react-dnd-multi-backend
Advanced tools
Comparing version 2.1.8 to 2.2.3
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDnD")):"function"==typeof define&&define.amd?define(["React","ReactDnD"],t):"object"==typeof exports?exports.ReactDnDMultiBackend=t(require("React"),require("ReactDnD")):e.ReactDnDMultiBackend=t(e.React,e.ReactDnD)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return e.getMonitor?new a.default(e):function(t){return new a.default(t,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Preview=void 0,t.default=o;var i=r(1),a=n(i),s=r(67),u=n(s);t.Preview=u.default},function(e,t,r){"use strict";function n(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")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(2),s=n(a),u=r(65),c=n(u),d={HTML5:0,TOUCH:1,MAX:2},h=function(){function e(t,r){o(this,e);var n=Object.assign({start:d.HTML5},r||{});this.current=n.start,this.backends=[],this.backends[d.HTML5]=new s.default(t),this.backends[d.TOUCH]=new c.default({enableMouseEvents:!0})(t),this.nodes={};var i=["setup","teardown","connectDragSource","connectDragPreview","connectDropTarget","previewEnabled","addEventListeners","removeEventListeners","backendSwitcher","cleanUpHandlers","applyToBackend","callBackends","restrictTouchBackend","freeTouchBackend"],a=!0,u=!1,h=void 0;try{for(var f,l=i[Symbol.iterator]();!(a=(f=l.next()).done);a=!0){var p=f.value;this[p]=this[p].bind(this)}}catch(e){u=!0,h=e}finally{try{!a&&l.return&&l.return()}finally{if(u)throw h}}}return i(e,[{key:"setup",value:function(){if("undefined"!=typeof window){if(this.constructor.isSetUp)throw new Error("Cannot have two Multi backends at the same time.");this.constructor.isSetUp=!0,this.addEventListeners(window),this.backends[this.current].setup()}}},{key:"teardown",value:function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this.removeEventListeners(window),this.backends[this.current].teardown())}},{key:"connectDragSource",value:function(){return this.callBackends("connectDragSource",arguments)}},{key:"connectDragPreview",value:function(){return this.callBackends("connectDragPreview",arguments)}},{key:"connectDropTarget",value:function(){return this.callBackends("connectDropTarget",arguments)}},{key:"previewEnabled",value:function(){return this.current===d.TOUCH}},{key:"addEventListeners",value:function(e){e.addEventListener("touchstart",this.backendSwitcher,!0)}},{key:"removeEventListeners",value:function(e){e.removeEventListener("touchstart",this.backendSwitcher,!0)}},{key:"backendSwitcher",value:function(e){var t=this.current;this.current===d.HTML5&&null!=e.touches&&(this.current=d.TOUCH,this.removeEventListeners(window)),this.current!==t&&(this.backends[t].teardown(),this.cleanUpHandlers(t),this.backends[this.current].setup(),this.current===d.TOUCH&&(this.freeTouchBackend(),this.backends[this.current].handleTopMoveStartCapture(e),this.backends[this.current].getTopMoveStartHandler()(e)))}},{key:"cleanUpHandlers",value:function(e){var t=!0,r=!1,n=void 0;try{for(var o,i=Object.keys(this.nodes)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=this.nodes[a];s.handlers[e](),s.handlers[e]=null}}catch(e){r=!0,n=e}finally{try{!t&&i.return&&i.return()}finally{if(r)throw n}}}},{key:"applyToBackend",value:function(e,t,r){var n=this.backends[e];return n[t].apply(n,r)}},{key:"callBackends",value:function(e,t){for(var r=[],n=e+"_"+t[0],o=0;o<d.MAX;++o)if(o<this.current)r.push(null);else{var i=o==d.TOUCH&&o!=this.current;i&&this.restrictTouchBackend(!0),r.push(this.applyToBackend(o,e,t)),i&&this.restrictTouchBackend(!1)}var a=this.nodes;return a[n]={func:e,args:t,handlers:r},function(){delete a[n];for(var e=0;e<r.length;++e){var t=r[e];t&&t(arguments)}}}},{key:"restrictTouchBackend",value:function(e){this.backends[d.TOUCH].listenerTypes=e?["touch"]:["touch","mouse"]}},{key:"freeTouchBackend",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,o=Object.keys(this.nodes)[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var i=n.value,a=this.nodes[i];a.handlers[d.TOUCH](),a.handlers[d.TOUCH]=this.applyToBackend(d.TOUCH,a.func,a.args)}}catch(e){t=!0,r=e}finally{try{!e&&o.return&&o.return()}finally{if(t)throw r}}}}]),e}();h.Backend=d,t.default=h},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return new s.default(e)}t.__esModule=!0,t.default=i;var a=r(3),s=o(a),u=r(64),c=o(u),d=r(63),h=n(d);t.NativeTypes=h,t.getEmptyImage=c.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var a=r(4),s=o(a),u=r(21),c=o(u),d=r(22),h=o(d),f=r(51),l=r(60),p=r(62),v=r(63),g=n(v),y=function(){function e(t){i(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 h.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,r){var n=this;return this.sourcePreviewNodeOptions[e]=r,this.sourcePreviewNodes[e]=t,function(){delete n.sourcePreviewNodes[e],delete n.sourcePreviewNodeOptions[e]}},e.prototype.connectDragSource=function(e,t,r){var n=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=r;var o=function(t){return n.handleDragStart(t,e)},i=function(t){return n.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){delete n.sourceNodes[e],delete n.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable",!1)}},e.prototype.connectDropTarget=function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}},e.prototype.getCurrentSourceNodeOptions=function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return s.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 s.default(t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})},e.prototype.getSourceClientOffset=function(e){return l.getNodeClientOffset(this.sourceNodes[e])},e.prototype.isDraggingNativeItem=function(){var e=this.monitor.getItemType();return Object.keys(g).some(function(t){return g[t]===e})},e.prototype.beginDragNativeItem=function(e){this.clearCurrentDragSourceNode();var t=p.createNativeDragSource(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),f.isFirefox()&&window.addEventListener("mousemove",this.endDragNativeItem,!0)},e.prototype.endDragNativeItem=function(){this.isDraggingNativeItem()&&(f.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=l.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=!c.default(l.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,r=this.dragStartSourceIds;this.dragStartSourceIds=null;var n=l.getEventClientOffset(e);this.actions.beginDrag(r,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});var o=e.dataTransfer,i=p.matchNativeItemType(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],u=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,h=c.anchorY,f={anchorX:d,anchorY:h},v=l.getDragPreviewOffset(s,u,n,f);o.setDragImage(u,v.x,v.y)}try{o.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(i)this.beginDragNativeItem(i);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 r=e.dataTransfer,n=p.matchNativeItemType(r);n&&this.beginDragNativeItem(n)}},e.prototype.handleDragEnter=function(e,t){this.dragEnterTargetIds.unshift(t)},e.prototype.handleTopDragEnter=function(e){var t=this,r=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){f.isFirefox()||this.actions.hover(r,{clientOffset:l.getEventClientOffset(e)});var n=r.some(function(e){return t.monitor.canDropOnTarget(e)});n&&(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,r=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(r,{clientOffset:l.getEventClientOffset(e)});var n=r.some(function(e){return t.monitor.canDropOnTarget(e)});n?(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:l.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}();t.default=y,e.exports=t.default},function(e,t,r){var n=r(5),o=r(6),i=r(14),a=r(20),s=i(function(e){return e.push(void 0,a),n(o,void 0,e)});e.exports=s},function(e,t){function r(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=r},function(e,t,r){var n=r(7),o=r(13),i=r(19),a=o(function(e,t,r,o){n(t,i(t),e,o)});e.exports=a},function(e,t,r){function n(e,t,r,n){var a=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],d=n?n(r[c],e[c],c,r,e):void 0;void 0===d&&(d=e[c]),a?i(r,c,d):o(r,c,d)}return r}var o=r(8),i=r(9);e.exports=n},function(e,t,r){function n(e,t,r){var n=e[t];s.call(e,t)&&i(n,r)&&(void 0!==r||t in e)||o(e,t,r)}var o=r(9),i=r(12),a=Object.prototype,s=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t,r){"__proto__"==t&&o?o(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var o=r(10);e.exports=n},function(e,t,r){var n=r(11),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t){function r(e,t){return null==e?void 0:e[t]}e.exports=r},function(e,t){function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},function(e,t,r){function n(e){return o(function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var u=r[n];u&&e(t,u,n,a)}return t})}var o=r(14),i=r(18);e.exports=n},function(e,t,r){function n(e,t){return a(i(e,t,o),e+"")}var o=r(15),i=r(16),a=r(17);e.exports=n},function(e,t){function r(e){return e}e.exports=r},function(e,t,r){function n(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,s=i(n.length-t,0),u=Array(s);++a<s;)u[a]=n[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=n[a];return c[t]=r(u),o(e,this,c)}}var o=r(5),i=Math.max;e.exports=n},function(e,t){function r(e){return e}e.exports=r},function(e,t){function r(){return!1}e.exports=r},function(e,t){function r(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}e.exports=r},function(e,t,r){function n(e,t,r,n){return void 0===e||o(e,i[r])&&!a.call(n,r)?t:e}var o=r(12),i=Object.prototype,a=i.hasOwnProperty;e.exports=n},function(e,t){"use strict";function r(e,t){if(e===t)return!0;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<r.length;i++){if(!o.call(t,r[i])||e[r[i]]!==t[r[i]])return!1;var a=e[r[i]],s=t[r[i]];if(a!==s)return!1}return!0}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,r){"use strict";function n(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")}t.__esModule=!0;var i=r(23),a=n(i),s=r(47),u=n(s),c=function(){function e(){o(this,e),this.entered=[]}return e.prototype.enter=function(e){var t=this.entered.length;return this.entered=a.default(this.entered.filter(function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))}),[e]),0===t&&this.entered.length>0},e.prototype.leave=function(e){var t=this.entered.length;return this.entered=u.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}();t.default=c,e.exports=t.default},function(e,t,r){var n=r(24),o=r(14),i=r(32),a=r(40),s=o(function(e){return i(n(e,1,a,!0))});e.exports=s},function(e,t,r){function n(e,t,r,a,s){var u=-1,c=e.length;for(r||(r=i),s||(s=[]);++u<c;){var d=e[u];t>0&&r(d)?t>1?n(d,t-1,r,a,s):o(s,d):a||(s[s.length]=d)}return s}var o=r(25),i=r(26);e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}e.exports=r},function(e,t,r){function n(e){return a(e)||i(e)||!!(s&&e&&e[s])}var o=r(27),i=r(30),a=r(31),s=o?o.isConcatSpreadable:void 0;e.exports=n},function(e,t,r){var n=r(28),o=n.Symbol;e.exports=o},function(e,t,r){var n=r(29),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(t,function(){return this}())},function(e,t){function r(){return!1}e.exports=r},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){function n(e,t,r){var n=-1,h=i,f=e.length,l=!0,p=[],v=p;if(r)l=!1,h=a;else if(f>=d){var g=t?null:u(e);if(g)return c(g);l=!1,h=s,v=new o}else v=t?[]:p;e:for(;++n<f;){var y=e[n],m=t?t(y):y;if(y=r||0!==y?y:0,l&&m===m){for(var T=v.length;T--;)if(v[T]===m)continue e;t&&v.push(m),p.push(y)}else h(v,m,r)||(v!==p&&v.push(m),p.push(y))}return p}var o=r(33),i=r(34),a=r(36),s=r(37),u=r(38),c=r(39),d=200;e.exports=n},function(e,t,r){function n(){if(!arguments.length)return[];var e=arguments[0];return o(e)?e:[e]}var o=r(31);e.exports=n},function(e,t,r){function n(e,t){var r=null==e?0:e.length;return!!r&&o(e,t,0)>-1}var o=r(35);e.exports=n},function(e,t){function r(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}e.exports=r},function(e,t){function r(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}e.exports=r},function(e,t,r){function n(e,t){var r=null==e?0:e.length;return!!r&&o(e,t,0)>-1}var o=r(35);e.exports=n},function(e,t){function r(){}e.exports=r},function(e,t){function r(){return[]}e.exports=r},function(e,t,r){function n(e){return i(e)&&o(e)}var o=r(41),i=r(46);e.exports=n},function(e,t,r){function n(e){return null!=e&&i(e.length)&&!o(e)}var o=r(42),i=r(45);e.exports=n},function(e,t,r){function n(e){if(!i(e))return!1;var t=o(e);return t==s||t==u||t==a||t==c}var o=r(43),i=r(44),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";e.exports=n},function(e,t){function r(e){return o.call(e)}var n=Object.prototype,o=n.toString;e.exports=r},function(e,t){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=r},function(e,t){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t){function r(e){return null!=e&&"object"==typeof e}e.exports=r},function(e,t,r){var n=r(48),o=r(14),i=r(40),a=o(function(e,t){return i(e)?n(e,t):[]});e.exports=a},function(e,t,r){function n(e,t,r,n){var h=-1,f=i,l=!0,p=e.length,v=[],g=t.length;if(!p)return v;r&&(t=s(t,u(r))),n?(f=a,l=!1):t.length>=d&&(f=c,l=!1,t=new o(t));e:for(;++h<p;){var y=e[h],m=null==r?y:r(y);if(y=n||0!==y?y:0,l&&m===m){for(var T=g;T--;)if(t[T]===m)continue e;v.push(y)}else f(t,m,n)||v.push(y)}return v}var o=r(33),i=r(34),a=r(36),s=r(49),u=r(50),c=r(37),d=200;e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}e.exports=r},function(e,t){function r(e){return function(t){return e(t)}}e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=r(52),i=n(o),a=i.default(function(){return/firefox/i.test(navigator.userAgent)});t.isFirefox=a;var s=i.default(function(){return Boolean(window.safari)});t.isSafari=s},function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(n.Cache||o),r}var o=r(53),i="Expected a function";n.Cache=o,e.exports=n},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(54),i=r(55),a=r(57),s=r(58),u=r(59);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=a,n.prototype.has=s,n.prototype.set=u,e.exports=n},function(e,t){function r(){this.__data__=[],this.size=0}e.exports=r},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():a.call(t,r,1),--this.size,!0}var o=r(56),i=Array.prototype,a=i.splice;e.exports=n},function(e,t,r){function n(e,t){for(var r=e.length;r--;)if(o(e[r][0],t))return r;return-1}var o=r(12);e.exports=n},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);return r<0?void 0:t[r][1]}var o=r(56);e.exports=n},function(e,t,r){function n(e){return o(this.__data__,e)>-1}var o=r(56);e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__,n=o(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var o=r(56);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.nodeType===d?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function i(e){return{x:e.clientX,y:e.clientY}}function a(e,t,r,n){var i="IMG"===t.nodeName&&(s.isFirefox()||!document.documentElement.contains(t)),a=i?e:t,u=o(a),d={x:r.x-u.x,y:r.y-u.y},h=e.offsetWidth,f=e.offsetHeight,l=n.anchorX,p=n.anchorY,v=i?t.width:h,g=i?t.height:f;s.isSafari()&&i?(g/=window.devicePixelRatio,v/=window.devicePixelRatio):s.isFirefox()&&!i&&(g*=window.devicePixelRatio,v*=window.devicePixelRatio);var y=new c.default([0,.5,1],[d.x,d.x/h*v,d.x+v-h]),m=new c.default([0,.5,1],[d.y,d.y/f*g,d.y+g-f]),T=y.interpolate(l),D=m.interpolate(p);return s.isSafari()&&i&&(D+=(window.devicePixelRatio-1)*g),{x:T,y:D}}t.__esModule=!0,t.getNodeClientOffset=o,t.getEventClientOffset=i,t.getDragPreviewOffset=a;var s=r(51),u=r(61),c=n(u),d=1},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}t.__esModule=!0;var n=function(){function e(t,n){r(this,e);for(var o=t.length,i=[],a=0;a<o;a++)i.push(a);i.sort(function(e,r){return t[e]<t[r]?-1:1});for(var s=[],u=[],c=[],d=void 0,h=void 0,a=0;a<o-1;a++)d=t[a+1]-t[a],h=n[a+1]-n[a],u.push(d),s.push(h),c.push(h/d);for(var f=[c[0]],a=0;a<u.length-1;a++){var l=c[a],p=c[a+1];if(l*p<=0)f.push(0);else{d=u[a];var v=u[a+1],g=d+v;f.push(3*g/((g+v)/l+(g+d)/p))}}f.push(c[c.length-1]);for(var y=[],m=[],T=void 0,a=0;a<f.length-1;a++){T=c[a];var D=f[a],b=1/u[a],g=D+f[a+1]-T-T;y.push((T-D-g)*b),m.push(g*b*b)}this.xs=t,this.ys=n,this.c1s=f,this.c2s=y,this.c3s=m}return e.prototype.interpolate=function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var s=0,u=i.length-1,c=void 0;s<=u;){c=Math.floor(.5*(s+u));var d=t[c];if(d<e)s=c+1;else{if(!(d>e))return r[c];u=c-1}}a=Math.max(0,u);var h=e-t[a],f=h*h;return r[a]+n[a]*h+o[a]*f+i[a]*h*f},e}();t.default=n,e.exports=t.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},null);return null!=n?n:r}function s(e){var t=f[e],r=t.exposeProperty,n=t.matchesTypes,a=t.getData;return function(){function e(){o(this,e),this.item=Object.defineProperties({},i({},r,{get:function(){return console.warn("Browser doesn't allow reading \""+r+'" until the drop event.'),null},configurable:!0,enumerable:!0}))}return e.prototype.mutateItemByReadingDataTransfer=function(e){delete this.item[r],this.item[r]=a(e,n)},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 u(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(f).filter(function(e){var r=f[e].matchesTypes;return r.some(function(e){return t.indexOf(e)>-1})})[0]||null}t.__esModule=!0;var c;t.createNativeDragSource=s,t.matchNativeItemType=u;var d=r(63),h=n(d),f=(c={},i(c,h.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),i(c,h.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return a(e,t,"").split("\n")}}),i(c,h.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return a(e,t,"")}}),c)},function(e,t){"use strict";t.__esModule=!0;var r="__NATIVE_FILE__";t.FILE=r;var n="__NATIVE_URL__";t.URL=n;var o="__NATIVE_TEXT__";t.TEXT=o},function(e,t){"use strict";function r(){return n||(n=new Image,n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),n}t.__esModule=!0,t.default=r;var n=void 0;e.exports=t.default},function(e,t,r){"use strict";function n(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 i(e){if(1===e.targetTouches.length)return a(e.targetTouches[0])}function a(e){return e.targetTouches?i(e):{x:e.clientX,y:e.clientY}}function s(e){var t=e.nodeType===p?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=function(t){return new g(t,e)};return e.getMonitor?t(e):t}Object.defineProperty(t,"__esModule",{value:!0}),t.TouchBackend=void 0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.default=u;var h=r(66),f=n(h),l=function(){var e=!1;try{addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){e=!0}}))}catch(e){}return e}(),p=1,v={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend"},keyboard:{keydown:"keydown"}},g=t.TouchBackend=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),r.delayTouchStart=r.delayTouchStart||r.delay,r=c({enableTouchEvents:!0,enableMouseEvents:!1,enableKeyboardEvents:!1,delayTouchStart:0,delayMouseStart:0},r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enableKeyboardEvents=r.enableKeyboardEvents,this.delayTouchStart=r.delayTouchStart,this.delayMouseStart=r.delayMouseStart,this.sourceNodes={},this.sourceNodeOptions={},this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.targetNodeOptions={},this.listenerTypes=[],this._mouseClientOffset={},r.enableMouseEvents&&this.listenerTypes.push("mouse"),r.enableTouchEvents&&this.listenerTypes.push("touch"),r.enableKeyboardEvents&&this.listenerTypes.push("keyboard"),this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopMoveStart=this.handleTopMoveStart.bind(this),this.handleTopMoveStartDelay=this.handleTopMoveStartDelay.bind(this),this.handleTopMoveStartCapture=this.handleTopMoveStartCapture.bind(this),this.handleTopMoveCapture=this.handleTopMoveCapture.bind(this),this.handleTopMove=this.handleTopMove.bind(this),this.handleTopMoveEndCapture=this.handleTopMoveEndCapture.bind(this),this.handleCancelOnEscape=this.handleCancelOnEscape.bind(this)}return d(e,[{key:"setup",value:function(){"undefined"!=typeof window&&((0,f.default)(!this.constructor.isSetUp,"Cannot have two Touch backends at the same time."),this.constructor.isSetUp=!0,this.addEventListener(window,"start",this.getTopMoveStartHandler()),this.addEventListener(window,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(window,"move",this.handleTopMove),this.addEventListener(window,"move",this.handleTopMoveCapture,!0),this.addEventListener(window,"end",this.handleTopMoveEndCapture,!0),this.enableKeyboardEvents&&this.addEventListener(window,"keydown",this.handleCancelOnEscape,!0))}},{key:"teardown",value:function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(window,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(window,"start",this.handleTopMoveStart),this.removeEventListener(window,"move",this.handleTopMoveCapture,!0), | ||
this.removeEventListener(window,"move",this.handleTopMove),this.removeEventListener(window,"end",this.handleTopMoveEndCapture,!0),this.enableKeyboardEvents&&this.removeEventListener(window,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}},{key:"addEventListener",value:function(e,t,r,n){var o=l?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(n){e.addEventListener(v[n][t],r,o)})}},{key:"removeEventListener",value:function(e,t,r,n){var o=l?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(n){e.removeEventListener(v[n][t],r,o)})}},{key:"connectDragSource",value:function(e,t,r){var n=this,o=this.handleMoveStart.bind(this,e);return this.sourceNodes[e]=t,this.addEventListener(t,"start",o),function(){delete n.sourceNodes[e],n.removeEventListener(t,"start",o)}}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions[e]=r,this.sourcePreviewNodes[e]=t,function(){delete n.sourcePreviewNodes[e],delete n.sourcePreviewNodeOptions[e]}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(n){var o=void 0;switch(n.type){case v.mouse.move:o={x:n.clientX,y:n.clientY};break;case v.touch.move:o={x:n.touches[0].clientX,y:n.touches[0].clientY}}var i=document.elementFromPoint(o.x,o.y),a=t.contains(i);if(i===t||a)return r.handleMove(n,e)};return this.addEventListener(document.querySelector("body"),"move",n),function(){r.removeEventListener(document.querySelector("body"),"move",n)}}},{key:"getSourceClientOffset",value:function(e){return s(this.sourceNodes[e])}},{key:"handleTopMoveStartCapture",value:function(e){this.moveStartSourceIds=[]}},{key:"handleMoveStart",value:function(e){this.moveStartSourceIds.unshift(e)}},{key:"getTopMoveStartHandler",value:function(){return this.delayTouchStart||this.delayMouseStart?this.handleTopMoveStartDelay:this.handleTopMoveStart}},{key:"handleTopMoveStart",value:function(e){var t=a(e);t&&(this._mouseClientOffset=t)}},{key:"handleTopMoveStartDelay",value:function(e){var t=e.type===v.touch.start?this.delayTouchStart:this.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,e),t)}},{key:"handleTopMoveCapture",value:function(e){this.dragOverTargetIds=[]}},{key:"handleMove",value:function(e,t){this.dragOverTargetIds.unshift(t)}},{key:"handleTopMove",value:function(e){clearTimeout(this.timeout);var t=this.moveStartSourceIds,r=this.dragOverTargetIds,n=a(e);if(n&&(this.monitor.isDragging()||!this._mouseClientOffset.hasOwnProperty("x")||!t||this._mouseClientOffset.x===n.x&&this._mouseClientOffset.y===n.y||(this.moveStartSourceIds=null,this.actions.beginDrag(t,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),this.monitor.isDragging())){var o=this.sourceNodes[this.monitor.getSourceId()];this.installSourceNodeRemovalObserver(o),this.actions.publishDragSource(),e.preventDefault(),this.actions.hover(r,{clientOffset:n})}}},{key:"handleTopMoveEndCapture",value:function(e){return!this.monitor.isDragging()||this.monitor.didDrop()?void(this.moveStartSourceIds=null):(e.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),void this.actions.endDrag())}},{key:"handleCancelOnEscape",value:function(e){"Escape"===e.key&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())}},{key:"installSourceNodeRemovalObserver",value:function(e){var t=this;this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new window.MutationObserver(function(){e.parentElement||(t.resurrectSourceNode(),t.uninstallSourceNodeRemovalObserver())}),e&&e.parentElement&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}},{key:"resurrectSourceNode",value:function(){this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),document.body.appendChild(this.draggedSourceNode)}},{key:"uninstallSourceNodeRemovalObserver",value:function(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=null,this.draggedSourceNode=null}}]),e}()},function(e,t,r){"use strict";var n=function(e,t,r,n,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,o,i,a,s],d=0;u=new Error(t.replace(/%s/g,function(){return c[d++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,s,u,c,d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),h=r(68),f=r(69),l=(a=(0,f.DragLayer)(function(e){return{currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging(),itemType:e.getItemType(),item:e.getItem()}}),a((c=u=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),d(t,[{key:"getStyle",value:function(){var e="translate("+this.props.currentOffset.x+"px, "+this.props.currentOffset.y+"px)";return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:e,WebkitTransform:e}}},{key:"render",value:function(){return this.context.dragDropManager.getBackend().previewEnabled()&&this.props.isDragging&&null!==this.props.currentOffset?this.props.generator(this.props.type,this.props.item,this.getStyle()):null}}]),t}(h.Component),u.defaultProps={currentOffset:{x:0,y:0},isDragging:!1,itemType:"",item:""},u.propTypes={currentOffset:h.PropTypes.shape({x:h.PropTypes.number,y:h.PropTypes.number}),isDragging:h.PropTypes.bool,itemType:h.PropTypes.string,item:h.PropTypes.object,generator:h.PropTypes.func.isRequired},u.contextTypes={dragDropManager:h.PropTypes.object},s=c))||s);t.default=l},function(t,r){t.exports=e},function(e,r){e.exports=t}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDnD")):"function"==typeof define&&define.amd?define(["React","ReactDnD"],t):"object"==typeof exports?exports.ReactDnDMultiBackend=t(require("React"),require("ReactDnD")):e.ReactDnDMultiBackend=t(e.React,e.ReactDnD)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){return e.getMonitor?new a.default(e):function(t){return new a.default(t,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Preview=void 0,t.default=o;var i=r(1),a=n(i),s=r(67),u=n(s);t.Preview=u.default},function(e,t,r){"use strict";function n(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")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(2),s=n(a),u=r(65),c=n(u),d={HTML5:0,TOUCH:1,MAX:2},l=function(){function e(t,r){o(this,e);var n=Object.assign({start:d.HTML5},r||{});this.current=n.start,this.backends=[],this.backends[d.HTML5]=new s.default(t),this.backends[d.TOUCH]=new c.default({enableMouseEvents:!0})(t),this.nodes={};var i=["setup","teardown","connectDragSource","connectDragPreview","connectDropTarget","previewEnabled","addEventListeners","removeEventListeners","backendSwitcher","cleanUpHandlers","applyToBackend","callBackends","restrictTouchBackend","freeTouchBackend"],a=!0,u=!1,l=void 0;try{for(var f,h=i[Symbol.iterator]();!(a=(f=h.next()).done);a=!0){var v=f.value;this[v]=this[v].bind(this)}}catch(e){u=!0,l=e}finally{try{!a&&h.return&&h.return()}finally{if(u)throw l}}}return i(e,[{key:"setup",value:function(){if("undefined"!=typeof window){if(this.constructor.isSetUp)throw new Error("Cannot have two Multi backends at the same time.");this.constructor.isSetUp=!0,this.addEventListeners(window),this.backends[this.current].setup()}}},{key:"teardown",value:function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this.removeEventListeners(window),this.backends[this.current].teardown())}},{key:"connectDragSource",value:function(){return this.callBackends("connectDragSource",arguments)}},{key:"connectDragPreview",value:function(){return this.callBackends("connectDragPreview",arguments)}},{key:"connectDropTarget",value:function(){return this.callBackends("connectDropTarget",arguments)}},{key:"previewEnabled",value:function(){return this.current===d.TOUCH}},{key:"addEventListeners",value:function(e){e.addEventListener("touchstart",this.backendSwitcher,!0)}},{key:"removeEventListeners",value:function(e){e.removeEventListener("touchstart",this.backendSwitcher,!0)}},{key:"backendSwitcher",value:function(e){var t=this.current;this.current===d.HTML5&&null!=e.touches&&(this.current=d.TOUCH,this.removeEventListeners(window)),this.current!==t&&(this.backends[t].teardown(),this.cleanUpHandlers(t),this.backends[this.current].setup(),this.current===d.TOUCH&&(this.freeTouchBackend(),this.backends[this.current].handleTopMoveStartCapture(e),this.backends[this.current].getTopMoveStartHandler()(e)))}},{key:"cleanUpHandlers",value:function(e){var t=!0,r=!1,n=void 0;try{for(var o,i=Object.keys(this.nodes)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=this.nodes[a];s.handlers[e](),s.handlers[e]=null}}catch(e){r=!0,n=e}finally{try{!t&&i.return&&i.return()}finally{if(r)throw n}}}},{key:"applyToBackend",value:function(e,t,r){var n=this.backends[e];return n[t].apply(n,r)}},{key:"callBackends",value:function(e,t){for(var r=[],n=e+"_"+t[0],o=0;o<d.MAX;++o)if(o<this.current)r.push(null);else{var i=o==d.TOUCH&&o!=this.current;i&&this.restrictTouchBackend(!0),r.push(this.applyToBackend(o,e,t)),i&&this.restrictTouchBackend(!1)}var a=this.nodes;return a[n]={func:e,args:t,handlers:r},function(){delete a[n];for(var e=0;e<r.length;++e){var t=r[e];t&&t(arguments)}}}},{key:"restrictTouchBackend",value:function(e){this.backends[d.TOUCH].listenerTypes=e?["touch"]:["touch","mouse"]}},{key:"freeTouchBackend",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,o=Object.keys(this.nodes)[Symbol.iterator]();!(e=(n=o.next()).done);e=!0){var i=n.value,a=this.nodes[i];a.handlers[d.TOUCH](),a.handlers[d.TOUCH]=this.applyToBackend(d.TOUCH,a.func,a.args)}}catch(e){t=!0,r=e}finally{try{!e&&o.return&&o.return()}finally{if(t)throw r}}}}]),e}();l.Backend=d,t.default=l},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e){return new s.default(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getEmptyImage=t.NativeTypes=void 0,t.default=i;var a=r(3),s=o(a),u=r(64),c=o(u),d=r(63),l=n(d);t.NativeTypes=l,t.getEmptyImage=c.default},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(4),u=o(s),c=r(21),d=o(c),l=r(22),f=o(l),h=r(51),v=r(60),p=r(62),g=r(63),y=n(g),m=function(){function e(t){i(this,e),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.context=t.getContext(),this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.sourceNodes={},this.sourceNodeOptions={},this.enterLeaveCounter=new f.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 a(e,[{key:"setup",value:function(){if(void 0!==this.window){if(this.window.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");this.window.__isReactDndBackendSetUp=!0,this.addEventListeners(this.window)}}},{key:"teardown",value:function(){void 0!==this.window&&(this.window.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.window),this.clearCurrentDragSourceNode())}},{key:"addEventListeners",value: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)}},{key:"removeEventListeners",value: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)}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions[e]=r,this.sourcePreviewNodes[e]=t,function(){delete n.sourcePreviewNodes[e],delete n.sourcePreviewNodeOptions[e]}}},{key:"connectDragSource",value:function(e,t,r){var n=this;this.sourceNodes[e]=t,this.sourceNodeOptions[e]=r;var o=function(t){return n.handleDragStart(t,e)},i=function(t){return n.handleSelectStart(t,e)};return t.setAttribute("draggable",!0),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){delete n.sourceNodes[e],delete n.sourceNodeOptions[e],t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable",!1)}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(t){return r.handleDragEnter(t,e)},o=function(t){return r.handleDragOver(t,e)},i=function(t){return r.handleDrop(t,e)};return t.addEventListener("dragenter",n),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",n),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions[e];return(0,u.default)(t||{},{dropEffect:"move"})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourcePreviewNodeOptions[e];return(0,u.default)(t||{},{anchorX:.5,anchorY:.5,captureDraggingState:!1})}},{key:"getSourceClientOffset",value:function(e){return(0,v.getNodeClientOffset)(this.sourceNodes[e])}},{key:"isDraggingNativeItem",value:function(){var e=this.monitor.getItemType();return Object.keys(y).some(function(t){return y[t]===e})}},{key:"beginDragNativeItem",value:function(e){this.clearCurrentDragSourceNode();var t=(0,p.createNativeDragSource)(e);this.currentNativeSource=new t,this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle]),(0,h.isFirefox)()&&this.window.addEventListener("mousemove",this.endDragNativeItem,!0)}},{key:"endDragNativeItem",value:function(){this.isDraggingNativeItem()&&((0,h.isFirefox)()&&this.window.removeEventListener("mousemove",this.endDragNativeItem,!0),this.actions.endDrag(),this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)}},{key:"endDragIfSourceWasRemovedFromDOM",value:function(){var e=this.currentDragSourceNode;document.body.contains(e)||this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"setCurrentDragSourceNode",value:function(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.currentDragSourceNodeOffset=(0,v.getNodeClientOffset)(e),this.currentDragSourceNodeOffsetChanged=!1,this.window.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}},{key:"clearCurrentDragSourceNode",value:function(){return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.currentDragSourceNodeOffset=null,this.currentDragSourceNodeOffsetChanged=!1,this.window.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0),!0)}},{key:"checkIfCurrentDragSourceRectChanged",value:function(){var e=this.currentDragSourceNode;return!!e&&(!!this.currentDragSourceNodeOffsetChanged||(this.currentDragSourceNodeOffsetChanged=!(0,d.default)((0,v.getNodeClientOffset)(e),this.currentDragSourceNodeOffset),this.currentDragSourceNodeOffsetChanged))}},{key:"handleTopDragStartCapture",value:function(){this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]}},{key:"handleDragStart",value:function(e,t){this.dragStartSourceIds.unshift(t)}},{key:"handleTopDragStart",value:function(e){var t=this,r=this.dragStartSourceIds;this.dragStartSourceIds=null;var n=(0,v.getEventClientOffset)(e);this.actions.beginDrag(r,{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});var o=e.dataTransfer,i=(0,p.matchNativeItemType)(o);if(this.monitor.isDragging()){if("function"==typeof o.setDragImage){var a=this.monitor.getSourceId(),s=this.sourceNodes[a],u=this.sourcePreviewNodes[a]||s,c=this.getCurrentSourcePreviewNodeOptions(),d=c.anchorX,l=c.anchorY,f={anchorX:d,anchorY:l},h=(0,v.getDragPreviewOffset)(s,u,n,f);o.setDragImage(u,h.x,h.y)}try{o.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);var g=this.getCurrentSourcePreviewNodeOptions(),y=g.captureDraggingState;y?this.actions.publishDragSource():setTimeout(function(){return t.actions.publishDragSource()})}else if(i)this.beginDragNativeItem(i);else{if(!(o.types||e.target.hasAttribute&&e.target.hasAttribute("draggable")))return;e.preventDefault()}}},{key:"handleTopDragEndCapture",value:function(){this.clearCurrentDragSourceNode()&&this.actions.endDrag()}},{key:"handleTopDragEnterCapture",value:function(e){this.dragEnterTargetIds=[];var t=this.enterLeaveCounter.enter(e.target);if(t&&!this.monitor.isDragging()){var r=e.dataTransfer,n=(0,p.matchNativeItemType)(r);n&&this.beginDragNativeItem(n)}}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleTopDragEnter",value:function(e){var t=this,r=this.dragEnterTargetIds;if(this.dragEnterTargetIds=[],this.monitor.isDragging()){(0,h.isFirefox)()||this.actions.hover(r,{clientOffset:(0,v.getEventClientOffset)(e)});var n=r.some(function(e){return t.monitor.canDropOnTarget(e)});n&&(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect())}}},{key:"handleTopDragOverCapture",value:function(){this.dragOverTargetIds=[]}},{key:"handleDragOver",value:function(e,t){this.dragOverTargetIds.unshift(t)}},{key:"handleTopDragOver",value:function(e){var t=this,r=this.dragOverTargetIds;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer.dropEffect="none");this.actions.hover(r,{clientOffset:(0,v.getEventClientOffset)(e)});var n=r.some(function(e){return t.monitor.canDropOnTarget(e)});n?(e.preventDefault(),e.dataTransfer.dropEffect=this.getCurrentDropEffect()):this.isDraggingNativeItem()?(e.preventDefault(),e.dataTransfer.dropEffect="none"):this.checkIfCurrentDragSourceRectChanged()&&(e.preventDefault(),e.dataTransfer.dropEffect="move")}},{key:"handleTopDragLeaveCapture",value:function(e){this.isDraggingNativeItem()&&e.preventDefault();var t=this.enterLeaveCounter.leave(e.target);t&&this.isDraggingNativeItem()&&this.endDragNativeItem()}},{key:"handleTopDropCapture",value:function(e){this.dropTargetIds=[],e.preventDefault(),this.isDraggingNativeItem()&&this.currentNativeSource.mutateItemByReadingDataTransfer(e.dataTransfer),this.enterLeaveCounter.reset()}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}},{key:"handleTopDrop",value:function(e){var t=this.dropTargetIds;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:(0,v.getEventClientOffset)(e)}),this.actions.drop(),this.isDraggingNativeItem()?this.endDragNativeItem():this.endDragIfSourceWasRemovedFromDOM()}},{key:"handleSelectStart",value: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()))}},{key:"window",get:function(){return this.context&&this.context.window?this.context.window:"undefined"!=typeof window?window:void 0}}]),e}();t.default=m},function(e,t,r){var n=r(5),o=r(6),i=r(8),a=r(15),s=a(function(e){return e.push(void 0,o),n(i,void 0,e)});e.exports=s},function(e,t){function r(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}e.exports=r},function(e,t,r){function n(e,t,r,n){return void 0===e||o(e,i[r])&&!a.call(n,r)?t:e}var o=r(7),i=Object.prototype,a=i.hasOwnProperty;e.exports=n},function(e,t){function r(e,t){return e===t||e!==e&&t!==t}e.exports=r},function(e,t,r){var n=r(9),o=r(14),i=r(20),a=o(function(e,t,r,o){n(t,i(t),e,o)});e.exports=a},function(e,t,r){function n(e,t,r,n){var a=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],d=n?n(r[c],e[c],c,r,e):void 0;void 0===d&&(d=e[c]),a?i(r,c,d):o(r,c,d)}return r}var o=r(10),i=r(11);e.exports=n},function(e,t,r){function n(e,t,r){var n=e[t];s.call(e,t)&&i(n,r)&&(void 0!==r||t in e)||o(e,t,r)}var o=r(11),i=r(7),a=Object.prototype,s=a.hasOwnProperty;e.exports=n},function(e,t,r){function n(e,t,r){"__proto__"==t&&o?o(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var o=r(12);e.exports=n},function(e,t,r){var n=r(13),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},function(e,t){function r(e,t){return null==e?void 0:e[t]}e.exports=r},function(e,t,r){function n(e){return o(function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var u=r[n];u&&e(t,u,n,a)}return t})}var o=r(15),i=r(19);e.exports=n},function(e,t,r){function n(e,t){return a(i(e,t,o),e+"")}var o=r(16),i=r(17),a=r(18);e.exports=n},function(e,t){function r(e){return e}e.exports=r},function(e,t,r){function n(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var n=arguments,a=-1,s=i(n.length-t,0),u=Array(s);++a<s;)u[a]=n[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=n[a];return c[t]=r(u),o(e,this,c)}}var o=r(5),i=Math.max;e.exports=n},function(e,t){function r(e){return e}e.exports=r},function(e,t){function r(){return!1}e.exports=r},function(e,t){function r(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}e.exports=r},function(e,t){"use strict";function r(e,t){if(e===t)return!0;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(var o=Object.prototype.hasOwnProperty,i=0;i<r.length;i+=1){if(!o.call(t,r[i])||e[r[i]]!==t[r[i]])return!1;var a=e[r[i]],s=t[r[i]];if(a!==s)return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},function(e,t,r){"use strict";function n(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")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(23),s=n(a),u=r(47),c=n(u),d=function(){function e(){o(this,e),this.entered=[]}return i(e,[{key:"enter",value:function(e){var t=this.entered.length,r=function(t){return document.documentElement.contains(t)&&(!t.contains||t.contains(e))};return this.entered=(0,s.default)(this.entered.filter(r),[e]),0===t&&this.entered.length>0}},{key:"leave",value:function(e){var t=this.entered.length;return this.entered=(0,c.default)(this.entered.filter(function(e){return document.documentElement.contains(e)}),e),t>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}]),e}();t.default=d},function(e,t,r){var n=r(24),o=r(15),i=r(32),a=r(40),s=o(function(e){return i(n(e,1,a,!0))});e.exports=s},function(e,t,r){function n(e,t,r,a,s){var u=-1,c=e.length;for(r||(r=i),s||(s=[]);++u<c;){var d=e[u];t>0&&r(d)?t>1?n(d,t-1,r,a,s):o(s,d):a||(s[s.length]=d)}return s}var o=r(25),i=r(26);e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}e.exports=r},function(e,t,r){function n(e){return a(e)||i(e)||!!(s&&e&&e[s])}var o=r(27),i=r(30),a=r(31),s=o?o.isConcatSpreadable:void 0;e.exports=n},function(e,t,r){var n=r(28),o=n.Symbol;e.exports=o},function(e,t,r){var n=r(29),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},function(e,t){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(t,function(){return this}())},function(e,t){function r(){return!1}e.exports=r},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){function n(e,t,r){var n=-1,l=i,f=e.length,h=!0,v=[],p=v;if(r)h=!1,l=a;else if(f>=d){var g=t?null:u(e);if(g)return c(g);h=!1,l=s,p=new o}else p=t?[]:v;e:for(;++n<f;){var y=e[n],m=t?t(y):y;if(y=r||0!==y?y:0,h&&m===m){for(var b=p.length;b--;)if(p[b]===m)continue e;t&&p.push(m),v.push(y)}else l(p,m,r)||(p!==v&&p.push(m),v.push(y))}return v}var o=r(33),i=r(34),a=r(36),s=r(37),u=r(38),c=r(39),d=200;e.exports=n},function(e,t,r){function n(){if(!arguments.length)return[];var e=arguments[0];return o(e)?e:[e]}var o=r(31);e.exports=n},function(e,t,r){function n(e,t){var r=null==e?0:e.length;return!!r&&o(e,t,0)>-1}var o=r(35);e.exports=n},function(e,t){function r(e,t,r){for(var n=r-1,o=e.length;++n<o;)if(e[n]===t)return n;return-1}e.exports=r},function(e,t){function r(e,t,r){for(var n=-1,o=null==e?0:e.length;++n<o;)if(r(t,e[n]))return!0;return!1}e.exports=r},function(e,t,r){function n(e,t){var r=null==e?0:e.length;return!!r&&o(e,t,0)>-1}var o=r(35);e.exports=n},function(e,t){function r(){}e.exports=r},function(e,t){function r(){return[]}e.exports=r},function(e,t,r){function n(e){return i(e)&&o(e)}var o=r(41),i=r(46);e.exports=n},function(e,t,r){function n(e){return null!=e&&i(e.length)&&!o(e)}var o=r(42),i=r(45);e.exports=n},function(e,t,r){function n(e){if(!i(e))return!1;var t=o(e);return t==s||t==u||t==a||t==c}var o=r(43),i=r(44),a="[object AsyncFunction]",s="[object Function]",u="[object GeneratorFunction]",c="[object Proxy]";e.exports=n},function(e,t){function r(e){return o.call(e)}var n=Object.prototype,o=n.toString;e.exports=r},function(e,t){function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}e.exports=r},function(e,t){function r(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}var n=9007199254740991;e.exports=r},function(e,t){function r(e){return null!=e&&"object"==typeof e}e.exports=r},function(e,t,r){var n=r(48),o=r(15),i=r(40),a=o(function(e,t){return i(e)?n(e,t):[]});e.exports=a},function(e,t,r){function n(e,t,r,n){var l=-1,f=i,h=!0,v=e.length,p=[],g=t.length;if(!v)return p;r&&(t=s(t,u(r))),n?(f=a,h=!1):t.length>=d&&(f=c,h=!1,t=new o(t));e:for(;++l<v;){var y=e[l],m=null==r?y:r(y);if(y=n||0!==y?y:0,h&&m===m){for(var b=g;b--;)if(t[b]===m)continue e;p.push(y)}else f(t,m,n)||p.push(y)}return p}var o=r(33),i=r(34),a=r(36),s=r(49),u=r(50),c=r(37),d=200;e.exports=n},function(e,t){function r(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}e.exports=r},function(e,t){function r(e){return function(t){return e(t)}}e.exports=r},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.isSafari=t.isFirefox=void 0;var o=r(52),i=n(o);t.isFirefox=(0,i.default)(function(){return/firefox/i.test(navigator.userAgent)}),t.isSafari=(0,i.default)(function(){return Boolean(window.safari)})},function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(i);var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(n.Cache||o),r}var o=r(53),i="Expected a function";n.Cache=o,e.exports=n},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var o=r(54),i=r(55),a=r(57),s=r(58),u=r(59);n.prototype.clear=o,n.prototype.delete=i,n.prototype.get=a,n.prototype.has=s,n.prototype.set=u,e.exports=n},function(e,t){function r(){this.__data__=[],this.size=0}e.exports=r},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():a.call(t,r,1),--this.size,!0}var o=r(56),i=Array.prototype,a=i.splice;e.exports=n},function(e,t,r){function n(e,t){for(var r=e.length;r--;)if(o(e[r][0],t))return r;return-1}var o=r(7);e.exports=n},function(e,t,r){function n(e){var t=this.__data__,r=o(t,e);return r<0?void 0:t[r][1]}var o=r(56);e.exports=n},function(e,t,r){function n(e){return o(this.__data__,e)>-1}var o=r(56);e.exports=n},function(e,t,r){function n(e,t){var r=this.__data__,n=o(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var o=r(56);e.exports=n},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.nodeType===d?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function i(e){return{x:e.clientX,y:e.clientY}}function a(e,t,r,n){var i="IMG"===t.nodeName&&((0,s.isFirefox)()||!document.documentElement.contains(t)),a=i?e:t,u=o(a),d={x:r.x-u.x,y:r.y-u.y},l=e.offsetWidth,f=e.offsetHeight,h=n.anchorX,v=n.anchorY,p=i?t.width:l,g=i?t.height:f;(0,s.isSafari)()&&i?(g/=window.devicePixelRatio,p/=window.devicePixelRatio):(0,s.isFirefox)()&&!i&&(g*=window.devicePixelRatio,p*=window.devicePixelRatio);var y=new c.default([0,.5,1],[d.x,d.x/l*p,d.x+p-l]),m=new c.default([0,.5,1],[d.y,d.y/f*g,d.y+g-f]),b=y.interpolate(h),T=m.interpolate(v);return(0,s.isSafari)()&&i&&(T+=(window.devicePixelRatio-1)*g),{x:b,y:T}}Object.defineProperty(t,"__esModule",{value:!0}),t.getNodeClientOffset=o,t.getEventClientOffset=i,t.getDragPreviewOffset=a;var s=r(51),u=r(61),c=n(u),d=1},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(t,n){r(this,e);for(var o=t.length,i=[],a=0;a<o;a++)i.push(a);i.sort(function(e,r){return t[e]<t[r]?-1:1});for(var s=[],u=[],c=[],d=void 0,l=void 0,f=0;f<o-1;f++)d=t[f+1]-t[f],l=n[f+1]-n[f],u.push(d),s.push(l),c.push(l/d);for(var h=[c[0]],v=0;v<u.length-1;v++){var p=c[v],g=c[v+1];if(p*g<=0)h.push(0);else{d=u[v];var y=u[v+1],m=d+y;h.push(3*m/((m+y)/p+(m+d)/g))}}h.push(c[c.length-1]);for(var b=[],T=[],D=void 0,w=0;w<h.length-1;w++){D=c[w];var S=h[w],O=1/u[w],E=S+h[w+1]-D-D;b.push((D-S-E)*O),T.push(E*O*O)}this.xs=t,this.ys=n,this.c1s=h,this.c2s=b,this.c3s=T}return n(e,[{key:"interpolate",value:function(e){var t=this.xs,r=this.ys,n=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return r[a];for(var s=0,u=i.length-1,c=void 0;s<=u;){c=Math.floor(.5*(s+u));var d=t[c];if(d<e)s=c+1;else{if(!(d>e))return r[c];u=c-1}}a=Math.max(0,u);var l=e-t[a],f=l*l;return r[a]+n[a]*l+o[a]*f+i[a]*l*f}}]),e}();t.default=o},function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function o(e,t){for(var r in t){var n=t[r];n.configurable=n.enumerable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,r,n)}return e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t,r){var n=t.reduce(function(t,r){return t||e.getData(r)},null);return null!=n?n:r}function u(e){var t=v[e],r=t.exposeProperty,n=t.matchesTypes,a=t.getData;return function(){function e(){var t,n;i(this,e),this.item=(t={},n={},n[r]=n[r]||{},n[r].get=function(){return console.warn("Browser doesn't allow reading \""+r+'" until the drop event.'),null},o(t,n),t)}return l(e,[{key:"mutateItemByReadingDataTransfer",value:function(e){delete this.item[r],this.item[r]=a(e,n)}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}]),e}()}function c(e){var t=Array.prototype.slice.call(e.types||[]);return Object.keys(v).filter(function(e){var r=v[e].matchesTypes;return r.some(function(e){return t.indexOf(e)>-1})})[0]||null}Object.defineProperty(t,"__esModule",{value:!0});var d,l=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.createNativeDragSource=u,t.matchNativeItemType=c;var f=r(63),h=n(f),v=(d={},a(d,h.FILE,{exposeProperty:"files",matchesTypes:["Files"],getData:function(e){return Array.prototype.slice.call(e.files)}}),a(d,h.URL,{exposeProperty:"urls",matchesTypes:["Url","text/uri-list"],getData:function(e,t){return s(e,t,"").split("\n")}}),a(d,h.TEXT,{exposeProperty:"text",matchesTypes:["Text","text/plain"],getData:function(e,t){return s(e,t,"")}}),d)},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FILE="__NATIVE_FILE__",t.URL="__NATIVE_URL__",t.TEXT="__NATIVE_TEXT__"},function(e,t){"use strict";function r(){return n||(n=new Image,n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var n=void 0},function(e,t,r){"use strict";function n(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 i(e){if(1===e.targetTouches.length)return a(e.targetTouches[0])}function a(e){return e.targetTouches?i(e):{x:e.clientX,y:e.clientY}}function s(e){var t=e.nodeType===v?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,o=r.left;return{x:o,y:n}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=function(t){return new g(t,e)};return e.getMonitor?t(e):t}Object.defineProperty(t,"__esModule",{value:!0}),t.TouchBackend=void 0;var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();t.default=u;var l=r(66),f=n(l),h=function(){var e=!1;try{addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){e=!0}}))}catch(e){}return e}(),v=1,p={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend"},keyboard:{keydown:"keydown"}},g=t.TouchBackend=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),r.delayTouchStart=r.delayTouchStart||r.delay,r=c({enableTouchEvents:!0,enableMouseEvents:!1,enableKeyboardEvents:!1,delayTouchStart:0,delayMouseStart:0},r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enableKeyboardEvents=r.enableKeyboardEvents,this.delayTouchStart=r.delayTouchStart,this.delayMouseStart=r.delayMouseStart, | ||
this.sourceNodes={},this.sourceNodeOptions={},this.sourcePreviewNodes={},this.sourcePreviewNodeOptions={},this.targetNodeOptions={},this.listenerTypes=[],this._mouseClientOffset={},r.enableMouseEvents&&this.listenerTypes.push("mouse"),r.enableTouchEvents&&this.listenerTypes.push("touch"),r.enableKeyboardEvents&&this.listenerTypes.push("keyboard"),this.getSourceClientOffset=this.getSourceClientOffset.bind(this),this.handleTopMoveStart=this.handleTopMoveStart.bind(this),this.handleTopMoveStartDelay=this.handleTopMoveStartDelay.bind(this),this.handleTopMoveStartCapture=this.handleTopMoveStartCapture.bind(this),this.handleTopMoveCapture=this.handleTopMoveCapture.bind(this),this.handleTopMove=this.handleTopMove.bind(this),this.handleTopMoveEndCapture=this.handleTopMoveEndCapture.bind(this),this.handleCancelOnEscape=this.handleCancelOnEscape.bind(this)}return d(e,[{key:"setup",value:function(){"undefined"!=typeof window&&((0,f.default)(!this.constructor.isSetUp,"Cannot have two Touch backends at the same time."),this.constructor.isSetUp=!0,this.addEventListener(window,"start",this.getTopMoveStartHandler()),this.addEventListener(window,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(window,"move",this.handleTopMove),this.addEventListener(window,"move",this.handleTopMoveCapture,!0),this.addEventListener(window,"end",this.handleTopMoveEndCapture,!0),this.enableKeyboardEvents&&this.addEventListener(window,"keydown",this.handleCancelOnEscape,!0))}},{key:"teardown",value:function(){"undefined"!=typeof window&&(this.constructor.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(window,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(window,"start",this.handleTopMoveStart),this.removeEventListener(window,"move",this.handleTopMoveCapture,!0),this.removeEventListener(window,"move",this.handleTopMove),this.removeEventListener(window,"end",this.handleTopMoveEndCapture,!0),this.enableKeyboardEvents&&this.removeEventListener(window,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}},{key:"addEventListener",value:function(e,t,r,n){var o=h?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(n){e.addEventListener(p[n][t],r,o)})}},{key:"removeEventListener",value:function(e,t,r,n){var o=h?{capture:n,passive:!1}:n;this.listenerTypes.forEach(function(n){e.removeEventListener(p[n][t],r,o)})}},{key:"connectDragSource",value:function(e,t,r){var n=this,o=this.handleMoveStart.bind(this,e);return this.sourceNodes[e]=t,this.addEventListener(t,"start",o),function(){delete n.sourceNodes[e],n.removeEventListener(t,"start",o)}}},{key:"connectDragPreview",value:function(e,t,r){var n=this;return this.sourcePreviewNodeOptions[e]=r,this.sourcePreviewNodes[e]=t,function(){delete n.sourcePreviewNodes[e],delete n.sourcePreviewNodeOptions[e]}}},{key:"connectDropTarget",value:function(e,t){var r=this,n=function(n){var o=void 0;switch(n.type){case p.mouse.move:o={x:n.clientX,y:n.clientY};break;case p.touch.move:o={x:n.touches[0].clientX,y:n.touches[0].clientY}}var i=document.elementFromPoint(o.x,o.y),a=t.contains(i);if(i===t||a)return r.handleMove(n,e)};return this.addEventListener(document.querySelector("body"),"move",n),function(){r.removeEventListener(document.querySelector("body"),"move",n)}}},{key:"getSourceClientOffset",value:function(e){return s(this.sourceNodes[e])}},{key:"handleTopMoveStartCapture",value:function(e){this.moveStartSourceIds=[]}},{key:"handleMoveStart",value:function(e){this.moveStartSourceIds.unshift(e)}},{key:"getTopMoveStartHandler",value:function(){return this.delayTouchStart||this.delayMouseStart?this.handleTopMoveStartDelay:this.handleTopMoveStart}},{key:"handleTopMoveStart",value:function(e){var t=a(e);t&&(this._mouseClientOffset=t)}},{key:"handleTopMoveStartDelay",value:function(e){var t=e.type===p.touch.start?this.delayTouchStart:this.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,e),t)}},{key:"handleTopMoveCapture",value:function(e){this.dragOverTargetIds=[]}},{key:"handleMove",value:function(e,t){this.dragOverTargetIds.unshift(t)}},{key:"handleTopMove",value:function(e){clearTimeout(this.timeout);var t=this.moveStartSourceIds,r=this.dragOverTargetIds,n=a(e);if(n&&(this.monitor.isDragging()||!this._mouseClientOffset.hasOwnProperty("x")||!t||this._mouseClientOffset.x===n.x&&this._mouseClientOffset.y===n.y||(this.moveStartSourceIds=null,this.actions.beginDrag(t,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),this.monitor.isDragging())){var o=this.sourceNodes[this.monitor.getSourceId()];this.installSourceNodeRemovalObserver(o),this.actions.publishDragSource(),e.preventDefault(),this.actions.hover(r,{clientOffset:n})}}},{key:"handleTopMoveEndCapture",value:function(e){return!this.monitor.isDragging()||this.monitor.didDrop()?void(this.moveStartSourceIds=null):(e.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),void this.actions.endDrag())}},{key:"handleCancelOnEscape",value:function(e){"Escape"===e.key&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())}},{key:"installSourceNodeRemovalObserver",value:function(e){var t=this;this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new window.MutationObserver(function(){e.parentElement||(t.resurrectSourceNode(),t.uninstallSourceNodeRemovalObserver())}),e&&e.parentElement&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}},{key:"resurrectSourceNode",value:function(){this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),document.body.appendChild(this.draggedSourceNode)}},{key:"uninstallSourceNodeRemovalObserver",value:function(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=null,this.draggedSourceNode=null}}]),e}()},function(e,t,r){"use strict";var n=function(e,t,r,n,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,o,i,a,s],d=0;u=new Error(t.replace(/%s/g,function(){return c[d++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=n},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,s,u,c,d=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(68),f=r(69),h=(a=(0,f.DragLayer)(function(e){return{currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging(),itemType:e.getItemType(),item:e.getItem()}}),a((c=u=function(e){function t(){return n(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),d(t,[{key:"getStyle",value:function(){var e="translate("+this.props.currentOffset.x+"px, "+this.props.currentOffset.y+"px)";return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:e,WebkitTransform:e}}},{key:"render",value:function(){return this.context.dragDropManager.getBackend().previewEnabled()&&this.props.isDragging&&null!==this.props.currentOffset?this.props.generator(this.props.itemType,this.props.item,this.getStyle()):null}}]),t}(l.Component),u.defaultProps={currentOffset:{x:0,y:0},isDragging:!1,itemType:"",item:""},u.propTypes={currentOffset:l.PropTypes.shape({x:l.PropTypes.number,y:l.PropTypes.number}),isDragging:l.PropTypes.bool,itemType:l.PropTypes.string,item:l.PropTypes.object,generator:l.PropTypes.func.isRequired},u.contextTypes={dragDropManager:l.PropTypes.object},s=c))||s);t.default=h},function(t,r){t.exports=e},function(e,r){e.exports=t}])}); |
@@ -47,3 +47,3 @@ 'use strict'; | ||
} | ||
return this.props.generator(this.props.type, this.props.item, this.getStyle()); | ||
return this.props.generator(this.props.itemType, this.props.item, this.getStyle()); | ||
} | ||
@@ -50,0 +50,0 @@ }]); |
{ | ||
"name": "react-dnd-multi-backend", | ||
"version": "2.1.8", | ||
"version": "2.2.3", | ||
"description": "Multi Backend system for React DnD", | ||
@@ -5,0 +5,0 @@ "author": "Louis Brunner <louis.brunner.fr@gmail.com> (https://github.com/LouisBrunner)", |
@@ -24,4 +24,4 @@ import { Component, PropTypes } from 'react'; | ||
} | ||
return this.props.generator(this.props.type, this.props.item, this.getStyle()); | ||
return this.props.generator(this.props.itemType, this.props.item, this.getStyle()); | ||
} | ||
} |
67212