//>>built
define("dojox/grid/enhanced/plugins/GridSource",["dojo/_base/declare","dojo/_base/array","dojo/_base/lang","dojo/dnd/Source","./DnD"],function(p,g,k,q,t){var l=function(b){for(var a=b[0],c=1;c<b.length;++c)a=a.concat(b[c]);return a},m=k.getObject("dojox.grid.enhanced.plugins.GridDnDSource");return p("dojox.grid.enhanced.plugins.GridSource",q,{accept:["grid/cells","grid/rows","grid/cols","text"],insertNodesForGrid:!1,markupFactory:function(b,a){cls=k.getObject("dojox.grid.enhanced.plugins.GridSource");
return new cls(a,b)},checkAcceptance:function(b,a){if(b instanceof m){if(a[0]){var c=b.getItem(a[0].id);if(c&&(0<=g.indexOf(c.type,"grid/rows")||0<=g.indexOf(c.type,"grid/cells"))&&!b.dndPlugin._allDnDItemsLoaded())return!1}this.sourcePlugin=b.dndPlugin}return this.inherited(arguments)},onDraggingOver:function(){this.sourcePlugin&&(this.sourcePlugin._isSource=!0)},onDraggingOut:function(){this.sourcePlugin&&(this.sourcePlugin._isSource=!1)},onDropExternal:function(b,a,c){if(b instanceof m){var d=
g.map(a,function(n){return b.getItem(n.id).data}),h=b.getItem(a[0].id),e=h.dndPlugin.grid,r=h.type[0];try{switch(r){case "grid/cells":a[0].innerHTML=this.getCellContent(e,d[0].min,d[0].max)||"";this.onDropGridCells(e,d[0].min,d[0].max);break;case "grid/rows":var f=l(d);a[0].innerHTML=this.getRowContent(e,f)||"";this.onDropGridRows(e,f);break;case "grid/cols":f=l(d),a[0].innerHTML=this.getColumnContent(e,f)||"",this.onDropGridColumns(e,f)}this.insertNodesForGrid&&(this.selectNone(),this.insertNodes(!0,
[a[0]],this.before,this.current));h.dndPlugin.onDragOut(!c)}catch(n){}}else this.inherited(arguments)},getCellContent:function(b,a,c){},getRowContent:function(b,a){},getColumnContent:function(b,a){},onDropGridCells:function(b,a,c){},onDropGridRows:function(b,a){},onDropGridColumns:function(b,a){}})});