text: /*! v0.0.1 | Author: Martin Mende <martin.mende@aristech.de> | https://github.com/mmende/EaselJS-Drag-and-Drop */
  var DDC;!function(a){var b=function(){function a(){this.events=[]}return a.prototype.registerEvent=function(a){this.events[a]=[]},a.prototype.trigger=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];if(this.events.hasOwnProperty(a))for(var d=0;d<this.events[a].length;++d)this.events[a][d].apply(this,Array.prototype.slice.call(arguments,1))},a.prototype.on=function(a,b){return this.events.hasOwnProperty(a)&&this.events[a].push(b),b},a.prototype.off=function(a,b){function c(a,b){var c=a.indexOf(b);-1!==c?(console.log("Event found"),a.splice(c,1)):console.log("Event not found:",a,b)}this.events.hasOwnProperty(a)&&c(this.events[a],b),console.log("Events after off:",this.events[a])},a}();a.EventDispatcher=b}(DDC||(DDC={}));var DDC;!function(a){var b=function(){function a(a,b){this.x=a,this.y=b}return a}();a.Point=b}(DDC||(DDC={}));var __extends=this&&this.__extends||function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);a.prototype=null===b?Object.create(b):(c.prototype=b.prototype,new c)},DDC;!function(a){var b=[],c=function(c){function d(a,b){c.call(this),this.container=new createjs.Container,this.reference=b,this.registerEvent("startdragging"),this.registerEvent("stopdragging"),this.registerEvent("dragging"),this.registerEvent("overdroppable"),this.registerEvent("outdroppable"),this.registerEvent("hitdroppable"),this.parent=a,this.parent.addChild(this.container)}return __extends(d,c),d.prototype.draggable=function(a){return void 0===a&&(a=!0),a?this.enableDraggable():this.disableDraggable()},d.prototype.droppable=function(a){return void 0===a&&(a=!0),a?this.enableDroppable():this.disableDroppable()},d.prototype["delete"]=function(){this.draggable(!1).droppable(!1),this.parent.removeChild(this.container)},d.prototype.enableDraggable=function(){var b,c=this,d=new a.Point(0,0);return this.downEvent=this.container.on("mousedown",function(a){if(b=null,!a.target.hasOwnProperty("isDraggable")||0!=a.target.isDraggable){d.x=a.stageX-this.x,d.y=a.stageY-this.y,c.parent.setChildIndex(c.container,c.parent.getNumChildren()-1);var e={draggable:c};e.draggable=c;var f=c.parent.globalToLocal(a.stageX,a.stageY);e.droppable=c.getDroppableUnderPoint(f),null!==e.droppable&&(e.droppable.trigger("overdroppable",e),b=e.droppable),c.trigger("startdragging",e),c.moveEvent=c.container.on("pressmove",function(a){c.container.x=a.stageX-d.x,c.container.y=a.stageY-d.y;var f=c.parent.globalToLocal(a.stageX,a.stageY);if(e.droppable=c.getDroppableUnderPoint(f),c.trigger("dragging",e),b!==e.droppable)if(null!==e.droppable)if(e.droppable.trigger("overdroppable",e),null===b)b=e.droppable;else{var g={draggable:e.draggable,droppable:b};b.trigger("outdroppable",g),b=e.droppable}else if(null!==b){var g={draggable:e.draggable,droppable:b};b.trigger("outdroppable",g),b=null}}),c.upEvent=c.container.on("pressup",function(a){var b=c.parent.globalToLocal(a.stageX,a.stageY);e.droppable=c.getDroppableUnderPoint(b),c.trigger("stopdragging",e),c.container.off("pressmove",c.moveEvent),c.container.off("pressup",c.upEvent),null!==e.droppable&&e.droppable.trigger("hitdroppable",e)})}}),this},d.prototype.disableDraggable=function(){return this.container.off("mousedown",this.downEvent),this},d.prototype.enableDroppable=function(){return this.overEvent=this.container.on("mouseover",function(a){}),this.container.__droppable=!0,b.push(this),this},d.prototype.disableDroppable=function(){this.container.off("mouseover",this.overEvent),this.container.hasOwnProperty("__droppable")&&delete this.container.__droppable;var a=b.indexOf(this);return a>-1&&b.splice(a,1),this},d.prototype.searchAncestryForDroppable=function(a){for(var b=null,c=a;;){if(c===this.container)return null;if(c.hasOwnProperty("__droppable")&&c.__droppable===!0){b=c;break}if(!c.hasOwnProperty("parent")||null===c.parent||c.parent===this.parent)break;c=c.parent}return b},d.prototype.getDroppableContainerUnderPoint=function(a){for(var b=this.parent.getObjectsUnderPoint(a.x,a.y,2),c=null,d=-1,e=0;e<b.length;++e){var f=this.searchAncestryForDroppable(b[e]);if(null!==f){var g=this.parent.getChildIndex(f);g>d&&(c=f,d=g)}}return c},d.prototype.getDroppableFromContainer=function(a){for(var c=0;c<b.length;++c)if(b[c].container.id===a.id)return b[c];return null},d.prototype.getDroppableUnderPoint=function(a){var b=this.getDroppableContainerUnderPoint(a);return null===b?null:this.getDroppableFromContainer(b)},d}(a.EventDispatcher);a.DragDropContainer=c}(DDC||(DDC={}));
  //# sourceMappingURL=ddcontainer.min.js.map