//>>built
define("dojox/mdnd/dropMode/VerticalDropMode",["dojo/_base/kernel","dojo/_base/declare","dojo/_base/array","dojo/dom-geometry","dojox/mdnd/AreaManager"],function(h,n,p,k,q){h=n("dojox.mdnd.dropMode.VerticalDropMode",null,{_oldXPoint:null,_oldYPoint:null,_oldBehaviour:"up",addArea:function(a,c){var b=a.length,e=k.position(c.node,!0);c.coords={x:e.x,y:e.y};if(0==b)a.push(c);else{var d=c.coords.x;for(e=0;e<b;e++)if(d<a[e].coords.x){for(d=b-1;d>=e;d--)a[d+1]=a[d];a[e]=c;break}e==b&&a.push(c)}return a},
updateAreas:function(a){var c=a.length;if(1<c)for(var b,e,d=0;d<c;d++){var f=a[d];f.coords.x1=-1;f.coords.x2=-1;0==d?(e=a[d+1],this._updateArea(f),this._updateArea(e),b=f.coords.x+f.node.offsetWidth,e=e.coords.x,f.coords.x2=b+(e-b)/2):d==c-1?f.coords.x1=a[d-1].coords.x2:(e=a[d+1],this._updateArea(e),b=f.coords.x+f.node.offsetWidth,e=e.coords.x,f.coords.x1=a[d-1].coords.x2,f.coords.x2=b+(e-b)/2)}},_updateArea:function(a){var c=k.position(a.node,!0);a.coords.x=c.x;a.coords.y=c.y},initItems:function(a){p.forEach(a.items,
function(c){var b=k.position(c.item.node,!0);c.y=b.y+b.h/2});a.initItems=!0},refreshItems:function(a,c,b,e){if(-1!=c&&a&&b&&b.h){b=b.h;a.margin&&(b+=a.margin.t);for(var d=a.items.length;c<d;c++){var f=a.items[c];f.y=e?f.y+b:f.y-b}}},getDragPoint:function(a,c,b){b=a.y;this._oldYPoint&&(b>this._oldYPoint?(this._oldBehaviour="down",b+=c.h):b<=this._oldYPoint&&(this._oldBehaviour="up"));this._oldYPoint=b;return{x:a.x+c.w/2,y:b}},getTargetArea:function(a,c,b){var e=0,d=c.x,f=a.length;if(1<f){var g=0,m=
"right",l=!1;-1==b||3>arguments.length?l=!0:this._checkInterval(a,b,d)?e=b:(this._oldXPoint<d?g=b+1:(g=b-1,f=0,m="left"),l=!0);if(l)if("right"===m)for(;g<f;g++){if(this._checkInterval(a,g,d)){e=g;break}}else for(;g>=f;g--)if(this._checkInterval(a,g,d)){e=g;break}}this._oldXPoint=d;return e},_checkInterval:function(a,c,b){a=a[c].coords;if(-1==a.x1){if(b<=a.x2)return!0}else if(-1==a.x2){if(b>a.x1)return!0}else if(a.x1<b&&b<=a.x2)return!0;return!1},getDropIndex:function(a,c){var b=a.items.length,e=c.y;
if(0<b)for(var d=0;d<b;d++){if(e<a.items[d].y)return d;if(d==b-1)break}return-1},destroy:function(){}});q.areaManager()._dropMode=new h;return h});