f754ad8cebcf93c7cf789d013777e7e34c27449d3391db882cebfba27c0ec667

Source Code:

/*! jQuery UI - v1.11.4 - 2015-08-04
* http://jqueryui.com
* Includes: core.js, widget.js, mouse.js, draggable.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
(function(b){"function"==typeof define&&define.amd?define(["jquery"],b):b(jQuery)})(function(i){function k(g,f){var b,h,c,d=g.nodeName.toLowerCase();return"area"===d?(b=g.parentNode,h=b.name,g.href&&h&&"map"===b.nodeName.toLowerCase()?(c=i("img[usemap='#"+h+"']")[0],!!c&&l(c)):!1):(/^(input|select|textarea|button|object)$/.test(d)?!g.disabled:"a"===d?g.href||f:f)&&l(g)}function l(b){return i.expr.filters.visible(b)&&!i(b).parents().addBack().filter(function(){return"hidden"===i.css(this,"visibility")}).length}i.ui=i.ui||{},i.extend(i.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),i.fn.extend({scrollParent:function(d){var f=this.css("position"),c="absolute"===f,b=d?/(auto|scroll|hidden)/:/(auto|scroll)/,g=this.parents().filter(function(){var h=i(this);return c&&"static"===h.css("position")?!1:b.test(h.css("overflow")+h.css("overflow-y")+h.css("overflow-x"))}).eq(0);return"fixed"!==f&&g.length?g:i(this[0].ownerDocument||document)},uniqueId:function(){var b=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++b)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&i(this).removeAttr("id")})}}),i.extend(i.expr[":"],{data:i.expr.createPseudo?i.expr.createPseudo(function(b){return function(c){return !!i.data(c,b)}}):function(d,b,c){return !!i.data(d,c[3])},focusable:function(b){return k(b,!isNaN(i.attr(b,"tabindex")))},tabbable:function(b){var d=i.attr(b,"tabindex"),c=isNaN(d);return(c||d>=0)&&k(b,!c)}}),i("<a>").outerWidth(1).jquery||i.each(["Width","Height"],function(d,f){function c(p,s,m,t){return i.each(h,function(){s-=parseFloat(i.css(p,"padding"+this))||0,m&&(s-=parseFloat(i.css(p,"border"+this+"Width"))||0),t&&(s-=parseFloat(i.css(p,"margin"+this))||0)}),s}var h="Width"===f?["Left","Right"]:["Top","Bottom"],g=f.toLowerCase(),b={innerWidth:i.fn.innerWidth,innerHeight:i.fn.innerHeight,outerWidth:i.fn.outerWidth,outerHeight:i.fn.outerHeight};i.fn["inner"+f]=function(m){return void 0===m?b["inner"+f].call(this):this.each(function(){i(this).css(g,c(this,m)+"px")})},i.fn["outer"+f]=function(m,n){return"number"!=typeof m?b["outer"+f].call(this,m):this.each(function(){i(this).css(g,c(this,m,!0,n)+"px")})}}),i.fn.addBack||(i.fn.addBack=function(b){return this.add(null==b?this.prevObject:this.prevObject.filter(b))}),i("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(i.fn.removeData=function(b){return function(c){return arguments.length?b.call(this,i.camelCase(c)):b.call(this)}}(i.fn.removeData)),i.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),i.fn.extend({focus:function(b){return function(d,c){return"number"==typeof d?this.each(function(){var f=this;setTimeout(function(){i(f).focus(),c&&c.call(f)},d)}):b.apply(this,arguments)}}(i.fn.focus),disableSelection:function(){var b="onselectstart" in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(b+".ui-disableSelection",function(c){c.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(f){if(void 0!==f){return this.css("zIndex",f)}if(this.length){for(var b,d,c=i(this[0]);c.length&&c[0]!==document;){if(b=c.css("position"),("absolute"===b||"relative"===b||"fixed"===b)&&(d=parseInt(c.css("zIndex"),10),!isNaN(d)&&0!==d)){return d}c=c.parent()}}return 0}}),i.ui.plugin={add:function(d,f,c){var b,g=i.ui[d].prototype;for(b in c){g.plugins[b]=g.plugins[b]||[],g.plugins[b].push([f,c[b]])}},call:function(h,c,d,b){var g,f=h.plugins[c];if(f&&(b||h.element[0].parentNode&&11!==h.element[0].parentNode.nodeType)){for(g=0;f.length>g;g++){h.options[f[g][0]]&&f[g][1].apply(h.element,d)}}}};var j=0,e=Array.prototype.slice;i.cleanData=function(b){return function(g){var f,c,h;for(h=0;null!=(c=g[h]);h++){try{f=i._data(c,"events"),f&&f.remove&&i(c).triggerHandler("remove")}catch(d){}}b(g)}}(i.cleanData),i.widget=function(o,c,n){var f,r,g,h,b={},d=o.split(".")[0];return o=o.split(".")[1],f=d+"-"+o,n||(n=c,c=i.Widget),i.expr[":"][f.toLowerCase()]=function(m){return !!i.data(m,f)},i[d]=i[d]||{},r=i[d][o],g=i[d][o]=function(p,m){return this._createWidget?(arguments.length&&this._createWidget(p,m),void 0):new g(p,m)},i.extend(g,r,{version:n.version,_proto:i.extend({},n),_childConstructors:[]}),h=new c,h.options=i.widget.extend({},h.options),i.each(n,function(m,p){return i.isFunction(p)?(b[m]=function(){var q=function(){return c.prototype[m].apply(this,arguments)},s=function(t){return c.prototype[m].apply(this,t)};return function(){var t,u=this._super,v=this._superApply;return this._super=q,this._superApply=s,t=p.apply(this,arguments),this._super=u,this._superApply=v,t}}(),void 0):(b[m]=p,void 0)}),g.prototype=i.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix||o:o},b,{constructor:g,namespace:d,widgetName:o,widgetFullName:f}),r?(i.each(r._childConstructors,function(p,m){var q=m.prototype;i.widget(q.namespace+"."+q.widgetName,g,m._proto)}),delete r._childConstructors):c._childConstructors.push(g),i.widget.bridge(o,g),g},i.widget.extend=function(d){for(var f,c,g=e.call(arguments,1),h=0,b=g.length;b>h;h++){for(f in g[h]){c=g[h][f],g[h].hasOwnProperty(f)&&void 0!==c&&(d[f]=i.isPlainObject(c)?i.isPlainObject(d[f])?i.widget.extend({},d[f],c):i.widget.extend({},c):c)}}return d},i.widget.bridge=function(d,b){var c=b.prototype.widgetFullName||d;i.fn[d]=function(n){var f="string"==typeof n,g=e.call(arguments,1),h=this;return f?this.each(function(){var q,m=i.data(this,c);return"instance"===n?(h=m,!1):m?i.isFunction(m[n])&&"_"!==n.charAt(0)?(q=m[n].apply(m,g),q!==m&&void 0!==q?(h=q&&q.jquery?h.pushStack(q.get()):q,!1):void 0):i.error("no such method '"+n+"' for "+d+" widget instance"):i.error("cannot call methods on "+d+" prior to initialization; attempted to call method '"+n+"'")}):(g.length&&(n=i.widget.extend.apply(null,[n].concat(g))),this.each(function(){var m=i.data(this,c);m?(m.option(n||{}),m._init&&m._init()):i.data(this,c,new b(n,this))})),h}},i.Widget=function(){},i.Widget._childConstructors=[],i.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(c,b){b=i(b||this.defaultElement||this)[0],this.element=i(b),this.uuid=j++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=i(),this.hoverable=i(),this.focusable=i(),b!==this&&(i.data(b,this.widgetFullName,this),this._on(!0,this.element,{remove:function(d){d.target===b&&this.destroy()}}),this.document=i(b.style?b.ownerDocument:b.document||b),this.window=i(this.document[0].defaultView||this.document[0].parentWindow)),this.options=i.widget.extend({},this.options,this._getCreateOptions(),c),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:i.noop,_getCreateEventData:i.noop,_create:i.noop,_init:i.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(i.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:i.noop,widget:function(){return this.element},option:function(d,f){var c,h,g,b=d;if(0===arguments.length){return i.widget.extend({},this.options)}if("string"==typeof d){if(b={},c=d.split("."),d=c.shift(),c.length){for(h=b[d]=i.widget.extend({},this.options[d]),g=0;c.length-1>g;g++){h[c[g]]=h[c[g]]||{},h=h[c[g]]}if(d=c.pop(),1===arguments.length){return void 0===h[d]?null:h[d]}h[d]=f}else{if(1===arguments.length){return void 0===this.options[d]?null:this.options[d]}b[d]=f}}return this._setOptions(b),this},_setOptions:function(c){var b;for(b in c){this._setOption(b,c[b])}return this},_setOption:function(c,b){return this.options[c]=b,"disabled"===c&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!b),b&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(d,f,c){var b,g=this;"boolean"!=typeof d&&(c=f,f=d,d=!1),c?(f=b=i(f),this.bindings=this.bindings.add(f)):(c=f,f=this.element,b=this.widget()),i.each(c,function(s,o){function r(){return d||g.options.disabled!==!0&&!i(this).hasClass("ui-state-disabled")?("string"==typeof o?g[o]:o).apply(g,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||i.guid++);var u=s.match(/^([\w:-]*)\s*(.*)$/),h=u[1]+g.eventNamespace,m=u[2];m?b.delegate(m,h,r):f.bind(h,r)})},_off:function(c,b){b=(b||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,c.unbind(b).undelegate(b),this.bindings=i(this.bindings.not(c).get()),this.focusable=i(this.focusable.not(c).get()),this.hoverable=i(this.hoverable.not(c).get())},_delay:function(c,f){function b(){return("string"==typeof c?d[c]:c).apply(d,arguments)}var d=this;return setTimeout(b,f||0)},_hoverable:function(b){this.hoverable=this.hoverable.add(b),this._on(b,{mouseenter:function(c){i(c.currentTarget).addClass("ui-state-hover")},mouseleave:function(c){i(c.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(b){this.focusable=this.focusable.add(b),this._on(b,{focusin:function(c){i(c.currentTarget).addClass("ui-state-focus")},focusout:function(c){i(c.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(d,f,c){var h,g,b=this.options[d];if(c=c||{},f=i.Event(f),f.type=(d===this.widgetEventPrefix?d:this.widgetEventPrefix+d).toLowerCase(),f.target=this.element[0],g=f.originalEvent){for(h in g){h in f||(f[h]=g[h])}}return this.element.trigger(f,c),!(i.isFunction(b)&&b.apply(this.element[0],[f].concat(c))===!1||f.isDefaultPrevented())}},i.each({show:"fadeIn",hide:"fadeOut"},function(c,b){i.Widget.prototype["_"+c]=function(h,d,n){"string"==typeof d&&(d={effect:d});var f,g=d?d===!0||"number"==typeof d?b:d.effect||b:c;d=d||{},"number"==typeof d&&(d={duration:d}),f=!i.isEmptyObject(d),d.complete=n,d.delay&&h.delay(d.delay),f&&i.effects&&i.effects.effect[g]?h[c](d):g!==c&&h[g]?h[g](d.duration,d.easing,n):h.queue(function(m){i(this)[c](),n&&n.call(h[0]),m()})}}),i.widget;var a=!1;i(document).mouseup(function(){a=!1}),i.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(c){return b._mouseDown(c)}).bind("click."+this.widgetName,function(c){return !0===i.data(c.target,b.widgetName+".preventClickEvent")?(i.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(f){if(!a){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(f),this._mouseDownEvent=f;var b=this,d=1===f.which,c="string"==typeof this.options.cancel&&f.target.nodeName?i(f.target).closest(this.options.cancel).length:!1;return d&&!c&&this._mouseCapture(f)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(f)&&this._mouseDelayMet(f)&&(this._mouseStarted=this._mouseStart(f)!==!1,!this._mouseStarted)?(f.preventDefault(),!0):(!0===i.data(f.target,this.widgetName+".preventClickEvent")&&i.removeData(f.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(g){return b._mouseMove(g)},this._mouseUpDelegate=function(g){return b._mouseUp(g)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),f.preventDefault(),a=!0,!0)):!0}},_mouseMove:function(b){if(this._mouseMoved){if(i.ui.ie&&(!document.documentMode||9>document.documentMode)&&!b.button){return this._mouseUp(b)}if(!b.which){return this._mouseUp(b)}}return(b.which||b.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted)},_mouseUp:function(b){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target===this._mouseDownEvent.target&&i.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),a=!1,!1},_mouseDistanceMet:function(b){return Math.max(Math.abs(this._mouseDownEvent.pageX-b.pageX),Math.abs(this._mouseDownEvent.pageY-b.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return !0}}),i.widget("ui.draggable",i.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(c,b){this._super(c,b),"handle"===c&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(c){var b=this.options;return this._blurActiveElement(c),this.helper||b.disabled||i(c.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(c),this.handle?(this._blockFrames(b.iframeFix===!0?"iframe":b.iframeFix),!0):!1)},_blockFrames:function(b){this.iframeBlocks=this.document.find(b).map(function(){var c=i(this);return i("<div>").css("position","absolute").appendTo(c.parent()).outerWidth(c.outerWidth()).outerHeight(c.outerHeight()).offset(c.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(d){var b=this.document[0];if(this.handleElement.is(d.target)){try{b.activeElement&&"body"!==b.activeElement.nodeName.toLowerCase()&&i(b.activeElement).blur()}catch(c){}}},_mouseStart:function(c){var b=this.options;return this.helper=this._createHelper(c),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),i.ui.ddmanager&&(i.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===i(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(c),this.originalPosition=this.position=this._generatePosition(c,!1),this.originalPageX=c.pageX,this.originalPageY=c.pageY,b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt),this._setContainment(),this._trigger("start",c)===!1?(this._clear(),!1):(this._cacheHelperProportions(),i.ui.ddmanager&&!b.dropBehaviour&&i.ui.ddmanager.prepareOffsets(this,c),this._normalizeRightBottom(),this._mouseDrag(c,!0),i.ui.ddmanager&&i.ui.ddmanager.dragStart(this,c),!0)},_refreshOffsets:function(b){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:b.pageX-this.offset.left,top:b.pageY-this.offset.top}},_mouseDrag:function(d,b){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(d,!0),this.positionAbs=this._convertPositionTo("absolute"),!b){var c=this._uiHash();if(this._trigger("drag",d,c)===!1){return this._mouseUp({}),!1}this.position=c.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",i.ui.ddmanager&&i.ui.ddmanager.drag(this,d),!1},_mouseStop:function(d){var b=this,c=!1;return i.ui.ddmanager&&!this.options.dropBehaviour&&(c=i.ui.ddmanager.drop(this,d)),this.dropped&&(c=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!c||"valid"===this.options.revert&&c||this.options.revert===!0||i.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)?i(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",d)!==!1&&b._clear()}):this._trigger("stop",d)!==!1&&this._clear(),!1},_mouseUp:function(b){return this._unblockFrames(),i.ui.ddmanager&&i.ui.ddmanager.dragStop(this,b),this.handleElement.is(b.target)&&this.element.focus(),i.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){return this.options.handle?!!i(b.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(f){var b=this.options,d=i.isFunction(b.helper),c=d?i(b.helper.apply(this.element[0],[f])):"clone"===b.helper?this.element.clone().removeAttr("id"):this.element;return c.parents("body").length||c.appendTo("parent"===b.appendTo?this.element[0].parentNode:b.appendTo),d&&c[0]===this.element[0]&&this._setPositionRelative(),c[0]===this.element[0]||/(fixed|absolute)/.test(c.css("position"))||c.css("position","absolute"),c},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(b){"string"==typeof b&&(b=b.split(" ")),i.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)},_isRootNode:function(b){return/(html|body)/i.test(b.tagName)||b===this.document[0]},_getParentOffset:function(){var c=this.offsetParent.offset(),b=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==b&&i.contains(this.scrollParent[0],this.offsetParent[0])&&(c.left+=this.scrollParent.scrollLeft(),c.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(c={top:0,left:0}),{top:c.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:c.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition){return{top:0,left:0}}var c=this.element.position(),b=this._isRootNode(this.scrollParent[0]);return{top:c.top-(parseInt(this.helper.css("top"),10)||0)+(b?0:this.scrollParent.scrollTop()),left:c.left-(parseInt(this.helper.css("left"),10)||0)+(b?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d,f,c,b=this.options,g=this.document[0];return this.relativeContainer=null,b.containment?"window"===b.containment?(this.containment=[i(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,i(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,i(window).scrollLeft()+i(window).width()-this.helperProportions.width-this.margins.left,i(window).scrollTop()+(i(window).height()||g.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===b.containment?(this.containment=[0,0,i(g).width()-this.helperProportions.width-this.margins.left,(i(g).height()||g.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):b.containment.constructor===Array?(this.containment=b.containment,void 0):("parent"===b.containment&&(b.containment=this.helper[0].parentNode),f=i(b.containment),c=f[0],c&&(d=/(scroll|auto)/.test(f.css("overflow")),this.containment=[(parseInt(f.css("borderLeftWidth"),10)||0)+(parseInt(f.css("paddingLeft"),10)||0),(parseInt(f.css("borderTopWidth"),10)||0)+(parseInt(f.css("paddingTop"),10)||0),(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(f.css("borderRightWidth"),10)||0)-(parseInt(f.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(f.css("borderBottomWidth"),10)||0)-(parseInt(f.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=f),void 0):(this.containment=null,void 0)},_convertPositionTo:function(c,f){f||(f=this.position);var b="absolute"===c?1:-1,d=this._isRootNode(this.scrollParent[0]);return{top:f.top+this.offset.relative.top*b+this.offset.parent.top*b-("fixed"===this.cssPosition?-this.offset.scroll.top:d?0:this.offset.scroll.top)*b,left:f.left+this.offset.relative.left*b+this.offset.parent.left*b-("fixed"===this.cssPosition?-this.offset.scroll.left:d?0:this.offset.scroll.left)*b}},_generatePosition:function(r,n){var b,h,d,o,f=this.options,g=this._isRootNode(this.scrollParent[0]),s=r.pageX,c=r.pageY;return g&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),n&&(this.containment&&(this.relativeContainer?(h=this.relativeContainer.offset(),b=[this.containment[0]+h.left,this.containment[1]+h.top,this.containment[2]+h.left,this.containment[3]+h.top]):b=this.containment,r.pageX-this.offset.click.left<b[0]&&(s=b[0]+this.offset.click.left),r.pageY-this.offset.click.top<b[1]&&(c=b[1]+this.offset.click.top),r.pageX-this.offset.click.left>b[2]&&(s=b[2]+this.offset.click.left),r.pageY-this.offset.click.top>b[3]&&(c=b[3]+this.offset.click.top)),f.grid&&(d=f.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/f.grid[1])*f.grid[1]:this.originalPageY,c=b?d-this.offset.click.top>=b[1]||d-this.offset.click.top>b[3]?d:d-this.offset.click.top>=b[1]?d-f.grid[1]:d+f.grid[1]:d,o=f.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/f.grid[0])*f.grid[0]:this.originalPageX,s=b?o-this.offset.click.left>=b[0]||o-this.offset.click.left>b[2]?o:o-this.offset.click.left>=b[0]?o-f.grid[0]:o+f.grid[0]:o),"y"===f.axis&&(s=this.originalPageX),"x"===f.axis&&(c=this.originalPageY)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:g?0:this.offset.scroll.top),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:g?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(d,b,c){return c=c||this._uiHash(),i.ui.plugin.call(this,d,[b,c,this],!0),/^(drag|start|stop)/.test(d)&&(this.positionAbs=this._convertPositionTo("absolute"),c.offset=this.positionAbs),i.Widget.prototype._trigger.call(this,d,b,c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),i.ui.plugin.add("draggable","connectToSortable",{start:function(f,b,d){var c=i.extend({},b,{item:d.element});d.sortables=[],i(d.options.connectToSortable).each(function(){var g=i(this).sortable("instance");g&&!g.options.disabled&&(d.sortables.push(g),g.refreshPositions(),g._trigger("activate",f,c))})},stop:function(f,b,d){var c=i.extend({},b,{item:d.element});d.cancelHelperRemoval=!1,i.each(d.sortables,function(){var g=this;g.isOver?(g.isOver=0,d.cancelHelperRemoval=!0,g.cancelHelperRemoval=!1,g._storedCSS={position:g.placeholder.css("position"),top:g.placeholder.css("top"),left:g.placeholder.css("left")},g._mouseStop(f),g.options.helper=g.options._helper):(g.cancelHelperRemoval=!0,g._trigger("deactivate",f,c))})},drag:function(d,b,c){i.each(c.sortables,function(){var f=!1,g=this;g.positionAbs=c.positionAbs,g.helperProportions=c.helperProportions,g.offset.click=c.offset.click,g._intersectsWith(g.containerCache)&&(f=!0,i.each(c.sortables,function(){return this.positionAbs=c.positionAbs,this.helperProportions=c.helperProportions,this.offset.click=c.offset.click,this!==g&&this._intersectsWith(this.containerCache)&&i.contains(g.element[0],this.element[0])&&(f=!1),f})),f?(g.isOver||(g.isOver=1,c._parent=b.helper.parent(),g.currentItem=b.helper.appendTo(g.element).data("ui-sortable-item",!0),g.options._helper=g.options.helper,g.options.helper=function(){return b.helper[0]},d.target=g.currentItem[0],g._mouseCapture(d,!0),g._mouseStart(d,!0,!0),g.offset.click.top=c.offset.click.top,g.offset.click.left=c.offset.click.left,g.offset.parent.left-=c.offset.parent.left-g.offset.parent.left,g.offset.parent.top-=c.offset.parent.top-g.offset.parent.top,c._trigger("toSortable",d),c.dropped=g.element,i.each(c.sortables,function(){this.refreshPositions()}),c.currentItem=c.element,g.fromOutside=c),g.currentItem&&(g._mouseDrag(d),b.position=g.position)):g.isOver&&(g.isOver=0,g.cancelHelperRemoval=!0,g.options._revert=g.options.revert,g.options.revert=!1,g._trigger("out",d,g._uiHash(g)),g._mouseStop(d,!0),g.options.revert=g.options._revert,g.options.helper=g.options._helper,g.placeholder&&g.placeholder.remove(),b.helper.appendTo(c._parent),c._refreshOffsets(d),b.position=c._generatePosition(d,!0),c._trigger("fromSortable",d),c.dropped=!1,i.each(c.sortables,function(){this.refreshPositions()}))})}}),i.ui.plugin.add("draggable","cursor",{start:function(d,f,c){var b=i("body"),g=c.options;b.css("cursor")&&(g._cursor=b.css("cursor")),b.css("cursor",g.cursor)},stop:function(f,b,d){var c=d.options;c._cursor&&i("body").css("cursor",c._cursor)}}),i.ui.plugin.add("draggable","opacity",{start:function(d,f,c){var b=i(f.helper),g=c.options;b.css("opacity")&&(g._opacity=b.css("opacity")),b.css("opacity",g.opacity)},stop:function(f,b,d){var c=d.options;c._opacity&&i(b.helper).css("opacity",c._opacity)}}),i.ui.plugin.add("draggable","scroll",{start:function(c,d,b){b.scrollParentNotHidden||(b.scrollParentNotHidden=b.helper.scrollParent(!1)),b.scrollParentNotHidden[0]!==b.document[0]&&"HTML"!==b.scrollParentNotHidden[0].tagName&&(b.overflowOffset=b.scrollParentNotHidden.offset())},drag:function(d,f,c){var g=c.options,n=!1,h=c.scrollParentNotHidden[0],b=c.document[0];h!==b&&"HTML"!==h.tagName?(g.axis&&"x"===g.axis||(c.overflowOffset.top+h.offsetHeight-d.pageY<g.scrollSensitivity?h.scrollTop=n=h.scrollTop+g.scrollSpeed:d.pageY-c.overflowOffset.top<g.scrollSensitivity&&(h.scrollTop=n=h.scrollTop-g.scrollSpeed)),g.axis&&"y"===g.axis||(c.overflowOffset.left+h.offsetWidth-d.pageX<g.scrollSensitivity?h.scrollLeft=n=h.scrollLeft+g.scrollSpeed:d.pageX-c.overflowOffset.left<g.scrollSensitivity&&(h.scrollLeft=n=h.scrollLeft-g.scrollSpeed))):(g.axis&&"x"===g.axis||(d.pageY-i(b).scrollTop()<g.scrollSensitivity?n=i(b).scrollTop(i(b).scrollTop()-g.scrollSpeed):i(window).height()-(d.pageY-i(b).scrollTop())<g.scrollSensitivity&&(n=i(b).scrollTop(i(b).scrollTop()+g.scrollSpeed))),g.axis&&"y"===g.axis||(d.pageX-i(b).scrollLeft()<g.scrollSensitivity?n=i(b).scrollLeft(i(b).scrollLeft()-g.scrollSpeed):i(window).width()-(d.pageX-i(b).scrollLeft())<g.scrollSensitivity&&(n=i(b).scrollLeft(i(b).scrollLeft()+g.scrollSpeed)))),n!==!1&&i.ui.ddmanager&&!g.dropBehaviour&&i.ui.ddmanager.prepareOffsets(c,d)}}),i.ui.plugin.add("draggable","snap",{start:function(f,b,d){var c=d.options;d.snapElements=[],i(c.snap.constructor!==String?c.snap.items||":data(ui-draggable)":c.snap).each(function(){var g=i(this),h=g.offset();this!==d.element[0]&&d.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:h.top,left:h.left})})},drag:function(v,r,n){var u,b,y,h,p,s,M,g,f,d,m=n.options,t=m.snapTolerance,o=r.offset.left,N=o+n.helperProportions.width,O=r.offset.top,c=O+n.helperProportions.height;for(f=n.snapElements.length-1;f>=0;f--){p=n.snapElements[f].left-n.margins.left,s=p+n.snapElements[f].width,M=n.snapElements[f].top-n.margins.top,g=M+n.snapElements[f].height,p-t>N||o>s+t||M-t>c||O>g+t||!i.contains(n.snapElements[f].item.ownerDocument,n.snapElements[f].item)?(n.snapElements[f].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,v,i.extend(n._uiHash(),{snapItem:n.snapElements[f].item})),n.snapElements[f].snapping=!1):("inner"!==m.snapMode&&(u=t>=Math.abs(M-c),b=t>=Math.abs(g-O),y=t>=Math.abs(p-N),h=t>=Math.abs(s-o),u&&(r.position.top=n._convertPositionTo("relative",{top:M-n.helperProportions.height,left:0}).top),b&&(r.position.top=n._convertPositionTo("relative",{top:g,left:0}).top),y&&(r.position.left=n._convertPositionTo("relative",{top:0,left:p-n.helperProportions.width}).left),h&&(r.position.left=n._convertPositionTo("relative",{top:0,left:s}).left)),d=u||b||y||h,"outer"!==m.snapMode&&(u=t>=Math.abs(M-O),b=t>=Math.abs(g-c),y=t>=Math.abs(p-o),h=t>=Math.abs(s-N),u&&(r.position.top=n._convertPositionTo("relative",{top:M,left:0}).top),b&&(r.position.top=n._convertPositionTo("relative",{top:g-n.helperProportions.height,left:0}).top),y&&(r.position.left=n._convertPositionTo("relative",{top:0,left:p}).left),h&&(r.position.left=n._convertPositionTo("relative",{top:0,left:s-n.helperProportions.width}).left)),!n.snapElements[f].snapping&&(u||b||y||h||d)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,v,i.extend(n._uiHash(),{snapItem:n.snapElements[f].item})),n.snapElements[f].snapping=u||b||y||h||d)}}}),i.ui.plugin.add("draggable","stack",{start:function(d,f,c){var h,g=c.options,b=i.makeArray(i(g.stack)).sort(function(o,m){return(parseInt(i(o).css("zIndex"),10)||0)-(parseInt(i(m).css("zIndex"),10)||0)});b.length&&(h=parseInt(i(b[0]).css("zIndex"),10)||0,i(b).each(function(m){i(this).css("zIndex",h+m)}),this.css("zIndex",h+b.length))}}),i.ui.plugin.add("draggable","zIndex",{start:function(d,f,c){var b=i(f.helper),g=c.options;b.css("zIndex")&&(g._zIndex=b.css("zIndex")),b.css("zIndex",g.zIndex)},stop:function(f,b,d){var c=d.options;c._zIndex&&i(b.helper).css("zIndex",c._zIndex)}}),i.ui.draggable});