(function(t){if(typeof define==="function"&&define.amd){define(["jquery"],t)}else{t(jQuery)}})(function(S){S.ui=S.ui||{};S.extend(S.ui,{version:"1.11.2",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}});S.fn.extend({scrollParent:function(t){var e=this.css("position"),i=e==="absolute",s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.parents().filter(function(){var t=S(this);if(i&&t.css("position")==="static"){return false}return s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return e==="fixed"||!n.length?S(this[0].ownerDocument||document):n},uniqueId:function(){var t=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+ ++t}})}}(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){S(this).removeAttr("id")}})}});function s(t,e){var i,s,n,o=t.nodeName.toLowerCase();if("area"===o){i=t.parentNode;s=i.name;if(!t.href||!s||i.nodeName.toLowerCase()!=="map"){return false}n=S("img[usemap='#"+s+"']")[0];return!!n&&r(n)}return(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||e:e)&&r(t)}function r(t){return S.expr.filters.visible(t)&&!S(t).parents().addBack().filter(function(){return S.css(this,"visibility")==="hidden"}).length}S.extend(S.expr[":"],{data:S.expr.createPseudo?S.expr.createPseudo(function(e){return function(t){return!!S.data(t,e)}}):function(t,e,i){return!!S.data(t,i[3])},focusable:function(t){return s(t,!isNaN(S.attr(t,"tabindex")))},tabbable:function(t){var e=S.attr(t,"tabindex"),i=isNaN(e);return(i||e>=0)&&s(t,!i)}});if(!S("<a>").outerWidth(1).jquery){S.each(["Width","Height"],function(t,i){var n=i==="Width"?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),o={innerWidth:S.fn.innerWidth,innerHeight:S.fn.innerHeight,outerWidth:S.fn.outerWidth,outerHeight:S.fn.outerHeight};function r(t,e,i,s){S.each(n,function(){e-=parseFloat(S.css(t,"padding"+this))||0;if(i){e-=parseFloat(S.css(t,"border"+this+"Width"))||0}if(s){e-=parseFloat(S.css(t,"margin"+this))||0}});return e}S.fn["inner"+i]=function(t){if(t===undefined){return o["inner"+i].call(this)}return this.each(function(){S(this).css(s,r(this,t)+"px")})};S.fn["outer"+i]=function(t,e){if(typeof t!=="number"){return o["outer"+i].call(this,t)}return this.each(function(){S(this).css(s,r(this,t,true,e)+"px")})}})}if(!S.fn.addBack){S.fn.addBack=function(t){return this.add(t==null?this.prevObject:this.prevObject.filter(t))}}if(S("<a>").data("a-b","a").removeData("a-b").data("a-b")){S.fn.removeData=function(e){return function(t){if(arguments.length){return e.call(this,S.camelCase(t))}else{return e.call(this)}}}(S.fn.removeData)}S.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());S.fn.extend({focus:function(t){return function(e,i){return typeof e==="number"?this.each(function(){var t=this;setTimeout(function(){S(t).focus();if(i){i.call(t)}},e)}):t.apply(this,arguments)}}(S.fn.focus),disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(t!==undefined){return this.css("zIndex",t)}if(this.length){var e=S(this[0]),i,s;while(e.length&&e[0]!==document){i=e.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(e.css("zIndex"),10);if(!isNaN(s)&&s!==0){return s}}e=e.parent()}}return 0}});S.ui.plugin={add:function(t,e,i){var s,n=S.ui[t].prototype;for(s in i){n.plugins[s]=n.plugins[s]||[];n.plugins[s].push([e,i[s]])}},call:function(t,e,i,s){var n,o=t.plugins[e];if(!o){return}if(!s&&(!t.element[0].parentNode||t.element[0].parentNode.nodeType===11)){return}for(n=0;n<o.length;n++){if(t.options[o[n][0]]){o[n][1].apply(t.element,i)}}}};var i=0,a=Array.prototype.slice;S.cleanData=function(n){return function(t){var e,i,s;for(s=0;(i=t[s])!=null;s++){try{e=S._data(i,"events");if(e&&e.remove){S(i).triggerHandler("remove")}}catch(t){}}n(t)}}(S.cleanData);S.widget=function(t,i,e){var s,n,o,r,a={},l=t.split(".")[0];t=t.split(".")[1];s=l+"-"+t;if(!e){e=i;i=S.Widget}S.expr[":"][s.toLowerCase()]=function(t){return!!S.data(t,s)};S[l]=S[l]||{};n=S[l][t];o=S[l][t]=function(t,e){if(!this._createWidget){return new o(t,e)}if(arguments.length){this._createWidget(t,e)}};S.extend(o,n,{version:e.version,_proto:S.extend({},e),_childConstructors:[]});r=new i;r.options=S.widget.extend({},r.options);S.each(e,function(e,o){if(!S.isFunction(o)){a[e]=o;return}a[e]=function(){var s=function(){return i.prototype[e].apply(this,arguments)},n=function(t){return i.prototype[e].apply(this,t)};return function(){var t=this._super,e=this._superApply,i;this._super=s;this._superApply=n;i=o.apply(this,arguments);this._super=t;this._superApply=e;return i}}()});o.prototype=S.widget.extend(r,{widgetEventPrefix:n?r.widgetEventPrefix||t:t},a,{constructor:o,namespace:l,widgetName:t,widgetFullName:s});if(n){S.each(n._childConstructors,function(t,e){var i=e.prototype;S.widget(i.namespace+"."+i.widgetName,o,e._proto)});delete n._childConstructors}else{i._childConstructors.push(o)}S.widget.bridge(t,o);return o};S.widget.extend=function(t){var e=a.call(arguments,1),i=0,s=e.length,n,o;for(;i<s;i++){for(n in e[i]){o=e[i][n];if(e[i].hasOwnProperty(n)&&o!==undefined){if(S.isPlainObject(o)){t[n]=S.isPlainObject(t[n])?S.widget.extend({},t[n],o):S.widget.extend({},o)}else{t[n]=o}}}}return t};S.widget.bridge=function(o,e){var r=e.prototype.widgetFullName||o;S.fn[o]=function(i){var t=typeof i==="string",s=a.call(arguments,1),n=this;i=!t&&s.length?S.widget.extend.apply(null,[i].concat(s)):i;if(t){this.each(function(){var t,e=S.data(this,r);if(i==="instance"){n=e;return false}if(!e){return S.error("cannot call methods on "+o+" prior to initialization; "+"attempted to call method '"+i+"'")}if(!S.isFunction(e[i])||i.charAt(0)==="_"){return S.error("no such method '"+i+"' for "+o+" widget instance")}t=e[i].apply(e,s);if(t!==e&&t!==undefined){n=t&&t.jquery?n.pushStack(t.get()):t;return false}})}else{this.each(function(){var t=S.data(this,r);if(t){t.option(i||{});if(t._init){t._init()}}else{S.data(this,r,new e(i,this))}})}return n}};S.Widget=function(){};S.Widget._childConstructors=[];S.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(t,e){e=S(e||this.defaultElement||this)[0];this.element=S(e);this.uuid=i++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=S();this.hoverable=S();this.focusable=S();if(e!==this){S.data(e,this.widgetFullName,this);this._on(true,this.element,{remove:function(t){if(t.target===e){this.destroy()}}});this.document=S(e.style?e.ownerDocument:e.document||e);this.window=S(this.document[0].defaultView||this.document[0].parentWindow)}this.options=S.widget.extend({},this.options,this._getCreateOptions(),t);this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:S.noop,_getCreateEventData:S.noop,_create:S.noop,_init:S.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(S.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:S.noop,widget:function(){return this.element},option:function(t,e){var i=t,s,n,o;if(arguments.length===0){return S.widget.extend({},this.options)}if(typeof t==="string"){i={};s=t.split(".");t=s.shift();if(s.length){n=i[t]=S.widget.extend({},this.options[t]);for(o=0;o<s.length-1;o++){n[s[o]]=n[s[o]]||{};n=n[s[o]]}t=s.pop();if(arguments.length===1){return n[t]===undefined?null:n[t]}n[t]=e}else{if(arguments.length===1){return this.options[t]===undefined?null:this.options[t]}i[t]=e}}this._setOptions(i);return this},_setOptions:function(t){var e;for(e in t){this._setOption(e,t[e])}return this},_setOption:function(t,e){this.options[t]=e;if(t==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!e);if(e){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}}return this},enable:function(){return this._setOptions({disabled:false})},disable:function(){return this._setOptions({disabled:true})},_on:function(r,a,t){var l,h=this;if(typeof r!=="boolean"){t=a;a=r;r=false}if(!t){t=a;a=this.element;l=this.widget()}else{a=l=S(a);this.bindings=this.bindings.add(a)}S.each(t,function(t,e){function i(){if(!r&&(h.options.disabled===true||S(this).hasClass("ui-state-disabled"))){return}return(typeof e==="string"?h[e]:e).apply(h,arguments)}if(typeof e!=="string"){i.guid=e.guid=e.guid||i.guid||S.guid++}var s=t.match(/^([\w:-]*)\s*(.*)$/),n=s[1]+h.eventNamespace,o=s[2];if(o){l.delegate(o,n,i)}else{a.bind(n,i)}})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;t.unbind(e).undelegate(e);this.bindings=S(this.bindings.not(t).get());this.focusable=S(this.focusable.not(t).get());this.hoverable=S(this.hoverable.not(t).get())},_delay:function(t,e){function i(){return(typeof t==="string"?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t);this._on(t,{mouseenter:function(t){S(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){S(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t);this._on(t,{focusin:function(t){S(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){S(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];i=i||{};e=S.Event(e);e.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase();e.target=this.element[0];n=e.originalEvent;if(n){for(s in n){if(!(s in e)){e[s]=n[s]}}}this.element.trigger(e,i);return!(S.isFunction(o)&&o.apply(this.element[0],[e].concat(i))===false||e.isDefaultPrevented())}};S.each({show:"fadeIn",hide:"fadeOut"},function(o,r){S.Widget.prototype["_"+o]=function(e,t,i){if(typeof t==="string"){t={effect:t}}var s,n=!t?o:t===true||typeof t==="number"?r:t.effect||r;t=t||{};if(typeof t==="number"){t={duration:t}}s=!S.isEmptyObject(t);t.complete=i;if(t.delay){e.delay(t.delay)}if(s&&S.effects&&S.effects.effect[n]){e[o](t)}else if(n!==o&&e[n]){e[n](t.duration,t.easing,i)}else{e.queue(function(t){S(this)[o]();if(i){i.call(e[0])}t()})}}});var t=S.widget;var n=false;S(document).mouseup(function(){n=false});var e=S.widget("ui.mouse",{version:"1.11.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(t){if(true===S.data(t.target,e.widgetName+".preventClickEvent")){S.removeData(t.target,e.widgetName+".preventClickEvent");t.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(t){if(n){return}this._mouseMoved=false;this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var e=this,i=t.which===1,s=typeof this.options.cancel==="string"&&t.target.nodeName?S(t.target).closest(this.options.cancel).length:false;if(!i||s||!this._mouseCapture(t)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==false;if(!this._mouseStarted){t.preventDefault();return true}}if(true===S.data(t.target,this.widgetName+".preventClickEvent")){S.removeData(t.target,this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(t){return e._mouseMove(t)};this._mouseUpDelegate=function(t){return e._mouseUp(t)};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);t.preventDefault();n=true;return true},_mouseMove:function(t){if(this._mouseMoved){if(S.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button){return this._mouseUp(t)}else if(!t.which){return this._mouseUp(t)}}if(t.which||t.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(t);return t.preventDefault()}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==false;this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)}return!this._mouseStarted},_mouseUp:function(t){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(t.target===this._mouseDownEvent.target){S.data(t.target,this.widgetName+".preventClickEvent",true)}this._mouseStop(t)}n=false;return false},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});(function(){S.ui=S.ui||{};var n,P,x=Math.max,z=Math.abs,C=Math.round,s=/left|center|right/,o=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,a=/^\w+/,l=/%$/,e=S.fn.position;function I(t,e,i){return[parseFloat(t[0])*(l.test(t[0])?e/100:1),parseFloat(t[1])*(l.test(t[1])?i/100:1)]}function H(t,e){return parseInt(S.css(t,e),10)||0}function i(t){var e=t[0];if(e.nodeType===9){return{width:t.width(),height:t.height(),offset:{top:0,left:0}}}if(S.isWindow(e)){return{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}}if(e.preventDefault){return{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}}return{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}S.position={scrollbarWidth:function(){if(n!==undefined){return n}var t,e,i=S("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=i.children()[0];S("body").append(i);t=s.offsetWidth;i.css("overflow","scroll");e=s.offsetWidth;if(t===e){e=i[0].clientWidth}i.remove();return n=t-e},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s=e==="scroll"||e==="auto"&&t.width<t.element[0].scrollWidth,n=i==="scroll"||i==="auto"&&t.height<t.element[0].scrollHeight;return{width:n?S.position.scrollbarWidth():0,height:s?S.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=S(t||window),i=S.isWindow(e[0]),s=!!e[0]&&e[0].nodeType===9;return{element:e,isWindow:i,isDocument:s,offset:e.offset()||{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:i||s?e.width():e.outerWidth(),height:i||s?e.height():e.outerHeight()}}};S.fn.position=function(c){if(!c||!c.of){return e.apply(this,arguments)}c=S.extend({},c);var u,p,d,g,m,t,v=S(c.of),_=S.position.getWithinInfo(c.within),b=S.position.getScrollInfo(_),w=(c.collision||"flip").split(" "),y={};t=i(v);if(v[0].preventDefault){c.at="left top"}p=t.width;d=t.height;g=t.offset;m=S.extend({},g);S.each(["my","at"],function(){var t=(c[this]||"").split(" "),e,i;if(t.length===1){t=s.test(t[0])?t.concat(["center"]):o.test(t[0])?["center"].concat(t):["center","center"]}t[0]=s.test(t[0])?t[0]:"center";t[1]=o.test(t[1])?t[1]:"center";e=r.exec(t[0]);i=r.exec(t[1]);y[this]=[e?e[0]:0,i?i[0]:0];c[this]=[a.exec(t[0])[0],a.exec(t[1])[0]]});if(w.length===1){w[1]=w[0]}if(c.at[0]==="right"){m.left+=p}else if(c.at[0]==="center"){m.left+=p/2}if(c.at[1]==="bottom"){m.top+=d}else if(c.at[1]==="center"){m.top+=d/2}u=I(y.at,p,d);m.left+=u[0];m.top+=u[1];return this.each(function(){var i,t,r=S(this),a=r.outerWidth(),l=r.outerHeight(),e=H(this,"marginLeft"),s=H(this,"marginTop"),n=a+e+H(this,"marginRight")+b.width,o=l+s+H(this,"marginBottom")+b.height,h=S.extend({},m),f=I(y.my,r.outerWidth(),r.outerHeight());if(c.my[0]==="right"){h.left-=a}else if(c.my[0]==="center"){h.left-=a/2}if(c.my[1]==="bottom"){h.top-=l}else if(c.my[1]==="center"){h.top-=l/2}h.left+=f[0];h.top+=f[1];if(!P){h.left=C(h.left);h.top=C(h.top)}i={marginLeft:e,marginTop:s};S.each(["left","top"],function(t,e){if(S.ui.position[w[t]]){S.ui.position[w[t]][e](h,{targetWidth:p,targetHeight:d,elemWidth:a,elemHeight:l,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[u[0]+f[0],u[1]+f[1]],my:c.my,at:c.at,within:_,elem:r})}});if(c.using){t=function(t){var e=g.left-h.left,i=e+p-a,s=g.top-h.top,n=s+d-l,o={target:{element:v,left:g.left,top:g.top,width:p,height:d},element:{element:r,left:h.left,top:h.top,width:a,height:l},horizontal:i<0?"left":e>0?"right":"center",vertical:n<0?"top":s>0?"bottom":"middle"};if(p<a&&z(e+i)<p){o.horizontal="center"}if(d<l&&z(s+n)<d){o.vertical="middle"}if(x(z(e),z(i))>x(z(s),z(n))){o.important="horizontal"}else{o.important="vertical"}c.using.call(this,t,o)}}r.offset(S.extend(h,{using:t}))})};S.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,r=s-o,a=o+e.collisionWidth-n-s,l;if(e.collisionWidth>n){if(r>0&&a<=0){l=t.left+r+e.collisionWidth-n-s;t.left+=r-l}else if(a>0&&r<=0){t.left=s}else{if(r>a){t.left=s+n-e.collisionWidth}else{t.left=s}}}else if(r>0){t.left+=r}else if(a>0){t.left-=a}else{t.left=x(t.left-o,t.left)}},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,r=s-o,a=o+e.collisionHeight-n-s,l;if(e.collisionHeight>n){if(r>0&&a<=0){l=t.top+r+e.collisionHeight-n-s;t.top+=r-l}else if(a>0&&r<=0){t.top=s}else{if(r>a){t.top=s+n-e.collisionHeight}else{t.top=s}}}else if(r>0){t.top+=r}else if(a>0){t.top-=a}else{t.top=x(t.top-o,t.top)}}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,r=t.left-e.collisionPosition.marginLeft,a=r-o,l=r+e.collisionWidth-n-o,h=e.my[0]==="left"?-e.elemWidth:e.my[0]==="right"?e.elemWidth:0,f=e.at[0]==="left"?e.targetWidth:e.at[0]==="right"?-e.targetWidth:0,c=-2*e.offset[0],u,p;if(a<0){u=t.left+h+f+c+e.collisionWidth-n-s;if(u<0||u<z(a)){t.left+=h+f+c}}else if(l>0){p=t.left-e.collisionPosition.marginLeft+h+f+c-o;if(p>0||z(p)<l){t.left+=h+f+c}}},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,r=t.top-e.collisionPosition.marginTop,a=r-o,l=r+e.collisionHeight-n-o,h=e.my[1]==="top",f=h?-e.elemHeight:e.my[1]==="bottom"?e.elemHeight:0,c=e.at[1]==="top"?e.targetHeight:e.at[1]==="bottom"?-e.targetHeight:0,u=-2*e.offset[1],p,d;if(a<0){d=t.top+f+c+u+e.collisionHeight-n-s;if(t.top+f+c+u>a&&(d<0||d<z(a))){t.top+=f+c+u}}else if(l>0){p=t.top-e.collisionPosition.marginTop+f+c+u-o;if(t.top+f+c+u>l&&(p>0||z(p)<l)){t.top+=f+c+u}}}},flipfit:{left:function(){S.ui.position.flip.left.apply(this,arguments);S.ui.position.fit.left.apply(this,arguments)},top:function(){S.ui.position.flip.top.apply(this,arguments);S.ui.position.fit.top.apply(this,arguments)}}};(function(){var t,e,i,s,n,o=document.getElementsByTagName("body")[0],r=document.createElement("div");t=document.createElement(o?"div":"body");i={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(o){S.extend(i,{position:"absolute",left:"-1000px",top:"-1000px"})}for(n in i){t.style[n]=i[n]}t.appendChild(r);e=o||document.documentElement;e.insertBefore(t,e.firstChild);r.style.cssText="position: absolute; left: 10.7432222px;";s=S(r).offset().left;P=s>10&&s<11;t.innerHTML="";e.removeChild(t)})()})();var o=S.ui.position;S.widget("ui.draggable",S.ui.mouse,{version:"1.11.2",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(this.options.addClasses){this.element.addClass("ui-draggable")}if(this.options.disabled){this.element.addClass("ui-draggable-disabled")}this._setHandleClassName();this._mouseInit()},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(t){var e=this.options;this._blurActiveElement(t);if(this.helper||e.disabled||S(t.target).closest(".ui-resizable-handle").length>0){return false}this.handle=this._getHandle(t);if(!this.handle){return false}this._blockFrames(e.iframeFix===true?"iframe":e.iframeFix);return true},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=S(this);return S("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(t){var e=this.document[0];if(!this.handleElement.is(t.target)){return}try{if(e.activeElement&&e.activeElement.nodeName.toLowerCase()!=="body"){S(e.activeElement).blur()}}catch(t){}},_mouseStart:function(t){var e=this.options;this.helper=this._createHelper(t);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();if(S.ui.ddmanager){S.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return S(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(t);this.originalPosition=this.position=this._generatePosition(t,false);this.originalPageX=t.pageX;this.originalPageY=t.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);this._setContainment();if(this._trigger("start",t)===false){this._clear();return false}this._cacheHelperProportions();if(S.ui.ddmanager&&!e.dropBehaviour){S.ui.ddmanager.prepareOffsets(this,t)}this._normalizeRightBottom();this._mouseDrag(t,true);if(S.ui.ddmanager){S.ui.ddmanager.dragStart(this,t)}return true},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(t,true);this.positionAbs=this._convertPositionTo("absolute");if(!e){var i=this._uiHash();if(this._trigger("drag",t,i)===false){this._mouseUp({});return false}this.position=i.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(S.ui.ddmanager){S.ui.ddmanager.drag(this,t)}return false},_mouseStop:function(t){var e=this,i=false;if(S.ui.ddmanager&&!this.options.dropBehaviour){i=S.ui.ddmanager.drop(this,t)}if(this.dropped){i=this.dropped;this.dropped=false}if(this.options.revert==="invalid"&&!i||this.options.revert==="valid"&&i||this.options.revert===true||S.isFunction(this.options.revert)&&this.options.revert.call(this.element,i)){S(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(e._trigger("stop",t)!==false){e._clear()}})}else{if(this._trigger("stop",t)!==false){this._clear()}}return false},_mouseUp:function(t){this._unblockFrames();if(S.ui.ddmanager){S.ui.ddmanager.dragStop(this,t)}if(this.handleElement.is(t.target)){this.element.focus()}return S.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({})}else{this._clear()}return this},_getHandle:function(t){return this.options.handle?!!S(t.target).closest(this.element.find(this.options.handle)).length:true},_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(t){var e=this.options,i=S.isFunction(e.helper),s=i?S(e.helper.apply(this.element[0],[t])):e.helper==="clone"?this.element.clone().removeAttr("id"):this.element;if(!s.parents("body").length){s.appendTo(e.appendTo==="parent"?this.element[0].parentNode:e.appendTo)}if(i&&s[0]===this.element[0]){this._setPositionRelative()}if(s[0]!==this.element[0]&&!/(fixed|absolute)/.test(s.css("position"))){s.css("position","absolute")}return s},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(t){if(typeof t==="string"){t=t.split(" ")}if(S.isArray(t)){t={left:+t[0],top:+t[1]||0}}if("left"in t){this.offset.click.left=t.left+this.margins.left}if("right"in t){this.offset.click.left=this.helperProportions.width-t.right+this.margins.left}if("top"in t){this.offset.click.top=t.top+this.margins.top}if("bottom"in t){this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top}},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==e&&S.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){t={top:0,left:0}}return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(!e?this.scrollParent.scrollTop():0),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(!e?this.scrollParent.scrollLeft():0)}},_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 t,e,i,s=this.options,n=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return}if(s.containment==="window"){this.containment=[S(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,S(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,S(window).scrollLeft()+S(window).width()-this.helperProportions.width-this.margins.left,S(window).scrollTop()+(S(window).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment==="document"){this.containment=[0,0,S(n).width()-this.helperProportions.width-this.margins.left,(S(n).height()||n.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment.constructor===Array){this.containment=s.containment;return}if(s.containment==="parent"){s.containment=this.helper[0].parentNode}e=S(s.containment);i=e[0];if(!i){return}t=/(scroll|auto)/.test(e.css("overflow"));this.containment=[(parseInt(e.css("borderLeftWidth"),10)||0)+(parseInt(e.css("paddingLeft"),10)||0),(parseInt(e.css("borderTopWidth"),10)||0)+(parseInt(e.css("paddingTop"),10)||0),(t?Math.max(i.scrollWidth,i.offsetWidth):i.offsetWidth)-(parseInt(e.css("borderRightWidth"),10)||0)-(parseInt(e.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(i.scrollHeight,i.offsetHeight):i.offsetHeight)-(parseInt(e.css("borderBottomWidth"),10)||0)-(parseInt(e.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=e},_convertPositionTo:function(t,e){if(!e){e=this.position}var i=t==="absolute"?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,r=this.options,a=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;if(!a||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(e){if(this.containment){if(this.relativeContainer){s=this.relativeContainer.offset();i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]}else{i=this.containment}if(t.pageX-this.offset.click.left<i[0]){l=i[0]+this.offset.click.left}if(t.pageY-this.offset.click.top<i[1]){h=i[1]+this.offset.click.top}if(t.pageX-this.offset.click.left>i[2]){l=i[2]+this.offset.click.left}if(t.pageY-this.offset.click.top>i[3]){h=i[3]+this.offset.click.top}}if(r.grid){n=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY;h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-r.grid[1]:n+r.grid[1]:n;o=r.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX;l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-r.grid[0]:o+r.grid[0]:o}if(r.axis==="y"){l=this.originalPageX}if(r.axis==="x"){h=this.originalPageY}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:a?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:a?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_normalizeRightBottom:function(){if(this.options.axis!=="y"&&this.helper.css("right")!=="auto"){this.helper.width(this.helper.width());this.helper.css("right","auto")}if(this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"){this.helper.height(this.helper.height());this.helper.css("bottom","auto")}},_trigger:function(t,e,i){i=i||this._uiHash();S.ui.plugin.call(this,t,[e,i,this],true);if(/^(drag|start|stop)/.test(t)){this.positionAbs=this._convertPositionTo("absolute");i.offset=this.positionAbs}return S.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});S.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=S.extend({},t,{item:i.element});i.sortables=[];S(i.options.connectToSortable).each(function(){var t=S(this).sortable("instance");if(t&&!t.options.disabled){i.sortables.push(t);t.refreshPositions();t._trigger("activate",e,s)}})},stop:function(e,t,i){var s=S.extend({},t,{item:i.element});i.cancelHelperRemoval=false;S.each(i.sortables,function(){var t=this;if(t.isOver){t.isOver=0;i.cancelHelperRemoval=true;t.cancelHelperRemoval=false;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(e);t.options.helper=t.options._helper}else{t.cancelHelperRemoval=true;t._trigger("deactivate",e,s)}})},drag:function(i,s,n){S.each(n.sortables,function(){var t=false,e=this;e.positionAbs=n.positionAbs;e.helperProportions=n.helperProportions;e.offset.click=n.offset.click;if(e._intersectsWith(e.containerCache)){t=true;S.each(n.sortables,function(){this.positionAbs=n.positionAbs;this.helperProportions=n.helperProportions;this.offset.click=n.offset.click;if(this!==e&&this._intersectsWith(this.containerCache)&&S.contains(e.element[0],this.element[0])){t=false}return t})}if(t){if(!e.isOver){e.isOver=1;e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",true);e.options._helper=e.options.helper;e.options.helper=function(){return s.helper[0]};i.target=e.currentItem[0];e._mouseCapture(i,true);e._mouseStart(i,true,true);e.offset.click.top=n.offset.click.top;e.offset.click.left=n.offset.click.left;e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left;e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top;n._trigger("toSortable",i);n.dropped=e.element;S.each(n.sortables,function(){this.refreshPositions()});n.currentItem=n.element;e.fromOutside=n}if(e.currentItem){e._mouseDrag(i);s.position=e.position}}else{if(e.isOver){e.isOver=0;e.cancelHelperRemoval=true;e.options._revert=e.options.revert;e.options.revert=false;e._trigger("out",i,e._uiHash(e));e._mouseStop(i,true);e.options.revert=e.options._revert;e.options.helper=e.options._helper;if(e.placeholder){e.placeholder.remove()}n._refreshOffsets(i);s.position=n._generatePosition(i,true);n._trigger("fromSortable",i);n.dropped=false;S.each(n.sortables,function(){this.refreshPositions()})}}})}});S.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=S("body"),n=i.options;if(s.css("cursor")){n._cursor=s.css("cursor")}s.css("cursor",n.cursor)},stop:function(t,e,i){var s=i.options;if(s._cursor){S("body").css("cursor",s._cursor)}}});S.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=S(e.helper),n=i.options;if(s.css("opacity")){n._opacity=s.css("opacity")}s.css("opacity",n.opacity)},stop:function(t,e,i){var s=i.options;if(s._opacity){S(e.helper).css("opacity",s._opacity)}}});S.ui.plugin.add("draggable","scroll",{start:function(t,e,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false)}if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(t,e,i){var s=i.options,n=false,o=i.scrollParentNotHidden[0],r=i.document[0];if(o!==r&&o.tagName!=="HTML"){if(!s.axis||s.axis!=="x"){if(i.overflowOffset.top+o.offsetHeight-t.pageY<s.scrollSensitivity){o.scrollTop=n=o.scrollTop+s.scrollSpeed}else if(t.pageY-i.overflowOffset.top<s.scrollSensitivity){o.scrollTop=n=o.scrollTop-s.scrollSpeed}}if(!s.axis||s.axis!=="y"){if(i.overflowOffset.left+o.offsetWidth-t.pageX<s.scrollSensitivity){o.scrollLeft=n=o.scrollLeft+s.scrollSpeed}else if(t.pageX-i.overflowOffset.left<s.scrollSensitivity){o.scrollLeft=n=o.scrollLeft-s.scrollSpeed}}}else{if(!s.axis||s.axis!=="x"){if(t.pageY-S(r).scrollTop()<s.scrollSensitivity){n=S(r).scrollTop(S(r).scrollTop()-s.scrollSpeed)}else if(S(window).height()-(t.pageY-S(r).scrollTop())<s.scrollSensitivity){n=S(r).scrollTop(S(r).scrollTop()+s.scrollSpeed)}}if(!s.axis||s.axis!=="y"){if(t.pageX-S(r).scrollLeft()<s.scrollSensitivity){n=S(r).scrollLeft(S(r).scrollLeft()-s.scrollSpeed)}else if(S(window).width()-(t.pageX-S(r).scrollLeft())<s.scrollSensitivity){n=S(r).scrollLeft(S(r).scrollLeft()+s.scrollSpeed)}}}if(n!==false&&S.ui.ddmanager&&!s.dropBehaviour){S.ui.ddmanager.prepareOffsets(i,t)}}});S.ui.plugin.add("draggable","snap",{start:function(t,e,i){var s=i.options;i.snapElements=[];S(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var t=S(this),e=t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})}})},drag:function(t,e,i){var s,n,o,r,a,l,h,f,c,u,p=i.options,d=p.snapTolerance,g=e.offset.left,m=g+i.helperProportions.width,v=e.offset.top,_=v+i.helperProportions.height;for(c=i.snapElements.length-1;c>=0;c--){a=i.snapElements[c].left-i.margins.left;l=a+i.snapElements[c].width;h=i.snapElements[c].top-i.margins.top;f=h+i.snapElements[c].height;if(m<a-d||g>l+d||_<h-d||v>f+d||!S.contains(i.snapElements[c].item.ownerDocument,i.snapElements[c].item)){if(i.snapElements[c].snapping){i.options.snap.release&&i.options.snap.release.call(i.element,t,S.extend(i._uiHash(),{snapItem:i.snapElements[c].item}))}i.snapElements[c].snapping=false;continue}if(p.snapMode!=="inner"){s=Math.abs(h-_)<=d;n=Math.abs(f-v)<=d;o=Math.abs(a-m)<=d;r=Math.abs(l-g)<=d;if(s){e.position.top=i._convertPositionTo("relative",{top:h-i.helperProportions.height,left:0}).top}if(n){e.position.top=i._convertPositionTo("relative",{top:f,left:0}).top}if(o){e.position.left=i._convertPositionTo("relative",{top:0,left:a-i.helperProportions.width}).left}if(r){e.position.left=i._convertPositionTo("relative",{top:0,left:l}).left}}u=s||n||o||r;if(p.snapMode!=="outer"){s=Math.abs(h-v)<=d;n=Math.abs(f-_)<=d;o=Math.abs(a-g)<=d;r=Math.abs(l-m)<=d;if(s){e.position.top=i._convertPositionTo("relative",{top:h,left:0}).top}if(n){e.position.top=i._convertPositionTo("relative",{top:f-i.helperProportions.height,left:0}).top}if(o){e.position.left=i._convertPositionTo("relative",{top:0,left:a}).left}if(r){e.position.left=i._convertPositionTo("relative",{top:0,left:l-i.helperProportions.width}).left}}if(!i.snapElements[c].snapping&&(s||n||o||r||u)){i.options.snap.snap&&i.options.snap.snap.call(i.element,t,S.extend(i._uiHash(),{snapItem:i.snapElements[c].item}))}i.snapElements[c].snapping=s||n||o||r||u}}});S.ui.plugin.add("draggable","stack",{start:function(t,e,i){var s,n=i.options,o=S.makeArray(S(n.stack)).sort(function(t,e){return(parseInt(S(t).css("zIndex"),10)||0)-(parseInt(S(e).css("zIndex"),10)||0)});if(!o.length){return}s=parseInt(S(o[0]).css("zIndex"),10)||0;S(o).each(function(t){S(this).css("zIndex",s+t)});this.css("zIndex",s+o.length)}});S.ui.plugin.add("draggable","zIndex",{start:function(t,e,i){var s=S(e.helper),n=i.options;if(s.css("zIndex")){n._zIndex=s.css("zIndex")}s.css("zIndex",n.zIndex)},stop:function(t,e,i){var s=i.options;if(s._zIndex){S(e.helper).css("zIndex",s._zIndex)}}});var l=S.ui.draggable;S.widget("ui.droppable",{version:"1.11.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=false;this.isout=true;this.accept=S.isFunction(i)?i:function(t){return t.is(i)};this.proportions=function(){if(arguments.length){t=arguments[0]}else{return t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}}};this._addToManager(e.scope);e.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(t){S.ui.ddmanager.droppables[t]=S.ui.ddmanager.droppables[t]||[];S.ui.ddmanager.droppables[t].push(this)},_splice:function(t){var e=0;for(;e<t.length;e++){if(t[e]===this){t.splice(e,1)}}},_destroy:function(){var t=S.ui.ddmanager.droppables[this.options.scope];this._splice(t);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,e){if(t==="accept"){this.accept=S.isFunction(e)?e:function(t){return t.is(e)}}else if(t==="scope"){var i=S.ui.ddmanager.droppables[this.options.scope];this._splice(i);this._addToManager(e)}this._super(t,e)},_activate:function(t){var e=S.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}if(e){this._trigger("activate",t,this.ui(e))}},_deactivate:function(t){var e=S.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(e){this._trigger("deactivate",t,this.ui(e))}},_over:function(t){var e=S.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],e.currentItem||e.element)){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",t,this.ui(e))}},_out:function(t){var e=S.ui.ddmanager.current;if(!e||(e.currentItem||e.element)[0]===this.element[0]){return}if(this.accept.call(this.element[0],e.currentItem||e.element)){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",t,this.ui(e))}},_drop:function(e,t){var i=t||S.ui.ddmanager.current,s=false;if(!i||(i.currentItem||i.element)[0]===this.element[0]){return false}this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=S(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===i.options.scope&&t.accept.call(t.element[0],i.currentItem||i.element)&&S.ui.intersect(i,S.extend(t,{offset:t.element.offset()}),t.options.tolerance,e)){s=true;return false}});if(s){return false}if(this.accept.call(this.element[0],i.currentItem||i.element)){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",e,this.ui(i));return this.element}return false},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}});S.ui.intersect=function(){function u(t,e,i){return t>=e&&t<e+i}return function(t,e,i,s){if(!e.offset){return false}var n=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,r=n+t.helperProportions.width,a=o+t.helperProportions.height,l=e.offset.left,h=e.offset.top,f=l+e.proportions().width,c=h+e.proportions().height;switch(i){case"fit":return l<=n&&r<=f&&h<=o&&a<=c;case"intersect":return l<n+t.helperProportions.width/2&&r-t.helperProportions.width/2<f&&h<o+t.helperProportions.height/2&&a-t.helperProportions.height/2<c;case"pointer":return u(s.pageY,h,e.proportions().height)&&u(s.pageX,l,e.proportions().width);case"touch":return(o>=h&&o<=c||a>=h&&a<=c||o<h&&a>c)&&(n>=l&&n<=f||r>=l&&r<=f||n<l&&r>f);default:return false}}}();S.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,e){var i,s,n=S.ui.ddmanager.droppables[t.options.scope]||[],o=e?e.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();t:for(i=0;i<n.length;i++){if(n[i].options.disabled||t&&!n[i].accept.call(n[i].element[0],t.currentItem||t.element)){continue}for(s=0;s<r.length;s++){if(r[s]===n[i].element[0]){n[i].proportions().height=0;continue t}}n[i].visible=n[i].element.css("display")!=="none";if(!n[i].visible){continue}if(o==="mousedown"){n[i]._activate.call(n[i],e)}n[i].offset=n[i].element.offset();n[i].proportions({width:n[i].element[0].offsetWidth,height:n[i].element[0].offsetHeight})}},drop:function(t,e){var i=false;S.each((S.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&S.ui.intersect(t,this,this.options.tolerance,e)){i=this._drop.call(this,e)||i}if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)){this.isout=true;this.isover=false;this._deactivate.call(this,e)}});return i},dragStart:function(t,e){t.element.parentsUntil("body").bind("scroll.droppable",function(){if(!t.options.refreshPositions){S.ui.ddmanager.prepareOffsets(t,e)}})},drag:function(o,r){if(o.options.refreshPositions){S.ui.ddmanager.prepareOffsets(o,r)}S.each(S.ui.ddmanager.droppables[o.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var t,e,i,s=S.ui.intersect(o,this,this.options.tolerance,r),n=!s&&this.isover?"isout":s&&!this.isover?"isover":null;if(!n){return}if(this.options.greedy){e=this.options.scope;i=this.element.parents(":data(ui-droppable)").filter(function(){return S(this).droppable("instance").options.scope===e});if(i.length){t=S(i[0]).droppable("instance");t.greedyChild=n==="isover"}}if(t&&n==="isover"){t.isover=false;t.isout=true;t._out.call(t,r)}this[n]=true;this[n==="isout"?"isover":"isout"]=false;this[n==="isover"?"_over":"_out"].call(this,r);if(t&&n==="isout"){t.isout=false;t.isover=true;t._over.call(t,r)}})},dragStop:function(t,e){t.element.parentsUntil("body").unbind("scroll.droppable");if(!t.options.refreshPositions){S.ui.ddmanager.prepareOffsets(t,e)}}};var h=S.ui.droppable;S.widget("ui.resizable",S.ui.mouse,{version:"1.11.2",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseInt(t,10)||0},_isNumber:function(t){return!isNaN(parseInt(t,10))},_hasScroll:function(t,e){if(S(t).css("overflow")==="hidden"){return false}var i=e&&e==="left"?"scrollLeft":"scrollTop",s=false;if(t[i]>0){return true}t[i]=1;s=t[i]>0;t[i]=0;return s},_create:function(){var t,e,i,s,n,o=this,r=this.options;this.element.addClass("ui-resizable");S.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){this.element.wrap(S("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=r.handles||(!S(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}t=this.handles.split(",");this.handles={};for(e=0;e<t.length;e++){i=S.trim(t[e]);n="ui-resizable-"+i;s=S("<div class='ui-resizable-handle "+n+"'></div>");s.css({zIndex:r.zIndex});if("se"===i){s.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[i]=".ui-resizable-"+i;this.element.append(s)}}this._renderAxis=function(t){var e,i,s,n;t=t||this.element;for(e in this.handles){if(this.handles[e].constructor===String){this.handles[e]=this.element.children(this.handles[e]).first().show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){i=S(this.handles[e],this.element);n=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth();s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join("");t.css(s,n);this._proportionallyResize()}if(!S(this.handles[e]).length){continue}}};this._renderAxis(this.element);this._handles=S(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!o.resizing){if(this.className){s=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}o.axis=s&&s[1]?s[1]:"se"}});if(r.autoHide){this._handles.hide();S(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(r.disabled){return}S(this).removeClass("ui-resizable-autohide");o._handles.show()}).mouseleave(function(){if(r.disabled){return}if(!o.resizing){S(this).addClass("ui-resizable-autohide");o._handles.hide()}})}this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,e=function(t){S(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){e(this.element);t=this.element;this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t);t.remove()}this.originalElement.css("resize",this.originalResizeStyle);e(this.originalElement);return this},_mouseCapture:function(t){var e,i,s=false;for(e in this.handles){i=S(this.handles[e])[0];if(i===t.target||S.contains(i,t.target)){s=true}}return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,n=this.options,o=this.element;this.resizing=true;this._renderProxy();e=this._num(this.helper.css("left"));i=this._num(this.helper.css("top"));if(n.containment){e+=S(n.containment).scrollLeft()||0;i+=S(n.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:e,top:i};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()};this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()};this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()};this.originalPosition={left:e,top:i};this.originalMousePosition={left:t.pageX,top:t.pageY};this.aspectRatio=typeof n.aspectRatio==="number"?n.aspectRatio:this.originalSize.width/this.originalSize.height||1;s=S(".ui-resizable-"+this.axis).css("cursor");S("body").css("cursor",s==="auto"?this.axis+"-resize":s);o.addClass("ui-resizable-resizing");this._propagate("start",t);return true},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,n=this.axis,o=t.pageX-s.left||0,r=t.pageY-s.top||0,a=this._change[n];this._updatePrevProperties();if(!a){return false}e=a.apply(this,[t,o,r]);this._updateVirtualBoundaries(t.shiftKey);if(this._aspectRatio||t.shiftKey){e=this._updateRatio(e,t)}e=this._respectSize(e,t);this._updateCache(e);this._propagate("resize",t);i=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(!S.isEmptyObject(i)){this._updatePrevProperties();this._trigger("resize",t,this.ui());this._applyChanges()}return false},_mouseStop:function(t){this.resizing=false;var e,i,s,n,o,r,a,l=this.options,h=this;if(this._helper){e=this._proportionallyResizeElements;i=e.length&&/textarea/i.test(e[0].nodeName);s=i&&this._hasScroll(e[0],"left")?0:h.sizeDiff.height;n=i?0:h.sizeDiff.width;o={width:h.helper.width()-n,height:h.helper.height()-s};r=parseInt(h.element.css("left"),10)+(h.position.left-h.originalPosition.left)||null;a=parseInt(h.element.css("top"),10)+(h.position.top-h.originalPosition.top)||null;if(!l.animate){this.element.css(S.extend(o,{top:a,left:r}))}h.helper.height(h.size.height);h.helper.width(h.size.width);if(this._helper&&!l.animate){this._proportionallyResize()}}S("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",t);if(this._helper){this.helper.remove()}return false},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};if(this.position.top!==this.prevPosition.top){t.top=this.position.top+"px"}if(this.position.left!==this.prevPosition.left){t.left=this.position.left+"px"}if(this.size.width!==this.prevSize.width){t.width=this.size.width+"px"}if(this.size.height!==this.prevSize.height){t.height=this.size.height+"px"}this.helper.css(t);return t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,r=this.options;o={minWidth:this._isNumber(r.minWidth)?r.minWidth:0,maxWidth:this._isNumber(r.maxWidth)?r.maxWidth:Infinity,minHeight:this._isNumber(r.minHeight)?r.minHeight:0,maxHeight:this._isNumber(r.maxHeight)?r.maxHeight:Infinity};if(this._aspectRatio||t){e=o.minHeight*this.aspectRatio;s=o.minWidth/this.aspectRatio;i=o.maxHeight*this.aspectRatio;n=o.maxWidth/this.aspectRatio;if(e>o.minWidth){o.minWidth=e}if(s>o.minHeight){o.minHeight=s}if(i<o.maxWidth){o.maxWidth=i}if(n<o.maxHeight){o.maxHeight=n}}this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset();if(this._isNumber(t.left)){this.position.left=t.left}if(this._isNumber(t.top)){this.position.top=t.top}if(this._isNumber(t.height)){this.size.height=t.height}if(this._isNumber(t.width)){this.size.width=t.width}},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;if(this._isNumber(t.height)){t.width=t.height*this.aspectRatio}else if(this._isNumber(t.width)){t.height=t.width/this.aspectRatio}if(s==="sw"){t.left=e.left+(i.width-t.width);t.top=null}if(s==="nw"){t.top=e.top+(i.height-t.height);t.left=e.left+(i.width-t.width)}return t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,r=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,h=/sw|nw|w/.test(i),f=/nw|ne|n/.test(i);if(o){t.width=e.minWidth}if(r){t.height=e.minHeight}if(s){t.width=e.maxWidth}if(n){t.height=e.maxHeight}if(o&&h){t.left=a-e.minWidth}if(s&&h){t.left=a-e.maxWidth}if(r&&f){t.top=l-e.minHeight}if(n&&f){t.top=l-e.maxHeight}if(!t.width&&!t.height&&!t.left&&t.top){t.top=null}else if(!t.width&&!t.height&&!t.top&&t.left){t.left=null}return t},_getPaddingPlusBorderDimensions:function(t){var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];for(;e<4;e++){i[e]=parseInt(s[e],10)||0;i[e]+=parseInt(n[e],10)||0}return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var t,e=0,i=this.helper||this.element;for(;e<this._proportionallyResizeElements.length;e++){t=this._proportionallyResizeElements[e];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(t)}t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})}},_renderProxy:function(){var t=this.element,e=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||S("<div style='overflow:hidden;'></div>");this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return S.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return S.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return S.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return S.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){S.ui.plugin.call(this,t,[e,this.ui()]);t!=="resize"&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});S.ui.plugin.add("resizable","animate",{stop:function(e){var i=S(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=n?0:i.sizeDiff.width,a={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,h=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(S.extend(a,h&&l?{top:h,left:l}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};if(s&&s.length){S(s[0]).css({width:t.width,height:t.height})}i._updateCache(t);i._propagate("resize",e)}})}});S.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,n,o,r,a=S(this).resizable("instance"),l=a.options,h=a.element,f=l.containment,c=f instanceof S?f.get(0):/parent/.test(f)?h.parent().get(0):f;if(!c){return}a.containerElement=S(c);if(/document/.test(f)||f===document){a.containerOffset={left:0,top:0};a.containerPosition={left:0,top:0};a.parentData={element:S(document),left:0,top:0,width:S(document).width(),height:S(document).height()||document.body.parentNode.scrollHeight}}else{i=S(c);s=[];S(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=a._num(i.css("padding"+e))});a.containerOffset=i.offset();a.containerPosition=i.position();a.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]};t=a.containerOffset;e=a.containerSize.height;n=a.containerSize.width;o=a._hasScroll(c,"left")?c.scrollWidth:n;r=a._hasScroll(c)?c.scrollHeight:e;a.parentData={element:c,left:t.left,top:t.top,width:o,height:r}}},resize:function(t){var e,i,s,n,o=S(this).resizable("instance"),r=o.options,a=o.containerOffset,l=o.position,h=o._aspectRatio||t.shiftKey,f={top:0,left:0},c=o.containerElement,u=true;if(c[0]!==document&&/static/.test(c.css("position"))){f=a}if(l.left<(o._helper?a.left:0)){o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-f.left);if(h){o.size.height=o.size.width/o.aspectRatio;u=false}o.position.left=r.helper?a.left:0}if(l.top<(o._helper?a.top:0)){o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top);if(h){o.size.width=o.size.height*o.aspectRatio;u=false}o.position.top=o._helper?a.top:0}s=o.containerElement.get(0)===o.element.parent().get(0);n=/relative|absolute/.test(o.containerElement.css("position"));if(s&&n){o.offset.left=o.parentData.left+o.position.left;o.offset.top=o.parentData.top+o.position.top}else{o.offset.left=o.element.offset().left;o.offset.top=o.element.offset().top}e=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-f.left:o.offset.left-a.left));i=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-f.top:o.offset.top-a.top));if(e+o.size.width>=o.parentData.width){o.size.width=o.parentData.width-e;if(h){o.size.height=o.size.width/o.aspectRatio;u=false}}if(i+o.size.height>=o.parentData.height){o.size.height=o.parentData.height-i;if(h){o.size.width=o.size.height*o.aspectRatio;u=false}}if(!u){o.position.left=o.prevPosition.left;o.position.top=o.prevPosition.top;o.size.width=o.prevSize.width;o.size.height=o.prevSize.height}},stop:function(){var t=S(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=S(t.helper),r=o.offset(),a=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;if(t._helper&&!e.animate&&/relative/.test(n.css("position"))){S(this).css({left:r.left-s.left-i.left,width:a,height:l})}if(t._helper&&!e.animate&&/static/.test(n.css("position"))){S(this).css({left:r.left-s.left-i.left,width:a,height:l})}}});S.ui.plugin.add("resizable","alsoResize",{start:function(){var t=S(this).resizable("instance"),e=t.options,i=function(t){S(t).each(function(){var t=S(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};if(typeof e.alsoResize==="object"&&!e.alsoResize.parentNode){if(e.alsoResize.length){e.alsoResize=e.alsoResize[0];i(e.alsoResize)}else{S.each(e.alsoResize,function(t){i(t)})}}else{i(e.alsoResize)}},resize:function(t,o){var e=S(this).resizable("instance"),i=e.options,s=e.originalSize,n=e.originalPosition,r={height:e.size.height-s.height||0,width:e.size.width-s.width||0,top:e.position.top-n.top||0,left:e.position.left-n.left||0},a=function(t,i){S(t).each(function(){var t=S(this),s=S(this).data("ui-resizable-alsoresize"),n={},e=i&&i.length?i:t.parents(o.originalElement[0]).length?["width","height"]:["width","height","top","left"];S.each(e,function(t,e){var i=(s[e]||0)+(r[e]||0);if(i&&i>=0){n[e]=i||null}});t.css(n)})};if(typeof i.alsoResize==="object"&&!i.alsoResize.nodeType){S.each(i.alsoResize,function(t,e){a(t,e)})}else{a(i.alsoResize)}},stop:function(){S(this).removeData("resizable-alsoresize")}});S.ui.plugin.add("resizable","ghost",{start:function(){var t=S(this).resizable("instance"),e=t.options,i=t.size;t.ghost=t.originalElement.clone();t.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost==="string"?e.ghost:"");t.ghost.appendTo(t.helper)},resize:function(){var t=S(this).resizable("instance");if(t.ghost){t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})}},stop:function(){var t=S(this).resizable("instance");if(t.ghost&&t.helper){t.helper.get(0).removeChild(t.ghost.get(0))}}});S.ui.plugin.add("resizable","grid",{resize:function(){var t,e=S(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,r=e.axis,a=typeof i.grid==="number"?[i.grid,i.grid]:i.grid,l=a[0]||1,h=a[1]||1,f=Math.round((s.width-n.width)/l)*l,c=Math.round((s.height-n.height)/h)*h,u=n.width+f,p=n.height+c,d=i.maxWidth&&i.maxWidth<u,g=i.maxHeight&&i.maxHeight<p,m=i.minWidth&&i.minWidth>u,v=i.minHeight&&i.minHeight>p;i.grid=a;if(m){u+=l}if(v){p+=h}if(d){u-=l}if(g){p-=h}if(/^(se|s|e)$/.test(r)){e.size.width=u;e.size.height=p}else if(/^(ne)$/.test(r)){e.size.width=u;e.size.height=p;e.position.top=o.top-c}else if(/^(sw)$/.test(r)){e.size.width=u;e.size.height=p;e.position.left=o.left-f}else{if(p-h<=0||u-l<=0){t=e._getPaddingPlusBorderDimensions(this)}if(p-h>0){e.size.height=p;e.position.top=o.top-c}else{p=h-t.height;e.size.height=p;e.position.top=o.top+n.height-p}if(u-l>0){e.size.width=u;e.position.left=o.left-f}else{u=h-t.height;e.size.width=u;e.position.left=o.left+n.width-u}}}});var f=S.ui.resizable;var c=S.widget("ui.selectable",S.ui.mouse,{version:"1.11.2",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,e=this;this.element.addClass("ui-selectable");this.dragged=false;this.refresh=function(){t=S(e.options.filter,e.element[0]);t.addClass("ui-selectee");t.each(function(){var t=S(this),e=t.offset();S.data(this,"selectable-item",{element:this,$element:t,left:e.left,top:e.top,right:e.left+t.outerWidth(),bottom:e.top+t.outerHeight(),startselected:false,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})};this.refresh();this.selectees=t.addClass("ui-selectee");this._mouseInit();this.helper=S("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled");this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY];if(this.options.disabled){return}this.selectees=S(t.filter,this.element[0]);this._trigger("start",i);S(t.appendTo).append(this.helper);this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0});if(t.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var t=S.data(this,"selectable-item");t.startselected=true;if(!i.metaKey&&!i.ctrlKey){t.$element.removeClass("ui-selected");t.selected=false;t.$element.addClass("ui-unselecting");t.unselecting=true;s._trigger("unselecting",i,{unselecting:t.element})}});S(i.target).parents().addBack().each(function(){var t,e=S.data(this,"selectable-item");if(e){t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected");e.$element.removeClass(t?"ui-unselecting":"ui-selected").addClass(t?"ui-selecting":"ui-unselecting");e.unselecting=!t;e.selecting=t;e.selected=t;if(t){s._trigger("selecting",i,{selecting:e.element})}else{s._trigger("unselecting",i,{unselecting:e.element})}return false}})},_mouseDrag:function(i){this.dragged=true;if(this.options.disabled){return}var t,s=this,n=this.options,o=this.opos[0],r=this.opos[1],a=i.pageX,l=i.pageY;if(o>a){t=a;a=o;o=t}if(r>l){t=l;l=r;r=t}this.helper.css({left:o,top:r,width:a-o,height:l-r});this.selectees.each(function(){var t=S.data(this,"selectable-item"),e=false;if(!t||t.element===s.element[0]){return}if(n.tolerance==="touch"){e=!(t.left>a||t.right<o||t.top>l||t.bottom<r)}else if(n.tolerance==="fit"){e=t.left>o&&t.right<a&&t.top>r&&t.bottom<l}if(e){if(t.selected){t.$element.removeClass("ui-selected");t.selected=false}if(t.unselecting){t.$element.removeClass("ui-unselecting");t.unselecting=false}if(!t.selecting){t.$element.addClass("ui-selecting");t.selecting=true;s._trigger("selecting",i,{selecting:t.element})}}else{if(t.selecting){if((i.metaKey||i.ctrlKey)&&t.startselected){t.$element.removeClass("ui-selecting");t.selecting=false;t.$element.addClass("ui-selected");t.selected=true}else{t.$element.removeClass("ui-selecting");t.selecting=false;if(t.startselected){t.$element.addClass("ui-unselecting");t.unselecting=true}s._trigger("unselecting",i,{unselecting:t.element})}}if(t.selected){if(!i.metaKey&&!i.ctrlKey&&!t.startselected){t.$element.removeClass("ui-selected");t.selected=false;t.$element.addClass("ui-unselecting");t.unselecting=true;s._trigger("unselecting",i,{unselecting:t.element})}}}});return false},_mouseStop:function(e){var i=this;this.dragged=false;S(".ui-unselecting",this.element[0]).each(function(){var t=S.data(this,"selectable-item");t.$element.removeClass("ui-unselecting");t.unselecting=false;t.startselected=false;i._trigger("unselected",e,{unselected:t.element})});S(".ui-selecting",this.element[0]).each(function(){var t=S.data(this,"selectable-item");t.$element.removeClass("ui-selecting").addClass("ui-selected");t.selecting=false;t.selected=true;t.startselected=true;i._trigger("selected",e,{selected:t.element})});this._trigger("stop",e);this.helper.remove();return false}});var u=S.widget("ui.sortable",S.ui.mouse,{version:"1.11.2",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,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},_isOverAxis:function(t,e,i){return t>=e&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){var t=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?t.axis==="x"||this._isFloating(this.items[0].item):false;this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true},_setOption:function(t,e){this._super(t,e);if(t==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");S.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle");this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--){this.items[t].item.removeData(this.widgetName+"-item")}return this},_mouseCapture:function(t,e){var i=null,s=false,n=this;if(this.reverting){return false}if(this.options.disabled||this.options.type==="static"){return false}this._refreshItems(t);S(t.target).parents().each(function(){if(S.data(this,n.widgetName+"-item")===n){i=S(this);return false}});if(S.data(t.target,n.widgetName+"-item")===n){i=S(t.target)}if(!i){return false}if(this.options.handle&&!e){S(this.options.handle,i).find("*").addBack().each(function(){if(this===t.target){s=true}});if(!s){return false}}this.currentItem=i;this._removeCurrentsFromItems();return true},_mouseStart:function(t,e,i){var s,n,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(t);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};S.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.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(t);this.originalPageX=t.pageX;this.originalPageY=t.pageY;o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(o.containment){this._setContainment()}if(o.cursor&&o.cursor!=="auto"){n=this.document.find("body");this.storedCursor=n.css("cursor");n.css("cursor",o.cursor);this.storedStylesheet=S("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(n)}if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",o.opacity)}if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",o.zIndex)}if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",t,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!i){for(s=this.containers.length-1;s>=0;s--){this.containers[s]._trigger("activate",t,this._uiHash(this))}}if(S.ui.ddmanager){S.ui.ddmanager.current=this}if(S.ui.ddmanager&&!o.dropBehaviour){S.ui.ddmanager.prepareOffsets(this,t)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(t);return true},_mouseDrag:function(t){var e,i,s,n,o=this.options,r=false;this.position=this._generatePosition(t);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed}else if(t.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed}if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed}else if(t.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed}}else{if(t.pageY-S(document).scrollTop()<o.scrollSensitivity){r=S(document).scrollTop(S(document).scrollTop()-o.scrollSpeed)}else if(S(window).height()-(t.pageY-S(document).scrollTop())<o.scrollSensitivity){r=S(document).scrollTop(S(document).scrollTop()+o.scrollSpeed)}if(t.pageX-S(document).scrollLeft()<o.scrollSensitivity){r=S(document).scrollLeft(S(document).scrollLeft()-o.scrollSpeed)}else if(S(window).width()-(t.pageX-S(document).scrollLeft())<o.scrollSensitivity){r=S(document).scrollLeft(S(document).scrollLeft()+o.scrollSpeed)}}if(r!==false&&S.ui.ddmanager&&!o.dropBehaviour){S.ui.ddmanager.prepareOffsets(this,t)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}for(e=this.items.length-1;e>=0;e--){i=this.items[e];s=i.item[0];n=this._intersectsWithPointer(i);if(!n){continue}if(i.instance!==this.currentContainer){continue}if(s!==this.currentItem[0]&&this.placeholder[n===1?"next":"prev"]()[0]!==s&&!S.contains(this.placeholder[0],s)&&(this.options.type==="semi-dynamic"?!S.contains(this.element[0],s):true)){this.direction=n===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(i)){this._rearrange(t,i)}else{break}this._trigger("change",t,this._uiHash());break}}this._contactContainers(t);if(S.ui.ddmanager){S.ui.ddmanager.drag(this,t)}this._trigger("sort",t,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(t,e){if(!t){return}if(S.ui.ddmanager&&!this.options.dropBehaviour){S.ui.ddmanager.drop(this,t)}if(this.options.revert){var i=this,s=this.placeholder.offset(),n=this.options.axis,o={};if(!n||n==="x"){o.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)}if(!n||n==="y"){o.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)}this.reverting=true;S(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){i._clear(t)})}else{this._clear(t,e)}return false},cancel:function(){if(this.dragging){this._mouseUp({target:null});if(this.options.helper==="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var t=this.containers.length-1;t>=0;t--){this.containers[t]._trigger("deactivate",null,this._uiHash(this));if(this.containers[t].containerCache.over){this.containers[t]._trigger("out",null,this._uiHash(this));this.containers[t].containerCache.over=0}}}if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}S.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){S(this.domPosition.prev).after(this.currentItem)}else{S(this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];e=e||{};S(t).each(function(){var t=(S(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);if(t){i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}});if(!i.length&&e.key){i.push(e.key+"=")}return i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];t=t||{};e.each(function(){i.push(S(t.item||this).attr(t.attribute||"id")||"")});return i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,r=o+t.width,a=t.top,l=a+t.height,h=this.offset.click.top,f=this.offset.click.left,c=this.options.axis==="x"||s+h>a&&s+h<l,u=this.options.axis==="y"||e+f>o&&e+f<r,p=c&&u;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]){return p}else{return o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<r&&a<s+this.helperProportions.height/2&&n-this.helperProportions.height/2<l}},_intersectsWithPointer:function(t){var e=this.options.axis==="x"||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),i=this.options.axis==="y"||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),s=e&&i,n=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();if(!s){return false}return this.floating?o&&o==="right"||n==="down"?2:1:n&&(n==="down"?2:1)},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();if(this.floating&&n){return n==="right"&&i||n==="left"&&!i}else{return s&&(s==="down"&&e||s==="up"&&!e)}},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return t!==0&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return t!==0&&(t>0?"right":"left")},refresh:function(t){this._refreshItems(t);this._setHandleClassName();this.refreshPositions();return this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,n,o=[],r=[],a=this._connectWith();if(a&&t){for(e=a.length-1;e>=0;e--){s=S(a[e]);for(i=s.length-1;i>=0;i--){n=S.data(s[i],this.widgetFullName);if(n&&n!==this&&!n.options.disabled){r.push([S.isFunction(n.options.items)?n.options.items.call(n.element):S(n.options.items,n.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),n])}}}}r.push([S.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):S(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function l(){o.push(this)}for(e=r.length-1;e>=0;e--){r[e][0].each(l)}return S(o)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=S.grep(this.items,function(t){for(var e=0;e<i.length;e++){if(i[e]===t.item[0]){return false}}return true})},_refreshItems:function(t){this.items=[];this.containers=[this];var e,i,s,n,o,r,a,l,h=this.items,f=[[S.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):S(this.options.items,this.element),this]],c=this._connectWith();if(c&&this.ready){for(e=c.length-1;e>=0;e--){s=S(c[e]);for(i=s.length-1;i>=0;i--){n=S.data(s[i],this.widgetFullName);if(n&&n!==this&&!n.options.disabled){f.push([S.isFunction(n.options.items)?n.options.items.call(n.element[0],t,{item:this.currentItem}):S(n.options.items,n.element),n]);this.containers.push(n)}}}}for(e=f.length-1;e>=0;e--){o=f[e][1];r=f[e][0];for(i=0,l=r.length;i<l;i++){a=S(r[i]);a.data(this.widgetName+"-item",o);h.push({item:a,instance:o,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}var e,i,s,n;for(e=this.items.length-1;e>=0;e--){i=this.items[e];if(i.instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]){continue}s=this.options.toleranceElement?S(this.options.toleranceElement,i.item):i.item;if(!t){i.width=s.outerWidth();i.height=s.outerHeight()}n=s.offset();i.left=n.left;i.top=n.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(e=this.containers.length-1;e>=0;e--){n=this.containers[e].element.offset();this.containers[e].containerCache.left=n.left;this.containers[e].containerCache.top=n.top;this.containers[e].containerCache.width=this.containers[e].element.outerWidth();this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}}return this},_createPlaceholder:function(i){i=i||this;var s,n=i.options;if(!n.placeholder||n.placeholder.constructor===String){s=n.placeholder;n.placeholder={element:function(){var t=i.currentItem[0].nodeName.toLowerCase(),e=S("<"+t+">",i.document[0]).addClass(s||i.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");if(t==="tr"){i.currentItem.children().each(function(){S("<td>&#160;</td>",i.document[0]).attr("colspan",S(this).attr("colspan")||1).appendTo(e)})}else if(t==="img"){e.attr("src",i.currentItem.attr("src"))}if(!s){e.css("visibility","hidden")}return e},update:function(t,e){if(s&&!n.forcePlaceholderSize){return}if(!e.height()){e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10))}if(!e.width()){e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10))}}}}i.placeholder=S(n.placeholder.element.call(i.element,i.currentItem));i.currentItem.after(i.placeholder);n.placeholder.update(i,i.placeholder)},_contactContainers:function(t){var e,i,s,n,o,r,a,l,h,f,c=null,u=null;for(e=this.containers.length-1;e>=0;e--){if(S.contains(this.currentItem[0],this.containers[e].element[0])){continue}if(this._intersectsWith(this.containers[e].containerCache)){if(c&&S.contains(this.containers[e].element[0],c.element[0])){continue}c=this.containers[e];u=e}else{if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",t,this._uiHash(this));this.containers[e].containerCache.over=0}}}if(!c){return}if(this.containers.length===1){if(!this.containers[u].containerCache.over){this.containers[u]._trigger("over",t,this._uiHash(this));this.containers[u].containerCache.over=1}}else{s=1e4;n=null;h=c.floating||this._isFloating(this.currentItem);o=h?"left":"top";r=h?"width":"height";f=h?"clientX":"clientY";for(i=this.items.length-1;i>=0;i--){if(!S.contains(this.containers[u].element[0],this.items[i].item[0])){continue}if(this.items[i].item[0]===this.currentItem[0]){continue}a=this.items[i].item.offset()[o];l=false;if(t[f]-a>this.items[i][r]/2){l=true}if(Math.abs(t[f]-a)<s){s=Math.abs(t[f]-a);n=this.items[i];this.direction=l?"up":"down"}}if(!n&&!this.options.dropOnEmpty){return}if(this.currentContainer===this.containers[u]){if(!this.currentContainer.containerCache.over){this.containers[u]._trigger("over",t,this._uiHash());this.currentContainer.containerCache.over=1}return}n?this._rearrange(t,n,null,true):this._rearrange(t,null,this.containers[u].element,true);this._trigger("change",t,this._uiHash());this.containers[u]._trigger("change",t,this._uiHash(this));this.currentContainer=this.containers[u];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[u]._trigger("over",t,this._uiHash(this));this.containers[u].containerCache.over=1}},_createHelper:function(t){var e=this.options,i=S.isFunction(e.helper)?S(e.helper.apply(this.element[0],[t,this.currentItem])):e.helper==="clone"?this.currentItem.clone():this.currentItem;if(!i.parents("body").length){S(e.appendTo!=="parent"?e.appendTo:this.currentItem[0].parentNode)[0].appendChild(i[0])}if(i[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")}}if(!i[0].style.width||e.forceHelperSize){i.width(this.currentItem.width())}if(!i[0].style.height||e.forceHelperSize){i.height(this.currentItem.height())}return i},_adjustOffsetFromHelper:function(t){if(typeof t==="string"){t=t.split(" ")}if(S.isArray(t)){t={left:+t[0],top:+t[1]||0}}if("left"in t){this.offset.click.left=t.left+this.margins.left}if("right"in t){this.offset.click.left=this.helperProportions.width-t.right+this.margins.left}if("top"in t){this.offset.click.top=t.top+this.margins.top}if("bottom"in t){this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&S.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&S.ui.ie){t={top:0,left:0}}return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{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 t,e,i,s=this.options;if(s.containment==="parent"){s.containment=this.helper[0].parentNode}if(s.containment==="document"||s.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,S(s.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(S(s.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!/^(document|window|parent)$/.test(s.containment)){t=S(s.containment)[0];e=S(s.containment).offset();i=S(t).css("overflow")!=="hidden";this.containment=[e.left+(parseInt(S(t).css("borderLeftWidth"),10)||0)+(parseInt(S(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(S(t).css("borderTopWidth"),10)||0)+(parseInt(S(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(S(t).css("borderLeftWidth"),10)||0)-(parseInt(S(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(S(t).css("borderTopWidth"),10)||0)-(parseInt(S(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,e){if(!e){e=this.position}var i=t==="absolute"?1:-1,s=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&S.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,n=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():n?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():n?0:s.scrollLeft())*i}},_generatePosition:function(t){var e,i,s=this.options,n=t.pageX,o=t.pageY,r=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==document&&S.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,a=/(html|body)/i.test(r[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}if(this.originalPosition){if(this.containment){if(t.pageX-this.offset.click.left<this.containment[0]){n=this.containment[0]+this.offset.click.left}if(t.pageY-this.offset.click.top<this.containment[1]){o=this.containment[1]+this.offset.click.top}if(t.pageX-this.offset.click.left>this.containment[2]){n=this.containment[2]+this.offset.click.left}if(t.pageY-this.offset.click.top>this.containment[3]){o=this.containment[3]+this.offset.click.top}}if(s.grid){e=this.originalPageY+Math.round((o-this.originalPageY)/s.grid[1])*s.grid[1];o=this.containment?e-this.offset.click.top>=this.containment[1]&&e-this.offset.click.top<=this.containment[3]?e:e-this.offset.click.top>=this.containment[1]?e-s.grid[1]:e+s.grid[1]:e;i=this.originalPageX+Math.round((n-this.originalPageX)/s.grid[0])*s.grid[0];n=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-s.grid[0]:i+s.grid[0]:i}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():a?0:r.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():a?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?e.item[0]:e.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){if(n===this.counter){this.refreshPositions(!s)}})},_clear:function(t,e){this.reverting=false;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!e){s.push(function(t){this._trigger("update",t,this._uiHash())})}if(this!==this.currentContainer){if(!e){s.push(function(t){this._trigger("remove",t,this._uiHash())});s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer));s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))}}function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(i=this.containers.length-1;i>=0;i--){if(!e){s.push(n("deactivate",this,this.containers[i]))}if(this.containers[i].containerCache.over){s.push(n("out",this,this.containers[i]));this.containers[i].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(!e){this._trigger("beforeStop",t,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove()}this.helper=null}if(!e){for(i=0;i<s.length;i++){s[i].call(this,t)}this._trigger("stop",t,this._uiHash())}this.fromOutside=false;return!this.cancelHelperRemoval},_trigger:function(){if(S.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||S([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}});var p=S.widget("ui.slider",S.ui.mouse,{version:"1.11.2",widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._refresh();this._setOption("disabled",this.options.disabled);this._animateOff=false},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},_createHandles:function(){var t,e,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),n="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",o=[];e=i.values&&i.values.length||1;if(s.length>e){s.slice(e).remove();s=s.slice(0,e)}for(t=s.length;t<e;t++){o.push(n)}this.handles=s.add(S(o.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(t){S(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,e="";if(t.range){if(t.range===true){if(!t.values){t.values=[this._valueMin(),this._valueMin()]}else if(t.values.length&&t.values.length!==2){t.values=[t.values[0],t.values[0]]}else if(S.isArray(t.values)){t.values=t.values.slice(0)}}if(!this.range||!this.range.length){this.range=S("<div></div>").appendTo(this.element);e="ui-slider-range"+" ui-widget-header ui-corner-all"}else{this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""})}this.range.addClass(e+(t.range==="min"||t.range==="max"?" ui-slider-range-"+t.range:""))}else{if(this.range){this.range.remove()}this.range=null}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){this.handles.remove();if(this.range){this.range.remove()}this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._mouseDestroy()},_mouseCapture:function(t){var e,i,s,n,o,r,a,l,h=this,f=this.options;if(f.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();e={x:t.pageX,y:t.pageY};i=this._normValueFromMouse(e);s=this._valueMax()-this._valueMin()+1;this.handles.each(function(t){var e=Math.abs(i-h.values(t));if(s>e||s===e&&(t===h._lastChangedValue||h.values(t)===f.min)){s=e;n=S(this);o=t}});r=this._start(t,o);if(r===false){return false}this._mouseSliding=true;this._handleIndex=o;n.addClass("ui-state-active").focus();a=n.offset();l=!S(t.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=l?{left:0,top:0}:{left:t.pageX-a.left-n.width()/2,top:t.pageY-a.top-n.height()/2-(parseInt(n.css("borderTopWidth"),10)||0)-(parseInt(n.css("borderBottomWidth"),10)||0)+(parseInt(n.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(t,o,i)}this._animateOff=true;return true},_mouseStart:function(){return true},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);this._slide(t,this._handleIndex,i);return false},_mouseStop:function(t){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(t,this._handleIndex);this._change(t,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;if(this.orientation==="horizontal"){e=this.elementSize.width;i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{e=this.elementSize.height;i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}s=i/e;if(s>1){s=1}if(s<0){s=0}if(this.orientation==="vertical"){s=1-s}n=this._valueMax()-this._valueMin();o=this._valueMin()+s*n;return this._trimAlignValue(o)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){i.value=this.values(e);i.values=this.values()}return this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,o;if(this.options.values&&this.options.values.length){s=this.values(e?0:1);if(this.options.values.length===2&&this.options.range===true&&(e===0&&i>s||e===1&&i<s)){i=s}if(i!==this.values(e)){n=this.values();n[e]=i;o=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n});s=this.values(e?0:1);if(o!==false){this.values(e,i)}}}else{if(i!==this.value()){o=this._trigger("slide",t,{handle:this.handles[e],value:i});if(o!==false){this.value(i)}}}},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){i.value=this.values(e);i.values=this.values()}this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){i.value=this.values(e);i.values=this.values()}this._lastChangedValue=e;this._trigger("change",t,i)}},value:function(t){if(arguments.length){this.options.value=this._trimAlignValue(t);this._refreshValue();this._change(null,0);return}return this._value()},values:function(t,e){var i,s,n;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(e);this._refreshValue();this._change(null,t);return}if(arguments.length){if(S.isArray(arguments[0])){i=this.options.values;s=arguments[0];for(n=0;n<i.length;n+=1){i[n]=this._trimAlignValue(s[n]);this._change(null,n)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(t)}else{return this.value()}}}else{return this._values()}},_setOption:function(t,e){var i,s=0;if(t==="range"&&this.options.range===true){if(e==="min"){this.options.value=this._values(0);this.options.values=null}else if(e==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null}}if(S.isArray(this.options.values)){s=this.options.values.length}if(t==="disabled"){this.element.toggleClass("ui-state-disabled",!!e)}this._super(t,e);switch(t){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();this.handles.css(e==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=0;i<s;i+=1){this._change(null,i)}this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break}},_value:function(){var t=this.options.value;t=this._trimAlignValue(t);return t},_values:function(t){var e,i,s;if(arguments.length){e=this.options.values[t];e=this._trimAlignValue(e);return e}else if(this.options.values&&this.options.values.length){i=this.options.values.slice();for(s=0;s<i.length;s+=1){i[s]=this._trimAlignValue(i[s])}return i}else{return[]}},_trimAlignValue:function(t){if(t<=this._valueMin()){return this._valueMin()}if(t>=this._valueMax()){return this._valueMax()}var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;if(Math.abs(i)*2>=e){s+=i>0?e:-e}return parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=(this.options.max-this._valueMin())%this.options.step;this.max=this.options.max-t},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,r=this.options,a=this,l=!this._animateOff?r.animate:false,h={};if(this.options.values&&this.options.values.length){this.handles.each(function(t){i=(a.values(t)-a._valueMin())/(a._valueMax()-a._valueMin())*100;h[a.orientation==="horizontal"?"left":"bottom"]=i+"%";S(this).stop(1,1)[l?"animate":"css"](h,r.animate);if(a.options.range===true){if(a.orientation==="horizontal"){if(t===0){a.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate)}if(t===1){a.range[l?"animate":"css"]({width:i-e+"%"},{queue:false,duration:r.animate})}}else{if(t===0){a.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate)}if(t===1){a.range[l?"animate":"css"]({height:i-e+"%"},{queue:false,duration:r.animate})}}}e=i})}else{t=this.value();s=this._valueMin();n=this._valueMax();i=n!==s?(t-s)/(n-s)*100:0;h[this.orientation==="horizontal"?"left":"bottom"]=i+"%";this.handle.stop(1,1)[l?"animate":"css"](h,r.animate);if(o==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate)}if(o==="max"&&this.orientation==="horizontal"){this.range[l?"animate":"css"]({width:100-i+"%"},{queue:false,duration:r.animate})}if(o==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate)}if(o==="max"&&this.orientation==="vertical"){this.range[l?"animate":"css"]({height:100-i+"%"},{queue:false,duration:r.animate})}}},_handleEvents:{keydown:function(t){var e,i,s,n,o=S(t.target).data("ui-slider-handle-index");switch(t.keyCode){case S.ui.keyCode.HOME:case S.ui.keyCode.END:case S.ui.keyCode.PAGE_UP:case S.ui.keyCode.PAGE_DOWN:case S.ui.keyCode.UP:case S.ui.keyCode.RIGHT:case S.ui.keyCode.DOWN:case S.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=true;S(t.target).addClass("ui-state-active");e=this._start(t,o);if(e===false){return}}break}n=this.options.step;if(this.options.values&&this.options.values.length){i=s=this.values(o)}else{i=s=this.value()}switch(t.keyCode){case S.ui.keyCode.HOME:s=this._valueMin();break;case S.ui.keyCode.END:s=this._valueMax();break;case S.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case S.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case S.ui.keyCode.UP:case S.ui.keyCode.RIGHT:if(i===this._valueMax()){return}s=this._trimAlignValue(i+n);break;case S.ui.keyCode.DOWN:case S.ui.keyCode.LEFT:if(i===this._valueMin()){return}s=this._trimAlignValue(i-n);break}this._slide(t,o,s)},keyup:function(t){var e=S(t.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(t,e);this._change(t,e);S(t.target).removeClass("ui-state-active")}}}})});