/*! Copyright 2015-2019 SpryMedia Ltd. This source file is free software, available under the following license: MIT license - http://datatables.net/license/mit This source file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. For details please refer to: http://www.datatables.net RowReorder 1.2.6 2015-2019 SpryMedia Ltd - datatables.net/license */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,f,d){a instanceof String&&(a=String(a));for(var h=a.length,g=0;g").append(c.clone(!1)),b=c.outerWidth(),n=c.outerHeight(),d=c.children().map(function(){return a(this).width()});e.width(b).height(n).find("tr").children().each(function(a){this.style.width=d[a]+"px"});e.appendTo("body");this.dom.clone=e;this.s.domCloneOuterHeight=e.outerHeight()},_clonePosition:function(a){var c=this.s.start,b=this._eventToPage(a,"Y")-c.top;a=this._eventToPage(a,"X")-c.left;var d=this.c.snapX; b+=c.offsetTop;c=!0===d?c.offsetLeft:"number"===typeof d?c.offsetLeft+d:a+c.offsetLeft;0>b?b=0:b+this.s.domCloneOuterHeight>this.s.documentOuterHeight&&(b=this.s.documentOuterHeight-this.s.domCloneOuterHeight);this.dom.clone.css({top:b,left:c})},_emitEvent:function(c,e){this.s.dt.iterator("table",function(b,d){a(b.nTable).triggerHandler(c+".dt",e)})},_eventToPage:function(a,e){return-1!==a.type.indexOf("touch")?a.originalEvent.touches[0]["page"+e]:a["page"+e]},_mouseDown:function(c,e){var b=this, n=this.s.dt,g=this.s.start,t=e.offset();g.top=this._eventToPage(c,"Y");g.left=this._eventToPage(c,"X");g.offsetTop=t.top;g.offsetLeft=t.left;g.nodes=a.unique(n.rows({page:"current"}).nodes().toArray());this._cachePositions();this._clone(e);this._clonePosition(c);this.dom.target=e;e.addClass("dt-rowReorder-moving");a(d).on("mouseup.rowReorder touchend.rowReorder",function(a){b._mouseUp(a)}).on("mousemove.rowReorder touchmove.rowReorder",function(a){b._mouseMove(a)});a(f).width()===a(d).width()&&a(d.body).addClass("dt-rowReorder-noOverflow"); c=this.dom.dtScroll;this.s.scroll={windowHeight:a(f).height(),windowWidth:a(f).width(),dtTop:c.length?c.offset().top:null,dtLeft:c.length?c.offset().left:null,dtHeight:c.length?c.outerHeight():null,dtWidth:c.length?c.outerWidth():null}},_mouseMove:function(c){this._clonePosition(c);for(var e=this._eventToPage(c,"Y")-this.s.bodyTop,b=this.s.middles,d=null,f=this.s.dt,g=f.table().body(),l=0,h=b.length;lthis.s.lastInsert?this.dom.target.insertAfter(e[d-1]):this.dom.target.insertBefore(e[d])),this._cachePositions(),this.s.lastInsert=d;this._shiftScroll(c)},_mouseUp:function(c){var e=this,b=this.s.dt,f,g=this.c.dataSrc;this.dom.clone.remove();this.dom.clone=null;this.dom.target.removeClass("dt-rowReorder-moving");a(d).off(".rowReorder");a(d.body).removeClass("dt-rowReorder-noOverflow");clearInterval(this.s.scrollInterval); this.s.scrollInterval=null;var h=this.s.start.nodes,l=a.unique(b.rows({page:"current"}).nodes().toArray()),m={},q=[],p=[],r=this.s.getDataFn,y=this.s.setDataFn;var k=0;for(f=h.length;kg?h=-5:g>b.windowHeight-65&&(h=5);null!==b.dtTop&&a.pageYb.dtTop+b.dtHeight-65&&(l=5);h||l?(b.windowVert=h,b.dtVert=l,f=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),this.s.scrollInterval= null);!this.s.scrollInterval&&f&&(this.s.scrollInterval=setInterval(function(){b.windowVert&&(d.body.scrollTop+=b.windowVert);if(b.dtVert){var a=c.dom.dtScroll[0];b.dtVert&&(a.scrollTop+=b.dtVert)}},20))}});m.defaults={dataSrc:0,editor:null,enable:!0,formOptions:{},selector:"td:first-child",snapX:!1,update:!0,excludedChildren:"a"};var p=a.fn.dataTable.Api;p.register("rowReorder()",function(){return this});p.register("rowReorder.enable()",function(a){a===h&&(a=!0);return this.iterator("table",function(c){c.rowreorder&& (c.rowreorder.c.enable=a)})});p.register("rowReorder.disable()",function(){return this.iterator("table",function(a){a.rowreorder&&(a.rowreorder.c.enable=!1)})});m.version="1.2.6";a.fn.dataTable.RowReorder=m;a.fn.DataTable.RowReorder=m;a(d).on("init.dt.dtr",function(c,d,b){"dt"===c.namespace&&(c=d.oInit.rowReorder,b=g.defaults.rowReorder,c||b)&&(b=a.extend({},c,b),!1!==c&&new m(d,b))});return m});