//>>built
define("dojox/mdnd/Moveable","dojo/_base/declare dojo/_base/array dojo/_base/connect dojo/_base/event dojo/_base/sniff dojo/touch dojo/dom dojo/dom-geometry dojo/dom-style ./AutoScroll".split(" "),function(m,n,b,d,g,e,h,k,p,l){return m("dojox.mdnd.Moveable",null,{handle:null,skip:!0,dragDistance:3,constructor:function(a,c){this.node=h.byId(c);this.d=this.node.ownerDocument;a||(a={});this.handle=a.handle?h.byId(a.handle):null;this.handle||(this.handle=this.node);this.skip=a.skip;this.events=[b.connect(this.handle,
e.press,this,"onMouseDown")];l.autoScroll&&(this.autoScroll=l.autoScroll)},isFormElement:function(a){a=a.target;3==a.nodeType&&(a=a.parentNode);return 0<=" a button textarea input select option ".indexOf(" "+a.tagName.toLowerCase()+" ")},onMouseDown:function(a){this._isDragging||1!=(a.which||a.button)||this.skip&&this.isFormElement(a)||(this.autoScroll&&(this.autoScroll.setAutoScrollNode(this.node),this.autoScroll.setAutoScrollMaxPage()),this.events.push(b.connect(this.d,e.release,this,"onMouseUp")),
this.events.push(b.connect(this.d,e.move,this,"onFirstMove")),this._selectStart=b.connect(dojo.body(),"onselectstart",d.stop),this._firstX=a.clientX,this._firstY=a.clientY,d.stop(a))},onFirstMove:function(a){d.stop(a);(this._firstX-a.clientX)*(this._firstX-a.clientX)+(this._firstY-a.clientY)*(this._firstY-a.clientY)>this.dragDistance*this.dragDistance&&(this._isDragging=!0,b.disconnect(this.events.pop()),p.set(this.node,"width",k.getContentBox(this.node).w+"px"),this.initOffsetDrag(a),this.events.push(b.connect(this.d,
e.move,this,"onMove")))},initOffsetDrag:function(a){this.offsetDrag={l:a.pageX,t:a.pageY};a=k.position(this.node,!0);this.offsetDrag.l=a.x-this.offsetDrag.l;this.offsetDrag.t=a.y-this.offsetDrag.t;var c={x:a.x,y:a.y};this.size={w:a.w,h:a.h};this.onDragStart(this.node,c,this.size)},onMove:function(a){d.stop(a);if(!(8==g("ie")&&20>new Date-this.date)){this.autoScroll&&this.autoScroll.checkAutoScroll(a);var c={x:this.offsetDrag.l+a.pageX,y:this.offsetDrag.t+a.pageY},f=this.node.style;f.left=c.x+"px";
f.top=c.y+"px";this.onDrag(this.node,c,this.size,{x:a.pageX,y:a.pageY});8==g("ie")&&(this.date=new Date)}},onMouseUp:function(a){this._isDragging&&(d.stop(a),this._isDragging=!1,this.autoScroll&&this.autoScroll.stopAutoScroll(),delete this.onMove,this.onDragEnd(this.node),this.node.focus());b.disconnect(this.events.pop());b.disconnect(this.events.pop());b.disconnect(this._selectStart);this._selectStart=null},onDragStart:function(a,c,f){},onDragEnd:function(a){},onDrag:function(a,c,f,q){},destroy:function(){n.forEach(this.events,
b.disconnect);this.events=this.node=null}})});