/*
 jQuery UI - v1.10.4 - 2014-06-14
 http://jqueryui.com
 Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js
 Copyright 2014 jQuery Foundation and other contributors; Licensed MIT  jquery.event.drag - v 2.2
 Copyright (c) 2010 Three Dub Media - http://threedubmedia.com
 Open Source MIT License - http://threedubmedia.com/code/license
*/
(function(d,n){function l(a,c){var f,h,k,p=a.nodeName.toLowerCase();return"area"===p?(f=a.parentNode,h=f.name,a.href&&h&&"map"===f.nodeName.toLowerCase()?(k=d("img[usemap=#"+h+"]")[0],!!k&&b(k)):!1):(/input|select|textarea|button|object/.test(p)?!a.disabled:"a"===p?a.href||c:c)&&b(a)}function b(a){return d.expr.filters.visible(a)&&!d(a).parents().addBack().filter(function(){return"hidden"===d.css(this,"visibility")}).length}var g=0,e=/^ui-id-\d+$/;d.ui=d.ui||{};d.extend(d.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,
COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});d.fn.extend({focus:function(a){return function(c,f){return"number"==typeof c?this.each(function(){var h=this;setTimeout(function(){d(h).focus();f&&f.call(h)},c)}):a.apply(this,arguments)}}(d.fn.focus),scrollParent:function(){var a;return a=d.ui.ie&&/(static|relative)/.test(this.css("position"))||
/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(d.css(this,"position"))&&/(auto|scroll)/.test(d.css(this,"overflow")+d.css(this,"overflow-y")+d.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(d.css(this,"overflow")+d.css(this,"overflow-y")+d.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!a.length?d(document):a},zIndex:function(a){if(a!==n)return this.css("zIndex",a);if(this.length){var c,
f;for(a=d(this[0]);a.length&&a[0]!==document;){if(c=a.css("position"),("absolute"===c||"relative"===c||"fixed"===c)&&(f=parseInt(a.css("zIndex"),10),!isNaN(f)&&0!==f))return f;a=a.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++g)})},removeUniqueId:function(){return this.each(function(){e.test(this.id)&&d(this).removeAttr("id")})}});d.extend(d.expr[":"],{data:d.expr.createPseudo?d.expr.createPseudo(function(a){return function(c){return!!d.data(c,a)}}):
function(a,c,f){return!!d.data(a,f[3])},focusable:function(a){return l(a,!isNaN(d.attr(a,"tabindex")))},tabbable:function(a){var c=d.attr(a,"tabindex"),f=isNaN(c);return(f||c>=0)&&l(a,!f)}});d("<a>").outerWidth(1).jquery||d.each(["Width","Height"],function(a,c){function f(m,q,r,u){return d.each(h,function(){q-=parseFloat(d.css(m,"padding"+this))||0;r&&(q-=parseFloat(d.css(m,"border"+this+"Width"))||0);u&&(q-=parseFloat(d.css(m,"margin"+this))||0)}),q}var h="Width"===c?["Left","Right"]:["Top","Bottom"],
k=c.toLowerCase(),p={innerWidth:d.fn.innerWidth,innerHeight:d.fn.innerHeight,outerWidth:d.fn.outerWidth,outerHeight:d.fn.outerHeight};d.fn["inner"+c]=function(m){return m===n?p["inner"+c].call(this):this.each(function(){d(this).css(k,f(this,m)+"px")})};d.fn["outer"+c]=function(m,q){return"number"!=typeof m?p["outer"+c].call(this,m):this.each(function(){d(this).css(k,f(this,m,!0,q)+"px")})}});d.fn.addBack||(d.fn.addBack=function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))});
d("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(d.fn.removeData=function(a){return function(c){return arguments.length?a.call(this,d.camelCase(c)):a.call(this)}}(d.fn.removeData));d.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());d.support.selectstart="onselectstart"in document.createElement("div");d.fn.extend({disableSelection:function(){return this.bind((d.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});
d.extend(d.ui,{plugin:{add:function(a,c,f){var h;a=d.ui[a].prototype;for(h in f)a.plugins[h]=a.plugins[h]||[],a.plugins[h].push([c,f[h]])},call:function(a,c,f){var h=a.plugins[c];if(h&&a.element[0].parentNode&&11!==a.element[0].parentNode.nodeType)for(c=0;h.length>c;c++)a.options[h[c][0]]&&h[c][1].apply(a.element,f)}},hasScroll:function(a,c){if("hidden"===d(a).css("overflow"))return!1;c=c&&"left"===c?"scrollLeft":"scrollTop";var f=!1;return a[c]>0?!0:(a[c]=1,f=a[c]>0,a[c]=0,f)}})})(jQuery);
(function(d,n){var l=0,b=Array.prototype.slice,g=d.cleanData;d.cleanData=function(e){for(var a,c=0;null!=(a=e[c]);c++)try{d(a).triggerHandler("remove")}catch(f){}g(e)};d.widget=function(e,a,c){var f={},h=e.split(".")[0];e=e.split(".")[1];var k=h+"-"+e;c||(c=a,a=d.Widget);d.expr[":"][k.toLowerCase()]=function(r){return!!d.data(r,k)};d[h]=d[h]||{};var p=d[h][e];var m=d[h][e]=function(r,u){return this._createWidget?(arguments.length&&this._createWidget(r,u),n):new m(r,u)};d.extend(m,p,{version:c.version,
_proto:d.extend({},c),_childConstructors:[]});var q=new a;q.options=d.widget.extend({},q.options);d.each(c,function(r,u){return d.isFunction(u)?(f[r]=function(){var t=function(){return a.prototype[r].apply(this,arguments)},x=function(v){return a.prototype[r].apply(this,v)};return function(){var v,w=this._super,y=this._superApply;return this._super=t,this._superApply=x,v=u.apply(this,arguments),this._super=w,this._superApply=y,v}}(),n):(f[r]=u,n)});m.prototype=d.widget.extend(q,{widgetEventPrefix:p?
q.widgetEventPrefix||e:e},f,{constructor:m,namespace:h,widgetName:e,widgetFullName:k});p?(d.each(p._childConstructors,function(r,u){r=u.prototype;d.widget(r.namespace+"."+r.widgetName,m,u._proto)}),delete p._childConstructors):a._childConstructors.push(m);d.widget.bridge(e,m)};d.widget.extend=function(e){for(var a,c,f=b.call(arguments,1),h=0,k=f.length;k>h;h++)for(a in f[h])c=f[h][a],f[h].hasOwnProperty(a)&&c!==n&&(e[a]=d.isPlainObject(c)?d.isPlainObject(e[a])?d.widget.extend({},e[a],c):d.widget.extend({},
c):c);return e};d.widget.bridge=function(e,a){var c=a.prototype.widgetFullName||e;d.fn[e]=function(f){var h="string"==typeof f,k=b.call(arguments,1),p=this;return f=!h&&k.length?d.widget.extend.apply(null,[f].concat(k)):f,h?this.each(function(){var m,q=d.data(this,c);return q?d.isFunction(q[f])&&"_"!==f.charAt(0)?(m=q[f].apply(q,k),m!==q&&m!==n?(p=m&&m.jquery?p.pushStack(m.get()):m,!1):n):d.error("no such method '"+f+"' for "+e+" widget instance"):d.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+
f+"'")}):this.each(function(){var m=d.data(this,c);m?m.option(f||{})._init():d.data(this,c,new a(f,this))}),p}};d.Widget=function(){};d.Widget._childConstructors=[];d.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,a){a=d(a||this.defaultElement||this)[0];this.element=d(a);this.uuid=l++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=d.widget.extend({},this.options,this._getCreateOptions(),e);
this.bindings=d();this.hoverable=d();this.focusable=d();a!==this&&(d.data(a,this.widgetFullName,this),this._on(!0,this.element,{remove:function(c){c.target===a&&this.destroy()}}),this.document=d(a.style?a.ownerDocument:a.document||a),this.window=d(this.document[0].defaultView||this.document[0].parentWindow));this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:d.noop,_getCreateEventData:d.noop,_create:d.noop,_init:d.noop,destroy:function(){this._destroy();
this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(d.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:d.noop,widget:function(){return this.element},option:function(e,a){var c,f,h=e;if(0===
arguments.length)return d.widget.extend({},this.options);if("string"==typeof e)if(h={},c=e.split("."),e=c.shift(),c.length){var k=h[e]=d.widget.extend({},this.options[e]);for(f=0;c.length-1>f;f++)k[c[f]]=k[c[f]]||{},k=k[c[f]];if(e=c.pop(),1===arguments.length)return k[e]===n?null:k[e];k[e]=a}else{if(1===arguments.length)return this.options[e]===n?null:this.options[e];h[e]=a}return this._setOptions(h),this},_setOptions:function(e){for(var a in e)this._setOption(a,e[a]);return this},_setOption:function(e,
a){return this.options[e]=a,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!a).attr("aria-disabled",a),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,a,c){var f,h=this;"boolean"!=typeof e&&(c=a,a=e,e=!1);c?(a=f=d(a),this.bindings=this.bindings.add(a)):(c=a,a=this.element,f=
this.widget());d.each(c,function(k,p){function m(){return e||h.options.disabled!==!0&&!d(this).hasClass("ui-state-disabled")?("string"==typeof p?h[p]:p).apply(h,arguments):n}"string"!=typeof p&&(m.guid=p.guid=p.guid||m.guid||d.guid++);var q=k.match(/^(\w+)\s*(.*)$/);k=q[1]+h.eventNamespace;(q=q[2])?f.delegate(q,k,m):a.bind(k,m)})},_off:function(e,a){a=(a||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.unbind(a).undelegate(a)},_delay:function(e,a){var c=this;return setTimeout(function(){return("string"==
typeof e?c[e]:e).apply(c,arguments)},a||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e);this._on(e,{mouseenter:function(a){d(a.currentTarget).addClass("ui-state-hover")},mouseleave:function(a){d(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e);this._on(e,{focusin:function(a){d(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){d(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,a,c){var f,
h,k=this.options[e];if(c=c||{},a=d.Event(a),a.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),a.target=this.element[0],h=a.originalEvent)for(f in h)f in a||(a[f]=h[f]);return this.element.trigger(a,c),!(d.isFunction(k)&&k.apply(this.element[0],[a].concat(c))===!1||a.isDefaultPrevented())}};d.each({show:"fadeIn",hide:"fadeOut"},function(e,a){d.Widget.prototype["_"+e]=function(c,f,h){"string"==typeof f&&(f={effect:f});var k=f?f===!0||"number"==typeof f?a:f.effect||a:e;f=f||
{};"number"==typeof f&&(f={duration:f});var p=!d.isEmptyObject(f);f.complete=h;f.delay&&c.delay(f.delay);p&&d.effects&&d.effects.effect[k]?c[e](f):k!==e&&c[k]?c[k](f.duration,f.easing,h):c.queue(function(m){d(this)[e]();h&&h.call(c[0]);m()})}})})(jQuery);
(function(d){var n=!1;d(document).mouseup(function(){n=!1});d.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var l=this;this.element.bind("mousedown."+this.widgetName,function(b){return l._mouseDown(b)}).bind("click."+this.widgetName,function(b){return!0===d.data(b.target,l.widgetName+".preventClickEvent")?(d.removeData(b.target,l.widgetName+".preventClickEvent"),b.stopImmediatePropagation(),!1):void 0});this.started=
!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&d(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(l){if(!n){this._mouseStarted&&this._mouseUp(l);this._mouseDownEvent=l;var b=this,g=1===l.which,e="string"==typeof this.options.cancel&&l.target.nodeName?d(l.target).closest(this.options.cancel).length:!1;return g&&!e&&this._mouseCapture(l)?(this.mouseDelayMet=
!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(l)&&this._mouseDelayMet(l)&&(this._mouseStarted=this._mouseStart(l)!==!1,!this._mouseStarted)?(l.preventDefault(),!0):(!0===d.data(l.target,this.widgetName+".preventClickEvent")&&d.removeData(l.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return b._mouseMove(a)},this._mouseUpDelegate=function(a){return b._mouseUp(a)},
d(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),l.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(l){return d.ui.ie&&(!document.documentMode||9>document.documentMode)&&!l.button?this._mouseUp(l):this._mouseStarted?(this._mouseDrag(l),l.preventDefault()):(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,l)!==!1,this._mouseStarted?this._mouseDrag(l):this._mouseUp(l)),
!this._mouseStarted)},_mouseUp:function(l){return d(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,l.target===this._mouseDownEvent.target&&d.data(l.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(l)),!1},_mouseDistanceMet:function(l){return Math.max(Math.abs(this._mouseDownEvent.pageX-l.pageX),Math.abs(this._mouseDownEvent.pageY-l.pageY))>=this.options.distance},
_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);
(function(d){function n(b,g,e){return b>g&&g+e>b}function l(b){return/left|right/.test(b.css("float"))||/inline|table-cell/.test(b.css("display"))}d.widget("ui.sortable",d.ui.mouse,{version:"1.10.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,
scope:"default",tolerance:"intersect",zIndex:1E3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?"x"===b.axis||l(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");
this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,g){"disabled"===b?(this.options[b]=g,this.widget().toggleClass("ui-sortable-disabled",!!g)):d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,g){var e=null,a=!1,c=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(b),d(b.target).parents().each(function(){return d.data(this,
c.widgetName+"-item")===c?(e=d(this),!1):void 0}),d.data(b.target,c.widgetName+"-item")===c&&(e=d(b.target)),e?!this.options.handle||g||(d(this.options.handle,e).find("*").addBack().each(function(){this===b.target&&(a=!0)}),a)?(this.currentItem=e,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(b,g,e){var a;g=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),
this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},d.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,g.cursorAt&&this._adjustOffsetFromHelper(g.cursorAt),
this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),g.containment&&this._setContainment(),g.cursor&&"auto"!==g.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",g.cursor),this.storedStylesheet=d("<style>*{ cursor: "+g.cursor+" !important; }</style>").appendTo(a)),g.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),
this.helper.css("opacity",g.opacity)),g.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",g.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!e)for(e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("activate",b,this._uiHash(this));return d.ui.ddmanager&&
(d.ui.ddmanager.current=this),d.ui.ddmanager&&!g.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){var g,e,a;var c=this.options;var f=!1;this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+
this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=f=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=f=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=f=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=
f=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-d(document).scrollTop()<c.scrollSensitivity?f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed):d(window).height()-(b.pageY-d(document).scrollTop())<c.scrollSensitivity&&(f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed)),b.pageX-d(document).scrollLeft()<c.scrollSensitivity?f=d(document).scrollLeft(d(document).scrollLeft()-c.scrollSpeed):d(window).width()-(b.pageX-d(document).scrollLeft())<c.scrollSensitivity&&(f=d(document).scrollLeft(d(document).scrollLeft()+
c.scrollSpeed))),f!==!1&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,b));this.positionAbs=this._convertPositionTo("absolute");this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px");this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px");for(c=this.items.length-1;c>=0;c--)if(g=this.items[c],e=g.item[0],a=this._intersectsWithPointer(g),a&&g.instance===this.currentContainer&&e!==this.currentItem[0]&&
this.placeholder[1===a?"next":"prev"]()[0]!==e&&!d.contains(this.placeholder[0],e)&&("semi-dynamic"===this.options.type?!d.contains(this.element[0],e):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(g))break;this._rearrange(b,g);this._trigger("change",b,this._uiHash());break}return this._contactContainers(b),d.ui.ddmanager&&d.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,
g){if(b){if(d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,b),this.options.revert){var e=this;g=this.placeholder.offset();var a=this.options.axis,c={};a&&"x"!==a||(c.left=g.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft));a&&"y"!==a||(c.top=g.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop));this.reverting=!0;d(this.helper).animate(c,parseInt(this.options.revert,
10)||500,function(){e._clear(b)})}else this._clear(b,g);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--)this.containers[b]._trigger("deactivate",null,this._uiHash(this)),this.containers[b].containerCache.over&&(this.containers[b]._trigger("out",null,this._uiHash(this)),this.containers[b].containerCache.over=
0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),d.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var g=this._getItemsAsjQuery(b&&b.connected),e=[];return b=
b||{},d(g).each(function(){var a=(d(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[\-=_](.+)/);a&&e.push((b.key||a[1]+"[]")+"="+(b.key&&b.expression?a[1]:a[2]))}),!e.length&&b.key&&e.push(b.key+"="),e.join("&")},toArray:function(b){var g=this._getItemsAsjQuery(b&&b.connected),e=[];return b=b||{},g.each(function(){e.push(d(b.item||this).attr(b.attribute||"id")||"")}),e},_intersectsWith:function(b){var g=this.positionAbs.left,e=g+this.helperProportions.width,a=this.positionAbs.top,
c=a+this.helperProportions.height,f=b.left,h=f+b.width,k=b.top,p=k+b.height,m=this.offset.click.top,q=this.offset.click.left;m="x"===this.options.axis||a+m>k&&p>a+m;q="y"===this.options.axis||g+q>f&&h>g+q;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>b[this.floating?"width":"height"]?m&&q:g+this.helperProportions.width/2>f&&h>e-this.helperProportions.width/2&&a+this.helperProportions.height/
2>k&&p>c-this.helperProportions.height/2},_intersectsWithPointer:function(b){var g="x"===this.options.axis||n(this.positionAbs.top+this.offset.click.top,b.top,b.height);b="y"===this.options.axis||n(this.positionAbs.left+this.offset.click.left,b.left,b.width);g=g&&b;b=this._getDragVerticalDirection();var e=this._getDragHorizontalDirection();return g?this.floating?e&&"right"===e||"down"===b?2:1:b&&("down"===b?2:1):!1},_intersectsWithSides:function(b){var g=n(this.positionAbs.top+this.offset.click.top,
b.top+b.height/2,b.height);b=n(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width);var e=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&b||"left"===a&&!b:e&&("down"===e&&g||"up"===e&&!g)},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return 0!==b&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return 0!==b&&(b>0?
"right":"left")},refresh:function(b){return this._refreshItems(b),this.refreshPositions(),this},_connectWith:function(){var b=this.options;return b.connectWith.constructor===String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){function g(){c.push(this)}var e,a,c=[],f=[],h=this._connectWith();if(h&&b)for(b=h.length-1;b>=0;b--){var k=d(h[b]);for(e=k.length-1;e>=0;e--)(a=d.data(k[e],this.widgetFullName))&&a!==this&&!a.options.disabled&&f.push([d.isFunction(a.options.items)?a.options.items.call(a.element):
d(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}f.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(b=f.length-1;b>=0;b--)f[b][0].each(g);return d(c)},_removeCurrentsFromItems:function(){var b=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=d.grep(this.items,
function(g){for(var e=0;b.length>e;e++)if(b[e]===g.item[0])return!1;return!0})},_refreshItems:function(b){this.items=[];this.containers=[this];var g,e,a,c,f=this.items,h=[[d.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):d(this.options.items,this.element),this]];if((c=this._connectWith())&&this.ready)for(g=c.length-1;g>=0;g--){var k=d(c[g]);for(e=k.length-1;e>=0;e--)(a=d.data(k[e],this.widgetFullName))&&a!==this&&!a.options.disabled&&(h.push([d.isFunction(a.options.items)?
a.options.items.call(a.element[0],b,{item:this.currentItem}):d(a.options.items,a.element),a]),this.containers.push(a))}for(g=h.length-1;g>=0;g--)for(b=h[g][1],k=h[g][0],e=0,c=k.length;c>e;e++)a=d(k[e]),a.data(this.widgetName+"-item",b),f.push({item:a,instance:b,width:0,height:0,left:0,top:0})},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var g,e,a;for(g=this.items.length-1;g>=0;g--){var c=this.items[g];c.instance!==this.currentContainer&&
this.currentContainer&&c.item[0]!==this.currentItem[0]||(e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item,b||(c.width=e.outerWidth(),c.height=e.outerHeight()),a=e.offset(),c.left=a.left,c.top=a.top)}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(g=this.containers.length-1;g>=0;g--)a=this.containers[g].element.offset(),this.containers[g].containerCache.left=a.left,this.containers[g].containerCache.top=
a.top,this.containers[g].containerCache.width=this.containers[g].element.outerWidth(),this.containers[g].containerCache.height=this.containers[g].element.outerHeight();return this},_createPlaceholder:function(b){b=b||this;var g,e=b.options;e.placeholder&&e.placeholder.constructor!==String||(g=e.placeholder,e.placeholder={element:function(){var a=b.currentItem[0].nodeName.toLowerCase(),c=d("<"+a+">",b.document[0]).addClass(g||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");
return"tr"===a?b.currentItem.children().each(function(){d("<td>&#160;</td>",b.document[0]).attr("colspan",d(this).attr("colspan")||1).appendTo(c)}):"img"===a&&c.attr("src",b.currentItem.attr("src")),g||c.css("visibility","hidden"),c},update:function(a,c){(!g||e.forcePlaceholderSize)&&(c.height()||c.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10)),c.width()||c.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||
0,10)-parseInt(b.currentItem.css("paddingRight")||0,10)))}});b.placeholder=d(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(b){var g,e,a,c,f,h=e=null;for(g=this.containers.length-1;g>=0;g--)d.contains(this.currentItem[0],this.containers[g].element[0])||(this._intersectsWith(this.containers[g].containerCache)?e&&d.contains(this.containers[g].element[0],e.element[0])||(e=this.containers[g],h=
g):this.containers[g].containerCache.over&&(this.containers[g]._trigger("out",b,this._uiHash(this)),this.containers[g].containerCache.over=0));if(e)if(1===this.containers.length)this.containers[h].containerCache.over||(this.containers[h]._trigger("over",b,this._uiHash(this)),this.containers[h].containerCache.over=1);else{g=1E4;var k=null;var p=(f=e.floating||l(this.currentItem))?"left":"top";var m=f?"width":"height";var q=this.positionAbs[p]+this.offset.click[p];for(e=this.items.length-1;e>=0;e--)d.contains(this.containers[h].element[0],
this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(!f||n(this.positionAbs.top+this.offset.click.top,this.items[e].top,this.items[e].height))&&(a=this.items[e].item.offset()[p],c=!1,Math.abs(a-q)>Math.abs(a+this.items[e][m]-q)&&(c=!0,a+=this.items[e][m]),g>Math.abs(a-q)&&(g=Math.abs(a-q),k=this.items[e],this.direction=c?"up":"down"));(k||this.options.dropOnEmpty)&&this.currentContainer!==this.containers[h]&&(k?this._rearrange(b,k,null,!0):this._rearrange(b,null,this.containers[h].element,
!0),this._trigger("change",b,this._uiHash()),this.containers[h]._trigger("change",b,this._uiHash(this)),this.currentContainer=this.containers[h],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[h]._trigger("over",b,this._uiHash(this)),this.containers[h].containerCache.over=1)}},_createHelper:function(b){var g=this.options;b=d.isFunction(g.helper)?d(g.helper.apply(this.element[0],[b,this.currentItem])):"clone"===g.helper?this.currentItem.clone():this.currentItem;
return b.parents("body").length||d("parent"!==g.appendTo?g.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0]),b[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!b[0].style.width||g.forceHelperSize)&&b.width(this.currentItem.width()),(!b[0].style.height||g.forceHelperSize)&&b.height(this.currentItem.height()),
b},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" "));d.isArray(b)&&(b={left:+b[0],top:+b[1]||0});"left"in b&&(this.offset.click.left=b.left+this.margins.left);"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left);"top"in b&&(this.offset.click.top=b.top+this.margins.top);"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();
var b=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&d.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&d.ui.ie)&&(b={top:0,left:0}),{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions=
{width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b,g,e,a=this.options;"parent"===a.containment&&(a.containment=this.helper[0].parentNode);"document"!==a.containment&&"window"!==a.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,d("document"===a.containment?document:window).width()-this.helperProportions.width-this.margins.left,(d("document"===a.containment?document:
window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]);/^(document|window|parent)$/.test(a.containment)||(b=d(a.containment)[0],g=d(a.containment).offset(),e="hidden"!==d(b).css("overflow"),this.containment=[g.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,g.top+(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,g.left+(e?Math.max(b.scrollWidth,
b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,g.top+(e?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(b,g){g||(g=this.position);b="absolute"===b?1:-1;var e="absolute"!==this.cssPosition||this.scrollParent[0]!==
document&&d.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(e[0].tagName);return{top:g.top+this.offset.relative.top*b+this.offset.parent.top*b-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:e.scrollTop())*b,left:g.left+this.offset.relative.left*b+this.offset.parent.left*b-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:e.scrollLeft())*b}},_generatePosition:function(b){var g,e,a=this.options,c=b.pageX,f=b.pageY,
h="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&d.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,k=/(html|body)/i.test(h[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(c=this.containment[0]+this.offset.click.left),b.pageY-
this.offset.click.top<this.containment[1]&&(f=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(c=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(f=this.containment[3]+this.offset.click.top)),a.grid&&(g=this.originalPageY+Math.round((f-this.originalPageY)/a.grid[1])*a.grid[1],f=this.containment?g-this.offset.click.top>=this.containment[1]&&g-this.offset.click.top<=this.containment[3]?g:g-this.offset.click.top>=
this.containment[1]?g-a.grid[1]:g+a.grid[1]:g,e=this.originalPageX+Math.round((c-this.originalPageX)/a.grid[0])*a.grid[0],c=this.containment?e-this.offset.click.left>=this.containment[0]&&e-this.offset.click.left<=this.containment[2]?e:e-this.offset.click.left>=this.containment[0]?e-a.grid[0]:e+a.grid[0]:e)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():k?0:h.scrollTop()),left:c-this.offset.click.left-this.offset.relative.left-
this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():k?0:h.scrollLeft())}},_rearrange:function(b,g,e,a){e?e[0].appendChild(this.placeholder[0]):g.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?g.item[0]:g.item[0].nextSibling);var c=this.counter=this.counter?++this.counter:1;this._delay(function(){c===this.counter&&this.refreshPositions(!a)})},_clear:function(b,g){function e(f,h,k){return function(p){k._trigger(f,p,h._uiHash(h))}}this.reverting=
!1;var a,c=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(a in this._storedCSS)"auto"!==this._storedCSS[a]&&"static"!==this._storedCSS[a]||(this._storedCSS[a]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!g&&c.push(function(f){this._trigger("receive",f,this._uiHash(this.fromOutside))});!this.fromOutside&&
this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||g||c.push(function(f){this._trigger("update",f,this._uiHash())});this!==this.currentContainer&&(g||(c.push(function(f){this._trigger("remove",f,this._uiHash())}),c.push(function(f){return function(h){f._trigger("receive",h,this._uiHash(this))}}.call(this,this.currentContainer)),c.push(function(f){return function(h){f._trigger("update",h,this._uiHash(this))}}.call(this,
this.currentContainer))));for(a=this.containers.length-1;a>=0;a--)g||c.push(e("deactivate",this,this.containers[a])),this.containers[a].containerCache.over&&(c.push(e("out",this,this.containers[a])),this.containers[a].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),
this.dragging=!1,this.cancelHelperRemoval){if(!g){this._trigger("beforeStop",b,this._uiHash());for(a=0;c.length>a;a++)c[a].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}if(g||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!g){for(a=0;c.length>a;a++)c[a].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=
!1,!0},_trigger:function(){d.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var g=b||this;return{helper:g.helper,placeholder:g.placeholder||d([]),position:g.position,originalPosition:g.originalPosition,offset:g.positionAbs,item:g.currentItem,sender:b?b.element:null}}})})(jQuery);
(function(d){d.fn.drag=function(a,c,f){var h=typeof a=="string"?a:"",k=d.isFunction(a)?a:d.isFunction(c)?c:null;h.indexOf("drag")!==0&&(h="drag"+h);f=(a==k?c:f)||{};return k?this.bind(h,f,k):this.trigger(h)};var n=d.event,l=n.special,b=l.drag={defaults:{which:1,distance:0,not:":input",handle:null,relative:!1,drop:!0,click:!1},datakey:"dragdata",noBubble:!0,add:function(a){var c=d.data(this,b.datakey),f=a.data||{};c.related+=1;d.each(b.defaults,function(h,k){f[h]!==void 0&&(c[h]=f[h])})},remove:function(){--d.data(this,
b.datakey).related},setup:function(){if(!d.data(this,b.datakey)){var a=d.extend({related:0},b.defaults);d.data(this,b.datakey,a);n.add(this,"touchstart mousedown",b.init,a);this.attachEvent&&this.attachEvent("ondragstart",b.dontstart)}},teardown:function(){(d.data(this,b.datakey)||{}).related||(d.removeData(this,b.datakey),n.remove(this,"touchstart mousedown",b.init),b.textselect(!0),this.detachEvent&&this.detachEvent("ondragstart",b.dontstart))},init:function(a){if(!b.touched){var c=a.data;if(!(a.which!=
0&&c.which>0&&a.which!=c.which||d(a.target).is(c.not)||c.handle&&!d(a.target).closest(c.handle,a.currentTarget).length)){b.touched=a.type=="touchstart"?this:null;c.propagates=1;c.mousedown=this;c.interactions=[b.interaction(this,c)];c.target=a.target;c.pageX=a.pageX;c.pageY=a.pageY;c.dragging=null;var f=b.hijack(a,"draginit",c);if(c.propagates&&((f=b.flatten(f))&&f.length&&(c.interactions=[],d.each(f,function(){c.interactions.push(b.interaction(this,c))})),c.propagates=c.interactions.length,c.drop!==
!1&&l.drop&&l.drop.handler(a,c),b.textselect(!1),b.touched?n.add(b.touched,"touchmove touchend",b.handler,c):n.add(document,"mousemove mouseup",b.handler,c),!b.touched||c.live))return!1}}},interaction:function(a,c){c=d(a)[c.relative?"position":"offset"]()||{top:0,left:0};return{drag:a,callback:new b.callback,droppable:[],offset:c}},handler:function(a){var c=a.data;switch(a.type){case !c.dragging&&"touchmove":a.preventDefault();case !c.dragging&&"mousemove":if(Math.pow(a.pageX-c.pageX,2)+Math.pow(a.pageY-
c.pageY,2)<Math.pow(c.distance,2))break;a.target=c.target;b.hijack(a,"dragstart",c);c.propagates&&(c.dragging=!0);case "touchmove":a.preventDefault();case "mousemove":if(c.dragging){b.hijack(a,"drag",c);if(c.propagates){c.drop!==!1&&l.drop&&l.drop.handler(a,c);break}a.type="mouseup"}default:b.touched?n.remove(b.touched,"touchmove touchend",b.handler):n.remove(document,"mousemove mouseup",b.handler),c.dragging&&(c.drop!==!1&&l.drop&&l.drop.handler(a,c),b.hijack(a,"dragend",c)),b.textselect(!0),c.click===
!1&&c.dragging&&d.data(c.mousedown,"suppress.click",(new Date).getTime()+5),c.dragging=b.touched=!1}},hijack:function(a,c,f,h,k){if(f){var p=a.originalEvent,m=a.type,q=c.indexOf("drop")?"drag":"drop",r,u=h||0,t;h=isNaN(h)?f.interactions.length:h;a.type=c;a.originalEvent=null;f.results=[];do if((t=f.interactions[u])&&(c==="dragend"||!t.cancelled)){var x=b.properties(a,f,t);t.results=[];d(k||t[q]||f.droppable).each(function(v,w){x.target=w;a.isPropagationStopped=function(){return!1};r=w?n.dispatch.call(w,
a,x):null;r===!1?(q=="drag"&&(t.cancelled=!0,--f.propagates),c=="drop"&&(t[q][v]=null)):c=="dropinit"&&t.droppable.push(b.element(r)||w);c=="dragstart"&&(t.proxy=d(b.element(r)||t.drag)[0]);t.results.push(r);delete a.result;if(c!=="dropinit")return r});f.results[u]=b.flatten(t.results);c=="dropinit"&&(t.droppable=b.flatten(t.droppable));c!="dragstart"||t.cancelled||x.update()}while(++u<h);a.type=m;a.originalEvent=p;return b.flatten(f.results)}},properties:function(a,c,f){var h=f.callback;h.drag=f.drag;
h.proxy=f.proxy||f.drag;h.startX=c.pageX;h.startY=c.pageY;h.deltaX=a.pageX-c.pageX;h.deltaY=a.pageY-c.pageY;h.originalX=f.offset.left;h.originalY=f.offset.top;h.offsetX=h.originalX+h.deltaX;h.offsetY=h.originalY+h.deltaY;h.drop=b.flatten((f.drop||[]).slice());h.available=b.flatten((f.droppable||[]).slice());return h},element:function(a){if(a&&(a.jquery||a.nodeType==1))return a},flatten:function(a){return d.map(a,function(c){return c&&c.jquery?d.makeArray(c):c&&c.length?b.flatten(c):c})},textselect:function(a){d(document)[a?
"unbind":"bind"]("selectstart",b.dontstart).css("MozUserSelect",a?"":"none");document.unselectable=a?"off":"on"},dontstart:function(){return!1},callback:function(){}};b.callback.prototype={update:function(){l.drop&&this.available.length&&d.each(this.available,function(a){l.drop.locate(this,a)})}};var g=n.dispatch;n.dispatch=function(a){if(d.data(this,"suppress."+a.type)-(new Date).getTime()>0)d.removeData(this,"suppress."+a.type);else return g.apply(this,arguments)};var e=n.fixHooks.touchstart=n.fixHooks.touchmove=
n.fixHooks.touchend=n.fixHooks.touchcancel={props:"clientX clientY pageX pageY screenX screenY".split(" "),filter:function(a,c){if(c){var f=c.touches&&c.touches[0]||c.changedTouches&&c.changedTouches[0]||null;f&&d.each(e.props,function(h,k){a[k]=f[k]})}return a}};l.draginit=l.dragstart=l.dragend=b})(jQuery);
