!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).dragula=e()}}(function(){return function e(n,t,o){function r(u,c){if(!t[u]){if(!n[u]){var a="function"==typeof require&&require;if(!c&&a)return a(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var l=t[u]={exports:{}};n[u][0].call(l.exports,function(e){var t=n[u][1][e];return r(t||e)},l,l.exports,e,n,t,o)}return t[u].exports}for(var i="function"==typeof require&&require,u=0;u0?e:D.revertOnSpill,t=X||E,o=g(t),r=J(o);!1===r&&n&&(X?o&&o.removeChild(X):w.insertBefore(t,N)),r||n?I.emit("cancel",t,w,w):I.emit("drop",t,o,w,T),G()}}function G(){var e=X||E;K(),t&&(i.rm(D.mirrorContainer,"gu-unselectable"),a(c,"remove","mousemove",W),g(t).removeChild(t),t=null),e&&i.rm(e,"gu-transit"),Y&&clearTimeout(Y),I.dragging=!1,P&&I.emit("out",e,P,w),I.emit("dragend",e),w=E=X=N=T=Y=P=null}function J(e,n){var o;return o=void 0!==n?n:t?T:y(X||E),e===w&&o===N}function Q(e,n,t){for(var o=e;o&&!r();)o=g(o);return o;function r(){if(!1===L(o))return!1;var r=Z(o,e),i=ee(o,r,n,t);return!!J(o,i)||D.accepts(E,o,w,i)}}function W(e){if(t){e.preventDefault();var n=b("clientX",e),o=b("clientY",e),r=n-x,i=o-S;t.style.left=r+"px",t.style.top=i+"px";var u=X||E,c=d(t,n,o),a=Q(c,n,o),f=null!==a&&a!==P;(f||null===a)&&(P&&p("out"),P=a,f&&p("over"));var l=g(u);if(a!==w||!X||D.copySortSource){var s,v=Z(a,c);if(null!==v)s=ee(a,v,n,o);else{if(!0!==D.revertOnSpill||X)return void(X&&l&&l.removeChild(u));s=N,a=w}(null===s&&f||s!==u&&s!==y(u))&&(T=s,a.insertBefore(u,s),I.emit("shadow",u,a,w))}else l&&l.removeChild(u)}function p(e){I.emit(e,u,P,w)}}function Z(e,n){for(var t=n;t!==e&&g(t)!==e;)t=g(t);return t===c?null:t}function ee(e,n,t,o){var r,i="horizontal"===D.direction;return n!==e?(r=n.getBoundingClientRect(),u(i?t>r.left+p(r)/2:o>r.top+m(r)/2)):function(){var n,r,u,c=e.children.length;for(n=0;nt)return r;if(!i&&u.top+u.height/2>o)return r}return null}();function u(e){return e?y(n):n}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,n,t){n.exports=function(e,n){return Array.prototype.slice.call(e,n)}},{}],4:[function(e,n,t){"use strict";var o=e("ticky");n.exports=function(e,n,t){e&&o(function(){e.apply(t||null,n||[])})}},{ticky:9}],5:[function(e,n,t){"use strict";var o=e("atoa"),r=e("./debounce");n.exports=function(e,n){var t=n||{},i={};return void 0===e&&(e={}),e.on=function(n,t){return i[n]?i[n].push(t):i[n]=[t],e},e.once=function(n,t){return t._once=!0,e.on(n,t),e},e.off=function(n,t){var o=arguments.length;if(1===o)delete i[n];else if(0===o)i={};else{var r=i[n];if(!r)return e;r.splice(r.indexOf(t),1)}return e},e.emit=function(){var n=o(arguments);return e.emitterSnapshot(n.shift()).apply(this,n)},e.emitterSnapshot=function(n){var u=(i[n]||[]).slice(0);return function(){var i=o(arguments),c=this||e;if("error"===n&&!1!==t.throws&&!u.length)throw 1===i.length?i[0]:i;return u.forEach(function(o){t.async?r(o,i,c):o.apply(c,i),o._once&&e.off(n,o)}),e}},e}},{"./debounce":4,atoa:3}],6:[function(e,n,t){(function(t){"use strict";var o=e("custom-event"),r=e("./eventmap"),i=t.document,u=function(e,n,t,o){return e.addEventListener(n,t,o)},c=function(e,n,t,o){return e.removeEventListener(n,t,o)},a=[];function f(e,n,t){var o=function(e,n,t){var o,r;for(o=0;o