diff --git a/dist/@foxdcg/react-select.js b/dist/@foxdcg/react-select.js index 10dfedc942..1415c116bf 100644 --- a/dist/@foxdcg/react-select.js +++ b/dist/@foxdcg/react-select.js @@ -1,7652 +1,7232 @@ (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.Select = 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 capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { - queue[scan] = queue[scan + index]; +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(); } - queue.length -= index; - index = 0; } + queueIndex = -1; + len = queue.length; } - queue.length = 0; - index = 0; - flushing = false; + currentQueue = null; + draining = false; + runClearTimeout(timeout); } -// `requestFlush` is implemented using a strategy based on data collected from -// every available SauceLabs Selenium web driver worker at time of writing. -// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 - -// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that -// have WebKitMutationObserver but not un-prefixed MutationObserver. -// Must use `global` or `self` instead of `window` to work in both frames and web -// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. +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); + } +}; -/* globals self */ -var scope = typeof global !== "undefined" ? global : self; -var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; - -// MutationObservers are desirable because they have high priority and work -// reliably everywhere they are implemented. -// They are implemented in all modern browsers. -// -// - Android 4-4.3 -// - Chrome 26-34 -// - Firefox 14-29 -// - Internet Explorer 11 -// - iPad Safari 6-7.1 -// - iPhone Safari 7-7.1 -// - Safari 6-7 -if (typeof BrowserMutationObserver === "function") { - requestFlush = makeRequestCallFromMutationObserver(flush); - -// MessageChannels are desirable because they give direct access to the HTML -// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera -// 11-12, and in web workers in many engines. -// Although message channels yield to any queued rendering and IO tasks, they -// would be better than imposing the 4ms delay of timers. -// However, they do not work reliably in Internet Explorer or Safari. - -// Internet Explorer 10 is the only browser that has setImmediate but does -// not have MutationObservers. -// Although setImmediate yields to the browser's renderer, it would be -// preferrable to falling back to setTimeout since it does not have -// the minimum 4ms penalty. -// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and -// Desktop to a lesser extent) that renders both setImmediate and -// MessageChannel useless for the purposes of ASAP. -// https://github.com/kriskowal/q/issues/396 - -// Timers are implemented universally. -// We fall back to timers in workers in most engines, and in foreground -// contexts in the following browsers. -// However, note that even this simple case requires nuances to operate in a -// broad spectrum of browsers. -// -// - Firefox 3-13 -// - Internet Explorer 6-9 -// - iPad Safari 4.3 -// - Lynx 2.8.7 -} else { - requestFlush = makeRequestCallFromTimer(flush); -} - -// `requestFlush` requests that the high priority event queue be flushed as -// soon as possible. -// This is useful to prevent an error thrown in a task from stalling the event -// queue if the exception handled by Node.js’s -// `process.on("uncaughtException")` or by a domain. -rawAsap.requestFlush = requestFlush; - -// To request a high priority event, we induce a mutation observer by toggling -// the text of a text node between "1" and "-1". -function makeRequestCallFromMutationObserver(callback) { - var toggle = 1; - var observer = new BrowserMutationObserver(callback); - var node = document.createTextNode(""); - observer.observe(node, {characterData: true}); - return function requestCall() { - toggle = -toggle; - node.data = toggle; - }; +// 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 = {}; -// The message channel technique was discovered by Malte Ubl and was the -// original foundation for this library. -// http://www.nonblocking.io/2011/06/windownexttick.html - -// Safari 6.0.5 (at least) intermittently fails to create message ports on a -// page's first load. Thankfully, this version of Safari supports -// MutationObservers, so we don't need to fall back in that case. +function noop() {} -// function makeRequestCallFromMessageChannel(callback) { -// var channel = new MessageChannel(); -// channel.port1.onmessage = callback; -// return function requestCall() { -// channel.port2.postMessage(0); -// }; -// } +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; -// For reasons explained above, we are also unable to use `setImmediate` -// under any circumstances. -// Even if we were, there is another bug in Internet Explorer 10. -// It is not sufficient to assign `setImmediate` to `requestFlush` because -// `setImmediate` must be called *by name* and therefore must be wrapped in a -// closure. -// Never forget. +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; -// function makeRequestCallFromSetImmediate(callback) { -// return function requestCall() { -// setImmediate(callback); -// }; -// } +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; -// Safari 6.0 has a problem where timers will get lost while the user is -// scrolling. This problem does not impact ASAP because Safari 6.0 supports -// mutation observers, so that implementation is used instead. -// However, if we ever elect to use timers in Safari, the prevalent work-around -// is to add a scroll event listener that calls for a flush. +},{}],2:[function(require,module,exports){ +'use strict'; -// `setTimeout` does not call the passed callback if the delay is less than -// approximately 7 in web workers in Firefox 8 through 18, and sometimes not -// even then. +exports.__esModule = true; -function makeRequestCallFromTimer(callback) { - return function requestCall() { - // We dispatch a timeout with a specified delay of 0 for engines that - // can reliably accommodate that request. This will usually be snapped - // to a 4 milisecond delay, but once we're flushing, there's no delay - // between events. - var timeoutHandle = setTimeout(handleTimer, 0); - // However, since this timer gets frequently dropped in Firefox - // workers, we enlist an interval handle that will try to fire - // an event 20 times per second until it succeeds. - var intervalHandle = setInterval(handleTimer, 50); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - function handleTimer() { - // Whichever timer succeeds will cancel both timers and - // execute the callback. - clearTimeout(timeoutHandle); - clearInterval(intervalHandle); - callback(); - } - }; -} +var _lodashMemoize = require('lodash/memoize'); -// This is for `asap.js` only. -// Its name will be periodically randomized to break any code that depends on -// its existence. -rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; +var _lodashMemoize2 = _interopRequireDefault(_lodashMemoize); -// ASAP was originally a nextTick shim included in Q. This was factored out -// into this ASAP package. It was later adapted to RSVP which made further -// amendments. These decisions, particularly to marginalize MessageChannel and -// to capture the MutationObserver implementation in a closure, were integrated -// back into ASAP proper. -// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js +var isFirefox = _lodashMemoize2['default'](function () { + return (/firefox/i.test(navigator.userAgent) + ); +}); -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],3:[function(require,module,exports){ +exports.isFirefox = isFirefox; +var isSafari = _lodashMemoize2['default'](function () { + return Boolean(window.safari); +}); +exports.isSafari = isSafari; +},{"lodash/memoize":105}],3:[function(require,module,exports){ 'use strict'; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - exports.__esModule = true; -var _isDisposable = require('./isDisposable'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _isDisposable2 = _interopRequireWildcard(_isDisposable); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -/** - * Represents a group of disposable resources that are disposed together. - */ +var _lodashUnion = require('lodash/union'); -var CompositeDisposable = (function () { - function CompositeDisposable() { - for (var _len = arguments.length, disposables = Array(_len), _key = 0; _key < _len; _key++) { - disposables[_key] = arguments[_key]; - } +var _lodashUnion2 = _interopRequireDefault(_lodashUnion); - _classCallCheck(this, CompositeDisposable); +var _lodashWithout = require('lodash/without'); - if (Array.isArray(disposables[0]) && disposables.length === 1) { - disposables = disposables[0]; - } +var _lodashWithout2 = _interopRequireDefault(_lodashWithout); - for (var i = 0; i < disposables.length; i++) { - if (!_isDisposable2['default'](disposables[i])) { - throw new Error('Expected a disposable'); - } - } +var EnterLeaveCounter = (function () { + function EnterLeaveCounter() { + _classCallCheck(this, EnterLeaveCounter); - this.disposables = disposables; - this.isDisposed = false; + this.entered = []; } - /** - * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. - * @param {Disposable} item Disposable to add. - */ + EnterLeaveCounter.prototype.enter = function enter(enteringNode) { + var previousLength = this.entered.length; - CompositeDisposable.prototype.add = function add(item) { - if (this.isDisposed) { - item.dispose(); - } else { - this.disposables.push(item); - } + this.entered = _lodashUnion2['default'](this.entered.filter(function (node) { + return document.documentElement.contains(node) && (!node.contains || node.contains(enteringNode)); + }), [enteringNode]); + + return previousLength === 0 && this.entered.length > 0; }; - /** - * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. - * @param {Disposable} item Disposable to remove. - * @returns {Boolean} true if found; false otherwise. - */ + EnterLeaveCounter.prototype.leave = function leave(leavingNode) { + var previousLength = this.entered.length; - CompositeDisposable.prototype.remove = function remove(item) { - if (this.isDisposed) { - return false; - } + this.entered = _lodashWithout2['default'](this.entered.filter(function (node) { + return document.documentElement.contains(node); + }), leavingNode); - var index = this.disposables.indexOf(item); - if (index === -1) { - return false; - } + return previousLength > 0 && this.entered.length === 0; + }; - this.disposables.splice(index, 1); - item.dispose(); - return true; + EnterLeaveCounter.prototype.reset = function reset() { + this.entered = []; }; - /** - * Disposes all disposables in the group and removes them from the group. - */ + return EnterLeaveCounter; +})(); - CompositeDisposable.prototype.dispose = function dispose() { - if (this.isDisposed) { - return; - } - - var len = this.disposables.length; - var currentDisposables = new Array(len); - for (var i = 0; i < len; i++) { - currentDisposables[i] = this.disposables[i]; - } - - this.isDisposed = true; - this.disposables = []; - this.length = 0; - - for (var i = 0; i < len; i++) { - currentDisposables[i].dispose(); - } - }; - - return CompositeDisposable; -})(); - -exports['default'] = CompositeDisposable; +exports['default'] = EnterLeaveCounter; module.exports = exports['default']; -},{"./isDisposable":7}],4:[function(require,module,exports){ -"use strict"; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -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; }; })(); +},{"lodash/union":108,"lodash/without":109}],4:[function(require,module,exports){ +'use strict'; exports.__esModule = true; -var noop = function noop() {}; - -/** - * The basic disposable. - */ - -var Disposable = (function () { - function Disposable(action) { - _classCallCheck(this, Disposable); - - this.isDisposed = false; - this.action = action || noop; - } - Disposable.prototype.dispose = function dispose() { - if (!this.isDisposed) { - this.action.call(null); - this.isDisposed = true; - } - }; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } - _createClass(Disposable, null, [{ - key: "empty", - enumerable: true, - value: { dispose: noop } - }]); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - return Disposable; -})(); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -exports["default"] = Disposable; -module.exports = exports["default"]; -},{}],5:[function(require,module,exports){ -'use strict'; +var _lodashDefaults = require('lodash/defaults'); -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; +var _lodashDefaults2 = _interopRequireDefault(_lodashDefaults); -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; +var _shallowEqual = require('./shallowEqual'); -exports.__esModule = true; +var _shallowEqual2 = _interopRequireDefault(_shallowEqual); -var _isDisposable = require('./isDisposable'); +var _EnterLeaveCounter = require('./EnterLeaveCounter'); -var _isDisposable2 = _interopRequireWildcard(_isDisposable); +var _EnterLeaveCounter2 = _interopRequireDefault(_EnterLeaveCounter); -var SerialDisposable = (function () { - function SerialDisposable() { - _classCallCheck(this, SerialDisposable); +var _BrowserDetector = require('./BrowserDetector'); - this.isDisposed = false; - this.current = null; - } +var _OffsetUtils = require('./OffsetUtils'); - /** - * Gets the underlying disposable. - * @return The underlying disposable. - */ +var _NativeDragSources = require('./NativeDragSources'); - SerialDisposable.prototype.getDisposable = function getDisposable() { - return this.current; - }; +var _NativeTypes = require('./NativeTypes'); - /** - * Sets the underlying disposable. - * @param {Disposable} value The new underlying disposable. - */ +var NativeTypes = _interopRequireWildcard(_NativeTypes); - SerialDisposable.prototype.setDisposable = function setDisposable() { - var value = arguments[0] === undefined ? null : arguments[0]; +var HTML5Backend = (function () { + function HTML5Backend(manager) { + _classCallCheck(this, HTML5Backend); - if (value != null && !_isDisposable2['default'](value)) { - throw new Error('Expected either an empty value or a valid disposable'); - } + this.actions = manager.getActions(); + this.monitor = manager.getMonitor(); + this.registry = manager.getRegistry(); - var isDisposed = this.isDisposed; - var previous = undefined; + this.sourcePreviewNodes = {}; + this.sourcePreviewNodeOptions = {}; + this.sourceNodes = {}; + this.sourceNodeOptions = {}; + this.enterLeaveCounter = new _EnterLeaveCounter2['default'](); - if (!isDisposed) { - previous = this.current; - this.current = value; - } + this.getSourceClientOffset = this.getSourceClientOffset.bind(this); + this.handleTopDragStart = this.handleTopDragStart.bind(this); + this.handleTopDragStartCapture = this.handleTopDragStartCapture.bind(this); + this.handleTopDragEndCapture = this.handleTopDragEndCapture.bind(this); + this.handleTopDragEnter = this.handleTopDragEnter.bind(this); + this.handleTopDragEnterCapture = this.handleTopDragEnterCapture.bind(this); + this.handleTopDragLeaveCapture = this.handleTopDragLeaveCapture.bind(this); + this.handleTopDragOver = this.handleTopDragOver.bind(this); + this.handleTopDragOverCapture = this.handleTopDragOverCapture.bind(this); + this.handleTopDrop = this.handleTopDrop.bind(this); + this.handleTopDropCapture = this.handleTopDropCapture.bind(this); + this.handleSelectStart = this.handleSelectStart.bind(this); + this.endDragIfSourceWasRemovedFromDOM = this.endDragIfSourceWasRemovedFromDOM.bind(this); + this.endDragNativeItem = this.endDragNativeItem.bind(this); + } - if (previous) { - previous.dispose(); + HTML5Backend.prototype.setup = function setup() { + if (typeof window === 'undefined') { + return; } - if (isDisposed && value) { - value.dispose(); + if (this.constructor.isSetUp) { + throw new Error('Cannot have two HTML5 backends at the same time.'); } + this.constructor.isSetUp = true; + this.addEventListeners(window); }; - /** - * Disposes the underlying disposable as well as all future replacements. - */ - - SerialDisposable.prototype.dispose = function dispose() { - if (this.isDisposed) { + HTML5Backend.prototype.teardown = function teardown() { + if (typeof window === 'undefined') { return; } - this.isDisposed = true; - var previous = this.current; - this.current = null; + this.constructor.isSetUp = false; + this.removeEventListeners(window); + this.clearCurrentDragSourceNode(); + }; - if (previous) { - previous.dispose(); - } + HTML5Backend.prototype.addEventListeners = function addEventListeners(target) { + target.addEventListener('dragstart', this.handleTopDragStart); + target.addEventListener('dragstart', this.handleTopDragStartCapture, true); + target.addEventListener('dragend', this.handleTopDragEndCapture, true); + target.addEventListener('dragenter', this.handleTopDragEnter); + target.addEventListener('dragenter', this.handleTopDragEnterCapture, true); + target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true); + target.addEventListener('dragover', this.handleTopDragOver); + target.addEventListener('dragover', this.handleTopDragOverCapture, true); + target.addEventListener('drop', this.handleTopDrop); + target.addEventListener('drop', this.handleTopDropCapture, true); }; - return SerialDisposable; -})(); + HTML5Backend.prototype.removeEventListeners = function removeEventListeners(target) { + target.removeEventListener('dragstart', this.handleTopDragStart); + target.removeEventListener('dragstart', this.handleTopDragStartCapture, true); + target.removeEventListener('dragend', this.handleTopDragEndCapture, true); + target.removeEventListener('dragenter', this.handleTopDragEnter); + target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true); + target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true); + target.removeEventListener('dragover', this.handleTopDragOver); + target.removeEventListener('dragover', this.handleTopDragOverCapture, true); + target.removeEventListener('drop', this.handleTopDrop); + target.removeEventListener('drop', this.handleTopDropCapture, true); + }; -exports['default'] = SerialDisposable; -module.exports = exports['default']; -},{"./isDisposable":7}],6:[function(require,module,exports){ -'use strict'; + HTML5Backend.prototype.connectDragPreview = function connectDragPreview(sourceId, node, options) { + var _this = this; -var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + this.sourcePreviewNodeOptions[sourceId] = options; + this.sourcePreviewNodes[sourceId] = node; -exports.__esModule = true; + return function () { + delete _this.sourcePreviewNodes[sourceId]; + delete _this.sourcePreviewNodeOptions[sourceId]; + }; + }; -var _isDisposable2 = require('./isDisposable'); + HTML5Backend.prototype.connectDragSource = function connectDragSource(sourceId, node, options) { + var _this2 = this; -var _isDisposable3 = _interopRequireWildcard(_isDisposable2); + this.sourceNodes[sourceId] = node; + this.sourceNodeOptions[sourceId] = options; -exports.isDisposable = _isDisposable3['default']; + var handleDragStart = function handleDragStart(e) { + return _this2.handleDragStart(e, sourceId); + }; + var handleSelectStart = function handleSelectStart(e) { + return _this2.handleSelectStart(e, sourceId); + }; -var _Disposable2 = require('./Disposable'); + node.setAttribute('draggable', true); + node.addEventListener('dragstart', handleDragStart); + node.addEventListener('selectstart', handleSelectStart); -var _Disposable3 = _interopRequireWildcard(_Disposable2); + return function () { + delete _this2.sourceNodes[sourceId]; + delete _this2.sourceNodeOptions[sourceId]; -exports.Disposable = _Disposable3['default']; + node.removeEventListener('dragstart', handleDragStart); + node.removeEventListener('selectstart', handleSelectStart); + node.setAttribute('draggable', false); + }; + }; -var _CompositeDisposable2 = require('./CompositeDisposable'); + HTML5Backend.prototype.connectDropTarget = function connectDropTarget(targetId, node) { + var _this3 = this; -var _CompositeDisposable3 = _interopRequireWildcard(_CompositeDisposable2); + var handleDragEnter = function handleDragEnter(e) { + return _this3.handleDragEnter(e, targetId); + }; + var handleDragOver = function handleDragOver(e) { + return _this3.handleDragOver(e, targetId); + }; + var handleDrop = function handleDrop(e) { + return _this3.handleDrop(e, targetId); + }; -exports.CompositeDisposable = _CompositeDisposable3['default']; + node.addEventListener('dragenter', handleDragEnter); + node.addEventListener('dragover', handleDragOver); + node.addEventListener('drop', handleDrop); -var _SerialDisposable2 = require('./SerialDisposable'); + return function () { + node.removeEventListener('dragenter', handleDragEnter); + node.removeEventListener('dragover', handleDragOver); + node.removeEventListener('drop', handleDrop); + }; + }; -var _SerialDisposable3 = _interopRequireWildcard(_SerialDisposable2); + HTML5Backend.prototype.getCurrentSourceNodeOptions = function getCurrentSourceNodeOptions() { + var sourceId = this.monitor.getSourceId(); + var sourceNodeOptions = this.sourceNodeOptions[sourceId]; -exports.SerialDisposable = _SerialDisposable3['default']; -},{"./CompositeDisposable":3,"./Disposable":4,"./SerialDisposable":5,"./isDisposable":7}],7:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports['default'] = isDisposable; - -function isDisposable(obj) { - return Boolean(obj && typeof obj.dispose === 'function'); -} - -module.exports = exports['default']; -},{}],8:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } - -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'); } } - -var _reduxLibCreateStore = require('redux/lib/createStore'); - -var _reduxLibCreateStore2 = _interopRequireDefault(_reduxLibCreateStore); - -var _reducers = require('./reducers'); - -var _reducers2 = _interopRequireDefault(_reducers); - -var _actionsDragDrop = require('./actions/dragDrop'); - -var dragDropActions = _interopRequireWildcard(_actionsDragDrop); + return _lodashDefaults2['default'](sourceNodeOptions || {}, { + dropEffect: 'move' + }); + }; -var _DragDropMonitor = require('./DragDropMonitor'); + HTML5Backend.prototype.getCurrentDropEffect = function getCurrentDropEffect() { + if (this.isDraggingNativeItem()) { + // It makes more sense to default to 'copy' for native resources + return 'copy'; + } -var _DragDropMonitor2 = _interopRequireDefault(_DragDropMonitor); + return this.getCurrentSourceNodeOptions().dropEffect; + }; -var _HandlerRegistry = require('./HandlerRegistry'); + HTML5Backend.prototype.getCurrentSourcePreviewNodeOptions = function getCurrentSourcePreviewNodeOptions() { + var sourceId = this.monitor.getSourceId(); + var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions[sourceId]; -var _HandlerRegistry2 = _interopRequireDefault(_HandlerRegistry); + return _lodashDefaults2['default'](sourcePreviewNodeOptions || {}, { + anchorX: 0.5, + anchorY: 0.5, + captureDraggingState: false + }); + }; -var DragDropManager = (function () { - function DragDropManager(createBackend) { - _classCallCheck(this, DragDropManager); + HTML5Backend.prototype.getSourceClientOffset = function getSourceClientOffset(sourceId) { + return _OffsetUtils.getNodeClientOffset(this.sourceNodes[sourceId]); + }; - var store = _reduxLibCreateStore2['default'](_reducers2['default']); + HTML5Backend.prototype.isDraggingNativeItem = function isDraggingNativeItem() { + var itemType = this.monitor.getItemType(); + return Object.keys(NativeTypes).some(function (key) { + return NativeTypes[key] === itemType; + }); + }; - this.store = store; - this.monitor = new _DragDropMonitor2['default'](store); - this.registry = this.monitor.registry; - this.backend = createBackend(this); + HTML5Backend.prototype.beginDragNativeItem = function beginDragNativeItem(type) { + this.clearCurrentDragSourceNode(); - store.subscribe(this.handleRefCountChange.bind(this)); - } + var SourceType = _NativeDragSources.createNativeDragSource(type); + this.currentNativeSource = new SourceType(); + this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource); + this.actions.beginDrag([this.currentNativeHandle]); - DragDropManager.prototype.handleRefCountChange = function handleRefCountChange() { - var shouldSetUp = this.store.getState().refCount > 0; - if (shouldSetUp && !this.isSetUp) { - this.backend.setup(); - this.isSetUp = true; - } else if (!shouldSetUp && this.isSetUp) { - this.backend.teardown(); - this.isSetUp = false; + // On Firefox, if mousemove fires, the drag is over but browser failed to tell us. + // This is not true for other browsers. + if (_BrowserDetector.isFirefox()) { + window.addEventListener('mousemove', this.endDragNativeItem, true); } }; - DragDropManager.prototype.getMonitor = function getMonitor() { - return this.monitor; - }; + HTML5Backend.prototype.endDragNativeItem = function endDragNativeItem() { + if (!this.isDraggingNativeItem()) { + return; + } - DragDropManager.prototype.getBackend = function getBackend() { - return this.backend; - }; + if (_BrowserDetector.isFirefox()) { + window.removeEventListener('mousemove', this.endDragNativeItem, true); + } - DragDropManager.prototype.getRegistry = function getRegistry() { - return this.registry; + this.actions.endDrag(); + this.registry.removeSource(this.currentNativeHandle); + this.currentNativeHandle = null; + this.currentNativeSource = null; }; - DragDropManager.prototype.getActions = function getActions() { - var manager = this; - var dispatch = this.store.dispatch; - - function bindActionCreator(actionCreator) { - return function () { - var action = actionCreator.apply(manager, arguments); - if (typeof action !== 'undefined') { - dispatch(action); - } - }; + HTML5Backend.prototype.endDragIfSourceWasRemovedFromDOM = function endDragIfSourceWasRemovedFromDOM() { + var node = this.currentDragSourceNode; + if (document.body.contains(node)) { + return; } - return Object.keys(dragDropActions).filter(function (key) { - return typeof dragDropActions[key] === 'function'; - }).reduce(function (boundActions, key) { - boundActions[key] = bindActionCreator(dragDropActions[key]); - return boundActions; - }, {}); + if (this.clearCurrentDragSourceNode()) { + this.actions.endDrag(); + } }; - return DragDropManager; -})(); + HTML5Backend.prototype.setCurrentDragSourceNode = function setCurrentDragSourceNode(node) { + this.clearCurrentDragSourceNode(); + this.currentDragSourceNode = node; + this.currentDragSourceNodeOffset = _OffsetUtils.getNodeClientOffset(node); + this.currentDragSourceNodeOffsetChanged = false; -exports['default'] = DragDropManager; -module.exports = exports['default']; -},{"./DragDropMonitor":9,"./HandlerRegistry":12,"./actions/dragDrop":13,"./reducers":20,"redux/lib/createStore":249}],9:[function(require,module,exports){ -'use strict'; + // Receiving a mouse event in the middle of a dragging operation + // means it has ended and the drag source node disappeared from DOM, + // so the browser didn't dispatch the dragend event. + window.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true); + }; -exports.__esModule = true; + HTML5Backend.prototype.clearCurrentDragSourceNode = function clearCurrentDragSourceNode() { + if (this.currentDragSourceNode) { + this.currentDragSourceNode = null; + this.currentDragSourceNodeOffset = null; + this.currentDragSourceNodeOffsetChanged = false; + window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true); + return true; + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + return false; + }; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + HTML5Backend.prototype.checkIfCurrentDragSourceRectChanged = function checkIfCurrentDragSourceRectChanged() { + var node = this.currentDragSourceNode; + if (!node) { + return false; + } -var _invariant = require('invariant'); + if (this.currentDragSourceNodeOffsetChanged) { + return true; + } -var _invariant2 = _interopRequireDefault(_invariant); + this.currentDragSourceNodeOffsetChanged = !_shallowEqual2['default'](_OffsetUtils.getNodeClientOffset(node), this.currentDragSourceNodeOffset); -var _utilsMatchesType = require('./utils/matchesType'); + return this.currentDragSourceNodeOffsetChanged; + }; -var _utilsMatchesType2 = _interopRequireDefault(_utilsMatchesType); + HTML5Backend.prototype.handleTopDragStartCapture = function handleTopDragStartCapture() { + this.clearCurrentDragSourceNode(); + this.dragStartSourceIds = []; + }; -var _lodashIsArray = require('lodash/isArray'); + HTML5Backend.prototype.handleDragStart = function handleDragStart(e, sourceId) { + this.dragStartSourceIds.unshift(sourceId); + }; -var _lodashIsArray2 = _interopRequireDefault(_lodashIsArray); + HTML5Backend.prototype.handleTopDragStart = function handleTopDragStart(e) { + var _this4 = this; -var _HandlerRegistry = require('./HandlerRegistry'); + var dragStartSourceIds = this.dragStartSourceIds; -var _HandlerRegistry2 = _interopRequireDefault(_HandlerRegistry); + this.dragStartSourceIds = null; -var _reducersDragOffset = require('./reducers/dragOffset'); + var clientOffset = _OffsetUtils.getEventClientOffset(e); -var _reducersDirtyHandlerIds = require('./reducers/dirtyHandlerIds'); + // Don't publish the source just yet (see why below) + this.actions.beginDrag(dragStartSourceIds, { + publishSource: false, + getSourceClientOffset: this.getSourceClientOffset, + clientOffset: clientOffset + }); -var DragDropMonitor = (function () { - function DragDropMonitor(store) { - _classCallCheck(this, DragDropMonitor); + var dataTransfer = e.dataTransfer; - this.store = store; - this.registry = new _HandlerRegistry2['default'](store); - } + var nativeType = _NativeDragSources.matchNativeItemType(dataTransfer); - DragDropMonitor.prototype.subscribeToStateChange = function subscribeToStateChange(listener) { - var _this = this; + if (this.monitor.isDragging()) { + if (typeof dataTransfer.setDragImage === 'function') { + // Use custom drag image if user specifies it. + // If child drag source refuses drag but parent agrees, + // use parent's node as drag image. Neither works in IE though. + var sourceId = this.monitor.getSourceId(); + var sourceNode = this.sourceNodes[sourceId]; + var dragPreview = this.sourcePreviewNodes[sourceId] || sourceNode; - var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + var _getCurrentSourcePreviewNodeOptions = this.getCurrentSourcePreviewNodeOptions(); - var handlerIds = _ref.handlerIds; + var anchorX = _getCurrentSourcePreviewNodeOptions.anchorX; + var anchorY = _getCurrentSourcePreviewNodeOptions.anchorY; - _invariant2['default'](typeof listener === 'function', 'listener must be a function.'); - _invariant2['default'](typeof handlerIds === 'undefined' || _lodashIsArray2['default'](handlerIds), 'handlerIds, when specified, must be an array of strings.'); + var anchorPoint = { anchorX: anchorX, anchorY: anchorY }; + var dragPreviewOffset = _OffsetUtils.getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint); + dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y); + } - var prevStateId = this.store.getState().stateId; - var handleChange = function handleChange() { - var state = _this.store.getState(); - var currentStateId = state.stateId; try { - var canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !_reducersDirtyHandlerIds.areDirty(state.dirtyHandlerIds, handlerIds); + // Firefox won't drag without setting data + dataTransfer.setData('application/json', {}); + } catch (err) {} + // IE doesn't support MIME types in setData - if (!canSkipListener) { - listener(); - } - } finally { - prevStateId = currentStateId; - } - }; + // Store drag source node so we can check whether + // it is removed from DOM and trigger endDrag manually. + this.setCurrentDragSourceNode(e.target); - return this.store.subscribe(handleChange); - }; + // Now we are ready to publish the drag source.. or are we not? - DragDropMonitor.prototype.subscribeToOffsetChange = function subscribeToOffsetChange(listener) { - var _this2 = this; + var _getCurrentSourcePreviewNodeOptions2 = this.getCurrentSourcePreviewNodeOptions(); - _invariant2['default'](typeof listener === 'function', 'listener must be a function.'); + var captureDraggingState = _getCurrentSourcePreviewNodeOptions2.captureDraggingState; - var previousState = this.store.getState().dragOffset; - var handleChange = function handleChange() { - var nextState = _this2.store.getState().dragOffset; - if (nextState === previousState) { - return; + if (!captureDraggingState) { + // Usually we want to publish it in the next tick so that browser + // is able to screenshot the current (not yet dragging) state. + // + // It also neatly avoids a situation where render() returns null + // in the same tick for the source element, and browser freaks out. + setTimeout(function () { + return _this4.actions.publishDragSource(); + }); + } else { + // In some cases the user may want to override this behavior, e.g. + // to work around IE not supporting custom drag previews. + // + // When using a custom drag layer, the only way to prevent + // the default drag preview from drawing in IE is to screenshot + // the dragging state in which the node itself has zero opacity + // and height. In this case, though, returning null from render() + // will abruptly end the dragging, which is not obvious. + // + // This is the reason such behavior is strictly opt-in. + this.actions.publishDragSource(); } + } else if (nativeType) { + // A native item (such as URL) dragged from inside the document + this.beginDragNativeItem(nativeType); + } else if (!dataTransfer.types && (!e.target.hasAttribute || !e.target.hasAttribute('draggable'))) { + // Looks like a Safari bug: dataTransfer.types is null, but there was no draggable. + // Just let it drag. It's a native type (URL or text) and will be picked up in dragenter handler. + return; + } else { + // If by this time no drag source reacted, tell browser not to drag. + e.preventDefault(); + } + }; - previousState = nextState; - listener(); - }; - - return this.store.subscribe(handleChange); + HTML5Backend.prototype.handleTopDragEndCapture = function handleTopDragEndCapture() { + if (this.clearCurrentDragSourceNode()) { + // Firefox can dispatch this event in an infinite loop + // if dragend handler does something like showing an alert. + // Only proceed if we have not handled it already. + this.actions.endDrag(); + } }; - DragDropMonitor.prototype.canDragSource = function canDragSource(sourceId) { - var source = this.registry.getSource(sourceId); - _invariant2['default'](source, 'Expected to find a valid source.'); + HTML5Backend.prototype.handleTopDragEnterCapture = function handleTopDragEnterCapture(e) { + this.dragEnterTargetIds = []; - if (this.isDragging()) { - return false; + var isFirstEnter = this.enterLeaveCounter.enter(e.target); + if (!isFirstEnter || this.monitor.isDragging()) { + return; } - return source.canDrag(this, sourceId); - }; + var dataTransfer = e.dataTransfer; - DragDropMonitor.prototype.canDropOnTarget = function canDropOnTarget(targetId) { - var target = this.registry.getTarget(targetId); - _invariant2['default'](target, 'Expected to find a valid target.'); + var nativeType = _NativeDragSources.matchNativeItemType(dataTransfer); - if (!this.isDragging() || this.didDrop()) { - return false; + if (nativeType) { + // A native item (such as file or URL) dragged from outside the document + this.beginDragNativeItem(nativeType); } - - var targetType = this.registry.getTargetType(targetId); - var draggedItemType = this.getItemType(); - return _utilsMatchesType2['default'](targetType, draggedItemType) && target.canDrop(this, targetId); }; - DragDropMonitor.prototype.isDragging = function isDragging() { - return Boolean(this.getItemType()); + HTML5Backend.prototype.handleDragEnter = function handleDragEnter(e, targetId) { + this.dragEnterTargetIds.unshift(targetId); }; - DragDropMonitor.prototype.isDraggingSource = function isDraggingSource(sourceId) { - var source = this.registry.getSource(sourceId, true); - _invariant2['default'](source, 'Expected to find a valid source.'); + HTML5Backend.prototype.handleTopDragEnter = function handleTopDragEnter(e) { + var _this5 = this; + + var dragEnterTargetIds = this.dragEnterTargetIds; - if (!this.isDragging() || !this.isSourcePublic()) { - return false; + this.dragEnterTargetIds = []; + + if (!this.monitor.isDragging()) { + // This is probably a native item type we don't understand. + return; } - var sourceType = this.registry.getSourceType(sourceId); - var draggedItemType = this.getItemType(); - if (sourceType !== draggedItemType) { - return false; + if (!_BrowserDetector.isFirefox()) { + // Don't emit hover in `dragenter` on Firefox due to an edge case. + // If the target changes position as the result of `dragenter`, Firefox + // will still happily dispatch `dragover` despite target being no longer + // there. The easy solution is to only fire `hover` in `dragover` on FF. + this.actions.hover(dragEnterTargetIds, { + clientOffset: _OffsetUtils.getEventClientOffset(e) + }); + } + + var canDrop = dragEnterTargetIds.some(function (targetId) { + return _this5.monitor.canDropOnTarget(targetId); + }); + + if (canDrop) { + // IE requires this to fire dragover events + e.preventDefault(); + e.dataTransfer.dropEffect = this.getCurrentDropEffect(); } + }; - return source.isDragging(this, sourceId); + HTML5Backend.prototype.handleTopDragOverCapture = function handleTopDragOverCapture() { + this.dragOverTargetIds = []; }; - DragDropMonitor.prototype.isOverTarget = function isOverTarget(targetId) { - var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + HTML5Backend.prototype.handleDragOver = function handleDragOver(e, targetId) { + this.dragOverTargetIds.unshift(targetId); + }; - var _ref2$shallow = _ref2.shallow; - var shallow = _ref2$shallow === undefined ? false : _ref2$shallow; + HTML5Backend.prototype.handleTopDragOver = function handleTopDragOver(e) { + var _this6 = this; - if (!this.isDragging()) { - return false; + var dragOverTargetIds = this.dragOverTargetIds; + + this.dragOverTargetIds = []; + + if (!this.monitor.isDragging()) { + // This is probably a native item type we don't understand. + // Prevent default "drop and blow away the whole document" action. + e.preventDefault(); + e.dataTransfer.dropEffect = 'none'; + return; } - var targetType = this.registry.getTargetType(targetId); - var draggedItemType = this.getItemType(); - if (!_utilsMatchesType2['default'](targetType, draggedItemType)) { - return false; + this.actions.hover(dragOverTargetIds, { + clientOffset: _OffsetUtils.getEventClientOffset(e) + }); + + var canDrop = dragOverTargetIds.some(function (targetId) { + return _this6.monitor.canDropOnTarget(targetId); + }); + + if (canDrop) { + // Show user-specified drop effect. + e.preventDefault(); + e.dataTransfer.dropEffect = this.getCurrentDropEffect(); + } else if (this.isDraggingNativeItem()) { + // Don't show a nice cursor but still prevent default + // "drop and blow away the whole document" action. + e.preventDefault(); + e.dataTransfer.dropEffect = 'none'; + } else if (this.checkIfCurrentDragSourceRectChanged()) { + // Prevent animating to incorrect position. + // Drop effect must be other than 'none' to prevent animation. + e.preventDefault(); + e.dataTransfer.dropEffect = 'move'; } + }; - var targetIds = this.getTargetIds(); - if (!targetIds.length) { - return false; + HTML5Backend.prototype.handleTopDragLeaveCapture = function handleTopDragLeaveCapture(e) { + if (this.isDraggingNativeItem()) { + e.preventDefault(); } - var index = targetIds.indexOf(targetId); - if (shallow) { - return index === targetIds.length - 1; - } else { - return index > -1; + var isLastLeave = this.enterLeaveCounter.leave(e.target); + if (!isLastLeave) { + return; } - }; - DragDropMonitor.prototype.getItemType = function getItemType() { - return this.store.getState().dragOperation.itemType; + if (this.isDraggingNativeItem()) { + this.endDragNativeItem(); + } }; - DragDropMonitor.prototype.getItem = function getItem() { - return this.store.getState().dragOperation.item; - }; + HTML5Backend.prototype.handleTopDropCapture = function handleTopDropCapture(e) { + this.dropTargetIds = []; + e.preventDefault(); - DragDropMonitor.prototype.getSourceId = function getSourceId() { - return this.store.getState().dragOperation.sourceId; - }; + if (this.isDraggingNativeItem()) { + this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer); + } - DragDropMonitor.prototype.getTargetIds = function getTargetIds() { - return this.store.getState().dragOperation.targetIds; + this.enterLeaveCounter.reset(); }; - DragDropMonitor.prototype.getDropResult = function getDropResult() { - return this.store.getState().dragOperation.dropResult; + HTML5Backend.prototype.handleDrop = function handleDrop(e, targetId) { + this.dropTargetIds.unshift(targetId); }; - DragDropMonitor.prototype.didDrop = function didDrop() { - return this.store.getState().dragOperation.didDrop; - }; + HTML5Backend.prototype.handleTopDrop = function handleTopDrop(e) { + var dropTargetIds = this.dropTargetIds; - DragDropMonitor.prototype.isSourcePublic = function isSourcePublic() { - return this.store.getState().dragOperation.isSourcePublic; - }; + this.dropTargetIds = []; - DragDropMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() { - return this.store.getState().dragOffset.initialClientOffset; - }; + this.actions.hover(dropTargetIds, { + clientOffset: _OffsetUtils.getEventClientOffset(e) + }); + this.actions.drop(); - DragDropMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() { - return this.store.getState().dragOffset.initialSourceClientOffset; + if (this.isDraggingNativeItem()) { + this.endDragNativeItem(); + } else { + this.endDragIfSourceWasRemovedFromDOM(); + } }; - DragDropMonitor.prototype.getClientOffset = function getClientOffset() { - return this.store.getState().dragOffset.clientOffset; - }; + HTML5Backend.prototype.handleSelectStart = function handleSelectStart(e) { + var target = e.target; - DragDropMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() { - return _reducersDragOffset.getSourceClientOffset(this.store.getState().dragOffset); - }; + // Only IE requires us to explicitly say + // we want drag drop operation to start + if (typeof target.dragDrop !== 'function') { + return; + } + + // Inputs and textareas should be selectable + if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { + return; + } - DragDropMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() { - return _reducersDragOffset.getDifferenceFromInitialOffset(this.store.getState().dragOffset); + // For other targets, ask IE + // to enable drag and drop + e.preventDefault(); + target.dragDrop(); }; - return DragDropMonitor; + return HTML5Backend; })(); -exports['default'] = DragDropMonitor; +exports['default'] = HTML5Backend; module.exports = exports['default']; -},{"./HandlerRegistry":12,"./reducers/dirtyHandlerIds":17,"./reducers/dragOffset":18,"./utils/matchesType":24,"invariant":107,"lodash/isArray":97}],10:[function(require,module,exports){ +},{"./BrowserDetector":2,"./EnterLeaveCounter":3,"./NativeDragSources":6,"./NativeTypes":7,"./OffsetUtils":8,"./shallowEqual":11,"lodash/defaults":91}],5:[function(require,module,exports){ "use strict"; exports.__esModule = true; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var DragSource = (function () { - function DragSource() { - _classCallCheck(this, DragSource); - } - - DragSource.prototype.canDrag = function canDrag() { - return true; - }; - - DragSource.prototype.isDragging = function isDragging(monitor, handle) { - return handle === monitor.getSourceId(); - }; +var MonotonicInterpolant = (function () { + function MonotonicInterpolant(xs, ys) { + _classCallCheck(this, MonotonicInterpolant); - DragSource.prototype.endDrag = function endDrag() {}; + var length = xs.length; - return DragSource; -})(); + // Rearrange xs and ys so that xs is sorted + var indexes = []; + for (var i = 0; i < length; i++) { + indexes.push(i); + } + indexes.sort(function (a, b) { + return xs[a] < xs[b] ? -1 : 1; + }); -exports["default"] = DragSource; -module.exports = exports["default"]; -},{}],11:[function(require,module,exports){ -"use strict"; + // Get consecutive differences and slopes + var dys = []; + var dxs = []; + var ms = []; + var dx = undefined; + var dy = undefined; + for (var i = 0; i < length - 1; i++) { + dx = xs[i + 1] - xs[i]; + dy = ys[i + 1] - ys[i]; + dxs.push(dx); + dys.push(dy); + ms.push(dy / dx); + } -exports.__esModule = true; + // Get degree-1 coefficients + var c1s = [ms[0]]; + for (var i = 0; i < dxs.length - 1; i++) { + var _m = ms[i]; + var mNext = ms[i + 1]; + if (_m * mNext <= 0) { + c1s.push(0); + } else { + dx = dxs[i]; + var dxNext = dxs[i + 1]; + var common = dx + dxNext; + c1s.push(3 * common / ((common + dxNext) / _m + (common + dx) / mNext)); + } + } + c1s.push(ms[ms.length - 1]); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + // Get degree-2 and degree-3 coefficients + var c2s = []; + var c3s = []; + var m = undefined; + for (var i = 0; i < c1s.length - 1; i++) { + m = ms[i]; + var c1 = c1s[i]; + var invDx = 1 / dxs[i]; + var common = c1 + c1s[i + 1] - m - m; + c2s.push((m - c1 - common) * invDx); + c3s.push(common * invDx * invDx); + } -var DropTarget = (function () { - function DropTarget() { - _classCallCheck(this, DropTarget); + this.xs = xs; + this.ys = ys; + this.c1s = c1s; + this.c2s = c2s; + this.c3s = c3s; } - DropTarget.prototype.canDrop = function canDrop() { - return true; - }; + MonotonicInterpolant.prototype.interpolate = function interpolate(x) { + var xs = this.xs; + var ys = this.ys; + var c1s = this.c1s; + var c2s = this.c2s; + var c3s = this.c3s; + + // The rightmost point in the dataset should give an exact result + var i = xs.length - 1; + if (x === xs[i]) { + return ys[i]; + } - DropTarget.prototype.hover = function hover() {}; + // Search for the interval x is in, returning the corresponding y if x is one of the original xs + var low = 0; + var high = c3s.length - 1; + var mid = undefined; + while (low <= high) { + mid = Math.floor(0.5 * (low + high)); + var xHere = xs[mid]; + if (xHere < x) { + low = mid + 1; + } else if (xHere > x) { + high = mid - 1; + } else { + return ys[mid]; + } + } + i = Math.max(0, high); - DropTarget.prototype.drop = function drop() {}; + // Interpolate + var diff = x - xs[i]; + var diffSq = diff * diff; + return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq; + }; - return DropTarget; + return MonotonicInterpolant; })(); -exports["default"] = DropTarget; +exports["default"] = MonotonicInterpolant; module.exports = exports["default"]; -},{}],12:[function(require,module,exports){ +},{}],6:[function(require,module,exports){ 'use strict'; exports.__esModule = true; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _nativeTypesConfig; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } +exports.createNativeDragSource = createNativeDragSource; +exports.matchNativeItemType = matchNativeItemType; -function _typeof(obj) { return obj && obj.constructor === Symbol ? 'symbol' : typeof obj; } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } -var _invariant = require('invariant'); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -var _invariant2 = _interopRequireDefault(_invariant); +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; } -var _lodashIsArray = require('lodash/isArray'); - -var _lodashIsArray2 = _interopRequireDefault(_lodashIsArray); - -var _utilsGetNextUniqueId = require('./utils/getNextUniqueId'); - -var _utilsGetNextUniqueId2 = _interopRequireDefault(_utilsGetNextUniqueId); - -var _actionsRegistry = require('./actions/registry'); - -var _asap = require('asap'); - -var _asap2 = _interopRequireDefault(_asap); +var _NativeTypes = require('./NativeTypes'); -var HandlerRoles = { - SOURCE: 'SOURCE', - TARGET: 'TARGET' -}; +var NativeTypes = _interopRequireWildcard(_NativeTypes); -function validateSourceContract(source) { - _invariant2['default'](typeof source.canDrag === 'function', 'Expected canDrag to be a function.'); - _invariant2['default'](typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.'); - _invariant2['default'](typeof source.endDrag === 'function', 'Expected endDrag to be a function.'); -} +function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) { + var result = typesToTry.reduce(function (resultSoFar, typeToTry) { + return resultSoFar || dataTransfer.getData(typeToTry); + }, null); -function validateTargetContract(target) { - _invariant2['default'](typeof target.canDrop === 'function', 'Expected canDrop to be a function.'); - _invariant2['default'](typeof target.hover === 'function', 'Expected hover to be a function.'); - _invariant2['default'](typeof target.drop === 'function', 'Expected beginDrag to be a function.'); + return result != null ? // eslint-disable-line eqeqeq + result : defaultValue; } -function validateType(type, allowArray) { - if (allowArray && _lodashIsArray2['default'](type)) { - type.forEach(function (t) { - return validateType(t, false); - }); - return; +var nativeTypesConfig = (_nativeTypesConfig = {}, _defineProperty(_nativeTypesConfig, NativeTypes.FILE, { + exposeProperty: 'files', + matchesTypes: ['Files'], + getData: function getData(dataTransfer) { + return Array.prototype.slice.call(dataTransfer.files); } - - _invariant2['default'](typeof type === 'string' || (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'symbol', allowArray ? 'Type can only be a string, a symbol, or an array of either.' : 'Type can only be a string or a symbol.'); -} - -function getNextHandlerId(role) { - var id = _utilsGetNextUniqueId2['default']().toString(); - switch (role) { - case HandlerRoles.SOURCE: - return 'S' + id; - case HandlerRoles.TARGET: - return 'T' + id; - default: - _invariant2['default'](false, 'Unknown role: ' + role); +}), _defineProperty(_nativeTypesConfig, NativeTypes.URL, { + exposeProperty: 'urls', + matchesTypes: ['Url', 'text/uri-list'], + getData: function getData(dataTransfer, matchesTypes) { + return getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\n'); } -} - -function parseRoleFromHandlerId(handlerId) { - switch (handlerId[0]) { - case 'S': - return HandlerRoles.SOURCE; - case 'T': - return HandlerRoles.TARGET; - default: - _invariant2['default'](false, 'Cannot parse handler ID: ' + handlerId); +}), _defineProperty(_nativeTypesConfig, NativeTypes.TEXT, { + exposeProperty: 'text', + matchesTypes: ['Text', 'text/plain'], + getData: function getData(dataTransfer, matchesTypes) { + return getDataFromDataTransfer(dataTransfer, matchesTypes, ''); } -} +}), _nativeTypesConfig); -var HandlerRegistry = (function () { - function HandlerRegistry(store) { - _classCallCheck(this, HandlerRegistry); +function createNativeDragSource(type) { + var _nativeTypesConfig$type = nativeTypesConfig[type]; + var exposeProperty = _nativeTypesConfig$type.exposeProperty; + var matchesTypes = _nativeTypesConfig$type.matchesTypes; + var getData = _nativeTypesConfig$type.getData; - this.store = store; + return (function () { + function NativeDragSource() { + _classCallCheck(this, NativeDragSource); - this.types = {}; - this.handlers = {}; + this.item = Object.defineProperties({}, _defineProperty({}, exposeProperty, { + get: function get() { + console.warn( // eslint-disable-line no-console + 'Browser doesn\'t allow reading "' + exposeProperty + '" until the drop event.'); + return null; + }, + configurable: true, + enumerable: true + })); + } - this.pinnedSourceId = null; - this.pinnedSource = null; - } + NativeDragSource.prototype.mutateItemByReadingDataTransfer = function mutateItemByReadingDataTransfer(dataTransfer) { + delete this.item[exposeProperty]; + this.item[exposeProperty] = getData(dataTransfer, matchesTypes); + }; - HandlerRegistry.prototype.addSource = function addSource(type, source) { - validateType(type); - validateSourceContract(source); + NativeDragSource.prototype.canDrag = function canDrag() { + return true; + }; - var sourceId = this.addHandler(HandlerRoles.SOURCE, type, source); - this.store.dispatch(_actionsRegistry.addSource(sourceId)); - return sourceId; - }; + NativeDragSource.prototype.beginDrag = function beginDrag() { + return this.item; + }; - HandlerRegistry.prototype.addTarget = function addTarget(type, target) { - validateType(type, true); - validateTargetContract(target); + NativeDragSource.prototype.isDragging = function isDragging(monitor, handle) { + return handle === monitor.getSourceId(); + }; - var targetId = this.addHandler(HandlerRoles.TARGET, type, target); - this.store.dispatch(_actionsRegistry.addTarget(targetId)); - return targetId; - }; + NativeDragSource.prototype.endDrag = function endDrag() {}; - HandlerRegistry.prototype.addHandler = function addHandler(role, type, handler) { - var id = getNextHandlerId(role); - this.types[id] = type; - this.handlers[id] = handler; + return NativeDragSource; + })(); +} - return id; - }; +function matchNativeItemType(dataTransfer) { + var dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || []); - HandlerRegistry.prototype.containsHandler = function containsHandler(handler) { - var _this = this; + return Object.keys(nativeTypesConfig).filter(function (nativeItemType) { + var matchesTypes = nativeTypesConfig[nativeItemType].matchesTypes; - return Object.keys(this.handlers).some(function (key) { - return _this.handlers[key] === handler; + return matchesTypes.some(function (t) { + return dataTransferTypes.indexOf(t) > -1; }); - }; - - HandlerRegistry.prototype.getSource = function getSource(sourceId, includePinned) { - _invariant2['default'](this.isSourceId(sourceId), 'Expected a valid source ID.'); + })[0] || null; +} +},{"./NativeTypes":7}],7:[function(require,module,exports){ +'use strict'; - var isPinned = includePinned && sourceId === this.pinnedSourceId; - var source = isPinned ? this.pinnedSource : this.handlers[sourceId]; +exports.__esModule = true; +var FILE = '__NATIVE_FILE__'; +exports.FILE = FILE; +var URL = '__NATIVE_URL__'; +exports.URL = URL; +var TEXT = '__NATIVE_TEXT__'; +exports.TEXT = TEXT; +},{}],8:[function(require,module,exports){ +'use strict'; - return source; - }; +exports.__esModule = true; +exports.getNodeClientOffset = getNodeClientOffset; +exports.getEventClientOffset = getEventClientOffset; +exports.getDragPreviewOffset = getDragPreviewOffset; - HandlerRegistry.prototype.getTarget = function getTarget(targetId) { - _invariant2['default'](this.isTargetId(targetId), 'Expected a valid target ID.'); - return this.handlers[targetId]; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - HandlerRegistry.prototype.getSourceType = function getSourceType(sourceId) { - _invariant2['default'](this.isSourceId(sourceId), 'Expected a valid source ID.'); - return this.types[sourceId]; - }; +var _BrowserDetector = require('./BrowserDetector'); - HandlerRegistry.prototype.getTargetType = function getTargetType(targetId) { - _invariant2['default'](this.isTargetId(targetId), 'Expected a valid target ID.'); - return this.types[targetId]; - }; +var _MonotonicInterpolant = require('./MonotonicInterpolant'); - HandlerRegistry.prototype.isSourceId = function isSourceId(handlerId) { - var role = parseRoleFromHandlerId(handlerId); - return role === HandlerRoles.SOURCE; - }; +var _MonotonicInterpolant2 = _interopRequireDefault(_MonotonicInterpolant); - HandlerRegistry.prototype.isTargetId = function isTargetId(handlerId) { - var role = parseRoleFromHandlerId(handlerId); - return role === HandlerRoles.TARGET; - }; +var ELEMENT_NODE = 1; - HandlerRegistry.prototype.removeSource = function removeSource(sourceId) { - var _this2 = this; +function getNodeClientOffset(node) { + var el = node.nodeType === ELEMENT_NODE ? node : node.parentElement; - _invariant2['default'](this.getSource(sourceId), 'Expected an existing source.'); - this.store.dispatch(_actionsRegistry.removeSource(sourceId)); + if (!el) { + return null; + } - _asap2['default'](function () { - delete _this2.handlers[sourceId]; - delete _this2.types[sourceId]; - }); - }; + var _el$getBoundingClientRect = el.getBoundingClientRect(); - HandlerRegistry.prototype.removeTarget = function removeTarget(targetId) { - var _this3 = this; + var top = _el$getBoundingClientRect.top; + var left = _el$getBoundingClientRect.left; - _invariant2['default'](this.getTarget(targetId), 'Expected an existing target.'); - this.store.dispatch(_actionsRegistry.removeTarget(targetId)); + return { x: left, y: top }; +} - _asap2['default'](function () { - delete _this3.handlers[targetId]; - delete _this3.types[targetId]; - }); +function getEventClientOffset(e) { + return { + x: e.clientX, + y: e.clientY }; +} - HandlerRegistry.prototype.pinSource = function pinSource(sourceId) { - var source = this.getSource(sourceId); - _invariant2['default'](source, 'Expected an existing source.'); +function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint) { + // The browsers will use the image intrinsic size under different conditions. + // Firefox only cares if it's an image, but WebKit also wants it to be detached. + var isImage = dragPreview.nodeName === 'IMG' && (_BrowserDetector.isFirefox() || !document.documentElement.contains(dragPreview)); + var dragPreviewNode = isImage ? sourceNode : dragPreview; - this.pinnedSourceId = sourceId; - this.pinnedSource = source; + var dragPreviewNodeOffsetFromClient = getNodeClientOffset(dragPreviewNode); + var offsetFromDragPreview = { + x: clientOffset.x - dragPreviewNodeOffsetFromClient.x, + y: clientOffset.y - dragPreviewNodeOffsetFromClient.y }; - HandlerRegistry.prototype.unpinSource = function unpinSource() { - _invariant2['default'](this.pinnedSource, 'No source is pinned at the time.'); + var sourceWidth = sourceNode.offsetWidth; + var sourceHeight = sourceNode.offsetHeight; + var anchorX = anchorPoint.anchorX; + var anchorY = anchorPoint.anchorY; - this.pinnedSourceId = null; - this.pinnedSource = null; - }; + var dragPreviewWidth = isImage ? dragPreview.width : sourceWidth; + var dragPreviewHeight = isImage ? dragPreview.height : sourceHeight; - return HandlerRegistry; -})(); + // Work around @2x coordinate discrepancies in browsers + if (_BrowserDetector.isSafari() && isImage) { + dragPreviewHeight /= window.devicePixelRatio; + dragPreviewWidth /= window.devicePixelRatio; + } else if (_BrowserDetector.isFirefox() && !isImage) { + dragPreviewHeight *= window.devicePixelRatio; + dragPreviewWidth *= window.devicePixelRatio; + } -exports['default'] = HandlerRegistry; -module.exports = exports['default']; -},{"./actions/registry":14,"./utils/getNextUniqueId":23,"asap":1,"invariant":107,"lodash/isArray":97}],13:[function(require,module,exports){ + // Interpolate coordinates depending on anchor point + // If you know a simpler way to do this, let me know + var interpolantX = new _MonotonicInterpolant2['default']([0, 0.5, 1], [ + // Dock to the left + offsetFromDragPreview.x, + // Align at the center + offsetFromDragPreview.x / sourceWidth * dragPreviewWidth, + // Dock to the right + offsetFromDragPreview.x + dragPreviewWidth - sourceWidth]); + var interpolantY = new _MonotonicInterpolant2['default']([0, 0.5, 1], [ + // Dock to the top + offsetFromDragPreview.y, + // Align at the center + offsetFromDragPreview.y / sourceHeight * dragPreviewHeight, + // Dock to the bottom + offsetFromDragPreview.y + dragPreviewHeight - sourceHeight]); + var x = interpolantX.interpolate(anchorX); + var y = interpolantY.interpolate(anchorY); + + // Work around Safari 8 positioning bug + if (_BrowserDetector.isSafari() && isImage) { + // We'll have to wait for @3x to see if this is entirely correct + y += (window.devicePixelRatio - 1) * dragPreviewHeight; + } + + return { x: x, y: y }; +} +},{"./BrowserDetector":2,"./MonotonicInterpolant":5}],9:[function(require,module,exports){ 'use strict'; exports.__esModule = true; -exports.beginDrag = beginDrag; -exports.publishDragSource = publishDragSource; -exports.hover = hover; -exports.drop = drop; -exports.endDrag = endDrag; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +exports['default'] = getEmptyImage; +var emptyImage = undefined; -var _utilsMatchesType = require('../utils/matchesType'); +function getEmptyImage() { + if (!emptyImage) { + emptyImage = new Image(); + emptyImage.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; + } -var _utilsMatchesType2 = _interopRequireDefault(_utilsMatchesType); + return emptyImage; +} -var _invariant = require('invariant'); +module.exports = exports['default']; +},{}],10:[function(require,module,exports){ +'use strict'; -var _invariant2 = _interopRequireDefault(_invariant); +exports.__esModule = true; +exports['default'] = createHTML5Backend; -var _lodashIsArray = require('lodash/isArray'); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } -var _lodashIsArray2 = _interopRequireDefault(_lodashIsArray); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _lodashIsObject = require('lodash/isObject'); +var _HTML5Backend = require('./HTML5Backend'); -var _lodashIsObject2 = _interopRequireDefault(_lodashIsObject); +var _HTML5Backend2 = _interopRequireDefault(_HTML5Backend); -var BEGIN_DRAG = 'dnd-core/BEGIN_DRAG'; -exports.BEGIN_DRAG = BEGIN_DRAG; -var PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE'; -exports.PUBLISH_DRAG_SOURCE = PUBLISH_DRAG_SOURCE; -var HOVER = 'dnd-core/HOVER'; -exports.HOVER = HOVER; -var DROP = 'dnd-core/DROP'; -exports.DROP = DROP; -var END_DRAG = 'dnd-core/END_DRAG'; +var _getEmptyImage = require('./getEmptyImage'); -exports.END_DRAG = END_DRAG; +var _getEmptyImage2 = _interopRequireDefault(_getEmptyImage); -function beginDrag(sourceIds) { - var _ref = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; +var _NativeTypes = require('./NativeTypes'); - var _ref$publishSource = _ref.publishSource; - var publishSource = _ref$publishSource === undefined ? true : _ref$publishSource; - var _ref$clientOffset = _ref.clientOffset; - var clientOffset = _ref$clientOffset === undefined ? null : _ref$clientOffset; - var getSourceClientOffset = _ref.getSourceClientOffset; +var NativeTypes = _interopRequireWildcard(_NativeTypes); - _invariant2['default'](_lodashIsArray2['default'](sourceIds), 'Expected sourceIds to be an array.'); +exports.NativeTypes = NativeTypes; +exports.getEmptyImage = _getEmptyImage2['default']; - var monitor = this.getMonitor(); - var registry = this.getRegistry(); - _invariant2['default'](!monitor.isDragging(), 'Cannot call beginDrag while dragging.'); +function createHTML5Backend(manager) { + return new _HTML5Backend2['default'](manager); +} +},{"./HTML5Backend":4,"./NativeTypes":7,"./getEmptyImage":9}],11:[function(require,module,exports){ +"use strict"; - for (var i = 0; i < sourceIds.length; i++) { - _invariant2['default'](registry.getSource(sourceIds[i]), 'Expected sourceIds to be registered.'); - } +exports.__esModule = true; +exports["default"] = shallowEqual; - var sourceId = null; - for (var i = sourceIds.length - 1; i >= 0; i--) { - if (monitor.canDragSource(sourceIds[i])) { - sourceId = sourceIds[i]; - break; - } - } - if (sourceId === null) { - return; +function shallowEqual(objA, objB) { + if (objA === objB) { + return true; } - var sourceClientOffset = null; - if (clientOffset) { - _invariant2['default'](typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.'); - sourceClientOffset = getSourceClientOffset(sourceId); - } + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); - var source = registry.getSource(sourceId); - var item = source.beginDrag(monitor, sourceId); - _invariant2['default'](_lodashIsObject2['default'](item), 'Item must be an object.'); + if (keysA.length !== keysB.length) { + return false; + } - registry.pinSource(sourceId); + // Test for A's keys different from B. + var hasOwn = Object.prototype.hasOwnProperty; + for (var i = 0; i < keysA.length; i++) { + if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { + return false; + } - var itemType = registry.getSourceType(sourceId); - return { - type: BEGIN_DRAG, - itemType: itemType, - item: item, - sourceId: sourceId, - clientOffset: clientOffset, - sourceClientOffset: sourceClientOffset, - isSourcePublic: publishSource - }; -} + var valA = objA[keysA[i]]; + var valB = objB[keysA[i]]; -function publishDragSource(manager) { - var monitor = this.getMonitor(); - if (!monitor.isDragging()) { - return; + if (valA !== valB) { + return false; + } } - return { - type: PUBLISH_DRAG_SOURCE - }; + return true; } -function hover(targetIds) { - var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; +module.exports = exports["default"]; +},{}],12:[function(require,module,exports){ +var hashClear = require('./_hashClear'), + hashDelete = require('./_hashDelete'), + hashGet = require('./_hashGet'), + hashHas = require('./_hashHas'), + hashSet = require('./_hashSet'); - var _ref2$clientOffset = _ref2.clientOffset; - var clientOffset = _ref2$clientOffset === undefined ? null : _ref2$clientOffset; +/** + * 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; - _invariant2['default'](_lodashIsArray2['default'](targetIds), 'Expected targetIds to be an array.'); - targetIds = targetIds.slice(0); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} - var monitor = this.getMonitor(); - var registry = this.getRegistry(); - _invariant2['default'](monitor.isDragging(), 'Cannot call hover while not dragging.'); - _invariant2['default'](!monitor.didDrop(), 'Cannot call hover after drop.'); +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; - // First check invariants. - for (var i = 0; i < targetIds.length; i++) { - var targetId = targetIds[i]; - _invariant2['default'](targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.'); +module.exports = Hash; - var target = registry.getTarget(targetId); - _invariant2['default'](target, 'Expected targetIds to be registered.'); - } +},{"./_hashClear":55,"./_hashDelete":56,"./_hashGet":57,"./_hashHas":58,"./_hashSet":59}],13:[function(require,module,exports){ +var listCacheClear = require('./_listCacheClear'), + listCacheDelete = require('./_listCacheDelete'), + listCacheGet = require('./_listCacheGet'), + listCacheHas = require('./_listCacheHas'), + listCacheSet = require('./_listCacheSet'); - var draggedItemType = monitor.getItemType(); +/** + * 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; - // Remove those targetIds that don't match the targetType. This - // fixes shallow isOver which would only be non-shallow because of - // non-matching targets. - for (var i = targetIds.length - 1; i >= 0; i--) { - var targetId = targetIds[i]; - var targetType = registry.getTargetType(targetId); - if (!_utilsMatchesType2['default'](targetType, draggedItemType)) { - targetIds.splice(i, 1); - } + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } +} - // Finally call hover on all matching targets. - for (var i = 0; i < targetIds.length; i++) { - var targetId = targetIds[i]; - var target = registry.getTarget(targetId); - target.hover(monitor, targetId); - } +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; - return { - type: HOVER, - targetIds: targetIds, - clientOffset: clientOffset - }; -} +module.exports = ListCache; -function drop() { - var _this = this; +},{"./_listCacheClear":66,"./_listCacheDelete":67,"./_listCacheGet":68,"./_listCacheHas":69,"./_listCacheSet":70}],14:[function(require,module,exports){ +var getNative = require('./_getNative'), + root = require('./_root'); - var monitor = this.getMonitor(); - var registry = this.getRegistry(); - _invariant2['default'](monitor.isDragging(), 'Cannot call drop while not dragging.'); - _invariant2['default'](!monitor.didDrop(), 'Cannot call drop twice during one drag operation.'); +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'); - var targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor); +module.exports = Map; - targetIds.reverse(); - targetIds.forEach(function (targetId, index) { - var target = registry.getTarget(targetId); +},{"./_getNative":52,"./_root":81}],15:[function(require,module,exports){ +var mapCacheClear = require('./_mapCacheClear'), + mapCacheDelete = require('./_mapCacheDelete'), + mapCacheGet = require('./_mapCacheGet'), + mapCacheHas = require('./_mapCacheHas'), + mapCacheSet = require('./_mapCacheSet'); - var dropResult = target.drop(monitor, targetId); - _invariant2['default'](typeof dropResult === 'undefined' || _lodashIsObject2['default'](dropResult), 'Drop result must either be an object or undefined.'); - if (typeof dropResult === 'undefined') { - dropResult = index === 0 ? {} : monitor.getDropResult(); - } +/** + * 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.store.dispatch({ - type: DROP, - dropResult: dropResult - }); - }); + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } -function endDrag() { - var monitor = this.getMonitor(); - var registry = this.getRegistry(); - _invariant2['default'](monitor.isDragging(), 'Cannot call endDrag while not dragging.'); +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; - var sourceId = monitor.getSourceId(); - var source = registry.getSource(sourceId, true); - source.endDrag(monitor, sourceId); +module.exports = MapCache; - registry.unpinSource(); +},{"./_mapCacheClear":71,"./_mapCacheDelete":72,"./_mapCacheGet":73,"./_mapCacheHas":74,"./_mapCacheSet":75}],16:[function(require,module,exports){ +var getNative = require('./_getNative'), + root = require('./_root'); - return { - type: END_DRAG - }; -} -},{"../utils/matchesType":24,"invariant":107,"lodash/isArray":97,"lodash/isObject":102}],14:[function(require,module,exports){ -'use strict'; +/* Built-in method references that are verified to be native. */ +var Set = getNative(root, 'Set'); -exports.__esModule = true; -exports.addSource = addSource; -exports.addTarget = addTarget; -exports.removeSource = removeSource; -exports.removeTarget = removeTarget; -var ADD_SOURCE = 'dnd-core/ADD_SOURCE'; -exports.ADD_SOURCE = ADD_SOURCE; -var ADD_TARGET = 'dnd-core/ADD_TARGET'; -exports.ADD_TARGET = ADD_TARGET; -var REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE'; -exports.REMOVE_SOURCE = REMOVE_SOURCE; -var REMOVE_TARGET = 'dnd-core/REMOVE_TARGET'; +module.exports = Set; -exports.REMOVE_TARGET = REMOVE_TARGET; +},{"./_getNative":52,"./_root":81}],17:[function(require,module,exports){ +var MapCache = require('./_MapCache'), + setCacheAdd = require('./_setCacheAdd'), + setCacheHas = require('./_setCacheHas'); -function addSource(sourceId) { - return { - type: ADD_SOURCE, - sourceId: sourceId - }; -} +/** + * + * 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; -function addTarget(targetId) { - return { - type: ADD_TARGET, - targetId: targetId - }; + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } } -function removeSource(sourceId) { - return { - type: REMOVE_SOURCE, - sourceId: sourceId - }; -} +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; -function removeTarget(targetId) { - return { - type: REMOVE_TARGET, - targetId: targetId - }; -} -},{}],15:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports['default'] = createBackend; - -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'); } } +module.exports = SetCache; -var _lodashNoop = require('lodash/noop'); +},{"./_MapCache":15,"./_setCacheAdd":82,"./_setCacheHas":83}],18:[function(require,module,exports){ +var root = require('./_root'); -var _lodashNoop2 = _interopRequireDefault(_lodashNoop); +/** Built-in value references. */ +var Symbol = root.Symbol; -var TestBackend = (function () { - function TestBackend(manager) { - _classCallCheck(this, TestBackend); +module.exports = Symbol; - this.actions = manager.getActions(); +},{"./_root":81}],19:[function(require,module,exports){ +/** + * 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); +} - TestBackend.prototype.setup = function setup() { - this.didCallSetup = true; - }; +module.exports = apply; - TestBackend.prototype.teardown = function teardown() { - this.didCallTeardown = true; - }; +},{}],20:[function(require,module,exports){ +var baseIndexOf = require('./_baseIndexOf'); - TestBackend.prototype.connectDragSource = function connectDragSource() { - return _lodashNoop2['default']; - }; +/** + * 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; +} - TestBackend.prototype.connectDragPreview = function connectDragPreview() { - return _lodashNoop2['default']; - }; +module.exports = arrayIncludes; - TestBackend.prototype.connectDropTarget = function connectDropTarget() { - return _lodashNoop2['default']; - }; +},{"./_baseIndexOf":32}],21:[function(require,module,exports){ +/** + * 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; - TestBackend.prototype.simulateBeginDrag = function simulateBeginDrag(sourceIds, options) { - this.actions.beginDrag(sourceIds, options); - }; + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} - TestBackend.prototype.simulatePublishDragSource = function simulatePublishDragSource() { - this.actions.publishDragSource(); - }; +module.exports = arrayIncludesWith; - TestBackend.prototype.simulateHover = function simulateHover(targetIds, options) { - this.actions.hover(targetIds, options); - }; +},{}],22:[function(require,module,exports){ +var baseTimes = require('./_baseTimes'), + isArguments = require('./isArguments'), + isArray = require('./isArray'), + isBuffer = require('./isBuffer'), + isIndex = require('./_isIndex'), + isTypedArray = require('./isTypedArray'); - TestBackend.prototype.simulateDrop = function simulateDrop() { - this.actions.drop(); - }; +/** Used for built-in method references. */ +var objectProto = Object.prototype; - TestBackend.prototype.simulateEndDrag = function simulateEndDrag() { - this.actions.endDrag(); - }; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; - return TestBackend; -})(); +/** + * 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; -function createBackend(manager) { - return new TestBackend(manager); + 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; } -module.exports = exports['default']; -},{"lodash/noop":104}],16:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; +module.exports = arrayLikeKeys; -function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } +},{"./_baseTimes":40,"./_isIndex":61,"./isArguments":94,"./isArray":95,"./isBuffer":98,"./isTypedArray":103}],23:[function(require,module,exports){ +/** + * 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); -var _DragDropManager = require('./DragDropManager'); + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} -exports.DragDropManager = _interopRequire(_DragDropManager); +module.exports = arrayMap; -var _DragSource = require('./DragSource'); +},{}],24:[function(require,module,exports){ +/** + * 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; -exports.DragSource = _interopRequire(_DragSource); + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} -var _DropTarget = require('./DropTarget'); +module.exports = arrayPush; -exports.DropTarget = _interopRequire(_DropTarget); +},{}],25:[function(require,module,exports){ +var baseAssignValue = require('./_baseAssignValue'), + eq = require('./eq'); -var _backendsCreateTestBackend = require('./backends/createTestBackend'); +/** Used for built-in method references. */ +var objectProto = Object.prototype; -exports.createTestBackend = _interopRequire(_backendsCreateTestBackend); -},{"./DragDropManager":8,"./DragSource":10,"./DropTarget":11,"./backends/createTestBackend":15}],17:[function(require,module,exports){ -'use strict'; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -exports.__esModule = true; -exports['default'] = dirtyHandlerIds; -exports.areDirty = areDirty; +/** + * 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); + } +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +module.exports = assignValue; -var _lodashXor = require('lodash/xor'); +},{"./_baseAssignValue":27,"./eq":92}],26:[function(require,module,exports){ +var eq = require('./eq'); -var _lodashXor2 = _interopRequireDefault(_lodashXor); +/** + * 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; +} -var _lodashIntersection = require('lodash/intersection'); +module.exports = assocIndexOf; -var _lodashIntersection2 = _interopRequireDefault(_lodashIntersection); +},{"./eq":92}],27:[function(require,module,exports){ +var defineProperty = require('./_defineProperty'); -var _actionsDragDrop = require('../actions/dragDrop'); +/** + * 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; + } +} -var _actionsRegistry = require('../actions/registry'); +module.exports = baseAssignValue; -var NONE = []; -var ALL = []; +},{"./_defineProperty":49}],28:[function(require,module,exports){ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); -function dirtyHandlerIds(state, action, dragOperation) { - if (state === undefined) state = NONE; +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; - switch (action.type) { - case _actionsDragDrop.HOVER: - break; - case _actionsRegistry.ADD_SOURCE: - case _actionsRegistry.ADD_TARGET: - case _actionsRegistry.REMOVE_TARGET: - case _actionsRegistry.REMOVE_SOURCE: - return NONE; - case _actionsDragDrop.BEGIN_DRAG: - case _actionsDragDrop.PUBLISH_DRAG_SOURCE: - case _actionsDragDrop.END_DRAG: - case _actionsDragDrop.DROP: - default: - return ALL; - } - - var targetIds = action.targetIds; - var prevTargetIds = dragOperation.targetIds; - - var dirtyHandlerIds = _lodashXor2['default'](targetIds, prevTargetIds); +/** + * 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; - var didChange = false; - if (dirtyHandlerIds.length === 0) { - for (var i = 0; i < targetIds.length; i++) { - if (targetIds[i] !== prevTargetIds[i]) { - didChange = true; - break; - } - } - } else { - didChange = true; + if (!length) { + return result; } - - if (!didChange) { - return NONE; + 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); - var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1]; - var innermostTargetId = targetIds[targetIds.length - 1]; - - if (prevInnermostTargetId !== innermostTargetId) { - if (prevInnermostTargetId) { - dirtyHandlerIds.push(prevInnermostTargetId); + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); } - if (innermostTargetId) { - dirtyHandlerIds.push(innermostTargetId); + else if (!includes(values, computed, comparator)) { + result.push(value); } } - - return dirtyHandlerIds; + return result; } -function areDirty(state, handlerIds) { - if (state === NONE) { - return false; - } +module.exports = baseDifference; - if (state === ALL || typeof handlerIds === 'undefined') { - return true; - } +},{"./_SetCache":17,"./_arrayIncludes":20,"./_arrayIncludesWith":21,"./_arrayMap":23,"./_baseUnary":41,"./_cacheHas":43}],29:[function(require,module,exports){ +/** + * 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); - return _lodashIntersection2['default'](handlerIds, state).length > 0; + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; } -},{"../actions/dragDrop":13,"../actions/registry":14,"lodash/intersection":95,"lodash/xor":106}],18:[function(require,module,exports){ -'use strict'; - -exports.__esModule = 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; }; +module.exports = baseFindIndex; -exports['default'] = dragOffset; -exports.getSourceClientOffset = getSourceClientOffset; -exports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset; +},{}],30:[function(require,module,exports){ +var arrayPush = require('./_arrayPush'), + isFlattenable = require('./_isFlattenable'); -var _actionsDragDrop = require('../actions/dragDrop'); +/** + * 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; -var initialState = { - initialSourceClientOffset: null, - initialClientOffset: null, - clientOffset: null -}; + predicate || (predicate = isFlattenable); + result || (result = []); -function areOffsetsEqual(offsetA, offsetB) { - if (offsetA === offsetB) { - return true; + 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 offsetA && offsetB && offsetA.x === offsetB.x && offsetA.y === offsetB.y; + return result; } -function dragOffset(state, action) { - if (state === undefined) state = initialState; +module.exports = baseFlatten; - switch (action.type) { - case _actionsDragDrop.BEGIN_DRAG: - return { - initialSourceClientOffset: action.sourceClientOffset, - initialClientOffset: action.clientOffset, - clientOffset: action.clientOffset - }; - case _actionsDragDrop.HOVER: - if (areOffsetsEqual(state.clientOffset, action.clientOffset)) { - return state; - } - return _extends({}, state, { - clientOffset: action.clientOffset - }); - case _actionsDragDrop.END_DRAG: - case _actionsDragDrop.DROP: - return initialState; - default: - return state; - } -} +},{"./_arrayPush":24,"./_isFlattenable":60}],31:[function(require,module,exports){ +var Symbol = require('./_Symbol'), + getRawTag = require('./_getRawTag'), + objectToString = require('./_objectToString'); -function getSourceClientOffset(state) { - var clientOffset = state.clientOffset; - var initialClientOffset = state.initialClientOffset; - var initialSourceClientOffset = state.initialSourceClientOffset; +/** `Object#toString` result references. */ +var nullTag = '[object Null]', + undefinedTag = '[object Undefined]'; - if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) { - return null; +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * 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 { - x: clientOffset.x + initialSourceClientOffset.x - initialClientOffset.x, - y: clientOffset.y + initialSourceClientOffset.y - initialClientOffset.y - }; + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); } -function getDifferenceFromInitialOffset(state) { - var clientOffset = state.clientOffset; - var initialClientOffset = state.initialClientOffset; +module.exports = baseGetTag; - if (!clientOffset || !initialClientOffset) { - return null; - } - return { - x: clientOffset.x - initialClientOffset.x, - y: clientOffset.y - initialClientOffset.y - }; +},{"./_Symbol":18,"./_getRawTag":53,"./_objectToString":79}],32:[function(require,module,exports){ +var baseFindIndex = require('./_baseFindIndex'), + baseIsNaN = require('./_baseIsNaN'), + strictIndexOf = require('./_strictIndexOf'); + +/** + * 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); } -},{"../actions/dragDrop":13}],19:[function(require,module,exports){ -'use strict'; -exports.__esModule = true; +module.exports = baseIndexOf; -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; }; +},{"./_baseFindIndex":29,"./_baseIsNaN":34,"./_strictIndexOf":87}],33:[function(require,module,exports){ +var baseGetTag = require('./_baseGetTag'), + isObjectLike = require('./isObjectLike'); -exports['default'] = dragOperation; +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]'; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +/** + * 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; +} -var _actionsDragDrop = require('../actions/dragDrop'); +module.exports = baseIsArguments; -var _actionsRegistry = require('../actions/registry'); +},{"./_baseGetTag":31,"./isObjectLike":102}],34:[function(require,module,exports){ +/** + * 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; +} -var _lodashWithout = require('lodash/without'); +module.exports = baseIsNaN; -var _lodashWithout2 = _interopRequireDefault(_lodashWithout); - -var initialState = { - itemType: null, - item: null, - sourceId: null, - targetIds: [], - dropResult: null, - didDrop: false, - isSourcePublic: null -}; - -function dragOperation(state, action) { - if (state === undefined) state = initialState; - - switch (action.type) { - case _actionsDragDrop.BEGIN_DRAG: - return _extends({}, state, { - itemType: action.itemType, - item: action.item, - sourceId: action.sourceId, - isSourcePublic: action.isSourcePublic, - dropResult: null, - didDrop: false - }); - case _actionsDragDrop.PUBLISH_DRAG_SOURCE: - return _extends({}, state, { - isSourcePublic: true - }); - case _actionsDragDrop.HOVER: - return _extends({}, state, { - targetIds: action.targetIds - }); - case _actionsRegistry.REMOVE_TARGET: - if (state.targetIds.indexOf(action.targetId) === -1) { - return state; - } - return _extends({}, state, { - targetIds: _lodashWithout2['default'](state.targetIds, action.targetId) - }); - case _actionsDragDrop.DROP: - return _extends({}, state, { - dropResult: action.dropResult, - didDrop: true, - targetIds: [] - }); - case _actionsDragDrop.END_DRAG: - return _extends({}, state, { - itemType: null, - item: null, - sourceId: null, - dropResult: null, - didDrop: false, - isSourcePublic: null, - targetIds: [] - }); - default: - return state; - } -} - -module.exports = exports['default']; -},{"../actions/dragDrop":13,"../actions/registry":14,"lodash/without":105}],20:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _dragOffset = require('./dragOffset'); - -var _dragOffset2 = _interopRequireDefault(_dragOffset); - -var _dragOperation = require('./dragOperation'); - -var _dragOperation2 = _interopRequireDefault(_dragOperation); - -var _refCount = require('./refCount'); - -var _refCount2 = _interopRequireDefault(_refCount); - -var _dirtyHandlerIds = require('./dirtyHandlerIds'); - -var _dirtyHandlerIds2 = _interopRequireDefault(_dirtyHandlerIds); - -var _stateId = require('./stateId'); - -var _stateId2 = _interopRequireDefault(_stateId); +},{}],35:[function(require,module,exports){ +var isFunction = require('./isFunction'), + isMasked = require('./_isMasked'), + isObject = require('./isObject'), + toSource = require('./_toSource'); -exports['default'] = function (state, action) { - if (state === undefined) state = {}; +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - return { - dirtyHandlerIds: _dirtyHandlerIds2['default'](state.dirtyHandlerIds, action, state.dragOperation), - dragOffset: _dragOffset2['default'](state.dragOffset, action), - refCount: _refCount2['default'](state.refCount, action), - dragOperation: _dragOperation2['default'](state.dragOperation, action), - stateId: _stateId2['default'](state.stateId) - }; -}; +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; -module.exports = exports['default']; -},{"./dirtyHandlerIds":17,"./dragOffset":18,"./dragOperation":19,"./refCount":21,"./stateId":22}],21:[function(require,module,exports){ -'use strict'; +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; -exports.__esModule = true; -exports['default'] = refCount; +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -var _actionsRegistry = require('../actions/registry'); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -function refCount(state, action) { - if (state === undefined) state = 0; +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); - switch (action.type) { - case _actionsRegistry.ADD_SOURCE: - case _actionsRegistry.ADD_TARGET: - return state + 1; - case _actionsRegistry.REMOVE_SOURCE: - case _actionsRegistry.REMOVE_TARGET: - return state - 1; - default: - return state; +/** + * 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)); } -module.exports = exports['default']; -},{"../actions/registry":14}],22:[function(require,module,exports){ -"use strict"; - -exports.__esModule = true; -exports["default"] = stateId; +module.exports = baseIsNative; -function stateId() { - var state = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; +},{"./_isMasked":64,"./_toSource":88,"./isFunction":99,"./isObject":101}],36:[function(require,module,exports){ +var baseGetTag = require('./_baseGetTag'), + isLength = require('./isLength'), + isObjectLike = require('./isObjectLike'); - return state + 1; -} +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; -module.exports = exports["default"]; -},{}],23:[function(require,module,exports){ -"use strict"; +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]'; -exports.__esModule = true; -exports["default"] = getNextUniqueId; -var nextUniqueId = 0; +/** 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; -function getNextUniqueId() { - return nextUniqueId++; +/** + * 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)]; } -module.exports = exports["default"]; -},{}],24:[function(require,module,exports){ -'use strict'; +module.exports = baseIsTypedArray; -exports.__esModule = true; -exports['default'] = matchesType; +},{"./_baseGetTag":31,"./isLength":100,"./isObjectLike":102}],37:[function(require,module,exports){ +var isObject = require('./isObject'), + isPrototype = require('./_isPrototype'), + nativeKeysIn = require('./_nativeKeysIn'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +/** Used for built-in method references. */ +var objectProto = Object.prototype; -var _lodashIsArray = require('lodash/isArray'); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -var _lodashIsArray2 = _interopRequireDefault(_lodashIsArray); +/** + * 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 = []; -function matchesType(targetType, draggedItemType) { - if (_lodashIsArray2['default'](targetType)) { - return targetType.some(function (t) { - return t === draggedItemType; - }); - } else { - return targetType === draggedItemType; + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } } + return result; } -module.exports = exports['default']; -},{"lodash/isArray":97}],25:[function(require,module,exports){ -var hashClear = require('./_hashClear'), - hashDelete = require('./_hashDelete'), - hashGet = require('./_hashGet'), - hashHas = require('./_hashHas'), - hashSet = require('./_hashSet'); +module.exports = baseKeysIn; + +},{"./_isPrototype":65,"./_nativeKeysIn":77,"./isObject":101}],38:[function(require,module,exports){ +var identity = require('./identity'), + overRest = require('./_overRest'), + setToString = require('./_setToString'); /** - * Creates a hash object. + * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @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 Hash(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; +function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); +} - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} +module.exports = baseRest; -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; +},{"./_overRest":80,"./_setToString":85,"./identity":93}],39:[function(require,module,exports){ +var constant = require('./constant'), + defineProperty = require('./_defineProperty'), + identity = require('./identity'); -module.exports = Hash; +/** + * 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 + }); +}; -},{"./_hashClear":63,"./_hashDelete":64,"./_hashGet":65,"./_hashHas":66,"./_hashSet":67}],26:[function(require,module,exports){ -var listCacheClear = require('./_listCacheClear'), - listCacheDelete = require('./_listCacheDelete'), - listCacheGet = require('./_listCacheGet'), - listCacheHas = require('./_listCacheHas'), - listCacheSet = require('./_listCacheSet'); +module.exports = baseSetToString; +},{"./_defineProperty":49,"./constant":90,"./identity":93}],40:[function(require,module,exports){ /** - * Creates an list cache object. + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @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 ListCache(entries) { +function baseTimes(n, iteratee) { var index = -1, - length = entries == null ? 0 : entries.length; + result = Array(n); - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); + while (++index < n) { + result[index] = iteratee(index); } + return result; } -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -module.exports = ListCache; +module.exports = baseTimes; -},{"./_listCacheClear":71,"./_listCacheDelete":72,"./_listCacheGet":73,"./_listCacheHas":74,"./_listCacheSet":75}],27:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); +},{}],41:[function(require,module,exports){ +/** + * 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); + }; +} -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'); +module.exports = baseUnary; -module.exports = Map; +},{}],42:[function(require,module,exports){ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + cacheHas = require('./_cacheHas'), + createSet = require('./_createSet'), + setToArray = require('./_setToArray'); -},{"./_getNative":60,"./_root":84}],28:[function(require,module,exports){ -var mapCacheClear = require('./_mapCacheClear'), - mapCacheDelete = require('./_mapCacheDelete'), - mapCacheGet = require('./_mapCacheGet'), - mapCacheHas = require('./_mapCacheHas'), - mapCacheSet = require('./_mapCacheSet'); +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; /** - * Creates a map cache object to store key-value pairs. + * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. + * @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 MapCache(entries) { +function baseUniq(array, iteratee, comparator) { var index = -1, - length = entries == null ? 0 : entries.length; + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; - this.clear(); + 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 entry = entries[index]; - this.set(entry[0], entry[1]); + 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; } -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -module.exports = MapCache; - -},{"./_mapCacheClear":76,"./_mapCacheDelete":77,"./_mapCacheGet":78,"./_mapCacheHas":79,"./_mapCacheSet":80}],29:[function(require,module,exports){ -var getNative = require('./_getNative'), - root = require('./_root'); +module.exports = baseUniq; -/* Built-in method references that are verified to be native. */ -var Set = getNative(root, 'Set'); +},{"./_SetCache":17,"./_arrayIncludes":20,"./_arrayIncludesWith":21,"./_cacheHas":43,"./_createSet":47,"./_setToArray":84}],43:[function(require,module,exports){ +/** + * 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); +} -module.exports = Set; +module.exports = cacheHas; -},{"./_getNative":60,"./_root":84}],30:[function(require,module,exports){ -var MapCache = require('./_MapCache'), - setCacheAdd = require('./_setCacheAdd'), - setCacheHas = require('./_setCacheHas'); +},{}],44:[function(require,module,exports){ +var assignValue = require('./_assignValue'), + baseAssignValue = require('./_baseAssignValue'); /** - * - * Creates an array cache object to store unique values. + * Copies properties of `source` to `object`. * * @private - * @constructor - * @param {Array} [values] The values to cache. + * @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 SetCache(values) { +function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + var index = -1, - length = values == null ? 0 : values.length; + length = props.length; - this.__data__ = new MapCache; while (++index < length) { - this.add(values[index]); + 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; } -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -module.exports = SetCache; +module.exports = copyObject; -},{"./_MapCache":28,"./_setCacheAdd":85,"./_setCacheHas":86}],31:[function(require,module,exports){ +},{"./_assignValue":25,"./_baseAssignValue":27}],45:[function(require,module,exports){ var root = require('./_root'); -/** Built-in value references. */ -var Symbol = root.Symbol; +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; -module.exports = Symbol; +module.exports = coreJsData; + +},{"./_root":81}],46:[function(require,module,exports){ +var baseRest = require('./_baseRest'), + isIterateeCall = require('./_isIterateeCall'); -},{"./_root":84}],32:[function(require,module,exports){ /** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. + * Creates a function like `_.assign`. * * @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`. + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. */ -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); -} - -module.exports = apply; +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; + }); +} + +module.exports = createAssigner; + +},{"./_baseRest":38,"./_isIterateeCall":62}],47:[function(require,module,exports){ +var Set = require('./_Set'), + noop = require('./noop'), + setToArray = require('./_setToArray'); + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; -},{}],33:[function(require,module,exports){ /** - * A specialized version of `_.filter` for arrays without support for - * iteratee shorthands. + * Creates a set object of `values`. * * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} predicate The function invoked per iteration. - * @returns {Array} Returns the new filtered array. + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. */ -function arrayFilter(array, predicate) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; - } +module.exports = createSet; + +},{"./_Set":16,"./_setToArray":84,"./noop":106}],48:[function(require,module,exports){ +var eq = require('./eq'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * 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 result; + return objValue; } -module.exports = arrayFilter; +module.exports = customDefaultsAssignIn; -},{}],34:[function(require,module,exports){ -var baseIndexOf = require('./_baseIndexOf'); +},{"./eq":92}],49:[function(require,module,exports){ +var getNative = require('./_getNative'); + +var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} +}()); + +module.exports = defineProperty; + +},{"./_getNative":52}],50:[function(require,module,exports){ +(function (global){ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],51:[function(require,module,exports){ +var isKeyable = require('./_isKeyable'); /** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. + * Gets the data for `map`. * * @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`. + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. */ -function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; } -module.exports = arrayIncludes; +module.exports = getMapData; + +},{"./_isKeyable":63}],52:[function(require,module,exports){ +var baseIsNative = require('./_baseIsNative'), + getValue = require('./_getValue'); -},{"./_baseIndexOf":43}],35:[function(require,module,exports){ /** - * This function is like `arrayIncludes` except that it accepts a comparator. + * Gets the native function at `key` of `object`. * * @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`. + * @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 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; +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; } -module.exports = arrayIncludesWith; +module.exports = getNative; + +},{"./_baseIsNative":35,"./_getValue":54}],53:[function(require,module,exports){ +var Symbol = require('./_Symbol'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -},{}],36:[function(require,module,exports){ /** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; + +/** Built-in value references. */ +var symToStringTag = Symbol ? Symbol.toStringTag : undefined; + +/** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private - * @param {Array} [array] The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. */ -function arrayMap(array, iteratee) { - var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); +function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; - while (++index < length) { - result[index] = iteratee(array[index], index, array); + 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; } -module.exports = arrayMap; +module.exports = getRawTag; -},{}],37:[function(require,module,exports){ +},{"./_Symbol":18}],54:[function(require,module,exports){ /** - * Appends the elements of `values` to `array`. + * Gets the value at `key` of `object`. * * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; +function getValue(object, key) { + return object == null ? undefined : object[key]; } -module.exports = arrayPush; +module.exports = getValue; -},{}],38:[function(require,module,exports){ -var eq = require('./eq'); +},{}],55:[function(require,module,exports){ +var nativeCreate = require('./_nativeCreate'); /** - * Gets the index at which the `key` is found in `array` of key-value pairs. + * Removes all key-value entries from the hash. * * @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`. + * @name clear + * @memberOf Hash */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } -module.exports = assocIndexOf; - -},{"./eq":93}],39:[function(require,module,exports){ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - arrayMap = require('./_arrayMap'), - baseUnary = require('./_baseUnary'), - cacheHas = require('./_cacheHas'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +module.exports = hashClear; +},{"./_nativeCreate":76}],56:[function(require,module,exports){ /** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. + * Removes `key` and its value from the hash. * * @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. + * @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 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); - } - } +function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; return result; } -module.exports = baseDifference; +module.exports = hashDelete; + +},{}],57:[function(require,module,exports){ +var nativeCreate = require('./_nativeCreate'); + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -},{"./_SetCache":30,"./_arrayIncludes":34,"./_arrayIncludesWith":35,"./_arrayMap":36,"./_baseUnary":50,"./_cacheHas":53}],40:[function(require,module,exports){ /** - * The base implementation of `_.findIndex` and `_.findLastIndex` without - * support for iteratee shorthands. + * Gets the hash value for `key`. * * @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`. + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ -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; - } +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; } - return -1; + return hasOwnProperty.call(data, key) ? data[key] : undefined; } -module.exports = baseFindIndex; +module.exports = hashGet; -},{}],41:[function(require,module,exports){ -var arrayPush = require('./_arrayPush'), - isFlattenable = require('./_isFlattenable'); +},{"./_nativeCreate":76}],58:[function(require,module,exports){ +var nativeCreate = require('./_nativeCreate'); + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** - * The base implementation of `_.flatten` with support for restricting flattening. + * Checks if a hash value for `key` exists. * * @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. + * @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 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; +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } -module.exports = baseFlatten; - -},{"./_arrayPush":37,"./_isFlattenable":68}],42:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - getRawTag = require('./_getRawTag'), - objectToString = require('./_objectToString'); +module.exports = hashHas; -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; +},{"./_nativeCreate":76}],59:[function(require,module,exports){ +var nativeCreate = require('./_nativeCreate'); -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** - * The base implementation of `getTag` without fallbacks for buggy environments. + * Sets the hash `key` to `value`. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * @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 baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - value = Object(value); - return (symToStringTag && symToStringTag in value) - ? getRawTag(value) - : objectToString(value); +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; } -module.exports = baseGetTag; +module.exports = hashSet; -},{"./_Symbol":31,"./_getRawTag":61,"./_objectToString":82}],43:[function(require,module,exports){ -var baseFindIndex = require('./_baseFindIndex'), - baseIsNaN = require('./_baseIsNaN'), - strictIndexOf = require('./_strictIndexOf'); +},{"./_nativeCreate":76}],60:[function(require,module,exports){ +var Symbol = require('./_Symbol'), + isArguments = require('./isArguments'), + isArray = require('./isArray'); + +/** Built-in value references. */ +var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; /** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * Checks if `value` is a flattenable `arguments` object or array. * * @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`. + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ -function baseIndexOf(array, value, fromIndex) { - return value === value - ? strictIndexOf(array, value, fromIndex) - : baseFindIndex(array, baseIsNaN, fromIndex); +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); } -module.exports = baseIndexOf; +module.exports = isFlattenable; -},{"./_baseFindIndex":40,"./_baseIsNaN":46,"./_strictIndexOf":90}],44:[function(require,module,exports){ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - arrayMap = require('./_arrayMap'), - baseUnary = require('./_baseUnary'), - cacheHas = require('./_cacheHas'); +},{"./_Symbol":18,"./isArguments":94,"./isArray":95}],61:[function(require,module,exports){ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMin = Math.min; +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; /** - * The base implementation of methods like `_.intersection`, without support - * for iteratee shorthands, that accepts an array of arrays to inspect. + * Checks if `value` is a valid array-like index. * * @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. + * @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 baseIntersection(arrays, iteratee, comparator) { - var includes = comparator ? arrayIncludesWith : arrayIncludes, - length = arrays[0].length, - othLength = arrays.length, - othIndex = othLength, - caches = Array(othLength), - maxLength = Infinity, - result = []; +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); +} - 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]; +module.exports = isIndex; - var index = -1, - seen = caches[0]; +},{}],62:[function(require,module,exports){ +var eq = require('./eq'), + isArrayLike = require('./isArrayLike'), + isIndex = require('./_isIndex'), + isObject = require('./isObject'); - 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); - } +/** + * 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; } - return result; + 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; } -module.exports = baseIntersection; - -},{"./_SetCache":30,"./_arrayIncludes":34,"./_arrayIncludesWith":35,"./_arrayMap":36,"./_baseUnary":50,"./_cacheHas":53}],45:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObjectLike = require('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]'; +module.exports = isIterateeCall; +},{"./_isIndex":61,"./eq":92,"./isArrayLike":96,"./isObject":101}],63:[function(require,module,exports){ /** - * The base implementation of `_.isArguments`. + * 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 an `arguments` object, + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ -function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); } -module.exports = baseIsArguments; +module.exports = isKeyable; + +},{}],64:[function(require,module,exports){ +var coreJsData = require('./_coreJsData'); + +/** 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) : ''; +}()); -},{"./_baseGetTag":42,"./isObjectLike":103}],46:[function(require,module,exports){ /** - * The base implementation of `_.isNaN` without support for number objects. + * Checks if `func` has its source masked. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ -function baseIsNaN(value) { - return value !== value; +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); } -module.exports = baseIsNaN; +module.exports = isMasked; -},{}],47:[function(require,module,exports){ -var isFunction = require('./isFunction'), - isMasked = require('./_isMasked'), - isObject = require('./isObject'), - toSource = require('./_toSource'); +},{"./_coreJsData":45}],65:[function(require,module,exports){ +/** Used for built-in method references. */ +var objectProto = Object.prototype; /** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + * 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`. */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; + return value === proto; +} -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; +module.exports = isPrototype; -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +},{}],66:[function(require,module,exports){ +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; + this.size = 0; +} -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +module.exports = listCacheClear; -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); +},{}],67:[function(require,module,exports){ +var assocIndexOf = require('./_assocIndexOf'); + +/** Used for built-in method references. */ +var arrayProto = Array.prototype; + +/** Built-in value references. */ +var splice = arrayProto.splice; /** - * The base implementation of `_.isNative` without bad shim checks. + * Removes `key` and its value from the list cache. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. + * @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 baseIsNative(value) { - if (!isObject(value) || isMasked(value)) { +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { return false; } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; } -module.exports = baseIsNative; +module.exports = listCacheDelete; -},{"./_isMasked":70,"./_toSource":91,"./isFunction":100,"./isObject":102}],48:[function(require,module,exports){ -var identity = require('./identity'), - overRest = require('./_overRest'), - setToString = require('./_setToString'); +},{"./_assocIndexOf":26}],68:[function(require,module,exports){ +var assocIndexOf = require('./_assocIndexOf'); /** - * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * Gets the list cache value for `key`. * * @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. + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ -function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; } -module.exports = baseRest; +module.exports = listCacheGet; -},{"./_overRest":83,"./_setToString":88,"./identity":94}],49:[function(require,module,exports){ -var constant = require('./constant'), - defineProperty = require('./_defineProperty'), - identity = require('./identity'); +},{"./_assocIndexOf":26}],69:[function(require,module,exports){ +var assocIndexOf = require('./_assocIndexOf'); /** - * The base implementation of `setToString` without support for hot loop shorting. + * Checks if a list cache value for `key` exists. * * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @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`. */ -var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(string), - 'writable': true - }); -}; +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} -module.exports = baseSetToString; +module.exports = listCacheHas; + +},{"./_assocIndexOf":26}],70:[function(require,module,exports){ +var assocIndexOf = require('./_assocIndexOf'); -},{"./_defineProperty":57,"./constant":92,"./identity":94}],50:[function(require,module,exports){ /** - * The base implementation of `_.unary` without support for storing metadata. + * Sets the list cache `key` to `value`. * * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. + * @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 baseUnary(func) { - return function(value) { - return func(value); - }; +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; } -module.exports = baseUnary; +module.exports = listCacheSet; -},{}],51:[function(require,module,exports){ -var SetCache = require('./_SetCache'), - arrayIncludes = require('./_arrayIncludes'), - arrayIncludesWith = require('./_arrayIncludesWith'), - cacheHas = require('./_cacheHas'), - createSet = require('./_createSet'), - setToArray = require('./_setToArray'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; +},{"./_assocIndexOf":26}],71:[function(require,module,exports){ +var Hash = require('./_Hash'), + ListCache = require('./_ListCache'), + Map = require('./_Map'); /** - * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * Removes all key-value entries from the map. * * @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. + * @name clear + * @memberOf MapCache */ -function baseUniq(array, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; +function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} - 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; +module.exports = mapCacheClear; - 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); - } - } +},{"./_Hash":12,"./_ListCache":13,"./_Map":14}],72:[function(require,module,exports){ +var getMapData = require('./_getMapData'); + +/** + * 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; } -module.exports = baseUniq; +module.exports = mapCacheDelete; -},{"./_SetCache":30,"./_arrayIncludes":34,"./_arrayIncludesWith":35,"./_cacheHas":53,"./_createSet":56,"./_setToArray":87}],52:[function(require,module,exports){ -var baseDifference = require('./_baseDifference'), - baseFlatten = require('./_baseFlatten'), - baseUniq = require('./_baseUniq'); +},{"./_getMapData":51}],73:[function(require,module,exports){ +var getMapData = require('./_getMapData'); /** - * The base implementation of methods like `_.xor`, without support for - * iteratee shorthands, that accepts an array of arrays to inspect. + * Gets the map value for `key`. * * @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. + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. */ -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); +function mapCacheGet(key) { + return getMapData(this, key).get(key); } -module.exports = baseXor; +module.exports = mapCacheGet; + +},{"./_getMapData":51}],74:[function(require,module,exports){ +var getMapData = require('./_getMapData'); -},{"./_baseDifference":39,"./_baseFlatten":41,"./_baseUniq":51}],53:[function(require,module,exports){ /** - * Checks if a `cache` value for `key` exists. + * Checks if a map value for `key` exists. * * @private - * @param {Object} cache The cache to query. + * @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 cacheHas(cache, key) { - return cache.has(key); +function mapCacheHas(key) { + return getMapData(this, key).has(key); } -module.exports = cacheHas; +module.exports = mapCacheHas; -},{}],54:[function(require,module,exports){ -var isArrayLikeObject = require('./isArrayLikeObject'); +},{"./_getMapData":51}],75:[function(require,module,exports){ +var getMapData = require('./_getMapData'); /** - * Casts `value` to an empty array if it's not an array like object. + * Sets the map `key` to `value`. * * @private - * @param {*} value The value to inspect. - * @returns {Array|Object} Returns the cast array-like object. + * @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 castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; -} - -module.exports = castArrayLikeObject; +function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; -},{"./isArrayLikeObject":99}],55:[function(require,module,exports){ -var root = require('./_root'); + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; +} -/** Used to detect overreaching core-js shims. */ -var coreJsData = root['__core-js_shared__']; +module.exports = mapCacheSet; -module.exports = coreJsData; +},{"./_getMapData":51}],76:[function(require,module,exports){ +var getNative = require('./_getNative'); -},{"./_root":84}],56:[function(require,module,exports){ -var Set = require('./_Set'), - noop = require('./noop'), - setToArray = require('./_setToArray'); +/* Built-in method references that are verified to be native. */ +var nativeCreate = getNative(Object, 'create'); -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; +module.exports = nativeCreate; +},{"./_getNative":52}],77:[function(require,module,exports){ /** - * Creates a set object of `values`. + * 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 {Array} values The values to add to the set. - * @returns {Object} Returns the new set. + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. */ -var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { - return new Set(values); -}; +function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; +} -module.exports = createSet; +module.exports = nativeKeysIn; -},{"./_Set":29,"./_setToArray":87,"./noop":104}],57:[function(require,module,exports){ -var getNative = require('./_getNative'); +},{}],78:[function(require,module,exports){ +var freeGlobal = require('./_freeGlobal'); -var defineProperty = (function() { +/** 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 { - var func = getNative(Object, 'defineProperty'); - func({}, '', {}); - return func; + return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); -module.exports = defineProperty; - -},{"./_getNative":60}],58:[function(require,module,exports){ -(function (global){ -/** Detect free variable `global` from Node.js. */ -var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; +module.exports = nodeUtil; -module.exports = freeGlobal; +},{"./_freeGlobal":50}],79:[function(require,module,exports){ +/** Used for built-in method references. */ +var objectProto = Object.prototype; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],59:[function(require,module,exports){ -var isKeyable = require('./_isKeyable'); +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var nativeObjectToString = objectProto.toString; /** - * Gets the data for `map`. + * Converts `value` to a string using `Object.prototype.toString`. * * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; +function objectToString(value) { + return nativeObjectToString.call(value); } -module.exports = getMapData; +module.exports = objectToString; -},{"./_isKeyable":69}],60:[function(require,module,exports){ -var baseIsNative = require('./_baseIsNative'), - getValue = require('./_getValue'); +},{}],80:[function(require,module,exports){ +var apply = require('./_apply'); + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; /** - * Gets the native function at `key` of `object`. + * A specialized version of `baseRest` which transforms the rest array. * * @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`. + * @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 getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; +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); + }; } -module.exports = getNative; +module.exports = overRest; -},{"./_baseIsNative":47,"./_getValue":62}],61:[function(require,module,exports){ -var Symbol = require('./_Symbol'); +},{"./_apply":19}],81:[function(require,module,exports){ +var freeGlobal = require('./_freeGlobal'); -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; +module.exports = root; -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +},{"./_freeGlobal":50}],82:[function(require,module,exports){ +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * Adds `value` to the array cache. * * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. */ -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; +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } -module.exports = getRawTag; +module.exports = setCacheAdd; -},{"./_Symbol":31}],62:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ /** - * Gets the value at `key` of `object`. + * Checks if `value` is in the array cache. * * @private - * @param {Object} [object] The object to query. - * @param {string} key The key of the property to get. - * @returns {*} Returns the property value. + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. */ -function getValue(object, key) { - return object == null ? undefined : object[key]; +function setCacheHas(value) { + return this.__data__.has(value); } -module.exports = getValue; - -},{}],63:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); +module.exports = setCacheHas; +},{}],84:[function(require,module,exports){ /** - * Removes all key-value entries from the hash. + * Converts `set` to an array of its values. * * @private - * @name clear - * @memberOf Hash + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; -} - -module.exports = hashClear; +function setToArray(set) { + var index = -1, + result = Array(set.size); -},{"./_nativeCreate":81}],64:[function(require,module,exports){ -/** - * 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; + set.forEach(function(value) { + result[++index] = value; + }); return result; } -module.exports = hashDelete; - -},{}],65:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used for built-in method references. */ -var objectProto = Object.prototype; +module.exports = setToArray; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +},{}],85:[function(require,module,exports){ +var baseSetToString = require('./_baseSetToString'), + shortOut = require('./_shortOut'); /** - * Gets the hash value for `key`. + * Sets the `toString` method of `func` to return `string`. * * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. */ -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; -} - -module.exports = hashGet; +var setToString = shortOut(baseSetToString); -},{"./_nativeCreate":81}],66:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); +module.exports = setToString; -/** Used for built-in method references. */ -var objectProto = Object.prototype; +},{"./_baseSetToString":39,"./_shortOut":86}],86:[function(require,module,exports){ +/** Used to detect hot functions by number of calls within a span of milliseconds. */ +var HOT_COUNT = 800, + HOT_SPAN = 16; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeNow = Date.now; /** - * Checks if a hash value for `key` exists. + * 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 - * @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`. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} +function shortOut(func) { + var count = 0, + lastCalled = 0; -module.exports = hashHas; + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); -},{"./_nativeCreate":81}],67:[function(require,module,exports){ -var nativeCreate = require('./_nativeCreate'); + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; +} -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +module.exports = shortOut; +},{}],87:[function(require,module,exports){ /** - * Sets the hash `key` to `value`. + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. * * @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. + * @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 hashSet(key, value) { - var data = this.__data__; - this.size += this.has(key) ? 0 : 1; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; +function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; } -module.exports = hashSet; +module.exports = strictIndexOf; -},{"./_nativeCreate":81}],68:[function(require,module,exports){ -var Symbol = require('./_Symbol'), - isArguments = require('./isArguments'), - isArray = require('./isArray'); +},{}],88:[function(require,module,exports){ +/** Used for built-in method references. */ +var funcProto = Function.prototype; -/** Built-in value references. */ -var spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; /** - * Checks if `value` is a flattenable `arguments` object or array. + * Converts `func` to its source code. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. */ -function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; } -module.exports = isFlattenable; +module.exports = toSource; + +},{}],89:[function(require,module,exports){ +var copyObject = require('./_copyObject'), + createAssigner = require('./_createAssigner'), + keysIn = require('./keysIn'); -},{"./_Symbol":31,"./isArguments":96,"./isArray":97}],69:[function(require,module,exports){ /** - * Checks if `value` is suitable for use as unique object key. + * 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). * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * **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 } */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -module.exports = isKeyable; - -},{}],70:[function(require,module,exports){ -var coreJsData = require('./_coreJsData'); +var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); +}); -/** 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) : ''; -}()); +module.exports = assignInWith; +},{"./_copyObject":44,"./_createAssigner":46,"./keysIn":104}],90:[function(require,module,exports){ /** - * Checks if `func` has its source masked. + * Creates a function that returns `value`. * - * @private - * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` is masked, else `false`. + * @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 isMasked(func) { - return !!maskSrcKey && (maskSrcKey in func); +function constant(value) { + return function() { + return value; + }; } -module.exports = isMasked; +module.exports = constant; + +},{}],91:[function(require,module,exports){ +var apply = require('./_apply'), + assignInWith = require('./assignInWith'), + baseRest = require('./_baseRest'), + customDefaultsAssignIn = require('./_customDefaultsAssignIn'); -},{"./_coreJsData":55}],71:[function(require,module,exports){ /** - * Removes all key-value entries from the list cache. + * 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. * - * @private - * @name clear - * @memberOf ListCache + * **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 } */ -function listCacheClear() { - this.__data__ = []; - this.size = 0; -} - -module.exports = listCacheClear; - -},{}],72:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); - -/** Used for built-in method references. */ -var arrayProto = Array.prototype; +var defaults = baseRest(function(args) { + args.push(undefined, customDefaultsAssignIn); + return apply(assignInWith, undefined, args); +}); -/** Built-in value references. */ -var splice = arrayProto.splice; +module.exports = defaults; +},{"./_apply":19,"./_baseRest":38,"./_customDefaultsAssignIn":48,"./assignInWith":89}],92:[function(require,module,exports){ /** - * Removes `key` and its value from the list cache. + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. * - * @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`. + * @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 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; +function eq(value, other) { + return value === other || (value !== value && other !== other); } -module.exports = listCacheDelete; - -},{"./_assocIndexOf":38}],73:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); +module.exports = eq; +},{}],93:[function(require,module,exports){ /** - * Gets the list cache value for `key`. + * This method returns the first argument it receives. * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @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 listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; +function identity(value) { + return value; } -module.exports = listCacheGet; +module.exports = identity; -},{"./_assocIndexOf":38}],74:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); +},{}],94:[function(require,module,exports){ +var baseIsArguments = require('./_baseIsArguments'), + isObjectLike = require('./isObjectLike'); -/** - * 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; -} +/** Used for built-in method references. */ +var objectProto = Object.prototype; -module.exports = listCacheHas; +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; -},{"./_assocIndexOf":38}],75:[function(require,module,exports){ -var assocIndexOf = require('./_assocIndexOf'); +/** Built-in value references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; /** - * Sets the list cache `key` to `value`. + * Checks if `value` is likely an `arguments` object. * - * @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; -} - -module.exports = listCacheSet; - -},{"./_assocIndexOf":38}],76:[function(require,module,exports){ -var Hash = require('./_Hash'), - ListCache = require('./_ListCache'), - Map = require('./_Map'); - -/** - * Removes all key-value entries from the map. + * @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 * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.size = 0; - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -module.exports = mapCacheClear; - -},{"./_Hash":25,"./_ListCache":26,"./_Map":27}],77:[function(require,module,exports){ -var getMapData = require('./_getMapData'); - -/** - * Removes `key` and its value from the map. + * _.isArguments(function() { return arguments; }()); + * // => true * - * @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`. + * _.isArguments([1, 2, 3]); + * // => false */ -function mapCacheDelete(key) { - var result = getMapData(this, key)['delete'](key); - this.size -= result ? 1 : 0; - return result; -} - -module.exports = mapCacheDelete; +var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); +}; -},{"./_getMapData":59}],78:[function(require,module,exports){ -var getMapData = require('./_getMapData'); +module.exports = isArguments; +},{"./_baseIsArguments":33,"./isObjectLike":102}],95:[function(require,module,exports){ /** - * Gets the map value for `key`. + * Checks if `value` is classified as an `Array` object. * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. + * @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 */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} +var isArray = Array.isArray; -module.exports = mapCacheGet; +module.exports = isArray; -},{"./_getMapData":59}],79:[function(require,module,exports){ -var getMapData = require('./_getMapData'); +},{}],96:[function(require,module,exports){ +var isFunction = require('./isFunction'), + isLength = require('./isLength'); /** - * Checks if a map value for `key` exists. + * 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`. * - * @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`. + * @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 mapCacheHas(key) { - return getMapData(this, key).has(key); +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); } -module.exports = mapCacheHas; +module.exports = isArrayLike; -},{"./_getMapData":59}],80:[function(require,module,exports){ -var getMapData = require('./_getMapData'); +},{"./isFunction":99,"./isLength":100}],97:[function(require,module,exports){ +var isArrayLike = require('./isArrayLike'), + isObjectLike = require('./isObjectLike'); /** - * Sets the map `key` to `value`. + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. * - * @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. + * @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 mapCacheSet(key, value) { - var data = getMapData(this, key), - size = data.size; - - data.set(key, value); - this.size += data.size == size ? 0 : 1; - return this; +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); } -module.exports = mapCacheSet; +module.exports = isArrayLikeObject; -},{"./_getMapData":59}],81:[function(require,module,exports){ -var getNative = require('./_getNative'); +},{"./isArrayLike":96,"./isObjectLike":102}],98:[function(require,module,exports){ +var root = require('./_root'), + stubFalse = require('./stubFalse'); -/* Built-in method references that are verified to be native. */ -var nativeCreate = getNative(Object, 'create'); +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; -module.exports = nativeCreate; +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; -},{"./_getNative":60}],82:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) - * of values. - */ -var nativeObjectToString = objectProto.toString; +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; /** - * Converts `value` to a string using `Object.prototype.toString`. + * Checks if `value` is a buffer. * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. + * @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 */ -function objectToString(value) { - return nativeObjectToString.call(value); -} +var isBuffer = nativeIsBuffer || stubFalse; -module.exports = objectToString; +module.exports = isBuffer; -},{}],83:[function(require,module,exports){ -var apply = require('./_apply'); +},{"./_root":81,"./stubFalse":107}],99:[function(require,module,exports){ +var baseGetTag = require('./_baseGetTag'), + isObject = require('./isObject'); -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; +/** `Object#toString` result references. */ +var asyncTag = '[object AsyncFunction]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + proxyTag = '[object Proxy]'; /** - * A specialized version of `baseRest` which transforms the rest array. + * Checks if `value` is classified as a `Function` object. * - * @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); - }; + * @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; } -module.exports = overRest; - -},{"./_apply":32}],84:[function(require,module,exports){ -var freeGlobal = require('./_freeGlobal'); - -/** 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')(); - -module.exports = root; +module.exports = isFunction; -},{"./_freeGlobal":58}],85:[function(require,module,exports){ -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; +},{"./_baseGetTag":31,"./isObject":101}],100:[function(require,module,exports){ +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; /** - * Adds `value` to the array cache. + * Checks if `value` is a valid array-like length. * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. + * **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 setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } -module.exports = setCacheAdd; +module.exports = isLength; -},{}],86:[function(require,module,exports){ +},{}],101:[function(require,module,exports){ /** - * Checks if `value` is in the array cache. + * 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('')`) * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. + * @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 setCacheHas(value) { - return this.__data__.has(value); +function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); } -module.exports = setCacheHas; +module.exports = isObject; -},{}],87:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ /** - * Converts `set` to an array of its values. + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the values. + * @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 setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; +function isObjectLike(value) { + return value != null && typeof value == 'object'; } -module.exports = setToArray; +module.exports = isObjectLike; -},{}],88:[function(require,module,exports){ -var baseSetToString = require('./_baseSetToString'), - shortOut = require('./_shortOut'); +},{}],103:[function(require,module,exports){ +var baseIsTypedArray = require('./_baseIsTypedArray'), + baseUnary = require('./_baseUnary'), + nodeUtil = require('./_nodeUtil'); + +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** - * Sets the `toString` method of `func` to return `string`. + * Checks if `value` is classified as a typed array. * - * @private - * @param {Function} func The function to modify. - * @param {Function} string The `toString` result. - * @returns {Function} Returns `func`. + * @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 setToString = shortOut(baseSetToString); - -module.exports = setToString; +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; -},{"./_baseSetToString":49,"./_shortOut":89}],89:[function(require,module,exports){ -/** Used to detect hot functions by number of calls within a span of milliseconds. */ -var HOT_COUNT = 800, - HOT_SPAN = 16; +module.exports = isTypedArray; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeNow = Date.now; +},{"./_baseIsTypedArray":36,"./_baseUnary":41,"./_nodeUtil":78}],104:[function(require,module,exports){ +var arrayLikeKeys = require('./_arrayLikeKeys'), + baseKeysIn = require('./_baseKeysIn'), + isArrayLike = require('./isArrayLike'); /** - * 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. + * Creates an array of the own and inherited enumerable property names of `object`. * - * @private - * @param {Function} func The function to restrict. - * @returns {Function} Returns the new shortable function. + * **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 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); - }; +function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } -module.exports = shortOut; +module.exports = keysIn; -},{}],90:[function(require,module,exports){ -/** - * 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; -} - -module.exports = strictIndexOf; - -},{}],91:[function(require,module,exports){ -/** Used for built-in method references. */ -var funcProto = Function.prototype; +},{"./_arrayLikeKeys":22,"./_baseKeysIn":37,"./isArrayLike":96}],105:[function(require,module,exports){ +var MapCache = require('./_MapCache'); -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +/** Error message constants. */ +var FUNC_ERROR_TEXT = 'Expected a function'; /** - * Converts `func` to its source code. + * 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. * - * @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 ''; -} - -module.exports = toSource; - -},{}],92:[function(require,module,exports){ -/** - * Creates a function that returns `value`. + * **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 2.4.0 - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new constant function. + * @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 objects = _.times(2, _.constant({ 'a': 1 })); + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; * - * console.log(objects); - * // => [{ 'a': 1 }, { 'a': 1 }] + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] * - * console.log(objects[0] === objects[1]); - * // => true + * 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 constant(value) { - return function() { - return value; +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; } -module.exports = constant; +// Expose `MapCache`. +memoize.Cache = MapCache; -},{}],93:[function(require,module,exports){ +module.exports = memoize; + +},{"./_MapCache":15}],106:[function(require,module,exports){ /** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. + * This method returns `undefined`. * * @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`. + * @since 2.3.0 + * @category Util * @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 + * _.times(2, _.noop); + * // => [undefined, undefined] */ -function eq(value, other) { - return value === other || (value !== value && other !== other); +function noop() { + // No operation performed. } -module.exports = eq; +module.exports = noop; -},{}],94:[function(require,module,exports){ +},{}],107:[function(require,module,exports){ /** - * This method returns the first argument it receives. + * This method returns `false`. * * @static - * @since 0.1.0 * @memberOf _ + * @since 4.13.0 * @category Util - * @param {*} value Any value. - * @returns {*} Returns `value`. + * @returns {boolean} Returns `false`. * @example * - * var object = { 'a': 1 }; - * - * console.log(_.identity(object) === object); - * // => true + * _.times(2, _.stubFalse); + * // => [false, false] */ -function identity(value) { - return value; +function stubFalse() { + return false; } -module.exports = identity; +module.exports = stubFalse; -},{}],95:[function(require,module,exports){ -var arrayMap = require('./_arrayMap'), - baseIntersection = require('./_baseIntersection'), +},{}],108:[function(require,module,exports){ +var baseFlatten = require('./_baseFlatten'), baseRest = require('./_baseRest'), - castArrayLikeObject = require('./_castArrayLikeObject'); + baseUniq = require('./_baseUniq'), + isArrayLikeObject = require('./isArrayLikeObject'); /** - * 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. + * 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 intersecting values. + * @returns {Array} Returns the new array of combined values. * @example * - * _.intersection([2, 1], [2, 3]); - * // => [2] + * _.union([2], [1, 2]); + * // => [2, 1] */ -var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; +var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); -module.exports = intersection; - -},{"./_arrayMap":36,"./_baseIntersection":44,"./_baseRest":48,"./_castArrayLikeObject":54}],96:[function(require,module,exports){ -var baseIsArguments = require('./_baseIsArguments'), - isObjectLike = require('./isObjectLike'); - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +module.exports = union; -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; +},{"./_baseFlatten":30,"./_baseRest":38,"./_baseUniq":42,"./isArrayLikeObject":97}],109:[function(require,module,exports){ +var baseDifference = require('./_baseDifference'), + baseRest = require('./_baseRest'), + isArrayLikeObject = require('./isArrayLikeObject'); /** - * Checks if `value` is likely an `arguments` object. + * 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 Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an `arguments` object, - * else `false`. + * @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 * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false + * _.without([2, 1, 2, 3], 1, 2); + * // => [3] */ -var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); -}; +var without = baseRest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; +}); -module.exports = isArguments; +module.exports = without; -},{"./_baseIsArguments":45,"./isObjectLike":103}],97:[function(require,module,exports){ -/** - * 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; - -module.exports = isArray; - -},{}],98:[function(require,module,exports){ -var isFunction = require('./isFunction'), - isLength = require('./isLength'); - -/** - * 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); -} - -module.exports = isArrayLike; - -},{"./isFunction":100,"./isLength":101}],99:[function(require,module,exports){ -var isArrayLike = require('./isArrayLike'), - isObjectLike = require('./isObjectLike'); - -/** - * 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); -} - -module.exports = isArrayLikeObject; - -},{"./isArrayLike":98,"./isObjectLike":103}],100:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isObject = require('./isObject'); - -/** `Object#toString` result references. */ -var asyncTag = '[object AsyncFunction]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - proxyTag = '[object Proxy]'; - -/** - * 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; -} - -module.exports = isFunction; - -},{"./_baseGetTag":42,"./isObject":102}],101:[function(require,module,exports){ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** - * 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; -} - -module.exports = isLength; - -},{}],102:[function(require,module,exports){ -/** - * 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'); -} - -module.exports = isObject; - -},{}],103:[function(require,module,exports){ -/** - * 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'; -} - -module.exports = isObjectLike; - -},{}],104:[function(require,module,exports){ -/** - * This method returns `undefined`. - * - * @static - * @memberOf _ - * @since 2.3.0 - * @category Util - * @example - * - * _.times(2, _.noop); - * // => [undefined, undefined] - */ -function noop() { - // No operation performed. -} - -module.exports = noop; - -},{}],105:[function(require,module,exports){ -var baseDifference = require('./_baseDifference'), - baseRest = require('./_baseRest'), - isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * 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) - : []; -}); - -module.exports = without; - -},{"./_baseDifference":39,"./_baseRest":48,"./isArrayLikeObject":99}],106:[function(require,module,exports){ -var arrayFilter = require('./_arrayFilter'), - baseRest = require('./_baseRest'), - baseXor = require('./_baseXor'), - isArrayLikeObject = require('./isArrayLikeObject'); - -/** - * 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)); -}); - -module.exports = xor; - -},{"./_arrayFilter":33,"./_baseRest":48,"./_baseXor":52,"./isArrayLikeObject":99}],107:[function(require,module,exports){ -/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var invariant = function(condition, format, a, b, c, d, e, f) { - if ("production" !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -module.exports = invariant; - -},{}],108:[function(require,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; }; - -},{}],109:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _lodashMemoize = require('lodash/memoize'); - -var _lodashMemoize2 = _interopRequireDefault(_lodashMemoize); - -var isFirefox = _lodashMemoize2['default'](function () { - return (/firefox/i.test(navigator.userAgent) - ); -}); - -exports.isFirefox = isFirefox; -var isSafari = _lodashMemoize2['default'](function () { - return Boolean(window.safari); -}); -exports.isSafari = isSafari; -},{"lodash/memoize":212}],110:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; - -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'); } } - -var _lodashUnion = require('lodash/union'); - -var _lodashUnion2 = _interopRequireDefault(_lodashUnion); - -var _lodashWithout = require('lodash/without'); - -var _lodashWithout2 = _interopRequireDefault(_lodashWithout); - -var EnterLeaveCounter = (function () { - function EnterLeaveCounter() { - _classCallCheck(this, EnterLeaveCounter); - - this.entered = []; - } - - EnterLeaveCounter.prototype.enter = function enter(enteringNode) { - var previousLength = this.entered.length; +},{"./_baseDifference":28,"./_baseRest":38,"./isArrayLikeObject":97}],110:[function(require,module,exports){ +'use strict'; - this.entered = _lodashUnion2['default'](this.entered.filter(function (node) { - return document.documentElement.contains(node) && (!node.contains || node.contains(enteringNode)); - }), [enteringNode]); +exports.__esModule = true; - return previousLength === 0 && this.entered.length > 0; - }; +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; }; - EnterLeaveCounter.prototype.leave = function leave(leavingNode) { - var previousLength = this.entered.length; +var _slice = Array.prototype.slice; - this.entered = _lodashWithout2['default'](this.entered.filter(function (node) { - return document.documentElement.contains(node); - }), leavingNode); +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; }; })(); - return previousLength > 0 && this.entered.length === 0; - }; +exports['default'] = DragDropContext; - EnterLeaveCounter.prototype.reset = function reset() { - this.entered = []; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - return EnterLeaveCounter; -})(); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -exports['default'] = EnterLeaveCounter; -module.exports = exports['default']; -},{"lodash/union":215,"lodash/without":216}],111:[function(require,module,exports){ -'use strict'; +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; } -exports.__esModule = true; +var _react = require('react'); -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } +var _react2 = _interopRequireDefault(_react); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _dndCore = require('dnd-core'); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } +var _invariant = require('invariant'); -var _lodashDefaults = require('lodash/defaults'); +var _invariant2 = _interopRequireDefault(_invariant); -var _lodashDefaults2 = _interopRequireDefault(_lodashDefaults); +var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); -var _shallowEqual = require('./shallowEqual'); +var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); -var _shallowEqual2 = _interopRequireDefault(_shallowEqual); +function DragDropContext(backendOrModule) { + _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragDropContext', 'backend'].concat(_slice.call(arguments))); -var _EnterLeaveCounter = require('./EnterLeaveCounter'); + // Auto-detect ES6 default export for people still using ES5 + var backend = undefined; + if (typeof backendOrModule === 'object' && typeof backendOrModule['default'] === 'function') { + backend = backendOrModule['default']; + } else { + backend = backendOrModule; + } -var _EnterLeaveCounter2 = _interopRequireDefault(_EnterLeaveCounter); + _invariant2['default'](typeof backend === 'function', 'Expected the backend to be a function or an ES6 module exporting a default function. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html'); -var _BrowserDetector = require('./BrowserDetector'); + var childContext = { + dragDropManager: new _dndCore.DragDropManager(backend) + }; -var _OffsetUtils = require('./OffsetUtils'); + return function decorateContext(DecoratedComponent) { + var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'; -var _NativeDragSources = require('./NativeDragSources'); + return (function (_Component) { + _inherits(DragDropContextContainer, _Component); -var _NativeTypes = require('./NativeTypes'); + function DragDropContextContainer() { + _classCallCheck(this, DragDropContextContainer); -var NativeTypes = _interopRequireWildcard(_NativeTypes); + _Component.apply(this, arguments); + } -var HTML5Backend = (function () { - function HTML5Backend(manager) { - _classCallCheck(this, HTML5Backend); + DragDropContextContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() { + return this.refs.child; + }; - this.actions = manager.getActions(); - this.monitor = manager.getMonitor(); - this.registry = manager.getRegistry(); + DragDropContextContainer.prototype.getManager = function getManager() { + return childContext.dragDropManager; + }; - this.sourcePreviewNodes = {}; - this.sourcePreviewNodeOptions = {}; - this.sourceNodes = {}; - this.sourceNodeOptions = {}; - this.enterLeaveCounter = new _EnterLeaveCounter2['default'](); + DragDropContextContainer.prototype.getChildContext = function getChildContext() { + return childContext; + }; - this.getSourceClientOffset = this.getSourceClientOffset.bind(this); - this.handleTopDragStart = this.handleTopDragStart.bind(this); - this.handleTopDragStartCapture = this.handleTopDragStartCapture.bind(this); - this.handleTopDragEndCapture = this.handleTopDragEndCapture.bind(this); - this.handleTopDragEnter = this.handleTopDragEnter.bind(this); - this.handleTopDragEnterCapture = this.handleTopDragEnterCapture.bind(this); - this.handleTopDragLeaveCapture = this.handleTopDragLeaveCapture.bind(this); - this.handleTopDragOver = this.handleTopDragOver.bind(this); - this.handleTopDragOverCapture = this.handleTopDragOverCapture.bind(this); - this.handleTopDrop = this.handleTopDrop.bind(this); - this.handleTopDropCapture = this.handleTopDropCapture.bind(this); - this.handleSelectStart = this.handleSelectStart.bind(this); - this.endDragIfSourceWasRemovedFromDOM = this.endDragIfSourceWasRemovedFromDOM.bind(this); - this.endDragNativeItem = this.endDragNativeItem.bind(this); - } + DragDropContextContainer.prototype.render = function render() { + return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, { + ref: 'child' })); + }; - HTML5Backend.prototype.setup = function setup() { - if (typeof window === 'undefined') { - return; - } + _createClass(DragDropContextContainer, null, [{ + key: 'DecoratedComponent', + value: DecoratedComponent, + enumerable: true + }, { + key: 'displayName', + value: 'DragDropContext(' + displayName + ')', + enumerable: true + }, { + key: 'childContextTypes', + value: { + dragDropManager: _react.PropTypes.object.isRequired + }, + enumerable: true + }]); - if (this.constructor.isSetUp) { - throw new Error('Cannot have two HTML5 backends at the same time.'); - } - this.constructor.isSetUp = true; - this.addEventListeners(window); + return DragDropContextContainer; + })(_react.Component); }; +} - HTML5Backend.prototype.teardown = function teardown() { - if (typeof window === 'undefined') { - return; - } +module.exports = exports['default']; +},{"./utils/checkDecoratorArguments":125,"dnd-core":144,"invariant":159,"react":undefined}],111:[function(require,module,exports){ +'use strict'; - this.constructor.isSetUp = false; - this.removeEventListeners(window); - this.clearCurrentDragSourceNode(); - }; +exports.__esModule = true; - HTML5Backend.prototype.addEventListeners = function addEventListeners(target) { - target.addEventListener('dragstart', this.handleTopDragStart); - target.addEventListener('dragstart', this.handleTopDragStartCapture, true); - target.addEventListener('dragend', this.handleTopDragEndCapture, true); - target.addEventListener('dragenter', this.handleTopDragEnter); - target.addEventListener('dragenter', this.handleTopDragEnterCapture, true); - target.addEventListener('dragleave', this.handleTopDragLeaveCapture, true); - target.addEventListener('dragover', this.handleTopDragOver); - target.addEventListener('dragover', this.handleTopDragOverCapture, true); - target.addEventListener('drop', this.handleTopDrop); - target.addEventListener('drop', this.handleTopDropCapture, 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; }; - HTML5Backend.prototype.removeEventListeners = function removeEventListeners(target) { - target.removeEventListener('dragstart', this.handleTopDragStart); - target.removeEventListener('dragstart', this.handleTopDragStartCapture, true); - target.removeEventListener('dragend', this.handleTopDragEndCapture, true); - target.removeEventListener('dragenter', this.handleTopDragEnter); - target.removeEventListener('dragenter', this.handleTopDragEnterCapture, true); - target.removeEventListener('dragleave', this.handleTopDragLeaveCapture, true); - target.removeEventListener('dragover', this.handleTopDragOver); - target.removeEventListener('dragover', this.handleTopDragOverCapture, true); - target.removeEventListener('drop', this.handleTopDrop); - target.removeEventListener('drop', this.handleTopDropCapture, true); - }; +var _slice = Array.prototype.slice; - HTML5Backend.prototype.connectDragPreview = function connectDragPreview(sourceId, node, options) { - var _this = this; +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; }; })(); - this.sourcePreviewNodeOptions[sourceId] = options; - this.sourcePreviewNodes[sourceId] = node; +exports['default'] = DragLayer; - return function () { - delete _this.sourcePreviewNodes[sourceId]; - delete _this.sourcePreviewNodeOptions[sourceId]; - }; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - HTML5Backend.prototype.connectDragSource = function connectDragSource(sourceId, node, options) { - var _this2 = this; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - this.sourceNodes[sourceId] = node; - this.sourceNodeOptions[sourceId] = options; +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 handleDragStart = function handleDragStart(e) { - return _this2.handleDragStart(e, sourceId); - }; - var handleSelectStart = function handleSelectStart(e) { - return _this2.handleSelectStart(e, sourceId); - }; +var _react = require('react'); - node.setAttribute('draggable', true); - node.addEventListener('dragstart', handleDragStart); - node.addEventListener('selectstart', handleSelectStart); +var _react2 = _interopRequireDefault(_react); - return function () { - delete _this2.sourceNodes[sourceId]; - delete _this2.sourceNodeOptions[sourceId]; +var _utilsShallowEqual = require('./utils/shallowEqual'); - node.removeEventListener('dragstart', handleDragStart); - node.removeEventListener('selectstart', handleSelectStart); - node.setAttribute('draggable', false); - }; - }; +var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); - HTML5Backend.prototype.connectDropTarget = function connectDropTarget(targetId, node) { - var _this3 = this; +var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar'); - var handleDragEnter = function handleDragEnter(e) { - return _this3.handleDragEnter(e, targetId); - }; - var handleDragOver = function handleDragOver(e) { - return _this3.handleDragOver(e, targetId); - }; - var handleDrop = function handleDrop(e) { - return _this3.handleDrop(e, targetId); - }; +var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar); - node.addEventListener('dragenter', handleDragEnter); - node.addEventListener('dragover', handleDragOver); - node.addEventListener('drop', handleDrop); +var _lodashIsPlainObject = require('lodash/isPlainObject'); - return function () { - node.removeEventListener('dragenter', handleDragEnter); - node.removeEventListener('dragover', handleDragOver); - node.removeEventListener('drop', handleDrop); - }; - }; +var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); - HTML5Backend.prototype.getCurrentSourceNodeOptions = function getCurrentSourceNodeOptions() { - var sourceId = this.monitor.getSourceId(); - var sourceNodeOptions = this.sourceNodeOptions[sourceId]; +var _invariant = require('invariant'); - return _lodashDefaults2['default'](sourceNodeOptions || {}, { - dropEffect: 'move' - }); - }; +var _invariant2 = _interopRequireDefault(_invariant); - HTML5Backend.prototype.getCurrentDropEffect = function getCurrentDropEffect() { - if (this.isDraggingNativeItem()) { - // It makes more sense to default to 'copy' for native resources - return 'copy'; - } +var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); - return this.getCurrentSourceNodeOptions().dropEffect; - }; +var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); - HTML5Backend.prototype.getCurrentSourcePreviewNodeOptions = function getCurrentSourcePreviewNodeOptions() { - var sourceId = this.monitor.getSourceId(); - var sourcePreviewNodeOptions = this.sourcePreviewNodeOptions[sourceId]; +function DragLayer(collect) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - return _lodashDefaults2['default'](sourcePreviewNodeOptions || {}, { - anchorX: 0.5, - anchorY: 0.5, - captureDraggingState: false - }); - }; + _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragLayer', 'collect[, options]'].concat(_slice.call(arguments))); + _invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer ' + 'to be a function that collects props to inject into the component. ', 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', collect); + _invariant2['default'](_lodashIsPlainObject2['default'](options), 'Expected "options" provided as the second argument to DragLayer to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', options); - HTML5Backend.prototype.getSourceClientOffset = function getSourceClientOffset(sourceId) { - return _OffsetUtils.getNodeClientOffset(this.sourceNodes[sourceId]); - }; + return function decorateLayer(DecoratedComponent) { + var _options$arePropsEqual = options.arePropsEqual; + var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual; - HTML5Backend.prototype.isDraggingNativeItem = function isDraggingNativeItem() { - var itemType = this.monitor.getItemType(); - return Object.keys(NativeTypes).some(function (key) { - return NativeTypes[key] === itemType; - }); - }; + var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'; - HTML5Backend.prototype.beginDragNativeItem = function beginDragNativeItem(type) { - this.clearCurrentDragSourceNode(); + return (function (_Component) { + _inherits(DragLayerContainer, _Component); - var SourceType = _NativeDragSources.createNativeDragSource(type); - this.currentNativeSource = new SourceType(); - this.currentNativeHandle = this.registry.addSource(type, this.currentNativeSource); - this.actions.beginDrag([this.currentNativeHandle]); + DragLayerContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() { + return this.refs.child; + }; - // On Firefox, if mousemove fires, the drag is over but browser failed to tell us. - // This is not true for other browsers. - if (_BrowserDetector.isFirefox()) { - window.addEventListener('mousemove', this.endDragNativeItem, true); - } - }; + DragLayerContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) { + return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state); + }; - HTML5Backend.prototype.endDragNativeItem = function endDragNativeItem() { - if (!this.isDraggingNativeItem()) { - return; - } + _createClass(DragLayerContainer, null, [{ + key: 'DecoratedComponent', + value: DecoratedComponent, + enumerable: true + }, { + key: 'displayName', + value: 'DragLayer(' + displayName + ')', + enumerable: true + }, { + key: 'contextTypes', + value: { + dragDropManager: _react.PropTypes.object.isRequired + }, + enumerable: true + }]); - if (_BrowserDetector.isFirefox()) { - window.removeEventListener('mousemove', this.endDragNativeItem, true); - } + function DragLayerContainer(props, context) { + _classCallCheck(this, DragLayerContainer); - this.actions.endDrag(); - this.registry.removeSource(this.currentNativeHandle); - this.currentNativeHandle = null; - this.currentNativeSource = null; - }; + _Component.call(this, props); + this.handleChange = this.handleChange.bind(this); - HTML5Backend.prototype.endDragIfSourceWasRemovedFromDOM = function endDragIfSourceWasRemovedFromDOM() { - var node = this.currentDragSourceNode; - if (document.body.contains(node)) { - return; - } + this.manager = context.dragDropManager; + _invariant2['default'](typeof this.manager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName); - if (this.clearCurrentDragSourceNode()) { - this.actions.endDrag(); - } - }; + this.state = this.getCurrentState(); + } - HTML5Backend.prototype.setCurrentDragSourceNode = function setCurrentDragSourceNode(node) { - this.clearCurrentDragSourceNode(); - this.currentDragSourceNode = node; - this.currentDragSourceNodeOffset = _OffsetUtils.getNodeClientOffset(node); - this.currentDragSourceNodeOffsetChanged = false; + DragLayerContainer.prototype.componentDidMount = function componentDidMount() { + this.isCurrentlyMounted = true; - // Receiving a mouse event in the middle of a dragging operation - // means it has ended and the drag source node disappeared from DOM, - // so the browser didn't dispatch the dragend event. - window.addEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true); - }; + var monitor = this.manager.getMonitor(); + this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange); + this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange); - HTML5Backend.prototype.clearCurrentDragSourceNode = function clearCurrentDragSourceNode() { - if (this.currentDragSourceNode) { - this.currentDragSourceNode = null; - this.currentDragSourceNodeOffset = null; - this.currentDragSourceNodeOffsetChanged = false; - window.removeEventListener('mousemove', this.endDragIfSourceWasRemovedFromDOM, true); - return true; - } + this.handleChange(); + }; - return false; - }; + DragLayerContainer.prototype.componentWillUnmount = function componentWillUnmount() { + this.isCurrentlyMounted = false; - HTML5Backend.prototype.checkIfCurrentDragSourceRectChanged = function checkIfCurrentDragSourceRectChanged() { - var node = this.currentDragSourceNode; - if (!node) { - return false; - } + this.unsubscribeFromOffsetChange(); + this.unsubscribeFromStateChange(); + }; - if (this.currentDragSourceNodeOffsetChanged) { - return true; - } + DragLayerContainer.prototype.handleChange = function handleChange() { + if (!this.isCurrentlyMounted) { + return; + } - this.currentDragSourceNodeOffsetChanged = !_shallowEqual2['default'](_OffsetUtils.getNodeClientOffset(node), this.currentDragSourceNodeOffset); + var nextState = this.getCurrentState(); + if (!_utilsShallowEqual2['default'](nextState, this.state)) { + this.setState(nextState); + } + }; - return this.currentDragSourceNodeOffsetChanged; - }; + DragLayerContainer.prototype.getCurrentState = function getCurrentState() { + var monitor = this.manager.getMonitor(); + return collect(monitor); + }; - HTML5Backend.prototype.handleTopDragStartCapture = function handleTopDragStartCapture() { - this.clearCurrentDragSourceNode(); - this.dragStartSourceIds = []; - }; + DragLayerContainer.prototype.render = function render() { + return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, { + ref: 'child' })); + }; - HTML5Backend.prototype.handleDragStart = function handleDragStart(e, sourceId) { - this.dragStartSourceIds.unshift(sourceId); + return DragLayerContainer; + })(_react.Component); }; +} - HTML5Backend.prototype.handleTopDragStart = function handleTopDragStart(e) { - var _this4 = this; - - var dragStartSourceIds = this.dragStartSourceIds; +module.exports = exports['default']; +},{"./utils/checkDecoratorArguments":125,"./utils/shallowEqual":128,"./utils/shallowEqualScalar":129,"invariant":159,"lodash/isPlainObject":241,"react":undefined}],112:[function(require,module,exports){ +'use strict'; - this.dragStartSourceIds = null; +exports.__esModule = true; +var _slice = Array.prototype.slice; +exports['default'] = DragSource; - var clientOffset = _OffsetUtils.getEventClientOffset(e); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - // Don't publish the source just yet (see why below) - this.actions.beginDrag(dragStartSourceIds, { - publishSource: false, - getSourceClientOffset: this.getSourceClientOffset, - clientOffset: clientOffset - }); +var _invariant = require('invariant'); - var dataTransfer = e.dataTransfer; +var _invariant2 = _interopRequireDefault(_invariant); - var nativeType = _NativeDragSources.matchNativeItemType(dataTransfer); +var _lodashIsPlainObject = require('lodash/isPlainObject'); - if (this.monitor.isDragging()) { - if (typeof dataTransfer.setDragImage === 'function') { - // Use custom drag image if user specifies it. - // If child drag source refuses drag but parent agrees, - // use parent's node as drag image. Neither works in IE though. - var sourceId = this.monitor.getSourceId(); - var sourceNode = this.sourceNodes[sourceId]; - var dragPreview = this.sourcePreviewNodes[sourceId] || sourceNode; +var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); - var _getCurrentSourcePreviewNodeOptions = this.getCurrentSourcePreviewNodeOptions(); +var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); - var anchorX = _getCurrentSourcePreviewNodeOptions.anchorX; - var anchorY = _getCurrentSourcePreviewNodeOptions.anchorY; +var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); - var anchorPoint = { anchorX: anchorX, anchorY: anchorY }; - var dragPreviewOffset = _OffsetUtils.getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint); - dataTransfer.setDragImage(dragPreview, dragPreviewOffset.x, dragPreviewOffset.y); - } +var _decorateHandler = require('./decorateHandler'); - try { - // Firefox won't drag without setting data - dataTransfer.setData('application/json', {}); - } catch (err) {} - // IE doesn't support MIME types in setData +var _decorateHandler2 = _interopRequireDefault(_decorateHandler); - // Store drag source node so we can check whether - // it is removed from DOM and trigger endDrag manually. - this.setCurrentDragSourceNode(e.target); +var _registerSource = require('./registerSource'); - // Now we are ready to publish the drag source.. or are we not? +var _registerSource2 = _interopRequireDefault(_registerSource); - var _getCurrentSourcePreviewNodeOptions2 = this.getCurrentSourcePreviewNodeOptions(); +var _createSourceFactory = require('./createSourceFactory'); - var captureDraggingState = _getCurrentSourcePreviewNodeOptions2.captureDraggingState; +var _createSourceFactory2 = _interopRequireDefault(_createSourceFactory); - if (!captureDraggingState) { - // Usually we want to publish it in the next tick so that browser - // is able to screenshot the current (not yet dragging) state. - // - // It also neatly avoids a situation where render() returns null - // in the same tick for the source element, and browser freaks out. - setTimeout(function () { - return _this4.actions.publishDragSource(); - }); - } else { - // In some cases the user may want to override this behavior, e.g. - // to work around IE not supporting custom drag previews. - // - // When using a custom drag layer, the only way to prevent - // the default drag preview from drawing in IE is to screenshot - // the dragging state in which the node itself has zero opacity - // and height. In this case, though, returning null from render() - // will abruptly end the dragging, which is not obvious. - // - // This is the reason such behavior is strictly opt-in. - this.actions.publishDragSource(); - } - } else if (nativeType) { - // A native item (such as URL) dragged from inside the document - this.beginDragNativeItem(nativeType); - } else if (!dataTransfer.types && (!e.target.hasAttribute || !e.target.hasAttribute('draggable'))) { - // Looks like a Safari bug: dataTransfer.types is null, but there was no draggable. - // Just let it drag. It's a native type (URL or text) and will be picked up in dragenter handler. - return; - } else { - // If by this time no drag source reacted, tell browser not to drag. - e.preventDefault(); - } - }; +var _createSourceMonitor = require('./createSourceMonitor'); - HTML5Backend.prototype.handleTopDragEndCapture = function handleTopDragEndCapture() { - if (this.clearCurrentDragSourceNode()) { - // Firefox can dispatch this event in an infinite loop - // if dragend handler does something like showing an alert. - // Only proceed if we have not handled it already. - this.actions.endDrag(); - } - }; +var _createSourceMonitor2 = _interopRequireDefault(_createSourceMonitor); - HTML5Backend.prototype.handleTopDragEnterCapture = function handleTopDragEnterCapture(e) { - this.dragEnterTargetIds = []; +var _createSourceConnector = require('./createSourceConnector'); - var isFirstEnter = this.enterLeaveCounter.enter(e.target); - if (!isFirstEnter || this.monitor.isDragging()) { - return; - } +var _createSourceConnector2 = _interopRequireDefault(_createSourceConnector); - var dataTransfer = e.dataTransfer; +var _utilsIsValidType = require('./utils/isValidType'); - var nativeType = _NativeDragSources.matchNativeItemType(dataTransfer); +var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType); - if (nativeType) { - // A native item (such as file or URL) dragged from outside the document - this.beginDragNativeItem(nativeType); - } - }; +function DragSource(type, spec, collect) { + var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; - HTML5Backend.prototype.handleDragEnter = function handleDragEnter(e, targetId) { - this.dragEnterTargetIds.unshift(targetId); + _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragSource', 'type, spec, collect[, options]'].concat(_slice.call(arguments))); + var getType = type; + if (typeof type !== 'function') { + _invariant2['default'](_utilsIsValidType2['default'](type), 'Expected "type" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', type); + getType = function () { + return type; + }; + } + _invariant2['default'](_lodashIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', spec); + var createSource = _createSourceFactory2['default'](spec); + _invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect); + _invariant2['default'](_lodashIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect); + + return function decorateSource(DecoratedComponent) { + return _decorateHandler2['default']({ + connectBackend: function connectBackend(backend, sourceId) { + return backend.connectDragSource(sourceId); + }, + containerDisplayName: 'DragSource', + createHandler: createSource, + registerHandler: _registerSource2['default'], + createMonitor: _createSourceMonitor2['default'], + createConnector: _createSourceConnector2['default'], + DecoratedComponent: DecoratedComponent, + getType: getType, + collect: collect, + options: options + }); }; +} - HTML5Backend.prototype.handleTopDragEnter = function handleTopDragEnter(e) { - var _this5 = this; +module.exports = exports['default']; +},{"./createSourceConnector":115,"./createSourceFactory":116,"./createSourceMonitor":117,"./decorateHandler":121,"./registerSource":123,"./utils/checkDecoratorArguments":125,"./utils/isValidType":127,"invariant":159,"lodash/isPlainObject":241}],113:[function(require,module,exports){ +'use strict'; - var dragEnterTargetIds = this.dragEnterTargetIds; +exports.__esModule = true; +var _slice = Array.prototype.slice; +exports['default'] = DropTarget; - this.dragEnterTargetIds = []; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - if (!this.monitor.isDragging()) { - // This is probably a native item type we don't understand. - return; - } +var _invariant = require('invariant'); - if (!_BrowserDetector.isFirefox()) { - // Don't emit hover in `dragenter` on Firefox due to an edge case. - // If the target changes position as the result of `dragenter`, Firefox - // will still happily dispatch `dragover` despite target being no longer - // there. The easy solution is to only fire `hover` in `dragover` on FF. - this.actions.hover(dragEnterTargetIds, { - clientOffset: _OffsetUtils.getEventClientOffset(e) - }); - } +var _invariant2 = _interopRequireDefault(_invariant); - var canDrop = dragEnterTargetIds.some(function (targetId) { - return _this5.monitor.canDropOnTarget(targetId); - }); +var _lodashIsPlainObject = require('lodash/isPlainObject'); - if (canDrop) { - // IE requires this to fire dragover events - e.preventDefault(); - e.dataTransfer.dropEffect = this.getCurrentDropEffect(); - } - }; +var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); - HTML5Backend.prototype.handleTopDragOverCapture = function handleTopDragOverCapture() { - this.dragOverTargetIds = []; - }; +var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); - HTML5Backend.prototype.handleDragOver = function handleDragOver(e, targetId) { - this.dragOverTargetIds.unshift(targetId); - }; +var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); - HTML5Backend.prototype.handleTopDragOver = function handleTopDragOver(e) { - var _this6 = this; +var _decorateHandler = require('./decorateHandler'); - var dragOverTargetIds = this.dragOverTargetIds; +var _decorateHandler2 = _interopRequireDefault(_decorateHandler); - this.dragOverTargetIds = []; +var _registerTarget = require('./registerTarget'); - if (!this.monitor.isDragging()) { - // This is probably a native item type we don't understand. - // Prevent default "drop and blow away the whole document" action. - e.preventDefault(); - e.dataTransfer.dropEffect = 'none'; - return; - } +var _registerTarget2 = _interopRequireDefault(_registerTarget); - this.actions.hover(dragOverTargetIds, { - clientOffset: _OffsetUtils.getEventClientOffset(e) - }); +var _createTargetFactory = require('./createTargetFactory'); - var canDrop = dragOverTargetIds.some(function (targetId) { - return _this6.monitor.canDropOnTarget(targetId); - }); +var _createTargetFactory2 = _interopRequireDefault(_createTargetFactory); - if (canDrop) { - // Show user-specified drop effect. - e.preventDefault(); - e.dataTransfer.dropEffect = this.getCurrentDropEffect(); - } else if (this.isDraggingNativeItem()) { - // Don't show a nice cursor but still prevent default - // "drop and blow away the whole document" action. - e.preventDefault(); - e.dataTransfer.dropEffect = 'none'; - } else if (this.checkIfCurrentDragSourceRectChanged()) { - // Prevent animating to incorrect position. - // Drop effect must be other than 'none' to prevent animation. - e.preventDefault(); - e.dataTransfer.dropEffect = 'move'; - } - }; +var _createTargetMonitor = require('./createTargetMonitor'); - HTML5Backend.prototype.handleTopDragLeaveCapture = function handleTopDragLeaveCapture(e) { - if (this.isDraggingNativeItem()) { - e.preventDefault(); - } +var _createTargetMonitor2 = _interopRequireDefault(_createTargetMonitor); - var isLastLeave = this.enterLeaveCounter.leave(e.target); - if (!isLastLeave) { - return; - } +var _createTargetConnector = require('./createTargetConnector'); - if (this.isDraggingNativeItem()) { - this.endDragNativeItem(); - } - }; +var _createTargetConnector2 = _interopRequireDefault(_createTargetConnector); - HTML5Backend.prototype.handleTopDropCapture = function handleTopDropCapture(e) { - this.dropTargetIds = []; - e.preventDefault(); +var _utilsIsValidType = require('./utils/isValidType'); - if (this.isDraggingNativeItem()) { - this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer); - } +var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType); - this.enterLeaveCounter.reset(); - }; +function DropTarget(type, spec, collect) { + var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; - HTML5Backend.prototype.handleDrop = function handleDrop(e, targetId) { - this.dropTargetIds.unshift(targetId); + _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DropTarget', 'type, spec, collect[, options]'].concat(_slice.call(arguments))); + var getType = type; + if (typeof type !== 'function') { + _invariant2['default'](_utilsIsValidType2['default'](type, true), 'Expected "type" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', type); + getType = function () { + return type; + }; + } + _invariant2['default'](_lodashIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', spec); + var createTarget = _createTargetFactory2['default'](spec); + _invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect); + _invariant2['default'](_lodashIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect); + + return function decorateTarget(DecoratedComponent) { + return _decorateHandler2['default']({ + connectBackend: function connectBackend(backend, targetId) { + return backend.connectDropTarget(targetId); + }, + containerDisplayName: 'DropTarget', + createHandler: createTarget, + registerHandler: _registerTarget2['default'], + createMonitor: _createTargetMonitor2['default'], + createConnector: _createTargetConnector2['default'], + DecoratedComponent: DecoratedComponent, + getType: getType, + collect: collect, + options: options + }); }; +} - HTML5Backend.prototype.handleTopDrop = function handleTopDrop(e) { - var dropTargetIds = this.dropTargetIds; +module.exports = exports['default']; +},{"./createTargetConnector":118,"./createTargetFactory":119,"./createTargetMonitor":120,"./decorateHandler":121,"./registerTarget":124,"./utils/checkDecoratorArguments":125,"./utils/isValidType":127,"invariant":159,"lodash/isPlainObject":241}],114:[function(require,module,exports){ +'use strict'; - this.dropTargetIds = []; +exports.__esModule = true; +exports['default'] = areOptionsEqual; - this.actions.hover(dropTargetIds, { - clientOffset: _OffsetUtils.getEventClientOffset(e) - }); - this.actions.drop(); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - if (this.isDraggingNativeItem()) { - this.endDragNativeItem(); - } else { - this.endDragIfSourceWasRemovedFromDOM(); - } - }; +var _utilsShallowEqual = require('./utils/shallowEqual'); - HTML5Backend.prototype.handleSelectStart = function handleSelectStart(e) { - var target = e.target; +var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); - // Only IE requires us to explicitly say - // we want drag drop operation to start - if (typeof target.dragDrop !== 'function') { - return; - } +function areOptionsEqual(nextOptions, currentOptions) { + if (currentOptions === nextOptions) { + return true; + } - // Inputs and textareas should be selectable - if (target.tagName === 'INPUT' || target.tagName === 'SELECT' || target.tagName === 'TEXTAREA' || target.isContentEditable) { - return; - } + return currentOptions !== null && nextOptions !== null && _utilsShallowEqual2['default'](currentOptions, nextOptions); +} - // For other targets, ask IE - // to enable drag and drop - e.preventDefault(); - target.dragDrop(); - }; +module.exports = exports['default']; +},{"./utils/shallowEqual":128}],115:[function(require,module,exports){ +'use strict'; - return HTML5Backend; -})(); +exports.__esModule = true; +exports['default'] = createSourceConnector; + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var _wrapConnectorHooks = require('./wrapConnectorHooks'); + +var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks); + +var _areOptionsEqual = require('./areOptionsEqual'); -exports['default'] = HTML5Backend; -module.exports = exports['default']; -},{"./BrowserDetector":109,"./EnterLeaveCounter":110,"./NativeDragSources":113,"./NativeTypes":114,"./OffsetUtils":115,"./shallowEqual":118,"lodash/defaults":198}],112:[function(require,module,exports){ -"use strict"; +var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual); -exports.__esModule = true; +function createSourceConnector(backend) { + var currentHandlerId = undefined; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + var currentDragSourceNode = undefined; + var currentDragSourceOptions = undefined; + var disconnectCurrentDragSource = undefined; -var MonotonicInterpolant = (function () { - function MonotonicInterpolant(xs, ys) { - _classCallCheck(this, MonotonicInterpolant); + var currentDragPreviewNode = undefined; + var currentDragPreviewOptions = undefined; + var disconnectCurrentDragPreview = undefined; - var length = xs.length; + function reconnectDragSource() { + if (disconnectCurrentDragSource) { + disconnectCurrentDragSource(); + disconnectCurrentDragSource = null; + } - // Rearrange xs and ys so that xs is sorted - var indexes = []; - for (var i = 0; i < length; i++) { - indexes.push(i); + if (currentHandlerId && currentDragSourceNode) { + disconnectCurrentDragSource = backend.connectDragSource(currentHandlerId, currentDragSourceNode, currentDragSourceOptions); } - indexes.sort(function (a, b) { - return xs[a] < xs[b] ? -1 : 1; - }); + } - // Get consecutive differences and slopes - var dys = []; - var dxs = []; - var ms = []; - var dx = undefined; - var dy = undefined; - for (var i = 0; i < length - 1; i++) { - dx = xs[i + 1] - xs[i]; - dy = ys[i + 1] - ys[i]; - dxs.push(dx); - dys.push(dy); - ms.push(dy / dx); + function reconnectDragPreview() { + if (disconnectCurrentDragPreview) { + disconnectCurrentDragPreview(); + disconnectCurrentDragPreview = null; } - // Get degree-1 coefficients - var c1s = [ms[0]]; - for (var i = 0; i < dxs.length - 1; i++) { - var _m = ms[i]; - var mNext = ms[i + 1]; - if (_m * mNext <= 0) { - c1s.push(0); - } else { - dx = dxs[i]; - var dxNext = dxs[i + 1]; - var common = dx + dxNext; - c1s.push(3 * common / ((common + dxNext) / _m + (common + dx) / mNext)); - } + if (currentHandlerId && currentDragPreviewNode) { + disconnectCurrentDragPreview = backend.connectDragPreview(currentHandlerId, currentDragPreviewNode, currentDragPreviewOptions); } - c1s.push(ms[ms.length - 1]); + } - // Get degree-2 and degree-3 coefficients - var c2s = []; - var c3s = []; - var m = undefined; - for (var i = 0; i < c1s.length - 1; i++) { - m = ms[i]; - var c1 = c1s[i]; - var invDx = 1 / dxs[i]; - var common = c1 + c1s[i + 1] - m - m; - c2s.push((m - c1 - common) * invDx); - c3s.push(common * invDx * invDx); + function receiveHandlerId(handlerId) { + if (handlerId === currentHandlerId) { + return; } - this.xs = xs; - this.ys = ys; - this.c1s = c1s; - this.c2s = c2s; - this.c3s = c3s; + currentHandlerId = handlerId; + reconnectDragSource(); + reconnectDragPreview(); } - MonotonicInterpolant.prototype.interpolate = function interpolate(x) { - var xs = this.xs; - var ys = this.ys; - var c1s = this.c1s; - var c2s = this.c2s; - var c3s = this.c3s; + var hooks = _wrapConnectorHooks2['default']({ + dragSource: function connectDragSource(node, options) { + if (node === currentDragSourceNode && _areOptionsEqual2['default'](options, currentDragSourceOptions)) { + return; + } - // The rightmost point in the dataset should give an exact result - var i = xs.length - 1; - if (x === xs[i]) { - return ys[i]; - } + currentDragSourceNode = node; + currentDragSourceOptions = options; - // Search for the interval x is in, returning the corresponding y if x is one of the original xs - var low = 0; - var high = c3s.length - 1; - var mid = undefined; - while (low <= high) { - mid = Math.floor(0.5 * (low + high)); - var xHere = xs[mid]; - if (xHere < x) { - low = mid + 1; - } else if (xHere > x) { - high = mid - 1; - } else { - return ys[mid]; + reconnectDragSource(); + }, + + dragPreview: function connectDragPreview(node, options) { + if (node === currentDragPreviewNode && _areOptionsEqual2['default'](options, currentDragPreviewOptions)) { + return; } + + currentDragPreviewNode = node; + currentDragPreviewOptions = options; + + reconnectDragPreview(); } - i = Math.max(0, high); + }); - // Interpolate - var diff = x - xs[i]; - var diffSq = diff * diff; - return ys[i] + c1s[i] * diff + c2s[i] * diffSq + c3s[i] * diff * diffSq; + return { + receiveHandlerId: receiveHandlerId, + hooks: hooks }; +} - return MonotonicInterpolant; -})(); - -exports["default"] = MonotonicInterpolant; -module.exports = exports["default"]; -},{}],113:[function(require,module,exports){ +module.exports = exports['default']; +},{"./areOptionsEqual":114,"./wrapConnectorHooks":130}],116:[function(require,module,exports){ +(function (process){ 'use strict'; exports.__esModule = true; +exports['default'] = createSourceFactory; -var _nativeTypesConfig; - -exports.createNativeDragSource = createNativeDragSource; -exports.matchNativeItemType = matchNativeItemType; - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } +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 _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; } - -var _NativeTypes = require('./NativeTypes'); +var _invariant = require('invariant'); -var NativeTypes = _interopRequireWildcard(_NativeTypes); +var _invariant2 = _interopRequireDefault(_invariant); -function getDataFromDataTransfer(dataTransfer, typesToTry, defaultValue) { - var result = typesToTry.reduce(function (resultSoFar, typeToTry) { - return resultSoFar || dataTransfer.getData(typeToTry); - }, null); +var _lodashIsPlainObject = require('lodash/isPlainObject'); - return result != null ? // eslint-disable-line eqeqeq - result : defaultValue; -} +var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); -var nativeTypesConfig = (_nativeTypesConfig = {}, _defineProperty(_nativeTypesConfig, NativeTypes.FILE, { - exposeProperty: 'files', - matchesTypes: ['Files'], - getData: function getData(dataTransfer) { - return Array.prototype.slice.call(dataTransfer.files); - } -}), _defineProperty(_nativeTypesConfig, NativeTypes.URL, { - exposeProperty: 'urls', - matchesTypes: ['Url', 'text/uri-list'], - getData: function getData(dataTransfer, matchesTypes) { - return getDataFromDataTransfer(dataTransfer, matchesTypes, '').split('\n'); - } -}), _defineProperty(_nativeTypesConfig, NativeTypes.TEXT, { - exposeProperty: 'text', - matchesTypes: ['Text', 'text/plain'], - getData: function getData(dataTransfer, matchesTypes) { - return getDataFromDataTransfer(dataTransfer, matchesTypes, ''); - } -}), _nativeTypesConfig); +var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'canDrag', 'isDragging', 'endDrag']; +var REQUIRED_SPEC_METHODS = ['beginDrag']; -function createNativeDragSource(type) { - var _nativeTypesConfig$type = nativeTypesConfig[type]; - var exposeProperty = _nativeTypesConfig$type.exposeProperty; - var matchesTypes = _nativeTypesConfig$type.matchesTypes; - var getData = _nativeTypesConfig$type.getData; +function createSourceFactory(spec) { + Object.keys(spec).forEach(function (key) { + _invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key); + _invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]); + }); + REQUIRED_SPEC_METHODS.forEach(function (key) { + _invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]); + }); - return (function () { - function NativeDragSource() { - _classCallCheck(this, NativeDragSource); + var Source = (function () { + function Source(monitor) { + _classCallCheck(this, Source); - this.item = Object.defineProperties({}, _defineProperty({}, exposeProperty, { - get: function get() { - console.warn( // eslint-disable-line no-console - 'Browser doesn\'t allow reading "' + exposeProperty + '" until the drop event.'); - return null; - }, - configurable: true, - enumerable: true - })); + this.monitor = monitor; + this.props = null; + this.component = null; } - NativeDragSource.prototype.mutateItemByReadingDataTransfer = function mutateItemByReadingDataTransfer(dataTransfer) { - delete this.item[exposeProperty]; - this.item[exposeProperty] = getData(dataTransfer, matchesTypes); + Source.prototype.receiveProps = function receiveProps(props) { + this.props = props; }; - NativeDragSource.prototype.canDrag = function canDrag() { - return true; + Source.prototype.receiveComponent = function receiveComponent(component) { + this.component = component; }; - NativeDragSource.prototype.beginDrag = function beginDrag() { - return this.item; + Source.prototype.canDrag = function canDrag() { + if (!spec.canDrag) { + return true; + } + + return spec.canDrag(this.props, this.monitor); }; - NativeDragSource.prototype.isDragging = function isDragging(monitor, handle) { - return handle === monitor.getSourceId(); + Source.prototype.isDragging = function isDragging(globalMonitor, sourceId) { + if (!spec.isDragging) { + return sourceId === globalMonitor.getSourceId(); + } + + return spec.isDragging(this.props, this.monitor); + }; + + Source.prototype.beginDrag = function beginDrag() { + var item = spec.beginDrag(this.props, this.monitor, this.component); + if (process.env.NODE_ENV !== 'production') { + _invariant2['default'](_lodashIsPlainObject2['default'](item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', item); + } + return item; }; - NativeDragSource.prototype.endDrag = function endDrag() {}; - - return NativeDragSource; - })(); -} + Source.prototype.endDrag = function endDrag() { + if (!spec.endDrag) { + return; + } -function matchNativeItemType(dataTransfer) { - var dataTransferTypes = Array.prototype.slice.call(dataTransfer.types || []); + spec.endDrag(this.props, this.monitor, this.component); + }; - return Object.keys(nativeTypesConfig).filter(function (nativeItemType) { - var matchesTypes = nativeTypesConfig[nativeItemType].matchesTypes; + return Source; + })(); - return matchesTypes.some(function (t) { - return dataTransferTypes.indexOf(t) > -1; - }); - })[0] || null; + return function createSource(monitor) { + return new Source(monitor); + }; } -},{"./NativeTypes":114}],114:[function(require,module,exports){ -'use strict'; -exports.__esModule = true; -var FILE = '__NATIVE_FILE__'; -exports.FILE = FILE; -var URL = '__NATIVE_URL__'; -exports.URL = URL; -var TEXT = '__NATIVE_TEXT__'; -exports.TEXT = TEXT; -},{}],115:[function(require,module,exports){ +module.exports = exports['default']; +}).call(this,require('_process')) +},{"_process":1,"invariant":159,"lodash/isPlainObject":241}],117:[function(require,module,exports){ 'use strict'; exports.__esModule = true; -exports.getNodeClientOffset = getNodeClientOffset; -exports.getEventClientOffset = getEventClientOffset; -exports.getDragPreviewOffset = getDragPreviewOffset; +exports['default'] = createSourceMonitor; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _BrowserDetector = require('./BrowserDetector'); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -var _MonotonicInterpolant = require('./MonotonicInterpolant'); +var _invariant = require('invariant'); -var _MonotonicInterpolant2 = _interopRequireDefault(_MonotonicInterpolant); +var _invariant2 = _interopRequireDefault(_invariant); -var ELEMENT_NODE = 1; +var isCallingCanDrag = false; +var isCallingIsDragging = false; -function getNodeClientOffset(node) { - var el = node.nodeType === ELEMENT_NODE ? node : node.parentElement; +var SourceMonitor = (function () { + function SourceMonitor(manager) { + _classCallCheck(this, SourceMonitor); - if (!el) { - return null; + this.internalMonitor = manager.getMonitor(); } - var _el$getBoundingClientRect = el.getBoundingClientRect(); + SourceMonitor.prototype.receiveHandlerId = function receiveHandlerId(sourceId) { + this.sourceId = sourceId; + }; - var top = _el$getBoundingClientRect.top; - var left = _el$getBoundingClientRect.left; + SourceMonitor.prototype.canDrag = function canDrag() { + _invariant2['default'](!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html'); - return { x: left, y: top }; -} + try { + isCallingCanDrag = true; + return this.internalMonitor.canDragSource(this.sourceId); + } finally { + isCallingCanDrag = false; + } + }; -function getEventClientOffset(e) { - return { - x: e.clientX, - y: e.clientY + SourceMonitor.prototype.isDragging = function isDragging() { + _invariant2['default'](!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html'); + + try { + isCallingIsDragging = true; + return this.internalMonitor.isDraggingSource(this.sourceId); + } finally { + isCallingIsDragging = false; + } }; -} -function getDragPreviewOffset(sourceNode, dragPreview, clientOffset, anchorPoint) { - // The browsers will use the image intrinsic size under different conditions. - // Firefox only cares if it's an image, but WebKit also wants it to be detached. - var isImage = dragPreview.nodeName === 'IMG' && (_BrowserDetector.isFirefox() || !document.documentElement.contains(dragPreview)); - var dragPreviewNode = isImage ? sourceNode : dragPreview; + SourceMonitor.prototype.getItemType = function getItemType() { + return this.internalMonitor.getItemType(); + }; - var dragPreviewNodeOffsetFromClient = getNodeClientOffset(dragPreviewNode); - var offsetFromDragPreview = { - x: clientOffset.x - dragPreviewNodeOffsetFromClient.x, - y: clientOffset.y - dragPreviewNodeOffsetFromClient.y + SourceMonitor.prototype.getItem = function getItem() { + return this.internalMonitor.getItem(); }; - var sourceWidth = sourceNode.offsetWidth; - var sourceHeight = sourceNode.offsetHeight; - var anchorX = anchorPoint.anchorX; - var anchorY = anchorPoint.anchorY; + SourceMonitor.prototype.getDropResult = function getDropResult() { + return this.internalMonitor.getDropResult(); + }; - var dragPreviewWidth = isImage ? dragPreview.width : sourceWidth; - var dragPreviewHeight = isImage ? dragPreview.height : sourceHeight; + SourceMonitor.prototype.didDrop = function didDrop() { + return this.internalMonitor.didDrop(); + }; - // Work around @2x coordinate discrepancies in browsers - if (_BrowserDetector.isSafari() && isImage) { - dragPreviewHeight /= window.devicePixelRatio; - dragPreviewWidth /= window.devicePixelRatio; - } else if (_BrowserDetector.isFirefox() && !isImage) { - dragPreviewHeight *= window.devicePixelRatio; - dragPreviewWidth *= window.devicePixelRatio; - } + SourceMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() { + return this.internalMonitor.getInitialClientOffset(); + }; - // Interpolate coordinates depending on anchor point - // If you know a simpler way to do this, let me know - var interpolantX = new _MonotonicInterpolant2['default']([0, 0.5, 1], [ - // Dock to the left - offsetFromDragPreview.x, - // Align at the center - offsetFromDragPreview.x / sourceWidth * dragPreviewWidth, - // Dock to the right - offsetFromDragPreview.x + dragPreviewWidth - sourceWidth]); - var interpolantY = new _MonotonicInterpolant2['default']([0, 0.5, 1], [ - // Dock to the top - offsetFromDragPreview.y, - // Align at the center - offsetFromDragPreview.y / sourceHeight * dragPreviewHeight, - // Dock to the bottom - offsetFromDragPreview.y + dragPreviewHeight - sourceHeight]); - var x = interpolantX.interpolate(anchorX); - var y = interpolantY.interpolate(anchorY); + SourceMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() { + return this.internalMonitor.getInitialSourceClientOffset(); + }; - // Work around Safari 8 positioning bug - if (_BrowserDetector.isSafari() && isImage) { - // We'll have to wait for @3x to see if this is entirely correct - y += (window.devicePixelRatio - 1) * dragPreviewHeight; - } + SourceMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() { + return this.internalMonitor.getSourceClientOffset(); + }; - return { x: x, y: y }; -} -},{"./BrowserDetector":109,"./MonotonicInterpolant":112}],116:[function(require,module,exports){ -'use strict'; + SourceMonitor.prototype.getClientOffset = function getClientOffset() { + return this.internalMonitor.getClientOffset(); + }; -exports.__esModule = true; -exports['default'] = getEmptyImage; -var emptyImage = undefined; + SourceMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() { + return this.internalMonitor.getDifferenceFromInitialOffset(); + }; -function getEmptyImage() { - if (!emptyImage) { - emptyImage = new Image(); - emptyImage.src = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; - } + return SourceMonitor; +})(); - return emptyImage; +function createSourceMonitor(manager) { + return new SourceMonitor(manager); } module.exports = exports['default']; -},{}],117:[function(require,module,exports){ +},{"invariant":159}],118:[function(require,module,exports){ 'use strict'; exports.__esModule = true; -exports['default'] = createHTML5Backend; - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } +exports['default'] = createTargetConnector; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var _HTML5Backend = require('./HTML5Backend'); +var _wrapConnectorHooks = require('./wrapConnectorHooks'); -var _HTML5Backend2 = _interopRequireDefault(_HTML5Backend); +var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks); -var _getEmptyImage = require('./getEmptyImage'); +var _areOptionsEqual = require('./areOptionsEqual'); -var _getEmptyImage2 = _interopRequireDefault(_getEmptyImage); +var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual); -var _NativeTypes = require('./NativeTypes'); +function createTargetConnector(backend) { + var currentHandlerId = undefined; -var NativeTypes = _interopRequireWildcard(_NativeTypes); + var currentDropTargetNode = undefined; + var currentDropTargetOptions = undefined; + var disconnectCurrentDropTarget = undefined; -exports.NativeTypes = NativeTypes; -exports.getEmptyImage = _getEmptyImage2['default']; + function reconnectDropTarget() { + if (disconnectCurrentDropTarget) { + disconnectCurrentDropTarget(); + disconnectCurrentDropTarget = null; + } -function createHTML5Backend(manager) { - return new _HTML5Backend2['default'](manager); + if (currentHandlerId && currentDropTargetNode) { + disconnectCurrentDropTarget = backend.connectDropTarget(currentHandlerId, currentDropTargetNode, currentDropTargetOptions); + } + } + + function receiveHandlerId(handlerId) { + if (handlerId === currentHandlerId) { + return; + } + + currentHandlerId = handlerId; + reconnectDropTarget(); + } + + var hooks = _wrapConnectorHooks2['default']({ + dropTarget: function connectDropTarget(node, options) { + if (node === currentDropTargetNode && _areOptionsEqual2['default'](options, currentDropTargetOptions)) { + return; + } + + currentDropTargetNode = node; + currentDropTargetOptions = options; + + reconnectDropTarget(); + } + }); + + return { + receiveHandlerId: receiveHandlerId, + hooks: hooks + }; } -},{"./HTML5Backend":111,"./NativeTypes":114,"./getEmptyImage":116}],118:[function(require,module,exports){ -"use strict"; + +module.exports = exports['default']; +},{"./areOptionsEqual":114,"./wrapConnectorHooks":130}],119:[function(require,module,exports){ +(function (process){ +'use strict'; exports.__esModule = true; -exports["default"] = shallowEqual; +exports['default'] = createTargetFactory; -function shallowEqual(objA, objB) { - if (objA === objB) { - return true; - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - var keysA = Object.keys(objA); - var keysB = Object.keys(objB); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + +var _invariant = require('invariant'); + +var _invariant2 = _interopRequireDefault(_invariant); + +var _lodashIsPlainObject = require('lodash/isPlainObject'); + +var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); - if (keysA.length !== keysB.length) { - return false; - } +var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop']; - // Test for A's keys different from B. - var hasOwn = Object.prototype.hasOwnProperty; - for (var i = 0; i < keysA.length; i++) { - if (!hasOwn.call(objB, keysA[i]) || objA[keysA[i]] !== objB[keysA[i]]) { - return false; - } +function createTargetFactory(spec) { + Object.keys(spec).forEach(function (key) { + _invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key); + _invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]); + }); - var valA = objA[keysA[i]]; - var valB = objB[keysA[i]]; + var Target = (function () { + function Target(monitor) { + _classCallCheck(this, Target); - if (valA !== valB) { - return false; + this.monitor = monitor; + this.props = null; + this.component = null; } - } - return true; -} + Target.prototype.receiveProps = function receiveProps(props) { + this.props = props; + }; -module.exports = exports["default"]; -},{}],119:[function(require,module,exports){ -arguments[4][25][0].apply(exports,arguments) -},{"./_hashClear":162,"./_hashDelete":163,"./_hashGet":164,"./_hashHas":165,"./_hashSet":166,"dup":25}],120:[function(require,module,exports){ -arguments[4][26][0].apply(exports,arguments) -},{"./_listCacheClear":173,"./_listCacheDelete":174,"./_listCacheGet":175,"./_listCacheHas":176,"./_listCacheSet":177,"dup":26}],121:[function(require,module,exports){ -arguments[4][27][0].apply(exports,arguments) -},{"./_getNative":159,"./_root":188,"dup":27}],122:[function(require,module,exports){ -arguments[4][28][0].apply(exports,arguments) -},{"./_mapCacheClear":178,"./_mapCacheDelete":179,"./_mapCacheGet":180,"./_mapCacheHas":181,"./_mapCacheSet":182,"dup":28}],123:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./_getNative":159,"./_root":188,"dup":29}],124:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"./_MapCache":122,"./_setCacheAdd":189,"./_setCacheHas":190,"dup":30}],125:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"./_root":188,"dup":31}],126:[function(require,module,exports){ -arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],127:[function(require,module,exports){ -arguments[4][34][0].apply(exports,arguments) -},{"./_baseIndexOf":140,"dup":34}],128:[function(require,module,exports){ -arguments[4][35][0].apply(exports,arguments) -},{"dup":35}],129:[function(require,module,exports){ -var baseTimes = require('./_baseTimes'), - isArguments = require('./isArguments'), - isArray = require('./isArray'), - isBuffer = require('./isBuffer'), - isIndex = require('./_isIndex'), - isTypedArray = require('./isTypedArray'); + Target.prototype.receiveMonitor = function receiveMonitor(monitor) { + this.monitor = monitor; + }; -/** Used for built-in method references. */ -var objectProto = Object.prototype; + Target.prototype.receiveComponent = function receiveComponent(component) { + this.component = component; + }; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + Target.prototype.canDrop = function canDrop() { + if (!spec.canDrop) { + return true; + } -/** - * 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; + return spec.canDrop(this.props, this.monitor); + }; - 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; -} + Target.prototype.hover = function hover() { + if (!spec.hover) { + return; + } -module.exports = arrayLikeKeys; + spec.hover(this.props, this.monitor, this.component); + }; -},{"./_baseTimes":148,"./_isIndex":168,"./isArguments":201,"./isArray":202,"./isBuffer":205,"./isTypedArray":210}],130:[function(require,module,exports){ -arguments[4][36][0].apply(exports,arguments) -},{"dup":36}],131:[function(require,module,exports){ -arguments[4][37][0].apply(exports,arguments) -},{"dup":37}],132:[function(require,module,exports){ -var eq = require('./eq'); + Target.prototype.drop = function drop() { + if (!spec.drop) { + return; + } -/** Used for built-in method references. */ -var objectProto = Object.prototype; + var dropResult = spec.drop(this.props, this.monitor, this.component); + if (process.env.NODE_ENV !== 'production') { + _invariant2['default'](typeof dropResult === 'undefined' || _lodashIsPlainObject2['default'](dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', dropResult); + } + return dropResult; + }; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + return Target; + })(); -/** - * Used by `_.defaults` to customize its `_.assignIn` use. - * - * @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 assignInDefaults(objValue, srcValue, key, object) { - if (objValue === undefined || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { - return srcValue; - } - return objValue; + return function createTarget(monitor) { + return new Target(monitor); + }; } -module.exports = assignInDefaults; - -},{"./eq":199}],133:[function(require,module,exports){ -var baseAssignValue = require('./_baseAssignValue'), - eq = require('./eq'); +module.exports = exports['default']; +}).call(this,require('_process')) +},{"_process":1,"invariant":159,"lodash/isPlainObject":241}],120:[function(require,module,exports){ +'use strict'; -/** Used for built-in method references. */ -var objectProto = Object.prototype; +exports.__esModule = true; +exports['default'] = createTargetMonitor; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -/** - * 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); - } -} +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -module.exports = assignValue; +var _invariant = require('invariant'); -},{"./_baseAssignValue":135,"./eq":199}],134:[function(require,module,exports){ -arguments[4][38][0].apply(exports,arguments) -},{"./eq":199,"dup":38}],135:[function(require,module,exports){ -var defineProperty = require('./_defineProperty'); +var _invariant2 = _interopRequireDefault(_invariant); -/** - * 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; - } -} +var isCallingCanDrop = false; -module.exports = baseAssignValue; +var TargetMonitor = (function () { + function TargetMonitor(manager) { + _classCallCheck(this, TargetMonitor); -},{"./_defineProperty":156}],136:[function(require,module,exports){ -arguments[4][39][0].apply(exports,arguments) -},{"./_SetCache":124,"./_arrayIncludes":127,"./_arrayIncludesWith":128,"./_arrayMap":130,"./_baseUnary":149,"./_cacheHas":151,"dup":39}],137:[function(require,module,exports){ -arguments[4][40][0].apply(exports,arguments) -},{"dup":40}],138:[function(require,module,exports){ -arguments[4][41][0].apply(exports,arguments) -},{"./_arrayPush":131,"./_isFlattenable":167,"dup":41}],139:[function(require,module,exports){ -arguments[4][42][0].apply(exports,arguments) -},{"./_Symbol":125,"./_getRawTag":160,"./_objectToString":186,"dup":42}],140:[function(require,module,exports){ -arguments[4][43][0].apply(exports,arguments) -},{"./_baseFindIndex":137,"./_baseIsNaN":142,"./_strictIndexOf":194,"dup":43}],141:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"./_baseGetTag":139,"./isObjectLike":209,"dup":45}],142:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"dup":46}],143:[function(require,module,exports){ -arguments[4][47][0].apply(exports,arguments) -},{"./_isMasked":171,"./_toSource":195,"./isFunction":206,"./isObject":208,"dup":47}],144:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - isLength = require('./isLength'), - isObjectLike = require('./isObjectLike'); + this.internalMonitor = manager.getMonitor(); + } -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; + TargetMonitor.prototype.receiveHandlerId = function receiveHandlerId(targetId) { + this.targetId = targetId; + }; -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]'; + TargetMonitor.prototype.canDrop = function canDrop() { + _invariant2['default'](!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html'); -/** 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; + try { + isCallingCanDrop = true; + return this.internalMonitor.canDropOnTarget(this.targetId); + } finally { + isCallingCanDrop = false; + } + }; -/** - * 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)]; -} + TargetMonitor.prototype.isOver = function isOver(options) { + return this.internalMonitor.isOverTarget(this.targetId, options); + }; -module.exports = baseIsTypedArray; + TargetMonitor.prototype.getItemType = function getItemType() { + return this.internalMonitor.getItemType(); + }; -},{"./_baseGetTag":139,"./isLength":207,"./isObjectLike":209}],145:[function(require,module,exports){ -var isObject = require('./isObject'), - isPrototype = require('./_isPrototype'), - nativeKeysIn = require('./_nativeKeysIn'); + TargetMonitor.prototype.getItem = function getItem() { + return this.internalMonitor.getItem(); + }; -/** Used for built-in method references. */ -var objectProto = Object.prototype; + TargetMonitor.prototype.getDropResult = function getDropResult() { + return this.internalMonitor.getDropResult(); + }; -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; + TargetMonitor.prototype.didDrop = function didDrop() { + return this.internalMonitor.didDrop(); + }; -/** - * 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 = []; + TargetMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() { + return this.internalMonitor.getInitialClientOffset(); + }; - for (var key in object) { - if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; -} + TargetMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() { + return this.internalMonitor.getInitialSourceClientOffset(); + }; -module.exports = baseKeysIn; + TargetMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() { + return this.internalMonitor.getSourceClientOffset(); + }; -},{"./_isPrototype":172,"./_nativeKeysIn":184,"./isObject":208}],146:[function(require,module,exports){ -arguments[4][48][0].apply(exports,arguments) -},{"./_overRest":187,"./_setToString":192,"./identity":200,"dup":48}],147:[function(require,module,exports){ -arguments[4][49][0].apply(exports,arguments) -},{"./_defineProperty":156,"./constant":197,"./identity":200,"dup":49}],148:[function(require,module,exports){ -/** - * 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); + TargetMonitor.prototype.getClientOffset = function getClientOffset() { + return this.internalMonitor.getClientOffset(); + }; - while (++index < n) { - result[index] = iteratee(index); - } - return result; + TargetMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() { + return this.internalMonitor.getDifferenceFromInitialOffset(); + }; + + return TargetMonitor; +})(); + +function createTargetMonitor(manager) { + return new TargetMonitor(manager); } -module.exports = baseTimes; +module.exports = exports['default']; +},{"invariant":159}],121:[function(require,module,exports){ +(function (process){ +'use strict'; -},{}],149:[function(require,module,exports){ -arguments[4][50][0].apply(exports,arguments) -},{"dup":50}],150:[function(require,module,exports){ -arguments[4][51][0].apply(exports,arguments) -},{"./_SetCache":124,"./_arrayIncludes":127,"./_arrayIncludesWith":128,"./_cacheHas":151,"./_createSet":155,"./_setToArray":191,"dup":51}],151:[function(require,module,exports){ -arguments[4][53][0].apply(exports,arguments) -},{"dup":53}],152:[function(require,module,exports){ -var assignValue = require('./_assignValue'), - baseAssignValue = require('./_baseAssignValue'); +exports.__esModule = true; -/** - * 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 _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 index = -1, - length = props.length; +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; }; })(); - while (++index < length) { - var key = props[index]; +exports['default'] = decorateHandler; - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : undefined; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - if (newValue === undefined) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; -} +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -module.exports = copyObject; +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; } -},{"./_assignValue":133,"./_baseAssignValue":135}],153:[function(require,module,exports){ -arguments[4][55][0].apply(exports,arguments) -},{"./_root":188,"dup":55}],154:[function(require,module,exports){ -var baseRest = require('./_baseRest'), - isIterateeCall = require('./_isIterateeCall'); +var _react = require('react'); -/** - * 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; +var _react2 = _interopRequireDefault(_react); - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined; +var _disposables = require('disposables'); - 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; - }); -} +var _utilsShallowEqual = require('./utils/shallowEqual'); -module.exports = createAssigner; +var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); -},{"./_baseRest":146,"./_isIterateeCall":169}],155:[function(require,module,exports){ -arguments[4][56][0].apply(exports,arguments) -},{"./_Set":123,"./_setToArray":191,"./noop":213,"dup":56}],156:[function(require,module,exports){ -arguments[4][57][0].apply(exports,arguments) -},{"./_getNative":159,"dup":57}],157:[function(require,module,exports){ -arguments[4][58][0].apply(exports,arguments) -},{"dup":58}],158:[function(require,module,exports){ -arguments[4][59][0].apply(exports,arguments) -},{"./_isKeyable":170,"dup":59}],159:[function(require,module,exports){ -arguments[4][60][0].apply(exports,arguments) -},{"./_baseIsNative":143,"./_getValue":161,"dup":60}],160:[function(require,module,exports){ -arguments[4][61][0].apply(exports,arguments) -},{"./_Symbol":125,"dup":61}],161:[function(require,module,exports){ -arguments[4][62][0].apply(exports,arguments) -},{"dup":62}],162:[function(require,module,exports){ -arguments[4][63][0].apply(exports,arguments) -},{"./_nativeCreate":183,"dup":63}],163:[function(require,module,exports){ -arguments[4][64][0].apply(exports,arguments) -},{"dup":64}],164:[function(require,module,exports){ -arguments[4][65][0].apply(exports,arguments) -},{"./_nativeCreate":183,"dup":65}],165:[function(require,module,exports){ -arguments[4][66][0].apply(exports,arguments) -},{"./_nativeCreate":183,"dup":66}],166:[function(require,module,exports){ -arguments[4][67][0].apply(exports,arguments) -},{"./_nativeCreate":183,"dup":67}],167:[function(require,module,exports){ -arguments[4][68][0].apply(exports,arguments) -},{"./_Symbol":125,"./isArguments":201,"./isArray":202,"dup":68}],168:[function(require,module,exports){ -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar'); -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; +var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar); -/** - * 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); -} +var _lodashIsPlainObject = require('lodash/isPlainObject'); -module.exports = isIndex; +var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); -},{}],169:[function(require,module,exports){ -var eq = require('./eq'), - isArrayLike = require('./isArrayLike'), - isIndex = require('./_isIndex'), - isObject = require('./isObject'); +var _invariant = require('invariant'); -/** - * 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; -} +var _invariant2 = _interopRequireDefault(_invariant); + +function decorateHandler(_ref) { + var DecoratedComponent = _ref.DecoratedComponent; + var createHandler = _ref.createHandler; + var createMonitor = _ref.createMonitor; + var createConnector = _ref.createConnector; + var registerHandler = _ref.registerHandler; + var containerDisplayName = _ref.containerDisplayName; + var getType = _ref.getType; + var collect = _ref.collect; + var options = _ref.options; + var _options$arePropsEqual = options.arePropsEqual; + var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual; -module.exports = isIterateeCall; + var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'; -},{"./_isIndex":168,"./eq":199,"./isArrayLike":203,"./isObject":208}],170:[function(require,module,exports){ -arguments[4][69][0].apply(exports,arguments) -},{"dup":69}],171:[function(require,module,exports){ -arguments[4][70][0].apply(exports,arguments) -},{"./_coreJsData":153,"dup":70}],172:[function(require,module,exports){ -/** Used for built-in method references. */ -var objectProto = Object.prototype; + return (function (_Component) { + _inherits(DragDropContainer, _Component); -/** - * 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; + DragDropContainer.prototype.getHandlerId = function getHandlerId() { + return this.handlerId; + }; - return value === proto; -} + DragDropContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() { + return this.decoratedComponentInstance; + }; -module.exports = isPrototype; + DragDropContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) { + return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state); + }; -},{}],173:[function(require,module,exports){ -arguments[4][71][0].apply(exports,arguments) -},{"dup":71}],174:[function(require,module,exports){ -arguments[4][72][0].apply(exports,arguments) -},{"./_assocIndexOf":134,"dup":72}],175:[function(require,module,exports){ -arguments[4][73][0].apply(exports,arguments) -},{"./_assocIndexOf":134,"dup":73}],176:[function(require,module,exports){ -arguments[4][74][0].apply(exports,arguments) -},{"./_assocIndexOf":134,"dup":74}],177:[function(require,module,exports){ -arguments[4][75][0].apply(exports,arguments) -},{"./_assocIndexOf":134,"dup":75}],178:[function(require,module,exports){ -arguments[4][76][0].apply(exports,arguments) -},{"./_Hash":119,"./_ListCache":120,"./_Map":121,"dup":76}],179:[function(require,module,exports){ -arguments[4][77][0].apply(exports,arguments) -},{"./_getMapData":158,"dup":77}],180:[function(require,module,exports){ -arguments[4][78][0].apply(exports,arguments) -},{"./_getMapData":158,"dup":78}],181:[function(require,module,exports){ -arguments[4][79][0].apply(exports,arguments) -},{"./_getMapData":158,"dup":79}],182:[function(require,module,exports){ -arguments[4][80][0].apply(exports,arguments) -},{"./_getMapData":158,"dup":80}],183:[function(require,module,exports){ -arguments[4][81][0].apply(exports,arguments) -},{"./_getNative":159,"dup":81}],184:[function(require,module,exports){ -/** - * 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); + _createClass(DragDropContainer, null, [{ + key: 'DecoratedComponent', + value: DecoratedComponent, + enumerable: true + }, { + key: 'displayName', + value: containerDisplayName + '(' + displayName + ')', + enumerable: true + }, { + key: 'contextTypes', + value: { + dragDropManager: _react.PropTypes.object.isRequired + }, + enumerable: true + }]); + + function DragDropContainer(props, context) { + _classCallCheck(this, DragDropContainer); + + _Component.call(this, props, context); + this.handleChange = this.handleChange.bind(this); + this.handleChildRef = this.handleChildRef.bind(this); + + _invariant2['default'](typeof this.context.dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName); + + this.manager = this.context.dragDropManager; + this.handlerMonitor = createMonitor(this.manager); + this.handlerConnector = createConnector(this.manager.getBackend()); + this.handler = createHandler(this.handlerMonitor); + + this.disposable = new _disposables.SerialDisposable(); + this.receiveProps(props); + this.state = this.getCurrentState(); + this.dispose(); } - } - return result; -} -module.exports = nativeKeysIn; + DragDropContainer.prototype.componentDidMount = function componentDidMount() { + this.isCurrentlyMounted = true; + this.disposable = new _disposables.SerialDisposable(); + this.currentType = null; + this.receiveProps(this.props); + this.handleChange(); + }; -},{}],185:[function(require,module,exports){ -var freeGlobal = require('./_freeGlobal'); + DragDropContainer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { + if (!arePropsEqual(nextProps, this.props)) { + this.receiveProps(nextProps); + this.handleChange(); + } + }; -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + DragDropContainer.prototype.componentWillUnmount = function componentWillUnmount() { + this.dispose(); + this.isCurrentlyMounted = false; + }; -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + DragDropContainer.prototype.receiveProps = function receiveProps(props) { + this.handler.receiveProps(props); + this.receiveType(getType(props)); + }; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; + DragDropContainer.prototype.receiveType = function receiveType(type) { + if (type === this.currentType) { + return; + } -/** Detect free variable `process` from Node.js. */ -var freeProcess = moduleExports && freeGlobal.process; + this.currentType = type; -/** Used to access faster Node.js helpers. */ -var nodeUtil = (function() { - try { - return freeProcess && freeProcess.binding('util'); - } catch (e) {} -}()); + var _registerHandler = registerHandler(type, this.handler, this.manager); -module.exports = nodeUtil; + var handlerId = _registerHandler.handlerId; + var unregister = _registerHandler.unregister; -},{"./_freeGlobal":157}],186:[function(require,module,exports){ -arguments[4][82][0].apply(exports,arguments) -},{"dup":82}],187:[function(require,module,exports){ -arguments[4][83][0].apply(exports,arguments) -},{"./_apply":126,"dup":83}],188:[function(require,module,exports){ -arguments[4][84][0].apply(exports,arguments) -},{"./_freeGlobal":157,"dup":84}],189:[function(require,module,exports){ -arguments[4][85][0].apply(exports,arguments) -},{"dup":85}],190:[function(require,module,exports){ -arguments[4][86][0].apply(exports,arguments) -},{"dup":86}],191:[function(require,module,exports){ -arguments[4][87][0].apply(exports,arguments) -},{"dup":87}],192:[function(require,module,exports){ -arguments[4][88][0].apply(exports,arguments) -},{"./_baseSetToString":147,"./_shortOut":193,"dup":88}],193:[function(require,module,exports){ -arguments[4][89][0].apply(exports,arguments) -},{"dup":89}],194:[function(require,module,exports){ -arguments[4][90][0].apply(exports,arguments) -},{"dup":90}],195:[function(require,module,exports){ -arguments[4][91][0].apply(exports,arguments) -},{"dup":91}],196:[function(require,module,exports){ -var copyObject = require('./_copyObject'), - createAssigner = require('./_createAssigner'), - keysIn = require('./keysIn'); + this.handlerId = handlerId; + this.handlerMonitor.receiveHandlerId(handlerId); + this.handlerConnector.receiveHandlerId(handlerId); -/** - * 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); -}); + var globalMonitor = this.manager.getMonitor(); + var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] }); -module.exports = assignInWith; + this.disposable.setDisposable(new _disposables.CompositeDisposable(new _disposables.Disposable(unsubscribe), new _disposables.Disposable(unregister))); + }; -},{"./_copyObject":152,"./_createAssigner":154,"./keysIn":211}],197:[function(require,module,exports){ -arguments[4][92][0].apply(exports,arguments) -},{"dup":92}],198:[function(require,module,exports){ -var apply = require('./_apply'), - assignInDefaults = require('./_assignInDefaults'), - assignInWith = require('./assignInWith'), - baseRest = require('./_baseRest'); + DragDropContainer.prototype.handleChange = function handleChange() { + if (!this.isCurrentlyMounted) { + return; + } -/** - * 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, assignInDefaults); - return apply(assignInWith, undefined, args); -}); + var nextState = this.getCurrentState(); + if (!_utilsShallowEqual2['default'](nextState, this.state)) { + this.setState(nextState); + } + }; -module.exports = defaults; + DragDropContainer.prototype.dispose = function dispose() { + this.disposable.dispose(); + this.handlerConnector.receiveHandlerId(null); + }; -},{"./_apply":126,"./_assignInDefaults":132,"./_baseRest":146,"./assignInWith":196}],199:[function(require,module,exports){ -arguments[4][93][0].apply(exports,arguments) -},{"dup":93}],200:[function(require,module,exports){ -arguments[4][94][0].apply(exports,arguments) -},{"dup":94}],201:[function(require,module,exports){ -arguments[4][96][0].apply(exports,arguments) -},{"./_baseIsArguments":141,"./isObjectLike":209,"dup":96}],202:[function(require,module,exports){ -arguments[4][97][0].apply(exports,arguments) -},{"dup":97}],203:[function(require,module,exports){ -arguments[4][98][0].apply(exports,arguments) -},{"./isFunction":206,"./isLength":207,"dup":98}],204:[function(require,module,exports){ -arguments[4][99][0].apply(exports,arguments) -},{"./isArrayLike":203,"./isObjectLike":209,"dup":99}],205:[function(require,module,exports){ -var root = require('./_root'), - stubFalse = require('./stubFalse'); + DragDropContainer.prototype.handleChildRef = function handleChildRef(component) { + this.decoratedComponentInstance = component; + this.handler.receiveComponent(component); + }; -/** Detect free variable `exports`. */ -var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + DragDropContainer.prototype.getCurrentState = function getCurrentState() { + var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor); -/** Detect free variable `module`. */ -var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + if (process.env.NODE_ENV !== 'production') { + _invariant2['default'](_lodashIsPlainObject2['default'](nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState); + } + + return nextState; + }; + + DragDropContainer.prototype.render = function render() { + return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, { + ref: this.handleChildRef })); + }; -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = freeModule && freeModule.exports === freeExports; + return DragDropContainer; + })(_react.Component); +} -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined; +module.exports = exports['default']; +}).call(this,require('_process')) +},{"./utils/shallowEqual":128,"./utils/shallowEqualScalar":129,"_process":1,"disposables":134,"invariant":159,"lodash/isPlainObject":241,"react":undefined}],122:[function(require,module,exports){ +'use strict'; -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined; +exports.__esModule = true; -/** - * 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; +function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } -module.exports = isBuffer; +var _DragDropContext = require('./DragDropContext'); -},{"./_root":188,"./stubFalse":214}],206:[function(require,module,exports){ -arguments[4][100][0].apply(exports,arguments) -},{"./_baseGetTag":139,"./isObject":208,"dup":100}],207:[function(require,module,exports){ -arguments[4][101][0].apply(exports,arguments) -},{"dup":101}],208:[function(require,module,exports){ -arguments[4][102][0].apply(exports,arguments) -},{"dup":102}],209:[function(require,module,exports){ -arguments[4][103][0].apply(exports,arguments) -},{"dup":103}],210:[function(require,module,exports){ -var baseIsTypedArray = require('./_baseIsTypedArray'), - baseUnary = require('./_baseUnary'), - nodeUtil = require('./_nodeUtil'); +exports.DragDropContext = _interopRequire(_DragDropContext); -/* Node.js helper references. */ -var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; +var _DragLayer = require('./DragLayer'); -/** - * 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; +exports.DragLayer = _interopRequire(_DragLayer); -module.exports = isTypedArray; +var _DragSource = require('./DragSource'); -},{"./_baseIsTypedArray":144,"./_baseUnary":149,"./_nodeUtil":185}],211:[function(require,module,exports){ -var arrayLikeKeys = require('./_arrayLikeKeys'), - baseKeysIn = require('./_baseKeysIn'), - isArrayLike = require('./isArrayLike'); +exports.DragSource = _interopRequire(_DragSource); -/** - * 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); -} +var _DropTarget = require('./DropTarget'); -module.exports = keysIn; +exports.DropTarget = _interopRequire(_DropTarget); +},{"./DragDropContext":110,"./DragLayer":111,"./DragSource":112,"./DropTarget":113}],123:[function(require,module,exports){ +"use strict"; -},{"./_arrayLikeKeys":129,"./_baseKeysIn":145,"./isArrayLike":203}],212:[function(require,module,exports){ -var MapCache = require('./_MapCache'); +exports.__esModule = true; +exports["default"] = registerSource; -/** Error message constants. */ -var FUNC_ERROR_TEXT = 'Expected a function'; +function registerSource(type, source, manager) { + var registry = manager.getRegistry(); + var sourceId = registry.addSource(type, source); -/** - * 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); + function unregisterSource() { + registry.removeSource(sourceId); } - 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; + return { + handlerId: sourceId, + unregister: unregisterSource }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; } -// Expose `MapCache`. -memoize.Cache = MapCache; - -module.exports = memoize; - -},{"./_MapCache":122}],213:[function(require,module,exports){ -arguments[4][104][0].apply(exports,arguments) -},{"dup":104}],214:[function(require,module,exports){ -/** - * 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; -} +module.exports = exports["default"]; +},{}],124:[function(require,module,exports){ +"use strict"; -module.exports = stubFalse; +exports.__esModule = true; +exports["default"] = registerTarget; -},{}],215:[function(require,module,exports){ -var baseFlatten = require('./_baseFlatten'), - baseRest = require('./_baseRest'), - baseUniq = require('./_baseUniq'), - isArrayLikeObject = require('./isArrayLikeObject'); +function registerTarget(type, target, manager) { + var registry = manager.getRegistry(); + var targetId = registry.addTarget(type, target); -/** - * 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)); -}); + function unregisterTarget() { + registry.removeTarget(targetId); + } -module.exports = union; + return { + handlerId: targetId, + unregister: unregisterTarget + }; +} -},{"./_baseFlatten":138,"./_baseRest":146,"./_baseUniq":150,"./isArrayLikeObject":204}],216:[function(require,module,exports){ -arguments[4][105][0].apply(exports,arguments) -},{"./_baseDifference":136,"./_baseRest":146,"./isArrayLikeObject":204,"dup":105}],217:[function(require,module,exports){ +module.exports = exports["default"]; +},{}],125:[function(require,module,exports){ +(function (process){ 'use strict'; exports.__esModule = true; +exports['default'] = checkDecoratorArguments; -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; }; +function checkDecoratorArguments(functionName, signature) { + if (process.env.NODE_ENV !== 'production') { + for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } -var _slice = Array.prototype.slice; + for (var i = 0; i < args.length; i++) { + var arg = args[i]; + if (arg && arg.prototype && arg.prototype.render) { + console.error( // eslint-disable-line no-console + 'You seem to be applying the arguments in the wrong order. ' + ('It should be ' + functionName + '(' + signature + ')(Component), not the other way around. ') + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order'); + return; + } + } + } +} -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; }; })(); +module.exports = exports['default']; +}).call(this,require('_process')) +},{"_process":1}],126:[function(require,module,exports){ +'use strict'; -exports['default'] = DragDropContext; +exports.__esModule = true; +exports['default'] = cloneWithRef; 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'); } } +var _invariant = require('invariant'); -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 _invariant2 = _interopRequireDefault(_invariant); var _react = require('react'); -var _react2 = _interopRequireDefault(_react); +function cloneWithRef(element, newRef) { + var previousRef = element.ref; + _invariant2['default'](typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a or
. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute'); -var _dndCore = require('dnd-core'); + if (!previousRef) { + // When there is no ref on the element, use the new ref directly + return _react.cloneElement(element, { + ref: newRef + }); + } -var _invariant = require('invariant'); + return _react.cloneElement(element, { + ref: function ref(node) { + newRef(node); -var _invariant2 = _interopRequireDefault(_invariant); + if (previousRef) { + previousRef(node); + } + } + }); +} -var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); +module.exports = exports['default']; +},{"invariant":159,"react":undefined}],127:[function(require,module,exports){ +'use strict'; -var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); +exports.__esModule = true; +exports['default'] = isValidType; -function DragDropContext(backendOrModule) { - _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragDropContext', 'backend'].concat(_slice.call(arguments))); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - // Auto-detect ES6 default export for people still using ES5 - var backend = undefined; - if (typeof backendOrModule === 'object' && typeof backendOrModule['default'] === 'function') { - backend = backendOrModule['default']; - } else { - backend = backendOrModule; - } +var _lodashIsArray = require('lodash/isArray'); - _invariant2['default'](typeof backend === 'function', 'Expected the backend to be a function or an ES6 module exporting a default function. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html'); +var _lodashIsArray2 = _interopRequireDefault(_lodashIsArray); - var childContext = { - dragDropManager: new _dndCore.DragDropManager(backend) - }; +function isValidType(type, allowArray) { + return typeof type === 'string' || typeof type === 'symbol' || allowArray && _lodashIsArray2['default'](type) && type.every(function (t) { + return isValidType(t, false); + }); +} - return function decorateContext(DecoratedComponent) { - var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'; +module.exports = exports['default']; +},{"lodash/isArray":234}],128:[function(require,module,exports){ +arguments[4][11][0].apply(exports,arguments) +},{"dup":11}],129:[function(require,module,exports){ +'use strict'; - return (function (_Component) { - _inherits(DragDropContextContainer, _Component); +exports.__esModule = true; +exports['default'] = shallowEqualScalar; - function DragDropContextContainer() { - _classCallCheck(this, DragDropContextContainer); +function shallowEqualScalar(objA, objB) { + if (objA === objB) { + return true; + } - _Component.apply(this, arguments); - } + if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { + return false; + } - DragDropContextContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() { - return this.refs.child; - }; + var keysA = Object.keys(objA); + var keysB = Object.keys(objB); - DragDropContextContainer.prototype.getManager = function getManager() { - return childContext.dragDropManager; - }; + if (keysA.length !== keysB.length) { + return false; + } - DragDropContextContainer.prototype.getChildContext = function getChildContext() { - return childContext; - }; + // Test for A's keys different from B. + var hasOwn = Object.prototype.hasOwnProperty; + for (var i = 0; i < keysA.length; i++) { + if (!hasOwn.call(objB, keysA[i])) { + return false; + } - DragDropContextContainer.prototype.render = function render() { - return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, { - ref: 'child' })); - }; + var valA = objA[keysA[i]]; + var valB = objB[keysA[i]]; - _createClass(DragDropContextContainer, null, [{ - key: 'DecoratedComponent', - value: DecoratedComponent, - enumerable: true - }, { - key: 'displayName', - value: 'DragDropContext(' + displayName + ')', - enumerable: true - }, { - key: 'childContextTypes', - value: { - dragDropManager: _react.PropTypes.object.isRequired - }, - enumerable: true - }]); + if (valA !== valB || typeof valA === 'object' || typeof valB === 'object') { + return false; + } + } - return DragDropContextContainer; - })(_react.Component); - }; + return true; } module.exports = exports['default']; -},{"./utils/checkDecoratorArguments":232,"dnd-core":16,"invariant":107,"react":undefined}],218:[function(require,module,exports){ +},{}],130:[function(require,module,exports){ 'use strict'; exports.__esModule = 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 _slice = Array.prototype.slice; - -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; }; })(); - -exports['default'] = DragLayer; +exports['default'] = wrapConnectorHooks; 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'); } } +var _utilsCloneWithRef = require('./utils/cloneWithRef'); -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 _utilsCloneWithRef2 = _interopRequireDefault(_utilsCloneWithRef); var _react = require('react'); -var _react2 = _interopRequireDefault(_react); - -var _utilsShallowEqual = require('./utils/shallowEqual'); +function throwIfCompositeComponentElement(element) { + // Custom components can no longer be wrapped directly in React DnD 2.0 + // so that we don't need to depend on findDOMNode() from react-dom. + if (typeof element.type === 'string') { + return; + } -var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); + var displayName = element.type.displayName || element.type.name || 'the component'; -var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar'); + throw new Error('Only native element nodes can now be passed to React DnD connectors. ' + ('You can either wrap ' + displayName + ' into a
, or turn it into a ') + 'drag source or a drop target itself.'); +} -var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar); +function wrapHookToRecognizeElement(hook) { + return function () { + var elementOrNode = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; + var options = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; -var _lodashIsPlainObject = require('lodash/isPlainObject'); + // When passed a node, call the hook straight away. + if (!_react.isValidElement(elementOrNode)) { + var node = elementOrNode; + hook(node, options); + return; + } -var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); + // If passed a ReactElement, clone it and attach this function as a ref. + // This helps us achieve a neat API where user doesn't even know that refs + // are being used under the hood. + var element = elementOrNode; + throwIfCompositeComponentElement(element); -var _invariant = require('invariant'); + // When no options are passed, use the hook directly + var ref = options ? function (node) { + return hook(node, options); + } : hook; -var _invariant2 = _interopRequireDefault(_invariant); + return _utilsCloneWithRef2['default'](element, ref); + }; +} -var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); +function wrapConnectorHooks(hooks) { + var wrappedHooks = {}; -var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); + Object.keys(hooks).forEach(function (key) { + var hook = hooks[key]; + var wrappedHook = wrapHookToRecognizeElement(hook); + wrappedHooks[key] = function () { + return wrappedHook; + }; + }); -function DragLayer(collect) { - var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + return wrappedHooks; +} - _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragLayer', 'collect[, options]'].concat(_slice.call(arguments))); - _invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the first argument to DragLayer ' + 'to be a function that collects props to inject into the component. ', 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', collect); - _invariant2['default'](_lodashIsPlainObject2['default'](options), 'Expected "options" provided as the second argument to DragLayer to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-layer.html', options); +module.exports = exports['default']; +},{"./utils/cloneWithRef":126,"react":undefined}],131:[function(require,module,exports){ +'use strict'; - return function decorateLayer(DecoratedComponent) { - var _options$arePropsEqual = options.arePropsEqual; - var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual; +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'; +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - return (function (_Component) { - _inherits(DragLayerContainer, _Component); +exports.__esModule = true; - DragLayerContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() { - return this.refs.child; - }; +var _isDisposable = require('./isDisposable'); - DragLayerContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) { - return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state); - }; +var _isDisposable2 = _interopRequireWildcard(_isDisposable); - _createClass(DragLayerContainer, null, [{ - key: 'DecoratedComponent', - value: DecoratedComponent, - enumerable: true - }, { - key: 'displayName', - value: 'DragLayer(' + displayName + ')', - enumerable: true - }, { - key: 'contextTypes', - value: { - dragDropManager: _react.PropTypes.object.isRequired - }, - enumerable: true - }]); +/** + * Represents a group of disposable resources that are disposed together. + */ - function DragLayerContainer(props, context) { - _classCallCheck(this, DragLayerContainer); +var CompositeDisposable = (function () { + function CompositeDisposable() { + for (var _len = arguments.length, disposables = Array(_len), _key = 0; _key < _len; _key++) { + disposables[_key] = arguments[_key]; + } - _Component.call(this, props); - this.handleChange = this.handleChange.bind(this); + _classCallCheck(this, CompositeDisposable); - this.manager = context.dragDropManager; - _invariant2['default'](typeof this.manager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName); + if (Array.isArray(disposables[0]) && disposables.length === 1) { + disposables = disposables[0]; + } - this.state = this.getCurrentState(); + for (var i = 0; i < disposables.length; i++) { + if (!_isDisposable2['default'](disposables[i])) { + throw new Error('Expected a disposable'); } + } - DragLayerContainer.prototype.componentDidMount = function componentDidMount() { - this.isCurrentlyMounted = true; + this.disposables = disposables; + this.isDisposed = false; + } - var monitor = this.manager.getMonitor(); - this.unsubscribeFromOffsetChange = monitor.subscribeToOffsetChange(this.handleChange); - this.unsubscribeFromStateChange = monitor.subscribeToStateChange(this.handleChange); + /** + * Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. + * @param {Disposable} item Disposable to add. + */ - this.handleChange(); - }; + CompositeDisposable.prototype.add = function add(item) { + if (this.isDisposed) { + item.dispose(); + } else { + this.disposables.push(item); + } + }; - DragLayerContainer.prototype.componentWillUnmount = function componentWillUnmount() { - this.isCurrentlyMounted = false; + /** + * Removes and disposes the first occurrence of a disposable from the CompositeDisposable. + * @param {Disposable} item Disposable to remove. + * @returns {Boolean} true if found; false otherwise. + */ - this.unsubscribeFromOffsetChange(); - this.unsubscribeFromStateChange(); - }; + CompositeDisposable.prototype.remove = function remove(item) { + if (this.isDisposed) { + return false; + } - DragLayerContainer.prototype.handleChange = function handleChange() { - if (!this.isCurrentlyMounted) { - return; - } + var index = this.disposables.indexOf(item); + if (index === -1) { + return false; + } - var nextState = this.getCurrentState(); - if (!_utilsShallowEqual2['default'](nextState, this.state)) { - this.setState(nextState); - } - }; + this.disposables.splice(index, 1); + item.dispose(); + return true; + }; - DragLayerContainer.prototype.getCurrentState = function getCurrentState() { - var monitor = this.manager.getMonitor(); - return collect(monitor); - }; + /** + * Disposes all disposables in the group and removes them from the group. + */ - DragLayerContainer.prototype.render = function render() { - return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, { - ref: 'child' })); - }; + CompositeDisposable.prototype.dispose = function dispose() { + if (this.isDisposed) { + return; + } - return DragLayerContainer; - })(_react.Component); + var len = this.disposables.length; + var currentDisposables = new Array(len); + for (var i = 0; i < len; i++) { + currentDisposables[i] = this.disposables[i]; + } + + this.isDisposed = true; + this.disposables = []; + this.length = 0; + + for (var i = 0; i < len; i++) { + currentDisposables[i].dispose(); + } }; -} + return CompositeDisposable; +})(); + +exports['default'] = CompositeDisposable; module.exports = exports['default']; -},{"./utils/checkDecoratorArguments":232,"./utils/shallowEqual":235,"./utils/shallowEqualScalar":236,"invariant":107,"lodash/isPlainObject":248,"react":undefined}],219:[function(require,module,exports){ -'use strict'; +},{"./isDisposable":135}],132:[function(require,module,exports){ +"use strict"; -exports.__esModule = true; -var _slice = Array.prototype.slice; -exports['default'] = DragSource; +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +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 _invariant = require('invariant'); +exports.__esModule = true; +var noop = function noop() {}; -var _invariant2 = _interopRequireDefault(_invariant); +/** + * The basic disposable. + */ -var _lodashIsPlainObject = require('lodash/isPlainObject'); +var Disposable = (function () { + function Disposable(action) { + _classCallCheck(this, Disposable); -var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); + this.isDisposed = false; + this.action = action || noop; + } -var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); + Disposable.prototype.dispose = function dispose() { + if (!this.isDisposed) { + this.action.call(null); + this.isDisposed = true; + } + }; -var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); + _createClass(Disposable, null, [{ + key: "empty", + enumerable: true, + value: { dispose: noop } + }]); -var _decorateHandler = require('./decorateHandler'); + return Disposable; +})(); -var _decorateHandler2 = _interopRequireDefault(_decorateHandler); +exports["default"] = Disposable; +module.exports = exports["default"]; +},{}],133:[function(require,module,exports){ +'use strict'; -var _registerSource = require('./registerSource'); +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; -var _registerSource2 = _interopRequireDefault(_registerSource); +var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; -var _createSourceFactory = require('./createSourceFactory'); +exports.__esModule = true; -var _createSourceFactory2 = _interopRequireDefault(_createSourceFactory); +var _isDisposable = require('./isDisposable'); -var _createSourceMonitor = require('./createSourceMonitor'); +var _isDisposable2 = _interopRequireWildcard(_isDisposable); -var _createSourceMonitor2 = _interopRequireDefault(_createSourceMonitor); +var SerialDisposable = (function () { + function SerialDisposable() { + _classCallCheck(this, SerialDisposable); -var _createSourceConnector = require('./createSourceConnector'); + this.isDisposed = false; + this.current = null; + } -var _createSourceConnector2 = _interopRequireDefault(_createSourceConnector); + /** + * Gets the underlying disposable. + * @return The underlying disposable. + */ -var _utilsIsValidType = require('./utils/isValidType'); + SerialDisposable.prototype.getDisposable = function getDisposable() { + return this.current; + }; -var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType); + /** + * Sets the underlying disposable. + * @param {Disposable} value The new underlying disposable. + */ -function DragSource(type, spec, collect) { - var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; + SerialDisposable.prototype.setDisposable = function setDisposable() { + var value = arguments[0] === undefined ? null : arguments[0]; - _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DragSource', 'type, spec, collect[, options]'].concat(_slice.call(arguments))); - var getType = type; - if (typeof type !== 'function') { - _invariant2['default'](_utilsIsValidType2['default'](type), 'Expected "type" provided as the first argument to DragSource to be ' + 'a string, or a function that returns a string given the current props. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', type); - getType = function () { - return type; - }; - } - _invariant2['default'](_lodashIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DragSource to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', spec); - var createSource = _createSourceFactory2['default'](spec); - _invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DragSource to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect); - _invariant2['default'](_lodashIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DragSource to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', collect); + if (value != null && !_isDisposable2['default'](value)) { + throw new Error('Expected either an empty value or a valid disposable'); + } - return function decorateSource(DecoratedComponent) { - return _decorateHandler2['default']({ - connectBackend: function connectBackend(backend, sourceId) { - return backend.connectDragSource(sourceId); - }, - containerDisplayName: 'DragSource', - createHandler: createSource, - registerHandler: _registerSource2['default'], - createMonitor: _createSourceMonitor2['default'], - createConnector: _createSourceConnector2['default'], - DecoratedComponent: DecoratedComponent, - getType: getType, - collect: collect, - options: options - }); - }; -} + var isDisposed = this.isDisposed; + var previous = undefined; -module.exports = exports['default']; -},{"./createSourceConnector":222,"./createSourceFactory":223,"./createSourceMonitor":224,"./decorateHandler":228,"./registerSource":230,"./utils/checkDecoratorArguments":232,"./utils/isValidType":234,"invariant":107,"lodash/isPlainObject":248}],220:[function(require,module,exports){ -'use strict'; + if (!isDisposed) { + previous = this.current; + this.current = value; + } -exports.__esModule = true; -var _slice = Array.prototype.slice; -exports['default'] = DropTarget; + if (previous) { + previous.dispose(); + } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + if (isDisposed && value) { + value.dispose(); + } + }; -var _invariant = require('invariant'); + /** + * Disposes the underlying disposable as well as all future replacements. + */ -var _invariant2 = _interopRequireDefault(_invariant); + SerialDisposable.prototype.dispose = function dispose() { + if (this.isDisposed) { + return; + } -var _lodashIsPlainObject = require('lodash/isPlainObject'); + this.isDisposed = true; + var previous = this.current; + this.current = null; -var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); + if (previous) { + previous.dispose(); + } + }; -var _utilsCheckDecoratorArguments = require('./utils/checkDecoratorArguments'); + return SerialDisposable; +})(); -var _utilsCheckDecoratorArguments2 = _interopRequireDefault(_utilsCheckDecoratorArguments); +exports['default'] = SerialDisposable; +module.exports = exports['default']; +},{"./isDisposable":135}],134:[function(require,module,exports){ +'use strict'; -var _decorateHandler = require('./decorateHandler'); +var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; -var _decorateHandler2 = _interopRequireDefault(_decorateHandler); +exports.__esModule = true; -var _registerTarget = require('./registerTarget'); +var _isDisposable2 = require('./isDisposable'); -var _registerTarget2 = _interopRequireDefault(_registerTarget); +var _isDisposable3 = _interopRequireWildcard(_isDisposable2); -var _createTargetFactory = require('./createTargetFactory'); +exports.isDisposable = _isDisposable3['default']; -var _createTargetFactory2 = _interopRequireDefault(_createTargetFactory); +var _Disposable2 = require('./Disposable'); + +var _Disposable3 = _interopRequireWildcard(_Disposable2); -var _createTargetMonitor = require('./createTargetMonitor'); +exports.Disposable = _Disposable3['default']; -var _createTargetMonitor2 = _interopRequireDefault(_createTargetMonitor); +var _CompositeDisposable2 = require('./CompositeDisposable'); -var _createTargetConnector = require('./createTargetConnector'); +var _CompositeDisposable3 = _interopRequireWildcard(_CompositeDisposable2); -var _createTargetConnector2 = _interopRequireDefault(_createTargetConnector); +exports.CompositeDisposable = _CompositeDisposable3['default']; -var _utilsIsValidType = require('./utils/isValidType'); +var _SerialDisposable2 = require('./SerialDisposable'); -var _utilsIsValidType2 = _interopRequireDefault(_utilsIsValidType); +var _SerialDisposable3 = _interopRequireWildcard(_SerialDisposable2); -function DropTarget(type, spec, collect) { - var options = arguments.length <= 3 || arguments[3] === undefined ? {} : arguments[3]; +exports.SerialDisposable = _SerialDisposable3['default']; +},{"./CompositeDisposable":131,"./Disposable":132,"./SerialDisposable":133,"./isDisposable":135}],135:[function(require,module,exports){ +'use strict'; - _utilsCheckDecoratorArguments2['default'].apply(undefined, ['DropTarget', 'type, spec, collect[, options]'].concat(_slice.call(arguments))); - var getType = type; - if (typeof type !== 'function') { - _invariant2['default'](_utilsIsValidType2['default'](type, true), 'Expected "type" provided as the first argument to DropTarget to be ' + 'a string, an array of strings, or a function that returns either given ' + 'the current props. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', type); - getType = function () { - return type; - }; - } - _invariant2['default'](_lodashIsPlainObject2['default'](spec), 'Expected "spec" provided as the second argument to DropTarget to be ' + 'a plain object. Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', spec); - var createTarget = _createTargetFactory2['default'](spec); - _invariant2['default'](typeof collect === 'function', 'Expected "collect" provided as the third argument to DropTarget to be ' + 'a function that returns a plain object of props to inject. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect); - _invariant2['default'](_lodashIsPlainObject2['default'](options), 'Expected "options" provided as the fourth argument to DropTarget to be ' + 'a plain object when specified. ' + 'Instead, received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', collect); +exports.__esModule = true; +exports['default'] = isDisposable; - return function decorateTarget(DecoratedComponent) { - return _decorateHandler2['default']({ - connectBackend: function connectBackend(backend, targetId) { - return backend.connectDropTarget(targetId); - }, - containerDisplayName: 'DropTarget', - createHandler: createTarget, - registerHandler: _registerTarget2['default'], - createMonitor: _createTargetMonitor2['default'], - createConnector: _createTargetConnector2['default'], - DecoratedComponent: DecoratedComponent, - getType: getType, - collect: collect, - options: options - }); - }; +function isDisposable(obj) { + return Boolean(obj && typeof obj.dispose === 'function'); } module.exports = exports['default']; -},{"./createTargetConnector":225,"./createTargetFactory":226,"./createTargetMonitor":227,"./decorateHandler":228,"./registerTarget":231,"./utils/checkDecoratorArguments":232,"./utils/isValidType":234,"invariant":107,"lodash/isPlainObject":248}],221:[function(require,module,exports){ +},{}],136:[function(require,module,exports){ 'use strict'; -exports.__esModule = true; -exports['default'] = areOptionsEqual; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +Object.defineProperty(exports, "__esModule", { + value: true +}); -var _utilsShallowEqual = require('./utils/shallowEqual'); +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 _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); +var _createStore = require('redux/lib/createStore'); -function areOptionsEqual(nextOptions, currentOptions) { - if (currentOptions === nextOptions) { - return true; - } +var _createStore2 = _interopRequireDefault(_createStore); - return currentOptions !== null && nextOptions !== null && _utilsShallowEqual2['default'](currentOptions, nextOptions); -} +var _reducers = require('./reducers'); -module.exports = exports['default']; -},{"./utils/shallowEqual":235}],222:[function(require,module,exports){ -'use strict'; +var _reducers2 = _interopRequireDefault(_reducers); -exports.__esModule = true; -exports['default'] = createSourceConnector; +var _dragDrop = require('./actions/dragDrop'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var dragDropActions = _interopRequireWildcard(_dragDrop); -var _wrapConnectorHooks = require('./wrapConnectorHooks'); +var _DragDropMonitor = require('./DragDropMonitor'); -var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks); +var _DragDropMonitor2 = _interopRequireDefault(_DragDropMonitor); -var _areOptionsEqual = require('./areOptionsEqual'); +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function createSourceConnector(backend) { - var currentHandlerId = undefined; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - var currentDragSourceNode = undefined; - var currentDragSourceOptions = undefined; - var disconnectCurrentDragSource = undefined; +var DragDropManager = function () { + function DragDropManager(createBackend) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var currentDragPreviewNode = undefined; - var currentDragPreviewOptions = undefined; - var disconnectCurrentDragPreview = undefined; + _classCallCheck(this, DragDropManager); - function reconnectDragSource() { - if (disconnectCurrentDragSource) { - disconnectCurrentDragSource(); - disconnectCurrentDragSource = null; - } + var store = (0, _createStore2.default)(_reducers2.default); + this.context = context; + this.store = store; + this.monitor = new _DragDropMonitor2.default(store); + this.registry = this.monitor.registry; + this.backend = createBackend(this); - if (currentHandlerId && currentDragSourceNode) { - disconnectCurrentDragSource = backend.connectDragSource(currentHandlerId, currentDragSourceNode, currentDragSourceOptions); - } + store.subscribe(this.handleRefCountChange.bind(this)); } - function reconnectDragPreview() { - if (disconnectCurrentDragPreview) { - disconnectCurrentDragPreview(); - disconnectCurrentDragPreview = null; + _createClass(DragDropManager, [{ + key: 'handleRefCountChange', + value: function handleRefCountChange() { + var shouldSetUp = this.store.getState().refCount > 0; + if (shouldSetUp && !this.isSetUp) { + this.backend.setup(); + this.isSetUp = true; + } else if (!shouldSetUp && this.isSetUp) { + this.backend.teardown(); + this.isSetUp = false; + } } + }, { + key: 'getContext', + value: function getContext() { + return this.context; + } + }, { + key: 'getMonitor', + value: function getMonitor() { + return this.monitor; + } + }, { + key: 'getBackend', + value: function getBackend() { + return this.backend; + } + }, { + key: 'getRegistry', + value: function getRegistry() { + return this.registry; + } + }, { + key: 'getActions', + value: function getActions() { + var manager = this; + var dispatch = this.store.dispatch; + + + function bindActionCreator(actionCreator) { + return function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } - if (currentHandlerId && currentDragPreviewNode) { - disconnectCurrentDragPreview = backend.connectDragPreview(currentHandlerId, currentDragPreviewNode, currentDragPreviewOptions); - } - } + var action = actionCreator.apply(manager, args); + if (typeof action !== 'undefined') { + dispatch(action); + } + }; + } - function receiveHandlerId(handlerId) { - if (handlerId === currentHandlerId) { - return; + return Object.keys(dragDropActions).filter(function (key) { + return typeof dragDropActions[key] === 'function'; + }).reduce(function (boundActions, key) { + var action = dragDropActions[key]; + boundActions[key] = bindActionCreator(action); // eslint-disable-line no-param-reassign + return boundActions; + }, {}); } + }]); - currentHandlerId = handlerId; - reconnectDragSource(); - reconnectDragPreview(); - } + return DragDropManager; +}(); - var hooks = _wrapConnectorHooks2['default']({ - dragSource: function connectDragSource(node, options) { - if (node === currentDragSourceNode && _areOptionsEqual2['default'](options, currentDragSourceOptions)) { - return; - } +exports.default = DragDropManager; +},{"./DragDropMonitor":137,"./actions/dragDrop":141,"./reducers":148,"redux/lib/createStore":155}],137:[function(require,module,exports){ +'use strict'; - currentDragSourceNode = node; - currentDragSourceOptions = options; +Object.defineProperty(exports, "__esModule", { + value: true +}); - reconnectDragSource(); - }, +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; }; }(); - dragPreview: function connectDragPreview(node, options) { - if (node === currentDragPreviewNode && _areOptionsEqual2['default'](options, currentDragPreviewOptions)) { - return; - } +var _invariant = require('invariant'); - currentDragPreviewNode = node; - currentDragPreviewOptions = options; +var _invariant2 = _interopRequireDefault(_invariant); - reconnectDragPreview(); - } - }); +var _isArray = require('lodash/isArray'); - return { - receiveHandlerId: receiveHandlerId, - hooks: hooks - }; -} +var _isArray2 = _interopRequireDefault(_isArray); -module.exports = exports['default']; -},{"./areOptionsEqual":221,"./wrapConnectorHooks":237}],223:[function(require,module,exports){ -(function (process){ -'use strict'; +var _matchesType = require('./utils/matchesType'); -exports.__esModule = true; -exports['default'] = createSourceFactory; +var _matchesType2 = _interopRequireDefault(_matchesType); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _HandlerRegistry = require('./HandlerRegistry'); -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } +var _HandlerRegistry2 = _interopRequireDefault(_HandlerRegistry); -var _invariant = require('invariant'); +var _dragOffset = require('./reducers/dragOffset'); -var _invariant2 = _interopRequireDefault(_invariant); +var _dirtyHandlerIds = require('./reducers/dirtyHandlerIds'); -var _lodashIsPlainObject = require('lodash/isPlainObject'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var ALLOWED_SPEC_METHODS = ['canDrag', 'beginDrag', 'canDrag', 'isDragging', 'endDrag']; -var REQUIRED_SPEC_METHODS = ['beginDrag']; +var DragDropMonitor = function () { + function DragDropMonitor(store) { + _classCallCheck(this, DragDropMonitor); -function createSourceFactory(spec) { - Object.keys(spec).forEach(function (key) { - _invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drag source specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', ALLOWED_SPEC_METHODS.join(', '), key); - _invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]); - }); - REQUIRED_SPEC_METHODS.forEach(function (key) { - _invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drag source specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', key, key, spec[key]); - }); + this.store = store; + this.registry = new _HandlerRegistry2.default(store); + } - var Source = (function () { - function Source(monitor) { - _classCallCheck(this, Source); + _createClass(DragDropMonitor, [{ + key: 'subscribeToStateChange', + value: function subscribeToStateChange(listener) { + var _this = this; - this.monitor = monitor; - this.props = null; - this.component = null; + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handlerIds = options.handlerIds; + + (0, _invariant2.default)(typeof listener === 'function', 'listener must be a function.'); + (0, _invariant2.default)(typeof handlerIds === 'undefined' || (0, _isArray2.default)(handlerIds), 'handlerIds, when specified, must be an array of strings.'); + + var prevStateId = this.store.getState().stateId; + var handleChange = function handleChange() { + var state = _this.store.getState(); + var currentStateId = state.stateId; + try { + var canSkipListener = currentStateId === prevStateId || currentStateId === prevStateId + 1 && !(0, _dirtyHandlerIds.areDirty)(state.dirtyHandlerIds, handlerIds); + + if (!canSkipListener) { + listener(); + } + } finally { + prevStateId = currentStateId; + } + }; + + return this.store.subscribe(handleChange); } + }, { + key: 'subscribeToOffsetChange', + value: function subscribeToOffsetChange(listener) { + var _this2 = this; - Source.prototype.receiveProps = function receiveProps(props) { - this.props = props; - }; + (0, _invariant2.default)(typeof listener === 'function', 'listener must be a function.'); - Source.prototype.receiveComponent = function receiveComponent(component) { - this.component = component; - }; + var previousState = this.store.getState().dragOffset; + var handleChange = function handleChange() { + var nextState = _this2.store.getState().dragOffset; + if (nextState === previousState) { + return; + } - Source.prototype.canDrag = function canDrag() { - if (!spec.canDrag) { - return true; + previousState = nextState; + listener(); + }; + + return this.store.subscribe(handleChange); + } + }, { + key: 'canDragSource', + value: function canDragSource(sourceId) { + var source = this.registry.getSource(sourceId); + (0, _invariant2.default)(source, 'Expected to find a valid source.'); + + if (this.isDragging()) { + return false; } - return spec.canDrag(this.props, this.monitor); - }; + return source.canDrag(this, sourceId); + } + }, { + key: 'canDropOnTarget', + value: function canDropOnTarget(targetId) { + var target = this.registry.getTarget(targetId); + (0, _invariant2.default)(target, 'Expected to find a valid target.'); - Source.prototype.isDragging = function isDragging(globalMonitor, sourceId) { - if (!spec.isDragging) { - return sourceId === globalMonitor.getSourceId(); + if (!this.isDragging() || this.didDrop()) { + return false; } - return spec.isDragging(this.props, this.monitor); - }; + var targetType = this.registry.getTargetType(targetId); + var draggedItemType = this.getItemType(); + return (0, _matchesType2.default)(targetType, draggedItemType) && target.canDrop(this, targetId); + } + }, { + key: 'isDragging', + value: function isDragging() { + return Boolean(this.getItemType()); + } + }, { + key: 'isDraggingSource', + value: function isDraggingSource(sourceId) { + var source = this.registry.getSource(sourceId, true); + (0, _invariant2.default)(source, 'Expected to find a valid source.'); - Source.prototype.beginDrag = function beginDrag() { - var item = spec.beginDrag(this.props, this.monitor, this.component); - if (process.env.NODE_ENV !== 'production') { - _invariant2['default'](_lodashIsPlainObject2['default'](item), 'beginDrag() must return a plain object that represents the dragged item. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html', item); + if (!this.isDragging() || !this.isSourcePublic()) { + return false; } - return item; - }; - Source.prototype.endDrag = function endDrag() { - if (!spec.endDrag) { - return; + var sourceType = this.registry.getSourceType(sourceId); + var draggedItemType = this.getItemType(); + if (sourceType !== draggedItemType) { + return false; } - spec.endDrag(this.props, this.monitor, this.component); - }; + return source.isDragging(this, sourceId); + } + }, { + key: 'isOverTarget', + value: function isOverTarget(targetId) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { shallow: false }; + var shallow = options.shallow; - return Source; - })(); + if (!this.isDragging()) { + return false; + } - return function createSource(monitor) { - return new Source(monitor); - }; -} + var targetType = this.registry.getTargetType(targetId); + var draggedItemType = this.getItemType(); + if (!(0, _matchesType2.default)(targetType, draggedItemType)) { + return false; + } -module.exports = exports['default']; -}).call(this,require('_process')) -},{"_process":108,"invariant":107,"lodash/isPlainObject":248}],224:[function(require,module,exports){ -'use strict'; + var targetIds = this.getTargetIds(); + if (!targetIds.length) { + return false; + } + + var index = targetIds.indexOf(targetId); + if (shallow) { + return index === targetIds.length - 1; + } else { + return index > -1; + } + } + }, { + key: 'getItemType', + value: function getItemType() { + return this.store.getState().dragOperation.itemType; + } + }, { + key: 'getItem', + value: function getItem() { + return this.store.getState().dragOperation.item; + } + }, { + key: 'getSourceId', + value: function getSourceId() { + return this.store.getState().dragOperation.sourceId; + } + }, { + key: 'getTargetIds', + value: function getTargetIds() { + return this.store.getState().dragOperation.targetIds; + } + }, { + key: 'getDropResult', + value: function getDropResult() { + return this.store.getState().dragOperation.dropResult; + } + }, { + key: 'didDrop', + value: function didDrop() { + return this.store.getState().dragOperation.didDrop; + } + }, { + key: 'isSourcePublic', + value: function isSourcePublic() { + return this.store.getState().dragOperation.isSourcePublic; + } + }, { + key: 'getInitialClientOffset', + value: function getInitialClientOffset() { + return this.store.getState().dragOffset.initialClientOffset; + } + }, { + key: 'getInitialSourceClientOffset', + value: function getInitialSourceClientOffset() { + return this.store.getState().dragOffset.initialSourceClientOffset; + } + }, { + key: 'getClientOffset', + value: function getClientOffset() { + return this.store.getState().dragOffset.clientOffset; + } + }, { + key: 'getSourceClientOffset', + value: function getSourceClientOffset() { + return (0, _dragOffset.getSourceClientOffset)(this.store.getState().dragOffset); + } + }, { + key: 'getDifferenceFromInitialOffset', + value: function getDifferenceFromInitialOffset() { + return (0, _dragOffset.getDifferenceFromInitialOffset)(this.store.getState().dragOffset); + } + }]); + + return DragDropMonitor; +}(); + +exports.default = DragDropMonitor; +},{"./HandlerRegistry":140,"./reducers/dirtyHandlerIds":145,"./reducers/dragOffset":146,"./utils/matchesType":152,"invariant":159,"lodash/isArray":234}],138:[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; }; }(); -exports.__esModule = true; -exports['default'] = createSourceMonitor; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var DragSource = function () { + function DragSource() { + _classCallCheck(this, DragSource); + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + _createClass(DragSource, [{ + key: "canDrag", + value: function canDrag() { + return true; + } + }, { + key: "isDragging", + value: function isDragging(monitor, handle) { + return handle === monitor.getSourceId(); + } + }, { + key: "endDrag", + value: function endDrag() {} + }]); -var _invariant = require('invariant'); + return DragSource; +}(); -var _invariant2 = _interopRequireDefault(_invariant); +exports.default = DragSource; +},{}],139:[function(require,module,exports){ +"use strict"; -var isCallingCanDrag = false; -var isCallingIsDragging = false; +Object.defineProperty(exports, "__esModule", { + value: true +}); -var SourceMonitor = (function () { - function SourceMonitor(manager) { - _classCallCheck(this, SourceMonitor); +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; }; }(); - this.internalMonitor = manager.getMonitor(); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DropTarget = function () { + function DropTarget() { + _classCallCheck(this, DropTarget); } - SourceMonitor.prototype.receiveHandlerId = function receiveHandlerId(sourceId) { - this.sourceId = sourceId; - }; + _createClass(DropTarget, [{ + key: "canDrop", + value: function canDrop() { + return true; + } + }, { + key: "hover", + value: function hover() {} + }, { + key: "drop", + value: function drop() {} + }]); - SourceMonitor.prototype.canDrag = function canDrag() { - _invariant2['default'](!isCallingCanDrag, 'You may not call monitor.canDrag() inside your canDrag() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html'); + return DropTarget; +}(); - try { - isCallingCanDrag = true; - return this.internalMonitor.canDragSource(this.sourceId); - } finally { - isCallingCanDrag = false; - } - }; +exports.default = DropTarget; +},{}],140:[function(require,module,exports){ +'use strict'; - SourceMonitor.prototype.isDragging = function isDragging() { - _invariant2['default'](!isCallingIsDragging, 'You may not call monitor.isDragging() inside your isDragging() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html'); +Object.defineProperty(exports, "__esModule", { + value: true +}); - try { - isCallingIsDragging = true; - return this.internalMonitor.isDraggingSource(this.sourceId); - } finally { - isCallingIsDragging = false; - } - }; +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; }; }(); - SourceMonitor.prototype.getItemType = function getItemType() { - return this.internalMonitor.getItemType(); - }; +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; - SourceMonitor.prototype.getItem = function getItem() { - return this.internalMonitor.getItem(); - }; +var _invariant = require('invariant'); - SourceMonitor.prototype.getDropResult = function getDropResult() { - return this.internalMonitor.getDropResult(); - }; +var _invariant2 = _interopRequireDefault(_invariant); - SourceMonitor.prototype.didDrop = function didDrop() { - return this.internalMonitor.didDrop(); - }; +var _isArray = require('lodash/isArray'); - SourceMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() { - return this.internalMonitor.getInitialClientOffset(); - }; +var _isArray2 = _interopRequireDefault(_isArray); - SourceMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() { - return this.internalMonitor.getInitialSourceClientOffset(); - }; +var _asap = require('asap'); - SourceMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() { - return this.internalMonitor.getSourceClientOffset(); - }; +var _asap2 = _interopRequireDefault(_asap); - SourceMonitor.prototype.getClientOffset = function getClientOffset() { - return this.internalMonitor.getClientOffset(); - }; +var _registry = require('./actions/registry'); - SourceMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() { - return this.internalMonitor.getDifferenceFromInitialOffset(); - }; +var _getNextUniqueId = require('./utils/getNextUniqueId'); - return SourceMonitor; -})(); +var _getNextUniqueId2 = _interopRequireDefault(_getNextUniqueId); -function createSourceMonitor(manager) { - return new SourceMonitor(manager); -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -module.exports = exports['default']; -},{"invariant":107}],225:[function(require,module,exports){ -'use strict'; +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -exports.__esModule = true; -exports['default'] = createTargetConnector; +var HandlerRoles = { + SOURCE: 'SOURCE', + TARGET: 'TARGET' +}; -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +function validateSourceContract(source) { + (0, _invariant2.default)(typeof source.canDrag === 'function', 'Expected canDrag to be a function.'); + (0, _invariant2.default)(typeof source.beginDrag === 'function', 'Expected beginDrag to be a function.'); + (0, _invariant2.default)(typeof source.endDrag === 'function', 'Expected endDrag to be a function.'); +} -var _wrapConnectorHooks = require('./wrapConnectorHooks'); +function validateTargetContract(target) { + (0, _invariant2.default)(typeof target.canDrop === 'function', 'Expected canDrop to be a function.'); + (0, _invariant2.default)(typeof target.hover === 'function', 'Expected hover to be a function.'); + (0, _invariant2.default)(typeof target.drop === 'function', 'Expected beginDrag to be a function.'); +} -var _wrapConnectorHooks2 = _interopRequireDefault(_wrapConnectorHooks); +function validateType(type, allowArray) { + if (allowArray && (0, _isArray2.default)(type)) { + type.forEach(function (t) { + return validateType(t, false); + }); + return; + } -var _areOptionsEqual = require('./areOptionsEqual'); + (0, _invariant2.default)(typeof type === 'string' || (typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'symbol', allowArray ? 'Type can only be a string, a symbol, or an array of either.' : 'Type can only be a string or a symbol.'); +} -var _areOptionsEqual2 = _interopRequireDefault(_areOptionsEqual); +function getNextHandlerId(role) { + var id = (0, _getNextUniqueId2.default)().toString(); + switch (role) { + case HandlerRoles.SOURCE: + return 'S' + id; + case HandlerRoles.TARGET: + return 'T' + id; + default: + (0, _invariant2.default)(false, 'Unknown role: ' + role); + } +} -function createTargetConnector(backend) { - var currentHandlerId = undefined; +function parseRoleFromHandlerId(handlerId) { + switch (handlerId[0]) { + case 'S': + return HandlerRoles.SOURCE; + case 'T': + return HandlerRoles.TARGET; + default: + (0, _invariant2.default)(false, 'Cannot parse handler ID: ' + handlerId); + } +} - var currentDropTargetNode = undefined; - var currentDropTargetOptions = undefined; - var disconnectCurrentDropTarget = undefined; +var HandlerRegistry = function () { + function HandlerRegistry(store) { + _classCallCheck(this, HandlerRegistry); - function reconnectDropTarget() { - if (disconnectCurrentDropTarget) { - disconnectCurrentDropTarget(); - disconnectCurrentDropTarget = null; - } + this.store = store; - if (currentHandlerId && currentDropTargetNode) { - disconnectCurrentDropTarget = backend.connectDropTarget(currentHandlerId, currentDropTargetNode, currentDropTargetOptions); - } + this.types = {}; + this.handlers = {}; + + this.pinnedSourceId = null; + this.pinnedSource = null; } - function receiveHandlerId(handlerId) { - if (handlerId === currentHandlerId) { - return; + _createClass(HandlerRegistry, [{ + key: 'addSource', + value: function addSource(type, source) { + validateType(type); + validateSourceContract(source); + + var sourceId = this.addHandler(HandlerRoles.SOURCE, type, source); + this.store.dispatch((0, _registry.addSource)(sourceId)); + return sourceId; + } + }, { + key: 'addTarget', + value: function addTarget(type, target) { + validateType(type, true); + validateTargetContract(target); + + var targetId = this.addHandler(HandlerRoles.TARGET, type, target); + this.store.dispatch((0, _registry.addTarget)(targetId)); + return targetId; + } + }, { + key: 'addHandler', + value: function addHandler(role, type, handler) { + var id = getNextHandlerId(role); + this.types[id] = type; + this.handlers[id] = handler; + + return id; + } + }, { + key: 'containsHandler', + value: function containsHandler(handler) { + var _this = this; + + return Object.keys(this.handlers).some(function (key) { + return _this.handlers[key] === handler; + }); + } + }, { + key: 'getSource', + value: function getSource(sourceId, includePinned) { + (0, _invariant2.default)(this.isSourceId(sourceId), 'Expected a valid source ID.'); + + var isPinned = includePinned && sourceId === this.pinnedSourceId; + var source = isPinned ? this.pinnedSource : this.handlers[sourceId]; + + return source; + } + }, { + key: 'getTarget', + value: function getTarget(targetId) { + (0, _invariant2.default)(this.isTargetId(targetId), 'Expected a valid target ID.'); + return this.handlers[targetId]; + } + }, { + key: 'getSourceType', + value: function getSourceType(sourceId) { + (0, _invariant2.default)(this.isSourceId(sourceId), 'Expected a valid source ID.'); + return this.types[sourceId]; + } + }, { + key: 'getTargetType', + value: function getTargetType(targetId) { + (0, _invariant2.default)(this.isTargetId(targetId), 'Expected a valid target ID.'); + return this.types[targetId]; + } + }, { + key: 'isSourceId', + value: function isSourceId(handlerId) { + var role = parseRoleFromHandlerId(handlerId); + return role === HandlerRoles.SOURCE; + } + }, { + key: 'isTargetId', + value: function isTargetId(handlerId) { + var role = parseRoleFromHandlerId(handlerId); + return role === HandlerRoles.TARGET; + } + }, { + key: 'removeSource', + value: function removeSource(sourceId) { + var _this2 = this; + + (0, _invariant2.default)(this.getSource(sourceId), 'Expected an existing source.'); + this.store.dispatch((0, _registry.removeSource)(sourceId)); + + (0, _asap2.default)(function () { + delete _this2.handlers[sourceId]; + delete _this2.types[sourceId]; + }); } + }, { + key: 'removeTarget', + value: function removeTarget(targetId) { + var _this3 = this; - currentHandlerId = handlerId; - reconnectDropTarget(); - } + (0, _invariant2.default)(this.getTarget(targetId), 'Expected an existing target.'); + this.store.dispatch((0, _registry.removeTarget)(targetId)); - var hooks = _wrapConnectorHooks2['default']({ - dropTarget: function connectDropTarget(node, options) { - if (node === currentDropTargetNode && _areOptionsEqual2['default'](options, currentDropTargetOptions)) { - return; - } + (0, _asap2.default)(function () { + delete _this3.handlers[targetId]; + delete _this3.types[targetId]; + }); + } + }, { + key: 'pinSource', + value: function pinSource(sourceId) { + var source = this.getSource(sourceId); + (0, _invariant2.default)(source, 'Expected an existing source.'); - currentDropTargetNode = node; - currentDropTargetOptions = options; + this.pinnedSourceId = sourceId; + this.pinnedSource = source; + } + }, { + key: 'unpinSource', + value: function unpinSource() { + (0, _invariant2.default)(this.pinnedSource, 'No source is pinned at the time.'); - reconnectDropTarget(); + this.pinnedSourceId = null; + this.pinnedSource = null; } - }); + }]); - return { - receiveHandlerId: receiveHandlerId, - hooks: hooks - }; -} + return HandlerRegistry; +}(); -module.exports = exports['default']; -},{"./areOptionsEqual":221,"./wrapConnectorHooks":237}],226:[function(require,module,exports){ -(function (process){ +exports.default = HandlerRegistry; +},{"./actions/registry":142,"./utils/getNextUniqueId":151,"asap":153,"invariant":159,"lodash/isArray":234}],141:[function(require,module,exports){ 'use strict'; -exports.__esModule = true; -exports['default'] = createTargetFactory; - -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'); } } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.END_DRAG = exports.DROP = exports.HOVER = exports.PUBLISH_DRAG_SOURCE = exports.BEGIN_DRAG = undefined; +exports.beginDrag = beginDrag; +exports.publishDragSource = publishDragSource; +exports.hover = hover; +exports.drop = drop; +exports.endDrag = endDrag; var _invariant = require('invariant'); var _invariant2 = _interopRequireDefault(_invariant); -var _lodashIsPlainObject = require('lodash/isPlainObject'); - -var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); +var _isArray = require('lodash/isArray'); -var ALLOWED_SPEC_METHODS = ['canDrop', 'hover', 'drop']; +var _isArray2 = _interopRequireDefault(_isArray); -function createTargetFactory(spec) { - Object.keys(spec).forEach(function (key) { - _invariant2['default'](ALLOWED_SPEC_METHODS.indexOf(key) > -1, 'Expected the drop target specification to only have ' + 'some of the following keys: %s. ' + 'Instead received a specification with an unexpected "%s" key. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', ALLOWED_SPEC_METHODS.join(', '), key); - _invariant2['default'](typeof spec[key] === 'function', 'Expected %s in the drop target specification to be a function. ' + 'Instead received a specification with %s: %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', key, key, spec[key]); - }); +var _isObject = require('lodash/isObject'); - var Target = (function () { - function Target(monitor) { - _classCallCheck(this, Target); +var _isObject2 = _interopRequireDefault(_isObject); - this.monitor = monitor; - this.props = null; - this.component = null; - } +var _matchesType = require('../utils/matchesType'); - Target.prototype.receiveProps = function receiveProps(props) { - this.props = props; - }; +var _matchesType2 = _interopRequireDefault(_matchesType); - Target.prototype.receiveMonitor = function receiveMonitor(monitor) { - this.monitor = monitor; - }; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - Target.prototype.receiveComponent = function receiveComponent(component) { - this.component = component; - }; +var BEGIN_DRAG = exports.BEGIN_DRAG = 'dnd-core/BEGIN_DRAG'; +var PUBLISH_DRAG_SOURCE = exports.PUBLISH_DRAG_SOURCE = 'dnd-core/PUBLISH_DRAG_SOURCE'; +var HOVER = exports.HOVER = 'dnd-core/HOVER'; +var DROP = exports.DROP = 'dnd-core/DROP'; +var END_DRAG = exports.END_DRAG = 'dnd-core/END_DRAG'; - Target.prototype.canDrop = function canDrop() { - if (!spec.canDrop) { - return true; - } +function beginDrag(sourceIds) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { publishSource: true, clientOffset: null }; + var publishSource = options.publishSource, + clientOffset = options.clientOffset, + getSourceClientOffset = options.getSourceClientOffset; - return spec.canDrop(this.props, this.monitor); - }; + (0, _invariant2.default)((0, _isArray2.default)(sourceIds), 'Expected sourceIds to be an array.'); - Target.prototype.hover = function hover() { - if (!spec.hover) { - return; - } + var monitor = this.getMonitor(); + var registry = this.getRegistry(); + (0, _invariant2.default)(!monitor.isDragging(), 'Cannot call beginDrag while dragging.'); - spec.hover(this.props, this.monitor, this.component); - }; + for (var i = 0; i < sourceIds.length; i++) { + (0, _invariant2.default)(registry.getSource(sourceIds[i]), 'Expected sourceIds to be registered.'); + } - Target.prototype.drop = function drop() { - if (!spec.drop) { - return; - } + var sourceId = null; + for (var _i = sourceIds.length - 1; _i >= 0; _i--) { + if (monitor.canDragSource(sourceIds[_i])) { + sourceId = sourceIds[_i]; + break; + } + } + if (sourceId === null) { + return; + } - var dropResult = spec.drop(this.props, this.monitor, this.component); - if (process.env.NODE_ENV !== 'production') { - _invariant2['default'](typeof dropResult === 'undefined' || _lodashIsPlainObject2['default'](dropResult), 'drop() must either return undefined, or an object that represents the drop result. ' + 'Instead received %s. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html', dropResult); - } - return dropResult; - }; + var sourceClientOffset = null; + if (clientOffset) { + (0, _invariant2.default)(typeof getSourceClientOffset === 'function', 'When clientOffset is provided, getSourceClientOffset must be a function.'); + sourceClientOffset = getSourceClientOffset(sourceId); + } - return Target; - })(); + var source = registry.getSource(sourceId); + var item = source.beginDrag(monitor, sourceId); + (0, _invariant2.default)((0, _isObject2.default)(item), 'Item must be an object.'); - return function createTarget(monitor) { - return new Target(monitor); + registry.pinSource(sourceId); + + var itemType = registry.getSourceType(sourceId); + return { + type: BEGIN_DRAG, + itemType: itemType, + item: item, + sourceId: sourceId, + clientOffset: clientOffset, + sourceClientOffset: sourceClientOffset, + isSourcePublic: publishSource }; } -module.exports = exports['default']; -}).call(this,require('_process')) -},{"_process":108,"invariant":107,"lodash/isPlainObject":248}],227:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports['default'] = createTargetMonitor; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +function publishDragSource() { + var monitor = this.getMonitor(); + if (!monitor.isDragging()) { + return; + } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + return { type: PUBLISH_DRAG_SOURCE }; +} -var _invariant = require('invariant'); +function hover(targetIdsArg) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$clientOffset = _ref.clientOffset, + clientOffset = _ref$clientOffset === undefined ? null : _ref$clientOffset; -var _invariant2 = _interopRequireDefault(_invariant); + (0, _invariant2.default)((0, _isArray2.default)(targetIdsArg), 'Expected targetIds to be an array.'); + var targetIds = targetIdsArg.slice(0); -var isCallingCanDrop = false; + var monitor = this.getMonitor(); + var registry = this.getRegistry(); + (0, _invariant2.default)(monitor.isDragging(), 'Cannot call hover while not dragging.'); + (0, _invariant2.default)(!monitor.didDrop(), 'Cannot call hover after drop.'); -var TargetMonitor = (function () { - function TargetMonitor(manager) { - _classCallCheck(this, TargetMonitor); + // First check invariants. + for (var i = 0; i < targetIds.length; i++) { + var targetId = targetIds[i]; + (0, _invariant2.default)(targetIds.lastIndexOf(targetId) === i, 'Expected targetIds to be unique in the passed array.'); - this.internalMonitor = manager.getMonitor(); + var target = registry.getTarget(targetId); + (0, _invariant2.default)(target, 'Expected targetIds to be registered.'); } - TargetMonitor.prototype.receiveHandlerId = function receiveHandlerId(targetId) { - this.targetId = targetId; - }; - - TargetMonitor.prototype.canDrop = function canDrop() { - _invariant2['default'](!isCallingCanDrop, 'You may not call monitor.canDrop() inside your canDrop() implementation. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html'); + var draggedItemType = monitor.getItemType(); - try { - isCallingCanDrop = true; - return this.internalMonitor.canDropOnTarget(this.targetId); - } finally { - isCallingCanDrop = false; + // Remove those targetIds that don't match the targetType. This + // fixes shallow isOver which would only be non-shallow because of + // non-matching targets. + for (var _i2 = targetIds.length - 1; _i2 >= 0; _i2--) { + var _targetId = targetIds[_i2]; + var targetType = registry.getTargetType(_targetId); + if (!(0, _matchesType2.default)(targetType, draggedItemType)) { + targetIds.splice(_i2, 1); } - }; + } - TargetMonitor.prototype.isOver = function isOver(options) { - return this.internalMonitor.isOverTarget(this.targetId, options); - }; + // Finally call hover on all matching targets. + for (var _i3 = 0; _i3 < targetIds.length; _i3++) { + var _targetId2 = targetIds[_i3]; + var _target = registry.getTarget(_targetId2); + _target.hover(monitor, _targetId2); + } - TargetMonitor.prototype.getItemType = function getItemType() { - return this.internalMonitor.getItemType(); + return { + type: HOVER, + targetIds: targetIds, + clientOffset: clientOffset }; +} - TargetMonitor.prototype.getItem = function getItem() { - return this.internalMonitor.getItem(); - }; +function drop() { + var _this = this; - TargetMonitor.prototype.getDropResult = function getDropResult() { - return this.internalMonitor.getDropResult(); - }; + var monitor = this.getMonitor(); + var registry = this.getRegistry(); + (0, _invariant2.default)(monitor.isDragging(), 'Cannot call drop while not dragging.'); + (0, _invariant2.default)(!monitor.didDrop(), 'Cannot call drop twice during one drag operation.'); - TargetMonitor.prototype.didDrop = function didDrop() { - return this.internalMonitor.didDrop(); - }; + var targetIds = monitor.getTargetIds().filter(monitor.canDropOnTarget, monitor); - TargetMonitor.prototype.getInitialClientOffset = function getInitialClientOffset() { - return this.internalMonitor.getInitialClientOffset(); - }; + targetIds.reverse(); + targetIds.forEach(function (targetId, index) { + var target = registry.getTarget(targetId); - TargetMonitor.prototype.getInitialSourceClientOffset = function getInitialSourceClientOffset() { - return this.internalMonitor.getInitialSourceClientOffset(); - }; + var dropResult = target.drop(monitor, targetId); + (0, _invariant2.default)(typeof dropResult === 'undefined' || (0, _isObject2.default)(dropResult), 'Drop result must either be an object or undefined.'); + if (typeof dropResult === 'undefined') { + dropResult = index === 0 ? {} : monitor.getDropResult(); + } - TargetMonitor.prototype.getSourceClientOffset = function getSourceClientOffset() { - return this.internalMonitor.getSourceClientOffset(); - }; + _this.store.dispatch({ + type: DROP, + dropResult: dropResult + }); + }); +} - TargetMonitor.prototype.getClientOffset = function getClientOffset() { - return this.internalMonitor.getClientOffset(); - }; +function endDrag() { + var monitor = this.getMonitor(); + var registry = this.getRegistry(); + (0, _invariant2.default)(monitor.isDragging(), 'Cannot call endDrag while not dragging.'); - TargetMonitor.prototype.getDifferenceFromInitialOffset = function getDifferenceFromInitialOffset() { - return this.internalMonitor.getDifferenceFromInitialOffset(); - }; + var sourceId = monitor.getSourceId(); + var source = registry.getSource(sourceId, true); + source.endDrag(monitor, sourceId); - return TargetMonitor; -})(); + registry.unpinSource(); -function createTargetMonitor(manager) { - return new TargetMonitor(manager); + return { type: END_DRAG }; } - -module.exports = exports['default']; -},{"invariant":107}],228:[function(require,module,exports){ -(function (process){ +},{"../utils/matchesType":152,"invariant":159,"lodash/isArray":234,"lodash/isObject":239}],142:[function(require,module,exports){ 'use strict'; -exports.__esModule = true; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addSource = addSource; +exports.addTarget = addTarget; +exports.removeSource = removeSource; +exports.removeTarget = removeTarget; +var ADD_SOURCE = exports.ADD_SOURCE = 'dnd-core/ADD_SOURCE'; +var ADD_TARGET = exports.ADD_TARGET = 'dnd-core/ADD_TARGET'; +var REMOVE_SOURCE = exports.REMOVE_SOURCE = 'dnd-core/REMOVE_SOURCE'; +var REMOVE_TARGET = exports.REMOVE_TARGET = 'dnd-core/REMOVE_TARGET'; -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; }; +function addSource(sourceId) { + return { + type: ADD_SOURCE, + sourceId: sourceId + }; +} -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 addTarget(targetId) { + return { + type: ADD_TARGET, + targetId: targetId + }; +} -exports['default'] = decorateHandler; +function removeSource(sourceId) { + return { + type: REMOVE_SOURCE, + sourceId: sourceId + }; +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +function removeTarget(targetId) { + return { + type: REMOVE_TARGET, + targetId: targetId + }; +} +},{}],143:[function(require,module,exports){ +'use strict'; -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } +Object.defineProperty(exports, "__esModule", { + value: true +}); -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 _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 = require('react'); +exports.default = createBackend; -var _react2 = _interopRequireDefault(_react); +var _noop = require('lodash/noop'); -var _disposables = require('disposables'); +var _noop2 = _interopRequireDefault(_noop); -var _utilsShallowEqual = require('./utils/shallowEqual'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _utilsShallowEqual2 = _interopRequireDefault(_utilsShallowEqual); +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var _utilsShallowEqualScalar = require('./utils/shallowEqualScalar'); +var TestBackend = function () { + function TestBackend(manager) { + _classCallCheck(this, TestBackend); -var _utilsShallowEqualScalar2 = _interopRequireDefault(_utilsShallowEqualScalar); + this.actions = manager.getActions(); + } -var _lodashIsPlainObject = require('lodash/isPlainObject'); + _createClass(TestBackend, [{ + key: 'setup', + value: function setup() { + this.didCallSetup = true; + } + }, { + key: 'teardown', + value: function teardown() { + this.didCallTeardown = true; + } + }, { + key: 'connectDragSource', + value: function connectDragSource() { + return _noop2.default; + } + }, { + key: 'connectDragPreview', + value: function connectDragPreview() { + return _noop2.default; + } + }, { + key: 'connectDropTarget', + value: function connectDropTarget() { + return _noop2.default; + } + }, { + key: 'simulateBeginDrag', + value: function simulateBeginDrag(sourceIds, options) { + this.actions.beginDrag(sourceIds, options); + } + }, { + key: 'simulatePublishDragSource', + value: function simulatePublishDragSource() { + this.actions.publishDragSource(); + } + }, { + key: 'simulateHover', + value: function simulateHover(targetIds, options) { + this.actions.hover(targetIds, options); + } + }, { + key: 'simulateDrop', + value: function simulateDrop() { + this.actions.drop(); + } + }, { + key: 'simulateEndDrag', + value: function simulateEndDrag() { + this.actions.endDrag(); + } + }]); -var _lodashIsPlainObject2 = _interopRequireDefault(_lodashIsPlainObject); + return TestBackend; +}(); -var _invariant = require('invariant'); +function createBackend(manager) { + return new TestBackend(manager); +} +},{"lodash/noop":242}],144:[function(require,module,exports){ +'use strict'; -var _invariant2 = _interopRequireDefault(_invariant); +Object.defineProperty(exports, "__esModule", { + value: true +}); -function decorateHandler(_ref) { - var DecoratedComponent = _ref.DecoratedComponent; - var createHandler = _ref.createHandler; - var createMonitor = _ref.createMonitor; - var createConnector = _ref.createConnector; - var registerHandler = _ref.registerHandler; - var containerDisplayName = _ref.containerDisplayName; - var getType = _ref.getType; - var collect = _ref.collect; - var options = _ref.options; - var _options$arePropsEqual = options.arePropsEqual; - var arePropsEqual = _options$arePropsEqual === undefined ? _utilsShallowEqualScalar2['default'] : _options$arePropsEqual; +var _DragDropManager = require('./DragDropManager'); - var displayName = DecoratedComponent.displayName || DecoratedComponent.name || 'Component'; +Object.defineProperty(exports, 'DragDropManager', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_DragDropManager).default; + } +}); - return (function (_Component) { - _inherits(DragDropContainer, _Component); +var _DragSource = require('./DragSource'); - DragDropContainer.prototype.getHandlerId = function getHandlerId() { - return this.handlerId; - }; +Object.defineProperty(exports, 'DragSource', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_DragSource).default; + } +}); - DragDropContainer.prototype.getDecoratedComponentInstance = function getDecoratedComponentInstance() { - return this.decoratedComponentInstance; - }; +var _DropTarget = require('./DropTarget'); - DragDropContainer.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps, nextState) { - return !arePropsEqual(nextProps, this.props) || !_utilsShallowEqual2['default'](nextState, this.state); - }; +Object.defineProperty(exports, 'DropTarget', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_DropTarget).default; + } +}); - _createClass(DragDropContainer, null, [{ - key: 'DecoratedComponent', - value: DecoratedComponent, - enumerable: true - }, { - key: 'displayName', - value: containerDisplayName + '(' + displayName + ')', - enumerable: true - }, { - key: 'contextTypes', - value: { - dragDropManager: _react.PropTypes.object.isRequired - }, - enumerable: true - }]); +var _createTestBackend = require('./backends/createTestBackend'); - function DragDropContainer(props, context) { - _classCallCheck(this, DragDropContainer); +Object.defineProperty(exports, 'createTestBackend', { + enumerable: true, + get: function get() { + return _interopRequireDefault(_createTestBackend).default; + } +}); - _Component.call(this, props, context); - this.handleChange = this.handleChange.bind(this); - this.handleChildRef = this.handleChildRef.bind(this); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +},{"./DragDropManager":136,"./DragSource":138,"./DropTarget":139,"./backends/createTestBackend":143}],145:[function(require,module,exports){ +'use strict'; - _invariant2['default'](typeof this.context.dragDropManager === 'object', 'Could not find the drag and drop manager in the context of %s. ' + 'Make sure to wrap the top-level component of your app with DragDropContext. ' + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context', displayName, displayName); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = dirtyHandlerIds; +exports.areDirty = areDirty; - this.manager = this.context.dragDropManager; - this.handlerMonitor = createMonitor(this.manager); - this.handlerConnector = createConnector(this.manager.getBackend()); - this.handler = createHandler(this.handlerMonitor); +var _xor = require('lodash/xor'); - this.disposable = new _disposables.SerialDisposable(); - this.receiveProps(props); - this.state = this.getCurrentState(); - this.dispose(); - } +var _xor2 = _interopRequireDefault(_xor); - DragDropContainer.prototype.componentDidMount = function componentDidMount() { - this.isCurrentlyMounted = true; - this.disposable = new _disposables.SerialDisposable(); - this.currentType = null; - this.receiveProps(this.props); - this.handleChange(); - }; +var _intersection = require('lodash/intersection'); - DragDropContainer.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { - if (!arePropsEqual(nextProps, this.props)) { - this.receiveProps(nextProps); - this.handleChange(); - } - }; +var _intersection2 = _interopRequireDefault(_intersection); - DragDropContainer.prototype.componentWillUnmount = function componentWillUnmount() { - this.dispose(); - this.isCurrentlyMounted = false; - }; +var _dragDrop = require('../actions/dragDrop'); - DragDropContainer.prototype.receiveProps = function receiveProps(props) { - this.handler.receiveProps(props); - this.receiveType(getType(props)); - }; +var _registry = require('../actions/registry'); - DragDropContainer.prototype.receiveType = function receiveType(type) { - if (type === this.currentType) { - return; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var NONE = []; +var ALL = []; + +function dirtyHandlerIds() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : NONE; + var action = arguments[1]; + var dragOperation = arguments[2]; + + switch (action.type) { + case _dragDrop.HOVER: + break; + case _registry.ADD_SOURCE: + case _registry.ADD_TARGET: + case _registry.REMOVE_TARGET: + case _registry.REMOVE_SOURCE: + return NONE; + case _dragDrop.BEGIN_DRAG: + case _dragDrop.PUBLISH_DRAG_SOURCE: + case _dragDrop.END_DRAG: + case _dragDrop.DROP: + default: + return ALL; + } + + var targetIds = action.targetIds; + var prevTargetIds = dragOperation.targetIds; + + var result = (0, _xor2.default)(targetIds, prevTargetIds); + + var didChange = false; + if (result.length === 0) { + for (var i = 0; i < targetIds.length; i++) { + if (targetIds[i] !== prevTargetIds[i]) { + didChange = true; + break; } + } + } else { + didChange = true; + } - this.currentType = type; + if (!didChange) { + return NONE; + } - var _registerHandler = registerHandler(type, this.handler, this.manager); + var prevInnermostTargetId = prevTargetIds[prevTargetIds.length - 1]; + var innermostTargetId = targetIds[targetIds.length - 1]; - var handlerId = _registerHandler.handlerId; - var unregister = _registerHandler.unregister; + if (prevInnermostTargetId !== innermostTargetId) { + if (prevInnermostTargetId) { + result.push(prevInnermostTargetId); + } + if (innermostTargetId) { + result.push(innermostTargetId); + } + } - this.handlerId = handlerId; - this.handlerMonitor.receiveHandlerId(handlerId); - this.handlerConnector.receiveHandlerId(handlerId); + return result; +} - var globalMonitor = this.manager.getMonitor(); - var unsubscribe = globalMonitor.subscribeToStateChange(this.handleChange, { handlerIds: [handlerId] }); +function areDirty(state, handlerIds) { + if (state === NONE) { + return false; + } - this.disposable.setDisposable(new _disposables.CompositeDisposable(new _disposables.Disposable(unsubscribe), new _disposables.Disposable(unregister))); - }; + if (state === ALL || typeof handlerIds === 'undefined') { + return true; + } - DragDropContainer.prototype.handleChange = function handleChange() { - if (!this.isCurrentlyMounted) { - return; - } + return (0, _intersection2.default)(handlerIds, state).length > 0; +} +},{"../actions/dragDrop":141,"../actions/registry":142,"lodash/intersection":232,"lodash/xor":244}],146:[function(require,module,exports){ +'use strict'; - var nextState = this.getCurrentState(); - if (!_utilsShallowEqual2['default'](nextState, this.state)) { - this.setState(nextState); - } - }; +Object.defineProperty(exports, "__esModule", { + value: true +}); - DragDropContainer.prototype.dispose = function dispose() { - this.disposable.dispose(); - this.handlerConnector.receiveHandlerId(null); - }; +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; }; - DragDropContainer.prototype.handleChildRef = function handleChildRef(component) { - this.decoratedComponentInstance = component; - this.handler.receiveComponent(component); - }; +exports.default = dragOffset; +exports.getSourceClientOffset = getSourceClientOffset; +exports.getDifferenceFromInitialOffset = getDifferenceFromInitialOffset; - DragDropContainer.prototype.getCurrentState = function getCurrentState() { - var nextState = collect(this.handlerConnector.hooks, this.handlerMonitor); +var _dragDrop = require('../actions/dragDrop'); - if (process.env.NODE_ENV !== 'production') { - _invariant2['default'](_lodashIsPlainObject2['default'](nextState), 'Expected `collect` specified as the second argument to ' + '%s for %s to return a plain object of props to inject. ' + 'Instead, received %s.', containerDisplayName, displayName, nextState); - } +var initialState = { + initialSourceClientOffset: null, + initialClientOffset: null, + clientOffset: null +}; - return nextState; - }; +function areOffsetsEqual(offsetA, offsetB) { + if (offsetA === offsetB) { + return true; + } + return offsetA && offsetB && offsetA.x === offsetB.x && offsetA.y === offsetB.y; +} - DragDropContainer.prototype.render = function render() { - return _react2['default'].createElement(DecoratedComponent, _extends({}, this.props, this.state, { - ref: this.handleChildRef })); - }; +function dragOffset() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + var action = arguments[1]; - return DragDropContainer; - })(_react.Component); + switch (action.type) { + case _dragDrop.BEGIN_DRAG: + return { + initialSourceClientOffset: action.sourceClientOffset, + initialClientOffset: action.clientOffset, + clientOffset: action.clientOffset + }; + case _dragDrop.HOVER: + if (areOffsetsEqual(state.clientOffset, action.clientOffset)) { + return state; + } + return _extends({}, state, { + clientOffset: action.clientOffset + }); + case _dragDrop.END_DRAG: + case _dragDrop.DROP: + return initialState; + default: + return state; + } } -module.exports = exports['default']; -}).call(this,require('_process')) -},{"./utils/shallowEqual":235,"./utils/shallowEqualScalar":236,"_process":108,"disposables":6,"invariant":107,"lodash/isPlainObject":248,"react":undefined}],229:[function(require,module,exports){ -'use strict'; +function getSourceClientOffset(state) { + var clientOffset = state.clientOffset, + initialClientOffset = state.initialClientOffset, + initialSourceClientOffset = state.initialSourceClientOffset; -exports.__esModule = true; + if (!clientOffset || !initialClientOffset || !initialSourceClientOffset) { + return null; + } + return { + x: clientOffset.x + initialSourceClientOffset.x - initialClientOffset.x, + y: clientOffset.y + initialSourceClientOffset.y - initialClientOffset.y + }; +} -function _interopRequire(obj) { return obj && obj.__esModule ? obj['default'] : obj; } +function getDifferenceFromInitialOffset(state) { + var clientOffset = state.clientOffset, + initialClientOffset = state.initialClientOffset; -var _DragDropContext = require('./DragDropContext'); + if (!clientOffset || !initialClientOffset) { + return null; + } + return { + x: clientOffset.x - initialClientOffset.x, + y: clientOffset.y - initialClientOffset.y + }; +} +},{"../actions/dragDrop":141}],147:[function(require,module,exports){ +'use strict'; -exports.DragDropContext = _interopRequire(_DragDropContext); +Object.defineProperty(exports, "__esModule", { + value: true +}); -var _DragLayer = require('./DragLayer'); +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.DragLayer = _interopRequire(_DragLayer); +exports.default = dragOperation; -var _DragSource = require('./DragSource'); +var _without = require('lodash/without'); -exports.DragSource = _interopRequire(_DragSource); +var _without2 = _interopRequireDefault(_without); -var _DropTarget = require('./DropTarget'); +var _dragDrop = require('../actions/dragDrop'); -exports.DropTarget = _interopRequire(_DropTarget); -},{"./DragDropContext":217,"./DragLayer":218,"./DragSource":219,"./DropTarget":220}],230:[function(require,module,exports){ -"use strict"; +var _registry = require('../actions/registry'); -exports.__esModule = true; -exports["default"] = registerSource; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function registerSource(type, source, manager) { - var registry = manager.getRegistry(); - var sourceId = registry.addSource(type, source); +var initialState = { + itemType: null, + item: null, + sourceId: null, + targetIds: [], + dropResult: null, + didDrop: false, + isSourcePublic: null +}; - function unregisterSource() { - registry.removeSource(sourceId); +function dragOperation() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState; + var action = arguments[1]; + + switch (action.type) { + case _dragDrop.BEGIN_DRAG: + return _extends({}, state, { + itemType: action.itemType, + item: action.item, + sourceId: action.sourceId, + isSourcePublic: action.isSourcePublic, + dropResult: null, + didDrop: false + }); + case _dragDrop.PUBLISH_DRAG_SOURCE: + return _extends({}, state, { + isSourcePublic: true + }); + case _dragDrop.HOVER: + return _extends({}, state, { + targetIds: action.targetIds + }); + case _registry.REMOVE_TARGET: + if (state.targetIds.indexOf(action.targetId) === -1) { + return state; + } + return _extends({}, state, { + targetIds: (0, _without2.default)(state.targetIds, action.targetId) + }); + case _dragDrop.DROP: + return _extends({}, state, { + dropResult: action.dropResult, + didDrop: true, + targetIds: [] + }); + case _dragDrop.END_DRAG: + return _extends({}, state, { + itemType: null, + item: null, + sourceId: null, + dropResult: null, + didDrop: false, + isSourcePublic: null, + targetIds: [] + }); + default: + return state; } - - return { - handlerId: sourceId, - unregister: unregisterSource - }; } +},{"../actions/dragDrop":141,"../actions/registry":142,"lodash/without":243}],148:[function(require,module,exports){ +'use strict'; -module.exports = exports["default"]; -},{}],231:[function(require,module,exports){ -"use strict"; - -exports.__esModule = true; -exports["default"] = registerTarget; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = reduce; -function registerTarget(type, target, manager) { - var registry = manager.getRegistry(); - var targetId = registry.addTarget(type, target); +var _dragOffset = require('./dragOffset'); - function unregisterTarget() { - registry.removeTarget(targetId); - } +var _dragOffset2 = _interopRequireDefault(_dragOffset); - return { - handlerId: targetId, - unregister: unregisterTarget - }; -} +var _dragOperation = require('./dragOperation'); -module.exports = exports["default"]; -},{}],232:[function(require,module,exports){ -(function (process){ -'use strict'; +var _dragOperation2 = _interopRequireDefault(_dragOperation); -exports.__esModule = true; -exports['default'] = checkDecoratorArguments; +var _refCount = require('./refCount'); -function checkDecoratorArguments(functionName, signature) { - if (process.env.NODE_ENV !== 'production') { - for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - args[_key - 2] = arguments[_key]; - } +var _refCount2 = _interopRequireDefault(_refCount); - for (var i = 0; i < args.length; i++) { - var arg = args[i]; - if (arg && arg.prototype && arg.prototype.render) { - console.error( // eslint-disable-line no-console - 'You seem to be applying the arguments in the wrong order. ' + ('It should be ' + functionName + '(' + signature + ')(Component), not the other way around. ') + 'Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#you-seem-to-be-applying-the-arguments-in-the-wrong-order'); - return; - } - } - } -} +var _dirtyHandlerIds = require('./dirtyHandlerIds'); -module.exports = exports['default']; -}).call(this,require('_process')) -},{"_process":108}],233:[function(require,module,exports){ -'use strict'; +var _dirtyHandlerIds2 = _interopRequireDefault(_dirtyHandlerIds); -exports.__esModule = true; -exports['default'] = cloneWithRef; +var _stateId = require('./stateId'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +var _stateId2 = _interopRequireDefault(_stateId); -var _invariant = require('invariant'); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _invariant2 = _interopRequireDefault(_invariant); +function reduce() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var action = arguments[1]; -var _react = require('react'); + return { + dirtyHandlerIds: (0, _dirtyHandlerIds2.default)(state.dirtyHandlerIds, action, state.dragOperation), + dragOffset: (0, _dragOffset2.default)(state.dragOffset, action), + refCount: (0, _refCount2.default)(state.refCount, action), + dragOperation: (0, _dragOperation2.default)(state.dragOperation, action), + stateId: (0, _stateId2.default)(state.stateId) + }; +} +},{"./dirtyHandlerIds":145,"./dragOffset":146,"./dragOperation":147,"./refCount":149,"./stateId":150}],149:[function(require,module,exports){ +'use strict'; -function cloneWithRef(element, newRef) { - var previousRef = element.ref; - _invariant2['default'](typeof previousRef !== 'string', 'Cannot connect React DnD to an element with an existing string ref. ' + 'Please convert it to use a callback ref instead, or wrap it into a or
. ' + 'Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute'); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = refCount; - if (!previousRef) { - // When there is no ref on the element, use the new ref directly - return _react.cloneElement(element, { - ref: newRef - }); - } +var _registry = require('../actions/registry'); - return _react.cloneElement(element, { - ref: function ref(node) { - newRef(node); +function refCount() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var action = arguments[1]; - if (previousRef) { - previousRef(node); - } - } - }); + switch (action.type) { + case _registry.ADD_SOURCE: + case _registry.ADD_TARGET: + return state + 1; + case _registry.REMOVE_SOURCE: + case _registry.REMOVE_TARGET: + return state - 1; + default: + return state; + } } +},{"../actions/registry":142}],150:[function(require,module,exports){ +"use strict"; -module.exports = exports['default']; -},{"invariant":107,"react":undefined}],234:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports['default'] = isValidType; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = stateId; +function stateId() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; -var _lodashIsArray = require('lodash/isArray'); + return state + 1; +} +},{}],151:[function(require,module,exports){ +"use strict"; -var _lodashIsArray2 = _interopRequireDefault(_lodashIsArray); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = getNextUniqueId; +var nextUniqueId = 0; -function isValidType(type, allowArray) { - return typeof type === 'string' || typeof type === 'symbol' || allowArray && _lodashIsArray2['default'](type) && type.every(function (t) { - return isValidType(t, false); - }); +function getNextUniqueId() { + return nextUniqueId++; } - -module.exports = exports['default']; -},{"lodash/isArray":246}],235:[function(require,module,exports){ -arguments[4][118][0].apply(exports,arguments) -},{"dup":118}],236:[function(require,module,exports){ +},{}],152:[function(require,module,exports){ 'use strict'; -exports.__esModule = true; -exports['default'] = shallowEqualScalar; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = matchesType; -function shallowEqualScalar(objA, objB) { - if (objA === objB) { - return true; - } +var _isArray = require('lodash/isArray'); - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } +var _isArray2 = _interopRequireDefault(_isArray); - var keysA = Object.keys(objA); - var keysB = Object.keys(objB); +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - if (keysA.length !== keysB.length) { - return false; +function matchesType(targetType, draggedItemType) { + if ((0, _isArray2.default)(targetType)) { + return targetType.some(function (t) { + return t === draggedItemType; + }); + } else { + return targetType === draggedItemType; } +} +},{"lodash/isArray":234}],153:[function(require,module,exports){ +"use strict"; - // Test for A's keys different from B. - var hasOwn = Object.prototype.hasOwnProperty; - for (var i = 0; i < keysA.length; i++) { - if (!hasOwn.call(objB, keysA[i])) { - return false; - } - - var valA = objA[keysA[i]]; - var valB = objB[keysA[i]]; +// rawAsap provides everything we need except exception management. +var rawAsap = require("./raw"); +// RawTasks are recycled to reduce GC churn. +var freeTasks = []; +// We queue errors to ensure they are thrown in right order (FIFO). +// Array-as-queue is good enough here, since we are just dealing with exceptions. +var pendingErrors = []; +var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError); - if (valA !== valB || typeof valA === 'object' || typeof valB === 'object') { - return false; +function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); } - } - - return true; } -module.exports = exports['default']; -},{}],237:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports['default'] = wrapConnectorHooks; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _utilsCloneWithRef = require('./utils/cloneWithRef'); - -var _utilsCloneWithRef2 = _interopRequireDefault(_utilsCloneWithRef); +/** + * Calls a task as soon as possible after returning, in its own event, with priority + * over other events like animation, reflow, and repaint. An error thrown from an + * event will not interrupt, nor even substantially slow down the processing of + * other events, but will be rather postponed to a lower priority event. + * @param {{call}} task A callable object, typically a function that takes no + * arguments. + */ +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawAsap(rawTask); +} -var _react = require('react'); +// We wrap tasks with recyclable task objects. A task object implements +// `call`, just like a function. +function RawTask() { + this.task = null; +} -function throwIfCompositeComponentElement(element) { - // Custom components can no longer be wrapped directly in React DnD 2.0 - // so that we don't need to depend on findDOMNode() from react-dom. - if (typeof element.type === 'string') { - return; - } +// The sole purpose of wrapping the task is to catch the exception and recycle +// the task object after its single use. +RawTask.prototype.call = function () { + try { + this.task.call(); + } catch (error) { + if (asap.onerror) { + // This hook exists purely for testing purposes. + // Its name will be periodically randomized to break any code that + // depends on its existence. + asap.onerror(error); + } else { + // In a web browser, exceptions are not fatal. However, to avoid + // slowing down the queue of pending tasks, we rethrow the error in a + // lower priority turn. + pendingErrors.push(error); + requestErrorThrow(); + } + } finally { + this.task = null; + freeTasks[freeTasks.length] = this; + } +}; - var displayName = element.type.displayName || element.type.name || 'the component'; +},{"./raw":154}],154:[function(require,module,exports){ +(function (global){ +"use strict"; - throw new Error('Only native element nodes can now be passed to React DnD connectors. ' + ('You can either wrap ' + displayName + ' into a
, or turn it into a ') + 'drag source or a drop target itself.'); +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including IO, animation, reflow, and redraw +// events in browsers. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Equivalent to push, but avoids a function call. + queue[queue.length] = task; } -function wrapHookToRecognizeElement(hook) { - return function () { - var elementOrNode = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; - var options = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// `requestFlush` is an implementation-specific method that attempts to kick +// off a `flush` event as quickly as possible. `flush` will attempt to exhaust +// the event queue before yielding to the browser's own event loop. +var requestFlush; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory exhaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; - // When passed a node, call the hook straight away. - if (!_react.isValidElement(elementOrNode)) { - var node = elementOrNode; - hook(node, options); - return; +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } } - - // If passed a ReactElement, clone it and attach this function as a ref. - // This helps us achieve a neat API where user doesn't even know that refs - // are being used under the hood. - var element = elementOrNode; - throwIfCompositeComponentElement(element); - - // When no options are passed, use the hook directly - var ref = options ? function (node) { - return hook(node, options); - } : hook; - - return _utilsCloneWithRef2['default'](element, ref); - }; + queue.length = 0; + index = 0; + flushing = false; } -function wrapConnectorHooks(hooks) { - var wrappedHooks = {}; +// `requestFlush` is implemented using a strategy based on data collected from +// every available SauceLabs Selenium web driver worker at time of writing. +// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593 - Object.keys(hooks).forEach(function (key) { - var hook = hooks[key]; - var wrappedHook = wrapHookToRecognizeElement(hook); - wrappedHooks[key] = function () { - return wrappedHook; - }; - }); +// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that +// have WebKitMutationObserver but not un-prefixed MutationObserver. +// Must use `global` or `self` instead of `window` to work in both frames and web +// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop. - return wrappedHooks; -} +/* globals self */ +var scope = typeof global !== "undefined" ? global : self; +var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver; -module.exports = exports['default']; -},{"./utils/cloneWithRef":233,"react":undefined}],238:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"./_root":245,"dup":31}],239:[function(require,module,exports){ -arguments[4][42][0].apply(exports,arguments) -},{"./_Symbol":238,"./_getRawTag":242,"./_objectToString":243,"dup":42}],240:[function(require,module,exports){ -arguments[4][58][0].apply(exports,arguments) -},{"dup":58}],241:[function(require,module,exports){ -var overArg = require('./_overArg'); +// MutationObservers are desirable because they have high priority and work +// reliably everywhere they are implemented. +// They are implemented in all modern browsers. +// +// - Android 4-4.3 +// - Chrome 26-34 +// - Firefox 14-29 +// - Internet Explorer 11 +// - iPad Safari 6-7.1 +// - iPhone Safari 7-7.1 +// - Safari 6-7 +if (typeof BrowserMutationObserver === "function") { + requestFlush = makeRequestCallFromMutationObserver(flush); -/** Built-in value references. */ -var getPrototype = overArg(Object.getPrototypeOf, Object); +// MessageChannels are desirable because they give direct access to the HTML +// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera +// 11-12, and in web workers in many engines. +// Although message channels yield to any queued rendering and IO tasks, they +// would be better than imposing the 4ms delay of timers. +// However, they do not work reliably in Internet Explorer or Safari. -module.exports = getPrototype; +// Internet Explorer 10 is the only browser that has setImmediate but does +// not have MutationObservers. +// Although setImmediate yields to the browser's renderer, it would be +// preferrable to falling back to setTimeout since it does not have +// the minimum 4ms penalty. +// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and +// Desktop to a lesser extent) that renders both setImmediate and +// MessageChannel useless for the purposes of ASAP. +// https://github.com/kriskowal/q/issues/396 -},{"./_overArg":244}],242:[function(require,module,exports){ -arguments[4][61][0].apply(exports,arguments) -},{"./_Symbol":238,"dup":61}],243:[function(require,module,exports){ -arguments[4][82][0].apply(exports,arguments) -},{"dup":82}],244:[function(require,module,exports){ -/** - * 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)); - }; +// Timers are implemented universally. +// We fall back to timers in workers in most engines, and in foreground +// contexts in the following browsers. +// However, note that even this simple case requires nuances to operate in a +// broad spectrum of browsers. +// +// - Firefox 3-13 +// - Internet Explorer 6-9 +// - iPad Safari 4.3 +// - Lynx 2.8.7 +} else { + requestFlush = makeRequestCallFromTimer(flush); } -module.exports = overArg; +// `requestFlush` requests that the high priority event queue be flushed as +// soon as possible. +// This is useful to prevent an error thrown in a task from stalling the event +// queue if the exception handled by Node.js’s +// `process.on("uncaughtException")` or by a domain. +rawAsap.requestFlush = requestFlush; -},{}],245:[function(require,module,exports){ -arguments[4][84][0].apply(exports,arguments) -},{"./_freeGlobal":240,"dup":84}],246:[function(require,module,exports){ -arguments[4][97][0].apply(exports,arguments) -},{"dup":97}],247:[function(require,module,exports){ -arguments[4][103][0].apply(exports,arguments) -},{"dup":103}],248:[function(require,module,exports){ -var baseGetTag = require('./_baseGetTag'), - getPrototype = require('./_getPrototype'), - isObjectLike = require('./isObjectLike'); +// To request a high priority event, we induce a mutation observer by toggling +// the text of a text node between "1" and "-1". +function makeRequestCallFromMutationObserver(callback) { + var toggle = 1; + var observer = new BrowserMutationObserver(callback); + var node = document.createTextNode(""); + observer.observe(node, {characterData: true}); + return function requestCall() { + toggle = -toggle; + node.data = toggle; + }; +} -/** `Object#toString` result references. */ -var objectTag = '[object Object]'; +// The message channel technique was discovered by Malte Ubl and was the +// original foundation for this library. +// http://www.nonblocking.io/2011/06/windownexttick.html -/** Used for built-in method references. */ -var funcProto = Function.prototype, - objectProto = Object.prototype; +// Safari 6.0.5 (at least) intermittently fails to create message ports on a +// page's first load. Thankfully, this version of Safari supports +// MutationObservers, so we don't need to fall back in that case. -/** Used to resolve the decompiled source of functions. */ -var funcToString = funcProto.toString; +// function makeRequestCallFromMessageChannel(callback) { +// var channel = new MessageChannel(); +// channel.port1.onmessage = callback; +// return function requestCall() { +// channel.port2.postMessage(0); +// }; +// } -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; +// For reasons explained above, we are also unable to use `setImmediate` +// under any circumstances. +// Even if we were, there is another bug in Internet Explorer 10. +// It is not sufficient to assign `setImmediate` to `requestFlush` because +// `setImmediate` must be called *by name* and therefore must be wrapped in a +// closure. +// Never forget. -/** Used to infer the `Object` constructor. */ -var objectCtorString = funcToString.call(Object); +// function makeRequestCallFromSetImmediate(callback) { +// return function requestCall() { +// setImmediate(callback); +// }; +// } -/** - * 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; +// Safari 6.0 has a problem where timers will get lost while the user is +// scrolling. This problem does not impact ASAP because Safari 6.0 supports +// mutation observers, so that implementation is used instead. +// However, if we ever elect to use timers in Safari, the prevalent work-around +// is to add a scroll event listener that calls for a flush. + +// `setTimeout` does not call the passed callback if the delay is less than +// approximately 7 in web workers in Firefox 8 through 18, and sometimes not +// even then. + +function makeRequestCallFromTimer(callback) { + return function requestCall() { + // We dispatch a timeout with a specified delay of 0 for engines that + // can reliably accommodate that request. This will usually be snapped + // to a 4 milisecond delay, but once we're flushing, there's no delay + // between events. + var timeoutHandle = setTimeout(handleTimer, 0); + // However, since this timer gets frequently dropped in Firefox + // workers, we enlist an interval handle that will try to fire + // an event 20 times per second until it succeeds. + var intervalHandle = setInterval(handleTimer, 50); + + function handleTimer() { + // Whichever timer succeeds will cancel both timers and + // execute the callback. + clearTimeout(timeoutHandle); + clearInterval(intervalHandle); + callback(); + } + }; } -module.exports = isPlainObject; +// This is for `asap.js` only. +// Its name will be periodically randomized to break any code that depends on +// its existence. +rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer; + +// ASAP was originally a nextTick shim included in Q. This was factored out +// into this ASAP package. It was later adapted to RSVP which made further +// amendments. These decisions, particularly to marginalize MessageChannel and +// to capture the MutationObserver implementation in a closure, were integrated +// back into ASAP proper. +// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js -},{"./_baseGetTag":239,"./_getPrototype":241,"./isObjectLike":247}],249:[function(require,module,exports){ +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],155:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7767,227 +7347,720 @@ function createStore(reducer, preloadedState, enhancer) { throw new Error('Expected listener to be a function.'); } - var isSubscribed = true; + var isSubscribed = true; + + ensureCanMutateNextListeners(); + nextListeners.push(listener); + + return function unsubscribe() { + if (!isSubscribed) { + return; + } + + isSubscribed = false; + + ensureCanMutateNextListeners(); + var index = nextListeners.indexOf(listener); + nextListeners.splice(index, 1); + }; + } + + /** + * Dispatches an action. It is the only way to trigger a state change. + * + * The `reducer` function, used to create the store, will be called with the + * current state tree and the given `action`. Its return value will + * be considered the **next** state of the tree, and the change listeners + * will be notified. + * + * The base implementation only supports plain object actions. If you want to + * dispatch a Promise, an Observable, a thunk, or something else, you need to + * wrap your store creating function into the corresponding middleware. For + * example, see the documentation for the `redux-thunk` package. Even the + * middleware will eventually dispatch plain object actions using this method. + * + * @param {Object} action A plain object representing “what changed”. It is + * a good idea to keep actions serializable so you can record and replay user + * sessions, or use the time travelling `redux-devtools`. An action must have + * a `type` property which may not be `undefined`. It is a good idea to use + * string constants for action types. + * + * @returns {Object} For convenience, the same action object you dispatched. + * + * Note that, if you use a custom middleware, it may wrap `dispatch()` to + * return something else (for example, a Promise you can await). + */ + function dispatch(action) { + if (!(0, _isPlainObject2['default'])(action)) { + throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); + } + + if (typeof action.type === 'undefined') { + throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); + } + + if (isDispatching) { + throw new Error('Reducers may not dispatch actions.'); + } + + try { + isDispatching = true; + currentState = currentReducer(currentState, action); + } finally { + isDispatching = false; + } + + var listeners = currentListeners = nextListeners; + for (var i = 0; i < listeners.length; i++) { + listeners[i](); + } + + return action; + } + + /** + * Replaces the reducer currently used by the store to calculate the state. + * + * You might need this if your app implements code splitting and you want to + * load some of the reducers dynamically. You might also need this if you + * implement a hot reloading mechanism for Redux. + * + * @param {Function} nextReducer The reducer for the store to use instead. + * @returns {void} + */ + function replaceReducer(nextReducer) { + if (typeof nextReducer !== 'function') { + throw new Error('Expected the nextReducer to be a function.'); + } + + currentReducer = nextReducer; + dispatch({ type: ActionTypes.INIT }); + } + + /** + * Interoperability point for observable/reactive libraries. + * @returns {observable} A minimal observable of state changes. + * For more information, see the observable proposal: + * https://github.com/zenparsing/es-observable + */ + function observable() { + var _ref; + + var outerSubscribe = subscribe; + return _ref = { + /** + * The minimal observable subscription method. + * @param {Object} observer Any object that can be used as an observer. + * The observer object should have a `next` method. + * @returns {subscription} An object with an `unsubscribe` method that can + * be used to unsubscribe the observable from the store, and prevent further + * emission of values from the observable. + */ + subscribe: function subscribe(observer) { + if (typeof observer !== 'object') { + throw new TypeError('Expected the observer to be an object.'); + } + + function observeState() { + if (observer.next) { + observer.next(getState()); + } + } + + observeState(); + var unsubscribe = outerSubscribe(observeState); + return { unsubscribe: unsubscribe }; + } + }, _ref[_symbolObservable2['default']] = function () { + return this; + }, _ref; + } + + // When a store is created, an "INIT" action is dispatched so that every + // reducer returns their initial state. This effectively populates + // the initial state tree. + dispatch({ type: ActionTypes.INIT }); + + return _ref2 = { + dispatch: dispatch, + subscribe: subscribe, + getState: getState, + replaceReducer: replaceReducer + }, _ref2[_symbolObservable2['default']] = observable, _ref2; +} +},{"lodash/isPlainObject":241,"symbol-observable":156}],156:[function(require,module,exports){ +module.exports = require('./lib/index'); + +},{"./lib/index":157}],157:[function(require,module,exports){ +(function (global){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _ponyfill = require('./ponyfill'); + +var _ponyfill2 = _interopRequireDefault(_ponyfill); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + +var root; /* global window */ + + +if (typeof self !== 'undefined') { + root = self; +} else if (typeof window !== 'undefined') { + root = window; +} else if (typeof global !== 'undefined') { + root = global; +} else if (typeof module !== 'undefined') { + root = module; +} else { + root = Function('return this')(); +} + +var result = (0, _ponyfill2['default'])(root); +exports['default'] = result; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./ponyfill":158}],158:[function(require,module,exports){ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports['default'] = symbolObservablePonyfill; +function symbolObservablePonyfill(root) { + var result; + var _Symbol = root.Symbol; + + if (typeof _Symbol === 'function') { + if (_Symbol.observable) { + result = _Symbol.observable; + } else { + result = _Symbol('observable'); + _Symbol.observable = result; + } + } else { + result = '@@observable'; + } + + return result; +}; +},{}],159:[function(require,module,exports){ +/** + * Copyright 2013-2015, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +'use strict'; + +/** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + +var invariant = function(condition, format, a, b, c, d, e, f) { + if ("production" !== 'production') { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + } + + if (!condition) { + var error; + if (format === undefined) { + error = new Error( + 'Minified exception occurred; use the non-minified dev environment ' + + 'for the full error message and additional helpful warnings.' + ); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error( + format.replace(/%s/g, function() { return args[argIndex++]; }) + ); + error.name = 'Invariant Violation'; + } - ensureCanMutateNextListeners(); - nextListeners.push(listener); + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } +}; - return function unsubscribe() { - if (!isSubscribed) { - return; - } +module.exports = invariant; - isSubscribed = false; +},{}],160:[function(require,module,exports){ +arguments[4][12][0].apply(exports,arguments) +},{"./_hashClear":199,"./_hashDelete":200,"./_hashGet":201,"./_hashHas":202,"./_hashSet":203,"dup":12}],161:[function(require,module,exports){ +arguments[4][13][0].apply(exports,arguments) +},{"./_listCacheClear":207,"./_listCacheDelete":208,"./_listCacheGet":209,"./_listCacheHas":210,"./_listCacheSet":211,"dup":13}],162:[function(require,module,exports){ +arguments[4][14][0].apply(exports,arguments) +},{"./_getNative":195,"./_root":221,"dup":14}],163:[function(require,module,exports){ +arguments[4][15][0].apply(exports,arguments) +},{"./_mapCacheClear":212,"./_mapCacheDelete":213,"./_mapCacheGet":214,"./_mapCacheHas":215,"./_mapCacheSet":216,"dup":15}],164:[function(require,module,exports){ +arguments[4][16][0].apply(exports,arguments) +},{"./_getNative":195,"./_root":221,"dup":16}],165:[function(require,module,exports){ +arguments[4][17][0].apply(exports,arguments) +},{"./_MapCache":163,"./_setCacheAdd":222,"./_setCacheHas":223,"dup":17}],166:[function(require,module,exports){ +arguments[4][18][0].apply(exports,arguments) +},{"./_root":221,"dup":18}],167:[function(require,module,exports){ +arguments[4][19][0].apply(exports,arguments) +},{"dup":19}],168:[function(require,module,exports){ +/** + * 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 = []; - ensureCanMutateNextListeners(); - var index = nextListeners.indexOf(listener); - nextListeners.splice(index, 1); - }; + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } } + return result; +} - /** - * Dispatches an action. It is the only way to trigger a state change. - * - * The `reducer` function, used to create the store, will be called with the - * current state tree and the given `action`. Its return value will - * be considered the **next** state of the tree, and the change listeners - * will be notified. - * - * The base implementation only supports plain object actions. If you want to - * dispatch a Promise, an Observable, a thunk, or something else, you need to - * wrap your store creating function into the corresponding middleware. For - * example, see the documentation for the `redux-thunk` package. Even the - * middleware will eventually dispatch plain object actions using this method. - * - * @param {Object} action A plain object representing “what changed”. It is - * a good idea to keep actions serializable so you can record and replay user - * sessions, or use the time travelling `redux-devtools`. An action must have - * a `type` property which may not be `undefined`. It is a good idea to use - * string constants for action types. - * - * @returns {Object} For convenience, the same action object you dispatched. - * - * Note that, if you use a custom middleware, it may wrap `dispatch()` to - * return something else (for example, a Promise you can await). - */ - function dispatch(action) { - if (!(0, _isPlainObject2['default'])(action)) { - throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.'); - } +module.exports = arrayFilter; - if (typeof action.type === 'undefined') { - throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant?'); - } +},{}],169:[function(require,module,exports){ +arguments[4][20][0].apply(exports,arguments) +},{"./_baseIndexOf":178,"dup":20}],170:[function(require,module,exports){ +arguments[4][21][0].apply(exports,arguments) +},{"dup":21}],171:[function(require,module,exports){ +arguments[4][23][0].apply(exports,arguments) +},{"dup":23}],172:[function(require,module,exports){ +arguments[4][24][0].apply(exports,arguments) +},{"dup":24}],173:[function(require,module,exports){ +arguments[4][26][0].apply(exports,arguments) +},{"./eq":230,"dup":26}],174:[function(require,module,exports){ +arguments[4][28][0].apply(exports,arguments) +},{"./_SetCache":165,"./_arrayIncludes":169,"./_arrayIncludesWith":170,"./_arrayMap":171,"./_baseUnary":185,"./_cacheHas":188,"dup":28}],175:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],176:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_arrayPush":172,"./_isFlattenable":204,"dup":30}],177:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_Symbol":166,"./_getRawTag":197,"./_objectToString":218,"dup":31}],178:[function(require,module,exports){ +arguments[4][32][0].apply(exports,arguments) +},{"./_baseFindIndex":175,"./_baseIsNaN":181,"./_strictIndexOf":227,"dup":32}],179:[function(require,module,exports){ +var SetCache = require('./_SetCache'), + arrayIncludes = require('./_arrayIncludes'), + arrayIncludesWith = require('./_arrayIncludesWith'), + arrayMap = require('./_arrayMap'), + baseUnary = require('./_baseUnary'), + cacheHas = require('./_cacheHas'); - if (isDispatching) { - throw new Error('Reducers may not dispatch actions.'); - } +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMin = Math.min; - try { - isDispatching = true; - currentState = currentReducer(currentState, action); - } finally { - isDispatching = false; - } +/** + * 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 = []; - var listeners = currentListeners = nextListeners; - for (var i = 0; i < listeners.length; i++) { - listeners[i](); + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); } - - return action; + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; } + array = arrays[0]; - /** - * Replaces the reducer currently used by the store to calculate the state. - * - * You might need this if your app implements code splitting and you want to - * load some of the reducers dynamically. You might also need this if you - * implement a hot reloading mechanism for Redux. - * - * @param {Function} nextReducer The reducer for the store to use instead. - * @returns {void} - */ - function replaceReducer(nextReducer) { - if (typeof nextReducer !== 'function') { - throw new Error('Expected the nextReducer to be a function.'); - } + var index = -1, + seen = caches[0]; - currentReducer = nextReducer; - dispatch({ type: ActionTypes.INIT }); + 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; +} - /** - * Interoperability point for observable/reactive libraries. - * @returns {observable} A minimal observable of state changes. - * For more information, see the observable proposal: - * https://github.com/zenparsing/es-observable - */ - function observable() { - var _ref; +module.exports = baseIntersection; - var outerSubscribe = subscribe; - return _ref = { - /** - * The minimal observable subscription method. - * @param {Object} observer Any object that can be used as an observer. - * The observer object should have a `next` method. - * @returns {subscription} An object with an `unsubscribe` method that can - * be used to unsubscribe the observable from the store, and prevent further - * emission of values from the observable. - */ - subscribe: function subscribe(observer) { - if (typeof observer !== 'object') { - throw new TypeError('Expected the observer to be an object.'); - } +},{"./_SetCache":165,"./_arrayIncludes":169,"./_arrayIncludesWith":170,"./_arrayMap":171,"./_baseUnary":185,"./_cacheHas":188}],180:[function(require,module,exports){ +arguments[4][33][0].apply(exports,arguments) +},{"./_baseGetTag":177,"./isObjectLike":240,"dup":33}],181:[function(require,module,exports){ +arguments[4][34][0].apply(exports,arguments) +},{"dup":34}],182:[function(require,module,exports){ +arguments[4][35][0].apply(exports,arguments) +},{"./_isMasked":206,"./_toSource":228,"./isFunction":237,"./isObject":239,"dup":35}],183:[function(require,module,exports){ +arguments[4][38][0].apply(exports,arguments) +},{"./_overRest":220,"./_setToString":225,"./identity":231,"dup":38}],184:[function(require,module,exports){ +arguments[4][39][0].apply(exports,arguments) +},{"./_defineProperty":192,"./constant":229,"./identity":231,"dup":39}],185:[function(require,module,exports){ +arguments[4][41][0].apply(exports,arguments) +},{"dup":41}],186:[function(require,module,exports){ +arguments[4][42][0].apply(exports,arguments) +},{"./_SetCache":165,"./_arrayIncludes":169,"./_arrayIncludesWith":170,"./_cacheHas":188,"./_createSet":191,"./_setToArray":224,"dup":42}],187:[function(require,module,exports){ +var baseDifference = require('./_baseDifference'), + baseFlatten = require('./_baseFlatten'), + baseUniq = require('./_baseUniq'); - function observeState() { - if (observer.next) { - observer.next(getState()); - } - } +/** + * 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; - observeState(); - var unsubscribe = outerSubscribe(observeState); - return { unsubscribe: unsubscribe }; + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } - }, _ref[_symbolObservable2['default']] = function () { - return this; - }, _ref; + } } + return baseUniq(baseFlatten(result, 1), iteratee, comparator); +} - // When a store is created, an "INIT" action is dispatched so that every - // reducer returns their initial state. This effectively populates - // the initial state tree. - dispatch({ type: ActionTypes.INIT }); +module.exports = baseXor; - return _ref2 = { - dispatch: dispatch, - subscribe: subscribe, - getState: getState, - replaceReducer: replaceReducer - }, _ref2[_symbolObservable2['default']] = observable, _ref2; +},{"./_baseDifference":174,"./_baseFlatten":176,"./_baseUniq":186}],188:[function(require,module,exports){ +arguments[4][43][0].apply(exports,arguments) +},{"dup":43}],189:[function(require,module,exports){ +var isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * 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 : []; } -},{"lodash/isPlainObject":259,"symbol-observable":260}],250:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"./_root":257,"dup":31}],251:[function(require,module,exports){ -arguments[4][42][0].apply(exports,arguments) -},{"./_Symbol":250,"./_getRawTag":254,"./_objectToString":255,"dup":42}],252:[function(require,module,exports){ + +module.exports = castArrayLikeObject; + +},{"./isArrayLikeObject":236}],190:[function(require,module,exports){ +arguments[4][45][0].apply(exports,arguments) +},{"./_root":221,"dup":45}],191:[function(require,module,exports){ +arguments[4][47][0].apply(exports,arguments) +},{"./_Set":164,"./_setToArray":224,"./noop":242,"dup":47}],192:[function(require,module,exports){ +arguments[4][49][0].apply(exports,arguments) +},{"./_getNative":195,"dup":49}],193:[function(require,module,exports){ +arguments[4][50][0].apply(exports,arguments) +},{"dup":50}],194:[function(require,module,exports){ +arguments[4][51][0].apply(exports,arguments) +},{"./_isKeyable":205,"dup":51}],195:[function(require,module,exports){ +arguments[4][52][0].apply(exports,arguments) +},{"./_baseIsNative":182,"./_getValue":198,"dup":52}],196:[function(require,module,exports){ +var overArg = require('./_overArg'); + +/** Built-in value references. */ +var getPrototype = overArg(Object.getPrototypeOf, Object); + +module.exports = getPrototype; + +},{"./_overArg":219}],197:[function(require,module,exports){ +arguments[4][53][0].apply(exports,arguments) +},{"./_Symbol":166,"dup":53}],198:[function(require,module,exports){ +arguments[4][54][0].apply(exports,arguments) +},{"dup":54}],199:[function(require,module,exports){ +arguments[4][55][0].apply(exports,arguments) +},{"./_nativeCreate":217,"dup":55}],200:[function(require,module,exports){ +arguments[4][56][0].apply(exports,arguments) +},{"dup":56}],201:[function(require,module,exports){ +arguments[4][57][0].apply(exports,arguments) +},{"./_nativeCreate":217,"dup":57}],202:[function(require,module,exports){ arguments[4][58][0].apply(exports,arguments) -},{"dup":58}],253:[function(require,module,exports){ -arguments[4][241][0].apply(exports,arguments) -},{"./_overArg":256,"dup":241}],254:[function(require,module,exports){ -arguments[4][61][0].apply(exports,arguments) -},{"./_Symbol":250,"dup":61}],255:[function(require,module,exports){ +},{"./_nativeCreate":217,"dup":58}],203:[function(require,module,exports){ +arguments[4][59][0].apply(exports,arguments) +},{"./_nativeCreate":217,"dup":59}],204:[function(require,module,exports){ +arguments[4][60][0].apply(exports,arguments) +},{"./_Symbol":166,"./isArguments":233,"./isArray":234,"dup":60}],205:[function(require,module,exports){ +arguments[4][63][0].apply(exports,arguments) +},{"dup":63}],206:[function(require,module,exports){ +arguments[4][64][0].apply(exports,arguments) +},{"./_coreJsData":190,"dup":64}],207:[function(require,module,exports){ +arguments[4][66][0].apply(exports,arguments) +},{"dup":66}],208:[function(require,module,exports){ +arguments[4][67][0].apply(exports,arguments) +},{"./_assocIndexOf":173,"dup":67}],209:[function(require,module,exports){ +arguments[4][68][0].apply(exports,arguments) +},{"./_assocIndexOf":173,"dup":68}],210:[function(require,module,exports){ +arguments[4][69][0].apply(exports,arguments) +},{"./_assocIndexOf":173,"dup":69}],211:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"./_assocIndexOf":173,"dup":70}],212:[function(require,module,exports){ +arguments[4][71][0].apply(exports,arguments) +},{"./_Hash":160,"./_ListCache":161,"./_Map":162,"dup":71}],213:[function(require,module,exports){ +arguments[4][72][0].apply(exports,arguments) +},{"./_getMapData":194,"dup":72}],214:[function(require,module,exports){ +arguments[4][73][0].apply(exports,arguments) +},{"./_getMapData":194,"dup":73}],215:[function(require,module,exports){ +arguments[4][74][0].apply(exports,arguments) +},{"./_getMapData":194,"dup":74}],216:[function(require,module,exports){ +arguments[4][75][0].apply(exports,arguments) +},{"./_getMapData":194,"dup":75}],217:[function(require,module,exports){ +arguments[4][76][0].apply(exports,arguments) +},{"./_getNative":195,"dup":76}],218:[function(require,module,exports){ +arguments[4][79][0].apply(exports,arguments) +},{"dup":79}],219:[function(require,module,exports){ +/** + * 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)); + }; +} + +module.exports = overArg; + +},{}],220:[function(require,module,exports){ +arguments[4][80][0].apply(exports,arguments) +},{"./_apply":167,"dup":80}],221:[function(require,module,exports){ +arguments[4][81][0].apply(exports,arguments) +},{"./_freeGlobal":193,"dup":81}],222:[function(require,module,exports){ arguments[4][82][0].apply(exports,arguments) -},{"dup":82}],256:[function(require,module,exports){ -arguments[4][244][0].apply(exports,arguments) -},{"dup":244}],257:[function(require,module,exports){ +},{"dup":82}],223:[function(require,module,exports){ +arguments[4][83][0].apply(exports,arguments) +},{"dup":83}],224:[function(require,module,exports){ arguments[4][84][0].apply(exports,arguments) -},{"./_freeGlobal":252,"dup":84}],258:[function(require,module,exports){ -arguments[4][103][0].apply(exports,arguments) -},{"dup":103}],259:[function(require,module,exports){ -arguments[4][248][0].apply(exports,arguments) -},{"./_baseGetTag":251,"./_getPrototype":253,"./isObjectLike":258,"dup":248}],260:[function(require,module,exports){ -module.exports = require('./lib/index'); - -},{"./lib/index":261}],261:[function(require,module,exports){ -(function (global){ -'use strict'; +},{"dup":84}],225:[function(require,module,exports){ +arguments[4][85][0].apply(exports,arguments) +},{"./_baseSetToString":184,"./_shortOut":226,"dup":85}],226:[function(require,module,exports){ +arguments[4][86][0].apply(exports,arguments) +},{"dup":86}],227:[function(require,module,exports){ +arguments[4][87][0].apply(exports,arguments) +},{"dup":87}],228:[function(require,module,exports){ +arguments[4][88][0].apply(exports,arguments) +},{"dup":88}],229:[function(require,module,exports){ +arguments[4][90][0].apply(exports,arguments) +},{"dup":90}],230:[function(require,module,exports){ +arguments[4][92][0].apply(exports,arguments) +},{"dup":92}],231:[function(require,module,exports){ +arguments[4][93][0].apply(exports,arguments) +},{"dup":93}],232:[function(require,module,exports){ +var arrayMap = require('./_arrayMap'), + baseIntersection = require('./_baseIntersection'), + baseRest = require('./_baseRest'), + castArrayLikeObject = require('./_castArrayLikeObject'); -Object.defineProperty(exports, "__esModule", { - value: true +/** + * 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) + : []; }); -var _ponyfill = require('./ponyfill'); +module.exports = intersection; -var _ponyfill2 = _interopRequireDefault(_ponyfill); +},{"./_arrayMap":171,"./_baseIntersection":179,"./_baseRest":183,"./_castArrayLikeObject":189}],233:[function(require,module,exports){ +arguments[4][94][0].apply(exports,arguments) +},{"./_baseIsArguments":180,"./isObjectLike":240,"dup":94}],234:[function(require,module,exports){ +arguments[4][95][0].apply(exports,arguments) +},{"dup":95}],235:[function(require,module,exports){ +arguments[4][96][0].apply(exports,arguments) +},{"./isFunction":237,"./isLength":238,"dup":96}],236:[function(require,module,exports){ +arguments[4][97][0].apply(exports,arguments) +},{"./isArrayLike":235,"./isObjectLike":240,"dup":97}],237:[function(require,module,exports){ +arguments[4][99][0].apply(exports,arguments) +},{"./_baseGetTag":177,"./isObject":239,"dup":99}],238:[function(require,module,exports){ +arguments[4][100][0].apply(exports,arguments) +},{"dup":100}],239:[function(require,module,exports){ +arguments[4][101][0].apply(exports,arguments) +},{"dup":101}],240:[function(require,module,exports){ +arguments[4][102][0].apply(exports,arguments) +},{"dup":102}],241:[function(require,module,exports){ +var baseGetTag = require('./_baseGetTag'), + getPrototype = require('./_getPrototype'), + isObjectLike = require('./isObjectLike'); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } +/** `Object#toString` result references. */ +var objectTag = '[object Object]'; -var root; /* global window */ +/** Used for built-in method references. */ +var funcProto = Function.prototype, + objectProto = Object.prototype; +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; -if (typeof self !== 'undefined') { - root = self; -} else if (typeof window !== 'undefined') { - root = window; -} else if (typeof global !== 'undefined') { - root = global; -} else if (typeof module !== 'undefined') { - root = module; -} else { - root = Function('return this')(); +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Used to infer the `Object` constructor. */ +var objectCtorString = funcToString.call(Object); + +/** + * 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; } -var result = (0, _ponyfill2['default'])(root); -exports['default'] = result; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./ponyfill":262}],262:[function(require,module,exports){ -'use strict'; +module.exports = isPlainObject; -Object.defineProperty(exports, "__esModule", { - value: true +},{"./_baseGetTag":177,"./_getPrototype":196,"./isObjectLike":240}],242:[function(require,module,exports){ +arguments[4][106][0].apply(exports,arguments) +},{"dup":106}],243:[function(require,module,exports){ +arguments[4][109][0].apply(exports,arguments) +},{"./_baseDifference":174,"./_baseRest":183,"./isArrayLikeObject":236,"dup":109}],244:[function(require,module,exports){ +var arrayFilter = require('./_arrayFilter'), + baseRest = require('./_baseRest'), + baseXor = require('./_baseXor'), + isArrayLikeObject = require('./isArrayLikeObject'); + +/** + * 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)); }); -exports['default'] = symbolObservablePonyfill; -function symbolObservablePonyfill(root) { - var result; - var _Symbol = root.Symbol; - if (typeof _Symbol === 'function') { - if (_Symbol.observable) { - result = _Symbol.observable; - } else { - result = _Symbol('observable'); - _Symbol.observable = result; - } - } else { - result = '@@observable'; - } +module.exports = xor; - return result; -}; -},{}],263:[function(require,module,exports){ +},{"./_arrayFilter":168,"./_baseRest":183,"./_baseXor":187,"./isArrayLikeObject":236}],245:[function(require,module,exports){ (function (global){ 'use strict'; @@ -8226,7 +8299,7 @@ var Async = (function (_Component) { } }, onChange: function onChange(newValues) { - if (_this3.props.value && newValues.length > _this3.props.value.length) { + if (_this3.props.multi && _this3.props.value && newValues.length > _this3.props.value.length) { _this3.clearOptions(); } _this3.props.onChange(newValues); @@ -8254,7 +8327,7 @@ function defaultChildren(props) { module.exports = exports['default']; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./Select":267,"./utils/stripDiacritics":275}],264:[function(require,module,exports){ +},{"./Select":249,"./utils/stripDiacritics":257}],246:[function(require,module,exports){ (function (global){ 'use strict'; @@ -8300,7 +8373,7 @@ var AsyncCreatable = _react2['default'].createClass({ module.exports = AsyncCreatable; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./Select":267}],265:[function(require,module,exports){ +},{"./Select":249}],247:[function(require,module,exports){ (function (global){ 'use strict'; @@ -8603,7 +8676,7 @@ function shouldKeyDownEventCreateNewOption(_ref6) { module.exports = Creatable; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./Select":267,"./utils/defaultFilterOptions":273,"./utils/defaultMenuRenderer":274}],266:[function(require,module,exports){ +},{"./Select":249,"./utils/defaultFilterOptions":255,"./utils/defaultMenuRenderer":256}],248:[function(require,module,exports){ (function (global){ 'use strict'; @@ -8718,7 +8791,7 @@ var Option = _react2['default'].createClass({ module.exports = Option; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],267:[function(require,module,exports){ +},{}],249:[function(require,module,exports){ (function (global){ /*! Copyright (c) 2016 Jed Watson. @@ -9998,7 +10071,7 @@ exports['default'] = SelectComposite; module.exports = exports['default']; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./Async":263,"./AsyncCreatable":264,"./Creatable":265,"./Option":266,"./Value":268,"./dnd/DragDropContainer":270,"./dnd/DragDropItem":271,"./utils/defaultArrowRenderer":272,"./utils/defaultFilterOptions":273,"./utils/defaultMenuRenderer":274,"react-dnd":229,"react-dnd-html5-backend":117}],268:[function(require,module,exports){ +},{"./Async":245,"./AsyncCreatable":246,"./Creatable":247,"./Option":248,"./Value":250,"./dnd/DragDropContainer":252,"./dnd/DragDropItem":253,"./utils/defaultArrowRenderer":254,"./utils/defaultFilterOptions":255,"./utils/defaultMenuRenderer":256,"react-dnd":122,"react-dnd-html5-backend":10}],250:[function(require,module,exports){ (function (global){ 'use strict'; @@ -10109,7 +10182,7 @@ var Value = _react2['default'].createClass({ module.exports = Value; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],269:[function(require,module,exports){ +},{}],251:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, '__esModule', { @@ -10118,7 +10191,7 @@ Object.defineProperty(exports, '__esModule', { var MULTI_SELECT = 'multiSelect'; exports.MULTI_SELECT = MULTI_SELECT; -},{}],270:[function(require,module,exports){ +},{}],252:[function(require,module,exports){ (function (global){ 'use strict'; @@ -10212,7 +10285,7 @@ exports['default'] = (0, _reactDnd.DropTarget)(_constantsDragDropTypes.MULTI_SEL module.exports = exports['default']; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../constants/dragDropTypes":269,"react-dnd":229}],271:[function(require,module,exports){ +},{"../constants/dragDropTypes":251,"react-dnd":122}],253:[function(require,module,exports){ (function (global){ 'use strict'; @@ -10292,7 +10365,7 @@ exports['default'] = (0, _reactDnd.DragSource)(_constantsDragDropTypes.MULTI_SEL module.exports = exports['default']; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../constants/dragDropTypes":269,"react-dnd":229}],272:[function(require,module,exports){ +},{"../constants/dragDropTypes":251,"react-dnd":122}],254:[function(require,module,exports){ (function (global){ "use strict"; @@ -10320,7 +10393,7 @@ function arrowRenderer(_ref) { module.exports = exports["default"]; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],273:[function(require,module,exports){ +},{}],255:[function(require,module,exports){ 'use strict'; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -10364,7 +10437,7 @@ function filterOptions(options, filterValue, excludeOptions, props) { module.exports = filterOptions; -},{"./stripDiacritics":275}],274:[function(require,module,exports){ +},{"./stripDiacritics":257}],256:[function(require,module,exports){ (function (global){ 'use strict'; @@ -10429,7 +10502,7 @@ function menuRenderer(_ref) { module.exports = menuRenderer; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],275:[function(require,module,exports){ +},{}],257:[function(require,module,exports){ 'use strict'; var map = [{ 'base': 'A', 'letters': /[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g }, { 'base': 'AA', 'letters': /[\uA732]/g }, { 'base': 'AE', 'letters': /[\u00C6\u01FC\u01E2]/g }, { 'base': 'AO', 'letters': /[\uA734]/g }, { 'base': 'AU', 'letters': /[\uA736]/g }, { 'base': 'AV', 'letters': /[\uA738\uA73A]/g }, { 'base': 'AY', 'letters': /[\uA73C]/g }, { 'base': 'B', 'letters': /[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g }, { 'base': 'C', 'letters': /[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g }, { 'base': 'D', 'letters': /[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g }, { 'base': 'DZ', 'letters': /[\u01F1\u01C4]/g }, { 'base': 'Dz', 'letters': /[\u01F2\u01C5]/g }, { 'base': 'E', 'letters': /[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g }, { 'base': 'F', 'letters': /[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g }, { 'base': 'G', 'letters': /[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g }, { 'base': 'H', 'letters': /[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g }, { 'base': 'I', 'letters': /[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g }, { 'base': 'J', 'letters': /[\u004A\u24BF\uFF2A\u0134\u0248]/g }, { 'base': 'K', 'letters': /[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g }, { 'base': 'L', 'letters': /[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g }, { 'base': 'LJ', 'letters': /[\u01C7]/g }, { 'base': 'Lj', 'letters': /[\u01C8]/g }, { 'base': 'M', 'letters': /[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g }, { 'base': 'N', 'letters': /[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g }, { 'base': 'NJ', 'letters': /[\u01CA]/g }, { 'base': 'Nj', 'letters': /[\u01CB]/g }, { 'base': 'O', 'letters': /[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g }, { 'base': 'OI', 'letters': /[\u01A2]/g }, { 'base': 'OO', 'letters': /[\uA74E]/g }, { 'base': 'OU', 'letters': /[\u0222]/g }, { 'base': 'P', 'letters': /[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g }, { 'base': 'Q', 'letters': /[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g }, { 'base': 'R', 'letters': /[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g }, { 'base': 'S', 'letters': /[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g }, { 'base': 'T', 'letters': /[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g }, { 'base': 'TZ', 'letters': /[\uA728]/g }, { 'base': 'U', 'letters': /[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g }, { 'base': 'V', 'letters': /[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g }, { 'base': 'VY', 'letters': /[\uA760]/g }, { 'base': 'W', 'letters': /[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g }, { 'base': 'X', 'letters': /[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g }, { 'base': 'Y', 'letters': /[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g }, { 'base': 'Z', 'letters': /[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g }, { 'base': 'a', 'letters': /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g }, { 'base': 'aa', 'letters': /[\uA733]/g }, { 'base': 'ae', 'letters': /[\u00E6\u01FD\u01E3]/g }, { 'base': 'ao', 'letters': /[\uA735]/g }, { 'base': 'au', 'letters': /[\uA737]/g }, { 'base': 'av', 'letters': /[\uA739\uA73B]/g }, { 'base': 'ay', 'letters': /[\uA73D]/g }, { 'base': 'b', 'letters': /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g }, { 'base': 'c', 'letters': /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g }, { 'base': 'd', 'letters': /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g }, { 'base': 'dz', 'letters': /[\u01F3\u01C6]/g }, { 'base': 'e', 'letters': /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g }, { 'base': 'f', 'letters': /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g }, { 'base': 'g', 'letters': /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g }, { 'base': 'h', 'letters': /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g }, { 'base': 'hv', 'letters': /[\u0195]/g }, { 'base': 'i', 'letters': /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g }, { 'base': 'j', 'letters': /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g }, { 'base': 'k', 'letters': /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g }, { 'base': 'l', 'letters': /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g }, { 'base': 'lj', 'letters': /[\u01C9]/g }, { 'base': 'm', 'letters': /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g }, { 'base': 'n', 'letters': /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g }, { 'base': 'nj', 'letters': /[\u01CC]/g }, { 'base': 'o', 'letters': /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g }, { 'base': 'oi', 'letters': /[\u01A3]/g }, { 'base': 'ou', 'letters': /[\u0223]/g }, { 'base': 'oo', 'letters': /[\uA74F]/g }, { 'base': 'p', 'letters': /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g }, { 'base': 'q', 'letters': /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g }, { 'base': 'r', 'letters': /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g }, { 'base': 's', 'letters': /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g }, { 'base': 't', 'letters': /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g }, { 'base': 'tz', 'letters': /[\uA729]/g }, { 'base': 'u', 'letters': /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g }, { 'base': 'v', 'letters': /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g }, { 'base': 'vy', 'letters': /[\uA761]/g }, { 'base': 'w', 'letters': /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g }, { 'base': 'x', 'letters': /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g }, { 'base': 'y', 'letters': /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g }, { 'base': 'z', 'letters': /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g }]; @@ -10441,5 +10514,5 @@ module.exports = function stripDiacritics(str) { return str; }; -},{}]},{},[267])(267) +},{}]},{},[249])(249) }); \ No newline at end of file diff --git a/dist/@foxdcg/react-select.min.js b/dist/@foxdcg/react-select.min.js index 8c20134c94..476446bc1d 100644 --- a/dist/@foxdcg/react-select.min.js +++ b/dist/@foxdcg/react-select.min.js @@ -1,5 +1,5 @@ -!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.Select=e()}}(function(){return function e(t,n,r){function o(i,u){if(!n[i]){if(!t[i]){var s="function"==typeof require&&require;if(!u&&s)return s(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[i]={exports:{}};t[i][0].call(c.exports,function(e){var n=t[i][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;ic){for(var t=0,n=u.length-l;t0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)},e.prototype.getMonitor=function(){return this.monitor},e.prototype.getBackend=function(){return this.backend},e.prototype.getRegistry=function(){return this.registry},e.prototype.getActions=function(){function e(e){return function(){var r=e.apply(t,arguments);"undefined"!=typeof r&&n(r)}}var t=this,n=this.store.dispatch;return Object.keys(p).filter(function(e){return"function"==typeof p[e]}).reduce(function(t,n){return t[n]=e(p[n]),t},{})},e}());n["default"]=g,t.exports=n["default"]},{"./DragDropMonitor":9,"./HandlerRegistry":12,"./actions/dragDrop":13,"./reducers":20,"redux/lib/createStore":249}],9:[function(e,t,n){"use strict";function r(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")}n.__esModule=!0;var a=e("invariant"),i=r(a),u=e("./utils/matchesType"),s=r(u),l=e("lodash/isArray"),c=r(l),p=e("./HandlerRegistry"),d=r(p),f=e("./reducers/dragOffset"),h=e("./reducers/dirtyHandlerIds"),g=function(){function e(t){o(this,e),this.store=t,this.registry=new d["default"](t)}return e.prototype.subscribeToStateChange=function(e){var t=this,n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=n.handlerIds;i["default"]("function"==typeof e,"listener must be a function."),i["default"]("undefined"==typeof r||c["default"](r),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var n=t.store.getState(),a=n.stateId;try{var i=a===o||a===o+1&&!h.areDirty(n.dirtyHandlerIds,r);i||e()}finally{o=a}};return this.store.subscribe(a)},e.prototype.subscribeToOffsetChange=function(e){var t=this;i["default"]("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)},e.prototype.canDragSource=function(e){var t=this.registry.getSource(e);return i["default"](t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)},e.prototype.canDropOnTarget=function(e){var t=this.registry.getTarget(e);if(i["default"](t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return s["default"](n,r)&&t.canDrop(this,e)},e.prototype.isDragging=function(){return Boolean(this.getItemType())},e.prototype.isDraggingSource=function(e){var t=this.registry.getSource(e,!0);if(i["default"](t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n===r&&t.isDragging(this,e)},e.prototype.isOverTarget=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.shallow,r=void 0!==n&&n;if(!this.isDragging())return!1;var o=this.registry.getTargetType(e),a=this.getItemType();if(!s["default"](o,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var u=i.indexOf(e);return r?u===i.length-1:u>-1},e.prototype.getItemType=function(){return this.store.getState().dragOperation.itemType},e.prototype.getItem=function(){return this.store.getState().dragOperation.item},e.prototype.getSourceId=function(){return this.store.getState().dragOperation.sourceId},e.prototype.getTargetIds=function(){return this.store.getState().dragOperation.targetIds},e.prototype.getDropResult=function(){return this.store.getState().dragOperation.dropResult},e.prototype.didDrop=function(){return this.store.getState().dragOperation.didDrop},e.prototype.isSourcePublic=function(){return this.store.getState().dragOperation.isSourcePublic},e.prototype.getInitialClientOffset=function(){return this.store.getState().dragOffset.initialClientOffset},e.prototype.getInitialSourceClientOffset=function(){return this.store.getState().dragOffset.initialSourceClientOffset},e.prototype.getClientOffset=function(){return this.store.getState().dragOffset.clientOffset},e.prototype.getSourceClientOffset=function(){return f.getSourceClientOffset(this.store.getState().dragOffset)},e.prototype.getDifferenceFromInitialOffset=function(){return f.getDifferenceFromInitialOffset(this.store.getState().dragOffset)},e}();n["default"]=g,t.exports=n["default"]},{"./HandlerRegistry":12,"./reducers/dirtyHandlerIds":17,"./reducers/dragOffset":18,"./utils/matchesType":24,invariant:107,"lodash/isArray":97}],10:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var o=function(){function e(){r(this,e)}return e.prototype.canDrag=function(){return!0},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}();n["default"]=o,t.exports=n["default"]},{}],11:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var o=function(){function e(){r(this,e)}return e.prototype.canDrop=function(){return!0},e.prototype.hover=function(){},e.prototype.drop=function(){},e}();n["default"]=o,t.exports=n["default"]},{}],12:[function(e,t,n){"use strict";function r(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){return e&&e.constructor===Symbol?"symbol":typeof e}function i(e){d["default"]("function"==typeof e.canDrag,"Expected canDrag to be a function."),d["default"]("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),d["default"]("function"==typeof e.endDrag,"Expected endDrag to be a function.")}function u(e){d["default"]("function"==typeof e.canDrop,"Expected canDrop to be a function."),d["default"]("function"==typeof e.hover,"Expected hover to be a function."),d["default"]("function"==typeof e.drop,"Expected beginDrag to be a function.")}function s(e,t){return t&&h["default"](e)?void e.forEach(function(e){return s(e,!1)}):void d["default"]("string"==typeof e||"symbol"===("undefined"==typeof e?"undefined":a(e)),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}function l(e){var t=y["default"]().toString();switch(e){case _.SOURCE:return"S"+t;case _.TARGET:return"T"+t;default:d["default"](!1,"Unknown role: "+e)}}function c(e){switch(e[0]){case"S":return _.SOURCE;case"T":return _.TARGET;default:d["default"](!1,"Cannot parse handler ID: "+e)}}n.__esModule=!0;var p=e("invariant"),d=r(p),f=e("lodash/isArray"),h=r(f),g=e("./utils/getNextUniqueId"),y=r(g),v=e("./actions/registry"),b=e("asap"),m=r(b),_={SOURCE:"SOURCE",TARGET:"TARGET"},E=function(){function e(t){o(this,e),this.store=t,this.types={},this.handlers={},this.pinnedSourceId=null,this.pinnedSource=null}return e.prototype.addSource=function(e,t){s(e),i(t);var n=this.addHandler(_.SOURCE,e,t);return this.store.dispatch(v.addSource(n)),n},e.prototype.addTarget=function(e,t){s(e,!0),u(t);var n=this.addHandler(_.TARGET,e,t);return this.store.dispatch(v.addTarget(n)),n},e.prototype.addHandler=function(e,t,n){var r=l(e);return this.types[r]=t,this.handlers[r]=n,r},e.prototype.containsHandler=function(e){var t=this;return Object.keys(this.handlers).some(function(n){return t.handlers[n]===e})},e.prototype.getSource=function(e,t){d["default"](this.isSourceId(e),"Expected a valid source ID.");var n=t&&e===this.pinnedSourceId,r=n?this.pinnedSource:this.handlers[e];return r},e.prototype.getTarget=function(e){return d["default"](this.isTargetId(e),"Expected a valid target ID."),this.handlers[e]},e.prototype.getSourceType=function(e){return d["default"](this.isSourceId(e),"Expected a valid source ID."),this.types[e]},e.prototype.getTargetType=function(e){return d["default"](this.isTargetId(e),"Expected a valid target ID."),this.types[e]},e.prototype.isSourceId=function(e){var t=c(e);return t===_.SOURCE},e.prototype.isTargetId=function(e){var t=c(e);return t===_.TARGET},e.prototype.removeSource=function(e){var t=this;d["default"](this.getSource(e),"Expected an existing source."),this.store.dispatch(v.removeSource(e)),m["default"](function(){delete t.handlers[e],delete t.types[e]})},e.prototype.removeTarget=function(e){var t=this;d["default"](this.getTarget(e),"Expected an existing target."),this.store.dispatch(v.removeTarget(e)),m["default"](function(){delete t.handlers[e],delete t.types[e]})},e.prototype.pinSource=function(e){var t=this.getSource(e);d["default"](t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t},e.prototype.unpinSource=function(){d["default"](this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null},e}();n["default"]=E,t.exports=n["default"]},{"./actions/registry":14,"./utils/getNextUniqueId":23,asap:1,invariant:107,"lodash/isArray":97}],13:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.publishSource,r=void 0===n||n,o=t.clientOffset,a=void 0===o?null:o,i=t.getSourceClientOffset;d["default"](h["default"](e),"Expected sourceIds to be an array.");var u=this.getMonitor(),s=this.getRegistry();d["default"](!u.isDragging(),"Cannot call beginDrag while dragging.");for(var l=0;l=0;l--)if(u.canDragSource(e[l])){c=e[l];break}if(null!==c){var p=null;a&&(d["default"]("function"==typeof i,"When clientOffset is provided, getSourceClientOffset must be a function."),p=i(c));var f=s.getSource(c),g=f.beginDrag(u,c);d["default"](y["default"](g),"Item must be an object."),s.pinSource(c);var b=s.getSourceType(c);return{type:v,itemType:b,item:g,sourceId:c,clientOffset:a,sourceClientOffset:p,isSourcePublic:r}}}function a(e){var t=this.getMonitor();if(t.isDragging())return{type:b}}function i(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=t.clientOffset,r=void 0===n?null:n;d["default"](h["default"](e),"Expected targetIds to be an array."),e=e.slice(0);var o=this.getMonitor(),a=this.getRegistry();d["default"](o.isDragging(),"Cannot call hover while not dragging."),d["default"](!o.didDrop(),"Cannot call hover after drop.");for(var i=0;i=0;i--){var u=e[i],p=a.getTargetType(u);c["default"](p,l)||e.splice(i,1)}for(var i=0;i0)}n.__esModule=!0,n["default"]=o,n.areDirty=a;var i=e("lodash/xor"),u=r(i),s=e("lodash/intersection"),l=r(s),c=e("../actions/dragDrop"),p=e("../actions/registry"),d=[],f=[]},{"../actions/dragDrop":13,"../actions/registry":14,"lodash/intersection":95,"lodash/xor":106}],18:[function(e,t,n){"use strict";function r(e,t){return e===t||e&&t&&e.x===t.x&&e.y===t.y}function o(e,t){switch(void 0===e&&(e=l),t.type){case s.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case s.HOVER:return r(e.clientOffset,t.clientOffset)?e:u({},e,{clientOffset:t.clientOffset});case s.END_DRAG:case s.DROP:return l;default:return e}}function a(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function i(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}n.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t-1}var o=e("./_baseIndexOf");t.exports=r},{"./_baseIndexOf":43}],35:[function(e,t,n){function r(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=c&&(d=l,f=!1,t=new o(t));e:for(;++p0&&n(c)?t>1?r(c,t-1,n,i,u):o(u,c):i||(u[u.length]=c)}return u}var o=e("./_arrayPush"),a=e("./_isFlattenable");t.exports=r},{"./_arrayPush":37,"./_isFlattenable":68}],42:[function(e,t,n){function r(e){return null==e?void 0===e?s:u:(e=Object(e),l&&l in e?a(e):i(e))}var o=e("./_Symbol"),a=e("./_getRawTag"),i=e("./_objectToString"),u="[object Null]",s="[object Undefined]",l=o?o.toStringTag:void 0;t.exports=r},{"./_Symbol":31,"./_getRawTag":61,"./_objectToString":82}],43:[function(e,t,n){function r(e,t,n){return t===t?i(e,t,n):o(e,a,n)}var o=e("./_baseFindIndex"),a=e("./_baseIsNaN"),i=e("./_strictIndexOf");t.exports=r},{"./_baseFindIndex":40,"./_baseIsNaN":46,"./_strictIndexOf":90}],44:[function(e,t,n){function r(e,t,n){for(var r=n?i:a,p=e[0].length,d=e.length,f=d,h=Array(d),g=1/0,y=[];f--;){var v=e[f];f&&t&&(v=u(v,s(t))),g=c(v.length,g),h[f]=!n&&(t||p>=120&&v.length>=120)?new o(f&&v):void 0}v=e[0];var b=-1,m=h[0];e:for(;++b=c){var y=t?null:s(e);if(y)return l(y);f=!1,p=u,g=new o}else g=t?[]:h;e:for(;++r-1}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":38}],75:[function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":38}],76:[function(e,t,n){function r(){this.size=0,this.__data__={hash:new o,map:new(i||a),string:new o}}var o=e("./_Hash"),a=e("./_ListCache"),i=e("./_Map");t.exports=r},{"./_Hash":25,"./_ListCache":26,"./_Map":27}],77:[function(e,t,n){function r(e){var t=o(this,e)["delete"](e);return this.size-=t?1:0,t}var o=e("./_getMapData");t.exports=r},{"./_getMapData":59}],78:[function(e,t,n){function r(e){return o(this,e).get(e)}var o=e("./_getMapData");t.exports=r},{"./_getMapData":59}],79:[function(e,t,n){function r(e){return o(this,e).has(e)}var o=e("./_getMapData");t.exports=r},{"./_getMapData":59}],80:[function(e,t,n){function r(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var o=e("./_getMapData");t.exports=r},{"./_getMapData":59}],81:[function(e,t,n){var r=e("./_getNative"),o=r(Object,"create");t.exports=o},{"./_getNative":60}],82:[function(e,t,n){function r(e){return a.call(e)}var o=Object.prototype,a=o.toString;t.exports=r},{}],83:[function(e,t,n){function r(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,u=a(r.length-t,0),s=Array(u);++i0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var o=800,a=16,i=Date.now;t.exports=r},{}],90:[function(e,t,n){function r(e,t,n){for(var r=n-1,o=e.length;++r-1&&e%1==0&&e<=o}var o=9007199254740991;t.exports=r},{}],102:[function(e,t,n){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=r},{}],103:[function(e,t,n){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],104:[function(e,t,n){function r(){}t.exports=r},{}],105:[function(e,t,n){var r=e("./_baseDifference"),o=e("./_baseRest"),a=e("./isArrayLikeObject"),i=o(function(e,t){return a(e)?r(e,t):[]});t.exports=i},{"./_baseDifference":39,"./_baseRest":48,"./isArrayLikeObject":99}],106:[function(e,t,n){var r=e("./_arrayFilter"),o=e("./_baseRest"),a=e("./_baseXor"),i=e("./isArrayLikeObject"),u=o(function(e){return a(r(e,i))});t.exports=u},{"./_arrayFilter":33,"./_baseRest":48,"./_baseXor":52,"./isArrayLikeObject":99}],107:[function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,u],c=0;s=new Error(t.replace(/%s/g,function(){return l[c++]})),s.name="Invariant Violation"}throw s.framesToPop=1,s}};t.exports=r},{}],108:[function(e,t,n){function r(){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===r||!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 i(e){if(d===clearTimeout)return clearTimeout(e);if((d===o||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function u(){y&&h&&(y=!1,h.length?g=h.concat(g):v=-1,g.length&&s())}function s(){if(!y){var e=a(u);y=!0;for(var t=g.length;t;){for(h=g,g=[];++v1)for(var n=1;n0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=s["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();n["default"]=l,t.exports=n["default"]},{"lodash/union":215,"lodash/without":216}],111:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}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")}n.__esModule=!0;var i=e("lodash/defaults"),u=o(i),s=e("./shallowEqual"),l=o(s),c=e("./EnterLeaveCounter"),p=o(c),d=e("./BrowserDetector"),f=e("./OffsetUtils"),h=e("./NativeDragSources"),g=e("./NativeTypes"),y=r(g),v=function(){function e(t){a(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new p["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this),this.endDragNativeItem=this.endDragNativeItem.bind(this)}return e.prototype.setup=function(){if("undefined"!=typeof window){if(this.constructor.isSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.constructor.isSetUp=!0,this.addEventListeners(window)}},e.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this.removeEventListeners(window),this.clearCurrentDragSourceNode())},e.prototype.addEventListeners=function(e){e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0)},e.prototype.removeEventListeners=function(e){e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0)},e.prototype.connectDragPreview=function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var o=function(t){return r.handleDragStart(t,e)},a=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",a),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",a),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},a=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",a),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",a)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return u["default"](t||{},{dropEffect:"move"})},e.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},e.prototype.getCurrentSourcePreviewNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return u["default"](t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return f.getNodeClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(y).some(function(t){return y[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=h.createNativeDragSource(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),d.isFirefox()&&window.addEventListener("mousemove",this.endDragNativeItem,!0)},e.prototype.endDragNativeItem=function(){this.isDraggingNativeItem()&&(d.isFirefox()&&window.removeEventListener("mousemove",this.endDragNativeItem,!0),this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},e.prototype.endDragIfSourceWasRemovedFromDOM=function(){var e=this.currentDragSourceNode;document.body.contains(e)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.setCurrentDragSourceNode=function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=f.getNodeClientOffset(e),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},e.prototype.clearCurrentDragSourceNode=function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0)},e.prototype.checkIfCurrentDragSourceRectChanged=function(){var e=this.currentDragSourceNode;return!!e&&(!!this.currentDragSourceNodeOffsetChanged||(this.currentDragSourceNodeOffsetChanged=!l["default"](f.getNodeClientOffset(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged))},e.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},e.prototype.handleDragStart=function(e,t){this.dragStartSourceIds.unshift(t)},e.prototype.handleTopDragStart=function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=f.getEventClientOffset(e);this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var o=e.dataTransfer,a=h.matchNativeItemType(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var i=this.monitor.getSourceId(),u=this.sourceNodes[i],s=this.sourcePreviewNodes[i]||u,l=this.getCurrentSourcePreviewNodeOptions(),c=l.anchorX,p=l.anchorY,d={anchorX:c,anchorY:p},g=f.getDragPreviewOffset(u,s,r,d);o.setDragImage(s,g.x,g.y)}try{o.setData("application/json",{})}catch(y){}this.setCurrentDragSourceNode(e.target);var v=this.getCurrentSourcePreviewNodeOptions(),b=v.captureDraggingState;b?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(a)this.beginDragNativeItem(a);else{if(!(o.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=h.matchNativeItemType(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){d.isFirefox()||this.actions.hover(n,{clientOffset:f.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:f.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:f.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},e}();n["default"]=v,t.exports=n["default"]},{"./BrowserDetector":109,"./EnterLeaveCounter":110,"./NativeDragSources":113,"./NativeTypes":114,"./OffsetUtils":115,"./shallowEqual":118,"lodash/defaults":198}],112:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var o=function(){function e(t,n){r(this,e);for(var o=t.length,a=[],i=0;ie))return n[l];s=l-1}}i=Math.max(0,s);var p=e-t[i],d=p*p;return n[i]+r[i]*p+o[i]*d+a[i]*p*d},e}();n["default"]=o,t.exports=n["default"]},{}],113:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 i(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function u(e){var t=d[e],n=t.exposeProperty,r=t.matchesTypes,i=t.getData;return function(){function e(){o(this,e),this.item=Object.defineProperties({},a({},n,{get:function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return e.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[n],this.item[n]=i(e,r)},e.prototype.canDrag=function(){return!0},e.prototype.beginDrag=function(){return this.item},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}()}function s(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(d).filter(function(e){var n=d[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}n.__esModule=!0;var l;n.createNativeDragSource=u,n.matchNativeItemType=s;var c=e("./NativeTypes"),p=r(c),d=(l={},a(l,p.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(l,p.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return i(e,t,"").split("\n")}}),a(l,p.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return i(e,t,"")}}),l)},{"./NativeTypes":114}],114:[function(e,t,n){"use strict";n.__esModule=!0;var r="__NATIVE_FILE__";n.FILE=r;var o="__NATIVE_URL__";n.URL=o;var a="__NATIVE_TEXT__";n.TEXT=a},{}],115:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.nodeType===c?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,o=n.left;return{x:o,y:r}}function a(e){return{x:e.clientX,y:e.clientY}}function i(e,t,n,r){var a="IMG"===t.nodeName&&(u.isFirefox()||!document.documentElement.contains(t)),i=a?e:t,s=o(i),c={x:n.x-s.x,y:n.y-s.y},p=e.offsetWidth,d=e.offsetHeight,f=r.anchorX,h=r.anchorY,g=a?t.width:p,y=a?t.height:d;u.isSafari()&&a?(y/=window.devicePixelRatio,g/=window.devicePixelRatio):u.isFirefox()&&!a&&(y*=window.devicePixelRatio,g*=window.devicePixelRatio);var v=new l["default"]([0,.5,1],[c.x,c.x/p*g,c.x+g-p]),b=new l["default"]([0,.5,1],[c.y,c.y/d*y,c.y+y-d]),m=v.interpolate(f),_=b.interpolate(h);return u.isSafari()&&a&&(_+=(window.devicePixelRatio-1)*y),{x:m,y:_}}n.__esModule=!0,n.getNodeClientOffset=o,n.getEventClientOffset=a,n.getDragPreviewOffset=i;var u=e("./BrowserDetector"),s=e("./MonotonicInterpolant"),l=r(s),c=1},{"./BrowserDetector":109,"./MonotonicInterpolant":112}],116:[function(e,t,n){"use strict";function r(){return o||(o=new Image,o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),o}n.__esModule=!0,n["default"]=r;var o=void 0;t.exports=n["default"]},{}],117:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e){return new u["default"](e)}n.__esModule=!0,n["default"]=a;var i=e("./HTML5Backend"),u=o(i),s=e("./getEmptyImage"),l=o(s),c=e("./NativeTypes"),p=r(c);n.NativeTypes=p,n.getEmptyImage=l["default"]},{"./HTML5Backend":111,"./NativeTypes":114,"./getEmptyImage":116}],118:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,u&&a(n[0],n[1],u)&&(i=o<3?void 0:i,o=1),t=Object(t);++r-1&&e%1==0&&e-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',p.join(", "),t),s["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),d.forEach(function(t){s["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){a(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return!e.canDrag||e.canDrag(this.props,this.monitor)},t.prototype.isDragging=function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&s["default"](c["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)},t}();return function(e){return new t(e)}}n.__esModule=!0,n["default"]=i;var u=e("invariant"),s=o(u),l=e("lodash/isPlainObject"),c=o(l),p=["canDrag","beginDrag","canDrag","isDragging","endDrag"],d=["beginDrag"];t.exports=n["default"]}).call(this,e("_process"))},{_process:108,invariant:107,"lodash/isPlainObject":248}],224:[function(e,t,n){"use strict";function r(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){return new c(e)}n.__esModule=!0,n["default"]=a;var i=e("invariant"),u=r(i),s=!1,l=!1,c=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){u["default"](!s,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return s=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{s=!1}},e.prototype.isDragging=function(){u["default"](!l,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{l=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();t.exports=n["default"]},{invariant:107}],225:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(){u&&(u(),u=null),r&&o&&(u=e.connectDropTarget(r,o,a))}function n(e){e!==r&&(r=e,t())}var r=void 0,o=void 0,a=void 0,u=void 0,l=i["default"]({dropTarget:function(e,n){e===o&&s["default"](n,a)||(o=e,a=n,t())}});return{receiveHandlerId:n,hooks:l}}n.__esModule=!0,n["default"]=o;var a=e("./wrapConnectorHooks"),i=r(a),u=e("./areOptionsEqual"),s=r(u);t.exports=n["default"]},{"./areOptionsEqual":221,"./wrapConnectorHooks":237}],226:[function(e,t,n){(function(r){"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 i(e){Object.keys(e).forEach(function(t){s["default"](p.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',p.join(", "),t),s["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){a(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return!e.canDrop||e.canDrop(this.props,this.monitor)},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&s["default"]("undefined"==typeof t||c["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}n.__esModule=!0,n["default"]=i;var u=e("invariant"),s=o(u),l=e("lodash/isPlainObject"),c=o(l),p=["canDrop","hover","drop"];t.exports=n["default"]}).call(this,e("_process"))},{_process:108,invariant:107,"lodash/isPlainObject":248}],227:[function(e,t,n){"use strict";function r(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){return new l(e)}n.__esModule=!0,n["default"]=a;var i=e("invariant"),u=r(i),s=!1,l=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){u["default"](!s,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return s=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{s=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();t.exports=n["default"]},{invariant:107}],228:[function(e,t,n){(function(r){"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 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 u(e){var t=e.DecoratedComponent,n=e.createHandler,o=e.createMonitor,u=e.createConnector,f=e.registerHandler,g=e.containerDisplayName,v=e.getType,m=e.collect,E=e.options,D=E.arePropsEqual,O=void 0===D?y["default"]:D,C=t.displayName||t.name||"Component";return function(e){function y(t,r){a(this,y),e.call(this,t,r),this.handleChange=this.handleChange.bind(this),this.handleChildRef=this.handleChildRef.bind(this),_["default"]("object"==typeof this.context.dragDropManager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",C,C),this.manager=this.context.dragDropManager,this.handlerMonitor=o(this.manager),this.handlerConnector=u(this.manager.getBackend()),this.handler=n(this.handlerMonitor),this.disposable=new d.SerialDisposable,this.receiveProps(t),this.state=this.getCurrentState(),this.dispose()}return i(y,e),y.prototype.getHandlerId=function(){return this.handlerId},y.prototype.getDecoratedComponentInstance=function(){return this.decoratedComponentInstance},y.prototype.shouldComponentUpdate=function(e,t){return!O(e,this.props)||!h["default"](t,this.state)},l(y,null,[{key:"DecoratedComponent",value:t,enumerable:!0},{key:"displayName",value:g+"("+C+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:c.PropTypes.object.isRequired},enumerable:!0}]),y.prototype.componentDidMount=function(){this.isCurrentlyMounted=!0,this.disposable=new d.SerialDisposable,this.currentType=null,this.receiveProps(this.props),this.handleChange()},y.prototype.componentWillReceiveProps=function(e){O(e,this.props)||(this.receiveProps(e),this.handleChange())},y.prototype.componentWillUnmount=function(){this.dispose(),this.isCurrentlyMounted=!1},y.prototype.receiveProps=function(e){this.handler.receiveProps(e),this.receiveType(v(e))},y.prototype.receiveType=function(e){if(e!==this.currentType){this.currentType=e;var t=f(e,this.handler,this.manager),n=t.handlerId,r=t.unregister;this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor(),a=o.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new d.CompositeDisposable(new d.Disposable(a),new d.Disposable(r)))}},y.prototype.handleChange=function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();h["default"](e,this.state)||this.setState(e)}},y.prototype.dispose=function(){this.disposable.dispose(),this.handlerConnector.receiveHandlerId(null)},y.prototype.handleChildRef=function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)},y.prototype.getCurrentState=function(){var e=m(this.handlerConnector.hooks,this.handlerMonitor);return"production"!==r.env.NODE_ENV&&_["default"](b["default"](e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",g,C,e), -e},y.prototype.render=function(){return p["default"].createElement(t,s({},this.props,this.state,{ref:this.handleChildRef}))},y}(c.Component)}n.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t2?r-2:0),a=2;a or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),n?u.cloneElement(e,{ref:function(e){t(e),n&&n(e)}}):u.cloneElement(e,{ref:t})}n.__esModule=!0,n["default"]=o;var a=e("invariant"),i=r(a),u=e("react");t.exports=n["default"]},{invariant:107,react:void 0}],234:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return"string"==typeof e||"symbol"==typeof e||t&&i["default"](e)&&e.every(function(e){return o(e,!1)})}n.__esModule=!0,n["default"]=o;var a=e("lodash/isArray"),i=r(a);t.exports=n["default"]},{"lodash/isArray":246}],235:[function(e,t,n){arguments[4][118][0].apply(n,arguments)},{dup:118}],236:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a, or turn it into a ")+"drag source or a drop target itself.")}}function a(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?null:arguments[0],n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!l.isValidElement(t)){var r=t;return void e(r,n)}var a=t;o(a);var i=n?function(t){return e(t,n)}:e;return s["default"](a,i)}}function i(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n],o=a(r);t[n]=function(){return o}}),t}n.__esModule=!0,n["default"]=i;var u=e("./utils/cloneWithRef"),s=r(u),l=e("react");t.exports=n["default"]},{"./utils/cloneWithRef":233,react:void 0}],238:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{"./_root":245,dup:31}],239:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{"./_Symbol":238,"./_getRawTag":242,"./_objectToString":243,dup:42}],240:[function(e,t,n){arguments[4][58][0].apply(n,arguments)},{dup:58}],241:[function(e,t,n){var r=e("./_overArg"),o=r(Object.getPrototypeOf,Object);t.exports=o},{"./_overArg":244}],242:[function(e,t,n){arguments[4][61][0].apply(n,arguments)},{"./_Symbol":238,dup:61}],243:[function(e,t,n){arguments[4][82][0].apply(n,arguments)},{dup:82}],244:[function(e,t,n){function r(e,t){return function(n){return e(t(n))}}t.exports=r},{}],245:[function(e,t,n){arguments[4][84][0].apply(n,arguments)},{"./_freeGlobal":240,dup:84}],246:[function(e,t,n){arguments[4][97][0].apply(n,arguments)},{dup:97}],247:[function(e,t,n){arguments[4][103][0].apply(n,arguments)},{dup:103}],248:[function(e,t,n){function r(e){if(!i(e)||o(e)!=u)return!1;var t=a(e);if(null===t)return!0;var n=p.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}var o=e("./_baseGetTag"),a=e("./_getPrototype"),i=e("./isObjectLike"),u="[object Object]",s=Function.prototype,l=Object.prototype,c=s.toString,p=l.hasOwnProperty,d=c.call(Object);t.exports=r},{"./_baseGetTag":239,"./_getPrototype":241,"./isObjectLike":247}],249:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){function r(){v===y&&(v=y.slice())}function a(){return g}function u(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return r(),v.push(e),function(){if(t){t=!1,r();var n=v.indexOf(e);v.splice(n,1)}}}function c(e){if(!(0,i["default"])(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(b)throw new Error("Reducers may not dispatch actions.");try{b=!0,g=h(g,e)}finally{b=!1}for(var t=y=v,n=0;ne.props.value.length&&e.clearOptions(),e.props.onChange(t)}};return n(l({},this.props,s,{isLoading:i,onInputChange:this._onInputChange}))}}]),t}(d.Component);n["default"]=E,E.propTypes=b,E.defaultProps=_,t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Select":267,"./utils/stripDiacritics":275}],264:[function(e,t,n){(function(n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return f["default"].createElement(g["default"],e)}function i(e){var t=e.option,n=e.options,r=e.labelKey,o=e.valueKey;return 0===n.filter(function(e){return e[r]===t[r]||e[o]===t[o]}).length}function u(e){var t=e.label;return!!t}function s(e){var t=e.label,n=e.labelKey,r=e.valueKey,o={};return o[r]=t,o[n]=t,o.className="Select-create-option-placeholder",o}function l(e){return'Create option "'+e+'"'}function c(e){var t=e.keyCode;switch(t){case 9:case 13:case 188:return!0}return!1}var p=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tu.bottom||i.topt.offsetHeight&&!(t.scrollHeight-t.offsetHeight-t.scrollTop)&&this.props.onMenuScrollToBottom()}},handleRequired:function(e,t){return!e||(t?0===e.length:0===Object.keys(e).length)},getOptionLabel:function(e){return e[this.props.labelKey]},getValueArray:function(e,t){var n=this,r="object"==typeof t?t:this.props;if(r.multi){if("string"==typeof e&&(e=e.split(r.delimiter)),!Array.isArray(e)){if(null===e||void 0===e)return[];e=[e]}return e.map(function(e){return n.expandValue(e,r)}).filter(function(e){return e})}var o=this.expandValue(e,r);return o?[o]:[]},expandValue:function(e,t){var n=typeof e;if("string"!==n&&"number"!==n&&"boolean"!==n)return e;var r=t.options,o=t.valueKey;if(r)for(var a=0;a0?n-=1:n=t.length-1;else if("start"===e)n=0;else if("end"===e)n=t.length-1;else if("page_up"===e){var o=n-this.props.pageSize;n=o<0?0:o}else if("page_down"===e){var o=n+this.props.pageSize;n=o>t.length-1?t.length-1:o}n===-1&&(n=0),this.setState({focusedIndex:t[n].index,focusedOption:t[n].option})}},getFocusedOption:function(){return this._focusedOption},getInputValue:function(){return this.state.inputValue},selectFocusedOption:function(){if(this._focusedOption)return this.selectValue(this._focusedOption)},reorderValueArray:function(e,t){if(e!==t){var n=this.getValueArray(this.props.value),r=n.splice(e,1);n.splice.apply(n,[t,0].concat(i(r))),this.setValue(n)}},renderLoading:function(){if(this.props.isLoading)return p["default"].createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},p["default"].createElement("span",{className:"Select-loading"}))},renderMultiValueComponent:function(e,t,n){var r=this.props.valueRenderer||this.getOptionLabel,o=this.props.valueComponent,a=this.props.onValueClick?this.handleValueClick:null,i=this._instancePrefix+"-value-"+t,u="value-"+t+"-"+e[this.props.valueKey];return p["default"].createElement(o,{id:i,instancePrefix:this._instancePrefix,disabled:this.props.disabled||e.clearableValue===!1,key:u,onClick:a,onRemove:this.removeValue,value:e,reorder:n},r(e,t),p["default"].createElement("span",{className:"Select-aria-only"}," "))},renderValue:function(e,t){var n=this;if(!e.length)return this.state.inputValue?null:p["default"].createElement("div",{className:"Select-placeholder"},this.props.placeholder);if(this.props.multi)return this.props.reorder&&!this.props.disabled?e.map(function(e,t){var r=!0;return p["default"].createElement(L["default"],{key:t,index:t,contextId:n._instancePrefix,className:"Select-drag-container",handleSorting:n.reorderValueArray},p["default"].createElement(B["default"],{index:t,contextId:n._instancePrefix},n.renderMultiValueComponent(e,t,r)))}):e.map(function(e,t){var r=!1;return n.renderMultiValueComponent(e,t,r)});if(!this.state.inputValue){var r=this.props.valueRenderer||this.getOptionLabel,o=this.props.valueComponent,a=this.props.onValueClick?this.handleValueClick:null;t&&(a=null);this._instancePrefix+"-value-item";return p["default"].createElement(o,{id:this._instancePrefix+"-value-item",disabled:this.props.disabled,instancePrefix:this._instancePrefix,onClick:a,value:e[0]},r(e[0]))}},renderInput:function(e,t){var n=this;if(this.props.inputRenderer)return this.props.inputRenderer();var r,o=(0,v["default"])("Select-input",this.props.inputProps.className),i=!!this.state.isOpen,s=(0,v["default"])((r={},u(r,this._instancePrefix+"-list",i),u(r,this._instancePrefix+"-backspace-remove-message",this.props.multi&&!this.props.disabled&&this.state.isFocused&&!this.state.inputValue),r)),c=l({},this.props.inputProps,{role:"combobox","aria-expanded":""+i,"aria-owns":s,"aria-haspopup":""+i,"aria-activedescendant":i?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value","aria-labelledby":this.props["aria-labelledby"],"aria-label":this.props["aria-label"],className:o,tabIndex:this.props.tabIndex,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:function(e){return n.input=e},required:this.state.required,value:this.state.inputValue});if(this.props.disabled||!this.props.searchable){var d=this.props.inputProps,f=(d.inputClassName,a(d,["inputClassName"]));return p["default"].createElement("div",l({},f,{role:"combobox","aria-expanded":i,"aria-owns":i?this._instancePrefix+"-list":this._instancePrefix+"-value","aria-activedescendant":i?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value",className:o,tabIndex:this.props.tabIndex||0,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,ref:function(e){return n.input=e},"aria-readonly":""+!!this.props.disabled,style:{border:0,width:1,display:"inline-block"}}))}return this.props.autosize?p["default"].createElement(g["default"],l({},c,{minWidth:"5"})):p["default"].createElement("div",{className:o},p["default"].createElement("input",c))},renderClear:function(){if(this.props.clearable&&this.props.value&&0!==this.props.value&&(!this.props.multi||this.props.value.length)&&!this.props.disabled&&!this.props.isLoading)return p["default"].createElement("span",{className:"Select-clear-zone",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEndClearValue},p["default"].createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"×"}}))},renderArrow:function(){var e=this.handleMouseDownOnArrow,t=this.props.arrowRenderer({onMouseDown:e});return p["default"].createElement("span",{className:"Select-arrow-zone",onMouseDown:e},t)},filterOptions:function G(e){var t=this.state.inputValue,n=this.props.options||[];if(this.props.filterOptions){var G="function"==typeof this.props.filterOptions?this.props.filterOptions:E["default"];return G(n,t,e,{filterOption:this.props.filterOption,ignoreAccents:this.props.ignoreAccents,ignoreCase:this.props.ignoreCase,labelKey:this.props.labelKey,matchPos:this.props.matchPos,matchProp:this.props.matchProp,valueKey:this.props.valueKey})}return n},onOptionRef:function(e,t){t&&(this.focused=e)},renderMenu:function(e,t,n){return e&&e.length?this.props.menuRenderer({focusedOption:n,focusOption:this.focusOption,instancePrefix:this._instancePrefix,labelKey:this.props.labelKey,onFocus:this.focusOption,onSelect:this.selectValue,optionClassName:this.props.optionClassName,optionComponent:this.props.optionComponent,optionRenderer:this.props.optionRenderer||this.getOptionLabel,options:e,selectValue:this.selectValue,valueArray:t,valueKey:this.props.valueKey,onOptionRef:this.onOptionRef}):this.props.noResultsText?p["default"].createElement("div",{className:"Select-noresults"},this.props.noResultsText):null},renderHiddenField:function(e){var t=this;if(this.props.name){if(this.props.joinValues){var n=e.map(function(e){return s(e[t.props.valueKey])}).join(this.props.delimiter);return p["default"].createElement("input",{type:"hidden",ref:function(e){return t.value=e},name:this.props.name,value:n,disabled:this.props.disabled})}return e.map(function(e,n){return p["default"].createElement("input",{key:"hidden."+n,type:"hidden",ref:"value"+n,name:t.props.name,value:s(e[t.props.valueKey]),disabled:t.props.disabled})})}},getFocusableOptionIndex:function(e){var t=this._visibleOptions;if(!t.length)return null;var n=this.state.focusedOption||e;if(n&&!n.disabled){var r=t.indexOf(n);if(r!==-1)return r}for(var o=0;o-1)return!1;if(r.filterOption)return r.filterOption.call(o,e,t);if(!t)return!0;var a=String(e[r.valueKey]),u=String(e[r.labelKey]);return r.ignoreAccents&&("label"!==r.matchProp&&(a=(0,i["default"])(a)),"value"!==r.matchProp&&(u=(0,i["default"])(u))),r.ignoreCase&&("label"!==r.matchProp&&(a=a.toLowerCase()),"value"!==r.matchProp&&(u=u.toLowerCase())),"start"===r.matchPos?"label"!==r.matchProp&&a.substr(0,t.length)===t||"value"!==r.matchProp&&u.substr(0,t.length)===t:"label"!==r.matchProp&&a.indexOf(t)>=0||"value"!==r.matchProp&&u.indexOf(t)>=0})}var a=e("./stripDiacritics"),i=r(a);t.exports=o},{"./stripDiacritics":275}],274:[function(e,t,n){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=e.focusedOption,n=e.instancePrefix,r=(e.labelKey,e.onFocus),o=e.onSelect,i=e.optionClassName,s=e.optionComponent,l=e.optionRenderer,c=e.options,p=e.valueArray,d=e.valueKey,f=e.onOptionRef,h=s;return c.map(function(e,s){var c=p&&p.indexOf(e)>-1,g=e===t,y=(0,a["default"])(i,{"Select-option":!0,"is-selected":c,"is-focused":g,"is-disabled":e.disabled});return u["default"].createElement(h,{className:y,instancePrefix:n,isDisabled:e.disabled,isFocused:g,isSelected:c,key:"option-"+s+"-"+e[d],onFocus:r,onSelect:o,option:e,optionIndex:s,ref:function(e){f(e,g)}},l(e,s))})}var o="undefined"!=typeof window?window.classNames:"undefined"!=typeof e?e.classNames:null,a=n(o),i="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,u=n(i);t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],275:[function(e,t,n){"use strict";var r=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];t.exports=function(e){for(var t=0;t1)for(var n=1;n0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=s["default"](this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length},e.prototype.reset=function(){this.entered=[]},e}();n["default"]=l,t.exports=n["default"]},{"lodash/union":108,"lodash/without":109}],4:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}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")}n.__esModule=!0;var i=e("lodash/defaults"),u=o(i),s=e("./shallowEqual"),l=o(s),c=e("./EnterLeaveCounter"),p=o(c),d=e("./BrowserDetector"),f=e("./OffsetUtils"),h=e("./NativeDragSources"),g=e("./NativeTypes"),y=r(g),v=function(){function e(t){a(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new p["default"],this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopDragStart=this.handleTopDragStart.bind(this),this.handleTopDragStartCapture=this.handleTopDragStartCapture.bind(this),this.handleTopDragEndCapture=this.handleTopDragEndCapture.bind(this),this.handleTopDragEnter=this.handleTopDragEnter.bind(this),this.handleTopDragEnterCapture=this.handleTopDragEnterCapture.bind(this),this.handleTopDragLeaveCapture=this.handleTopDragLeaveCapture.bind(this),this.handleTopDragOver=this.handleTopDragOver.bind(this),this.handleTopDragOverCapture=this.handleTopDragOverCapture.bind(this),this.handleTopDrop=this.handleTopDrop.bind(this),this.handleTopDropCapture=this.handleTopDropCapture.bind(this),this.handleSelectStart=this.handleSelectStart.bind(this),this.endDragIfSourceWasRemovedFromDOM=this.endDragIfSourceWasRemovedFromDOM.bind(this),this.endDragNativeItem=this.endDragNativeItem.bind(this)}return e.prototype.setup=function(){if("undefined"!=typeof window){if(this.constructor.isSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.constructor.isSetUp=!0,this.addEventListeners(window)}},e.prototype.teardown=function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this.removeEventListeners(window),this.clearCurrentDragSourceNode())},e.prototype.addEventListeners=function(e){e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0)},e.prototype.removeEventListeners=function(e){e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0)},e.prototype.connectDragPreview=function(e,t,n){var r=this;return this.sourcePreviewNodeOptions[e]=n,this.sourcePreviewNodes[e]=t,function(){delete r.sourcePreviewNodes[e],delete r.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,n){var r=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=n;var o=function(t){return r.handleDragStart(t,e)},a=function(t){return r.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",a),function(){delete r.sourceNodes[e],delete r.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",a),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},a=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",a),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",a)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return u["default"](t||{},{dropEffect:"move"})},e.prototype.getCurrentDropEffect=function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect},e.prototype.getCurrentSourcePreviewNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return u["default"](t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return f.getNodeClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(y).some(function(t){return y[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=h.createNativeDragSource(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),d.isFirefox()&&window.addEventListener("mousemove",this.endDragNativeItem,!0)},e.prototype.endDragNativeItem=function(){this.isDraggingNativeItem()&&(d.isFirefox()&&window.removeEventListener("mousemove",this.endDragNativeItem,!0),this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},e.prototype.endDragIfSourceWasRemovedFromDOM=function(){var e=this.currentDragSourceNode;document.body.contains(e)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.setCurrentDragSourceNode=function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=f.getNodeClientOffset(e),this.currentDragSourceNodeOffsetChanged=!1,window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},e.prototype.clearCurrentDragSourceNode=function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0)},e.prototype.checkIfCurrentDragSourceRectChanged=function(){var e=this.currentDragSourceNode;return!!e&&(!!this.currentDragSourceNodeOffsetChanged||(this.currentDragSourceNodeOffsetChanged=!l["default"](f.getNodeClientOffset(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged))},e.prototype.handleTopDragStartCapture=function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},e.prototype.handleDragStart=function(e,t){this.dragStartSourceIds.unshift(t)},e.prototype.handleTopDragStart=function(e){var t=this,n=this.dragStartSourceIds;this.dragStartSourceIds=null;var r=f.getEventClientOffset(e);this.actions.beginDrag(n,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:r});var o=e.dataTransfer,a=h.matchNativeItemType(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var i=this.monitor.getSourceId(),u=this.sourceNodes[i],s=this.sourcePreviewNodes[i]||u,l=this.getCurrentSourcePreviewNodeOptions(),c=l.anchorX,p=l.anchorY,d={anchorX:c,anchorY:p},g=f.getDragPreviewOffset(u,s,r,d);o.setDragImage(s,g.x,g.y)}try{o.setData("application/json",{})}catch(y){}this.setCurrentDragSourceNode(e.target);var v=this.getCurrentSourcePreviewNodeOptions(),b=v.captureDraggingState;b?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(a)this.beginDragNativeItem(a);else{if(!(o.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}},e.prototype.handleTopDragEndCapture=function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()},e.prototype.handleTopDragEnterCapture=function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var n=e.dataTransfer,r=h.matchNativeItemType(n);r&&this.beginDragNativeItem(r)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,n=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){d.isFirefox()||this.actions.hover(n,{clientOffset:f.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}},e.prototype.handleTopDragOverCapture=function(){this.dragOverTargetIds=[]},e.prototype.handleDragOver=function(e,t){this.dragOverTargetIds.unshift(t)},e.prototype.handleTopDragOver=function(e){var t=this,n=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(n,{clientOffset:f.getEventClientOffset(e)});var r=n.some(function(e){return t.monitor.canDropOnTarget(e)});r?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")},e.prototype.handleTopDragLeaveCapture=function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()},e.prototype.handleTopDropCapture=function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()},e.prototype.handleDrop=function(e,t){this.dropTargetIds.unshift(t)},e.prototype.handleTopDrop=function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:f.getEventClientOffset(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()},e.prototype.handleSelectStart=function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},e}();n["default"]=v,t.exports=n["default"]},{"./BrowserDetector":2,"./EnterLeaveCounter":3,"./NativeDragSources":6,"./NativeTypes":7,"./OffsetUtils":8,"./shallowEqual":11,"lodash/defaults":91}],5:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.__esModule=!0;var o=function(){function e(t,n){r(this,e);for(var o=t.length,a=[],i=0;ie))return n[l];s=l-1}}i=Math.max(0,s);var p=e-t[i],d=p*p;return n[i]+r[i]*p+o[i]*d+a[i]*p*d},e}();n["default"]=o,t.exports=n["default"]},{}],6:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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 i(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},null);return null!=r?r:n}function u(e){var t=d[e],n=t.exposeProperty,r=t.matchesTypes,i=t.getData;return function(){function e(){o(this,e),this.item=Object.defineProperties({},a({},n,{get:function(){return console.warn("Browser doesn't allow reading \""+n+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return e.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[n],this.item[n]=i(e,r)},e.prototype.canDrag=function(){return!0},e.prototype.beginDrag=function(){return this.item},e.prototype.isDragging=function(e,t){return t===e.getSourceId()},e.prototype.endDrag=function(){},e}()}function s(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(d).filter(function(e){var n=d[e].matchesTypes;return n.some(function(e){return t.indexOf(e)>-1})})[0]||null}n.__esModule=!0;var l;n.createNativeDragSource=u,n.matchNativeItemType=s;var c=e("./NativeTypes"),p=r(c),d=(l={},a(l,p.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(l,p.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return i(e,t,"").split("\n")}}),a(l,p.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return i(e,t,"")}}),l)},{"./NativeTypes":7}],7:[function(e,t,n){"use strict";n.__esModule=!0;var r="__NATIVE_FILE__";n.FILE=r;var o="__NATIVE_URL__";n.URL=o;var a="__NATIVE_TEXT__";n.TEXT=a},{}],8:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.nodeType===c?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top,o=n.left;return{x:o,y:r}}function a(e){return{x:e.clientX,y:e.clientY}}function i(e,t,n,r){var a="IMG"===t.nodeName&&(u.isFirefox()||!document.documentElement.contains(t)),i=a?e:t,s=o(i),c={x:n.x-s.x,y:n.y-s.y},p=e.offsetWidth,d=e.offsetHeight,f=r.anchorX,h=r.anchorY,g=a?t.width:p,y=a?t.height:d;u.isSafari()&&a?(y/=window.devicePixelRatio,g/=window.devicePixelRatio):u.isFirefox()&&!a&&(y*=window.devicePixelRatio,g*=window.devicePixelRatio);var v=new l["default"]([0,.5,1],[c.x,c.x/p*g,c.x+g-p]),b=new l["default"]([0,.5,1],[c.y,c.y/d*y,c.y+y-d]),m=v.interpolate(f),_=b.interpolate(h);return u.isSafari()&&a&&(_+=(window.devicePixelRatio-1)*y),{x:m,y:_}}n.__esModule=!0,n.getNodeClientOffset=o,n.getEventClientOffset=a,n.getDragPreviewOffset=i;var u=e("./BrowserDetector"),s=e("./MonotonicInterpolant"),l=r(s),c=1},{"./BrowserDetector":2,"./MonotonicInterpolant":5}],9:[function(e,t,n){"use strict";function r(){return o||(o=new Image,o.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),o}n.__esModule=!0,n["default"]=r;var o=void 0;t.exports=n["default"]},{}],10:[function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}function a(e){return new u["default"](e)}n.__esModule=!0,n["default"]=a;var i=e("./HTML5Backend"),u=o(i),s=e("./getEmptyImage"),l=o(s),c=e("./NativeTypes"),p=r(c);n.NativeTypes=p,n.getEmptyImage=l["default"]},{"./HTML5Backend":4,"./NativeTypes":7,"./getEmptyImage":9}],11:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a-1}var o=e("./_baseIndexOf");t.exports=r},{"./_baseIndexOf":32}],21:[function(e,t,n){function r(e,t,n){for(var r=-1,o=null==e?0:e.length;++r=c&&(d=l,f=!1,t=new o(t));e:for(;++p0&&n(c)?t>1?r(c,t-1,n,i,u):o(u,c):i||(u[u.length]=c)}return u}var o=e("./_arrayPush"),a=e("./_isFlattenable");t.exports=r},{"./_arrayPush":24,"./_isFlattenable":60}],31:[function(e,t,n){function r(e){return null==e?void 0===e?s:u:l&&l in Object(e)?a(e):i(e)}var o=e("./_Symbol"),a=e("./_getRawTag"),i=e("./_objectToString"),u="[object Null]",s="[object Undefined]",l=o?o.toStringTag:void 0;t.exports=r},{"./_Symbol":18,"./_getRawTag":53,"./_objectToString":79}],32:[function(e,t,n){function r(e,t,n){return t===t?i(e,t,n):o(e,a,n)}var o=e("./_baseFindIndex"),a=e("./_baseIsNaN"),i=e("./_strictIndexOf");t.exports=r},{"./_baseFindIndex":29,"./_baseIsNaN":34,"./_strictIndexOf":87}],33:[function(e,t,n){function r(e){return a(e)&&o(e)==i}var o=e("./_baseGetTag"),a=e("./isObjectLike"),i="[object Arguments]";t.exports=r},{"./_baseGetTag":31,"./isObjectLike":102}],34:[function(e,t,n){function r(e){return e!==e}t.exports=r},{}],35:[function(e,t,n){function r(e){if(!i(e)||a(e))return!1;var t=o(e)?h:l;return t.test(u(e))}var o=e("./isFunction"),a=e("./_isMasked"),i=e("./isObject"),u=e("./_toSource"),s=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,c=Function.prototype,p=Object.prototype,d=c.toString,f=p.hasOwnProperty,h=RegExp("^"+d.call(f).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=r},{"./_isMasked":64,"./_toSource":88,"./isFunction":99,"./isObject":101}],36:[function(e,t,n){function r(e){return i(e)&&a(e.length)&&!!I[o(e)]}var o=e("./_baseGetTag"),a=e("./isLength"),i=e("./isObjectLike"),u="[object Arguments]",s="[object Array]",l="[object Boolean]",c="[object Date]",p="[object Error]",d="[object Function]",f="[object Map]",h="[object Number]",g="[object Object]",y="[object RegExp]",v="[object Set]",b="[object String]",m="[object WeakMap]",_="[object ArrayBuffer]",E="[object DataView]",D="[object Float32Array]",O="[object Float64Array]",C="[object Int8Array]",T="[object Int16Array]",w="[object Int32Array]",S="[object Uint8Array]",x="[object Uint8ClampedArray]",A="[object Uint16Array]",P="[object Uint32Array]",I={};I[D]=I[O]=I[C]=I[T]=I[w]=I[S]=I[x]=I[A]=I[P]=!0,I[u]=I[s]=I[_]=I[l]=I[E]=I[c]=I[p]=I[d]=I[f]=I[h]=I[g]=I[y]=I[v]=I[b]=I[m]=!1,t.exports=r},{"./_baseGetTag":31,"./isLength":100,"./isObjectLike":102}],37:[function(e,t,n){function r(e){if(!o(e))return i(e);var t=a(e),n=[];for(var r in e)("constructor"!=r||!t&&s.call(e,r))&&n.push(r);return n}var o=e("./isObject"),a=e("./_isPrototype"),i=e("./_nativeKeysIn"),u=Object.prototype,s=u.hasOwnProperty;t.exports=r},{"./_isPrototype":65,"./_nativeKeysIn":77,"./isObject":101}],38:[function(e,t,n){function r(e,t){return i(a(e,t,o),e+"")}var o=e("./identity"),a=e("./_overRest"),i=e("./_setToString");t.exports=r},{"./_overRest":80,"./_setToString":85,"./identity":93}],39:[function(e,t,n){var r=e("./constant"),o=e("./_defineProperty"),a=e("./identity"),i=o?function(e,t){return o(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:a;t.exports=i},{"./_defineProperty":49,"./constant":90,"./identity":93}],40:[function(e,t,n){function r(e,t){for(var n=-1,r=Array(e);++n=c){var y=t?null:s(e);if(y)return l(y);f=!1,p=u,g=new o}else g=t?[]:h;e:for(;++r1?n[o-1]:void 0,u=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,u&&a(n[0],n[1],u)&&(i=o<3?void 0:i,o=1),t=Object(t);++r-1&&e%1==0&&e-1}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":26}],70:[function(e,t,n){function r(e,t){var n=this.__data__,r=o(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var o=e("./_assocIndexOf");t.exports=r},{"./_assocIndexOf":26}],71:[function(e,t,n){function r(){this.size=0,this.__data__={hash:new o,map:new(i||a),string:new o}}var o=e("./_Hash"),a=e("./_ListCache"),i=e("./_Map");t.exports=r},{"./_Hash":12,"./_ListCache":13,"./_Map":14}],72:[function(e,t,n){function r(e){var t=o(this,e)["delete"](e);return this.size-=t?1:0,t}var o=e("./_getMapData");t.exports=r},{"./_getMapData":51}],73:[function(e,t,n){function r(e){return o(this,e).get(e)}var o=e("./_getMapData");t.exports=r},{"./_getMapData":51}],74:[function(e,t,n){function r(e){return o(this,e).has(e)}var o=e("./_getMapData");t.exports=r},{"./_getMapData":51}],75:[function(e,t,n){function r(e,t){var n=o(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var o=e("./_getMapData");t.exports=r},{"./_getMapData":51}],76:[function(e,t,n){var r=e("./_getNative"),o=r(Object,"create");t.exports=o},{"./_getNative":52}],77:[function(e,t,n){function r(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}t.exports=r},{}],78:[function(e,t,n){var r=e("./_freeGlobal"),o="object"==typeof n&&n&&!n.nodeType&&n,a=o&&"object"==typeof t&&t&&!t.nodeType&&t,i=a&&a.exports===o,u=i&&r.process,s=function(){try{return u&&u.binding&&u.binding("util")}catch(e){}}();t.exports=s},{"./_freeGlobal":50}],79:[function(e,t,n){function r(e){return a.call(e)}var o=Object.prototype,a=o.toString;t.exports=r},{}],80:[function(e,t,n){function r(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,u=a(r.length-t,0),s=Array(u);++i0){if(++t>=o)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var o=800,a=16,i=Date.now;t.exports=r},{}],87:[function(e,t,n){function r(e,t,n){for(var r=n-1,o=e.length;++r-1&&e%1==0&&e<=o}var o=9007199254740991;t.exports=r},{}],101:[function(e,t,n){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}t.exports=r},{}],102:[function(e,t,n){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],103:[function(e,t,n){var r=e("./_baseIsTypedArray"),o=e("./_baseUnary"),a=e("./_nodeUtil"),i=a&&a.isTypedArray,u=i?o(i):r;t.exports=u},{"./_baseIsTypedArray":36,"./_baseUnary":41,"./_nodeUtil":78}],104:[function(e,t,n){function r(e){return i(e)?o(e,!0):a(e)}var o=e("./_arrayLikeKeys"),a=e("./_baseKeysIn"),i=e("./isArrayLike");t.exports=r},{"./_arrayLikeKeys":22,"./_baseKeysIn":37,"./isArrayLike":96}],105:[function(e,t,n){function r(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(a);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(r.Cache||o),n}var o=e("./_MapCache"),a="Expected a function";r.Cache=o,t.exports=r},{"./_MapCache":15}],106:[function(e,t,n){function r(){}t.exports=r},{}],107:[function(e,t,n){function r(){return!1}t.exports=r},{}],108:[function(e,t,n){var r=e("./_baseFlatten"),o=e("./_baseRest"),a=e("./_baseUniq"),i=e("./isArrayLikeObject"),u=o(function(e){return a(r(e,1,i,!0))});t.exports=u},{"./_baseFlatten":30,"./_baseRest":38,"./_baseUniq":42,"./isArrayLikeObject":97}],109:[function(e,t,n){var r=e("./_baseDifference"),o=e("./_baseRest"),a=e("./isArrayLikeObject"),i=o(function(e,t){return a(e)?r(e,t):[]});t.exports=i},{"./_baseDifference":28,"./_baseRest":38,"./isArrayLikeObject":97}],110:[function(e,t,n){"use strict";function r(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("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 i(e){y["default"].apply(void 0,["DragDropContext","backend"].concat(s.call(arguments)));var t=void 0;t="object"==typeof e&&"function"==typeof e["default"]?e["default"]:e,h["default"]("function"==typeof t,"Expected the backend to be a function or an ES6 module exporting a default function. Read more: http://gaearon.github.io/react-dnd/docs-drag-drop-context.html");var n={dragDropManager:new d.DragDropManager(t)};return function(e){var t=e.displayName||e.name||"Component";return function(r){function i(){o(this,i),r.apply(this,arguments)}return a(i,r),i.prototype.getDecoratedComponentInstance=function(){return this.refs.child},i.prototype.getManager=function(){return n.dragDropManager},i.prototype.getChildContext=function(){return n},i.prototype.render=function(){return p["default"].createElement(e,u({},this.props,{ref:"child"}))},l(i,null,[{key:"DecoratedComponent",value:e,enumerable:!0},{key:"displayName",value:"DragDropContext("+t+")",enumerable:!0},{key:"childContextTypes",value:{dragDropManager:c.PropTypes.object.isRequired},enumerable:!0}]),i}(c.Component)}}n.__esModule=!0;var u=Object.assign||function(e){for(var t=1;t-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html',p.join(", "),t),s["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])}),d.forEach(function(t){s["default"]("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t,t,e[t])});var t=function(){function t(e){a(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrag=function(){return!e.canDrag||e.canDrag(this.props,this.monitor)},t.prototype.isDragging=function(t,n){return e.isDragging?e.isDragging(this.props,this.monitor):n===t.getSourceId()},t.prototype.beginDrag=function(){var t=e.beginDrag(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&s["default"](c["default"](t),"beginDrag() must return a plain object that represents the dragged item. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drag-source.html",t),t},t.prototype.endDrag=function(){e.endDrag&&e.endDrag(this.props,this.monitor,this.component)},t}();return function(e){return new t(e)}}n.__esModule=!0,n["default"]=i;var u=e("invariant"),s=o(u),l=e("lodash/isPlainObject"),c=o(l),p=["canDrag","beginDrag","canDrag","isDragging","endDrag"],d=["beginDrag"];t.exports=n["default"]}).call(this,e("_process"))},{_process:1,invariant:159,"lodash/isPlainObject":241}],117:[function(e,t,n){"use strict";function r(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){return new c(e)}n.__esModule=!0,n["default"]=a;var i=e("invariant"),u=r(i),s=!1,l=!1,c=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.sourceId=e},e.prototype.canDrag=function(){u["default"](!s,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return s=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{s=!1}},e.prototype.isDragging=function(){u["default"](!l,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drag-source-monitor.html");try{return l=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{l=!1}},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();t.exports=n["default"]},{invariant:159}],118:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(){u&&(u(),u=null),r&&o&&(u=e.connectDropTarget(r,o,a))}function n(e){e!==r&&(r=e,t())}var r=void 0,o=void 0,a=void 0,u=void 0,l=i["default"]({dropTarget:function(e,n){e===o&&s["default"](n,a)||(o=e,a=n,t())}});return{receiveHandlerId:n,hooks:l}}n.__esModule=!0,n["default"]=o;var a=e("./wrapConnectorHooks"),i=r(a),u=e("./areOptionsEqual"),s=r(u);t.exports=n["default"]},{"./areOptionsEqual":114,"./wrapConnectorHooks":130}],119:[function(e,t,n){(function(r){"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 i(e){Object.keys(e).forEach(function(t){s["default"](p.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html',p.join(", "),t),s["default"]("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t,t,e[t])});var t=function(){function t(e){a(this,t),this.monitor=e,this.props=null,this.component=null}return t.prototype.receiveProps=function(e){this.props=e},t.prototype.receiveMonitor=function(e){this.monitor=e},t.prototype.receiveComponent=function(e){this.component=e},t.prototype.canDrop=function(){return!e.canDrop||e.canDrop(this.props,this.monitor)},t.prototype.hover=function(){e.hover&&e.hover(this.props,this.monitor,this.component)},t.prototype.drop=function(){if(e.drop){var t=e.drop(this.props,this.monitor,this.component);return"production"!==r.env.NODE_ENV&&s["default"]("undefined"==typeof t||c["default"](t),"drop() must either return undefined, or an object that represents the drop result. Instead received %s. Read more: http://gaearon.github.io/react-dnd/docs-drop-target.html",t),t}},t}();return function(e){return new t(e)}}n.__esModule=!0,n["default"]=i;var u=e("invariant"),s=o(u),l=e("lodash/isPlainObject"),c=o(l),p=["canDrop","hover","drop"];t.exports=n["default"]}).call(this,e("_process"))},{_process:1,invariant:159,"lodash/isPlainObject":241}],120:[function(e,t,n){"use strict";function r(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){return new l(e)}n.__esModule=!0,n["default"]=a;var i=e("invariant"),u=r(i),s=!1,l=function(){function e(t){o(this,e),this.internalMonitor=t.getMonitor()}return e.prototype.receiveHandlerId=function(e){this.targetId=e},e.prototype.canDrop=function(){u["default"](!s,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://gaearon.github.io/react-dnd/docs-drop-target-monitor.html");try{return s=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{s=!1}},e.prototype.isOver=function(e){return this.internalMonitor.isOverTarget(this.targetId,e)},e.prototype.getItemType=function(){return this.internalMonitor.getItemType()},e.prototype.getItem=function(){return this.internalMonitor.getItem()},e.prototype.getDropResult=function(){return this.internalMonitor.getDropResult()},e.prototype.didDrop=function(){return this.internalMonitor.didDrop()},e.prototype.getInitialClientOffset=function(){return this.internalMonitor.getInitialClientOffset()},e.prototype.getInitialSourceClientOffset=function(){return this.internalMonitor.getInitialSourceClientOffset()},e.prototype.getSourceClientOffset=function(){return this.internalMonitor.getSourceClientOffset()},e.prototype.getClientOffset=function(){return this.internalMonitor.getClientOffset()},e.prototype.getDifferenceFromInitialOffset=function(){return this.internalMonitor.getDifferenceFromInitialOffset()},e}();t.exports=n["default"]},{invariant:159}],121:[function(e,t,n){(function(r){"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 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 u(e){var t=e.DecoratedComponent,n=e.createHandler,o=e.createMonitor,u=e.createConnector,f=e.registerHandler,g=e.containerDisplayName,v=e.getType,m=e.collect,E=e.options,D=E.arePropsEqual,O=void 0===D?y["default"]:D,C=t.displayName||t.name||"Component";return function(e){function y(t,r){a(this,y),e.call(this,t,r),this.handleChange=this.handleChange.bind(this),this.handleChildRef=this.handleChildRef.bind(this),_["default"]("object"==typeof this.context.dragDropManager,"Could not find the drag and drop manager in the context of %s. Make sure to wrap the top-level component of your app with DragDropContext. Read more: http://gaearon.github.io/react-dnd/docs-troubleshooting.html#could-not-find-the-drag-and-drop-manager-in-the-context",C,C),this.manager=this.context.dragDropManager,this.handlerMonitor=o(this.manager),this.handlerConnector=u(this.manager.getBackend()),this.handler=n(this.handlerMonitor),this.disposable=new d.SerialDisposable,this.receiveProps(t),this.state=this.getCurrentState(),this.dispose()}return i(y,e),y.prototype.getHandlerId=function(){return this.handlerId},y.prototype.getDecoratedComponentInstance=function(){return this.decoratedComponentInstance},y.prototype.shouldComponentUpdate=function(e,t){return!O(e,this.props)||!h["default"](t,this.state)},l(y,null,[{key:"DecoratedComponent",value:t,enumerable:!0},{key:"displayName",value:g+"("+C+")",enumerable:!0},{key:"contextTypes",value:{dragDropManager:c.PropTypes.object.isRequired},enumerable:!0}]),y.prototype.componentDidMount=function(){this.isCurrentlyMounted=!0,this.disposable=new d.SerialDisposable,this.currentType=null,this.receiveProps(this.props),this.handleChange()},y.prototype.componentWillReceiveProps=function(e){O(e,this.props)||(this.receiveProps(e),this.handleChange())},y.prototype.componentWillUnmount=function(){this.dispose(),this.isCurrentlyMounted=!1},y.prototype.receiveProps=function(e){this.handler.receiveProps(e),this.receiveType(v(e))},y.prototype.receiveType=function(e){if(e!==this.currentType){this.currentType=e;var t=f(e,this.handler,this.manager),n=t.handlerId,r=t.unregister;this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor(),a=o.subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new d.CompositeDisposable(new d.Disposable(a),new d.Disposable(r)))}},y.prototype.handleChange=function(){if(this.isCurrentlyMounted){var e=this.getCurrentState();h["default"](e,this.state)||this.setState(e)}},y.prototype.dispose=function(){this.disposable.dispose(),this.handlerConnector.receiveHandlerId(null)},y.prototype.handleChildRef=function(e){this.decoratedComponentInstance=e,this.handler.receiveComponent(e)},y.prototype.getCurrentState=function(){var e=m(this.handlerConnector.hooks,this.handlerMonitor);return"production"!==r.env.NODE_ENV&&_["default"](b["default"](e),"Expected `collect` specified as the second argument to %s for %s to return a plain object of props to inject. Instead, received %s.",g,C,e),e},y.prototype.render=function(){return p["default"].createElement(t,s({},this.props,this.state,{ref:this.handleChildRef}))},y}(c.Component)}n.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t2?r-2:0),a=2;a or
. Read more: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute"),n?u.cloneElement(e,{ref:function(e){t(e),n&&n(e)}}):u.cloneElement(e,{ref:t})}n.__esModule=!0,n["default"]=o;var a=e("invariant"),i=r(a),u=e("react");t.exports=n["default"]},{invariant:159,react:void 0}],127:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return"string"==typeof e||"symbol"==typeof e||t&&i["default"](e)&&e.every(function(e){return o(e,!1)})}n.__esModule=!0,n["default"]=o;var a=e("lodash/isArray"),i=r(a);t.exports=n["default"]},{"lodash/isArray":234}],128:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{dup:11}],129:[function(e,t,n){"use strict";function r(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=Object.prototype.hasOwnProperty,a=0;a, or turn it into a ")+"drag source or a drop target itself.")}}function a(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?null:arguments[0],n=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!l.isValidElement(t)){var r=t;return void e(r,n)}var a=t;o(a);var i=n?function(t){return e(t,n)}:e;return s["default"](a,i)}}function i(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n],o=a(r);t[n]=function(){return o}}),t}n.__esModule=!0,n["default"]=i;var u=e("./utils/cloneWithRef"),s=r(u),l=e("react");t.exports=n["default"]},{"./utils/cloneWithRef":126,react:void 0}],131:[function(e,t,n){"use strict";var r=function(e){return e&&e.__esModule?e:{"default":e}},o=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")};n.__esModule=!0;var a=e("./isDisposable"),i=r(a),u=function(){function e(){for(var t=arguments.length,n=Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};a(this,e);var r=(0,s["default"])(c["default"]);this.context=n,this.store=r,this.monitor=new h["default"](r),this.registry=this.monitor.registry,this.backend=t(this),r.subscribe(this.handleRefCountChange.bind(this))}return i(e,[{key:"handleRefCountChange",value:function(){var e=this.store.getState().refCount>0;e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1)}},{key:"getContext",value:function(){return this.context}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.registry}},{key:"getActions",value:function(){function e(e){return function(){for(var r=arguments.length,o=Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:{},r=n.handlerIds;(0,u["default"])("function"==typeof e,"listener must be a function."),(0,u["default"])("undefined"==typeof r||(0,l["default"])(r),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var n=t.store.getState(),a=n.stateId;try{var i=a===o||a===o+1&&!(0,g.areDirty)(n.dirtyHandlerIds,r);i||e()}finally{o=a}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;(0,u["default"])("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset,r=function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())};return this.store.subscribe(r)}},{key:"canDragSource",value:function(e){var t=this.registry.getSource(e);return(0,u["default"])(t,"Expected to find a valid source."),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){var t=this.registry.getTarget(e);if((0,u["default"])(t,"Expected to find a valid target."),!this.isDragging()||this.didDrop())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();return(0,p["default"])(n,r)&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){var t=this.registry.getSource(e,!0);if((0,u["default"])(t,"Expected to find a valid source."),!this.isDragging()||!this.isSourcePublic())return!1;var n=this.registry.getSourceType(e),r=this.getItemType();return n===r&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1},n=t.shallow;if(!this.isDragging())return!1;var r=this.registry.getTargetType(e),o=this.getItemType();if(!(0,p["default"])(r,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var i=a.indexOf(e);return n?i===a.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return(0,h.getSourceClientOffset)(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return(0,h.getDifferenceFromInitialOffset)(this.store.getState().dragOffset)}}]),e}();n["default"]=y},{"./HandlerRegistry":140,"./reducers/dirtyHandlerIds":145,"./reducers/dragOffset":146,"./utils/matchesType":152,invariant:159,"lodash/isArray":234}],138:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0,clientOffset:null},n=t.publishSource,r=t.clientOffset,o=t.getSourceClientOffset;(0,c["default"])((0,d["default"])(e),"Expected sourceIds to be an array.");var a=this.getMonitor(),i=this.getRegistry();(0,c["default"])(!a.isDragging(),"Cannot call beginDrag while dragging.");for(var u=0;u=0;l--)if(a.canDragSource(e[l])){s=e[l];break}if(null!==s){var p=null;r&&((0,c["default"])("function"==typeof o,"When clientOffset is provided, getSourceClientOffset must be a function."),p=o(s));var f=i.getSource(s),g=f.beginDrag(a,s);(0,c["default"])((0,h["default"])(g),"Item must be an object."),i.pinSource(s);var y=i.getSourceType(s);return{type:v,itemType:y,item:g,sourceId:s,clientOffset:r,sourceClientOffset:p,isSourcePublic:n}}}function a(){var e=this.getMonitor();if(e.isDragging())return{type:b}}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.clientOffset,r=void 0===n?null:n;(0,c["default"])((0,d["default"])(e),"Expected targetIds to be an array.");var o=e.slice(0),a=this.getMonitor(),i=this.getRegistry();(0,c["default"])(a.isDragging(),"Cannot call hover while not dragging."),(0,c["default"])(!a.didDrop(),"Cannot call hover after drop.");for(var u=0;u=0;f--){var h=o[f],g=i.getTargetType(h);(0,y["default"])(g,p)||o.splice(f,1)}for(var v=0;v0&&void 0!==arguments[0]?arguments[0]:d,arguments[1]),t=arguments[2];switch(e.type){case c.HOVER:break;case p.ADD_SOURCE:case p.ADD_TARGET:case p.REMOVE_TARGET:case p.REMOVE_SOURCE:return d;case c.BEGIN_DRAG:case c.PUBLISH_DRAG_SOURCE:case c.END_DRAG:case c.DROP:default:return f}var n=e.targetIds,r=t.targetIds,o=(0,u["default"])(n,r),a=!1;if(0===o.length){for(var i=0;i0)}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o,n.areDirty=a;var i=e("lodash/xor"),u=r(i),s=e("lodash/intersection"),l=r(s),c=e("../actions/dragDrop"),p=e("../actions/registry"),d=[],f=[]},{"../actions/dragDrop":141,"../actions/registry":142,"lodash/intersection":232,"lodash/xor":244}],146:[function(e,t,n){"use strict";function r(e,t){return e===t||e&&t&&e.x===t.x&&e.y===t.y}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments[1];switch(t.type){case s.BEGIN_DRAG:return{initialSourceClientOffset:t.sourceClientOffset,initialClientOffset:t.clientOffset,clientOffset:t.clientOffset};case s.HOVER:return r(e.clientOffset,t.clientOffset)?e:u({},e,{clientOffset:t.clientOffset});case s.END_DRAG:case s.DROP:return l;default:return e}}function a(e){var t=e.clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset;return t&&n&&r?{x:t.x+r.x-n.x,y:t.y+r.y-n.y}:null}function i(e){var t=e.clientOffset,n=e.initialClientOffset;return t&&n?{x:t.x-n.x,y:t.y-n.y}:null}Object.defineProperty(n,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:c,t=arguments[1];switch(t.type){case s.BEGIN_DRAG:return a({},e,{itemType:t.itemType,item:t.item,sourceId:t.sourceId,isSourcePublic:t.isSourcePublic,dropResult:null,didDrop:!1});case s.PUBLISH_DRAG_SOURCE:return a({},e,{isSourcePublic:!0});case s.HOVER:return a({},e,{targetIds:t.targetIds});case l.REMOVE_TARGET:return e.targetIds.indexOf(t.targetId)===-1?e:a({},e,{targetIds:(0,u["default"])(e.targetIds,t.targetId)});case s.DROP:return a({},e,{dropResult:t.dropResult,didDrop:!0,targetIds:[]});case s.END_DRAG:return a({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];return{dirtyHandlerIds:(0,d["default"])(e.dirtyHandlerIds,t,e.dragOperation),dragOffset:(0,i["default"])(e.dragOffset,t),refCount:(0,c["default"])(e.refCount,t),dragOperation:(0,s["default"])(e.dragOperation,t),stateId:(0,h["default"])(e.stateId)}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("./dragOffset"),i=r(a),u=e("./dragOperation"),s=r(u),l=e("./refCount"),c=r(l),p=e("./dirtyHandlerIds"),d=r(p),f=e("./stateId"),h=r(f)},{"./dirtyHandlerIds":145,"./dragOffset":146,"./dragOperation":147,"./refCount":149,"./stateId":150}],149:[function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments[1];switch(t.type){case o.ADD_SOURCE:case o.ADD_TARGET:return e+1;case o.REMOVE_SOURCE:case o.REMOVE_TARGET:return e-1;default:return e}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r;var o=e("../actions/registry")},{"../actions/registry":142}],150:[function(e,t,n){"use strict";function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r},{}],151:[function(e,t,n){"use strict";function r(){return o++}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r;var o=0},{}],152:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return(0,i["default"])(e)?e.some(function(e){return e===t}):e===t}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=o;var a=e("lodash/isArray"),i=r(a)},{"lodash/isArray":234}],153:[function(e,t,n){"use strict";function r(){if(s.length)throw s.shift()}function o(e){var t;t=u.length?u.pop():new a,t.task=e,i(t)}function a(){this.task=null}var i=e("./raw"),u=[],s=[],l=i.makeRequestCallFromTimer(r);t.exports=o,a.prototype.call=function(){try{this.task.call()}catch(e){o.onerror?o.onerror(e):(s.push(e),l())}finally{this.task=null,u[u.length]=this}}},{"./raw":154}],154:[function(e,t,n){(function(e){"use strict";function n(e){u.length||(i(),s=!0),u[u.length]=e}function r(){for(;lc){for(var t=0,n=u.length-l;t=120&&v.length>=120)?new o(f&&v):void 0}v=e[0];var b=-1,m=h[0];e:for(;++be.props.value.length&&e.clearOptions(),e.props.onChange(t)}};return n(l({},this.props,s,{isLoading:i,onInputChange:this._onInputChange}))}}]),t}(d.Component);n["default"]=E,E.propTypes=b,E.defaultProps=_,t.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Select":249,"./utils/stripDiacritics":257}],246:[function(e,t,n){(function(n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return f["default"].createElement(g["default"],e)}function i(e){var t=e.option,n=e.options,r=e.labelKey,o=e.valueKey;return 0===n.filter(function(e){return e[r]===t[r]||e[o]===t[o]}).length}function u(e){var t=e.label;return!!t}function s(e){var t=e.label,n=e.labelKey,r=e.valueKey,o={};return o[r]=t,o[n]=t,o.className="Select-create-option-placeholder",o}function l(e){return'Create option "'+e+'"'}function c(e){var t=e.keyCode;switch(t){case 9:case 13:case 188:return!0}return!1}var p=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tu.bottom||i.topt.offsetHeight&&!(t.scrollHeight-t.offsetHeight-t.scrollTop)&&this.props.onMenuScrollToBottom()}},handleRequired:function(e,t){return!e||(t?0===e.length:0===Object.keys(e).length)},getOptionLabel:function(e){return e[this.props.labelKey]},getValueArray:function(e,t){var n=this,r="object"==typeof t?t:this.props;if(r.multi){if("string"==typeof e&&(e=e.split(r.delimiter)),!Array.isArray(e)){if(null===e||void 0===e)return[];e=[e]}return e.map(function(e){return n.expandValue(e,r)}).filter(function(e){return e})}var o=this.expandValue(e,r);return o?[o]:[]},expandValue:function(e,t){var n=typeof e;if("string"!==n&&"number"!==n&&"boolean"!==n)return e;var r=t.options,o=t.valueKey;if(r)for(var a=0;a0?n-=1:n=t.length-1;else if("start"===e)n=0;else if("end"===e)n=t.length-1;else if("page_up"===e){var o=n-this.props.pageSize;n=o<0?0:o}else if("page_down"===e){var o=n+this.props.pageSize;n=o>t.length-1?t.length-1:o}n===-1&&(n=0),this.setState({focusedIndex:t[n].index,focusedOption:t[n].option})}},getFocusedOption:function(){return this._focusedOption},getInputValue:function(){return this.state.inputValue},selectFocusedOption:function(){if(this._focusedOption)return this.selectValue(this._focusedOption)},reorderValueArray:function(e,t){if(e!==t){var n=this.getValueArray(this.props.value),r=n.splice(e,1);n.splice.apply(n,[t,0].concat(i(r))),this.setValue(n)}},renderLoading:function(){if(this.props.isLoading)return p["default"].createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},p["default"].createElement("span",{className:"Select-loading"}))},renderMultiValueComponent:function(e,t,n){var r=this.props.valueRenderer||this.getOptionLabel,o=this.props.valueComponent,a=this.props.onValueClick?this.handleValueClick:null,i=this._instancePrefix+"-value-"+t,u="value-"+t+"-"+e[this.props.valueKey];return p["default"].createElement(o,{id:i,instancePrefix:this._instancePrefix,disabled:this.props.disabled||e.clearableValue===!1,key:u,onClick:a,onRemove:this.removeValue,value:e,reorder:n},r(e,t),p["default"].createElement("span",{className:"Select-aria-only"}," "))},renderValue:function(e,t){var n=this;if(!e.length)return this.state.inputValue?null:p["default"].createElement("div",{className:"Select-placeholder"},this.props.placeholder);if(this.props.multi)return this.props.reorder&&!this.props.disabled?e.map(function(e,t){var r=!0;return p["default"].createElement(L["default"],{key:t,index:t,contextId:n._instancePrefix,className:"Select-drag-container",handleSorting:n.reorderValueArray},p["default"].createElement(B["default"],{index:t,contextId:n._instancePrefix},n.renderMultiValueComponent(e,t,r)))}):e.map(function(e,t){var r=!1;return n.renderMultiValueComponent(e,t,r)});if(!this.state.inputValue){var r=this.props.valueRenderer||this.getOptionLabel,o=this.props.valueComponent,a=this.props.onValueClick?this.handleValueClick:null;t&&(a=null);this._instancePrefix+"-value-item";return p["default"].createElement(o,{id:this._instancePrefix+"-value-item",disabled:this.props.disabled,instancePrefix:this._instancePrefix,onClick:a,value:e[0]},r(e[0]))}},renderInput:function(e,t){var n=this;if(this.props.inputRenderer)return this.props.inputRenderer();var r,o=(0,v["default"])("Select-input",this.props.inputProps.className),i=!!this.state.isOpen,s=(0,v["default"])((r={},u(r,this._instancePrefix+"-list",i),u(r,this._instancePrefix+"-backspace-remove-message",this.props.multi&&!this.props.disabled&&this.state.isFocused&&!this.state.inputValue),r)),c=l({},this.props.inputProps,{role:"combobox","aria-expanded":""+i,"aria-owns":s,"aria-haspopup":""+i,"aria-activedescendant":i?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value","aria-labelledby":this.props["aria-labelledby"],"aria-label":this.props["aria-label"],className:o,tabIndex:this.props.tabIndex,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus,ref:function(e){return n.input=e},required:this.state.required,value:this.state.inputValue});if(this.props.disabled||!this.props.searchable){var d=this.props.inputProps,f=(d.inputClassName,a(d,["inputClassName"]));return p["default"].createElement("div",l({},f,{role:"combobox","aria-expanded":i,"aria-owns":i?this._instancePrefix+"-list":this._instancePrefix+"-value","aria-activedescendant":i?this._instancePrefix+"-option-"+t:this._instancePrefix+"-value",className:o,tabIndex:this.props.tabIndex||0,onBlur:this.handleInputBlur,onFocus:this.handleInputFocus,ref:function(e){return n.input=e},"aria-readonly":""+!!this.props.disabled,style:{border:0,width:1,display:"inline-block"}}))}return this.props.autosize?p["default"].createElement(g["default"],l({},c,{minWidth:"5"})):p["default"].createElement("div",{className:o},p["default"].createElement("input",c))},renderClear:function(){if(this.props.clearable&&this.props.value&&0!==this.props.value&&(!this.props.multi||this.props.value.length)&&!this.props.disabled&&!this.props.isLoading)return p["default"].createElement("span",{className:"Select-clear-zone",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEndClearValue},p["default"].createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"×"}}))},renderArrow:function(){var e=this.handleMouseDownOnArrow,t=this.props.arrowRenderer({onMouseDown:e});return p["default"].createElement("span",{className:"Select-arrow-zone",onMouseDown:e},t)},filterOptions:function G(e){var t=this.state.inputValue,n=this.props.options||[];if(this.props.filterOptions){var G="function"==typeof this.props.filterOptions?this.props.filterOptions:E["default"];return G(n,t,e,{filterOption:this.props.filterOption,ignoreAccents:this.props.ignoreAccents,ignoreCase:this.props.ignoreCase,labelKey:this.props.labelKey,matchPos:this.props.matchPos,matchProp:this.props.matchProp,valueKey:this.props.valueKey})}return n},onOptionRef:function(e,t){t&&(this.focused=e)},renderMenu:function(e,t,n){return e&&e.length?this.props.menuRenderer({focusedOption:n,focusOption:this.focusOption,instancePrefix:this._instancePrefix,labelKey:this.props.labelKey,onFocus:this.focusOption,onSelect:this.selectValue,optionClassName:this.props.optionClassName,optionComponent:this.props.optionComponent,optionRenderer:this.props.optionRenderer||this.getOptionLabel,options:e,selectValue:this.selectValue,valueArray:t,valueKey:this.props.valueKey,onOptionRef:this.onOptionRef}):this.props.noResultsText?p["default"].createElement("div",{className:"Select-noresults"},this.props.noResultsText):null},renderHiddenField:function(e){var t=this;if(this.props.name){if(this.props.joinValues){var n=e.map(function(e){return s(e[t.props.valueKey])}).join(this.props.delimiter);return p["default"].createElement("input",{type:"hidden",ref:function(e){return t.value=e},name:this.props.name,value:n,disabled:this.props.disabled})}return e.map(function(e,n){return p["default"].createElement("input",{key:"hidden."+n,type:"hidden",ref:"value"+n,name:t.props.name,value:s(e[t.props.valueKey]),disabled:t.props.disabled})})}},getFocusableOptionIndex:function(e){var t=this._visibleOptions;if(!t.length)return null;var n=this.state.focusedOption||e;if(n&&!n.disabled){var r=t.indexOf(n);if(r!==-1)return r}for(var o=0;o-1)return!1;if(r.filterOption)return r.filterOption.call(o,e,t);if(!t)return!0;var a=String(e[r.valueKey]),u=String(e[r.labelKey]);return r.ignoreAccents&&("label"!==r.matchProp&&(a=(0,i["default"])(a)),"value"!==r.matchProp&&(u=(0,i["default"])(u))),r.ignoreCase&&("label"!==r.matchProp&&(a=a.toLowerCase()),"value"!==r.matchProp&&(u=u.toLowerCase())),"start"===r.matchPos?"label"!==r.matchProp&&a.substr(0,t.length)===t||"value"!==r.matchProp&&u.substr(0,t.length)===t:"label"!==r.matchProp&&a.indexOf(t)>=0||"value"!==r.matchProp&&u.indexOf(t)>=0})}var a=e("./stripDiacritics"),i=r(a);t.exports=o},{"./stripDiacritics":257}],256:[function(e,t,n){(function(e){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function r(e){var t=e.focusedOption,n=e.instancePrefix,r=(e.labelKey,e.onFocus),o=e.onSelect,i=e.optionClassName,s=e.optionComponent,l=e.optionRenderer,c=e.options,p=e.valueArray,d=e.valueKey,f=e.onOptionRef,h=s;return c.map(function(e,s){var c=p&&p.indexOf(e)>-1,g=e===t,y=(0,a["default"])(i,{"Select-option":!0,"is-selected":c,"is-focused":g,"is-disabled":e.disabled});return u["default"].createElement(h,{className:y,instancePrefix:n,isDisabled:e.disabled,isFocused:g,isSelected:c,key:"option-"+s+"-"+e[d],onFocus:r,onSelect:o,option:e,optionIndex:s,ref:function(e){f(e,g)}},l(e,s))})}var o="undefined"!=typeof window?window.classNames:"undefined"!=typeof e?e.classNames:null,a=n(o),i="undefined"!=typeof window?window.React:"undefined"!=typeof e?e.React:null,u=n(i);t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],257:[function(e,t,n){"use strict";var r=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];t.exports=function(e){for(var t=0;t>> (32 - b)); - }, - - // Bit-wise rotation right - rotr: function(n, b) { - return (n << (32 - b)) | (n >>> b); - }, - - // Swap big-endian to little-endian and vice versa - endian: function(n) { - // If number given, swap endian - if (n.constructor == Number) { - return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; - } - - // Else, assume array and swap all items - for (var i = 0; i < n.length; i++) - n[i] = crypt.endian(n[i]); - return n; - }, - - // Generate an array of any length of random bytes - randomBytes: function(n) { - for (var bytes = []; n > 0; n--) - bytes.push(Math.floor(Math.random() * 256)); - return bytes; - }, - - // Convert a byte array to big-endian 32-bit words - bytesToWords: function(bytes) { - for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) - words[b >>> 5] |= bytes[i] << (24 - b % 32); - return words; - }, - - // Convert big-endian 32-bit words to a byte array - wordsToBytes: function(words) { - for (var bytes = [], b = 0; b < words.length * 32; b += 8) - bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF); - return bytes; - }, - - // Convert a byte array to a hex string - bytesToHex: function(bytes) { - for (var hex = [], i = 0; i < bytes.length; i++) { - hex.push((bytes[i] >>> 4).toString(16)); - hex.push((bytes[i] & 0xF).toString(16)); - } - return hex.join(''); - }, - - // Convert a hex string to a byte array - hexToBytes: function(hex) { - for (var bytes = [], c = 0; c < hex.length; c += 2) - bytes.push(parseInt(hex.substr(c, 2), 16)); - return bytes; - }, - - // Convert a byte array to a base-64 string - bytesToBase64: function(bytes) { - for (var base64 = [], i = 0; i < bytes.length; i += 3) { - var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2]; - for (var j = 0; j < 4; j++) - if (i * 8 + j * 6 <= bytes.length * 8) - base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F)); - else - base64.push('='); - } - return base64.join(''); - }, - - // Convert a base-64 string to a byte array - base64ToBytes: function(base64) { - // Remove non-base-64 characters - base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); - - for (var bytes = [], i = 0, imod4 = 0; i < base64.length; - imod4 = ++i % 4) { - if (imod4 == 0) continue; - bytes.push(((base64map.indexOf(base64.charAt(i - 1)) - & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2)) - | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2))); - } - return bytes; - } - }; - - module.exports = crypt; -})(); - -},{}],18:[function(require,module,exports){ -'use strict'; -module.exports = !!(typeof window !== 'undefined' && window.document && window.document.createElement); -},{}],19:[function(require,module,exports){ -'use strict'; - -var canUseDOM = require('./inDOM'); - -var size; - -module.exports = function (recalc) { - if (!size || recalc) { - if (canUseDOM) { - var scrollDiv = document.createElement('div'); - - scrollDiv.style.position = 'absolute'; - scrollDiv.style.top = '-9999px'; - scrollDiv.style.width = '50px'; - scrollDiv.style.height = '50px'; - scrollDiv.style.overflow = 'scroll'; - - document.body.appendChild(scrollDiv); - size = scrollDiv.offsetWidth - scrollDiv.clientWidth; - document.body.removeChild(scrollDiv); - } - } - - return size; -}; -},{"./inDOM":18}],20:[function(require,module,exports){ -/** - * Copyright (c) 2013-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @typechecks - * - */ - -/*eslint-disable no-self-compare */ - -'use strict'; - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -/** - * inlined Object.is polyfill to avoid requiring consumers ship their own - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is - */ -function is(x, y) { - // SameValue algorithm - if (x === y) { - // Steps 1-5, 7-10 - // Steps 6.b-6.e: +0 != -0 - // Added the nonzero y check to make Flow happy, but it is redundant - return x !== 0 || y !== 0 || 1 / x === 1 / y; - } else { - // Step 6.a: NaN == NaN - return x !== x && y !== y; - } -} - -/** - * Performs equality by iterating through keys on an object and returning false - * when any key has values which are not strictly equal between the arguments. - * Returns true when the values of all keys are strictly equal. - */ -function shallowEqual(objA, objB) { - if (is(objA, objB)) { - return true; - } - - if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { - return false; - } - - var keysA = Object.keys(objA); - var keysB = Object.keys(objB); - - if (keysA.length !== keysB.length) { - return false; - } - - // Test for A's keys different from B. - for (var i = 0; i < keysA.length; i++) { - if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) { - return false; - } - } - - return true; -} - -module.exports = shallowEqual; -},{}],21:[function(require,module,exports){ -/*! - * Determine if an object is a Buffer - * - * @author Feross Aboukhadijeh - * @license MIT - */ - -// The _isBuffer check is for Safari 5-7 support, because it's missing -// Object.prototype.constructor. Remove this eventually -module.exports = function (obj) { - return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) -} - -function isBuffer (obj) { - return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) -} - -// For Node v0.10 support. Remove this eventually. -function isSlowBuffer (obj) { - return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) -} - -},{}],22:[function(require,module,exports){ -module.exports = function() { - var mediaQuery; - if (typeof window !== "undefined" && window !== null) { - mediaQuery = "(-webkit-min-device-pixel-ratio: 1.25), (min--moz-device-pixel-ratio: 1.25), (-o-min-device-pixel-ratio: 5/4), (min-resolution: 1.25dppx)"; - if (window.devicePixelRatio > 1.25) { - return true; - } - if (window.matchMedia && window.matchMedia(mediaQuery).matches) { - return true; - } - } - return false; -}; - -},{}],23:[function(require,module,exports){ -// the whatwg-fetch polyfill installs the fetch() function -// on the global object (window or self) -// -// Return that as the export for use in Webpack, Browserify etc. -require('whatwg-fetch'); -module.exports = self.fetch.bind(self); - -},{"whatwg-fetch":93}],24:[function(require,module,exports){ -(function(){ - var crypt = require('crypt'), - utf8 = require('charenc').utf8, - isBuffer = require('is-buffer'), - bin = require('charenc').bin, - - // The core - md5 = function (message, options) { - // Convert to byte array - if (message.constructor == String) - if (options && options.encoding === 'binary') - message = bin.stringToBytes(message); - else - message = utf8.stringToBytes(message); - else if (isBuffer(message)) - message = Array.prototype.slice.call(message, 0); - else if (!Array.isArray(message)) - message = message.toString(); - // else, assume byte array already - - var m = crypt.bytesToWords(message), - l = message.length * 8, - a = 1732584193, - b = -271733879, - c = -1732584194, - d = 271733878; - - // Swap endian - for (var i = 0; i < m.length; i++) { - m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF | - ((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00; - } - - // Padding - m[l >>> 5] |= 0x80 << (l % 32); - m[(((l + 64) >>> 9) << 4) + 14] = l; - - // Method shortcuts - var FF = md5._ff, - GG = md5._gg, - HH = md5._hh, - II = md5._ii; - - for (var i = 0; i < m.length; i += 16) { - - var aa = a, - bb = b, - cc = c, - dd = d; - - a = FF(a, b, c, d, m[i+ 0], 7, -680876936); - d = FF(d, a, b, c, m[i+ 1], 12, -389564586); - c = FF(c, d, a, b, m[i+ 2], 17, 606105819); - b = FF(b, c, d, a, m[i+ 3], 22, -1044525330); - a = FF(a, b, c, d, m[i+ 4], 7, -176418897); - d = FF(d, a, b, c, m[i+ 5], 12, 1200080426); - c = FF(c, d, a, b, m[i+ 6], 17, -1473231341); - b = FF(b, c, d, a, m[i+ 7], 22, -45705983); - a = FF(a, b, c, d, m[i+ 8], 7, 1770035416); - d = FF(d, a, b, c, m[i+ 9], 12, -1958414417); - c = FF(c, d, a, b, m[i+10], 17, -42063); - b = FF(b, c, d, a, m[i+11], 22, -1990404162); - a = FF(a, b, c, d, m[i+12], 7, 1804603682); - d = FF(d, a, b, c, m[i+13], 12, -40341101); - c = FF(c, d, a, b, m[i+14], 17, -1502002290); - b = FF(b, c, d, a, m[i+15], 22, 1236535329); - - a = GG(a, b, c, d, m[i+ 1], 5, -165796510); - d = GG(d, a, b, c, m[i+ 6], 9, -1069501632); - c = GG(c, d, a, b, m[i+11], 14, 643717713); - b = GG(b, c, d, a, m[i+ 0], 20, -373897302); - a = GG(a, b, c, d, m[i+ 5], 5, -701558691); - d = GG(d, a, b, c, m[i+10], 9, 38016083); - c = GG(c, d, a, b, m[i+15], 14, -660478335); - b = GG(b, c, d, a, m[i+ 4], 20, -405537848); - a = GG(a, b, c, d, m[i+ 9], 5, 568446438); - d = GG(d, a, b, c, m[i+14], 9, -1019803690); - c = GG(c, d, a, b, m[i+ 3], 14, -187363961); - b = GG(b, c, d, a, m[i+ 8], 20, 1163531501); - a = GG(a, b, c, d, m[i+13], 5, -1444681467); - d = GG(d, a, b, c, m[i+ 2], 9, -51403784); - c = GG(c, d, a, b, m[i+ 7], 14, 1735328473); - b = GG(b, c, d, a, m[i+12], 20, -1926607734); - - a = HH(a, b, c, d, m[i+ 5], 4, -378558); - d = HH(d, a, b, c, m[i+ 8], 11, -2022574463); - c = HH(c, d, a, b, m[i+11], 16, 1839030562); - b = HH(b, c, d, a, m[i+14], 23, -35309556); - a = HH(a, b, c, d, m[i+ 1], 4, -1530992060); - d = HH(d, a, b, c, m[i+ 4], 11, 1272893353); - c = HH(c, d, a, b, m[i+ 7], 16, -155497632); - b = HH(b, c, d, a, m[i+10], 23, -1094730640); - a = HH(a, b, c, d, m[i+13], 4, 681279174); - d = HH(d, a, b, c, m[i+ 0], 11, -358537222); - c = HH(c, d, a, b, m[i+ 3], 16, -722521979); - b = HH(b, c, d, a, m[i+ 6], 23, 76029189); - a = HH(a, b, c, d, m[i+ 9], 4, -640364487); - d = HH(d, a, b, c, m[i+12], 11, -421815835); - c = HH(c, d, a, b, m[i+15], 16, 530742520); - b = HH(b, c, d, a, m[i+ 2], 23, -995338651); - - a = II(a, b, c, d, m[i+ 0], 6, -198630844); - d = II(d, a, b, c, m[i+ 7], 10, 1126891415); - c = II(c, d, a, b, m[i+14], 15, -1416354905); - b = II(b, c, d, a, m[i+ 5], 21, -57434055); - a = II(a, b, c, d, m[i+12], 6, 1700485571); - d = II(d, a, b, c, m[i+ 3], 10, -1894986606); - c = II(c, d, a, b, m[i+10], 15, -1051523); - b = II(b, c, d, a, m[i+ 1], 21, -2054922799); - a = II(a, b, c, d, m[i+ 8], 6, 1873313359); - d = II(d, a, b, c, m[i+15], 10, -30611744); - c = II(c, d, a, b, m[i+ 6], 15, -1560198380); - b = II(b, c, d, a, m[i+13], 21, 1309151649); - a = II(a, b, c, d, m[i+ 4], 6, -145523070); - d = II(d, a, b, c, m[i+11], 10, -1120210379); - c = II(c, d, a, b, m[i+ 2], 15, 718787259); - b = II(b, c, d, a, m[i+ 9], 21, -343485551); - - a = (a + aa) >>> 0; - b = (b + bb) >>> 0; - c = (c + cc) >>> 0; - d = (d + dd) >>> 0; - } - - return crypt.endian([a, b, c, d]); - }; - - // Auxiliary functions - md5._ff = function (a, b, c, d, x, s, t) { - var n = a + (b & c | ~b & d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._gg = function (a, b, c, d, x, s, t) { - var n = a + (b & d | c & ~d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._hh = function (a, b, c, d, x, s, t) { - var n = a + (b ^ c ^ d) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - md5._ii = function (a, b, c, d, x, s, t) { - var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; - return ((n << s) | (n >>> (32 - s))) + b; - }; - - // Package private blocksize - md5._blocksize = 16; - md5._digestsize = 16; - - module.exports = function (message, options) { - if (message === undefined || message === null) - throw new Error('Illegal argument ' + message); - - var digestbytes = crypt.wordsToBytes(md5(message, options)); - return options && options.asBytes ? digestbytes : - options && options.asString ? bin.bytesToString(digestbytes) : - crypt.bytesToHex(digestbytes); - }; - -})(); - -},{"charenc":16,"crypt":17,"is-buffer":21}],25:[function(require,module,exports){ -'use strict'; -/* eslint-disable no-unused-vars */ -var hasOwnProperty = Object.prototype.hasOwnProperty; -var propIsEnumerable = Object.prototype.propertyIsEnumerable; - -function toObject(val) { - if (val === null || val === undefined) { - throw new TypeError('Object.assign cannot be called with null or undefined'); - } - - return Object(val); -} - -function shouldUseNative() { - try { - if (!Object.assign) { - return false; - } - - // Detect buggy property enumeration order in older V8 versions. - - // https://bugs.chromium.org/p/v8/issues/detail?id=4118 - var test1 = new String('abc'); // eslint-disable-line - test1[5] = 'de'; - if (Object.getOwnPropertyNames(test1)[0] === '5') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test2 = {}; - for (var i = 0; i < 10; i++) { - test2['_' + String.fromCharCode(i)] = i; - } - var order2 = Object.getOwnPropertyNames(test2).map(function (n) { - return test2[n]; - }); - if (order2.join('') !== '0123456789') { - return false; - } - - // https://bugs.chromium.org/p/v8/issues/detail?id=3056 - var test3 = {}; - 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { - test3[letter] = letter; - }); - if (Object.keys(Object.assign({}, test3)).join('') !== - 'abcdefghijklmnopqrst') { - return false; - } - - return true; - } catch (e) { - // We don't expect any of the above to throw, but better to be safe. - return false; - } -} - -module.exports = shouldUseNative() ? Object.assign : function (target, source) { - var from; - var to = toObject(target); - var symbols; - - for (var s = 1; s < arguments.length; s++) { - from = Object(arguments[s]); - - for (var key in from) { - if (hasOwnProperty.call(from, key)) { - to[key] = from[key]; - } - } - - if (Object.getOwnPropertySymbols) { - symbols = Object.getOwnPropertySymbols(from); - for (var i = 0; i < symbols.length; i++) { - if (propIsEnumerable.call(from, symbols[i])) { - to[symbols[i]] = from[symbols[i]]; - } - } - } - } - - return to; -}; - -},{}],26:[function(require,module,exports){ -(function (process){ -// Generated by CoffeeScript 1.7.1 -(function() { - var getNanoSeconds, hrtime, loadTime; - - if ((typeof performance !== "undefined" && performance !== null) && performance.now) { - module.exports = function() { - return performance.now(); - }; - } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { - module.exports = function() { - return (getNanoSeconds() - loadTime) / 1e6; - }; - hrtime = process.hrtime; - getNanoSeconds = function() { - var hr; - hr = hrtime(); - return hr[0] * 1e9 + hr[1]; - }; - loadTime = getNanoSeconds(); - } else if (Date.now) { - module.exports = function() { - return Date.now() - loadTime; - }; - loadTime = Date.now(); - } else { - module.exports = function() { - return new Date().getTime() - loadTime; - }; - loadTime = new Date().getTime(); - } - -}).call(this); - -}).call(this,require('_process')) -},{"_process":27}],27:[function(require,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; }; - -},{}],28:[function(require,module,exports){ -'use strict'; -var strictUriEncode = require('strict-uri-encode'); -var objectAssign = require('object-assign'); - -function encode(value, opts) { - if (opts.encode) { - return opts.strict ? strictUriEncode(value) : encodeURIComponent(value); - } - - return value; -} - -exports.extract = function (str) { - return str.split('?')[1] || ''; -}; - -exports.parse = function (str) { - // Create an object with no prototype - // https://github.com/sindresorhus/query-string/issues/47 - var ret = Object.create(null); - - if (typeof str !== 'string') { - return ret; - } - - str = str.trim().replace(/^(\?|#|&)/, ''); - - if (!str) { - return ret; - } - - str.split('&').forEach(function (param) { - var parts = param.replace(/\+/g, ' ').split('='); - // Firefox (pre 40) decodes `%3D` to `=` - // https://github.com/sindresorhus/query-string/pull/37 - var key = parts.shift(); - var val = parts.length > 0 ? parts.join('=') : undefined; - - key = decodeURIComponent(key); - - // missing `=` should be `null`: - // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters - val = val === undefined ? null : decodeURIComponent(val); - - if (ret[key] === undefined) { - ret[key] = val; - } else if (Array.isArray(ret[key])) { - ret[key].push(val); - } else { - ret[key] = [ret[key], val]; - } - }); - - return ret; -}; - -exports.stringify = function (obj, opts) { - var defaults = { - encode: true, - strict: true - }; - - opts = objectAssign(defaults, opts); - - return obj ? Object.keys(obj).sort().map(function (key) { - var val = obj[key]; - - if (val === undefined) { - return ''; - } - - if (val === null) { - return encode(key, opts); - } - - if (Array.isArray(val)) { - var result = []; - - val.slice().forEach(function (val2) { - if (val2 === undefined) { - return; - } - - if (val2 === null) { - result.push(encode(key, opts)); - } else { - result.push(encode(key, opts) + '=' + encode(val2, opts)); - } - }); - - return result.join('&'); - } - - return encode(key, opts) + '=' + encode(val, opts); - }).filter(function (x) { - return x.length > 0; - }).join('&') : ''; -}; - -},{"object-assign":25,"strict-uri-encode":92}],29:[function(require,module,exports){ -(function (global){ -var now = require('performance-now') - , root = typeof window === 'undefined' ? global : window - , vendors = ['moz', 'webkit'] - , suffix = 'AnimationFrame' - , raf = root['request' + suffix] - , caf = root['cancel' + suffix] || root['cancelRequest' + suffix] - -for(var i = 0; !raf && i < vendors.length; i++) { - raf = root[vendors[i] + 'Request' + suffix] - caf = root[vendors[i] + 'Cancel' + suffix] - || root[vendors[i] + 'CancelRequest' + suffix] -} - -// Some versions of FF have rAF but not cAF -if(!raf || !caf) { - var last = 0 - , id = 0 - , queue = [] - , frameDuration = 1000 / 60 - - raf = function(callback) { - if(queue.length === 0) { - var _now = now() - , next = Math.max(0, frameDuration - (_now - last)) - last = next + _now - setTimeout(function() { - var cp = queue.slice(0) - // Clear queue here to prevent - // callbacks from appending listeners - // to the current frame's queue - queue.length = 0 - for(var i = 0; i < cp.length; i++) { - if(!cp[i].cancelled) { - try{ - cp[i].callback(last) - } catch(e) { - setTimeout(function() { throw e }, 0) - } - } - } - }, Math.round(next)) - } - queue.push({ - handle: ++id, - callback: callback, - cancelled: false - }) - return id - } - - caf = function(handle) { - for(var i = 0; i < queue.length; i++) { - if(queue[i].handle === handle) { - queue[i].cancelled = true - } - } - } -} - -module.exports = function(fn) { - // Wrap in a new function to prevent - // `cancel` potentially being assigned - // to the native rAF function - return raf.call(root, fn) -} -module.exports.cancel = function() { - caf.apply(root, arguments) -} -module.exports.polyfill = function() { - root.requestAnimationFrame = raf - root.cancelAnimationFrame = caf -} - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"performance-now":26}],30:[function(require,module,exports){ -module.exports = require('react/lib/shallowCompare'); -},{"react/lib/shallowCompare":91}],31:[function(require,module,exports){ -'use strict'; - -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 _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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _md = require('md5'); - -var _md2 = _interopRequireDefault(_md); - -var _queryString = require('query-string'); - -var _queryString2 = _interopRequireDefault(_queryString); - -var _isRetina = require('is-retina'); - -var _isRetina2 = _interopRequireDefault(_isRetina); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -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; } - -var Gravatar = function (_React$Component) { - _inherits(Gravatar, _React$Component); - - function Gravatar() { - _classCallCheck(this, Gravatar); - - return _possibleConstructorReturn(this, Object.getPrototypeOf(Gravatar).apply(this, arguments)); - } - - _createClass(Gravatar, [{ - key: 'render', - value: function render() { - var base = this.props.protocol + 'www.gravatar.com/avatar/'; - - var query = _queryString2.default.stringify({ - s: this.props.size, - r: this.props.rating, - d: this.props.default - }); - - var retinaQuery = _queryString2.default.stringify({ - s: this.props.size * 2, - r: this.props.rating, - d: this.props.default - }); - - // Gravatar service currently trims and lowercases all registered emails - var formattedEmail = ('' + this.props.email).trim().toLowerCase(); - - var hash = void 0; - if (this.props.md5) { - hash = this.props.md5; - } else if (typeof this.props.email === 'string') { - hash = (0, _md2.default)(formattedEmail); - } else { - console.warn('Gravatar image can not be fetched. Either the "email" or "md5" prop must be specified.'); - return _react2.default.createElement('script', null); - } - - var src = '' + base + hash + '?' + query; - var retinaSrc = '' + base + hash + '?' + retinaQuery; - - var modernBrowser = true; // server-side, we render for modern browsers - - if (typeof window !== 'undefined') { - // this is not NodeJS - modernBrowser = 'srcset' in document.createElement('img'); - } - - var className = 'react-gravatar'; - if (this.props.className) { - className = className + ' ' + this.props.className; - } - - // Clone this.props and then delete Component specific props so we can - // spread the rest into the img. - - var rest = _objectWithoutProperties(this.props, []); - - delete rest.md5; - delete rest.email; - delete rest.protocol; - delete rest.rating; - delete rest.size; - delete rest.style; - delete rest.className; - delete rest.default; - if (!modernBrowser && (0, _isRetina2.default)()) { - return _react2.default.createElement('img', _extends({ - alt: 'Gravatar for ' + formattedEmail, - style: this.props.style, - src: retinaSrc, - height: this.props.size, - width: this.props.size - }, rest, { - className: className - })); - } - return _react2.default.createElement('img', _extends({ - alt: 'Gravatar for ' + formattedEmail, - style: this.props.style, - src: src, - srcSet: retinaSrc + ' 2x', - height: this.props.size, - width: this.props.size - }, rest, { - className: className - })); - } - }]); - - return Gravatar; -}(_react2.default.Component); - -Gravatar.displayName = 'Gravatar'; -Gravatar.propTypes = { - email: _react2.default.PropTypes.string, - md5: _react2.default.PropTypes.string, - size: _react2.default.PropTypes.number, - rating: _react2.default.PropTypes.string, - default: _react2.default.PropTypes.string, - className: _react2.default.PropTypes.string, - protocol: _react2.default.PropTypes.string, - style: _react2.default.PropTypes.object -}; -Gravatar.defaultProps = { - size: 50, - rating: 'g', - default: 'retro', - protocol: '//' -}; - - -module.exports = Gravatar; -},{"is-retina":22,"md5":24,"query-string":28,"react":undefined}],32:[function(require,module,exports){ -module.exports = -/******/ (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__) { - - module.exports = __webpack_require__(1); - - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, '__esModule', { - value: true - }); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - - var _Highlighter = __webpack_require__(2); - - var _Highlighter2 = _interopRequireDefault(_Highlighter); - - var _utils = __webpack_require__(4); - - exports['default'] = _Highlighter2['default']; - exports.combineChunks = _utils.combineChunks; - exports.fillInChunks = _utils.fillInChunks; - exports.findAll = _utils.findAll; - exports.findChunks = _utils.findChunks; - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - 'use strict'; - - Object.defineProperty(exports, '__esModule', { - value: true - }); - exports['default'] = Highlighter; - - function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj['default'] = obj; return newObj; } } - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - - var _react = __webpack_require__(3); - - var _react2 = _interopRequireDefault(_react); - - var _utilsJs = __webpack_require__(4); - - var Chunks = _interopRequireWildcard(_utilsJs); - - Highlighter.propTypes = { - highlightClassName: _react.PropTypes.string, - highlightStyle: _react.PropTypes.object, - searchWords: _react.PropTypes.arrayOf(_react.PropTypes.string).isRequired, - textToHighlight: _react.PropTypes.string.isRequired, - sanitize: _react.PropTypes.func - }; - - /** - * Highlights all occurrences of search terms (searchText) within a string (textToHighlight). - * This function returns an array of strings and s (wrapping highlighted words). - */ - - function Highlighter(_ref) { - var _ref$highlightClassName = _ref.highlightClassName; - var highlightClassName = _ref$highlightClassName === undefined ? '' : _ref$highlightClassName; - var _ref$highlightStyle = _ref.highlightStyle; - var highlightStyle = _ref$highlightStyle === undefined ? {} : _ref$highlightStyle; - var searchWords = _ref.searchWords; - var textToHighlight = _ref.textToHighlight; - var sanitize = _ref.sanitize; - - var chunks = Chunks.findAll(textToHighlight, searchWords, sanitize); - - return _react2['default'].createElement( - 'span', - null, - chunks.map(function (chunk, index) { - var text = textToHighlight.substr(chunk.start, chunk.end - chunk.start); - - if (chunk.highlight) { - return _react2['default'].createElement( - 'mark', - { - className: highlightClassName, - key: index, - style: highlightStyle - }, - text - ); - } else { - return _react2['default'].createElement( - 'span', - { key: index }, - text - ); - } - }) - ); - } - - module.exports = exports['default']; - -/***/ }, -/* 3 */ -/***/ function(module, exports) { - - module.exports = require("react"); - -/***/ }, -/* 4 */ -/***/ function(module, exports) { - - /** - * Creates an array of chunk objects representing both higlightable and non highlightable pieces of text that match each search word. - * @param searchWords string[] - * @param textToSearch string - * @return {start:number, end:number, highlight:boolean}[] - */ - 'use strict'; - - Object.defineProperty(exports, '__esModule', { - value: true - }); - var findAll = function findAll(textToSearch, wordsToFind, sanitize) { - return fillInChunks(combineChunks(findChunks(textToSearch, wordsToFind, sanitize)), textToSearch.length); - }; - - exports.findAll = findAll; - /** - * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. - * @param chunks {start:number, end:number}[] - * @return {start:number, end:number}[] - */ - var combineChunks = function combineChunks(chunks) { - chunks = chunks.sort(function (first, second) { - return first.start - second.start; - }).reduce(function (processedChunks, nextChunk) { - // First chunk just goes straight in the array... - if (processedChunks.length === 0) { - return [nextChunk]; - } else { - // ... subsequent chunks get checked to see if they overlap... - var prevChunk = processedChunks.pop(); - if (nextChunk.start <= prevChunk.end) { - // It may be the case that prevChunk completely surrounds nextChunk, so take the - // largest of the end indeces. - var endIndex = Math.max(prevChunk.end, nextChunk.end); - processedChunks.push({ start: prevChunk.start, end: endIndex }); - } else { - processedChunks.push(prevChunk, nextChunk); - } - return processedChunks; - } - }, []); - - return chunks; - }; - - exports.combineChunks = combineChunks; - /** - * Examine textToSearch for any matches. - * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). - * @param textToSearch string - * @param wordsToFind string[] - * @param sanitize Process and optionally modify textToSearch and wordsToFind before comparison; this can be used to eg. remove accents - * @return {start:number, end:number}[] - */ - var findChunks = function findChunks(textToSearch, wordsToFind) { - var sanitize = arguments.length <= 2 || arguments[2] === undefined ? identity : arguments[2]; - return wordsToFind.filter(function (searchWord) { - return searchWord; - }) // Remove empty words - .reduce(function (chunks, searchWord) { - var normalizedWord = sanitize(searchWord); - var normalizedText = sanitize(textToSearch); - var regex = new RegExp(normalizedWord, 'gi'); - var match = undefined; - while ((match = regex.exec(normalizedText)) != null) { - chunks.push({ start: match.index, end: regex.lastIndex }); - } - return chunks; - }, []); - }; - - exports.findChunks = findChunks; - /** - * Given a set of chunks to highlight, create an additional set of chunks - * to represent the bits of text between the highlighted text. - * @param chunksToHighlight {start:number, end:number}[] - * @param totalLength number - * @return {start:number, end:number, highlight:boolean}[] - */ - var fillInChunks = function fillInChunks(chunksToHighlight, totalLength) { - var allChunks = []; - var append = function append(start, end, highlight) { - if (end - start > 0) { - allChunks.push({ start: start, end: end, highlight: highlight }); - } - }; - - if (chunksToHighlight.length === 0) { - append(0, totalLength, false); - } else { - (function () { - var lastIndex = 0; - chunksToHighlight.forEach(function (chunk) { - append(lastIndex, chunk.start, false); - append(chunk.start, chunk.end, true); - lastIndex = chunk.end; - }); - append(lastIndex, totalLength, false); - })(); - } - return allChunks; - }; - - exports.fillInChunks = fillInChunks; - function identity(value) { - return value; - } - -/***/ } -/******/ ]); - -},{"react":undefined}],33:[function(require,module,exports){ -'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 _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 _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 _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 = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _Select = require('./Select'); - -var _Select2 = _interopRequireDefault(_Select); - -var _utilsStripDiacritics = require('./utils/stripDiacritics'); - -var _utilsStripDiacritics2 = _interopRequireDefault(_utilsStripDiacritics); - -var propTypes = { - autoload: _react2['default'].PropTypes.bool.isRequired, // automatically call the `loadOptions` prop on-mount; defaults to true - cache: _react2['default'].PropTypes.any, // object to use to cache results; set to null/false to disable caching - children: _react2['default'].PropTypes.func.isRequired, // Child function responsible for creating the inner Select component; (props: Object): PropTypes.element - ignoreAccents: _react2['default'].PropTypes.bool, // strip diacritics when filtering; defaults to true - ignoreCase: _react2['default'].PropTypes.bool, // perform case-insensitive filtering; defaults to true - loadingPlaceholder: _react.PropTypes.string.isRequired, // replaces the placeholder while options are loading - loadOptions: _react2['default'].PropTypes.func.isRequired, // callback to load options asynchronously; (inputValue: string, callback: Function): ?Promise - options: _react.PropTypes.array.isRequired, // array of options - placeholder: _react2['default'].PropTypes.oneOfType([// field placeholder, displayed when there's no value (shared with Select) - _react2['default'].PropTypes.string, _react2['default'].PropTypes.node]), - searchPromptText: _react2['default'].PropTypes.oneOfType([// label to prompt for search input - _react2['default'].PropTypes.string, _react2['default'].PropTypes.node]) -}; - -var defaultProps = { - autoload: true, - cache: {}, - children: defaultChildren, - ignoreAccents: true, - ignoreCase: true, - loadingPlaceholder: 'Loading...', - options: [], - searchPromptText: 'Type to search' -}; - -var Async = (function (_Component) { - _inherits(Async, _Component); - - function Async(props, context) { - _classCallCheck(this, Async); - - _get(Object.getPrototypeOf(Async.prototype), 'constructor', this).call(this, props, context); - - this.state = { - isLoading: false, - options: props.options - }; - - this._onInputChange = this._onInputChange.bind(this); - } - - _createClass(Async, [{ - key: 'componentDidMount', - value: function componentDidMount() { - var autoload = this.props.autoload; - - if (autoload) { - this.loadOptions(''); - } - } - }, { - key: 'componentWillUpdate', - value: function componentWillUpdate(nextProps, nextState) { - var _this = this; - - var propertiesToSync = ['options']; - propertiesToSync.forEach(function (prop) { - if (_this.props[prop] !== nextProps[prop]) { - _this.setState(_defineProperty({}, prop, nextProps[prop])); - } - }); - } - }, { - key: 'loadOptions', - value: function loadOptions(inputValue) { - var _this2 = this; - - var _props = this.props; - var cache = _props.cache; - var loadOptions = _props.loadOptions; - - if (cache && cache.hasOwnProperty(inputValue)) { - this.setState({ - options: cache[inputValue] - }); - - return; - } - - var callback = function callback(error, data) { - if (callback === _this2._callback) { - _this2._callback = null; - - var options = data && data.options || []; - - if (cache) { - cache[inputValue] = options; - } - - _this2.setState({ - isLoading: false, - options: options - }); - } - }; - - // Ignore all but the most recent request - this._callback = callback; - - var promise = loadOptions(inputValue, callback); - if (promise) { - promise.then(function (data) { - return callback(null, data); - }, function (error) { - return callback(error); - }); - } - - if (this._callback && !this.state.isLoading) { - this.setState({ - isLoading: true - }); - } - - return inputValue; - } - }, { - key: '_onInputChange', - value: function _onInputChange(inputValue) { - var _props2 = this.props; - var ignoreAccents = _props2.ignoreAccents; - var ignoreCase = _props2.ignoreCase; - - if (ignoreAccents) { - inputValue = (0, _utilsStripDiacritics2['default'])(inputValue); - } - - if (ignoreCase) { - inputValue = inputValue.toLowerCase(); - } - - return this.loadOptions(inputValue); - } - }, { - key: 'render', - value: function render() { - var _props3 = this.props; - var children = _props3.children; - var loadingPlaceholder = _props3.loadingPlaceholder; - var placeholder = _props3.placeholder; - var searchPromptText = _props3.searchPromptText; - var _state = this.state; - var isLoading = _state.isLoading; - var options = _state.options; - - var props = { - noResultsText: isLoading ? loadingPlaceholder : searchPromptText, - placeholder: isLoading ? loadingPlaceholder : placeholder, - options: isLoading ? [] : options - }; - - return children(_extends({}, this.props, props, { - isLoading: isLoading, - onInputChange: this._onInputChange - })); - } - }]); - - return Async; -})(_react.Component); - -exports['default'] = Async; - -Async.propTypes = propTypes; -Async.defaultProps = defaultProps; - -function defaultChildren(props) { - return _react2['default'].createElement(_Select2['default'], props); -}; -module.exports = exports['default']; -},{"./Select":37,"./utils/stripDiacritics":42,"react":undefined}],34:[function(require,module,exports){ -'use strict'; - -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; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _Select = require('./Select'); - -var _Select2 = _interopRequireDefault(_Select); - -var AsyncCreatable = _react2['default'].createClass({ - displayName: 'AsyncCreatableSelect', - - render: function render() { - var _this = this; - - return _react2['default'].createElement( - _Select2['default'].Async, - this.props, - function (asyncProps) { - return _react2['default'].createElement( - _Select2['default'].Creatable, - _this.props, - function (creatableProps) { - return _react2['default'].createElement(_Select2['default'], _extends({}, asyncProps, creatableProps, { - onInputChange: function (input) { - creatableProps.onInputChange(input); - return asyncProps.onInputChange(input); - } - })); - } - ); - } - ); - } -}); - -module.exports = AsyncCreatable; -},{"./Select":37,"react":undefined}],35:[function(require,module,exports){ -'use strict'; - -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; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _Select = require('./Select'); - -var _Select2 = _interopRequireDefault(_Select); - -var _utilsDefaultFilterOptions = require('./utils/defaultFilterOptions'); - -var _utilsDefaultFilterOptions2 = _interopRequireDefault(_utilsDefaultFilterOptions); - -var _utilsDefaultMenuRenderer = require('./utils/defaultMenuRenderer'); - -var _utilsDefaultMenuRenderer2 = _interopRequireDefault(_utilsDefaultMenuRenderer); - -var Creatable = _react2['default'].createClass({ - displayName: 'CreatableSelect', - - propTypes: { - // Child function responsible for creating the inner Select component - // This component can be used to compose HOCs (eg Creatable and Async) - // (props: Object): PropTypes.element - children: _react2['default'].PropTypes.func, - - // See Select.propTypes.filterOptions - filterOptions: _react2['default'].PropTypes.any, - - // Searches for any matching option within the set of options. - // This function prevents duplicate options from being created. - // ({ option: Object, options: Array, labelKey: string, valueKey: string }): boolean - isOptionUnique: _react2['default'].PropTypes.func, - - // Determines if the current input text represents a valid option. - // ({ label: string }): boolean - isValidNewOption: _react2['default'].PropTypes.func, - - // See Select.propTypes.menuRenderer - menuRenderer: _react2['default'].PropTypes.any, - - // Factory to create new option. - // ({ label: string, labelKey: string, valueKey: string }): Object - newOptionCreator: _react2['default'].PropTypes.func, - - // See Select.propTypes.options - options: _react2['default'].PropTypes.array, - - // Creates prompt/placeholder option text. - // (filterText: string): string - promptTextCreator: _react2['default'].PropTypes.func, - - // Decides if a keyDown event (eg its `keyCode`) should result in the creation of a new option. - shouldKeyDownEventCreateNewOption: _react2['default'].PropTypes.func - }, - - // Default prop methods - statics: { - isOptionUnique: isOptionUnique, - isValidNewOption: isValidNewOption, - newOptionCreator: newOptionCreator, - promptTextCreator: promptTextCreator, - shouldKeyDownEventCreateNewOption: shouldKeyDownEventCreateNewOption - }, - - getDefaultProps: function getDefaultProps() { - return { - filterOptions: _utilsDefaultFilterOptions2['default'], - isOptionUnique: isOptionUnique, - isValidNewOption: isValidNewOption, - menuRenderer: _utilsDefaultMenuRenderer2['default'], - newOptionCreator: newOptionCreator, - promptTextCreator: promptTextCreator, - shouldKeyDownEventCreateNewOption: shouldKeyDownEventCreateNewOption - }; - }, - - createNewOption: function createNewOption() { - var _props = this.props; - var isValidNewOption = _props.isValidNewOption; - var newOptionCreator = _props.newOptionCreator; - var _props$options = _props.options; - var options = _props$options === undefined ? [] : _props$options; - var shouldKeyDownEventCreateNewOption = _props.shouldKeyDownEventCreateNewOption; - - if (isValidNewOption({ label: this.inputValue })) { - var option = newOptionCreator({ label: this.inputValue, labelKey: this.labelKey, valueKey: this.valueKey }); - var _isOptionUnique = this.isOptionUnique({ option: option }); - - // Don't add the same option twice. - if (_isOptionUnique) { - options.unshift(option); - - this.select.selectValue(option); - } - } - }, - - filterOptions: function filterOptions() { - var _props2 = this.props; - var filterOptions = _props2.filterOptions; - var isValidNewOption = _props2.isValidNewOption; - var options = _props2.options; - var promptTextCreator = _props2.promptTextCreator; - - // TRICKY Check currently selected options as well. - // Don't display a create-prompt for a value that's selected. - // This covers async edge-cases where a newly-created Option isn't yet in the async-loaded array. - var excludeOptions = arguments[2] || []; - - var filteredOptions = filterOptions.apply(undefined, arguments) || []; - - if (isValidNewOption({ label: this.inputValue })) { - var _newOptionCreator = this.props.newOptionCreator; - - var option = _newOptionCreator({ - label: this.inputValue, - labelKey: this.labelKey, - valueKey: this.valueKey - }); - - // TRICKY Compare to all options (not just filtered options) in case option has already been selected). - // For multi-selects, this would remove it from the filtered list. - var _isOptionUnique2 = this.isOptionUnique({ - option: option, - options: excludeOptions.concat(filteredOptions) - }); - - if (_isOptionUnique2) { - var _prompt = promptTextCreator(this.inputValue); - - this._createPlaceholderOption = _newOptionCreator({ - label: _prompt, - labelKey: this.labelKey, - valueKey: this.valueKey - }); - - filteredOptions.unshift(this._createPlaceholderOption); - } - } - - return filteredOptions; - }, - - isOptionUnique: function isOptionUnique(_ref2) { - var option = _ref2.option; - var options = _ref2.options; - var isOptionUnique = this.props.isOptionUnique; - - options = options || this.select.filterOptions(); - - return isOptionUnique({ - labelKey: this.labelKey, - option: option, - options: options, - valueKey: this.valueKey - }); - }, - - menuRenderer: function menuRenderer(params) { - var menuRenderer = this.props.menuRenderer; - - return menuRenderer(_extends({}, params, { - onSelect: this.onOptionSelect - })); - }, - - onInputChange: function onInputChange(input) { - // This value may be needed in between Select mounts (when this.select is null) - this.inputValue = input; - }, - - onInputKeyDown: function onInputKeyDown(event) { - var shouldKeyDownEventCreateNewOption = this.props.shouldKeyDownEventCreateNewOption; - - var focusedOption = this.select.getFocusedOption(); - - if (focusedOption && focusedOption === this._createPlaceholderOption && shouldKeyDownEventCreateNewOption({ keyCode: event.keyCode })) { - this.createNewOption(); - - // Prevent decorated Select from doing anything additional with this keyDown event - event.preventDefault(); - } - }, - - onOptionSelect: function onOptionSelect(option, event) { - if (option === this._createPlaceholderOption) { - this.createNewOption(); - } else { - this.select.selectValue(option); - } - }, - - render: function render() { - var _this = this; - - var _props3 = this.props; - var _props3$children = _props3.children; - var children = _props3$children === undefined ? defaultChildren : _props3$children; - var newOptionCreator = _props3.newOptionCreator; - var shouldKeyDownEventCreateNewOption = _props3.shouldKeyDownEventCreateNewOption; - - var restProps = _objectWithoutProperties(_props3, ['children', 'newOptionCreator', 'shouldKeyDownEventCreateNewOption']); - - var props = _extends({}, restProps, { - allowCreate: true, - filterOptions: this.filterOptions, - menuRenderer: this.menuRenderer, - onInputChange: this.onInputChange, - onInputKeyDown: this.onInputKeyDown, - ref: function ref(_ref) { - _this.select = _ref; - - // These values may be needed in between Select mounts (when this.select is null) - if (_ref) { - _this.labelKey = _ref.props.labelKey; - _this.valueKey = _ref.props.valueKey; - } - } - }); - - return children(props); - } -}); - -function defaultChildren(props) { - return _react2['default'].createElement(_Select2['default'], props); -}; - -function isOptionUnique(_ref3) { - var option = _ref3.option; - var options = _ref3.options; - var labelKey = _ref3.labelKey; - var valueKey = _ref3.valueKey; - - return options.filter(function (existingOption) { - return existingOption[labelKey] === option[labelKey] || existingOption[valueKey] === option[valueKey]; - }).length === 0; -}; - -function isValidNewOption(_ref4) { - var label = _ref4.label; - - return !!label; -}; - -function newOptionCreator(_ref5) { - var label = _ref5.label; - var labelKey = _ref5.labelKey; - var valueKey = _ref5.valueKey; - - var option = {}; - option[valueKey] = label; - option[labelKey] = label; - option.className = 'Select-create-option-placeholder'; - return option; -}; - -function promptTextCreator(label) { - return 'Create option "' + label + '"'; -} - -function shouldKeyDownEventCreateNewOption(_ref6) { - var keyCode = _ref6.keyCode; - - switch (keyCode) { - case 9: // TAB - case 13: // ENTER - case 188: - // COMMA - return true; - } - - return false; -}; - -module.exports = Creatable; -},{"./Select":37,"./utils/defaultFilterOptions":40,"./utils/defaultMenuRenderer":41,"react":undefined}],36:[function(require,module,exports){ -'use strict'; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var Option = _react2['default'].createClass({ - displayName: 'Option', - - propTypes: { - children: _react2['default'].PropTypes.node, - className: _react2['default'].PropTypes.string, // className (based on mouse position) - instancePrefix: _react2['default'].PropTypes.string.isRequired, // unique prefix for the ids (used for aria) - isDisabled: _react2['default'].PropTypes.bool, // the option is disabled - isFocused: _react2['default'].PropTypes.bool, // the option is focused - isSelected: _react2['default'].PropTypes.bool, // the option is selected - onFocus: _react2['default'].PropTypes.func, // method to handle mouseEnter on option element - onSelect: _react2['default'].PropTypes.func, // method to handle click on option element - onUnfocus: _react2['default'].PropTypes.func, // method to handle mouseLeave on option element - option: _react2['default'].PropTypes.object.isRequired, // object that is base for that option - optionIndex: _react2['default'].PropTypes.number }, - // index of the option, used to generate unique ids for aria - blockEvent: function blockEvent(event) { - event.preventDefault(); - event.stopPropagation(); - if (event.target.tagName !== 'A' || !('href' in event.target)) { - return; - } - if (event.target.target) { - window.open(event.target.href, event.target.target); - } else { - window.location.href = event.target.href; - } - }, - - handleMouseDown: function handleMouseDown(event) { - event.preventDefault(); - event.stopPropagation(); - this.props.onSelect(this.props.option, event); - }, - - handleMouseEnter: function handleMouseEnter(event) { - this.onFocus(event); - }, - - handleMouseMove: function handleMouseMove(event) { - this.onFocus(event); - }, - - handleTouchEnd: function handleTouchEnd(event) { - // Check if the view is being dragged, In this case - // we don't want to fire the click event (because the user only wants to scroll) - if (this.dragging) return; - - this.handleMouseDown(event); - }, - - handleTouchMove: function handleTouchMove(event) { - // Set a flag that the view is being dragged - this.dragging = true; - }, - - handleTouchStart: function handleTouchStart(event) { - // Set a flag that the view is not being dragged - this.dragging = false; - }, - - onFocus: function onFocus(event) { - if (!this.props.isFocused) { - this.props.onFocus(this.props.option, event); - } - }, - render: function render() { - var _props = this.props; - var option = _props.option; - var instancePrefix = _props.instancePrefix; - var optionIndex = _props.optionIndex; - - var className = (0, _classnames2['default'])(this.props.className, option.className); - - return option.disabled ? _react2['default'].createElement( - 'div', - { className: className, - onMouseDown: this.blockEvent, - onClick: this.blockEvent }, - this.props.children - ) : _react2['default'].createElement( - 'div', - { className: className, - style: option.style, - role: 'option', - onMouseDown: this.handleMouseDown, - onMouseEnter: this.handleMouseEnter, - onMouseMove: this.handleMouseMove, - onTouchStart: this.handleTouchStart, - onTouchMove: this.handleTouchMove, - onTouchEnd: this.handleTouchEnd, - id: instancePrefix + '-option-' + optionIndex, - title: option.title }, - this.props.children - ); - } -}); - -module.exports = Option; -},{"classnames":undefined,"react":undefined}],37:[function(require,module,exports){ -/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/react-select -*/ - -'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; }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } - -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; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactDom = require('react-dom'); - -var _reactDom2 = _interopRequireDefault(_reactDom); - -var _reactInputAutosize = require('react-input-autosize'); - -var _reactInputAutosize2 = _interopRequireDefault(_reactInputAutosize); - -var _classnames = require('classnames'); - -var _classnames2 = _interopRequireDefault(_classnames); - -var _utilsDefaultArrowRenderer = require('./utils/defaultArrowRenderer'); - -var _utilsDefaultArrowRenderer2 = _interopRequireDefault(_utilsDefaultArrowRenderer); - -var _utilsDefaultFilterOptions = require('./utils/defaultFilterOptions'); - -var _utilsDefaultFilterOptions2 = _interopRequireDefault(_utilsDefaultFilterOptions); - -var _utilsDefaultMenuRenderer = require('./utils/defaultMenuRenderer'); - -var _utilsDefaultMenuRenderer2 = _interopRequireDefault(_utilsDefaultMenuRenderer); - -var _Async = require('./Async'); - -var _Async2 = _interopRequireDefault(_Async); - -var _AsyncCreatable = require('./AsyncCreatable'); - -var _AsyncCreatable2 = _interopRequireDefault(_AsyncCreatable); - -var _Creatable = require('./Creatable'); - -var _Creatable2 = _interopRequireDefault(_Creatable); - -var _Option = require('./Option'); - -var _Option2 = _interopRequireDefault(_Option); - -var _Value = require('./Value'); - -var _Value2 = _interopRequireDefault(_Value); - -function stringifyValue(value) { - var valueType = typeof value; - if (valueType === 'string') { - return value; - } else if (valueType === 'object') { - return JSON.stringify(value); - } else if (valueType === 'number' || valueType === 'boolean') { - return String(value); - } else { - return ''; - } -} - -var stringOrNode = _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.string, _react2['default'].PropTypes.node]); - -var instanceId = 1; - -var Select = _react2['default'].createClass({ - - displayName: 'Select', - - propTypes: { - addLabelText: _react2['default'].PropTypes.string, // placeholder displayed when you want to add a label on a multi-value input - 'aria-label': _react2['default'].PropTypes.string, // Aria label (for assistive tech) - 'aria-labelledby': _react2['default'].PropTypes.string, // HTML ID of an element that should be used as the label (for assistive tech) - arrowRenderer: _react2['default'].PropTypes.func, // Create drop-down caret element - autoBlur: _react2['default'].PropTypes.bool, // automatically blur the component when an option is selected - autofocus: _react2['default'].PropTypes.bool, // autofocus the component on mount - autosize: _react2['default'].PropTypes.bool, // whether to enable autosizing or not - backspaceRemoves: _react2['default'].PropTypes.bool, // whether backspace removes an item if there is no text input - backspaceToRemoveMessage: _react2['default'].PropTypes.string, // Message to use for screenreaders to press backspace to remove the current item - {label} is replaced with the item label - className: _react2['default'].PropTypes.string, // className for the outer element - clearAllText: stringOrNode, // title for the "clear" control when multi: true - clearValueText: stringOrNode, // title for the "clear" control - clearable: _react2['default'].PropTypes.bool, // should it be possible to reset value - delimiter: _react2['default'].PropTypes.string, // delimiter to use to join multiple values for the hidden field value - disabled: _react2['default'].PropTypes.bool, // whether the Select is disabled or not - escapeClearsValue: _react2['default'].PropTypes.bool, // whether escape clears the value when the menu is closed - filterOption: _react2['default'].PropTypes.func, // method to filter a single option (option, filterString) - filterOptions: _react2['default'].PropTypes.any, // boolean to enable default filtering or function to filter the options array ([options], filterString, [values]) - ignoreAccents: _react2['default'].PropTypes.bool, // whether to strip diacritics when filtering - ignoreCase: _react2['default'].PropTypes.bool, // whether to perform case-insensitive filtering - inputProps: _react2['default'].PropTypes.object, // custom attributes for the Input - inputRenderer: _react2['default'].PropTypes.func, // returns a custom input component - instanceId: _react2['default'].PropTypes.string, // set the components instanceId - isLoading: _react2['default'].PropTypes.bool, // whether the Select is loading externally or not (such as options being loaded) - joinValues: _react2['default'].PropTypes.bool, // joins multiple values into a single form field with the delimiter (legacy mode) - labelKey: _react2['default'].PropTypes.string, // path of the label value in option objects - matchPos: _react2['default'].PropTypes.string, // (any|start) match the start or entire string when filtering - matchProp: _react2['default'].PropTypes.string, // (any|label|value) which option property to filter on - menuBuffer: _react2['default'].PropTypes.number, // optional buffer (in px) between the bottom of the viewport and the bottom of the menu - menuContainerStyle: _react2['default'].PropTypes.object, // optional style to apply to the menu container - menuRenderer: _react2['default'].PropTypes.func, // renders a custom menu with options - menuStyle: _react2['default'].PropTypes.object, // optional style to apply to the menu - multi: _react2['default'].PropTypes.bool, // multi-value input - name: _react2['default'].PropTypes.string, // generates a hidden tag with this field name for html forms - noResultsText: stringOrNode, // placeholder displayed when there are no matching search results - onBlur: _react2['default'].PropTypes.func, // onBlur handler: function (event) {} - onBlurResetsInput: _react2['default'].PropTypes.bool, // whether input is cleared on blur - onChange: _react2['default'].PropTypes.func, // onChange handler: function (newValue) {} - onClose: _react2['default'].PropTypes.func, // fires when the menu is closed - onCloseResetsInput: _react2['default'].PropTypes.bool, // whether input is cleared when menu is closed through the arrow - onFocus: _react2['default'].PropTypes.func, // onFocus handler: function (event) {} - onInputChange: _react2['default'].PropTypes.func, // onInputChange handler: function (inputValue) {} - onInputKeyDown: _react2['default'].PropTypes.func, // input keyDown handler: function (event) {} - onMenuScrollToBottom: _react2['default'].PropTypes.func, // fires when the menu is scrolled to the bottom; can be used to paginate options - onOpen: _react2['default'].PropTypes.func, // fires when the menu is opened - onValueClick: _react2['default'].PropTypes.func, // onClick handler for value labels: function (value, event) {} - openAfterFocus: _react2['default'].PropTypes.bool, // boolean to enable opening dropdown when focused - openOnFocus: _react2['default'].PropTypes.bool, // always open options menu on focus - optionClassName: _react2['default'].PropTypes.string, // additional class(es) to apply to the