!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactDnD={},e.React)}(this,(function(e,t){"use strict";var r=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(t),n=t.createContext({dragDropManager:void 0});function o(e){var t={exports:{}};return e(t,t.exports),t.exports /* object-assign (c) Sindre Sorhus @license MIT */}Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable,!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()||Object.assign; /** @license React v17.0.2 * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var i=o((function(e,t){var n=60103;if(t.Fragment=60107,"function"==typeof Symbol&&Symbol.for){var o=Symbol.for;n=o("react.element"),t.Fragment=o("react.fragment")}var i=r.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a=Object.prototype.hasOwnProperty,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var o,c={},s=null,l=null;for(o in void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(l=t.ref),t)a.call(t,o)&&!u.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:n,type:e,key:s,ref:l,props:c,_owner:i.current}}t.jsx=c,t.jsxs=c})); /** @license React v17.0.2 * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */o((function(e,t){}));var a,u=o((function(e){e.exports=i}));function c(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},n=r.publishSource,o=void 0===n||n,i=r.clientOffset,a=r.getSourceClientOffset,u=e.getMonitor(),c=e.getRegistry();e.dispatch(g(i)),D(t,u,c);var s=k(t,u);if(null!==s){var f=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");I(a),f=a(s)}e.dispatch(g(i,f));var d=c.getSource(s),p=d.beginDrag(u,s);if(null!=p){C(p),c.pinSource(s);var h=c.getSourceType(s);return{type:l,payload:{itemType:h,item:p,sourceId:s,clientOffset:i||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}else e.dispatch(S)}}function D(e,t,r){c(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach((function(e){c(r.getSource(e),"Expected sourceIds to be registered.")}))}function I(e){c("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}function C(e){c(m(e),"Item must be an object.")}function k(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function T(e){return function(){if(e.getMonitor().isDragging())return{type:f}}}function j(e,t){return null===t?null===e:Array.isArray(e)?e.some((function(e){return e===t})):e===t}function P(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.clientOffset;E(t);var o=t.slice(0),i=e.getMonitor(),a=e.getRegistry();R(o,i,a);var u=i.getItemType();return M(o,a,u),x(o,i,a),{type:d,payload:{targetIds:o,clientOffset:n||null}}}}function E(e){c(Array.isArray(e),"Expected targetIds to be an array.")}function R(e,t,r){c(t.isDragging(),"Cannot call hover while not dragging."),c(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n=0;n--){var o=e[n];j(t.getTargetType(o),r)||e.splice(n,1)}}function x(e,t,r){e.forEach((function(e){r.getTarget(e).hover(t,e)}))}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=e.getMonitor(),n=e.getRegistry();H(r);var o=F(r);o.forEach((function(o,i){var a=$(o,i,n,r),u={type:p,payload:{dropResult:_(_({},t),a)}};e.dispatch(u)}))}}function H(e){c(e.isDragging(),"Cannot call drop while not dragging."),c(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function $(e,t,r,n){var o=r.getTarget(e),i=o?o.drop(n,e):void 0;return function(e){c(void 0===e||m(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:n.getDropResult()),i}function F(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function B(e){return function(){var t=e.getMonitor(),r=e.getRegistry();!function(e){c(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var n=t.getSourceId();return null!=n&&(r.getSource(n,!0).endDrag(t,n),r.unpinSource()),{type:h}}}function L(e,t){for(var r=0;r0;n.backend&&(e&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!e&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))})),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}var t,r;return t=e,(r=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,r=function(e){return{beginDrag:w(e),publishDragSource:T(e),hover:P(e),drop:U(e),endDrag:B(e)}}(this);return Object.keys(r).reduce((function(n,o){var i,a=r[o];return n[o]=(i=a,function(){for(var r=arguments.length,n=new Array(r),o=0;o2&&void 0!==arguments[2]?arguments[2]:J;if(e.length!==t.length)return!1;for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:ne,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case s:case l:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case d:return Q(e.clientOffset,r.clientOffset)?e:te(te({},e),{},{clientOffset:r.clientOffset});case h:case p:return ne;default:return e}}var ie="dnd-core/ADD_SOURCE",ae="dnd-core/ADD_TARGET",ue="dnd-core/REMOVE_SOURCE",ce="dnd-core/REMOVE_TARGET";function se(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function le(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:de,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case l:return le(le({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case f:return le(le({},e),{},{isSourcePublic:!0});case d:return le(le({},e),{},{targetIds:r.targetIds});case ce:return-1===e.targetIds.indexOf(r.targetId)?e:le(le({},e),{},{targetIds:b(e.targetIds,r.targetId)});case p:return le(le({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case h:return le(le({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function he(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ie:case ae:return e+1;case ue:case ce:return e-1;default:return e}}var ge=[],ye=[];function ve(e,t){return e!==ge&&(e===ye||void 0===t||(r=e,t.filter((function(e){return r.indexOf(e)>-1}))).length>0);var r}function be(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case d:break;case ie:case ae:case ce:case ue:return ge;case l:case f:case h:case p:default:return ye}var t=e.payload,r=t.targetIds,n=void 0===r?[]:r,o=t.prevTargetIds,i=void 0===o?[]:o,a=O(n,i),u=a.length>0||!Z(n,i);if(!u)return ge;var c=i[i.length-1],s=n[n.length-1];return c!==s&&(c&&a.push(c),s&&a.push(s)),a}function me(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e+1}function Oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Se(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:be(e.dirtyHandlerIds,{type:t.type,payload:Se(Se({},t.payload),{},{prevTargetIds:v(e,"dragOperation.targetIds",[])})}),dragOffset:oe(e.dragOffset,t),refCount:he(e.refCount,t),dragOperation:pe(e.dragOperation,t),stateId:me(e.stateId)}}function Ie(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ce(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0},n=r.handlerIds;c("function"==typeof e,"listener must be a function."),c(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,i=function(){var r=t.store.getState(),i=r.stateId;try{i===o||i===o+1&&!ve(r.dirtyHandlerIds,n)||e()}finally{o=i}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(e){var t=this;c("function"==typeof e,"listener must be a function.");var r=this.store.getState().dragOffset;return this.store.subscribe((function(){var n=t.store.getState().dragOffset;n!==r&&(r=n,e())}))}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return c(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return c(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&j(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return c(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1};if(!e)return!1;var r=t.shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),o=this.getItemType();if(o&&!j(n,o))return!1;var i=this.getTargetIds();if(!i.length)return!1;var a=i.indexOf(e);return r?a===i.length-1:a>-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 Boolean(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 t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset,t&&r&&n?Ie(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,n),r):null;var e,t,r,n}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,r=e.initialClientOffset,t&&r?Ie(t,r):null;var e,t,r}}])&&Ce(t.prototype,r),e}(),je=0;function Pe(e){return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ee(e,t){t&&Array.isArray(e)?e.forEach((function(e){return Ee(e,!1)})):c("string"==typeof e||"symbol"===Pe(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 Re(e){xe.length||Me(),xe[xe.length]=e}var Me,xe=[],Ae=0;function _e(){for(;Ae1024){for(var t=0,r=xe.length-Ae;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1];c(this.isSourceId(e),"Expected a valid source ID.");var r=t&&e===this.pinnedSourceId,n=r?this.pinnedSource:this.dragSources.get(e);return n}},{key:"getTarget",value:function(e){return c(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return c(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return c(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return Je(e)===a.SOURCE}},{key:"isTargetId",value:function(e){return Je(e)===a.TARGET}},{key:"removeSource",value:function(e){var t=this;c(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:ue,payload:{sourceId:e}}}(e)),We((function(){t.dragSources.delete(e),t.types.delete(e)}))}},{key:"removeTarget",value:function(e){c(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:ce,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);c(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){c(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,r){var n=function(e){var t=(je++).toString();switch(e){case a.SOURCE:return"S".concat(t);case a.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(n,t),e===a.SOURCE?this.dragSources.set(n,r):e===a.TARGET&&this.dropTargets.set(n,r),n}}])&&Ye(t.prototype,r),e}();function et(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=tt(n),i=new Te(o,new Ze(o)),a=new q(o,i),u=e(a,t,r);return a.receiveBackend(u),a}function tt(e){var t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return X(De,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var rt=["children"];function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:ut(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=t;return o[it]||(o[it]={dragDropManager:et(e,t,r,n)}),o[it]}(e.backend,e.context,e.options,e.debugMode),!e.context]}(function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,rt)),2),i=o[0],a=o[1];return t.useEffect((function(){if(a){var e=ut();return++ot,function(){0==--ot&&(e[it]=null)}}}),[]),u.jsx(n.Provider,Object.assign({value:i},{children:r}),void 0)}));function ut(){return"undefined"!=typeof global?global:window}var ct=t.memo((function(e){var r=e.connect,n=e.src;return t.useEffect((function(){if("undefined"!=typeof Image){var e=!1,t=new Image;return t.src=n,t.onload=function(){r(t),e=!0},function(){e&&r(null)}}})),null}));function st(e,t){for(var r=0;r, or turn it into a ")+"drag source or a drop target itself.")}}function mt(e){var r={};return Object.keys(e).forEach((function(n){var o=e[n];if(n.endsWith("Ref"))r[n]=e[n];else{var i=function(e){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t.isValidElement(r)){var o=r;return e(o,n),o}var i=r;return bt(i),St(i,n?function(t){return e(t,n)}:e)}}(o);r[n]=function(){return i}}})),r}function Ot(e,t){"function"==typeof e?e(t):e.current=t}function St(e,r){var n=e.ref;return c("string"!=typeof n,"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://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?t.cloneElement(e,{ref:function(e){Ot(n,e),Ot(r,e)}}):t.cloneElement(e,{ref:r})}function wt(e){return(wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Dt(e){return null!==e&&"object"===wt(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function It(e,t,r,n){var o=r?r.call(n,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var u=Object.prototype.hasOwnProperty.bind(t),c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r-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://react-dnd.github.io/react-dnd/docs/api/drag-source',$r.join(", "),t),c("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://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),Fr.forEach((function(t){c("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://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])})),function(t,r){return new Br(e,t,r)}}function Gr(e,t){for(var r=0;r-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://react-dnd.github.io/react-dnd/docs/api/drop-target',Wr.join(", "),t),c("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://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])})),function(t,r){return new Vr(e,t,r)}}function zr(e){return(zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xr(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:{};return c("function"==typeof e,'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://react-dnd.github.io/react-dnd/docs/api/drag-layer",e),c(Ht(r),'Expected "options" provided as the second argument to DragLayer to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-layer',r),function(o){var i=o,a=r.arePropsEqual,s=void 0===a?It:a,l=i.displayName||i.name||"Component",f=function(r){Qr(a,r);var o=en(a);function a(){var e;Kr(this,a);for(var r=arguments.length,n=new Array(r),i=0;i3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(c($t(e),'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://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),c(Ht(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=Lr(t);return c("function"==typeof r,'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://react-dnd.github.io/react-dnd/docs/api/drag-source',r),c(Ht(n),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',r),function(e){return Nr({containerDisplayName:"DragSource",createHandler:i,registerHandler:Mt,createConnector:function(e){return new Tt(e)},createMonitor:function(e){return new pt(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}},e.DropTarget=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(c($t(e,!0),'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://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),c(Ht(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=Yr(t);return c("function"==typeof r,'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://react-dnd.github.io/react-dnd/docs/api/drop-target',r),c(Ht(n),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',r),function(e){return Nr({containerDisplayName:"DropTarget",createHandler:i,registerHandler:Rt,createMonitor:function(e){return new vt(e)},createConnector:function(e){return new Et(e)},DecoratedComponent:e,getType:o,collect:r,options:n})}},e.useDrag=function(e,r){var n=gn(e,r);c(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var o,i=(o=fn(),t.useMemo((function(){return new pt(o)}),[o])),a=function(e,r){var n=fn(),o=t.useMemo((function(){return new Tt(n.getBackend())}),[n]);return an((function(){return o.dragSourceOptions=e||null,o.reconnect(),function(){return o.disconnectDragSource()}}),[o,e]),an((function(){return o.dragPreviewOptions=r||null,o.reconnect(),function(){return o.disconnectDragPreview()}}),[o,r]),o}(n.options,n.previewOptions);return pn(n,i,a),[On(n.collect,i,a),Sn(a),wn(a)]},e.useDragDropManager=fn,e.useDragLayer=function(e){var r=fn().getMonitor(),n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(bn(r,e),2),o=n[0],i=n[1];return t.useEffect((function(){return r.subscribeToOffsetChange(i)})),t.useEffect((function(){return r.subscribeToStateChange(i)})),o},e.useDrop=function(e,r){var n,o=gn(e,r),i=(n=fn(),t.useMemo((function(){return new vt(n)}),[n])),a=function(e){var r=fn(),n=t.useMemo((function(){return new Et(r.getBackend())}),[r]);return an((function(){return n.dropTargetOptions=e||null,n.reconnect(),function(){return n.disconnectDropTarget()}}),[e]),n}(o.options);return Tn(o,i,a),[On(o.collect,i,a),jn(a)]},Object.defineProperty(e,"__esModule",{value:!0})}));