jquery update
Bernd Wurst

Bernd Wurst commited on 2023-04-28 10:37:06
Zeige 9 geänderte Dateien mit 12252 Einfügungen und 9809 Löschungen.

... ...
@@ -1,4 +1,2 @@
1
-/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
2
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b="length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){
3
-return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ba=/<([\w:]+)/,ca=/<|&#?\w+;/,da=/<(?:script|style|link)/i,ea=/checked\s*(?:[^=]|=\s*.checked.)/i,fa=/^$|\/(?:java|ecma)script/i,ga=/^true\/(.*)/,ha=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ia={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option,ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead,ia.th=ia.td;function ja(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function ka(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function la(a){var b=ga.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function ma(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function na(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function oa(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pa(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=oa(h),f=oa(a),d=0,e=f.length;e>d;d++)pa(f[d],g[d]);if(b)if(c)for(f=f||oa(a),g=g||oa(h),d=0,e=f.length;e>d;d++)na(f[d],g[d]);else na(a,h);return g=oa(h,"script"),g.length>0&&ma(g,!i&&oa(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(ca.test(e)){f=f||k.appendChild(b.createElement("div")),g=(ba.exec(e)||["",""])[1].toLowerCase(),h=ia[g]||ia._default,f.innerHTML=h[1]+e.replace(aa,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=oa(k.appendChild(e),"script"),i&&ma(f),c)){j=0;while(e=f[j++])fa.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=ja(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(oa(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&ma(oa(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(oa(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!da.test(a)&&!ia[(ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(aa,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(oa(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(oa(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&ea.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(oa(c,"script"),ka),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,oa(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,la),j=0;g>j;j++)h=f[j],fa.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(ha,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qa,ra={};function sa(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function ta(a){var b=l,c=ra[a];return c||(c=sa(a,b),"none"!==c&&c||(qa=(qa||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qa[0].contentDocument,b.write(),b.close(),c=sa(a,b),qa.detach()),ra[a]=c),c}var ua=/^margin/,va=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wa=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)};function xa(a,b,c){var d,e,f,g,h=a.style;return c=c||wa(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),va.test(g)&&ua.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function ya(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),f.removeChild(c),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var za=/^(none|table(?!-c[ea]).+)/,Aa=new RegExp("^("+Q+")(.*)$","i"),Ba=new RegExp("^([+-])=("+Q+")","i"),Ca={position:"absolute",visibility:"hidden",display:"block"},Da={letterSpacing:"0",fontWeight:"400"},Ea=["Webkit","O","Moz","ms"];function Fa(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Ea.length;while(e--)if(b=Ea[e]+c,b in a)return b;return d}function Ga(a,b,c){var d=Aa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Ha(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ia(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wa(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xa(a,b,f),(0>e||null==e)&&(e=a.style[b]),va.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Ha(a,b,c||(g?"border":"content"),d,f)+"px"}function Ja(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",ta(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xa(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fa(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Ba.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fa(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xa(a,b,d)),"normal"===e&&b in Da&&(e=Da[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?za.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Ca,function(){return Ia(a,b,d)}):Ia(a,b,d):void 0},set:function(a,c,d){var e=d&&wa(a);return Ga(a,c,d?Ha(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=ya(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xa,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ua.test(a)||(n.cssHooks[a+b].set=Ga)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wa(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Ja(this,!0)},hide:function(){return Ja(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Ka(a,b,c,d,e){return new Ka.prototype.init(a,b,c,d,e)}n.Tween=Ka,Ka.prototype={constructor:Ka,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Ka.propHooks[this.prop];return a&&a.get?a.get(this):Ka.propHooks._default.get(this)},run:function(a){var b,c=Ka.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Ka.propHooks._default.set(this),this}},Ka.prototype.init.prototype=Ka.prototype,Ka.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Ka.propHooks.scrollTop=Ka.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Ka.prototype.init,n.fx.step={};var La,Ma,Na=/^(?:toggle|show|hide)$/,Oa=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pa=/queueHooks$/,Qa=[Va],Ra={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Oa.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Oa.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sa(){return setTimeout(function(){La=void 0}),La=n.now()}function Ta(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ua(a,b,c){for(var d,e=(Ra[b]||[]).concat(Ra["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Va(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||ta(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Na.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?ta(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ua(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wa(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xa(a,b,c){var d,e,f=0,g=Qa.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=La||Sa(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:La||Sa(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wa(k,j.opts.specialEasing);g>f;f++)if(d=Qa[f].call(j,a,k,j.opts))return d;return n.map(k,Ua,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xa,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Ra[c]=Ra[c]||[],Ra[c].unshift(b)},prefilter:function(a,b){b?Qa.unshift(a):Qa.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xa(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pa.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Ta(b,!0),a,d,e)}}),n.each({slideDown:Ta("show"),slideUp:Ta("hide"),slideToggle:Ta("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(La=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),La=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Ma||(Ma=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Ma),Ma=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Ya,Za,$a=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Za:Ya)),
4
-void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Za={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$a[b]||n.find.attr;$a[b]=function(a,b,d){var e,f;return d||(f=$a[b],$a[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$a[b]=f),e}});var _a=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_a.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ab=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ab," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ab," ").indexOf(b)>=0)return!0;return!1}});var bb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cb=n.now(),db=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var eb=/#.*$/,fb=/([?&])_=[^&]*/,gb=/^(.*?):[ \t]*([^\r\n]*)$/gm,hb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ib=/^(?:GET|HEAD)$/,jb=/^\/\//,kb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,lb={},mb={},nb="*/".concat("*"),ob=a.location.href,pb=kb.exec(ob.toLowerCase())||[];function qb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function rb(a,b,c,d){var e={},f=a===mb;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function sb(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function tb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function ub(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ob,type:"GET",isLocal:hb.test(pb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":nb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?sb(sb(a,n.ajaxSettings),b):sb(n.ajaxSettings,a)},ajaxPrefilter:qb(lb),ajaxTransport:qb(mb),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=gb.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||ob)+"").replace(eb,"").replace(jb,pb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=kb.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===pb[1]&&h[2]===pb[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(pb[3]||("http:"===pb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),rb(lb,k,b,v),2===t)return v;i=n.event&&k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!ib.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(db.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=fb.test(d)?d.replace(fb,"$1_="+cb++):d+(db.test(d)?"&":"?")+"_="+cb++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+nb+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=rb(mb,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=tb(k,v,f)),u=ub(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var vb=/%20/g,wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&").replace(vb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Bb=0,Cb={},Db={0:200,1223:204},Eb=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Cb)Cb[a]()}),k.cors=!!Eb&&"withCredentials"in Eb,k.ajax=Eb=!!Eb,n.ajaxTransport(function(a){var b;return k.cors||Eb&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Bb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Cb[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Db[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Cb[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Fb=[],Gb=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Fb.pop()||n.expando+"_"+cb++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Gb.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Gb.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Gb,"$1"+e):b.jsonp!==!1&&(b.url+=(db.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Fb.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Hb=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Hb)return Hb.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Ib=a.document.documentElement;function Jb(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Jb(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Ib;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Ib})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Jb(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=ya(k.pixelPosition,function(a,c){return c?(c=xa(a,b),va.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Kb=a.jQuery,Lb=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Lb),b&&a.jQuery===n&&(a.jQuery=Kb),n},typeof b===U&&(a.jQuery=a.$=n),n});
1
+/*! jQuery v3.6.4 | (c) OpenJS Foundation and other contributors | jquery.org/license */
2
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,y=n.hasOwnProperty,a=y.toString,l=a.call(Object),v={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.4",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=y.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,y,s,c,v,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&v(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!y||!y.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ve(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ye(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ve(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.cssHas=ce(function(){try{return C.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],y=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||y.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||y.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||y.push(".#.+[+~]"),e.querySelectorAll("\\\f"),y.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),d.cssHas||y.push(":has"),y=y.length&&new RegExp(y.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),v=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType&&e.documentElement||e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&v(p,e)?-1:t==C||t.ownerDocument==p&&v(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!y||!y.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace($," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,y){var v="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===y?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=v!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(v){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=y)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ye(function(){return[0]}),last:ye(function(e,t){return[t-1]}),eq:ye(function(e,t,n){return[n<0?n+t:n]}),even:ye(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ye(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ye(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ye(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,y,v,e){return y&&!y[S]&&(y=Ce(y)),v&&!v[S]&&(v=Ce(v,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?v||(e?d:l||y)?[]:t:f;if(g&&g(f,p,n,r),y){i=Te(p,u),y(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(v||d){if(v){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);v(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=v?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),v?v(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,y,v,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(y=o,m=0<(v=i).length,x=0<y.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=y[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=v[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+v.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ve(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ve(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function $(){E.removeEventListener("DOMContentLoaded",$),C.removeEventListener("load",$),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",$),C.addEventListener("load",$));var B=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)B(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):B(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),v.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",v.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,v.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=y.events)||(u=y.events=Object.create(null)),(a=y.handle)||(a=y.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=Y.hasData(e)&&Y.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||S.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(t,e){S.event.special[t]={setup:function(){return Se(this,t,Ce),!1},trigger:function(){return Se(this,t),!0},_default:function(e){return Y.get(e.target,t)},delegateType:e}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!v.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ye(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ye(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ye(r)),r.parentNode&&(n&&ie(r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(v.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ye(c),r=0,i=(o=ye(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ye(e),a=a||ye(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ye(c,"script")).length&&ve(a,!f&&ye(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return B(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return B(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ye(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=/^--/,Me=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Ie=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},We=new RegExp(ne.join("|"),"i"),Fe="[\\x20\\t\\r\\n\\f]",$e=new RegExp("^"+Fe+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Fe+"+$","g");function Be(e,t,n){var r,i,o,a,s=Re.test(t),u=e.style;return(n=n||Me(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace($e,"$1")||void 0),""!==a||ie(e)||(a=S.style(e,t)),!v.pixelBoxStyles()&&Pe.test(a)&&We.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var ze=["Webkit","Moz","ms"],Ue=E.createElement("div").style,Xe={};function Ve(e){var t=S.cssProps[e]||Xe[e];return t||(e in Ue?e:Xe[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=ze.length;while(n--)if((e=ze[n]+t)in Ue)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Me(e),i=(!v.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Re.test(t),l=e.style;if(u||(t=Ve(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Re.test(t)||(t=Ve(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ge.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):Ie(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Me(e),o=!v.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=_e(v.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-Ie(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return B(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Me(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Ve(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(y?"hidden"in y&&(g=y.hidden):y=Y.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",v.checkOn=""!==rt.value,v.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",v.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return B(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function yt(e){return(e.match(P)||[]).join(" ")}function vt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return B(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),v.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).addClass(t.call(this,e,vt(this)))}):(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=yt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return m(t)?this.each(function(e){S(this).removeClass(t.call(this,e,vt(this)))}):arguments.length?(e=mt(t)).length?this.each(function(){if(r=vt(this),n=1===this.nodeType&&" "+yt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=yt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return m(t)?this.each(function(e){S(this).toggleClass(t.call(this,e,vt(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=mt(t),this.each(function(){if(s)for(o=S(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=vt(this))&&Y.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":Y.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+yt(vt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:yt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},v.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),v.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=y.call(e,"type")?e.type:e,h=y.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function jt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):jt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)jt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var Dt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function $t(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Bt(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Bt(Bt(e,S.ajaxSettings),t):Bt(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,y=S.ajaxSetup({},t),v=y.context||y,m=y.context&&(v.nodeType||v.jquery)?S(v):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=y.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(y.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),y.url=((e||y.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),y.type=t.method||t.type||y.method||y.type,y.dataTypes=(y.dataType||"*").toLowerCase().match(P)||[""],null==y.crossDomain){r=E.createElement("a");try{r.href=y.url,r.href=r.href,y.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){y.crossDomain=!0}}if(y.data&&y.processData&&"string"!=typeof y.data&&(y.data=S.param(y.data,y.traditional)),$t(Rt,y,t,T),h)return T;for(i in(g=S.event&&y.global)&&0==S.active++&&S.event.trigger("ajaxStart"),y.type=y.type.toUpperCase(),y.hasContent=!Ot.test(y.type),f=y.url.replace(qt,""),y.hasContent?y.data&&y.processData&&0===(y.contentType||"").indexOf("application/x-www-form-urlencoded")&&(y.data=y.data.replace(Dt,"+")):(o=y.url.slice(f.length),y.data&&(y.processData||"string"==typeof y.data)&&(f+=(Et.test(f)?"&":"?")+y.data,delete y.data),!1===y.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),y.url=f+o),y.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(y.data&&y.hasContent&&!1!==y.contentType||t.contentType)&&T.setRequestHeader("Content-Type",y.contentType),T.setRequestHeader("Accept",y.dataTypes[0]&&y.accepts[y.dataTypes[0]]?y.accepts[y.dataTypes[0]]+("*"!==y.dataTypes[0]?", "+It+"; q=0.01":""):y.accepts["*"]),y.headers)T.setRequestHeader(i,y.headers[i]);if(y.beforeSend&&(!1===y.beforeSend.call(v,T,y)||h))return T.abort();if(u="abort",b.add(y.complete),T.done(y.success),T.fail(y.error),c=$t(Mt,y,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,y]),h)return T;y.async&&0<y.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},y.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(y,T,n)),!i&&-1<S.inArray("script",y.dataTypes)&&S.inArray("json",y.dataTypes)<0&&(y.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(y,s,T,i),i?(y.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===y.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(v,[o,l,T]):x.rejectWith(v,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,y,i?o:a]),b.fireWith(v,[T,l]),g&&(m.trigger("ajaxComplete",[T,y]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();v.cors=!!zt&&"withCredentials"in zt,v.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(v.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),v.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(v.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=yt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=_e(v.pixelPosition,function(e,t){if(t)return t=Be(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
... ...
@@ -1,8 +1,8 @@
1
-/*! jQuery UI - v1.11.4 - 2015-03-11
1
+/*! jQuery UI - v1.13.2 - 2022-07-14
2 2
 * http://jqueryui.com
3
-* Includes: core.css, accordion.css, autocomplete.css, button.css, datepicker.css, dialog.css, draggable.css, menu.css, progressbar.css, resizable.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
-* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
5
-* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
3
+* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+* To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6
5
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
6 6
 
7 7
 /* Layout helpers
8 8
 ----------------------------------*/
... ...
@@ -38,9 +38,6 @@
38 38
 .ui-helper-clearfix:after {
39 39
 	clear: both;
40 40
 }
41
-.ui-helper-clearfix {
42
-	min-height: 0; /* support: IE7 */
43
-}
44 41
 .ui-helper-zfix {
45 42
 	width: 100%;
46 43
 	height: 100%;
... ...
@@ -48,7 +45,7 @@
48 45
 	left: 0;
49 46
 	position: absolute;
50 47
 	opacity: 0;
51
-	filter:Alpha(Opacity=0); /* support: IE8 */
48
+	-ms-filter: "alpha(opacity=0)"; /* support: IE8 */
52 49
 }
53 50
 
54 51
 .ui-front {
... ...
@@ -60,20 +57,27 @@
60 57
 ----------------------------------*/
61 58
 .ui-state-disabled {
62 59
 	cursor: default !important;
60
+	pointer-events: none;
63 61
 }
64 62
 
65 63
 
66 64
 /* Icons
67 65
 ----------------------------------*/
68
-
69
-/* states and images */
70 66
 .ui-icon {
71
-	display: block;
67
+	display: inline-block;
68
+	vertical-align: middle;
69
+	margin-top: -.25em;
70
+	position: relative;
72 71
 	text-indent: -99999px;
73 72
 	overflow: hidden;
74 73
 	background-repeat: no-repeat;
75 74
 }
76 75
 
76
+.ui-widget-icon-block {
77
+	left: 50%;
78
+	margin-left: -8px;
79
+	display: block;
80
+}
77 81
 
78 82
 /* Misc visuals
79 83
 ----------------------------------*/
... ...
@@ -92,21 +96,8 @@
92 96
 	position: relative;
93 97
 	margin: 2px 0 0 0;
94 98
 	padding: .5em .5em .5em .7em;
95
-	min-height: 0; /* support: IE7 */
96 99
 	font-size: 100%;
97 100
 }
98
-.ui-accordion .ui-accordion-icons {
99
-	padding-left: 2.2em;
100
-}
101
-.ui-accordion .ui-accordion-icons .ui-accordion-icons {
102
-	padding-left: 2.2em;
103
-}
104
-.ui-accordion .ui-accordion-header .ui-accordion-header-icon {
105
-	position: absolute;
106
-	left: .5em;
107
-	top: 50%;
108
-	margin-top: -8px;
109
-}
110 101
 .ui-accordion .ui-accordion-content {
111 102
 	padding: 1em 2.2em;
112 103
 	border-top: 0;
... ...
@@ -118,17 +109,78 @@
118 109
 	left: 0;
119 110
 	cursor: default;
120 111
 }
112
+.ui-menu {
113
+	list-style: none;
114
+	padding: 0;
115
+	margin: 0;
116
+	display: block;
117
+	outline: 0;
118
+}
119
+.ui-menu .ui-menu {
120
+	position: absolute;
121
+}
122
+.ui-menu .ui-menu-item {
123
+	margin: 0;
124
+	cursor: pointer;
125
+	/* support: IE10, see #8844 */
126
+	list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
127
+}
128
+.ui-menu .ui-menu-item-wrapper {
129
+	position: relative;
130
+	padding: 3px 1em 3px .4em;
131
+}
132
+.ui-menu .ui-menu-divider {
133
+	margin: 5px 0;
134
+	height: 0;
135
+	font-size: 0;
136
+	line-height: 0;
137
+	border-width: 1px 0 0 0;
138
+}
139
+.ui-menu .ui-state-focus,
140
+.ui-menu .ui-state-active {
141
+	margin: -1px;
142
+}
143
+
144
+/* icon support */
145
+.ui-menu-icons {
146
+	position: relative;
147
+}
148
+.ui-menu-icons .ui-menu-item-wrapper {
149
+	padding-left: 2em;
150
+}
151
+
152
+/* left-aligned */
153
+.ui-menu .ui-icon {
154
+	position: absolute;
155
+	top: 0;
156
+	bottom: 0;
157
+	left: .2em;
158
+	margin: auto 0;
159
+}
160
+
161
+/* right-aligned */
162
+.ui-menu .ui-menu-icon {
163
+	left: auto;
164
+	right: 0;
165
+}
121 166
 .ui-button {
167
+	padding: .4em 1em;
122 168
 	display: inline-block;
123 169
 	position: relative;
124
-	padding: 0;
125 170
 	line-height: normal;
126 171
 	margin-right: .1em;
127 172
 	cursor: pointer;
128 173
 	vertical-align: middle;
129 174
 	text-align: center;
130
-	overflow: visible; /* removes extra width in IE */
175
+	-webkit-user-select: none;
176
+	-moz-user-select: none;
177
+	-ms-user-select: none;
178
+	user-select: none;
179
+
180
+	/* Support: IE <= 11 */
181
+	overflow: visible;
131 182
 }
183
+
132 184
 .ui-button,
133 185
 .ui-button:link,
134 186
 .ui-button:visited,
... ...
@@ -136,91 +188,129 @@
136 188
 .ui-button:active {
137 189
 	text-decoration: none;
138 190
 }
191
+
139 192
 /* to make room for the icon, a width needs to be set here */
140 193
 .ui-button-icon-only {
141
-	width: 2.2em;
142
-}
143
-/* button elements seem to need a little more width */
144
-button.ui-button-icon-only {
145
-	width: 2.4em;
194
+	width: 2em;
195
+	box-sizing: border-box;
196
+	text-indent: -9999px;
197
+	white-space: nowrap;
146 198
 }
147
-.ui-button-icons-only {
148
-	width: 3.4em;
199
+
200
+/* no icon support for input elements */
201
+input.ui-button.ui-button-icon-only {
202
+	text-indent: 0;
149 203
 }
150
-button.ui-button-icons-only {
151
-	width: 3.7em;
204
+
205
+/* button icon element(s) */
206
+.ui-button-icon-only .ui-icon {
207
+	position: absolute;
208
+	top: 50%;
209
+	left: 50%;
210
+	margin-top: -8px;
211
+	margin-left: -8px;
152 212
 }
153 213
 
154
-/* button text element */
155
-.ui-button .ui-button-text {
156
-	display: block;
157
-	line-height: normal;
214
+.ui-button.ui-icon-notext .ui-icon {
215
+	padding: 0;
216
+	width: 2.1em;
217
+	height: 2.1em;
218
+	text-indent: -9999px;
219
+	white-space: nowrap;
220
+
158 221
 }
159
-.ui-button-text-only .ui-button-text {
222
+
223
+input.ui-button.ui-icon-notext .ui-icon {
224
+	width: auto;
225
+	height: auto;
226
+	text-indent: 0;
227
+	white-space: normal;
160 228
 	padding: .4em 1em;
161 229
 }
162
-.ui-button-icon-only .ui-button-text,
163
-.ui-button-icons-only .ui-button-text {
164
-	padding: .4em;
165
-	text-indent: -9999999px;
230
+
231
+/* workarounds */
232
+/* Support: Firefox 5 - 40 */
233
+input.ui-button::-moz-focus-inner,
234
+button.ui-button::-moz-focus-inner {
235
+	border: 0;
236
+	padding: 0;
166 237
 }
167
-.ui-button-text-icon-primary .ui-button-text,
168
-.ui-button-text-icons .ui-button-text {
169
-	padding: .4em 1em .4em 2.1em;
238
+.ui-controlgroup {
239
+	vertical-align: middle;
240
+	display: inline-block;
170 241
 }
171
-.ui-button-text-icon-secondary .ui-button-text,
172
-.ui-button-text-icons .ui-button-text {
173
-	padding: .4em 2.1em .4em 1em;
242
+.ui-controlgroup > .ui-controlgroup-item {
243
+	float: left;
244
+	margin-left: 0;
245
+	margin-right: 0;
174 246
 }
175
-.ui-button-text-icons .ui-button-text {
176
-	padding-left: 2.1em;
177
-	padding-right: 2.1em;
247
+.ui-controlgroup > .ui-controlgroup-item:focus,
248
+.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus {
249
+	z-index: 9999;
178 250
 }
179
-/* no icon support for input elements, provide padding by default */
180
-input.ui-button {
251
+.ui-controlgroup-vertical > .ui-controlgroup-item {
252
+	display: block;
253
+	float: none;
254
+	width: 100%;
255
+	margin-top: 0;
256
+	margin-bottom: 0;
257
+	text-align: left;
258
+}
259
+.ui-controlgroup-vertical .ui-controlgroup-item {
260
+	box-sizing: border-box;
261
+}
262
+.ui-controlgroup .ui-controlgroup-label {
181 263
 	padding: .4em 1em;
182 264
 }
183
-
184
-/* button icon element(s) */
185
-.ui-button-icon-only .ui-icon,
186
-.ui-button-text-icon-primary .ui-icon,
187
-.ui-button-text-icon-secondary .ui-icon,
188
-.ui-button-text-icons .ui-icon,
189
-.ui-button-icons-only .ui-icon {
190
-	position: absolute;
191
-	top: 50%;
192
-	margin-top: -8px;
265
+.ui-controlgroup .ui-controlgroup-label span {
266
+	font-size: 80%;
193 267
 }
194
-.ui-button-icon-only .ui-icon {
195
-	left: 50%;
196
-	margin-left: -8px;
268
+.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item {
269
+	border-left: none;
197 270
 }
198
-.ui-button-text-icon-primary .ui-button-icon-primary,
199
-.ui-button-text-icons .ui-button-icon-primary,
200
-.ui-button-icons-only .ui-button-icon-primary {
201
-	left: .5em;
271
+.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item {
272
+	border-top: none;
273
+}
274
+.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content {
275
+	border-right: none;
202 276
 }
203
-.ui-button-text-icon-secondary .ui-button-icon-secondary,
204
-.ui-button-text-icons .ui-button-icon-secondary,
205
-.ui-button-icons-only .ui-button-icon-secondary {
206
-	right: .5em;
277
+.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content {
278
+	border-bottom: none;
207 279
 }
208 280
 
209
-/* button sets */
210
-.ui-buttonset {
211
-	margin-right: 7px;
281
+/* Spinner specific style fixes */
282
+.ui-controlgroup-vertical .ui-spinner-input {
283
+
284
+	/* Support: IE8 only, Android < 4.4 only */
285
+	width: 75%;
286
+	width: calc( 100% - 2.4em );
212 287
 }
213
-.ui-buttonset .ui-button {
214
-	margin-left: 0;
215
-	margin-right: -.3em;
288
+.ui-controlgroup-vertical .ui-spinner .ui-spinner-up {
289
+	border-top-style: solid;
216 290
 }
217 291
 
218
-/* workarounds */
219
-/* reset extra padding in Firefox, see h5bp.com/l */
220
-input.ui-button::-moz-focus-inner,
221
-button.ui-button::-moz-focus-inner {
222
-	border: 0;
223
-	padding: 0;
292
+.ui-checkboxradio-label .ui-icon-background {
293
+	box-shadow: inset 1px 1px 1px #ccc;
294
+	border-radius: .12em;
295
+	border: none;
296
+}
297
+.ui-checkboxradio-radio-label .ui-icon-background {
298
+	width: 16px;
299
+	height: 16px;
300
+	border-radius: 1em;
301
+	overflow: visible;
302
+	border: none;
303
+}
304
+.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,
305
+.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon {
306
+	background-image: none;
307
+	width: 8px;
308
+	height: 8px;
309
+	border-width: 4px;
310
+	border-style: solid;
311
+}
312
+.ui-checkboxradio-disabled {
313
+	pointer-events: none;
224 314
 }
225 315
 .ui-datepicker {
226 316
 	width: 17em;
... ...
@@ -387,8 +477,17 @@ button.ui-button::-moz-focus-inner {
387 477
 	border-right-width: 0;
388 478
 	border-left-width: 1px;
389 479
 }
390
-.ui-dialog {
480
+
481
+/* Icons */
482
+.ui-datepicker .ui-icon {
483
+	display: block;
484
+	text-indent: -99999px;
391 485
 	overflow: hidden;
486
+	background-repeat: no-repeat;
487
+	left: .5em;
488
+	top: .3em;
489
+}
490
+.ui-dialog {
392 491
 	position: absolute;
393 492
 	top: 0;
394 493
 	left: 0;
... ...
@@ -437,90 +536,51 @@ button.ui-button::-moz-focus-inner {
437 536
 	margin: .5em .4em .5em 0;
438 537
 	cursor: pointer;
439 538
 }
440
-.ui-dialog .ui-resizable-se {
441
-	width: 12px;
442
-	height: 12px;
443
-	right: -5px;
444
-	bottom: -5px;
445
-	background-position: 16px 16px;
446
-}
447
-.ui-draggable .ui-dialog-titlebar {
448
-	cursor: move;
449
-}
450
-.ui-draggable-handle {
451
-	-ms-touch-action: none;
452
-	touch-action: none;
453
-}
454
-.ui-menu {
455
-	list-style: none;
456
-	padding: 0;
457
-	margin: 0;
458
-	display: block;
459
-	outline: none;
460
-}
461
-.ui-menu .ui-menu {
462
-	position: absolute;
539
+.ui-dialog .ui-resizable-n {
540
+	height: 2px;
541
+	top: 0;
463 542
 }
464
-.ui-menu .ui-menu-item {
465
-	position: relative;
466
-	margin: 0;
467
-	padding: 3px 1em 3px .4em;
468
-	cursor: pointer;
469
-	min-height: 0; /* support: IE7 */
470
-	/* support: IE10, see #8844 */
471
-	list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
543
+.ui-dialog .ui-resizable-e {
544
+	width: 2px;
545
+	right: 0;
472 546
 }
473
-.ui-menu .ui-menu-divider {
474
-	margin: 5px 0;
475
-	height: 0;
476
-	font-size: 0;
477
-	line-height: 0;
478
-	border-width: 1px 0 0 0;
547
+.ui-dialog .ui-resizable-s {
548
+	height: 2px;
549
+	bottom: 0;
479 550
 }
480
-.ui-menu .ui-state-focus,
481
-.ui-menu .ui-state-active {
482
-	margin: -1px;
551
+.ui-dialog .ui-resizable-w {
552
+	width: 2px;
553
+	left: 0;
483 554
 }
484
-
485
-/* icon support */
486
-.ui-menu-icons {
487
-	position: relative;
555
+.ui-dialog .ui-resizable-se,
556
+.ui-dialog .ui-resizable-sw,
557
+.ui-dialog .ui-resizable-ne,
558
+.ui-dialog .ui-resizable-nw {
559
+	width: 7px;
560
+	height: 7px;
488 561
 }
489
-.ui-menu-icons .ui-menu-item {
490
-	padding-left: 2em;
562
+.ui-dialog .ui-resizable-se {
563
+	right: 0;
564
+	bottom: 0;
491 565
 }
492
-
493
-/* left-aligned */
494
-.ui-menu .ui-icon {
495
-	position: absolute;
496
-	top: 0;
566
+.ui-dialog .ui-resizable-sw {
567
+	left: 0;
497 568
 	bottom: 0;
498
-	left: .2em;
499
-	margin: auto 0;
500 569
 }
501
-
502
-/* right-aligned */
503
-.ui-menu .ui-menu-icon {
504
-	left: auto;
570
+.ui-dialog .ui-resizable-ne {
505 571
 	right: 0;
572
+	top: 0;
506 573
 }
507
-.ui-progressbar {
508
-	height: 2em;
509
-	text-align: left;
510
-	overflow: hidden;
511
-}
512
-.ui-progressbar .ui-progressbar-value {
513
-	margin: -1px;
514
-	height: 100%;
574
+.ui-dialog .ui-resizable-nw {
575
+	left: 0;
576
+	top: 0;
515 577
 }
516
-.ui-progressbar .ui-progressbar-overlay {
517
-	background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
518
-	height: 100%;
519
-	filter: alpha(opacity=25); /* support: IE8 */
520
-	opacity: 0.25;
578
+.ui-draggable .ui-dialog-titlebar {
579
+	cursor: move;
521 580
 }
522
-.ui-progressbar-indeterminate .ui-progressbar-value {
523
-	background-image: none;
581
+.ui-draggable-handle {
582
+	-ms-touch-action: none;
583
+	touch-action: none;
524 584
 }
525 585
 .ui-resizable {
526 586
 	position: relative;
... ...
@@ -592,6 +652,24 @@ button.ui-button::-moz-focus-inner {
592 652
 	right: -5px;
593 653
 	top: -5px;
594 654
 }
655
+.ui-progressbar {
656
+	height: 2em;
657
+	text-align: left;
658
+	overflow: hidden;
659
+}
660
+.ui-progressbar .ui-progressbar-value {
661
+	margin: -1px;
662
+	height: 100%;
663
+}
664
+.ui-progressbar .ui-progressbar-overlay {
665
+	background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");
666
+	height: 100%;
667
+	-ms-filter: "alpha(opacity=25)"; /* support: IE8 */
668
+	opacity: 0.25;
669
+}
670
+.ui-progressbar-indeterminate .ui-progressbar-value {
671
+	background-image: none;
672
+}
595 673
 .ui-selectable {
596 674
 	-ms-touch-action: none;
597 675
 	touch-action: none;
... ...
@@ -611,7 +689,6 @@ button.ui-button::-moz-focus-inner {
611 689
 }
612 690
 .ui-selectmenu-menu .ui-menu {
613 691
 	overflow: auto;
614
-	/* Support: IE7 */
615 692
 	overflow-x: hidden;
616 693
 	padding-bottom: 1px;
617 694
 }
... ...
@@ -627,28 +704,20 @@ button.ui-button::-moz-focus-inner {
627 704
 .ui-selectmenu-open {
628 705
 	display: block;
629 706
 }
630
-.ui-selectmenu-button {
631
-	display: inline-block;
632
-	overflow: hidden;
633
-	position: relative;
634
-	text-decoration: none;
635
-	cursor: pointer;
636
-}
637
-.ui-selectmenu-button span.ui-icon {
638
-	right: 0.5em;
639
-	left: auto;
640
-	margin-top: -8px;
641
-	position: absolute;
642
-	top: 50%;
643
-}
644
-.ui-selectmenu-button span.ui-selectmenu-text {
645
-	text-align: left;
646
-	padding: 0.4em 2.1em 0.4em 1em;
707
+.ui-selectmenu-text {
647 708
 	display: block;
648
-	line-height: 1.4;
709
+	margin-right: 20px;
649 710
 	overflow: hidden;
650 711
 	text-overflow: ellipsis;
712
+}
713
+.ui-selectmenu-button.ui-button {
714
+	text-align: left;
651 715
 	white-space: nowrap;
716
+	width: 14em;
717
+}
718
+.ui-selectmenu-icon.ui-icon {
719
+	float: right;
720
+	margin-top: 0;
652 721
 }
653 722
 .ui-slider {
654 723
 	position: relative;
... ...
@@ -659,7 +728,7 @@ button.ui-button::-moz-focus-inner {
659 728
 	z-index: 2;
660 729
 	width: 1.2em;
661 730
 	height: 1.2em;
662
-	cursor: default;
731
+	cursor: pointer;
663 732
 	-ms-touch-action: none;
664 733
 	touch-action: none;
665 734
 }
... ...
@@ -730,14 +799,14 @@ button.ui-button::-moz-focus-inner {
730 799
 	border: none;
731 800
 	background: none;
732 801
 	color: inherit;
733
-	padding: 0;
802
+	padding: .222em 0;
734 803
 	margin: .2em 0;
735 804
 	vertical-align: middle;
736 805
 	margin-left: .4em;
737
-	margin-right: 22px;
806
+	margin-right: 2em;
738 807
 }
739 808
 .ui-spinner-button {
740
-	width: 16px;
809
+	width: 1.6em;
741 810
 	height: 50%;
742 811
 	font-size: .5em;
743 812
 	padding: 0;
... ...
@@ -751,16 +820,9 @@ button.ui-button::-moz-focus-inner {
751 820
 }
752 821
 /* more specificity required here to override default borders */
753 822
 .ui-spinner a.ui-spinner-button {
754
-	border-top: none;
755
-	border-bottom: none;
756
-	border-right: none;
757
-}
758
-/* vertically center icon */
759
-.ui-spinner .ui-icon {
760
-	position: absolute;
761
-	margin-top: -8px;
762
-	top: 50%;
763
-	left: 0;
823
+	border-top-style: none;
824
+	border-bottom-style: none;
825
+	border-right-style: none;
764 826
 }
765 827
 .ui-spinner-up {
766 828
 	top: 0;
... ...
@@ -768,12 +830,6 @@ button.ui-button::-moz-focus-inner {
768 830
 .ui-spinner-down {
769 831
 	bottom: 0;
770 832
 }
771
-
772
-/* TR overrides */
773
-.ui-spinner .ui-icon-triangle-1-s {
774
-	/* need to fix icons sprite */
775
-	background-position: -65px -16px;
776
-}
777 833
 .ui-tabs {
778 834
 	position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
779 835
 	padding: .2em;
... ...
@@ -820,8 +876,6 @@ button.ui-button::-moz-focus-inner {
820 876
 	position: absolute;
821 877
 	z-index: 9999;
822 878
 	max-width: 300px;
823
-	-webkit-box-shadow: 0 0 5px #aaa;
824
-	box-shadow: 0 0 5px #aaa;
825 879
 }
826 880
 body .ui-tooltip {
827 881
 	border-width: 2px;
... ...
@@ -830,8 +884,8 @@ body .ui-tooltip {
830 884
 /* Component containers
831 885
 ----------------------------------*/
832 886
 .ui-widget {
833
-	font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
834
-	font-size: 1.1em;
887
+	font-family: Arial,Helvetica,sans-serif;
888
+	font-size: 1em;
835 889
 }
836 890
 .ui-widget .ui-widget {
837 891
 	font-size: 1em;
... ...
@@ -840,41 +894,54 @@ body .ui-tooltip {
840 894
 .ui-widget select,
841 895
 .ui-widget textarea,
842 896
 .ui-widget button {
843
-	font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;
897
+	font-family: Arial,Helvetica,sans-serif;
844 898
 	font-size: 1em;
845 899
 }
900
+.ui-widget.ui-widget-content {
901
+	border: 1px solid #c5c5c5;
902
+}
846 903
 .ui-widget-content {
847 904
 	border: 1px solid #dddddd;
848
-	background: #eeeeee url("images/ui-bg_highlight-soft_100_eeeeee_1x100.png") 50% top repeat-x;
905
+	background: #ffffff;
849 906
 	color: #333333;
850 907
 }
851 908
 .ui-widget-content a {
852 909
 	color: #333333;
853 910
 }
854 911
 .ui-widget-header {
855
-	border: 1px solid #e78f08;
856
-	background: #f6a828 url("images/ui-bg_gloss-wave_35_f6a828_500x100.png") 50% 50% repeat-x;
857
-	color: #ffffff;
912
+	border: 1px solid #dddddd;
913
+	background: #e9e9e9;
914
+	color: #333333;
858 915
 	font-weight: bold;
859 916
 }
860 917
 .ui-widget-header a {
861
-	color: #ffffff;
918
+	color: #333333;
862 919
 }
863 920
 
864 921
 /* Interaction states
865 922
 ----------------------------------*/
866 923
 .ui-state-default,
867 924
 .ui-widget-content .ui-state-default,
868
-.ui-widget-header .ui-state-default {
869
-	border: 1px solid #cccccc;
870
-	background: #f6f6f6 url("images/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x;
871
-	font-weight: bold;
872
-	color: #1c94c4;
925
+.ui-widget-header .ui-state-default,
926
+.ui-button,
927
+
928
+/* We use html here because we need a greater specificity to make sure disabled
929
+works properly when clicked or hovered */
930
+html .ui-button.ui-state-disabled:hover,
931
+html .ui-button.ui-state-disabled:active {
932
+	border: 1px solid #c5c5c5;
933
+	background: #f6f6f6;
934
+	font-weight: normal;
935
+	color: #454545;
873 936
 }
874 937
 .ui-state-default a,
875 938
 .ui-state-default a:link,
876
-.ui-state-default a:visited {
877
-	color: #1c94c4;
939
+.ui-state-default a:visited,
940
+a.ui-button,
941
+a:link.ui-button,
942
+a:visited.ui-button,
943
+.ui-button {
944
+	color: #454545;
878 945
 	text-decoration: none;
879 946
 }
880 947
 .ui-state-hover,
... ...
@@ -882,11 +949,13 @@ body .ui-tooltip {
882 949
 .ui-widget-header .ui-state-hover,
883 950
 .ui-state-focus,
884 951
 .ui-widget-content .ui-state-focus,
885
-.ui-widget-header .ui-state-focus {
886
-	border: 1px solid #fbcb09;
887
-	background: #fdf5ce url("images/ui-bg_glass_100_fdf5ce_1x400.png") 50% 50% repeat-x;
888
-	font-weight: bold;
889
-	color: #c77405;
952
+.ui-widget-header .ui-state-focus,
953
+.ui-button:hover,
954
+.ui-button:focus {
955
+	border: 1px solid #cccccc;
956
+	background: #ededed;
957
+	font-weight: normal;
958
+	color: #2b2b2b;
890 959
 }
891 960
 .ui-state-hover a,
892 961
 .ui-state-hover a:hover,
... ...
@@ -895,22 +964,36 @@ body .ui-tooltip {
895 964
 .ui-state-focus a,
896 965
 .ui-state-focus a:hover,
897 966
 .ui-state-focus a:link,
898
-.ui-state-focus a:visited {
899
-	color: #c77405;
967
+.ui-state-focus a:visited,
968
+a.ui-button:hover,
969
+a.ui-button:focus {
970
+	color: #2b2b2b;
900 971
 	text-decoration: none;
901 972
 }
973
+
974
+.ui-visual-focus {
975
+	box-shadow: 0 0 3px 1px rgb(94, 158, 214);
976
+}
902 977
 .ui-state-active,
903 978
 .ui-widget-content .ui-state-active,
904
-.ui-widget-header .ui-state-active {
905
-	border: 1px solid #fbd850;
906
-	background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x;
907
-	font-weight: bold;
908
-	color: #eb8f00;
979
+.ui-widget-header .ui-state-active,
980
+a.ui-button:active,
981
+.ui-button:active,
982
+.ui-button.ui-state-active:hover {
983
+	border: 1px solid #003eff;
984
+	background: #007fff;
985
+	font-weight: normal;
986
+	color: #ffffff;
987
+}
988
+.ui-icon-background,
989
+.ui-state-active .ui-icon-background {
990
+	border: #003eff;
991
+	background-color: #ffffff;
909 992
 }
910 993
 .ui-state-active a,
911 994
 .ui-state-active a:link,
912 995
 .ui-state-active a:visited {
913
-	color: #eb8f00;
996
+	color: #ffffff;
914 997
 	text-decoration: none;
915 998
 }
916 999
 
... ...
@@ -919,31 +1002,35 @@ body .ui-tooltip {
919 1002
 .ui-state-highlight,
920 1003
 .ui-widget-content .ui-state-highlight,
921 1004
 .ui-widget-header .ui-state-highlight {
922
-	border: 1px solid #fed22f;
923
-	background: #ffe45c url("images/ui-bg_highlight-soft_75_ffe45c_1x100.png") 50% top repeat-x;
924
-	color: #363636;
1005
+	border: 1px solid #dad55e;
1006
+	background: #fffa90;
1007
+	color: #777620;
1008
+}
1009
+.ui-state-checked {
1010
+	border: 1px solid #dad55e;
1011
+	background: #fffa90;
925 1012
 }
926 1013
 .ui-state-highlight a,
927 1014
 .ui-widget-content .ui-state-highlight a,
928 1015
 .ui-widget-header .ui-state-highlight a {
929
-	color: #363636;
1016
+	color: #777620;
930 1017
 }
931 1018
 .ui-state-error,
932 1019
 .ui-widget-content .ui-state-error,
933 1020
 .ui-widget-header .ui-state-error {
934
-	border: 1px solid #cd0a0a;
935
-	background: #b81900 url("images/ui-bg_diagonals-thick_18_b81900_40x40.png") 50% 50% repeat;
936
-	color: #ffffff;
1021
+	border: 1px solid #f1a899;
1022
+	background: #fddfdf;
1023
+	color: #5f3f3f;
937 1024
 }
938 1025
 .ui-state-error a,
939 1026
 .ui-widget-content .ui-state-error a,
940 1027
 .ui-widget-header .ui-state-error a {
941
-	color: #ffffff;
1028
+	color: #5f3f3f;
942 1029
 }
943 1030
 .ui-state-error-text,
944 1031
 .ui-widget-content .ui-state-error-text,
945 1032
 .ui-widget-header .ui-state-error-text {
946
-	color: #ffffff;
1033
+	color: #5f3f3f;
947 1034
 }
948 1035
 .ui-priority-primary,
949 1036
 .ui-widget-content .ui-priority-primary,
... ...
@@ -954,18 +1041,18 @@ body .ui-tooltip {
954 1041
 .ui-widget-content .ui-priority-secondary,
955 1042
 .ui-widget-header .ui-priority-secondary {
956 1043
 	opacity: .7;
957
-	filter:Alpha(Opacity=70); /* support: IE8 */
1044
+	-ms-filter: "alpha(opacity=70)"; /* support: IE8 */
958 1045
 	font-weight: normal;
959 1046
 }
960 1047
 .ui-state-disabled,
961 1048
 .ui-widget-content .ui-state-disabled,
962 1049
 .ui-widget-header .ui-state-disabled {
963 1050
 	opacity: .35;
964
-	filter:Alpha(Opacity=35); /* support: IE8 */
1051
+	-ms-filter: "alpha(opacity=35)"; /* support: IE8 */
965 1052
 	background-image: none;
966 1053
 }
967 1054
 .ui-state-disabled .ui-icon {
968
-	filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */
1055
+	-ms-filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */
969 1056
 }
970 1057
 
971 1058
 /* Icons
... ...
@@ -978,46 +1065,53 @@ body .ui-tooltip {
978 1065
 }
979 1066
 .ui-icon,
980 1067
 .ui-widget-content .ui-icon {
981
-	background-image: url("images/ui-icons_222222_256x240.png");
1068
+	background-image: url("images/ui-icons_444444_256x240.png");
982 1069
 }
983 1070
 .ui-widget-header .ui-icon {
984
-	background-image: url("images/ui-icons_ffffff_256x240.png");
985
-}
986
-.ui-state-default .ui-icon {
987
-	background-image: url("images/ui-icons_ef8c08_256x240.png");
1071
+	background-image: url("images/ui-icons_444444_256x240.png");
988 1072
 }
989 1073
 .ui-state-hover .ui-icon,
990
-.ui-state-focus .ui-icon {
991
-	background-image: url("images/ui-icons_ef8c08_256x240.png");
1074
+.ui-state-focus .ui-icon,
1075
+.ui-button:hover .ui-icon,
1076
+.ui-button:focus .ui-icon {
1077
+	background-image: url("images/ui-icons_555555_256x240.png");
992 1078
 }
993
-.ui-state-active .ui-icon {
994
-	background-image: url("images/ui-icons_ef8c08_256x240.png");
1079
+.ui-state-active .ui-icon,
1080
+.ui-button:active .ui-icon {
1081
+	background-image: url("images/ui-icons_ffffff_256x240.png");
995 1082
 }
996
-.ui-state-highlight .ui-icon {
997
-	background-image: url("images/ui-icons_228ef1_256x240.png");
1083
+.ui-state-highlight .ui-icon,
1084
+.ui-button .ui-state-highlight.ui-icon {
1085
+	background-image: url("images/ui-icons_777620_256x240.png");
998 1086
 }
999 1087
 .ui-state-error .ui-icon,
1000 1088
 .ui-state-error-text .ui-icon {
1001
-	background-image: url("images/ui-icons_ffd27a_256x240.png");
1089
+	background-image: url("images/ui-icons_cc0000_256x240.png");
1090
+}
1091
+.ui-button .ui-icon {
1092
+	background-image: url("images/ui-icons_777777_256x240.png");
1002 1093
 }
1003 1094
 
1004 1095
 /* positioning */
1005
-.ui-icon-blank { background-position: 16px 16px; }
1006
-.ui-icon-carat-1-n { background-position: 0 0; }
1007
-.ui-icon-carat-1-ne { background-position: -16px 0; }
1008
-.ui-icon-carat-1-e { background-position: -32px 0; }
1009
-.ui-icon-carat-1-se { background-position: -48px 0; }
1010
-.ui-icon-carat-1-s { background-position: -64px 0; }
1011
-.ui-icon-carat-1-sw { background-position: -80px 0; }
1012
-.ui-icon-carat-1-w { background-position: -96px 0; }
1013
-.ui-icon-carat-1-nw { background-position: -112px 0; }
1014
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
1015
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
1096
+/* Three classes needed to override `.ui-button:hover .ui-icon` */
1097
+.ui-icon-blank.ui-icon-blank.ui-icon-blank {
1098
+	background-image: none;
1099
+}
1100
+.ui-icon-caret-1-n { background-position: 0 0; }
1101
+.ui-icon-caret-1-ne { background-position: -16px 0; }
1102
+.ui-icon-caret-1-e { background-position: -32px 0; }
1103
+.ui-icon-caret-1-se { background-position: -48px 0; }
1104
+.ui-icon-caret-1-s { background-position: -65px 0; }
1105
+.ui-icon-caret-1-sw { background-position: -80px 0; }
1106
+.ui-icon-caret-1-w { background-position: -96px 0; }
1107
+.ui-icon-caret-1-nw { background-position: -112px 0; }
1108
+.ui-icon-caret-2-n-s { background-position: -128px 0; }
1109
+.ui-icon-caret-2-e-w { background-position: -144px 0; }
1016 1110
 .ui-icon-triangle-1-n { background-position: 0 -16px; }
1017 1111
 .ui-icon-triangle-1-ne { background-position: -16px -16px; }
1018 1112
 .ui-icon-triangle-1-e { background-position: -32px -16px; }
1019 1113
 .ui-icon-triangle-1-se { background-position: -48px -16px; }
1020
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
1114
+.ui-icon-triangle-1-s { background-position: -65px -16px; }
1021 1115
 .ui-icon-triangle-1-sw { background-position: -80px -16px; }
1022 1116
 .ui-icon-triangle-1-w { background-position: -96px -16px; }
1023 1117
 .ui-icon-triangle-1-nw { background-position: -112px -16px; }
... ...
@@ -1027,7 +1121,7 @@ body .ui-tooltip {
1027 1121
 .ui-icon-arrow-1-ne { background-position: -16px -32px; }
1028 1122
 .ui-icon-arrow-1-e { background-position: -32px -32px; }
1029 1123
 .ui-icon-arrow-1-se { background-position: -48px -32px; }
1030
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
1124
+.ui-icon-arrow-1-s { background-position: -65px -32px; }
1031 1125
 .ui-icon-arrow-1-sw { background-position: -80px -32px; }
1032 1126
 .ui-icon-arrow-1-w { background-position: -96px -32px; }
1033 1127
 .ui-icon-arrow-1-nw { background-position: -112px -32px; }
... ...
@@ -1039,7 +1133,7 @@ body .ui-tooltip {
1039 1133
 .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
1040 1134
 .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
1041 1135
 .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
1042
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
1136
+.ui-icon-arrowthick-1-n { background-position: 1px -48px; }
1043 1137
 .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
1044 1138
 .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
1045 1139
 .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
... ...
@@ -1188,38 +1282,34 @@ body .ui-tooltip {
1188 1282
 .ui-corner-top,
1189 1283
 .ui-corner-left,
1190 1284
 .ui-corner-tl {
1191
-	border-top-left-radius: 4px;
1285
+	border-top-left-radius: 3px;
1192 1286
 }
1193 1287
 .ui-corner-all,
1194 1288
 .ui-corner-top,
1195 1289
 .ui-corner-right,
1196 1290
 .ui-corner-tr {
1197
-	border-top-right-radius: 4px;
1291
+	border-top-right-radius: 3px;
1198 1292
 }
1199 1293
 .ui-corner-all,
1200 1294
 .ui-corner-bottom,
1201 1295
 .ui-corner-left,
1202 1296
 .ui-corner-bl {
1203
-	border-bottom-left-radius: 4px;
1297
+	border-bottom-left-radius: 3px;
1204 1298
 }
1205 1299
 .ui-corner-all,
1206 1300
 .ui-corner-bottom,
1207 1301
 .ui-corner-right,
1208 1302
 .ui-corner-br {
1209
-	border-bottom-right-radius: 4px;
1303
+	border-bottom-right-radius: 3px;
1210 1304
 }
1211 1305
 
1212 1306
 /* Overlays */
1213 1307
 .ui-widget-overlay {
1214
-	background: #666666 url("images/ui-bg_diagonals-thick_20_666666_40x40.png") 50% 50% repeat;
1215
-	opacity: .5;
1216
-	filter: Alpha(Opacity=50); /* support: IE8 */
1308
+	background: #aaaaaa;
1309
+	opacity: .003;
1310
+	-ms-filter: Alpha(Opacity=.3); /* support: IE8 */
1217 1311
 }
1218 1312
 .ui-widget-shadow {
1219
-	margin: -5px 0 0 -5px;
1220
-	padding: 5px;
1221
-	background: #000000 url("images/ui-bg_flat_10_000000_40x100.png") 50% 50% repeat-x;
1222
-	opacity: .2;
1223
-	filter: Alpha(Opacity=20); /* support: IE8 */
1224
-	border-radius: 5px;
1313
+	-webkit-box-shadow: 0px 0px 5px #666666;
1314
+	box-shadow: 0px 0px 5px #666666;
1225 1315
 }
... ...
@@ -1,9 +1,11 @@
1
-/*! jQuery UI - v1.11.4 - 2015-03-11
1
+/*! jQuery UI - v1.13.2 - 2022-07-14
2 2
 * http://jqueryui.com
3
-* Includes: core.js, widget.js, mouse.js, position.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, draggable.js, droppable.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js, menu.js, progressbar.js, resizable.js, selectable.js, selectmenu.js, slider.js, sortable.js, spinner.js, tabs.js, tooltip.js
4
-* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
3
+* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
4
+* Copyright jQuery Foundation and other contributors; Licensed MIT */
5 5
 
6 6
 ( function( factory ) {
7
+	"use strict";
8
+	
7 9
 	if ( typeof define === "function" && define.amd ) {
8 10
 
9 11
 		// AMD. Register as an anonymous module.
... ...
@@ -13,401 +15,127 @@
13 15
 		// Browser globals
14 16
 		factory( jQuery );
15 17
 	}
16
-}(function( $ ) {
17
-/*!
18
- * jQuery UI Core 1.11.4
19
- * http://jqueryui.com
20
- *
21
- * Copyright jQuery Foundation and other contributors
22
- * Released under the MIT license.
23
- * http://jquery.org/license
24
- *
25
- * http://api.jqueryui.com/category/ui-core/
26
- */
27
-
18
+} )( function( $ ) {
19
+"use strict";
28 20
 
29
-// $.ui might exist from components with no dependencies, e.g., $.ui.position
30 21
 $.ui = $.ui || {};
31 22
 
32
-$.extend( $.ui, {
33
-	version: "1.11.4",
34
-
35
-	keyCode: {
36
-		BACKSPACE: 8,
37
-		COMMA: 188,
38
-		DELETE: 46,
39
-		DOWN: 40,
40
-		END: 35,
41
-		ENTER: 13,
42
-		ESCAPE: 27,
43
-		HOME: 36,
44
-		LEFT: 37,
45
-		PAGE_DOWN: 34,
46
-		PAGE_UP: 33,
47
-		PERIOD: 190,
48
-		RIGHT: 39,
49
-		SPACE: 32,
50
-		TAB: 9,
51
-		UP: 38
52
-	}
53
-});
54
-
55
-// plugins
56
-$.fn.extend({
57
-	scrollParent: function( includeHidden ) {
58
-		var position = this.css( "position" ),
59
-			excludeStaticParent = position === "absolute",
60
-			overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
61
-			scrollParent = this.parents().filter( function() {
62
-				var parent = $( this );
63
-				if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
64
-					return false;
65
-				}
66
-				return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) );
67
-			}).eq( 0 );
68
-
69
-		return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent;
70
-	},
71
-
72
-	uniqueId: (function() {
73
-		var uuid = 0;
74
-
75
-		return function() {
76
-			return this.each(function() {
77
-				if ( !this.id ) {
78
-					this.id = "ui-id-" + ( ++uuid );
79
-				}
80
-			});
81
-		};
82
-	})(),
83
-
84
-	removeUniqueId: function() {
85
-		return this.each(function() {
86
-			if ( /^ui-id-\d+$/.test( this.id ) ) {
87
-				$( this ).removeAttr( "id" );
88
-			}
89
-		});
90
-	}
91
-});
92
-
93
-// selectors
94
-function focusable( element, isTabIndexNotNaN ) {
95
-	var map, mapName, img,
96
-		nodeName = element.nodeName.toLowerCase();
97
-	if ( "area" === nodeName ) {
98
-		map = element.parentNode;
99
-		mapName = map.name;
100
-		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
101
-			return false;
102
-		}
103
-		img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
104
-		return !!img && visible( img );
105
-	}
106
-	return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
107
-		!element.disabled :
108
-		"a" === nodeName ?
109
-			element.href || isTabIndexNotNaN :
110
-			isTabIndexNotNaN) &&
111
-		// the element and all of its ancestors must be visible
112
-		visible( element );
113
-}
114
-
115
-function visible( element ) {
116
-	return $.expr.filters.visible( element ) &&
117
-		!$( element ).parents().addBack().filter(function() {
118
-			return $.css( this, "visibility" ) === "hidden";
119
-		}).length;
120
-}
121
-
122
-$.extend( $.expr[ ":" ], {
123
-	data: $.expr.createPseudo ?
124
-		$.expr.createPseudo(function( dataName ) {
125
-			return function( elem ) {
126
-				return !!$.data( elem, dataName );
127
-			};
128
-		}) :
129
-		// support: jQuery <1.8
130
-		function( elem, i, match ) {
131
-			return !!$.data( elem, match[ 3 ] );
132
-		},
133
-
134
-	focusable: function( element ) {
135
-		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
136
-	},
137
-
138
-	tabbable: function( element ) {
139
-		var tabIndex = $.attr( element, "tabindex" ),
140
-			isTabIndexNaN = isNaN( tabIndex );
141
-		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
142
-	}
143
-});
144
-
145
-// support: jQuery <1.8
146
-if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
147
-	$.each( [ "Width", "Height" ], function( i, name ) {
148
-		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
149
-			type = name.toLowerCase(),
150
-			orig = {
151
-				innerWidth: $.fn.innerWidth,
152
-				innerHeight: $.fn.innerHeight,
153
-				outerWidth: $.fn.outerWidth,
154
-				outerHeight: $.fn.outerHeight
155
-			};
156
-
157
-		function reduce( elem, size, border, margin ) {
158
-			$.each( side, function() {
159
-				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
160
-				if ( border ) {
161
-					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
162
-				}
163
-				if ( margin ) {
164
-					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
165
-				}
166
-			});
167
-			return size;
168
-		}
169
-
170
-		$.fn[ "inner" + name ] = function( size ) {
171
-			if ( size === undefined ) {
172
-				return orig[ "inner" + name ].call( this );
173
-			}
174
-
175
-			return this.each(function() {
176
-				$( this ).css( type, reduce( this, size ) + "px" );
177
-			});
178
-		};
179
-
180
-		$.fn[ "outer" + name] = function( size, margin ) {
181
-			if ( typeof size !== "number" ) {
182
-				return orig[ "outer" + name ].call( this, size );
183
-			}
184
-
185
-			return this.each(function() {
186
-				$( this).css( type, reduce( this, size, true, margin ) + "px" );
187
-			});
188
-		};
189
-	});
190
-}
191
-
192
-// support: jQuery <1.8
193
-if ( !$.fn.addBack ) {
194
-	$.fn.addBack = function( selector ) {
195
-		return this.add( selector == null ?
196
-			this.prevObject : this.prevObject.filter( selector )
197
-		);
198
-	};
199
-}
200
-
201
-// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
202
-if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
203
-	$.fn.removeData = (function( removeData ) {
204
-		return function( key ) {
205
-			if ( arguments.length ) {
206
-				return removeData.call( this, $.camelCase( key ) );
207
-			} else {
208
-				return removeData.call( this );
209
-			}
210
-		};
211
-	})( $.fn.removeData );
212
-}
213
-
214
-// deprecated
215
-$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
216
-
217
-$.fn.extend({
218
-	focus: (function( orig ) {
219
-		return function( delay, fn ) {
220
-			return typeof delay === "number" ?
221
-				this.each(function() {
222
-					var elem = this;
223
-					setTimeout(function() {
224
-						$( elem ).focus();
225
-						if ( fn ) {
226
-							fn.call( elem );
227
-						}
228
-					}, delay );
229
-				}) :
230
-				orig.apply( this, arguments );
231
-		};
232
-	})( $.fn.focus ),
233
-
234
-	disableSelection: (function() {
235
-		var eventType = "onselectstart" in document.createElement( "div" ) ?
236
-			"selectstart" :
237
-			"mousedown";
238
-
239
-		return function() {
240
-			return this.bind( eventType + ".ui-disableSelection", function( event ) {
241
-				event.preventDefault();
242
-			});
243
-		};
244
-	})(),
245
-
246
-	enableSelection: function() {
247
-		return this.unbind( ".ui-disableSelection" );
248
-	},
249
-
250
-	zIndex: function( zIndex ) {
251
-		if ( zIndex !== undefined ) {
252
-			return this.css( "zIndex", zIndex );
253
-		}
254
-
255
-		if ( this.length ) {
256
-			var elem = $( this[ 0 ] ), position, value;
257
-			while ( elem.length && elem[ 0 ] !== document ) {
258
-				// Ignore z-index if position is set to a value where z-index is ignored by the browser
259
-				// This makes behavior of this function consistent across browsers
260
-				// WebKit always returns auto if the element is positioned
261
-				position = elem.css( "position" );
262
-				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
263
-					// IE returns 0 when zIndex is not specified
264
-					// other browsers return a string
265
-					// we ignore the case of nested elements with an explicit value of 0
266
-					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
267
-					value = parseInt( elem.css( "zIndex" ), 10 );
268
-					if ( !isNaN( value ) && value !== 0 ) {
269
-						return value;
270
-					}
271
-				}
272
-				elem = elem.parent();
273
-			}
274
-		}
275
-
276
-		return 0;
277
-	}
278
-});
279
-
280
-// $.ui.plugin is deprecated. Use $.widget() extensions instead.
281
-$.ui.plugin = {
282
-	add: function( module, option, set ) {
283
-		var i,
284
-			proto = $.ui[ module ].prototype;
285
-		for ( i in set ) {
286
-			proto.plugins[ i ] = proto.plugins[ i ] || [];
287
-			proto.plugins[ i ].push( [ option, set[ i ] ] );
288
-		}
289
-	},
290
-	call: function( instance, name, args, allowDisconnected ) {
291
-		var i,
292
-			set = instance.plugins[ name ];
293
-
294
-		if ( !set ) {
295
-			return;
296
-		}
297
-
298
-		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
299
-			return;
300
-		}
301
-
302
-		for ( i = 0; i < set.length; i++ ) {
303
-			if ( instance.options[ set[ i ][ 0 ] ] ) {
304
-				set[ i ][ 1 ].apply( instance.element, args );
305
-			}
306
-		}
307
-	}
308
-};
23
+var version = $.ui.version = "1.13.2";
309 24
 
310 25
 
311 26
 /*!
312
- * jQuery UI Widget 1.11.4
27
+ * jQuery UI Widget 1.13.2
313 28
  * http://jqueryui.com
314 29
  *
315 30
  * Copyright jQuery Foundation and other contributors
316 31
  * Released under the MIT license.
317 32
  * http://jquery.org/license
318
- *
319
- * http://api.jqueryui.com/jQuery.widget/
320 33
  */
321 34
 
35
+//>>label: Widget
36
+//>>group: Core
37
+//>>description: Provides a factory for creating stateful widgets with a common API.
38
+//>>docs: http://api.jqueryui.com/jQuery.widget/
39
+//>>demos: http://jqueryui.com/widget/
40
+
322 41
 
323
-var widget_uuid = 0,
324
-	widget_slice = Array.prototype.slice;
42
+var widgetUuid = 0;
43
+var widgetHasOwnProperty = Array.prototype.hasOwnProperty;
44
+var widgetSlice = Array.prototype.slice;
325 45
 
326 46
 $.cleanData = ( function( orig ) {
327 47
 	return function( elems ) {
328 48
 		var events, elem, i;
329 49
 		for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
330
-			try {
331 50
 
332 51
 			// Only trigger remove when necessary to save time
333 52
 			events = $._data( elem, "events" );
334 53
 			if ( events && events.remove ) {
335 54
 				$( elem ).triggerHandler( "remove" );
336 55
 			}
337
-
338
-			// http://bugs.jquery.com/ticket/8235
339
-			} catch ( e ) {}
340 56
 		}
341 57
 		orig( elems );
342 58
 	};
343 59
 } )( $.cleanData );
344 60
 
345 61
 $.widget = function( name, base, prototype ) {
346
-	var fullName, existingConstructor, constructor, basePrototype,
347
-		// proxiedPrototype allows the provided prototype to remain unmodified
62
+	var existingConstructor, constructor, basePrototype;
63
+
64
+	// ProxiedPrototype allows the provided prototype to remain unmodified
348 65
 	// so that it can be used as a mixin for multiple widgets (#8876)
349
-		proxiedPrototype = {},
350
-		namespace = name.split( "." )[ 0 ];
66
+	var proxiedPrototype = {};
351 67
 
68
+	var namespace = name.split( "." )[ 0 ];
352 69
 	name = name.split( "." )[ 1 ];
353
-	fullName = namespace + "-" + name;
70
+	var fullName = namespace + "-" + name;
354 71
 
355 72
 	if ( !prototype ) {
356 73
 		prototype = base;
357 74
 		base = $.Widget;
358 75
 	}
359 76
 
360
-	// create selector for plugin
361
-	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
77
+	if ( Array.isArray( prototype ) ) {
78
+		prototype = $.extend.apply( null, [ {} ].concat( prototype ) );
79
+	}
80
+
81
+	// Create selector for plugin
82
+	$.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {
362 83
 		return !!$.data( elem, fullName );
363 84
 	};
364 85
 
365 86
 	$[ namespace ] = $[ namespace ] || {};
366 87
 	existingConstructor = $[ namespace ][ name ];
367 88
 	constructor = $[ namespace ][ name ] = function( options, element ) {
368
-		// allow instantiation without "new" keyword
369
-		if ( !this._createWidget ) {
89
+
90
+		// Allow instantiation without "new" keyword
91
+		if ( !this || !this._createWidget ) {
370 92
 			return new constructor( options, element );
371 93
 		}
372 94
 
373
-		// allow instantiation without initializing for simple inheritance
95
+		// Allow instantiation without initializing for simple inheritance
374 96
 		// must use "new" keyword (the code above always passes args)
375 97
 		if ( arguments.length ) {
376 98
 			this._createWidget( options, element );
377 99
 		}
378 100
 	};
379
-	// extend with the existing constructor to carry over any static properties
101
+
102
+	// Extend with the existing constructor to carry over any static properties
380 103
 	$.extend( constructor, existingConstructor, {
381 104
 		version: prototype.version,
382
-		// copy the object used to create the prototype in case we need to
105
+
106
+		// Copy the object used to create the prototype in case we need to
383 107
 		// redefine the widget later
384 108
 		_proto: $.extend( {}, prototype ),
385
-		// track widgets that inherit from this widget in case this widget is
109
+
110
+		// Track widgets that inherit from this widget in case this widget is
386 111
 		// redefined after a widget inherits from it
387 112
 		_childConstructors: []
388 113
 	} );
389 114
 
390 115
 	basePrototype = new base();
391
-	// we need to make the options hash a property directly on the new instance
116
+
117
+	// We need to make the options hash a property directly on the new instance
392 118
 	// otherwise we'll modify the options hash on the prototype that we're
393 119
 	// inheriting from
394 120
 	basePrototype.options = $.widget.extend( {}, basePrototype.options );
395 121
 	$.each( prototype, function( prop, value ) {
396
-		if ( !$.isFunction( value ) ) {
122
+		if ( typeof value !== "function" ) {
397 123
 			proxiedPrototype[ prop ] = value;
398 124
 			return;
399 125
 		}
400 126
 		proxiedPrototype[ prop ] = ( function() {
401
-			var _super = function() {
127
+			function _super() {
402 128
 				return base.prototype[ prop ].apply( this, arguments );
403
-				},
404
-				_superApply = function( args ) {
129
+			}
130
+
131
+			function _superApply( args ) {
405 132
 				return base.prototype[ prop ].apply( this, args );
406
-				};
133
+			}
134
+
407 135
 			return function() {
408
-				var __super = this._super,
409
-					__superApply = this._superApply,
410
-					returnValue;
136
+				var __super = this._super;
137
+				var __superApply = this._superApply;
138
+				var returnValue;
411 139
 
412 140
 				this._super = _super;
413 141
 				this._superApply = _superApply;
... ...
@@ -441,11 +170,13 @@ $.widget = function( name, base, prototype ) {
441 170
 		$.each( existingConstructor._childConstructors, function( i, child ) {
442 171
 			var childPrototype = child.prototype;
443 172
 
444
-			// redefine the child widget using the same prototype that was
173
+			// Redefine the child widget using the same prototype that was
445 174
 			// originally used, but inherit from the new version of the base
446
-			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
175
+			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,
176
+				child._proto );
447 177
 		} );
448
-		// remove the list of existing child constructors from the old constructor
178
+
179
+		// Remove the list of existing child constructors from the old constructor
449 180
 		// so the old child constructors can be garbage collected
450 181
 		delete existingConstructor._childConstructors;
451 182
 	} else {
... ...
@@ -458,15 +189,17 @@ $.widget = function( name, base, prototype ) {
458 189
 };
459 190
 
460 191
 $.widget.extend = function( target ) {
461
-	var input = widget_slice.call( arguments, 1 ),
462
-		inputIndex = 0,
463
-		inputLength = input.length,
464
-		key,
465
-		value;
192
+	var input = widgetSlice.call( arguments, 1 );
193
+	var inputIndex = 0;
194
+	var inputLength = input.length;
195
+	var key;
196
+	var value;
197
+
466 198
 	for ( ; inputIndex < inputLength; inputIndex++ ) {
467 199
 		for ( key in input[ inputIndex ] ) {
468 200
 			value = input[ inputIndex ][ key ];
469
-			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
201
+			if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {
202
+
470 203
 				// Clone objects
471 204
 				if ( $.isPlainObject( value ) ) {
472 205
 					target[ key ] = $.isPlainObject( target[ key ] ) ?
... ...
@@ -486,26 +221,40 @@ $.widget.extend = function( target ) {
486 221
 $.widget.bridge = function( name, object ) {
487 222
 	var fullName = object.prototype.widgetFullName || name;
488 223
 	$.fn[ name ] = function( options ) {
489
-		var isMethodCall = typeof options === "string",
490
-			args = widget_slice.call( arguments, 1 ),
491
-			returnValue = this;
224
+		var isMethodCall = typeof options === "string";
225
+		var args = widgetSlice.call( arguments, 1 );
226
+		var returnValue = this;
492 227
 
493 228
 		if ( isMethodCall ) {
229
+
230
+			// If this is an empty collection, we need to have the instance method
231
+			// return undefined instead of the jQuery instance
232
+			if ( !this.length && options === "instance" ) {
233
+				returnValue = undefined;
234
+			} else {
494 235
 				this.each( function() {
495
-				var methodValue,
496
-					instance = $.data( this, fullName );
236
+					var methodValue;
237
+					var instance = $.data( this, fullName );
238
+
497 239
 					if ( options === "instance" ) {
498 240
 						returnValue = instance;
499 241
 						return false;
500 242
 					}
243
+
501 244
 					if ( !instance ) {
502
-					return $.error( "cannot call methods on " + name + " prior to initialization; " +
245
+						return $.error( "cannot call methods on " + name +
246
+							" prior to initialization; " +
503 247
 							"attempted to call method '" + options + "'" );
504 248
 					}
505
-				if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
506
-					return $.error( "no such method '" + options + "' for " + name + " widget instance" );
249
+
250
+					if ( typeof instance[ options ] !== "function" ||
251
+						options.charAt( 0 ) === "_" ) {
252
+						return $.error( "no such method '" + options + "' for " + name +
253
+							" widget instance" );
507 254
 					}
255
+
508 256
 					methodValue = instance[ options ].apply( instance, args );
257
+
509 258
 					if ( methodValue !== instance && methodValue !== undefined ) {
510 259
 						returnValue = methodValue && methodValue.jquery ?
511 260
 							returnValue.pushStack( methodValue.get() ) :
... ...
@@ -513,6 +262,7 @@ $.widget.bridge = function( name, object ) {
513 262
 						return false;
514 263
 					}
515 264
 				} );
265
+			}
516 266
 		} else {
517 267
 
518 268
 			// Allow multiple hashes to be passed on init
... ...
@@ -544,21 +294,25 @@ $.Widget.prototype = {
544 294
 	widgetName: "widget",
545 295
 	widgetEventPrefix: "",
546 296
 	defaultElement: "<div>",
297
+
547 298
 	options: {
299
+		classes: {},
548 300
 		disabled: false,
549 301
 
550
-		// callbacks
302
+		// Callbacks
551 303
 		create: null
552 304
 	},
305
+
553 306
 	_createWidget: function( options, element ) {
554 307
 		element = $( element || this.defaultElement || this )[ 0 ];
555 308
 		this.element = $( element );
556
-		this.uuid = widget_uuid++;
309
+		this.uuid = widgetUuid++;
557 310
 		this.eventNamespace = "." + this.widgetName + this.uuid;
558 311
 
559 312
 		this.bindings = $();
560 313
 		this.hoverable = $();
561 314
 		this.focusable = $();
315
+		this.classesElementLookup = {};
562 316
 
563 317
 		if ( element !== this ) {
564 318
 			$.data( element, this.widgetFullName, this );
... ...
@@ -570,9 +324,11 @@ $.Widget.prototype = {
570 324
 				}
571 325
 			} );
572 326
 			this.document = $( element.style ?
573
-				// element within the document
327
+
328
+				// Element within the document
574 329
 				element.ownerDocument :
575
-				// element is window or document
330
+
331
+				// Element is window or document
576 332
 				element.document || element );
577 333
 			this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );
578 334
 		}
... ...
@@ -583,36 +339,46 @@ $.Widget.prototype = {
583 339
 			options );
584 340
 
585 341
 		this._create();
342
+
343
+		if ( this.options.disabled ) {
344
+			this._setOptionDisabled( this.options.disabled );
345
+		}
346
+
586 347
 		this._trigger( "create", null, this._getCreateEventData() );
587 348
 		this._init();
588 349
 	},
589
-	_getCreateOptions: $.noop,
350
+
351
+	_getCreateOptions: function() {
352
+		return {};
353
+	},
354
+
590 355
 	_getCreateEventData: $.noop,
356
+
591 357
 	_create: $.noop,
358
+
592 359
 	_init: $.noop,
593 360
 
594 361
 	destroy: function() {
362
+		var that = this;
363
+
595 364
 		this._destroy();
596
-		// we can probably remove the unbind calls in 2.0
365
+		$.each( this.classesElementLookup, function( key, value ) {
366
+			that._removeClass( value, key );
367
+		} );
368
+
369
+		// We can probably remove the unbind calls in 2.0
597 370
 		// all event bindings should go through this._on()
598 371
 		this.element
599
-			.unbind( this.eventNamespace )
600
-			.removeData( this.widgetFullName )
601
-			// support: jquery <1.6.3
602
-			// http://bugs.jquery.com/ticket/9413
603
-			.removeData( $.camelCase( this.widgetFullName ) );
372
+			.off( this.eventNamespace )
373
+			.removeData( this.widgetFullName );
604 374
 		this.widget()
605
-			.unbind( this.eventNamespace )
606
-			.removeAttr( "aria-disabled" )
607
-			.removeClass(
608
-				this.widgetFullName + "-disabled " +
609
-				"ui-state-disabled" );
375
+			.off( this.eventNamespace )
376
+			.removeAttr( "aria-disabled" );
610 377
 
611
-		// clean up events and states
612
-		this.bindings.unbind( this.eventNamespace );
613
-		this.hoverable.removeClass( "ui-state-hover" );
614
-		this.focusable.removeClass( "ui-state-focus" );
378
+		// Clean up events and states
379
+		this.bindings.off( this.eventNamespace );
615 380
 	},
381
+
616 382
 	_destroy: $.noop,
617 383
 
618 384
 	widget: function() {
... ...
@@ -620,18 +386,20 @@ $.Widget.prototype = {
620 386
 	},
621 387
 
622 388
 	option: function( key, value ) {
623
-		var options = key,
624
-			parts,
625
-			curOption,
626
-			i;
389
+		var options = key;
390
+		var parts;
391
+		var curOption;
392
+		var i;
627 393
 
628 394
 		if ( arguments.length === 0 ) {
629
-			// don't return a reference to the internal hash
395
+
396
+			// Don't return a reference to the internal hash
630 397
 			return $.widget.extend( {}, this.options );
631 398
 		}
632 399
 
633 400
 		if ( typeof key === "string" ) {
634
-			// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
401
+
402
+			// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
635 403
 			options = {};
636 404
 			parts = key.split( "." );
637 405
 			key = parts.shift();
... ...
@@ -667,21 +436,60 @@ $.Widget.prototype = {
667 436
 
668 437
 		return this;
669 438
 	},
439
+
670 440
 	_setOption: function( key, value ) {
441
+		if ( key === "classes" ) {
442
+			this._setOptionClasses( value );
443
+		}
444
+
671 445
 		this.options[ key ] = value;
672 446
 
673 447
 		if ( key === "disabled" ) {
674
-			this.widget()
675
-				.toggleClass( this.widgetFullName + "-disabled", !!value );
448
+			this._setOptionDisabled( value );
449
+		}
676 450
 
677
-			// If the widget is becoming disabled, then nothing is interactive
678
-			if ( value ) {
679
-				this.hoverable.removeClass( "ui-state-hover" );
680
-				this.focusable.removeClass( "ui-state-focus" );
451
+		return this;
452
+	},
453
+
454
+	_setOptionClasses: function( value ) {
455
+		var classKey, elements, currentElements;
456
+
457
+		for ( classKey in value ) {
458
+			currentElements = this.classesElementLookup[ classKey ];
459
+			if ( value[ classKey ] === this.options.classes[ classKey ] ||
460
+					!currentElements ||
461
+					!currentElements.length ) {
462
+				continue;
681 463
 			}
464
+
465
+			// We are doing this to create a new jQuery object because the _removeClass() call
466
+			// on the next line is going to destroy the reference to the current elements being
467
+			// tracked. We need to save a copy of this collection so that we can add the new classes
468
+			// below.
469
+			elements = $( currentElements.get() );
470
+			this._removeClass( currentElements, classKey );
471
+
472
+			// We don't use _addClass() here, because that uses this.options.classes
473
+			// for generating the string of classes. We want to use the value passed in from
474
+			// _setOption(), this is the new value of the classes option which was passed to
475
+			// _setOption(). We pass this value directly to _classes().
476
+			elements.addClass( this._classes( {
477
+				element: elements,
478
+				keys: classKey,
479
+				classes: value,
480
+				add: true
481
+			} ) );
682 482
 		}
483
+	},
683 484
 
684
-		return this;
485
+	_setOptionDisabled: function( value ) {
486
+		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );
487
+
488
+		// If the widget is becoming disabled, then nothing is interactive
489
+		if ( value ) {
490
+			this._removeClass( this.hoverable, null, "ui-state-hover" );
491
+			this._removeClass( this.focusable, null, "ui-state-focus" );
492
+		}
685 493
 	},
686 494
 
687 495
 	enable: function() {
... ...
@@ -691,18 +500,108 @@ $.Widget.prototype = {
691 500
 		return this._setOptions( { disabled: true } );
692 501
 	},
693 502
 
503
+	_classes: function( options ) {
504
+		var full = [];
505
+		var that = this;
506
+
507
+		options = $.extend( {
508
+			element: this.element,
509
+			classes: this.options.classes || {}
510
+		}, options );
511
+
512
+		function bindRemoveEvent() {
513
+			var nodesToBind = [];
514
+
515
+			options.element.each( function( _, element ) {
516
+				var isTracked = $.map( that.classesElementLookup, function( elements ) {
517
+					return elements;
518
+				} )
519
+					.some( function( elements ) {
520
+						return elements.is( element );
521
+					} );
522
+
523
+				if ( !isTracked ) {
524
+					nodesToBind.push( element );
525
+				}
526
+			} );
527
+
528
+			that._on( $( nodesToBind ), {
529
+				remove: "_untrackClassesElement"
530
+			} );
531
+		}
532
+
533
+		function processClassString( classes, checkOption ) {
534
+			var current, i;
535
+			for ( i = 0; i < classes.length; i++ ) {
536
+				current = that.classesElementLookup[ classes[ i ] ] || $();
537
+				if ( options.add ) {
538
+					bindRemoveEvent();
539
+					current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );
540
+				} else {
541
+					current = $( current.not( options.element ).get() );
542
+				}
543
+				that.classesElementLookup[ classes[ i ] ] = current;
544
+				full.push( classes[ i ] );
545
+				if ( checkOption && options.classes[ classes[ i ] ] ) {
546
+					full.push( options.classes[ classes[ i ] ] );
547
+				}
548
+			}
549
+		}
550
+
551
+		if ( options.keys ) {
552
+			processClassString( options.keys.match( /\S+/g ) || [], true );
553
+		}
554
+		if ( options.extra ) {
555
+			processClassString( options.extra.match( /\S+/g ) || [] );
556
+		}
557
+
558
+		return full.join( " " );
559
+	},
560
+
561
+	_untrackClassesElement: function( event ) {
562
+		var that = this;
563
+		$.each( that.classesElementLookup, function( key, value ) {
564
+			if ( $.inArray( event.target, value ) !== -1 ) {
565
+				that.classesElementLookup[ key ] = $( value.not( event.target ).get() );
566
+			}
567
+		} );
568
+
569
+		this._off( $( event.target ) );
570
+	},
571
+
572
+	_removeClass: function( element, keys, extra ) {
573
+		return this._toggleClass( element, keys, extra, false );
574
+	},
575
+
576
+	_addClass: function( element, keys, extra ) {
577
+		return this._toggleClass( element, keys, extra, true );
578
+	},
579
+
580
+	_toggleClass: function( element, keys, extra, add ) {
581
+		add = ( typeof add === "boolean" ) ? add : extra;
582
+		var shift = ( typeof element === "string" || element === null ),
583
+			options = {
584
+				extra: shift ? keys : extra,
585
+				keys: shift ? element : keys,
586
+				element: shift ? this.element : element,
587
+				add: add
588
+			};
589
+		options.element.toggleClass( this._classes( options ), add );
590
+		return this;
591
+	},
592
+
694 593
 	_on: function( suppressDisabledCheck, element, handlers ) {
695
-		var delegateElement,
696
-			instance = this;
594
+		var delegateElement;
595
+		var instance = this;
697 596
 
698
-		// no suppressDisabledCheck flag, shuffle arguments
597
+		// No suppressDisabledCheck flag, shuffle arguments
699 598
 		if ( typeof suppressDisabledCheck !== "boolean" ) {
700 599
 			handlers = element;
701 600
 			element = suppressDisabledCheck;
702 601
 			suppressDisabledCheck = false;
703 602
 		}
704 603
 
705
-		// no element argument, shuffle and use this.element
604
+		// No element argument, shuffle and use this.element
706 605
 		if ( !handlers ) {
707 606
 			handlers = element;
708 607
 			element = this.element;
... ...
@@ -714,7 +613,8 @@ $.Widget.prototype = {
714 613
 
715 614
 		$.each( handlers, function( event, handler ) {
716 615
 			function handlerProxy() {
717
-				// allow widgets to customize the disabled handling
616
+
617
+				// Allow widgets to customize the disabled handling
718 618
 				// - disabled as an array instead of boolean
719 619
 				// - disabled class as method for disabling individual parts
720 620
 				if ( !suppressDisabledCheck &&
... ...
@@ -726,19 +626,20 @@ $.Widget.prototype = {
726 626
 					.apply( instance, arguments );
727 627
 			}
728 628
 
729
-			// copy the guid so direct unbinding works
629
+			// Copy the guid so direct unbinding works
730 630
 			if ( typeof handler !== "string" ) {
731 631
 				handlerProxy.guid = handler.guid =
732 632
 					handler.guid || handlerProxy.guid || $.guid++;
733 633
 			}
734 634
 
735
-			var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
736
-				eventName = match[1] + instance.eventNamespace,
737
-				selector = match[2];
635
+			var match = event.match( /^([\w:-]*)\s*(.*)$/ );
636
+			var eventName = match[ 1 ] + instance.eventNamespace;
637
+			var selector = match[ 2 ];
638
+
738 639
 			if ( selector ) {
739
-				delegateElement.delegate( selector, eventName, handlerProxy );
640
+				delegateElement.on( eventName, selector, handlerProxy );
740 641
 			} else {
741
-				element.bind( eventName, handlerProxy );
642
+				element.on( eventName, handlerProxy );
742 643
 			}
743 644
 		} );
744 645
 	},
... ...
@@ -746,7 +647,7 @@ $.Widget.prototype = {
746 647
 	_off: function( element, eventName ) {
747 648
 		eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +
748 649
 			this.eventNamespace;
749
-		element.unbind( eventName ).undelegate( eventName );
650
+		element.off( eventName );
750 651
 
751 652
 		// Clear the stack to avoid memory leaks (#10056)
752 653
 		this.bindings = $( this.bindings.not( element ).get() );
... ...
@@ -767,10 +668,10 @@ $.Widget.prototype = {
767 668
 		this.hoverable = this.hoverable.add( element );
768 669
 		this._on( element, {
769 670
 			mouseenter: function( event ) {
770
-				$( event.currentTarget ).addClass( "ui-state-hover" );
671
+				this._addClass( $( event.currentTarget ), null, "ui-state-hover" );
771 672
 			},
772 673
 			mouseleave: function( event ) {
773
-				$( event.currentTarget ).removeClass( "ui-state-hover" );
674
+				this._removeClass( $( event.currentTarget ), null, "ui-state-hover" );
774 675
 			}
775 676
 		} );
776 677
 	},
... ...
@@ -779,28 +680,29 @@ $.Widget.prototype = {
779 680
 		this.focusable = this.focusable.add( element );
780 681
 		this._on( element, {
781 682
 			focusin: function( event ) {
782
-				$( event.currentTarget ).addClass( "ui-state-focus" );
683
+				this._addClass( $( event.currentTarget ), null, "ui-state-focus" );
783 684
 			},
784 685
 			focusout: function( event ) {
785
-				$( event.currentTarget ).removeClass( "ui-state-focus" );
686
+				this._removeClass( $( event.currentTarget ), null, "ui-state-focus" );
786 687
 			}
787 688
 		} );
788 689
 	},
789 690
 
790 691
 	_trigger: function( type, event, data ) {
791
-		var prop, orig,
792
-			callback = this.options[ type ];
692
+		var prop, orig;
693
+		var callback = this.options[ type ];
793 694
 
794 695
 		data = data || {};
795 696
 		event = $.Event( event );
796 697
 		event.type = ( type === this.widgetEventPrefix ?
797 698
 			type :
798 699
 			this.widgetEventPrefix + type ).toLowerCase();
799
-		// the original event may come from any element
700
+
701
+		// The original event may come from any element
800 702
 		// so we need to reset the target on the new event
801 703
 		event.target = this.element[ 0 ];
802 704
 
803
-		// copy original event properties over to the new event
705
+		// Copy original event properties over to the new event
804 706
 		orig = event.originalEvent;
805 707
 		if ( orig ) {
806 708
 			for ( prop in orig ) {
... ...
@@ -811,7 +713,7 @@ $.Widget.prototype = {
811 713
 		}
812 714
 
813 715
 		this.element.trigger( event, data );
814
-		return !( $.isFunction( callback ) &&
716
+		return !( typeof callback === "function" &&
815 717
 			callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||
816 718
 			event.isDefaultPrevented() );
817 719
 	}
... ...
@@ -822,8 +724,9 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
822 724
 		if ( typeof options === "string" ) {
823 725
 			options = { effect: options };
824 726
 		}
825
-		var hasOptions,
826
-			effectName = !options ?
727
+
728
+		var hasOptions;
729
+		var effectName = !options ?
827 730
 			method :
828 731
 			options === true || typeof options === "number" ?
829 732
 				defaultEffect :
... ...
@@ -831,9 +735,13 @@ $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
831 735
 		options = options || {};
832 736
 		if ( typeof options === "number" ) {
833 737
 			options = { duration: options };
738
+		} else if ( options === true ) {
739
+			options = {};
834 740
 		}
741
+
835 742
 		hasOptions = !$.isEmptyObject( options );
836 743
 		options.complete = callback;
744
+
837 745
 		if ( options.delay ) {
838 746
 			element.delay( options.delay );
839 747
 		}
... ...
@@ -857,193 +766,7 @@ var widget = $.widget;
857 766
 
858 767
 
859 768
 /*!
860
- * jQuery UI Mouse 1.11.4
861
- * http://jqueryui.com
862
- *
863
- * Copyright jQuery Foundation and other contributors
864
- * Released under the MIT license.
865
- * http://jquery.org/license
866
- *
867
- * http://api.jqueryui.com/mouse/
868
- */
869
-
870
-
871
-var mouseHandled = false;
872
-$( document ).mouseup( function() {
873
-	mouseHandled = false;
874
-});
875
-
876
-var mouse = $.widget("ui.mouse", {
877
-	version: "1.11.4",
878
-	options: {
879
-		cancel: "input,textarea,button,select,option",
880
-		distance: 1,
881
-		delay: 0
882
-	},
883
-	_mouseInit: function() {
884
-		var that = this;
885
-
886
-		this.element
887
-			.bind("mousedown." + this.widgetName, function(event) {
888
-				return that._mouseDown(event);
889
-			})
890
-			.bind("click." + this.widgetName, function(event) {
891
-				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
892
-					$.removeData(event.target, that.widgetName + ".preventClickEvent");
893
-					event.stopImmediatePropagation();
894
-					return false;
895
-				}
896
-			});
897
-
898
-		this.started = false;
899
-	},
900
-
901
-	// TODO: make sure destroying one instance of mouse doesn't mess with
902
-	// other instances of mouse
903
-	_mouseDestroy: function() {
904
-		this.element.unbind("." + this.widgetName);
905
-		if ( this._mouseMoveDelegate ) {
906
-			this.document
907
-				.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate)
908
-				.unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
909
-		}
910
-	},
911
-
912
-	_mouseDown: function(event) {
913
-		// don't let more than one widget handle mouseStart
914
-		if ( mouseHandled ) {
915
-			return;
916
-		}
917
-
918
-		this._mouseMoved = false;
919
-
920
-		// we may have missed mouseup (out of window)
921
-		(this._mouseStarted && this._mouseUp(event));
922
-
923
-		this._mouseDownEvent = event;
924
-
925
-		var that = this,
926
-			btnIsLeft = (event.which === 1),
927
-			// event.target.nodeName works around a bug in IE 8 with
928
-			// disabled inputs (#7620)
929
-			elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
930
-		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
931
-			return true;
932
-		}
933
-
934
-		this.mouseDelayMet = !this.options.delay;
935
-		if (!this.mouseDelayMet) {
936
-			this._mouseDelayTimer = setTimeout(function() {
937
-				that.mouseDelayMet = true;
938
-			}, this.options.delay);
939
-		}
940
-
941
-		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
942
-			this._mouseStarted = (this._mouseStart(event) !== false);
943
-			if (!this._mouseStarted) {
944
-				event.preventDefault();
945
-				return true;
946
-			}
947
-		}
948
-
949
-		// Click event may never have fired (Gecko & Opera)
950
-		if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
951
-			$.removeData(event.target, this.widgetName + ".preventClickEvent");
952
-		}
953
-
954
-		// these delegates are required to keep context
955
-		this._mouseMoveDelegate = function(event) {
956
-			return that._mouseMove(event);
957
-		};
958
-		this._mouseUpDelegate = function(event) {
959
-			return that._mouseUp(event);
960
-		};
961
-
962
-		this.document
963
-			.bind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
964
-			.bind( "mouseup." + this.widgetName, this._mouseUpDelegate );
965
-
966
-		event.preventDefault();
967
-
968
-		mouseHandled = true;
969
-		return true;
970
-	},
971
-
972
-	_mouseMove: function(event) {
973
-		// Only check for mouseups outside the document if you've moved inside the document
974
-		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
975
-		// fire a mousemove event if content is placed under the cursor. See #7778
976
-		// Support: IE <9
977
-		if ( this._mouseMoved ) {
978
-			// IE mouseup check - mouseup happened when mouse was out of window
979
-			if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
980
-				return this._mouseUp(event);
981
-
982
-			// Iframe mouseup check - mouseup occurred in another document
983
-			} else if ( !event.which ) {
984
-				return this._mouseUp( event );
985
-			}
986
-		}
987
-
988
-		if ( event.which || event.button ) {
989
-			this._mouseMoved = true;
990
-		}
991
-
992
-		if (this._mouseStarted) {
993
-			this._mouseDrag(event);
994
-			return event.preventDefault();
995
-		}
996
-
997
-		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
998
-			this._mouseStarted =
999
-				(this._mouseStart(this._mouseDownEvent, event) !== false);
1000
-			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
1001
-		}
1002
-
1003
-		return !this._mouseStarted;
1004
-	},
1005
-
1006
-	_mouseUp: function(event) {
1007
-		this.document
1008
-			.unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate )
1009
-			.unbind( "mouseup." + this.widgetName, this._mouseUpDelegate );
1010
-
1011
-		if (this._mouseStarted) {
1012
-			this._mouseStarted = false;
1013
-
1014
-			if (event.target === this._mouseDownEvent.target) {
1015
-				$.data(event.target, this.widgetName + ".preventClickEvent", true);
1016
-			}
1017
-
1018
-			this._mouseStop(event);
1019
-		}
1020
-
1021
-		mouseHandled = false;
1022
-		return false;
1023
-	},
1024
-
1025
-	_mouseDistanceMet: function(event) {
1026
-		return (Math.max(
1027
-				Math.abs(this._mouseDownEvent.pageX - event.pageX),
1028
-				Math.abs(this._mouseDownEvent.pageY - event.pageY)
1029
-			) >= this.options.distance
1030
-		);
1031
-	},
1032
-
1033
-	_mouseDelayMet: function(/* event */) {
1034
-		return this.mouseDelayMet;
1035
-	},
1036
-
1037
-	// These are placeholder methods, to be overriden by extending plugin
1038
-	_mouseStart: function(/* event */) {},
1039
-	_mouseDrag: function(/* event */) {},
1040
-	_mouseStop: function(/* event */) {},
1041
-	_mouseCapture: function(/* event */) { return true; }
1042
-});
1043
-
1044
-
1045
-/*!
1046
- * jQuery UI Position 1.11.4
769
+ * jQuery UI Position 1.13.2
1047 770
  * http://jqueryui.com
1048 771
  *
1049 772
  * Copyright jQuery Foundation and other contributors
... ...
@@ -1053,14 +776,17 @@ var mouse = $.widget("ui.mouse", {
1053 776
  * http://api.jqueryui.com/position/
1054 777
  */
1055 778
 
1056
-(function() {
779
+//>>label: Position
780
+//>>group: Core
781
+//>>description: Positions elements relative to other elements.
782
+//>>docs: http://api.jqueryui.com/position/
783
+//>>demos: http://jqueryui.com/position/
1057 784
 
1058
-$.ui = $.ui || {};
1059 785
 
1060
-var cachedScrollbarWidth, supportsOffsetFractions,
786
+( function() {
787
+var cachedScrollbarWidth,
1061 788
 	max = Math.max,
1062 789
 	abs = Math.abs,
1063
-	round = Math.round,
1064 790
 	rhorizontal = /left|center|right/,
1065 791
 	rvertical = /top|center|bottom/,
1066 792
 	roffset = /[\+\-]\d+(\.[\d]+)?%?/,
... ...
@@ -1079,6 +805,10 @@ function parseCss( element, property ) {
1079 805
 	return parseInt( $.css( element, property ), 10 ) || 0;
1080 806
 }
1081 807
 
808
+function isWindow( obj ) {
809
+	return obj != null && obj === obj.window;
810
+}
811
+
1082 812
 function getDimensions( elem ) {
1083 813
 	var raw = elem[ 0 ];
1084 814
 	if ( raw.nodeType === 9 ) {
... ...
@@ -1088,7 +818,7 @@ function getDimensions( elem ) {
1088 818
 			offset: { top: 0, left: 0 }
1089 819
 		};
1090 820
 	}
1091
-	if ( $.isWindow( raw ) ) {
821
+	if ( isWindow( raw ) ) {
1092 822
 		return {
1093 823
 			width: elem.width(),
1094 824
 			height: elem.height(),
... ...
@@ -1115,7 +845,9 @@ $.position = {
1115 845
 			return cachedScrollbarWidth;
1116 846
 		}
1117 847
 		var w1, w2,
1118
-			div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ),
848
+			div = $( "<div style=" +
849
+				"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" +
850
+				"<div style='height:300px;width:auto;'></div></div>" ),
1119 851
 			innerDiv = div.children()[ 0 ];
1120 852
 
1121 853
 		$( "body" ).append( div );
... ...
@@ -1148,20 +880,18 @@ $.position = {
1148 880
 	},
1149 881
 	getWithinInfo: function( element ) {
1150 882
 		var withinElement = $( element || window ),
1151
-			isWindow = $.isWindow( withinElement[0] ),
1152
-			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9;
883
+			isElemWindow = isWindow( withinElement[ 0 ] ),
884
+			isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9,
885
+			hasOffset = !isElemWindow && !isDocument;
1153 886
 		return {
1154 887
 			element: withinElement,
1155
-			isWindow: isWindow,
888
+			isWindow: isElemWindow,
1156 889
 			isDocument: isDocument,
1157
-			offset: withinElement.offset() || { left: 0, top: 0 },
890
+			offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 },
1158 891
 			scrollLeft: withinElement.scrollLeft(),
1159 892
 			scrollTop: withinElement.scrollTop(),
1160
-
1161
-			// support: jQuery 1.6.x
1162
-			// jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows
1163
-			width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(),
1164
-			height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight()
893
+			width: withinElement.outerWidth(),
894
+			height: withinElement.outerHeight()
1165 895
 		};
1166 896
 	}
1167 897
 };
... ...
@@ -1171,11 +901,16 @@ $.fn.position = function( options ) {
1171 901
 		return _position.apply( this, arguments );
1172 902
 	}
1173 903
 
1174
-	// make a copy, we don't want to modify arguments
904
+	// Make a copy, we don't want to modify arguments
1175 905
 	options = $.extend( {}, options );
1176 906
 
1177 907
 	var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
1178
-		target = $( options.of ),
908
+
909
+		// Make sure string options are treated as CSS selectors
910
+		target = typeof options.of === "string" ?
911
+			$( document ).find( options.of ) :
912
+			$( options.of ),
913
+
1179 914
 		within = $.position.getWithinInfo( options.within ),
1180 915
 		scrollInfo = $.position.getScrollInfo( within ),
1181 916
 		collision = ( options.collision || "flip" ).split( " " ),
... ...
@@ -1183,16 +918,18 @@ $.fn.position = function( options ) {
1183 918
 
1184 919
 	dimensions = getDimensions( target );
1185 920
 	if ( target[ 0 ].preventDefault ) {
1186
-		// force left top to allow flipping
921
+
922
+		// Force left top to allow flipping
1187 923
 		options.at = "left top";
1188 924
 	}
1189 925
 	targetWidth = dimensions.width;
1190 926
 	targetHeight = dimensions.height;
1191 927
 	targetOffset = dimensions.offset;
1192
-	// clone to reuse original targetOffset later
928
+
929
+	// Clone to reuse original targetOffset later
1193 930
 	basePosition = $.extend( {}, targetOffset );
1194 931
 
1195
-	// force my and at to have valid horizontal and vertical positions
932
+	// Force my and at to have valid horizontal and vertical positions
1196 933
 	// if a value is missing or invalid, it will be converted to center
1197 934
 	$.each( [ "my", "at" ], function() {
1198 935
 		var pos = ( options[ this ] || "" ).split( " " ),
... ...
@@ -1209,7 +946,7 @@ $.fn.position = function( options ) {
1209 946
 		pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
1210 947
 		pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
1211 948
 
1212
-		// calculate offsets
949
+		// Calculate offsets
1213 950
 		horizontalOffset = roffset.exec( pos[ 0 ] );
1214 951
 		verticalOffset = roffset.exec( pos[ 1 ] );
1215 952
 		offsets[ this ] = [
... ...
@@ -1217,14 +954,14 @@ $.fn.position = function( options ) {
1217 954
 			verticalOffset ? verticalOffset[ 0 ] : 0
1218 955
 		];
1219 956
 
1220
-		// reduce to just the positions without the offsets
957
+		// Reduce to just the positions without the offsets
1221 958
 		options[ this ] = [
1222 959
 			rposition.exec( pos[ 0 ] )[ 0 ],
1223 960
 			rposition.exec( pos[ 1 ] )[ 0 ]
1224 961
 		];
1225 962
 	} );
1226 963
 
1227
-	// normalize collision option
964
+	// Normalize collision option
1228 965
 	if ( collision.length === 1 ) {
1229 966
 		collision[ 1 ] = collision[ 0 ];
1230 967
 	}
... ...
@@ -1252,8 +989,10 @@ $.fn.position = function( options ) {
1252 989
 			elemHeight = elem.outerHeight(),
1253 990
 			marginLeft = parseCss( this, "marginLeft" ),
1254 991
 			marginTop = parseCss( this, "marginTop" ),
1255
-			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width,
1256
-			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height,
992
+			collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) +
993
+				scrollInfo.width,
994
+			collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) +
995
+				scrollInfo.height,
1257 996
 			position = $.extend( {}, basePosition ),
1258 997
 			myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() );
1259 998
 
... ...
@@ -1272,12 +1011,6 @@ $.fn.position = function( options ) {
1272 1011
 		position.left += myOffset[ 0 ];
1273 1012
 		position.top += myOffset[ 1 ];
1274 1013
 
1275
-		// if the browser doesn't support fractions, then round for consistent results
1276
-		if ( !supportsOffsetFractions ) {
1277
-			position.left = round( position.left );
1278
-			position.top = round( position.top );
1279
-		}
1280
-
1281 1014
 		collisionPosition = {
1282 1015
 			marginLeft: marginLeft,
1283 1016
 			marginTop: marginTop
... ...
@@ -1303,7 +1036,8 @@ $.fn.position = function( options ) {
1303 1036
 		} );
1304 1037
 
1305 1038
 		if ( options.using ) {
1306
-			// adds feedback as second argument to using callback, if present
1039
+
1040
+			// Adds feedback as second argument to using callback, if present
1307 1041
 			using = function( props ) {
1308 1042
 				var left = targetOffset.left - position.left,
1309 1043
 					right = left + targetWidth - elemWidth,
... ...
@@ -1357,16 +1091,20 @@ $.ui.position = {
1357 1091
 				overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
1358 1092
 				newOverRight;
1359 1093
 
1360
-			// element is wider than within
1094
+			// Element is wider than within
1361 1095
 			if ( data.collisionWidth > outerWidth ) {
1362
-				// element is initially over the left side of within
1096
+
1097
+				// Element is initially over the left side of within
1363 1098
 				if ( overLeft > 0 && overRight <= 0 ) {
1364
-					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
1099
+					newOverRight = position.left + overLeft + data.collisionWidth - outerWidth -
1100
+						withinOffset;
1365 1101
 					position.left += overLeft - newOverRight;
1366
-				// element is initially over right side of within
1102
+
1103
+				// Element is initially over right side of within
1367 1104
 				} else if ( overRight > 0 && overLeft <= 0 ) {
1368 1105
 					position.left = withinOffset;
1369
-				// element is initially over both left and right sides of within
1106
+
1107
+				// Element is initially over both left and right sides of within
1370 1108
 				} else {
1371 1109
 					if ( overLeft > overRight ) {
1372 1110
 						position.left = withinOffset + outerWidth - data.collisionWidth;
... ...
@@ -1374,13 +1112,16 @@ $.ui.position = {
1374 1112
 						position.left = withinOffset;
1375 1113
 					}
1376 1114
 				}
1377
-			// too far left -> align with left edge
1115
+
1116
+			// Too far left -> align with left edge
1378 1117
 			} else if ( overLeft > 0 ) {
1379 1118
 				position.left += overLeft;
1380
-			// too far right -> align with right edge
1119
+
1120
+			// Too far right -> align with right edge
1381 1121
 			} else if ( overRight > 0 ) {
1382 1122
 				position.left -= overRight;
1383
-			// adjust based on position and margin
1123
+
1124
+			// Adjust based on position and margin
1384 1125
 			} else {
1385 1126
 				position.left = max( position.left - collisionPosLeft, position.left );
1386 1127
 			}
... ...
@@ -1394,16 +1135,20 @@ $.ui.position = {
1394 1135
 				overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
1395 1136
 				newOverBottom;
1396 1137
 
1397
-			// element is taller than within
1138
+			// Element is taller than within
1398 1139
 			if ( data.collisionHeight > outerHeight ) {
1399
-				// element is initially over the top of within
1140
+
1141
+				// Element is initially over the top of within
1400 1142
 				if ( overTop > 0 && overBottom <= 0 ) {
1401
-					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
1143
+					newOverBottom = position.top + overTop + data.collisionHeight - outerHeight -
1144
+						withinOffset;
1402 1145
 					position.top += overTop - newOverBottom;
1403
-				// element is initially over bottom of within
1146
+
1147
+				// Element is initially over bottom of within
1404 1148
 				} else if ( overBottom > 0 && overTop <= 0 ) {
1405 1149
 					position.top = withinOffset;
1406
-				// element is initially over both top and bottom of within
1150
+
1151
+				// Element is initially over both top and bottom of within
1407 1152
 				} else {
1408 1153
 					if ( overTop > overBottom ) {
1409 1154
 						position.top = withinOffset + outerHeight - data.collisionHeight;
... ...
@@ -1411,13 +1156,16 @@ $.ui.position = {
1411 1156
 						position.top = withinOffset;
1412 1157
 					}
1413 1158
 				}
1414
-			// too far up -> align with top
1159
+
1160
+			// Too far up -> align with top
1415 1161
 			} else if ( overTop > 0 ) {
1416 1162
 				position.top += overTop;
1417
-			// too far down -> align with bottom edge
1163
+
1164
+			// Too far down -> align with bottom edge
1418 1165
 			} else if ( overBottom > 0 ) {
1419 1166
 				position.top -= overBottom;
1420
-			// adjust based on position and margin
1167
+
1168
+			// Adjust based on position and margin
1421 1169
 			} else {
1422 1170
 				position.top = max( position.top - collisionPosTop, position.top );
1423 1171
 			}
... ...
@@ -1447,12 +1195,14 @@ $.ui.position = {
1447 1195
 				newOverLeft;
1448 1196
 
1449 1197
 			if ( overLeft < 0 ) {
1450
-				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
1198
+				newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth -
1199
+					outerWidth - withinOffset;
1451 1200
 				if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) {
1452 1201
 					position.left += myOffset + atOffset + offset;
1453 1202
 				}
1454 1203
 			} else if ( overRight > 0 ) {
1455
-				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
1204
+				newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset +
1205
+					atOffset + offset - offsetLeft;
1456 1206
 				if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) {
1457 1207
 					position.left += myOffset + atOffset + offset;
1458 1208
 				}
... ...
@@ -1481,12 +1231,14 @@ $.ui.position = {
1481 1231
 				newOverTop,
1482 1232
 				newOverBottom;
1483 1233
 			if ( overTop < 0 ) {
1484
-				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
1234
+				newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight -
1235
+					outerHeight - withinOffset;
1485 1236
 				if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
1486 1237
 					position.top += myOffset + atOffset + offset;
1487 1238
 				}
1488 1239
 			} else if ( overBottom > 0 ) {
1489
-				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
1240
+				newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset +
1241
+					offset - offsetTop;
1490 1242
 				if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
1491 1243
 					position.top += myOffset + atOffset + offset;
1492 1244
 				}
... ...
@@ -1505,10282 +1257,12406 @@ $.ui.position = {
1505 1257
 	}
1506 1258
 };
1507 1259
 
1508
-// fraction support test
1509
-(function() {
1510
-	var testElement, testElementParent, testElementStyle, offsetLeft, i,
1511
-		body = document.getElementsByTagName( "body" )[ 0 ],
1512
-		div = document.createElement( "div" );
1513
-
1514
-	//Create a "fake body" for testing based on method used in jQuery.support
1515
-	testElement = document.createElement( body ? "div" : "body" );
1516
-	testElementStyle = {
1517
-		visibility: "hidden",
1518
-		width: 0,
1519
-		height: 0,
1520
-		border: 0,
1521
-		margin: 0,
1522
-		background: "none"
1523
-	};
1524
-	if ( body ) {
1525
-		$.extend( testElementStyle, {
1526
-			position: "absolute",
1527
-			left: "-1000px",
1528
-			top: "-1000px"
1529
-		});
1530
-	}
1531
-	for ( i in testElementStyle ) {
1532
-		testElement.style[ i ] = testElementStyle[ i ];
1533
-	}
1534
-	testElement.appendChild( div );
1535
-	testElementParent = body || document.documentElement;
1536
-	testElementParent.insertBefore( testElement, testElementParent.firstChild );
1537
-
1538
-	div.style.cssText = "position: absolute; left: 10.7432222px;";
1539
-
1540
-	offsetLeft = $( div ).offset().left;
1541
-	supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11;
1542
-
1543
-	testElement.innerHTML = "";
1544
-	testElementParent.removeChild( testElement );
1545
-})();
1546
-
1547 1260
 } )();
1548 1261
 
1549 1262
 var position = $.ui.position;
1550 1263
 
1551 1264
 
1552 1265
 /*!
1553
- * jQuery UI Accordion 1.11.4
1266
+ * jQuery UI :data 1.13.2
1554 1267
  * http://jqueryui.com
1555 1268
  *
1556 1269
  * Copyright jQuery Foundation and other contributors
1557 1270
  * Released under the MIT license.
1558 1271
  * http://jquery.org/license
1559
- *
1560
- * http://api.jqueryui.com/accordion/
1561 1272
  */
1562 1273
 
1274
+//>>label: :data Selector
1275
+//>>group: Core
1276
+//>>description: Selects elements which have data stored under the specified key.
1277
+//>>docs: http://api.jqueryui.com/data-selector/
1563 1278
 
1564
-var accordion = $.widget( "ui.accordion", {
1565
-	version: "1.11.4",
1566
-	options: {
1567
-		active: 0,
1568
-		animate: {},
1569
-		collapsible: false,
1570
-		event: "click",
1571
-		header: "> li > :first-child,> :not(li):even",
1572
-		heightStyle: "auto",
1573
-		icons: {
1574
-			activeHeader: "ui-icon-triangle-1-s",
1575
-			header: "ui-icon-triangle-1-e"
1576
-		},
1577 1279
 
1578
-		// callbacks
1579
-		activate: null,
1580
-		beforeActivate: null
1581
-	},
1280
+var data = $.extend( $.expr.pseudos, {
1281
+	data: $.expr.createPseudo ?
1282
+		$.expr.createPseudo( function( dataName ) {
1283
+			return function( elem ) {
1284
+				return !!$.data( elem, dataName );
1285
+			};
1286
+		} ) :
1582 1287
 
1583
-	hideProps: {
1584
-		borderTopWidth: "hide",
1585
-		borderBottomWidth: "hide",
1586
-		paddingTop: "hide",
1587
-		paddingBottom: "hide",
1588
-		height: "hide"
1589
-	},
1288
+		// Support: jQuery <1.8
1289
+		function( elem, i, match ) {
1290
+			return !!$.data( elem, match[ 3 ] );
1291
+		}
1292
+} );
1590 1293
 
1591
-	showProps: {
1592
-		borderTopWidth: "show",
1593
-		borderBottomWidth: "show",
1594
-		paddingTop: "show",
1595
-		paddingBottom: "show",
1596
-		height: "show"
1597
-	},
1294
+/*!
1295
+ * jQuery UI Disable Selection 1.13.2
1296
+ * http://jqueryui.com
1297
+ *
1298
+ * Copyright jQuery Foundation and other contributors
1299
+ * Released under the MIT license.
1300
+ * http://jquery.org/license
1301
+ */
1598 1302
 
1599
-	_create: function() {
1600
-		var options = this.options;
1601
-		this.prevShow = this.prevHide = $();
1602
-		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
1603
-			// ARIA
1604
-			.attr( "role", "tablist" );
1303
+//>>label: disableSelection
1304
+//>>group: Core
1305
+//>>description: Disable selection of text content within the set of matched elements.
1306
+//>>docs: http://api.jqueryui.com/disableSelection/
1605 1307
 
1606
-		// don't allow collapsible: false and active: false / null
1607
-		if ( !options.collapsible && (options.active === false || options.active == null) ) {
1608
-			options.active = 0;
1609
-		}
1308
+// This file is deprecated
1610 1309
 
1611
-		this._processPanels();
1612
-		// handle negative values
1613
-		if ( options.active < 0 ) {
1614
-			options.active += this.headers.length;
1615
-		}
1616
-		this._refresh();
1617
-	},
1310
+var disableSelection = $.fn.extend( {
1311
+	disableSelection: ( function() {
1312
+		var eventType = "onselectstart" in document.createElement( "div" ) ?
1313
+			"selectstart" :
1314
+			"mousedown";
1618 1315
 
1619
-	_getCreateEventData: function() {
1620
-		return {
1621
-			header: this.active,
1622
-			panel: !this.active.length ? $() : this.active.next()
1316
+		return function() {
1317
+			return this.on( eventType + ".ui-disableSelection", function( event ) {
1318
+				event.preventDefault();
1319
+			} );
1623 1320
 		};
1624
-	},
1321
+	} )(),
1625 1322
 
1626
-	_createIcons: function() {
1627
-		var icons = this.options.icons;
1628
-		if ( icons ) {
1629
-			$( "<span>" )
1630
-				.addClass( "ui-accordion-header-icon ui-icon " + icons.header )
1631
-				.prependTo( this.headers );
1632
-			this.active.children( ".ui-accordion-header-icon" )
1633
-				.removeClass( icons.header )
1634
-				.addClass( icons.activeHeader );
1635
-			this.headers.addClass( "ui-accordion-icons" );
1323
+	enableSelection: function() {
1324
+		return this.off( ".ui-disableSelection" );
1636 1325
 	}
1637
-	},
1326
+} );
1638 1327
 
1639
-	_destroyIcons: function() {
1640
-		this.headers
1641
-			.removeClass( "ui-accordion-icons" )
1642
-			.children( ".ui-accordion-header-icon" )
1643
-				.remove();
1644
-	},
1645 1328
 
1646
-	_destroy: function() {
1647
-		var contents;
1648 1329
 
1649
-		// clean up main element
1650
-		this.element
1651
-			.removeClass( "ui-accordion ui-widget ui-helper-reset" )
1652
-			.removeAttr( "role" );
1330
+// Create a local jQuery because jQuery Color relies on it and the
1331
+// global may not exist with AMD and a custom build (#10199).
1332
+// This module is a noop if used as a regular AMD module.
1333
+// eslint-disable-next-line no-unused-vars
1334
+var jQuery = $;
1653 1335
 
1654
-		// clean up headers
1655
-		this.headers
1656
-			.removeClass( "ui-accordion-header ui-accordion-header-active ui-state-default " +
1657
-				"ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
1658
-			.removeAttr( "role" )
1659
-			.removeAttr( "aria-expanded" )
1660
-			.removeAttr( "aria-selected" )
1661
-			.removeAttr( "aria-controls" )
1662
-			.removeAttr( "tabIndex" )
1663
-			.removeUniqueId();
1664 1336
 
1665
-		this._destroyIcons();
1337
+/*!
1338
+ * jQuery Color Animations v2.2.0
1339
+ * https://github.com/jquery/jquery-color
1340
+ *
1341
+ * Copyright OpenJS Foundation and other contributors
1342
+ * Released under the MIT license.
1343
+ * http://jquery.org/license
1344
+ *
1345
+ * Date: Sun May 10 09:02:36 2020 +0200
1346
+ */
1666 1347
 
1667
-		// clean up content panels
1668
-		contents = this.headers.next()
1669
-			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom " +
1670
-				"ui-accordion-content ui-accordion-content-active ui-state-disabled" )
1671
-			.css( "display", "" )
1672
-			.removeAttr( "role" )
1673
-			.removeAttr( "aria-hidden" )
1674
-			.removeAttr( "aria-labelledby" )
1675
-			.removeUniqueId();
1676 1348
 
1677
-		if ( this.options.heightStyle !== "content" ) {
1678
-			contents.css( "height", "" );
1679
-		}
1680
-	},
1681 1349
 
1682
-	_setOption: function( key, value ) {
1683
-		if ( key === "active" ) {
1684
-			// _activate() will handle invalid values and update this.options
1685
-			this._activate( value );
1686
-			return;
1687
-		}
1350
+	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " +
1351
+		"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
1688 1352
 
1689
-		if ( key === "event" ) {
1690
-			if ( this.options.event ) {
1691
-				this._off( this.headers, this.options.event );
1353
+	class2type = {},
1354
+	toString = class2type.toString,
1355
+
1356
+	// plusequals test for += 100 -= 100
1357
+	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
1358
+
1359
+	// a set of RE's that can match strings and generate color tuples.
1360
+	stringParsers = [ {
1361
+			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1362
+			parse: function( execResult ) {
1363
+				return [
1364
+					execResult[ 1 ],
1365
+					execResult[ 2 ],
1366
+					execResult[ 3 ],
1367
+					execResult[ 4 ]
1368
+				];
1692 1369
 			}
1693
-			this._setupEvents( value );
1370
+		}, {
1371
+			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1372
+			parse: function( execResult ) {
1373
+				return [
1374
+					execResult[ 1 ] * 2.55,
1375
+					execResult[ 2 ] * 2.55,
1376
+					execResult[ 3 ] * 2.55,
1377
+					execResult[ 4 ]
1378
+				];
1694 1379
 			}
1380
+		}, {
1695 1381
 
1696
-		this._super( key, value );
1697
-
1698
-		// setting collapsible: false while collapsed; open first panel
1699
-		if ( key === "collapsible" && !value && this.options.active === false ) {
1700
-			this._activate( 0 );
1382
+			// this regex ignores A-F because it's compared against an already lowercased string
1383
+			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,
1384
+			parse: function( execResult ) {
1385
+				return [
1386
+					parseInt( execResult[ 1 ], 16 ),
1387
+					parseInt( execResult[ 2 ], 16 ),
1388
+					parseInt( execResult[ 3 ], 16 ),
1389
+					execResult[ 4 ] ?
1390
+						( parseInt( execResult[ 4 ], 16 ) / 255 ).toFixed( 2 ) :
1391
+						1
1392
+				];
1701 1393
 			}
1394
+		}, {
1702 1395
 
1703
-		if ( key === "icons" ) {
1704
-			this._destroyIcons();
1705
-			if ( value ) {
1706
-				this._createIcons();
1396
+			// this regex ignores A-F because it's compared against an already lowercased string
1397
+			re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,
1398
+			parse: function( execResult ) {
1399
+				return [
1400
+					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
1401
+					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
1402
+					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ),
1403
+					execResult[ 4 ] ?
1404
+						( parseInt( execResult[ 4 ] + execResult[ 4 ], 16 ) / 255 )
1405
+							.toFixed( 2 ) :
1406
+						1
1407
+				];
1707 1408
 			}
1409
+		}, {
1410
+			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
1411
+			space: "hsla",
1412
+			parse: function( execResult ) {
1413
+				return [
1414
+					execResult[ 1 ],
1415
+					execResult[ 2 ] / 100,
1416
+					execResult[ 3 ] / 100,
1417
+					execResult[ 4 ]
1418
+				];
1708 1419
 			}
1420
+		} ],
1709 1421
 
1710
-		// #5332 - opacity doesn't cascade to positioned elements in IE
1711
-		// so we need to add the disabled class to the headers and panels
1712
-		if ( key === "disabled" ) {
1713
-			this.element
1714
-				.toggleClass( "ui-state-disabled", !!value )
1715
-				.attr( "aria-disabled", value );
1716
-			this.headers.add( this.headers.next() )
1717
-				.toggleClass( "ui-state-disabled", !!value );
1422
+	// jQuery.Color( )
1423
+	color = jQuery.Color = function( color, green, blue, alpha ) {
1424
+		return new jQuery.Color.fn.parse( color, green, blue, alpha );
1425
+	},
1426
+	spaces = {
1427
+		rgba: {
1428
+			props: {
1429
+				red: {
1430
+					idx: 0,
1431
+					type: "byte"
1432
+				},
1433
+				green: {
1434
+					idx: 1,
1435
+					type: "byte"
1436
+				},
1437
+				blue: {
1438
+					idx: 2,
1439
+					type: "byte"
1440
+				}
1718 1441
 			}
1719 1442
 		},
1720 1443
 
1721
-	_keydown: function( event ) {
1722
-		if ( event.altKey || event.ctrlKey ) {
1723
-			return;
1444
+		hsla: {
1445
+			props: {
1446
+				hue: {
1447
+					idx: 0,
1448
+					type: "degrees"
1449
+				},
1450
+				saturation: {
1451
+					idx: 1,
1452
+					type: "percent"
1453
+				},
1454
+				lightness: {
1455
+					idx: 2,
1456
+					type: "percent"
1457
+				}
1724 1458
 			}
1459
+		}
1460
+	},
1461
+	propTypes = {
1462
+		"byte": {
1463
+			floor: true,
1464
+			max: 255
1465
+		},
1466
+		"percent": {
1467
+			max: 1
1468
+		},
1469
+		"degrees": {
1470
+			mod: 360,
1471
+			floor: true
1472
+		}
1473
+	},
1474
+	support = color.support = {},
1725 1475
 
1726
-		var keyCode = $.ui.keyCode,
1727
-			length = this.headers.length,
1728
-			currentIndex = this.headers.index( event.target ),
1729
-			toFocus = false;
1476
+	// element for support tests
1477
+	supportElem = jQuery( "<p>" )[ 0 ],
1730 1478
 
1731
-		switch ( event.keyCode ) {
1732
-			case keyCode.RIGHT:
1733
-			case keyCode.DOWN:
1734
-				toFocus = this.headers[ ( currentIndex + 1 ) % length ];
1735
-				break;
1736
-			case keyCode.LEFT:
1737
-			case keyCode.UP:
1738
-				toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
1739
-				break;
1740
-			case keyCode.SPACE:
1741
-			case keyCode.ENTER:
1742
-				this._eventHandler( event );
1743
-				break;
1744
-			case keyCode.HOME:
1745
-				toFocus = this.headers[ 0 ];
1746
-				break;
1747
-			case keyCode.END:
1748
-				toFocus = this.headers[ length - 1 ];
1749
-				break;
1750
-		}
1479
+	// colors = jQuery.Color.names
1480
+	colors,
1751 1481
 
1752
-		if ( toFocus ) {
1753
-			$( event.target ).attr( "tabIndex", -1 );
1754
-			$( toFocus ).attr( "tabIndex", 0 );
1755
-			toFocus.focus();
1756
-			event.preventDefault();
1757
-		}
1758
-	},
1482
+	// local aliases of functions called often
1483
+	each = jQuery.each;
1759 1484
 
1760
-	_panelKeyDown: function( event ) {
1761
-		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
1762
-			$( event.currentTarget ).prev().focus();
1763
-		}
1764
-	},
1485
+// determine rgba support immediately
1486
+supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
1487
+support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
1765 1488
 
1766
-	refresh: function() {
1767
-		var options = this.options;
1768
-		this._processPanels();
1489
+// define cache name and alpha properties
1490
+// for rgba and hsla spaces
1491
+each( spaces, function( spaceName, space ) {
1492
+	space.cache = "_" + spaceName;
1493
+	space.props.alpha = {
1494
+		idx: 3,
1495
+		type: "percent",
1496
+		def: 1
1497
+	};
1498
+} );
1769 1499
 
1770
-		// was collapsed or no panel
1771
-		if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
1772
-			options.active = false;
1773
-			this.active = $();
1774
-		// active false only when collapsible is true
1775
-		} else if ( options.active === false ) {
1776
-			this._activate( 0 );
1777
-		// was active, but active panel is gone
1778
-		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
1779
-			// all remaining panel are disabled
1780
-			if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
1781
-				options.active = false;
1782
-				this.active = $();
1783
-			// activate previous panel
1784
-			} else {
1785
-				this._activate( Math.max( 0, options.active - 1 ) );
1786
-			}
1787
-		// was active, active panel still exists
1788
-		} else {
1789
-			// make sure active index is correct
1790
-			options.active = this.headers.index( this.active );
1791
-		}
1500
+// Populate the class2type map
1501
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
1502
+	function( _i, name ) {
1503
+		class2type[ "[object " + name + "]" ] = name.toLowerCase();
1504
+	} );
1792 1505
 
1793
-		this._destroyIcons();
1506
+function getType( obj ) {
1507
+	if ( obj == null ) {
1508
+		return obj + "";
1509
+	}
1794 1510
 
1795
-		this._refresh();
1796
-	},
1511
+	return typeof obj === "object" ?
1512
+		class2type[ toString.call( obj ) ] || "object" :
1513
+		typeof obj;
1514
+}
1797 1515
 
1798
-	_processPanels: function() {
1799
-		var prevHeaders = this.headers,
1800
-			prevPanels = this.panels;
1516
+function clamp( value, prop, allowEmpty ) {
1517
+	var type = propTypes[ prop.type ] || {};
1801 1518
 
1802
-		this.headers = this.element.find( this.options.header )
1803
-			.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
1519
+	if ( value == null ) {
1520
+		return ( allowEmpty || !prop.def ) ? null : prop.def;
1521
+	}
1804 1522
 
1805
-		this.panels = this.headers.next()
1806
-			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
1807
-			.filter( ":not(.ui-accordion-content-active)" )
1808
-			.hide();
1523
+	// ~~ is an short way of doing floor for positive numbers
1524
+	value = type.floor ? ~~value : parseFloat( value );
1809 1525
 
1810
-		// Avoid memory leaks (#10056)
1811
-		if ( prevPanels ) {
1812
-			this._off( prevHeaders.not( this.headers ) );
1813
-			this._off( prevPanels.not( this.panels ) );
1526
+	// IE will pass in empty strings as value for alpha,
1527
+	// which will hit this case
1528
+	if ( isNaN( value ) ) {
1529
+		return prop.def;
1814 1530
 	}
1815
-	},
1816 1531
 
1817
-	_refresh: function() {
1818
-		var maxHeight,
1819
-			options = this.options,
1820
-			heightStyle = options.heightStyle,
1821
-			parent = this.element.parent();
1532
+	if ( type.mod ) {
1822 1533
 
1823
-		this.active = this._findActive( options.active )
1824
-			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
1825
-			.removeClass( "ui-corner-all" );
1826
-		this.active.next()
1827
-			.addClass( "ui-accordion-content-active" )
1828
-			.show();
1534
+		// we add mod before modding to make sure that negatives values
1535
+		// get converted properly: -10 -> 350
1536
+		return ( value + type.mod ) % type.mod;
1537
+	}
1829 1538
 
1830
-		this.headers
1831
-			.attr( "role", "tab" )
1832
-			.each(function() {
1833
-				var header = $( this ),
1834
-					headerId = header.uniqueId().attr( "id" ),
1835
-					panel = header.next(),
1836
-					panelId = panel.uniqueId().attr( "id" );
1837
-				header.attr( "aria-controls", panelId );
1838
-				panel.attr( "aria-labelledby", headerId );
1839
-			})
1840
-			.next()
1841
-				.attr( "role", "tabpanel" );
1539
+	// for now all property types without mod have min and max
1540
+	return Math.min( type.max, Math.max( 0, value ) );
1541
+}
1842 1542
 
1843
-		this.headers
1844
-			.not( this.active )
1845
-			.attr({
1846
-				"aria-selected": "false",
1847
-				"aria-expanded": "false",
1848
-				tabIndex: -1
1849
-			})
1850
-			.next()
1851
-				.attr({
1852
-					"aria-hidden": "true"
1853
-				})
1854
-				.hide();
1543
+function stringParse( string ) {
1544
+	var inst = color(),
1545
+		rgba = inst._rgba = [];
1855 1546
 
1856
-		// make sure at least one header is in the tab order
1857
-		if ( !this.active.length ) {
1858
-			this.headers.eq( 0 ).attr( "tabIndex", 0 );
1859
-		} else {
1860
-			this.active.attr({
1861
-				"aria-selected": "true",
1862
-				"aria-expanded": "true",
1863
-				tabIndex: 0
1864
-			})
1865
-			.next()
1866
-				.attr({
1867
-					"aria-hidden": "false"
1868
-				});
1869
-		}
1547
+	string = string.toLowerCase();
1870 1548
 
1871
-		this._createIcons();
1549
+	each( stringParsers, function( _i, parser ) {
1550
+		var parsed,
1551
+			match = parser.re.exec( string ),
1552
+			values = match && parser.parse( match ),
1553
+			spaceName = parser.space || "rgba";
1872 1554
 
1873
-		this._setupEvents( options.event );
1555
+		if ( values ) {
1556
+			parsed = inst[ spaceName ]( values );
1874 1557
 
1875
-		if ( heightStyle === "fill" ) {
1876
-			maxHeight = parent.height();
1877
-			this.element.siblings( ":visible" ).each(function() {
1878
-				var elem = $( this ),
1879
-					position = elem.css( "position" );
1558
+			// if this was an rgba parse the assignment might happen twice
1559
+			// oh well....
1560
+			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
1561
+			rgba = inst._rgba = parsed._rgba;
1880 1562
 
1881
-				if ( position === "absolute" || position === "fixed" ) {
1882
-					return;
1563
+			// exit each( stringParsers ) here because we matched
1564
+			return false;
1883 1565
 		}
1884
-				maxHeight -= elem.outerHeight( true );
1885 1566
 	} );
1886 1567
 
1887
-			this.headers.each(function() {
1888
-				maxHeight -= $( this ).outerHeight( true );
1889
-			});
1568
+	// Found a stringParser that handled it
1569
+	if ( rgba.length ) {
1890 1570
 
1891
-			this.headers.next()
1892
-				.each(function() {
1893
-					$( this ).height( Math.max( 0, maxHeight -
1894
-						$( this ).innerHeight() + $( this ).height() ) );
1895
-				})
1896
-				.css( "overflow", "auto" );
1897
-		} else if ( heightStyle === "auto" ) {
1898
-			maxHeight = 0;
1899
-			this.headers.next()
1900
-				.each(function() {
1901
-					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
1902
-				})
1903
-				.height( maxHeight );
1571
+		// if this came from a parsed string, force "transparent" when alpha is 0
1572
+		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
1573
+		if ( rgba.join() === "0,0,0,0" ) {
1574
+			jQuery.extend( rgba, colors.transparent );
1575
+		}
1576
+		return inst;
1904 1577
 	}
1905
-	},
1906 1578
 
1907
-	_activate: function( index ) {
1908
-		var active = this._findActive( index )[ 0 ];
1579
+	// named colors
1580
+	return colors[ string ];
1581
+}
1909 1582
 
1910
-		// trying to activate the already active panel
1911
-		if ( active === this.active[ 0 ] ) {
1912
-			return;
1583
+color.fn = jQuery.extend( color.prototype, {
1584
+	parse: function( red, green, blue, alpha ) {
1585
+		if ( red === undefined ) {
1586
+			this._rgba = [ null, null, null, null ];
1587
+			return this;
1588
+		}
1589
+		if ( red.jquery || red.nodeType ) {
1590
+			red = jQuery( red ).css( green );
1591
+			green = undefined;
1913 1592
 		}
1914 1593
 
1915
-		// trying to collapse, simulate a click on the currently active header
1916
-		active = active || this.active[ 0 ];
1594
+		var inst = this,
1595
+			type = getType( red ),
1596
+			rgba = this._rgba = [];
1917 1597
 
1918
-		this._eventHandler({
1919
-			target: active,
1920
-			currentTarget: active,
1921
-			preventDefault: $.noop
1922
-		});
1923
-	},
1598
+		// more than 1 argument specified - assume ( red, green, blue, alpha )
1599
+		if ( green !== undefined ) {
1600
+			red = [ red, green, blue, alpha ];
1601
+			type = "array";
1602
+		}
1924 1603
 
1925
-	_findActive: function( selector ) {
1926
-		return typeof selector === "number" ? this.headers.eq( selector ) : $();
1927
-	},
1604
+		if ( type === "string" ) {
1605
+			return this.parse( stringParse( red ) || colors._default );
1606
+		}
1928 1607
 
1929
-	_setupEvents: function( event ) {
1930
-		var events = {
1931
-			keydown: "_keydown"
1932
-		};
1933
-		if ( event ) {
1934
-			$.each( event.split( " " ), function( index, eventName ) {
1935
-				events[ eventName ] = "_eventHandler";
1608
+		if ( type === "array" ) {
1609
+			each( spaces.rgba.props, function( _key, prop ) {
1610
+				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
1936 1611
 			} );
1612
+			return this;
1937 1613
 		}
1938 1614
 
1939
-		this._off( this.headers.add( this.headers.next() ) );
1940
-		this._on( this.headers, events );
1941
-		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
1942
-		this._hoverable( this.headers );
1943
-		this._focusable( this.headers );
1944
-	},
1945
-
1946
-	_eventHandler: function( event ) {
1947
-		var options = this.options,
1948
-			active = this.active,
1949
-			clicked = $( event.currentTarget ),
1950
-			clickedIsActive = clicked[ 0 ] === active[ 0 ],
1951
-			collapsing = clickedIsActive && options.collapsible,
1952
-			toShow = collapsing ? $() : clicked.next(),
1953
-			toHide = active.next(),
1954
-			eventData = {
1955
-				oldHeader: active,
1956
-				oldPanel: toHide,
1957
-				newHeader: collapsing ? $() : clicked,
1958
-				newPanel: toShow
1959
-			};
1615
+		if ( type === "object" ) {
1616
+			if ( red instanceof color ) {
1617
+				each( spaces, function( _spaceName, space ) {
1618
+					if ( red[ space.cache ] ) {
1619
+						inst[ space.cache ] = red[ space.cache ].slice();
1620
+					}
1621
+				} );
1622
+			} else {
1623
+				each( spaces, function( _spaceName, space ) {
1624
+					var cache = space.cache;
1625
+					each( space.props, function( key, prop ) {
1960 1626
 
1961
-		event.preventDefault();
1627
+						// if the cache doesn't exist, and we know how to convert
1628
+						if ( !inst[ cache ] && space.to ) {
1962 1629
 
1963
-		if (
1964
-				// click on active header, but not collapsible
1965
-				( clickedIsActive && !options.collapsible ) ||
1966
-				// allow canceling activation
1967
-				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
1630
+							// if the value was null, we don't need to copy it
1631
+							// if the key was alpha, we don't need to copy it either
1632
+							if ( key === "alpha" || red[ key ] == null ) {
1968 1633
 								return;
1969 1634
 							}
1635
+							inst[ cache ] = space.to( inst._rgba );
1636
+						}
1970 1637
 
1971
-		options.active = collapsing ? false : this.headers.index( clicked );
1638
+						// this is the only case where we allow nulls for ALL properties.
1639
+						// call clamp with alwaysAllowEmpty
1640
+						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
1641
+					} );
1972 1642
 
1973
-		// when the call to ._toggle() comes after the class changes
1974
-		// it causes a very odd bug in IE 8 (see #6720)
1975
-		this.active = clickedIsActive ? $() : clicked;
1976
-		this._toggle( eventData );
1643
+					// everything defined but alpha?
1644
+					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
1977 1645
 
1978
-		// switch classes
1979
-		// corner classes on the previously active header stay after the animation
1980
-		active.removeClass( "ui-accordion-header-active ui-state-active" );
1981
-		if ( options.icons ) {
1982
-			active.children( ".ui-accordion-header-icon" )
1983
-				.removeClass( options.icons.activeHeader )
1984
-				.addClass( options.icons.header );
1646
+						// use the default of 1
1647
+						if ( inst[ cache ][ 3 ] == null ) {
1648
+							inst[ cache ][ 3 ] = 1;
1985 1649
 						}
1986 1650
 
1987
-		if ( !clickedIsActive ) {
1988
-			clicked
1989
-				.removeClass( "ui-corner-all" )
1990
-				.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
1991
-			if ( options.icons ) {
1992
-				clicked.children( ".ui-accordion-header-icon" )
1993
-					.removeClass( options.icons.header )
1994
-					.addClass( options.icons.activeHeader );
1651
+						if ( space.from ) {
1652
+							inst._rgba = space.from( inst[ cache ] );
1995 1653
 						}
1996
-
1997
-			clicked
1998
-				.next()
1999
-				.addClass( "ui-accordion-content-active" );
1654
+					}
1655
+				} );
1656
+			}
1657
+			return this;
2000 1658
 		}
2001 1659
 	},
1660
+	is: function( compare ) {
1661
+		var is = color( compare ),
1662
+			same = true,
1663
+			inst = this;
2002 1664
 
2003
-	_toggle: function( data ) {
2004
-		var toShow = data.newPanel,
2005
-			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
2006
-
2007
-		// handle activating a panel during the animation for another activation
2008
-		this.prevShow.add( this.prevHide ).stop( true, true );
2009
-		this.prevShow = toShow;
2010
-		this.prevHide = toHide;
2011
-
2012
-		if ( this.options.animate ) {
2013
-			this._animate( toShow, toHide, data );
2014
-		} else {
2015
-			toHide.hide();
2016
-			toShow.show();
2017
-			this._toggleComplete( data );
1665
+		each( spaces, function( _, space ) {
1666
+			var localCache,
1667
+				isCache = is[ space.cache ];
1668
+			if ( isCache ) {
1669
+				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
1670
+				each( space.props, function( _, prop ) {
1671
+					if ( isCache[ prop.idx ] != null ) {
1672
+						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
1673
+						return same;
2018 1674
 					}
2019
-
2020
-		toHide.attr({
2021
-			"aria-hidden": "true"
2022
-		});
2023
-		toHide.prev().attr({
2024
-			"aria-selected": "false",
2025
-			"aria-expanded": "false"
2026 1675
 				} );
2027
-		// if we're switching panels, remove the old header from the tab order
2028
-		// if we're opening from collapsed state, remove the previous header from the tab order
2029
-		// if we're collapsing, then keep the collapsing header in the tab order
2030
-		if ( toShow.length && toHide.length ) {
2031
-			toHide.prev().attr({
2032
-				"tabIndex": -1,
2033
-				"aria-expanded": "false"
1676
+			}
1677
+			return same;
2034 1678
 		} );
2035
-		} else if ( toShow.length ) {
2036
-			this.headers.filter(function() {
2037
-				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
2038
-			})
2039
-			.attr( "tabIndex", -1 );
1679
+		return same;
1680
+	},
1681
+	_space: function() {
1682
+		var used = [],
1683
+			inst = this;
1684
+		each( spaces, function( spaceName, space ) {
1685
+			if ( inst[ space.cache ] ) {
1686
+				used.push( spaceName );
2040 1687
 			}
2041
-
2042
-		toShow
2043
-			.attr( "aria-hidden", "false" )
2044
-			.prev()
2045
-				.attr({
2046
-					"aria-selected": "true",
2047
-					"aria-expanded": "true",
2048
-					tabIndex: 0
2049 1688
 		} );
1689
+		return used.pop();
2050 1690
 	},
1691
+	transition: function( other, distance ) {
1692
+		var end = color( other ),
1693
+			spaceName = end._space(),
1694
+			space = spaces[ spaceName ],
1695
+			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
1696
+			start = startColor[ space.cache ] || space.to( startColor._rgba ),
1697
+			result = start.slice();
2051 1698
 
2052
-	_animate: function( toShow, toHide, data ) {
2053
-		var total, easing, duration,
2054
-			that = this,
2055
-			adjust = 0,
2056
-			boxSizing = toShow.css( "box-sizing" ),
2057
-			down = toShow.length &&
2058
-				( !toHide.length || ( toShow.index() < toHide.index() ) ),
2059
-			animate = this.options.animate || {},
2060
-			options = down && animate.down || animate,
2061
-			complete = function() {
2062
-				that._toggleComplete( data );
2063
-			};
2064
-
2065
-		if ( typeof options === "number" ) {
2066
-			duration = options;
2067
-		}
2068
-		if ( typeof options === "string" ) {
2069
-			easing = options;
2070
-		}
2071
-		// fall back from options to animation in case of partial down settings
2072
-		easing = easing || options.easing || animate.easing;
2073
-		duration = duration || options.duration || animate.duration;
1699
+		end = end[ space.cache ];
1700
+		each( space.props, function( _key, prop ) {
1701
+			var index = prop.idx,
1702
+				startValue = start[ index ],
1703
+				endValue = end[ index ],
1704
+				type = propTypes[ prop.type ] || {};
2074 1705
 
2075
-		if ( !toHide.length ) {
2076
-			return toShow.animate( this.showProps, duration, easing, complete );
2077
-		}
2078
-		if ( !toShow.length ) {
2079
-			return toHide.animate( this.hideProps, duration, easing, complete );
1706
+			// if null, don't override start value
1707
+			if ( endValue === null ) {
1708
+				return;
2080 1709
 			}
2081 1710
 
2082
-		total = toShow.show().outerHeight();
2083
-		toHide.animate( this.hideProps, {
2084
-			duration: duration,
2085
-			easing: easing,
2086
-			step: function( now, fx ) {
2087
-				fx.now = Math.round( now );
2088
-			}
2089
-		});
2090
-		toShow
2091
-			.hide()
2092
-			.animate( this.showProps, {
2093
-				duration: duration,
2094
-				easing: easing,
2095
-				complete: complete,
2096
-				step: function( now, fx ) {
2097
-					fx.now = Math.round( now );
2098
-					if ( fx.prop !== "height" ) {
2099
-						if ( boxSizing === "content-box" ) {
2100
-							adjust += fx.now;
1711
+			// if null - use end
1712
+			if ( startValue === null ) {
1713
+				result[ index ] = endValue;
1714
+			} else {
1715
+				if ( type.mod ) {
1716
+					if ( endValue - startValue > type.mod / 2 ) {
1717
+						startValue += type.mod;
1718
+					} else if ( startValue - endValue > type.mod / 2 ) {
1719
+						startValue -= type.mod;
2101 1720
 					}
2102
-					} else if ( that.options.heightStyle !== "content" ) {
2103
-						fx.now = Math.round( total - toHide.outerHeight() - adjust );
2104
-						adjust = 0;
2105 1721
 				}
1722
+				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
2106 1723
 			}
2107 1724
 		} );
1725
+		return this[ spaceName ]( result );
2108 1726
 	},
1727
+	blend: function( opaque ) {
2109 1728
 
2110
-	_toggleComplete: function( data ) {
2111
-		var toHide = data.oldPanel;
1729
+		// if we are already opaque - return ourself
1730
+		if ( this._rgba[ 3 ] === 1 ) {
1731
+			return this;
1732
+		}
2112 1733
 
2113
-		toHide
2114
-			.removeClass( "ui-accordion-content-active" )
2115
-			.prev()
2116
-				.removeClass( "ui-corner-top" )
2117
-				.addClass( "ui-corner-all" );
1734
+		var rgb = this._rgba.slice(),
1735
+			a = rgb.pop(),
1736
+			blend = color( opaque )._rgba;
2118 1737
 
2119
-		// Work around for rendering bug in IE (#5421)
2120
-		if ( toHide.length ) {
2121
-			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
2122
-		}
2123
-		this._trigger( "activate", null, data );
1738
+		return color( jQuery.map( rgb, function( v, i ) {
1739
+			return ( 1 - a ) * blend[ i ] + a * v;
1740
+		} ) );
1741
+	},
1742
+	toRgbaString: function() {
1743
+		var prefix = "rgba(",
1744
+			rgba = jQuery.map( this._rgba, function( v, i ) {
1745
+				if ( v != null ) {
1746
+					return v;
2124 1747
 				}
1748
+				return i > 2 ? 1 : 0;
2125 1749
 			} );
2126 1750
 
1751
+		if ( rgba[ 3 ] === 1 ) {
1752
+			rgba.pop();
1753
+			prefix = "rgb(";
1754
+		}
2127 1755
 
2128
-/*!
2129
- * jQuery UI Menu 1.11.4
2130
- * http://jqueryui.com
2131
- *
2132
- * Copyright jQuery Foundation and other contributors
2133
- * Released under the MIT license.
2134
- * http://jquery.org/license
2135
- *
2136
- * http://api.jqueryui.com/menu/
2137
- */
2138
-
2139
-
2140
-var menu = $.widget( "ui.menu", {
2141
-	version: "1.11.4",
2142
-	defaultElement: "<ul>",
2143
-	delay: 300,
2144
-	options: {
2145
-		icons: {
2146
-			submenu: "ui-icon-carat-1-e"
2147
-		},
2148
-		items: "> *",
2149
-		menus: "ul",
2150
-		position: {
2151
-			my: "left-1 top",
2152
-			at: "right top"
1756
+		return prefix + rgba.join() + ")";
2153 1757
 	},
2154
-		role: "menu",
1758
+	toHslaString: function() {
1759
+		var prefix = "hsla(",
1760
+			hsla = jQuery.map( this.hsla(), function( v, i ) {
1761
+				if ( v == null ) {
1762
+					v = i > 2 ? 1 : 0;
1763
+				}
2155 1764
 
2156
-		// callbacks
2157
-		blur: null,
2158
-		focus: null,
2159
-		select: null
2160
-	},
2161
-
2162
-	_create: function() {
2163
-		this.activeMenu = this.element;
2164
-
2165
-		// Flag used to prevent firing of the click handler
2166
-		// as the event bubbles up through nested menus
2167
-		this.mouseHandled = false;
2168
-		this.element
2169
-			.uniqueId()
2170
-			.addClass( "ui-menu ui-widget ui-widget-content" )
2171
-			.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
2172
-			.attr({
2173
-				role: this.options.role,
2174
-				tabIndex: 0
1765
+				// catch 1 and 2
1766
+				if ( i && i < 3 ) {
1767
+					v = Math.round( v * 100 ) + "%";
1768
+				}
1769
+				return v;
2175 1770
 			} );
2176 1771
 
2177
-		if ( this.options.disabled ) {
2178
-			this.element
2179
-				.addClass( "ui-state-disabled" )
2180
-				.attr( "aria-disabled", "true" );
1772
+		if ( hsla[ 3 ] === 1 ) {
1773
+			hsla.pop();
1774
+			prefix = "hsl(";
2181 1775
 		}
2182
-
2183
-		this._on({
2184
-			// Prevent focus from sticking to links inside menu after clicking
2185
-			// them (focus should always stay on UL during navigation).
2186
-			"mousedown .ui-menu-item": function( event ) {
2187
-				event.preventDefault();
1776
+		return prefix + hsla.join() + ")";
2188 1777
 	},
2189
-			"click .ui-menu-item": function( event ) {
2190
-				var target = $( event.target );
2191
-				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
2192
-					this.select( event );
1778
+	toHexString: function( includeAlpha ) {
1779
+		var rgba = this._rgba.slice(),
1780
+			alpha = rgba.pop();
2193 1781
 
2194
-					// Only set the mouseHandled flag if the event will bubble, see #9469.
2195
-					if ( !event.isPropagationStopped() ) {
2196
-						this.mouseHandled = true;
1782
+		if ( includeAlpha ) {
1783
+			rgba.push( ~~( alpha * 255 ) );
2197 1784
 		}
2198 1785
 
2199
-					// Open submenu on click
2200
-					if ( target.has( ".ui-menu" ).length ) {
2201
-						this.expand( event );
2202
-					} else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
1786
+		return "#" + jQuery.map( rgba, function( v ) {
2203 1787
 
2204
-						// Redirect focus to the menu
2205
-						this.element.trigger( "focus", [ true ] );
1788
+			// default to 0 when nulls exist
1789
+			v = ( v || 0 ).toString( 16 );
1790
+			return v.length === 1 ? "0" + v : v;
1791
+		} ).join( "" );
1792
+	},
1793
+	toString: function() {
1794
+		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
1795
+	}
1796
+} );
1797
+color.fn.parse.prototype = color.fn;
2206 1798
 
2207
-						// If the active item is on the top level, let it stay active.
2208
-						// Otherwise, blur the active item since it is no longer visible.
2209
-						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
2210
-							clearTimeout( this.timer );
1799
+// hsla conversions adapted from:
1800
+// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
1801
+
1802
+function hue2rgb( p, q, h ) {
1803
+	h = ( h + 1 ) % 1;
1804
+	if ( h * 6 < 1 ) {
1805
+		return p + ( q - p ) * h * 6;
2211 1806
 	}
1807
+	if ( h * 2 < 1 ) {
1808
+		return q;
2212 1809
 	}
1810
+	if ( h * 3 < 2 ) {
1811
+		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
2213 1812
 	}
2214
-			},
2215
-			"mouseenter .ui-menu-item": function( event ) {
2216
-				// Ignore mouse events while typeahead is active, see #10458.
2217
-				// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
2218
-				// is over an item in the menu
2219
-				if ( this.previousFilter ) {
2220
-					return;
1813
+	return p;
2221 1814
 }
2222
-				var target = $( event.currentTarget );
2223
-				// Remove ui-state-active class from siblings of the newly focused menu item
2224
-				// to avoid a jump caused by adjacent elements both having a class with a border
2225
-				target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
2226
-				this.focus( event, target );
2227
-			},
2228
-			mouseleave: "collapseAll",
2229
-			"mouseleave .ui-menu": "collapseAll",
2230
-			focus: function( event, keepActiveItem ) {
2231
-				// If there's already an active item, keep it active
2232
-				// If not, activate the first item
2233
-				var item = this.active || this.element.find( this.options.items ).eq( 0 );
2234 1815
 
2235
-				if ( !keepActiveItem ) {
2236
-					this.focus( event, item );
2237
-				}
2238
-			},
2239
-			blur: function( event ) {
2240
-				this._delay(function() {
2241
-					if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
2242
-						this.collapseAll( event );
1816
+spaces.hsla.to = function( rgba ) {
1817
+	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
1818
+		return [ null, null, null, rgba[ 3 ] ];
2243 1819
 	}
2244
-				});
2245
-			},
2246
-			keydown: "_keydown"
2247
-		});
2248
-
2249
-		this.refresh();
1820
+	var r = rgba[ 0 ] / 255,
1821
+		g = rgba[ 1 ] / 255,
1822
+		b = rgba[ 2 ] / 255,
1823
+		a = rgba[ 3 ],
1824
+		max = Math.max( r, g, b ),
1825
+		min = Math.min( r, g, b ),
1826
+		diff = max - min,
1827
+		add = max + min,
1828
+		l = add * 0.5,
1829
+		h, s;
2250 1830
 
2251
-		// Clicks outside of a menu collapse any open menus
2252
-		this._on( this.document, {
2253
-			click: function( event ) {
2254
-				if ( this._closeOnDocumentClick( event ) ) {
2255
-					this.collapseAll( event );
1831
+	if ( min === max ) {
1832
+		h = 0;
1833
+	} else if ( r === max ) {
1834
+		h = ( 60 * ( g - b ) / diff ) + 360;
1835
+	} else if ( g === max ) {
1836
+		h = ( 60 * ( b - r ) / diff ) + 120;
1837
+	} else {
1838
+		h = ( 60 * ( r - g ) / diff ) + 240;
2256 1839
 	}
2257 1840
 
2258
-				// Reset the mouseHandled flag
2259
-				this.mouseHandled = false;
1841
+	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
1842
+	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
1843
+	if ( diff === 0 ) {
1844
+		s = 0;
1845
+	} else if ( l <= 0.5 ) {
1846
+		s = diff / add;
1847
+	} else {
1848
+		s = diff / ( 2 - add );
2260 1849
 	}
2261
-		});
2262
-	},
2263
-
2264
-	_destroy: function() {
2265
-		// Destroy (sub)menus
2266
-		this.element
2267
-			.removeAttr( "aria-activedescendant" )
2268
-			.find( ".ui-menu" ).addBack()
2269
-				.removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
2270
-				.removeAttr( "role" )
2271
-				.removeAttr( "tabIndex" )
2272
-				.removeAttr( "aria-labelledby" )
2273
-				.removeAttr( "aria-expanded" )
2274
-				.removeAttr( "aria-hidden" )
2275
-				.removeAttr( "aria-disabled" )
2276
-				.removeUniqueId()
2277
-				.show();
1850
+	return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ];
1851
+};
2278 1852
 
2279
-		// Destroy menu items
2280
-		this.element.find( ".ui-menu-item" )
2281
-			.removeClass( "ui-menu-item" )
2282
-			.removeAttr( "role" )
2283
-			.removeAttr( "aria-disabled" )
2284
-			.removeUniqueId()
2285
-			.removeClass( "ui-state-hover" )
2286
-			.removeAttr( "tabIndex" )
2287
-			.removeAttr( "role" )
2288
-			.removeAttr( "aria-haspopup" )
2289
-			.children().each( function() {
2290
-				var elem = $( this );
2291
-				if ( elem.data( "ui-menu-submenu-carat" ) ) {
2292
-					elem.remove();
1853
+spaces.hsla.from = function( hsla ) {
1854
+	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
1855
+		return [ null, null, null, hsla[ 3 ] ];
2293 1856
 	}
2294
-			});
1857
+	var h = hsla[ 0 ] / 360,
1858
+		s = hsla[ 1 ],
1859
+		l = hsla[ 2 ],
1860
+		a = hsla[ 3 ],
1861
+		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
1862
+		p = 2 * l - q;
2295 1863
 
2296
-		// Destroy menu dividers
2297
-		this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
2298
-	},
1864
+	return [
1865
+		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
1866
+		Math.round( hue2rgb( p, q, h ) * 255 ),
1867
+		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
1868
+		a
1869
+	];
1870
+};
2299 1871
 
2300
-	_keydown: function( event ) {
2301
-		var match, prev, character, skip,
2302
-			preventDefault = true;
2303 1872
 
2304
-		switch ( event.keyCode ) {
2305
-		case $.ui.keyCode.PAGE_UP:
2306
-			this.previousPage( event );
2307
-			break;
2308
-		case $.ui.keyCode.PAGE_DOWN:
2309
-			this.nextPage( event );
2310
-			break;
2311
-		case $.ui.keyCode.HOME:
2312
-			this._move( "first", "first", event );
2313
-			break;
2314
-		case $.ui.keyCode.END:
2315
-			this._move( "last", "last", event );
2316
-			break;
2317
-		case $.ui.keyCode.UP:
2318
-			this.previous( event );
2319
-			break;
2320
-		case $.ui.keyCode.DOWN:
2321
-			this.next( event );
2322
-			break;
2323
-		case $.ui.keyCode.LEFT:
2324
-			this.collapse( event );
2325
-			break;
2326
-		case $.ui.keyCode.RIGHT:
2327
-			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
2328
-				this.expand( event );
2329
-			}
2330
-			break;
2331
-		case $.ui.keyCode.ENTER:
2332
-		case $.ui.keyCode.SPACE:
2333
-			this._activate( event );
2334
-			break;
2335
-		case $.ui.keyCode.ESCAPE:
2336
-			this.collapse( event );
2337
-			break;
2338
-		default:
2339
-			preventDefault = false;
2340
-			prev = this.previousFilter || "";
2341
-			character = String.fromCharCode( event.keyCode );
2342
-			skip = false;
1873
+each( spaces, function( spaceName, space ) {
1874
+	var props = space.props,
1875
+		cache = space.cache,
1876
+		to = space.to,
1877
+		from = space.from;
2343 1878
 
2344
-			clearTimeout( this.filterTimer );
1879
+	// makes rgba() and hsla()
1880
+	color.fn[ spaceName ] = function( value ) {
2345 1881
 
2346
-			if ( character === prev ) {
2347
-				skip = true;
2348
-			} else {
2349
-				character = prev + character;
1882
+		// generate a cache for this space if it doesn't exist
1883
+		if ( to && !this[ cache ] ) {
1884
+			this[ cache ] = to( this._rgba );
1885
+		}
1886
+		if ( value === undefined ) {
1887
+			return this[ cache ].slice();
2350 1888
 		}
2351 1889
 
2352
-			match = this._filterMenuItems( character );
2353
-			match = skip && match.index( this.active.next() ) !== -1 ?
2354
-				this.active.nextAll( ".ui-menu-item" ) :
2355
-				match;
1890
+		var ret,
1891
+			type = getType( value ),
1892
+			arr = ( type === "array" || type === "object" ) ? value : arguments,
1893
+			local = this[ cache ].slice();
2356 1894
 
2357
-			// If no matches on the current filter, reset to the last character pressed
2358
-			// to move down the menu to the first item that starts with that character
2359
-			if ( !match.length ) {
2360
-				character = String.fromCharCode( event.keyCode );
2361
-				match = this._filterMenuItems( character );
1895
+		each( props, function( key, prop ) {
1896
+			var val = arr[ type === "object" ? key : prop.idx ];
1897
+			if ( val == null ) {
1898
+				val = local[ prop.idx ];
2362 1899
 			}
1900
+			local[ prop.idx ] = clamp( val, prop );
1901
+		} );
2363 1902
 
2364
-			if ( match.length ) {
2365
-				this.focus( event, match );
2366
-				this.previousFilter = character;
2367
-				this.filterTimer = this._delay(function() {
2368
-					delete this.previousFilter;
2369
-				}, 1000 );
1903
+		if ( from ) {
1904
+			ret = color( from( local ) );
1905
+			ret[ cache ] = local;
1906
+			return ret;
2370 1907
 		} else {
2371
-				delete this.previousFilter;
2372
-			}
1908
+			return color( local );
2373 1909
 		}
1910
+	};
2374 1911
 
2375
-		if ( preventDefault ) {
2376
-			event.preventDefault();
1912
+	// makes red() green() blue() alpha() hue() saturation() lightness()
1913
+	each( props, function( key, prop ) {
1914
+
1915
+		// alpha is included in more than one space
1916
+		if ( color.fn[ key ] ) {
1917
+			return;
2377 1918
 		}
2378
-	},
1919
+		color.fn[ key ] = function( value ) {
1920
+			var local, cur, match, fn,
1921
+				vtype = getType( value );
2379 1922
 
2380
-	_activate: function( event ) {
2381
-		if ( !this.active.is( ".ui-state-disabled" ) ) {
2382
-			if ( this.active.is( "[aria-haspopup='true']" ) ) {
2383
-				this.expand( event );
1923
+			if ( key === "alpha" ) {
1924
+				fn = this._hsla ? "hsla" : "rgba";
2384 1925
 			} else {
2385
-				this.select( event );
2386
-			}
1926
+				fn = spaceName;
2387 1927
 			}
2388
-	},
2389
-
2390
-	refresh: function() {
2391
-		var menus, items,
2392
-			that = this,
2393
-			icon = this.options.icons.submenu,
2394
-			submenus = this.element.find( this.options.menus );
1928
+			local = this[ fn ]();
1929
+			cur = local[ prop.idx ];
2395 1930
 
2396
-		this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
2397
-
2398
-		// Initialize nested menus
2399
-		submenus.filter( ":not(.ui-menu)" )
2400
-			.addClass( "ui-menu ui-widget ui-widget-content ui-front" )
2401
-			.hide()
2402
-			.attr({
2403
-				role: this.options.role,
2404
-				"aria-hidden": "true",
2405
-				"aria-expanded": "false"
2406
-			})
2407
-			.each(function() {
2408
-				var menu = $( this ),
2409
-					item = menu.parent(),
2410
-					submenuCarat = $( "<span>" )
2411
-						.addClass( "ui-menu-icon ui-icon " + icon )
2412
-						.data( "ui-menu-submenu-carat", true );
2413
-
2414
-				item
2415
-					.attr( "aria-haspopup", "true" )
2416
-					.prepend( submenuCarat );
2417
-				menu.attr( "aria-labelledby", item.attr( "id" ) );
2418
-			});
2419
-
2420
-		menus = submenus.add( this.element );
2421
-		items = menus.find( this.options.items );
1931
+			if ( vtype === "undefined" ) {
1932
+				return cur;
1933
+			}
2422 1934
 
2423
-		// Initialize menu-items containing spaces and/or dashes only as dividers
2424
-		items.not( ".ui-menu-item" ).each(function() {
2425
-			var item = $( this );
2426
-			if ( that._isDivider( item ) ) {
2427
-				item.addClass( "ui-widget-content ui-menu-divider" );
1935
+			if ( vtype === "function" ) {
1936
+				value = value.call( this, cur );
1937
+				vtype = getType( value );
1938
+			}
1939
+			if ( value == null && prop.empty ) {
1940
+				return this;
1941
+			}
1942
+			if ( vtype === "string" ) {
1943
+				match = rplusequals.exec( value );
1944
+				if ( match ) {
1945
+					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
1946
+				}
2428 1947
 			}
1948
+			local[ prop.idx ] = value;
1949
+			return this[ fn ]( local );
1950
+		};
2429 1951
 	} );
2430
-
2431
-		// Don't refresh list items that are already adapted
2432
-		items.not( ".ui-menu-item, .ui-menu-divider" )
2433
-			.addClass( "ui-menu-item" )
2434
-			.uniqueId()
2435
-			.attr({
2436
-				tabIndex: -1,
2437
-				role: this._itemRole()
2438 1952
 } );
2439 1953
 
2440
-		// Add aria-disabled attribute to any disabled menu item
2441
-		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
2442
-
2443
-		// If the active item has been removed, blur the menu
2444
-		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
2445
-			this.blur();
2446
-		}
2447
-	},
2448
-
2449
-	_itemRole: function() {
2450
-		return {
2451
-			menu: "menuitem",
2452
-			listbox: "option"
2453
-		}[ this.options.role ];
2454
-	},
1954
+// add cssHook and .fx.step function for each named hook.
1955
+// accept a space separated string of properties
1956
+color.hook = function( hook ) {
1957
+	var hooks = hook.split( " " );
1958
+	each( hooks, function( _i, hook ) {
1959
+		jQuery.cssHooks[ hook ] = {
1960
+			set: function( elem, value ) {
1961
+				var parsed, curElem,
1962
+					backgroundColor = "";
2455 1963
 
2456
-	_setOption: function( key, value ) {
2457
-		if ( key === "icons" ) {
2458
-			this.element.find( ".ui-menu-icon" )
2459
-				.removeClass( this.options.icons.submenu )
2460
-				.addClass( value.submenu );
1964
+				if ( value !== "transparent" && ( getType( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
1965
+					value = color( parsed || value );
1966
+					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
1967
+						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
1968
+						while (
1969
+							( backgroundColor === "" || backgroundColor === "transparent" ) &&
1970
+							curElem && curElem.style
1971
+						) {
1972
+							try {
1973
+								backgroundColor = jQuery.css( curElem, "backgroundColor" );
1974
+								curElem = curElem.parentNode;
1975
+							} catch ( e ) {
2461 1976
 							}
2462
-		if ( key === "disabled" ) {
2463
-			this.element
2464
-				.toggleClass( "ui-state-disabled", !!value )
2465
-				.attr( "aria-disabled", value );
2466 1977
 						}
2467
-		this._super( key, value );
2468
-	},
2469
-
2470
-	focus: function( event, item ) {
2471
-		var nested, focused;
2472
-		this.blur( event, event && event.type === "focus" );
2473 1978
 
2474
-		this._scrollIntoView( item );
2475
-
2476
-		this.active = item.first();
2477
-		focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
2478
-		// Only update aria-activedescendant if there's a role
2479
-		// otherwise we assume focus is managed elsewhere
2480
-		if ( this.options.role ) {
2481
-			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
1979
+						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
1980
+							backgroundColor :
1981
+							"_default" );
2482 1982
 					}
2483 1983
 
2484
-		// Highlight active parent menu item, if any
2485
-		this.active
2486
-			.parent()
2487
-			.closest( ".ui-menu-item" )
2488
-			.addClass( "ui-state-active" );
2489
-
2490
-		if ( event && event.type === "keydown" ) {
2491
-			this._close();
2492
-		} else {
2493
-			this.timer = this._delay(function() {
2494
-				this._close();
2495
-			}, this.delay );
1984
+					value = value.toRgbaString();
2496 1985
 				}
1986
+				try {
1987
+					elem.style[ hook ] = value;
1988
+				} catch ( e ) {
2497 1989
 
2498
-		nested = item.children( ".ui-menu" );
2499
-		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
2500
-			this._startOpening(nested);
1990
+					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
2501 1991
 				}
2502
-		this.activeMenu = item.parent();
1992
+			}
1993
+		};
1994
+		jQuery.fx.step[ hook ] = function( fx ) {
1995
+			if ( !fx.colorInit ) {
1996
+				fx.start = color( fx.elem, hook );
1997
+				fx.end = color( fx.end );
1998
+				fx.colorInit = true;
1999
+			}
2000
+			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
2001
+		};
2002
+	} );
2503 2003
 
2504
-		this._trigger( "focus", event, { item: item } );
2505
-	},
2004
+};
2506 2005
 
2507
-	_scrollIntoView: function( item ) {
2508
-		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
2509
-		if ( this._hasScroll() ) {
2510
-			borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
2511
-			paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
2512
-			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
2513
-			scroll = this.activeMenu.scrollTop();
2514
-			elementHeight = this.activeMenu.height();
2515
-			itemHeight = item.outerHeight();
2006
+color.hook( stepHooks );
2516 2007
 
2517
-			if ( offset < 0 ) {
2518
-				this.activeMenu.scrollTop( scroll + offset );
2519
-			} else if ( offset + itemHeight > elementHeight ) {
2520
-				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
2521
-			}
2522
-		}
2523
-	},
2008
+jQuery.cssHooks.borderColor = {
2009
+	expand: function( value ) {
2010
+		var expanded = {};
2524 2011
 
2525
-	blur: function( event, fromFocus ) {
2526
-		if ( !fromFocus ) {
2527
-			clearTimeout( this.timer );
2012
+		each( [ "Top", "Right", "Bottom", "Left" ], function( _i, part ) {
2013
+			expanded[ "border" + part + "Color" ] = value;
2014
+		} );
2015
+		return expanded;
2528 2016
 	}
2017
+};
2529 2018
 
2530
-		if ( !this.active ) {
2531
-			return;
2532
-		}
2019
+// Basic color names only.
2020
+// Usage of any of the other color names requires adding yourself or including
2021
+// jquery.color.svg-names.js.
2022
+colors = jQuery.Color.names = {
2533 2023
 
2534
-		this.active.removeClass( "ui-state-focus" );
2535
-		this.active = null;
2024
+	// 4.1. Basic color keywords
2025
+	aqua: "#00ffff",
2026
+	black: "#000000",
2027
+	blue: "#0000ff",
2028
+	fuchsia: "#ff00ff",
2029
+	gray: "#808080",
2030
+	green: "#008000",
2031
+	lime: "#00ff00",
2032
+	maroon: "#800000",
2033
+	navy: "#000080",
2034
+	olive: "#808000",
2035
+	purple: "#800080",
2036
+	red: "#ff0000",
2037
+	silver: "#c0c0c0",
2038
+	teal: "#008080",
2039
+	white: "#ffffff",
2040
+	yellow: "#ffff00",
2536 2041
 
2537
-		this._trigger( "blur", event, { item: this.active } );
2538
-	},
2042
+	// 4.2.3. "transparent" color keyword
2043
+	transparent: [ null, null, null, 0 ],
2539 2044
 
2540
-	_startOpening: function( submenu ) {
2541
-		clearTimeout( this.timer );
2045
+	_default: "#ffffff"
2046
+};
2542 2047
 
2543
-		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
2544
-		// shift in the submenu position when mousing over the carat icon
2545
-		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
2546
-			return;
2547
-		}
2548 2048
 
2549
-		this.timer = this._delay(function() {
2550
-			this._close();
2551
-			this._open( submenu );
2552
-		}, this.delay );
2553
-	},
2049
+/*!
2050
+ * jQuery UI Effects 1.13.2
2051
+ * http://jqueryui.com
2052
+ *
2053
+ * Copyright jQuery Foundation and other contributors
2054
+ * Released under the MIT license.
2055
+ * http://jquery.org/license
2056
+ */
2554 2057
 
2555
-	_open: function( submenu ) {
2556
-		var position = $.extend({
2557
-			of: this.active
2558
-		}, this.options.position );
2058
+//>>label: Effects Core
2059
+//>>group: Effects
2060
+/* eslint-disable max-len */
2061
+//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.
2062
+/* eslint-enable max-len */
2063
+//>>docs: http://api.jqueryui.com/category/effects-core/
2064
+//>>demos: http://jqueryui.com/effect/
2559 2065
 
2560
-		clearTimeout( this.timer );
2561
-		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
2562
-			.hide()
2563
-			.attr( "aria-hidden", "true" );
2564 2066
 
2565
-		submenu
2566
-			.show()
2567
-			.removeAttr( "aria-hidden" )
2568
-			.attr( "aria-expanded", "true" )
2569
-			.position( position );
2570
-	},
2067
+var dataSpace = "ui-effects-",
2068
+	dataSpaceStyle = "ui-effects-style",
2069
+	dataSpaceAnimated = "ui-effects-animated";
2571 2070
 
2572
-	collapseAll: function( event, all ) {
2573
-		clearTimeout( this.timer );
2574
-		this.timer = this._delay(function() {
2575
-			// If we were passed an event, look for the submenu that contains the event
2576
-			var currentMenu = all ? this.element :
2577
-				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
2578
-
2579
-			// If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
2580
-			if ( !currentMenu.length ) {
2581
-				currentMenu = this.element;
2582
-			}
2071
+$.effects = {
2072
+	effect: {}
2073
+};
2583 2074
 
2584
-			this._close( currentMenu );
2075
+/******************************************************************************/
2076
+/****************************** CLASS ANIMATIONS ******************************/
2077
+/******************************************************************************/
2078
+( function() {
2585 2079
 
2586
-			this.blur( event );
2587
-			this.activeMenu = currentMenu;
2588
-		}, this.delay );
2589
-	},
2080
+var classAnimationActions = [ "add", "remove", "toggle" ],
2081
+	shorthandStyles = {
2082
+		border: 1,
2083
+		borderBottom: 1,
2084
+		borderColor: 1,
2085
+		borderLeft: 1,
2086
+		borderRight: 1,
2087
+		borderTop: 1,
2088
+		borderWidth: 1,
2089
+		margin: 1,
2090
+		padding: 1
2091
+	};
2590 2092
 
2591
-	// With no arguments, closes the currently active menu - if nothing is active
2592
-	// it closes all menus.  If passed an argument, it will search for menus BELOW
2593
-	_close: function( startMenu ) {
2594
-		if ( !startMenu ) {
2595
-			startMenu = this.active ? this.active.parent() : this.element;
2093
+$.each(
2094
+	[ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ],
2095
+	function( _, prop ) {
2096
+		$.fx.step[ prop ] = function( fx ) {
2097
+			if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
2098
+				jQuery.style( fx.elem, prop, fx.end );
2099
+				fx.setAttr = true;
2596 2100
 			}
2597
-
2598
-		startMenu
2599
-			.find( ".ui-menu" )
2600
-				.hide()
2601
-				.attr( "aria-hidden", "true" )
2602
-				.attr( "aria-expanded", "false" )
2603
-			.end()
2604
-			.find( ".ui-state-active" ).not( ".ui-state-focus" )
2605
-				.removeClass( "ui-state-active" );
2606
-	},
2607
-
2608
-	_closeOnDocumentClick: function( event ) {
2609
-		return !$( event.target ).closest( ".ui-menu" ).length;
2610
-	},
2611
-
2612
-	_isDivider: function( item ) {
2613
-
2614
-		// Match hyphen, em dash, en dash
2615
-		return !/[^\-\u2014\u2013\s]/.test( item.text() );
2616
-	},
2617
-
2618
-	collapse: function( event ) {
2619
-		var newItem = this.active &&
2620
-			this.active.parent().closest( ".ui-menu-item", this.element );
2621
-		if ( newItem && newItem.length ) {
2622
-			this._close();
2623
-			this.focus( event, newItem );
2101
+		};
2624 2102
 	}
2625
-	},
2626
-
2627
-	expand: function( event ) {
2628
-		var newItem = this.active &&
2629
-			this.active
2630
-				.children( ".ui-menu " )
2631
-				.find( this.options.items )
2632
-				.first();
2633
-
2634
-		if ( newItem && newItem.length ) {
2635
-			this._open( newItem.parent() );
2103
+);
2636 2104
 
2637
-			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
2638
-			this._delay(function() {
2639
-				this.focus( event, newItem );
2105
+function camelCase( string ) {
2106
+	return string.replace( /-([\da-z])/gi, function( all, letter ) {
2107
+		return letter.toUpperCase();
2640 2108
 	} );
2641 2109
 }
2642
-	},
2643
-
2644
-	next: function( event ) {
2645
-		this._move( "next", "first", event );
2646
-	},
2647
-
2648
-	previous: function( event ) {
2649
-		this._move( "prev", "last", event );
2650
-	},
2651 2110
 
2652
-	isFirstItem: function() {
2653
-		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
2654
-	},
2111
+function getElementStyles( elem ) {
2112
+	var key, len,
2113
+		style = elem.ownerDocument.defaultView ?
2114
+			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
2115
+			elem.currentStyle,
2116
+		styles = {};
2655 2117
 
2656
-	isLastItem: function() {
2657
-		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
2658
-	},
2118
+	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
2119
+		len = style.length;
2120
+		while ( len-- ) {
2121
+			key = style[ len ];
2122
+			if ( typeof style[ key ] === "string" ) {
2123
+				styles[ camelCase( key ) ] = style[ key ];
2124
+			}
2125
+		}
2659 2126
 
2660
-	_move: function( direction, filter, event ) {
2661
-		var next;
2662
-		if ( this.active ) {
2663
-			if ( direction === "first" || direction === "last" ) {
2664
-				next = this.active
2665
-					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
2666
-					.eq( -1 );
2127
+	// Support: Opera, IE <9
2667 2128
 	} else {
2668
-				next = this.active
2669
-					[ direction + "All" ]( ".ui-menu-item" )
2670
-					.eq( 0 );
2129
+		for ( key in style ) {
2130
+			if ( typeof style[ key ] === "string" ) {
2131
+				styles[ key ] = style[ key ];
2671 2132
 			}
2672 2133
 		}
2673
-		if ( !next || !next.length || !this.active ) {
2674
-			next = this.activeMenu.find( this.options.items )[ filter ]();
2675 2134
 	}
2676 2135
 
2677
-		this.focus( event, next );
2678
-	},
2136
+	return styles;
2137
+}
2679 2138
 
2680
-	nextPage: function( event ) {
2681
-		var item, base, height;
2139
+function styleDifference( oldStyle, newStyle ) {
2140
+	var diff = {},
2141
+		name, value;
2682 2142
 
2683
-		if ( !this.active ) {
2684
-			this.next( event );
2685
-			return;
2686
-		}
2687
-		if ( this.isLastItem() ) {
2688
-			return;
2143
+	for ( name in newStyle ) {
2144
+		value = newStyle[ name ];
2145
+		if ( oldStyle[ name ] !== value ) {
2146
+			if ( !shorthandStyles[ name ] ) {
2147
+				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
2148
+					diff[ name ] = value;
2689 2149
 				}
2690
-		if ( this._hasScroll() ) {
2691
-			base = this.active.offset().top;
2692
-			height = this.element.height();
2693
-			this.active.nextAll( ".ui-menu-item" ).each(function() {
2694
-				item = $( this );
2695
-				return item.offset().top - base - height < 0;
2696
-			});
2697
-
2698
-			this.focus( event, item );
2699
-		} else {
2700
-			this.focus( event, this.activeMenu.find( this.options.items )
2701
-				[ !this.active ? "first" : "last" ]() );
2702 2150
 			}
2703
-	},
2704
-
2705
-	previousPage: function( event ) {
2706
-		var item, base, height;
2707
-		if ( !this.active ) {
2708
-			this.next( event );
2709
-			return;
2710 2151
 		}
2711
-		if ( this.isFirstItem() ) {
2712
-			return;
2713 2152
 	}
2714
-		if ( this._hasScroll() ) {
2715
-			base = this.active.offset().top;
2716
-			height = this.element.height();
2717
-			this.active.prevAll( ".ui-menu-item" ).each(function() {
2718
-				item = $( this );
2719
-				return item.offset().top - base + height > 0;
2720
-			});
2721 2153
 
2722
-			this.focus( event, item );
2723
-		} else {
2724
-			this.focus( event, this.activeMenu.find( this.options.items ).first() );
2154
+	return diff;
2725 2155
 }
2726
-	},
2727 2156
 
2728
-	_hasScroll: function() {
2729
-		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
2730
-	},
2731
-
2732
-	select: function( event ) {
2733
-		// TODO: It should never be possible to not have an active item at this
2734
-		// point, but the tests don't trigger mouseenter before click.
2735
-		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
2736
-		var ui = { item: this.active };
2737
-		if ( !this.active.has( ".ui-menu" ).length ) {
2738
-			this.collapseAll( event, true );
2157
+// Support: jQuery <1.8
2158
+if ( !$.fn.addBack ) {
2159
+	$.fn.addBack = function( selector ) {
2160
+		return this.add( selector == null ?
2161
+			this.prevObject : this.prevObject.filter( selector )
2162
+		);
2163
+	};
2739 2164
 }
2740
-		this._trigger( "select", event, ui );
2741
-	},
2742 2165
 
2743
-	_filterMenuItems: function(character) {
2744
-		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
2745
-			regex = new RegExp( "^" + escapedCharacter, "i" );
2166
+$.effects.animateClass = function( value, duration, easing, callback ) {
2167
+	var o = $.speed( duration, easing, callback );
2746 2168
 
2747
-		return this.activeMenu
2748
-			.find( this.options.items )
2169
+	return this.queue( function() {
2170
+		var animated = $( this ),
2171
+			baseClass = animated.attr( "class" ) || "",
2172
+			applyClassChange,
2173
+			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
2749 2174
 
2750
-			// Only match on items, not dividers or other content (#10571)
2751
-			.filter( ".ui-menu-item" )
2752
-			.filter(function() {
2753
-				return regex.test( $.trim( $( this ).text() ) );
2175
+		// Map the animated objects to store the original styles.
2176
+		allAnimations = allAnimations.map( function() {
2177
+			var el = $( this );
2178
+			return {
2179
+				el: el,
2180
+				start: getElementStyles( this )
2181
+			};
2754 2182
 		} );
2183
+
2184
+		// Apply class change
2185
+		applyClassChange = function() {
2186
+			$.each( classAnimationActions, function( i, action ) {
2187
+				if ( value[ action ] ) {
2188
+					animated[ action + "Class" ]( value[ action ] );
2755 2189
 				}
2756 2190
 			} );
2191
+		};
2192
+		applyClassChange();
2757 2193
 
2194
+		// Map all animated objects again - calculate new styles and diff
2195
+		allAnimations = allAnimations.map( function() {
2196
+			this.end = getElementStyles( this.el[ 0 ] );
2197
+			this.diff = styleDifference( this.start, this.end );
2198
+			return this;
2199
+		} );
2758 2200
 
2759
-/*!
2760
- * jQuery UI Autocomplete 1.11.4
2761
- * http://jqueryui.com
2762
- *
2763
- * Copyright jQuery Foundation and other contributors
2764
- * Released under the MIT license.
2765
- * http://jquery.org/license
2766
- *
2767
- * http://api.jqueryui.com/autocomplete/
2768
- */
2201
+		// Apply original class
2202
+		animated.attr( "class", baseClass );
2769 2203
 
2204
+		// Map all animated objects again - this time collecting a promise
2205
+		allAnimations = allAnimations.map( function() {
2206
+			var styleInfo = this,
2207
+				dfd = $.Deferred(),
2208
+				opts = $.extend( {}, o, {
2209
+					queue: false,
2210
+					complete: function() {
2211
+						dfd.resolve( styleInfo );
2212
+					}
2213
+				} );
2770 2214
 
2771
-$.widget( "ui.autocomplete", {
2772
-	version: "1.11.4",
2773
-	defaultElement: "<input>",
2774
-	options: {
2775
-		appendTo: null,
2776
-		autoFocus: false,
2777
-		delay: 300,
2778
-		minLength: 1,
2779
-		position: {
2780
-			my: "left top",
2781
-			at: "left bottom",
2782
-			collision: "none"
2783
-		},
2784
-		source: null,
2215
+			this.el.animate( this.diff, opts );
2216
+			return dfd.promise();
2217
+		} );
2785 2218
 
2786
-		// callbacks
2787
-		change: null,
2788
-		close: null,
2789
-		focus: null,
2790
-		open: null,
2791
-		response: null,
2792
-		search: null,
2793
-		select: null
2794
-	},
2219
+		// Once all animations have completed:
2220
+		$.when.apply( $, allAnimations.get() ).done( function() {
2795 2221
 
2796
-	requestIndex: 0,
2797
-	pending: 0,
2222
+			// Set the final class
2223
+			applyClassChange();
2798 2224
 
2799
-	_create: function() {
2800
-		// Some browsers only repeat keydown events, not keypress events,
2801
-		// so we use the suppressKeyPress flag to determine if we've already
2802
-		// handled the keydown event. #7269
2803
-		// Unfortunately the code for & in keypress is the same as the up arrow,
2804
-		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
2805
-		// events when we know the keydown event was used to modify the
2806
-		// search term. #7799
2807
-		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
2808
-			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
2809
-			isTextarea = nodeName === "textarea",
2810
-			isInput = nodeName === "input";
2225
+			// For each animated element,
2226
+			// clear all css properties that were animated
2227
+			$.each( arguments, function() {
2228
+				var el = this.el;
2229
+				$.each( this.diff, function( key ) {
2230
+					el.css( key, "" );
2231
+				} );
2232
+			} );
2811 2233
 
2812
-		this.isMultiLine =
2813
-			// Textareas are always multi-line
2814
-			isTextarea ? true :
2815
-			// Inputs are always single-line, even if inside a contentEditable element
2816
-			// IE also treats inputs as contentEditable
2817
-			isInput ? false :
2818
-			// All other element types are determined by whether or not they're contentEditable
2819
-			this.element.prop( "isContentEditable" );
2234
+			// This is guarnteed to be there if you use jQuery.speed()
2235
+			// it also handles dequeuing the next anim...
2236
+			o.complete.call( animated[ 0 ] );
2237
+		} );
2238
+	} );
2239
+};
2820 2240
 
2821
-		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
2822
-		this.isNewMenu = true;
2241
+$.fn.extend( {
2242
+	addClass: ( function( orig ) {
2243
+		return function( classNames, speed, easing, callback ) {
2244
+			return speed ?
2245
+				$.effects.animateClass.call( this,
2246
+					{ add: classNames }, speed, easing, callback ) :
2247
+				orig.apply( this, arguments );
2248
+		};
2249
+	} )( $.fn.addClass ),
2823 2250
 
2824
-		this.element
2825
-			.addClass( "ui-autocomplete-input" )
2826
-			.attr( "autocomplete", "off" );
2251
+	removeClass: ( function( orig ) {
2252
+		return function( classNames, speed, easing, callback ) {
2253
+			return arguments.length > 1 ?
2254
+				$.effects.animateClass.call( this,
2255
+					{ remove: classNames }, speed, easing, callback ) :
2256
+				orig.apply( this, arguments );
2257
+		};
2258
+	} )( $.fn.removeClass ),
2827 2259
 
2828
-		this._on( this.element, {
2829
-			keydown: function( event ) {
2830
-				if ( this.element.prop( "readOnly" ) ) {
2831
-					suppressKeyPress = true;
2832
-					suppressInput = true;
2833
-					suppressKeyPressRepeat = true;
2834
-					return;
2835
-				}
2260
+	toggleClass: ( function( orig ) {
2261
+		return function( classNames, force, speed, easing, callback ) {
2262
+			if ( typeof force === "boolean" || force === undefined ) {
2263
+				if ( !speed ) {
2836 2264
 
2837
-				suppressKeyPress = false;
2838
-				suppressInput = false;
2839
-				suppressKeyPressRepeat = false;
2840
-				var keyCode = $.ui.keyCode;
2841
-				switch ( event.keyCode ) {
2842
-				case keyCode.PAGE_UP:
2843
-					suppressKeyPress = true;
2844
-					this._move( "previousPage", event );
2845
-					break;
2846
-				case keyCode.PAGE_DOWN:
2847
-					suppressKeyPress = true;
2848
-					this._move( "nextPage", event );
2849
-					break;
2850
-				case keyCode.UP:
2851
-					suppressKeyPress = true;
2852
-					this._keyEvent( "previous", event );
2853
-					break;
2854
-				case keyCode.DOWN:
2855
-					suppressKeyPress = true;
2856
-					this._keyEvent( "next", event );
2857
-					break;
2858
-				case keyCode.ENTER:
2859
-					// when menu is open and has focus
2860
-					if ( this.menu.active ) {
2861
-						// #6055 - Opera still allows the keypress to occur
2862
-						// which causes forms to submit
2863
-						suppressKeyPress = true;
2864
-						event.preventDefault();
2865
-						this.menu.select( event );
2866
-					}
2867
-					break;
2868
-				case keyCode.TAB:
2869
-					if ( this.menu.active ) {
2870
-						this.menu.select( event );
2871
-					}
2872
-					break;
2873
-				case keyCode.ESCAPE:
2874
-					if ( this.menu.element.is( ":visible" ) ) {
2875
-						if ( !this.isMultiLine ) {
2876
-							this._value( this.term );
2877
-						}
2878
-						this.close( event );
2879
-						// Different browsers have different default behavior for escape
2880
-						// Single press can mean undo or clear
2881
-						// Double press in IE means clear the whole form
2882
-						event.preventDefault();
2883
-					}
2884
-					break;
2885
-				default:
2886
-					suppressKeyPressRepeat = true;
2887
-					// search timeout should be triggered before the input value is changed
2888
-					this._searchTimeout( event );
2889
-					break;
2890
-				}
2891
-			},
2892
-			keypress: function( event ) {
2893
-				if ( suppressKeyPress ) {
2894
-					suppressKeyPress = false;
2895
-					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
2896
-						event.preventDefault();
2897
-					}
2898
-					return;
2899
-				}
2900
-				if ( suppressKeyPressRepeat ) {
2901
-					return;
2265
+					// Without speed parameter
2266
+					return orig.apply( this, arguments );
2267
+				} else {
2268
+					return $.effects.animateClass.call( this,
2269
+						( force ? { add: classNames } : { remove: classNames } ),
2270
+						speed, easing, callback );
2902 2271
 				}
2272
+			} else {
2903 2273
 
2904
-				// replicate some key handlers to allow them to repeat in Firefox and Opera
2905
-				var keyCode = $.ui.keyCode;
2906
-				switch ( event.keyCode ) {
2907
-				case keyCode.PAGE_UP:
2908
-					this._move( "previousPage", event );
2909
-					break;
2910
-				case keyCode.PAGE_DOWN:
2911
-					this._move( "nextPage", event );
2912
-					break;
2913
-				case keyCode.UP:
2914
-					this._keyEvent( "previous", event );
2915
-					break;
2916
-				case keyCode.DOWN:
2917
-					this._keyEvent( "next", event );
2918
-					break;
2919
-				}
2920
-			},
2921
-			input: function( event ) {
2922
-				if ( suppressInput ) {
2923
-					suppressInput = false;
2924
-					event.preventDefault();
2925
-					return;
2926
-				}
2927
-				this._searchTimeout( event );
2928
-			},
2929
-			focus: function() {
2930
-				this.selectedItem = null;
2931
-				this.previous = this._value();
2932
-			},
2933
-			blur: function( event ) {
2934
-				if ( this.cancelBlur ) {
2935
-					delete this.cancelBlur;
2936
-					return;
2274
+				// Without force parameter
2275
+				return $.effects.animateClass.call( this,
2276
+					{ toggle: classNames }, force, speed, easing );
2937 2277
 			}
2278
+		};
2279
+	} )( $.fn.toggleClass ),
2938 2280
 
2939
-				clearTimeout( this.searching );
2940
-				this.close( event );
2941
-				this._change( event );
2281
+	switchClass: function( remove, add, speed, easing, callback ) {
2282
+		return $.effects.animateClass.call( this, {
2283
+			add: add,
2284
+			remove: remove
2285
+		}, speed, easing, callback );
2942 2286
 	}
2943 2287
 } );
2944 2288
 
2945
-		this._initSource();
2946
-		this.menu = $( "<ul>" )
2947
-			.addClass( "ui-autocomplete ui-front" )
2948
-			.appendTo( this._appendTo() )
2949
-			.menu({
2950
-				// disable ARIA support, the live region takes care of that
2951
-				role: null
2952
-			})
2953
-			.hide()
2954
-			.menu( "instance" );
2289
+} )();
2955 2290
 
2956
-		this._on( this.menu.element, {
2957
-			mousedown: function( event ) {
2958
-				// prevent moving focus out of the text field
2959
-				event.preventDefault();
2291
+/******************************************************************************/
2292
+/*********************************** EFFECTS **********************************/
2293
+/******************************************************************************/
2960 2294
 
2961
-				// IE doesn't prevent moving focus even with event.preventDefault()
2962
-				// so we set a flag to know when we should ignore the blur event
2963
-				this.cancelBlur = true;
2964
-				this._delay(function() {
2965
-					delete this.cancelBlur;
2966
-				});
2295
+( function() {
2967 2296
 
2968
-				// clicking on the scrollbar causes focus to shift to the body
2969
-				// but we can't detect a mouseup or a click immediately afterward
2970
-				// so we have to track the next mousedown and close the menu if
2971
-				// the user clicks somewhere outside of the autocomplete
2972
-				var menuElement = this.menu.element[ 0 ];
2973
-				if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
2974
-					this._delay(function() {
2975
-						var that = this;
2976
-						this.document.one( "mousedown", function( event ) {
2977
-							if ( event.target !== that.element[ 0 ] &&
2978
-									event.target !== menuElement &&
2979
-									!$.contains( menuElement, event.target ) ) {
2980
-								that.close();
2981
-							}
2982
-						});
2983
-					});
2297
+if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) {
2298
+	$.expr.pseudos.animated = ( function( orig ) {
2299
+		return function( elem ) {
2300
+			return !!$( elem ).data( dataSpaceAnimated ) || orig( elem );
2301
+		};
2302
+	} )( $.expr.pseudos.animated );
2984 2303
 }
2985
-			},
2986
-			menufocus: function( event, ui ) {
2987
-				var label, item;
2988
-				// support: Firefox
2989
-				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
2990
-				if ( this.isNewMenu ) {
2991
-					this.isNewMenu = false;
2992
-					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
2993
-						this.menu.blur();
2994 2304
 
2995
-						this.document.one( "mousemove", function() {
2996
-							$( event.target ).trigger( event.originalEvent );
2997
-						});
2305
+if ( $.uiBackCompat !== false ) {
2306
+	$.extend( $.effects, {
2998 2307
 
2999
-						return;
2308
+		// Saves a set of properties in a data storage
2309
+		save: function( element, set ) {
2310
+			var i = 0, length = set.length;
2311
+			for ( ; i < length; i++ ) {
2312
+				if ( set[ i ] !== null ) {
2313
+					element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
3000 2314
 				}
3001 2315
 			}
2316
+		},
3002 2317
 
3003
-				item = ui.item.data( "ui-autocomplete-item" );
3004
-				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
3005
-					// use value to match what will end up in the input, if it was a key event
3006
-					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
3007
-						this._value( item.value );
2318
+		// Restores a set of previously saved properties from a data storage
2319
+		restore: function( element, set ) {
2320
+			var val, i = 0, length = set.length;
2321
+			for ( ; i < length; i++ ) {
2322
+				if ( set[ i ] !== null ) {
2323
+					val = element.data( dataSpace + set[ i ] );
2324
+					element.css( set[ i ], val );
3008 2325
 				}
3009 2326
 			}
2327
+		},
3010 2328
 
3011
-				// Announce the value in the liveRegion
3012
-				label = ui.item.attr( "aria-label" ) || item.value;
3013
-				if ( label && $.trim( label ).length ) {
3014
-					this.liveRegion.children().hide();
3015
-					$( "<div>" ).text( label ).appendTo( this.liveRegion );
2329
+		setMode: function( el, mode ) {
2330
+			if ( mode === "toggle" ) {
2331
+				mode = el.is( ":hidden" ) ? "show" : "hide";
3016 2332
 			}
2333
+			return mode;
3017 2334
 		},
3018
-			menuselect: function( event, ui ) {
3019
-				var item = ui.item.data( "ui-autocomplete-item" ),
3020
-					previous = this.previous;
3021 2335
 
3022
-				// only trigger when focus was lost (click on menu)
3023
-				if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) {
3024
-					this.element.focus();
3025
-					this.previous = previous;
3026
-					// #6109 - IE triggers two focus events and the second
3027
-					// is asynchronous, so we need to reset the previous
3028
-					// term synchronously and asynchronously :-(
3029
-					this._delay(function() {
3030
-						this.previous = previous;
3031
-						this.selectedItem = item;
3032
-					});
3033
-				}
2336
+		// Wraps the element around a wrapper that copies position properties
2337
+		createWrapper: function( element ) {
3034 2338
 
3035
-				if ( false !== this._trigger( "select", event, { item: item } ) ) {
3036
-					this._value( item.value );
2339
+			// If the element is already wrapped, return it
2340
+			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
2341
+				return element.parent();
3037 2342
 			}
3038
-				// reset the term after the select event
3039
-				// this allows custom select handling to work properly
3040
-				this.term = this._value();
3041 2343
 
3042
-				this.close( event );
3043
-				this.selectedItem = item;
3044
-			}
3045
-		});
2344
+			// Wrap the element
2345
+			var props = {
2346
+					width: element.outerWidth( true ),
2347
+					height: element.outerHeight( true ),
2348
+					"float": element.css( "float" )
2349
+				},
2350
+				wrapper = $( "<div></div>" )
2351
+					.addClass( "ui-effects-wrapper" )
2352
+					.css( {
2353
+						fontSize: "100%",
2354
+						background: "transparent",
2355
+						border: "none",
2356
+						margin: 0,
2357
+						padding: 0
2358
+					} ),
3046 2359
 
3047
-		this.liveRegion = $( "<span>", {
3048
-				role: "status",
3049
-				"aria-live": "assertive",
3050
-				"aria-relevant": "additions"
3051
-			})
3052
-			.addClass( "ui-helper-hidden-accessible" )
3053
-			.appendTo( this.document[ 0 ].body );
2360
+				// Store the size in case width/height are defined in % - Fixes #5245
2361
+				size = {
2362
+					width: element.width(),
2363
+					height: element.height()
2364
+				},
2365
+				active = document.activeElement;
3054 2366
 
3055
-		// turning off autocomplete prevents the browser from remembering the
3056
-		// value when navigating through history, so we re-enable autocomplete
3057
-		// if the page is unloaded before the widget is destroyed. #7790
3058
-		this._on( this.window, {
3059
-			beforeunload: function() {
3060
-				this.element.removeAttr( "autocomplete" );
2367
+			// Support: Firefox
2368
+			// Firefox incorrectly exposes anonymous content
2369
+			// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
2370
+			try {
2371
+				// eslint-disable-next-line no-unused-expressions
2372
+				active.id;
2373
+			} catch ( e ) {
2374
+				active = document.body;
3061 2375
 			}
3062
-		});
3063
-	},
3064 2376
 
3065
-	_destroy: function() {
3066
-		clearTimeout( this.searching );
3067
-		this.element
3068
-			.removeClass( "ui-autocomplete-input" )
3069
-			.removeAttr( "autocomplete" );
3070
-		this.menu.element.remove();
3071
-		this.liveRegion.remove();
3072
-	},
2377
+			element.wrap( wrapper );
3073 2378
 
3074
-	_setOption: function( key, value ) {
3075
-		this._super( key, value );
3076
-		if ( key === "source" ) {
3077
-			this._initSource();
2379
+			// Fixes #7595 - Elements lose focus when wrapped.
2380
+			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
2381
+				$( active ).trigger( "focus" );
3078 2382
 			}
3079
-		if ( key === "appendTo" ) {
3080
-			this.menu.element.appendTo( this._appendTo() );
2383
+
2384
+			// Hotfix for jQuery 1.4 since some change in wrap() seems to actually
2385
+			// lose the reference to the wrapped element
2386
+			wrapper = element.parent();
2387
+
2388
+			// Transfer positioning properties to the wrapper
2389
+			if ( element.css( "position" ) === "static" ) {
2390
+				wrapper.css( { position: "relative" } );
2391
+				element.css( { position: "relative" } );
2392
+			} else {
2393
+				$.extend( props, {
2394
+					position: element.css( "position" ),
2395
+					zIndex: element.css( "z-index" )
2396
+				} );
2397
+				$.each( [ "top", "left", "bottom", "right" ], function( i, pos ) {
2398
+					props[ pos ] = element.css( pos );
2399
+					if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
2400
+						props[ pos ] = "auto";
3081 2401
 					}
3082
-		if ( key === "disabled" && value && this.xhr ) {
3083
-			this.xhr.abort();
2402
+				} );
2403
+				element.css( {
2404
+					position: "relative",
2405
+					top: 0,
2406
+					left: 0,
2407
+					right: "auto",
2408
+					bottom: "auto"
2409
+				} );
3084 2410
 			}
2411
+			element.css( size );
2412
+
2413
+			return wrapper.css( props ).show();
3085 2414
 		},
3086 2415
 
3087
-	_appendTo: function() {
3088
-		var element = this.options.appendTo;
2416
+		removeWrapper: function( element ) {
2417
+			var active = document.activeElement;
3089 2418
 
3090
-		if ( element ) {
3091
-			element = element.jquery || element.nodeType ?
3092
-				$( element ) :
3093
-				this.document.find( element ).eq( 0 );
2419
+			if ( element.parent().is( ".ui-effects-wrapper" ) ) {
2420
+				element.parent().replaceWith( element );
2421
+
2422
+				// Fixes #7595 - Elements lose focus when wrapped.
2423
+				if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
2424
+					$( active ).trigger( "focus" );
2425
+				}
3094 2426
 			}
3095 2427
 
3096
-		if ( !element || !element[ 0 ] ) {
3097
-			element = this.element.closest( ".ui-front" );
2428
+			return element;
2429
+		}
2430
+	} );
3098 2431
 }
3099 2432
 
3100
-		if ( !element.length ) {
3101
-			element = this.document[ 0 ].body;
2433
+$.extend( $.effects, {
2434
+	version: "1.13.2",
2435
+
2436
+	define: function( name, mode, effect ) {
2437
+		if ( !effect ) {
2438
+			effect = mode;
2439
+			mode = "effect";
3102 2440
 		}
3103 2441
 
3104
-		return element;
2442
+		$.effects.effect[ name ] = effect;
2443
+		$.effects.effect[ name ].mode = mode;
2444
+
2445
+		return effect;
3105 2446
 	},
3106 2447
 
3107
-	_initSource: function() {
3108
-		var array, url,
3109
-			that = this;
3110
-		if ( $.isArray( this.options.source ) ) {
3111
-			array = this.options.source;
3112
-			this.source = function( request, response ) {
3113
-				response( $.ui.autocomplete.filter( array, request.term ) );
2448
+	scaledDimensions: function( element, percent, direction ) {
2449
+		if ( percent === 0 ) {
2450
+			return {
2451
+				height: 0,
2452
+				width: 0,
2453
+				outerHeight: 0,
2454
+				outerWidth: 0
3114 2455
 			};
3115
-		} else if ( typeof this.options.source === "string" ) {
3116
-			url = this.options.source;
3117
-			this.source = function( request, response ) {
3118
-				if ( that.xhr ) {
3119
-					that.xhr.abort();
3120 2456
 		}
3121
-				that.xhr = $.ajax({
3122
-					url: url,
3123
-					data: request,
3124
-					dataType: "json",
3125
-					success: function( data ) {
3126
-						response( data );
2457
+
2458
+		var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1,
2459
+			y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1;
2460
+
2461
+		return {
2462
+			height: element.height() * y,
2463
+			width: element.width() * x,
2464
+			outerHeight: element.outerHeight() * y,
2465
+			outerWidth: element.outerWidth() * x
2466
+		};
2467
+
3127 2468
 	},
3128
-					error: function() {
3129
-						response([]);
3130
-					}
3131
-				});
2469
+
2470
+	clipToBox: function( animation ) {
2471
+		return {
2472
+			width: animation.clip.right - animation.clip.left,
2473
+			height: animation.clip.bottom - animation.clip.top,
2474
+			left: animation.clip.left,
2475
+			top: animation.clip.top
3132 2476
 		};
3133
-		} else {
3134
-			this.source = this.options.source;
2477
+	},
2478
+
2479
+	// Injects recently queued functions to be first in line (after "inprogress")
2480
+	unshift: function( element, queueLength, count ) {
2481
+		var queue = element.queue();
2482
+
2483
+		if ( queueLength > 1 ) {
2484
+			queue.splice.apply( queue,
2485
+				[ 1, 0 ].concat( queue.splice( queueLength, count ) ) );
3135 2486
 		}
2487
+		element.dequeue();
3136 2488
 	},
3137 2489
 
3138
-	_searchTimeout: function( event ) {
3139
-		clearTimeout( this.searching );
3140
-		this.searching = this._delay(function() {
2490
+	saveStyle: function( element ) {
2491
+		element.data( dataSpaceStyle, element[ 0 ].style.cssText );
2492
+	},
3141 2493
 
3142
-			// Search if the value has changed, or if the user retypes the same value (see #7434)
3143
-			var equalValues = this.term === this._value(),
3144
-				menuVisible = this.menu.element.is( ":visible" ),
3145
-				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
2494
+	restoreStyle: function( element ) {
2495
+		element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || "";
2496
+		element.removeData( dataSpaceStyle );
2497
+	},
3146 2498
 
3147
-			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
3148
-				this.selectedItem = null;
3149
-				this.search( null, event );
2499
+	mode: function( element, mode ) {
2500
+		var hidden = element.is( ":hidden" );
2501
+
2502
+		if ( mode === "toggle" ) {
2503
+			mode = hidden ? "show" : "hide";
3150 2504
 		}
3151
-		}, this.options.delay );
2505
+		if ( hidden ? mode === "hide" : mode === "show" ) {
2506
+			mode = "none";
2507
+		}
2508
+		return mode;
3152 2509
 	},
3153 2510
 
3154
-	search: function( value, event ) {
3155
-		value = value != null ? value : this._value();
3156
-
3157
-		// always save the actual value, not the one passed as an argument
3158
-		this.term = this._value();
2511
+	// Translates a [top,left] array into a baseline value
2512
+	getBaseline: function( origin, original ) {
2513
+		var y, x;
3159 2514
 
3160
-		if ( value.length < this.options.minLength ) {
3161
-			return this.close( event );
2515
+		switch ( origin[ 0 ] ) {
2516
+		case "top":
2517
+			y = 0;
2518
+			break;
2519
+		case "middle":
2520
+			y = 0.5;
2521
+			break;
2522
+		case "bottom":
2523
+			y = 1;
2524
+			break;
2525
+		default:
2526
+			y = origin[ 0 ] / original.height;
3162 2527
 		}
3163 2528
 
3164
-		if ( this._trigger( "search", event ) === false ) {
3165
-			return;
2529
+		switch ( origin[ 1 ] ) {
2530
+		case "left":
2531
+			x = 0;
2532
+			break;
2533
+		case "center":
2534
+			x = 0.5;
2535
+			break;
2536
+		case "right":
2537
+			x = 1;
2538
+			break;
2539
+		default:
2540
+			x = origin[ 1 ] / original.width;
3166 2541
 		}
3167 2542
 
3168
-		return this._search( value );
2543
+		return {
2544
+			x: x,
2545
+			y: y
2546
+		};
3169 2547
 	},
3170 2548
 
3171
-	_search: function( value ) {
3172
-		this.pending++;
3173
-		this.element.addClass( "ui-autocomplete-loading" );
3174
-		this.cancelSearch = false;
2549
+	// Creates a placeholder element so that the original element can be made absolute
2550
+	createPlaceholder: function( element ) {
2551
+		var placeholder,
2552
+			cssPosition = element.css( "position" ),
2553
+			position = element.position();
3175 2554
 
3176
-		this.source( { term: value }, this._response() );
3177
-	},
2555
+		// Lock in margins first to account for form elements, which
2556
+		// will change margin if you explicitly set height
2557
+		// see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380
2558
+		// Support: Safari
2559
+		element.css( {
2560
+			marginTop: element.css( "marginTop" ),
2561
+			marginBottom: element.css( "marginBottom" ),
2562
+			marginLeft: element.css( "marginLeft" ),
2563
+			marginRight: element.css( "marginRight" )
2564
+		} )
2565
+		.outerWidth( element.outerWidth() )
2566
+		.outerHeight( element.outerHeight() );
3178 2567
 
3179
-	_response: function() {
3180
-		var index = ++this.requestIndex;
2568
+		if ( /^(static|relative)/.test( cssPosition ) ) {
2569
+			cssPosition = "absolute";
3181 2570
 
3182
-		return $.proxy(function( content ) {
3183
-			if ( index === this.requestIndex ) {
3184
-				this.__response( content );
3185
-			}
2571
+			placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( {
3186 2572
 
3187
-			this.pending--;
3188
-			if ( !this.pending ) {
3189
-				this.element.removeClass( "ui-autocomplete-loading" );
3190
-			}
3191
-		}, this );
3192
-	},
2573
+				// Convert inline to inline block to account for inline elements
2574
+				// that turn to inline block based on content (like img)
2575
+				display: /^(inline|ruby)/.test( element.css( "display" ) ) ?
2576
+					"inline-block" :
2577
+					"block",
2578
+				visibility: "hidden",
3193 2579
 
3194
-	__response: function( content ) {
3195
-		if ( content ) {
3196
-			content = this._normalize( content );
3197
-		}
3198
-		this._trigger( "response", null, { content: content } );
3199
-		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
3200
-			this._suggest( content );
3201
-			this._trigger( "open" );
3202
-		} else {
3203
-			// use ._close() instead of .close() so we don't cancel future searches
3204
-			this._close();
2580
+				// Margins need to be set to account for margin collapse
2581
+				marginTop: element.css( "marginTop" ),
2582
+				marginBottom: element.css( "marginBottom" ),
2583
+				marginLeft: element.css( "marginLeft" ),
2584
+				marginRight: element.css( "marginRight" ),
2585
+				"float": element.css( "float" )
2586
+			} )
2587
+			.outerWidth( element.outerWidth() )
2588
+			.outerHeight( element.outerHeight() )
2589
+			.addClass( "ui-effects-placeholder" );
2590
+
2591
+			element.data( dataSpace + "placeholder", placeholder );
3205 2592
 		}
3206
-	},
3207 2593
 
3208
-	close: function( event ) {
3209
-		this.cancelSearch = true;
3210
-		this._close( event );
2594
+		element.css( {
2595
+			position: cssPosition,
2596
+			left: position.left,
2597
+			top: position.top
2598
+		} );
2599
+
2600
+		return placeholder;
3211 2601
 	},
3212 2602
 
3213
-	_close: function( event ) {
3214
-		if ( this.menu.element.is( ":visible" ) ) {
3215
-			this.menu.element.hide();
3216
-			this.menu.blur();
3217
-			this.isNewMenu = true;
3218
-			this._trigger( "close", event );
2603
+	removePlaceholder: function( element ) {
2604
+		var dataKey = dataSpace + "placeholder",
2605
+				placeholder = element.data( dataKey );
2606
+
2607
+		if ( placeholder ) {
2608
+			placeholder.remove();
2609
+			element.removeData( dataKey );
3219 2610
 		}
3220 2611
 	},
3221 2612
 
3222
-	_change: function( event ) {
3223
-		if ( this.previous !== this._value() ) {
3224
-			this._trigger( "change", event, { item: this.selectedItem } );
3225
-		}
2613
+	// Removes a placeholder if it exists and restores
2614
+	// properties that were modified during placeholder creation
2615
+	cleanUp: function( element ) {
2616
+		$.effects.restoreStyle( element );
2617
+		$.effects.removePlaceholder( element );
3226 2618
 	},
3227 2619
 
3228
-	_normalize: function( items ) {
3229
-		// assume all items have the right format when the first item is complete
3230
-		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
3231
-			return items;
3232
-		}
3233
-		return $.map( items, function( item ) {
3234
-			if ( typeof item === "string" ) {
3235
-				return {
3236
-					label: item,
3237
-					value: item
3238
-				};
2620
+	setTransition: function( element, list, factor, value ) {
2621
+		value = value || {};
2622
+		$.each( list, function( i, x ) {
2623
+			var unit = element.cssUnit( x );
2624
+			if ( unit[ 0 ] > 0 ) {
2625
+				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
3239 2626
 			}
3240
-			return $.extend( {}, item, {
3241
-				label: item.label || item.value,
3242
-				value: item.value || item.label
3243 2627
 		} );
2628
+		return value;
2629
+	}
3244 2630
 } );
3245
-	},
3246
-
3247
-	_suggest: function( items ) {
3248
-		var ul = this.menu.element.empty();
3249
-		this._renderMenu( ul, items );
3250
-		this.isNewMenu = true;
3251
-		this.menu.refresh();
3252 2631
 
3253
-		// size and position menu
3254
-		ul.show();
3255
-		this._resizeMenu();
3256
-		ul.position( $.extend({
3257
-			of: this.element
3258
-		}, this.options.position ) );
2632
+// Return an effect options object for the given parameters:
2633
+function _normalizeArguments( effect, options, speed, callback ) {
3259 2634
 
3260
-		if ( this.options.autoFocus ) {
3261
-			this.menu.next();
2635
+	// Allow passing all options as the first parameter
2636
+	if ( $.isPlainObject( effect ) ) {
2637
+		options = effect;
2638
+		effect = effect.effect;
3262 2639
 	}
3263
-	},
3264
-
3265
-	_resizeMenu: function() {
3266
-		var ul = this.menu.element;
3267
-		ul.outerWidth( Math.max(
3268
-			// Firefox wraps long text (possibly a rounding bug)
3269
-			// so we add 1px to avoid the wrapping (#7513)
3270
-			ul.width( "" ).outerWidth() + 1,
3271
-			this.element.outerWidth()
3272
-		) );
3273
-	},
3274
-
3275
-	_renderMenu: function( ul, items ) {
3276
-		var that = this;
3277
-		$.each( items, function( index, item ) {
3278
-			that._renderItemData( ul, item );
3279
-		});
3280
-	},
3281 2640
 
3282
-	_renderItemData: function( ul, item ) {
3283
-		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
3284
-	},
2641
+	// Convert to an object
2642
+	effect = { effect: effect };
3285 2643
 
3286
-	_renderItem: function( ul, item ) {
3287
-		return $( "<li>" ).text( item.label ).appendTo( ul );
3288
-	},
2644
+	// Catch (effect, null, ...)
2645
+	if ( options == null ) {
2646
+		options = {};
2647
+	}
3289 2648
 
3290
-	_move: function( direction, event ) {
3291
-		if ( !this.menu.element.is( ":visible" ) ) {
3292
-			this.search( null, event );
3293
-			return;
2649
+	// Catch (effect, callback)
2650
+	if ( typeof options === "function" ) {
2651
+		callback = options;
2652
+		speed = null;
2653
+		options = {};
3294 2654
 	}
3295
-		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
3296
-				this.menu.isLastItem() && /^next/.test( direction ) ) {
3297 2655
 
3298
-			if ( !this.isMultiLine ) {
3299
-				this._value( this.term );
2656
+	// Catch (effect, speed, ?)
2657
+	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
2658
+		callback = speed;
2659
+		speed = options;
2660
+		options = {};
3300 2661
 	}
3301 2662
 
3302
-			this.menu.blur();
3303
-			return;
2663
+	// Catch (effect, options, callback)
2664
+	if ( typeof speed === "function" ) {
2665
+		callback = speed;
2666
+		speed = null;
3304 2667
 	}
3305
-		this.menu[ direction ]( event );
3306
-	},
3307 2668
 
3308
-	widget: function() {
3309
-		return this.menu.element;
3310
-	},
2669
+	// Add options to effect
2670
+	if ( options ) {
2671
+		$.extend( effect, options );
2672
+	}
3311 2673
 
3312
-	_value: function() {
3313
-		return this.valueMethod.apply( this.element, arguments );
3314
-	},
2674
+	speed = speed || options.duration;
2675
+	effect.duration = $.fx.off ? 0 :
2676
+		typeof speed === "number" ? speed :
2677
+		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
2678
+		$.fx.speeds._default;
3315 2679
 
3316
-	_keyEvent: function( keyEvent, event ) {
3317
-		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
3318
-			this._move( keyEvent, event );
2680
+	effect.complete = callback || options.complete;
3319 2681
 
3320
-			// prevents moving cursor to beginning/end of the text field in some browsers
3321
-			event.preventDefault();
3322
-		}
2682
+	return effect;
3323 2683
 }
3324
-});
3325 2684
 
3326
-$.extend( $.ui.autocomplete, {
3327
-	escapeRegex: function( value ) {
3328
-		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
3329
-	},
3330
-	filter: function( array, term ) {
3331
-		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
3332
-		return $.grep( array, function( value ) {
3333
-			return matcher.test( value.label || value.value || value );
3334
-		});
3335
-	}
3336
-});
2685
+function standardAnimationOption( option ) {
3337 2686
 
3338
-// live region extension, adding a `messages` option
3339
-// NOTE: This is an experimental API. We are still investigating
3340
-// a full solution for string manipulation and internationalization.
3341
-$.widget( "ui.autocomplete", $.ui.autocomplete, {
3342
-	options: {
3343
-		messages: {
3344
-			noResults: "No search results.",
3345
-			results: function( amount ) {
3346
-				return amount + ( amount > 1 ? " results are" : " result is" ) +
3347
-					" available, use up and down arrow keys to navigate.";
2687
+	// Valid standard speeds (nothing, number, named speed)
2688
+	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
2689
+		return true;
3348 2690
 	}
2691
+
2692
+	// Invalid strings - treat as "normal" speed
2693
+	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
2694
+		return true;
3349 2695
 	}
3350
-	},
3351 2696
 
3352
-	__response: function( content ) {
3353
-		var message;
3354
-		this._superApply( arguments );
3355
-		if ( this.options.disabled || this.cancelSearch ) {
3356
-			return;
2697
+	// Complete callback
2698
+	if ( typeof option === "function" ) {
2699
+		return true;
3357 2700
 	}
3358
-		if ( content && content.length ) {
3359
-			message = this.options.messages.results( content.length );
3360
-		} else {
3361
-			message = this.options.messages.noResults;
2701
+
2702
+	// Options hash (but not naming an effect)
2703
+	if ( typeof option === "object" && !option.effect ) {
2704
+		return true;
3362 2705
 	}
3363
-		this.liveRegion.children().hide();
3364
-		$( "<div>" ).text( message ).appendTo( this.liveRegion );
2706
+
2707
+	// Didn't match any standard API
2708
+	return false;
3365 2709
 }
3366
-});
3367 2710
 
3368
-var autocomplete = $.ui.autocomplete;
2711
+$.fn.extend( {
2712
+	effect: function( /* effect, options, speed, callback */ ) {
2713
+		var args = _normalizeArguments.apply( this, arguments ),
2714
+			effectMethod = $.effects.effect[ args.effect ],
2715
+			defaultMode = effectMethod.mode,
2716
+			queue = args.queue,
2717
+			queueName = queue || "fx",
2718
+			complete = args.complete,
2719
+			mode = args.mode,
2720
+			modes = [],
2721
+			prefilter = function( next ) {
2722
+				var el = $( this ),
2723
+					normalizedMode = $.effects.mode( el, mode ) || defaultMode;
3369 2724
 
2725
+				// Sentinel for duck-punching the :animated pseudo-selector
2726
+				el.data( dataSpaceAnimated, true );
3370 2727
 
3371
-/*!
3372
- * jQuery UI Button 1.11.4
3373
- * http://jqueryui.com
3374
- *
3375
- * Copyright jQuery Foundation and other contributors
3376
- * Released under the MIT license.
3377
- * http://jquery.org/license
3378
- *
3379
- * http://api.jqueryui.com/button/
3380
- */
2728
+				// Save effect mode for later use,
2729
+				// we can't just call $.effects.mode again later,
2730
+				// as the .show() below destroys the initial state
2731
+				modes.push( normalizedMode );
3381 2732
 
2733
+				// See $.uiBackCompat inside of run() for removal of defaultMode in 1.14
2734
+				if ( defaultMode && ( normalizedMode === "show" ||
2735
+						( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) {
2736
+					el.show();
2737
+				}
3382 2738
 
3383
-var lastActive,
3384
-	baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
3385
-	typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
3386
-	formResetHandler = function() {
3387
-		var form = $( this );
3388
-		setTimeout(function() {
3389
-			form.find( ":ui-button" ).button( "refresh" );
3390
-		}, 1 );
3391
-	},
3392
-	radioGroup = function( radio ) {
3393
-		var name = radio.name,
3394
-			form = radio.form,
3395
-			radios = $( [] );
3396
-		if ( name ) {
3397
-			name = name.replace( /'/g, "\\'" );
3398
-			if ( form ) {
3399
-				radios = $( form ).find( "[name='" + name + "'][type=radio]" );
3400
-			} else {
3401
-				radios = $( "[name='" + name + "'][type=radio]", radio.ownerDocument )
3402
-					.filter(function() {
3403
-						return !this.form;
3404
-					});
2739
+				if ( !defaultMode || normalizedMode !== "none" ) {
2740
+					$.effects.saveStyle( el );
3405 2741
 				}
2742
+
2743
+				if ( typeof next === "function" ) {
2744
+					next();
3406 2745
 				}
3407
-		return radios;
3408 2746
 			};
3409 2747
 
3410
-$.widget( "ui.button", {
3411
-	version: "1.11.4",
3412
-	defaultElement: "<button>",
3413
-	options: {
3414
-		disabled: null,
3415
-		text: true,
3416
-		label: null,
3417
-		icons: {
3418
-			primary: null,
3419
-			secondary: null
3420
-		}
3421
-	},
3422
-	_create: function() {
3423
-		this.element.closest( "form" )
3424
-			.unbind( "reset" + this.eventNamespace )
3425
-			.bind( "reset" + this.eventNamespace, formResetHandler );
2748
+		if ( $.fx.off || !effectMethod ) {
3426 2749
 
3427
-		if ( typeof this.options.disabled !== "boolean" ) {
3428
-			this.options.disabled = !!this.element.prop( "disabled" );
2750
+			// Delegate to the original method (e.g., .show()) if possible
2751
+			if ( mode ) {
2752
+				return this[ mode ]( args.duration, complete );
3429 2753
 			} else {
3430
-			this.element.prop( "disabled", this.options.disabled );
2754
+				return this.each( function() {
2755
+					if ( complete ) {
2756
+						complete.call( this );
2757
+					}
2758
+				} );
2759
+			}
3431 2760
 		}
3432 2761
 
3433
-		this._determineButtonType();
3434
-		this.hasTitle = !!this.buttonElement.attr( "title" );
3435
-
3436
-		var that = this,
3437
-			options = this.options,
3438
-			toggleButton = this.type === "checkbox" || this.type === "radio",
3439
-			activeClass = !toggleButton ? "ui-state-active" : "";
2762
+		function run( next ) {
2763
+			var elem = $( this );
3440 2764
 
3441
-		if ( options.label === null ) {
3442
-			options.label = (this.type === "input" ? this.buttonElement.val() : this.buttonElement.html());
3443
-		}
2765
+			function cleanup() {
2766
+				elem.removeData( dataSpaceAnimated );
3444 2767
 
3445
-		this._hoverable( this.buttonElement );
2768
+				$.effects.cleanUp( elem );
3446 2769
 
3447
-		this.buttonElement
3448
-			.addClass( baseClasses )
3449
-			.attr( "role", "button" )
3450
-			.bind( "mouseenter" + this.eventNamespace, function() {
3451
-				if ( options.disabled ) {
3452
-					return;
3453
-				}
3454
-				if ( this === lastActive ) {
3455
-					$( this ).addClass( "ui-state-active" );
3456
-				}
3457
-			})
3458
-			.bind( "mouseleave" + this.eventNamespace, function() {
3459
-				if ( options.disabled ) {
3460
-					return;
3461
-				}
3462
-				$( this ).removeClass( activeClass );
3463
-			})
3464
-			.bind( "click" + this.eventNamespace, function( event ) {
3465
-				if ( options.disabled ) {
3466
-					event.preventDefault();
3467
-					event.stopImmediatePropagation();
2770
+				if ( args.mode === "hide" ) {
2771
+					elem.hide();
3468 2772
 				}
3469
-			});
3470 2773
 
3471
-		// Can't use _focusable() because the element that receives focus
3472
-		// and the element that gets the ui-state-focus class are different
3473
-		this._on({
3474
-			focus: function() {
3475
-				this.buttonElement.addClass( "ui-state-focus" );
3476
-			},
3477
-			blur: function() {
3478
-				this.buttonElement.removeClass( "ui-state-focus" );
2774
+				done();
3479 2775
 			}
3480
-		});
3481 2776
 
3482
-		if ( toggleButton ) {
3483
-			this.element.bind( "change" + this.eventNamespace, function() {
3484
-				that.refresh();
3485
-			});
2777
+			function done() {
2778
+				if ( typeof complete === "function" ) {
2779
+					complete.call( elem[ 0 ] );
3486 2780
 				}
3487 2781
 
3488
-		if ( this.type === "checkbox" ) {
3489
-			this.buttonElement.bind( "click" + this.eventNamespace, function() {
3490
-				if ( options.disabled ) {
3491
-					return false;
2782
+				if ( typeof next === "function" ) {
2783
+					next();
3492 2784
 				}
3493
-			});
3494
-		} else if ( this.type === "radio" ) {
3495
-			this.buttonElement.bind( "click" + this.eventNamespace, function() {
3496
-				if ( options.disabled ) {
3497
-					return false;
3498 2785
 			}
3499
-				$( this ).addClass( "ui-state-active" );
3500
-				that.buttonElement.attr( "aria-pressed", "true" );
3501 2786
 
3502
-				var radio = that.element[ 0 ];
3503
-				radioGroup( radio )
3504
-					.not( radio )
3505
-					.map(function() {
3506
-						return $( this ).button( "widget" )[ 0 ];
3507
-					})
3508
-					.removeClass( "ui-state-active" )
3509
-					.attr( "aria-pressed", "false" );
3510
-			});
2787
+			// Override mode option on a per element basis,
2788
+			// as toggle can be either show or hide depending on element state
2789
+			args.mode = modes.shift();
2790
+
2791
+			if ( $.uiBackCompat !== false && !defaultMode ) {
2792
+				if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
2793
+
2794
+					// Call the core method to track "olddisplay" properly
2795
+					elem[ mode ]();
2796
+					done();
3511 2797
 				} else {
3512
-			this.buttonElement
3513
-				.bind( "mousedown" + this.eventNamespace, function() {
3514
-					if ( options.disabled ) {
3515
-						return false;
2798
+					effectMethod.call( elem[ 0 ], args, done );
3516 2799
 				}
3517
-					$( this ).addClass( "ui-state-active" );
3518
-					lastActive = this;
3519
-					that.document.one( "mouseup", function() {
3520
-						lastActive = null;
3521
-					});
3522
-				})
3523
-				.bind( "mouseup" + this.eventNamespace, function() {
3524
-					if ( options.disabled ) {
3525
-						return false;
2800
+			} else {
2801
+				if ( args.mode === "none" ) {
2802
+
2803
+					// Call the core method to track "olddisplay" properly
2804
+					elem[ mode ]();
2805
+					done();
2806
+				} else {
2807
+					effectMethod.call( elem[ 0 ], args, cleanup );
3526 2808
 				}
3527
-					$( this ).removeClass( "ui-state-active" );
3528
-				})
3529
-				.bind( "keydown" + this.eventNamespace, function(event) {
3530
-					if ( options.disabled ) {
3531
-						return false;
3532
-					}
3533
-					if ( event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER ) {
3534
-						$( this ).addClass( "ui-state-active" );
3535
-					}
3536
-				})
3537
-				// see #8559, we bind to blur here in case the button element loses
3538
-				// focus between keydown and keyup, it would be left in an "active" state
3539
-				.bind( "keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
3540
-					$( this ).removeClass( "ui-state-active" );
3541
-				});
3542
-
3543
-			if ( this.buttonElement.is("a") ) {
3544
-				this.buttonElement.keyup(function(event) {
3545
-					if ( event.keyCode === $.ui.keyCode.SPACE ) {
3546
-						// TODO pass through original event correctly (just as 2nd argument doesn't work)
3547
-						$( this ).click();
3548
-					}
3549
-				});
3550 2809
 			}
3551 2810
 		}
3552 2811
 
3553
-		this._setOption( "disabled", options.disabled );
3554
-		this._resetButton();
2812
+		// Run prefilter on all elements first to ensure that
2813
+		// any showing or hiding happens before placeholder creation,
2814
+		// which ensures that any layout changes are correctly captured.
2815
+		return queue === false ?
2816
+			this.each( prefilter ).each( run ) :
2817
+			this.queue( queueName, prefilter ).queue( queueName, run );
3555 2818
 	},
3556 2819
 
3557
-	_determineButtonType: function() {
3558
-		var ancestor, labelSelector, checked;
3559
-
3560
-		if ( this.element.is("[type=checkbox]") ) {
3561
-			this.type = "checkbox";
3562
-		} else if ( this.element.is("[type=radio]") ) {
3563
-			this.type = "radio";
3564
-		} else if ( this.element.is("input") ) {
3565
-			this.type = "input";
2820
+	show: ( function( orig ) {
2821
+		return function( option ) {
2822
+			if ( standardAnimationOption( option ) ) {
2823
+				return orig.apply( this, arguments );
3566 2824
 			} else {
3567
-			this.type = "button";
2825
+				var args = _normalizeArguments.apply( this, arguments );
2826
+				args.mode = "show";
2827
+				return this.effect.call( this, args );
3568 2828
 			}
2829
+		};
2830
+	} )( $.fn.show ),
3569 2831
 
3570
-		if ( this.type === "checkbox" || this.type === "radio" ) {
3571
-			// we don't search against the document in case the element
3572
-			// is disconnected from the DOM
3573
-			ancestor = this.element.parents().last();
3574
-			labelSelector = "label[for='" + this.element.attr("id") + "']";
3575
-			this.buttonElement = ancestor.find( labelSelector );
3576
-			if ( !this.buttonElement.length ) {
3577
-				ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
3578
-				this.buttonElement = ancestor.filter( labelSelector );
3579
-				if ( !this.buttonElement.length ) {
3580
-					this.buttonElement = ancestor.find( labelSelector );
3581
-				}
2832
+	hide: ( function( orig ) {
2833
+		return function( option ) {
2834
+			if ( standardAnimationOption( option ) ) {
2835
+				return orig.apply( this, arguments );
2836
+			} else {
2837
+				var args = _normalizeArguments.apply( this, arguments );
2838
+				args.mode = "hide";
2839
+				return this.effect.call( this, args );
3582 2840
 			}
3583
-			this.element.addClass( "ui-helper-hidden-accessible" );
2841
+		};
2842
+	} )( $.fn.hide ),
3584 2843
 
3585
-			checked = this.element.is( ":checked" );
3586
-			if ( checked ) {
3587
-				this.buttonElement.addClass( "ui-state-active" );
3588
-			}
3589
-			this.buttonElement.prop( "aria-pressed", checked );
2844
+	toggle: ( function( orig ) {
2845
+		return function( option ) {
2846
+			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
2847
+				return orig.apply( this, arguments );
3590 2848
 			} else {
3591
-			this.buttonElement = this.element;
2849
+				var args = _normalizeArguments.apply( this, arguments );
2850
+				args.mode = "toggle";
2851
+				return this.effect.call( this, args );
3592 2852
 			}
3593
-	},
3594
-
3595
-	widget: function() {
3596
-		return this.buttonElement;
3597
-	},
2853
+		};
2854
+	} )( $.fn.toggle ),
3598 2855
 
3599
-	_destroy: function() {
3600
-		this.element
3601
-			.removeClass( "ui-helper-hidden-accessible" );
3602
-		this.buttonElement
3603
-			.removeClass( baseClasses + " ui-state-active " + typeClasses )
3604
-			.removeAttr( "role" )
3605
-			.removeAttr( "aria-pressed" )
3606
-			.html( this.buttonElement.find(".ui-button-text").html() );
2856
+	cssUnit: function( key ) {
2857
+		var style = this.css( key ),
2858
+			val = [];
3607 2859
 
3608
-		if ( !this.hasTitle ) {
3609
-			this.buttonElement.removeAttr( "title" );
2860
+		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
2861
+			if ( style.indexOf( unit ) > 0 ) {
2862
+				val = [ parseFloat( style ), unit ];
3610 2863
 			}
2864
+		} );
2865
+		return val;
3611 2866
 	},
3612 2867
 
3613
-	_setOption: function( key, value ) {
3614
-		this._super( key, value );
3615
-		if ( key === "disabled" ) {
3616
-			this.widget().toggleClass( "ui-state-disabled", !!value );
3617
-			this.element.prop( "disabled", !!value );
3618
-			if ( value ) {
3619
-				if ( this.type === "checkbox" || this.type === "radio" ) {
3620
-					this.buttonElement.removeClass( "ui-state-focus" );
3621
-				} else {
3622
-					this.buttonElement.removeClass( "ui-state-focus ui-state-active" );
3623
-				}
2868
+	cssClip: function( clipObj ) {
2869
+		if ( clipObj ) {
2870
+			return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " +
2871
+				clipObj.bottom + "px " + clipObj.left + "px)" );
3624 2872
 		}
3625
-			return;
3626
-		}
3627
-		this._resetButton();
2873
+		return parseClip( this.css( "clip" ), this );
3628 2874
 	},
3629 2875
 
3630
-	refresh: function() {
3631
-		//See #8237 & #8828
3632
-		var isDisabled = this.element.is( "input, button" ) ? this.element.is( ":disabled" ) : this.element.hasClass( "ui-button-disabled" );
2876
+	transfer: function( options, done ) {
2877
+		var element = $( this ),
2878
+			target = $( options.to ),
2879
+			targetFixed = target.css( "position" ) === "fixed",
2880
+			body = $( "body" ),
2881
+			fixTop = targetFixed ? body.scrollTop() : 0,
2882
+			fixLeft = targetFixed ? body.scrollLeft() : 0,
2883
+			endPosition = target.offset(),
2884
+			animation = {
2885
+				top: endPosition.top - fixTop,
2886
+				left: endPosition.left - fixLeft,
2887
+				height: target.innerHeight(),
2888
+				width: target.innerWidth()
2889
+			},
2890
+			startPosition = element.offset(),
2891
+			transfer = $( "<div class='ui-effects-transfer'></div>" );
3633 2892
 
3634
-		if ( isDisabled !== this.options.disabled ) {
3635
-			this._setOption( "disabled", isDisabled );
3636
-		}
3637
-		if ( this.type === "radio" ) {
3638
-			radioGroup( this.element[0] ).each(function() {
3639
-				if ( $( this ).is( ":checked" ) ) {
3640
-					$( this ).button( "widget" )
3641
-						.addClass( "ui-state-active" )
3642
-						.attr( "aria-pressed", "true" );
3643
-				} else {
3644
-					$( this ).button( "widget" )
3645
-						.removeClass( "ui-state-active" )
3646
-						.attr( "aria-pressed", "false" );
2893
+		transfer
2894
+			.appendTo( "body" )
2895
+			.addClass( options.className )
2896
+			.css( {
2897
+				top: startPosition.top - fixTop,
2898
+				left: startPosition.left - fixLeft,
2899
+				height: element.innerHeight(),
2900
+				width: element.innerWidth(),
2901
+				position: targetFixed ? "fixed" : "absolute"
2902
+			} )
2903
+			.animate( animation, options.duration, options.easing, function() {
2904
+				transfer.remove();
2905
+				if ( typeof done === "function" ) {
2906
+					done();
3647 2907
 				}
3648 2908
 			} );
3649
-		} else if ( this.type === "checkbox" ) {
3650
-			if ( this.element.is( ":checked" ) ) {
3651
-				this.buttonElement
3652
-					.addClass( "ui-state-active" )
3653
-					.attr( "aria-pressed", "true" );
3654
-			} else {
3655
-				this.buttonElement
3656
-					.removeClass( "ui-state-active" )
3657
-					.attr( "aria-pressed", "false" );
3658 2909
 	}
2910
+} );
2911
+
2912
+function parseClip( str, element ) {
2913
+		var outerWidth = element.outerWidth(),
2914
+			outerHeight = element.outerHeight(),
2915
+			clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,
2916
+			values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ];
2917
+
2918
+		return {
2919
+			top: parseFloat( values[ 1 ] ) || 0,
2920
+			right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ),
2921
+			bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ),
2922
+			left: parseFloat( values[ 4 ] ) || 0
2923
+		};
3659 2924
 }
3660
-	},
3661 2925
 
3662
-	_resetButton: function() {
3663
-		if ( this.type === "input" ) {
3664
-			if ( this.options.label ) {
3665
-				this.element.val( this.options.label );
2926
+$.fx.step.clip = function( fx ) {
2927
+	if ( !fx.clipInit ) {
2928
+		fx.start = $( fx.elem ).cssClip();
2929
+		if ( typeof fx.end === "string" ) {
2930
+			fx.end = parseClip( fx.end, fx.elem );
3666 2931
 		}
3667
-			return;
2932
+		fx.clipInit = true;
3668 2933
 	}
3669
-		var buttonElement = this.buttonElement.removeClass( typeClasses ),
3670
-			buttonText = $( "<span></span>", this.document[0] )
3671
-				.addClass( "ui-button-text" )
3672
-				.html( this.options.label )
3673
-				.appendTo( buttonElement.empty() )
3674
-				.text(),
3675
-			icons = this.options.icons,
3676
-			multipleIcons = icons.primary && icons.secondary,
3677
-			buttonClasses = [];
3678 2934
 
3679
-		if ( icons.primary || icons.secondary ) {
3680
-			if ( this.options.text ) {
3681
-				buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
3682
-			}
2935
+	$( fx.elem ).cssClip( {
2936
+		top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top,
2937
+		right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right,
2938
+		bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom,
2939
+		left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left
2940
+	} );
2941
+};
3683 2942
 
3684
-			if ( icons.primary ) {
3685
-				buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
3686
-			}
2943
+} )();
3687 2944
 
3688
-			if ( icons.secondary ) {
3689
-				buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
3690
-			}
2945
+/******************************************************************************/
2946
+/*********************************** EASING ***********************************/
2947
+/******************************************************************************/
3691 2948
 
3692
-			if ( !this.options.text ) {
3693
-				buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
2949
+( function() {
3694 2950
 
3695
-				if ( !this.hasTitle ) {
3696
-					buttonElement.attr( "title", $.trim( buttonText ) );
3697
-				}
3698
-			}
3699
-		} else {
3700
-			buttonClasses.push( "ui-button-text-only" );
3701
-		}
3702
-		buttonElement.addClass( buttonClasses.join( " " ) );
3703
-	}
2951
+// Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
2952
+
2953
+var baseEasings = {};
2954
+
2955
+$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
2956
+	baseEasings[ name ] = function( p ) {
2957
+		return Math.pow( p, i + 2 );
2958
+	};
3704 2959
 } );
3705 2960
 
3706
-$.widget( "ui.buttonset", {
3707
-	version: "1.11.4",
3708
-	options: {
3709
-		items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
2961
+$.extend( baseEasings, {
2962
+	Sine: function( p ) {
2963
+		return 1 - Math.cos( p * Math.PI / 2 );
3710 2964
 	},
3711
-
3712
-	_create: function() {
3713
-		this.element.addClass( "ui-buttonset" );
2965
+	Circ: function( p ) {
2966
+		return 1 - Math.sqrt( 1 - p * p );
3714 2967
 	},
3715
-
3716
-	_init: function() {
3717
-		this.refresh();
2968
+	Elastic: function( p ) {
2969
+		return p === 0 || p === 1 ? p :
2970
+			-Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 );
3718 2971
 	},
2972
+	Back: function( p ) {
2973
+		return p * p * ( 3 * p - 2 );
2974
+	},
2975
+	Bounce: function( p ) {
2976
+		var pow2,
2977
+			bounce = 4;
3719 2978
 
3720
-	_setOption: function( key, value ) {
3721
-		if ( key === "disabled" ) {
3722
-			this.buttons.button( "option", key, value );
2979
+		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
2980
+		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
3723 2981
 	}
2982
+} );
3724 2983
 
3725
-		this._super( key, value );
3726
-	},
2984
+$.each( baseEasings, function( name, easeIn ) {
2985
+	$.easing[ "easeIn" + name ] = easeIn;
2986
+	$.easing[ "easeOut" + name ] = function( p ) {
2987
+		return 1 - easeIn( 1 - p );
2988
+	};
2989
+	$.easing[ "easeInOut" + name ] = function( p ) {
2990
+		return p < 0.5 ?
2991
+			easeIn( p * 2 ) / 2 :
2992
+			1 - easeIn( p * -2 + 2 ) / 2;
2993
+	};
2994
+} );
3727 2995
 
3728
-	refresh: function() {
3729
-		var rtl = this.element.css( "direction" ) === "rtl",
3730
-			allButtons = this.element.find( this.options.items ),
3731
-			existingButtons = allButtons.filter( ":ui-button" );
2996
+} )();
3732 2997
 
3733
-		// Initialize new buttons
3734
-		allButtons.not( ":ui-button" ).button();
2998
+var effect = $.effects;
3735 2999
 
3736
-		// Refresh existing buttons
3737
-		existingButtons.button( "refresh" );
3738 3000
 
3739
-		this.buttons = allButtons
3740
-			.map(function() {
3741
-				return $( this ).button( "widget" )[ 0 ];
3742
-			})
3743
-				.removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
3744
-				.filter( ":first" )
3745
-					.addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
3746
-				.end()
3747
-				.filter( ":last" )
3748
-					.addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
3749
-				.end()
3750
-			.end();
3001
+/*!
3002
+ * jQuery UI Effects Blind 1.13.2
3003
+ * http://jqueryui.com
3004
+ *
3005
+ * Copyright jQuery Foundation and other contributors
3006
+ * Released under the MIT license.
3007
+ * http://jquery.org/license
3008
+ */
3009
+
3010
+//>>label: Blind Effect
3011
+//>>group: Effects
3012
+//>>description: Blinds the element.
3013
+//>>docs: http://api.jqueryui.com/blind-effect/
3014
+//>>demos: http://jqueryui.com/effect/
3015
+
3016
+
3017
+var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) {
3018
+	var map = {
3019
+			up: [ "bottom", "top" ],
3020
+			vertical: [ "bottom", "top" ],
3021
+			down: [ "top", "bottom" ],
3022
+			left: [ "right", "left" ],
3023
+			horizontal: [ "right", "left" ],
3024
+			right: [ "left", "right" ]
3751 3025
 		},
3026
+		element = $( this ),
3027
+		direction = options.direction || "up",
3028
+		start = element.cssClip(),
3029
+		animate = { clip: $.extend( {}, start ) },
3030
+		placeholder = $.effects.createPlaceholder( element );
3752 3031
 
3753
-	_destroy: function() {
3754
-		this.element.removeClass( "ui-buttonset" );
3755
-		this.buttons
3756
-			.map(function() {
3757
-				return $( this ).button( "widget" )[ 0 ];
3758
-			})
3759
-				.removeClass( "ui-corner-left ui-corner-right" )
3760
-			.end()
3761
-			.button( "destroy" );
3032
+	animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ];
3033
+
3034
+	if ( options.mode === "show" ) {
3035
+		element.cssClip( animate.clip );
3036
+		if ( placeholder ) {
3037
+			placeholder.css( $.effects.clipToBox( animate ) );
3038
+		}
3039
+
3040
+		animate.clip = start;
3762 3041
 	}
3763
-});
3764 3042
 
3765
-var button = $.ui.button;
3043
+	if ( placeholder ) {
3044
+		placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing );
3045
+	}
3046
+
3047
+	element.animate( animate, {
3048
+		queue: false,
3049
+		duration: options.duration,
3050
+		easing: options.easing,
3051
+		complete: done
3052
+	} );
3053
+} );
3766 3054
 
3767 3055
 
3768 3056
 /*!
3769
- * jQuery UI Datepicker 1.11.4
3057
+ * jQuery UI Effects Bounce 1.13.2
3770 3058
  * http://jqueryui.com
3771 3059
  *
3772 3060
  * Copyright jQuery Foundation and other contributors
3773 3061
  * Released under the MIT license.
3774 3062
  * http://jquery.org/license
3775
- *
3776
- * http://api.jqueryui.com/datepicker/
3777 3063
  */
3778 3064
 
3065
+//>>label: Bounce Effect
3066
+//>>group: Effects
3067
+//>>description: Bounces an element horizontally or vertically n times.
3068
+//>>docs: http://api.jqueryui.com/bounce-effect/
3069
+//>>demos: http://jqueryui.com/effect/
3779 3070
 
3780
-$.extend($.ui, { datepicker: { version: "1.11.4" } });
3781 3071
 
3782
-var datepicker_instActive;
3072
+var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) {
3073
+	var upAnim, downAnim, refValue,
3074
+		element = $( this ),
3783 3075
 
3784
-function datepicker_getZindex( elem ) {
3785
-	var position, value;
3786
-	while ( elem.length && elem[ 0 ] !== document ) {
3787
-		// Ignore z-index if position is set to a value where z-index is ignored by the browser
3788
-		// This makes behavior of this function consistent across browsers
3789
-		// WebKit always returns auto if the element is positioned
3790
-		position = elem.css( "position" );
3791
-		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
3792
-			// IE returns 0 when zIndex is not specified
3793
-			// other browsers return a string
3794
-			// we ignore the case of nested elements with an explicit value of 0
3795
-			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
3796
-			value = parseInt( elem.css( "zIndex" ), 10 );
3797
-			if ( !isNaN( value ) && value !== 0 ) {
3798
-				return value;
3076
+		// Defaults:
3077
+		mode = options.mode,
3078
+		hide = mode === "hide",
3079
+		show = mode === "show",
3080
+		direction = options.direction || "up",
3081
+		distance = options.distance,
3082
+		times = options.times || 5,
3083
+
3084
+		// Number of internal animations
3085
+		anims = times * 2 + ( show || hide ? 1 : 0 ),
3086
+		speed = options.duration / anims,
3087
+		easing = options.easing,
3088
+
3089
+		// Utility:
3090
+		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3091
+		motion = ( direction === "up" || direction === "left" ),
3092
+		i = 0,
3093
+
3094
+		queuelen = element.queue().length;
3095
+
3096
+	$.effects.createPlaceholder( element );
3097
+
3098
+	refValue = element.css( ref );
3099
+
3100
+	// Default distance for the BIGGEST bounce is the outer Distance / 3
3101
+	if ( !distance ) {
3102
+		distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
3799 3103
 	}
3104
+
3105
+	if ( show ) {
3106
+		downAnim = { opacity: 1 };
3107
+		downAnim[ ref ] = refValue;
3108
+
3109
+		// If we are showing, force opacity 0 and set the initial position
3110
+		// then do the "first" animation
3111
+		element
3112
+			.css( "opacity", 0 )
3113
+			.css( ref, motion ? -distance * 2 : distance * 2 )
3114
+			.animate( downAnim, speed, easing );
3800 3115
 	}
3801
-		elem = elem.parent();
3116
+
3117
+	// Start at the smallest distance if we are hiding
3118
+	if ( hide ) {
3119
+		distance = distance / Math.pow( 2, times - 1 );
3802 3120
 	}
3803 3121
 
3804
-	return 0;
3122
+	downAnim = {};
3123
+	downAnim[ ref ] = refValue;
3124
+
3125
+	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
3126
+	for ( ; i < times; i++ ) {
3127
+		upAnim = {};
3128
+		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
3129
+
3130
+		element
3131
+			.animate( upAnim, speed, easing )
3132
+			.animate( downAnim, speed, easing );
3133
+
3134
+		distance = hide ? distance * 2 : distance / 2;
3805 3135
 	}
3806
-/* Date picker manager.
3807
-   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
3808
-   Settings for (groups of) date pickers are maintained in an instance object,
3809
-   allowing multiple different settings on the same page. */
3810 3136
 
3811
-function Datepicker() {
3812
-	this._curInst = null; // The current instance in use
3813
-	this._keyEvent = false; // If the last event was a key event
3814
-	this._disabledInputs = []; // List of date picker inputs that have been disabled
3815
-	this._datepickerShowing = false; // True if the popup picker is showing , false if not
3816
-	this._inDialog = false; // True if showing within a "dialog", false if not
3817
-	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
3818
-	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
3819
-	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
3820
-	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
3821
-	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
3822
-	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
3823
-	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
3824
-	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
3825
-	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
3826
-	this.regional = []; // Available regional settings, indexed by language code
3827
-	this.regional[""] = { // Default regional settings
3828
-		closeText: "Done", // Display text for close link
3829
-		prevText: "Prev", // Display text for previous month link
3830
-		nextText: "Next", // Display text for next month link
3831
-		currentText: "Today", // Display text for current month link
3832
-		monthNames: ["January","February","March","April","May","June",
3833
-			"July","August","September","October","November","December"], // Names of months for drop-down and formatting
3834
-		monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting
3835
-		dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting
3836
-		dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting
3837
-		dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday
3838
-		weekHeader: "Wk", // Column header for week of the year
3839
-		dateFormat: "mm/dd/yy", // See format options on parseDate
3840
-		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
3841
-		isRTL: false, // True if right-to-left language, false if left-to-right
3842
-		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
3843
-		yearSuffix: "" // Additional text to append to the year in the month headers
3844
-	};
3845
-	this._defaults = { // Global defaults for all the date picker instances
3846
-		showOn: "focus", // "focus" for popup on focus,
3847
-			// "button" for trigger button, or "both" for either
3848
-		showAnim: "fadeIn", // Name of jQuery animation for popup
3849
-		showOptions: {}, // Options for enhanced animations
3850
-		defaultDate: null, // Used when field is blank: actual date,
3851
-			// +/-number for offset from today, null for today
3852
-		appendText: "", // Display text following the input box, e.g. showing the format
3853
-		buttonText: "...", // Text for trigger button
3854
-		buttonImage: "", // URL for trigger button image
3855
-		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
3856
-		hideIfNoPrevNext: false, // True to hide next/previous month links
3857
-			// if not applicable, false to just disable them
3858
-		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
3859
-		gotoCurrent: false, // True if today link goes back to current selection instead
3860
-		changeMonth: false, // True if month can be selected directly, false if only prev/next
3861
-		changeYear: false, // True if year can be selected directly, false if only prev/next
3862
-		yearRange: "c-10:c+10", // Range of years to display in drop-down,
3863
-			// either relative to today's year (-nn:+nn), relative to currently displayed year
3864
-			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
3865
-		showOtherMonths: false, // True to show dates in other months, false to leave blank
3866
-		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
3867
-		showWeek: false, // True to show week of the year, false to not show it
3868
-		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
3869
-			// takes a Date and returns the number of the week for it
3870
-		shortYearCutoff: "+10", // Short year values < this are in the current century,
3871
-			// > this are in the previous century,
3872
-			// string value starting with "+" for current year + value
3873
-		minDate: null, // The earliest selectable date, or null for no limit
3874
-		maxDate: null, // The latest selectable date, or null for no limit
3875
-		duration: "fast", // Duration of display/closure
3876
-		beforeShowDay: null, // Function that takes a date and returns an array with
3877
-			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
3878
-			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
3879
-		beforeShow: null, // Function that takes an input field and
3880
-			// returns a set of custom settings for the date picker
3881
-		onSelect: null, // Define a callback function when a date is selected
3882
-		onChangeMonthYear: null, // Define a callback function when the month or year is changed
3883
-		onClose: null, // Define a callback function when the datepicker is closed
3884
-		numberOfMonths: 1, // Number of months to show at a time
3885
-		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
3886
-		stepMonths: 1, // Number of months to step back/forward
3887
-		stepBigMonths: 12, // Number of months to step back/forward for the big links
3888
-		altField: "", // Selector for an alternate field to store selected dates into
3889
-		altFormat: "", // The date format to use for the alternate field
3890
-		constrainInput: true, // The input is constrained by the current date format
3891
-		showButtonPanel: false, // True to show button panel, false to not show it
3892
-		autoSize: false, // True to size the input for the date format, false to leave as is
3893
-		disabled: false // The initial disabled state
3894
-	};
3895
-	$.extend(this._defaults, this.regional[""]);
3896
-	this.regional.en = $.extend( true, {}, this.regional[ "" ]);
3897
-	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
3898
-	this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"));
3137
+	// Last Bounce when Hiding
3138
+	if ( hide ) {
3139
+		upAnim = { opacity: 0 };
3140
+		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
3141
+
3142
+		element.animate( upAnim, speed, easing );
3899 3143
 	}
3900 3144
 
3901
-$.extend(Datepicker.prototype, {
3902
-	/* Class name added to elements to indicate already configured with a date picker. */
3903
-	markerClassName: "hasDatepicker",
3145
+	element.queue( done );
3904 3146
 
3905
-	//Keep track of the maximum number of rows displayed (see #7043)
3906
-	maxRows: 4,
3147
+	$.effects.unshift( element, queuelen, anims + 1 );
3148
+} );
3907 3149
 
3908
-	// TODO rename to "widget" when switching to widget factory
3909
-	_widgetDatepicker: function() {
3910
-		return this.dpDiv;
3911
-	},
3912 3150
 
3913
-	/* Override the default settings for all instances of the date picker.
3914
-	 * @param  settings  object - the new settings to use as defaults (anonymous object)
3915
-	 * @return the manager object
3151
+/*!
3152
+ * jQuery UI Effects Clip 1.13.2
3153
+ * http://jqueryui.com
3154
+ *
3155
+ * Copyright jQuery Foundation and other contributors
3156
+ * Released under the MIT license.
3157
+ * http://jquery.org/license
3916 3158
  */
3917
-	setDefaults: function(settings) {
3918
-		datepicker_extendRemove(this._defaults, settings || {});
3919
-		return this;
3920
-	},
3921 3159
 
3922
-	/* Attach the date picker to a jQuery selection.
3923
-	 * @param  target	element - the target input field or division or span
3924
-	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
3925
-	 */
3926
-	_attachDatepicker: function(target, settings) {
3927
-		var nodeName, inline, inst;
3928
-		nodeName = target.nodeName.toLowerCase();
3929
-		inline = (nodeName === "div" || nodeName === "span");
3930
-		if (!target.id) {
3931
-			this.uuid += 1;
3932
-			target.id = "dp" + this.uuid;
3933
-		}
3934
-		inst = this._newInst($(target), inline);
3935
-		inst.settings = $.extend({}, settings || {});
3936
-		if (nodeName === "input") {
3937
-			this._connectDatepicker(target, inst);
3938
-		} else if (inline) {
3939
-			this._inlineDatepicker(target, inst);
3940
-		}
3941
-	},
3160
+//>>label: Clip Effect
3161
+//>>group: Effects
3162
+//>>description: Clips the element on and off like an old TV.
3163
+//>>docs: http://api.jqueryui.com/clip-effect/
3164
+//>>demos: http://jqueryui.com/effect/
3165
+
3166
+
3167
+var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) {
3168
+	var start,
3169
+		animate = {},
3170
+		element = $( this ),
3171
+		direction = options.direction || "vertical",
3172
+		both = direction === "both",
3173
+		horizontal = both || direction === "horizontal",
3174
+		vertical = both || direction === "vertical";
3175
+
3176
+	start = element.cssClip();
3177
+	animate.clip = {
3178
+		top: vertical ? ( start.bottom - start.top ) / 2 : start.top,
3179
+		right: horizontal ? ( start.right - start.left ) / 2 : start.right,
3180
+		bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom,
3181
+		left: horizontal ? ( start.right - start.left ) / 2 : start.left
3182
+	};
3942 3183
 
3943
-	/* Create a new instance object. */
3944
-	_newInst: function(target, inline) {
3945
-		var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars
3946
-		return {id: id, input: target, // associated target
3947
-			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
3948
-			drawMonth: 0, drawYear: 0, // month being drawn
3949
-			inline: inline, // is datepicker inline or not
3950
-			dpDiv: (!inline ? this.dpDiv : // presentation div
3951
-			datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))};
3952
-	},
3184
+	$.effects.createPlaceholder( element );
3953 3185
 
3954
-	/* Attach the date picker to an input field. */
3955
-	_connectDatepicker: function(target, inst) {
3956
-		var input = $(target);
3957
-		inst.append = $([]);
3958
-		inst.trigger = $([]);
3959
-		if (input.hasClass(this.markerClassName)) {
3960
-			return;
3961
-		}
3962
-		this._attachments(input, inst);
3963
-		input.addClass(this.markerClassName).keydown(this._doKeyDown).
3964
-			keypress(this._doKeyPress).keyup(this._doKeyUp);
3965
-		this._autoSize(inst);
3966
-		$.data(target, "datepicker", inst);
3967
-		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
3968
-		if( inst.settings.disabled ) {
3969
-			this._disableDatepicker( target );
3186
+	if ( options.mode === "show" ) {
3187
+		element.cssClip( animate.clip );
3188
+		animate.clip = start;
3970 3189
 	}
3971
-	},
3972 3190
 
3973
-	/* Make attachments based on settings. */
3974
-	_attachments: function(input, inst) {
3975
-		var showOn, buttonText, buttonImage,
3976
-			appendText = this._get(inst, "appendText"),
3977
-			isRTL = this._get(inst, "isRTL");
3191
+	element.animate( animate, {
3192
+		queue: false,
3193
+		duration: options.duration,
3194
+		easing: options.easing,
3195
+		complete: done
3196
+	} );
3978 3197
 
3979
-		if (inst.append) {
3980
-			inst.append.remove();
3981
-		}
3982
-		if (appendText) {
3983
-			inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
3984
-			input[isRTL ? "before" : "after"](inst.append);
3985
-		}
3198
+} );
3986 3199
 
3987
-		input.unbind("focus", this._showDatepicker);
3988 3200
 
3989
-		if (inst.trigger) {
3990
-			inst.trigger.remove();
3991
-		}
3201
+/*!
3202
+ * jQuery UI Effects Drop 1.13.2
3203
+ * http://jqueryui.com
3204
+ *
3205
+ * Copyright jQuery Foundation and other contributors
3206
+ * Released under the MIT license.
3207
+ * http://jquery.org/license
3208
+ */
3992 3209
 
3993
-		showOn = this._get(inst, "showOn");
3994
-		if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field
3995
-			input.focus(this._showDatepicker);
3996
-		}
3997
-		if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked
3998
-			buttonText = this._get(inst, "buttonText");
3999
-			buttonImage = this._get(inst, "buttonImage");
4000
-			inst.trigger = $(this._get(inst, "buttonImageOnly") ?
4001
-				$("<img/>").addClass(this._triggerClass).
4002
-					attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
4003
-				$("<button type='button'></button>").addClass(this._triggerClass).
4004
-					html(!buttonImage ? buttonText : $("<img/>").attr(
4005
-					{ src:buttonImage, alt:buttonText, title:buttonText })));
4006
-			input[isRTL ? "before" : "after"](inst.trigger);
4007
-			inst.trigger.click(function() {
4008
-				if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
4009
-					$.datepicker._hideDatepicker();
4010
-				} else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
4011
-					$.datepicker._hideDatepicker();
4012
-					$.datepicker._showDatepicker(input[0]);
4013
-				} else {
4014
-					$.datepicker._showDatepicker(input[0]);
3210
+//>>label: Drop Effect
3211
+//>>group: Effects
3212
+//>>description: Moves an element in one direction and hides it at the same time.
3213
+//>>docs: http://api.jqueryui.com/drop-effect/
3214
+//>>demos: http://jqueryui.com/effect/
3215
+
3216
+
3217
+var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) {
3218
+
3219
+	var distance,
3220
+		element = $( this ),
3221
+		mode = options.mode,
3222
+		show = mode === "show",
3223
+		direction = options.direction || "left",
3224
+		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3225
+		motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=",
3226
+		oppositeMotion = ( motion === "+=" ) ? "-=" : "+=",
3227
+		animation = {
3228
+			opacity: 0
3229
+		};
3230
+
3231
+	$.effects.createPlaceholder( element );
3232
+
3233
+	distance = options.distance ||
3234
+		element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
3235
+
3236
+	animation[ ref ] = motion + distance;
3237
+
3238
+	if ( show ) {
3239
+		element.css( animation );
3240
+
3241
+		animation[ ref ] = oppositeMotion + distance;
3242
+		animation.opacity = 1;
4015 3243
 	}
4016
-				return false;
3244
+
3245
+	// Animate
3246
+	element.animate( animation, {
3247
+		queue: false,
3248
+		duration: options.duration,
3249
+		easing: options.easing,
3250
+		complete: done
3251
+	} );
4017 3252
 } );
4018
-		}
4019
-	},
4020 3253
 
4021
-	/* Apply the maximum length for the date format. */
4022
-	_autoSize: function(inst) {
4023
-		if (this._get(inst, "autoSize") && !inst.inline) {
4024
-			var findMax, max, maxI, i,
4025
-				date = new Date(2009, 12 - 1, 20), // Ensure double digits
4026
-				dateFormat = this._get(inst, "dateFormat");
4027 3254
 
4028
-			if (dateFormat.match(/[DM]/)) {
4029
-				findMax = function(names) {
4030
-					max = 0;
4031
-					maxI = 0;
4032
-					for (i = 0; i < names.length; i++) {
4033
-						if (names[i].length > max) {
4034
-							max = names[i].length;
4035
-							maxI = i;
4036
-						}
4037
-					}
4038
-					return maxI;
4039
-				};
4040
-				date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
4041
-					"monthNames" : "monthNamesShort"))));
4042
-				date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
4043
-					"dayNames" : "dayNamesShort"))) + 20 - date.getDay());
3255
+/*!
3256
+ * jQuery UI Effects Explode 1.13.2
3257
+ * http://jqueryui.com
3258
+ *
3259
+ * Copyright jQuery Foundation and other contributors
3260
+ * Released under the MIT license.
3261
+ * http://jquery.org/license
3262
+ */
3263
+
3264
+//>>label: Explode Effect
3265
+//>>group: Effects
3266
+/* eslint-disable max-len */
3267
+//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.
3268
+/* eslint-enable max-len */
3269
+//>>docs: http://api.jqueryui.com/explode-effect/
3270
+//>>demos: http://jqueryui.com/effect/
3271
+
3272
+
3273
+var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) {
3274
+
3275
+	var i, j, left, top, mx, my,
3276
+		rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3,
3277
+		cells = rows,
3278
+		element = $( this ),
3279
+		mode = options.mode,
3280
+		show = mode === "show",
3281
+
3282
+		// Show and then visibility:hidden the element before calculating offset
3283
+		offset = element.show().css( "visibility", "hidden" ).offset(),
3284
+
3285
+		// Width and height of a piece
3286
+		width = Math.ceil( element.outerWidth() / cells ),
3287
+		height = Math.ceil( element.outerHeight() / rows ),
3288
+		pieces = [];
3289
+
3290
+	// Children animate complete:
3291
+	function childComplete() {
3292
+		pieces.push( this );
3293
+		if ( pieces.length === rows * cells ) {
3294
+			animComplete();
4044 3295
 		}
4045
-			inst.input.attr("size", this._formatDate(inst, date).length);
4046 3296
 	}
4047
-	},
4048 3297
 
4049
-	/* Attach an inline date picker to a div. */
4050
-	_inlineDatepicker: function(target, inst) {
4051
-		var divSpan = $(target);
4052
-		if (divSpan.hasClass(this.markerClassName)) {
4053
-			return;
4054
-		}
4055
-		divSpan.addClass(this.markerClassName).append(inst.dpDiv);
4056
-		$.data(target, "datepicker", inst);
4057
-		this._setDate(inst, this._getDefaultDate(inst), true);
4058
-		this._updateDatepicker(inst);
4059
-		this._updateAlternate(inst);
4060
-		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
4061
-		if( inst.settings.disabled ) {
4062
-			this._disableDatepicker( target );
4063
-		}
4064
-		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
4065
-		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
4066
-		inst.dpDiv.css( "display", "block" );
4067
-	},
3298
+	// Clone the element for each row and cell.
3299
+	for ( i = 0; i < rows; i++ ) { // ===>
3300
+		top = offset.top + i * height;
3301
+		my = i - ( rows - 1 ) / 2;
4068 3302
 
4069
-	/* Pop-up the date picker in a "dialog" box.
4070
-	 * @param  input element - ignored
4071
-	 * @param  date	string or Date - the initial date to display
4072
-	 * @param  onSelect  function - the function to call when a date is selected
4073
-	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
4074
-	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
4075
-	 *					event - with x/y coordinates or
4076
-	 *					leave empty for default (screen centre)
4077
-	 * @return the manager object
4078
-	 */
4079
-	_dialogDatepicker: function(input, date, onSelect, settings, pos) {
4080
-		var id, browserWidth, browserHeight, scrollX, scrollY,
4081
-			inst = this._dialogInst; // internal instance
3303
+		for ( j = 0; j < cells; j++ ) { // |||
3304
+			left = offset.left + j * width;
3305
+			mx = j - ( cells - 1 ) / 2;
4082 3306
 
4083
-		if (!inst) {
4084
-			this.uuid += 1;
4085
-			id = "dp" + this.uuid;
4086
-			this._dialogInput = $("<input type='text' id='" + id +
4087
-				"' style='position: absolute; top: -100px; width: 0px;'/>");
4088
-			this._dialogInput.keydown(this._doKeyDown);
4089
-			$("body").append(this._dialogInput);
4090
-			inst = this._dialogInst = this._newInst(this._dialogInput, false);
4091
-			inst.settings = {};
4092
-			$.data(this._dialogInput[0], "datepicker", inst);
4093
-		}
4094
-		datepicker_extendRemove(inst.settings, settings || {});
4095
-		date = (date && date.constructor === Date ? this._formatDate(inst, date) : date);
4096
-		this._dialogInput.val(date);
3307
+			// Create a clone of the now hidden main element that will be absolute positioned
3308
+			// within a wrapper div off the -left and -top equal to size of our pieces
3309
+			element
3310
+				.clone()
3311
+				.appendTo( "body" )
3312
+				.wrap( "<div></div>" )
3313
+				.css( {
3314
+					position: "absolute",
3315
+					visibility: "visible",
3316
+					left: -j * width,
3317
+					top: -i * height
3318
+				} )
4097 3319
 
4098
-		this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
4099
-		if (!this._pos) {
4100
-			browserWidth = document.documentElement.clientWidth;
4101
-			browserHeight = document.documentElement.clientHeight;
4102
-			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
4103
-			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
4104
-			this._pos = // should use actual width/height below
4105
-				[(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
3320
+				// Select the wrapper - make it overflow: hidden and absolute positioned based on
3321
+				// where the original was located +left and +top equal to the size of pieces
3322
+				.parent()
3323
+					.addClass( "ui-effects-explode" )
3324
+					.css( {
3325
+						position: "absolute",
3326
+						overflow: "hidden",
3327
+						width: width,
3328
+						height: height,
3329
+						left: left + ( show ? mx * width : 0 ),
3330
+						top: top + ( show ? my * height : 0 ),
3331
+						opacity: show ? 0 : 1
3332
+					} )
3333
+					.animate( {
3334
+						left: left + ( show ? 0 : mx * width ),
3335
+						top: top + ( show ? 0 : my * height ),
3336
+						opacity: show ? 1 : 0
3337
+					}, options.duration || 500, options.easing, childComplete );
3338
+		}
4106 3339
 	}
4107 3340
 
4108
-		// move input on screen for focus, but hidden behind dialog
4109
-		this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px");
4110
-		inst.settings.onSelect = onSelect;
4111
-		this._inDialog = true;
4112
-		this.dpDiv.addClass(this._dialogClass);
4113
-		this._showDatepicker(this._dialogInput[0]);
4114
-		if ($.blockUI) {
4115
-			$.blockUI(this.dpDiv);
3341
+	function animComplete() {
3342
+		element.css( {
3343
+			visibility: "visible"
3344
+		} );
3345
+		$( pieces ).remove();
3346
+		done();
4116 3347
 	}
4117
-		$.data(this._dialogInput[0], "datepicker", inst);
4118
-		return this;
4119
-	},
3348
+} );
4120 3349
 
4121
-	/* Detach a datepicker from its control.
4122
-	 * @param  target	element - the target input field or division or span
3350
+
3351
+/*!
3352
+ * jQuery UI Effects Fade 1.13.2
3353
+ * http://jqueryui.com
3354
+ *
3355
+ * Copyright jQuery Foundation and other contributors
3356
+ * Released under the MIT license.
3357
+ * http://jquery.org/license
4123 3358
  */
4124
-	_destroyDatepicker: function(target) {
4125
-		var nodeName,
4126
-			$target = $(target),
4127
-			inst = $.data(target, "datepicker");
4128 3359
 
4129
-		if (!$target.hasClass(this.markerClassName)) {
4130
-			return;
4131
-		}
3360
+//>>label: Fade Effect
3361
+//>>group: Effects
3362
+//>>description: Fades the element.
3363
+//>>docs: http://api.jqueryui.com/fade-effect/
3364
+//>>demos: http://jqueryui.com/effect/
4132 3365
 
4133
-		nodeName = target.nodeName.toLowerCase();
4134
-		$.removeData(target, "datepicker");
4135
-		if (nodeName === "input") {
4136
-			inst.append.remove();
4137
-			inst.trigger.remove();
4138
-			$target.removeClass(this.markerClassName).
4139
-				unbind("focus", this._showDatepicker).
4140
-				unbind("keydown", this._doKeyDown).
4141
-				unbind("keypress", this._doKeyPress).
4142
-				unbind("keyup", this._doKeyUp);
4143
-		} else if (nodeName === "div" || nodeName === "span") {
4144
-			$target.removeClass(this.markerClassName).empty();
4145
-		}
4146 3366
 
4147
-		if ( datepicker_instActive === inst ) {
4148
-			datepicker_instActive = null;
4149
-		}
4150
-	},
3367
+var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) {
3368
+	var show = options.mode === "show";
4151 3369
 
4152
-	/* Enable the date picker to a jQuery selection.
4153
-	 * @param  target	element - the target input field or division or span
3370
+	$( this )
3371
+		.css( "opacity", show ? 0 : 1 )
3372
+		.animate( {
3373
+			opacity: show ? 1 : 0
3374
+		}, {
3375
+			queue: false,
3376
+			duration: options.duration,
3377
+			easing: options.easing,
3378
+			complete: done
3379
+		} );
3380
+} );
3381
+
3382
+
3383
+/*!
3384
+ * jQuery UI Effects Fold 1.13.2
3385
+ * http://jqueryui.com
3386
+ *
3387
+ * Copyright jQuery Foundation and other contributors
3388
+ * Released under the MIT license.
3389
+ * http://jquery.org/license
4154 3390
  */
4155
-	_enableDatepicker: function(target) {
4156
-		var nodeName, inline,
4157
-			$target = $(target),
4158
-			inst = $.data(target, "datepicker");
4159 3391
 
4160
-		if (!$target.hasClass(this.markerClassName)) {
4161
-			return;
4162
-		}
3392
+//>>label: Fold Effect
3393
+//>>group: Effects
3394
+//>>description: Folds an element first horizontally and then vertically.
3395
+//>>docs: http://api.jqueryui.com/fold-effect/
3396
+//>>demos: http://jqueryui.com/effect/
4163 3397
 
4164
-		nodeName = target.nodeName.toLowerCase();
4165
-		if (nodeName === "input") {
4166
-			target.disabled = false;
4167
-			inst.trigger.filter("button").
4168
-				each(function() { this.disabled = false; }).end().
4169
-				filter("img").css({opacity: "1.0", cursor: ""});
4170
-		} else if (nodeName === "div" || nodeName === "span") {
4171
-			inline = $target.children("." + this._inlineClass);
4172
-			inline.children().removeClass("ui-state-disabled");
4173
-			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
4174
-				prop("disabled", false);
4175
-		}
4176
-		this._disabledInputs = $.map(this._disabledInputs,
4177
-			function(value) { return (value === target ? null : value); }); // delete entry
4178
-	},
4179 3398
 
4180
-	/* Disable the date picker to a jQuery selection.
4181
-	 * @param  target	element - the target input field or division or span
4182
-	 */
4183
-	_disableDatepicker: function(target) {
4184
-		var nodeName, inline,
4185
-			$target = $(target),
4186
-			inst = $.data(target, "datepicker");
3399
+var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) {
4187 3400
 
4188
-		if (!$target.hasClass(this.markerClassName)) {
4189
-			return;
4190
-		}
3401
+	// Create element
3402
+	var element = $( this ),
3403
+		mode = options.mode,
3404
+		show = mode === "show",
3405
+		hide = mode === "hide",
3406
+		size = options.size || 15,
3407
+		percent = /([0-9]+)%/.exec( size ),
3408
+		horizFirst = !!options.horizFirst,
3409
+		ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ],
3410
+		duration = options.duration / 2,
4191 3411
 
4192
-		nodeName = target.nodeName.toLowerCase();
4193
-		if (nodeName === "input") {
4194
-			target.disabled = true;
4195
-			inst.trigger.filter("button").
4196
-				each(function() { this.disabled = true; }).end().
4197
-				filter("img").css({opacity: "0.5", cursor: "default"});
4198
-		} else if (nodeName === "div" || nodeName === "span") {
4199
-			inline = $target.children("." + this._inlineClass);
4200
-			inline.children().addClass("ui-state-disabled");
4201
-			inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
4202
-				prop("disabled", true);
4203
-		}
4204
-		this._disabledInputs = $.map(this._disabledInputs,
4205
-			function(value) { return (value === target ? null : value); }); // delete entry
4206
-		this._disabledInputs[this._disabledInputs.length] = target;
4207
-	},
3412
+		placeholder = $.effects.createPlaceholder( element ),
4208 3413
 
4209
-	/* Is the first field in a jQuery collection disabled as a datepicker?
4210
-	 * @param  target	element - the target input field or division or span
4211
-	 * @return boolean - true if disabled, false if enabled
4212
-	 */
4213
-	_isDisabledDatepicker: function(target) {
4214
-		if (!target) {
4215
-			return false;
4216
-		}
4217
-		for (var i = 0; i < this._disabledInputs.length; i++) {
4218
-			if (this._disabledInputs[i] === target) {
4219
-				return true;
4220
-			}
4221
-		}
4222
-		return false;
4223
-	},
3414
+		start = element.cssClip(),
3415
+		animation1 = { clip: $.extend( {}, start ) },
3416
+		animation2 = { clip: $.extend( {}, start ) },
4224 3417
 
4225
-	/* Retrieve the instance data for the target control.
4226
-	 * @param  target  element - the target input field or division or span
4227
-	 * @return  object - the associated instance data
4228
-	 * @throws  error if a jQuery problem getting data
4229
-	 */
4230
-	_getInst: function(target) {
4231
-		try {
4232
-			return $.data(target, "datepicker");
4233
-		}
4234
-		catch (err) {
4235
-			throw "Missing instance data for this datepicker";
4236
-		}
4237
-	},
3418
+		distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ],
4238 3419
 
4239
-	/* Update or retrieve the settings for a date picker attached to an input field or division.
4240
-	 * @param  target  element - the target input field or division or span
4241
-	 * @param  name	object - the new settings to update or
4242
-	 *				string - the name of the setting to change or retrieve,
4243
-	 *				when retrieving also "all" for all instance settings or
4244
-	 *				"defaults" for all global defaults
4245
-	 * @param  value   any - the new value for the setting
4246
-	 *				(omit if above is an object or to retrieve a value)
4247
-	 */
4248
-	_optionDatepicker: function(target, name, value) {
4249
-		var settings, date, minDate, maxDate,
4250
-			inst = this._getInst(target);
3420
+		queuelen = element.queue().length;
4251 3421
 
4252
-		if (arguments.length === 2 && typeof name === "string") {
4253
-			return (name === "defaults" ? $.extend({}, $.datepicker._defaults) :
4254
-				(inst ? (name === "all" ? $.extend({}, inst.settings) :
4255
-				this._get(inst, name)) : null));
3422
+	if ( percent ) {
3423
+		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
4256 3424
 	}
3425
+	animation1.clip[ ref[ 0 ] ] = size;
3426
+	animation2.clip[ ref[ 0 ] ] = size;
3427
+	animation2.clip[ ref[ 1 ] ] = 0;
4257 3428
 
4258
-		settings = name || {};
4259
-		if (typeof name === "string") {
4260
-			settings = {};
4261
-			settings[name] = value;
3429
+	if ( show ) {
3430
+		element.cssClip( animation2.clip );
3431
+		if ( placeholder ) {
3432
+			placeholder.css( $.effects.clipToBox( animation2 ) );
4262 3433
 		}
4263 3434
 
4264
-		if (inst) {
4265
-			if (this._curInst === inst) {
4266
-				this._hideDatepicker();
3435
+		animation2.clip = start;
4267 3436
 	}
4268 3437
 
4269
-			date = this._getDateDatepicker(target, true);
4270
-			minDate = this._getMinMaxDate(inst, "min");
4271
-			maxDate = this._getMinMaxDate(inst, "max");
4272
-			datepicker_extendRemove(inst.settings, settings);
4273
-			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
4274
-			if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
4275
-				inst.settings.minDate = this._formatDate(inst, minDate);
4276
-			}
4277
-			if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
4278
-				inst.settings.maxDate = this._formatDate(inst, maxDate);
4279
-			}
4280
-			if ( "disabled" in settings ) {
4281
-				if ( settings.disabled ) {
4282
-					this._disableDatepicker(target);
4283
-				} else {
4284
-					this._enableDatepicker(target);
4285
-				}
4286
-			}
4287
-			this._attachments($(target), inst);
4288
-			this._autoSize(inst);
4289
-			this._setDate(inst, date);
4290
-			this._updateAlternate(inst);
4291
-			this._updateDatepicker(inst);
3438
+	// Animate
3439
+	element
3440
+		.queue( function( next ) {
3441
+			if ( placeholder ) {
3442
+				placeholder
3443
+					.animate( $.effects.clipToBox( animation1 ), duration, options.easing )
3444
+					.animate( $.effects.clipToBox( animation2 ), duration, options.easing );
4292 3445
 			}
4293
-	},
4294 3446
 
4295
-	// change method deprecated
4296
-	_changeDatepicker: function(target, name, value) {
4297
-		this._optionDatepicker(target, name, value);
4298
-	},
3447
+			next();
3448
+		} )
3449
+		.animate( animation1, duration, options.easing )
3450
+		.animate( animation2, duration, options.easing )
3451
+		.queue( done );
4299 3452
 
4300
-	/* Redraw the date picker attached to an input field or division.
4301
-	 * @param  target  element - the target input field or division or span
4302
-	 */
4303
-	_refreshDatepicker: function(target) {
4304
-		var inst = this._getInst(target);
4305
-		if (inst) {
4306
-			this._updateDatepicker(inst);
4307
-		}
4308
-	},
3453
+	$.effects.unshift( element, queuelen, 4 );
3454
+} );
4309 3455
 
4310
-	/* Set the dates for a jQuery selection.
4311
-	 * @param  target element - the target input field or division or span
4312
-	 * @param  date	Date - the new date
3456
+
3457
+/*!
3458
+ * jQuery UI Effects Highlight 1.13.2
3459
+ * http://jqueryui.com
3460
+ *
3461
+ * Copyright jQuery Foundation and other contributors
3462
+ * Released under the MIT license.
3463
+ * http://jquery.org/license
4313 3464
  */
4314
-	_setDateDatepicker: function(target, date) {
4315
-		var inst = this._getInst(target);
4316
-		if (inst) {
4317
-			this._setDate(inst, date);
4318
-			this._updateDatepicker(inst);
4319
-			this._updateAlternate(inst);
3465
+
3466
+//>>label: Highlight Effect
3467
+//>>group: Effects
3468
+//>>description: Highlights the background of an element in a defined color for a custom duration.
3469
+//>>docs: http://api.jqueryui.com/highlight-effect/
3470
+//>>demos: http://jqueryui.com/effect/
3471
+
3472
+
3473
+var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) {
3474
+	var element = $( this ),
3475
+		animation = {
3476
+			backgroundColor: element.css( "backgroundColor" )
3477
+		};
3478
+
3479
+	if ( options.mode === "hide" ) {
3480
+		animation.opacity = 0;
4320 3481
 	}
4321
-	},
4322 3482
 
4323
-	/* Get the date(s) for the first entry in a jQuery selection.
4324
-	 * @param  target element - the target input field or division or span
4325
-	 * @param  noDefault boolean - true if no default date is to be used
4326
-	 * @return Date - the current date
3483
+	$.effects.saveStyle( element );
3484
+
3485
+	element
3486
+		.css( {
3487
+			backgroundImage: "none",
3488
+			backgroundColor: options.color || "#ffff99"
3489
+		} )
3490
+		.animate( animation, {
3491
+			queue: false,
3492
+			duration: options.duration,
3493
+			easing: options.easing,
3494
+			complete: done
3495
+		} );
3496
+} );
3497
+
3498
+
3499
+/*!
3500
+ * jQuery UI Effects Size 1.13.2
3501
+ * http://jqueryui.com
3502
+ *
3503
+ * Copyright jQuery Foundation and other contributors
3504
+ * Released under the MIT license.
3505
+ * http://jquery.org/license
4327 3506
  */
4328
-	_getDateDatepicker: function(target, noDefault) {
4329
-		var inst = this._getInst(target);
4330
-		if (inst && !inst.inline) {
4331
-			this._setDateFromField(inst, noDefault);
4332
-		}
4333
-		return (inst ? this._getDate(inst) : null);
4334
-	},
4335 3507
 
4336
-	/* Handle keystrokes. */
4337
-	_doKeyDown: function(event) {
4338
-		var onSelect, dateStr, sel,
4339
-			inst = $.datepicker._getInst(event.target),
4340
-			handled = true,
4341
-			isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
3508
+//>>label: Size Effect
3509
+//>>group: Effects
3510
+//>>description: Resize an element to a specified width and height.
3511
+//>>docs: http://api.jqueryui.com/size-effect/
3512
+//>>demos: http://jqueryui.com/effect/
4342 3513
 
4343
-		inst._keyEvent = true;
4344
-		if ($.datepicker._datepickerShowing) {
4345
-			switch (event.keyCode) {
4346
-				case 9: $.datepicker._hideDatepicker();
4347
-						handled = false;
4348
-						break; // hide on tab out
4349
-				case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." +
4350
-									$.datepicker._currentClass + ")", inst.dpDiv);
4351
-						if (sel[0]) {
4352
-							$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
4353
-						}
4354 3514
 
4355
-						onSelect = $.datepicker._get(inst, "onSelect");
4356
-						if (onSelect) {
4357
-							dateStr = $.datepicker._formatDate(inst);
3515
+var effectsEffectSize = $.effects.define( "size", function( options, done ) {
4358 3516
 
4359
-							// trigger custom callback
4360
-							onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
4361
-						} else {
4362
-							$.datepicker._hideDatepicker();
4363
-						}
3517
+	// Create element
3518
+	var baseline, factor, temp,
3519
+		element = $( this ),
4364 3520
 
4365
-						return false; // don't submit the form
4366
-				case 27: $.datepicker._hideDatepicker();
4367
-						break; // hide on escape
4368
-				case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4369
-							-$.datepicker._get(inst, "stepBigMonths") :
4370
-							-$.datepicker._get(inst, "stepMonths")), "M");
4371
-						break; // previous month/year on page up/+ ctrl
4372
-				case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
4373
-							+$.datepicker._get(inst, "stepBigMonths") :
4374
-							+$.datepicker._get(inst, "stepMonths")), "M");
4375
-						break; // next month/year on page down/+ ctrl
4376
-				case 35: if (event.ctrlKey || event.metaKey) {
4377
-							$.datepicker._clearDate(event.target);
3521
+		// Copy for children
3522
+		cProps = [ "fontSize" ],
3523
+		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
3524
+		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
3525
+
3526
+		// Set options
3527
+		mode = options.mode,
3528
+		restore = mode !== "effect",
3529
+		scale = options.scale || "both",
3530
+		origin = options.origin || [ "middle", "center" ],
3531
+		position = element.css( "position" ),
3532
+		pos = element.position(),
3533
+		original = $.effects.scaledDimensions( element ),
3534
+		from = options.from || original,
3535
+		to = options.to || $.effects.scaledDimensions( element, 0 );
3536
+
3537
+	$.effects.createPlaceholder( element );
3538
+
3539
+	if ( mode === "show" ) {
3540
+		temp = from;
3541
+		from = to;
3542
+		to = temp;
4378 3543
 	}
4379
-						handled = event.ctrlKey || event.metaKey;
4380
-						break; // clear on ctrl or command +end
4381
-				case 36: if (event.ctrlKey || event.metaKey) {
4382
-							$.datepicker._gotoToday(event.target);
3544
+
3545
+	// Set scaling factor
3546
+	factor = {
3547
+		from: {
3548
+			y: from.height / original.height,
3549
+			x: from.width / original.width
3550
+		},
3551
+		to: {
3552
+			y: to.height / original.height,
3553
+			x: to.width / original.width
4383 3554
 		}
4384
-						handled = event.ctrlKey || event.metaKey;
4385
-						break; // current on ctrl or command +home
4386
-				case 37: if (event.ctrlKey || event.metaKey) {
4387
-							$.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D");
3555
+	};
3556
+
3557
+	// Scale the css box
3558
+	if ( scale === "box" || scale === "both" ) {
3559
+
3560
+		// Vertical props scaling
3561
+		if ( factor.from.y !== factor.to.y ) {
3562
+			from = $.effects.setTransition( element, vProps, factor.from.y, from );
3563
+			to = $.effects.setTransition( element, vProps, factor.to.y, to );
4388 3564
 		}
4389
-						handled = event.ctrlKey || event.metaKey;
4390
-						// -1 day on ctrl or command +left
4391
-						if (event.originalEvent.altKey) {
4392
-							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
4393
-								-$.datepicker._get(inst, "stepBigMonths") :
4394
-								-$.datepicker._get(inst, "stepMonths")), "M");
3565
+
3566
+		// Horizontal props scaling
3567
+		if ( factor.from.x !== factor.to.x ) {
3568
+			from = $.effects.setTransition( element, hProps, factor.from.x, from );
3569
+			to = $.effects.setTransition( element, hProps, factor.to.x, to );
4395 3570
 		}
4396
-						// next month/year on alt +left on Mac
4397
-						break;
4398
-				case 38: if (event.ctrlKey || event.metaKey) {
4399
-							$.datepicker._adjustDate(event.target, -7, "D");
4400 3571
 	}
4401
-						handled = event.ctrlKey || event.metaKey;
4402
-						break; // -1 week on ctrl or command +up
4403
-				case 39: if (event.ctrlKey || event.metaKey) {
4404
-							$.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D");
3572
+
3573
+	// Scale the content
3574
+	if ( scale === "content" || scale === "both" ) {
3575
+
3576
+		// Vertical props scaling
3577
+		if ( factor.from.y !== factor.to.y ) {
3578
+			from = $.effects.setTransition( element, cProps, factor.from.y, from );
3579
+			to = $.effects.setTransition( element, cProps, factor.to.y, to );
4405 3580
 		}
4406
-						handled = event.ctrlKey || event.metaKey;
4407
-						// +1 day on ctrl or command +right
4408
-						if (event.originalEvent.altKey) {
4409
-							$.datepicker._adjustDate(event.target, (event.ctrlKey ?
4410
-								+$.datepicker._get(inst, "stepBigMonths") :
4411
-								+$.datepicker._get(inst, "stepMonths")), "M");
4412 3581
 	}
4413
-						// next month/year on alt +right
4414
-						break;
4415
-				case 40: if (event.ctrlKey || event.metaKey) {
4416
-							$.datepicker._adjustDate(event.target, +7, "D");
3582
+
3583
+	// Adjust the position properties based on the provided origin points
3584
+	if ( origin ) {
3585
+		baseline = $.effects.getBaseline( origin, original );
3586
+		from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top;
3587
+		from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left;
3588
+		to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top;
3589
+		to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left;
4417 3590
 	}
4418
-						handled = event.ctrlKey || event.metaKey;
4419
-						break; // +1 week on ctrl or command +down
4420
-				default: handled = false;
3591
+	delete from.outerHeight;
3592
+	delete from.outerWidth;
3593
+	element.css( from );
3594
+
3595
+	// Animate the children if desired
3596
+	if ( scale === "content" || scale === "both" ) {
3597
+
3598
+		vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps );
3599
+		hProps = hProps.concat( [ "marginLeft", "marginRight" ] );
3600
+
3601
+		// Only animate children with width attributes specified
3602
+		// TODO: is this right? should we include anything with css width specified as well
3603
+		element.find( "*[width]" ).each( function() {
3604
+			var child = $( this ),
3605
+				childOriginal = $.effects.scaledDimensions( child ),
3606
+				childFrom = {
3607
+					height: childOriginal.height * factor.from.y,
3608
+					width: childOriginal.width * factor.from.x,
3609
+					outerHeight: childOriginal.outerHeight * factor.from.y,
3610
+					outerWidth: childOriginal.outerWidth * factor.from.x
3611
+				},
3612
+				childTo = {
3613
+					height: childOriginal.height * factor.to.y,
3614
+					width: childOriginal.width * factor.to.x,
3615
+					outerHeight: childOriginal.height * factor.to.y,
3616
+					outerWidth: childOriginal.width * factor.to.x
3617
+				};
3618
+
3619
+			// Vertical props scaling
3620
+			if ( factor.from.y !== factor.to.y ) {
3621
+				childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom );
3622
+				childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo );
4421 3623
 			}
4422
-		} else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home
4423
-			$.datepicker._showDatepicker(this);
4424
-		} else {
4425
-			handled = false;
3624
+
3625
+			// Horizontal props scaling
3626
+			if ( factor.from.x !== factor.to.x ) {
3627
+				childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom );
3628
+				childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo );
4426 3629
 			}
4427 3630
 
4428
-		if (handled) {
4429
-			event.preventDefault();
4430
-			event.stopPropagation();
3631
+			if ( restore ) {
3632
+				$.effects.saveStyle( child );
4431 3633
 			}
4432
-	},
4433 3634
 
4434
-	/* Filter entered characters - based on date format. */
4435
-	_doKeyPress: function(event) {
4436
-		var chars, chr,
4437
-			inst = $.datepicker._getInst(event.target);
3635
+			// Animate children
3636
+			child.css( childFrom );
3637
+			child.animate( childTo, options.duration, options.easing, function() {
4438 3638
 
4439
-		if ($.datepicker._get(inst, "constrainInput")) {
4440
-			chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
4441
-			chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
4442
-			return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1);
3639
+				// Restore children
3640
+				if ( restore ) {
3641
+					$.effects.restoreStyle( child );
3642
+				}
3643
+			} );
3644
+		} );
4443 3645
 	}
4444
-	},
4445 3646
 
4446
-	/* Synchronise manual entry and field/alternate field. */
4447
-	_doKeyUp: function(event) {
4448
-		var date,
4449
-			inst = $.datepicker._getInst(event.target);
3647
+	// Animate
3648
+	element.animate( to, {
3649
+		queue: false,
3650
+		duration: options.duration,
3651
+		easing: options.easing,
3652
+		complete: function() {
4450 3653
 
4451
-		if (inst.input.val() !== inst.lastVal) {
4452
-			try {
4453
-				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
4454
-					(inst.input ? inst.input.val() : null),
4455
-					$.datepicker._getFormatConfig(inst));
3654
+			var offset = element.offset();
4456 3655
 
4457
-				if (date) { // only if valid
4458
-					$.datepicker._setDateFromField(inst);
4459
-					$.datepicker._updateAlternate(inst);
4460
-					$.datepicker._updateDatepicker(inst);
4461
-				}
3656
+			if ( to.opacity === 0 ) {
3657
+				element.css( "opacity", from.opacity );
4462 3658
 			}
4463
-			catch (err) {
3659
+
3660
+			if ( !restore ) {
3661
+				element
3662
+					.css( "position", position === "static" ? "relative" : position )
3663
+					.offset( offset );
3664
+
3665
+				// Need to save style here so that automatic style restoration
3666
+				// doesn't restore to the original styles from before the animation.
3667
+				$.effects.saveStyle( element );
4464 3668
 			}
3669
+
3670
+			done();
4465 3671
 		}
4466
-		return true;
4467
-	},
3672
+	} );
4468 3673
 
4469
-	/* Pop-up the date picker for a given input field.
4470
-	 * If false returned from beforeShow event handler do not show.
4471
-	 * @param  input  element - the input field attached to the date picker or
4472
-	 *					event - if triggered by focus
3674
+} );
3675
+
3676
+
3677
+/*!
3678
+ * jQuery UI Effects Scale 1.13.2
3679
+ * http://jqueryui.com
3680
+ *
3681
+ * Copyright jQuery Foundation and other contributors
3682
+ * Released under the MIT license.
3683
+ * http://jquery.org/license
4473 3684
  */
4474
-	_showDatepicker: function(input) {
4475
-		input = input.target || input;
4476
-		if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger
4477
-			input = $("input", input.parentNode)[0];
4478
-		}
4479 3685
 
4480
-		if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here
4481
-			return;
4482
-		}
3686
+//>>label: Scale Effect
3687
+//>>group: Effects
3688
+//>>description: Grows or shrinks an element and its content.
3689
+//>>docs: http://api.jqueryui.com/scale-effect/
3690
+//>>demos: http://jqueryui.com/effect/
4483 3691
 
4484
-		var inst, beforeShow, beforeShowSettings, isFixed,
4485
-			offset, showAnim, duration;
4486 3692
 
4487
-		inst = $.datepicker._getInst(input);
4488
-		if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
4489
-			$.datepicker._curInst.dpDiv.stop(true, true);
4490
-			if ( inst && $.datepicker._datepickerShowing ) {
4491
-				$.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
4492
-			}
4493
-		}
3693
+var effectsEffectScale = $.effects.define( "scale", function( options, done ) {
4494 3694
 
4495
-		beforeShow = $.datepicker._get(inst, "beforeShow");
4496
-		beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
4497
-		if(beforeShowSettings === false){
4498
-			return;
4499
-		}
4500
-		datepicker_extendRemove(inst.settings, beforeShowSettings);
3695
+	// Create element
3696
+	var el = $( this ),
3697
+		mode = options.mode,
3698
+		percent = parseInt( options.percent, 10 ) ||
3699
+			( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ),
4501 3700
 
4502
-		inst.lastVal = null;
4503
-		$.datepicker._lastInput = input;
4504
-		$.datepicker._setDateFromField(inst);
3701
+		newOptions = $.extend( true, {
3702
+			from: $.effects.scaledDimensions( el ),
3703
+			to: $.effects.scaledDimensions( el, percent, options.direction || "both" ),
3704
+			origin: options.origin || [ "middle", "center" ]
3705
+		}, options );
4505 3706
 
4506
-		if ($.datepicker._inDialog) { // hide cursor
4507
-			input.value = "";
4508
-		}
4509
-		if (!$.datepicker._pos) { // position below input
4510
-			$.datepicker._pos = $.datepicker._findPos(input);
4511
-			$.datepicker._pos[1] += input.offsetHeight; // add the height
3707
+	// Fade option to support puff
3708
+	if ( options.fade ) {
3709
+		newOptions.from.opacity = 1;
3710
+		newOptions.to.opacity = 0;
4512 3711
 	}
4513 3712
 
4514
-		isFixed = false;
4515
-		$(input).parents().each(function() {
4516
-			isFixed |= $(this).css("position") === "fixed";
4517
-			return !isFixed;
3713
+	$.effects.effect.size.call( this, newOptions, done );
4518 3714
 } );
4519 3715
 
4520
-		offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
4521
-		$.datepicker._pos = null;
4522
-		//to avoid flashes on Firefox
4523
-		inst.dpDiv.empty();
4524
-		// determine sizing offscreen
4525
-		inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"});
4526
-		$.datepicker._updateDatepicker(inst);
4527
-		// fix width for dynamic number of date pickers
4528
-		// and adjust position before showing
4529
-		offset = $.datepicker._checkOffset(inst, offset, isFixed);
4530
-		inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
4531
-			"static" : (isFixed ? "fixed" : "absolute")), display: "none",
4532
-			left: offset.left + "px", top: offset.top + "px"});
4533 3716
 
4534
-		if (!inst.inline) {
4535
-			showAnim = $.datepicker._get(inst, "showAnim");
4536
-			duration = $.datepicker._get(inst, "duration");
4537
-			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
4538
-			$.datepicker._datepickerShowing = true;
3717
+/*!
3718
+ * jQuery UI Effects Puff 1.13.2
3719
+ * http://jqueryui.com
3720
+ *
3721
+ * Copyright jQuery Foundation and other contributors
3722
+ * Released under the MIT license.
3723
+ * http://jquery.org/license
3724
+ */
4539 3725
 
4540
-			if ( $.effects && $.effects.effect[ showAnim ] ) {
4541
-				inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration);
4542
-			} else {
4543
-				inst.dpDiv[showAnim || "show"](showAnim ? duration : null);
4544
-			}
3726
+//>>label: Puff Effect
3727
+//>>group: Effects
3728
+//>>description: Creates a puff effect by scaling the element up and hiding it at the same time.
3729
+//>>docs: http://api.jqueryui.com/puff-effect/
3730
+//>>demos: http://jqueryui.com/effect/
4545 3731
 
4546
-			if ( $.datepicker._shouldFocusInput( inst ) ) {
4547
-				inst.input.focus();
4548
-			}
4549 3732
 
4550
-			$.datepicker._curInst = inst;
4551
-		}
4552
-	},
3733
+var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) {
3734
+	var newOptions = $.extend( true, {}, options, {
3735
+		fade: true,
3736
+		percent: parseInt( options.percent, 10 ) || 150
3737
+	} );
4553 3738
 
4554
-	/* Generate the date picker content. */
4555
-	_updateDatepicker: function(inst) {
4556
-		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
4557
-		datepicker_instActive = inst; // for delegate hover events
4558
-		inst.dpDiv.empty().append(this._generateHTML(inst));
4559
-		this._attachHandlers(inst);
3739
+	$.effects.effect.scale.call( this, newOptions, done );
3740
+} );
4560 3741
 
4561
-		var origyearshtml,
4562
-			numMonths = this._getNumberOfMonths(inst),
4563
-			cols = numMonths[1],
4564
-			width = 17,
4565
-			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" );
4566 3742
 
4567
-		if ( activeCell.length > 0 ) {
4568
-			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
4569
-		}
3743
+/*!
3744
+ * jQuery UI Effects Pulsate 1.13.2
3745
+ * http://jqueryui.com
3746
+ *
3747
+ * Copyright jQuery Foundation and other contributors
3748
+ * Released under the MIT license.
3749
+ * http://jquery.org/license
3750
+ */
4570 3751
 
4571
-		inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
4572
-		if (cols > 1) {
4573
-			inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em");
4574
-		}
4575
-		inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") +
4576
-			"Class"]("ui-datepicker-multi");
4577
-		inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") +
4578
-			"Class"]("ui-datepicker-rtl");
3752
+//>>label: Pulsate Effect
3753
+//>>group: Effects
3754
+//>>description: Pulsates an element n times by changing the opacity to zero and back.
3755
+//>>docs: http://api.jqueryui.com/pulsate-effect/
3756
+//>>demos: http://jqueryui.com/effect/
4579 3757
 
4580
-		if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
4581
-			inst.input.focus();
4582
-		}
4583 3758
 
4584
-		// deffered render of the years select (to avoid flashes on Firefox)
4585
-		if( inst.yearshtml ){
4586
-			origyearshtml = inst.yearshtml;
4587
-			setTimeout(function(){
4588
-				//assure that inst.yearshtml didn't change.
4589
-				if( origyearshtml === inst.yearshtml && inst.yearshtml ){
4590
-					inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml);
3759
+var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) {
3760
+	var element = $( this ),
3761
+		mode = options.mode,
3762
+		show = mode === "show",
3763
+		hide = mode === "hide",
3764
+		showhide = show || hide,
3765
+
3766
+		// Showing or hiding leaves off the "last" animation
3767
+		anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
3768
+		duration = options.duration / anims,
3769
+		animateTo = 0,
3770
+		i = 1,
3771
+		queuelen = element.queue().length;
3772
+
3773
+	if ( show || !element.is( ":visible" ) ) {
3774
+		element.css( "opacity", 0 ).show();
3775
+		animateTo = 1;
4591 3776
 	}
4592
-				origyearshtml = inst.yearshtml = null;
4593
-			}, 0);
3777
+
3778
+	// Anims - 1 opacity "toggles"
3779
+	for ( ; i < anims; i++ ) {
3780
+		element.animate( { opacity: animateTo }, duration, options.easing );
3781
+		animateTo = 1 - animateTo;
4594 3782
 	}
4595
-	},
4596 3783
 
4597
-	// #6694 - don't focus the input if it's already focused
4598
-	// this breaks the change event in IE
4599
-	// Support: IE and jQuery <1.9
4600
-	_shouldFocusInput: function( inst ) {
4601
-		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
4602
-	},
3784
+	element.animate( { opacity: animateTo }, duration, options.easing );
4603 3785
 
4604
-	/* Check positioning to remain on screen. */
4605
-	_checkOffset: function(inst, offset, isFixed) {
4606
-		var dpWidth = inst.dpDiv.outerWidth(),
4607
-			dpHeight = inst.dpDiv.outerHeight(),
4608
-			inputWidth = inst.input ? inst.input.outerWidth() : 0,
4609
-			inputHeight = inst.input ? inst.input.outerHeight() : 0,
4610
-			viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
4611
-			viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
3786
+	element.queue( done );
4612 3787
 
4613
-		offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0);
4614
-		offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0;
4615
-		offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
3788
+	$.effects.unshift( element, queuelen, anims + 1 );
3789
+} );
4616 3790
 
4617
-		// now check if datepicker is showing outside window viewport - move to a better place if so.
4618
-		offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
4619
-			Math.abs(offset.left + dpWidth - viewWidth) : 0);
4620
-		offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
4621
-			Math.abs(dpHeight + inputHeight) : 0);
4622 3791
 
4623
-		return offset;
4624
-	},
3792
+/*!
3793
+ * jQuery UI Effects Shake 1.13.2
3794
+ * http://jqueryui.com
3795
+ *
3796
+ * Copyright jQuery Foundation and other contributors
3797
+ * Released under the MIT license.
3798
+ * http://jquery.org/license
3799
+ */
4625 3800
 
4626
-	/* Find an object's position on the screen. */
4627
-	_findPos: function(obj) {
4628
-		var position,
4629
-			inst = this._getInst(obj),
4630
-			isRTL = this._get(inst, "isRTL");
3801
+//>>label: Shake Effect
3802
+//>>group: Effects
3803
+//>>description: Shakes an element horizontally or vertically n times.
3804
+//>>docs: http://api.jqueryui.com/shake-effect/
3805
+//>>demos: http://jqueryui.com/effect/
4631 3806
 
4632
-		while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
4633
-			obj = obj[isRTL ? "previousSibling" : "nextSibling"];
4634
-		}
4635 3807
 
4636
-		position = $(obj).offset();
4637
-		return [position.left, position.top];
4638
-	},
3808
+var effectsEffectShake = $.effects.define( "shake", function( options, done ) {
4639 3809
 
4640
-	/* Hide the date picker from view.
4641
-	 * @param  input  element - the input field attached to the date picker
4642
-	 */
4643
-	_hideDatepicker: function(input) {
4644
-		var showAnim, duration, postProcess, onClose,
4645
-			inst = this._curInst;
3810
+	var i = 1,
3811
+		element = $( this ),
3812
+		direction = options.direction || "left",
3813
+		distance = options.distance || 20,
3814
+		times = options.times || 3,
3815
+		anims = times * 2 + 1,
3816
+		speed = Math.round( options.duration / anims ),
3817
+		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3818
+		positiveMotion = ( direction === "up" || direction === "left" ),
3819
+		animation = {},
3820
+		animation1 = {},
3821
+		animation2 = {},
4646 3822
 
4647
-		if (!inst || (input && inst !== $.data(input, "datepicker"))) {
4648
-			return;
4649
-		}
3823
+		queuelen = element.queue().length;
4650 3824
 
4651
-		if (this._datepickerShowing) {
4652
-			showAnim = this._get(inst, "showAnim");
4653
-			duration = this._get(inst, "duration");
4654
-			postProcess = function() {
4655
-				$.datepicker._tidyDialog(inst);
4656
-			};
3825
+	$.effects.createPlaceholder( element );
4657 3826
 
4658
-			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
4659
-			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
4660
-				inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess);
4661
-			} else {
4662
-				inst.dpDiv[(showAnim === "slideDown" ? "slideUp" :
4663
-					(showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess);
4664
-			}
3827
+	// Animation
3828
+	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
3829
+	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
3830
+	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
4665 3831
 
4666
-			if (!showAnim) {
4667
-				postProcess();
4668
-			}
4669
-			this._datepickerShowing = false;
3832
+	// Animate
3833
+	element.animate( animation, speed, options.easing );
4670 3834
 
4671
-			onClose = this._get(inst, "onClose");
4672
-			if (onClose) {
4673
-				onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]);
3835
+	// Shakes
3836
+	for ( ; i < times; i++ ) {
3837
+		element
3838
+			.animate( animation1, speed, options.easing )
3839
+			.animate( animation2, speed, options.easing );
4674 3840
 	}
4675 3841
 
4676
-			this._lastInput = null;
4677
-			if (this._inDialog) {
4678
-				this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" });
4679
-				if ($.blockUI) {
4680
-					$.unblockUI();
4681
-					$("body").append(this.dpDiv);
4682
-				}
4683
-			}
4684
-			this._inDialog = false;
4685
-		}
4686
-	},
3842
+	element
3843
+		.animate( animation1, speed, options.easing )
3844
+		.animate( animation, speed / 2, options.easing )
3845
+		.queue( done );
4687 3846
 
4688
-	/* Tidy up after a dialog display. */
4689
-	_tidyDialog: function(inst) {
4690
-		inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar");
3847
+	$.effects.unshift( element, queuelen, anims + 1 );
3848
+} );
3849
+
3850
+
3851
+/*!
3852
+ * jQuery UI Effects Slide 1.13.2
3853
+ * http://jqueryui.com
3854
+ *
3855
+ * Copyright jQuery Foundation and other contributors
3856
+ * Released under the MIT license.
3857
+ * http://jquery.org/license
3858
+ */
3859
+
3860
+//>>label: Slide Effect
3861
+//>>group: Effects
3862
+//>>description: Slides an element in and out of the viewport.
3863
+//>>docs: http://api.jqueryui.com/slide-effect/
3864
+//>>demos: http://jqueryui.com/effect/
3865
+
3866
+
3867
+var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) {
3868
+	var startClip, startRef,
3869
+		element = $( this ),
3870
+		map = {
3871
+			up: [ "bottom", "top" ],
3872
+			down: [ "top", "bottom" ],
3873
+			left: [ "right", "left" ],
3874
+			right: [ "left", "right" ]
4691 3875
 		},
3876
+		mode = options.mode,
3877
+		direction = options.direction || "left",
3878
+		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
3879
+		positiveMotion = ( direction === "up" || direction === "left" ),
3880
+		distance = options.distance ||
3881
+			element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ),
3882
+		animation = {};
4692 3883
 
4693
-	/* Close date picker if clicked elsewhere. */
4694
-	_checkExternalClick: function(event) {
4695
-		if (!$.datepicker._curInst) {
4696
-			return;
4697
-		}
3884
+	$.effects.createPlaceholder( element );
4698 3885
 
4699
-		var $target = $(event.target),
4700
-			inst = $.datepicker._getInst($target[0]);
3886
+	startClip = element.cssClip();
3887
+	startRef = element.position()[ ref ];
4701 3888
 
4702
-		if ( ( ( $target[0].id !== $.datepicker._mainDivId &&
4703
-				$target.parents("#" + $.datepicker._mainDivId).length === 0 &&
4704
-				!$target.hasClass($.datepicker.markerClassName) &&
4705
-				!$target.closest("." + $.datepicker._triggerClass).length &&
4706
-				$.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
4707
-			( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) {
4708
-				$.datepicker._hideDatepicker();
3889
+	// Define hide animation
3890
+	animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef;
3891
+	animation.clip = element.cssClip();
3892
+	animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ];
3893
+
3894
+	// Reverse the animation if we're showing
3895
+	if ( mode === "show" ) {
3896
+		element.cssClip( animation.clip );
3897
+		element.css( ref, animation[ ref ] );
3898
+		animation.clip = startClip;
3899
+		animation[ ref ] = startRef;
4709 3900
 	}
4710
-	},
4711 3901
 
4712
-	/* Adjust one of the date sub-fields. */
4713
-	_adjustDate: function(id, offset, period) {
4714
-		var target = $(id),
4715
-			inst = this._getInst(target[0]);
3902
+	// Actually animate
3903
+	element.animate( animation, {
3904
+		queue: false,
3905
+		duration: options.duration,
3906
+		easing: options.easing,
3907
+		complete: done
3908
+	} );
3909
+} );
4716 3910
 
4717
-		if (this._isDisabledDatepicker(target[0])) {
4718
-			return;
4719
-		}
4720
-		this._adjustInstDate(inst, offset +
4721
-			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
4722
-			period);
4723
-		this._updateDatepicker(inst);
4724
-	},
4725 3911
 
4726
-	/* Action for current link. */
4727
-	_gotoToday: function(id) {
4728
-		var date,
4729
-			target = $(id),
4730
-			inst = this._getInst(target[0]);
3912
+/*!
3913
+ * jQuery UI Effects Transfer 1.13.2
3914
+ * http://jqueryui.com
3915
+ *
3916
+ * Copyright jQuery Foundation and other contributors
3917
+ * Released under the MIT license.
3918
+ * http://jquery.org/license
3919
+ */
4731 3920
 
4732
-		if (this._get(inst, "gotoCurrent") && inst.currentDay) {
4733
-			inst.selectedDay = inst.currentDay;
4734
-			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
4735
-			inst.drawYear = inst.selectedYear = inst.currentYear;
4736
-		} else {
4737
-			date = new Date();
4738
-			inst.selectedDay = date.getDate();
4739
-			inst.drawMonth = inst.selectedMonth = date.getMonth();
4740
-			inst.drawYear = inst.selectedYear = date.getFullYear();
3921
+//>>label: Transfer Effect
3922
+//>>group: Effects
3923
+//>>description: Displays a transfer effect from one element to another.
3924
+//>>docs: http://api.jqueryui.com/transfer-effect/
3925
+//>>demos: http://jqueryui.com/effect/
3926
+
3927
+
3928
+var effect;
3929
+if ( $.uiBackCompat !== false ) {
3930
+	effect = $.effects.define( "transfer", function( options, done ) {
3931
+		$( this ).transfer( options, done );
3932
+	} );
4741 3933
 }
4742
-		this._notifyChange(inst);
4743
-		this._adjustDate(target);
4744
-	},
3934
+var effectsEffectTransfer = effect;
4745 3935
 
4746
-	/* Action for selecting a new month/year. */
4747
-	_selectMonthYear: function(id, select, period) {
4748
-		var target = $(id),
4749
-			inst = this._getInst(target[0]);
4750 3936
 
4751
-		inst["selected" + (period === "M" ? "Month" : "Year")] =
4752
-		inst["draw" + (period === "M" ? "Month" : "Year")] =
4753
-			parseInt(select.options[select.selectedIndex].value,10);
3937
+/*!
3938
+ * jQuery UI Focusable 1.13.2
3939
+ * http://jqueryui.com
3940
+ *
3941
+ * Copyright jQuery Foundation and other contributors
3942
+ * Released under the MIT license.
3943
+ * http://jquery.org/license
3944
+ */
4754 3945
 
4755
-		this._notifyChange(inst);
4756
-		this._adjustDate(target);
4757
-	},
3946
+//>>label: :focusable Selector
3947
+//>>group: Core
3948
+//>>description: Selects elements which can be focused.
3949
+//>>docs: http://api.jqueryui.com/focusable-selector/
4758 3950
 
4759
-	/* Action for selecting a day. */
4760
-	_selectDay: function(id, month, year, td) {
4761
-		var inst,
4762
-			target = $(id);
4763 3951
 
4764
-		if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
4765
-			return;
4766
-		}
3952
+// Selectors
3953
+$.ui.focusable = function( element, hasTabindex ) {
3954
+	var map, mapName, img, focusableIfVisible, fieldset,
3955
+		nodeName = element.nodeName.toLowerCase();
4767 3956
 
4768
-		inst = this._getInst(target[0]);
4769
-		inst.selectedDay = inst.currentDay = $("a", td).html();
4770
-		inst.selectedMonth = inst.currentMonth = month;
4771
-		inst.selectedYear = inst.currentYear = year;
4772
-		this._selectDate(id, this._formatDate(inst,
4773
-			inst.currentDay, inst.currentMonth, inst.currentYear));
4774
-	},
3957
+	if ( "area" === nodeName ) {
3958
+		map = element.parentNode;
3959
+		mapName = map.name;
3960
+		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
3961
+			return false;
3962
+		}
3963
+		img = $( "img[usemap='#" + mapName + "']" );
3964
+		return img.length > 0 && img.is( ":visible" );
3965
+	}
4775 3966
 
4776
-	/* Erase the input field and hide the date picker. */
4777
-	_clearDate: function(id) {
4778
-		var target = $(id);
4779
-		this._selectDate(target, "");
4780
-	},
3967
+	if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) {
3968
+		focusableIfVisible = !element.disabled;
4781 3969
 
4782
-	/* Update the input field with the selected date. */
4783
-	_selectDate: function(id, dateStr) {
4784
-		var onSelect,
4785
-			target = $(id),
4786
-			inst = this._getInst(target[0]);
3970
+		if ( focusableIfVisible ) {
4787 3971
 
4788
-		dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
4789
-		if (inst.input) {
4790
-			inst.input.val(dateStr);
3972
+			// Form controls within a disabled fieldset are disabled.
3973
+			// However, controls within the fieldset's legend do not get disabled.
3974
+			// Since controls generally aren't placed inside legends, we skip
3975
+			// this portion of the check.
3976
+			fieldset = $( element ).closest( "fieldset" )[ 0 ];
3977
+			if ( fieldset ) {
3978
+				focusableIfVisible = !fieldset.disabled;
4791 3979
 			}
4792
-		this._updateAlternate(inst);
4793
-
4794
-		onSelect = this._get(inst, "onSelect");
4795
-		if (onSelect) {
4796
-			onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);  // trigger custom callback
4797
-		} else if (inst.input) {
4798
-			inst.input.trigger("change"); // fire the change event
4799 3980
 		}
4800
-
4801
-		if (inst.inline){
4802
-			this._updateDatepicker(inst);
3981
+	} else if ( "a" === nodeName ) {
3982
+		focusableIfVisible = element.href || hasTabindex;
4803 3983
 	} else {
4804
-			this._hideDatepicker();
4805
-			this._lastInput = inst.input[0];
4806
-			if (typeof(inst.input[0]) !== "object") {
4807
-				inst.input.focus(); // restore focus
4808
-			}
4809
-			this._lastInput = null;
3984
+		focusableIfVisible = hasTabindex;
4810 3985
 	}
4811
-	},
4812 3986
 
4813
-	/* Update any alternate field to synchronise with the main field. */
4814
-	_updateAlternate: function(inst) {
4815
-		var altFormat, date, dateStr,
4816
-			altField = this._get(inst, "altField");
3987
+	return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) );
3988
+};
4817 3989
 
4818
-		if (altField) { // update alternate field too
4819
-			altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
4820
-			date = this._getDate(inst);
4821
-			dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
4822
-			$(altField).each(function() { $(this).val(dateStr); });
3990
+// Support: IE 8 only
3991
+// IE 8 doesn't resolve inherit to visible/hidden for computed values
3992
+function visible( element ) {
3993
+	var visibility = element.css( "visibility" );
3994
+	while ( visibility === "inherit" ) {
3995
+		element = element.parent();
3996
+		visibility = element.css( "visibility" );
3997
+	}
3998
+	return visibility === "visible";
4823 3999
 }
4824
-	},
4825 4000
 
4826
-	/* Set as beforeShowDay function to prevent selection of weekends.
4827
-	 * @param  date  Date - the date to customise
4828
-	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
4829
-	 */
4830
-	noWeekends: function(date) {
4831
-		var day = date.getDay();
4832
-		return [(day > 0 && day < 6), ""];
4833
-	},
4001
+$.extend( $.expr.pseudos, {
4002
+	focusable: function( element ) {
4003
+		return $.ui.focusable( element, $.attr( element, "tabindex" ) != null );
4004
+	}
4005
+} );
4834 4006
 
4835
-	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
4836
-	 * @param  date  Date - the date to get the week for
4837
-	 * @return  number - the number of the week within the year that contains this date
4838
-	 */
4839
-	iso8601Week: function(date) {
4840
-		var time,
4841
-			checkDate = new Date(date.getTime());
4007
+var focusable = $.ui.focusable;
4842 4008
 
4843
-		// Find Thursday of this week starting on Monday
4844
-		checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
4845 4009
 
4846
-		time = checkDate.getTime();
4847
-		checkDate.setMonth(0); // Compare with Jan 1
4848
-		checkDate.setDate(1);
4849
-		return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
4850
-	},
4851 4010
 
4852
-	/* Parse a string value into a date object.
4853
-	 * See formatDate below for the possible formats.
4011
+// Support: IE8 Only
4012
+// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop
4013
+// with a string, so we need to find the proper form.
4014
+var form = $.fn._form = function() {
4015
+	return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form );
4016
+};
4017
+
4018
+
4019
+/*!
4020
+ * jQuery UI Form Reset Mixin 1.13.2
4021
+ * http://jqueryui.com
4854 4022
  *
4855
-	 * @param  format string - the expected format of the date
4856
-	 * @param  value string - the date in the above format
4857
-	 * @param  settings Object - attributes include:
4858
-	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
4859
-	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
4860
-	 *					dayNames		string[7] - names of the days from Sunday (optional)
4861
-	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
4862
-	 *					monthNames		string[12] - names of the months (optional)
4863
-	 * @return  Date - the extracted date value or null if value is blank
4023
+ * Copyright jQuery Foundation and other contributors
4024
+ * Released under the MIT license.
4025
+ * http://jquery.org/license
4864 4026
  */
4865
-	parseDate: function (format, value, settings) {
4866
-		if (format == null || value == null) {
4867
-			throw "Invalid arguments";
4868
-		}
4869 4027
 
4870
-		value = (typeof value === "object" ? value.toString() : value + "");
4871
-		if (value === "") {
4872
-			return null;
4873
-		}
4028
+//>>label: Form Reset Mixin
4029
+//>>group: Core
4030
+//>>description: Refresh input widgets when their form is reset
4031
+//>>docs: http://api.jqueryui.com/form-reset-mixin/
4874 4032
 
4875
-		var iFormat, dim, extra,
4876
-			iValue = 0,
4877
-			shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
4878
-			shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
4879
-				new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)),
4880
-			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
4881
-			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
4882
-			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
4883
-			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
4884
-			year = -1,
4885
-			month = -1,
4886
-			day = -1,
4887
-			doy = -1,
4888
-			literal = false,
4889
-			date,
4890
-			// Check whether a format character is doubled
4891
-			lookAhead = function(match) {
4892
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
4893
-				if (matches) {
4894
-					iFormat++;
4895
-				}
4896
-				return matches;
4033
+
4034
+var formResetMixin = $.ui.formResetMixin = {
4035
+	_formResetHandler: function() {
4036
+		var form = $( this );
4037
+
4038
+		// Wait for the form reset to actually happen before refreshing
4039
+		setTimeout( function() {
4040
+			var instances = form.data( "ui-form-reset-instances" );
4041
+			$.each( instances, function() {
4042
+				this.refresh();
4043
+			} );
4044
+		} );
4897 4045
 	},
4898
-			// Extract a number from the string value
4899
-			getNumber = function(match) {
4900
-				var isDoubled = lookAhead(match),
4901
-					size = (match === "@" ? 14 : (match === "!" ? 20 :
4902
-					(match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))),
4903
-					minSize = (match === "y" ? size : 1),
4904
-					digits = new RegExp("^\\d{" + minSize + "," + size + "}"),
4905
-					num = value.substring(iValue).match(digits);
4906
-				if (!num) {
4907
-					throw "Missing number at position " + iValue;
4046
+
4047
+	_bindFormResetHandler: function() {
4048
+		this.form = this.element._form();
4049
+		if ( !this.form.length ) {
4050
+			return;
4908 4051
 		}
4909
-				iValue += num[0].length;
4910
-				return parseInt(num[0], 10);
4052
+
4053
+		var instances = this.form.data( "ui-form-reset-instances" ) || [];
4054
+		if ( !instances.length ) {
4055
+
4056
+			// We don't use _on() here because we use a single event handler per form
4057
+			this.form.on( "reset.ui-form-reset", this._formResetHandler );
4058
+		}
4059
+		instances.push( this );
4060
+		this.form.data( "ui-form-reset-instances", instances );
4911 4061
 	},
4912
-			// Extract a name from the string value and convert to an index
4913
-			getName = function(match, shortNames, longNames) {
4914
-				var index = -1,
4915
-					names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
4916
-						return [ [k, v] ];
4917
-					}).sort(function (a, b) {
4918
-						return -(a[1].length - b[1].length);
4919
-					});
4920 4062
 
4921
-				$.each(names, function (i, pair) {
4922
-					var name = pair[1];
4923
-					if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
4924
-						index = pair[0];
4925
-						iValue += name.length;
4926
-						return false;
4063
+	_unbindFormResetHandler: function() {
4064
+		if ( !this.form.length ) {
4065
+			return;
4927 4066
 		}
4928
-				});
4929
-				if (index !== -1) {
4930
-					return index + 1;
4067
+
4068
+		var instances = this.form.data( "ui-form-reset-instances" );
4069
+		instances.splice( $.inArray( this, instances ), 1 );
4070
+		if ( instances.length ) {
4071
+			this.form.data( "ui-form-reset-instances", instances );
4931 4072
 		} else {
4932
-					throw "Unknown name at position " + iValue;
4073
+			this.form
4074
+				.removeData( "ui-form-reset-instances" )
4075
+				.off( "reset.ui-form-reset" );
4933 4076
 		}
4934
-			},
4935
-			// Confirm that a literal character matches the string value
4936
-			checkLiteral = function() {
4937
-				if (value.charAt(iValue) !== format.charAt(iFormat)) {
4938
-					throw "Unexpected literal at position " + iValue;
4939 4077
 	}
4940
-				iValue++;
4941 4078
 };
4942 4079
 
4943
-		for (iFormat = 0; iFormat < format.length; iFormat++) {
4944
-			if (literal) {
4945
-				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
4946
-					literal = false;
4947
-				} else {
4948
-					checkLiteral();
4949
-				}
4950
-			} else {
4951
-				switch (format.charAt(iFormat)) {
4952
-					case "d":
4953
-						day = getNumber("d");
4954
-						break;
4955
-					case "D":
4956
-						getName("D", dayNamesShort, dayNames);
4957
-						break;
4958
-					case "o":
4959
-						doy = getNumber("o");
4960
-						break;
4961
-					case "m":
4962
-						month = getNumber("m");
4963
-						break;
4964
-					case "M":
4965
-						month = getName("M", monthNamesShort, monthNames);
4966
-						break;
4967
-					case "y":
4968
-						year = getNumber("y");
4969
-						break;
4970
-					case "@":
4971
-						date = new Date(getNumber("@"));
4972
-						year = date.getFullYear();
4973
-						month = date.getMonth() + 1;
4974
-						day = date.getDate();
4975
-						break;
4976
-					case "!":
4977
-						date = new Date((getNumber("!") - this._ticksTo1970) / 10000);
4978
-						year = date.getFullYear();
4979
-						month = date.getMonth() + 1;
4980
-						day = date.getDate();
4981
-						break;
4982
-					case "'":
4983
-						if (lookAhead("'")){
4984
-							checkLiteral();
4985
-						} else {
4986
-							literal = true;
4987
-						}
4988
-						break;
4989
-					default:
4990
-						checkLiteral();
4991
-				}
4080
+
4081
+/*!
4082
+ * jQuery UI Support for jQuery core 1.8.x and newer 1.13.2
4083
+ * http://jqueryui.com
4084
+ *
4085
+ * Copyright jQuery Foundation and other contributors
4086
+ * Released under the MIT license.
4087
+ * http://jquery.org/license
4088
+ *
4089
+ */
4090
+
4091
+//>>label: jQuery 1.8+ Support
4092
+//>>group: Core
4093
+//>>description: Support version 1.8.x and newer of jQuery core
4094
+
4095
+
4096
+// Support: jQuery 1.9.x or older
4097
+// $.expr[ ":" ] is deprecated.
4098
+if ( !$.expr.pseudos ) {
4099
+	$.expr.pseudos = $.expr[ ":" ];
4992 4100
 }
4101
+
4102
+// Support: jQuery 1.11.x or older
4103
+// $.unique has been renamed to $.uniqueSort
4104
+if ( !$.uniqueSort ) {
4105
+	$.uniqueSort = $.unique;
4993 4106
 }
4994 4107
 
4995
-		if (iValue < value.length){
4996
-			extra = value.substr(iValue);
4997
-			if (!/^\s+/.test(extra)) {
4998
-				throw "Extra/unparsed characters found in date: " + extra;
4108
+// Support: jQuery 2.2.x or older.
4109
+// This method has been defined in jQuery 3.0.0.
4110
+// Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js
4111
+if ( !$.escapeSelector ) {
4112
+
4113
+	// CSS string/identifier serialization
4114
+	// https://drafts.csswg.org/cssom/#common-serializing-idioms
4115
+	var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
4116
+
4117
+	var fcssescape = function( ch, asCodePoint ) {
4118
+		if ( asCodePoint ) {
4119
+
4120
+			// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
4121
+			if ( ch === "\0" ) {
4122
+				return "\uFFFD";
4999 4123
 			}
4124
+
4125
+			// Control characters and (dependent upon position) numbers get escaped as code points
4126
+			return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
5000 4127
 		}
5001 4128
 
5002
-		if (year === -1) {
5003
-			year = new Date().getFullYear();
5004
-		} else if (year < 100) {
5005
-			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
5006
-				(year <= shortYearCutoff ? 0 : -100);
4129
+		// Other potentially-special ASCII characters get backslash-escaped
4130
+		return "\\" + ch;
4131
+	};
4132
+
4133
+	$.escapeSelector = function( sel ) {
4134
+		return ( sel + "" ).replace( rcssescape, fcssescape );
4135
+	};
5007 4136
 }
5008 4137
 
5009
-		if (doy > -1) {
5010
-			month = 1;
5011
-			day = doy;
5012
-			do {
5013
-				dim = this._getDaysInMonth(year, month - 1);
5014
-				if (day <= dim) {
5015
-					break;
4138
+// Support: jQuery 3.4.x or older
4139
+// These methods have been defined in jQuery 3.5.0.
4140
+if ( !$.fn.even || !$.fn.odd ) {
4141
+	$.fn.extend( {
4142
+		even: function() {
4143
+			return this.filter( function( i ) {
4144
+				return i % 2 === 0;
4145
+			} );
4146
+		},
4147
+		odd: function() {
4148
+			return this.filter( function( i ) {
4149
+				return i % 2 === 1;
4150
+			} );
5016 4151
 		}
5017
-				month++;
5018
-				day -= dim;
5019
-			} while (true);
4152
+	} );
5020 4153
 }
5021 4154
 
5022
-		date = this._daylightSavingAdjust(new Date(year, month - 1, day));
5023
-		if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
5024
-			throw "Invalid date"; // E.g. 31/02/00
5025
-		}
5026
-		return date;
5027
-	},
4155
+;
4156
+/*!
4157
+ * jQuery UI Keycode 1.13.2
4158
+ * http://jqueryui.com
4159
+ *
4160
+ * Copyright jQuery Foundation and other contributors
4161
+ * Released under the MIT license.
4162
+ * http://jquery.org/license
4163
+ */
5028 4164
 
5029
-	/* Standard date formats. */
5030
-	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
5031
-	COOKIE: "D, dd M yy",
5032
-	ISO_8601: "yy-mm-dd",
5033
-	RFC_822: "D, d M y",
5034
-	RFC_850: "DD, dd-M-y",
5035
-	RFC_1036: "D, d M y",
5036
-	RFC_1123: "D, d M yy",
5037
-	RFC_2822: "D, d M yy",
5038
-	RSS: "D, d M y", // RFC 822
5039
-	TICKS: "!",
5040
-	TIMESTAMP: "@",
5041
-	W3C: "yy-mm-dd", // ISO 8601
4165
+//>>label: Keycode
4166
+//>>group: Core
4167
+//>>description: Provide keycodes as keynames
4168
+//>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/
5042 4169
 
5043
-	_ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
5044
-		Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
5045 4170
 
5046
-	/* Format a date object into a string value.
5047
-	 * The format can be combinations of the following:
5048
-	 * d  - day of month (no leading zero)
5049
-	 * dd - day of month (two digit)
5050
-	 * o  - day of year (no leading zeros)
5051
-	 * oo - day of year (three digit)
5052
-	 * D  - day name short
5053
-	 * DD - day name long
5054
-	 * m  - month of year (no leading zero)
5055
-	 * mm - month of year (two digit)
5056
-	 * M  - month name short
5057
-	 * MM - month name long
5058
-	 * y  - year (two digit)
5059
-	 * yy - year (four digit)
5060
-	 * @ - Unix timestamp (ms since 01/01/1970)
5061
-	 * ! - Windows ticks (100ns since 01/01/0001)
5062
-	 * "..." - literal text
5063
-	 * '' - single quote
4171
+var keycode = $.ui.keyCode = {
4172
+	BACKSPACE: 8,
4173
+	COMMA: 188,
4174
+	DELETE: 46,
4175
+	DOWN: 40,
4176
+	END: 35,
4177
+	ENTER: 13,
4178
+	ESCAPE: 27,
4179
+	HOME: 36,
4180
+	LEFT: 37,
4181
+	PAGE_DOWN: 34,
4182
+	PAGE_UP: 33,
4183
+	PERIOD: 190,
4184
+	RIGHT: 39,
4185
+	SPACE: 32,
4186
+	TAB: 9,
4187
+	UP: 38
4188
+};
4189
+
4190
+
4191
+/*!
4192
+ * jQuery UI Labels 1.13.2
4193
+ * http://jqueryui.com
5064 4194
  *
5065
-	 * @param  format string - the desired format of the date
5066
-	 * @param  date Date - the date value to format
5067
-	 * @param  settings Object - attributes include:
5068
-	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
5069
-	 *					dayNames		string[7] - names of the days from Sunday (optional)
5070
-	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
5071
-	 *					monthNames		string[12] - names of the months (optional)
5072
-	 * @return  string - the date in the above format
4195
+ * Copyright jQuery Foundation and other contributors
4196
+ * Released under the MIT license.
4197
+ * http://jquery.org/license
5073 4198
  */
5074
-	formatDate: function (format, date, settings) {
5075
-		if (!date) {
5076
-			return "";
4199
+
4200
+//>>label: labels
4201
+//>>group: Core
4202
+//>>description: Find all the labels associated with a given input
4203
+//>>docs: http://api.jqueryui.com/labels/
4204
+
4205
+
4206
+var labels = $.fn.labels = function() {
4207
+	var ancestor, selector, id, labels, ancestors;
4208
+
4209
+	if ( !this.length ) {
4210
+		return this.pushStack( [] );
5077 4211
 	}
5078 4212
 
5079
-		var iFormat,
5080
-			dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
5081
-			dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
5082
-			monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
5083
-			monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
5084
-			// Check whether a format character is doubled
5085
-			lookAhead = function(match) {
5086
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
5087
-				if (matches) {
5088
-					iFormat++;
4213
+	// Check control.labels first
4214
+	if ( this[ 0 ].labels && this[ 0 ].labels.length ) {
4215
+		return this.pushStack( this[ 0 ].labels );
5089 4216
 	}
5090
-				return matches;
5091
-			},
5092
-			// Format a number, with leading zero if necessary
5093
-			formatNumber = function(match, value, len) {
5094
-				var num = "" + value;
5095
-				if (lookAhead(match)) {
5096
-					while (num.length < len) {
5097
-						num = "0" + num;
4217
+
4218
+	// Support: IE <= 11, FF <= 37, Android <= 2.3 only
4219
+	// Above browsers do not support control.labels. Everything below is to support them
4220
+	// as well as document fragments. control.labels does not work on document fragments
4221
+	labels = this.eq( 0 ).parents( "label" );
4222
+
4223
+	// Look for the label based on the id
4224
+	id = this.attr( "id" );
4225
+	if ( id ) {
4226
+
4227
+		// We don't search against the document in case the element
4228
+		// is disconnected from the DOM
4229
+		ancestor = this.eq( 0 ).parents().last();
4230
+
4231
+		// Get a full set of top level ancestors
4232
+		ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() );
4233
+
4234
+		// Create a selector for the label based on the id
4235
+		selector = "label[for='" + $.escapeSelector( id ) + "']";
4236
+
4237
+		labels = labels.add( ancestors.find( selector ).addBack( selector ) );
4238
+
5098 4239
 	}
4240
+
4241
+	// Return whatever we have found for labels
4242
+	return this.pushStack( labels );
4243
+};
4244
+
4245
+
4246
+/*!
4247
+ * jQuery UI Scroll Parent 1.13.2
4248
+ * http://jqueryui.com
4249
+ *
4250
+ * Copyright jQuery Foundation and other contributors
4251
+ * Released under the MIT license.
4252
+ * http://jquery.org/license
4253
+ */
4254
+
4255
+//>>label: scrollParent
4256
+//>>group: Core
4257
+//>>description: Get the closest ancestor element that is scrollable.
4258
+//>>docs: http://api.jqueryui.com/scrollParent/
4259
+
4260
+
4261
+var scrollParent = $.fn.scrollParent = function( includeHidden ) {
4262
+	var position = this.css( "position" ),
4263
+		excludeStaticParent = position === "absolute",
4264
+		overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,
4265
+		scrollParent = this.parents().filter( function() {
4266
+			var parent = $( this );
4267
+			if ( excludeStaticParent && parent.css( "position" ) === "static" ) {
4268
+				return false;
5099 4269
 			}
5100
-				return num;
5101
-			},
5102
-			// Format a name, short or long as requested
5103
-			formatName = function(match, value, shortNames, longNames) {
5104
-				return (lookAhead(match) ? longNames[value] : shortNames[value]);
5105
-			},
5106
-			output = "",
5107
-			literal = false;
4270
+			return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) +
4271
+				parent.css( "overflow-x" ) );
4272
+		} ).eq( 0 );
5108 4273
 
5109
-		if (date) {
5110
-			for (iFormat = 0; iFormat < format.length; iFormat++) {
5111
-				if (literal) {
5112
-					if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
5113
-						literal = false;
5114
-					} else {
5115
-						output += format.charAt(iFormat);
4274
+	return position === "fixed" || !scrollParent.length ?
4275
+		$( this[ 0 ].ownerDocument || document ) :
4276
+		scrollParent;
4277
+};
4278
+
4279
+
4280
+/*!
4281
+ * jQuery UI Tabbable 1.13.2
4282
+ * http://jqueryui.com
4283
+ *
4284
+ * Copyright jQuery Foundation and other contributors
4285
+ * Released under the MIT license.
4286
+ * http://jquery.org/license
4287
+ */
4288
+
4289
+//>>label: :tabbable Selector
4290
+//>>group: Core
4291
+//>>description: Selects elements which can be tabbed to.
4292
+//>>docs: http://api.jqueryui.com/tabbable-selector/
4293
+
4294
+
4295
+var tabbable = $.extend( $.expr.pseudos, {
4296
+	tabbable: function( element ) {
4297
+		var tabIndex = $.attr( element, "tabindex" ),
4298
+			hasTabindex = tabIndex != null;
4299
+		return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex );
5116 4300
 	}
5117
-				} else {
5118
-					switch (format.charAt(iFormat)) {
5119
-						case "d":
5120
-							output += formatNumber("d", date.getDate(), 2);
5121
-							break;
5122
-						case "D":
5123
-							output += formatName("D", date.getDay(), dayNamesShort, dayNames);
5124
-							break;
5125
-						case "o":
5126
-							output += formatNumber("o",
5127
-								Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
5128
-							break;
5129
-						case "m":
5130
-							output += formatNumber("m", date.getMonth() + 1, 2);
5131
-							break;
5132
-						case "M":
5133
-							output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
5134
-							break;
5135
-						case "y":
5136
-							output += (lookAhead("y") ? date.getFullYear() :
5137
-								(date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100);
5138
-							break;
5139
-						case "@":
5140
-							output += date.getTime();
5141
-							break;
5142
-						case "!":
5143
-							output += date.getTime() * 10000 + this._ticksTo1970;
5144
-							break;
5145
-						case "'":
5146
-							if (lookAhead("'")) {
5147
-								output += "'";
5148
-							} else {
5149
-								literal = true;
5150
-							}
5151
-							break;
5152
-						default:
5153
-							output += format.charAt(iFormat);
5154
-					}
5155
-				}
5156
-			}
5157
-		}
5158
-		return output;
5159
-	},
4301
+} );
5160 4302
 
5161
-	/* Extract all possible characters from the date format. */
5162
-	_possibleChars: function (format) {
5163
-		var iFormat,
5164
-			chars = "",
5165
-			literal = false,
5166
-			// Check whether a format character is doubled
5167
-			lookAhead = function(match) {
5168
-				var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
5169
-				if (matches) {
5170
-					iFormat++;
4303
+
4304
+/*!
4305
+ * jQuery UI Unique ID 1.13.2
4306
+ * http://jqueryui.com
4307
+ *
4308
+ * Copyright jQuery Foundation and other contributors
4309
+ * Released under the MIT license.
4310
+ * http://jquery.org/license
4311
+ */
4312
+
4313
+//>>label: uniqueId
4314
+//>>group: Core
4315
+//>>description: Functions to generate and remove uniqueId's
4316
+//>>docs: http://api.jqueryui.com/uniqueId/
4317
+
4318
+
4319
+var uniqueId = $.fn.extend( {
4320
+	uniqueId: ( function() {
4321
+		var uuid = 0;
4322
+
4323
+		return function() {
4324
+			return this.each( function() {
4325
+				if ( !this.id ) {
4326
+					this.id = "ui-id-" + ( ++uuid );
5171 4327
 				}
5172
-				return matches;
4328
+			} );
5173 4329
 		};
4330
+	} )(),
5174 4331
 
5175
-		for (iFormat = 0; iFormat < format.length; iFormat++) {
5176
-			if (literal) {
5177
-				if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
5178
-					literal = false;
5179
-				} else {
5180
-					chars += format.charAt(iFormat);
5181
-				}
5182
-			} else {
5183
-				switch (format.charAt(iFormat)) {
5184
-					case "d": case "m": case "y": case "@":
5185
-						chars += "0123456789";
5186
-						break;
5187
-					case "D": case "M":
5188
-						return null; // Accept anything
5189
-					case "'":
5190
-						if (lookAhead("'")) {
5191
-							chars += "'";
5192
-						} else {
5193
-							literal = true;
5194
-						}
5195
-						break;
5196
-					default:
5197
-						chars += format.charAt(iFormat);
5198
-				}
4332
+	removeUniqueId: function() {
4333
+		return this.each( function() {
4334
+			if ( /^ui-id-\d+$/.test( this.id ) ) {
4335
+				$( this ).removeAttr( "id" );
5199 4336
 			}
4337
+		} );
5200 4338
 	}
5201
-		return chars;
5202
-	},
4339
+} );
5203 4340
 
5204
-	/* Get a setting value, defaulting if necessary. */
5205
-	_get: function(inst, name) {
5206
-		return inst.settings[name] !== undefined ?
5207
-			inst.settings[name] : this._defaults[name];
5208
-	},
5209 4341
 
5210
-	/* Parse existing date and initialise date picker. */
5211
-	_setDateFromField: function(inst, noDefault) {
5212
-		if (inst.input.val() === inst.lastVal) {
5213
-			return;
5214
-		}
4342
+/*!
4343
+ * jQuery UI Accordion 1.13.2
4344
+ * http://jqueryui.com
4345
+ *
4346
+ * Copyright jQuery Foundation and other contributors
4347
+ * Released under the MIT license.
4348
+ * http://jquery.org/license
4349
+ */
5215 4350
 
5216
-		var dateFormat = this._get(inst, "dateFormat"),
5217
-			dates = inst.lastVal = inst.input ? inst.input.val() : null,
5218
-			defaultDate = this._getDefaultDate(inst),
5219
-			date = defaultDate,
5220
-			settings = this._getFormatConfig(inst);
4351
+//>>label: Accordion
4352
+//>>group: Widgets
4353
+/* eslint-disable max-len */
4354
+//>>description: Displays collapsible content panels for presenting information in a limited amount of space.
4355
+/* eslint-enable max-len */
4356
+//>>docs: http://api.jqueryui.com/accordion/
4357
+//>>demos: http://jqueryui.com/accordion/
4358
+//>>css.structure: ../../themes/base/core.css
4359
+//>>css.structure: ../../themes/base/accordion.css
4360
+//>>css.theme: ../../themes/base/theme.css
5221 4361
 
5222
-		try {
5223
-			date = this.parseDate(dateFormat, dates, settings) || defaultDate;
5224
-		} catch (event) {
5225
-			dates = (noDefault ? "" : dates);
5226
-		}
5227
-		inst.selectedDay = date.getDate();
5228
-		inst.drawMonth = inst.selectedMonth = date.getMonth();
5229
-		inst.drawYear = inst.selectedYear = date.getFullYear();
5230
-		inst.currentDay = (dates ? date.getDate() : 0);
5231
-		inst.currentMonth = (dates ? date.getMonth() : 0);
5232
-		inst.currentYear = (dates ? date.getFullYear() : 0);
5233
-		this._adjustInstDate(inst);
4362
+
4363
+var widgetsAccordion = $.widget( "ui.accordion", {
4364
+	version: "1.13.2",
4365
+	options: {
4366
+		active: 0,
4367
+		animate: {},
4368
+		classes: {
4369
+			"ui-accordion-header": "ui-corner-top",
4370
+			"ui-accordion-header-collapsed": "ui-corner-all",
4371
+			"ui-accordion-content": "ui-corner-bottom"
4372
+		},
4373
+		collapsible: false,
4374
+		event: "click",
4375
+		header: function( elem ) {
4376
+			return elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() );
4377
+		},
4378
+		heightStyle: "auto",
4379
+		icons: {
4380
+			activeHeader: "ui-icon-triangle-1-s",
4381
+			header: "ui-icon-triangle-1-e"
5234 4382
 		},
5235 4383
 
5236
-	/* Retrieve the default date shown on opening. */
5237
-	_getDefaultDate: function(inst) {
5238
-		return this._restrictMinMax(inst,
5239
-			this._determineDate(inst, this._get(inst, "defaultDate"), new Date()));
4384
+		// Callbacks
4385
+		activate: null,
4386
+		beforeActivate: null
5240 4387
 	},
5241 4388
 
5242
-	/* A date may be specified as an exact value or a relative one. */
5243
-	_determineDate: function(inst, date, defaultDate) {
5244
-		var offsetNumeric = function(offset) {
5245
-				var date = new Date();
5246
-				date.setDate(date.getDate() + offset);
5247
-				return date;
4389
+	hideProps: {
4390
+		borderTopWidth: "hide",
4391
+		borderBottomWidth: "hide",
4392
+		paddingTop: "hide",
4393
+		paddingBottom: "hide",
4394
+		height: "hide"
5248 4395
 	},
5249
-			offsetString = function(offset) {
5250
-				try {
5251
-					return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
5252
-						offset, $.datepicker._getFormatConfig(inst));
5253
-				}
5254
-				catch (e) {
5255
-					// Ignore
5256
-				}
5257 4396
 
5258
-				var date = (offset.toLowerCase().match(/^c/) ?
5259
-					$.datepicker._getDate(inst) : null) || new Date(),
5260
-					year = date.getFullYear(),
5261
-					month = date.getMonth(),
5262
-					day = date.getDate(),
5263
-					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
5264
-					matches = pattern.exec(offset);
4397
+	showProps: {
4398
+		borderTopWidth: "show",
4399
+		borderBottomWidth: "show",
4400
+		paddingTop: "show",
4401
+		paddingBottom: "show",
4402
+		height: "show"
4403
+	},
5265 4404
 
5266
-				while (matches) {
5267
-					switch (matches[2] || "d") {
5268
-						case "d" : case "D" :
5269
-							day += parseInt(matches[1],10); break;
5270
-						case "w" : case "W" :
5271
-							day += parseInt(matches[1],10) * 7; break;
5272
-						case "m" : case "M" :
5273
-							month += parseInt(matches[1],10);
5274
-							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
5275
-							break;
5276
-						case "y": case "Y" :
5277
-							year += parseInt(matches[1],10);
5278
-							day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
5279
-							break;
4405
+	_create: function() {
4406
+		var options = this.options;
4407
+
4408
+		this.prevShow = this.prevHide = $();
4409
+		this._addClass( "ui-accordion", "ui-widget ui-helper-reset" );
4410
+		this.element.attr( "role", "tablist" );
4411
+
4412
+		// Don't allow collapsible: false and active: false / null
4413
+		if ( !options.collapsible && ( options.active === false || options.active == null ) ) {
4414
+			options.active = 0;
5280 4415
 		}
5281
-					matches = pattern.exec(offset);
4416
+
4417
+		this._processPanels();
4418
+
4419
+		// handle negative values
4420
+		if ( options.active < 0 ) {
4421
+			options.active += this.headers.length;
5282 4422
 		}
5283
-				return new Date(year, month, day);
4423
+		this._refresh();
5284 4424
 	},
5285
-			newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) :
5286
-				(typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
5287 4425
 
5288
-		newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate);
5289
-		if (newDate) {
5290
-			newDate.setHours(0);
5291
-			newDate.setMinutes(0);
5292
-			newDate.setSeconds(0);
5293
-			newDate.setMilliseconds(0);
5294
-		}
5295
-		return this._daylightSavingAdjust(newDate);
4426
+	_getCreateEventData: function() {
4427
+		return {
4428
+			header: this.active,
4429
+			panel: !this.active.length ? $() : this.active.next()
4430
+		};
5296 4431
 	},
5297 4432
 
5298
-	/* Handle switch to/from daylight saving.
5299
-	 * Hours may be non-zero on daylight saving cut-over:
5300
-	 * > 12 when midnight changeover, but then cannot generate
5301
-	 * midnight datetime, so jump to 1AM, otherwise reset.
5302
-	 * @param  date  (Date) the date to check
5303
-	 * @return  (Date) the corrected date
5304
-	 */
5305
-	_daylightSavingAdjust: function(date) {
5306
-		if (!date) {
5307
-			return null;
4433
+	_createIcons: function() {
4434
+		var icon, children,
4435
+			icons = this.options.icons;
4436
+
4437
+		if ( icons ) {
4438
+			icon = $( "<span>" );
4439
+			this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header );
4440
+			icon.prependTo( this.headers );
4441
+			children = this.active.children( ".ui-accordion-header-icon" );
4442
+			this._removeClass( children, icons.header )
4443
+				._addClass( children, null, icons.activeHeader )
4444
+				._addClass( this.headers, "ui-accordion-icons" );
5308 4445
 		}
5309
-		date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
5310
-		return date;
5311 4446
 	},
5312 4447
 
5313
-	/* Set the date(s) directly. */
5314
-	_setDate: function(inst, date, noChange) {
5315
-		var clear = !date,
5316
-			origMonth = inst.selectedMonth,
5317
-			origYear = inst.selectedYear,
5318
-			newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
5319
-
5320
-		inst.selectedDay = inst.currentDay = newDate.getDate();
5321
-		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
5322
-		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
5323
-		if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
5324
-			this._notifyChange(inst);
5325
-		}
5326
-		this._adjustInstDate(inst);
5327
-		if (inst.input) {
5328
-			inst.input.val(clear ? "" : this._formatDate(inst));
5329
-		}
4448
+	_destroyIcons: function() {
4449
+		this._removeClass( this.headers, "ui-accordion-icons" );
4450
+		this.headers.children( ".ui-accordion-header-icon" ).remove();
5330 4451
 	},
5331 4452
 
5332
-	/* Retrieve the date(s) directly. */
5333
-	_getDate: function(inst) {
5334
-		var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null :
5335
-			this._daylightSavingAdjust(new Date(
5336
-			inst.currentYear, inst.currentMonth, inst.currentDay)));
5337
-			return startDate;
5338
-	},
4453
+	_destroy: function() {
4454
+		var contents;
5339 4455
 
5340
-	/* Attach the onxxx handlers.  These are declared statically so
5341
-	 * they work with static code transformers like Caja.
5342
-	 */
5343
-	_attachHandlers: function(inst) {
5344
-		var stepMonths = this._get(inst, "stepMonths"),
5345
-			id = "#" + inst.id.replace( /\\\\/g, "\\" );
5346
-		inst.dpDiv.find("[data-handler]").map(function () {
5347
-			var handler = {
5348
-				prev: function () {
5349
-					$.datepicker._adjustDate(id, -stepMonths, "M");
5350
-				},
5351
-				next: function () {
5352
-					$.datepicker._adjustDate(id, +stepMonths, "M");
5353
-				},
5354
-				hide: function () {
5355
-					$.datepicker._hideDatepicker();
5356
-				},
5357
-				today: function () {
5358
-					$.datepicker._gotoToday(id);
5359
-				},
5360
-				selectDay: function () {
5361
-					$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
5362
-					return false;
5363
-				},
5364
-				selectMonth: function () {
5365
-					$.datepicker._selectMonthYear(id, this, "M");
5366
-					return false;
5367
-				},
5368
-				selectYear: function () {
5369
-					$.datepicker._selectMonthYear(id, this, "Y");
5370
-					return false;
4456
+		// Clean up main element
4457
+		this.element.removeAttr( "role" );
4458
+
4459
+		// Clean up headers
4460
+		this.headers
4461
+			.removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" )
4462
+			.removeUniqueId();
4463
+
4464
+		this._destroyIcons();
4465
+
4466
+		// Clean up content panels
4467
+		contents = this.headers.next()
4468
+			.css( "display", "" )
4469
+			.removeAttr( "role aria-hidden aria-labelledby" )
4470
+			.removeUniqueId();
4471
+
4472
+		if ( this.options.heightStyle !== "content" ) {
4473
+			contents.css( "height", "" );
5371 4474
 		}
5372
-			};
5373
-			$(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]);
5374
-		});
5375 4475
 	},
5376 4476
 
5377
-	/* Generate the HTML for the current state of the date picker. */
5378
-	_generateHTML: function(inst) {
5379
-		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
5380
-			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
5381
-			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
5382
-			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
5383
-			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
5384
-			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
5385
-			tempDate = new Date(),
5386
-			today = this._daylightSavingAdjust(
5387
-				new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time
5388
-			isRTL = this._get(inst, "isRTL"),
5389
-			showButtonPanel = this._get(inst, "showButtonPanel"),
5390
-			hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
5391
-			navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
5392
-			numMonths = this._getNumberOfMonths(inst),
5393
-			showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
5394
-			stepMonths = this._get(inst, "stepMonths"),
5395
-			isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1),
5396
-			currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
5397
-				new Date(inst.currentYear, inst.currentMonth, inst.currentDay))),
5398
-			minDate = this._getMinMaxDate(inst, "min"),
5399
-			maxDate = this._getMinMaxDate(inst, "max"),
5400
-			drawMonth = inst.drawMonth - showCurrentAtPos,
5401
-			drawYear = inst.drawYear;
4477
+	_setOption: function( key, value ) {
4478
+		if ( key === "active" ) {
5402 4479
 
5403
-		if (drawMonth < 0) {
5404
-			drawMonth += 12;
5405
-			drawYear--;
5406
-		}
5407
-		if (maxDate) {
5408
-			maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
5409
-				maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
5410
-			maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
5411
-			while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
5412
-				drawMonth--;
5413
-				if (drawMonth < 0) {
5414
-					drawMonth = 11;
5415
-					drawYear--;
4480
+			// _activate() will handle invalid values and update this.options
4481
+			this._activate( value );
4482
+			return;
5416 4483
 		}
4484
+
4485
+		if ( key === "event" ) {
4486
+			if ( this.options.event ) {
4487
+				this._off( this.headers, this.options.event );
5417 4488
 			}
4489
+			this._setupEvents( value );
5418 4490
 		}
5419
-		inst.drawMonth = drawMonth;
5420
-		inst.drawYear = drawYear;
5421 4491
 
5422
-		prevText = this._get(inst, "prevText");
5423
-		prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
5424
-			this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
5425
-			this._getFormatConfig(inst)));
4492
+		this._super( key, value );
5426 4493
 
5427
-		prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
5428
-			"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
5429
-			" title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
5430
-			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
4494
+		// Setting collapsible: false while collapsed; open first panel
4495
+		if ( key === "collapsible" && !value && this.options.active === false ) {
4496
+			this._activate( 0 );
4497
+		}
5431 4498
 
5432
-		nextText = this._get(inst, "nextText");
5433
-		nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
5434
-			this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
5435
-			this._getFormatConfig(inst)));
4499
+		if ( key === "icons" ) {
4500
+			this._destroyIcons();
4501
+			if ( value ) {
4502
+				this._createIcons();
4503
+			}
4504
+		}
4505
+	},
5436 4506
 
5437
-		next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
5438
-			"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
5439
-			" title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
5440
-			(hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
4507
+	_setOptionDisabled: function( value ) {
4508
+		this._super( value );
5441 4509
 
5442
-		currentText = this._get(inst, "currentText");
5443
-		gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today);
5444
-		currentText = (!navigationAsDateFormat ? currentText :
5445
-			this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
4510
+		this.element.attr( "aria-disabled", value );
5446 4511
 
5447
-		controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" +
5448
-			this._get(inst, "closeText") + "</button>" : "");
4512
+		// Support: IE8 Only
4513
+		// #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
4514
+		// so we need to add the disabled class to the headers and panels
4515
+		this._toggleClass( null, "ui-state-disabled", !!value );
4516
+		this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
4517
+			!!value );
4518
+	},
5449 4519
 
5450
-		buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") +
5451
-			(this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" +
5452
-			">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
4520
+	_keydown: function( event ) {
4521
+		if ( event.altKey || event.ctrlKey ) {
4522
+			return;
4523
+		}
5453 4524
 
5454
-		firstDay = parseInt(this._get(inst, "firstDay"),10);
5455
-		firstDay = (isNaN(firstDay) ? 0 : firstDay);
4525
+		var keyCode = $.ui.keyCode,
4526
+			length = this.headers.length,
4527
+			currentIndex = this.headers.index( event.target ),
4528
+			toFocus = false;
5456 4529
 
5457
-		showWeek = this._get(inst, "showWeek");
5458
-		dayNames = this._get(inst, "dayNames");
5459
-		dayNamesMin = this._get(inst, "dayNamesMin");
5460
-		monthNames = this._get(inst, "monthNames");
5461
-		monthNamesShort = this._get(inst, "monthNamesShort");
5462
-		beforeShowDay = this._get(inst, "beforeShowDay");
5463
-		showOtherMonths = this._get(inst, "showOtherMonths");
5464
-		selectOtherMonths = this._get(inst, "selectOtherMonths");
5465
-		defaultDate = this._getDefaultDate(inst);
5466
-		html = "";
5467
-		dow;
5468
-		for (row = 0; row < numMonths[0]; row++) {
5469
-			group = "";
5470
-			this.maxRows = 4;
5471
-			for (col = 0; col < numMonths[1]; col++) {
5472
-				selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
5473
-				cornerClass = " ui-corner-all";
5474
-				calender = "";
5475
-				if (isMultiMonth) {
5476
-					calender += "<div class='ui-datepicker-group";
5477
-					if (numMonths[1] > 1) {
5478
-						switch (col) {
5479
-							case 0: calender += " ui-datepicker-group-first";
5480
-								cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break;
5481
-							case numMonths[1]-1: calender += " ui-datepicker-group-last";
5482
-								cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break;
5483
-							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
4530
+		switch ( event.keyCode ) {
4531
+		case keyCode.RIGHT:
4532
+		case keyCode.DOWN:
4533
+			toFocus = this.headers[ ( currentIndex + 1 ) % length ];
4534
+			break;
4535
+		case keyCode.LEFT:
4536
+		case keyCode.UP:
4537
+			toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
4538
+			break;
4539
+		case keyCode.SPACE:
4540
+		case keyCode.ENTER:
4541
+			this._eventHandler( event );
4542
+			break;
4543
+		case keyCode.HOME:
4544
+			toFocus = this.headers[ 0 ];
4545
+			break;
4546
+		case keyCode.END:
4547
+			toFocus = this.headers[ length - 1 ];
4548
+			break;
5484 4549
 		}
4550
+
4551
+		if ( toFocus ) {
4552
+			$( event.target ).attr( "tabIndex", -1 );
4553
+			$( toFocus ).attr( "tabIndex", 0 );
4554
+			$( toFocus ).trigger( "focus" );
4555
+			event.preventDefault();
5485 4556
 		}
5486
-					calender += "'>";
4557
+	},
4558
+
4559
+	_panelKeyDown: function( event ) {
4560
+		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
4561
+			$( event.currentTarget ).prev().trigger( "focus" );
5487 4562
 		}
5488
-				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
5489
-					(/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") +
5490
-					(/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") +
5491
-					this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
5492
-					row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
5493
-					"</div><table class='ui-datepicker-calendar'><thead>" +
5494
-					"<tr>";
5495
-				thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "");
5496
-				for (dow = 0; dow < 7; dow++) { // days of the week
5497
-					day = (dow + firstDay) % 7;
5498
-					thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" +
5499
-						"<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>";
4563
+	},
4564
+
4565
+	refresh: function() {
4566
+		var options = this.options;
4567
+		this._processPanels();
4568
+
4569
+		// Was collapsed or no panel
4570
+		if ( ( options.active === false && options.collapsible === true ) ||
4571
+				!this.headers.length ) {
4572
+			options.active = false;
4573
+			this.active = $();
4574
+
4575
+		// active false only when collapsible is true
4576
+		} else if ( options.active === false ) {
4577
+			this._activate( 0 );
4578
+
4579
+		// was active, but active panel is gone
4580
+		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
4581
+
4582
+			// all remaining panel are disabled
4583
+			if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) {
4584
+				options.active = false;
4585
+				this.active = $();
4586
+
4587
+			// activate previous panel
4588
+			} else {
4589
+				this._activate( Math.max( 0, options.active - 1 ) );
5500 4590
 			}
5501
-				calender += thead + "</tr></thead><tbody>";
5502
-				daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
5503
-				if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
5504
-					inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
4591
+
4592
+		// was active, active panel still exists
4593
+		} else {
4594
+
4595
+			// make sure active index is correct
4596
+			options.active = this.headers.index( this.active );
5505 4597
 		}
5506
-				leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
5507
-				curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
5508
-				numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
5509
-				this.maxRows = numRows;
5510
-				printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
5511
-				for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows
5512
-					calender += "<tr>";
5513
-					tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
5514
-						this._get(inst, "calculateWeek")(printDate) + "</td>");
5515
-					for (dow = 0; dow < 7; dow++) { // create date picker days
5516
-						daySettings = (beforeShowDay ?
5517
-							beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]);
5518
-						otherMonth = (printDate.getMonth() !== drawMonth);
5519
-						unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
5520
-							(minDate && printDate < minDate) || (maxDate && printDate > maxDate);
5521
-						tbody += "<td class='" +
5522
-							((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
5523
-							(otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
5524
-							((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
5525
-							(defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
5526
-							// or defaultDate is current printedDate and defaultDate is selectedDate
5527
-							" " + this._dayOverClass : "") + // highlight selected day
5528
-							(unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") +  // highlight unselectable days
5529
-							(otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates
5530
-							(printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day
5531
-							(printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different)
5532
-							((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title
5533
-							(unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions
5534
-							(otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
5535
-							(unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
5536
-							(printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") +
5537
-							(printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day
5538
-							(otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months
5539
-							"' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date
5540
-						printDate.setDate(printDate.getDate() + 1);
5541
-						printDate = this._daylightSavingAdjust(printDate);
5542
-					}
5543
-					calender += tbody + "</tr>";
5544
-				}
5545
-				drawMonth++;
5546
-				if (drawMonth > 11) {
5547
-					drawMonth = 0;
5548
-					drawYear++;
5549
-				}
5550
-				calender += "</tbody></table>" + (isMultiMonth ? "</div>" +
5551
-							((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
5552
-				group += calender;
4598
+
4599
+		this._destroyIcons();
4600
+
4601
+		this._refresh();
4602
+	},
4603
+
4604
+	_processPanels: function() {
4605
+		var prevHeaders = this.headers,
4606
+			prevPanels = this.panels;
4607
+
4608
+		if ( typeof this.options.header === "function" ) {
4609
+			this.headers = this.options.header( this.element );
4610
+		} else {
4611
+			this.headers = this.element.find( this.options.header );
5553 4612
 		}
5554
-			html += group;
4613
+		this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed",
4614
+			"ui-state-default" );
4615
+
4616
+		this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide();
4617
+		this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" );
4618
+
4619
+		// Avoid memory leaks (#10056)
4620
+		if ( prevPanels ) {
4621
+			this._off( prevHeaders.not( this.headers ) );
4622
+			this._off( prevPanels.not( this.panels ) );
5555 4623
 		}
5556
-		html += buttonPanel;
5557
-		inst._keyEvent = false;
5558
-		return html;
5559 4624
 	},
5560 4625
 
5561
-	/* Generate the month and year header. */
5562
-	_generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
5563
-			secondary, monthNames, monthNamesShort) {
4626
+	_refresh: function() {
4627
+		var maxHeight,
4628
+			options = this.options,
4629
+			heightStyle = options.heightStyle,
4630
+			parent = this.element.parent();
5564 4631
 
5565
-		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
5566
-			changeMonth = this._get(inst, "changeMonth"),
5567
-			changeYear = this._get(inst, "changeYear"),
5568
-			showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
5569
-			html = "<div class='ui-datepicker-title'>",
5570
-			monthHtml = "";
4632
+		this.active = this._findActive( options.active );
4633
+		this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" )
4634
+			._removeClass( this.active, "ui-accordion-header-collapsed" );
4635
+		this._addClass( this.active.next(), "ui-accordion-content-active" );
4636
+		this.active.next().show();
5571 4637
 
5572
-		// month selection
5573
-		if (secondary || !changeMonth) {
5574
-			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>";
4638
+		this.headers
4639
+			.attr( "role", "tab" )
4640
+			.each( function() {
4641
+				var header = $( this ),
4642
+					headerId = header.uniqueId().attr( "id" ),
4643
+					panel = header.next(),
4644
+					panelId = panel.uniqueId().attr( "id" );
4645
+				header.attr( "aria-controls", panelId );
4646
+				panel.attr( "aria-labelledby", headerId );
4647
+			} )
4648
+			.next()
4649
+				.attr( "role", "tabpanel" );
4650
+
4651
+		this.headers
4652
+			.not( this.active )
4653
+				.attr( {
4654
+					"aria-selected": "false",
4655
+					"aria-expanded": "false",
4656
+					tabIndex: -1
4657
+				} )
4658
+				.next()
4659
+					.attr( {
4660
+						"aria-hidden": "true"
4661
+					} )
4662
+					.hide();
4663
+
4664
+		// Make sure at least one header is in the tab order
4665
+		if ( !this.active.length ) {
4666
+			this.headers.eq( 0 ).attr( "tabIndex", 0 );
5575 4667
 		} else {
5576
-			inMinYear = (minDate && minDate.getFullYear() === drawYear);
5577
-			inMaxYear = (maxDate && maxDate.getFullYear() === drawYear);
5578
-			monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
5579
-			for ( month = 0; month < 12; month++) {
5580
-				if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
5581
-					monthHtml += "<option value='" + month + "'" +
5582
-						(month === drawMonth ? " selected='selected'" : "") +
5583
-						">" + monthNamesShort[month] + "</option>";
5584
-				}
5585
-			}
5586
-			monthHtml += "</select>";
4668
+			this.active.attr( {
4669
+				"aria-selected": "true",
4670
+				"aria-expanded": "true",
4671
+				tabIndex: 0
4672
+			} )
4673
+				.next()
4674
+					.attr( {
4675
+						"aria-hidden": "false"
4676
+					} );
5587 4677
 		}
5588 4678
 
5589
-		if (!showMonthAfterYear) {
5590
-			html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "");
5591
-		}
4679
+		this._createIcons();
5592 4680
 
5593
-		// year selection
5594
-		if ( !inst.yearshtml ) {
5595
-			inst.yearshtml = "";
5596
-			if (secondary || !changeYear) {
5597
-				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
5598
-			} else {
5599
-				// determine range of years to display
5600
-				years = this._get(inst, "yearRange").split(":");
5601
-				thisYear = new Date().getFullYear();
5602
-				determineYear = function(value) {
5603
-					var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) :
5604
-						(value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) :
5605
-						parseInt(value, 10)));
5606
-					return (isNaN(year) ? thisYear : year);
5607
-				};
5608
-				year = determineYear(years[0]);
5609
-				endYear = Math.max(year, determineYear(years[1] || ""));
5610
-				year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
5611
-				endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
5612
-				inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
5613
-				for (; year <= endYear; year++) {
5614
-					inst.yearshtml += "<option value='" + year + "'" +
5615
-						(year === drawYear ? " selected='selected'" : "") +
5616
-						">" + year + "</option>";
4681
+		this._setupEvents( options.event );
4682
+
4683
+		if ( heightStyle === "fill" ) {
4684
+			maxHeight = parent.height();
4685
+			this.element.siblings( ":visible" ).each( function() {
4686
+				var elem = $( this ),
4687
+					position = elem.css( "position" );
4688
+
4689
+				if ( position === "absolute" || position === "fixed" ) {
4690
+					return;
5617 4691
 				}
5618
-				inst.yearshtml += "</select>";
4692
+				maxHeight -= elem.outerHeight( true );
4693
+			} );
5619 4694
 
5620
-				html += inst.yearshtml;
5621
-				inst.yearshtml = null;
4695
+			this.headers.each( function() {
4696
+				maxHeight -= $( this ).outerHeight( true );
4697
+			} );
4698
+
4699
+			this.headers.next()
4700
+				.each( function() {
4701
+					$( this ).height( Math.max( 0, maxHeight -
4702
+						$( this ).innerHeight() + $( this ).height() ) );
4703
+				} )
4704
+				.css( "overflow", "auto" );
4705
+		} else if ( heightStyle === "auto" ) {
4706
+			maxHeight = 0;
4707
+			this.headers.next()
4708
+				.each( function() {
4709
+					var isVisible = $( this ).is( ":visible" );
4710
+					if ( !isVisible ) {
4711
+						$( this ).show();
5622 4712
 					}
4713
+					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
4714
+					if ( !isVisible ) {
4715
+						$( this ).hide();
5623 4716
 					}
5624
-
5625
-		html += this._get(inst, "yearSuffix");
5626
-		if (showMonthAfterYear) {
5627
-			html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml;
4717
+				} )
4718
+				.height( maxHeight );
5628 4719
 		}
5629
-		html += "</div>"; // Close datepicker_header
5630
-		return html;
5631 4720
 	},
5632 4721
 
5633
-	/* Adjust one of the date sub-fields. */
5634
-	_adjustInstDate: function(inst, offset, period) {
5635
-		var year = inst.drawYear + (period === "Y" ? offset : 0),
5636
-			month = inst.drawMonth + (period === "M" ? offset : 0),
5637
-			day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
5638
-			date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
4722
+	_activate: function( index ) {
4723
+		var active = this._findActive( index )[ 0 ];
5639 4724
 
5640
-		inst.selectedDay = date.getDate();
5641
-		inst.drawMonth = inst.selectedMonth = date.getMonth();
5642
-		inst.drawYear = inst.selectedYear = date.getFullYear();
5643
-		if (period === "M" || period === "Y") {
5644
-			this._notifyChange(inst);
4725
+		// Trying to activate the already active panel
4726
+		if ( active === this.active[ 0 ] ) {
4727
+			return;
5645 4728
 		}
5646
-	},
5647 4729
 
5648
-	/* Ensure a date is within any min/max bounds. */
5649
-	_restrictMinMax: function(inst, date) {
5650
-		var minDate = this._getMinMaxDate(inst, "min"),
5651
-			maxDate = this._getMinMaxDate(inst, "max"),
5652
-			newDate = (minDate && date < minDate ? minDate : date);
5653
-		return (maxDate && newDate > maxDate ? maxDate : newDate);
5654
-	},
4730
+		// Trying to collapse, simulate a click on the currently active header
4731
+		active = active || this.active[ 0 ];
5655 4732
 
5656
-	/* Notify change of month/year. */
5657
-	_notifyChange: function(inst) {
5658
-		var onChange = this._get(inst, "onChangeMonthYear");
5659
-		if (onChange) {
5660
-			onChange.apply((inst.input ? inst.input[0] : null),
5661
-				[inst.selectedYear, inst.selectedMonth + 1, inst]);
5662
-		}
4733
+		this._eventHandler( {
4734
+			target: active,
4735
+			currentTarget: active,
4736
+			preventDefault: $.noop
4737
+		} );
5663 4738
 	},
5664 4739
 
5665
-	/* Determine the number of months to show. */
5666
-	_getNumberOfMonths: function(inst) {
5667
-		var numMonths = this._get(inst, "numberOfMonths");
5668
-		return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths));
4740
+	_findActive: function( selector ) {
4741
+		return typeof selector === "number" ? this.headers.eq( selector ) : $();
5669 4742
 	},
5670 4743
 
5671
-	/* Determine the current maximum date - ensure no time components are set. */
5672
-	_getMinMaxDate: function(inst, minMax) {
5673
-		return this._determineDate(inst, this._get(inst, minMax + "Date"), null);
5674
-	},
4744
+	_setupEvents: function( event ) {
4745
+		var events = {
4746
+			keydown: "_keydown"
4747
+		};
4748
+		if ( event ) {
4749
+			$.each( event.split( " " ), function( index, eventName ) {
4750
+				events[ eventName ] = "_eventHandler";
4751
+			} );
4752
+		}
5675 4753
 
5676
-	/* Find the number of days in a given month. */
5677
-	_getDaysInMonth: function(year, month) {
5678
-		return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
4754
+		this._off( this.headers.add( this.headers.next() ) );
4755
+		this._on( this.headers, events );
4756
+		this._on( this.headers.next(), { keydown: "_panelKeyDown" } );
4757
+		this._hoverable( this.headers );
4758
+		this._focusable( this.headers );
5679 4759
 	},
5680 4760
 
5681
-	/* Find the day of the week of the first of a month. */
5682
-	_getFirstDayOfMonth: function(year, month) {
5683
-		return new Date(year, month, 1).getDay();
5684
-	},
4761
+	_eventHandler: function( event ) {
4762
+		var activeChildren, clickedChildren,
4763
+			options = this.options,
4764
+			active = this.active,
4765
+			clicked = $( event.currentTarget ),
4766
+			clickedIsActive = clicked[ 0 ] === active[ 0 ],
4767
+			collapsing = clickedIsActive && options.collapsible,
4768
+			toShow = collapsing ? $() : clicked.next(),
4769
+			toHide = active.next(),
4770
+			eventData = {
4771
+				oldHeader: active,
4772
+				oldPanel: toHide,
4773
+				newHeader: collapsing ? $() : clicked,
4774
+				newPanel: toShow
4775
+			};
5685 4776
 
5686
-	/* Determines if we should allow a "next/prev" month display change. */
5687
-	_canAdjustMonth: function(inst, offset, curYear, curMonth) {
5688
-		var numMonths = this._getNumberOfMonths(inst),
5689
-			date = this._daylightSavingAdjust(new Date(curYear,
5690
-			curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
4777
+		event.preventDefault();
5691 4778
 
5692
-		if (offset < 0) {
5693
-			date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
5694
-		}
5695
-		return this._isInRange(inst, date);
5696
-	},
4779
+		if (
5697 4780
 
5698
-	/* Is the given date in the accepted range? */
5699
-	_isInRange: function(inst, date) {
5700
-		var yearSplit, currentYear,
5701
-			minDate = this._getMinMaxDate(inst, "min"),
5702
-			maxDate = this._getMinMaxDate(inst, "max"),
5703
-			minYear = null,
5704
-			maxYear = null,
5705
-			years = this._get(inst, "yearRange");
5706
-			if (years){
5707
-				yearSplit = years.split(":");
5708
-				currentYear = new Date().getFullYear();
5709
-				minYear = parseInt(yearSplit[0], 10);
5710
-				maxYear = parseInt(yearSplit[1], 10);
5711
-				if ( yearSplit[0].match(/[+\-].*/) ) {
5712
-					minYear += currentYear;
4781
+				// click on active header, but not collapsible
4782
+				( clickedIsActive && !options.collapsible ) ||
4783
+
4784
+				// allow canceling activation
4785
+				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
4786
+			return;
5713 4787
 		}
5714
-				if ( yearSplit[1].match(/[+\-].*/) ) {
5715
-					maxYear += currentYear;
4788
+
4789
+		options.active = collapsing ? false : this.headers.index( clicked );
4790
+
4791
+		// When the call to ._toggle() comes after the class changes
4792
+		// it causes a very odd bug in IE 8 (see #6720)
4793
+		this.active = clickedIsActive ? $() : clicked;
4794
+		this._toggle( eventData );
4795
+
4796
+		// Switch classes
4797
+		// corner classes on the previously active header stay after the animation
4798
+		this._removeClass( active, "ui-accordion-header-active", "ui-state-active" );
4799
+		if ( options.icons ) {
4800
+			activeChildren = active.children( ".ui-accordion-header-icon" );
4801
+			this._removeClass( activeChildren, null, options.icons.activeHeader )
4802
+				._addClass( activeChildren, null, options.icons.header );
5716 4803
 		}
4804
+
4805
+		if ( !clickedIsActive ) {
4806
+			this._removeClass( clicked, "ui-accordion-header-collapsed" )
4807
+				._addClass( clicked, "ui-accordion-header-active", "ui-state-active" );
4808
+			if ( options.icons ) {
4809
+				clickedChildren = clicked.children( ".ui-accordion-header-icon" );
4810
+				this._removeClass( clickedChildren, null, options.icons.header )
4811
+					._addClass( clickedChildren, null, options.icons.activeHeader );
5717 4812
 			}
5718 4813
 
5719
-		return ((!minDate || date.getTime() >= minDate.getTime()) &&
5720
-			(!maxDate || date.getTime() <= maxDate.getTime()) &&
5721
-			(!minYear || date.getFullYear() >= minYear) &&
5722
-			(!maxYear || date.getFullYear() <= maxYear));
4814
+			this._addClass( clicked.next(), "ui-accordion-content-active" );
4815
+		}
5723 4816
 	},
5724 4817
 
5725
-	/* Provide the configuration settings for formatting/parsing. */
5726
-	_getFormatConfig: function(inst) {
5727
-		var shortYearCutoff = this._get(inst, "shortYearCutoff");
5728
-		shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff :
5729
-			new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
5730
-		return {shortYearCutoff: shortYearCutoff,
5731
-			dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"),
5732
-			monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")};
5733
-	},
4818
+	_toggle: function( data ) {
4819
+		var toShow = data.newPanel,
4820
+			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
5734 4821
 
5735
-	/* Format the given date for display. */
5736
-	_formatDate: function(inst, day, month, year) {
5737
-		if (!day) {
5738
-			inst.currentDay = inst.selectedDay;
5739
-			inst.currentMonth = inst.selectedMonth;
5740
-			inst.currentYear = inst.selectedYear;
5741
-		}
5742
-		var date = (day ? (typeof day === "object" ? day :
5743
-			this._daylightSavingAdjust(new Date(year, month, day))) :
5744
-			this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
5745
-		return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst));
4822
+		// Handle activating a panel during the animation for another activation
4823
+		this.prevShow.add( this.prevHide ).stop( true, true );
4824
+		this.prevShow = toShow;
4825
+		this.prevHide = toHide;
4826
+
4827
+		if ( this.options.animate ) {
4828
+			this._animate( toShow, toHide, data );
4829
+		} else {
4830
+			toHide.hide();
4831
+			toShow.show();
4832
+			this._toggleComplete( data );
5746 4833
 		}
4834
+
4835
+		toHide.attr( {
4836
+			"aria-hidden": "true"
4837
+		} );
4838
+		toHide.prev().attr( {
4839
+			"aria-selected": "false",
4840
+			"aria-expanded": "false"
5747 4841
 		} );
5748 4842
 
5749
-/*
5750
- * Bind hover events for datepicker elements.
5751
- * Done via delegate so the binding only occurs once in the lifetime of the parent div.
5752
- * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
5753
- */
5754
-function datepicker_bindHover(dpDiv) {
5755
-	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
5756
-	return dpDiv.delegate(selector, "mouseout", function() {
5757
-			$(this).removeClass("ui-state-hover");
5758
-			if (this.className.indexOf("ui-datepicker-prev") !== -1) {
5759
-				$(this).removeClass("ui-datepicker-prev-hover");
5760
-			}
5761
-			if (this.className.indexOf("ui-datepicker-next") !== -1) {
5762
-				$(this).removeClass("ui-datepicker-next-hover");
5763
-			}
4843
+		// if we're switching panels, remove the old header from the tab order
4844
+		// if we're opening from collapsed state, remove the previous header from the tab order
4845
+		// if we're collapsing, then keep the collapsing header in the tab order
4846
+		if ( toShow.length && toHide.length ) {
4847
+			toHide.prev().attr( {
4848
+				"tabIndex": -1,
4849
+				"aria-expanded": "false"
4850
+			} );
4851
+		} else if ( toShow.length ) {
4852
+			this.headers.filter( function() {
4853
+				return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0;
5764 4854
 			} )
5765
-		.delegate( selector, "mouseover", datepicker_handleMouseover );
4855
+				.attr( "tabIndex", -1 );
5766 4856
 		}
5767 4857
 
5768
-function datepicker_handleMouseover() {
5769
-	if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) {
5770
-		$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
5771
-		$(this).addClass("ui-state-hover");
5772
-		if (this.className.indexOf("ui-datepicker-prev") !== -1) {
5773
-			$(this).addClass("ui-datepicker-prev-hover");
4858
+		toShow
4859
+			.attr( "aria-hidden", "false" )
4860
+			.prev()
4861
+				.attr( {
4862
+					"aria-selected": "true",
4863
+					"aria-expanded": "true",
4864
+					tabIndex: 0
4865
+				} );
4866
+	},
4867
+
4868
+	_animate: function( toShow, toHide, data ) {
4869
+		var total, easing, duration,
4870
+			that = this,
4871
+			adjust = 0,
4872
+			boxSizing = toShow.css( "box-sizing" ),
4873
+			down = toShow.length &&
4874
+				( !toHide.length || ( toShow.index() < toHide.index() ) ),
4875
+			animate = this.options.animate || {},
4876
+			options = down && animate.down || animate,
4877
+			complete = function() {
4878
+				that._toggleComplete( data );
4879
+			};
4880
+
4881
+		if ( typeof options === "number" ) {
4882
+			duration = options;
5774 4883
 		}
5775
-		if (this.className.indexOf("ui-datepicker-next") !== -1) {
5776
-			$(this).addClass("ui-datepicker-next-hover");
4884
+		if ( typeof options === "string" ) {
4885
+			easing = options;
5777 4886
 		}
4887
+
4888
+		// fall back from options to animation in case of partial down settings
4889
+		easing = easing || options.easing || animate.easing;
4890
+		duration = duration || options.duration || animate.duration;
4891
+
4892
+		if ( !toHide.length ) {
4893
+			return toShow.animate( this.showProps, duration, easing, complete );
5778 4894
 		}
4895
+		if ( !toShow.length ) {
4896
+			return toHide.animate( this.hideProps, duration, easing, complete );
5779 4897
 		}
5780 4898
 
5781
-/* jQuery extend now ignores nulls! */
5782
-function datepicker_extendRemove(target, props) {
5783
-	$.extend(target, props);
5784
-	for (var name in props) {
5785
-		if (props[name] == null) {
5786
-			target[name] = props[name];
4899
+		total = toShow.show().outerHeight();
4900
+		toHide.animate( this.hideProps, {
4901
+			duration: duration,
4902
+			easing: easing,
4903
+			step: function( now, fx ) {
4904
+				fx.now = Math.round( now );
4905
+			}
4906
+		} );
4907
+		toShow
4908
+			.hide()
4909
+			.animate( this.showProps, {
4910
+				duration: duration,
4911
+				easing: easing,
4912
+				complete: complete,
4913
+				step: function( now, fx ) {
4914
+					fx.now = Math.round( now );
4915
+					if ( fx.prop !== "height" ) {
4916
+						if ( boxSizing === "content-box" ) {
4917
+							adjust += fx.now;
5787 4918
 						}
4919
+					} else if ( that.options.heightStyle !== "content" ) {
4920
+						fx.now = Math.round( total - toHide.outerHeight() - adjust );
4921
+						adjust = 0;
5788 4922
 					}
5789
-	return target;
5790 4923
 				}
4924
+			} );
4925
+	},
5791 4926
 
5792
-/* Invoke the datepicker functionality.
5793
-   @param  options  string - a command, optionally followed by additional parameters or
5794
-					Object - settings for attaching new datepicker functionality
5795
-   @return  jQuery object */
5796
-$.fn.datepicker = function(options){
4927
+	_toggleComplete: function( data ) {
4928
+		var toHide = data.oldPanel,
4929
+			prev = toHide.prev();
5797 4930
 
5798
-	/* Verify an empty collection wasn't passed - Fixes #6976 */
5799
-	if ( !this.length ) {
5800
-		return this;
5801
-	}
4931
+		this._removeClass( toHide, "ui-accordion-content-active" );
4932
+		this._removeClass( prev, "ui-accordion-header-active" )
4933
+			._addClass( prev, "ui-accordion-header-collapsed" );
5802 4934
 
5803
-	/* Initialise the date picker. */
5804
-	if (!$.datepicker.initialized) {
5805
-		$(document).mousedown($.datepicker._checkExternalClick);
5806
-		$.datepicker.initialized = true;
4935
+		// Work around for rendering bug in IE (#5421)
4936
+		if ( toHide.length ) {
4937
+			toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className;
5807 4938
 		}
5808
-
5809
-	/* Append datepicker main container to body if not exist. */
5810
-	if ($("#"+$.datepicker._mainDivId).length === 0) {
5811
-		$("body").append($.datepicker.dpDiv);
4939
+		this._trigger( "activate", null, data );
5812 4940
 	}
4941
+} );
5813 4942
 
5814
-	var otherArgs = Array.prototype.slice.call(arguments, 1);
5815
-	if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
5816
-		return $.datepicker["_" + options + "Datepicker"].
5817
-			apply($.datepicker, [this[0]].concat(otherArgs));
4943
+
4944
+
4945
+var safeActiveElement = $.ui.safeActiveElement = function( document ) {
4946
+	var activeElement;
4947
+
4948
+	// Support: IE 9 only
4949
+	// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
4950
+	try {
4951
+		activeElement = document.activeElement;
4952
+	} catch ( error ) {
4953
+		activeElement = document.body;
5818 4954
 	}
5819
-	if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
5820
-		return $.datepicker["_" + options + "Datepicker"].
5821
-			apply($.datepicker, [this[0]].concat(otherArgs));
4955
+
4956
+	// Support: IE 9 - 11 only
4957
+	// IE may return null instead of an element
4958
+	// Interestingly, this only seems to occur when NOT in an iframe
4959
+	if ( !activeElement ) {
4960
+		activeElement = document.body;
5822 4961
 	}
5823
-	return this.each(function() {
5824
-		typeof options === "string" ?
5825
-			$.datepicker["_" + options + "Datepicker"].
5826
-				apply($.datepicker, [this].concat(otherArgs)) :
5827
-			$.datepicker._attachDatepicker(this, options);
5828
-	});
5829
-};
5830 4962
 
5831
-$.datepicker = new Datepicker(); // singleton instance
5832
-$.datepicker.initialized = false;
5833
-$.datepicker.uuid = new Date().getTime();
5834
-$.datepicker.version = "1.11.4";
4963
+	// Support: IE 11 only
4964
+	// IE11 returns a seemingly empty object in some cases when accessing
4965
+	// document.activeElement from an <iframe>
4966
+	if ( !activeElement.nodeName ) {
4967
+		activeElement = document.body;
4968
+	}
5835 4969
 
5836
-var datepicker = $.datepicker;
4970
+	return activeElement;
4971
+};
5837 4972
 
5838 4973
 
5839 4974
 /*!
5840
- * jQuery UI Draggable 1.11.4
4975
+ * jQuery UI Menu 1.13.2
5841 4976
  * http://jqueryui.com
5842 4977
  *
5843 4978
  * Copyright jQuery Foundation and other contributors
5844 4979
  * Released under the MIT license.
5845 4980
  * http://jquery.org/license
5846
- *
5847
- * http://api.jqueryui.com/draggable/
5848 4981
  */
5849 4982
 
4983
+//>>label: Menu
4984
+//>>group: Widgets
4985
+//>>description: Creates nestable menus.
4986
+//>>docs: http://api.jqueryui.com/menu/
4987
+//>>demos: http://jqueryui.com/menu/
4988
+//>>css.structure: ../../themes/base/core.css
4989
+//>>css.structure: ../../themes/base/menu.css
4990
+//>>css.theme: ../../themes/base/theme.css
5850 4991
 
5851
-$.widget("ui.draggable", $.ui.mouse, {
5852
-	version: "1.11.4",
5853
-	widgetEventPrefix: "drag",
4992
+
4993
+var widgetsMenu = $.widget( "ui.menu", {
4994
+	version: "1.13.2",
4995
+	defaultElement: "<ul>",
4996
+	delay: 300,
5854 4997
 	options: {
5855
-		addClasses: true,
5856
-		appendTo: "parent",
5857
-		axis: false,
5858
-		connectToSortable: false,
5859
-		containment: false,
5860
-		cursor: "auto",
5861
-		cursorAt: false,
5862
-		grid: false,
5863
-		handle: false,
5864
-		helper: "original",
5865
-		iframeFix: false,
5866
-		opacity: false,
5867
-		refreshPositions: false,
5868
-		revert: false,
5869
-		revertDuration: 500,
5870
-		scope: "default",
5871
-		scroll: true,
5872
-		scrollSensitivity: 20,
5873
-		scrollSpeed: 20,
5874
-		snap: false,
5875
-		snapMode: "both",
5876
-		snapTolerance: 20,
5877
-		stack: false,
5878
-		zIndex: false,
4998
+		icons: {
4999
+			submenu: "ui-icon-caret-1-e"
5000
+		},
5001
+		items: "> *",
5002
+		menus: "ul",
5003
+		position: {
5004
+			my: "left top",
5005
+			at: "right top"
5006
+		},
5007
+		role: "menu",
5879 5008
 
5880
-		// callbacks
5881
-		drag: null,
5882
-		start: null,
5883
-		stop: null
5009
+		// Callbacks
5010
+		blur: null,
5011
+		focus: null,
5012
+		select: null
5884 5013
 	},
5014
+
5885 5015
 	_create: function() {
5016
+		this.activeMenu = this.element;
5886 5017
 
5887
-		if ( this.options.helper === "original" ) {
5888
-			this._setPositionRelative();
5889
-		}
5890
-		if (this.options.addClasses){
5891
-			this.element.addClass("ui-draggable");
5892
-		}
5893
-		if (this.options.disabled){
5894
-			this.element.addClass("ui-draggable-disabled");
5895
-		}
5896
-		this._setHandleClassName();
5018
+		// Flag used to prevent firing of the click handler
5019
+		// as the event bubbles up through nested menus
5020
+		this.mouseHandled = false;
5021
+		this.lastMousePosition = { x: null, y: null };
5022
+		this.element
5023
+			.uniqueId()
5024
+			.attr( {
5025
+				role: this.options.role,
5026
+				tabIndex: 0
5027
+			} );
5897 5028
 
5898
-		this._mouseInit();
5899
-	},
5029
+		this._addClass( "ui-menu", "ui-widget ui-widget-content" );
5030
+		this._on( {
5900 5031
 
5901
-	_setOption: function( key, value ) {
5902
-		this._super( key, value );
5903
-		if ( key === "handle" ) {
5904
-			this._removeHandleClassName();
5905
-			this._setHandleClassName();
5906
-		}
5032
+			// Prevent focus from sticking to links inside menu after clicking
5033
+			// them (focus should always stay on UL during navigation).
5034
+			"mousedown .ui-menu-item": function( event ) {
5035
+				event.preventDefault();
5036
+
5037
+				this._activateItem( event );
5907 5038
 			},
5039
+			"click .ui-menu-item": function( event ) {
5040
+				var target = $( event.target );
5041
+				var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
5042
+				if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
5043
+					this.select( event );
5908 5044
 
5909
-	_destroy: function() {
5910
-		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
5911
-			this.destroyOnClear = true;
5912
-			return;
5045
+					// Only set the mouseHandled flag if the event will bubble, see #9469.
5046
+					if ( !event.isPropagationStopped() ) {
5047
+						this.mouseHandled = true;
5913 5048
 					}
5914
-		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
5915
-		this._removeHandleClassName();
5916
-		this._mouseDestroy();
5917
-	},
5918 5049
 
5919
-	_mouseCapture: function(event) {
5920
-		var o = this.options;
5050
+					// Open submenu on click
5051
+					if ( target.has( ".ui-menu" ).length ) {
5052
+						this.expand( event );
5053
+					} else if ( !this.element.is( ":focus" ) &&
5054
+							active.closest( ".ui-menu" ).length ) {
5921 5055
 
5922
-		this._blurActiveElement( event );
5056
+						// Redirect focus to the menu
5057
+						this.element.trigger( "focus", [ true ] );
5923 5058
 
5924
-		// among others, prevent a drag on a resizable-handle
5925
-		if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
5926
-			return false;
5059
+						// If the active item is on the top level, let it stay active.
5060
+						// Otherwise, blur the active item since it is no longer visible.
5061
+						if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
5062
+							clearTimeout( this.timer );
5063
+						}
5927 5064
 					}
5928
-
5929
-		//Quit if we're not on a valid handle
5930
-		this.handle = this._getHandle(event);
5931
-		if (!this.handle) {
5932
-			return false;
5933 5065
 				}
5934
-
5935
-		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
5936
-
5937
-		return true;
5938
-
5939 5066
 			},
5067
+			"mouseenter .ui-menu-item": "_activateItem",
5068
+			"mousemove .ui-menu-item": "_activateItem",
5069
+			mouseleave: "collapseAll",
5070
+			"mouseleave .ui-menu": "collapseAll",
5071
+			focus: function( event, keepActiveItem ) {
5940 5072
 
5941
-	_blockFrames: function( selector ) {
5942
-		this.iframeBlocks = this.document.find( selector ).map(function() {
5943
-			var iframe = $( this );
5073
+				// If there's already an active item, keep it active
5074
+				// If not, activate the first item
5075
+				var item = this.active || this._menuItems().first();
5944 5076
 
5945
-			return $( "<div>" )
5946
-				.css( "position", "absolute" )
5947
-				.appendTo( iframe.parent() )
5948
-				.outerWidth( iframe.outerWidth() )
5949
-				.outerHeight( iframe.outerHeight() )
5950
-				.offset( iframe.offset() )[ 0 ];
5951
-		});
5077
+				if ( !keepActiveItem ) {
5078
+					this.focus( event, item );
5079
+				}
5952 5080
 			},
5953
-
5954
-	_unblockFrames: function() {
5955
-		if ( this.iframeBlocks ) {
5956
-			this.iframeBlocks.remove();
5957
-			delete this.iframeBlocks;
5081
+			blur: function( event ) {
5082
+				this._delay( function() {
5083
+					var notContained = !$.contains(
5084
+						this.element[ 0 ],
5085
+						$.ui.safeActiveElement( this.document[ 0 ] )
5086
+					);
5087
+					if ( notContained ) {
5088
+						this.collapseAll( event );
5958 5089
 					}
5090
+				} );
5959 5091
 			},
5092
+			keydown: "_keydown"
5093
+		} );
5960 5094
 
5961
-	_blurActiveElement: function( event ) {
5962
-		var document = this.document[ 0 ];
5095
+		this.refresh();
5963 5096
 
5964
-		// Only need to blur if the event occurred on the draggable itself, see #10527
5965
-		if ( !this.handleElement.is( event.target ) ) {
5966
-			return;
5097
+		// Clicks outside of a menu collapse any open menus
5098
+		this._on( this.document, {
5099
+			click: function( event ) {
5100
+				if ( this._closeOnDocumentClick( event ) ) {
5101
+					this.collapseAll( event, true );
5967 5102
 				}
5968 5103
 
5969
-		// support: IE9
5970
-		// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
5971
-		try {
5972
-
5973
-			// Support: IE9, IE10
5974
-			// If the <body> is blurred, IE will switch windows, see #9520
5975
-			if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
5976
-
5977
-				// Blur any element that currently has focus, see #4261
5978
-				$( document.activeElement ).blur();
5104
+				// Reset the mouseHandled flag
5105
+				this.mouseHandled = false;
5979 5106
 			}
5980
-		} catch ( error ) {}
5107
+		} );
5981 5108
 	},
5982 5109
 
5983
-	_mouseStart: function(event) {
5984
-
5985
-		var o = this.options;
5986
-
5987
-		//Create and append the visible helper
5988
-		this.helper = this._createHelper(event);
5989
-
5990
-		this.helper.addClass("ui-draggable-dragging");
5991
-
5992
-		//Cache the helper size
5993
-		this._cacheHelperProportions();
5110
+	_activateItem: function( event ) {
5994 5111
 
5995
-		//If ddmanager is used for droppables, set the global draggable
5996
-		if ($.ui.ddmanager) {
5997
-			$.ui.ddmanager.current = this;
5112
+		// Ignore mouse events while typeahead is active, see #10458.
5113
+		// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
5114
+		// is over an item in the menu
5115
+		if ( this.previousFilter ) {
5116
+			return;
5998 5117
 		}
5999 5118
 
6000
-		/*
6001
-		 * - Position generation -
6002
-		 * This block generates everything position related - it's the core of draggables.
6003
-		 */
6004
-
6005
-		//Cache the margins of the original element
6006
-		this._cacheMargins();
6007
-
6008
-		//Store the helper's css position
6009
-		this.cssPosition = this.helper.css( "position" );
6010
-		this.scrollParent = this.helper.scrollParent( true );
6011
-		this.offsetParent = this.helper.offsetParent();
6012
-		this.hasFixedAncestor = this.helper.parents().filter(function() {
6013
-				return $( this ).css( "position" ) === "fixed";
6014
-			}).length > 0;
6015
-
6016
-		//The element's absolute position on the page minus margins
6017
-		this.positionAbs = this.element.offset();
6018
-		this._refreshOffsets( event );
6019
-
6020
-		//Generate the original position
6021
-		this.originalPosition = this.position = this._generatePosition( event, false );
6022
-		this.originalPageX = event.pageX;
6023
-		this.originalPageY = event.pageY;
5119
+		// If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356)
5120
+		if ( event.clientX === this.lastMousePosition.x &&
5121
+				event.clientY === this.lastMousePosition.y ) {
5122
+			return;
5123
+		}
6024 5124
 
6025
-		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
6026
-		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
5125
+		this.lastMousePosition = {
5126
+			x: event.clientX,
5127
+			y: event.clientY
5128
+		};
6027 5129
 
6028
-		//Set a containment if given in the options
6029
-		this._setContainment();
5130
+		var actualTarget = $( event.target ).closest( ".ui-menu-item" ),
5131
+			target = $( event.currentTarget );
6030 5132
 
6031
-		//Trigger event + callbacks
6032
-		if (this._trigger("start", event) === false) {
6033
-			this._clear();
6034
-			return false;
5133
+		// Ignore bubbled events on parent items, see #11641
5134
+		if ( actualTarget[ 0 ] !== target[ 0 ] ) {
5135
+			return;
6035 5136
 		}
6036 5137
 
6037
-		//Recache the helper size
6038
-		this._cacheHelperProportions();
6039
-
6040
-		//Prepare the droppable offsets
6041
-		if ($.ui.ddmanager && !o.dropBehaviour) {
6042
-			$.ui.ddmanager.prepareOffsets(this, event);
5138
+		// If the item is already active, there's nothing to do
5139
+		if ( target.is( ".ui-state-active" ) ) {
5140
+			return;
6043 5141
 		}
6044 5142
 
6045
-		// Reset helper's right/bottom css if they're set and set explicit width/height instead
6046
-		// as this prevents resizing of elements with right/bottom set (see #7772)
6047
-		this._normalizeRightBottom();
5143
+		// Remove ui-state-active class from siblings of the newly focused menu item
5144
+		// to avoid a jump caused by adjacent elements both having a class with a border
5145
+		this._removeClass( target.siblings().children( ".ui-state-active" ),
5146
+			null, "ui-state-active" );
5147
+		this.focus( event, target );
5148
+	},
5149
+
5150
+	_destroy: function() {
5151
+		var items = this.element.find( ".ui-menu-item" )
5152
+				.removeAttr( "role aria-disabled" ),
5153
+			submenus = items.children( ".ui-menu-item-wrapper" )
5154
+				.removeUniqueId()
5155
+				.removeAttr( "tabIndex role aria-haspopup" );
6048 5156
 
6049
-		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
5157
+		// Destroy (sub)menus
5158
+		this.element
5159
+			.removeAttr( "aria-activedescendant" )
5160
+			.find( ".ui-menu" ).addBack()
5161
+				.removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " +
5162
+					"tabIndex" )
5163
+				.removeUniqueId()
5164
+				.show();
6050 5165
 
6051
-		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
6052
-		if ( $.ui.ddmanager ) {
6053
-			$.ui.ddmanager.dragStart(this, event);
5166
+		submenus.children().each( function() {
5167
+			var elem = $( this );
5168
+			if ( elem.data( "ui-menu-submenu-caret" ) ) {
5169
+				elem.remove();
6054 5170
 			}
6055
-
6056
-		return true;
5171
+		} );
6057 5172
 	},
6058 5173
 
6059
-	_refreshOffsets: function( event ) {
6060
-		this.offset = {
6061
-			top: this.positionAbs.top - this.margins.top,
6062
-			left: this.positionAbs.left - this.margins.left,
6063
-			scroll: false,
6064
-			parent: this._getParentOffset(),
6065
-			relative: this._getRelativeOffset()
6066
-		};
5174
+	_keydown: function( event ) {
5175
+		var match, prev, character, skip,
5176
+			preventDefault = true;
6067 5177
 
6068
-		this.offset.click = {
6069
-			left: event.pageX - this.offset.left,
6070
-			top: event.pageY - this.offset.top
6071
-		};
6072
-	},
6073
-
6074
-	_mouseDrag: function(event, noPropagation) {
6075
-		// reset any necessary cached properties (see #5009)
6076
-		if ( this.hasFixedAncestor ) {
6077
-			this.offset.parent = this._getParentOffset();
5178
+		switch ( event.keyCode ) {
5179
+		case $.ui.keyCode.PAGE_UP:
5180
+			this.previousPage( event );
5181
+			break;
5182
+		case $.ui.keyCode.PAGE_DOWN:
5183
+			this.nextPage( event );
5184
+			break;
5185
+		case $.ui.keyCode.HOME:
5186
+			this._move( "first", "first", event );
5187
+			break;
5188
+		case $.ui.keyCode.END:
5189
+			this._move( "last", "last", event );
5190
+			break;
5191
+		case $.ui.keyCode.UP:
5192
+			this.previous( event );
5193
+			break;
5194
+		case $.ui.keyCode.DOWN:
5195
+			this.next( event );
5196
+			break;
5197
+		case $.ui.keyCode.LEFT:
5198
+			this.collapse( event );
5199
+			break;
5200
+		case $.ui.keyCode.RIGHT:
5201
+			if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
5202
+				this.expand( event );
6078 5203
 			}
5204
+			break;
5205
+		case $.ui.keyCode.ENTER:
5206
+		case $.ui.keyCode.SPACE:
5207
+			this._activate( event );
5208
+			break;
5209
+		case $.ui.keyCode.ESCAPE:
5210
+			this.collapse( event );
5211
+			break;
5212
+		default:
5213
+			preventDefault = false;
5214
+			prev = this.previousFilter || "";
5215
+			skip = false;
6079 5216
 
6080
-		//Compute the helpers position
6081
-		this.position = this._generatePosition( event, true );
6082
-		this.positionAbs = this._convertPositionTo("absolute");
6083
-
6084
-		//Call plugins and callbacks and use the resulting position if something is returned
6085
-		if (!noPropagation) {
6086
-			var ui = this._uiHash();
6087
-			if (this._trigger("drag", event, ui) === false) {
6088
-				this._mouseUp({});
6089
-				return false;
6090
-			}
6091
-			this.position = ui.position;
6092
-		}
5217
+			// Support number pad values
5218
+			character = event.keyCode >= 96 && event.keyCode <= 105 ?
5219
+				( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode );
6093 5220
 
6094
-		this.helper[ 0 ].style.left = this.position.left + "px";
6095
-		this.helper[ 0 ].style.top = this.position.top + "px";
5221
+			clearTimeout( this.filterTimer );
6096 5222
 
6097
-		if ($.ui.ddmanager) {
6098
-			$.ui.ddmanager.drag(this, event);
5223
+			if ( character === prev ) {
5224
+				skip = true;
5225
+			} else {
5226
+				character = prev + character;
6099 5227
 			}
6100 5228
 
6101
-		return false;
6102
-	},
6103
-
6104
-	_mouseStop: function(event) {
5229
+			match = this._filterMenuItems( character );
5230
+			match = skip && match.index( this.active.next() ) !== -1 ?
5231
+				this.active.nextAll( ".ui-menu-item" ) :
5232
+				match;
6105 5233
 
6106
-		//If we are using droppables, inform the manager about the drop
6107
-		var that = this,
6108
-			dropped = false;
6109
-		if ($.ui.ddmanager && !this.options.dropBehaviour) {
6110
-			dropped = $.ui.ddmanager.drop(this, event);
5234
+			// If no matches on the current filter, reset to the last character pressed
5235
+			// to move down the menu to the first item that starts with that character
5236
+			if ( !match.length ) {
5237
+				character = String.fromCharCode( event.keyCode );
5238
+				match = this._filterMenuItems( character );
6111 5239
 			}
6112 5240
 
6113
-		//if a drop comes from outside (a sortable)
6114
-		if (this.dropped) {
6115
-			dropped = this.dropped;
6116
-			this.dropped = false;
5241
+			if ( match.length ) {
5242
+				this.focus( event, match );
5243
+				this.previousFilter = character;
5244
+				this.filterTimer = this._delay( function() {
5245
+					delete this.previousFilter;
5246
+				}, 1000 );
5247
+			} else {
5248
+				delete this.previousFilter;
5249
+			}
6117 5250
 		}
6118 5251
 
6119
-		if ((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
6120
-			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
6121
-				if (that._trigger("stop", event) !== false) {
6122
-					that._clear();
5252
+		if ( preventDefault ) {
5253
+			event.preventDefault();
6123 5254
 		}
6124
-			});
5255
+	},
5256
+
5257
+	_activate: function( event ) {
5258
+		if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
5259
+			if ( this.active.children( "[aria-haspopup='true']" ).length ) {
5260
+				this.expand( event );
6125 5261
 			} else {
6126
-			if (this._trigger("stop", event) !== false) {
6127
-				this._clear();
5262
+				this.select( event );
6128 5263
 			}
6129 5264
 		}
6130
-
6131
-		return false;
6132 5265
 	},
6133 5266
 
6134
-	_mouseUp: function( event ) {
6135
-		this._unblockFrames();
5267
+	refresh: function() {
5268
+		var menus, items, newSubmenus, newItems, newWrappers,
5269
+			that = this,
5270
+			icon = this.options.icons.submenu,
5271
+			submenus = this.element.find( this.options.menus );
6136 5272
 
6137
-		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
6138
-		if ( $.ui.ddmanager ) {
6139
-			$.ui.ddmanager.dragStop(this, event);
6140
-		}
5273
+		this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length );
6141 5274
 
6142
-		// Only need to focus if the event occurred on the draggable itself, see #10527
6143
-		if ( this.handleElement.is( event.target ) ) {
6144
-			// The interaction is over; whether or not the click resulted in a drag, focus the element
6145
-			this.element.focus();
6146
-		}
5275
+		// Initialize nested menus
5276
+		newSubmenus = submenus.filter( ":not(.ui-menu)" )
5277
+			.hide()
5278
+			.attr( {
5279
+				role: this.options.role,
5280
+				"aria-hidden": "true",
5281
+				"aria-expanded": "false"
5282
+			} )
5283
+			.each( function() {
5284
+				var menu = $( this ),
5285
+					item = menu.prev(),
5286
+					submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true );
6147 5287
 
6148
-		return $.ui.mouse.prototype._mouseUp.call(this, event);
6149
-	},
5288
+				that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon );
5289
+				item
5290
+					.attr( "aria-haspopup", "true" )
5291
+					.prepend( submenuCaret );
5292
+				menu.attr( "aria-labelledby", item.attr( "id" ) );
5293
+			} );
6150 5294
 
6151
-	cancel: function() {
5295
+		this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" );
6152 5296
 
6153
-		if (this.helper.is(".ui-draggable-dragging")) {
6154
-			this._mouseUp({});
6155
-		} else {
6156
-			this._clear();
5297
+		menus = submenus.add( this.element );
5298
+		items = menus.find( this.options.items );
5299
+
5300
+		// Initialize menu-items containing spaces and/or dashes only as dividers
5301
+		items.not( ".ui-menu-item" ).each( function() {
5302
+			var item = $( this );
5303
+			if ( that._isDivider( item ) ) {
5304
+				that._addClass( item, "ui-menu-divider", "ui-widget-content" );
6157 5305
 			}
5306
+		} );
6158 5307
 
6159
-		return this;
5308
+		// Don't refresh list items that are already adapted
5309
+		newItems = items.not( ".ui-menu-item, .ui-menu-divider" );
5310
+		newWrappers = newItems.children()
5311
+			.not( ".ui-menu" )
5312
+				.uniqueId()
5313
+				.attr( {
5314
+					tabIndex: -1,
5315
+					role: this._itemRole()
5316
+				} );
5317
+		this._addClass( newItems, "ui-menu-item" )
5318
+			._addClass( newWrappers, "ui-menu-item-wrapper" );
5319
+
5320
+		// Add aria-disabled attribute to any disabled menu item
5321
+		items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
6160 5322
 
5323
+		// If the active item has been removed, blur the menu
5324
+		if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
5325
+			this.blur();
5326
+		}
6161 5327
 	},
6162 5328
 
6163
-	_getHandle: function(event) {
6164
-		return this.options.handle ?
6165
-			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
6166
-			true;
5329
+	_itemRole: function() {
5330
+		return {
5331
+			menu: "menuitem",
5332
+			listbox: "option"
5333
+		}[ this.options.role ];
6167 5334
 	},
6168 5335
 
6169
-	_setHandleClassName: function() {
6170
-		this.handleElement = this.options.handle ?
6171
-			this.element.find( this.options.handle ) : this.element;
6172
-		this.handleElement.addClass( "ui-draggable-handle" );
5336
+	_setOption: function( key, value ) {
5337
+		if ( key === "icons" ) {
5338
+			var icons = this.element.find( ".ui-menu-icon" );
5339
+			this._removeClass( icons, null, this.options.icons.submenu )
5340
+				._addClass( icons, null, value.submenu );
5341
+		}
5342
+		this._super( key, value );
6173 5343
 	},
6174 5344
 
6175
-	_removeHandleClassName: function() {
6176
-		this.handleElement.removeClass( "ui-draggable-handle" );
5345
+	_setOptionDisabled: function( value ) {
5346
+		this._super( value );
5347
+
5348
+		this.element.attr( "aria-disabled", String( value ) );
5349
+		this._toggleClass( null, "ui-state-disabled", !!value );
6177 5350
 	},
6178 5351
 
6179
-	_createHelper: function(event) {
5352
+	focus: function( event, item ) {
5353
+		var nested, focused, activeParent;
5354
+		this.blur( event, event && event.type === "focus" );
6180 5355
 
6181
-		var o = this.options,
6182
-			helperIsFunction = $.isFunction( o.helper ),
6183
-			helper = helperIsFunction ?
6184
-				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
6185
-				( o.helper === "clone" ?
6186
-					this.element.clone().removeAttr( "id" ) :
6187
-					this.element );
5356
+		this._scrollIntoView( item );
6188 5357
 
6189
-		if (!helper.parents("body").length) {
6190
-			helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
6191
-		}
5358
+		this.active = item.first();
6192 5359
 
6193
-		// http://bugs.jqueryui.com/ticket/9446
6194
-		// a helper function can return the original element
6195
-		// which wouldn't have been set to relative in _create
6196
-		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
6197
-			this._setPositionRelative();
6198
-		}
5360
+		focused = this.active.children( ".ui-menu-item-wrapper" );
5361
+		this._addClass( focused, null, "ui-state-active" );
6199 5362
 
6200
-		if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
6201
-			helper.css("position", "absolute");
5363
+		// Only update aria-activedescendant if there's a role
5364
+		// otherwise we assume focus is managed elsewhere
5365
+		if ( this.options.role ) {
5366
+			this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
6202 5367
 		}
6203 5368
 
6204
-		return helper;
5369
+		// Highlight active parent menu item, if any
5370
+		activeParent = this.active
5371
+			.parent()
5372
+				.closest( ".ui-menu-item" )
5373
+					.children( ".ui-menu-item-wrapper" );
5374
+		this._addClass( activeParent, null, "ui-state-active" );
6205 5375
 
6206
-	},
5376
+		if ( event && event.type === "keydown" ) {
5377
+			this._close();
5378
+		} else {
5379
+			this.timer = this._delay( function() {
5380
+				this._close();
5381
+			}, this.delay );
5382
+		}
6207 5383
 
6208
-	_setPositionRelative: function() {
6209
-		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
6210
-			this.element[ 0 ].style.position = "relative";
5384
+		nested = item.children( ".ui-menu" );
5385
+		if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
5386
+			this._startOpening( nested );
6211 5387
 		}
5388
+		this.activeMenu = item.parent();
5389
+
5390
+		this._trigger( "focus", event, { item: item } );
6212 5391
 	},
6213 5392
 
6214
-	_adjustOffsetFromHelper: function(obj) {
6215
-		if (typeof obj === "string") {
6216
-			obj = obj.split(" ");
6217
-		}
6218
-		if ($.isArray(obj)) {
6219
-			obj = { left: +obj[0], top: +obj[1] || 0 };
6220
-		}
6221
-		if ("left" in obj) {
6222
-			this.offset.click.left = obj.left + this.margins.left;
6223
-		}
6224
-		if ("right" in obj) {
6225
-			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
6226
-		}
6227
-		if ("top" in obj) {
6228
-			this.offset.click.top = obj.top + this.margins.top;
5393
+	_scrollIntoView: function( item ) {
5394
+		var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
5395
+		if ( this._hasScroll() ) {
5396
+			borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0;
5397
+			paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0;
5398
+			offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
5399
+			scroll = this.activeMenu.scrollTop();
5400
+			elementHeight = this.activeMenu.height();
5401
+			itemHeight = item.outerHeight();
5402
+
5403
+			if ( offset < 0 ) {
5404
+				this.activeMenu.scrollTop( scroll + offset );
5405
+			} else if ( offset + itemHeight > elementHeight ) {
5406
+				this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
6229 5407
 			}
6230
-		if ("bottom" in obj) {
6231
-			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
6232 5408
 		}
6233 5409
 	},
6234 5410
 
6235
-	_isRootNode: function( element ) {
6236
-		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
6237
-	},
6238
-
6239
-	_getParentOffset: function() {
6240
-
6241
-		//Get the offsetParent and cache its position
6242
-		var po = this.offsetParent.offset(),
6243
-			document = this.document[ 0 ];
6244
-
6245
-		// This is a special case where we need to modify a offset calculated on start, since the following happened:
6246
-		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
6247
-		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
6248
-		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
6249
-		if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
6250
-			po.left += this.scrollParent.scrollLeft();
6251
-			po.top += this.scrollParent.scrollTop();
5411
+	blur: function( event, fromFocus ) {
5412
+		if ( !fromFocus ) {
5413
+			clearTimeout( this.timer );
6252 5414
 		}
6253 5415
 
6254
-		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
6255
-			po = { top: 0, left: 0 };
5416
+		if ( !this.active ) {
5417
+			return;
6256 5418
 		}
6257 5419
 
6258
-		return {
6259
-			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
6260
-			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
6261
-		};
5420
+		this._removeClass( this.active.children( ".ui-menu-item-wrapper" ),
5421
+			null, "ui-state-active" );
6262 5422
 
5423
+		this._trigger( "blur", event, { item: this.active } );
5424
+		this.active = null;
6263 5425
 	},
6264 5426
 
6265
-	_getRelativeOffset: function() {
6266
-		if ( this.cssPosition !== "relative" ) {
6267
-			return { top: 0, left: 0 };
6268
-		}
6269
-
6270
-		var p = this.element.position(),
6271
-			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
6272
-
6273
-		return {
6274
-			top: p.top - ( parseInt(this.helper.css( "top" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
6275
-			left: p.left - ( parseInt(this.helper.css( "left" ), 10) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
6276
-		};
5427
+	_startOpening: function( submenu ) {
5428
+		clearTimeout( this.timer );
6277 5429
 
6278
-	},
5430
+		// Don't open if already open fixes a Firefox bug that caused a .5 pixel
5431
+		// shift in the submenu position when mousing over the caret icon
5432
+		if ( submenu.attr( "aria-hidden" ) !== "true" ) {
5433
+			return;
5434
+		}
6279 5435
 
6280
-	_cacheMargins: function() {
6281
-		this.margins = {
6282
-			left: (parseInt(this.element.css("marginLeft"), 10) || 0),
6283
-			top: (parseInt(this.element.css("marginTop"), 10) || 0),
6284
-			right: (parseInt(this.element.css("marginRight"), 10) || 0),
6285
-			bottom: (parseInt(this.element.css("marginBottom"), 10) || 0)
6286
-		};
5436
+		this.timer = this._delay( function() {
5437
+			this._close();
5438
+			this._open( submenu );
5439
+		}, this.delay );
6287 5440
 	},
6288 5441
 
6289
-	_cacheHelperProportions: function() {
6290
-		this.helperProportions = {
6291
-			width: this.helper.outerWidth(),
6292
-			height: this.helper.outerHeight()
6293
-		};
6294
-	},
5442
+	_open: function( submenu ) {
5443
+		var position = $.extend( {
5444
+			of: this.active
5445
+		}, this.options.position );
6295 5446
 
6296
-	_setContainment: function() {
5447
+		clearTimeout( this.timer );
5448
+		this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
5449
+			.hide()
5450
+			.attr( "aria-hidden", "true" );
6297 5451
 
6298
-		var isUserScrollable, c, ce,
6299
-			o = this.options,
6300
-			document = this.document[ 0 ];
5452
+		submenu
5453
+			.show()
5454
+			.removeAttr( "aria-hidden" )
5455
+			.attr( "aria-expanded", "true" )
5456
+			.position( position );
5457
+	},
6301 5458
 
6302
-		this.relativeContainer = null;
5459
+	collapseAll: function( event, all ) {
5460
+		clearTimeout( this.timer );
5461
+		this.timer = this._delay( function() {
6303 5462
 
6304
-		if ( !o.containment ) {
6305
-			this.containment = null;
6306
-			return;
6307
-		}
5463
+			// If we were passed an event, look for the submenu that contains the event
5464
+			var currentMenu = all ? this.element :
5465
+				$( event && event.target ).closest( this.element.find( ".ui-menu" ) );
6308 5466
 
6309
-		if ( o.containment === "window" ) {
6310
-			this.containment = [
6311
-				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
6312
-				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
6313
-				$( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
6314
-				$( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
6315
-			];
6316
-			return;
5467
+			// If we found no valid submenu ancestor, use the main menu to close all
5468
+			// sub menus anyway
5469
+			if ( !currentMenu.length ) {
5470
+				currentMenu = this.element;
6317 5471
 			}
6318 5472
 
6319
-		if ( o.containment === "document") {
6320
-			this.containment = [
6321
-				0,
6322
-				0,
6323
-				$( document ).width() - this.helperProportions.width - this.margins.left,
6324
-				( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
6325
-			];
6326
-			return;
6327
-		}
5473
+			this._close( currentMenu );
6328 5474
 
6329
-		if ( o.containment.constructor === Array ) {
6330
-			this.containment = o.containment;
6331
-			return;
6332
-		}
5475
+			this.blur( event );
6333 5476
 
6334
-		if ( o.containment === "parent" ) {
6335
-			o.containment = this.helper[ 0 ].parentNode;
6336
-		}
5477
+			// Work around active item staying active after menu is blurred
5478
+			this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" );
6337 5479
 
6338
-		c = $( o.containment );
6339
-		ce = c[ 0 ];
5480
+			this.activeMenu = currentMenu;
5481
+		}, all ? 0 : this.delay );
5482
+	},
6340 5483
 
6341
-		if ( !ce ) {
6342
-			return;
5484
+	// With no arguments, closes the currently active menu - if nothing is active
5485
+	// it closes all menus.  If passed an argument, it will search for menus BELOW
5486
+	_close: function( startMenu ) {
5487
+		if ( !startMenu ) {
5488
+			startMenu = this.active ? this.active.parent() : this.element;
6343 5489
 		}
6344 5490
 
6345
-		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
5491
+		startMenu.find( ".ui-menu" )
5492
+			.hide()
5493
+			.attr( "aria-hidden", "true" )
5494
+			.attr( "aria-expanded", "false" );
5495
+	},
6346 5496
 
6347
-		this.containment = [
6348
-			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
6349
-			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
6350
-			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
6351
-				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
6352
-				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
6353
-				this.helperProportions.width -
6354
-				this.margins.left -
6355
-				this.margins.right,
6356
-			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
6357
-				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
6358
-				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
6359
-				this.helperProportions.height -
6360
-				this.margins.top -
6361
-				this.margins.bottom
6362
-		];
6363
-		this.relativeContainer = c;
5497
+	_closeOnDocumentClick: function( event ) {
5498
+		return !$( event.target ).closest( ".ui-menu" ).length;
6364 5499
 	},
6365 5500
 
6366
-	_convertPositionTo: function(d, pos) {
5501
+	_isDivider: function( item ) {
6367 5502
 
6368
-		if (!pos) {
6369
-			pos = this.position;
5503
+		// Match hyphen, em dash, en dash
5504
+		return !/[^\-\u2014\u2013\s]/.test( item.text() );
5505
+	},
5506
+
5507
+	collapse: function( event ) {
5508
+		var newItem = this.active &&
5509
+			this.active.parent().closest( ".ui-menu-item", this.element );
5510
+		if ( newItem && newItem.length ) {
5511
+			this._close();
5512
+			this.focus( event, newItem );
6370 5513
 		}
5514
+	},
6371 5515
 
6372
-		var mod = d === "absolute" ? 1 : -1,
6373
-			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
5516
+	expand: function( event ) {
5517
+		var newItem = this.active && this._menuItems( this.active.children( ".ui-menu" ) ).first();
6374 5518
 
6375
-		return {
6376
-			top: (
6377
-				pos.top	+																// The absolute mouse position
6378
-				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
6379
-				this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
6380
-				( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
6381
-			),
6382
-			left: (
6383
-				pos.left +																// The absolute mouse position
6384
-				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
6385
-				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
6386
-				( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod)
6387
-			)
6388
-		};
5519
+		if ( newItem && newItem.length ) {
5520
+			this._open( newItem.parent() );
6389 5521
 
5522
+			// Delay so Firefox will not hide activedescendant change in expanding submenu from AT
5523
+			this._delay( function() {
5524
+				this.focus( event, newItem );
5525
+			} );
5526
+		}
6390 5527
 	},
6391 5528
 
6392
-	_generatePosition: function( event, constrainPosition ) {
5529
+	next: function( event ) {
5530
+		this._move( "next", "first", event );
5531
+	},
6393 5532
 
6394
-		var containment, co, top, left,
6395
-			o = this.options,
6396
-			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
6397
-			pageX = event.pageX,
6398
-			pageY = event.pageY;
5533
+	previous: function( event ) {
5534
+		this._move( "prev", "last", event );
5535
+	},
6399 5536
 
6400
-		// Cache the scroll
6401
-		if ( !scrollIsRootNode || !this.offset.scroll ) {
6402
-			this.offset.scroll = {
6403
-				top: this.scrollParent.scrollTop(),
6404
-				left: this.scrollParent.scrollLeft()
6405
-			};
6406
-		}
5537
+	isFirstItem: function() {
5538
+		return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
5539
+	},
6407 5540
 
6408
-		/*
6409
-		 * - Position constraining -
6410
-		 * Constrain the position to a mix of grid, containment.
6411
-		 */
5541
+	isLastItem: function() {
5542
+		return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
5543
+	},
6412 5544
 
6413
-		// If we are not dragging yet, we won't check for options
6414
-		if ( constrainPosition ) {
6415
-			if ( this.containment ) {
6416
-				if ( this.relativeContainer ){
6417
-					co = this.relativeContainer.offset();
6418
-					containment = [
6419
-						this.containment[ 0 ] + co.left,
6420
-						this.containment[ 1 ] + co.top,
6421
-						this.containment[ 2 ] + co.left,
6422
-						this.containment[ 3 ] + co.top
6423
-					];
6424
-				} else {
6425
-					containment = this.containment;
6426
-				}
5545
+	_menuItems: function( menu ) {
5546
+		return ( menu || this.element )
5547
+			.find( this.options.items )
5548
+			.filter( ".ui-menu-item" );
5549
+	},
6427 5550
 
6428
-				if (event.pageX - this.offset.click.left < containment[0]) {
6429
-					pageX = containment[0] + this.offset.click.left;
6430
-				}
6431
-				if (event.pageY - this.offset.click.top < containment[1]) {
6432
-					pageY = containment[1] + this.offset.click.top;
6433
-				}
6434
-				if (event.pageX - this.offset.click.left > containment[2]) {
6435
-					pageX = containment[2] + this.offset.click.left;
5551
+	_move: function( direction, filter, event ) {
5552
+		var next;
5553
+		if ( this.active ) {
5554
+			if ( direction === "first" || direction === "last" ) {
5555
+				next = this.active
5556
+					[ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
5557
+					.last();
5558
+			} else {
5559
+				next = this.active
5560
+					[ direction + "All" ]( ".ui-menu-item" )
5561
+					.first();
6436 5562
 			}
6437
-				if (event.pageY - this.offset.click.top > containment[3]) {
6438
-					pageY = containment[3] + this.offset.click.top;
6439 5563
 		}
5564
+		if ( !next || !next.length || !this.active ) {
5565
+			next = this._menuItems( this.activeMenu )[ filter ]();
6440 5566
 		}
6441 5567
 
6442
-			if (o.grid) {
6443
-				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
6444
-				top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
6445
-				pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
5568
+		this.focus( event, next );
5569
+	},
5570
+
5571
+	nextPage: function( event ) {
5572
+		var item, base, height;
6446 5573
 
6447
-				left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
6448
-				pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
5574
+		if ( !this.active ) {
5575
+			this.next( event );
5576
+			return;
5577
+		}
5578
+		if ( this.isLastItem() ) {
5579
+			return;
6449 5580
 		}
5581
+		if ( this._hasScroll() ) {
5582
+			base = this.active.offset().top;
5583
+			height = this.element.innerHeight();
6450 5584
 
6451
-			if ( o.axis === "y" ) {
6452
-				pageX = this.originalPageX;
5585
+			// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
5586
+			if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
5587
+				height += this.element[ 0 ].offsetHeight - this.element.outerHeight();
6453 5588
 			}
6454 5589
 
6455
-			if ( o.axis === "x" ) {
6456
-				pageY = this.originalPageY;
6457
-			}
6458
-		}
6459
-
6460
-		return {
6461
-			top: (
6462
-				pageY -																	// The absolute mouse position
6463
-				this.offset.click.top	-												// Click offset (relative to the element)
6464
-				this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
6465
-				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
6466
-				( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
6467
-			),
6468
-			left: (
6469
-				pageX -																	// The absolute mouse position
6470
-				this.offset.click.left -												// Click offset (relative to the element)
6471
-				this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
6472
-				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
6473
-				( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
6474
-			)
6475
-		};
5590
+			this.active.nextAll( ".ui-menu-item" ).each( function() {
5591
+				item = $( this );
5592
+				return item.offset().top - base - height < 0;
5593
+			} );
6476 5594
 
5595
+			this.focus( event, item );
5596
+		} else {
5597
+			this.focus( event, this._menuItems( this.activeMenu )
5598
+				[ !this.active ? "first" : "last" ]() );
5599
+		}
6477 5600
 	},
6478 5601
 
6479
-	_clear: function() {
6480
-		this.helper.removeClass("ui-draggable-dragging");
6481
-		if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
6482
-			this.helper.remove();
5602
+	previousPage: function( event ) {
5603
+		var item, base, height;
5604
+		if ( !this.active ) {
5605
+			this.next( event );
5606
+			return;
6483 5607
 		}
6484
-		this.helper = null;
6485
-		this.cancelHelperRemoval = false;
6486
-		if ( this.destroyOnClear ) {
6487
-			this.destroy();
5608
+		if ( this.isFirstItem() ) {
5609
+			return;
6488 5610
 		}
6489
-	},
5611
+		if ( this._hasScroll() ) {
5612
+			base = this.active.offset().top;
5613
+			height = this.element.innerHeight();
6490 5614
 
6491
-	_normalizeRightBottom: function() {
6492
-		if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
6493
-			this.helper.width( this.helper.width() );
6494
-			this.helper.css( "right", "auto" );
5615
+			// jQuery 3.2 doesn't include scrollbars in innerHeight, add it back.
5616
+			if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) {
5617
+				height += this.element[ 0 ].offsetHeight - this.element.outerHeight();
6495 5618
 			}
6496
-		if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
6497
-			this.helper.height( this.helper.height() );
6498
-			this.helper.css( "bottom", "auto" );
5619
+
5620
+			this.active.prevAll( ".ui-menu-item" ).each( function() {
5621
+				item = $( this );
5622
+				return item.offset().top - base + height > 0;
5623
+			} );
5624
+
5625
+			this.focus( event, item );
5626
+		} else {
5627
+			this.focus( event, this._menuItems( this.activeMenu ).first() );
6499 5628
 		}
6500 5629
 	},
6501 5630
 
6502
-	// From now on bulk stuff - mainly helpers
5631
+	_hasScroll: function() {
5632
+		return this.element.outerHeight() < this.element.prop( "scrollHeight" );
5633
+	},
6503 5634
 
6504
-	_trigger: function( type, event, ui ) {
6505
-		ui = ui || this._uiHash();
6506
-		$.ui.plugin.call( this, type, [ event, ui, this ], true );
5635
+	select: function( event ) {
6507 5636
 
6508
-		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
6509
-		if ( /^(drag|start|stop)/.test( type ) ) {
6510
-			this.positionAbs = this._convertPositionTo( "absolute" );
6511
-			ui.offset = this.positionAbs;
5637
+		// TODO: It should never be possible to not have an active item at this
5638
+		// point, but the tests don't trigger mouseenter before click.
5639
+		this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
5640
+		var ui = { item: this.active };
5641
+		if ( !this.active.has( ".ui-menu" ).length ) {
5642
+			this.collapseAll( event, true );
6512 5643
 		}
6513
-		return $.Widget.prototype._trigger.call( this, type, event, ui );
5644
+		this._trigger( "select", event, ui );
6514 5645
 	},
6515 5646
 
6516
-	plugins: {},
5647
+	_filterMenuItems: function( character ) {
5648
+		var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
5649
+			regex = new RegExp( "^" + escapedCharacter, "i" );
6517 5650
 
6518
-	_uiHash: function() {
6519
-		return {
6520
-			helper: this.helper,
6521
-			position: this.position,
6522
-			originalPosition: this.originalPosition,
6523
-			offset: this.positionAbs
6524
-		};
6525
-	}
5651
+		return this.activeMenu
5652
+			.find( this.options.items )
6526 5653
 
5654
+				// Only match on items, not dividers or other content (#10571)
5655
+				.filter( ".ui-menu-item" )
5656
+					.filter( function() {
5657
+						return regex.test(
5658
+							String.prototype.trim.call(
5659
+								$( this ).children( ".ui-menu-item-wrapper" ).text() ) );
6527 5660
 					} );
6528
-
6529
-$.ui.plugin.add( "draggable", "connectToSortable", {
6530
-	start: function( event, ui, draggable ) {
6531
-		var uiSortable = $.extend( {}, ui, {
6532
-			item: draggable.element
5661
+	}
6533 5662
 } );
6534 5663
 
6535
-		draggable.sortables = [];
6536
-		$( draggable.options.connectToSortable ).each(function() {
6537
-			var sortable = $( this ).sortable( "instance" );
6538 5664
 
6539
-			if ( sortable && !sortable.options.disabled ) {
6540
-				draggable.sortables.push( sortable );
5665
+/*!
5666
+ * jQuery UI Autocomplete 1.13.2
5667
+ * http://jqueryui.com
5668
+ *
5669
+ * Copyright jQuery Foundation and other contributors
5670
+ * Released under the MIT license.
5671
+ * http://jquery.org/license
5672
+ */
6541 5673
 
6542
-				// refreshPositions is called at drag start to refresh the containerCache
6543
-				// which is used in drag. This ensures it's initialized and synchronized
6544
-				// with any changes that might have happened on the page since initialization.
6545
-				sortable.refreshPositions();
6546
-				sortable._trigger("activate", event, uiSortable);
6547
-			}
6548
-		});
5674
+//>>label: Autocomplete
5675
+//>>group: Widgets
5676
+//>>description: Lists suggested words as the user is typing.
5677
+//>>docs: http://api.jqueryui.com/autocomplete/
5678
+//>>demos: http://jqueryui.com/autocomplete/
5679
+//>>css.structure: ../../themes/base/core.css
5680
+//>>css.structure: ../../themes/base/autocomplete.css
5681
+//>>css.theme: ../../themes/base/theme.css
5682
+
5683
+
5684
+$.widget( "ui.autocomplete", {
5685
+	version: "1.13.2",
5686
+	defaultElement: "<input>",
5687
+	options: {
5688
+		appendTo: null,
5689
+		autoFocus: false,
5690
+		delay: 300,
5691
+		minLength: 1,
5692
+		position: {
5693
+			my: "left top",
5694
+			at: "left bottom",
5695
+			collision: "none"
6549 5696
 		},
6550
-	stop: function( event, ui, draggable ) {
6551
-		var uiSortable = $.extend( {}, ui, {
6552
-			item: draggable.element
6553
-		});
5697
+		source: null,
6554 5698
 
6555
-		draggable.cancelHelperRemoval = false;
5699
+		// Callbacks
5700
+		change: null,
5701
+		close: null,
5702
+		focus: null,
5703
+		open: null,
5704
+		response: null,
5705
+		search: null,
5706
+		select: null
5707
+	},
6556 5708
 
6557
-		$.each( draggable.sortables, function() {
6558
-			var sortable = this;
5709
+	requestIndex: 0,
5710
+	pending: 0,
5711
+	liveRegionTimer: null,
6559 5712
 
6560
-			if ( sortable.isOver ) {
6561
-				sortable.isOver = 0;
5713
+	_create: function() {
6562 5714
 
6563
-				// Allow this sortable to handle removing the helper
6564
-				draggable.cancelHelperRemoval = true;
6565
-				sortable.cancelHelperRemoval = false;
5715
+		// Some browsers only repeat keydown events, not keypress events,
5716
+		// so we use the suppressKeyPress flag to determine if we've already
5717
+		// handled the keydown event. #7269
5718
+		// Unfortunately the code for & in keypress is the same as the up arrow,
5719
+		// so we use the suppressKeyPressRepeat flag to avoid handling keypress
5720
+		// events when we know the keydown event was used to modify the
5721
+		// search term. #7799
5722
+		var suppressKeyPress, suppressKeyPressRepeat, suppressInput,
5723
+			nodeName = this.element[ 0 ].nodeName.toLowerCase(),
5724
+			isTextarea = nodeName === "textarea",
5725
+			isInput = nodeName === "input";
6566 5726
 
6567
-				// Use _storedCSS To restore properties in the sortable,
6568
-				// as this also handles revert (#9675) since the draggable
6569
-				// may have modified them in unexpected ways (#8809)
6570
-				sortable._storedCSS = {
6571
-					position: sortable.placeholder.css( "position" ),
6572
-					top: sortable.placeholder.css( "top" ),
6573
-					left: sortable.placeholder.css( "left" )
6574
-				};
5727
+		// Textareas are always multi-line
5728
+		// Inputs are always single-line, even if inside a contentEditable element
5729
+		// IE also treats inputs as contentEditable
5730
+		// All other element types are determined by whether or not they're contentEditable
5731
+		this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element );
6575 5732
 
6576
-				sortable._mouseStop(event);
5733
+		this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ];
5734
+		this.isNewMenu = true;
6577 5735
 
6578
-				// Once drag has ended, the sortable should return to using
6579
-				// its original helper, not the shared helper from draggable
6580
-				sortable.options.helper = sortable.options._helper;
6581
-			} else {
6582
-				// Prevent this Sortable from removing the helper.
6583
-				// However, don't set the draggable to remove the helper
6584
-				// either as another connected Sortable may yet handle the removal.
6585
-				sortable.cancelHelperRemoval = true;
5736
+		this._addClass( "ui-autocomplete-input" );
5737
+		this.element.attr( "autocomplete", "off" );
6586 5738
 
6587
-				sortable._trigger( "deactivate", event, uiSortable );
5739
+		this._on( this.element, {
5740
+			keydown: function( event ) {
5741
+				if ( this.element.prop( "readOnly" ) ) {
5742
+					suppressKeyPress = true;
5743
+					suppressInput = true;
5744
+					suppressKeyPressRepeat = true;
5745
+					return;
6588 5746
 				}
6589
-		});
6590
-	},
6591
-	drag: function( event, ui, draggable ) {
6592
-		$.each( draggable.sortables, function() {
6593
-			var innermostIntersecting = false,
6594
-				sortable = this;
6595
-
6596
-			// Copy over variables that sortable's _intersectsWith uses
6597
-			sortable.positionAbs = draggable.positionAbs;
6598
-			sortable.helperProportions = draggable.helperProportions;
6599
-			sortable.offset.click = draggable.offset.click;
6600 5747
 
6601
-			if ( sortable._intersectsWith( sortable.containerCache ) ) {
6602
-				innermostIntersecting = true;
5748
+				suppressKeyPress = false;
5749
+				suppressInput = false;
5750
+				suppressKeyPressRepeat = false;
5751
+				var keyCode = $.ui.keyCode;
5752
+				switch ( event.keyCode ) {
5753
+				case keyCode.PAGE_UP:
5754
+					suppressKeyPress = true;
5755
+					this._move( "previousPage", event );
5756
+					break;
5757
+				case keyCode.PAGE_DOWN:
5758
+					suppressKeyPress = true;
5759
+					this._move( "nextPage", event );
5760
+					break;
5761
+				case keyCode.UP:
5762
+					suppressKeyPress = true;
5763
+					this._keyEvent( "previous", event );
5764
+					break;
5765
+				case keyCode.DOWN:
5766
+					suppressKeyPress = true;
5767
+					this._keyEvent( "next", event );
5768
+					break;
5769
+				case keyCode.ENTER:
6603 5770
 
6604
-				$.each( draggable.sortables, function() {
6605
-					// Copy over variables that sortable's _intersectsWith uses
6606
-					this.positionAbs = draggable.positionAbs;
6607
-					this.helperProportions = draggable.helperProportions;
6608
-					this.offset.click = draggable.offset.click;
5771
+					// when menu is open and has focus
5772
+					if ( this.menu.active ) {
6609 5773
 
6610
-					if ( this !== sortable &&
6611
-							this._intersectsWith( this.containerCache ) &&
6612
-							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
6613
-						innermostIntersecting = false;
5774
+						// #6055 - Opera still allows the keypress to occur
5775
+						// which causes forms to submit
5776
+						suppressKeyPress = true;
5777
+						event.preventDefault();
5778
+						this.menu.select( event );
5779
+					}
5780
+					break;
5781
+				case keyCode.TAB:
5782
+					if ( this.menu.active ) {
5783
+						this.menu.select( event );
6614 5784
 					}
5785
+					break;
5786
+				case keyCode.ESCAPE:
5787
+					if ( this.menu.element.is( ":visible" ) ) {
5788
+						if ( !this.isMultiLine ) {
5789
+							this._value( this.term );
5790
+						}
5791
+						this.close( event );
6615 5792
 
6616
-					return innermostIntersecting;
6617
-				});
5793
+						// Different browsers have different default behavior for escape
5794
+						// Single press can mean undo or clear
5795
+						// Double press in IE means clear the whole form
5796
+						event.preventDefault();
6618 5797
 					}
5798
+					break;
5799
+				default:
5800
+					suppressKeyPressRepeat = true;
6619 5801
 
6620
-			if ( innermostIntersecting ) {
6621
-				// If it intersects, we use a little isOver variable and set it once,
6622
-				// so that the move-in stuff gets fired only once.
6623
-				if ( !sortable.isOver ) {
6624
-					sortable.isOver = 1;
6625
-
6626
-					// Store draggable's parent in case we need to reappend to it later.
6627
-					draggable._parent = ui.helper.parent();
5802
+					// search timeout should be triggered before the input value is changed
5803
+					this._searchTimeout( event );
5804
+					break;
5805
+				}
5806
+			},
5807
+			keypress: function( event ) {
5808
+				if ( suppressKeyPress ) {
5809
+					suppressKeyPress = false;
5810
+					if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
5811
+						event.preventDefault();
5812
+					}
5813
+					return;
5814
+				}
5815
+				if ( suppressKeyPressRepeat ) {
5816
+					return;
5817
+				}
6628 5818
 
6629
-					sortable.currentItem = ui.helper
6630
-						.appendTo( sortable.element )
6631
-						.data( "ui-sortable-item", true );
5819
+				// Replicate some key handlers to allow them to repeat in Firefox and Opera
5820
+				var keyCode = $.ui.keyCode;
5821
+				switch ( event.keyCode ) {
5822
+				case keyCode.PAGE_UP:
5823
+					this._move( "previousPage", event );
5824
+					break;
5825
+				case keyCode.PAGE_DOWN:
5826
+					this._move( "nextPage", event );
5827
+					break;
5828
+				case keyCode.UP:
5829
+					this._keyEvent( "previous", event );
5830
+					break;
5831
+				case keyCode.DOWN:
5832
+					this._keyEvent( "next", event );
5833
+					break;
5834
+				}
5835
+			},
5836
+			input: function( event ) {
5837
+				if ( suppressInput ) {
5838
+					suppressInput = false;
5839
+					event.preventDefault();
5840
+					return;
5841
+				}
5842
+				this._searchTimeout( event );
5843
+			},
5844
+			focus: function() {
5845
+				this.selectedItem = null;
5846
+				this.previous = this._value();
5847
+			},
5848
+			blur: function( event ) {
5849
+				clearTimeout( this.searching );
5850
+				this.close( event );
5851
+				this._change( event );
5852
+			}
5853
+		} );
6632 5854
 
6633
-					// Store helper option to later restore it
6634
-					sortable.options._helper = sortable.options.helper;
5855
+		this._initSource();
5856
+		this.menu = $( "<ul>" )
5857
+			.appendTo( this._appendTo() )
5858
+			.menu( {
6635 5859
 
6636
-					sortable.options.helper = function() {
6637
-						return ui.helper[ 0 ];
6638
-					};
5860
+				// disable ARIA support, the live region takes care of that
5861
+				role: null
5862
+			} )
5863
+			.hide()
6639 5864
 
6640
-					// Fire the start events of the sortable with our passed browser event,
6641
-					// and our own helper (so it doesn't create a new one)
6642
-					event.target = sortable.currentItem[ 0 ];
6643
-					sortable._mouseCapture( event, true );
6644
-					sortable._mouseStart( event, true, true );
5865
+			// Support: IE 11 only, Edge <= 14
5866
+			// For other browsers, we preventDefault() on the mousedown event
5867
+			// to keep the dropdown from taking focus from the input. This doesn't
5868
+			// work for IE/Edge, causing problems with selection and scrolling (#9638)
5869
+			// Happily, IE and Edge support an "unselectable" attribute that
5870
+			// prevents an element from receiving focus, exactly what we want here.
5871
+			.attr( {
5872
+				"unselectable": "on"
5873
+			} )
5874
+			.menu( "instance" );
6645 5875
 
6646
-					// Because the browser event is way off the new appended portlet,
6647
-					// modify necessary variables to reflect the changes
6648
-					sortable.offset.click.top = draggable.offset.click.top;
6649
-					sortable.offset.click.left = draggable.offset.click.left;
6650
-					sortable.offset.parent.left -= draggable.offset.parent.left -
6651
-						sortable.offset.parent.left;
6652
-					sortable.offset.parent.top -= draggable.offset.parent.top -
6653
-						sortable.offset.parent.top;
5876
+		this._addClass( this.menu.element, "ui-autocomplete", "ui-front" );
5877
+		this._on( this.menu.element, {
5878
+			mousedown: function( event ) {
6654 5879
 
6655
-					draggable._trigger( "toSortable", event );
5880
+				// Prevent moving focus out of the text field
5881
+				event.preventDefault();
5882
+			},
5883
+			menufocus: function( event, ui ) {
5884
+				var label, item;
6656 5885
 
6657
-					// Inform draggable that the helper is in a valid drop zone,
6658
-					// used solely in the revert option to handle "valid/invalid".
6659
-					draggable.dropped = sortable.element;
5886
+				// support: Firefox
5887
+				// Prevent accidental activation of menu items in Firefox (#7024 #9118)
5888
+				if ( this.isNewMenu ) {
5889
+					this.isNewMenu = false;
5890
+					if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) {
5891
+						this.menu.blur();
6660 5892
 
6661
-					// Need to refreshPositions of all sortables in the case that
6662
-					// adding to one sortable changes the location of the other sortables (#9675)
6663
-					$.each( draggable.sortables, function() {
6664
-						this.refreshPositions();
5893
+						this.document.one( "mousemove", function() {
5894
+							$( event.target ).trigger( event.originalEvent );
6665 5895
 						} );
6666 5896
 
6667
-					// hack so receive/update callbacks work (mostly)
6668
-					draggable.currentItem = draggable.element;
6669
-					sortable.fromOutside = draggable;
5897
+						return;
6670 5898
 					}
6671
-
6672
-				if ( sortable.currentItem ) {
6673
-					sortable._mouseDrag( event );
6674
-					// Copy the sortable's position because the draggable's can potentially reflect
6675
-					// a relative position, while sortable is always absolute, which the dragged
6676
-					// element has now become. (#8809)
6677
-					ui.position = sortable.position;
6678 5899
 				}
6679
-			} else {
6680
-				// If it doesn't intersect with the sortable, and it intersected before,
6681
-				// we fake the drag stop of the sortable, but make sure it doesn't remove
6682
-				// the helper by using cancelHelperRemoval.
6683
-				if ( sortable.isOver ) {
6684
-
6685
-					sortable.isOver = 0;
6686
-					sortable.cancelHelperRemoval = true;
6687
-
6688
-					// Calling sortable's mouseStop would trigger a revert,
6689
-					// so revert must be temporarily false until after mouseStop is called.
6690
-					sortable.options._revert = sortable.options.revert;
6691
-					sortable.options.revert = false;
6692
-
6693
-					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
6694
-					sortable._mouseStop( event, true );
6695 5900
 
6696
-					// restore sortable behaviors that were modfied
6697
-					// when the draggable entered the sortable area (#9481)
6698
-					sortable.options.revert = sortable.options._revert;
6699
-					sortable.options.helper = sortable.options._helper;
5901
+				item = ui.item.data( "ui-autocomplete-item" );
5902
+				if ( false !== this._trigger( "focus", event, { item: item } ) ) {
6700 5903
 
6701
-					if ( sortable.placeholder ) {
6702
-						sortable.placeholder.remove();
5904
+					// use value to match what will end up in the input, if it was a key event
5905
+					if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) {
5906
+						this._value( item.value );
5907
+					}
6703 5908
 				}
6704 5909
 
6705
-					// Restore and recalculate the draggable's offset considering the sortable
6706
-					// may have modified them in unexpected ways. (#8809, #10669)
6707
-					ui.helper.appendTo( draggable._parent );
6708
-					draggable._refreshOffsets( event );
6709
-					ui.position = draggable._generatePosition( event, true );
6710
-
6711
-					draggable._trigger( "fromSortable", event );
5910
+				// Announce the value in the liveRegion
5911
+				label = ui.item.attr( "aria-label" ) || item.value;
5912
+				if ( label && String.prototype.trim.call( label ).length ) {
5913
+					clearTimeout( this.liveRegionTimer );
5914
+					this.liveRegionTimer = this._delay( function() {
5915
+						this.liveRegion.html( $( "<div>" ).text( label ) );
5916
+					}, 100 );
5917
+				}
5918
+			},
5919
+			menuselect: function( event, ui ) {
5920
+				var item = ui.item.data( "ui-autocomplete-item" ),
5921
+					previous = this.previous;
6712 5922
 
6713
-					// Inform draggable that the helper is no longer in a valid drop zone
6714
-					draggable.dropped = false;
5923
+				// Only trigger when focus was lost (click on menu)
5924
+				if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) {
5925
+					this.element.trigger( "focus" );
5926
+					this.previous = previous;
6715 5927
 
6716
-					// Need to refreshPositions of all sortables just in case removing
6717
-					// from one sortable changes the location of other sortables (#9675)
6718
-					$.each( draggable.sortables, function() {
6719
-						this.refreshPositions();
5928
+					// #6109 - IE triggers two focus events and the second
5929
+					// is asynchronous, so we need to reset the previous
5930
+					// term synchronously and asynchronously :-(
5931
+					this._delay( function() {
5932
+						this.previous = previous;
5933
+						this.selectedItem = item;
6720 5934
 					} );
6721 5935
 				}
5936
+
5937
+				if ( false !== this._trigger( "select", event, { item: item } ) ) {
5938
+					this._value( item.value );
6722 5939
 				}
6723
-		});
5940
+
5941
+				// reset the term after the select event
5942
+				// this allows custom select handling to work properly
5943
+				this.term = this._value();
5944
+
5945
+				this.close( event );
5946
+				this.selectedItem = item;
6724 5947
 			}
6725 5948
 		} );
6726 5949
 
6727
-$.ui.plugin.add("draggable", "cursor", {
6728
-	start: function( event, ui, instance ) {
6729
-		var t = $( "body" ),
6730
-			o = instance.options;
5950
+		this.liveRegion = $( "<div>", {
5951
+			role: "status",
5952
+			"aria-live": "assertive",
5953
+			"aria-relevant": "additions"
5954
+		} )
5955
+			.appendTo( this.document[ 0 ].body );
6731 5956
 
6732
-		if (t.css("cursor")) {
6733
-			o._cursor = t.css("cursor");
6734
-		}
6735
-		t.css("cursor", o.cursor);
6736
-	},
6737
-	stop: function( event, ui, instance ) {
6738
-		var o = instance.options;
6739
-		if (o._cursor) {
6740
-			$("body").css("cursor", o._cursor);
6741
-		}
5957
+		this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" );
5958
+
5959
+		// Turning off autocomplete prevents the browser from remembering the
5960
+		// value when navigating through history, so we re-enable autocomplete
5961
+		// if the page is unloaded before the widget is destroyed. #7790
5962
+		this._on( this.window, {
5963
+			beforeunload: function() {
5964
+				this.element.removeAttr( "autocomplete" );
6742 5965
 			}
6743 5966
 		} );
5967
+	},
6744 5968
 
6745
-$.ui.plugin.add("draggable", "opacity", {
6746
-	start: function( event, ui, instance ) {
6747
-		var t = $( ui.helper ),
6748
-			o = instance.options;
6749
-		if (t.css("opacity")) {
6750
-			o._opacity = t.css("opacity");
6751
-		}
6752
-		t.css("opacity", o.opacity);
5969
+	_destroy: function() {
5970
+		clearTimeout( this.searching );
5971
+		this.element.removeAttr( "autocomplete" );
5972
+		this.menu.element.remove();
5973
+		this.liveRegion.remove();
6753 5974
 	},
6754
-	stop: function( event, ui, instance ) {
6755
-		var o = instance.options;
6756
-		if (o._opacity) {
6757
-			$(ui.helper).css("opacity", o._opacity);
5975
+
5976
+	_setOption: function( key, value ) {
5977
+		this._super( key, value );
5978
+		if ( key === "source" ) {
5979
+			this._initSource();
6758 5980
 		}
5981
+		if ( key === "appendTo" ) {
5982
+			this.menu.element.appendTo( this._appendTo() );
6759 5983
 		}
6760
-});
6761
-
6762
-$.ui.plugin.add("draggable", "scroll", {
6763
-	start: function( event, ui, i ) {
6764
-		if ( !i.scrollParentNotHidden ) {
6765
-			i.scrollParentNotHidden = i.helper.scrollParent( false );
5984
+		if ( key === "disabled" && value && this.xhr ) {
5985
+			this.xhr.abort();
6766 5986
 		}
5987
+	},
6767 5988
 
6768
-		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
6769
-			i.overflowOffset = i.scrollParentNotHidden.offset();
5989
+	_isEventTargetInWidget: function( event ) {
5990
+		var menuElement = this.menu.element[ 0 ];
5991
+
5992
+		return event.target === this.element[ 0 ] ||
5993
+			event.target === menuElement ||
5994
+			$.contains( menuElement, event.target );
5995
+	},
5996
+
5997
+	_closeOnClickOutside: function( event ) {
5998
+		if ( !this._isEventTargetInWidget( event ) ) {
5999
+			this.close();
6770 6000
 		}
6771 6001
 	},
6772
-	drag: function( event, ui, i  ) {
6773 6002
 
6774
-		var o = i.options,
6775
-			scrolled = false,
6776
-			scrollParent = i.scrollParentNotHidden[ 0 ],
6777
-			document = i.document[ 0 ];
6003
+	_appendTo: function() {
6004
+		var element = this.options.appendTo;
6778 6005
 
6779
-		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
6780
-			if ( !o.axis || o.axis !== "x" ) {
6781
-				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) {
6782
-					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
6783
-				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
6784
-					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
6785
-				}
6006
+		if ( element ) {
6007
+			element = element.jquery || element.nodeType ?
6008
+				$( element ) :
6009
+				this.document.find( element ).eq( 0 );
6786 6010
 		}
6787 6011
 
6788
-			if ( !o.axis || o.axis !== "y" ) {
6789
-				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) {
6790
-					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
6791
-				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
6792
-					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
6012
+		if ( !element || !element[ 0 ] ) {
6013
+			element = this.element.closest( ".ui-front, dialog" );
6793 6014
 		}
6015
+
6016
+		if ( !element.length ) {
6017
+			element = this.document[ 0 ].body;
6794 6018
 		}
6795 6019
 
6796
-		} else {
6020
+		return element;
6021
+	},
6797 6022
 
6798
-			if (!o.axis || o.axis !== "x") {
6799
-				if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
6800
-					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
6801
-				} else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
6802
-					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
6803
-				}
6023
+	_initSource: function() {
6024
+		var array, url,
6025
+			that = this;
6026
+		if ( Array.isArray( this.options.source ) ) {
6027
+			array = this.options.source;
6028
+			this.source = function( request, response ) {
6029
+				response( $.ui.autocomplete.filter( array, request.term ) );
6030
+			};
6031
+		} else if ( typeof this.options.source === "string" ) {
6032
+			url = this.options.source;
6033
+			this.source = function( request, response ) {
6034
+				if ( that.xhr ) {
6035
+					that.xhr.abort();
6804 6036
 				}
6805
-
6806
-			if (!o.axis || o.axis !== "y") {
6807
-				if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
6808
-					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
6809
-				} else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
6810
-					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
6037
+				that.xhr = $.ajax( {
6038
+					url: url,
6039
+					data: request,
6040
+					dataType: "json",
6041
+					success: function( data ) {
6042
+						response( data );
6043
+					},
6044
+					error: function() {
6045
+						response( [] );
6811 6046
 					}
6047
+				} );
6048
+			};
6049
+		} else {
6050
+			this.source = this.options.source;
6812 6051
 		}
6052
+	},
6813 6053
 
6814
-		}
6054
+	_searchTimeout: function( event ) {
6055
+		clearTimeout( this.searching );
6056
+		this.searching = this._delay( function() {
6815 6057
 
6816
-		if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
6817
-			$.ui.ddmanager.prepareOffsets(i, event);
6818
-		}
6058
+			// Search if the value has changed, or if the user retypes the same value (see #7434)
6059
+			var equalValues = this.term === this._value(),
6060
+				menuVisible = this.menu.element.is( ":visible" ),
6061
+				modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
6819 6062
 
6063
+			if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) {
6064
+				this.selectedItem = null;
6065
+				this.search( null, event );
6820 6066
 			}
6821
-});
6067
+		}, this.options.delay );
6068
+	},
6822 6069
 
6823
-$.ui.plugin.add("draggable", "snap", {
6824
-	start: function( event, ui, i ) {
6070
+	search: function( value, event ) {
6071
+		value = value != null ? value : this._value();
6825 6072
 
6826
-		var o = i.options;
6073
+		// Always save the actual value, not the one passed as an argument
6074
+		this.term = this._value();
6827 6075
 
6828
-		i.snapElements = [];
6076
+		if ( value.length < this.options.minLength ) {
6077
+			return this.close( event );
6078
+		}
6829 6079
 
6830
-		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
6831
-			var $t = $(this),
6832
-				$o = $t.offset();
6833
-			if (this !== i.element[0]) {
6834
-				i.snapElements.push({
6835
-					item: this,
6836
-					width: $t.outerWidth(), height: $t.outerHeight(),
6837
-					top: $o.top, left: $o.left
6838
-				});
6080
+		if ( this._trigger( "search", event ) === false ) {
6081
+			return;
6839 6082
 		}
6840
-		});
6841 6083
 
6084
+		return this._search( value );
6842 6085
 	},
6843
-	drag: function( event, ui, inst ) {
6844 6086
 
6845
-		var ts, bs, ls, rs, l, r, t, b, i, first,
6846
-			o = inst.options,
6847
-			d = o.snapTolerance,
6848
-			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
6849
-			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
6087
+	_search: function( value ) {
6088
+		this.pending++;
6089
+		this._addClass( "ui-autocomplete-loading" );
6090
+		this.cancelSearch = false;
6850 6091
 
6851
-		for (i = inst.snapElements.length - 1; i >= 0; i--){
6092
+		this.source( { term: value }, this._response() );
6093
+	},
6852 6094
 
6853
-			l = inst.snapElements[i].left - inst.margins.left;
6854
-			r = l + inst.snapElements[i].width;
6855
-			t = inst.snapElements[i].top - inst.margins.top;
6856
-			b = t + inst.snapElements[i].height;
6095
+	_response: function() {
6096
+		var index = ++this.requestIndex;
6857 6097
 
6858
-			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
6859
-				if (inst.snapElements[i].snapping) {
6860
-					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
6861
-				}
6862
-				inst.snapElements[i].snapping = false;
6863
-				continue;
6098
+		return function( content ) {
6099
+			if ( index === this.requestIndex ) {
6100
+				this.__response( content );
6864 6101
 			}
6865 6102
 
6866
-			if (o.snapMode !== "inner") {
6867
-				ts = Math.abs(t - y2) <= d;
6868
-				bs = Math.abs(b - y1) <= d;
6869
-				ls = Math.abs(l - x2) <= d;
6870
-				rs = Math.abs(r - x1) <= d;
6871
-				if (ts) {
6872
-					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
6873
-				}
6874
-				if (bs) {
6875
-					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
6876
-				}
6877
-				if (ls) {
6878
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
6103
+			this.pending--;
6104
+			if ( !this.pending ) {
6105
+				this._removeClass( "ui-autocomplete-loading" );
6879 6106
 			}
6880
-				if (rs) {
6881
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
6107
+		}.bind( this );
6108
+	},
6109
+
6110
+	__response: function( content ) {
6111
+		if ( content ) {
6112
+			content = this._normalize( content );
6882 6113
 		}
6114
+		this._trigger( "response", null, { content: content } );
6115
+		if ( !this.options.disabled && content && content.length && !this.cancelSearch ) {
6116
+			this._suggest( content );
6117
+			this._trigger( "open" );
6118
+		} else {
6119
+
6120
+			// use ._close() instead of .close() so we don't cancel future searches
6121
+			this._close();
6883 6122
 		}
6123
+	},
6884 6124
 
6885
-			first = (ts || bs || ls || rs);
6125
+	close: function( event ) {
6126
+		this.cancelSearch = true;
6127
+		this._close( event );
6128
+	},
6886 6129
 
6887
-			if (o.snapMode !== "outer") {
6888
-				ts = Math.abs(t - y1) <= d;
6889
-				bs = Math.abs(b - y2) <= d;
6890
-				ls = Math.abs(l - x1) <= d;
6891
-				rs = Math.abs(r - x2) <= d;
6892
-				if (ts) {
6893
-					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
6894
-				}
6895
-				if (bs) {
6896
-					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
6897
-				}
6898
-				if (ls) {
6899
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
6900
-				}
6901
-				if (rs) {
6902
-					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
6903
-				}
6904
-			}
6130
+	_close: function( event ) {
6905 6131
 
6906
-			if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
6907
-				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
6132
+		// Remove the handler that closes the menu on outside clicks
6133
+		this._off( this.document, "mousedown" );
6134
+
6135
+		if ( this.menu.element.is( ":visible" ) ) {
6136
+			this.menu.element.hide();
6137
+			this.menu.blur();
6138
+			this.isNewMenu = true;
6139
+			this._trigger( "close", event );
6908 6140
 		}
6909
-			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
6141
+	},
6910 6142
 
6143
+	_change: function( event ) {
6144
+		if ( this.previous !== this._value() ) {
6145
+			this._trigger( "change", event, { item: this.selectedItem } );
6911 6146
 		}
6147
+	},
6148
+
6149
+	_normalize: function( items ) {
6912 6150
 
6151
+		// assume all items have the right format when the first item is complete
6152
+		if ( items.length && items[ 0 ].label && items[ 0 ].value ) {
6153
+			return items;
6154
+		}
6155
+		return $.map( items, function( item ) {
6156
+			if ( typeof item === "string" ) {
6157
+				return {
6158
+					label: item,
6159
+					value: item
6160
+				};
6913 6161
 			}
6162
+			return $.extend( {}, item, {
6163
+				label: item.label || item.value,
6164
+				value: item.value || item.label
6914 6165
 			} );
6915
-
6916
-$.ui.plugin.add("draggable", "stack", {
6917
-	start: function( event, ui, instance ) {
6918
-		var min,
6919
-			o = instance.options,
6920
-			group = $.makeArray($(o.stack)).sort(function(a, b) {
6921
-				return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0);
6922 6166
 		} );
6167
+	},
6168
+
6169
+	_suggest: function( items ) {
6170
+		var ul = this.menu.element.empty();
6171
+		this._renderMenu( ul, items );
6172
+		this.isNewMenu = true;
6173
+		this.menu.refresh();
6923 6174
 
6924
-		if (!group.length) { return; }
6175
+		// Size and position menu
6176
+		ul.show();
6177
+		this._resizeMenu();
6178
+		ul.position( $.extend( {
6179
+			of: this.element
6180
+		}, this.options.position ) );
6925 6181
 
6926
-		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
6927
-		$(group).each(function(i) {
6928
-			$(this).css("zIndex", min + i);
6929
-		});
6930
-		this.css("zIndex", (min + group.length));
6182
+		if ( this.options.autoFocus ) {
6183
+			this.menu.next();
6931 6184
 		}
6185
+
6186
+		// Listen for interactions outside of the widget (#6642)
6187
+		this._on( this.document, {
6188
+			mousedown: "_closeOnClickOutside"
6932 6189
 		} );
6190
+	},
6933 6191
 
6934
-$.ui.plugin.add("draggable", "zIndex", {
6935
-	start: function( event, ui, instance ) {
6936
-		var t = $( ui.helper ),
6937
-			o = instance.options;
6192
+	_resizeMenu: function() {
6193
+		var ul = this.menu.element;
6194
+		ul.outerWidth( Math.max(
6938 6195
 
6939
-		if (t.css("zIndex")) {
6940
-			o._zIndex = t.css("zIndex");
6941
-		}
6942
-		t.css("zIndex", o.zIndex);
6196
+			// Firefox wraps long text (possibly a rounding bug)
6197
+			// so we add 1px to avoid the wrapping (#7513)
6198
+			ul.width( "" ).outerWidth() + 1,
6199
+			this.element.outerWidth()
6200
+		) );
6943 6201
 	},
6944
-	stop: function( event, ui, instance ) {
6945
-		var o = instance.options;
6946 6202
 
6947
-		if (o._zIndex) {
6948
-			$(ui.helper).css("zIndex", o._zIndex);
6949
-		}
6950
-	}
6203
+	_renderMenu: function( ul, items ) {
6204
+		var that = this;
6205
+		$.each( items, function( index, item ) {
6206
+			that._renderItemData( ul, item );
6951 6207
 		} );
6208
+	},
6209
+
6210
+	_renderItemData: function( ul, item ) {
6211
+		return this._renderItem( ul, item ).data( "ui-autocomplete-item", item );
6212
+	},
6213
+
6214
+	_renderItem: function( ul, item ) {
6215
+		return $( "<li>" )
6216
+			.append( $( "<div>" ).text( item.label ) )
6217
+			.appendTo( ul );
6218
+	},
6219
+
6220
+	_move: function( direction, event ) {
6221
+		if ( !this.menu.element.is( ":visible" ) ) {
6222
+			this.search( null, event );
6223
+			return;
6224
+		}
6225
+		if ( this.menu.isFirstItem() && /^previous/.test( direction ) ||
6226
+				this.menu.isLastItem() && /^next/.test( direction ) ) {
6227
+
6228
+			if ( !this.isMultiLine ) {
6229
+				this._value( this.term );
6230
+			}
6231
+
6232
+			this.menu.blur();
6233
+			return;
6234
+		}
6235
+		this.menu[ direction ]( event );
6236
+	},
6237
+
6238
+	widget: function() {
6239
+		return this.menu.element;
6240
+	},
6241
+
6242
+	_value: function() {
6243
+		return this.valueMethod.apply( this.element, arguments );
6244
+	},
6245
+
6246
+	_keyEvent: function( keyEvent, event ) {
6247
+		if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) {
6248
+			this._move( keyEvent, event );
6249
+
6250
+			// Prevents moving cursor to beginning/end of the text field in some browsers
6251
+			event.preventDefault();
6252
+		}
6253
+	},
6254
+
6255
+	// Support: Chrome <=50
6256
+	// We should be able to just use this.element.prop( "isContentEditable" )
6257
+	// but hidden elements always report false in Chrome.
6258
+	// https://code.google.com/p/chromium/issues/detail?id=313082
6259
+	_isContentEditable: function( element ) {
6260
+		if ( !element.length ) {
6261
+			return false;
6262
+		}
6263
+
6264
+		var editable = element.prop( "contentEditable" );
6265
+
6266
+		if ( editable === "inherit" ) {
6267
+			return this._isContentEditable( element.parent() );
6268
+		}
6269
+
6270
+		return editable === "true";
6271
+	}
6272
+} );
6273
+
6274
+$.extend( $.ui.autocomplete, {
6275
+	escapeRegex: function( value ) {
6276
+		return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
6277
+	},
6278
+	filter: function( array, term ) {
6279
+		var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" );
6280
+		return $.grep( array, function( value ) {
6281
+			return matcher.test( value.label || value.value || value );
6282
+		} );
6283
+	}
6284
+} );
6285
+
6286
+// Live region extension, adding a `messages` option
6287
+// NOTE: This is an experimental API. We are still investigating
6288
+// a full solution for string manipulation and internationalization.
6289
+$.widget( "ui.autocomplete", $.ui.autocomplete, {
6290
+	options: {
6291
+		messages: {
6292
+			noResults: "No search results.",
6293
+			results: function( amount ) {
6294
+				return amount + ( amount > 1 ? " results are" : " result is" ) +
6295
+					" available, use up and down arrow keys to navigate.";
6296
+			}
6297
+		}
6298
+	},
6299
+
6300
+	__response: function( content ) {
6301
+		var message;
6302
+		this._superApply( arguments );
6303
+		if ( this.options.disabled || this.cancelSearch ) {
6304
+			return;
6305
+		}
6306
+		if ( content && content.length ) {
6307
+			message = this.options.messages.results( content.length );
6308
+		} else {
6309
+			message = this.options.messages.noResults;
6310
+		}
6311
+		clearTimeout( this.liveRegionTimer );
6312
+		this.liveRegionTimer = this._delay( function() {
6313
+			this.liveRegion.html( $( "<div>" ).text( message ) );
6314
+		}, 100 );
6315
+	}
6316
+} );
6317
+
6318
+var widgetsAutocomplete = $.ui.autocomplete;
6952 6319
 
6953
-var draggable = $.ui.draggable;
6954
-
6955 6320
 
6956 6321
 /*!
6957
- * jQuery UI Resizable 1.11.4
6322
+ * jQuery UI Controlgroup 1.13.2
6958 6323
  * http://jqueryui.com
6959 6324
  *
6960 6325
  * Copyright jQuery Foundation and other contributors
6961 6326
  * Released under the MIT license.
6962 6327
  * http://jquery.org/license
6963
- *
6964
- * http://api.jqueryui.com/resizable/
6965 6328
  */
6966 6329
 
6330
+//>>label: Controlgroup
6331
+//>>group: Widgets
6332
+//>>description: Visually groups form control widgets
6333
+//>>docs: http://api.jqueryui.com/controlgroup/
6334
+//>>demos: http://jqueryui.com/controlgroup/
6335
+//>>css.structure: ../../themes/base/core.css
6336
+//>>css.structure: ../../themes/base/controlgroup.css
6337
+//>>css.theme: ../../themes/base/theme.css
6967 6338
 
6968
-$.widget("ui.resizable", $.ui.mouse, {
6969
-	version: "1.11.4",
6970
-	widgetEventPrefix: "resize",
6339
+
6340
+var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g;
6341
+
6342
+var widgetsControlgroup = $.widget( "ui.controlgroup", {
6343
+	version: "1.13.2",
6344
+	defaultElement: "<div>",
6971 6345
 	options: {
6972
-		alsoResize: false,
6973
-		animate: false,
6974
-		animateDuration: "slow",
6975
-		animateEasing: "swing",
6976
-		aspectRatio: false,
6977
-		autoHide: false,
6978
-		containment: false,
6979
-		ghost: false,
6980
-		grid: false,
6981
-		handles: "e,s,se",
6982
-		helper: false,
6983
-		maxHeight: null,
6984
-		maxWidth: null,
6985
-		minHeight: 10,
6986
-		minWidth: 10,
6987
-		// See #7960
6988
-		zIndex: 90,
6346
+		direction: "horizontal",
6347
+		disabled: null,
6348
+		onlyVisible: true,
6349
+		items: {
6350
+			"button": "input[type=button], input[type=submit], input[type=reset], button, a",
6351
+			"controlgroupLabel": ".ui-controlgroup-label",
6352
+			"checkboxradio": "input[type='checkbox'], input[type='radio']",
6353
+			"selectmenu": "select",
6354
+			"spinner": ".ui-spinner-input"
6355
+		}
6356
+	},
6989 6357
 
6990
-		// callbacks
6991
-		resize: null,
6992
-		start: null,
6993
-		stop: null
6358
+	_create: function() {
6359
+		this._enhance();
6994 6360
 	},
6995 6361
 
6996
-	_num: function( value ) {
6997
-		return parseInt( value, 10 ) || 0;
6362
+	// To support the enhanced option in jQuery Mobile, we isolate DOM manipulation
6363
+	_enhance: function() {
6364
+		this.element.attr( "role", "toolbar" );
6365
+		this.refresh();
6998 6366
 	},
6999 6367
 
7000
-	_isNumber: function( value ) {
7001
-		return !isNaN( parseInt( value, 10 ) );
6368
+	_destroy: function() {
6369
+		this._callChildMethod( "destroy" );
6370
+		this.childWidgets.removeData( "ui-controlgroup-data" );
6371
+		this.element.removeAttr( "role" );
6372
+		if ( this.options.items.controlgroupLabel ) {
6373
+			this.element
6374
+				.find( this.options.items.controlgroupLabel )
6375
+				.find( ".ui-controlgroup-label-contents" )
6376
+				.contents().unwrap();
6377
+		}
7002 6378
 	},
7003 6379
 
7004
-	_hasScroll: function( el, a ) {
6380
+	_initWidgets: function() {
6381
+		var that = this,
6382
+			childWidgets = [];
7005 6383
 
7006
-		if ( $( el ).css( "overflow" ) === "hidden") {
7007
-			return false;
6384
+		// First we iterate over each of the items options
6385
+		$.each( this.options.items, function( widget, selector ) {
6386
+			var labels;
6387
+			var options = {};
6388
+
6389
+			// Make sure the widget has a selector set
6390
+			if ( !selector ) {
6391
+				return;
7008 6392
 			}
7009 6393
 
7010
-		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
7011
-			has = false;
6394
+			if ( widget === "controlgroupLabel" ) {
6395
+				labels = that.element.find( selector );
6396
+				labels.each( function() {
6397
+					var element = $( this );
7012 6398
 
7013
-		if ( el[ scroll ] > 0 ) {
7014
-			return true;
6399
+					if ( element.children( ".ui-controlgroup-label-contents" ).length ) {
6400
+						return;
6401
+					}
6402
+					element.contents()
6403
+						.wrapAll( "<span class='ui-controlgroup-label-contents'></span>" );
6404
+				} );
6405
+				that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" );
6406
+				childWidgets = childWidgets.concat( labels.get() );
6407
+				return;
7015 6408
 			}
7016 6409
 
7017
-		// TODO: determine which cases actually cause this to happen
7018
-		// if the element doesn't have the scroll set, see if it's possible to
7019
-		// set the scroll
7020
-		el[ scroll ] = 1;
7021
-		has = ( el[ scroll ] > 0 );
7022
-		el[ scroll ] = 0;
7023
-		return has;
7024
-	},
7025
-
7026
-	_create: function() {
6410
+			// Make sure the widget actually exists
6411
+			if ( !$.fn[ widget ] ) {
6412
+				return;
6413
+			}
7027 6414
 
7028
-		var n, i, handle, axis, hname,
7029
-			that = this,
7030
-			o = this.options;
7031
-		this.element.addClass("ui-resizable");
6415
+			// We assume everything is in the middle to start because we can't determine
6416
+			// first / last elements until all enhancments are done.
6417
+			if ( that[ "_" + widget + "Options" ] ) {
6418
+				options = that[ "_" + widget + "Options" ]( "middle" );
6419
+			} else {
6420
+				options = { classes: {} };
6421
+			}
7032 6422
 
7033
-		$.extend(this, {
7034
-			_aspectRatio: !!(o.aspectRatio),
7035
-			aspectRatio: o.aspectRatio,
7036
-			originalElement: this.element,
7037
-			_proportionallyResizeElements: [],
7038
-			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
7039
-		});
6423
+			// Find instances of this widget inside controlgroup and init them
6424
+			that.element
6425
+				.find( selector )
6426
+				.each( function() {
6427
+					var element = $( this );
6428
+					var instance = element[ widget ]( "instance" );
7040 6429
 
7041
-		// Wrap the element if it cannot hold child nodes
7042
-		if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
6430
+					// We need to clone the default options for this type of widget to avoid
6431
+					// polluting the variable options which has a wider scope than a single widget.
6432
+					var instanceOptions = $.widget.extend( {}, options );
7043 6433
 
7044
-			this.element.wrap(
7045
-				$("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
7046
-					position: this.element.css("position"),
7047
-					width: this.element.outerWidth(),
7048
-					height: this.element.outerHeight(),
7049
-					top: this.element.css("top"),
7050
-					left: this.element.css("left")
7051
-				})
7052
-			);
6434
+					// If the button is the child of a spinner ignore it
6435
+					// TODO: Find a more generic solution
6436
+					if ( widget === "button" && element.parent( ".ui-spinner" ).length ) {
6437
+						return;
6438
+					}
7053 6439
 
7054
-			this.element = this.element.parent().data(
7055
-				"ui-resizable", this.element.resizable( "instance" )
7056
-			);
6440
+					// Create the widget if it doesn't exist
6441
+					if ( !instance ) {
6442
+						instance = element[ widget ]()[ widget ]( "instance" );
6443
+					}
6444
+					if ( instance ) {
6445
+						instanceOptions.classes =
6446
+							that._resolveClassesValues( instanceOptions.classes, instance );
6447
+					}
6448
+					element[ widget ]( instanceOptions );
7057 6449
 
7058
-			this.elementIsWrapper = true;
6450
+					// Store an instance of the controlgroup to be able to reference
6451
+					// from the outermost element for changing options and refresh
6452
+					var widgetElement = element[ widget ]( "widget" );
6453
+					$.data( widgetElement[ 0 ], "ui-controlgroup-data",
6454
+						instance ? instance : element[ widget ]( "instance" ) );
7059 6455
 
7060
-			this.element.css({
7061
-				marginLeft: this.originalElement.css("marginLeft"),
7062
-				marginTop: this.originalElement.css("marginTop"),
7063
-				marginRight: this.originalElement.css("marginRight"),
7064
-				marginBottom: this.originalElement.css("marginBottom")
6456
+					childWidgets.push( widgetElement[ 0 ] );
7065 6457
 				} );
7066
-			this.originalElement.css({
7067
-				marginLeft: 0,
7068
-				marginTop: 0,
7069
-				marginRight: 0,
7070
-				marginBottom: 0
7071 6458
 		} );
7072
-			// support: Safari
7073
-			// Prevent Safari textarea resize
7074
-			this.originalResizeStyle = this.originalElement.css("resize");
7075
-			this.originalElement.css("resize", "none");
7076 6459
 
7077
-			this._proportionallyResizeElements.push( this.originalElement.css({
7078
-				position: "static",
7079
-				zoom: 1,
7080
-				display: "block"
7081
-			}) );
6460
+		this.childWidgets = $( $.uniqueSort( childWidgets ) );
6461
+		this._addClass( this.childWidgets, "ui-controlgroup-item" );
6462
+	},
7082 6463
 
7083
-			// support: IE9
7084
-			// avoid IE jump (hard set the margin)
7085
-			this.originalElement.css({ margin: this.originalElement.css("margin") });
6464
+	_callChildMethod: function( method ) {
6465
+		this.childWidgets.each( function() {
6466
+			var element = $( this ),
6467
+				data = element.data( "ui-controlgroup-data" );
6468
+			if ( data && data[ method ] ) {
6469
+				data[ method ]();
6470
+			}
6471
+		} );
6472
+	},
7086 6473
 
7087
-			this._proportionallyResize();
6474
+	_updateCornerClass: function( element, position ) {
6475
+		var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
6476
+		var add = this._buildSimpleOptions( position, "label" ).classes.label;
6477
+
6478
+		this._removeClass( element, null, remove );
6479
+		this._addClass( element, null, add );
6480
+	},
6481
+
6482
+	_buildSimpleOptions: function( position, key ) {
6483
+		var direction = this.options.direction === "vertical";
6484
+		var result = {
6485
+			classes: {}
6486
+		};
6487
+		result.classes[ key ] = {
6488
+			"middle": "",
6489
+			"first": "ui-corner-" + ( direction ? "top" : "left" ),
6490
+			"last": "ui-corner-" + ( direction ? "bottom" : "right" ),
6491
+			"only": "ui-corner-all"
6492
+		}[ position ];
6493
+
6494
+		return result;
6495
+	},
6496
+
6497
+	_spinnerOptions: function( position ) {
6498
+		var options = this._buildSimpleOptions( position, "ui-spinner" );
6499
+
6500
+		options.classes[ "ui-spinner-up" ] = "";
6501
+		options.classes[ "ui-spinner-down" ] = "";
6502
+
6503
+		return options;
6504
+	},
6505
+
6506
+	_buttonOptions: function( position ) {
6507
+		return this._buildSimpleOptions( position, "ui-button" );
6508
+	},
6509
+
6510
+	_checkboxradioOptions: function( position ) {
6511
+		return this._buildSimpleOptions( position, "ui-checkboxradio-label" );
6512
+	},
6513
+
6514
+	_selectmenuOptions: function( position ) {
6515
+		var direction = this.options.direction === "vertical";
6516
+		return {
6517
+			width: direction ? "auto" : false,
6518
+			classes: {
6519
+				middle: {
6520
+					"ui-selectmenu-button-open": "",
6521
+					"ui-selectmenu-button-closed": ""
6522
+				},
6523
+				first: {
6524
+					"ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ),
6525
+					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" )
6526
+				},
6527
+				last: {
6528
+					"ui-selectmenu-button-open": direction ? "" : "ui-corner-tr",
6529
+					"ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" )
6530
+				},
6531
+				only: {
6532
+					"ui-selectmenu-button-open": "ui-corner-top",
6533
+					"ui-selectmenu-button-closed": "ui-corner-all"
7088 6534
 				}
7089 6535
 
7090
-		this.handles = o.handles ||
7091
-			( !$(".ui-resizable-handle", this.element).length ?
7092
-				"e,s,se" : {
7093
-					n: ".ui-resizable-n",
7094
-					e: ".ui-resizable-e",
7095
-					s: ".ui-resizable-s",
7096
-					w: ".ui-resizable-w",
7097
-					se: ".ui-resizable-se",
7098
-					sw: ".ui-resizable-sw",
7099
-					ne: ".ui-resizable-ne",
7100
-					nw: ".ui-resizable-nw"
6536
+			}[ position ]
6537
+		};
6538
+	},
6539
+
6540
+	_resolveClassesValues: function( classes, instance ) {
6541
+		var result = {};
6542
+		$.each( classes, function( key ) {
6543
+			var current = instance.options.classes[ key ] || "";
6544
+			current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) );
6545
+			result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " );
7101 6546
 		} );
6547
+		return result;
6548
+	},
7102 6549
 
7103
-		this._handles = $();
7104
-		if ( this.handles.constructor === String ) {
6550
+	_setOption: function( key, value ) {
6551
+		if ( key === "direction" ) {
6552
+			this._removeClass( "ui-controlgroup-" + this.options.direction );
6553
+		}
7105 6554
 
7106
-			if ( this.handles === "all") {
7107
-				this.handles = "n,e,s,w,se,sw,ne,nw";
6555
+		this._super( key, value );
6556
+		if ( key === "disabled" ) {
6557
+			this._callChildMethod( value ? "disable" : "enable" );
6558
+			return;
7108 6559
 		}
7109 6560
 
7110
-			n = this.handles.split(",");
7111
-			this.handles = {};
6561
+		this.refresh();
6562
+	},
7112 6563
 
7113
-			for (i = 0; i < n.length; i++) {
6564
+	refresh: function() {
6565
+		var children,
6566
+			that = this;
6567
+
6568
+		this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction );
6569
+
6570
+		if ( this.options.direction === "horizontal" ) {
6571
+			this._addClass( null, "ui-helper-clearfix" );
6572
+		}
6573
+		this._initWidgets();
6574
+
6575
+		children = this.childWidgets;
6576
+
6577
+		// We filter here because we need to track all childWidgets not just the visible ones
6578
+		if ( this.options.onlyVisible ) {
6579
+			children = children.filter( ":visible" );
6580
+		}
6581
+
6582
+		if ( children.length ) {
6583
+
6584
+			// We do this last because we need to make sure all enhancment is done
6585
+			// before determining first and last
6586
+			$.each( [ "first", "last" ], function( index, value ) {
6587
+				var instance = children[ value ]().data( "ui-controlgroup-data" );
6588
+
6589
+				if ( instance && that[ "_" + instance.widgetName + "Options" ] ) {
6590
+					var options = that[ "_" + instance.widgetName + "Options" ](
6591
+						children.length === 1 ? "only" : value
6592
+					);
6593
+					options.classes = that._resolveClassesValues( options.classes, instance );
6594
+					instance.element[ instance.widgetName ]( options );
6595
+				} else {
6596
+					that._updateCornerClass( children[ value ](), value );
6597
+				}
6598
+			} );
6599
+
6600
+			// Finally call the refresh method on each of the child widgets.
6601
+			this._callChildMethod( "refresh" );
6602
+		}
6603
+	}
6604
+} );
6605
+
6606
+/*!
6607
+ * jQuery UI Checkboxradio 1.13.2
6608
+ * http://jqueryui.com
6609
+ *
6610
+ * Copyright jQuery Foundation and other contributors
6611
+ * Released under the MIT license.
6612
+ * http://jquery.org/license
6613
+ */
6614
+
6615
+//>>label: Checkboxradio
6616
+//>>group: Widgets
6617
+//>>description: Enhances a form with multiple themeable checkboxes or radio buttons.
6618
+//>>docs: http://api.jqueryui.com/checkboxradio/
6619
+//>>demos: http://jqueryui.com/checkboxradio/
6620
+//>>css.structure: ../../themes/base/core.css
6621
+//>>css.structure: ../../themes/base/button.css
6622
+//>>css.structure: ../../themes/base/checkboxradio.css
6623
+//>>css.theme: ../../themes/base/theme.css
6624
+
6625
+
6626
+$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, {
6627
+	version: "1.13.2",
6628
+	options: {
6629
+		disabled: null,
6630
+		label: null,
6631
+		icon: true,
6632
+		classes: {
6633
+			"ui-checkboxradio-label": "ui-corner-all",
6634
+			"ui-checkboxradio-icon": "ui-corner-all"
6635
+		}
6636
+	},
6637
+
6638
+	_getCreateOptions: function() {
6639
+		var disabled, labels, labelContents;
6640
+		var options = this._super() || {};
6641
+
6642
+		// We read the type here, because it makes more sense to throw a element type error first,
6643
+		// rather then the error for lack of a label. Often if its the wrong type, it
6644
+		// won't have a label (e.g. calling on a div, btn, etc)
6645
+		this._readType();
6646
+
6647
+		labels = this.element.labels();
6648
+
6649
+		// If there are multiple labels, use the last one
6650
+		this.label = $( labels[ labels.length - 1 ] );
6651
+		if ( !this.label.length ) {
6652
+			$.error( "No label found for checkboxradio widget" );
6653
+		}
6654
+
6655
+		this.originalLabel = "";
6656
+
6657
+		// We need to get the label text but this may also need to make sure it does not contain the
6658
+		// input itself.
6659
+		// The label contents could be text, html, or a mix. We wrap all elements
6660
+		// and read the wrapper's `innerHTML` to get a string representation of
6661
+		// the label, without the input as part of it.
6662
+		labelContents = this.label.contents().not( this.element[ 0 ] );
6663
+
6664
+		if ( labelContents.length ) {
6665
+			this.originalLabel += labelContents
6666
+				.clone()
6667
+				.wrapAll( "<div></div>" )
6668
+				.parent()
6669
+				.html();
6670
+		}
6671
+
6672
+		// Set the label option if we found label text
6673
+		if ( this.originalLabel ) {
6674
+			options.label = this.originalLabel;
6675
+		}
6676
+
6677
+		disabled = this.element[ 0 ].disabled;
6678
+		if ( disabled != null ) {
6679
+			options.disabled = disabled;
6680
+		}
6681
+		return options;
6682
+	},
6683
+
6684
+	_create: function() {
6685
+		var checked = this.element[ 0 ].checked;
6686
+
6687
+		this._bindFormResetHandler();
6688
+
6689
+		if ( this.options.disabled == null ) {
6690
+			this.options.disabled = this.element[ 0 ].disabled;
6691
+		}
6692
+
6693
+		this._setOption( "disabled", this.options.disabled );
6694
+		this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" );
6695
+		this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" );
6696
+
6697
+		if ( this.type === "radio" ) {
6698
+			this._addClass( this.label, "ui-checkboxradio-radio-label" );
6699
+		}
6700
+
6701
+		if ( this.options.label && this.options.label !== this.originalLabel ) {
6702
+			this._updateLabel();
6703
+		} else if ( this.originalLabel ) {
6704
+			this.options.label = this.originalLabel;
6705
+		}
6706
+
6707
+		this._enhance();
6708
+
6709
+		if ( checked ) {
6710
+			this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" );
6711
+		}
6712
+
6713
+		this._on( {
6714
+			change: "_toggleClasses",
6715
+			focus: function() {
6716
+				this._addClass( this.label, null, "ui-state-focus ui-visual-focus" );
6717
+			},
6718
+			blur: function() {
6719
+				this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" );
6720
+			}
6721
+		} );
6722
+	},
6723
+
6724
+	_readType: function() {
6725
+		var nodeName = this.element[ 0 ].nodeName.toLowerCase();
6726
+		this.type = this.element[ 0 ].type;
6727
+		if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) {
6728
+			$.error( "Can't create checkboxradio on element.nodeName=" + nodeName +
6729
+				" and element.type=" + this.type );
6730
+		}
6731
+	},
6732
+
6733
+	// Support jQuery Mobile enhanced option
6734
+	_enhance: function() {
6735
+		this._updateIcon( this.element[ 0 ].checked );
6736
+	},
6737
+
6738
+	widget: function() {
6739
+		return this.label;
6740
+	},
6741
+
6742
+	_getRadioGroup: function() {
6743
+		var group;
6744
+		var name = this.element[ 0 ].name;
6745
+		var nameSelector = "input[name='" + $.escapeSelector( name ) + "']";
6746
+
6747
+		if ( !name ) {
6748
+			return $( [] );
6749
+		}
6750
+
6751
+		if ( this.form.length ) {
6752
+			group = $( this.form[ 0 ].elements ).filter( nameSelector );
6753
+		} else {
6754
+
6755
+			// Not inside a form, check all inputs that also are not inside a form
6756
+			group = $( nameSelector ).filter( function() {
6757
+				return $( this )._form().length === 0;
6758
+			} );
6759
+		}
6760
+
6761
+		return group.not( this.element );
6762
+	},
6763
+
6764
+	_toggleClasses: function() {
6765
+		var checked = this.element[ 0 ].checked;
6766
+		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
6767
+
6768
+		if ( this.options.icon && this.type === "checkbox" ) {
6769
+			this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked )
6770
+				._toggleClass( this.icon, null, "ui-icon-blank", !checked );
6771
+		}
6772
+
6773
+		if ( this.type === "radio" ) {
6774
+			this._getRadioGroup()
6775
+				.each( function() {
6776
+					var instance = $( this ).checkboxradio( "instance" );
6777
+
6778
+					if ( instance ) {
6779
+						instance._removeClass( instance.label,
6780
+							"ui-checkboxradio-checked", "ui-state-active" );
6781
+					}
6782
+				} );
6783
+		}
6784
+	},
6785
+
6786
+	_destroy: function() {
6787
+		this._unbindFormResetHandler();
6788
+
6789
+		if ( this.icon ) {
6790
+			this.icon.remove();
6791
+			this.iconSpace.remove();
6792
+		}
6793
+	},
6794
+
6795
+	_setOption: function( key, value ) {
6796
+
6797
+		// We don't allow the value to be set to nothing
6798
+		if ( key === "label" && !value ) {
6799
+			return;
6800
+		}
6801
+
6802
+		this._super( key, value );
6803
+
6804
+		if ( key === "disabled" ) {
6805
+			this._toggleClass( this.label, null, "ui-state-disabled", value );
6806
+			this.element[ 0 ].disabled = value;
6807
+
6808
+			// Don't refresh when setting disabled
6809
+			return;
6810
+		}
6811
+		this.refresh();
6812
+	},
6813
+
6814
+	_updateIcon: function( checked ) {
6815
+		var toAdd = "ui-icon ui-icon-background ";
6816
+
6817
+		if ( this.options.icon ) {
6818
+			if ( !this.icon ) {
6819
+				this.icon = $( "<span>" );
6820
+				this.iconSpace = $( "<span> </span>" );
6821
+				this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" );
6822
+			}
6823
+
6824
+			if ( this.type === "checkbox" ) {
6825
+				toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank";
6826
+				this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" );
6827
+			} else {
6828
+				toAdd += "ui-icon-blank";
6829
+			}
6830
+			this._addClass( this.icon, "ui-checkboxradio-icon", toAdd );
6831
+			if ( !checked ) {
6832
+				this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" );
6833
+			}
6834
+			this.icon.prependTo( this.label ).after( this.iconSpace );
6835
+		} else if ( this.icon !== undefined ) {
6836
+			this.icon.remove();
6837
+			this.iconSpace.remove();
6838
+			delete this.icon;
6839
+		}
6840
+	},
6841
+
6842
+	_updateLabel: function() {
6843
+
6844
+		// Remove the contents of the label ( minus the icon, icon space, and input )
6845
+		var contents = this.label.contents().not( this.element[ 0 ] );
6846
+		if ( this.icon ) {
6847
+			contents = contents.not( this.icon[ 0 ] );
6848
+		}
6849
+		if ( this.iconSpace ) {
6850
+			contents = contents.not( this.iconSpace[ 0 ] );
6851
+		}
6852
+		contents.remove();
6853
+
6854
+		this.label.append( this.options.label );
6855
+	},
6856
+
6857
+	refresh: function() {
6858
+		var checked = this.element[ 0 ].checked,
6859
+			isDisabled = this.element[ 0 ].disabled;
6860
+
6861
+		this._updateIcon( checked );
6862
+		this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked );
6863
+		if ( this.options.label !== null ) {
6864
+			this._updateLabel();
6865
+		}
6866
+
6867
+		if ( isDisabled !== this.options.disabled ) {
6868
+			this._setOptions( { "disabled": isDisabled } );
6869
+		}
6870
+	}
6871
+
6872
+} ] );
6873
+
6874
+var widgetsCheckboxradio = $.ui.checkboxradio;
6875
+
6876
+
6877
+/*!
6878
+ * jQuery UI Button 1.13.2
6879
+ * http://jqueryui.com
6880
+ *
6881
+ * Copyright jQuery Foundation and other contributors
6882
+ * Released under the MIT license.
6883
+ * http://jquery.org/license
6884
+ */
6885
+
6886
+//>>label: Button
6887
+//>>group: Widgets
6888
+//>>description: Enhances a form with themeable buttons.
6889
+//>>docs: http://api.jqueryui.com/button/
6890
+//>>demos: http://jqueryui.com/button/
6891
+//>>css.structure: ../../themes/base/core.css
6892
+//>>css.structure: ../../themes/base/button.css
6893
+//>>css.theme: ../../themes/base/theme.css
6894
+
6895
+
6896
+$.widget( "ui.button", {
6897
+	version: "1.13.2",
6898
+	defaultElement: "<button>",
6899
+	options: {
6900
+		classes: {
6901
+			"ui-button": "ui-corner-all"
6902
+		},
6903
+		disabled: null,
6904
+		icon: null,
6905
+		iconPosition: "beginning",
6906
+		label: null,
6907
+		showLabel: true
6908
+	},
6909
+
6910
+	_getCreateOptions: function() {
6911
+		var disabled,
6912
+
6913
+			// This is to support cases like in jQuery Mobile where the base widget does have
6914
+			// an implementation of _getCreateOptions
6915
+			options = this._super() || {};
6916
+
6917
+		this.isInput = this.element.is( "input" );
6918
+
6919
+		disabled = this.element[ 0 ].disabled;
6920
+		if ( disabled != null ) {
6921
+			options.disabled = disabled;
6922
+		}
6923
+
6924
+		this.originalLabel = this.isInput ? this.element.val() : this.element.html();
6925
+		if ( this.originalLabel ) {
6926
+			options.label = this.originalLabel;
6927
+		}
6928
+
6929
+		return options;
6930
+	},
6931
+
6932
+	_create: function() {
6933
+		if ( !this.option.showLabel & !this.options.icon ) {
6934
+			this.options.showLabel = true;
6935
+		}
6936
+
6937
+		// We have to check the option again here even though we did in _getCreateOptions,
6938
+		// because null may have been passed on init which would override what was set in
6939
+		// _getCreateOptions
6940
+		if ( this.options.disabled == null ) {
6941
+			this.options.disabled = this.element[ 0 ].disabled || false;
6942
+		}
6943
+
6944
+		this.hasTitle = !!this.element.attr( "title" );
6945
+
6946
+		// Check to see if the label needs to be set or if its already correct
6947
+		if ( this.options.label && this.options.label !== this.originalLabel ) {
6948
+			if ( this.isInput ) {
6949
+				this.element.val( this.options.label );
6950
+			} else {
6951
+				this.element.html( this.options.label );
6952
+			}
6953
+		}
6954
+		this._addClass( "ui-button", "ui-widget" );
6955
+		this._setOption( "disabled", this.options.disabled );
6956
+		this._enhance();
6957
+
6958
+		if ( this.element.is( "a" ) ) {
6959
+			this._on( {
6960
+				"keyup": function( event ) {
6961
+					if ( event.keyCode === $.ui.keyCode.SPACE ) {
6962
+						event.preventDefault();
6963
+
6964
+						// Support: PhantomJS <= 1.9, IE 8 Only
6965
+						// If a native click is available use it so we actually cause navigation
6966
+						// otherwise just trigger a click event
6967
+						if ( this.element[ 0 ].click ) {
6968
+							this.element[ 0 ].click();
6969
+						} else {
6970
+							this.element.trigger( "click" );
6971
+						}
6972
+					}
6973
+				}
6974
+			} );
6975
+		}
6976
+	},
6977
+
6978
+	_enhance: function() {
6979
+		if ( !this.element.is( "button" ) ) {
6980
+			this.element.attr( "role", "button" );
6981
+		}
6982
+
6983
+		if ( this.options.icon ) {
6984
+			this._updateIcon( "icon", this.options.icon );
6985
+			this._updateTooltip();
6986
+		}
6987
+	},
6988
+
6989
+	_updateTooltip: function() {
6990
+		this.title = this.element.attr( "title" );
6991
+
6992
+		if ( !this.options.showLabel && !this.title ) {
6993
+			this.element.attr( "title", this.options.label );
6994
+		}
6995
+	},
6996
+
6997
+	_updateIcon: function( option, value ) {
6998
+		var icon = option !== "iconPosition",
6999
+			position = icon ? this.options.iconPosition : value,
7000
+			displayBlock = position === "top" || position === "bottom";
7001
+
7002
+		// Create icon
7003
+		if ( !this.icon ) {
7004
+			this.icon = $( "<span>" );
7005
+
7006
+			this._addClass( this.icon, "ui-button-icon", "ui-icon" );
7007
+
7008
+			if ( !this.options.showLabel ) {
7009
+				this._addClass( "ui-button-icon-only" );
7010
+			}
7011
+		} else if ( icon ) {
7012
+
7013
+			// If we are updating the icon remove the old icon class
7014
+			this._removeClass( this.icon, null, this.options.icon );
7015
+		}
7016
+
7017
+		// If we are updating the icon add the new icon class
7018
+		if ( icon ) {
7019
+			this._addClass( this.icon, null, value );
7020
+		}
7021
+
7022
+		this._attachIcon( position );
7023
+
7024
+		// If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove
7025
+		// the iconSpace if there is one.
7026
+		if ( displayBlock ) {
7027
+			this._addClass( this.icon, null, "ui-widget-icon-block" );
7028
+			if ( this.iconSpace ) {
7029
+				this.iconSpace.remove();
7030
+			}
7031
+		} else {
7032
+
7033
+			// Position is beginning or end so remove the ui-widget-icon-block class and add the
7034
+			// space if it does not exist
7035
+			if ( !this.iconSpace ) {
7036
+				this.iconSpace = $( "<span> </span>" );
7037
+				this._addClass( this.iconSpace, "ui-button-icon-space" );
7038
+			}
7039
+			this._removeClass( this.icon, null, "ui-wiget-icon-block" );
7040
+			this._attachIconSpace( position );
7041
+		}
7042
+	},
7043
+
7044
+	_destroy: function() {
7045
+		this.element.removeAttr( "role" );
7046
+
7047
+		if ( this.icon ) {
7048
+			this.icon.remove();
7049
+		}
7050
+		if ( this.iconSpace ) {
7051
+			this.iconSpace.remove();
7052
+		}
7053
+		if ( !this.hasTitle ) {
7054
+			this.element.removeAttr( "title" );
7055
+		}
7056
+	},
7057
+
7058
+	_attachIconSpace: function( iconPosition ) {
7059
+		this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace );
7060
+	},
7061
+
7062
+	_attachIcon: function( iconPosition ) {
7063
+		this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon );
7064
+	},
7065
+
7066
+	_setOptions: function( options ) {
7067
+		var newShowLabel = options.showLabel === undefined ?
7068
+				this.options.showLabel :
7069
+				options.showLabel,
7070
+			newIcon = options.icon === undefined ? this.options.icon : options.icon;
7071
+
7072
+		if ( !newShowLabel && !newIcon ) {
7073
+			options.showLabel = true;
7074
+		}
7075
+		this._super( options );
7076
+	},
7077
+
7078
+	_setOption: function( key, value ) {
7079
+		if ( key === "icon" ) {
7080
+			if ( value ) {
7081
+				this._updateIcon( key, value );
7082
+			} else if ( this.icon ) {
7083
+				this.icon.remove();
7084
+				if ( this.iconSpace ) {
7085
+					this.iconSpace.remove();
7086
+				}
7087
+			}
7088
+		}
7089
+
7090
+		if ( key === "iconPosition" ) {
7091
+			this._updateIcon( key, value );
7092
+		}
7093
+
7094
+		// Make sure we can't end up with a button that has neither text nor icon
7095
+		if ( key === "showLabel" ) {
7096
+				this._toggleClass( "ui-button-icon-only", null, !value );
7097
+				this._updateTooltip();
7098
+		}
7099
+
7100
+		if ( key === "label" ) {
7101
+			if ( this.isInput ) {
7102
+				this.element.val( value );
7103
+			} else {
7104
+
7105
+				// If there is an icon, append it, else nothing then append the value
7106
+				// this avoids removal of the icon when setting label text
7107
+				this.element.html( value );
7108
+				if ( this.icon ) {
7109
+					this._attachIcon( this.options.iconPosition );
7110
+					this._attachIconSpace( this.options.iconPosition );
7111
+				}
7112
+			}
7113
+		}
7114
+
7115
+		this._super( key, value );
7116
+
7117
+		if ( key === "disabled" ) {
7118
+			this._toggleClass( null, "ui-state-disabled", value );
7119
+			this.element[ 0 ].disabled = value;
7120
+			if ( value ) {
7121
+				this.element.trigger( "blur" );
7122
+			}
7123
+		}
7124
+	},
7125
+
7126
+	refresh: function() {
7127
+
7128
+		// Make sure to only check disabled if its an element that supports this otherwise
7129
+		// check for the disabled class to determine state
7130
+		var isDisabled = this.element.is( "input, button" ) ?
7131
+			this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" );
7132
+
7133
+		if ( isDisabled !== this.options.disabled ) {
7134
+			this._setOptions( { disabled: isDisabled } );
7135
+		}
7136
+
7137
+		this._updateTooltip();
7138
+	}
7139
+} );
7140
+
7141
+// DEPRECATED
7142
+if ( $.uiBackCompat !== false ) {
7143
+
7144
+	// Text and Icons options
7145
+	$.widget( "ui.button", $.ui.button, {
7146
+		options: {
7147
+			text: true,
7148
+			icons: {
7149
+				primary: null,
7150
+				secondary: null
7151
+			}
7152
+		},
7153
+
7154
+		_create: function() {
7155
+			if ( this.options.showLabel && !this.options.text ) {
7156
+				this.options.showLabel = this.options.text;
7157
+			}
7158
+			if ( !this.options.showLabel && this.options.text ) {
7159
+				this.options.text = this.options.showLabel;
7160
+			}
7161
+			if ( !this.options.icon && ( this.options.icons.primary ||
7162
+					this.options.icons.secondary ) ) {
7163
+				if ( this.options.icons.primary ) {
7164
+					this.options.icon = this.options.icons.primary;
7165
+				} else {
7166
+					this.options.icon = this.options.icons.secondary;
7167
+					this.options.iconPosition = "end";
7168
+				}
7169
+			} else if ( this.options.icon ) {
7170
+				this.options.icons.primary = this.options.icon;
7171
+			}
7172
+			this._super();
7173
+		},
7174
+
7175
+		_setOption: function( key, value ) {
7176
+			if ( key === "text" ) {
7177
+				this._super( "showLabel", value );
7178
+				return;
7179
+			}
7180
+			if ( key === "showLabel" ) {
7181
+				this.options.text = value;
7182
+			}
7183
+			if ( key === "icon" ) {
7184
+				this.options.icons.primary = value;
7185
+			}
7186
+			if ( key === "icons" ) {
7187
+				if ( value.primary ) {
7188
+					this._super( "icon", value.primary );
7189
+					this._super( "iconPosition", "beginning" );
7190
+				} else if ( value.secondary ) {
7191
+					this._super( "icon", value.secondary );
7192
+					this._super( "iconPosition", "end" );
7193
+				}
7194
+			}
7195
+			this._superApply( arguments );
7196
+		}
7197
+	} );
7198
+
7199
+	$.fn.button = ( function( orig ) {
7200
+		return function( options ) {
7201
+			var isMethodCall = typeof options === "string";
7202
+			var args = Array.prototype.slice.call( arguments, 1 );
7203
+			var returnValue = this;
7204
+
7205
+			if ( isMethodCall ) {
7206
+
7207
+				// If this is an empty collection, we need to have the instance method
7208
+				// return undefined instead of the jQuery instance
7209
+				if ( !this.length && options === "instance" ) {
7210
+					returnValue = undefined;
7211
+				} else {
7212
+					this.each( function() {
7213
+						var methodValue;
7214
+						var type = $( this ).attr( "type" );
7215
+						var name = type !== "checkbox" && type !== "radio" ?
7216
+							"button" :
7217
+							"checkboxradio";
7218
+						var instance = $.data( this, "ui-" + name );
7219
+
7220
+						if ( options === "instance" ) {
7221
+							returnValue = instance;
7222
+							return false;
7223
+						}
7224
+
7225
+						if ( !instance ) {
7226
+							return $.error( "cannot call methods on button" +
7227
+								" prior to initialization; " +
7228
+								"attempted to call method '" + options + "'" );
7229
+						}
7230
+
7231
+						if ( typeof instance[ options ] !== "function" ||
7232
+							options.charAt( 0 ) === "_" ) {
7233
+							return $.error( "no such method '" + options + "' for button" +
7234
+								" widget instance" );
7235
+						}
7236
+
7237
+						methodValue = instance[ options ].apply( instance, args );
7238
+
7239
+						if ( methodValue !== instance && methodValue !== undefined ) {
7240
+							returnValue = methodValue && methodValue.jquery ?
7241
+								returnValue.pushStack( methodValue.get() ) :
7242
+								methodValue;
7243
+							return false;
7244
+						}
7245
+					} );
7246
+				}
7247
+			} else {
7248
+
7249
+				// Allow multiple hashes to be passed on init
7250
+				if ( args.length ) {
7251
+					options = $.widget.extend.apply( null, [ options ].concat( args ) );
7252
+				}
7253
+
7254
+				this.each( function() {
7255
+					var type = $( this ).attr( "type" );
7256
+					var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio";
7257
+					var instance = $.data( this, "ui-" + name );
7258
+
7259
+					if ( instance ) {
7260
+						instance.option( options || {} );
7261
+						if ( instance._init ) {
7262
+							instance._init();
7263
+						}
7264
+					} else {
7265
+						if ( name === "button" ) {
7266
+							orig.call( $( this ), options );
7267
+							return;
7268
+						}
7269
+
7270
+						$( this ).checkboxradio( $.extend( { icon: false }, options ) );
7271
+					}
7272
+				} );
7273
+			}
7274
+
7275
+			return returnValue;
7276
+		};
7277
+	} )( $.fn.button );
7278
+
7279
+	$.fn.buttonset = function() {
7280
+		if ( !$.ui.controlgroup ) {
7281
+			$.error( "Controlgroup widget missing" );
7282
+		}
7283
+		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) {
7284
+			return this.controlgroup.apply( this,
7285
+				[ arguments[ 0 ], "items.button", arguments[ 2 ] ] );
7286
+		}
7287
+		if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) {
7288
+			return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] );
7289
+		}
7290
+		if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) {
7291
+			arguments[ 0 ].items = {
7292
+				button: arguments[ 0 ].items
7293
+			};
7294
+		}
7295
+		return this.controlgroup.apply( this, arguments );
7296
+	};
7297
+}
7298
+
7299
+var widgetsButton = $.ui.button;
7300
+
7301
+
7302
+/* eslint-disable max-len, camelcase */
7303
+/*!
7304
+ * jQuery UI Datepicker 1.13.2
7305
+ * http://jqueryui.com
7306
+ *
7307
+ * Copyright jQuery Foundation and other contributors
7308
+ * Released under the MIT license.
7309
+ * http://jquery.org/license
7310
+ */
7311
+
7312
+//>>label: Datepicker
7313
+//>>group: Widgets
7314
+//>>description: Displays a calendar from an input or inline for selecting dates.
7315
+//>>docs: http://api.jqueryui.com/datepicker/
7316
+//>>demos: http://jqueryui.com/datepicker/
7317
+//>>css.structure: ../../themes/base/core.css
7318
+//>>css.structure: ../../themes/base/datepicker.css
7319
+//>>css.theme: ../../themes/base/theme.css
7320
+
7321
+
7322
+$.extend( $.ui, { datepicker: { version: "1.13.2" } } );
7323
+
7324
+var datepicker_instActive;
7325
+
7326
+function datepicker_getZindex( elem ) {
7327
+	var position, value;
7328
+	while ( elem.length && elem[ 0 ] !== document ) {
7329
+
7330
+		// Ignore z-index if position is set to a value where z-index is ignored by the browser
7331
+		// This makes behavior of this function consistent across browsers
7332
+		// WebKit always returns auto if the element is positioned
7333
+		position = elem.css( "position" );
7334
+		if ( position === "absolute" || position === "relative" || position === "fixed" ) {
7335
+
7336
+			// IE returns 0 when zIndex is not specified
7337
+			// other browsers return a string
7338
+			// we ignore the case of nested elements with an explicit value of 0
7339
+			// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
7340
+			value = parseInt( elem.css( "zIndex" ), 10 );
7341
+			if ( !isNaN( value ) && value !== 0 ) {
7342
+				return value;
7343
+			}
7344
+		}
7345
+		elem = elem.parent();
7346
+	}
7347
+
7348
+	return 0;
7349
+}
7350
+
7351
+/* Date picker manager.
7352
+   Use the singleton instance of this class, $.datepicker, to interact with the date picker.
7353
+   Settings for (groups of) date pickers are maintained in an instance object,
7354
+   allowing multiple different settings on the same page. */
7355
+
7356
+function Datepicker() {
7357
+	this._curInst = null; // The current instance in use
7358
+	this._keyEvent = false; // If the last event was a key event
7359
+	this._disabledInputs = []; // List of date picker inputs that have been disabled
7360
+	this._datepickerShowing = false; // True if the popup picker is showing , false if not
7361
+	this._inDialog = false; // True if showing within a "dialog", false if not
7362
+	this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division
7363
+	this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class
7364
+	this._appendClass = "ui-datepicker-append"; // The name of the append marker class
7365
+	this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class
7366
+	this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class
7367
+	this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class
7368
+	this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class
7369
+	this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class
7370
+	this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
7371
+	this.regional = []; // Available regional settings, indexed by language code
7372
+	this.regional[ "" ] = { // Default regional settings
7373
+		closeText: "Done", // Display text for close link
7374
+		prevText: "Prev", // Display text for previous month link
7375
+		nextText: "Next", // Display text for next month link
7376
+		currentText: "Today", // Display text for current month link
7377
+		monthNames: [ "January", "February", "March", "April", "May", "June",
7378
+			"July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting
7379
+		monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting
7380
+		dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting
7381
+		dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting
7382
+		dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday
7383
+		weekHeader: "Wk", // Column header for week of the year
7384
+		dateFormat: "mm/dd/yy", // See format options on parseDate
7385
+		firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
7386
+		isRTL: false, // True if right-to-left language, false if left-to-right
7387
+		showMonthAfterYear: false, // True if the year select precedes month, false for month then year
7388
+		yearSuffix: "", // Additional text to append to the year in the month headers,
7389
+		selectMonthLabel: "Select month", // Invisible label for month selector
7390
+		selectYearLabel: "Select year" // Invisible label for year selector
7391
+	};
7392
+	this._defaults = { // Global defaults for all the date picker instances
7393
+		showOn: "focus", // "focus" for popup on focus,
7394
+			// "button" for trigger button, or "both" for either
7395
+		showAnim: "fadeIn", // Name of jQuery animation for popup
7396
+		showOptions: {}, // Options for enhanced animations
7397
+		defaultDate: null, // Used when field is blank: actual date,
7398
+			// +/-number for offset from today, null for today
7399
+		appendText: "", // Display text following the input box, e.g. showing the format
7400
+		buttonText: "...", // Text for trigger button
7401
+		buttonImage: "", // URL for trigger button image
7402
+		buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
7403
+		hideIfNoPrevNext: false, // True to hide next/previous month links
7404
+			// if not applicable, false to just disable them
7405
+		navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
7406
+		gotoCurrent: false, // True if today link goes back to current selection instead
7407
+		changeMonth: false, // True if month can be selected directly, false if only prev/next
7408
+		changeYear: false, // True if year can be selected directly, false if only prev/next
7409
+		yearRange: "c-10:c+10", // Range of years to display in drop-down,
7410
+			// either relative to today's year (-nn:+nn), relative to currently displayed year
7411
+			// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
7412
+		showOtherMonths: false, // True to show dates in other months, false to leave blank
7413
+		selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
7414
+		showWeek: false, // True to show week of the year, false to not show it
7415
+		calculateWeek: this.iso8601Week, // How to calculate the week of the year,
7416
+			// takes a Date and returns the number of the week for it
7417
+		shortYearCutoff: "+10", // Short year values < this are in the current century,
7418
+			// > this are in the previous century,
7419
+			// string value starting with "+" for current year + value
7420
+		minDate: null, // The earliest selectable date, or null for no limit
7421
+		maxDate: null, // The latest selectable date, or null for no limit
7422
+		duration: "fast", // Duration of display/closure
7423
+		beforeShowDay: null, // Function that takes a date and returns an array with
7424
+			// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
7425
+			// [2] = cell title (optional), e.g. $.datepicker.noWeekends
7426
+		beforeShow: null, // Function that takes an input field and
7427
+			// returns a set of custom settings for the date picker
7428
+		onSelect: null, // Define a callback function when a date is selected
7429
+		onChangeMonthYear: null, // Define a callback function when the month or year is changed
7430
+		onClose: null, // Define a callback function when the datepicker is closed
7431
+		onUpdateDatepicker: null, // Define a callback function when the datepicker is updated
7432
+		numberOfMonths: 1, // Number of months to show at a time
7433
+		showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
7434
+		stepMonths: 1, // Number of months to step back/forward
7435
+		stepBigMonths: 12, // Number of months to step back/forward for the big links
7436
+		altField: "", // Selector for an alternate field to store selected dates into
7437
+		altFormat: "", // The date format to use for the alternate field
7438
+		constrainInput: true, // The input is constrained by the current date format
7439
+		showButtonPanel: false, // True to show button panel, false to not show it
7440
+		autoSize: false, // True to size the input for the date format, false to leave as is
7441
+		disabled: false // The initial disabled state
7442
+	};
7443
+	$.extend( this._defaults, this.regional[ "" ] );
7444
+	this.regional.en = $.extend( true, {}, this.regional[ "" ] );
7445
+	this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en );
7446
+	this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) );
7447
+}
7448
+
7449
+$.extend( Datepicker.prototype, {
7450
+
7451
+	/* Class name added to elements to indicate already configured with a date picker. */
7452
+	markerClassName: "hasDatepicker",
7453
+
7454
+	//Keep track of the maximum number of rows displayed (see #7043)
7455
+	maxRows: 4,
7456
+
7457
+	// TODO rename to "widget" when switching to widget factory
7458
+	_widgetDatepicker: function() {
7459
+		return this.dpDiv;
7460
+	},
7461
+
7462
+	/* Override the default settings for all instances of the date picker.
7463
+	 * @param  settings  object - the new settings to use as defaults (anonymous object)
7464
+	 * @return the manager object
7465
+	 */
7466
+	setDefaults: function( settings ) {
7467
+		datepicker_extendRemove( this._defaults, settings || {} );
7468
+		return this;
7469
+	},
7470
+
7471
+	/* Attach the date picker to a jQuery selection.
7472
+	 * @param  target	element - the target input field or division or span
7473
+	 * @param  settings  object - the new settings to use for this date picker instance (anonymous)
7474
+	 */
7475
+	_attachDatepicker: function( target, settings ) {
7476
+		var nodeName, inline, inst;
7477
+		nodeName = target.nodeName.toLowerCase();
7478
+		inline = ( nodeName === "div" || nodeName === "span" );
7479
+		if ( !target.id ) {
7480
+			this.uuid += 1;
7481
+			target.id = "dp" + this.uuid;
7482
+		}
7483
+		inst = this._newInst( $( target ), inline );
7484
+		inst.settings = $.extend( {}, settings || {} );
7485
+		if ( nodeName === "input" ) {
7486
+			this._connectDatepicker( target, inst );
7487
+		} else if ( inline ) {
7488
+			this._inlineDatepicker( target, inst );
7489
+		}
7490
+	},
7491
+
7492
+	/* Create a new instance object. */
7493
+	_newInst: function( target, inline ) {
7494
+		var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars
7495
+		return { id: id, input: target, // associated target
7496
+			selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
7497
+			drawMonth: 0, drawYear: 0, // month being drawn
7498
+			inline: inline, // is datepicker inline or not
7499
+			dpDiv: ( !inline ? this.dpDiv : // presentation div
7500
+			datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) };
7501
+	},
7502
+
7503
+	/* Attach the date picker to an input field. */
7504
+	_connectDatepicker: function( target, inst ) {
7505
+		var input = $( target );
7506
+		inst.append = $( [] );
7507
+		inst.trigger = $( [] );
7508
+		if ( input.hasClass( this.markerClassName ) ) {
7509
+			return;
7510
+		}
7511
+		this._attachments( input, inst );
7512
+		input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ).
7513
+			on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp );
7514
+		this._autoSize( inst );
7515
+		$.data( target, "datepicker", inst );
7516
+
7517
+		//If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
7518
+		if ( inst.settings.disabled ) {
7519
+			this._disableDatepicker( target );
7520
+		}
7521
+	},
7522
+
7523
+	/* Make attachments based on settings. */
7524
+	_attachments: function( input, inst ) {
7525
+		var showOn, buttonText, buttonImage,
7526
+			appendText = this._get( inst, "appendText" ),
7527
+			isRTL = this._get( inst, "isRTL" );
7528
+
7529
+		if ( inst.append ) {
7530
+			inst.append.remove();
7531
+		}
7532
+		if ( appendText ) {
7533
+			inst.append = $( "<span>" )
7534
+				.addClass( this._appendClass )
7535
+				.text( appendText );
7536
+			input[ isRTL ? "before" : "after" ]( inst.append );
7537
+		}
7538
+
7539
+		input.off( "focus", this._showDatepicker );
7540
+
7541
+		if ( inst.trigger ) {
7542
+			inst.trigger.remove();
7543
+		}
7544
+
7545
+		showOn = this._get( inst, "showOn" );
7546
+		if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field
7547
+			input.on( "focus", this._showDatepicker );
7548
+		}
7549
+		if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked
7550
+			buttonText = this._get( inst, "buttonText" );
7551
+			buttonImage = this._get( inst, "buttonImage" );
7552
+
7553
+			if ( this._get( inst, "buttonImageOnly" ) ) {
7554
+				inst.trigger = $( "<img>" )
7555
+					.addClass( this._triggerClass )
7556
+					.attr( {
7557
+						src: buttonImage,
7558
+						alt: buttonText,
7559
+						title: buttonText
7560
+					} );
7561
+			} else {
7562
+				inst.trigger = $( "<button type='button'>" )
7563
+					.addClass( this._triggerClass );
7564
+				if ( buttonImage ) {
7565
+					inst.trigger.html(
7566
+						$( "<img>" )
7567
+							.attr( {
7568
+								src: buttonImage,
7569
+								alt: buttonText,
7570
+								title: buttonText
7571
+							} )
7572
+					);
7573
+				} else {
7574
+					inst.trigger.text( buttonText );
7575
+				}
7576
+			}
7577
+
7578
+			input[ isRTL ? "before" : "after" ]( inst.trigger );
7579
+			inst.trigger.on( "click", function() {
7580
+				if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) {
7581
+					$.datepicker._hideDatepicker();
7582
+				} else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) {
7583
+					$.datepicker._hideDatepicker();
7584
+					$.datepicker._showDatepicker( input[ 0 ] );
7585
+				} else {
7586
+					$.datepicker._showDatepicker( input[ 0 ] );
7587
+				}
7588
+				return false;
7589
+			} );
7590
+		}
7591
+	},
7592
+
7593
+	/* Apply the maximum length for the date format. */
7594
+	_autoSize: function( inst ) {
7595
+		if ( this._get( inst, "autoSize" ) && !inst.inline ) {
7596
+			var findMax, max, maxI, i,
7597
+				date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits
7598
+				dateFormat = this._get( inst, "dateFormat" );
7599
+
7600
+			if ( dateFormat.match( /[DM]/ ) ) {
7601
+				findMax = function( names ) {
7602
+					max = 0;
7603
+					maxI = 0;
7604
+					for ( i = 0; i < names.length; i++ ) {
7605
+						if ( names[ i ].length > max ) {
7606
+							max = names[ i ].length;
7607
+							maxI = i;
7608
+						}
7609
+					}
7610
+					return maxI;
7611
+				};
7612
+				date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ?
7613
+					"monthNames" : "monthNamesShort" ) ) ) );
7614
+				date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ?
7615
+					"dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() );
7616
+			}
7617
+			inst.input.attr( "size", this._formatDate( inst, date ).length );
7618
+		}
7619
+	},
7620
+
7621
+	/* Attach an inline date picker to a div. */
7622
+	_inlineDatepicker: function( target, inst ) {
7623
+		var divSpan = $( target );
7624
+		if ( divSpan.hasClass( this.markerClassName ) ) {
7625
+			return;
7626
+		}
7627
+		divSpan.addClass( this.markerClassName ).append( inst.dpDiv );
7628
+		$.data( target, "datepicker", inst );
7629
+		this._setDate( inst, this._getDefaultDate( inst ), true );
7630
+		this._updateDatepicker( inst );
7631
+		this._updateAlternate( inst );
7632
+
7633
+		//If disabled option is true, disable the datepicker before showing it (see ticket #5665)
7634
+		if ( inst.settings.disabled ) {
7635
+			this._disableDatepicker( target );
7636
+		}
7637
+
7638
+		// Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
7639
+		// http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
7640
+		inst.dpDiv.css( "display", "block" );
7641
+	},
7642
+
7643
+	/* Pop-up the date picker in a "dialog" box.
7644
+	 * @param  input element - ignored
7645
+	 * @param  date	string or Date - the initial date to display
7646
+	 * @param  onSelect  function - the function to call when a date is selected
7647
+	 * @param  settings  object - update the dialog date picker instance's settings (anonymous object)
7648
+	 * @param  pos int[2] - coordinates for the dialog's position within the screen or
7649
+	 *					event - with x/y coordinates or
7650
+	 *					leave empty for default (screen centre)
7651
+	 * @return the manager object
7652
+	 */
7653
+	_dialogDatepicker: function( input, date, onSelect, settings, pos ) {
7654
+		var id, browserWidth, browserHeight, scrollX, scrollY,
7655
+			inst = this._dialogInst; // internal instance
7656
+
7657
+		if ( !inst ) {
7658
+			this.uuid += 1;
7659
+			id = "dp" + this.uuid;
7660
+			this._dialogInput = $( "<input type='text' id='" + id +
7661
+				"' style='position: absolute; top: -100px; width: 0px;'/>" );
7662
+			this._dialogInput.on( "keydown", this._doKeyDown );
7663
+			$( "body" ).append( this._dialogInput );
7664
+			inst = this._dialogInst = this._newInst( this._dialogInput, false );
7665
+			inst.settings = {};
7666
+			$.data( this._dialogInput[ 0 ], "datepicker", inst );
7667
+		}
7668
+		datepicker_extendRemove( inst.settings, settings || {} );
7669
+		date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date );
7670
+		this._dialogInput.val( date );
7671
+
7672
+		this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null );
7673
+		if ( !this._pos ) {
7674
+			browserWidth = document.documentElement.clientWidth;
7675
+			browserHeight = document.documentElement.clientHeight;
7676
+			scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
7677
+			scrollY = document.documentElement.scrollTop || document.body.scrollTop;
7678
+			this._pos = // should use actual width/height below
7679
+				[ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ];
7680
+		}
7681
+
7682
+		// Move input on screen for focus, but hidden behind dialog
7683
+		this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" );
7684
+		inst.settings.onSelect = onSelect;
7685
+		this._inDialog = true;
7686
+		this.dpDiv.addClass( this._dialogClass );
7687
+		this._showDatepicker( this._dialogInput[ 0 ] );
7688
+		if ( $.blockUI ) {
7689
+			$.blockUI( this.dpDiv );
7690
+		}
7691
+		$.data( this._dialogInput[ 0 ], "datepicker", inst );
7692
+		return this;
7693
+	},
7694
+
7695
+	/* Detach a datepicker from its control.
7696
+	 * @param  target	element - the target input field or division or span
7697
+	 */
7698
+	_destroyDatepicker: function( target ) {
7699
+		var nodeName,
7700
+			$target = $( target ),
7701
+			inst = $.data( target, "datepicker" );
7702
+
7703
+		if ( !$target.hasClass( this.markerClassName ) ) {
7704
+			return;
7705
+		}
7706
+
7707
+		nodeName = target.nodeName.toLowerCase();
7708
+		$.removeData( target, "datepicker" );
7709
+		if ( nodeName === "input" ) {
7710
+			inst.append.remove();
7711
+			inst.trigger.remove();
7712
+			$target.removeClass( this.markerClassName ).
7713
+				off( "focus", this._showDatepicker ).
7714
+				off( "keydown", this._doKeyDown ).
7715
+				off( "keypress", this._doKeyPress ).
7716
+				off( "keyup", this._doKeyUp );
7717
+		} else if ( nodeName === "div" || nodeName === "span" ) {
7718
+			$target.removeClass( this.markerClassName ).empty();
7719
+		}
7720
+
7721
+		if ( datepicker_instActive === inst ) {
7722
+			datepicker_instActive = null;
7723
+			this._curInst = null;
7724
+		}
7725
+	},
7726
+
7727
+	/* Enable the date picker to a jQuery selection.
7728
+	 * @param  target	element - the target input field or division or span
7729
+	 */
7730
+	_enableDatepicker: function( target ) {
7731
+		var nodeName, inline,
7732
+			$target = $( target ),
7733
+			inst = $.data( target, "datepicker" );
7734
+
7735
+		if ( !$target.hasClass( this.markerClassName ) ) {
7736
+			return;
7737
+		}
7738
+
7739
+		nodeName = target.nodeName.toLowerCase();
7740
+		if ( nodeName === "input" ) {
7741
+			target.disabled = false;
7742
+			inst.trigger.filter( "button" ).
7743
+				each( function() {
7744
+					this.disabled = false;
7745
+				} ).end().
7746
+				filter( "img" ).css( { opacity: "1.0", cursor: "" } );
7747
+		} else if ( nodeName === "div" || nodeName === "span" ) {
7748
+			inline = $target.children( "." + this._inlineClass );
7749
+			inline.children().removeClass( "ui-state-disabled" );
7750
+			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
7751
+				prop( "disabled", false );
7752
+		}
7753
+		this._disabledInputs = $.map( this._disabledInputs,
7754
+
7755
+			// Delete entry
7756
+			function( value ) {
7757
+				return ( value === target ? null : value );
7758
+			} );
7759
+	},
7760
+
7761
+	/* Disable the date picker to a jQuery selection.
7762
+	 * @param  target	element - the target input field or division or span
7763
+	 */
7764
+	_disableDatepicker: function( target ) {
7765
+		var nodeName, inline,
7766
+			$target = $( target ),
7767
+			inst = $.data( target, "datepicker" );
7768
+
7769
+		if ( !$target.hasClass( this.markerClassName ) ) {
7770
+			return;
7771
+		}
7772
+
7773
+		nodeName = target.nodeName.toLowerCase();
7774
+		if ( nodeName === "input" ) {
7775
+			target.disabled = true;
7776
+			inst.trigger.filter( "button" ).
7777
+				each( function() {
7778
+					this.disabled = true;
7779
+				} ).end().
7780
+				filter( "img" ).css( { opacity: "0.5", cursor: "default" } );
7781
+		} else if ( nodeName === "div" || nodeName === "span" ) {
7782
+			inline = $target.children( "." + this._inlineClass );
7783
+			inline.children().addClass( "ui-state-disabled" );
7784
+			inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ).
7785
+				prop( "disabled", true );
7786
+		}
7787
+		this._disabledInputs = $.map( this._disabledInputs,
7788
+
7789
+			// Delete entry
7790
+			function( value ) {
7791
+				return ( value === target ? null : value );
7792
+			} );
7793
+		this._disabledInputs[ this._disabledInputs.length ] = target;
7794
+	},
7795
+
7796
+	/* Is the first field in a jQuery collection disabled as a datepicker?
7797
+	 * @param  target	element - the target input field or division or span
7798
+	 * @return boolean - true if disabled, false if enabled
7799
+	 */
7800
+	_isDisabledDatepicker: function( target ) {
7801
+		if ( !target ) {
7802
+			return false;
7803
+		}
7804
+		for ( var i = 0; i < this._disabledInputs.length; i++ ) {
7805
+			if ( this._disabledInputs[ i ] === target ) {
7806
+				return true;
7807
+			}
7808
+		}
7809
+		return false;
7810
+	},
7811
+
7812
+	/* Retrieve the instance data for the target control.
7813
+	 * @param  target  element - the target input field or division or span
7814
+	 * @return  object - the associated instance data
7815
+	 * @throws  error if a jQuery problem getting data
7816
+	 */
7817
+	_getInst: function( target ) {
7818
+		try {
7819
+			return $.data( target, "datepicker" );
7820
+		} catch ( err ) {
7821
+			throw "Missing instance data for this datepicker";
7822
+		}
7823
+	},
7824
+
7825
+	/* Update or retrieve the settings for a date picker attached to an input field or division.
7826
+	 * @param  target  element - the target input field or division or span
7827
+	 * @param  name	object - the new settings to update or
7828
+	 *				string - the name of the setting to change or retrieve,
7829
+	 *				when retrieving also "all" for all instance settings or
7830
+	 *				"defaults" for all global defaults
7831
+	 * @param  value   any - the new value for the setting
7832
+	 *				(omit if above is an object or to retrieve a value)
7833
+	 */
7834
+	_optionDatepicker: function( target, name, value ) {
7835
+		var settings, date, minDate, maxDate,
7836
+			inst = this._getInst( target );
7837
+
7838
+		if ( arguments.length === 2 && typeof name === "string" ) {
7839
+			return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) :
7840
+				( inst ? ( name === "all" ? $.extend( {}, inst.settings ) :
7841
+				this._get( inst, name ) ) : null ) );
7842
+		}
7843
+
7844
+		settings = name || {};
7845
+		if ( typeof name === "string" ) {
7846
+			settings = {};
7847
+			settings[ name ] = value;
7848
+		}
7849
+
7850
+		if ( inst ) {
7851
+			if ( this._curInst === inst ) {
7852
+				this._hideDatepicker();
7853
+			}
7854
+
7855
+			date = this._getDateDatepicker( target, true );
7856
+			minDate = this._getMinMaxDate( inst, "min" );
7857
+			maxDate = this._getMinMaxDate( inst, "max" );
7858
+			datepicker_extendRemove( inst.settings, settings );
7859
+
7860
+			// reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
7861
+			if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) {
7862
+				inst.settings.minDate = this._formatDate( inst, minDate );
7863
+			}
7864
+			if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) {
7865
+				inst.settings.maxDate = this._formatDate( inst, maxDate );
7866
+			}
7867
+			if ( "disabled" in settings ) {
7868
+				if ( settings.disabled ) {
7869
+					this._disableDatepicker( target );
7870
+				} else {
7871
+					this._enableDatepicker( target );
7872
+				}
7873
+			}
7874
+			this._attachments( $( target ), inst );
7875
+			this._autoSize( inst );
7876
+			this._setDate( inst, date );
7877
+			this._updateAlternate( inst );
7878
+			this._updateDatepicker( inst );
7879
+		}
7880
+	},
7881
+
7882
+	// Change method deprecated
7883
+	_changeDatepicker: function( target, name, value ) {
7884
+		this._optionDatepicker( target, name, value );
7885
+	},
7886
+
7887
+	/* Redraw the date picker attached to an input field or division.
7888
+	 * @param  target  element - the target input field or division or span
7889
+	 */
7890
+	_refreshDatepicker: function( target ) {
7891
+		var inst = this._getInst( target );
7892
+		if ( inst ) {
7893
+			this._updateDatepicker( inst );
7894
+		}
7895
+	},
7896
+
7897
+	/* Set the dates for a jQuery selection.
7898
+	 * @param  target element - the target input field or division or span
7899
+	 * @param  date	Date - the new date
7900
+	 */
7901
+	_setDateDatepicker: function( target, date ) {
7902
+		var inst = this._getInst( target );
7903
+		if ( inst ) {
7904
+			this._setDate( inst, date );
7905
+			this._updateDatepicker( inst );
7906
+			this._updateAlternate( inst );
7907
+		}
7908
+	},
7909
+
7910
+	/* Get the date(s) for the first entry in a jQuery selection.
7911
+	 * @param  target element - the target input field or division or span
7912
+	 * @param  noDefault boolean - true if no default date is to be used
7913
+	 * @return Date - the current date
7914
+	 */
7915
+	_getDateDatepicker: function( target, noDefault ) {
7916
+		var inst = this._getInst( target );
7917
+		if ( inst && !inst.inline ) {
7918
+			this._setDateFromField( inst, noDefault );
7919
+		}
7920
+		return ( inst ? this._getDate( inst ) : null );
7921
+	},
7922
+
7923
+	/* Handle keystrokes. */
7924
+	_doKeyDown: function( event ) {
7925
+		var onSelect, dateStr, sel,
7926
+			inst = $.datepicker._getInst( event.target ),
7927
+			handled = true,
7928
+			isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" );
7929
+
7930
+		inst._keyEvent = true;
7931
+		if ( $.datepicker._datepickerShowing ) {
7932
+			switch ( event.keyCode ) {
7933
+				case 9: $.datepicker._hideDatepicker();
7934
+						handled = false;
7935
+						break; // hide on tab out
7936
+				case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." +
7937
+									$.datepicker._currentClass + ")", inst.dpDiv );
7938
+						if ( sel[ 0 ] ) {
7939
+							$.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] );
7940
+						}
7941
+
7942
+						onSelect = $.datepicker._get( inst, "onSelect" );
7943
+						if ( onSelect ) {
7944
+							dateStr = $.datepicker._formatDate( inst );
7945
+
7946
+							// Trigger custom callback
7947
+							onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );
7948
+						} else {
7949
+							$.datepicker._hideDatepicker();
7950
+						}
7951
+
7952
+						return false; // don't submit the form
7953
+				case 27: $.datepicker._hideDatepicker();
7954
+						break; // hide on escape
7955
+				case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
7956
+							-$.datepicker._get( inst, "stepBigMonths" ) :
7957
+							-$.datepicker._get( inst, "stepMonths" ) ), "M" );
7958
+						break; // previous month/year on page up/+ ctrl
7959
+				case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ?
7960
+							+$.datepicker._get( inst, "stepBigMonths" ) :
7961
+							+$.datepicker._get( inst, "stepMonths" ) ), "M" );
7962
+						break; // next month/year on page down/+ ctrl
7963
+				case 35: if ( event.ctrlKey || event.metaKey ) {
7964
+							$.datepicker._clearDate( event.target );
7965
+						}
7966
+						handled = event.ctrlKey || event.metaKey;
7967
+						break; // clear on ctrl or command +end
7968
+				case 36: if ( event.ctrlKey || event.metaKey ) {
7969
+							$.datepicker._gotoToday( event.target );
7970
+						}
7971
+						handled = event.ctrlKey || event.metaKey;
7972
+						break; // current on ctrl or command +home
7973
+				case 37: if ( event.ctrlKey || event.metaKey ) {
7974
+							$.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" );
7975
+						}
7976
+						handled = event.ctrlKey || event.metaKey;
7977
+
7978
+						// -1 day on ctrl or command +left
7979
+						if ( event.originalEvent.altKey ) {
7980
+							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
7981
+								-$.datepicker._get( inst, "stepBigMonths" ) :
7982
+								-$.datepicker._get( inst, "stepMonths" ) ), "M" );
7983
+						}
7984
+
7985
+						// next month/year on alt +left on Mac
7986
+						break;
7987
+				case 38: if ( event.ctrlKey || event.metaKey ) {
7988
+							$.datepicker._adjustDate( event.target, -7, "D" );
7989
+						}
7990
+						handled = event.ctrlKey || event.metaKey;
7991
+						break; // -1 week on ctrl or command +up
7992
+				case 39: if ( event.ctrlKey || event.metaKey ) {
7993
+							$.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" );
7994
+						}
7995
+						handled = event.ctrlKey || event.metaKey;
7996
+
7997
+						// +1 day on ctrl or command +right
7998
+						if ( event.originalEvent.altKey ) {
7999
+							$.datepicker._adjustDate( event.target, ( event.ctrlKey ?
8000
+								+$.datepicker._get( inst, "stepBigMonths" ) :
8001
+								+$.datepicker._get( inst, "stepMonths" ) ), "M" );
8002
+						}
8003
+
8004
+						// next month/year on alt +right
8005
+						break;
8006
+				case 40: if ( event.ctrlKey || event.metaKey ) {
8007
+							$.datepicker._adjustDate( event.target, +7, "D" );
8008
+						}
8009
+						handled = event.ctrlKey || event.metaKey;
8010
+						break; // +1 week on ctrl or command +down
8011
+				default: handled = false;
8012
+			}
8013
+		} else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home
8014
+			$.datepicker._showDatepicker( this );
8015
+		} else {
8016
+			handled = false;
8017
+		}
8018
+
8019
+		if ( handled ) {
8020
+			event.preventDefault();
8021
+			event.stopPropagation();
8022
+		}
8023
+	},
8024
+
8025
+	/* Filter entered characters - based on date format. */
8026
+	_doKeyPress: function( event ) {
8027
+		var chars, chr,
8028
+			inst = $.datepicker._getInst( event.target );
8029
+
8030
+		if ( $.datepicker._get( inst, "constrainInput" ) ) {
8031
+			chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) );
8032
+			chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode );
8033
+			return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 );
8034
+		}
8035
+	},
8036
+
8037
+	/* Synchronise manual entry and field/alternate field. */
8038
+	_doKeyUp: function( event ) {
8039
+		var date,
8040
+			inst = $.datepicker._getInst( event.target );
8041
+
8042
+		if ( inst.input.val() !== inst.lastVal ) {
8043
+			try {
8044
+				date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
8045
+					( inst.input ? inst.input.val() : null ),
8046
+					$.datepicker._getFormatConfig( inst ) );
8047
+
8048
+				if ( date ) { // only if valid
8049
+					$.datepicker._setDateFromField( inst );
8050
+					$.datepicker._updateAlternate( inst );
8051
+					$.datepicker._updateDatepicker( inst );
8052
+				}
8053
+			} catch ( err ) {
8054
+			}
8055
+		}
8056
+		return true;
8057
+	},
8058
+
8059
+	/* Pop-up the date picker for a given input field.
8060
+	 * If false returned from beforeShow event handler do not show.
8061
+	 * @param  input  element - the input field attached to the date picker or
8062
+	 *					event - if triggered by focus
8063
+	 */
8064
+	_showDatepicker: function( input ) {
8065
+		input = input.target || input;
8066
+		if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger
8067
+			input = $( "input", input.parentNode )[ 0 ];
8068
+		}
8069
+
8070
+		if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here
8071
+			return;
8072
+		}
8073
+
8074
+		var inst, beforeShow, beforeShowSettings, isFixed,
8075
+			offset, showAnim, duration;
8076
+
8077
+		inst = $.datepicker._getInst( input );
8078
+		if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) {
8079
+			$.datepicker._curInst.dpDiv.stop( true, true );
8080
+			if ( inst && $.datepicker._datepickerShowing ) {
8081
+				$.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] );
8082
+			}
8083
+		}
8084
+
8085
+		beforeShow = $.datepicker._get( inst, "beforeShow" );
8086
+		beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {};
8087
+		if ( beforeShowSettings === false ) {
8088
+			return;
8089
+		}
8090
+		datepicker_extendRemove( inst.settings, beforeShowSettings );
8091
+
8092
+		inst.lastVal = null;
8093
+		$.datepicker._lastInput = input;
8094
+		$.datepicker._setDateFromField( inst );
8095
+
8096
+		if ( $.datepicker._inDialog ) { // hide cursor
8097
+			input.value = "";
8098
+		}
8099
+		if ( !$.datepicker._pos ) { // position below input
8100
+			$.datepicker._pos = $.datepicker._findPos( input );
8101
+			$.datepicker._pos[ 1 ] += input.offsetHeight; // add the height
8102
+		}
8103
+
8104
+		isFixed = false;
8105
+		$( input ).parents().each( function() {
8106
+			isFixed |= $( this ).css( "position" ) === "fixed";
8107
+			return !isFixed;
8108
+		} );
8109
+
8110
+		offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] };
8111
+		$.datepicker._pos = null;
8112
+
8113
+		//to avoid flashes on Firefox
8114
+		inst.dpDiv.empty();
8115
+
8116
+		// determine sizing offscreen
8117
+		inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } );
8118
+		$.datepicker._updateDatepicker( inst );
8119
+
8120
+		// fix width for dynamic number of date pickers
8121
+		// and adjust position before showing
8122
+		offset = $.datepicker._checkOffset( inst, offset, isFixed );
8123
+		inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ?
8124
+			"static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none",
8125
+			left: offset.left + "px", top: offset.top + "px" } );
8126
+
8127
+		if ( !inst.inline ) {
8128
+			showAnim = $.datepicker._get( inst, "showAnim" );
8129
+			duration = $.datepicker._get( inst, "duration" );
8130
+			inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 );
8131
+			$.datepicker._datepickerShowing = true;
8132
+
8133
+			if ( $.effects && $.effects.effect[ showAnim ] ) {
8134
+				inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration );
8135
+			} else {
8136
+				inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null );
8137
+			}
8138
+
8139
+			if ( $.datepicker._shouldFocusInput( inst ) ) {
8140
+				inst.input.trigger( "focus" );
8141
+			}
8142
+
8143
+			$.datepicker._curInst = inst;
8144
+		}
8145
+	},
8146
+
8147
+	/* Generate the date picker content. */
8148
+	_updateDatepicker: function( inst ) {
8149
+		this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
8150
+		datepicker_instActive = inst; // for delegate hover events
8151
+		inst.dpDiv.empty().append( this._generateHTML( inst ) );
8152
+		this._attachHandlers( inst );
8153
+
8154
+		var origyearshtml,
8155
+			numMonths = this._getNumberOfMonths( inst ),
8156
+			cols = numMonths[ 1 ],
8157
+			width = 17,
8158
+			activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ),
8159
+			onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" );
8160
+
8161
+		if ( activeCell.length > 0 ) {
8162
+			datepicker_handleMouseover.apply( activeCell.get( 0 ) );
8163
+		}
8164
+
8165
+		inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" );
8166
+		if ( cols > 1 ) {
8167
+			inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" );
8168
+		}
8169
+		inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) +
8170
+			"Class" ]( "ui-datepicker-multi" );
8171
+		inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) +
8172
+			"Class" ]( "ui-datepicker-rtl" );
8173
+
8174
+		if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) {
8175
+			inst.input.trigger( "focus" );
8176
+		}
8177
+
8178
+		// Deffered render of the years select (to avoid flashes on Firefox)
8179
+		if ( inst.yearshtml ) {
8180
+			origyearshtml = inst.yearshtml;
8181
+			setTimeout( function() {
8182
+
8183
+				//assure that inst.yearshtml didn't change.
8184
+				if ( origyearshtml === inst.yearshtml && inst.yearshtml ) {
8185
+					inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml );
8186
+				}
8187
+				origyearshtml = inst.yearshtml = null;
8188
+			}, 0 );
8189
+		}
8190
+
8191
+		if ( onUpdateDatepicker ) {
8192
+			onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] );
8193
+		}
8194
+	},
8195
+
8196
+	// #6694 - don't focus the input if it's already focused
8197
+	// this breaks the change event in IE
8198
+	// Support: IE and jQuery <1.9
8199
+	_shouldFocusInput: function( inst ) {
8200
+		return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" );
8201
+	},
8202
+
8203
+	/* Check positioning to remain on screen. */
8204
+	_checkOffset: function( inst, offset, isFixed ) {
8205
+		var dpWidth = inst.dpDiv.outerWidth(),
8206
+			dpHeight = inst.dpDiv.outerHeight(),
8207
+			inputWidth = inst.input ? inst.input.outerWidth() : 0,
8208
+			inputHeight = inst.input ? inst.input.outerHeight() : 0,
8209
+			viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ),
8210
+			viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() );
8211
+
8212
+		offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 );
8213
+		offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0;
8214
+		offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0;
8215
+
8216
+		// Now check if datepicker is showing outside window viewport - move to a better place if so.
8217
+		offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ?
8218
+			Math.abs( offset.left + dpWidth - viewWidth ) : 0 );
8219
+		offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ?
8220
+			Math.abs( dpHeight + inputHeight ) : 0 );
8221
+
8222
+		return offset;
8223
+	},
8224
+
8225
+	/* Find an object's position on the screen. */
8226
+	_findPos: function( obj ) {
8227
+		var position,
8228
+			inst = this._getInst( obj ),
8229
+			isRTL = this._get( inst, "isRTL" );
8230
+
8231
+		while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) {
8232
+			obj = obj[ isRTL ? "previousSibling" : "nextSibling" ];
8233
+		}
8234
+
8235
+		position = $( obj ).offset();
8236
+		return [ position.left, position.top ];
8237
+	},
8238
+
8239
+	/* Hide the date picker from view.
8240
+	 * @param  input  element - the input field attached to the date picker
8241
+	 */
8242
+	_hideDatepicker: function( input ) {
8243
+		var showAnim, duration, postProcess, onClose,
8244
+			inst = this._curInst;
8245
+
8246
+		if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) {
8247
+			return;
8248
+		}
8249
+
8250
+		if ( this._datepickerShowing ) {
8251
+			showAnim = this._get( inst, "showAnim" );
8252
+			duration = this._get( inst, "duration" );
8253
+			postProcess = function() {
8254
+				$.datepicker._tidyDialog( inst );
8255
+			};
8256
+
8257
+			// DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed
8258
+			if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) {
8259
+				inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess );
8260
+			} else {
8261
+				inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" :
8262
+					( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess );
8263
+			}
8264
+
8265
+			if ( !showAnim ) {
8266
+				postProcess();
8267
+			}
8268
+			this._datepickerShowing = false;
8269
+
8270
+			onClose = this._get( inst, "onClose" );
8271
+			if ( onClose ) {
8272
+				onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] );
8273
+			}
8274
+
8275
+			this._lastInput = null;
8276
+			if ( this._inDialog ) {
8277
+				this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } );
8278
+				if ( $.blockUI ) {
8279
+					$.unblockUI();
8280
+					$( "body" ).append( this.dpDiv );
8281
+				}
8282
+			}
8283
+			this._inDialog = false;
8284
+		}
8285
+	},
8286
+
8287
+	/* Tidy up after a dialog display. */
8288
+	_tidyDialog: function( inst ) {
8289
+		inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" );
8290
+	},
8291
+
8292
+	/* Close date picker if clicked elsewhere. */
8293
+	_checkExternalClick: function( event ) {
8294
+		if ( !$.datepicker._curInst ) {
8295
+			return;
8296
+		}
8297
+
8298
+		var $target = $( event.target ),
8299
+			inst = $.datepicker._getInst( $target[ 0 ] );
8300
+
8301
+		if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId &&
8302
+				$target.parents( "#" + $.datepicker._mainDivId ).length === 0 &&
8303
+				!$target.hasClass( $.datepicker.markerClassName ) &&
8304
+				!$target.closest( "." + $.datepicker._triggerClass ).length &&
8305
+				$.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) ||
8306
+			( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) {
8307
+				$.datepicker._hideDatepicker();
8308
+		}
8309
+	},
8310
+
8311
+	/* Adjust one of the date sub-fields. */
8312
+	_adjustDate: function( id, offset, period ) {
8313
+		var target = $( id ),
8314
+			inst = this._getInst( target[ 0 ] );
8315
+
8316
+		if ( this._isDisabledDatepicker( target[ 0 ] ) ) {
8317
+			return;
8318
+		}
8319
+		this._adjustInstDate( inst, offset, period );
8320
+		this._updateDatepicker( inst );
8321
+	},
8322
+
8323
+	/* Action for current link. */
8324
+	_gotoToday: function( id ) {
8325
+		var date,
8326
+			target = $( id ),
8327
+			inst = this._getInst( target[ 0 ] );
8328
+
8329
+		if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) {
8330
+			inst.selectedDay = inst.currentDay;
8331
+			inst.drawMonth = inst.selectedMonth = inst.currentMonth;
8332
+			inst.drawYear = inst.selectedYear = inst.currentYear;
8333
+		} else {
8334
+			date = new Date();
8335
+			inst.selectedDay = date.getDate();
8336
+			inst.drawMonth = inst.selectedMonth = date.getMonth();
8337
+			inst.drawYear = inst.selectedYear = date.getFullYear();
8338
+		}
8339
+		this._notifyChange( inst );
8340
+		this._adjustDate( target );
8341
+	},
8342
+
8343
+	/* Action for selecting a new month/year. */
8344
+	_selectMonthYear: function( id, select, period ) {
8345
+		var target = $( id ),
8346
+			inst = this._getInst( target[ 0 ] );
8347
+
8348
+		inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] =
8349
+		inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] =
8350
+			parseInt( select.options[ select.selectedIndex ].value, 10 );
8351
+
8352
+		this._notifyChange( inst );
8353
+		this._adjustDate( target );
8354
+	},
8355
+
8356
+	/* Action for selecting a day. */
8357
+	_selectDay: function( id, month, year, td ) {
8358
+		var inst,
8359
+			target = $( id );
8360
+
8361
+		if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) {
8362
+			return;
8363
+		}
8364
+
8365
+		inst = this._getInst( target[ 0 ] );
8366
+		inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) );
8367
+		inst.selectedMonth = inst.currentMonth = month;
8368
+		inst.selectedYear = inst.currentYear = year;
8369
+		this._selectDate( id, this._formatDate( inst,
8370
+			inst.currentDay, inst.currentMonth, inst.currentYear ) );
8371
+	},
8372
+
8373
+	/* Erase the input field and hide the date picker. */
8374
+	_clearDate: function( id ) {
8375
+		var target = $( id );
8376
+		this._selectDate( target, "" );
8377
+	},
8378
+
8379
+	/* Update the input field with the selected date. */
8380
+	_selectDate: function( id, dateStr ) {
8381
+		var onSelect,
8382
+			target = $( id ),
8383
+			inst = this._getInst( target[ 0 ] );
8384
+
8385
+		dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) );
8386
+		if ( inst.input ) {
8387
+			inst.input.val( dateStr );
8388
+		}
8389
+		this._updateAlternate( inst );
8390
+
8391
+		onSelect = this._get( inst, "onSelect" );
8392
+		if ( onSelect ) {
8393
+			onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] );  // trigger custom callback
8394
+		} else if ( inst.input ) {
8395
+			inst.input.trigger( "change" ); // fire the change event
8396
+		}
8397
+
8398
+		if ( inst.inline ) {
8399
+			this._updateDatepicker( inst );
8400
+		} else {
8401
+			this._hideDatepicker();
8402
+			this._lastInput = inst.input[ 0 ];
8403
+			if ( typeof( inst.input[ 0 ] ) !== "object" ) {
8404
+				inst.input.trigger( "focus" ); // restore focus
8405
+			}
8406
+			this._lastInput = null;
8407
+		}
8408
+	},
8409
+
8410
+	/* Update any alternate field to synchronise with the main field. */
8411
+	_updateAlternate: function( inst ) {
8412
+		var altFormat, date, dateStr,
8413
+			altField = this._get( inst, "altField" );
8414
+
8415
+		if ( altField ) { // update alternate field too
8416
+			altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" );
8417
+			date = this._getDate( inst );
8418
+			dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) );
8419
+			$( document ).find( altField ).val( dateStr );
8420
+		}
8421
+	},
8422
+
8423
+	/* Set as beforeShowDay function to prevent selection of weekends.
8424
+	 * @param  date  Date - the date to customise
8425
+	 * @return [boolean, string] - is this date selectable?, what is its CSS class?
8426
+	 */
8427
+	noWeekends: function( date ) {
8428
+		var day = date.getDay();
8429
+		return [ ( day > 0 && day < 6 ), "" ];
8430
+	},
8431
+
8432
+	/* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
8433
+	 * @param  date  Date - the date to get the week for
8434
+	 * @return  number - the number of the week within the year that contains this date
8435
+	 */
8436
+	iso8601Week: function( date ) {
8437
+		var time,
8438
+			checkDate = new Date( date.getTime() );
8439
+
8440
+		// Find Thursday of this week starting on Monday
8441
+		checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) );
8442
+
8443
+		time = checkDate.getTime();
8444
+		checkDate.setMonth( 0 ); // Compare with Jan 1
8445
+		checkDate.setDate( 1 );
8446
+		return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1;
8447
+	},
8448
+
8449
+	/* Parse a string value into a date object.
8450
+	 * See formatDate below for the possible formats.
8451
+	 *
8452
+	 * @param  format string - the expected format of the date
8453
+	 * @param  value string - the date in the above format
8454
+	 * @param  settings Object - attributes include:
8455
+	 *					shortYearCutoff  number - the cutoff year for determining the century (optional)
8456
+	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
8457
+	 *					dayNames		string[7] - names of the days from Sunday (optional)
8458
+	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
8459
+	 *					monthNames		string[12] - names of the months (optional)
8460
+	 * @return  Date - the extracted date value or null if value is blank
8461
+	 */
8462
+	parseDate: function( format, value, settings ) {
8463
+		if ( format == null || value == null ) {
8464
+			throw "Invalid arguments";
8465
+		}
8466
+
8467
+		value = ( typeof value === "object" ? value.toString() : value + "" );
8468
+		if ( value === "" ) {
8469
+			return null;
8470
+		}
8471
+
8472
+		var iFormat, dim, extra,
8473
+			iValue = 0,
8474
+			shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff,
8475
+			shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp :
8476
+				new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ),
8477
+			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
8478
+			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
8479
+			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
8480
+			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
8481
+			year = -1,
8482
+			month = -1,
8483
+			day = -1,
8484
+			doy = -1,
8485
+			literal = false,
8486
+			date,
8487
+
8488
+			// Check whether a format character is doubled
8489
+			lookAhead = function( match ) {
8490
+				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
8491
+				if ( matches ) {
8492
+					iFormat++;
8493
+				}
8494
+				return matches;
8495
+			},
8496
+
8497
+			// Extract a number from the string value
8498
+			getNumber = function( match ) {
8499
+				var isDoubled = lookAhead( match ),
8500
+					size = ( match === "@" ? 14 : ( match === "!" ? 20 :
8501
+					( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ),
8502
+					minSize = ( match === "y" ? size : 1 ),
8503
+					digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ),
8504
+					num = value.substring( iValue ).match( digits );
8505
+				if ( !num ) {
8506
+					throw "Missing number at position " + iValue;
8507
+				}
8508
+				iValue += num[ 0 ].length;
8509
+				return parseInt( num[ 0 ], 10 );
8510
+			},
8511
+
8512
+			// Extract a name from the string value and convert to an index
8513
+			getName = function( match, shortNames, longNames ) {
8514
+				var index = -1,
8515
+					names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) {
8516
+						return [ [ k, v ] ];
8517
+					} ).sort( function( a, b ) {
8518
+						return -( a[ 1 ].length - b[ 1 ].length );
8519
+					} );
8520
+
8521
+				$.each( names, function( i, pair ) {
8522
+					var name = pair[ 1 ];
8523
+					if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) {
8524
+						index = pair[ 0 ];
8525
+						iValue += name.length;
8526
+						return false;
8527
+					}
8528
+				} );
8529
+				if ( index !== -1 ) {
8530
+					return index + 1;
8531
+				} else {
8532
+					throw "Unknown name at position " + iValue;
8533
+				}
8534
+			},
8535
+
8536
+			// Confirm that a literal character matches the string value
8537
+			checkLiteral = function() {
8538
+				if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) {
8539
+					throw "Unexpected literal at position " + iValue;
8540
+				}
8541
+				iValue++;
8542
+			};
8543
+
8544
+		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
8545
+			if ( literal ) {
8546
+				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
8547
+					literal = false;
8548
+				} else {
8549
+					checkLiteral();
8550
+				}
8551
+			} else {
8552
+				switch ( format.charAt( iFormat ) ) {
8553
+					case "d":
8554
+						day = getNumber( "d" );
8555
+						break;
8556
+					case "D":
8557
+						getName( "D", dayNamesShort, dayNames );
8558
+						break;
8559
+					case "o":
8560
+						doy = getNumber( "o" );
8561
+						break;
8562
+					case "m":
8563
+						month = getNumber( "m" );
8564
+						break;
8565
+					case "M":
8566
+						month = getName( "M", monthNamesShort, monthNames );
8567
+						break;
8568
+					case "y":
8569
+						year = getNumber( "y" );
8570
+						break;
8571
+					case "@":
8572
+						date = new Date( getNumber( "@" ) );
8573
+						year = date.getFullYear();
8574
+						month = date.getMonth() + 1;
8575
+						day = date.getDate();
8576
+						break;
8577
+					case "!":
8578
+						date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 );
8579
+						year = date.getFullYear();
8580
+						month = date.getMonth() + 1;
8581
+						day = date.getDate();
8582
+						break;
8583
+					case "'":
8584
+						if ( lookAhead( "'" ) ) {
8585
+							checkLiteral();
8586
+						} else {
8587
+							literal = true;
8588
+						}
8589
+						break;
8590
+					default:
8591
+						checkLiteral();
8592
+				}
8593
+			}
8594
+		}
8595
+
8596
+		if ( iValue < value.length ) {
8597
+			extra = value.substr( iValue );
8598
+			if ( !/^\s+/.test( extra ) ) {
8599
+				throw "Extra/unparsed characters found in date: " + extra;
8600
+			}
8601
+		}
8602
+
8603
+		if ( year === -1 ) {
8604
+			year = new Date().getFullYear();
8605
+		} else if ( year < 100 ) {
8606
+			year += new Date().getFullYear() - new Date().getFullYear() % 100 +
8607
+				( year <= shortYearCutoff ? 0 : -100 );
8608
+		}
8609
+
8610
+		if ( doy > -1 ) {
8611
+			month = 1;
8612
+			day = doy;
8613
+			do {
8614
+				dim = this._getDaysInMonth( year, month - 1 );
8615
+				if ( day <= dim ) {
8616
+					break;
8617
+				}
8618
+				month++;
8619
+				day -= dim;
8620
+			} while ( true );
8621
+		}
8622
+
8623
+		date = this._daylightSavingAdjust( new Date( year, month - 1, day ) );
8624
+		if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) {
8625
+			throw "Invalid date"; // E.g. 31/02/00
8626
+		}
8627
+		return date;
8628
+	},
8629
+
8630
+	/* Standard date formats. */
8631
+	ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601)
8632
+	COOKIE: "D, dd M yy",
8633
+	ISO_8601: "yy-mm-dd",
8634
+	RFC_822: "D, d M y",
8635
+	RFC_850: "DD, dd-M-y",
8636
+	RFC_1036: "D, d M y",
8637
+	RFC_1123: "D, d M yy",
8638
+	RFC_2822: "D, d M yy",
8639
+	RSS: "D, d M y", // RFC 822
8640
+	TICKS: "!",
8641
+	TIMESTAMP: "@",
8642
+	W3C: "yy-mm-dd", // ISO 8601
8643
+
8644
+	_ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) +
8645
+		Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ),
8646
+
8647
+	/* Format a date object into a string value.
8648
+	 * The format can be combinations of the following:
8649
+	 * d  - day of month (no leading zero)
8650
+	 * dd - day of month (two digit)
8651
+	 * o  - day of year (no leading zeros)
8652
+	 * oo - day of year (three digit)
8653
+	 * D  - day name short
8654
+	 * DD - day name long
8655
+	 * m  - month of year (no leading zero)
8656
+	 * mm - month of year (two digit)
8657
+	 * M  - month name short
8658
+	 * MM - month name long
8659
+	 * y  - year (two digit)
8660
+	 * yy - year (four digit)
8661
+	 * @ - Unix timestamp (ms since 01/01/1970)
8662
+	 * ! - Windows ticks (100ns since 01/01/0001)
8663
+	 * "..." - literal text
8664
+	 * '' - single quote
8665
+	 *
8666
+	 * @param  format string - the desired format of the date
8667
+	 * @param  date Date - the date value to format
8668
+	 * @param  settings Object - attributes include:
8669
+	 *					dayNamesShort	string[7] - abbreviated names of the days from Sunday (optional)
8670
+	 *					dayNames		string[7] - names of the days from Sunday (optional)
8671
+	 *					monthNamesShort string[12] - abbreviated names of the months (optional)
8672
+	 *					monthNames		string[12] - names of the months (optional)
8673
+	 * @return  string - the date in the above format
8674
+	 */
8675
+	formatDate: function( format, date, settings ) {
8676
+		if ( !date ) {
8677
+			return "";
8678
+		}
8679
+
8680
+		var iFormat,
8681
+			dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort,
8682
+			dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames,
8683
+			monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort,
8684
+			monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames,
8685
+
8686
+			// Check whether a format character is doubled
8687
+			lookAhead = function( match ) {
8688
+				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
8689
+				if ( matches ) {
8690
+					iFormat++;
8691
+				}
8692
+				return matches;
8693
+			},
8694
+
8695
+			// Format a number, with leading zero if necessary
8696
+			formatNumber = function( match, value, len ) {
8697
+				var num = "" + value;
8698
+				if ( lookAhead( match ) ) {
8699
+					while ( num.length < len ) {
8700
+						num = "0" + num;
8701
+					}
8702
+				}
8703
+				return num;
8704
+			},
8705
+
8706
+			// Format a name, short or long as requested
8707
+			formatName = function( match, value, shortNames, longNames ) {
8708
+				return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] );
8709
+			},
8710
+			output = "",
8711
+			literal = false;
8712
+
8713
+		if ( date ) {
8714
+			for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
8715
+				if ( literal ) {
8716
+					if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
8717
+						literal = false;
8718
+					} else {
8719
+						output += format.charAt( iFormat );
8720
+					}
8721
+				} else {
8722
+					switch ( format.charAt( iFormat ) ) {
8723
+						case "d":
8724
+							output += formatNumber( "d", date.getDate(), 2 );
8725
+							break;
8726
+						case "D":
8727
+							output += formatName( "D", date.getDay(), dayNamesShort, dayNames );
8728
+							break;
8729
+						case "o":
8730
+							output += formatNumber( "o",
8731
+								Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 );
8732
+							break;
8733
+						case "m":
8734
+							output += formatNumber( "m", date.getMonth() + 1, 2 );
8735
+							break;
8736
+						case "M":
8737
+							output += formatName( "M", date.getMonth(), monthNamesShort, monthNames );
8738
+							break;
8739
+						case "y":
8740
+							output += ( lookAhead( "y" ) ? date.getFullYear() :
8741
+								( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 );
8742
+							break;
8743
+						case "@":
8744
+							output += date.getTime();
8745
+							break;
8746
+						case "!":
8747
+							output += date.getTime() * 10000 + this._ticksTo1970;
8748
+							break;
8749
+						case "'":
8750
+							if ( lookAhead( "'" ) ) {
8751
+								output += "'";
8752
+							} else {
8753
+								literal = true;
8754
+							}
8755
+							break;
8756
+						default:
8757
+							output += format.charAt( iFormat );
8758
+					}
8759
+				}
8760
+			}
8761
+		}
8762
+		return output;
8763
+	},
8764
+
8765
+	/* Extract all possible characters from the date format. */
8766
+	_possibleChars: function( format ) {
8767
+		var iFormat,
8768
+			chars = "",
8769
+			literal = false,
8770
+
8771
+			// Check whether a format character is doubled
8772
+			lookAhead = function( match ) {
8773
+				var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match );
8774
+				if ( matches ) {
8775
+					iFormat++;
8776
+				}
8777
+				return matches;
8778
+			};
8779
+
8780
+		for ( iFormat = 0; iFormat < format.length; iFormat++ ) {
8781
+			if ( literal ) {
8782
+				if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) {
8783
+					literal = false;
8784
+				} else {
8785
+					chars += format.charAt( iFormat );
8786
+				}
8787
+			} else {
8788
+				switch ( format.charAt( iFormat ) ) {
8789
+					case "d": case "m": case "y": case "@":
8790
+						chars += "0123456789";
8791
+						break;
8792
+					case "D": case "M":
8793
+						return null; // Accept anything
8794
+					case "'":
8795
+						if ( lookAhead( "'" ) ) {
8796
+							chars += "'";
8797
+						} else {
8798
+							literal = true;
8799
+						}
8800
+						break;
8801
+					default:
8802
+						chars += format.charAt( iFormat );
8803
+				}
8804
+			}
8805
+		}
8806
+		return chars;
8807
+	},
8808
+
8809
+	/* Get a setting value, defaulting if necessary. */
8810
+	_get: function( inst, name ) {
8811
+		return inst.settings[ name ] !== undefined ?
8812
+			inst.settings[ name ] : this._defaults[ name ];
8813
+	},
8814
+
8815
+	/* Parse existing date and initialise date picker. */
8816
+	_setDateFromField: function( inst, noDefault ) {
8817
+		if ( inst.input.val() === inst.lastVal ) {
8818
+			return;
8819
+		}
8820
+
8821
+		var dateFormat = this._get( inst, "dateFormat" ),
8822
+			dates = inst.lastVal = inst.input ? inst.input.val() : null,
8823
+			defaultDate = this._getDefaultDate( inst ),
8824
+			date = defaultDate,
8825
+			settings = this._getFormatConfig( inst );
8826
+
8827
+		try {
8828
+			date = this.parseDate( dateFormat, dates, settings ) || defaultDate;
8829
+		} catch ( event ) {
8830
+			dates = ( noDefault ? "" : dates );
8831
+		}
8832
+		inst.selectedDay = date.getDate();
8833
+		inst.drawMonth = inst.selectedMonth = date.getMonth();
8834
+		inst.drawYear = inst.selectedYear = date.getFullYear();
8835
+		inst.currentDay = ( dates ? date.getDate() : 0 );
8836
+		inst.currentMonth = ( dates ? date.getMonth() : 0 );
8837
+		inst.currentYear = ( dates ? date.getFullYear() : 0 );
8838
+		this._adjustInstDate( inst );
8839
+	},
8840
+
8841
+	/* Retrieve the default date shown on opening. */
8842
+	_getDefaultDate: function( inst ) {
8843
+		return this._restrictMinMax( inst,
8844
+			this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) );
8845
+	},
8846
+
8847
+	/* A date may be specified as an exact value or a relative one. */
8848
+	_determineDate: function( inst, date, defaultDate ) {
8849
+		var offsetNumeric = function( offset ) {
8850
+				var date = new Date();
8851
+				date.setDate( date.getDate() + offset );
8852
+				return date;
8853
+			},
8854
+			offsetString = function( offset ) {
8855
+				try {
8856
+					return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ),
8857
+						offset, $.datepicker._getFormatConfig( inst ) );
8858
+				} catch ( e ) {
8859
+
8860
+					// Ignore
8861
+				}
8862
+
8863
+				var date = ( offset.toLowerCase().match( /^c/ ) ?
8864
+					$.datepicker._getDate( inst ) : null ) || new Date(),
8865
+					year = date.getFullYear(),
8866
+					month = date.getMonth(),
8867
+					day = date.getDate(),
8868
+					pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
8869
+					matches = pattern.exec( offset );
8870
+
8871
+				while ( matches ) {
8872
+					switch ( matches[ 2 ] || "d" ) {
8873
+						case "d" : case "D" :
8874
+							day += parseInt( matches[ 1 ], 10 ); break;
8875
+						case "w" : case "W" :
8876
+							day += parseInt( matches[ 1 ], 10 ) * 7; break;
8877
+						case "m" : case "M" :
8878
+							month += parseInt( matches[ 1 ], 10 );
8879
+							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
8880
+							break;
8881
+						case "y": case "Y" :
8882
+							year += parseInt( matches[ 1 ], 10 );
8883
+							day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) );
8884
+							break;
8885
+					}
8886
+					matches = pattern.exec( offset );
8887
+				}
8888
+				return new Date( year, month, day );
8889
+			},
8890
+			newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) :
8891
+				( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) );
8892
+
8893
+		newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate );
8894
+		if ( newDate ) {
8895
+			newDate.setHours( 0 );
8896
+			newDate.setMinutes( 0 );
8897
+			newDate.setSeconds( 0 );
8898
+			newDate.setMilliseconds( 0 );
8899
+		}
8900
+		return this._daylightSavingAdjust( newDate );
8901
+	},
8902
+
8903
+	/* Handle switch to/from daylight saving.
8904
+	 * Hours may be non-zero on daylight saving cut-over:
8905
+	 * > 12 when midnight changeover, but then cannot generate
8906
+	 * midnight datetime, so jump to 1AM, otherwise reset.
8907
+	 * @param  date  (Date) the date to check
8908
+	 * @return  (Date) the corrected date
8909
+	 */
8910
+	_daylightSavingAdjust: function( date ) {
8911
+		if ( !date ) {
8912
+			return null;
8913
+		}
8914
+		date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 );
8915
+		return date;
8916
+	},
8917
+
8918
+	/* Set the date(s) directly. */
8919
+	_setDate: function( inst, date, noChange ) {
8920
+		var clear = !date,
8921
+			origMonth = inst.selectedMonth,
8922
+			origYear = inst.selectedYear,
8923
+			newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) );
8924
+
8925
+		inst.selectedDay = inst.currentDay = newDate.getDate();
8926
+		inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
8927
+		inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
8928
+		if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) {
8929
+			this._notifyChange( inst );
8930
+		}
8931
+		this._adjustInstDate( inst );
8932
+		if ( inst.input ) {
8933
+			inst.input.val( clear ? "" : this._formatDate( inst ) );
8934
+		}
8935
+	},
8936
+
8937
+	/* Retrieve the date(s) directly. */
8938
+	_getDate: function( inst ) {
8939
+		var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null :
8940
+			this._daylightSavingAdjust( new Date(
8941
+			inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
8942
+			return startDate;
8943
+	},
8944
+
8945
+	/* Attach the onxxx handlers.  These are declared statically so
8946
+	 * they work with static code transformers like Caja.
8947
+	 */
8948
+	_attachHandlers: function( inst ) {
8949
+		var stepMonths = this._get( inst, "stepMonths" ),
8950
+			id = "#" + inst.id.replace( /\\\\/g, "\\" );
8951
+		inst.dpDiv.find( "[data-handler]" ).map( function() {
8952
+			var handler = {
8953
+				prev: function() {
8954
+					$.datepicker._adjustDate( id, -stepMonths, "M" );
8955
+				},
8956
+				next: function() {
8957
+					$.datepicker._adjustDate( id, +stepMonths, "M" );
8958
+				},
8959
+				hide: function() {
8960
+					$.datepicker._hideDatepicker();
8961
+				},
8962
+				today: function() {
8963
+					$.datepicker._gotoToday( id );
8964
+				},
8965
+				selectDay: function() {
8966
+					$.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this );
8967
+					return false;
8968
+				},
8969
+				selectMonth: function() {
8970
+					$.datepicker._selectMonthYear( id, this, "M" );
8971
+					return false;
8972
+				},
8973
+				selectYear: function() {
8974
+					$.datepicker._selectMonthYear( id, this, "Y" );
8975
+					return false;
8976
+				}
8977
+			};
8978
+			$( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] );
8979
+		} );
8980
+	},
8981
+
8982
+	/* Generate the HTML for the current state of the date picker. */
8983
+	_generateHTML: function( inst ) {
8984
+		var maxDraw, prevText, prev, nextText, next, currentText, gotoDate,
8985
+			controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin,
8986
+			monthNames, monthNamesShort, beforeShowDay, showOtherMonths,
8987
+			selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate,
8988
+			cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows,
8989
+			printDate, dRow, tbody, daySettings, otherMonth, unselectable,
8990
+			tempDate = new Date(),
8991
+			today = this._daylightSavingAdjust(
8992
+				new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time
8993
+			isRTL = this._get( inst, "isRTL" ),
8994
+			showButtonPanel = this._get( inst, "showButtonPanel" ),
8995
+			hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ),
8996
+			navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ),
8997
+			numMonths = this._getNumberOfMonths( inst ),
8998
+			showCurrentAtPos = this._get( inst, "showCurrentAtPos" ),
8999
+			stepMonths = this._get( inst, "stepMonths" ),
9000
+			isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ),
9001
+			currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) :
9002
+				new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ),
9003
+			minDate = this._getMinMaxDate( inst, "min" ),
9004
+			maxDate = this._getMinMaxDate( inst, "max" ),
9005
+			drawMonth = inst.drawMonth - showCurrentAtPos,
9006
+			drawYear = inst.drawYear;
9007
+
9008
+		if ( drawMonth < 0 ) {
9009
+			drawMonth += 12;
9010
+			drawYear--;
9011
+		}
9012
+		if ( maxDate ) {
9013
+			maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(),
9014
+				maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) );
9015
+			maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw );
9016
+			while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) {
9017
+				drawMonth--;
9018
+				if ( drawMonth < 0 ) {
9019
+					drawMonth = 11;
9020
+					drawYear--;
9021
+				}
9022
+			}
9023
+		}
9024
+		inst.drawMonth = drawMonth;
9025
+		inst.drawYear = drawYear;
9026
+
9027
+		prevText = this._get( inst, "prevText" );
9028
+		prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText,
9029
+			this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ),
9030
+			this._getFormatConfig( inst ) ) );
9031
+
9032
+		if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) {
9033
+			prev = $( "<a>" )
9034
+				.attr( {
9035
+					"class": "ui-datepicker-prev ui-corner-all",
9036
+					"data-handler": "prev",
9037
+					"data-event": "click",
9038
+					title: prevText
9039
+				} )
9040
+				.append(
9041
+					$( "<span>" )
9042
+						.addClass( "ui-icon ui-icon-circle-triangle-" +
9043
+							( isRTL ? "e" : "w" ) )
9044
+						.text( prevText )
9045
+				)[ 0 ].outerHTML;
9046
+		} else if ( hideIfNoPrevNext ) {
9047
+			prev = "";
9048
+		} else {
9049
+			prev = $( "<a>" )
9050
+				.attr( {
9051
+					"class": "ui-datepicker-prev ui-corner-all ui-state-disabled",
9052
+					title: prevText
9053
+				} )
9054
+				.append(
9055
+					$( "<span>" )
9056
+						.addClass( "ui-icon ui-icon-circle-triangle-" +
9057
+							( isRTL ? "e" : "w" ) )
9058
+						.text( prevText )
9059
+				)[ 0 ].outerHTML;
9060
+		}
9061
+
9062
+		nextText = this._get( inst, "nextText" );
9063
+		nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText,
9064
+			this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ),
9065
+			this._getFormatConfig( inst ) ) );
9066
+
9067
+		if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) {
9068
+			next = $( "<a>" )
9069
+				.attr( {
9070
+					"class": "ui-datepicker-next ui-corner-all",
9071
+					"data-handler": "next",
9072
+					"data-event": "click",
9073
+					title: nextText
9074
+				} )
9075
+				.append(
9076
+					$( "<span>" )
9077
+						.addClass( "ui-icon ui-icon-circle-triangle-" +
9078
+							( isRTL ? "w" : "e" ) )
9079
+						.text( nextText )
9080
+				)[ 0 ].outerHTML;
9081
+		} else if ( hideIfNoPrevNext ) {
9082
+			next = "";
9083
+		} else {
9084
+			next = $( "<a>" )
9085
+				.attr( {
9086
+					"class": "ui-datepicker-next ui-corner-all ui-state-disabled",
9087
+					title: nextText
9088
+				} )
9089
+				.append(
9090
+					$( "<span>" )
9091
+						.attr( "class", "ui-icon ui-icon-circle-triangle-" +
9092
+							( isRTL ? "w" : "e" ) )
9093
+						.text( nextText )
9094
+				)[ 0 ].outerHTML;
9095
+		}
9096
+
9097
+		currentText = this._get( inst, "currentText" );
9098
+		gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today );
9099
+		currentText = ( !navigationAsDateFormat ? currentText :
9100
+			this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) );
9101
+
9102
+		controls = "";
9103
+		if ( !inst.inline ) {
9104
+			controls = $( "<button>" )
9105
+				.attr( {
9106
+					type: "button",
9107
+					"class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
9108
+					"data-handler": "hide",
9109
+					"data-event": "click"
9110
+				} )
9111
+				.text( this._get( inst, "closeText" ) )[ 0 ].outerHTML;
9112
+		}
9113
+
9114
+		buttonPanel = "";
9115
+		if ( showButtonPanel ) {
9116
+			buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" )
9117
+				.append( isRTL ? controls : "" )
9118
+				.append( this._isInRange( inst, gotoDate ) ?
9119
+					$( "<button>" )
9120
+						.attr( {
9121
+							type: "button",
9122
+							"class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
9123
+							"data-handler": "today",
9124
+							"data-event": "click"
9125
+						} )
9126
+						.text( currentText ) :
9127
+					"" )
9128
+				.append( isRTL ? "" : controls )[ 0 ].outerHTML;
9129
+		}
9130
+
9131
+		firstDay = parseInt( this._get( inst, "firstDay" ), 10 );
9132
+		firstDay = ( isNaN( firstDay ) ? 0 : firstDay );
9133
+
9134
+		showWeek = this._get( inst, "showWeek" );
9135
+		dayNames = this._get( inst, "dayNames" );
9136
+		dayNamesMin = this._get( inst, "dayNamesMin" );
9137
+		monthNames = this._get( inst, "monthNames" );
9138
+		monthNamesShort = this._get( inst, "monthNamesShort" );
9139
+		beforeShowDay = this._get( inst, "beforeShowDay" );
9140
+		showOtherMonths = this._get( inst, "showOtherMonths" );
9141
+		selectOtherMonths = this._get( inst, "selectOtherMonths" );
9142
+		defaultDate = this._getDefaultDate( inst );
9143
+		html = "";
9144
+
9145
+		for ( row = 0; row < numMonths[ 0 ]; row++ ) {
9146
+			group = "";
9147
+			this.maxRows = 4;
9148
+			for ( col = 0; col < numMonths[ 1 ]; col++ ) {
9149
+				selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) );
9150
+				cornerClass = " ui-corner-all";
9151
+				calender = "";
9152
+				if ( isMultiMonth ) {
9153
+					calender += "<div class='ui-datepicker-group";
9154
+					if ( numMonths[ 1 ] > 1 ) {
9155
+						switch ( col ) {
9156
+							case 0: calender += " ui-datepicker-group-first";
9157
+								cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break;
9158
+							case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last";
9159
+								cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break;
9160
+							default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break;
9161
+						}
9162
+					}
9163
+					calender += "'>";
9164
+				}
9165
+				calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" +
9166
+					( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) +
9167
+					( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) +
9168
+					this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate,
9169
+					row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers
9170
+					"</div><table class='ui-datepicker-calendar'><thead>" +
9171
+					"<tr>";
9172
+				thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" );
9173
+				for ( dow = 0; dow < 7; dow++ ) { // days of the week
9174
+					day = ( dow + firstDay ) % 7;
9175
+					thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" +
9176
+						"<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>";
9177
+				}
9178
+				calender += thead + "</tr></thead><tbody>";
9179
+				daysInMonth = this._getDaysInMonth( drawYear, drawMonth );
9180
+				if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) {
9181
+					inst.selectedDay = Math.min( inst.selectedDay, daysInMonth );
9182
+				}
9183
+				leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7;
9184
+				curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate
9185
+				numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043)
9186
+				this.maxRows = numRows;
9187
+				printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) );
9188
+				for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows
9189
+					calender += "<tr>";
9190
+					tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" +
9191
+						this._get( inst, "calculateWeek" )( printDate ) + "</td>" );
9192
+					for ( dow = 0; dow < 7; dow++ ) { // create date picker days
9193
+						daySettings = ( beforeShowDay ?
9194
+							beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] );
9195
+						otherMonth = ( printDate.getMonth() !== drawMonth );
9196
+						unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] ||
9197
+							( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate );
9198
+						tbody += "<td class='" +
9199
+							( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends
9200
+							( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months
9201
+							( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key
9202
+							( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ?
9203
+
9204
+							// or defaultDate is current printedDate and defaultDate is selectedDate
9205
+							" " + this._dayOverClass : "" ) + // highlight selected day
9206
+							( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) +  // highlight unselectable days
9207
+							( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates
9208
+							( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day
9209
+							( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different)
9210
+							( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "&#39;" ) + "'" : "" ) + // cell title
9211
+							( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions
9212
+							( otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months
9213
+							( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" +
9214
+							( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) +
9215
+							( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day
9216
+							( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months
9217
+							"' href='#' aria-current='" + ( printDate.getTime() === currentDate.getTime() ? "true" : "false" ) + // mark date as selected for screen reader
9218
+							"' data-date='" + printDate.getDate() + // store date as data
9219
+							"'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date
9220
+						printDate.setDate( printDate.getDate() + 1 );
9221
+						printDate = this._daylightSavingAdjust( printDate );
9222
+					}
9223
+					calender += tbody + "</tr>";
9224
+				}
9225
+				drawMonth++;
9226
+				if ( drawMonth > 11 ) {
9227
+					drawMonth = 0;
9228
+					drawYear++;
9229
+				}
9230
+				calender += "</tbody></table>" + ( isMultiMonth ? "</div>" +
9231
+							( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" );
9232
+				group += calender;
9233
+			}
9234
+			html += group;
9235
+		}
9236
+		html += buttonPanel;
9237
+		inst._keyEvent = false;
9238
+		return html;
9239
+	},
7114 9240
 
7115
-				handle = $.trim(n[i]);
7116
-				hname = "ui-resizable-" + handle;
7117
-				axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
9241
+	/* Generate the month and year header. */
9242
+	_generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate,
9243
+			secondary, monthNames, monthNamesShort ) {
7118 9244
 
7119
-				axis.css({ zIndex: o.zIndex });
9245
+		var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
9246
+			changeMonth = this._get( inst, "changeMonth" ),
9247
+			changeYear = this._get( inst, "changeYear" ),
9248
+			showMonthAfterYear = this._get( inst, "showMonthAfterYear" ),
9249
+			selectMonthLabel = this._get( inst, "selectMonthLabel" ),
9250
+			selectYearLabel = this._get( inst, "selectYearLabel" ),
9251
+			html = "<div class='ui-datepicker-title'>",
9252
+			monthHtml = "";
7120 9253
 
7121
-				// TODO : What's going on here?
7122
-				if ("se" === handle) {
7123
-					axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");
9254
+		// Month selection
9255
+		if ( secondary || !changeMonth ) {
9256
+			monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>";
9257
+		} else {
9258
+			inMinYear = ( minDate && minDate.getFullYear() === drawYear );
9259
+			inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear );
9260
+			monthHtml += "<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>";
9261
+			for ( month = 0; month < 12; month++ ) {
9262
+				if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) {
9263
+					monthHtml += "<option value='" + month + "'" +
9264
+						( month === drawMonth ? " selected='selected'" : "" ) +
9265
+						">" + monthNamesShort[ month ] + "</option>";
7124 9266
 				}
7125
-
7126
-				this.handles[handle] = ".ui-resizable-" + handle;
7127
-				this.element.append(axis);
7128 9267
 			}
7129
-
9268
+			monthHtml += "</select>";
7130 9269
 		}
7131 9270
 
7132
-		this._renderAxis = function(target) {
9271
+		if ( !showMonthAfterYear ) {
9272
+			html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" );
9273
+		}
7133 9274
 
7134
-			var i, axis, padPos, padWrapper;
9275
+		// Year selection
9276
+		if ( !inst.yearshtml ) {
9277
+			inst.yearshtml = "";
9278
+			if ( secondary || !changeYear ) {
9279
+				html += "<span class='ui-datepicker-year'>" + drawYear + "</span>";
9280
+			} else {
7135 9281
 
7136
-			target = target || this.element;
9282
+				// determine range of years to display
9283
+				years = this._get( inst, "yearRange" ).split( ":" );
9284
+				thisYear = new Date().getFullYear();
9285
+				determineYear = function( value ) {
9286
+					var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) :
9287
+						( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) :
9288
+						parseInt( value, 10 ) ) );
9289
+					return ( isNaN( year ) ? thisYear : year );
9290
+				};
9291
+				year = determineYear( years[ 0 ] );
9292
+				endYear = Math.max( year, determineYear( years[ 1 ] || "" ) );
9293
+				year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year );
9294
+				endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear );
9295
+				inst.yearshtml += "<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>";
9296
+				for ( ; year <= endYear; year++ ) {
9297
+					inst.yearshtml += "<option value='" + year + "'" +
9298
+						( year === drawYear ? " selected='selected'" : "" ) +
9299
+						">" + year + "</option>";
9300
+				}
9301
+				inst.yearshtml += "</select>";
7137 9302
 
7138
-			for (i in this.handles) {
9303
+				html += inst.yearshtml;
9304
+				inst.yearshtml = null;
9305
+			}
9306
+		}
7139 9307
 
7140
-				if (this.handles[i].constructor === String) {
7141
-					this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
7142
-				} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
7143
-					this.handles[ i ] = $( this.handles[ i ] );
7144
-					this._on( this.handles[ i ], { "mousedown": that._mouseDown });
9308
+		html += this._get( inst, "yearSuffix" );
9309
+		if ( showMonthAfterYear ) {
9310
+			html += ( secondary || !( changeMonth && changeYear ) ? "&#xa0;" : "" ) + monthHtml;
7145 9311
 		}
9312
+		html += "</div>"; // Close datepicker_header
9313
+		return html;
9314
+	},
7146 9315
 
7147
-				if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
9316
+	/* Adjust one of the date sub-fields. */
9317
+	_adjustInstDate: function( inst, offset, period ) {
9318
+		var year = inst.selectedYear + ( period === "Y" ? offset : 0 ),
9319
+			month = inst.selectedMonth + ( period === "M" ? offset : 0 ),
9320
+			day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ),
9321
+			date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) );
7148 9322
 
7149
-					axis = $(this.handles[i], this.element);
9323
+		inst.selectedDay = date.getDate();
9324
+		inst.drawMonth = inst.selectedMonth = date.getMonth();
9325
+		inst.drawYear = inst.selectedYear = date.getFullYear();
9326
+		if ( period === "M" || period === "Y" ) {
9327
+			this._notifyChange( inst );
9328
+		}
9329
+	},
7150 9330
 
7151
-					padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
9331
+	/* Ensure a date is within any min/max bounds. */
9332
+	_restrictMinMax: function( inst, date ) {
9333
+		var minDate = this._getMinMaxDate( inst, "min" ),
9334
+			maxDate = this._getMinMaxDate( inst, "max" ),
9335
+			newDate = ( minDate && date < minDate ? minDate : date );
9336
+		return ( maxDate && newDate > maxDate ? maxDate : newDate );
9337
+	},
7152 9338
 
7153
-					padPos = [ "padding",
7154
-						/ne|nw|n/.test(i) ? "Top" :
7155
-						/se|sw|s/.test(i) ? "Bottom" :
7156
-						/^e$/.test(i) ? "Right" : "Left" ].join("");
9339
+	/* Notify change of month/year. */
9340
+	_notifyChange: function( inst ) {
9341
+		var onChange = this._get( inst, "onChangeMonthYear" );
9342
+		if ( onChange ) {
9343
+			onChange.apply( ( inst.input ? inst.input[ 0 ] : null ),
9344
+				[ inst.selectedYear, inst.selectedMonth + 1, inst ] );
9345
+		}
9346
+	},
7157 9347
 
7158
-					target.css(padPos, padWrapper);
9348
+	/* Determine the number of months to show. */
9349
+	_getNumberOfMonths: function( inst ) {
9350
+		var numMonths = this._get( inst, "numberOfMonths" );
9351
+		return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) );
9352
+	},
7159 9353
 
7160
-					this._proportionallyResize();
7161
-				}
9354
+	/* Determine the current maximum date - ensure no time components are set. */
9355
+	_getMinMaxDate: function( inst, minMax ) {
9356
+		return this._determineDate( inst, this._get( inst, minMax + "Date" ), null );
9357
+	},
7162 9358
 
7163
-				this._handles = this._handles.add( this.handles[ i ] );
7164
-			}
7165
-		};
9359
+	/* Find the number of days in a given month. */
9360
+	_getDaysInMonth: function( year, month ) {
9361
+		return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate();
9362
+	},
7166 9363
 
7167
-		// TODO: make renderAxis a prototype function
7168
-		this._renderAxis(this.element);
9364
+	/* Find the day of the week of the first of a month. */
9365
+	_getFirstDayOfMonth: function( year, month ) {
9366
+		return new Date( year, month, 1 ).getDay();
9367
+	},
7169 9368
 
7170
-		this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
7171
-		this._handles.disableSelection();
9369
+	/* Determines if we should allow a "next/prev" month display change. */
9370
+	_canAdjustMonth: function( inst, offset, curYear, curMonth ) {
9371
+		var numMonths = this._getNumberOfMonths( inst ),
9372
+			date = this._daylightSavingAdjust( new Date( curYear,
9373
+			curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) );
7172 9374
 
7173
-		this._handles.mouseover(function() {
7174
-			if (!that.resizing) {
7175
-				if (this.className) {
7176
-					axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
7177
-				}
7178
-				that.axis = axis && axis[1] ? axis[1] : "se";
9375
+		if ( offset < 0 ) {
9376
+			date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) );
7179 9377
 		}
7180
-		});
9378
+		return this._isInRange( inst, date );
9379
+	},
7181 9380
 
7182
-		if (o.autoHide) {
7183
-			this._handles.hide();
7184
-			$(this.element)
7185
-				.addClass("ui-resizable-autohide")
7186
-				.mouseenter(function() {
7187
-					if (o.disabled) {
7188
-						return;
7189
-					}
7190
-					$(this).removeClass("ui-resizable-autohide");
7191
-					that._handles.show();
7192
-				})
7193
-				.mouseleave(function() {
7194
-					if (o.disabled) {
7195
-						return;
9381
+	/* Is the given date in the accepted range? */
9382
+	_isInRange: function( inst, date ) {
9383
+		var yearSplit, currentYear,
9384
+			minDate = this._getMinMaxDate( inst, "min" ),
9385
+			maxDate = this._getMinMaxDate( inst, "max" ),
9386
+			minYear = null,
9387
+			maxYear = null,
9388
+			years = this._get( inst, "yearRange" );
9389
+			if ( years ) {
9390
+				yearSplit = years.split( ":" );
9391
+				currentYear = new Date().getFullYear();
9392
+				minYear = parseInt( yearSplit[ 0 ], 10 );
9393
+				maxYear = parseInt( yearSplit[ 1 ], 10 );
9394
+				if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) {
9395
+					minYear += currentYear;
7196 9396
 				}
7197
-					if (!that.resizing) {
7198
-						$(this).addClass("ui-resizable-autohide");
7199
-						that._handles.hide();
9397
+				if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) {
9398
+					maxYear += currentYear;
7200 9399
 				}
7201
-				});
7202 9400
 			}
7203 9401
 
7204
-		this._mouseInit();
9402
+		return ( ( !minDate || date.getTime() >= minDate.getTime() ) &&
9403
+			( !maxDate || date.getTime() <= maxDate.getTime() ) &&
9404
+			( !minYear || date.getFullYear() >= minYear ) &&
9405
+			( !maxYear || date.getFullYear() <= maxYear ) );
7205 9406
 	},
7206 9407
 
7207
-	_destroy: function() {
7208
-
7209
-		this._mouseDestroy();
7210
-
7211
-		var wrapper,
7212
-			_destroy = function(exp) {
7213
-				$(exp)
7214
-					.removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
7215
-					.removeData("resizable")
7216
-					.removeData("ui-resizable")
7217
-					.unbind(".resizable")
7218
-					.find(".ui-resizable-handle")
7219
-						.remove();
7220
-			};
7221
-
7222
-		// TODO: Unwrap at same DOM position
7223
-		if (this.elementIsWrapper) {
7224
-			_destroy(this.element);
7225
-			wrapper = this.element;
7226
-			this.originalElement.css({
7227
-				position: wrapper.css("position"),
7228
-				width: wrapper.outerWidth(),
7229
-				height: wrapper.outerHeight(),
7230
-				top: wrapper.css("top"),
7231
-				left: wrapper.css("left")
7232
-			}).insertAfter( wrapper );
7233
-			wrapper.remove();
7234
-		}
7235
-
7236
-		this.originalElement.css("resize", this.originalResizeStyle);
7237
-		_destroy(this.originalElement);
7238
-
7239
-		return this;
9408
+	/* Provide the configuration settings for formatting/parsing. */
9409
+	_getFormatConfig: function( inst ) {
9410
+		var shortYearCutoff = this._get( inst, "shortYearCutoff" );
9411
+		shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff :
9412
+			new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) );
9413
+		return { shortYearCutoff: shortYearCutoff,
9414
+			dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ),
9415
+			monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) };
7240 9416
 	},
7241 9417
 
7242
-	_mouseCapture: function(event) {
7243
-		var i, handle,
7244
-			capture = false;
9418
+	/* Format the given date for display. */
9419
+	_formatDate: function( inst, day, month, year ) {
9420
+		if ( !day ) {
9421
+			inst.currentDay = inst.selectedDay;
9422
+			inst.currentMonth = inst.selectedMonth;
9423
+			inst.currentYear = inst.selectedYear;
9424
+		}
9425
+		var date = ( day ? ( typeof day === "object" ? day :
9426
+			this._daylightSavingAdjust( new Date( year, month, day ) ) ) :
9427
+			this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) );
9428
+		return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) );
9429
+	}
9430
+} );
7245 9431
 
7246
-		for (i in this.handles) {
7247
-			handle = $(this.handles[i])[0];
7248
-			if (handle === event.target || $.contains(handle, event.target)) {
7249
-				capture = true;
9432
+/*
9433
+ * Bind hover events for datepicker elements.
9434
+ * Done via delegate so the binding only occurs once in the lifetime of the parent div.
9435
+ * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
9436
+ */
9437
+function datepicker_bindHover( dpDiv ) {
9438
+	var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
9439
+	return dpDiv.on( "mouseout", selector, function() {
9440
+			$( this ).removeClass( "ui-state-hover" );
9441
+			if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
9442
+				$( this ).removeClass( "ui-datepicker-prev-hover" );
9443
+			}
9444
+			if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
9445
+				$( this ).removeClass( "ui-datepicker-next-hover" );
7250 9446
 			}
9447
+		} )
9448
+		.on( "mouseover", selector, datepicker_handleMouseover );
7251 9449
 }
7252 9450
 
7253
-		return !this.options.disabled && capture;
7254
-	},
7255
-
7256
-	_mouseStart: function(event) {
7257
-
7258
-		var curleft, curtop, cursor,
7259
-			o = this.options,
7260
-			el = this.element;
9451
+function datepicker_handleMouseover() {
9452
+	if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) {
9453
+		$( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" );
9454
+		$( this ).addClass( "ui-state-hover" );
9455
+		if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) {
9456
+			$( this ).addClass( "ui-datepicker-prev-hover" );
9457
+		}
9458
+		if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) {
9459
+			$( this ).addClass( "ui-datepicker-next-hover" );
9460
+		}
9461
+	}
9462
+}
7261 9463
 
7262
-		this.resizing = true;
9464
+/* jQuery extend now ignores nulls! */
9465
+function datepicker_extendRemove( target, props ) {
9466
+	$.extend( target, props );
9467
+	for ( var name in props ) {
9468
+		if ( props[ name ] == null ) {
9469
+			target[ name ] = props[ name ];
9470
+		}
9471
+	}
9472
+	return target;
9473
+}
7263 9474
 
7264
-		this._renderProxy();
9475
+/* Invoke the datepicker functionality.
9476
+   @param  options  string - a command, optionally followed by additional parameters or
9477
+					Object - settings for attaching new datepicker functionality
9478
+   @return  jQuery object */
9479
+$.fn.datepicker = function( options ) {
7265 9480
 
7266
-		curleft = this._num(this.helper.css("left"));
7267
-		curtop = this._num(this.helper.css("top"));
9481
+	/* Verify an empty collection wasn't passed - Fixes #6976 */
9482
+	if ( !this.length ) {
9483
+		return this;
9484
+	}
7268 9485
 
7269
-		if (o.containment) {
7270
-			curleft += $(o.containment).scrollLeft() || 0;
7271
-			curtop += $(o.containment).scrollTop() || 0;
9486
+	/* Initialise the date picker. */
9487
+	if ( !$.datepicker.initialized ) {
9488
+		$( document ).on( "mousedown", $.datepicker._checkExternalClick );
9489
+		$.datepicker.initialized = true;
7272 9490
 	}
7273 9491
 
7274
-		this.offset = this.helper.offset();
7275
-		this.position = { left: curleft, top: curtop };
9492
+	/* Append datepicker main container to body if not exist. */
9493
+	if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
9494
+		$( "body" ).append( $.datepicker.dpDiv );
9495
+	}
7276 9496
 
7277
-		this.size = this._helper ? {
7278
-				width: this.helper.width(),
7279
-				height: this.helper.height()
7280
-			} : {
7281
-				width: el.width(),
7282
-				height: el.height()
9497
+	var otherArgs = Array.prototype.slice.call( arguments, 1 );
9498
+	if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) {
9499
+		return $.datepicker[ "_" + options + "Datepicker" ].
9500
+			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
9501
+	}
9502
+	if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) {
9503
+		return $.datepicker[ "_" + options + "Datepicker" ].
9504
+			apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) );
9505
+	}
9506
+	return this.each( function() {
9507
+		if ( typeof options === "string" ) {
9508
+			$.datepicker[ "_" + options + "Datepicker" ]
9509
+				.apply( $.datepicker, [ this ].concat( otherArgs ) );
9510
+		} else {
9511
+			$.datepicker._attachDatepicker( this, options );
9512
+		}
9513
+	} );
7283 9514
 };
7284 9515
 
7285
-		this.originalSize = this._helper ? {
7286
-				width: el.outerWidth(),
7287
-				height: el.outerHeight()
7288
-			} : {
7289
-				width: el.width(),
7290
-				height: el.height()
7291
-			};
9516
+$.datepicker = new Datepicker(); // singleton instance
9517
+$.datepicker.initialized = false;
9518
+$.datepicker.uuid = new Date().getTime();
9519
+$.datepicker.version = "1.13.2";
7292 9520
 
7293
-		this.sizeDiff = {
7294
-			width: el.outerWidth() - el.width(),
7295
-			height: el.outerHeight() - el.height()
7296
-		};
9521
+var widgetsDatepicker = $.datepicker;
7297 9522
 
7298
-		this.originalPosition = { left: curleft, top: curtop };
7299
-		this.originalMousePosition = { left: event.pageX, top: event.pageY };
7300 9523
 
7301
-		this.aspectRatio = (typeof o.aspectRatio === "number") ?
7302
-			o.aspectRatio :
7303
-			((this.originalSize.width / this.originalSize.height) || 1);
7304 9524
 
7305
-		cursor = $(".ui-resizable-" + this.axis).css("cursor");
7306
-		$("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
9525
+// This file is deprecated
9526
+var ie = $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
7307 9527
 
7308
-		el.addClass("ui-resizable-resizing");
7309
-		this._propagate("start", event);
7310
-		return true;
7311
-	},
9528
+/*!
9529
+ * jQuery UI Mouse 1.13.2
9530
+ * http://jqueryui.com
9531
+ *
9532
+ * Copyright jQuery Foundation and other contributors
9533
+ * Released under the MIT license.
9534
+ * http://jquery.org/license
9535
+ */
7312 9536
 
7313
-	_mouseDrag: function(event) {
9537
+//>>label: Mouse
9538
+//>>group: Widgets
9539
+//>>description: Abstracts mouse-based interactions to assist in creating certain widgets.
9540
+//>>docs: http://api.jqueryui.com/mouse/
7314 9541
 
7315
-		var data, props,
7316
-			smp = this.originalMousePosition,
7317
-			a = this.axis,
7318
-			dx = (event.pageX - smp.left) || 0,
7319
-			dy = (event.pageY - smp.top) || 0,
7320
-			trigger = this._change[a];
7321 9542
 
7322
-		this._updatePrevProperties();
9543
+var mouseHandled = false;
9544
+$( document ).on( "mouseup", function() {
9545
+	mouseHandled = false;
9546
+} );
7323 9547
 
7324
-		if (!trigger) {
9548
+var widgetsMouse = $.widget( "ui.mouse", {
9549
+	version: "1.13.2",
9550
+	options: {
9551
+		cancel: "input, textarea, button, select, option",
9552
+		distance: 1,
9553
+		delay: 0
9554
+	},
9555
+	_mouseInit: function() {
9556
+		var that = this;
9557
+
9558
+		this.element
9559
+			.on( "mousedown." + this.widgetName, function( event ) {
9560
+				return that._mouseDown( event );
9561
+			} )
9562
+			.on( "click." + this.widgetName, function( event ) {
9563
+				if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) {
9564
+					$.removeData( event.target, that.widgetName + ".preventClickEvent" );
9565
+					event.stopImmediatePropagation();
7325 9566
 					return false;
7326 9567
 				}
9568
+			} );
7327 9569
 
7328
-		data = trigger.apply(this, [ event, dx, dy ]);
9570
+		this.started = false;
9571
+	},
7329 9572
 
7330
-		this._updateVirtualBoundaries(event.shiftKey);
7331
-		if (this._aspectRatio || event.shiftKey) {
7332
-			data = this._updateRatio(data, event);
9573
+	// TODO: make sure destroying one instance of mouse doesn't mess with
9574
+	// other instances of mouse
9575
+	_mouseDestroy: function() {
9576
+		this.element.off( "." + this.widgetName );
9577
+		if ( this._mouseMoveDelegate ) {
9578
+			this.document
9579
+				.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
9580
+				.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
7333 9581
 		}
9582
+	},
7334 9583
 
7335
-		data = this._respectSize(data, event);
7336
-
7337
-		this._updateCache(data);
7338
-
7339
-		this._propagate("resize", event);
7340
-
7341
-		props = this._applyChanges();
7342
-
7343
-		if ( !this._helper && this._proportionallyResizeElements.length ) {
7344
-			this._proportionallyResize();
7345
-		}
9584
+	_mouseDown: function( event ) {
7346 9585
 
7347
-		if ( !$.isEmptyObject( props ) ) {
7348
-			this._updatePrevProperties();
7349
-			this._trigger( "resize", event, this.ui() );
7350
-			this._applyChanges();
9586
+		// don't let more than one widget handle mouseStart
9587
+		if ( mouseHandled ) {
9588
+			return;
7351 9589
 		}
7352 9590
 
7353
-		return false;
7354
-	},
7355
-
7356
-	_mouseStop: function(event) {
7357
-
7358
-		this.resizing = false;
7359
-		var pr, ista, soffseth, soffsetw, s, left, top,
7360
-			o = this.options, that = this;
9591
+		this._mouseMoved = false;
7361 9592
 
7362
-		if (this._helper) {
9593
+		// We may have missed mouseup (out of window)
9594
+		if ( this._mouseStarted ) {
9595
+			this._mouseUp( event );
9596
+		}
7363 9597
 
7364
-			pr = this._proportionallyResizeElements;
7365
-			ista = pr.length && (/textarea/i).test(pr[0].nodeName);
7366
-			soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
7367
-			soffsetw = ista ? 0 : that.sizeDiff.width;
9598
+		this._mouseDownEvent = event;
7368 9599
 
7369
-			s = {
7370
-				width: (that.helper.width()  - soffsetw),
7371
-				height: (that.helper.height() - soffseth)
7372
-			};
7373
-			left = (parseInt(that.element.css("left"), 10) +
7374
-				(that.position.left - that.originalPosition.left)) || null;
7375
-			top = (parseInt(that.element.css("top"), 10) +
7376
-				(that.position.top - that.originalPosition.top)) || null;
9600
+		var that = this,
9601
+			btnIsLeft = ( event.which === 1 ),
7377 9602
 
7378
-			if (!o.animate) {
7379
-				this.element.css($.extend(s, { top: top, left: left }));
9603
+			// event.target.nodeName works around a bug in IE 8 with
9604
+			// disabled inputs (#7620)
9605
+			elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ?
9606
+				$( event.target ).closest( this.options.cancel ).length : false );
9607
+		if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) {
9608
+			return true;
7380 9609
 		}
7381 9610
 
7382
-			that.helper.height(that.size.height);
7383
-			that.helper.width(that.size.width);
9611
+		this.mouseDelayMet = !this.options.delay;
9612
+		if ( !this.mouseDelayMet ) {
9613
+			this._mouseDelayTimer = setTimeout( function() {
9614
+				that.mouseDelayMet = true;
9615
+			}, this.options.delay );
9616
+		}
7384 9617
 
7385
-			if (this._helper && !o.animate) {
7386
-				this._proportionallyResize();
9618
+		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
9619
+			this._mouseStarted = ( this._mouseStart( event ) !== false );
9620
+			if ( !this._mouseStarted ) {
9621
+				event.preventDefault();
9622
+				return true;
7387 9623
 			}
7388 9624
 		}
7389 9625
 
7390
-		$("body").css("cursor", "auto");
7391
-
7392
-		this.element.removeClass("ui-resizable-resizing");
7393
-
7394
-		this._propagate("stop", event);
7395
-
7396
-		if (this._helper) {
7397
-			this.helper.remove();
9626
+		// Click event may never have fired (Gecko & Opera)
9627
+		if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) {
9628
+			$.removeData( event.target, this.widgetName + ".preventClickEvent" );
7398 9629
 		}
7399 9630
 
7400
-		return false;
7401
-
7402
-	},
7403
-
7404
-	_updatePrevProperties: function() {
7405
-		this.prevPosition = {
7406
-			top: this.position.top,
7407
-			left: this.position.left
9631
+		// These delegates are required to keep context
9632
+		this._mouseMoveDelegate = function( event ) {
9633
+			return that._mouseMove( event );
7408 9634
 		};
7409
-		this.prevSize = {
7410
-			width: this.size.width,
7411
-			height: this.size.height
9635
+		this._mouseUpDelegate = function( event ) {
9636
+			return that._mouseUp( event );
7412 9637
 		};
7413
-	},
7414
-
7415
-	_applyChanges: function() {
7416
-		var props = {};
7417 9638
 
7418
-		if ( this.position.top !== this.prevPosition.top ) {
7419
-			props.top = this.position.top + "px";
7420
-		}
7421
-		if ( this.position.left !== this.prevPosition.left ) {
7422
-			props.left = this.position.left + "px";
7423
-		}
7424
-		if ( this.size.width !== this.prevSize.width ) {
7425
-			props.width = this.size.width + "px";
7426
-		}
7427
-		if ( this.size.height !== this.prevSize.height ) {
7428
-			props.height = this.size.height + "px";
7429
-		}
9639
+		this.document
9640
+			.on( "mousemove." + this.widgetName, this._mouseMoveDelegate )
9641
+			.on( "mouseup." + this.widgetName, this._mouseUpDelegate );
7430 9642
 
7431
-		this.helper.css( props );
9643
+		event.preventDefault();
7432 9644
 
7433
-		return props;
9645
+		mouseHandled = true;
9646
+		return true;
7434 9647
 	},
7435 9648
 
7436
-	_updateVirtualBoundaries: function(forceAspectRatio) {
7437
-		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
7438
-			o = this.options;
9649
+	_mouseMove: function( event ) {
7439 9650
 
7440
-		b = {
7441
-			minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
7442
-			maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
7443
-			minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
7444
-			maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
7445
-		};
9651
+		// Only check for mouseups outside the document if you've moved inside the document
9652
+		// at least once. This prevents the firing of mouseup in the case of IE<9, which will
9653
+		// fire a mousemove event if content is placed under the cursor. See #7778
9654
+		// Support: IE <9
9655
+		if ( this._mouseMoved ) {
7446 9656
 
7447
-		if (this._aspectRatio || forceAspectRatio) {
7448
-			pMinWidth = b.minHeight * this.aspectRatio;
7449
-			pMinHeight = b.minWidth / this.aspectRatio;
7450
-			pMaxWidth = b.maxHeight * this.aspectRatio;
7451
-			pMaxHeight = b.maxWidth / this.aspectRatio;
9657
+			// IE mouseup check - mouseup happened when mouse was out of window
9658
+			if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) &&
9659
+					!event.button ) {
9660
+				return this._mouseUp( event );
7452 9661
 
7453
-			if (pMinWidth > b.minWidth) {
7454
-				b.minWidth = pMinWidth;
7455
-			}
7456
-			if (pMinHeight > b.minHeight) {
7457
-				b.minHeight = pMinHeight;
7458
-			}
7459
-			if (pMaxWidth < b.maxWidth) {
7460
-				b.maxWidth = pMaxWidth;
9662
+			// Iframe mouseup check - mouseup occurred in another document
9663
+			} else if ( !event.which ) {
9664
+
9665
+				// Support: Safari <=8 - 9
9666
+				// Safari sets which to 0 if you press any of the following keys
9667
+				// during a drag (#14461)
9668
+				if ( event.originalEvent.altKey || event.originalEvent.ctrlKey ||
9669
+						event.originalEvent.metaKey || event.originalEvent.shiftKey ) {
9670
+					this.ignoreMissingWhich = true;
9671
+				} else if ( !this.ignoreMissingWhich ) {
9672
+					return this._mouseUp( event );
7461 9673
 				}
7462
-			if (pMaxHeight < b.maxHeight) {
7463
-				b.maxHeight = pMaxHeight;
7464 9674
 			}
7465 9675
 		}
7466
-		this._vBoundaries = b;
7467
-	},
7468 9676
 
7469
-	_updateCache: function(data) {
7470
-		this.offset = this.helper.offset();
7471
-		if (this._isNumber(data.left)) {
7472
-			this.position.left = data.left;
9677
+		if ( event.which || event.button ) {
9678
+			this._mouseMoved = true;
7473 9679
 		}
7474
-		if (this._isNumber(data.top)) {
7475
-			this.position.top = data.top;
9680
+
9681
+		if ( this._mouseStarted ) {
9682
+			this._mouseDrag( event );
9683
+			return event.preventDefault();
7476 9684
 		}
7477
-		if (this._isNumber(data.height)) {
7478
-			this.size.height = data.height;
9685
+
9686
+		if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) {
9687
+			this._mouseStarted =
9688
+				( this._mouseStart( this._mouseDownEvent, event ) !== false );
9689
+			if ( this._mouseStarted ) {
9690
+				this._mouseDrag( event );
9691
+			} else {
9692
+				this._mouseUp( event );
7479 9693
 			}
7480
-		if (this._isNumber(data.width)) {
7481
-			this.size.width = data.width;
7482 9694
 		}
9695
+
9696
+		return !this._mouseStarted;
7483 9697
 	},
7484 9698
 
7485
-	_updateRatio: function( data ) {
9699
+	_mouseUp: function( event ) {
9700
+		this.document
9701
+			.off( "mousemove." + this.widgetName, this._mouseMoveDelegate )
9702
+			.off( "mouseup." + this.widgetName, this._mouseUpDelegate );
7486 9703
 
7487
-		var cpos = this.position,
7488
-			csize = this.size,
7489
-			a = this.axis;
9704
+		if ( this._mouseStarted ) {
9705
+			this._mouseStarted = false;
7490 9706
 
7491
-		if (this._isNumber(data.height)) {
7492
-			data.width = (data.height * this.aspectRatio);
7493
-		} else if (this._isNumber(data.width)) {
7494
-			data.height = (data.width / this.aspectRatio);
9707
+			if ( event.target === this._mouseDownEvent.target ) {
9708
+				$.data( event.target, this.widgetName + ".preventClickEvent", true );
7495 9709
 			}
7496 9710
 
7497
-		if (a === "sw") {
7498
-			data.left = cpos.left + (csize.width - data.width);
7499
-			data.top = null;
9711
+			this._mouseStop( event );
7500 9712
 		}
7501
-		if (a === "nw") {
7502
-			data.top = cpos.top + (csize.height - data.height);
7503
-			data.left = cpos.left + (csize.width - data.width);
9713
+
9714
+		if ( this._mouseDelayTimer ) {
9715
+			clearTimeout( this._mouseDelayTimer );
9716
+			delete this._mouseDelayTimer;
7504 9717
 		}
7505 9718
 
7506
-		return data;
9719
+		this.ignoreMissingWhich = false;
9720
+		mouseHandled = false;
9721
+		event.preventDefault();
7507 9722
 	},
7508 9723
 
7509
-	_respectSize: function( data ) {
9724
+	_mouseDistanceMet: function( event ) {
9725
+		return ( Math.max(
9726
+				Math.abs( this._mouseDownEvent.pageX - event.pageX ),
9727
+				Math.abs( this._mouseDownEvent.pageY - event.pageY )
9728
+			) >= this.options.distance
9729
+		);
9730
+	},
7510 9731
 
7511
-		var o = this._vBoundaries,
7512
-			a = this.axis,
7513
-			ismaxw = this._isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width),
7514
-			ismaxh = this._isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
7515
-			isminw = this._isNumber(data.width) && o.minWidth && (o.minWidth > data.width),
7516
-			isminh = this._isNumber(data.height) && o.minHeight && (o.minHeight > data.height),
7517
-			dw = this.originalPosition.left + this.originalSize.width,
7518
-			dh = this.position.top + this.size.height,
7519
-			cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
7520
-		if (isminw) {
7521
-			data.width = o.minWidth;
7522
-		}
7523
-		if (isminh) {
7524
-			data.height = o.minHeight;
9732
+	_mouseDelayMet: function( /* event */ ) {
9733
+		return this.mouseDelayMet;
9734
+	},
9735
+
9736
+	// These are placeholder methods, to be overriden by extending plugin
9737
+	_mouseStart: function( /* event */ ) {},
9738
+	_mouseDrag: function( /* event */ ) {},
9739
+	_mouseStop: function( /* event */ ) {},
9740
+	_mouseCapture: function( /* event */ ) {
9741
+		return true;
7525 9742
 	}
7526
-		if (ismaxw) {
7527
-			data.width = o.maxWidth;
9743
+} );
9744
+
9745
+
9746
+
9747
+// $.ui.plugin is deprecated. Use $.widget() extensions instead.
9748
+var plugin = $.ui.plugin = {
9749
+	add: function( module, option, set ) {
9750
+		var i,
9751
+			proto = $.ui[ module ].prototype;
9752
+		for ( i in set ) {
9753
+			proto.plugins[ i ] = proto.plugins[ i ] || [];
9754
+			proto.plugins[ i ].push( [ option, set[ i ] ] );
7528 9755
 		}
7529
-		if (ismaxh) {
7530
-			data.height = o.maxHeight;
9756
+	},
9757
+	call: function( instance, name, args, allowDisconnected ) {
9758
+		var i,
9759
+			set = instance.plugins[ name ];
9760
+
9761
+		if ( !set ) {
9762
+			return;
7531 9763
 		}
7532 9764
 
7533
-		if (isminw && cw) {
7534
-			data.left = dw - o.minWidth;
9765
+		if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode ||
9766
+				instance.element[ 0 ].parentNode.nodeType === 11 ) ) {
9767
+			return;
7535 9768
 		}
7536
-		if (ismaxw && cw) {
7537
-			data.left = dw - o.maxWidth;
9769
+
9770
+		for ( i = 0; i < set.length; i++ ) {
9771
+			if ( instance.options[ set[ i ][ 0 ] ] ) {
9772
+				set[ i ][ 1 ].apply( instance.element, args );
7538 9773
 			}
7539
-		if (isminh && ch) {
7540
-			data.top = dh - o.minHeight;
7541 9774
 		}
7542
-		if (ismaxh && ch) {
7543
-			data.top = dh - o.maxHeight;
7544 9775
 	}
9776
+};
7545 9777
 
7546
-		// Fixing jump error on top/left - bug #2330
7547
-		if (!data.width && !data.height && !data.left && data.top) {
7548
-			data.top = null;
7549
-		} else if (!data.width && !data.height && !data.top && data.left) {
7550
-			data.left = null;
9778
+
9779
+
9780
+var safeBlur = $.ui.safeBlur = function( element ) {
9781
+
9782
+	// Support: IE9 - 10 only
9783
+	// If the <body> is blurred, IE will switch windows, see #9420
9784
+	if ( element && element.nodeName.toLowerCase() !== "body" ) {
9785
+		$( element ).trigger( "blur" );
7551 9786
 	}
9787
+};
7552 9788
 
7553
-		return data;
7554
-	},
7555 9789
 
7556
-	_getPaddingPlusBorderDimensions: function( element ) {
7557
-		var i = 0,
7558
-			widths = [],
7559
-			borders = [
7560
-				element.css( "borderTopWidth" ),
7561
-				element.css( "borderRightWidth" ),
7562
-				element.css( "borderBottomWidth" ),
7563
-				element.css( "borderLeftWidth" )
7564
-			],
7565
-			paddings = [
7566
-				element.css( "paddingTop" ),
7567
-				element.css( "paddingRight" ),
7568
-				element.css( "paddingBottom" ),
7569
-				element.css( "paddingLeft" )
7570
-			];
9790
+/*!
9791
+ * jQuery UI Draggable 1.13.2
9792
+ * http://jqueryui.com
9793
+ *
9794
+ * Copyright jQuery Foundation and other contributors
9795
+ * Released under the MIT license.
9796
+ * http://jquery.org/license
9797
+ */
7571 9798
 
7572
-		for ( ; i < 4; i++ ) {
7573
-			widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
7574
-			widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
9799
+//>>label: Draggable
9800
+//>>group: Interactions
9801
+//>>description: Enables dragging functionality for any element.
9802
+//>>docs: http://api.jqueryui.com/draggable/
9803
+//>>demos: http://jqueryui.com/draggable/
9804
+//>>css.structure: ../../themes/base/draggable.css
9805
+
9806
+
9807
+$.widget( "ui.draggable", $.ui.mouse, {
9808
+	version: "1.13.2",
9809
+	widgetEventPrefix: "drag",
9810
+	options: {
9811
+		addClasses: true,
9812
+		appendTo: "parent",
9813
+		axis: false,
9814
+		connectToSortable: false,
9815
+		containment: false,
9816
+		cursor: "auto",
9817
+		cursorAt: false,
9818
+		grid: false,
9819
+		handle: false,
9820
+		helper: "original",
9821
+		iframeFix: false,
9822
+		opacity: false,
9823
+		refreshPositions: false,
9824
+		revert: false,
9825
+		revertDuration: 500,
9826
+		scope: "default",
9827
+		scroll: true,
9828
+		scrollSensitivity: 20,
9829
+		scrollSpeed: 20,
9830
+		snap: false,
9831
+		snapMode: "both",
9832
+		snapTolerance: 20,
9833
+		stack: false,
9834
+		zIndex: false,
9835
+
9836
+		// Callbacks
9837
+		drag: null,
9838
+		start: null,
9839
+		stop: null
9840
+	},
9841
+	_create: function() {
9842
+
9843
+		if ( this.options.helper === "original" ) {
9844
+			this._setPositionRelative();
9845
+		}
9846
+		if ( this.options.addClasses ) {
9847
+			this._addClass( "ui-draggable" );
7575 9848
 		}
9849
+		this._setHandleClassName();
7576 9850
 
7577
-		return {
7578
-			height: widths[ 0 ] + widths[ 2 ],
7579
-			width: widths[ 1 ] + widths[ 3 ]
7580
-		};
9851
+		this._mouseInit();
7581 9852
 	},
7582 9853
 
7583
-	_proportionallyResize: function() {
9854
+	_setOption: function( key, value ) {
9855
+		this._super( key, value );
9856
+		if ( key === "handle" ) {
9857
+			this._removeHandleClassName();
9858
+			this._setHandleClassName();
9859
+		}
9860
+	},
7584 9861
 
7585
-		if (!this._proportionallyResizeElements.length) {
9862
+	_destroy: function() {
9863
+		if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) {
9864
+			this.destroyOnClear = true;
7586 9865
 			return;
7587 9866
 		}
9867
+		this._removeHandleClassName();
9868
+		this._mouseDestroy();
9869
+	},
7588 9870
 
7589
-		var prel,
7590
-			i = 0,
7591
-			element = this.helper || this.element;
7592
-
7593
-		for ( ; i < this._proportionallyResizeElements.length; i++) {
7594
-
7595
-			prel = this._proportionallyResizeElements[i];
9871
+	_mouseCapture: function( event ) {
9872
+		var o = this.options;
7596 9873
 
7597
-			// TODO: Seems like a bug to cache this.outerDimensions
7598
-			// considering that we are in a loop.
7599
-			if (!this.outerDimensions) {
7600
-				this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
9874
+		// Among others, prevent a drag on a resizable-handle
9875
+		if ( this.helper || o.disabled ||
9876
+				$( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) {
9877
+			return false;
7601 9878
 		}
7602 9879
 
7603
-			prel.css({
7604
-				height: (element.height() - this.outerDimensions.height) || 0,
7605
-				width: (element.width() - this.outerDimensions.width) || 0
7606
-			});
7607
-
9880
+		//Quit if we're not on a valid handle
9881
+		this.handle = this._getHandle( event );
9882
+		if ( !this.handle ) {
9883
+			return false;
7608 9884
 		}
7609 9885
 
7610
-	},
9886
+		this._blurActiveElement( event );
7611 9887
 
7612
-	_renderProxy: function() {
9888
+		this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
7613 9889
 
7614
-		var el = this.element, o = this.options;
7615
-		this.elementOffset = el.offset();
9890
+		return true;
7616 9891
 
7617
-		if (this._helper) {
9892
+	},
7618 9893
 
7619
-			this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
9894
+	_blockFrames: function( selector ) {
9895
+		this.iframeBlocks = this.document.find( selector ).map( function() {
9896
+			var iframe = $( this );
7620 9897
 
7621
-			this.helper.addClass(this._helper).css({
7622
-				width: this.element.outerWidth() - 1,
7623
-				height: this.element.outerHeight() - 1,
7624
-				position: "absolute",
7625
-				left: this.elementOffset.left + "px",
7626
-				top: this.elementOffset.top + "px",
7627
-				zIndex: ++o.zIndex //TODO: Don't modify option
9898
+			return $( "<div>" )
9899
+				.css( "position", "absolute" )
9900
+				.appendTo( iframe.parent() )
9901
+				.outerWidth( iframe.outerWidth() )
9902
+				.outerHeight( iframe.outerHeight() )
9903
+				.offset( iframe.offset() )[ 0 ];
7628 9904
 		} );
7629
-
7630
-			this.helper
7631
-				.appendTo("body")
7632
-				.disableSelection();
7633
-
7634
-		} else {
7635
-			this.helper = this.element;
7636
-		}
7637
-
7638 9905
 	},
7639 9906
 
7640
-	_change: {
7641
-		e: function(event, dx) {
7642
-			return { width: this.originalSize.width + dx };
7643
-		},
7644
-		w: function(event, dx) {
7645
-			var cs = this.originalSize, sp = this.originalPosition;
7646
-			return { left: sp.left + dx, width: cs.width - dx };
7647
-		},
7648
-		n: function(event, dx, dy) {
7649
-			var cs = this.originalSize, sp = this.originalPosition;
7650
-			return { top: sp.top + dy, height: cs.height - dy };
7651
-		},
7652
-		s: function(event, dx, dy) {
7653
-			return { height: this.originalSize.height + dy };
7654
-		},
7655
-		se: function(event, dx, dy) {
7656
-			return $.extend(this._change.s.apply(this, arguments),
7657
-				this._change.e.apply(this, [ event, dx, dy ]));
7658
-		},
7659
-		sw: function(event, dx, dy) {
7660
-			return $.extend(this._change.s.apply(this, arguments),
7661
-				this._change.w.apply(this, [ event, dx, dy ]));
7662
-		},
7663
-		ne: function(event, dx, dy) {
7664
-			return $.extend(this._change.n.apply(this, arguments),
7665
-				this._change.e.apply(this, [ event, dx, dy ]));
7666
-		},
7667
-		nw: function(event, dx, dy) {
7668
-			return $.extend(this._change.n.apply(this, arguments),
7669
-				this._change.w.apply(this, [ event, dx, dy ]));
9907
+	_unblockFrames: function() {
9908
+		if ( this.iframeBlocks ) {
9909
+			this.iframeBlocks.remove();
9910
+			delete this.iframeBlocks;
7670 9911
 		}
7671 9912
 	},
7672 9913
 
7673
-	_propagate: function(n, event) {
7674
-		$.ui.plugin.call(this, n, [ event, this.ui() ]);
7675
-		(n !== "resize" && this._trigger(n, event, this.ui()));
7676
-	},
7677
-
7678
-	plugins: {},
9914
+	_blurActiveElement: function( event ) {
9915
+		var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
9916
+			target = $( event.target );
7679 9917
 
7680
-	ui: function() {
7681
-		return {
7682
-			originalElement: this.originalElement,
7683
-			element: this.element,
7684
-			helper: this.helper,
7685
-			position: this.position,
7686
-			size: this.size,
7687
-			originalSize: this.originalSize,
7688
-			originalPosition: this.originalPosition
7689
-		};
9918
+		// Don't blur if the event occurred on an element that is within
9919
+		// the currently focused element
9920
+		// See #10527, #12472
9921
+		if ( target.closest( activeElement ).length ) {
9922
+			return;
7690 9923
 		}
7691 9924
 
7692
-});
9925
+		// Blur any element that currently has focus, see #4261
9926
+		$.ui.safeBlur( activeElement );
9927
+	},
7693 9928
 
7694
-/*
7695
- * Resizable Extensions
7696
- */
9929
+	_mouseStart: function( event ) {
7697 9930
 
7698
-$.ui.plugin.add("resizable", "animate", {
9931
+		var o = this.options;
7699 9932
 
7700
-	stop: function( event ) {
7701
-		var that = $(this).resizable( "instance" ),
7702
-			o = that.options,
7703
-			pr = that._proportionallyResizeElements,
7704
-			ista = pr.length && (/textarea/i).test(pr[0].nodeName),
7705
-			soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
7706
-			soffsetw = ista ? 0 : that.sizeDiff.width,
7707
-			style = { width: (that.size.width - soffsetw), height: (that.size.height - soffseth) },
7708
-			left = (parseInt(that.element.css("left"), 10) +
7709
-				(that.position.left - that.originalPosition.left)) || null,
7710
-			top = (parseInt(that.element.css("top"), 10) +
7711
-				(that.position.top - that.originalPosition.top)) || null;
9933
+		//Create and append the visible helper
9934
+		this.helper = this._createHelper( event );
7712 9935
 
7713
-		that.element.animate(
7714
-			$.extend(style, top && left ? { top: top, left: left } : {}), {
7715
-				duration: o.animateDuration,
7716
-				easing: o.animateEasing,
7717
-				step: function() {
9936
+		this._addClass( this.helper, "ui-draggable-dragging" );
7718 9937
 
7719
-					var data = {
7720
-						width: parseInt(that.element.css("width"), 10),
7721
-						height: parseInt(that.element.css("height"), 10),
7722
-						top: parseInt(that.element.css("top"), 10),
7723
-						left: parseInt(that.element.css("left"), 10)
7724
-					};
9938
+		//Cache the helper size
9939
+		this._cacheHelperProportions();
7725 9940
 
7726
-					if (pr && pr.length) {
7727
-						$(pr[0]).css({ width: data.width, height: data.height });
9941
+		//If ddmanager is used for droppables, set the global draggable
9942
+		if ( $.ui.ddmanager ) {
9943
+			$.ui.ddmanager.current = this;
7728 9944
 		}
7729 9945
 
7730
-					// propagating resize, and updating values for each animation step
7731
-					that._updateCache(data);
7732
-					that._propagate("resize", event);
9946
+		/*
9947
+		 * - Position generation -
9948
+		 * This block generates everything position related - it's the core of draggables.
9949
+		 */
7733 9950
 
7734
-				}
7735
-			}
7736
-		);
7737
-	}
9951
+		//Cache the margins of the original element
9952
+		this._cacheMargins();
7738 9953
 
7739
-});
9954
+		//Store the helper's css position
9955
+		this.cssPosition = this.helper.css( "position" );
9956
+		this.scrollParent = this.helper.scrollParent( true );
9957
+		this.offsetParent = this.helper.offsetParent();
9958
+		this.hasFixedAncestor = this.helper.parents().filter( function() {
9959
+				return $( this ).css( "position" ) === "fixed";
9960
+			} ).length > 0;
7740 9961
 
7741
-$.ui.plugin.add( "resizable", "containment", {
9962
+		//The element's absolute position on the page minus margins
9963
+		this.positionAbs = this.element.offset();
9964
+		this._refreshOffsets( event );
7742 9965
 
7743
-	start: function() {
7744
-		var element, p, co, ch, cw, width, height,
7745
-			that = $( this ).resizable( "instance" ),
7746
-			o = that.options,
7747
-			el = that.element,
7748
-			oc = o.containment,
7749
-			ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
9966
+		//Generate the original position
9967
+		this.originalPosition = this.position = this._generatePosition( event, false );
9968
+		this.originalPageX = event.pageX;
9969
+		this.originalPageY = event.pageY;
7750 9970
 
7751
-		if ( !ce ) {
7752
-			return;
9971
+		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
9972
+		if ( o.cursorAt ) {
9973
+			this._adjustOffsetFromHelper( o.cursorAt );
7753 9974
 		}
7754 9975
 
7755
-		that.containerElement = $( ce );
9976
+		//Set a containment if given in the options
9977
+		this._setContainment();
7756 9978
 
7757
-		if ( /document/.test( oc ) || oc === document ) {
7758
-			that.containerOffset = {
7759
-				left: 0,
7760
-				top: 0
7761
-			};
7762
-			that.containerPosition = {
7763
-				left: 0,
7764
-				top: 0
7765
-			};
9979
+		//Trigger event + callbacks
9980
+		if ( this._trigger( "start", event ) === false ) {
9981
+			this._clear();
9982
+			return false;
9983
+		}
7766 9984
 
7767
-			that.parentData = {
7768
-				element: $( document ),
7769
-				left: 0,
7770
-				top: 0,
7771
-				width: $( document ).width(),
7772
-				height: $( document ).height() || document.body.parentNode.scrollHeight
7773
-			};
7774
-		} else {
7775
-			element = $( ce );
7776
-			p = [];
7777
-			$([ "Top", "Right", "Left", "Bottom" ]).each(function( i, name ) {
7778
-				p[ i ] = that._num( element.css( "padding" + name ) );
7779
-			});
9985
+		//Recache the helper size
9986
+		this._cacheHelperProportions();
7780 9987
 
7781
-			that.containerOffset = element.offset();
7782
-			that.containerPosition = element.position();
7783
-			that.containerSize = {
7784
-				height: ( element.innerHeight() - p[ 3 ] ),
7785
-				width: ( element.innerWidth() - p[ 1 ] )
7786
-			};
9988
+		//Prepare the droppable offsets
9989
+		if ( $.ui.ddmanager && !o.dropBehaviour ) {
9990
+			$.ui.ddmanager.prepareOffsets( this, event );
9991
+		}
7787 9992
 
7788
-			co = that.containerOffset;
7789
-			ch = that.containerSize.height;
7790
-			cw = that.containerSize.width;
7791
-			width = ( that._hasScroll ( ce, "left" ) ? ce.scrollWidth : cw );
7792
-			height = ( that._hasScroll ( ce ) ? ce.scrollHeight : ch ) ;
9993
+		// Execute the drag once - this causes the helper not to be visible before getting its
9994
+		// correct position
9995
+		this._mouseDrag( event, true );
7793 9996
 
7794
-			that.parentData = {
7795
-				element: ce,
7796
-				left: co.left,
7797
-				top: co.top,
7798
-				width: width,
7799
-				height: height
7800
-			};
9997
+		// If the ddmanager is used for droppables, inform the manager that dragging has started
9998
+		// (see #5003)
9999
+		if ( $.ui.ddmanager ) {
10000
+			$.ui.ddmanager.dragStart( this, event );
7801 10001
 		}
7802
-	},
7803 10002
 
7804
-	resize: function( event ) {
7805
-		var woset, hoset, isParent, isOffsetRelative,
7806
-			that = $( this ).resizable( "instance" ),
7807
-			o = that.options,
7808
-			co = that.containerOffset,
7809
-			cp = that.position,
7810
-			pRatio = that._aspectRatio || event.shiftKey,
7811
-			cop = {
7812
-				top: 0,
7813
-				left: 0
10003
+		return true;
7814 10004
 	},
7815
-			ce = that.containerElement,
7816
-			continueResize = true;
7817 10005
 
7818
-		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
7819
-			cop = co;
7820
-		}
10006
+	_refreshOffsets: function( event ) {
10007
+		this.offset = {
10008
+			top: this.positionAbs.top - this.margins.top,
10009
+			left: this.positionAbs.left - this.margins.left,
10010
+			scroll: false,
10011
+			parent: this._getParentOffset(),
10012
+			relative: this._getRelativeOffset()
10013
+		};
10014
+
10015
+		this.offset.click = {
10016
+			left: event.pageX - this.offset.left,
10017
+			top: event.pageY - this.offset.top
10018
+		};
10019
+	},
7821 10020
 
7822
-		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
7823
-			that.size.width = that.size.width +
7824
-				( that._helper ?
7825
-					( that.position.left - co.left ) :
7826
-					( that.position.left - cop.left ) );
10021
+	_mouseDrag: function( event, noPropagation ) {
7827 10022
 
7828
-			if ( pRatio ) {
7829
-				that.size.height = that.size.width / that.aspectRatio;
7830
-				continueResize = false;
7831
-			}
7832
-			that.position.left = o.helper ? co.left : 0;
10023
+		// reset any necessary cached properties (see #5009)
10024
+		if ( this.hasFixedAncestor ) {
10025
+			this.offset.parent = this._getParentOffset();
7833 10026
 		}
7834 10027
 
7835
-		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
7836
-			that.size.height = that.size.height +
7837
-				( that._helper ?
7838
-					( that.position.top - co.top ) :
7839
-					that.position.top );
10028
+		//Compute the helpers position
10029
+		this.position = this._generatePosition( event, true );
10030
+		this.positionAbs = this._convertPositionTo( "absolute" );
7840 10031
 
7841
-			if ( pRatio ) {
7842
-				that.size.width = that.size.height * that.aspectRatio;
7843
-				continueResize = false;
10032
+		//Call plugins and callbacks and use the resulting position if something is returned
10033
+		if ( !noPropagation ) {
10034
+			var ui = this._uiHash();
10035
+			if ( this._trigger( "drag", event, ui ) === false ) {
10036
+				this._mouseUp( new $.Event( "mouseup", event ) );
10037
+				return false;
7844 10038
 			}
7845
-			that.position.top = that._helper ? co.top : 0;
10039
+			this.position = ui.position;
7846 10040
 		}
7847 10041
 
7848
-		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
7849
-		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
10042
+		this.helper[ 0 ].style.left = this.position.left + "px";
10043
+		this.helper[ 0 ].style.top = this.position.top + "px";
7850 10044
 
7851
-		if ( isParent && isOffsetRelative ) {
7852
-			that.offset.left = that.parentData.left + that.position.left;
7853
-			that.offset.top = that.parentData.top + that.position.top;
7854
-		} else {
7855
-			that.offset.left = that.element.offset().left;
7856
-			that.offset.top = that.element.offset().top;
10045
+		if ( $.ui.ddmanager ) {
10046
+			$.ui.ddmanager.drag( this, event );
7857 10047
 		}
7858 10048
 
7859
-		woset = Math.abs( that.sizeDiff.width +
7860
-			(that._helper ?
7861
-				that.offset.left - cop.left :
7862
-				(that.offset.left - co.left)) );
10049
+		return false;
10050
+	},
7863 10051
 
7864
-		hoset = Math.abs( that.sizeDiff.height +
7865
-			(that._helper ?
7866
-				that.offset.top - cop.top :
7867
-				(that.offset.top - co.top)) );
10052
+	_mouseStop: function( event ) {
7868 10053
 
7869
-		if ( woset + that.size.width >= that.parentData.width ) {
7870
-			that.size.width = that.parentData.width - woset;
7871
-			if ( pRatio ) {
7872
-				that.size.height = that.size.width / that.aspectRatio;
7873
-				continueResize = false;
10054
+		//If we are using droppables, inform the manager about the drop
10055
+		var that = this,
10056
+			dropped = false;
10057
+		if ( $.ui.ddmanager && !this.options.dropBehaviour ) {
10058
+			dropped = $.ui.ddmanager.drop( this, event );
7874 10059
 		}
10060
+
10061
+		//if a drop comes from outside (a sortable)
10062
+		if ( this.dropped ) {
10063
+			dropped = this.dropped;
10064
+			this.dropped = false;
7875 10065
 		}
7876 10066
 
7877
-		if ( hoset + that.size.height >= that.parentData.height ) {
7878
-			that.size.height = that.parentData.height - hoset;
7879
-			if ( pRatio ) {
7880
-				that.size.width = that.size.height * that.aspectRatio;
7881
-				continueResize = false;
10067
+		if ( ( this.options.revert === "invalid" && !dropped ) ||
10068
+				( this.options.revert === "valid" && dropped ) ||
10069
+				this.options.revert === true || ( typeof this.options.revert === "function" &&
10070
+				this.options.revert.call( this.element, dropped ) )
10071
+		) {
10072
+			$( this.helper ).animate(
10073
+				this.originalPosition,
10074
+				parseInt( this.options.revertDuration, 10 ),
10075
+				function() {
10076
+					if ( that._trigger( "stop", event ) !== false ) {
10077
+						that._clear();
7882 10078
 					}
7883 10079
 				}
7884
-
7885
-		if ( !continueResize ) {
7886
-			that.position.left = that.prevPosition.left;
7887
-			that.position.top = that.prevPosition.top;
7888
-			that.size.width = that.prevSize.width;
7889
-			that.size.height = that.prevSize.height;
10080
+			);
10081
+		} else {
10082
+			if ( this._trigger( "stop", event ) !== false ) {
10083
+				this._clear();
7890 10084
 			}
10085
+		}
10086
+
10087
+		return false;
7891 10088
 	},
7892 10089
 
7893
-	stop: function() {
7894
-		var that = $( this ).resizable( "instance" ),
7895
-			o = that.options,
7896
-			co = that.containerOffset,
7897
-			cop = that.containerPosition,
7898
-			ce = that.containerElement,
7899
-			helper = $( that.helper ),
7900
-			ho = helper.offset(),
7901
-			w = helper.outerWidth() - that.sizeDiff.width,
7902
-			h = helper.outerHeight() - that.sizeDiff.height;
10090
+	_mouseUp: function( event ) {
10091
+		this._unblockFrames();
7903 10092
 
7904
-		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
7905
-			$( this ).css({
7906
-				left: ho.left - cop.left - co.left,
7907
-				width: w,
7908
-				height: h
7909
-			});
10093
+		// If the ddmanager is used for droppables, inform the manager that dragging has stopped
10094
+		// (see #5003)
10095
+		if ( $.ui.ddmanager ) {
10096
+			$.ui.ddmanager.dragStop( this, event );
7910 10097
 		}
7911 10098
 
7912
-		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
7913
-			$( this ).css({
7914
-				left: ho.left - cop.left - co.left,
7915
-				width: w,
7916
-				height: h
7917
-			});
10099
+		// Only need to focus if the event occurred on the draggable itself, see #10527
10100
+		if ( this.handleElement.is( event.target ) ) {
10101
+
10102
+			// The interaction is over; whether or not the click resulted in a drag,
10103
+			// focus the element
10104
+			this.element.trigger( "focus" );
7918 10105
 		}
10106
+
10107
+		return $.ui.mouse.prototype._mouseUp.call( this, event );
10108
+	},
10109
+
10110
+	cancel: function() {
10111
+
10112
+		if ( this.helper.is( ".ui-draggable-dragging" ) ) {
10113
+			this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) );
10114
+		} else {
10115
+			this._clear();
7919 10116
 		}
7920
-});
7921 10117
 
7922
-$.ui.plugin.add("resizable", "alsoResize", {
10118
+		return this;
7923 10119
 
7924
-	start: function() {
7925
-		var that = $(this).resizable( "instance" ),
7926
-			o = that.options;
10120
+	},
7927 10121
 
7928
-		$(o.alsoResize).each(function() {
7929
-			var el = $(this);
7930
-			el.data("ui-resizable-alsoresize", {
7931
-				width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
7932
-				left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
7933
-			});
7934
-		});
10122
+	_getHandle: function( event ) {
10123
+		return this.options.handle ?
10124
+			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
10125
+			true;
7935 10126
 	},
7936 10127
 
7937
-	resize: function(event, ui) {
7938
-		var that = $(this).resizable( "instance" ),
7939
-			o = that.options,
7940
-			os = that.originalSize,
7941
-			op = that.originalPosition,
7942
-			delta = {
7943
-				height: (that.size.height - os.height) || 0,
7944
-				width: (that.size.width - os.width) || 0,
7945
-				top: (that.position.top - op.top) || 0,
7946
-				left: (that.position.left - op.left) || 0
7947
-			};
10128
+	_setHandleClassName: function() {
10129
+		this.handleElement = this.options.handle ?
10130
+			this.element.find( this.options.handle ) : this.element;
10131
+		this._addClass( this.handleElement, "ui-draggable-handle" );
10132
+	},
7948 10133
 
7949
-			$(o.alsoResize).each(function() {
7950
-				var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
7951
-					css = el.parents(ui.originalElement[0]).length ?
7952
-							[ "width", "height" ] :
7953
-							[ "width", "height", "top", "left" ];
10134
+	_removeHandleClassName: function() {
10135
+		this._removeClass( this.handleElement, "ui-draggable-handle" );
10136
+	},
7954 10137
 
7955
-				$.each(css, function(i, prop) {
7956
-					var sum = (start[prop] || 0) + (delta[prop] || 0);
7957
-					if (sum && sum >= 0) {
7958
-						style[prop] = sum || null;
10138
+	_createHelper: function( event ) {
10139
+
10140
+		var o = this.options,
10141
+			helperIsFunction = typeof o.helper === "function",
10142
+			helper = helperIsFunction ?
10143
+				$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
10144
+				( o.helper === "clone" ?
10145
+					this.element.clone().removeAttr( "id" ) :
10146
+					this.element );
10147
+
10148
+		if ( !helper.parents( "body" ).length ) {
10149
+			helper.appendTo( ( o.appendTo === "parent" ?
10150
+				this.element[ 0 ].parentNode :
10151
+				o.appendTo ) );
7959 10152
 		}
7960
-				});
7961 10153
 
7962
-				el.css(style);
7963
-			});
10154
+		// Http://bugs.jqueryui.com/ticket/9446
10155
+		// a helper function can return the original element
10156
+		// which wouldn't have been set to relative in _create
10157
+		if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
10158
+			this._setPositionRelative();
10159
+		}
10160
+
10161
+		if ( helper[ 0 ] !== this.element[ 0 ] &&
10162
+				!( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) {
10163
+			helper.css( "position", "absolute" );
10164
+		}
10165
+
10166
+		return helper;
10167
+
7964 10168
 	},
7965 10169
 
7966
-	stop: function() {
7967
-		$(this).removeData("resizable-alsoresize");
10170
+	_setPositionRelative: function() {
10171
+		if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
10172
+			this.element[ 0 ].style.position = "relative";
7968 10173
 		}
7969
-});
10174
+	},
7970 10175
 
7971
-$.ui.plugin.add("resizable", "ghost", {
10176
+	_adjustOffsetFromHelper: function( obj ) {
10177
+		if ( typeof obj === "string" ) {
10178
+			obj = obj.split( " " );
10179
+		}
10180
+		if ( Array.isArray( obj ) ) {
10181
+			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
10182
+		}
10183
+		if ( "left" in obj ) {
10184
+			this.offset.click.left = obj.left + this.margins.left;
10185
+		}
10186
+		if ( "right" in obj ) {
10187
+			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
10188
+		}
10189
+		if ( "top" in obj ) {
10190
+			this.offset.click.top = obj.top + this.margins.top;
10191
+		}
10192
+		if ( "bottom" in obj ) {
10193
+			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
10194
+		}
10195
+	},
7972 10196
 
7973
-	start: function() {
10197
+	_isRootNode: function( element ) {
10198
+		return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ];
10199
+	},
7974 10200
 
7975
-		var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
10201
+	_getParentOffset: function() {
7976 10202
 
7977
-		that.ghost = that.originalElement.clone();
7978
-		that.ghost
7979
-			.css({
7980
-				opacity: 0.25,
7981
-				display: "block",
7982
-				position: "relative",
7983
-				height: cs.height,
7984
-				width: cs.width,
7985
-				margin: 0,
7986
-				left: 0,
7987
-				top: 0
7988
-			})
7989
-			.addClass("ui-resizable-ghost")
7990
-			.addClass(typeof o.ghost === "string" ? o.ghost : "");
10203
+		//Get the offsetParent and cache its position
10204
+		var po = this.offsetParent.offset(),
10205
+			document = this.document[ 0 ];
7991 10206
 
7992
-		that.ghost.appendTo(that.helper);
10207
+		// This is a special case where we need to modify a offset calculated on start, since the
10208
+		// following happened:
10209
+		// 1. The position of the helper is absolute, so it's position is calculated based on the
10210
+		// next positioned parent
10211
+		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
10212
+		// the document, which means that the scroll is included in the initial calculation of the
10213
+		// offset of the parent, and never recalculated upon drag
10214
+		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document &&
10215
+				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
10216
+			po.left += this.scrollParent.scrollLeft();
10217
+			po.top += this.scrollParent.scrollTop();
10218
+		}
10219
+
10220
+		if ( this._isRootNode( this.offsetParent[ 0 ] ) ) {
10221
+			po = { top: 0, left: 0 };
10222
+		}
10223
+
10224
+		return {
10225
+			top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ),
10226
+			left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 )
10227
+		};
7993 10228
 
7994 10229
 	},
7995 10230
 
7996
-	resize: function() {
7997
-		var that = $(this).resizable( "instance" );
7998
-		if (that.ghost) {
7999
-			that.ghost.css({
8000
-				position: "relative",
8001
-				height: that.size.height,
8002
-				width: that.size.width
8003
-			});
10231
+	_getRelativeOffset: function() {
10232
+		if ( this.cssPosition !== "relative" ) {
10233
+			return { top: 0, left: 0 };
8004 10234
 		}
10235
+
10236
+		var p = this.element.position(),
10237
+			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
10238
+
10239
+		return {
10240
+			top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
10241
+				( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ),
10242
+			left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
10243
+				( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 )
10244
+		};
10245
+
8005 10246
 	},
8006 10247
 
8007
-	stop: function() {
8008
-		var that = $(this).resizable( "instance" );
8009
-		if (that.ghost && that.helper) {
8010
-			that.helper.get(0).removeChild(that.ghost.get(0));
8011
-		}
8012
-	}
10248
+	_cacheMargins: function() {
10249
+		this.margins = {
10250
+			left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ),
10251
+			top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ),
10252
+			right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ),
10253
+			bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 )
10254
+		};
10255
+	},
8013 10256
 
8014
-});
10257
+	_cacheHelperProportions: function() {
10258
+		this.helperProportions = {
10259
+			width: this.helper.outerWidth(),
10260
+			height: this.helper.outerHeight()
10261
+		};
10262
+	},
8015 10263
 
8016
-$.ui.plugin.add("resizable", "grid", {
10264
+	_setContainment: function() {
8017 10265
 
8018
-	resize: function() {
8019
-		var outerDimensions,
8020
-			that = $(this).resizable( "instance" ),
8021
-			o = that.options,
8022
-			cs = that.size,
8023
-			os = that.originalSize,
8024
-			op = that.originalPosition,
8025
-			a = that.axis,
8026
-			grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
8027
-			gridX = (grid[0] || 1),
8028
-			gridY = (grid[1] || 1),
8029
-			ox = Math.round((cs.width - os.width) / gridX) * gridX,
8030
-			oy = Math.round((cs.height - os.height) / gridY) * gridY,
8031
-			newWidth = os.width + ox,
8032
-			newHeight = os.height + oy,
8033
-			isMaxWidth = o.maxWidth && (o.maxWidth < newWidth),
8034
-			isMaxHeight = o.maxHeight && (o.maxHeight < newHeight),
8035
-			isMinWidth = o.minWidth && (o.minWidth > newWidth),
8036
-			isMinHeight = o.minHeight && (o.minHeight > newHeight);
10266
+		var isUserScrollable, c, ce,
10267
+			o = this.options,
10268
+			document = this.document[ 0 ];
8037 10269
 
8038
-		o.grid = grid;
10270
+		this.relativeContainer = null;
8039 10271
 
8040
-		if (isMinWidth) {
8041
-			newWidth += gridX;
8042
-		}
8043
-		if (isMinHeight) {
8044
-			newHeight += gridY;
8045
-		}
8046
-		if (isMaxWidth) {
8047
-			newWidth -= gridX;
10272
+		if ( !o.containment ) {
10273
+			this.containment = null;
10274
+			return;
8048 10275
 		}
8049
-		if (isMaxHeight) {
8050
-			newHeight -= gridY;
10276
+
10277
+		if ( o.containment === "window" ) {
10278
+			this.containment = [
10279
+				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
10280
+				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
10281
+				$( window ).scrollLeft() + $( window ).width() -
10282
+					this.helperProportions.width - this.margins.left,
10283
+				$( window ).scrollTop() +
10284
+					( $( window ).height() || document.body.parentNode.scrollHeight ) -
10285
+					this.helperProportions.height - this.margins.top
10286
+			];
10287
+			return;
8051 10288
 		}
8052 10289
 
8053
-		if (/^(se|s|e)$/.test(a)) {
8054
-			that.size.width = newWidth;
8055
-			that.size.height = newHeight;
8056
-		} else if (/^(ne)$/.test(a)) {
8057
-			that.size.width = newWidth;
8058
-			that.size.height = newHeight;
8059
-			that.position.top = op.top - oy;
8060
-		} else if (/^(sw)$/.test(a)) {
8061
-			that.size.width = newWidth;
8062
-			that.size.height = newHeight;
8063
-			that.position.left = op.left - ox;
8064
-		} else {
8065
-			if ( newHeight - gridY <= 0 || newWidth - gridX <= 0) {
8066
-				outerDimensions = that._getPaddingPlusBorderDimensions( this );
10290
+		if ( o.containment === "document" ) {
10291
+			this.containment = [
10292
+				0,
10293
+				0,
10294
+				$( document ).width() - this.helperProportions.width - this.margins.left,
10295
+				( $( document ).height() || document.body.parentNode.scrollHeight ) -
10296
+					this.helperProportions.height - this.margins.top
10297
+			];
10298
+			return;
8067 10299
 		}
8068 10300
 
8069
-			if ( newHeight - gridY > 0 ) {
8070
-				that.size.height = newHeight;
8071
-				that.position.top = op.top - oy;
8072
-			} else {
8073
-				newHeight = gridY - outerDimensions.height;
8074
-				that.size.height = newHeight;
8075
-				that.position.top = op.top + os.height - newHeight;
10301
+		if ( o.containment.constructor === Array ) {
10302
+			this.containment = o.containment;
10303
+			return;
8076 10304
 		}
8077
-			if ( newWidth - gridX > 0 ) {
8078
-				that.size.width = newWidth;
8079
-				that.position.left = op.left - ox;
8080
-			} else {
8081
-				newWidth = gridX - outerDimensions.width;
8082
-				that.size.width = newWidth;
8083
-				that.position.left = op.left + os.width - newWidth;
10305
+
10306
+		if ( o.containment === "parent" ) {
10307
+			o.containment = this.helper[ 0 ].parentNode;
8084 10308
 		}
10309
+
10310
+		c = $( o.containment );
10311
+		ce = c[ 0 ];
10312
+
10313
+		if ( !ce ) {
10314
+			return;
8085 10315
 		}
10316
+
10317
+		isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
10318
+
10319
+		this.containment = [
10320
+			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) +
10321
+				( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
10322
+			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) +
10323
+				( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
10324
+			( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
10325
+				( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
10326
+				( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
10327
+				this.helperProportions.width -
10328
+				this.margins.left -
10329
+				this.margins.right,
10330
+			( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
10331
+				( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
10332
+				( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
10333
+				this.helperProportions.height -
10334
+				this.margins.top -
10335
+				this.margins.bottom
10336
+		];
10337
+		this.relativeContainer = c;
10338
+	},
10339
+
10340
+	_convertPositionTo: function( d, pos ) {
10341
+
10342
+		if ( !pos ) {
10343
+			pos = this.position;
8086 10344
 		}
8087 10345
 
8088
-});
10346
+		var mod = d === "absolute" ? 1 : -1,
10347
+			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] );
8089 10348
 
8090
-var resizable = $.ui.resizable;
10349
+		return {
10350
+			top: (
8091 10351
 
10352
+				// The absolute mouse position
10353
+				pos.top	+
8092 10354
 
8093
-/*!
8094
- * jQuery UI Dialog 1.11.4
8095
- * http://jqueryui.com
8096
- *
8097
- * Copyright jQuery Foundation and other contributors
8098
- * Released under the MIT license.
8099
- * http://jquery.org/license
8100
- *
8101
- * http://api.jqueryui.com/dialog/
8102
- */
10355
+				// Only for relative positioned nodes: Relative offset from element to offset parent
10356
+				this.offset.relative.top * mod +
8103 10357
 
10358
+				// The offsetParent's offset without borders (offset + border)
10359
+				this.offset.parent.top * mod -
10360
+				( ( this.cssPosition === "fixed" ?
10361
+					-this.offset.scroll.top :
10362
+					( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod )
10363
+			),
10364
+			left: (
8104 10365
 
8105
-var dialog = $.widget( "ui.dialog", {
8106
-	version: "1.11.4",
8107
-	options: {
8108
-		appendTo: "body",
8109
-		autoOpen: true,
8110
-		buttons: [],
8111
-		closeOnEscape: true,
8112
-		closeText: "Close",
8113
-		dialogClass: "",
8114
-		draggable: true,
8115
-		hide: null,
8116
-		height: "auto",
8117
-		maxHeight: null,
8118
-		maxWidth: null,
8119
-		minHeight: 150,
8120
-		minWidth: 150,
8121
-		modal: false,
8122
-		position: {
8123
-			my: "center",
8124
-			at: "center",
8125
-			of: window,
8126
-			collision: "fit",
8127
-			// Ensure the titlebar is always visible
8128
-			using: function( pos ) {
8129
-				var topOffset = $( this ).css( pos ).offset().top;
8130
-				if ( topOffset < 0 ) {
8131
-					$( this ).css( "top", pos.top - topOffset );
8132
-				}
8133
-			}
8134
-		},
8135
-		resizable: true,
8136
-		show: null,
8137
-		title: null,
8138
-		width: 300,
10366
+				// The absolute mouse position
10367
+				pos.left +
8139 10368
 
8140
-		// callbacks
8141
-		beforeClose: null,
8142
-		close: null,
8143
-		drag: null,
8144
-		dragStart: null,
8145
-		dragStop: null,
8146
-		focus: null,
8147
-		open: null,
8148
-		resize: null,
8149
-		resizeStart: null,
8150
-		resizeStop: null
8151
-	},
10369
+				// Only for relative positioned nodes: Relative offset from element to offset parent
10370
+				this.offset.relative.left * mod +
8152 10371
 
8153
-	sizeRelatedOptions: {
8154
-		buttons: true,
8155
-		height: true,
8156
-		maxHeight: true,
8157
-		maxWidth: true,
8158
-		minHeight: true,
8159
-		minWidth: true,
8160
-		width: true
8161
-	},
10372
+				// The offsetParent's offset without borders (offset + border)
10373
+				this.offset.parent.left * mod	-
10374
+				( ( this.cssPosition === "fixed" ?
10375
+					-this.offset.scroll.left :
10376
+					( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod )
10377
+			)
10378
+		};
8162 10379
 
8163
-	resizableRelatedOptions: {
8164
-		maxHeight: true,
8165
-		maxWidth: true,
8166
-		minHeight: true,
8167
-		minWidth: true
8168 10380
 	},
8169 10381
 
8170
-	_create: function() {
8171
-		this.originalCss = {
8172
-			display: this.element[ 0 ].style.display,
8173
-			width: this.element[ 0 ].style.width,
8174
-			minHeight: this.element[ 0 ].style.minHeight,
8175
-			maxHeight: this.element[ 0 ].style.maxHeight,
8176
-			height: this.element[ 0 ].style.height
8177
-		};
8178
-		this.originalPosition = {
8179
-			parent: this.element.parent(),
8180
-			index: this.element.parent().children().index( this.element )
8181
-		};
8182
-		this.originalTitle = this.element.attr( "title" );
8183
-		this.options.title = this.options.title || this.originalTitle;
10382
+	_generatePosition: function( event, constrainPosition ) {
8184 10383
 
8185
-		this._createWrapper();
10384
+		var containment, co, top, left,
10385
+			o = this.options,
10386
+			scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ),
10387
+			pageX = event.pageX,
10388
+			pageY = event.pageY;
10389
+
10390
+		// Cache the scroll
10391
+		if ( !scrollIsRootNode || !this.offset.scroll ) {
10392
+			this.offset.scroll = {
10393
+				top: this.scrollParent.scrollTop(),
10394
+				left: this.scrollParent.scrollLeft()
10395
+			};
10396
+		}
8186 10397
 
8187
-		this.element
8188
-			.show()
8189
-			.removeAttr( "title" )
8190
-			.addClass( "ui-dialog-content ui-widget-content" )
8191
-			.appendTo( this.uiDialog );
10398
+		/*
10399
+		 * - Position constraining -
10400
+		 * Constrain the position to a mix of grid, containment.
10401
+		 */
8192 10402
 
8193
-		this._createTitlebar();
8194
-		this._createButtonPane();
10403
+		// If we are not dragging yet, we won't check for options
10404
+		if ( constrainPosition ) {
10405
+			if ( this.containment ) {
10406
+				if ( this.relativeContainer ) {
10407
+					co = this.relativeContainer.offset();
10408
+					containment = [
10409
+						this.containment[ 0 ] + co.left,
10410
+						this.containment[ 1 ] + co.top,
10411
+						this.containment[ 2 ] + co.left,
10412
+						this.containment[ 3 ] + co.top
10413
+					];
10414
+				} else {
10415
+					containment = this.containment;
10416
+				}
8195 10417
 
8196
-		if ( this.options.draggable && $.fn.draggable ) {
8197
-			this._makeDraggable();
10418
+				if ( event.pageX - this.offset.click.left < containment[ 0 ] ) {
10419
+					pageX = containment[ 0 ] + this.offset.click.left;
10420
+				}
10421
+				if ( event.pageY - this.offset.click.top < containment[ 1 ] ) {
10422
+					pageY = containment[ 1 ] + this.offset.click.top;
10423
+				}
10424
+				if ( event.pageX - this.offset.click.left > containment[ 2 ] ) {
10425
+					pageX = containment[ 2 ] + this.offset.click.left;
10426
+				}
10427
+				if ( event.pageY - this.offset.click.top > containment[ 3 ] ) {
10428
+					pageY = containment[ 3 ] + this.offset.click.top;
8198 10429
 				}
8199
-		if ( this.options.resizable && $.fn.resizable ) {
8200
-			this._makeResizable();
8201 10430
 			}
8202 10431
 
8203
-		this._isOpen = false;
10432
+			if ( o.grid ) {
8204 10433
 
8205
-		this._trackFocus();
8206
-	},
10434
+				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid
10435
+				// argument errors in IE (see ticket #6950)
10436
+				top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY -
10437
+					this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY;
10438
+				pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] ||
10439
+					top - this.offset.click.top > containment[ 3 ] ) ?
10440
+						top :
10441
+						( ( top - this.offset.click.top >= containment[ 1 ] ) ?
10442
+							top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top;
10443
+
10444
+				left = o.grid[ 0 ] ? this.originalPageX +
10445
+					Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] :
10446
+					this.originalPageX;
10447
+				pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] ||
10448
+					left - this.offset.click.left > containment[ 2 ] ) ?
10449
+						left :
10450
+						( ( left - this.offset.click.left >= containment[ 0 ] ) ?
10451
+							left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left;
10452
+			}
8207 10453
 
8208
-	_init: function() {
8209
-		if ( this.options.autoOpen ) {
8210
-			this.open();
10454
+			if ( o.axis === "y" ) {
10455
+				pageX = this.originalPageX;
8211 10456
 			}
8212
-	},
8213 10457
 
8214
-	_appendTo: function() {
8215
-		var element = this.options.appendTo;
8216
-		if ( element && (element.jquery || element.nodeType) ) {
8217
-			return $( element );
10458
+			if ( o.axis === "x" ) {
10459
+				pageY = this.originalPageY;
10460
+			}
8218 10461
 		}
8219
-		return this.document.find( element || "body" ).eq( 0 );
8220
-	},
8221 10462
 
8222
-	_destroy: function() {
8223
-		var next,
8224
-			originalPosition = this.originalPosition;
10463
+		return {
10464
+			top: (
8225 10465
 
8226
-		this._untrackInstance();
8227
-		this._destroyOverlay();
10466
+				// The absolute mouse position
10467
+				pageY -
8228 10468
 
8229
-		this.element
8230
-			.removeUniqueId()
8231
-			.removeClass( "ui-dialog-content ui-widget-content" )
8232
-			.css( this.originalCss )
8233
-			// Without detaching first, the following becomes really slow
8234
-			.detach();
10469
+				// Click offset (relative to the element)
10470
+				this.offset.click.top -
8235 10471
 
8236
-		this.uiDialog.stop( true, true ).remove();
10472
+				// Only for relative positioned nodes: Relative offset from element to offset parent
10473
+				this.offset.relative.top -
8237 10474
 
8238
-		if ( this.originalTitle ) {
8239
-			this.element.attr( "title", this.originalTitle );
8240
-		}
10475
+				// The offsetParent's offset without borders (offset + border)
10476
+				this.offset.parent.top +
10477
+				( this.cssPosition === "fixed" ?
10478
+					-this.offset.scroll.top :
10479
+					( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
10480
+			),
10481
+			left: (
8241 10482
 
8242
-		next = originalPosition.parent.children().eq( originalPosition.index );
8243
-		// Don't try to place the dialog next to itself (#8613)
8244
-		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
8245
-			next.before( this.element );
8246
-		} else {
8247
-			originalPosition.parent.append( this.element );
8248
-		}
8249
-	},
10483
+				// The absolute mouse position
10484
+				pageX -
8250 10485
 
8251
-	widget: function() {
8252
-		return this.uiDialog;
8253
-	},
10486
+				// Click offset (relative to the element)
10487
+				this.offset.click.left -
8254 10488
 
8255
-	disable: $.noop,
8256
-	enable: $.noop,
10489
+				// Only for relative positioned nodes: Relative offset from element to offset parent
10490
+				this.offset.relative.left -
8257 10491
 
8258
-	close: function( event ) {
8259
-		var activeElement,
8260
-			that = this;
10492
+				// The offsetParent's offset without borders (offset + border)
10493
+				this.offset.parent.left +
10494
+				( this.cssPosition === "fixed" ?
10495
+					-this.offset.scroll.left :
10496
+					( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
10497
+			)
10498
+		};
8261 10499
 
8262
-		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
8263
-			return;
10500
+	},
10501
+
10502
+	_clear: function() {
10503
+		this._removeClass( this.helper, "ui-draggable-dragging" );
10504
+		if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) {
10505
+			this.helper.remove();
10506
+		}
10507
+		this.helper = null;
10508
+		this.cancelHelperRemoval = false;
10509
+		if ( this.destroyOnClear ) {
10510
+			this.destroy();
8264 10511
 		}
10512
+	},
8265 10513
 
8266
-		this._isOpen = false;
8267
-		this._focusedElement = null;
8268
-		this._destroyOverlay();
8269
-		this._untrackInstance();
10514
+	// From now on bulk stuff - mainly helpers
8270 10515
 
8271
-		if ( !this.opener.filter( ":focusable" ).focus().length ) {
10516
+	_trigger: function( type, event, ui ) {
10517
+		ui = ui || this._uiHash();
10518
+		$.ui.plugin.call( this, type, [ event, ui, this ], true );
8272 10519
 
8273
-			// support: IE9
8274
-			// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
8275
-			try {
8276
-				activeElement = this.document[ 0 ].activeElement;
10520
+		// Absolute position and offset (see #6884 ) have to be recalculated after plugins
10521
+		if ( /^(drag|start|stop)/.test( type ) ) {
10522
+			this.positionAbs = this._convertPositionTo( "absolute" );
10523
+			ui.offset = this.positionAbs;
10524
+		}
10525
+		return $.Widget.prototype._trigger.call( this, type, event, ui );
10526
+	},
8277 10527
 
8278
-				// Support: IE9, IE10
8279
-				// If the <body> is blurred, IE will switch windows, see #4520
8280
-				if ( activeElement && activeElement.nodeName.toLowerCase() !== "body" ) {
10528
+	plugins: {},
8281 10529
 
8282
-					// Hiding a focused element doesn't trigger blur in WebKit
8283
-					// so in case we have nothing to focus on, explicitly blur the active element
8284
-					// https://bugs.webkit.org/show_bug.cgi?id=47182
8285
-					$( activeElement ).blur();
8286
-				}
8287
-			} catch ( error ) {}
10530
+	_uiHash: function() {
10531
+		return {
10532
+			helper: this.helper,
10533
+			position: this.position,
10534
+			originalPosition: this.originalPosition,
10535
+			offset: this.positionAbs
10536
+		};
8288 10537
 	}
8289 10538
 
8290
-		this._hide( this.uiDialog, this.options.hide, function() {
8291
-			that._trigger( "close", event );
8292 10539
 } );
8293
-	},
8294
-
8295
-	isOpen: function() {
8296
-		return this._isOpen;
8297
-	},
8298 10540
 
8299
-	moveToTop: function() {
8300
-		this._moveToTop();
8301
-	},
10541
+$.ui.plugin.add( "draggable", "connectToSortable", {
10542
+	start: function( event, ui, draggable ) {
10543
+		var uiSortable = $.extend( {}, ui, {
10544
+			item: draggable.element
10545
+		} );
8302 10546
 
8303
-	_moveToTop: function( event, silent ) {
8304
-		var moved = false,
8305
-			zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map(function() {
8306
-				return +$( this ).css( "z-index" );
8307
-			}).get(),
8308
-			zIndexMax = Math.max.apply( null, zIndices );
10547
+		draggable.sortables = [];
10548
+		$( draggable.options.connectToSortable ).each( function() {
10549
+			var sortable = $( this ).sortable( "instance" );
8309 10550
 
8310
-		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
8311
-			this.uiDialog.css( "z-index", zIndexMax + 1 );
8312
-			moved = true;
8313
-		}
10551
+			if ( sortable && !sortable.options.disabled ) {
10552
+				draggable.sortables.push( sortable );
8314 10553
 
8315
-		if ( moved && !silent ) {
8316
-			this._trigger( "focus", event );
10554
+				// RefreshPositions is called at drag start to refresh the containerCache
10555
+				// which is used in drag. This ensures it's initialized and synchronized
10556
+				// with any changes that might have happened on the page since initialization.
10557
+				sortable.refreshPositions();
10558
+				sortable._trigger( "activate", event, uiSortable );
8317 10559
 			}
8318
-		return moved;
10560
+		} );
8319 10561
 	},
10562
+	stop: function( event, ui, draggable ) {
10563
+		var uiSortable = $.extend( {}, ui, {
10564
+			item: draggable.element
10565
+		} );
8320 10566
 
8321
-	open: function() {
8322
-		var that = this;
8323
-		if ( this._isOpen ) {
8324
-			if ( this._moveToTop() ) {
8325
-				this._focusTabbable();
8326
-			}
8327
-			return;
8328
-		}
10567
+		draggable.cancelHelperRemoval = false;
8329 10568
 
8330
-		this._isOpen = true;
8331
-		this.opener = $( this.document[ 0 ].activeElement );
10569
+		$.each( draggable.sortables, function() {
10570
+			var sortable = this;
8332 10571
 
8333
-		this._size();
8334
-		this._position();
8335
-		this._createOverlay();
8336
-		this._moveToTop( null, true );
10572
+			if ( sortable.isOver ) {
10573
+				sortable.isOver = 0;
8337 10574
 
8338
-		// Ensure the overlay is moved to the top with the dialog, but only when
8339
-		// opening. The overlay shouldn't move after the dialog is open so that
8340
-		// modeless dialogs opened after the modal dialog stack properly.
8341
-		if ( this.overlay ) {
8342
-			this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
8343
-		}
10575
+				// Allow this sortable to handle removing the helper
10576
+				draggable.cancelHelperRemoval = true;
10577
+				sortable.cancelHelperRemoval = false;
8344 10578
 
8345
-		this._show( this.uiDialog, this.options.show, function() {
8346
-			that._focusTabbable();
8347
-			that._trigger( "focus" );
8348
-		});
10579
+				// Use _storedCSS To restore properties in the sortable,
10580
+				// as this also handles revert (#9675) since the draggable
10581
+				// may have modified them in unexpected ways (#8809)
10582
+				sortable._storedCSS = {
10583
+					position: sortable.placeholder.css( "position" ),
10584
+					top: sortable.placeholder.css( "top" ),
10585
+					left: sortable.placeholder.css( "left" )
10586
+				};
8349 10587
 
8350
-		// Track the dialog immediately upon openening in case a focus event
8351
-		// somehow occurs outside of the dialog before an element inside the
8352
-		// dialog is focused (#10152)
8353
-		this._makeFocusTarget();
10588
+				sortable._mouseStop( event );
8354 10589
 
8355
-		this._trigger( "open" );
8356
-	},
10590
+				// Once drag has ended, the sortable should return to using
10591
+				// its original helper, not the shared helper from draggable
10592
+				sortable.options.helper = sortable.options._helper;
10593
+			} else {
8357 10594
 
8358
-	_focusTabbable: function() {
8359
-		// Set focus to the first match:
8360
-		// 1. An element that was focused previously
8361
-		// 2. First element inside the dialog matching [autofocus]
8362
-		// 3. Tabbable element inside the content element
8363
-		// 4. Tabbable element inside the buttonpane
8364
-		// 5. The close button
8365
-		// 6. The dialog itself
8366
-		var hasFocus = this._focusedElement;
8367
-		if ( !hasFocus ) {
8368
-			hasFocus = this.element.find( "[autofocus]" );
8369
-		}
8370
-		if ( !hasFocus.length ) {
8371
-			hasFocus = this.element.find( ":tabbable" );
8372
-		}
8373
-		if ( !hasFocus.length ) {
8374
-			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
8375
-		}
8376
-		if ( !hasFocus.length ) {
8377
-			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
8378
-		}
8379
-		if ( !hasFocus.length ) {
8380
-			hasFocus = this.uiDialog;
8381
-		}
8382
-		hasFocus.eq( 0 ).focus();
8383
-	},
10595
+				// Prevent this Sortable from removing the helper.
10596
+				// However, don't set the draggable to remove the helper
10597
+				// either as another connected Sortable may yet handle the removal.
10598
+				sortable.cancelHelperRemoval = true;
8384 10599
 
8385
-	_keepFocus: function( event ) {
8386
-		function checkFocus() {
8387
-			var activeElement = this.document[0].activeElement,
8388
-				isActive = this.uiDialog[0] === activeElement ||
8389
-					$.contains( this.uiDialog[0], activeElement );
8390
-			if ( !isActive ) {
8391
-				this._focusTabbable();
8392
-			}
10600
+				sortable._trigger( "deactivate", event, uiSortable );
8393 10601
 			}
8394
-		event.preventDefault();
8395
-		checkFocus.call( this );
8396
-		// support: IE
8397
-		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
8398
-		// so we check again later
8399
-		this._delay( checkFocus );
10602
+		} );
8400 10603
 	},
10604
+	drag: function( event, ui, draggable ) {
10605
+		$.each( draggable.sortables, function() {
10606
+			var innermostIntersecting = false,
10607
+				sortable = this;
8401 10608
 
8402
-	_createWrapper: function() {
8403
-		this.uiDialog = $("<div>")
8404
-			.addClass( "ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " +
8405
-				this.options.dialogClass )
8406
-			.hide()
8407
-			.attr({
8408
-				// Setting tabIndex makes the div focusable
8409
-				tabIndex: -1,
8410
-				role: "dialog"
8411
-			})
8412
-			.appendTo( this._appendTo() );
10609
+			// Copy over variables that sortable's _intersectsWith uses
10610
+			sortable.positionAbs = draggable.positionAbs;
10611
+			sortable.helperProportions = draggable.helperProportions;
10612
+			sortable.offset.click = draggable.offset.click;
8413 10613
 
8414
-		this._on( this.uiDialog, {
8415
-			keydown: function( event ) {
8416
-				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
8417
-						event.keyCode === $.ui.keyCode.ESCAPE ) {
8418
-					event.preventDefault();
8419
-					this.close( event );
8420
-					return;
8421
-				}
10614
+			if ( sortable._intersectsWith( sortable.containerCache ) ) {
10615
+				innermostIntersecting = true;
8422 10616
 
8423
-				// prevent tabbing out of dialogs
8424
-				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
8425
-					return;
8426
-				}
8427
-				var tabbables = this.uiDialog.find( ":tabbable" ),
8428
-					first = tabbables.filter( ":first" ),
8429
-					last = tabbables.filter( ":last" );
10617
+				$.each( draggable.sortables, function() {
8430 10618
 
8431
-				if ( ( event.target === last[0] || event.target === this.uiDialog[0] ) && !event.shiftKey ) {
8432
-					this._delay(function() {
8433
-						first.focus();
8434
-					});
8435
-					event.preventDefault();
8436
-				} else if ( ( event.target === first[0] || event.target === this.uiDialog[0] ) && event.shiftKey ) {
8437
-					this._delay(function() {
8438
-						last.focus();
8439
-					});
8440
-					event.preventDefault();
8441
-				}
8442
-			},
8443
-			mousedown: function( event ) {
8444
-				if ( this._moveToTop( event ) ) {
8445
-					this._focusTabbable();
8446
-				}
10619
+					// Copy over variables that sortable's _intersectsWith uses
10620
+					this.positionAbs = draggable.positionAbs;
10621
+					this.helperProportions = draggable.helperProportions;
10622
+					this.offset.click = draggable.offset.click;
10623
+
10624
+					if ( this !== sortable &&
10625
+							this._intersectsWith( this.containerCache ) &&
10626
+							$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
10627
+						innermostIntersecting = false;
8447 10628
 					}
8448
-		});
8449 10629
 
8450
-		// We assume that any existing aria-describedby attribute means
8451
-		// that the dialog content is marked up properly
8452
-		// otherwise we brute force the content as the description
8453
-		if ( !this.element.find( "[aria-describedby]" ).length ) {
8454
-			this.uiDialog.attr({
8455
-				"aria-describedby": this.element.uniqueId().attr( "id" )
10630
+					return innermostIntersecting;
8456 10631
 				} );
8457 10632
 			}
8458
-	},
8459 10633
 
8460
-	_createTitlebar: function() {
8461
-		var uiDialogTitle;
10634
+			if ( innermostIntersecting ) {
8462 10635
 
8463
-		this.uiDialogTitlebar = $( "<div>" )
8464
-			.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
8465
-			.prependTo( this.uiDialog );
8466
-		this._on( this.uiDialogTitlebar, {
8467
-			mousedown: function( event ) {
8468
-				// Don't prevent click on close button (#8838)
8469
-				// Focusing a dialog that is partially scrolled out of view
8470
-				// causes the browser to scroll it into view, preventing the click event
8471
-				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
8472
-					// Dialog isn't getting focus when dragging (#8063)
8473
-					this.uiDialog.focus();
8474
-				}
8475
-			}
8476
-		});
10636
+				// If it intersects, we use a little isOver variable and set it once,
10637
+				// so that the move-in stuff gets fired only once.
10638
+				if ( !sortable.isOver ) {
10639
+					sortable.isOver = 1;
8477 10640
 
8478
-		// support: IE
8479
-		// Use type="button" to prevent enter keypresses in textboxes from closing the
8480
-		// dialog in IE (#9312)
8481
-		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
8482
-			.button({
8483
-				label: this.options.closeText,
8484
-				icons: {
8485
-					primary: "ui-icon-closethick"
8486
-				},
8487
-				text: false
8488
-			})
8489
-			.addClass( "ui-dialog-titlebar-close" )
8490
-			.appendTo( this.uiDialogTitlebar );
8491
-		this._on( this.uiDialogTitlebarClose, {
8492
-			click: function( event ) {
8493
-				event.preventDefault();
8494
-				this.close( event );
8495
-			}
8496
-		});
10641
+					// Store draggable's parent in case we need to reappend to it later.
10642
+					draggable._parent = ui.helper.parent();
8497 10643
 
8498
-		uiDialogTitle = $( "<span>" )
8499
-			.uniqueId()
8500
-			.addClass( "ui-dialog-title" )
8501
-			.prependTo( this.uiDialogTitlebar );
8502
-		this._title( uiDialogTitle );
10644
+					sortable.currentItem = ui.helper
10645
+						.appendTo( sortable.element )
10646
+						.data( "ui-sortable-item", true );
8503 10647
 
8504
-		this.uiDialog.attr({
8505
-			"aria-labelledby": uiDialogTitle.attr( "id" )
10648
+					// Store helper option to later restore it
10649
+					sortable.options._helper = sortable.options.helper;
10650
+
10651
+					sortable.options.helper = function() {
10652
+						return ui.helper[ 0 ];
10653
+					};
10654
+
10655
+					// Fire the start events of the sortable with our passed browser event,
10656
+					// and our own helper (so it doesn't create a new one)
10657
+					event.target = sortable.currentItem[ 0 ];
10658
+					sortable._mouseCapture( event, true );
10659
+					sortable._mouseStart( event, true, true );
10660
+
10661
+					// Because the browser event is way off the new appended portlet,
10662
+					// modify necessary variables to reflect the changes
10663
+					sortable.offset.click.top = draggable.offset.click.top;
10664
+					sortable.offset.click.left = draggable.offset.click.left;
10665
+					sortable.offset.parent.left -= draggable.offset.parent.left -
10666
+						sortable.offset.parent.left;
10667
+					sortable.offset.parent.top -= draggable.offset.parent.top -
10668
+						sortable.offset.parent.top;
10669
+
10670
+					draggable._trigger( "toSortable", event );
10671
+
10672
+					// Inform draggable that the helper is in a valid drop zone,
10673
+					// used solely in the revert option to handle "valid/invalid".
10674
+					draggable.dropped = sortable.element;
10675
+
10676
+					// Need to refreshPositions of all sortables in the case that
10677
+					// adding to one sortable changes the location of the other sortables (#9675)
10678
+					$.each( draggable.sortables, function() {
10679
+						this.refreshPositions();
8506 10680
 					} );
8507
-	},
8508 10681
 
8509
-	_title: function( title ) {
8510
-		if ( !this.options.title ) {
8511
-			title.html( "&#160;" );
10682
+					// Hack so receive/update callbacks work (mostly)
10683
+					draggable.currentItem = draggable.element;
10684
+					sortable.fromOutside = draggable;
8512 10685
 				}
8513
-		title.text( this.options.title );
8514
-	},
8515 10686
 
8516
-	_createButtonPane: function() {
8517
-		this.uiDialogButtonPane = $( "<div>" )
8518
-			.addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
10687
+				if ( sortable.currentItem ) {
10688
+					sortable._mouseDrag( event );
8519 10689
 
8520
-		this.uiButtonSet = $( "<div>" )
8521
-			.addClass( "ui-dialog-buttonset" )
8522
-			.appendTo( this.uiDialogButtonPane );
10690
+					// Copy the sortable's position because the draggable's can potentially reflect
10691
+					// a relative position, while sortable is always absolute, which the dragged
10692
+					// element has now become. (#8809)
10693
+					ui.position = sortable.position;
10694
+				}
10695
+			} else {
8523 10696
 
8524
-		this._createButtons();
8525
-	},
10697
+				// If it doesn't intersect with the sortable, and it intersected before,
10698
+				// we fake the drag stop of the sortable, but make sure it doesn't remove
10699
+				// the helper by using cancelHelperRemoval.
10700
+				if ( sortable.isOver ) {
8526 10701
 
8527
-	_createButtons: function() {
8528
-		var that = this,
8529
-			buttons = this.options.buttons;
10702
+					sortable.isOver = 0;
10703
+					sortable.cancelHelperRemoval = true;
8530 10704
 
8531
-		// if we already have a button pane, remove it
8532
-		this.uiDialogButtonPane.remove();
8533
-		this.uiButtonSet.empty();
10705
+					// Calling sortable's mouseStop would trigger a revert,
10706
+					// so revert must be temporarily false until after mouseStop is called.
10707
+					sortable.options._revert = sortable.options.revert;
10708
+					sortable.options.revert = false;
8534 10709
 
8535
-		if ( $.isEmptyObject( buttons ) || ($.isArray( buttons ) && !buttons.length) ) {
8536
-			this.uiDialog.removeClass( "ui-dialog-buttons" );
8537
-			return;
10710
+					sortable._trigger( "out", event, sortable._uiHash( sortable ) );
10711
+					sortable._mouseStop( event, true );
10712
+
10713
+					// Restore sortable behaviors that were modfied
10714
+					// when the draggable entered the sortable area (#9481)
10715
+					sortable.options.revert = sortable.options._revert;
10716
+					sortable.options.helper = sortable.options._helper;
10717
+
10718
+					if ( sortable.placeholder ) {
10719
+						sortable.placeholder.remove();
8538 10720
 					}
8539 10721
 
8540
-		$.each( buttons, function( name, props ) {
8541
-			var click, buttonOptions;
8542
-			props = $.isFunction( props ) ?
8543
-				{ click: props, text: name } :
8544
-				props;
8545
-			// Default to a non-submitting button
8546
-			props = $.extend( { type: "button" }, props );
8547
-			// Change the context for the click callback to be the main element
8548
-			click = props.click;
8549
-			props.click = function() {
8550
-				click.apply( that.element[ 0 ], arguments );
8551
-			};
8552
-			buttonOptions = {
8553
-				icons: props.icons,
8554
-				text: props.showText
8555
-			};
8556
-			delete props.icons;
8557
-			delete props.showText;
8558
-			$( "<button></button>", props )
8559
-				.button( buttonOptions )
8560
-				.appendTo( that.uiButtonSet );
10722
+					// Restore and recalculate the draggable's offset considering the sortable
10723
+					// may have modified them in unexpected ways. (#8809, #10669)
10724
+					ui.helper.appendTo( draggable._parent );
10725
+					draggable._refreshOffsets( event );
10726
+					ui.position = draggable._generatePosition( event, true );
10727
+
10728
+					draggable._trigger( "fromSortable", event );
10729
+
10730
+					// Inform draggable that the helper is no longer in a valid drop zone
10731
+					draggable.dropped = false;
10732
+
10733
+					// Need to refreshPositions of all sortables just in case removing
10734
+					// from one sortable changes the location of other sortables (#9675)
10735
+					$.each( draggable.sortables, function() {
10736
+						this.refreshPositions();
10737
+					} );
10738
+				}
10739
+			}
10740
+		} );
10741
+	}
8561 10742
 } );
8562
-		this.uiDialog.addClass( "ui-dialog-buttons" );
8563
-		this.uiDialogButtonPane.appendTo( this.uiDialog );
8564
-	},
8565 10743
 
8566
-	_makeDraggable: function() {
8567
-		var that = this,
8568
-			options = this.options;
10744
+$.ui.plugin.add( "draggable", "cursor", {
10745
+	start: function( event, ui, instance ) {
10746
+		var t = $( "body" ),
10747
+			o = instance.options;
8569 10748
 
8570
-		function filteredUi( ui ) {
8571
-			return {
8572
-				position: ui.position,
8573
-				offset: ui.offset
8574
-			};
10749
+		if ( t.css( "cursor" ) ) {
10750
+			o._cursor = t.css( "cursor" );
10751
+		}
10752
+		t.css( "cursor", o.cursor );
10753
+	},
10754
+	stop: function( event, ui, instance ) {
10755
+		var o = instance.options;
10756
+		if ( o._cursor ) {
10757
+			$( "body" ).css( "cursor", o._cursor );
10758
+		}
8575 10759
 	}
10760
+} );
8576 10761
 
8577
-		this.uiDialog.draggable({
8578
-			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
8579
-			handle: ".ui-dialog-titlebar",
8580
-			containment: "document",
8581
-			start: function( event, ui ) {
8582
-				$( this ).addClass( "ui-dialog-dragging" );
8583
-				that._blockFrames();
8584
-				that._trigger( "dragStart", event, filteredUi( ui ) );
8585
-			},
8586
-			drag: function( event, ui ) {
8587
-				that._trigger( "drag", event, filteredUi( ui ) );
10762
+$.ui.plugin.add( "draggable", "opacity", {
10763
+	start: function( event, ui, instance ) {
10764
+		var t = $( ui.helper ),
10765
+			o = instance.options;
10766
+		if ( t.css( "opacity" ) ) {
10767
+			o._opacity = t.css( "opacity" );
10768
+		}
10769
+		t.css( "opacity", o.opacity );
8588 10770
 	},
8589
-			stop: function( event, ui ) {
8590
-				var left = ui.offset.left - that.document.scrollLeft(),
8591
-					top = ui.offset.top - that.document.scrollTop();
8592
-
8593
-				options.position = {
8594
-					my: "left top",
8595
-					at: "left" + (left >= 0 ? "+" : "") + left + " " +
8596
-						"top" + (top >= 0 ? "+" : "") + top,
8597
-					of: that.window
8598
-				};
8599
-				$( this ).removeClass( "ui-dialog-dragging" );
8600
-				that._unblockFrames();
8601
-				that._trigger( "dragStop", event, filteredUi( ui ) );
10771
+	stop: function( event, ui, instance ) {
10772
+		var o = instance.options;
10773
+		if ( o._opacity ) {
10774
+			$( ui.helper ).css( "opacity", o._opacity );
10775
+		}
8602 10776
 	}
8603 10777
 } );
8604
-	},
8605
-
8606
-	_makeResizable: function() {
8607
-		var that = this,
8608
-			options = this.options,
8609
-			handles = options.resizable,
8610
-			// .ui-resizable has position: relative defined in the stylesheet
8611
-			// but dialogs have to use absolute or fixed positioning
8612
-			position = this.uiDialog.css("position"),
8613
-			resizeHandles = typeof handles === "string" ?
8614
-				handles	:
8615
-				"n,e,s,w,se,sw,ne,nw";
8616 10778
 
8617
-		function filteredUi( ui ) {
8618
-			return {
8619
-				originalPosition: ui.originalPosition,
8620
-				originalSize: ui.originalSize,
8621
-				position: ui.position,
8622
-				size: ui.size
8623
-			};
10779
+$.ui.plugin.add( "draggable", "scroll", {
10780
+	start: function( event, ui, i ) {
10781
+		if ( !i.scrollParentNotHidden ) {
10782
+			i.scrollParentNotHidden = i.helper.scrollParent( false );
8624 10783
 		}
8625 10784
 
8626
-		this.uiDialog.resizable({
8627
-			cancel: ".ui-dialog-content",
8628
-			containment: "document",
8629
-			alsoResize: this.element,
8630
-			maxWidth: options.maxWidth,
8631
-			maxHeight: options.maxHeight,
8632
-			minWidth: options.minWidth,
8633
-			minHeight: this._minHeight(),
8634
-			handles: resizeHandles,
8635
-			start: function( event, ui ) {
8636
-				$( this ).addClass( "ui-dialog-resizing" );
8637
-				that._blockFrames();
8638
-				that._trigger( "resizeStart", event, filteredUi( ui ) );
8639
-			},
8640
-			resize: function( event, ui ) {
8641
-				that._trigger( "resize", event, filteredUi( ui ) );
10785
+		if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] &&
10786
+				i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) {
10787
+			i.overflowOffset = i.scrollParentNotHidden.offset();
10788
+		}
8642 10789
 	},
8643
-			stop: function( event, ui ) {
8644
-				var offset = that.uiDialog.offset(),
8645
-					left = offset.left - that.document.scrollLeft(),
8646
-					top = offset.top - that.document.scrollTop();
10790
+	drag: function( event, ui, i  ) {
8647 10791
 
8648
-				options.height = that.uiDialog.height();
8649
-				options.width = that.uiDialog.width();
8650
-				options.position = {
8651
-					my: "left top",
8652
-					at: "left" + (left >= 0 ? "+" : "") + left + " " +
8653
-						"top" + (top >= 0 ? "+" : "") + top,
8654
-					of: that.window
8655
-				};
8656
-				$( this ).removeClass( "ui-dialog-resizing" );
8657
-				that._unblockFrames();
8658
-				that._trigger( "resizeStop", event, filteredUi( ui ) );
10792
+		var o = i.options,
10793
+			scrolled = false,
10794
+			scrollParent = i.scrollParentNotHidden[ 0 ],
10795
+			document = i.document[ 0 ];
10796
+
10797
+		if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) {
10798
+			if ( !o.axis || o.axis !== "x" ) {
10799
+				if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY <
10800
+						o.scrollSensitivity ) {
10801
+					scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed;
10802
+				} else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) {
10803
+					scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed;
10804
+				}
8659 10805
 			}
8660
-		})
8661
-		.css( "position", position );
8662
-	},
8663 10806
 
8664
-	_trackFocus: function() {
8665
-		this._on( this.widget(), {
8666
-			focusin: function( event ) {
8667
-				this._makeFocusTarget();
8668
-				this._focusedElement = $( event.target );
10807
+			if ( !o.axis || o.axis !== "y" ) {
10808
+				if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX <
10809
+						o.scrollSensitivity ) {
10810
+					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed;
10811
+				} else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) {
10812
+					scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed;
10813
+				}
8669 10814
 			}
8670
-		});
8671
-	},
8672 10815
 
8673
-	_makeFocusTarget: function() {
8674
-		this._untrackInstance();
8675
-		this._trackingInstances().unshift( this );
8676
-	},
10816
+		} else {
8677 10817
 
8678
-	_untrackInstance: function() {
8679
-		var instances = this._trackingInstances(),
8680
-			exists = $.inArray( this, instances );
8681
-		if ( exists !== -1 ) {
8682
-			instances.splice( exists, 1 );
10818
+			if ( !o.axis || o.axis !== "x" ) {
10819
+				if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) {
10820
+					scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed );
10821
+				} else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) <
10822
+						o.scrollSensitivity ) {
10823
+					scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed );
10824
+				}
8683 10825
 			}
8684
-	},
8685 10826
 
8686
-	_trackingInstances: function() {
8687
-		var instances = this.document.data( "ui-dialog-instances" );
8688
-		if ( !instances ) {
8689
-			instances = [];
8690
-			this.document.data( "ui-dialog-instances", instances );
10827
+			if ( !o.axis || o.axis !== "y" ) {
10828
+				if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) {
10829
+					scrolled = $( document ).scrollLeft(
10830
+						$( document ).scrollLeft() - o.scrollSpeed
10831
+					);
10832
+				} else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) <
10833
+						o.scrollSensitivity ) {
10834
+					scrolled = $( document ).scrollLeft(
10835
+						$( document ).scrollLeft() + o.scrollSpeed
10836
+					);
10837
+				}
8691 10838
 			}
8692
-		return instances;
8693
-	},
8694 10839
 
8695
-	_minHeight: function() {
8696
-		var options = this.options;
10840
+		}
8697 10841
 
8698
-		return options.height === "auto" ?
8699
-			options.minHeight :
8700
-			Math.min( options.minHeight, options.height );
8701
-	},
10842
+		if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) {
10843
+			$.ui.ddmanager.prepareOffsets( i, event );
10844
+		}
8702 10845
 
8703
-	_position: function() {
8704
-		// Need to show the dialog to get the actual offset in the position plugin
8705
-		var isVisible = this.uiDialog.is( ":visible" );
8706
-		if ( !isVisible ) {
8707
-			this.uiDialog.show();
8708 10846
 	}
8709
-		this.uiDialog.position( this.options.position );
8710
-		if ( !isVisible ) {
8711
-			this.uiDialog.hide();
10847
+} );
10848
+
10849
+$.ui.plugin.add( "draggable", "snap", {
10850
+	start: function( event, ui, i ) {
10851
+
10852
+		var o = i.options;
10853
+
10854
+		i.snapElements = [];
10855
+
10856
+		$( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap )
10857
+			.each( function() {
10858
+				var $t = $( this ),
10859
+					$o = $t.offset();
10860
+				if ( this !== i.element[ 0 ] ) {
10861
+					i.snapElements.push( {
10862
+						item: this,
10863
+						width: $t.outerWidth(), height: $t.outerHeight(),
10864
+						top: $o.top, left: $o.left
10865
+					} );
8712 10866
 				}
10867
+			} );
10868
+
8713 10869
 	},
10870
+	drag: function( event, ui, inst ) {
8714 10871
 
8715
-	_setOptions: function( options ) {
8716
-		var that = this,
8717
-			resize = false,
8718
-			resizableOptions = {};
10872
+		var ts, bs, ls, rs, l, r, t, b, i, first,
10873
+			o = inst.options,
10874
+			d = o.snapTolerance,
10875
+			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
10876
+			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
8719 10877
 
8720
-		$.each( options, function( key, value ) {
8721
-			that._setOption( key, value );
10878
+		for ( i = inst.snapElements.length - 1; i >= 0; i-- ) {
8722 10879
 
8723
-			if ( key in that.sizeRelatedOptions ) {
8724
-				resize = true;
10880
+			l = inst.snapElements[ i ].left - inst.margins.left;
10881
+			r = l + inst.snapElements[ i ].width;
10882
+			t = inst.snapElements[ i ].top - inst.margins.top;
10883
+			b = t + inst.snapElements[ i ].height;
10884
+
10885
+			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d ||
10886
+					!$.contains( inst.snapElements[ i ].item.ownerDocument,
10887
+					inst.snapElements[ i ].item ) ) {
10888
+				if ( inst.snapElements[ i ].snapping ) {
10889
+					if ( inst.options.snap.release ) {
10890
+						inst.options.snap.release.call(
10891
+							inst.element,
10892
+							event,
10893
+							$.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } )
10894
+						);
8725 10895
 					}
8726
-			if ( key in that.resizableRelatedOptions ) {
8727
-				resizableOptions[ key ] = value;
8728 10896
 				}
8729
-		});
10897
+				inst.snapElements[ i ].snapping = false;
10898
+				continue;
10899
+			}
8730 10900
 
8731
-		if ( resize ) {
8732
-			this._size();
8733
-			this._position();
10901
+			if ( o.snapMode !== "inner" ) {
10902
+				ts = Math.abs( t - y2 ) <= d;
10903
+				bs = Math.abs( b - y1 ) <= d;
10904
+				ls = Math.abs( l - x2 ) <= d;
10905
+				rs = Math.abs( r - x1 ) <= d;
10906
+				if ( ts ) {
10907
+					ui.position.top = inst._convertPositionTo( "relative", {
10908
+						top: t - inst.helperProportions.height,
10909
+						left: 0
10910
+					} ).top;
10911
+				}
10912
+				if ( bs ) {
10913
+					ui.position.top = inst._convertPositionTo( "relative", {
10914
+						top: b,
10915
+						left: 0
10916
+					} ).top;
10917
+				}
10918
+				if ( ls ) {
10919
+					ui.position.left = inst._convertPositionTo( "relative", {
10920
+						top: 0,
10921
+						left: l - inst.helperProportions.width
10922
+					} ).left;
10923
+				}
10924
+				if ( rs ) {
10925
+					ui.position.left = inst._convertPositionTo( "relative", {
10926
+						top: 0,
10927
+						left: r
10928
+					} ).left;
8734 10929
 				}
8735
-		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
8736
-			this.uiDialog.resizable( "option", resizableOptions );
8737 10930
 			}
8738
-	},
8739 10931
 
8740
-	_setOption: function( key, value ) {
8741
-		var isDraggable, isResizable,
8742
-			uiDialog = this.uiDialog;
10932
+			first = ( ts || bs || ls || rs );
8743 10933
 
8744
-		if ( key === "dialogClass" ) {
8745
-			uiDialog
8746
-				.removeClass( this.options.dialogClass )
8747
-				.addClass( value );
10934
+			if ( o.snapMode !== "outer" ) {
10935
+				ts = Math.abs( t - y1 ) <= d;
10936
+				bs = Math.abs( b - y2 ) <= d;
10937
+				ls = Math.abs( l - x1 ) <= d;
10938
+				rs = Math.abs( r - x2 ) <= d;
10939
+				if ( ts ) {
10940
+					ui.position.top = inst._convertPositionTo( "relative", {
10941
+						top: t,
10942
+						left: 0
10943
+					} ).top;
10944
+				}
10945
+				if ( bs ) {
10946
+					ui.position.top = inst._convertPositionTo( "relative", {
10947
+						top: b - inst.helperProportions.height,
10948
+						left: 0
10949
+					} ).top;
10950
+				}
10951
+				if ( ls ) {
10952
+					ui.position.left = inst._convertPositionTo( "relative", {
10953
+						top: 0,
10954
+						left: l
10955
+					} ).left;
10956
+				}
10957
+				if ( rs ) {
10958
+					ui.position.left = inst._convertPositionTo( "relative", {
10959
+						top: 0,
10960
+						left: r - inst.helperProportions.width
10961
+					} ).left;
8748 10962
 				}
8749
-
8750
-		if ( key === "disabled" ) {
8751
-			return;
8752 10963
 			}
8753 10964
 
8754
-		this._super( key, value );
8755
-
8756
-		if ( key === "appendTo" ) {
8757
-			this.uiDialog.appendTo( this._appendTo() );
10965
+			if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) {
10966
+				if ( inst.options.snap.snap ) {
10967
+					inst.options.snap.snap.call(
10968
+						inst.element,
10969
+						event,
10970
+						$.extend( inst._uiHash(), {
10971
+							snapItem: inst.snapElements[ i ].item
10972
+						} ) );
8758 10973
 				}
8759
-
8760
-		if ( key === "buttons" ) {
8761
-			this._createButtons();
8762 10974
 			}
10975
+			inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first );
8763 10976
 
8764
-		if ( key === "closeText" ) {
8765
-			this.uiDialogTitlebarClose.button({
8766
-				// Ensure that we always pass a string
8767
-				label: "" + value
8768
-			});
8769 10977
 		}
8770 10978
 
8771
-		if ( key === "draggable" ) {
8772
-			isDraggable = uiDialog.is( ":data(ui-draggable)" );
8773
-			if ( isDraggable && !value ) {
8774
-				uiDialog.draggable( "destroy" );
8775 10979
 	}
10980
+} );
8776 10981
 
8777
-			if ( !isDraggable && value ) {
8778
-				this._makeDraggable();
8779
-			}
8780
-		}
10982
+$.ui.plugin.add( "draggable", "stack", {
10983
+	start: function( event, ui, instance ) {
10984
+		var min,
10985
+			o = instance.options,
10986
+			group = $.makeArray( $( o.stack ) ).sort( function( a, b ) {
10987
+				return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) -
10988
+					( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 );
10989
+			} );
8781 10990
 
8782
-		if ( key === "position" ) {
8783
-			this._position();
10991
+		if ( !group.length ) {
10992
+			return;
8784 10993
 		}
8785 10994
 
8786
-		if ( key === "resizable" ) {
8787
-			// currently resizable, becoming non-resizable
8788
-			isResizable = uiDialog.is( ":data(ui-resizable)" );
8789
-			if ( isResizable && !value ) {
8790
-				uiDialog.resizable( "destroy" );
10995
+		min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0;
10996
+		$( group ).each( function( i ) {
10997
+			$( this ).css( "zIndex", min + i );
10998
+		} );
10999
+		this.css( "zIndex", ( min + group.length ) );
8791 11000
 	}
11001
+} );
8792 11002
 
8793
-			// currently resizable, changing handles
8794
-			if ( isResizable && typeof value === "string" ) {
8795
-				uiDialog.resizable( "option", "handles", value );
11003
+$.ui.plugin.add( "draggable", "zIndex", {
11004
+	start: function( event, ui, instance ) {
11005
+		var t = $( ui.helper ),
11006
+			o = instance.options;
11007
+
11008
+		if ( t.css( "zIndex" ) ) {
11009
+			o._zIndex = t.css( "zIndex" );
8796 11010
 		}
11011
+		t.css( "zIndex", o.zIndex );
11012
+	},
11013
+	stop: function( event, ui, instance ) {
11014
+		var o = instance.options;
8797 11015
 
8798
-			// currently non-resizable, becoming resizable
8799
-			if ( !isResizable && value !== false ) {
8800
-				this._makeResizable();
11016
+		if ( o._zIndex ) {
11017
+			$( ui.helper ).css( "zIndex", o._zIndex );
8801 11018
 		}
8802 11019
 	}
11020
+} );
8803 11021
 
8804
-		if ( key === "title" ) {
8805
-			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
8806
-		}
8807
-	},
11022
+var widgetsDraggable = $.ui.draggable;
8808 11023
 
8809
-	_size: function() {
8810
-		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
8811
-		// divs will both have width and height set, so we need to reset them
8812
-		var nonContentHeight, minContentHeight, maxContentHeight,
8813
-			options = this.options;
8814 11024
 
8815
-		// Reset content sizing
8816
-		this.element.show().css({
8817
-			width: "auto",
8818
-			minHeight: 0,
8819
-			maxHeight: "none",
8820
-			height: 0
8821
-		});
11025
+/*!
11026
+ * jQuery UI Resizable 1.13.2
11027
+ * http://jqueryui.com
11028
+ *
11029
+ * Copyright jQuery Foundation and other contributors
11030
+ * Released under the MIT license.
11031
+ * http://jquery.org/license
11032
+ */
8822 11033
 
8823
-		if ( options.minWidth > options.width ) {
8824
-			options.width = options.minWidth;
8825
-		}
11034
+//>>label: Resizable
11035
+//>>group: Interactions
11036
+//>>description: Enables resize functionality for any element.
11037
+//>>docs: http://api.jqueryui.com/resizable/
11038
+//>>demos: http://jqueryui.com/resizable/
11039
+//>>css.structure: ../../themes/base/core.css
11040
+//>>css.structure: ../../themes/base/resizable.css
11041
+//>>css.theme: ../../themes/base/theme.css
8826 11042
 
8827
-		// reset wrapper sizing
8828
-		// determine the height of all the non-content elements
8829
-		nonContentHeight = this.uiDialog.css({
8830
-				height: "auto",
8831
-				width: options.width
8832
-			})
8833
-			.outerHeight();
8834
-		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
8835
-		maxContentHeight = typeof options.maxHeight === "number" ?
8836
-			Math.max( 0, options.maxHeight - nonContentHeight ) :
8837
-			"none";
8838 11043
 
8839
-		if ( options.height === "auto" ) {
8840
-			this.element.css({
8841
-				minHeight: minContentHeight,
8842
-				maxHeight: maxContentHeight,
8843
-				height: "auto"
8844
-			});
8845
-		} else {
8846
-			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
8847
-		}
11044
+$.widget( "ui.resizable", $.ui.mouse, {
11045
+	version: "1.13.2",
11046
+	widgetEventPrefix: "resize",
11047
+	options: {
11048
+		alsoResize: false,
11049
+		animate: false,
11050
+		animateDuration: "slow",
11051
+		animateEasing: "swing",
11052
+		aspectRatio: false,
11053
+		autoHide: false,
11054
+		classes: {
11055
+			"ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se"
11056
+		},
11057
+		containment: false,
11058
+		ghost: false,
11059
+		grid: false,
11060
+		handles: "e,s,se",
11061
+		helper: false,
11062
+		maxHeight: null,
11063
+		maxWidth: null,
11064
+		minHeight: 10,
11065
+		minWidth: 10,
8848 11066
 
8849
-		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
8850
-			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
8851
-		}
11067
+		// See #7960
11068
+		zIndex: 90,
11069
+
11070
+		// Callbacks
11071
+		resize: null,
11072
+		start: null,
11073
+		stop: null
8852 11074
 	},
8853 11075
 
8854
-	_blockFrames: function() {
8855
-		this.iframeBlocks = this.document.find( "iframe" ).map(function() {
8856
-			var iframe = $( this );
11076
+	_num: function( value ) {
11077
+		return parseFloat( value ) || 0;
11078
+	},
8857 11079
 
8858
-			return $( "<div>" )
8859
-				.css({
8860
-					position: "absolute",
8861
-					width: iframe.outerWidth(),
8862
-					height: iframe.outerHeight()
8863
-				})
8864
-				.appendTo( iframe.parent() )
8865
-				.offset( iframe.offset() )[0];
8866
-		});
11080
+	_isNumber: function( value ) {
11081
+		return !isNaN( parseFloat( value ) );
8867 11082
 	},
8868 11083
 
8869
-	_unblockFrames: function() {
8870
-		if ( this.iframeBlocks ) {
8871
-			this.iframeBlocks.remove();
8872
-			delete this.iframeBlocks;
11084
+	_hasScroll: function( el, a ) {
11085
+
11086
+		if ( $( el ).css( "overflow" ) === "hidden" ) {
11087
+			return false;
8873 11088
 		}
8874
-	},
8875 11089
 
8876
-	_allowInteraction: function( event ) {
8877
-		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
11090
+		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
11091
+			has = false;
11092
+
11093
+		if ( el[ scroll ] > 0 ) {
8878 11094
 			return true;
8879 11095
 		}
8880 11096
 
8881
-		// TODO: Remove hack when datepicker implements
8882
-		// the .ui-front logic (#8989)
8883
-		return !!$( event.target ).closest( ".ui-datepicker" ).length;
8884
-	},
11097
+		// TODO: determine which cases actually cause this to happen
11098
+		// if the element doesn't have the scroll set, see if it's possible to
11099
+		// set the scroll
11100
+		try {
11101
+			el[ scroll ] = 1;
11102
+			has = ( el[ scroll ] > 0 );
11103
+			el[ scroll ] = 0;
11104
+		} catch ( e ) {
8885 11105
 
8886
-	_createOverlay: function() {
8887
-		if ( !this.options.modal ) {
8888
-			return;
11106
+			// `el` might be a string, then setting `scroll` will throw
11107
+			// an error in strict mode; ignore it.
8889 11108
 		}
11109
+		return has;
11110
+	},
8890 11111
 
8891
-		// We use a delay in case the overlay is created from an
8892
-		// event that we're going to be cancelling (#2804)
8893
-		var isOpening = true;
8894
-		this._delay(function() {
8895
-			isOpening = false;
11112
+	_create: function() {
11113
+
11114
+		var margins,
11115
+			o = this.options,
11116
+			that = this;
11117
+		this._addClass( "ui-resizable" );
11118
+
11119
+		$.extend( this, {
11120
+			_aspectRatio: !!( o.aspectRatio ),
11121
+			aspectRatio: o.aspectRatio,
11122
+			originalElement: this.element,
11123
+			_proportionallyResizeElements: [],
11124
+			_helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
8896 11125
 		} );
8897 11126
 
8898
-		if ( !this.document.data( "ui-dialog-overlays" ) ) {
11127
+		// Wrap the element if it cannot hold child nodes
11128
+		if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) {
8899 11129
 
8900
-			// Prevent use of anchors and inputs
8901
-			// Using _on() for an event handler shared across many instances is
8902
-			// safe because the dialogs stack and must be closed in reverse order
8903
-			this._on( this.document, {
8904
-				focusin: function( event ) {
8905
-					if ( isOpening ) {
8906
-						return;
8907
-					}
11130
+			this.element.wrap(
11131
+				$( "<div class='ui-wrapper'></div>" ).css( {
11132
+					overflow: "hidden",
11133
+					position: this.element.css( "position" ),
11134
+					width: this.element.outerWidth(),
11135
+					height: this.element.outerHeight(),
11136
+					top: this.element.css( "top" ),
11137
+					left: this.element.css( "left" )
11138
+				} )
11139
+			);
8908 11140
 
8909
-					if ( !this._allowInteraction( event ) ) {
8910
-						event.preventDefault();
8911
-						this._trackingInstances()[ 0 ]._focusTabbable();
8912
-					}
8913
-				}
8914
-			});
8915
-		}
11141
+			this.element = this.element.parent().data(
11142
+				"ui-resizable", this.element.resizable( "instance" )
11143
+			);
8916 11144
 
8917
-		this.overlay = $( "<div>" )
8918
-			.addClass( "ui-widget-overlay ui-front" )
8919
-			.appendTo( this._appendTo() );
8920
-		this._on( this.overlay, {
8921
-			mousedown: "_keepFocus"
8922
-		});
8923
-		this.document.data( "ui-dialog-overlays",
8924
-			(this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
8925
-	},
11145
+			this.elementIsWrapper = true;
8926 11146
 
8927
-	_destroyOverlay: function() {
8928
-		if ( !this.options.modal ) {
8929
-			return;
11147
+			margins = {
11148
+				marginTop: this.originalElement.css( "marginTop" ),
11149
+				marginRight: this.originalElement.css( "marginRight" ),
11150
+				marginBottom: this.originalElement.css( "marginBottom" ),
11151
+				marginLeft: this.originalElement.css( "marginLeft" )
11152
+			};
11153
+
11154
+			this.element.css( margins );
11155
+			this.originalElement.css( "margin", 0 );
11156
+
11157
+			// support: Safari
11158
+			// Prevent Safari textarea resize
11159
+			this.originalResizeStyle = this.originalElement.css( "resize" );
11160
+			this.originalElement.css( "resize", "none" );
11161
+
11162
+			this._proportionallyResizeElements.push( this.originalElement.css( {
11163
+				position: "static",
11164
+				zoom: 1,
11165
+				display: "block"
11166
+			} ) );
11167
+
11168
+			// Support: IE9
11169
+			// avoid IE jump (hard set the margin)
11170
+			this.originalElement.css( margins );
11171
+
11172
+			this._proportionallyResize();
8930 11173
 		}
8931 11174
 
8932
-		if ( this.overlay ) {
8933
-			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
11175
+		this._setupHandles();
8934 11176
 
8935
-			if ( !overlays ) {
8936
-				this.document
8937
-					.unbind( "focusin" )
8938
-					.removeData( "ui-dialog-overlays" );
8939
-			} else {
8940
-				this.document.data( "ui-dialog-overlays", overlays );
11177
+		if ( o.autoHide ) {
11178
+			$( this.element )
11179
+				.on( "mouseenter", function() {
11180
+					if ( o.disabled ) {
11181
+						return;
8941 11182
 					}
8942
-
8943
-			this.overlay.remove();
8944
-			this.overlay = null;
11183
+					that._removeClass( "ui-resizable-autohide" );
11184
+					that._handles.show();
11185
+				} )
11186
+				.on( "mouseleave", function() {
11187
+					if ( o.disabled ) {
11188
+						return;
8945 11189
 					}
11190
+					if ( !that.resizing ) {
11191
+						that._addClass( "ui-resizable-autohide" );
11192
+						that._handles.hide();
8946 11193
 					}
8947 11194
 				} );
11195
+		}
8948 11196
 
8949
-
8950
-/*!
8951
- * jQuery UI Droppable 1.11.4
8952
- * http://jqueryui.com
8953
- *
8954
- * Copyright jQuery Foundation and other contributors
8955
- * Released under the MIT license.
8956
- * http://jquery.org/license
8957
- *
8958
- * http://api.jqueryui.com/droppable/
8959
- */
8960
-
8961
-
8962
-$.widget( "ui.droppable", {
8963
-	version: "1.11.4",
8964
-	widgetEventPrefix: "drop",
8965
-	options: {
8966
-		accept: "*",
8967
-		activeClass: false,
8968
-		addClasses: true,
8969
-		greedy: false,
8970
-		hoverClass: false,
8971
-		scope: "default",
8972
-		tolerance: "intersect",
8973
-
8974
-		// callbacks
8975
-		activate: null,
8976
-		deactivate: null,
8977
-		drop: null,
8978
-		out: null,
8979
-		over: null
11197
+		this._mouseInit();
8980 11198
 	},
8981
-	_create: function() {
8982 11199
 
8983
-		var proportions,
8984
-			o = this.options,
8985
-			accept = o.accept;
11200
+	_destroy: function() {
8986 11201
 
8987
-		this.isover = false;
8988
-		this.isout = true;
11202
+		this._mouseDestroy();
11203
+		this._addedHandles.remove();
8989 11204
 
8990
-		this.accept = $.isFunction( accept ) ? accept : function( d ) {
8991
-			return d.is( accept );
11205
+		var wrapper,
11206
+			_destroy = function( exp ) {
11207
+				$( exp )
11208
+					.removeData( "resizable" )
11209
+					.removeData( "ui-resizable" )
11210
+					.off( ".resizable" );
8992 11211
 			};
8993 11212
 
8994
-		this.proportions = function( /* valueToWrite */ ) {
8995
-			if ( arguments.length ) {
8996
-				// Store the droppable's proportions
8997
-				proportions = arguments[ 0 ];
8998
-			} else {
8999
-				// Retrieve or derive the droppable's proportions
9000
-				return proportions ?
9001
-					proportions :
9002
-					proportions = {
9003
-						width: this.element[ 0 ].offsetWidth,
9004
-						height: this.element[ 0 ].offsetHeight
9005
-					};
11213
+		// TODO: Unwrap at same DOM position
11214
+		if ( this.elementIsWrapper ) {
11215
+			_destroy( this.element );
11216
+			wrapper = this.element;
11217
+			this.originalElement.css( {
11218
+				position: wrapper.css( "position" ),
11219
+				width: wrapper.outerWidth(),
11220
+				height: wrapper.outerHeight(),
11221
+				top: wrapper.css( "top" ),
11222
+				left: wrapper.css( "left" )
11223
+			} ).insertAfter( wrapper );
11224
+			wrapper.remove();
9006 11225
 		}
9007
-		};
9008
-
9009
-		this._addToManager( o.scope );
9010 11226
 
9011
-		o.addClasses && this.element.addClass( "ui-droppable" );
11227
+		this.originalElement.css( "resize", this.originalResizeStyle );
11228
+		_destroy( this.originalElement );
9012 11229
 
11230
+		return this;
9013 11231
 	},
9014 11232
 
9015
-	_addToManager: function( scope ) {
9016
-		// Add the reference and positions to the manager
9017
-		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
9018
-		$.ui.ddmanager.droppables[ scope ].push( this );
9019
-	},
11233
+	_setOption: function( key, value ) {
11234
+		this._super( key, value );
9020 11235
 
9021
-	_splice: function( drop ) {
9022
-		var i = 0;
9023
-		for ( ; i < drop.length; i++ ) {
9024
-			if ( drop[ i ] === this ) {
9025
-				drop.splice( i, 1 );
9026
-			}
11236
+		switch ( key ) {
11237
+		case "handles":
11238
+			this._removeHandles();
11239
+			this._setupHandles();
11240
+			break;
11241
+		case "aspectRatio":
11242
+			this._aspectRatio = !!value;
11243
+			break;
11244
+		default:
11245
+			break;
9027 11246
 		}
9028 11247
 	},
9029 11248
 
9030
-	_destroy: function() {
9031
-		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
11249
+	_setupHandles: function() {
11250
+		var o = this.options, handle, i, n, hname, axis, that = this;
11251
+		this.handles = o.handles ||
11252
+			( !$( ".ui-resizable-handle", this.element ).length ?
11253
+				"e,s,se" : {
11254
+					n: ".ui-resizable-n",
11255
+					e: ".ui-resizable-e",
11256
+					s: ".ui-resizable-s",
11257
+					w: ".ui-resizable-w",
11258
+					se: ".ui-resizable-se",
11259
+					sw: ".ui-resizable-sw",
11260
+					ne: ".ui-resizable-ne",
11261
+					nw: ".ui-resizable-nw"
11262
+				} );
9032 11263
 
9033
-		this._splice( drop );
11264
+		this._handles = $();
11265
+		this._addedHandles = $();
11266
+		if ( this.handles.constructor === String ) {
9034 11267
 
9035
-		this.element.removeClass( "ui-droppable ui-droppable-disabled" );
9036
-	},
11268
+			if ( this.handles === "all" ) {
11269
+				this.handles = "n,e,s,w,se,sw,ne,nw";
11270
+			}
9037 11271
 
9038
-	_setOption: function( key, value ) {
11272
+			n = this.handles.split( "," );
11273
+			this.handles = {};
9039 11274
 
9040
-		if ( key === "accept" ) {
9041
-			this.accept = $.isFunction( value ) ? value : function( d ) {
9042
-				return d.is( value );
9043
-			};
9044
-		} else if ( key === "scope" ) {
9045
-			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
11275
+			for ( i = 0; i < n.length; i++ ) {
9046 11276
 
9047
-			this._splice( drop );
9048
-			this._addToManager( value );
9049
-		}
11277
+				handle = String.prototype.trim.call( n[ i ] );
11278
+				hname = "ui-resizable-" + handle;
11279
+				axis = $( "<div>" );
11280
+				this._addClass( axis, "ui-resizable-handle " + hname );
9050 11281
 
9051
-		this._super( key, value );
9052
-	},
11282
+				axis.css( { zIndex: o.zIndex } );
9053 11283
 
9054
-	_activate: function( event ) {
9055
-		var draggable = $.ui.ddmanager.current;
9056
-		if ( this.options.activeClass ) {
9057
-			this.element.addClass( this.options.activeClass );
11284
+				this.handles[ handle ] = ".ui-resizable-" + handle;
11285
+				if ( !this.element.children( this.handles[ handle ] ).length ) {
11286
+					this.element.append( axis );
11287
+					this._addedHandles = this._addedHandles.add( axis );
9058 11288
 				}
9059
-		if ( draggable ){
9060
-			this._trigger( "activate", event, this.ui( draggable ) );
9061 11289
 			}
9062
-	},
9063 11290
 
9064
-	_deactivate: function( event ) {
9065
-		var draggable = $.ui.ddmanager.current;
9066
-		if ( this.options.activeClass ) {
9067
-			this.element.removeClass( this.options.activeClass );
9068 11291
 		}
9069
-		if ( draggable ){
9070
-			this._trigger( "deactivate", event, this.ui( draggable ) );
9071
-		}
9072
-	},
9073 11292
 
9074
-	_over: function( event ) {
11293
+		this._renderAxis = function( target ) {
9075 11294
 
9076
-		var draggable = $.ui.ddmanager.current;
11295
+			var i, axis, padPos, padWrapper;
9077 11296
 
9078
-		// Bail if draggable and droppable are same element
9079
-		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9080
-			return;
9081
-		}
11297
+			target = target || this.element;
9082 11298
 
9083
-		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9084
-			if ( this.options.hoverClass ) {
9085
-				this.element.addClass( this.options.hoverClass );
9086
-			}
9087
-			this._trigger( "over", event, this.ui( draggable ) );
11299
+			for ( i in this.handles ) {
11300
+
11301
+				if ( this.handles[ i ].constructor === String ) {
11302
+					this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show();
11303
+				} else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
11304
+					this.handles[ i ] = $( this.handles[ i ] );
11305
+					this._on( this.handles[ i ], { "mousedown": that._mouseDown } );
9088 11306
 				}
9089 11307
 
9090
-	},
11308
+				if ( this.elementIsWrapper &&
11309
+						this.originalElement[ 0 ]
11310
+							.nodeName
11311
+							.match( /^(textarea|input|select|button)$/i ) ) {
11312
+					axis = $( this.handles[ i ], this.element );
9091 11313
 
9092
-	_out: function( event ) {
11314
+					padWrapper = /sw|ne|nw|se|n|s/.test( i ) ?
11315
+						axis.outerHeight() :
11316
+						axis.outerWidth();
9093 11317
 
9094
-		var draggable = $.ui.ddmanager.current;
11318
+					padPos = [ "padding",
11319
+						/ne|nw|n/.test( i ) ? "Top" :
11320
+						/se|sw|s/.test( i ) ? "Bottom" :
11321
+						/^e$/.test( i ) ? "Right" : "Left" ].join( "" );
9095 11322
 
9096
-		// Bail if draggable and droppable are same element
9097
-		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9098
-			return;
9099
-		}
11323
+					target.css( padPos, padWrapper );
9100 11324
 
9101
-		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9102
-			if ( this.options.hoverClass ) {
9103
-				this.element.removeClass( this.options.hoverClass );
9104
-			}
9105
-			this._trigger( "out", event, this.ui( draggable ) );
11325
+					this._proportionallyResize();
9106 11326
 				}
9107 11327
 
9108
-	},
11328
+				this._handles = this._handles.add( this.handles[ i ] );
11329
+			}
11330
+		};
9109 11331
 
9110
-	_drop: function( event, custom ) {
11332
+		// TODO: make renderAxis a prototype function
11333
+		this._renderAxis( this.element );
9111 11334
 
9112
-		var draggable = custom || $.ui.ddmanager.current,
9113
-			childrenIntersection = false;
11335
+		this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
11336
+		this._handles.disableSelection();
9114 11337
 
9115
-		// Bail if draggable and droppable are same element
9116
-		if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) {
9117
-			return false;
11338
+		this._handles.on( "mouseover", function() {
11339
+			if ( !that.resizing ) {
11340
+				if ( this.className ) {
11341
+					axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i );
9118 11342
 				}
9119
-
9120
-		this.element.find( ":data(ui-droppable)" ).not( ".ui-draggable-dragging" ).each(function() {
9121
-			var inst = $( this ).droppable( "instance" );
9122
-			if (
9123
-				inst.options.greedy &&
9124
-				!inst.options.disabled &&
9125
-				inst.options.scope === draggable.options.scope &&
9126
-				inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) &&
9127
-				$.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event )
9128
-			) { childrenIntersection = true; return false; }
9129
-		});
9130
-		if ( childrenIntersection ) {
9131
-			return false;
11343
+				that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se";
9132 11344
 			}
11345
+		} );
9133 11346
 
9134
-		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9135
-			if ( this.options.activeClass ) {
9136
-				this.element.removeClass( this.options.activeClass );
11347
+		if ( o.autoHide ) {
11348
+			this._handles.hide();
11349
+			this._addClass( "ui-resizable-autohide" );
9137 11350
 		}
9138
-			if ( this.options.hoverClass ) {
9139
-				this.element.removeClass( this.options.hoverClass );
11351
+	},
11352
+
11353
+	_removeHandles: function() {
11354
+		this._addedHandles.remove();
11355
+	},
11356
+
11357
+	_mouseCapture: function( event ) {
11358
+		var i, handle,
11359
+			capture = false;
11360
+
11361
+		for ( i in this.handles ) {
11362
+			handle = $( this.handles[ i ] )[ 0 ];
11363
+			if ( handle === event.target || $.contains( handle, event.target ) ) {
11364
+				capture = true;
9140 11365
 			}
9141
-			this._trigger( "drop", event, this.ui( draggable ) );
9142
-			return this.element;
9143 11366
 		}
9144 11367
 
9145
-		return false;
11368
+		return !this.options.disabled && capture;
11369
+	},
11370
+
11371
+	_mouseStart: function( event ) {
11372
+
11373
+		var curleft, curtop, cursor,
11374
+			o = this.options,
11375
+			el = this.element;
9146 11376
 
9147
-	},
11377
+		this.resizing = true;
9148 11378
 
9149
-	ui: function( c ) {
9150
-		return {
9151
-			draggable: ( c.currentItem || c.element ),
9152
-			helper: c.helper,
9153
-			position: c.position,
9154
-			offset: c.positionAbs
9155
-		};
9156
-	}
11379
+		this._renderProxy();
9157 11380
 
9158
-});
11381
+		curleft = this._num( this.helper.css( "left" ) );
11382
+		curtop = this._num( this.helper.css( "top" ) );
9159 11383
 
9160
-$.ui.intersect = (function() {
9161
-	function isOverAxis( x, reference, size ) {
9162
-		return ( x >= reference ) && ( x < ( reference + size ) );
11384
+		if ( o.containment ) {
11385
+			curleft += $( o.containment ).scrollLeft() || 0;
11386
+			curtop += $( o.containment ).scrollTop() || 0;
9163 11387
 		}
9164 11388
 
9165
-	return function( draggable, droppable, toleranceMode, event ) {
11389
+		this.offset = this.helper.offset();
11390
+		this.position = { left: curleft, top: curtop };
9166 11391
 
9167
-		if ( !droppable.offset ) {
9168
-			return false;
9169
-		}
11392
+		this.size = this._helper ? {
11393
+				width: this.helper.width(),
11394
+				height: this.helper.height()
11395
+			} : {
11396
+				width: el.width(),
11397
+				height: el.height()
11398
+			};
9170 11399
 
9171
-		var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
9172
-			y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
9173
-			x2 = x1 + draggable.helperProportions.width,
9174
-			y2 = y1 + draggable.helperProportions.height,
9175
-			l = droppable.offset.left,
9176
-			t = droppable.offset.top,
9177
-			r = l + droppable.proportions().width,
9178
-			b = t + droppable.proportions().height;
11400
+		this.originalSize = this._helper ? {
11401
+				width: el.outerWidth(),
11402
+				height: el.outerHeight()
11403
+			} : {
11404
+				width: el.width(),
11405
+				height: el.height()
11406
+			};
9179 11407
 
9180
-		switch ( toleranceMode ) {
9181
-		case "fit":
9182
-			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
9183
-		case "intersect":
9184
-			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
9185
-				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
9186
-				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
9187
-				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
9188
-		case "pointer":
9189
-			return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width );
9190
-		case "touch":
9191
-			return (
9192
-				( y1 >= t && y1 <= b ) || // Top edge touching
9193
-				( y2 >= t && y2 <= b ) || // Bottom edge touching
9194
-				( y1 < t && y2 > b ) // Surrounded vertically
9195
-			) && (
9196
-				( x1 >= l && x1 <= r ) || // Left edge touching
9197
-				( x2 >= l && x2 <= r ) || // Right edge touching
9198
-				( x1 < l && x2 > r ) // Surrounded horizontally
9199
-			);
9200
-		default:
9201
-			return false;
9202
-		}
11408
+		this.sizeDiff = {
11409
+			width: el.outerWidth() - el.width(),
11410
+			height: el.outerHeight() - el.height()
9203 11411
 		};
9204
-})();
9205 11412
 
9206
-/*
9207
-	This manager tracks offsets of draggables and droppables
9208
-*/
9209
-$.ui.ddmanager = {
9210
-	current: null,
9211
-	droppables: { "default": [] },
9212
-	prepareOffsets: function( t, event ) {
11413
+		this.originalPosition = { left: curleft, top: curtop };
11414
+		this.originalMousePosition = { left: event.pageX, top: event.pageY };
9213 11415
 
9214
-		var i, j,
9215
-			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
9216
-			type = event ? event.type : null, // workaround for #2317
9217
-			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
11416
+		this.aspectRatio = ( typeof o.aspectRatio === "number" ) ?
11417
+			o.aspectRatio :
11418
+			( ( this.originalSize.width / this.originalSize.height ) || 1 );
9218 11419
 
9219
-		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
11420
+		cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" );
11421
+		$( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor );
9220 11422
 
9221
-			// No disabled and non-accepted
9222
-			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) {
9223
-				continue;
9224
-			}
11423
+		this._addClass( "ui-resizable-resizing" );
11424
+		this._propagate( "start", event );
11425
+		return true;
11426
+	},
9225 11427
 
9226
-			// Filter out elements in the current dragged item
9227
-			for ( j = 0; j < list.length; j++ ) {
9228
-				if ( list[ j ] === m[ i ].element[ 0 ] ) {
9229
-					m[ i ].proportions().height = 0;
9230
-					continue droppablesLoop;
9231
-				}
9232
-			}
11428
+	_mouseDrag: function( event ) {
9233 11429
 
9234
-			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
9235
-			if ( !m[ i ].visible ) {
9236
-				continue;
9237
-			}
11430
+		var data, props,
11431
+			smp = this.originalMousePosition,
11432
+			a = this.axis,
11433
+			dx = ( event.pageX - smp.left ) || 0,
11434
+			dy = ( event.pageY - smp.top ) || 0,
11435
+			trigger = this._change[ a ];
9238 11436
 
9239
-			// Activate the droppable if used directly from draggables
9240
-			if ( type === "mousedown" ) {
9241
-				m[ i ]._activate.call( m[ i ], event );
11437
+		this._updatePrevProperties();
11438
+
11439
+		if ( !trigger ) {
11440
+			return false;
9242 11441
 		}
9243 11442
 
9244
-			m[ i ].offset = m[ i ].element.offset();
9245
-			m[ i ].proportions({ width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight });
11443
+		data = trigger.apply( this, [ event, dx, dy ] );
9246 11444
 
11445
+		this._updateVirtualBoundaries( event.shiftKey );
11446
+		if ( this._aspectRatio || event.shiftKey ) {
11447
+			data = this._updateRatio( data, event );
9247 11448
 		}
9248 11449
 
9249
-	},
9250
-	drop: function( draggable, event ) {
11450
+		data = this._respectSize( data, event );
9251 11451
 
9252
-		var dropped = false;
9253
-		// Create a copy of the droppables in case the list changes during the drop (#9116)
9254
-		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
11452
+		this._updateCache( data );
9255 11453
 
9256
-			if ( !this.options ) {
9257
-				return;
9258
-			}
9259
-			if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
9260
-				dropped = this._drop.call( this, event ) || dropped;
9261
-			}
11454
+		this._propagate( "resize", event );
9262 11455
 
9263
-			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) {
9264
-				this.isout = true;
9265
-				this.isover = false;
9266
-				this._deactivate.call( this, event );
9267
-			}
11456
+		props = this._applyChanges();
9268 11457
 
9269
-		});
9270
-		return dropped;
11458
+		if ( !this._helper && this._proportionallyResizeElements.length ) {
11459
+			this._proportionallyResize();
11460
+		}
9271 11461
 
9272
-	},
9273
-	dragStart: function( draggable, event ) {
9274
-		// Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
9275
-		draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() {
9276
-			if ( !draggable.options.refreshPositions ) {
9277
-				$.ui.ddmanager.prepareOffsets( draggable, event );
11462
+		if ( !$.isEmptyObject( props ) ) {
11463
+			this._updatePrevProperties();
11464
+			this._trigger( "resize", event, this.ui() );
11465
+			this._applyChanges();
9278 11466
 		}
9279
-		});
11467
+
11468
+		return false;
9280 11469
 	},
9281
-	drag: function( draggable, event ) {
9282 11470
 
9283
-		// If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
9284
-		if ( draggable.options.refreshPositions ) {
9285
-			$.ui.ddmanager.prepareOffsets( draggable, event );
9286
-		}
11471
+	_mouseStop: function( event ) {
9287 11472
 
9288
-		// Run through all droppables and check their positions based on specific tolerance options
9289
-		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
11473
+		this.resizing = false;
11474
+		var pr, ista, soffseth, soffsetw, s, left, top,
11475
+			o = this.options, that = this;
9290 11476
 
9291
-			if ( this.options.disabled || this.greedyChild || !this.visible ) {
9292
-				return;
9293
-			}
11477
+		if ( this._helper ) {
9294 11478
 
9295
-			var parentInstance, scope, parent,
9296
-				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
9297
-				c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null );
9298
-			if ( !c ) {
9299
-				return;
11479
+			pr = this._proportionallyResizeElements;
11480
+			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName );
11481
+			soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height;
11482
+			soffsetw = ista ? 0 : that.sizeDiff.width;
11483
+
11484
+			s = {
11485
+				width: ( that.helper.width()  - soffsetw ),
11486
+				height: ( that.helper.height() - soffseth )
11487
+			};
11488
+			left = ( parseFloat( that.element.css( "left" ) ) +
11489
+				( that.position.left - that.originalPosition.left ) ) || null;
11490
+			top = ( parseFloat( that.element.css( "top" ) ) +
11491
+				( that.position.top - that.originalPosition.top ) ) || null;
11492
+
11493
+			if ( !o.animate ) {
11494
+				this.element.css( $.extend( s, { top: top, left: left } ) );
9300 11495
 			}
9301 11496
 
9302
-			if ( this.options.greedy ) {
9303
-				// find droppable parents with same scope
9304
-				scope = this.options.scope;
9305
-				parent = this.element.parents( ":data(ui-droppable)" ).filter(function() {
9306
-					return $( this ).droppable( "instance" ).options.scope === scope;
9307
-				});
11497
+			that.helper.height( that.size.height );
11498
+			that.helper.width( that.size.width );
9308 11499
 
9309
-				if ( parent.length ) {
9310
-					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
9311
-					parentInstance.greedyChild = ( c === "isover" );
11500
+			if ( this._helper && !o.animate ) {
11501
+				this._proportionallyResize();
9312 11502
 			}
9313 11503
 		}
9314 11504
 
9315
-			// we just moved into a greedy child
9316
-			if ( parentInstance && c === "isover" ) {
9317
-				parentInstance.isover = false;
9318
-				parentInstance.isout = true;
9319
-				parentInstance._out.call( parentInstance, event );
9320
-			}
11505
+		$( "body" ).css( "cursor", "auto" );
9321 11506
 
9322
-			this[ c ] = true;
9323
-			this[c === "isout" ? "isover" : "isout"] = false;
9324
-			this[c === "isover" ? "_over" : "_out"].call( this, event );
11507
+		this._removeClass( "ui-resizable-resizing" );
9325 11508
 
9326
-			// we just moved out of a greedy child
9327
-			if ( parentInstance && c === "isout" ) {
9328
-				parentInstance.isout = false;
9329
-				parentInstance.isover = true;
9330
-				parentInstance._over.call( parentInstance, event );
11509
+		this._propagate( "stop", event );
11510
+
11511
+		if ( this._helper ) {
11512
+			this.helper.remove();
9331 11513
 		}
9332
-		});
11514
+
11515
+		return false;
9333 11516
 
9334 11517
 	},
9335
-	dragStop: function( draggable, event ) {
9336
-		draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" );
9337
-		// Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
9338
-		if ( !draggable.options.refreshPositions ) {
9339
-			$.ui.ddmanager.prepareOffsets( draggable, event );
9340
-		}
9341
-	}
9342
-};
9343 11518
 
9344
-var droppable = $.ui.droppable;
11519
+	_updatePrevProperties: function() {
11520
+		this.prevPosition = {
11521
+			top: this.position.top,
11522
+			left: this.position.left
11523
+		};
11524
+		this.prevSize = {
11525
+			width: this.size.width,
11526
+			height: this.size.height
11527
+		};
11528
+	},
9345 11529
 
11530
+	_applyChanges: function() {
11531
+		var props = {};
9346 11532
 
9347
-/*!
9348
- * jQuery UI Effects 1.11.4
9349
- * http://jqueryui.com
9350
- *
9351
- * Copyright jQuery Foundation and other contributors
9352
- * Released under the MIT license.
9353
- * http://jquery.org/license
9354
- *
9355
- * http://api.jqueryui.com/category/effects-core/
9356
- */
11533
+		if ( this.position.top !== this.prevPosition.top ) {
11534
+			props.top = this.position.top + "px";
11535
+		}
11536
+		if ( this.position.left !== this.prevPosition.left ) {
11537
+			props.left = this.position.left + "px";
11538
+		}
11539
+		if ( this.size.width !== this.prevSize.width ) {
11540
+			props.width = this.size.width + "px";
11541
+		}
11542
+		if ( this.size.height !== this.prevSize.height ) {
11543
+			props.height = this.size.height + "px";
11544
+		}
9357 11545
 
11546
+		this.helper.css( props );
9358 11547
 
9359
-var dataSpace = "ui-effects-",
11548
+		return props;
11549
+	},
9360 11550
 
9361
-	// Create a local jQuery because jQuery Color relies on it and the
9362
-	// global may not exist with AMD and a custom build (#10199)
9363
-	jQuery = $;
11551
+	_updateVirtualBoundaries: function( forceAspectRatio ) {
11552
+		var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
11553
+			o = this.options;
9364 11554
 
9365
-$.effects = {
9366
-	effect: {}
11555
+		b = {
11556
+			minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0,
11557
+			maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity,
11558
+			minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0,
11559
+			maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity
9367 11560
 		};
9368 11561
 
9369
-/*!
9370
- * jQuery Color Animations v2.1.2
9371
- * https://github.com/jquery/jquery-color
9372
- *
9373
- * Copyright 2014 jQuery Foundation and other contributors
9374
- * Released under the MIT license.
9375
- * http://jquery.org/license
9376
- *
9377
- * Date: Wed Jan 16 08:47:09 2013 -0600
9378
- */
9379
-(function( jQuery, undefined ) {
9380
-
9381
-	var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
11562
+		if ( this._aspectRatio || forceAspectRatio ) {
11563
+			pMinWidth = b.minHeight * this.aspectRatio;
11564
+			pMinHeight = b.minWidth / this.aspectRatio;
11565
+			pMaxWidth = b.maxHeight * this.aspectRatio;
11566
+			pMaxHeight = b.maxWidth / this.aspectRatio;
9382 11567
 
9383
-	// plusequals test for += 100 -= 100
9384
-	rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
9385
-	// a set of RE's that can match strings and generate color tuples.
9386
-	stringParsers = [ {
9387
-			re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9388
-			parse: function( execResult ) {
9389
-				return [
9390
-					execResult[ 1 ],
9391
-					execResult[ 2 ],
9392
-					execResult[ 3 ],
9393
-					execResult[ 4 ]
9394
-				];
9395
-			}
9396
-		}, {
9397
-			re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9398
-			parse: function( execResult ) {
9399
-				return [
9400
-					execResult[ 1 ] * 2.55,
9401
-					execResult[ 2 ] * 2.55,
9402
-					execResult[ 3 ] * 2.55,
9403
-					execResult[ 4 ]
9404
-				];
9405
-			}
9406
-		}, {
9407
-			// this regex ignores A-F because it's compared against an already lowercased string
9408
-			re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
9409
-			parse: function( execResult ) {
9410
-				return [
9411
-					parseInt( execResult[ 1 ], 16 ),
9412
-					parseInt( execResult[ 2 ], 16 ),
9413
-					parseInt( execResult[ 3 ], 16 )
9414
-				];
11568
+			if ( pMinWidth > b.minWidth ) {
11569
+				b.minWidth = pMinWidth;
9415 11570
 			}
9416
-		}, {
9417
-			// this regex ignores A-F because it's compared against an already lowercased string
9418
-			re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
9419
-			parse: function( execResult ) {
9420
-				return [
9421
-					parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ),
9422
-					parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ),
9423
-					parseInt( execResult[ 3 ] + execResult[ 3 ], 16 )
9424
-				];
11571
+			if ( pMinHeight > b.minHeight ) {
11572
+				b.minHeight = pMinHeight;
9425 11573
 			}
9426
-		}, {
9427
-			re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
9428
-			space: "hsla",
9429
-			parse: function( execResult ) {
9430
-				return [
9431
-					execResult[ 1 ],
9432
-					execResult[ 2 ] / 100,
9433
-					execResult[ 3 ] / 100,
9434
-					execResult[ 4 ]
9435
-				];
11574
+			if ( pMaxWidth < b.maxWidth ) {
11575
+				b.maxWidth = pMaxWidth;
9436 11576
 			}
9437
-		} ],
9438
-
9439
-	// jQuery.Color( )
9440
-	color = jQuery.Color = function( color, green, blue, alpha ) {
9441
-		return new jQuery.Color.fn.parse( color, green, blue, alpha );
9442
-	},
9443
-	spaces = {
9444
-		rgba: {
9445
-			props: {
9446
-				red: {
9447
-					idx: 0,
9448
-					type: "byte"
9449
-				},
9450
-				green: {
9451
-					idx: 1,
9452
-					type: "byte"
9453
-				},
9454
-				blue: {
9455
-					idx: 2,
9456
-					type: "byte"
11577
+			if ( pMaxHeight < b.maxHeight ) {
11578
+				b.maxHeight = pMaxHeight;
9457 11579
 			}
9458 11580
 		}
11581
+		this._vBoundaries = b;
9459 11582
 	},
9460 11583
 
9461
-		hsla: {
9462
-			props: {
9463
-				hue: {
9464
-					idx: 0,
9465
-					type: "degrees"
9466
-				},
9467
-				saturation: {
9468
-					idx: 1,
9469
-					type: "percent"
9470
-				},
9471
-				lightness: {
9472
-					idx: 2,
9473
-					type: "percent"
11584
+	_updateCache: function( data ) {
11585
+		this.offset = this.helper.offset();
11586
+		if ( this._isNumber( data.left ) ) {
11587
+			this.position.left = data.left;
9474 11588
 		}
11589
+		if ( this._isNumber( data.top ) ) {
11590
+			this.position.top = data.top;
9475 11591
 		}
11592
+		if ( this._isNumber( data.height ) ) {
11593
+			this.size.height = data.height;
9476 11594
 		}
9477
-	},
9478
-	propTypes = {
9479
-		"byte": {
9480
-			floor: true,
9481
-			max: 255
9482
-		},
9483
-		"percent": {
9484
-			max: 1
9485
-		},
9486
-		"degrees": {
9487
-			mod: 360,
9488
-			floor: true
11595
+		if ( this._isNumber( data.width ) ) {
11596
+			this.size.width = data.width;
9489 11597
 		}
9490 11598
 	},
9491
-	support = color.support = {},
9492 11599
 
9493
-	// element for support tests
9494
-	supportElem = jQuery( "<p>" )[ 0 ],
11600
+	_updateRatio: function( data ) {
9495 11601
 
9496
-	// colors = jQuery.Color.names
9497
-	colors,
11602
+		var cpos = this.position,
11603
+			csize = this.size,
11604
+			a = this.axis;
9498 11605
 
9499
-	// local aliases of functions called often
9500
-	each = jQuery.each;
11606
+		if ( this._isNumber( data.height ) ) {
11607
+			data.width = ( data.height * this.aspectRatio );
11608
+		} else if ( this._isNumber( data.width ) ) {
11609
+			data.height = ( data.width / this.aspectRatio );
11610
+		}
9501 11611
 
9502
-// determine rgba support immediately
9503
-supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
9504
-support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1;
11612
+		if ( a === "sw" ) {
11613
+			data.left = cpos.left + ( csize.width - data.width );
11614
+			data.top = null;
11615
+		}
11616
+		if ( a === "nw" ) {
11617
+			data.top = cpos.top + ( csize.height - data.height );
11618
+			data.left = cpos.left + ( csize.width - data.width );
11619
+		}
9505 11620
 
9506
-// define cache name and alpha properties
9507
-// for rgba and hsla spaces
9508
-each( spaces, function( spaceName, space ) {
9509
-	space.cache = "_" + spaceName;
9510
-	space.props.alpha = {
9511
-		idx: 3,
9512
-		type: "percent",
9513
-		def: 1
9514
-	};
9515
-});
11621
+		return data;
11622
+	},
9516 11623
 
9517
-function clamp( value, prop, allowEmpty ) {
9518
-	var type = propTypes[ prop.type ] || {};
11624
+	_respectSize: function( data ) {
9519 11625
 
9520
-	if ( value == null ) {
9521
-		return (allowEmpty || !prop.def) ? null : prop.def;
11626
+		var o = this._vBoundaries,
11627
+			a = this.axis,
11628
+			ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ),
11629
+			ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ),
11630
+			isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ),
11631
+			isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ),
11632
+			dw = this.originalPosition.left + this.originalSize.width,
11633
+			dh = this.originalPosition.top + this.originalSize.height,
11634
+			cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a );
11635
+		if ( isminw ) {
11636
+			data.width = o.minWidth;
11637
+		}
11638
+		if ( isminh ) {
11639
+			data.height = o.minHeight;
11640
+		}
11641
+		if ( ismaxw ) {
11642
+			data.width = o.maxWidth;
11643
+		}
11644
+		if ( ismaxh ) {
11645
+			data.height = o.maxHeight;
9522 11646
 		}
9523 11647
 
9524
-	// ~~ is an short way of doing floor for positive numbers
9525
-	value = type.floor ? ~~value : parseFloat( value );
9526
-
9527
-	// IE will pass in empty strings as value for alpha,
9528
-	// which will hit this case
9529
-	if ( isNaN( value ) ) {
9530
-		return prop.def;
11648
+		if ( isminw && cw ) {
11649
+			data.left = dw - o.minWidth;
11650
+		}
11651
+		if ( ismaxw && cw ) {
11652
+			data.left = dw - o.maxWidth;
11653
+		}
11654
+		if ( isminh && ch ) {
11655
+			data.top = dh - o.minHeight;
11656
+		}
11657
+		if ( ismaxh && ch ) {
11658
+			data.top = dh - o.maxHeight;
9531 11659
 		}
9532 11660
 
9533
-	if ( type.mod ) {
9534
-		// we add mod before modding to make sure that negatives values
9535
-		// get converted properly: -10 -> 350
9536
-		return (value + type.mod) % type.mod;
11661
+		// Fixing jump error on top/left - bug #2330
11662
+		if ( !data.width && !data.height && !data.left && data.top ) {
11663
+			data.top = null;
11664
+		} else if ( !data.width && !data.height && !data.top && data.left ) {
11665
+			data.left = null;
9537 11666
 		}
9538 11667
 
9539
-	// for now all property types without mod have min and max
9540
-	return 0 > value ? 0 : type.max < value ? type.max : value;
11668
+		return data;
11669
+	},
11670
+
11671
+	_getPaddingPlusBorderDimensions: function( element ) {
11672
+		var i = 0,
11673
+			widths = [],
11674
+			borders = [
11675
+				element.css( "borderTopWidth" ),
11676
+				element.css( "borderRightWidth" ),
11677
+				element.css( "borderBottomWidth" ),
11678
+				element.css( "borderLeftWidth" )
11679
+			],
11680
+			paddings = [
11681
+				element.css( "paddingTop" ),
11682
+				element.css( "paddingRight" ),
11683
+				element.css( "paddingBottom" ),
11684
+				element.css( "paddingLeft" )
11685
+			];
11686
+
11687
+		for ( ; i < 4; i++ ) {
11688
+			widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
11689
+			widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
9541 11690
 		}
9542 11691
 
9543
-function stringParse( string ) {
9544
-	var inst = color(),
9545
-		rgba = inst._rgba = [];
9546
-
9547
-	string = string.toLowerCase();
9548
-
9549
-	each( stringParsers, function( i, parser ) {
9550
-		var parsed,
9551
-			match = parser.re.exec( string ),
9552
-			values = match && parser.parse( match ),
9553
-			spaceName = parser.space || "rgba";
9554
-
9555
-		if ( values ) {
9556
-			parsed = inst[ spaceName ]( values );
11692
+		return {
11693
+			height: widths[ 0 ] + widths[ 2 ],
11694
+			width: widths[ 1 ] + widths[ 3 ]
11695
+		};
11696
+	},
9557 11697
 
9558
-			// if this was an rgba parse the assignment might happen twice
9559
-			// oh well....
9560
-			inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ];
9561
-			rgba = inst._rgba = parsed._rgba;
11698
+	_proportionallyResize: function() {
9562 11699
 
9563
-			// exit each( stringParsers ) here because we matched
9564
-			return false;
11700
+		if ( !this._proportionallyResizeElements.length ) {
11701
+			return;
9565 11702
 		}
9566
-	});
9567 11703
 
9568
-	// Found a stringParser that handled it
9569
-	if ( rgba.length ) {
11704
+		var prel,
11705
+			i = 0,
11706
+			element = this.helper || this.element;
9570 11707
 
9571
-		// if this came from a parsed string, force "transparent" when alpha is 0
9572
-		// chrome, (and maybe others) return "transparent" as rgba(0,0,0,0)
9573
-		if ( rgba.join() === "0,0,0,0" ) {
9574
-			jQuery.extend( rgba, colors.transparent );
9575
-		}
9576
-		return inst;
9577
-	}
11708
+		for ( ; i < this._proportionallyResizeElements.length; i++ ) {
9578 11709
 
9579
-	// named colors
9580
-	return colors[ string ];
9581
-}
11710
+			prel = this._proportionallyResizeElements[ i ];
9582 11711
 
9583
-color.fn = jQuery.extend( color.prototype, {
9584
-	parse: function( red, green, blue, alpha ) {
9585
-		if ( red === undefined ) {
9586
-			this._rgba = [ null, null, null, null ];
9587
-			return this;
9588
-		}
9589
-		if ( red.jquery || red.nodeType ) {
9590
-			red = jQuery( red ).css( green );
9591
-			green = undefined;
11712
+			// TODO: Seems like a bug to cache this.outerDimensions
11713
+			// considering that we are in a loop.
11714
+			if ( !this.outerDimensions ) {
11715
+				this.outerDimensions = this._getPaddingPlusBorderDimensions( prel );
9592 11716
 			}
9593 11717
 
9594
-		var inst = this,
9595
-			type = jQuery.type( red ),
9596
-			rgba = this._rgba = [];
11718
+			prel.css( {
11719
+				height: ( element.height() - this.outerDimensions.height ) || 0,
11720
+				width: ( element.width() - this.outerDimensions.width ) || 0
11721
+			} );
9597 11722
 
9598
-		// more than 1 argument specified - assume ( red, green, blue, alpha )
9599
-		if ( green !== undefined ) {
9600
-			red = [ red, green, blue, alpha ];
9601
-			type = "array";
9602 11723
 		}
9603 11724
 
9604
-		if ( type === "string" ) {
9605
-			return this.parse( stringParse( red ) || colors._default );
9606
-		}
11725
+	},
9607 11726
 
9608
-		if ( type === "array" ) {
9609
-			each( spaces.rgba.props, function( key, prop ) {
9610
-				rgba[ prop.idx ] = clamp( red[ prop.idx ], prop );
9611
-			});
9612
-			return this;
9613
-		}
11727
+	_renderProxy: function() {
9614 11728
 
9615
-		if ( type === "object" ) {
9616
-			if ( red instanceof color ) {
9617
-				each( spaces, function( spaceName, space ) {
9618
-					if ( red[ space.cache ] ) {
9619
-						inst[ space.cache ] = red[ space.cache ].slice();
9620
-					}
9621
-				});
9622
-			} else {
9623
-				each( spaces, function( spaceName, space ) {
9624
-					var cache = space.cache;
9625
-					each( space.props, function( key, prop ) {
11729
+		var el = this.element, o = this.options;
11730
+		this.elementOffset = el.offset();
9626 11731
 
9627
-						// if the cache doesn't exist, and we know how to convert
9628
-						if ( !inst[ cache ] && space.to ) {
11732
+		if ( this._helper ) {
9629 11733
 
9630
-							// if the value was null, we don't need to copy it
9631
-							// if the key was alpha, we don't need to copy it either
9632
-							if ( key === "alpha" || red[ key ] == null ) {
9633
-								return;
9634
-							}
9635
-							inst[ cache ] = space.to( inst._rgba );
9636
-						}
11734
+			this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } );
9637 11735
 
9638
-						// this is the only case where we allow nulls for ALL properties.
9639
-						// call clamp with alwaysAllowEmpty
9640
-						inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true );
11736
+			this._addClass( this.helper, this._helper );
11737
+			this.helper.css( {
11738
+				width: this.element.outerWidth(),
11739
+				height: this.element.outerHeight(),
11740
+				position: "absolute",
11741
+				left: this.elementOffset.left + "px",
11742
+				top: this.elementOffset.top + "px",
11743
+				zIndex: ++o.zIndex //TODO: Don't modify option
9641 11744
 			} );
9642 11745
 
9643
-					// everything defined but alpha?
9644
-					if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) {
9645
-						// use the default of 1
9646
-						inst[ cache ][ 3 ] = 1;
9647
-						if ( space.from ) {
9648
-							inst._rgba = space.from( inst[ cache ] );
9649
-						}
9650
-					}
9651
-				});
9652
-			}
9653
-			return this;
11746
+			this.helper
11747
+				.appendTo( "body" )
11748
+				.disableSelection();
11749
+
11750
+		} else {
11751
+			this.helper = this.element;
9654 11752
 		}
11753
+
9655 11754
 	},
9656
-	is: function( compare ) {
9657
-		var is = color( compare ),
9658
-			same = true,
9659
-			inst = this;
9660 11755
 
9661
-		each( spaces, function( _, space ) {
9662
-			var localCache,
9663
-				isCache = is[ space.cache ];
9664
-			if (isCache) {
9665
-				localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || [];
9666
-				each( space.props, function( _, prop ) {
9667
-					if ( isCache[ prop.idx ] != null ) {
9668
-						same = ( isCache[ prop.idx ] === localCache[ prop.idx ] );
9669
-						return same;
9670
-					}
9671
-				});
9672
-			}
9673
-			return same;
9674
-		});
9675
-		return same;
11756
+	_change: {
11757
+		e: function( event, dx ) {
11758
+			return { width: this.originalSize.width + dx };
9676 11759
 		},
9677
-	_space: function() {
9678
-		var used = [],
9679
-			inst = this;
9680
-		each( spaces, function( spaceName, space ) {
9681
-			if ( inst[ space.cache ] ) {
9682
-				used.push( spaceName );
9683
-			}
9684
-		});
9685
-		return used.pop();
11760
+		w: function( event, dx ) {
11761
+			var cs = this.originalSize, sp = this.originalPosition;
11762
+			return { left: sp.left + dx, width: cs.width - dx };
9686 11763
 		},
9687
-	transition: function( other, distance ) {
9688
-		var end = color( other ),
9689
-			spaceName = end._space(),
9690
-			space = spaces[ spaceName ],
9691
-			startColor = this.alpha() === 0 ? color( "transparent" ) : this,
9692
-			start = startColor[ space.cache ] || space.to( startColor._rgba ),
9693
-			result = start.slice();
9694
-
9695
-		end = end[ space.cache ];
9696
-		each( space.props, function( key, prop ) {
9697
-			var index = prop.idx,
9698
-				startValue = start[ index ],
9699
-				endValue = end[ index ],
9700
-				type = propTypes[ prop.type ] || {};
9701
-
9702
-			// if null, don't override start value
9703
-			if ( endValue === null ) {
9704
-				return;
9705
-			}
9706
-			// if null - use end
9707
-			if ( startValue === null ) {
9708
-				result[ index ] = endValue;
9709
-			} else {
9710
-				if ( type.mod ) {
9711
-					if ( endValue - startValue > type.mod / 2 ) {
9712
-						startValue += type.mod;
9713
-					} else if ( startValue - endValue > type.mod / 2 ) {
9714
-						startValue -= type.mod;
9715
-					}
9716
-				}
9717
-				result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop );
9718
-			}
9719
-		});
9720
-		return this[ spaceName ]( result );
11764
+		n: function( event, dx, dy ) {
11765
+			var cs = this.originalSize, sp = this.originalPosition;
11766
+			return { top: sp.top + dy, height: cs.height - dy };
9721 11767
 		},
9722
-	blend: function( opaque ) {
9723
-		// if we are already opaque - return ourself
9724
-		if ( this._rgba[ 3 ] === 1 ) {
9725
-			return this;
11768
+		s: function( event, dx, dy ) {
11769
+			return { height: this.originalSize.height + dy };
11770
+		},
11771
+		se: function( event, dx, dy ) {
11772
+			return $.extend( this._change.s.apply( this, arguments ),
11773
+				this._change.e.apply( this, [ event, dx, dy ] ) );
11774
+		},
11775
+		sw: function( event, dx, dy ) {
11776
+			return $.extend( this._change.s.apply( this, arguments ),
11777
+				this._change.w.apply( this, [ event, dx, dy ] ) );
11778
+		},
11779
+		ne: function( event, dx, dy ) {
11780
+			return $.extend( this._change.n.apply( this, arguments ),
11781
+				this._change.e.apply( this, [ event, dx, dy ] ) );
11782
+		},
11783
+		nw: function( event, dx, dy ) {
11784
+			return $.extend( this._change.n.apply( this, arguments ),
11785
+				this._change.w.apply( this, [ event, dx, dy ] ) );
9726 11786
 		}
9727
-
9728
-		var rgb = this._rgba.slice(),
9729
-			a = rgb.pop(),
9730
-			blend = color( opaque )._rgba;
9731
-
9732
-		return color( jQuery.map( rgb, function( v, i ) {
9733
-			return ( 1 - a ) * blend[ i ] + a * v;
9734
-		}));
9735 11787
 	},
9736
-	toRgbaString: function() {
9737
-		var prefix = "rgba(",
9738
-			rgba = jQuery.map( this._rgba, function( v, i ) {
9739
-				return v == null ? ( i > 2 ? 1 : 0 ) : v;
9740
-			});
9741 11788
 
9742
-		if ( rgba[ 3 ] === 1 ) {
9743
-			rgba.pop();
9744
-			prefix = "rgb(";
11789
+	_propagate: function( n, event ) {
11790
+		$.ui.plugin.call( this, n, [ event, this.ui() ] );
11791
+		if ( n !== "resize" ) {
11792
+			this._trigger( n, event, this.ui() );
9745 11793
 		}
9746
-
9747
-		return prefix + rgba.join() + ")";
9748 11794
 	},
9749
-	toHslaString: function() {
9750
-		var prefix = "hsla(",
9751
-			hsla = jQuery.map( this.hsla(), function( v, i ) {
9752
-				if ( v == null ) {
9753
-					v = i > 2 ? 1 : 0;
11795
+
11796
+	plugins: {},
11797
+
11798
+	ui: function() {
11799
+		return {
11800
+			originalElement: this.originalElement,
11801
+			element: this.element,
11802
+			helper: this.helper,
11803
+			position: this.position,
11804
+			size: this.size,
11805
+			originalSize: this.originalSize,
11806
+			originalPosition: this.originalPosition
11807
+		};
9754 11808
 	}
9755 11809
 
9756
-				// catch 1 and 2
9757
-				if ( i && i < 3 ) {
9758
-					v = Math.round( v * 100 ) + "%";
9759
-				}
9760
-				return v;
9761 11810
 } );
9762 11811
 
9763
-		if ( hsla[ 3 ] === 1 ) {
9764
-			hsla.pop();
9765
-			prefix = "hsl(";
9766
-		}
9767
-		return prefix + hsla.join() + ")";
11812
+/*
11813
+ * Resizable Extensions
11814
+ */
11815
+
11816
+$.ui.plugin.add( "resizable", "animate", {
11817
+
11818
+	stop: function( event ) {
11819
+		var that = $( this ).resizable( "instance" ),
11820
+			o = that.options,
11821
+			pr = that._proportionallyResizeElements,
11822
+			ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ),
11823
+			soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
11824
+			soffsetw = ista ? 0 : that.sizeDiff.width,
11825
+			style = {
11826
+				width: ( that.size.width - soffsetw ),
11827
+				height: ( that.size.height - soffseth )
9768 11828
 			},
9769
-	toHexString: function( includeAlpha ) {
9770
-		var rgba = this._rgba.slice(),
9771
-			alpha = rgba.pop();
11829
+			left = ( parseFloat( that.element.css( "left" ) ) +
11830
+				( that.position.left - that.originalPosition.left ) ) || null,
11831
+			top = ( parseFloat( that.element.css( "top" ) ) +
11832
+				( that.position.top - that.originalPosition.top ) ) || null;
9772 11833
 
9773
-		if ( includeAlpha ) {
9774
-			rgba.push( ~~( alpha * 255 ) );
9775
-		}
11834
+		that.element.animate(
11835
+			$.extend( style, top && left ? { top: top, left: left } : {} ), {
11836
+				duration: o.animateDuration,
11837
+				easing: o.animateEasing,
11838
+				step: function() {
9776 11839
 
9777
-		return "#" + jQuery.map( rgba, function( v ) {
11840
+					var data = {
11841
+						width: parseFloat( that.element.css( "width" ) ),
11842
+						height: parseFloat( that.element.css( "height" ) ),
11843
+						top: parseFloat( that.element.css( "top" ) ),
11844
+						left: parseFloat( that.element.css( "left" ) )
11845
+					};
9778 11846
 
9779
-			// default to 0 when nulls exist
9780
-			v = ( v || 0 ).toString( 16 );
9781
-			return v.length === 1 ? "0" + v : v;
9782
-		}).join("");
9783
-	},
9784
-	toString: function() {
9785
-		return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString();
11847
+					if ( pr && pr.length ) {
11848
+						$( pr[ 0 ] ).css( { width: data.width, height: data.height } );
9786 11849
 					}
9787
-});
9788
-color.fn.parse.prototype = color.fn;
9789 11850
 
9790
-// hsla conversions adapted from:
9791
-// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021
11851
+					// Propagating resize, and updating values for each animation step
11852
+					that._updateCache( data );
11853
+					that._propagate( "resize", event );
9792 11854
 
9793
-function hue2rgb( p, q, h ) {
9794
-	h = ( h + 1 ) % 1;
9795
-	if ( h * 6 < 1 ) {
9796
-		return p + ( q - p ) * h * 6;
9797
-	}
9798
-	if ( h * 2 < 1) {
9799
-		return q;
9800 11855
 				}
9801
-	if ( h * 3 < 2 ) {
9802
-		return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6;
9803 11856
 			}
9804
-	return p;
11857
+		);
9805 11858
 	}
9806 11859
 
9807
-spaces.hsla.to = function( rgba ) {
9808
-	if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
9809
-		return [ null, null, null, rgba[ 3 ] ];
9810
-	}
9811
-	var r = rgba[ 0 ] / 255,
9812
-		g = rgba[ 1 ] / 255,
9813
-		b = rgba[ 2 ] / 255,
9814
-		a = rgba[ 3 ],
9815
-		max = Math.max( r, g, b ),
9816
-		min = Math.min( r, g, b ),
9817
-		diff = max - min,
9818
-		add = max + min,
9819
-		l = add * 0.5,
9820
-		h, s;
11860
+} );
9821 11861
 
9822
-	if ( min === max ) {
9823
-		h = 0;
9824
-	} else if ( r === max ) {
9825
-		h = ( 60 * ( g - b ) / diff ) + 360;
9826
-	} else if ( g === max ) {
9827
-		h = ( 60 * ( b - r ) / diff ) + 120;
9828
-	} else {
9829
-		h = ( 60 * ( r - g ) / diff ) + 240;
11862
+$.ui.plugin.add( "resizable", "containment", {
11863
+
11864
+	start: function() {
11865
+		var element, p, co, ch, cw, width, height,
11866
+			that = $( this ).resizable( "instance" ),
11867
+			o = that.options,
11868
+			el = that.element,
11869
+			oc = o.containment,
11870
+			ce = ( oc instanceof $ ) ?
11871
+				oc.get( 0 ) :
11872
+				( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc;
11873
+
11874
+		if ( !ce ) {
11875
+			return;
9830 11876
 		}
9831 11877
 
9832
-	// chroma (diff) == 0 means greyscale which, by definition, saturation = 0%
9833
-	// otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)
9834
-	if ( diff === 0 ) {
9835
-		s = 0;
9836
-	} else if ( l <= 0.5 ) {
9837
-		s = diff / add;
11878
+		that.containerElement = $( ce );
11879
+
11880
+		if ( /document/.test( oc ) || oc === document ) {
11881
+			that.containerOffset = {
11882
+				left: 0,
11883
+				top: 0
11884
+			};
11885
+			that.containerPosition = {
11886
+				left: 0,
11887
+				top: 0
11888
+			};
11889
+
11890
+			that.parentData = {
11891
+				element: $( document ),
11892
+				left: 0,
11893
+				top: 0,
11894
+				width: $( document ).width(),
11895
+				height: $( document ).height() || document.body.parentNode.scrollHeight
11896
+			};
9838 11897
 		} else {
9839
-		s = diff / ( 2 - add );
9840
-	}
9841
-	return [ Math.round(h) % 360, s, l, a == null ? 1 : a ];
11898
+			element = $( ce );
11899
+			p = [];
11900
+			$( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) {
11901
+				p[ i ] = that._num( element.css( "padding" + name ) );
11902
+			} );
11903
+
11904
+			that.containerOffset = element.offset();
11905
+			that.containerPosition = element.position();
11906
+			that.containerSize = {
11907
+				height: ( element.innerHeight() - p[ 3 ] ),
11908
+				width: ( element.innerWidth() - p[ 1 ] )
9842 11909
 			};
9843 11910
 
9844
-spaces.hsla.from = function( hsla ) {
9845
-	if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
9846
-		return [ null, null, null, hsla[ 3 ] ];
9847
-	}
9848
-	var h = hsla[ 0 ] / 360,
9849
-		s = hsla[ 1 ],
9850
-		l = hsla[ 2 ],
9851
-		a = hsla[ 3 ],
9852
-		q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s,
9853
-		p = 2 * l - q;
11911
+			co = that.containerOffset;
11912
+			ch = that.containerSize.height;
11913
+			cw = that.containerSize.width;
11914
+			width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw );
11915
+			height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch );
9854 11916
 
9855
-	return [
9856
-		Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ),
9857
-		Math.round( hue2rgb( p, q, h ) * 255 ),
9858
-		Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ),
9859
-		a
9860
-	];
11917
+			that.parentData = {
11918
+				element: ce,
11919
+				left: co.left,
11920
+				top: co.top,
11921
+				width: width,
11922
+				height: height
9861 11923
 			};
11924
+		}
11925
+	},
9862 11926
 
9863
-each( spaces, function( spaceName, space ) {
9864
-	var props = space.props,
9865
-		cache = space.cache,
9866
-		to = space.to,
9867
-		from = space.from;
11927
+	resize: function( event ) {
11928
+		var woset, hoset, isParent, isOffsetRelative,
11929
+			that = $( this ).resizable( "instance" ),
11930
+			o = that.options,
11931
+			co = that.containerOffset,
11932
+			cp = that.position,
11933
+			pRatio = that._aspectRatio || event.shiftKey,
11934
+			cop = {
11935
+				top: 0,
11936
+				left: 0
11937
+			},
11938
+			ce = that.containerElement,
11939
+			continueResize = true;
9868 11940
 
9869
-	// makes rgba() and hsla()
9870
-	color.fn[ spaceName ] = function( value ) {
11941
+		if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) {
11942
+			cop = co;
11943
+		}
9871 11944
 
9872
-		// generate a cache for this space if it doesn't exist
9873
-		if ( to && !this[ cache ] ) {
9874
-			this[ cache ] = to( this._rgba );
11945
+		if ( cp.left < ( that._helper ? co.left : 0 ) ) {
11946
+			that.size.width = that.size.width +
11947
+				( that._helper ?
11948
+					( that.position.left - co.left ) :
11949
+					( that.position.left - cop.left ) );
11950
+
11951
+			if ( pRatio ) {
11952
+				that.size.height = that.size.width / that.aspectRatio;
11953
+				continueResize = false;
9875 11954
 			}
9876
-		if ( value === undefined ) {
9877
-			return this[ cache ].slice();
11955
+			that.position.left = o.helper ? co.left : 0;
9878 11956
 		}
9879 11957
 
9880
-		var ret,
9881
-			type = jQuery.type( value ),
9882
-			arr = ( type === "array" || type === "object" ) ? value : arguments,
9883
-			local = this[ cache ].slice();
11958
+		if ( cp.top < ( that._helper ? co.top : 0 ) ) {
11959
+			that.size.height = that.size.height +
11960
+				( that._helper ?
11961
+					( that.position.top - co.top ) :
11962
+					that.position.top );
9884 11963
 
9885
-		each( props, function( key, prop ) {
9886
-			var val = arr[ type === "object" ? key : prop.idx ];
9887
-			if ( val == null ) {
9888
-				val = local[ prop.idx ];
11964
+			if ( pRatio ) {
11965
+				that.size.width = that.size.height * that.aspectRatio;
11966
+				continueResize = false;
11967
+			}
11968
+			that.position.top = that._helper ? co.top : 0;
9889 11969
 		}
9890
-			local[ prop.idx ] = clamp( val, prop );
9891
-		});
9892 11970
 
9893
-		if ( from ) {
9894
-			ret = color( from( local ) );
9895
-			ret[ cache ] = local;
9896
-			return ret;
11971
+		isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 );
11972
+		isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) );
11973
+
11974
+		if ( isParent && isOffsetRelative ) {
11975
+			that.offset.left = that.parentData.left + that.position.left;
11976
+			that.offset.top = that.parentData.top + that.position.top;
9897 11977
 		} else {
9898
-			return color( local );
11978
+			that.offset.left = that.element.offset().left;
11979
+			that.offset.top = that.element.offset().top;
11980
+		}
11981
+
11982
+		woset = Math.abs( that.sizeDiff.width +
11983
+			( that._helper ?
11984
+				that.offset.left - cop.left :
11985
+				( that.offset.left - co.left ) ) );
11986
+
11987
+		hoset = Math.abs( that.sizeDiff.height +
11988
+			( that._helper ?
11989
+				that.offset.top - cop.top :
11990
+				( that.offset.top - co.top ) ) );
11991
+
11992
+		if ( woset + that.size.width >= that.parentData.width ) {
11993
+			that.size.width = that.parentData.width - woset;
11994
+			if ( pRatio ) {
11995
+				that.size.height = that.size.width / that.aspectRatio;
11996
+				continueResize = false;
9899 11997
 			}
9900
-	};
9901
-
9902
-	// makes red() green() blue() alpha() hue() saturation() lightness()
9903
-	each( props, function( key, prop ) {
9904
-		// alpha is included in more than one space
9905
-		if ( color.fn[ key ] ) {
9906
-			return;
9907 11998
 		}
9908
-		color.fn[ key ] = function( value ) {
9909
-			var vtype = jQuery.type( value ),
9910
-				fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ),
9911
-				local = this[ fn ](),
9912
-				cur = local[ prop.idx ],
9913
-				match;
9914 11999
 
9915
-			if ( vtype === "undefined" ) {
9916
-				return cur;
12000
+		if ( hoset + that.size.height >= that.parentData.height ) {
12001
+			that.size.height = that.parentData.height - hoset;
12002
+			if ( pRatio ) {
12003
+				that.size.width = that.size.height * that.aspectRatio;
12004
+				continueResize = false;
12005
+			}
9917 12006
 		}
9918 12007
 
9919
-			if ( vtype === "function" ) {
9920
-				value = value.call( this, cur );
9921
-				vtype = jQuery.type( value );
12008
+		if ( !continueResize ) {
12009
+			that.position.left = that.prevPosition.left;
12010
+			that.position.top = that.prevPosition.top;
12011
+			that.size.width = that.prevSize.width;
12012
+			that.size.height = that.prevSize.height;
9922 12013
 		}
9923
-			if ( value == null && prop.empty ) {
9924
-				return this;
12014
+	},
12015
+
12016
+	stop: function() {
12017
+		var that = $( this ).resizable( "instance" ),
12018
+			o = that.options,
12019
+			co = that.containerOffset,
12020
+			cop = that.containerPosition,
12021
+			ce = that.containerElement,
12022
+			helper = $( that.helper ),
12023
+			ho = helper.offset(),
12024
+			w = helper.outerWidth() - that.sizeDiff.width,
12025
+			h = helper.outerHeight() - that.sizeDiff.height;
12026
+
12027
+		if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) {
12028
+			$( this ).css( {
12029
+				left: ho.left - cop.left - co.left,
12030
+				width: w,
12031
+				height: h
12032
+			} );
9925 12033
 		}
9926
-			if ( vtype === "string" ) {
9927
-				match = rplusequals.exec( value );
9928
-				if ( match ) {
9929
-					value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 );
12034
+
12035
+		if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) {
12036
+			$( this ).css( {
12037
+				left: ho.left - cop.left - co.left,
12038
+				width: w,
12039
+				height: h
12040
+			} );
9930 12041
 		}
9931 12042
 	}
9932
-			local[ prop.idx ] = value;
9933
-			return this[ fn ]( local );
9934
-		};
12043
+} );
12044
+
12045
+$.ui.plugin.add( "resizable", "alsoResize", {
12046
+
12047
+	start: function() {
12048
+		var that = $( this ).resizable( "instance" ),
12049
+			o = that.options;
12050
+
12051
+		$( o.alsoResize ).each( function() {
12052
+			var el = $( this );
12053
+			el.data( "ui-resizable-alsoresize", {
12054
+				width: parseFloat( el.width() ), height: parseFloat( el.height() ),
12055
+				left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
9935 12056
 			} );
9936 12057
 		} );
12058
+	},
9937 12059
 
9938
-// add cssHook and .fx.step function for each named hook.
9939
-// accept a space separated string of properties
9940
-color.hook = function( hook ) {
9941
-	var hooks = hook.split( " " );
9942
-	each( hooks, function( i, hook ) {
9943
-		jQuery.cssHooks[ hook ] = {
9944
-			set: function( elem, value ) {
9945
-				var parsed, curElem,
9946
-					backgroundColor = "";
12060
+	resize: function( event, ui ) {
12061
+		var that = $( this ).resizable( "instance" ),
12062
+			o = that.options,
12063
+			os = that.originalSize,
12064
+			op = that.originalPosition,
12065
+			delta = {
12066
+				height: ( that.size.height - os.height ) || 0,
12067
+				width: ( that.size.width - os.width ) || 0,
12068
+				top: ( that.position.top - op.top ) || 0,
12069
+				left: ( that.position.left - op.left ) || 0
12070
+			};
9947 12071
 
9948
-				if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
9949
-					value = color( parsed || value );
9950
-					if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
9951
-						curElem = hook === "backgroundColor" ? elem.parentNode : elem;
9952
-						while (
9953
-							(backgroundColor === "" || backgroundColor === "transparent") &&
9954
-							curElem && curElem.style
9955
-						) {
9956
-							try {
9957
-								backgroundColor = jQuery.css( curElem, "backgroundColor" );
9958
-								curElem = curElem.parentNode;
9959
-							} catch ( e ) {
9960
-							}
9961
-						}
12072
+			$( o.alsoResize ).each( function() {
12073
+				var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {},
12074
+					css = el.parents( ui.originalElement[ 0 ] ).length ?
12075
+							[ "width", "height" ] :
12076
+							[ "width", "height", "top", "left" ];
9962 12077
 
9963
-						value = value.blend( backgroundColor && backgroundColor !== "transparent" ?
9964
-							backgroundColor :
9965
-							"_default" );
12078
+				$.each( css, function( i, prop ) {
12079
+					var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 );
12080
+					if ( sum && sum >= 0 ) {
12081
+						style[ prop ] = sum || null;
9966 12082
 					}
12083
+				} );
9967 12084
 
9968
-					value = value.toRgbaString();
9969
-				}
9970
-				try {
9971
-					elem.style[ hook ] = value;
9972
-				} catch ( e ) {
9973
-					// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
9974
-				}
9975
-			}
9976
-		};
9977
-		jQuery.fx.step[ hook ] = function( fx ) {
9978
-			if ( !fx.colorInit ) {
9979
-				fx.start = color( fx.elem, hook );
9980
-				fx.end = color( fx.end );
9981
-				fx.colorInit = true;
12085
+				el.css( style );
12086
+			} );
12087
+	},
12088
+
12089
+	stop: function() {
12090
+		$( this ).removeData( "ui-resizable-alsoresize" );
9982 12091
 	}
9983
-			jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) );
9984
-		};
9985 12092
 } );
9986 12093
 
9987
-};
12094
+$.ui.plugin.add( "resizable", "ghost", {
9988 12095
 
9989
-color.hook( stepHooks );
12096
+	start: function() {
9990 12097
 
9991
-jQuery.cssHooks.borderColor = {
9992
-	expand: function( value ) {
9993
-		var expanded = {};
12098
+		var that = $( this ).resizable( "instance" ), cs = that.size;
9994 12099
 
9995
-		each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) {
9996
-			expanded[ "border" + part + "Color" ] = value;
12100
+		that.ghost = that.originalElement.clone();
12101
+		that.ghost.css( {
12102
+			opacity: 0.25,
12103
+			display: "block",
12104
+			position: "relative",
12105
+			height: cs.height,
12106
+			width: cs.width,
12107
+			margin: 0,
12108
+			left: 0,
12109
+			top: 0
9997 12110
 		} );
9998
-		return expanded;
9999
-	}
10000
-};
10001 12111
 
10002
-// Basic color names only.
10003
-// Usage of any of the other color names requires adding yourself or including
10004
-// jquery.color.svg-names.js.
10005
-colors = jQuery.Color.names = {
10006
-	// 4.1. Basic color keywords
10007
-	aqua: "#00ffff",
10008
-	black: "#000000",
10009
-	blue: "#0000ff",
10010
-	fuchsia: "#ff00ff",
10011
-	gray: "#808080",
10012
-	green: "#008000",
10013
-	lime: "#00ff00",
10014
-	maroon: "#800000",
10015
-	navy: "#000080",
10016
-	olive: "#808000",
10017
-	purple: "#800080",
10018
-	red: "#ff0000",
10019
-	silver: "#c0c0c0",
10020
-	teal: "#008080",
10021
-	white: "#ffffff",
10022
-	yellow: "#ffff00",
12112
+		that._addClass( that.ghost, "ui-resizable-ghost" );
10023 12113
 
10024
-	// 4.2.3. "transparent" color keyword
10025
-	transparent: [ null, null, null, 0 ],
12114
+		// DEPRECATED
12115
+		// TODO: remove after 1.12
12116
+		if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) {
10026 12117
 
10027
-	_default: "#ffffff"
10028
-};
12118
+			// Ghost option
12119
+			that.ghost.addClass( this.options.ghost );
12120
+		}
10029 12121
 
10030
-})( jQuery );
12122
+		that.ghost.appendTo( that.helper );
10031 12123
 
10032
-/******************************************************************************/
10033
-/****************************** CLASS ANIMATIONS ******************************/
10034
-/******************************************************************************/
10035
-(function() {
12124
+	},
10036 12125
 
10037
-var classAnimationActions = [ "add", "remove", "toggle" ],
10038
-	shorthandStyles = {
10039
-		border: 1,
10040
-		borderBottom: 1,
10041
-		borderColor: 1,
10042
-		borderLeft: 1,
10043
-		borderRight: 1,
10044
-		borderTop: 1,
10045
-		borderWidth: 1,
10046
-		margin: 1,
10047
-		padding: 1
10048
-	};
12126
+	resize: function() {
12127
+		var that = $( this ).resizable( "instance" );
12128
+		if ( that.ghost ) {
12129
+			that.ghost.css( {
12130
+				position: "relative",
12131
+				height: that.size.height,
12132
+				width: that.size.width
12133
+			} );
12134
+		}
12135
+	},
10049 12136
 
10050
-$.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) {
10051
-	$.fx.step[ prop ] = function( fx ) {
10052
-		if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) {
10053
-			jQuery.style( fx.elem, prop, fx.end );
10054
-			fx.setAttr = true;
12137
+	stop: function() {
12138
+		var that = $( this ).resizable( "instance" );
12139
+		if ( that.ghost && that.helper ) {
12140
+			that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) );
10055 12141
 		}
10056
-	};
12142
+	}
12143
+
10057 12144
 } );
10058 12145
 
10059
-function getElementStyles( elem ) {
10060
-	var key, len,
10061
-		style = elem.ownerDocument.defaultView ?
10062
-			elem.ownerDocument.defaultView.getComputedStyle( elem, null ) :
10063
-			elem.currentStyle,
10064
-		styles = {};
12146
+$.ui.plugin.add( "resizable", "grid", {
10065 12147
 
10066
-	if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) {
10067
-		len = style.length;
10068
-		while ( len-- ) {
10069
-			key = style[ len ];
10070
-			if ( typeof style[ key ] === "string" ) {
10071
-				styles[ $.camelCase( key ) ] = style[ key ];
10072
-			}
12148
+	resize: function() {
12149
+		var outerDimensions,
12150
+			that = $( this ).resizable( "instance" ),
12151
+			o = that.options,
12152
+			cs = that.size,
12153
+			os = that.originalSize,
12154
+			op = that.originalPosition,
12155
+			a = that.axis,
12156
+			grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid,
12157
+			gridX = ( grid[ 0 ] || 1 ),
12158
+			gridY = ( grid[ 1 ] || 1 ),
12159
+			ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX,
12160
+			oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY,
12161
+			newWidth = os.width + ox,
12162
+			newHeight = os.height + oy,
12163
+			isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ),
12164
+			isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ),
12165
+			isMinWidth = o.minWidth && ( o.minWidth > newWidth ),
12166
+			isMinHeight = o.minHeight && ( o.minHeight > newHeight );
12167
+
12168
+		o.grid = grid;
12169
+
12170
+		if ( isMinWidth ) {
12171
+			newWidth += gridX;
10073 12172
 		}
10074
-	// support: Opera, IE <9
10075
-	} else {
10076
-		for ( key in style ) {
10077
-			if ( typeof style[ key ] === "string" ) {
10078
-				styles[ key ] = style[ key ];
12173
+		if ( isMinHeight ) {
12174
+			newHeight += gridY;
10079 12175
 		}
12176
+		if ( isMaxWidth ) {
12177
+			newWidth -= gridX;
10080 12178
 		}
12179
+		if ( isMaxHeight ) {
12180
+			newHeight -= gridY;
10081 12181
 		}
10082 12182
 
10083
-	return styles;
12183
+		if ( /^(se|s|e)$/.test( a ) ) {
12184
+			that.size.width = newWidth;
12185
+			that.size.height = newHeight;
12186
+		} else if ( /^(ne)$/.test( a ) ) {
12187
+			that.size.width = newWidth;
12188
+			that.size.height = newHeight;
12189
+			that.position.top = op.top - oy;
12190
+		} else if ( /^(sw)$/.test( a ) ) {
12191
+			that.size.width = newWidth;
12192
+			that.size.height = newHeight;
12193
+			that.position.left = op.left - ox;
12194
+		} else {
12195
+			if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) {
12196
+				outerDimensions = that._getPaddingPlusBorderDimensions( this );
10084 12197
 			}
10085 12198
 
10086
-function styleDifference( oldStyle, newStyle ) {
10087
-	var diff = {},
10088
-		name, value;
10089
-
10090
-	for ( name in newStyle ) {
10091
-		value = newStyle[ name ];
10092
-		if ( oldStyle[ name ] !== value ) {
10093
-			if ( !shorthandStyles[ name ] ) {
10094
-				if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) {
10095
-					diff[ name ] = value;
10096
-				}
12199
+			if ( newHeight - gridY > 0 ) {
12200
+				that.size.height = newHeight;
12201
+				that.position.top = op.top - oy;
12202
+			} else {
12203
+				newHeight = gridY - outerDimensions.height;
12204
+				that.size.height = newHeight;
12205
+				that.position.top = op.top + os.height - newHeight;
10097 12206
 			}
12207
+			if ( newWidth - gridX > 0 ) {
12208
+				that.size.width = newWidth;
12209
+				that.position.left = op.left - ox;
12210
+			} else {
12211
+				newWidth = gridX - outerDimensions.width;
12212
+				that.size.width = newWidth;
12213
+				that.position.left = op.left + os.width - newWidth;
10098 12214
 			}
10099 12215
 		}
10100
-
10101
-	return diff;
10102 12216
 	}
10103 12217
 
10104
-// support: jQuery <1.8
10105
-if ( !$.fn.addBack ) {
10106
-	$.fn.addBack = function( selector ) {
10107
-		return this.add( selector == null ?
10108
-			this.prevObject : this.prevObject.filter( selector )
10109
-		);
10110
-	};
10111
-}
12218
+} );
10112 12219
 
10113
-$.effects.animateClass = function( value, duration, easing, callback ) {
10114
-	var o = $.speed( duration, easing, callback );
12220
+var widgetsResizable = $.ui.resizable;
10115 12221
 
10116
-	return this.queue( function() {
10117
-		var animated = $( this ),
10118
-			baseClass = animated.attr( "class" ) || "",
10119
-			applyClassChange,
10120
-			allAnimations = o.children ? animated.find( "*" ).addBack() : animated;
10121 12222
 
10122
-		// map the animated objects to store the original styles.
10123
-		allAnimations = allAnimations.map(function() {
10124
-			var el = $( this );
10125
-			return {
10126
-				el: el,
10127
-				start: getElementStyles( this )
10128
-			};
10129
-		});
12223
+/*!
12224
+ * jQuery UI Dialog 1.13.2
12225
+ * http://jqueryui.com
12226
+ *
12227
+ * Copyright jQuery Foundation and other contributors
12228
+ * Released under the MIT license.
12229
+ * http://jquery.org/license
12230
+ */
10130 12231
 
10131
-		// apply class change
10132
-		applyClassChange = function() {
10133
-			$.each( classAnimationActions, function(i, action) {
10134
-				if ( value[ action ] ) {
10135
-					animated[ action + "Class" ]( value[ action ] );
10136
-				}
10137
-			});
10138
-		};
10139
-		applyClassChange();
12232
+//>>label: Dialog
12233
+//>>group: Widgets
12234
+//>>description: Displays customizable dialog windows.
12235
+//>>docs: http://api.jqueryui.com/dialog/
12236
+//>>demos: http://jqueryui.com/dialog/
12237
+//>>css.structure: ../../themes/base/core.css
12238
+//>>css.structure: ../../themes/base/dialog.css
12239
+//>>css.theme: ../../themes/base/theme.css
10140 12240
 
10141
-		// map all animated objects again - calculate new styles and diff
10142
-		allAnimations = allAnimations.map(function() {
10143
-			this.end = getElementStyles( this.el[ 0 ] );
10144
-			this.diff = styleDifference( this.start, this.end );
10145
-			return this;
10146
-		});
10147 12241
 
10148
-		// apply original class
10149
-		animated.attr( "class", baseClass );
12242
+$.widget( "ui.dialog", {
12243
+	version: "1.13.2",
12244
+	options: {
12245
+		appendTo: "body",
12246
+		autoOpen: true,
12247
+		buttons: [],
12248
+		classes: {
12249
+			"ui-dialog": "ui-corner-all",
12250
+			"ui-dialog-titlebar": "ui-corner-all"
12251
+		},
12252
+		closeOnEscape: true,
12253
+		closeText: "Close",
12254
+		draggable: true,
12255
+		hide: null,
12256
+		height: "auto",
12257
+		maxHeight: null,
12258
+		maxWidth: null,
12259
+		minHeight: 150,
12260
+		minWidth: 150,
12261
+		modal: false,
12262
+		position: {
12263
+			my: "center",
12264
+			at: "center",
12265
+			of: window,
12266
+			collision: "fit",
10150 12267
 
10151
-		// map all animated objects again - this time collecting a promise
10152
-		allAnimations = allAnimations.map(function() {
10153
-			var styleInfo = this,
10154
-				dfd = $.Deferred(),
10155
-				opts = $.extend({}, o, {
10156
-					queue: false,
10157
-					complete: function() {
10158
-						dfd.resolve( styleInfo );
12268
+			// Ensure the titlebar is always visible
12269
+			using: function( pos ) {
12270
+				var topOffset = $( this ).css( pos ).offset().top;
12271
+				if ( topOffset < 0 ) {
12272
+					$( this ).css( "top", pos.top - topOffset );
10159 12273
 				}
10160
-				});
10161
-
10162
-			this.el.animate( this.diff, opts );
10163
-			return dfd.promise();
10164
-		});
10165
-
10166
-		// once all animations have completed:
10167
-		$.when.apply( $, allAnimations.get() ).done(function() {
12274
+			}
12275
+		},
12276
+		resizable: true,
12277
+		show: null,
12278
+		title: null,
12279
+		width: 300,
10168 12280
 
10169
-			// set the final class
10170
-			applyClassChange();
12281
+		// Callbacks
12282
+		beforeClose: null,
12283
+		close: null,
12284
+		drag: null,
12285
+		dragStart: null,
12286
+		dragStop: null,
12287
+		focus: null,
12288
+		open: null,
12289
+		resize: null,
12290
+		resizeStart: null,
12291
+		resizeStop: null
12292
+	},
10171 12293
 
10172
-			// for each animated element,
10173
-			// clear all css properties that were animated
10174
-			$.each( arguments, function() {
10175
-				var el = this.el;
10176
-				$.each( this.diff, function(key) {
10177
-					el.css( key, "" );
10178
-				});
10179
-			});
12294
+	sizeRelatedOptions: {
12295
+		buttons: true,
12296
+		height: true,
12297
+		maxHeight: true,
12298
+		maxWidth: true,
12299
+		minHeight: true,
12300
+		minWidth: true,
12301
+		width: true
12302
+	},
10180 12303
 
10181
-			// this is guarnteed to be there if you use jQuery.speed()
10182
-			// it also handles dequeuing the next anim...
10183
-			o.complete.call( animated[ 0 ] );
10184
-		});
10185
-	});
10186
-};
12304
+	resizableRelatedOptions: {
12305
+		maxHeight: true,
12306
+		maxWidth: true,
12307
+		minHeight: true,
12308
+		minWidth: true
12309
+	},
10187 12310
 
10188
-$.fn.extend({
10189
-	addClass: (function( orig ) {
10190
-		return function( classNames, speed, easing, callback ) {
10191
-			return speed ?
10192
-				$.effects.animateClass.call( this,
10193
-					{ add: classNames }, speed, easing, callback ) :
10194
-				orig.apply( this, arguments );
12311
+	_create: function() {
12312
+		this.originalCss = {
12313
+			display: this.element[ 0 ].style.display,
12314
+			width: this.element[ 0 ].style.width,
12315
+			minHeight: this.element[ 0 ].style.minHeight,
12316
+			maxHeight: this.element[ 0 ].style.maxHeight,
12317
+			height: this.element[ 0 ].style.height
10195 12318
 		};
10196
-	})( $.fn.addClass ),
10197
-
10198
-	removeClass: (function( orig ) {
10199
-		return function( classNames, speed, easing, callback ) {
10200
-			return arguments.length > 1 ?
10201
-				$.effects.animateClass.call( this,
10202
-					{ remove: classNames }, speed, easing, callback ) :
10203
-				orig.apply( this, arguments );
12319
+		this.originalPosition = {
12320
+			parent: this.element.parent(),
12321
+			index: this.element.parent().children().index( this.element )
10204 12322
 		};
10205
-	})( $.fn.removeClass ),
10206
-
10207
-	toggleClass: (function( orig ) {
10208
-		return function( classNames, force, speed, easing, callback ) {
10209
-			if ( typeof force === "boolean" || force === undefined ) {
10210
-				if ( !speed ) {
10211
-					// without speed parameter
10212
-					return orig.apply( this, arguments );
10213
-				} else {
10214
-					return $.effects.animateClass.call( this,
10215
-						(force ? { add: classNames } : { remove: classNames }),
10216
-						speed, easing, callback );
10217
-				}
10218
-			} else {
10219
-				// without force parameter
10220
-				return $.effects.animateClass.call( this,
10221
-					{ toggle: classNames }, force, speed, easing );
12323
+		this.originalTitle = this.element.attr( "title" );
12324
+		if ( this.options.title == null && this.originalTitle != null ) {
12325
+			this.options.title = this.originalTitle;
10222 12326
 		}
10223
-		};
10224
-	})( $.fn.toggleClass ),
10225 12327
 
10226
-	switchClass: function( remove, add, speed, easing, callback) {
10227
-		return $.effects.animateClass.call( this, {
10228
-			add: add,
10229
-			remove: remove
10230
-		}, speed, easing, callback );
12328
+		// Dialogs can't be disabled
12329
+		if ( this.options.disabled ) {
12330
+			this.options.disabled = false;
10231 12331
 		}
10232
-});
10233
-
10234
-})();
10235 12332
 
10236
-/******************************************************************************/
10237
-/*********************************** EFFECTS **********************************/
10238
-/******************************************************************************/
12333
+		this._createWrapper();
10239 12334
 
10240
-(function() {
12335
+		this.element
12336
+			.show()
12337
+			.removeAttr( "title" )
12338
+			.appendTo( this.uiDialog );
10241 12339
 
10242
-$.extend( $.effects, {
10243
-	version: "1.11.4",
12340
+		this._addClass( "ui-dialog-content", "ui-widget-content" );
10244 12341
 
10245
-	// Saves a set of properties in a data storage
10246
-	save: function( element, set ) {
10247
-		for ( var i = 0; i < set.length; i++ ) {
10248
-			if ( set[ i ] !== null ) {
10249
-				element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] );
10250
-			}
10251
-		}
10252
-	},
12342
+		this._createTitlebar();
12343
+		this._createButtonPane();
10253 12344
 
10254
-	// Restores a set of previously saved properties from a data storage
10255
-	restore: function( element, set ) {
10256
-		var val, i;
10257
-		for ( i = 0; i < set.length; i++ ) {
10258
-			if ( set[ i ] !== null ) {
10259
-				val = element.data( dataSpace + set[ i ] );
10260
-				// support: jQuery 1.6.2
10261
-				// http://bugs.jquery.com/ticket/9917
10262
-				// jQuery 1.6.2 incorrectly returns undefined for any falsy value.
10263
-				// We can't differentiate between "" and 0 here, so we just assume
10264
-				// empty string since it's likely to be a more common value...
10265
-				if ( val === undefined ) {
10266
-					val = "";
10267
-				}
10268
-				element.css( set[ i ], val );
12345
+		if ( this.options.draggable && $.fn.draggable ) {
12346
+			this._makeDraggable();
10269 12347
 		}
12348
+		if ( this.options.resizable && $.fn.resizable ) {
12349
+			this._makeResizable();
10270 12350
 		}
12351
+
12352
+		this._isOpen = false;
12353
+
12354
+		this._trackFocus();
10271 12355
 	},
10272 12356
 
10273
-	setMode: function( el, mode ) {
10274
-		if (mode === "toggle") {
10275
-			mode = el.is( ":hidden" ) ? "show" : "hide";
12357
+	_init: function() {
12358
+		if ( this.options.autoOpen ) {
12359
+			this.open();
10276 12360
 		}
10277
-		return mode;
10278 12361
 	},
10279 12362
 
10280
-	// Translates a [top,left] array into a baseline value
10281
-	// this should be a little more flexible in the future to handle a string & hash
10282
-	getBaseline: function( origin, original ) {
10283
-		var y, x;
10284
-		switch ( origin[ 0 ] ) {
10285
-			case "top": y = 0; break;
10286
-			case "middle": y = 0.5; break;
10287
-			case "bottom": y = 1; break;
10288
-			default: y = origin[ 0 ] / original.height;
10289
-		}
10290
-		switch ( origin[ 1 ] ) {
10291
-			case "left": x = 0; break;
10292
-			case "center": x = 0.5; break;
10293
-			case "right": x = 1; break;
10294
-			default: x = origin[ 1 ] / original.width;
12363
+	_appendTo: function() {
12364
+		var element = this.options.appendTo;
12365
+		if ( element && ( element.jquery || element.nodeType ) ) {
12366
+			return $( element );
10295 12367
 		}
10296
-		return {
10297
-			x: x,
10298
-			y: y
10299
-		};
12368
+		return this.document.find( element || "body" ).eq( 0 );
10300 12369
 	},
10301 12370
 
10302
-	// Wraps the element around a wrapper that copies position properties
10303
-	createWrapper: function( element ) {
12371
+	_destroy: function() {
12372
+		var next,
12373
+			originalPosition = this.originalPosition;
10304 12374
 
10305
-		// if the element is already wrapped, return it
10306
-		if ( element.parent().is( ".ui-effects-wrapper" )) {
10307
-			return element.parent();
10308
-		}
12375
+		this._untrackInstance();
12376
+		this._destroyOverlay();
10309 12377
 
10310
-		// wrap the element
10311
-		var props = {
10312
-				width: element.outerWidth(true),
10313
-				height: element.outerHeight(true),
10314
-				"float": element.css( "float" )
10315
-			},
10316
-			wrapper = $( "<div></div>" )
10317
-				.addClass( "ui-effects-wrapper" )
10318
-				.css({
10319
-					fontSize: "100%",
10320
-					background: "transparent",
10321
-					border: "none",
10322
-					margin: 0,
10323
-					padding: 0
10324
-				}),
10325
-			// Store the size in case width/height are defined in % - Fixes #5245
10326
-			size = {
10327
-				width: element.width(),
10328
-				height: element.height()
10329
-			},
10330
-			active = document.activeElement;
12378
+		this.element
12379
+			.removeUniqueId()
12380
+			.css( this.originalCss )
10331 12381
 
10332
-		// support: Firefox
10333
-		// Firefox incorrectly exposes anonymous content
10334
-		// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
10335
-		try {
10336
-			active.id;
10337
-		} catch ( e ) {
10338
-			active = document.body;
10339
-		}
12382
+			// Without detaching first, the following becomes really slow
12383
+			.detach();
10340 12384
 
10341
-		element.wrap( wrapper );
12385
+		this.uiDialog.remove();
10342 12386
 
10343
-		// Fixes #7595 - Elements lose focus when wrapped.
10344
-		if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
10345
-			$( active ).focus();
12387
+		if ( this.originalTitle ) {
12388
+			this.element.attr( "title", this.originalTitle );
10346 12389
 		}
10347 12390
 
10348
-		wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
12391
+		next = originalPosition.parent.children().eq( originalPosition.index );
10349 12392
 
10350
-		// transfer positioning properties to the wrapper
10351
-		if ( element.css( "position" ) === "static" ) {
10352
-			wrapper.css({ position: "relative" });
10353
-			element.css({ position: "relative" });
12393
+		// Don't try to place the dialog next to itself (#8613)
12394
+		if ( next.length && next[ 0 ] !== this.element[ 0 ] ) {
12395
+			next.before( this.element );
10354 12396
 		} else {
10355
-			$.extend( props, {
10356
-				position: element.css( "position" ),
10357
-				zIndex: element.css( "z-index" )
10358
-			});
10359
-			$.each([ "top", "left", "bottom", "right" ], function(i, pos) {
10360
-				props[ pos ] = element.css( pos );
10361
-				if ( isNaN( parseInt( props[ pos ], 10 ) ) ) {
10362
-					props[ pos ] = "auto";
10363
-				}
10364
-			});
10365
-			element.css({
10366
-				position: "relative",
10367
-				top: 0,
10368
-				left: 0,
10369
-				right: "auto",
10370
-				bottom: "auto"
10371
-			});
12397
+			originalPosition.parent.append( this.element );
10372 12398
 		}
10373
-		element.css(size);
10374
-
10375
-		return wrapper.css( props ).show();
10376 12399
 	},
10377 12400
 
10378
-	removeWrapper: function( element ) {
10379
-		var active = document.activeElement;
10380
-
10381
-		if ( element.parent().is( ".ui-effects-wrapper" ) ) {
10382
-			element.parent().replaceWith( element );
10383
-
10384
-			// Fixes #7595 - Elements lose focus when wrapped.
10385
-			if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
10386
-				$( active ).focus();
10387
-			}
10388
-		}
10389
-
10390
-		return element;
12401
+	widget: function() {
12402
+		return this.uiDialog;
10391 12403
 	},
10392 12404
 
10393
-	setTransition: function( element, list, factor, value ) {
10394
-		value = value || {};
10395
-		$.each( list, function( i, x ) {
10396
-			var unit = element.cssUnit( x );
10397
-			if ( unit[ 0 ] > 0 ) {
10398
-				value[ x ] = unit[ 0 ] * factor + unit[ 1 ];
10399
-			}
10400
-		});
10401
-		return value;
10402
-	}
10403
-});
10404
-
10405
-// return an effect options object for the given parameters:
10406
-function _normalizeArguments( effect, options, speed, callback ) {
10407
-
10408
-	// allow passing all options as the first parameter
10409
-	if ( $.isPlainObject( effect ) ) {
10410
-		options = effect;
10411
-		effect = effect.effect;
10412
-	}
12405
+	disable: $.noop,
12406
+	enable: $.noop,
10413 12407
 
10414
-	// convert to an object
10415
-	effect = { effect: effect };
12408
+	close: function( event ) {
12409
+		var that = this;
10416 12410
 
10417
-	// catch (effect, null, ...)
10418
-	if ( options == null ) {
10419
-		options = {};
12411
+		if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) {
12412
+			return;
10420 12413
 		}
10421 12414
 
10422
-	// catch (effect, callback)
10423
-	if ( $.isFunction( options ) ) {
10424
-		callback = options;
10425
-		speed = null;
10426
-		options = {};
10427
-	}
12415
+		this._isOpen = false;
12416
+		this._focusedElement = null;
12417
+		this._destroyOverlay();
12418
+		this._untrackInstance();
10428 12419
 
10429
-	// catch (effect, speed, ?)
10430
-	if ( typeof options === "number" || $.fx.speeds[ options ] ) {
10431
-		callback = speed;
10432
-		speed = options;
10433
-		options = {};
10434
-	}
12420
+		if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) {
10435 12421
 
10436
-	// catch (effect, options, callback)
10437
-	if ( $.isFunction( speed ) ) {
10438
-		callback = speed;
10439
-		speed = null;
12422
+			// Hiding a focused element doesn't trigger blur in WebKit
12423
+			// so in case we have nothing to focus on, explicitly blur the active element
12424
+			// https://bugs.webkit.org/show_bug.cgi?id=47182
12425
+			$.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) );
10440 12426
 		}
10441 12427
 
10442
-	// add options to effect
10443
-	if ( options ) {
10444
-		$.extend( effect, options );
10445
-	}
12428
+		this._hide( this.uiDialog, this.options.hide, function() {
12429
+			that._trigger( "close", event );
12430
+		} );
12431
+	},
10446 12432
 
10447
-	speed = speed || options.duration;
10448
-	effect.duration = $.fx.off ? 0 :
10449
-		typeof speed === "number" ? speed :
10450
-		speed in $.fx.speeds ? $.fx.speeds[ speed ] :
10451
-		$.fx.speeds._default;
12433
+	isOpen: function() {
12434
+		return this._isOpen;
12435
+	},
10452 12436
 
10453
-	effect.complete = callback || options.complete;
12437
+	moveToTop: function() {
12438
+		this._moveToTop();
12439
+	},
10454 12440
 
10455
-	return effect;
10456
-}
12441
+	_moveToTop: function( event, silent ) {
12442
+		var moved = false,
12443
+			zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() {
12444
+				return +$( this ).css( "z-index" );
12445
+			} ).get(),
12446
+			zIndexMax = Math.max.apply( null, zIndices );
10457 12447
 
10458
-function standardAnimationOption( option ) {
10459
-	// Valid standard speeds (nothing, number, named speed)
10460
-	if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) {
10461
-		return true;
12448
+		if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) {
12449
+			this.uiDialog.css( "z-index", zIndexMax + 1 );
12450
+			moved = true;
10462 12451
 		}
10463 12452
 
10464
-	// Invalid strings - treat as "normal" speed
10465
-	if ( typeof option === "string" && !$.effects.effect[ option ] ) {
10466
-		return true;
12453
+		if ( moved && !silent ) {
12454
+			this._trigger( "focus", event );
10467 12455
 		}
12456
+		return moved;
12457
+	},
10468 12458
 
10469
-	// Complete callback
10470
-	if ( $.isFunction( option ) ) {
10471
-		return true;
12459
+	open: function() {
12460
+		var that = this;
12461
+		if ( this._isOpen ) {
12462
+			if ( this._moveToTop() ) {
12463
+				this._focusTabbable();
10472 12464
 			}
10473
-
10474
-	// Options hash (but not naming an effect)
10475
-	if ( typeof option === "object" && !option.effect ) {
10476
-		return true;
12465
+			return;
10477 12466
 		}
10478 12467
 
10479
-	// Didn't match any standard API
10480
-	return false;
10481
-}
12468
+		this._isOpen = true;
12469
+		this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) );
10482 12470
 
10483
-$.fn.extend({
10484
-	effect: function( /* effect, options, speed, callback */ ) {
10485
-		var args = _normalizeArguments.apply( this, arguments ),
10486
-			mode = args.mode,
10487
-			queue = args.queue,
10488
-			effectMethod = $.effects.effect[ args.effect ];
12471
+		this._size();
12472
+		this._position();
12473
+		this._createOverlay();
12474
+		this._moveToTop( null, true );
10489 12475
 
10490
-		if ( $.fx.off || !effectMethod ) {
10491
-			// delegate to the original method (e.g., .show()) if possible
10492
-			if ( mode ) {
10493
-				return this[ mode ]( args.duration, args.complete );
10494
-			} else {
10495
-				return this.each( function() {
10496
-					if ( args.complete ) {
10497
-						args.complete.call( this );
12476
+		// Ensure the overlay is moved to the top with the dialog, but only when
12477
+		// opening. The overlay shouldn't move after the dialog is open so that
12478
+		// modeless dialogs opened after the modal dialog stack properly.
12479
+		if ( this.overlay ) {
12480
+			this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 );
10498 12481
 		}
12482
+
12483
+		this._show( this.uiDialog, this.options.show, function() {
12484
+			that._focusTabbable();
12485
+			that._trigger( "focus" );
10499 12486
 		} );
10500
-			}
10501
-		}
10502 12487
 
10503
-		function run( next ) {
10504
-			var elem = $( this ),
10505
-				complete = args.complete,
10506
-				mode = args.mode;
12488
+		// Track the dialog immediately upon opening in case a focus event
12489
+		// somehow occurs outside of the dialog before an element inside the
12490
+		// dialog is focused (#10152)
12491
+		this._makeFocusTarget();
12492
+
12493
+		this._trigger( "open" );
12494
+	},
10507 12495
 
10508
-			function done() {
10509
-				if ( $.isFunction( complete ) ) {
10510
-					complete.call( elem[0] );
12496
+	_focusTabbable: function() {
12497
+
12498
+		// Set focus to the first match:
12499
+		// 1. An element that was focused previously
12500
+		// 2. First element inside the dialog matching [autofocus]
12501
+		// 3. Tabbable element inside the content element
12502
+		// 4. Tabbable element inside the buttonpane
12503
+		// 5. The close button
12504
+		// 6. The dialog itself
12505
+		var hasFocus = this._focusedElement;
12506
+		if ( !hasFocus ) {
12507
+			hasFocus = this.element.find( "[autofocus]" );
10511 12508
 		}
10512
-				if ( $.isFunction( next ) ) {
10513
-					next();
12509
+		if ( !hasFocus.length ) {
12510
+			hasFocus = this.element.find( ":tabbable" );
10514 12511
 		}
12512
+		if ( !hasFocus.length ) {
12513
+			hasFocus = this.uiDialogButtonPane.find( ":tabbable" );
10515 12514
 		}
10516
-
10517
-			// If the element already has the correct final state, delegate to
10518
-			// the core methods so the internal tracking of "olddisplay" works.
10519
-			if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) {
10520
-				elem[ mode ]();
10521
-				done();
10522
-			} else {
10523
-				effectMethod.call( elem[0], args, done );
12515
+		if ( !hasFocus.length ) {
12516
+			hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" );
10524 12517
 		}
12518
+		if ( !hasFocus.length ) {
12519
+			hasFocus = this.uiDialog;
10525 12520
 		}
10526
-
10527
-		return queue === false ? this.each( run ) : this.queue( queue || "fx", run );
12521
+		hasFocus.eq( 0 ).trigger( "focus" );
10528 12522
 	},
10529 12523
 
10530
-	show: (function( orig ) {
10531
-		return function( option ) {
10532
-			if ( standardAnimationOption( option ) ) {
10533
-				return orig.apply( this, arguments );
10534
-			} else {
10535
-				var args = _normalizeArguments.apply( this, arguments );
10536
-				args.mode = "show";
10537
-				return this.effect.call( this, args );
10538
-			}
10539
-		};
10540
-	})( $.fn.show ),
10541
-
10542
-	hide: (function( orig ) {
10543
-		return function( option ) {
10544
-			if ( standardAnimationOption( option ) ) {
10545
-				return orig.apply( this, arguments );
10546
-			} else {
10547
-				var args = _normalizeArguments.apply( this, arguments );
10548
-				args.mode = "hide";
10549
-				return this.effect.call( this, args );
10550
-			}
10551
-		};
10552
-	})( $.fn.hide ),
10553
-
10554
-	toggle: (function( orig ) {
10555
-		return function( option ) {
10556
-			if ( standardAnimationOption( option ) || typeof option === "boolean" ) {
10557
-				return orig.apply( this, arguments );
10558
-			} else {
10559
-				var args = _normalizeArguments.apply( this, arguments );
10560
-				args.mode = "toggle";
10561
-				return this.effect.call( this, args );
12524
+	_restoreTabbableFocus: function() {
12525
+		var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ),
12526
+			isActive = this.uiDialog[ 0 ] === activeElement ||
12527
+				$.contains( this.uiDialog[ 0 ], activeElement );
12528
+		if ( !isActive ) {
12529
+			this._focusTabbable();
10562 12530
 		}
10563
-		};
10564
-	})( $.fn.toggle ),
10565
-
10566
-	// helper functions
10567
-	cssUnit: function(key) {
10568
-		var style = this.css( key ),
10569
-			val = [];
12531
+	},
10570 12532
 
10571
-		$.each( [ "em", "px", "%", "pt" ], function( i, unit ) {
10572
-			if ( style.indexOf( unit ) > 0 ) {
10573
-				val = [ parseFloat( style ), unit ];
10574
-			}
10575
-		});
10576
-		return val;
10577
-	}
10578
-});
12533
+	_keepFocus: function( event ) {
12534
+		event.preventDefault();
12535
+		this._restoreTabbableFocus();
10579 12536
 
10580
-})();
12537
+		// support: IE
12538
+		// IE <= 8 doesn't prevent moving focus even with event.preventDefault()
12539
+		// so we check again later
12540
+		this._delay( this._restoreTabbableFocus );
12541
+	},
10581 12542
 
10582
-/******************************************************************************/
10583
-/*********************************** EASING ***********************************/
10584
-/******************************************************************************/
12543
+	_createWrapper: function() {
12544
+		this.uiDialog = $( "<div>" )
12545
+			.hide()
12546
+			.attr( {
10585 12547
 
10586
-(function() {
12548
+				// Setting tabIndex makes the div focusable
12549
+				tabIndex: -1,
12550
+				role: "dialog"
12551
+			} )
12552
+			.appendTo( this._appendTo() );
10587 12553
 
10588
-// based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
12554
+		this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
12555
+		this._on( this.uiDialog, {
12556
+			keydown: function( event ) {
12557
+				if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
12558
+						event.keyCode === $.ui.keyCode.ESCAPE ) {
12559
+					event.preventDefault();
12560
+					this.close( event );
12561
+					return;
12562
+				}
10589 12563
 
10590
-var baseEasings = {};
12564
+				// Prevent tabbing out of dialogs
12565
+				if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) {
12566
+					return;
12567
+				}
12568
+				var tabbables = this.uiDialog.find( ":tabbable" ),
12569
+					first = tabbables.first(),
12570
+					last = tabbables.last();
10591 12571
 
10592
-$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) {
10593
-	baseEasings[ name ] = function( p ) {
10594
-		return Math.pow( p, i + 2 );
10595
-	};
12572
+				if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) &&
12573
+						!event.shiftKey ) {
12574
+					this._delay( function() {
12575
+						first.trigger( "focus" );
10596 12576
 					} );
10597
-
10598
-$.extend( baseEasings, {
10599
-	Sine: function( p ) {
10600
-		return 1 - Math.cos( p * Math.PI / 2 );
10601
-	},
10602
-	Circ: function( p ) {
10603
-		return 1 - Math.sqrt( 1 - p * p );
10604
-	},
10605
-	Elastic: function( p ) {
10606
-		return p === 0 || p === 1 ? p :
10607
-			-Math.pow( 2, 8 * (p - 1) ) * Math.sin( ( (p - 1) * 80 - 7.5 ) * Math.PI / 15 );
10608
-	},
10609
-	Back: function( p ) {
10610
-		return p * p * ( 3 * p - 2 );
12577
+					event.preventDefault();
12578
+				} else if ( ( event.target === first[ 0 ] ||
12579
+						event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) {
12580
+					this._delay( function() {
12581
+						last.trigger( "focus" );
12582
+					} );
12583
+					event.preventDefault();
12584
+				}
10611 12585
 			},
10612
-	Bounce: function( p ) {
10613
-		var pow2,
10614
-			bounce = 4;
10615
-
10616
-		while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {}
10617
-		return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 );
12586
+			mousedown: function( event ) {
12587
+				if ( this._moveToTop( event ) ) {
12588
+					this._focusTabbable();
12589
+				}
10618 12590
 			}
10619 12591
 		} );
10620 12592
 
10621
-$.each( baseEasings, function( name, easeIn ) {
10622
-	$.easing[ "easeIn" + name ] = easeIn;
10623
-	$.easing[ "easeOut" + name ] = function( p ) {
10624
-		return 1 - easeIn( 1 - p );
10625
-	};
10626
-	$.easing[ "easeInOut" + name ] = function( p ) {
10627
-		return p < 0.5 ?
10628
-			easeIn( p * 2 ) / 2 :
10629
-			1 - easeIn( p * -2 + 2 ) / 2;
10630
-	};
12593
+		// We assume that any existing aria-describedby attribute means
12594
+		// that the dialog content is marked up properly
12595
+		// otherwise we brute force the content as the description
12596
+		if ( !this.element.find( "[aria-describedby]" ).length ) {
12597
+			this.uiDialog.attr( {
12598
+				"aria-describedby": this.element.uniqueId().attr( "id" )
10631 12599
 			} );
12600
+		}
12601
+	},
10632 12602
 
10633
-})();
10634
-
10635
-var effect = $.effects;
12603
+	_createTitlebar: function() {
12604
+		var uiDialogTitle;
10636 12605
 
12606
+		this.uiDialogTitlebar = $( "<div>" );
12607
+		this._addClass( this.uiDialogTitlebar,
12608
+			"ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" );
12609
+		this._on( this.uiDialogTitlebar, {
12610
+			mousedown: function( event ) {
10637 12611
 
10638
-/*!
10639
- * jQuery UI Effects Blind 1.11.4
10640
- * http://jqueryui.com
10641
- *
10642
- * Copyright jQuery Foundation and other contributors
10643
- * Released under the MIT license.
10644
- * http://jquery.org/license
10645
- *
10646
- * http://api.jqueryui.com/blind-effect/
10647
- */
12612
+				// Don't prevent click on close button (#8838)
12613
+				// Focusing a dialog that is partially scrolled out of view
12614
+				// causes the browser to scroll it into view, preventing the click event
12615
+				if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) {
10648 12616
 
12617
+					// Dialog isn't getting focus when dragging (#8063)
12618
+					this.uiDialog.trigger( "focus" );
12619
+				}
12620
+			}
12621
+		} );
10649 12622
 
10650
-var effectBlind = $.effects.effect.blind = function( o, done ) {
10651
-	// Create element
10652
-	var el = $( this ),
10653
-		rvertical = /up|down|vertical/,
10654
-		rpositivemotion = /up|left|vertical|horizontal/,
10655
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10656
-		mode = $.effects.setMode( el, o.mode || "hide" ),
10657
-		direction = o.direction || "up",
10658
-		vertical = rvertical.test( direction ),
10659
-		ref = vertical ? "height" : "width",
10660
-		ref2 = vertical ? "top" : "left",
10661
-		motion = rpositivemotion.test( direction ),
10662
-		animation = {},
10663
-		show = mode === "show",
10664
-		wrapper, distance, margin;
12623
+		// Support: IE
12624
+		// Use type="button" to prevent enter keypresses in textboxes from closing the
12625
+		// dialog in IE (#9312)
12626
+		this.uiDialogTitlebarClose = $( "<button type='button'></button>" )
12627
+			.button( {
12628
+				label: $( "<a>" ).text( this.options.closeText ).html(),
12629
+				icon: "ui-icon-closethick",
12630
+				showLabel: false
12631
+			} )
12632
+			.appendTo( this.uiDialogTitlebar );
10665 12633
 
10666
-	// if already wrapped, the wrapper's properties are my property. #6245
10667
-	if ( el.parent().is( ".ui-effects-wrapper" ) ) {
10668
-		$.effects.save( el.parent(), props );
10669
-	} else {
10670
-		$.effects.save( el, props );
12634
+		this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" );
12635
+		this._on( this.uiDialogTitlebarClose, {
12636
+			click: function( event ) {
12637
+				event.preventDefault();
12638
+				this.close( event );
10671 12639
 			}
10672
-	el.show();
10673
-	wrapper = $.effects.createWrapper( el ).css({
10674
-		overflow: "hidden"
10675 12640
 		} );
10676 12641
 
10677
-	distance = wrapper[ ref ]();
10678
-	margin = parseFloat( wrapper.css( ref2 ) ) || 0;
12642
+		uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar );
12643
+		this._addClass( uiDialogTitle, "ui-dialog-title" );
12644
+		this._title( uiDialogTitle );
10679 12645
 
10680
-	animation[ ref ] = show ? distance : 0;
10681
-	if ( !motion ) {
10682
-		el
10683
-			.css( vertical ? "bottom" : "right", 0 )
10684
-			.css( vertical ? "top" : "left", "auto" )
10685
-			.css({ position: "absolute" });
12646
+		this.uiDialogTitlebar.prependTo( this.uiDialog );
10686 12647
 
10687
-		animation[ ref2 ] = show ? margin : distance + margin;
10688
-	}
12648
+		this.uiDialog.attr( {
12649
+			"aria-labelledby": uiDialogTitle.attr( "id" )
12650
+		} );
12651
+	},
10689 12652
 
10690
-	// start at 0 if we are showing
10691
-	if ( show ) {
10692
-		wrapper.css( ref, 0 );
10693
-		if ( !motion ) {
10694
-			wrapper.css( ref2, margin + distance );
10695
-		}
12653
+	_title: function( title ) {
12654
+		if ( this.options.title ) {
12655
+			title.text( this.options.title );
12656
+		} else {
12657
+			title.html( "&#160;" );
10696 12658
 		}
12659
+	},
10697 12660
 
10698
-	// Animate
10699
-	wrapper.animate( animation, {
10700
-		duration: o.duration,
10701
-		easing: o.easing,
10702
-		queue: false,
10703
-		complete: function() {
10704
-			if ( mode === "hide" ) {
10705
-				el.hide();
10706
-			}
10707
-			$.effects.restore( el, props );
10708
-			$.effects.removeWrapper( el );
10709
-			done();
10710
-		}
10711
-	});
10712
-};
12661
+	_createButtonPane: function() {
12662
+		this.uiDialogButtonPane = $( "<div>" );
12663
+		this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
12664
+			"ui-widget-content ui-helper-clearfix" );
10713 12665
 
12666
+		this.uiButtonSet = $( "<div>" )
12667
+			.appendTo( this.uiDialogButtonPane );
12668
+		this._addClass( this.uiButtonSet, "ui-dialog-buttonset" );
10714 12669
 
10715
-/*!
10716
- * jQuery UI Effects Bounce 1.11.4
10717
- * http://jqueryui.com
10718
- *
10719
- * Copyright jQuery Foundation and other contributors
10720
- * Released under the MIT license.
10721
- * http://jquery.org/license
10722
- *
10723
- * http://api.jqueryui.com/bounce-effect/
10724
- */
12670
+		this._createButtons();
12671
+	},
10725 12672
 
12673
+	_createButtons: function() {
12674
+		var that = this,
12675
+			buttons = this.options.buttons;
10726 12676
 
10727
-var effectBounce = $.effects.effect.bounce = function( o, done ) {
10728
-	var el = $( this ),
10729
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
12677
+		// If we already have a button pane, remove it
12678
+		this.uiDialogButtonPane.remove();
12679
+		this.uiButtonSet.empty();
10730 12680
 
10731
-		// defaults:
10732
-		mode = $.effects.setMode( el, o.mode || "effect" ),
10733
-		hide = mode === "hide",
10734
-		show = mode === "show",
10735
-		direction = o.direction || "up",
10736
-		distance = o.distance,
10737
-		times = o.times || 5,
12681
+		if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) {
12682
+			this._removeClass( this.uiDialog, "ui-dialog-buttons" );
12683
+			return;
12684
+		}
10738 12685
 
10739
-		// number of internal animations
10740
-		anims = times * 2 + ( show || hide ? 1 : 0 ),
10741
-		speed = o.duration / anims,
10742
-		easing = o.easing,
12686
+		$.each( buttons, function( name, props ) {
12687
+			var click, buttonOptions;
12688
+			props = typeof props === "function" ?
12689
+				{ click: props, text: name } :
12690
+				props;
10743 12691
 
10744
-		// utility:
10745
-		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10746
-		motion = ( direction === "up" || direction === "left" ),
10747
-		i,
10748
-		upAnim,
10749
-		downAnim,
12692
+			// Default to a non-submitting button
12693
+			props = $.extend( { type: "button" }, props );
10750 12694
 
10751
-		// we will need to re-assemble the queue to stack our animations in place
10752
-		queue = el.queue(),
10753
-		queuelen = queue.length;
12695
+			// Change the context for the click callback to be the main element
12696
+			click = props.click;
12697
+			buttonOptions = {
12698
+				icon: props.icon,
12699
+				iconPosition: props.iconPosition,
12700
+				showLabel: props.showLabel,
10754 12701
 
10755
-	// Avoid touching opacity to prevent clearType and PNG issues in IE
10756
-	if ( show || hide ) {
10757
-		props.push( "opacity" );
10758
-	}
12702
+				// Deprecated options
12703
+				icons: props.icons,
12704
+				text: props.text
12705
+			};
10759 12706
 
10760
-	$.effects.save( el, props );
10761
-	el.show();
10762
-	$.effects.createWrapper( el ); // Create Wrapper
12707
+			delete props.click;
12708
+			delete props.icon;
12709
+			delete props.iconPosition;
12710
+			delete props.showLabel;
10763 12711
 
10764
-	// default distance for the BIGGEST bounce is the outer Distance / 3
10765
-	if ( !distance ) {
10766
-		distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3;
12712
+			// Deprecated options
12713
+			delete props.icons;
12714
+			if ( typeof props.text === "boolean" ) {
12715
+				delete props.text;
10767 12716
 			}
10768 12717
 
10769
-	if ( show ) {
10770
-		downAnim = { opacity: 1 };
10771
-		downAnim[ ref ] = 0;
12718
+			$( "<button></button>", props )
12719
+				.button( buttonOptions )
12720
+				.appendTo( that.uiButtonSet )
12721
+				.on( "click", function() {
12722
+					click.apply( that.element[ 0 ], arguments );
12723
+				} );
12724
+		} );
12725
+		this._addClass( this.uiDialog, "ui-dialog-buttons" );
12726
+		this.uiDialogButtonPane.appendTo( this.uiDialog );
12727
+	},
10772 12728
 
10773
-		// if we are showing, force opacity 0 and set the initial position
10774
-		// then do the "first" animation
10775
-		el.css( "opacity", 0 )
10776
-			.css( ref, motion ? -distance * 2 : distance * 2 )
10777
-			.animate( downAnim, speed, easing );
12729
+	_makeDraggable: function() {
12730
+		var that = this,
12731
+			options = this.options;
12732
+
12733
+		function filteredUi( ui ) {
12734
+			return {
12735
+				position: ui.position,
12736
+				offset: ui.offset
12737
+			};
10778 12738
 		}
10779 12739
 
10780
-	// start at the smallest distance if we are hiding
10781
-	if ( hide ) {
10782
-		distance = distance / Math.pow( 2, times - 1 );
12740
+		this.uiDialog.draggable( {
12741
+			cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
12742
+			handle: ".ui-dialog-titlebar",
12743
+			containment: "document",
12744
+			start: function( event, ui ) {
12745
+				that._addClass( $( this ), "ui-dialog-dragging" );
12746
+				that._blockFrames();
12747
+				that._trigger( "dragStart", event, filteredUi( ui ) );
12748
+			},
12749
+			drag: function( event, ui ) {
12750
+				that._trigger( "drag", event, filteredUi( ui ) );
12751
+			},
12752
+			stop: function( event, ui ) {
12753
+				var left = ui.offset.left - that.document.scrollLeft(),
12754
+					top = ui.offset.top - that.document.scrollTop();
12755
+
12756
+				options.position = {
12757
+					my: "left top",
12758
+					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
12759
+						"top" + ( top >= 0 ? "+" : "" ) + top,
12760
+					of: that.window
12761
+				};
12762
+				that._removeClass( $( this ), "ui-dialog-dragging" );
12763
+				that._unblockFrames();
12764
+				that._trigger( "dragStop", event, filteredUi( ui ) );
10783 12765
 			}
12766
+		} );
12767
+	},
10784 12768
 
10785
-	downAnim = {};
10786
-	downAnim[ ref ] = 0;
10787
-	// Bounces up/down/left/right then back to 0 -- times * 2 animations happen here
10788
-	for ( i = 0; i < times; i++ ) {
10789
-		upAnim = {};
10790
-		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
12769
+	_makeResizable: function() {
12770
+		var that = this,
12771
+			options = this.options,
12772
+			handles = options.resizable,
10791 12773
 
10792
-		el.animate( upAnim, speed, easing )
10793
-			.animate( downAnim, speed, easing );
12774
+			// .ui-resizable has position: relative defined in the stylesheet
12775
+			// but dialogs have to use absolute or fixed positioning
12776
+			position = this.uiDialog.css( "position" ),
12777
+			resizeHandles = typeof handles === "string" ?
12778
+				handles :
12779
+				"n,e,s,w,se,sw,ne,nw";
10794 12780
 
10795
-		distance = hide ? distance * 2 : distance / 2;
12781
+		function filteredUi( ui ) {
12782
+			return {
12783
+				originalPosition: ui.originalPosition,
12784
+				originalSize: ui.originalSize,
12785
+				position: ui.position,
12786
+				size: ui.size
12787
+			};
10796 12788
 		}
10797 12789
 
10798
-	// Last Bounce when Hiding
10799
-	if ( hide ) {
10800
-		upAnim = { opacity: 0 };
10801
-		upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance;
12790
+		this.uiDialog.resizable( {
12791
+			cancel: ".ui-dialog-content",
12792
+			containment: "document",
12793
+			alsoResize: this.element,
12794
+			maxWidth: options.maxWidth,
12795
+			maxHeight: options.maxHeight,
12796
+			minWidth: options.minWidth,
12797
+			minHeight: this._minHeight(),
12798
+			handles: resizeHandles,
12799
+			start: function( event, ui ) {
12800
+				that._addClass( $( this ), "ui-dialog-resizing" );
12801
+				that._blockFrames();
12802
+				that._trigger( "resizeStart", event, filteredUi( ui ) );
12803
+			},
12804
+			resize: function( event, ui ) {
12805
+				that._trigger( "resize", event, filteredUi( ui ) );
12806
+			},
12807
+			stop: function( event, ui ) {
12808
+				var offset = that.uiDialog.offset(),
12809
+					left = offset.left - that.document.scrollLeft(),
12810
+					top = offset.top - that.document.scrollTop();
10802 12811
 
10803
-		el.animate( upAnim, speed, easing );
12812
+				options.height = that.uiDialog.height();
12813
+				options.width = that.uiDialog.width();
12814
+				options.position = {
12815
+					my: "left top",
12816
+					at: "left" + ( left >= 0 ? "+" : "" ) + left + " " +
12817
+						"top" + ( top >= 0 ? "+" : "" ) + top,
12818
+					of: that.window
12819
+				};
12820
+				that._removeClass( $( this ), "ui-dialog-resizing" );
12821
+				that._unblockFrames();
12822
+				that._trigger( "resizeStop", event, filteredUi( ui ) );
10804 12823
 			}
12824
+		} )
12825
+			.css( "position", position );
12826
+	},
10805 12827
 
10806
-	el.queue(function() {
10807
-		if ( hide ) {
10808
-			el.hide();
12828
+	_trackFocus: function() {
12829
+		this._on( this.widget(), {
12830
+			focusin: function( event ) {
12831
+				this._makeFocusTarget();
12832
+				this._focusedElement = $( event.target );
10809 12833
 			}
10810
-		$.effects.restore( el, props );
10811
-		$.effects.removeWrapper( el );
10812
-		done();
10813 12834
 		} );
12835
+	},
10814 12836
 
10815
-	// inject all the animations we just queued to be first in line (after "inprogress")
10816
-	if ( queuelen > 1) {
10817
-		queue.splice.apply( queue,
10818
-			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
12837
+	_makeFocusTarget: function() {
12838
+		this._untrackInstance();
12839
+		this._trackingInstances().unshift( this );
12840
+	},
12841
+
12842
+	_untrackInstance: function() {
12843
+		var instances = this._trackingInstances(),
12844
+			exists = $.inArray( this, instances );
12845
+		if ( exists !== -1 ) {
12846
+			instances.splice( exists, 1 );
10819 12847
 		}
10820
-	el.dequeue();
12848
+	},
10821 12849
 
10822
-};
12850
+	_trackingInstances: function() {
12851
+		var instances = this.document.data( "ui-dialog-instances" );
12852
+		if ( !instances ) {
12853
+			instances = [];
12854
+			this.document.data( "ui-dialog-instances", instances );
12855
+		}
12856
+		return instances;
12857
+	},
10823 12858
 
12859
+	_minHeight: function() {
12860
+		var options = this.options;
10824 12861
 
10825
-/*!
10826
- * jQuery UI Effects Clip 1.11.4
10827
- * http://jqueryui.com
10828
- *
10829
- * Copyright jQuery Foundation and other contributors
10830
- * Released under the MIT license.
10831
- * http://jquery.org/license
10832
- *
10833
- * http://api.jqueryui.com/clip-effect/
10834
- */
12862
+		return options.height === "auto" ?
12863
+			options.minHeight :
12864
+			Math.min( options.minHeight, options.height );
12865
+	},
10835 12866
 
12867
+	_position: function() {
10836 12868
 
10837
-var effectClip = $.effects.effect.clip = function( o, done ) {
10838
-	// Create element
10839
-	var el = $( this ),
10840
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
10841
-		mode = $.effects.setMode( el, o.mode || "hide" ),
10842
-		show = mode === "show",
10843
-		direction = o.direction || "vertical",
10844
-		vert = direction === "vertical",
10845
-		size = vert ? "height" : "width",
10846
-		position = vert ? "top" : "left",
10847
-		animation = {},
10848
-		wrapper, animate, distance;
12869
+		// Need to show the dialog to get the actual offset in the position plugin
12870
+		var isVisible = this.uiDialog.is( ":visible" );
12871
+		if ( !isVisible ) {
12872
+			this.uiDialog.show();
12873
+		}
12874
+		this.uiDialog.position( this.options.position );
12875
+		if ( !isVisible ) {
12876
+			this.uiDialog.hide();
12877
+		}
12878
+	},
10849 12879
 
10850
-	// Save & Show
10851
-	$.effects.save( el, props );
10852
-	el.show();
12880
+	_setOptions: function( options ) {
12881
+		var that = this,
12882
+			resize = false,
12883
+			resizableOptions = {};
10853 12884
 
10854
-	// Create Wrapper
10855
-	wrapper = $.effects.createWrapper( el ).css({
10856
-		overflow: "hidden"
10857
-	});
10858
-	animate = ( el[0].tagName === "IMG" ) ? wrapper : el;
10859
-	distance = animate[ size ]();
12885
+		$.each( options, function( key, value ) {
12886
+			that._setOption( key, value );
10860 12887
 
10861
-	// Shift
10862
-	if ( show ) {
10863
-		animate.css( size, 0 );
10864
-		animate.css( position, distance / 2 );
12888
+			if ( key in that.sizeRelatedOptions ) {
12889
+				resize = true;
10865 12890
 			}
12891
+			if ( key in that.resizableRelatedOptions ) {
12892
+				resizableOptions[ key ] = value;
12893
+			}
12894
+		} );
10866 12895
 
10867
-	// Create Animation Object:
10868
-	animation[ size ] = show ? distance : 0;
10869
-	animation[ position ] = show ? 0 : distance / 2;
10870
-
10871
-	// Animate
10872
-	animate.animate( animation, {
10873
-		queue: false,
10874
-		duration: o.duration,
10875
-		easing: o.easing,
10876
-		complete: function() {
10877
-			if ( !show ) {
10878
-				el.hide();
12896
+		if ( resize ) {
12897
+			this._size();
12898
+			this._position();
10879 12899
 		}
10880
-			$.effects.restore( el, props );
10881
-			$.effects.removeWrapper( el );
10882
-			done();
12900
+		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
12901
+			this.uiDialog.resizable( "option", resizableOptions );
10883 12902
 		}
10884
-	});
12903
+	},
10885 12904
 
10886
-};
12905
+	_setOption: function( key, value ) {
12906
+		var isDraggable, isResizable,
12907
+			uiDialog = this.uiDialog;
10887 12908
 
12909
+		if ( key === "disabled" ) {
12910
+			return;
12911
+		}
10888 12912
 
10889
-/*!
10890
- * jQuery UI Effects Drop 1.11.4
10891
- * http://jqueryui.com
10892
- *
10893
- * Copyright jQuery Foundation and other contributors
10894
- * Released under the MIT license.
10895
- * http://jquery.org/license
10896
- *
10897
- * http://api.jqueryui.com/drop-effect/
10898
- */
12913
+		this._super( key, value );
10899 12914
 
12915
+		if ( key === "appendTo" ) {
12916
+			this.uiDialog.appendTo( this._appendTo() );
12917
+		}
10900 12918
 
10901
-var effectDrop = $.effects.effect.drop = function( o, done ) {
12919
+		if ( key === "buttons" ) {
12920
+			this._createButtons();
12921
+		}
10902 12922
 
10903
-	var el = $( this ),
10904
-		props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ],
10905
-		mode = $.effects.setMode( el, o.mode || "hide" ),
10906
-		show = mode === "show",
10907
-		direction = o.direction || "left",
10908
-		ref = ( direction === "up" || direction === "down" ) ? "top" : "left",
10909
-		motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg",
10910
-		animation = {
10911
-			opacity: show ? 1 : 0
10912
-		},
10913
-		distance;
12923
+		if ( key === "closeText" ) {
12924
+			this.uiDialogTitlebarClose.button( {
10914 12925
 
10915
-	// Adjust
10916
-	$.effects.save( el, props );
10917
-	el.show();
10918
-	$.effects.createWrapper( el );
12926
+				// Ensure that we always pass a string
12927
+				label: $( "<a>" ).text( "" + this.options.closeText ).html()
12928
+			} );
12929
+		}
12930
+
12931
+		if ( key === "draggable" ) {
12932
+			isDraggable = uiDialog.is( ":data(ui-draggable)" );
12933
+			if ( isDraggable && !value ) {
12934
+				uiDialog.draggable( "destroy" );
12935
+			}
10919 12936
 
10920
-	distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
12937
+			if ( !isDraggable && value ) {
12938
+				this._makeDraggable();
12939
+			}
12940
+		}
10921 12941
 
10922
-	if ( show ) {
10923
-		el
10924
-			.css( "opacity", 0 )
10925
-			.css( ref, motion === "pos" ? -distance : distance );
12942
+		if ( key === "position" ) {
12943
+			this._position();
10926 12944
 		}
10927 12945
 
10928
-	// Animation
10929
-	animation[ ref ] = ( show ?
10930
-		( motion === "pos" ? "+=" : "-=" ) :
10931
-		( motion === "pos" ? "-=" : "+=" ) ) +
10932
-		distance;
12946
+		if ( key === "resizable" ) {
10933 12947
 
10934
-	// Animate
10935
-	el.animate( animation, {
10936
-		queue: false,
10937
-		duration: o.duration,
10938
-		easing: o.easing,
10939
-		complete: function() {
10940
-			if ( mode === "hide" ) {
10941
-				el.hide();
10942
-			}
10943
-			$.effects.restore( el, props );
10944
-			$.effects.removeWrapper( el );
10945
-			done();
12948
+			// currently resizable, becoming non-resizable
12949
+			isResizable = uiDialog.is( ":data(ui-resizable)" );
12950
+			if ( isResizable && !value ) {
12951
+				uiDialog.resizable( "destroy" );
10946 12952
 			}
10947
-	});
10948
-};
10949 12953
 
12954
+			// Currently resizable, changing handles
12955
+			if ( isResizable && typeof value === "string" ) {
12956
+				uiDialog.resizable( "option", "handles", value );
12957
+			}
10950 12958
 
10951
-/*!
10952
- * jQuery UI Effects Explode 1.11.4
10953
- * http://jqueryui.com
10954
- *
10955
- * Copyright jQuery Foundation and other contributors
10956
- * Released under the MIT license.
10957
- * http://jquery.org/license
10958
- *
10959
- * http://api.jqueryui.com/explode-effect/
10960
- */
12959
+			// Currently non-resizable, becoming resizable
12960
+			if ( !isResizable && value !== false ) {
12961
+				this._makeResizable();
12962
+			}
12963
+		}
10961 12964
 
12965
+		if ( key === "title" ) {
12966
+			this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) );
12967
+		}
12968
+	},
10962 12969
 
10963
-var effectExplode = $.effects.effect.explode = function( o, done ) {
12970
+	_size: function() {
10964 12971
 
10965
-	var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3,
10966
-		cells = rows,
10967
-		el = $( this ),
10968
-		mode = $.effects.setMode( el, o.mode || "hide" ),
10969
-		show = mode === "show",
12972
+		// If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
12973
+		// divs will both have width and height set, so we need to reset them
12974
+		var nonContentHeight, minContentHeight, maxContentHeight,
12975
+			options = this.options;
10970 12976
 
10971
-		// show and then visibility:hidden the element before calculating offset
10972
-		offset = el.show().css( "visibility", "hidden" ).offset(),
12977
+		// Reset content sizing
12978
+		this.element.show().css( {
12979
+			width: "auto",
12980
+			minHeight: 0,
12981
+			maxHeight: "none",
12982
+			height: 0
12983
+		} );
10973 12984
 
10974
-		// width and height of a piece
10975
-		width = Math.ceil( el.outerWidth() / cells ),
10976
-		height = Math.ceil( el.outerHeight() / rows ),
10977
-		pieces = [],
12985
+		if ( options.minWidth > options.width ) {
12986
+			options.width = options.minWidth;
12987
+		}
10978 12988
 
10979
-		// loop
10980
-		i, j, left, top, mx, my;
12989
+		// Reset wrapper sizing
12990
+		// determine the height of all the non-content elements
12991
+		nonContentHeight = this.uiDialog.css( {
12992
+			height: "auto",
12993
+			width: options.width
12994
+		} )
12995
+			.outerHeight();
12996
+		minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
12997
+		maxContentHeight = typeof options.maxHeight === "number" ?
12998
+			Math.max( 0, options.maxHeight - nonContentHeight ) :
12999
+			"none";
10981 13000
 
10982
-	// children animate complete:
10983
-	function childComplete() {
10984
-		pieces.push( this );
10985
-		if ( pieces.length === rows * cells ) {
10986
-			animComplete();
10987
-		}
13001
+		if ( options.height === "auto" ) {
13002
+			this.element.css( {
13003
+				minHeight: minContentHeight,
13004
+				maxHeight: maxContentHeight,
13005
+				height: "auto"
13006
+			} );
13007
+		} else {
13008
+			this.element.height( Math.max( 0, options.height - nonContentHeight ) );
10988 13009
 		}
10989 13010
 
10990
-	// clone the element for each row and cell.
10991
-	for ( i = 0; i < rows ; i++ ) { // ===>
10992
-		top = offset.top + i * height;
10993
-		my = i - ( rows - 1 ) / 2 ;
13011
+		if ( this.uiDialog.is( ":data(ui-resizable)" ) ) {
13012
+			this.uiDialog.resizable( "option", "minHeight", this._minHeight() );
13013
+		}
13014
+	},
10994 13015
 
10995
-		for ( j = 0; j < cells ; j++ ) { // |||
10996
-			left = offset.left + j * width;
10997
-			mx = j - ( cells - 1 ) / 2 ;
13016
+	_blockFrames: function() {
13017
+		this.iframeBlocks = this.document.find( "iframe" ).map( function() {
13018
+			var iframe = $( this );
10998 13019
 
10999
-			// Create a clone of the now hidden main element that will be absolute positioned
11000
-			// within a wrapper div off the -left and -top equal to size of our pieces
11001
-			el
11002
-				.clone()
11003
-				.appendTo( "body" )
11004
-				.wrap( "<div></div>" )
13020
+			return $( "<div>" )
11005 13021
 				.css( {
11006 13022
 					position: "absolute",
11007
-					visibility: "visible",
11008
-					left: -j * width,
11009
-					top: -i * height
13023
+					width: iframe.outerWidth(),
13024
+					height: iframe.outerHeight()
11010 13025
 				} )
13026
+				.appendTo( iframe.parent() )
13027
+				.offset( iframe.offset() )[ 0 ];
13028
+		} );
13029
+	},
11011 13030
 
11012
-			// select the wrapper - make it overflow: hidden and absolute positioned based on
11013
-			// where the original was located +left and +top equal to the size of pieces
11014
-				.parent()
11015
-				.addClass( "ui-effects-explode" )
11016
-				.css({
11017
-					position: "absolute",
11018
-					overflow: "hidden",
11019
-					width: width,
11020
-					height: height,
11021
-					left: left + ( show ? mx * width : 0 ),
11022
-					top: top + ( show ? my * height : 0 ),
11023
-					opacity: show ? 0 : 1
11024
-				}).animate({
11025
-					left: left + ( show ? 0 : mx * width ),
11026
-					top: top + ( show ? 0 : my * height ),
11027
-					opacity: show ? 1 : 0
11028
-				}, o.duration || 500, o.easing, childComplete );
11029
-		}
13031
+	_unblockFrames: function() {
13032
+		if ( this.iframeBlocks ) {
13033
+			this.iframeBlocks.remove();
13034
+			delete this.iframeBlocks;
11030 13035
 		}
13036
+	},
11031 13037
 
11032
-	function animComplete() {
11033
-		el.css({
11034
-			visibility: "visible"
11035
-		});
11036
-		$( pieces ).remove();
11037
-		if ( !show ) {
11038
-			el.hide();
11039
-		}
11040
-		done();
13038
+	_allowInteraction: function( event ) {
13039
+		if ( $( event.target ).closest( ".ui-dialog" ).length ) {
13040
+			return true;
11041 13041
 		}
11042
-};
11043 13042
 
13043
+		// TODO: Remove hack when datepicker implements
13044
+		// the .ui-front logic (#8989)
13045
+		return !!$( event.target ).closest( ".ui-datepicker" ).length;
13046
+	},
11044 13047
 
11045
-/*!
11046
- * jQuery UI Effects Fade 1.11.4
11047
- * http://jqueryui.com
11048
- *
11049
- * Copyright jQuery Foundation and other contributors
11050
- * Released under the MIT license.
11051
- * http://jquery.org/license
11052
- *
11053
- * http://api.jqueryui.com/fade-effect/
11054
- */
11055
-
13048
+	_createOverlay: function() {
13049
+		if ( !this.options.modal ) {
13050
+			return;
13051
+		}
11056 13052
 
11057
-var effectFade = $.effects.effect.fade = function( o, done ) {
11058
-	var el = $( this ),
11059
-		mode = $.effects.setMode( el, o.mode || "toggle" );
13053
+		var jqMinor = $.fn.jquery.substring( 0, 4 );
11060 13054
 
11061
-	el.animate({
11062
-		opacity: mode
11063
-	}, {
11064
-		queue: false,
11065
-		duration: o.duration,
11066
-		easing: o.easing,
11067
-		complete: done
13055
+		// We use a delay in case the overlay is created from an
13056
+		// event that we're going to be cancelling (#2804)
13057
+		var isOpening = true;
13058
+		this._delay( function() {
13059
+			isOpening = false;
11068 13060
 		} );
11069
-};
11070
-
11071
-
11072
-/*!
11073
- * jQuery UI Effects Fold 1.11.4
11074
- * http://jqueryui.com
11075
- *
11076
- * Copyright jQuery Foundation and other contributors
11077
- * Released under the MIT license.
11078
- * http://jquery.org/license
11079
- *
11080
- * http://api.jqueryui.com/fold-effect/
11081
- */
11082
-
11083 13061
 
11084
-var effectFold = $.effects.effect.fold = function( o, done ) {
11085
-
11086
-	// Create element
11087
-	var el = $( this ),
11088
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11089
-		mode = $.effects.setMode( el, o.mode || "hide" ),
11090
-		show = mode === "show",
11091
-		hide = mode === "hide",
11092
-		size = o.size || 15,
11093
-		percent = /([0-9]+)%/.exec( size ),
11094
-		horizFirst = !!o.horizFirst,
11095
-		widthFirst = show !== horizFirst,
11096
-		ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ],
11097
-		duration = o.duration / 2,
11098
-		wrapper, distance,
11099
-		animation1 = {},
11100
-		animation2 = {};
13062
+		if ( !this.document.data( "ui-dialog-overlays" ) ) {
11101 13063
 
11102
-	$.effects.save( el, props );
11103
-	el.show();
13064
+			// Prevent use of anchors and inputs
13065
+			// This doesn't use `_on()` because it is a shared event handler
13066
+			// across all open modal dialogs.
13067
+			this.document.on( "focusin.ui-dialog", function( event ) {
13068
+				if ( isOpening ) {
13069
+					return;
13070
+				}
11104 13071
 
11105
-	// Create Wrapper
11106
-	wrapper = $.effects.createWrapper( el ).css({
11107
-		overflow: "hidden"
11108
-	});
11109
-	distance = widthFirst ?
11110
-		[ wrapper.width(), wrapper.height() ] :
11111
-		[ wrapper.height(), wrapper.width() ];
13072
+				var instance = this._trackingInstances()[ 0 ];
13073
+				if ( !instance._allowInteraction( event ) ) {
13074
+					event.preventDefault();
13075
+					instance._focusTabbable();
11112 13076
 
11113
-	if ( percent ) {
11114
-		size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ];
13077
+					// Support: jQuery >=3.4 <3.6 only
13078
+					// Focus re-triggering in jQuery 3.4/3.5 makes the original element
13079
+					// have its focus event propagated last, breaking the re-targeting.
13080
+					// Trigger focus in a delay in addition if needed to avoid the issue
13081
+					// See https://github.com/jquery/jquery/issues/4382
13082
+					if ( jqMinor === "3.4." || jqMinor === "3.5." ) {
13083
+						instance._delay( instance._restoreTabbableFocus );
11115 13084
 					}
11116
-	if ( show ) {
11117
-		wrapper.css( horizFirst ? {
11118
-			height: 0,
11119
-			width: size
11120
-		} : {
11121
-			height: size,
11122
-			width: 0
11123
-		});
11124 13085
 				}
11125
-
11126
-	// Animation
11127
-	animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size;
11128
-	animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0;
11129
-
11130
-	// Animate
11131
-	wrapper
11132
-		.animate( animation1, duration, o.easing )
11133
-		.animate( animation2, duration, o.easing, function() {
11134
-			if ( hide ) {
11135
-				el.hide();
13086
+			}.bind( this ) );
11136 13087
 		}
11137
-			$.effects.restore( el, props );
11138
-			$.effects.removeWrapper( el );
11139
-			done();
11140
-		});
11141 13088
 
11142
-};
13089
+		this.overlay = $( "<div>" )
13090
+			.appendTo( this._appendTo() );
11143 13091
 
13092
+		this._addClass( this.overlay, null, "ui-widget-overlay ui-front" );
13093
+		this._on( this.overlay, {
13094
+			mousedown: "_keepFocus"
13095
+		} );
13096
+		this.document.data( "ui-dialog-overlays",
13097
+			( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 );
13098
+	},
11144 13099
 
11145
-/*!
11146
- * jQuery UI Effects Highlight 1.11.4
11147
- * http://jqueryui.com
11148
- *
11149
- * Copyright jQuery Foundation and other contributors
11150
- * Released under the MIT license.
11151
- * http://jquery.org/license
11152
- *
11153
- * http://api.jqueryui.com/highlight-effect/
11154
- */
13100
+	_destroyOverlay: function() {
13101
+		if ( !this.options.modal ) {
13102
+			return;
13103
+		}
11155 13104
 
13105
+		if ( this.overlay ) {
13106
+			var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
11156 13107
 
11157
-var effectHighlight = $.effects.effect.highlight = function( o, done ) {
11158
-	var elem = $( this ),
11159
-		props = [ "backgroundImage", "backgroundColor", "opacity" ],
11160
-		mode = $.effects.setMode( elem, o.mode || "show" ),
11161
-		animation = {
11162
-			backgroundColor: elem.css( "backgroundColor" )
11163
-		};
13108
+			if ( !overlays ) {
13109
+				this.document.off( "focusin.ui-dialog" );
13110
+				this.document.removeData( "ui-dialog-overlays" );
13111
+			} else {
13112
+				this.document.data( "ui-dialog-overlays", overlays );
13113
+			}
11164 13114
 
11165
-	if (mode === "hide") {
11166
-		animation.opacity = 0;
13115
+			this.overlay.remove();
13116
+			this.overlay = null;
13117
+		}
11167 13118
 	}
13119
+} );
11168 13120
 
11169
-	$.effects.save( elem, props );
13121
+// DEPRECATED
13122
+// TODO: switch return back to widget declaration at top of file when this is removed
13123
+if ( $.uiBackCompat !== false ) {
11170 13124
 
11171
-	elem
11172
-		.show()
11173
-		.css({
11174
-			backgroundImage: "none",
11175
-			backgroundColor: o.color || "#ffff99"
11176
-		})
11177
-		.animate( animation, {
11178
-			queue: false,
11179
-			duration: o.duration,
11180
-			easing: o.easing,
11181
-			complete: function() {
11182
-				if ( mode === "hide" ) {
11183
-					elem.hide();
13125
+	// Backcompat for dialogClass option
13126
+	$.widget( "ui.dialog", $.ui.dialog, {
13127
+		options: {
13128
+			dialogClass: ""
13129
+		},
13130
+		_createWrapper: function() {
13131
+			this._super();
13132
+			this.uiDialog.addClass( this.options.dialogClass );
13133
+		},
13134
+		_setOption: function( key, value ) {
13135
+			if ( key === "dialogClass" ) {
13136
+				this.uiDialog
13137
+					.removeClass( this.options.dialogClass )
13138
+					.addClass( value );
11184 13139
 			}
11185
-				$.effects.restore( elem, props );
11186
-				done();
13140
+			this._superApply( arguments );
11187 13141
 		}
11188 13142
 	} );
11189
-};
13143
+}
13144
+
13145
+var widgetsDialog = $.ui.dialog;
11190 13146
 
11191 13147
 
11192 13148
 /*!
11193
- * jQuery UI Effects Size 1.11.4
13149
+ * jQuery UI Droppable 1.13.2
11194 13150
  * http://jqueryui.com
11195 13151
  *
11196 13152
  * Copyright jQuery Foundation and other contributors
11197 13153
  * Released under the MIT license.
11198 13154
  * http://jquery.org/license
11199
- *
11200
- * http://api.jqueryui.com/size-effect/
11201 13155
  */
11202 13156
 
13157
+//>>label: Droppable
13158
+//>>group: Interactions
13159
+//>>description: Enables drop targets for draggable elements.
13160
+//>>docs: http://api.jqueryui.com/droppable/
13161
+//>>demos: http://jqueryui.com/droppable/
11203 13162
 
11204
-var effectSize = $.effects.effect.size = function( o, done ) {
11205 13163
 
11206
-	// Create element
11207
-	var original, baseline, factor,
11208
-		el = $( this ),
11209
-		props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ],
13164
+$.widget( "ui.droppable", {
13165
+	version: "1.13.2",
13166
+	widgetEventPrefix: "drop",
13167
+	options: {
13168
+		accept: "*",
13169
+		addClasses: true,
13170
+		greedy: false,
13171
+		scope: "default",
13172
+		tolerance: "intersect",
11210 13173
 
11211
-		// Always restore
11212
-		props1 = [ "position", "top", "bottom", "left", "right", "overflow", "opacity" ],
13174
+		// Callbacks
13175
+		activate: null,
13176
+		deactivate: null,
13177
+		drop: null,
13178
+		out: null,
13179
+		over: null
13180
+	},
13181
+	_create: function() {
11213 13182
 
11214
-		// Copy for children
11215
-		props2 = [ "width", "height", "overflow" ],
11216
-		cProps = [ "fontSize" ],
11217
-		vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ],
11218
-		hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ],
13183
+		var proportions,
13184
+			o = this.options,
13185
+			accept = o.accept;
11219 13186
 
11220
-		// Set options
11221
-		mode = $.effects.setMode( el, o.mode || "effect" ),
11222
-		restore = o.restore || mode !== "effect",
11223
-		scale = o.scale || "both",
11224
-		origin = o.origin || [ "middle", "center" ],
11225
-		position = el.css( "position" ),
11226
-		props = restore ? props0 : props1,
11227
-		zero = {
11228
-			height: 0,
11229
-			width: 0,
11230
-			outerHeight: 0,
11231
-			outerWidth: 0
11232
-		};
13187
+		this.isover = false;
13188
+		this.isout = true;
11233 13189
 
11234
-	if ( mode === "show" ) {
11235
-		el.show();
11236
-	}
11237
-	original = {
11238
-		height: el.height(),
11239
-		width: el.width(),
11240
-		outerHeight: el.outerHeight(),
11241
-		outerWidth: el.outerWidth()
13190
+		this.accept = typeof accept === "function" ? accept : function( d ) {
13191
+			return d.is( accept );
11242 13192
 		};
11243 13193
 
11244
-	if ( o.mode === "toggle" && mode === "show" ) {
11245
-		el.from = o.to || zero;
11246
-		el.to = o.from || original;
13194
+		this.proportions = function( /* valueToWrite */ ) {
13195
+			if ( arguments.length ) {
13196
+
13197
+				// Store the droppable's proportions
13198
+				proportions = arguments[ 0 ];
11247 13199
 			} else {
11248
-		el.from = o.from || ( mode === "show" ? zero : original );
11249
-		el.to = o.to || ( mode === "hide" ? zero : original );
11250
-	}
11251 13200
 
11252
-	// Set scaling factor
11253
-	factor = {
11254
-		from: {
11255
-			y: el.from.height / original.height,
11256
-			x: el.from.width / original.width
11257
-		},
11258
-		to: {
11259
-			y: el.to.height / original.height,
11260
-			x: el.to.width / original.width
13201
+				// Retrieve or derive the droppable's proportions
13202
+				return proportions ?
13203
+					proportions :
13204
+					proportions = {
13205
+						width: this.element[ 0 ].offsetWidth,
13206
+						height: this.element[ 0 ].offsetHeight
13207
+					};
11261 13208
 			}
11262 13209
 		};
11263 13210
 
11264
-	// Scale the css box
11265
-	if ( scale === "box" || scale === "both" ) {
11266
-
11267
-		// Vertical props scaling
11268
-		if ( factor.from.y !== factor.to.y ) {
11269
-			props = props.concat( vProps );
11270
-			el.from = $.effects.setTransition( el, vProps, factor.from.y, el.from );
11271
-			el.to = $.effects.setTransition( el, vProps, factor.to.y, el.to );
11272
-		}
13211
+		this._addToManager( o.scope );
11273 13212
 
11274
-		// Horizontal props scaling
11275
-		if ( factor.from.x !== factor.to.x ) {
11276
-			props = props.concat( hProps );
11277
-			el.from = $.effects.setTransition( el, hProps, factor.from.x, el.from );
11278
-			el.to = $.effects.setTransition( el, hProps, factor.to.x, el.to );
11279
-		}
13213
+		if ( o.addClasses ) {
13214
+			this._addClass( "ui-droppable" );
11280 13215
 		}
11281 13216
 
11282
-	// Scale the content
11283
-	if ( scale === "content" || scale === "both" ) {
13217
+	},
11284 13218
 
11285
-		// Vertical props scaling
11286
-		if ( factor.from.y !== factor.to.y ) {
11287
-			props = props.concat( cProps ).concat( props2 );
11288
-			el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from );
11289
-			el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to );
11290
-		}
11291
-	}
13219
+	_addToManager: function( scope ) {
11292 13220
 
11293
-	$.effects.save( el, props );
11294
-	el.show();
11295
-	$.effects.createWrapper( el );
11296
-	el.css( "overflow", "hidden" ).css( el.from );
13221
+		// Add the reference and positions to the manager
13222
+		$.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || [];
13223
+		$.ui.ddmanager.droppables[ scope ].push( this );
13224
+	},
11297 13225
 
11298
-	// Adjust
11299
-	if (origin) { // Calculate baseline shifts
11300
-		baseline = $.effects.getBaseline( origin, original );
11301
-		el.from.top = ( original.outerHeight - el.outerHeight() ) * baseline.y;
11302
-		el.from.left = ( original.outerWidth - el.outerWidth() ) * baseline.x;
11303
-		el.to.top = ( original.outerHeight - el.to.outerHeight ) * baseline.y;
11304
-		el.to.left = ( original.outerWidth - el.to.outerWidth ) * baseline.x;
13226
+	_splice: function( drop ) {
13227
+		var i = 0;
13228
+		for ( ; i < drop.length; i++ ) {
13229
+			if ( drop[ i ] === this ) {
13230
+				drop.splice( i, 1 );
13231
+			}
11305 13232
 		}
11306
-	el.css( el.from ); // set top & left
13233
+	},
11307 13234
 
11308
-	// Animate
11309
-	if ( scale === "content" || scale === "both" ) { // Scale the children
13235
+	_destroy: function() {
13236
+		var drop = $.ui.ddmanager.droppables[ this.options.scope ];
11310 13237
 
11311
-		// Add margins/font-size
11312
-		vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps);
11313
-		hProps = hProps.concat([ "marginLeft", "marginRight" ]);
11314
-		props2 = props0.concat(vProps).concat(hProps);
13238
+		this._splice( drop );
13239
+	},
11315 13240
 
11316
-		el.find( "*[width]" ).each( function() {
11317
-			var child = $( this ),
11318
-				c_original = {
11319
-					height: child.height(),
11320
-					width: child.width(),
11321
-					outerHeight: child.outerHeight(),
11322
-					outerWidth: child.outerWidth()
11323
-				};
11324
-			if (restore) {
11325
-				$.effects.save(child, props2);
11326
-			}
13241
+	_setOption: function( key, value ) {
11327 13242
 
11328
-			child.from = {
11329
-				height: c_original.height * factor.from.y,
11330
-				width: c_original.width * factor.from.x,
11331
-				outerHeight: c_original.outerHeight * factor.from.y,
11332
-				outerWidth: c_original.outerWidth * factor.from.x
11333
-			};
11334
-			child.to = {
11335
-				height: c_original.height * factor.to.y,
11336
-				width: c_original.width * factor.to.x,
11337
-				outerHeight: c_original.height * factor.to.y,
11338
-				outerWidth: c_original.width * factor.to.x
13243
+		if ( key === "accept" ) {
13244
+			this.accept = typeof value === "function" ? value : function( d ) {
13245
+				return d.is( value );
11339 13246
 			};
13247
+		} else if ( key === "scope" ) {
13248
+			var drop = $.ui.ddmanager.droppables[ this.options.scope ];
11340 13249
 
11341
-			// Vertical props scaling
11342
-			if ( factor.from.y !== factor.to.y ) {
11343
-				child.from = $.effects.setTransition( child, vProps, factor.from.y, child.from );
11344
-				child.to = $.effects.setTransition( child, vProps, factor.to.y, child.to );
13250
+			this._splice( drop );
13251
+			this._addToManager( value );
11345 13252
 		}
11346 13253
 
11347
-			// Horizontal props scaling
11348
-			if ( factor.from.x !== factor.to.x ) {
11349
-				child.from = $.effects.setTransition( child, hProps, factor.from.x, child.from );
11350
-				child.to = $.effects.setTransition( child, hProps, factor.to.x, child.to );
11351
-			}
13254
+		this._super( key, value );
13255
+	},
11352 13256
 
11353
-			// Animate children
11354
-			child.css( child.from );
11355
-			child.animate( child.to, o.duration, o.easing, function() {
13257
+	_activate: function( event ) {
13258
+		var draggable = $.ui.ddmanager.current;
11356 13259
 
11357
-				// Restore children
11358
-				if ( restore ) {
11359
-					$.effects.restore( child, props2 );
11360
-				}
11361
-			});
11362
-		});
13260
+		this._addActiveClass();
13261
+		if ( draggable ) {
13262
+			this._trigger( "activate", event, this.ui( draggable ) );
11363 13263
 		}
13264
+	},
11364 13265
 
11365
-	// Animate
11366
-	el.animate( el.to, {
11367
-		queue: false,
11368
-		duration: o.duration,
11369
-		easing: o.easing,
11370
-		complete: function() {
11371
-			if ( el.to.opacity === 0 ) {
11372
-				el.css( "opacity", el.from.opacity );
11373
-			}
11374
-			if ( mode === "hide" ) {
11375
-				el.hide();
13266
+	_deactivate: function( event ) {
13267
+		var draggable = $.ui.ddmanager.current;
13268
+
13269
+		this._removeActiveClass();
13270
+		if ( draggable ) {
13271
+			this._trigger( "deactivate", event, this.ui( draggable ) );
11376 13272
 		}
11377
-			$.effects.restore( el, props );
11378
-			if ( !restore ) {
13273
+	},
11379 13274
 
11380
-				// we need to calculate our new positioning based on the scaling
11381
-				if ( position === "static" ) {
11382
-					el.css({
11383
-						position: "relative",
11384
-						top: el.to.top,
11385
-						left: el.to.left
11386
-					});
11387
-				} else {
11388
-					$.each([ "top", "left" ], function( idx, pos ) {
11389
-						el.css( pos, function( _, str ) {
11390
-							var val = parseInt( str, 10 ),
11391
-								toRef = idx ? el.to.left : el.to.top;
13275
+	_over: function( event ) {
11392 13276
 
11393
-							// if original was "auto", recalculate the new value from wrapper
11394
-							if ( str === "auto" ) {
11395
-								return toRef + "px";
11396
-							}
13277
+		var draggable = $.ui.ddmanager.current;
11397 13278
 
11398
-							return val + toRef + "px";
11399
-						});
11400
-					});
11401
-				}
13279
+		// Bail if draggable and droppable are same element
13280
+		if ( !draggable || ( draggable.currentItem ||
13281
+				draggable.element )[ 0 ] === this.element[ 0 ] ) {
13282
+			return;
11402 13283
 		}
11403 13284
 
11404
-			$.effects.removeWrapper( el );
11405
-			done();
13285
+		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
13286
+				draggable.element ) ) ) {
13287
+			this._addHoverClass();
13288
+			this._trigger( "over", event, this.ui( draggable ) );
11406 13289
 		}
11407
-	});
11408 13290
 
11409
-};
13291
+	},
11410 13292
 
13293
+	_out: function( event ) {
11411 13294
 
11412
-/*!
11413
- * jQuery UI Effects Scale 1.11.4
11414
- * http://jqueryui.com
11415
- *
11416
- * Copyright jQuery Foundation and other contributors
11417
- * Released under the MIT license.
11418
- * http://jquery.org/license
11419
- *
11420
- * http://api.jqueryui.com/scale-effect/
11421
- */
13295
+		var draggable = $.ui.ddmanager.current;
11422 13296
 
13297
+		// Bail if draggable and droppable are same element
13298
+		if ( !draggable || ( draggable.currentItem ||
13299
+				draggable.element )[ 0 ] === this.element[ 0 ] ) {
13300
+			return;
13301
+		}
11423 13302
 
11424
-var effectScale = $.effects.effect.scale = function( o, done ) {
13303
+		if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem ||
13304
+				draggable.element ) ) ) {
13305
+			this._removeHoverClass();
13306
+			this._trigger( "out", event, this.ui( draggable ) );
13307
+		}
11425 13308
 
11426
-	// Create element
11427
-	var el = $( this ),
11428
-		options = $.extend( true, {}, o ),
11429
-		mode = $.effects.setMode( el, o.mode || "effect" ),
11430
-		percent = parseInt( o.percent, 10 ) ||
11431
-			( parseInt( o.percent, 10 ) === 0 ? 0 : ( mode === "hide" ? 0 : 100 ) ),
11432
-		direction = o.direction || "both",
11433
-		origin = o.origin,
11434
-		original = {
11435
-			height: el.height(),
11436
-			width: el.width(),
11437
-			outerHeight: el.outerHeight(),
11438
-			outerWidth: el.outerWidth()
11439 13309
 	},
11440
-		factor = {
11441
-			y: direction !== "horizontal" ? (percent / 100) : 1,
11442
-			x: direction !== "vertical" ? (percent / 100) : 1
11443
-		};
11444 13310
 
11445
-	// We are going to pass this effect to the size effect:
11446
-	options.effect = "size";
11447
-	options.queue = false;
11448
-	options.complete = done;
13311
+	_drop: function( event, custom ) {
11449 13312
 
11450
-	// Set default origin and restore for show/hide
11451
-	if ( mode !== "effect" ) {
11452
-		options.origin = origin || [ "middle", "center" ];
11453
-		options.restore = true;
11454
-	}
13313
+		var draggable = custom || $.ui.ddmanager.current,
13314
+			childrenIntersection = false;
11455 13315
 
11456
-	options.from = o.from || ( mode === "show" ? {
11457
-		height: 0,
11458
-		width: 0,
11459
-		outerHeight: 0,
11460
-		outerWidth: 0
11461
-	} : original );
11462
-	options.to = {
11463
-		height: original.height * factor.y,
11464
-		width: original.width * factor.x,
11465
-		outerHeight: original.outerHeight * factor.y,
11466
-		outerWidth: original.outerWidth * factor.x
11467
-	};
13316
+		// Bail if draggable and droppable are same element
13317
+		if ( !draggable || ( draggable.currentItem ||
13318
+				draggable.element )[ 0 ] === this.element[ 0 ] ) {
13319
+			return false;
13320
+		}
11468 13321
 
11469
-	// Fade option to support puff
11470
-	if ( options.fade ) {
11471
-		if ( mode === "show" ) {
11472
-			options.from.opacity = 0;
11473
-			options.to.opacity = 1;
13322
+		this.element
13323
+			.find( ":data(ui-droppable)" )
13324
+			.not( ".ui-draggable-dragging" )
13325
+			.each( function() {
13326
+				var inst = $( this ).droppable( "instance" );
13327
+				if (
13328
+					inst.options.greedy &&
13329
+					!inst.options.disabled &&
13330
+					inst.options.scope === draggable.options.scope &&
13331
+					inst.accept.call(
13332
+						inst.element[ 0 ], ( draggable.currentItem || draggable.element )
13333
+					) &&
13334
+					$.ui.intersect(
13335
+						draggable,
13336
+						$.extend( inst, { offset: inst.element.offset() } ),
13337
+						inst.options.tolerance, event
13338
+					)
13339
+				) {
13340
+					childrenIntersection = true;
13341
+					return false;
11474 13342
 				}
11475
-		if ( mode === "hide" ) {
11476
-			options.from.opacity = 1;
11477
-			options.to.opacity = 0;
13343
+			} );
13344
+		if ( childrenIntersection ) {
13345
+			return false;
11478 13346
 		}
13347
+
13348
+		if ( this.accept.call( this.element[ 0 ],
13349
+				( draggable.currentItem || draggable.element ) ) ) {
13350
+			this._removeActiveClass();
13351
+			this._removeHoverClass();
13352
+
13353
+			this._trigger( "drop", event, this.ui( draggable ) );
13354
+			return this.element;
11479 13355
 		}
11480 13356
 
11481
-	// Animate
11482
-	el.effect( options );
13357
+		return false;
13358
+
13359
+	},
11483 13360
 
13361
+	ui: function( c ) {
13362
+		return {
13363
+			draggable: ( c.currentItem || c.element ),
13364
+			helper: c.helper,
13365
+			position: c.position,
13366
+			offset: c.positionAbs
11484 13367
 		};
13368
+	},
11485 13369
 
13370
+	// Extension points just to make backcompat sane and avoid duplicating logic
13371
+	// TODO: Remove in 1.14 along with call to it below
13372
+	_addHoverClass: function() {
13373
+		this._addClass( "ui-droppable-hover" );
13374
+	},
11486 13375
 
11487
-/*!
11488
- * jQuery UI Effects Puff 1.11.4
11489
- * http://jqueryui.com
11490
- *
11491
- * Copyright jQuery Foundation and other contributors
11492
- * Released under the MIT license.
11493
- * http://jquery.org/license
11494
- *
11495
- * http://api.jqueryui.com/puff-effect/
11496
- */
13376
+	_removeHoverClass: function() {
13377
+		this._removeClass( "ui-droppable-hover" );
13378
+	},
11497 13379
 
13380
+	_addActiveClass: function() {
13381
+		this._addClass( "ui-droppable-active" );
13382
+	},
11498 13383
 
11499
-var effectPuff = $.effects.effect.puff = function( o, done ) {
11500
-	var elem = $( this ),
11501
-		mode = $.effects.setMode( elem, o.mode || "hide" ),
11502
-		hide = mode === "hide",
11503
-		percent = parseInt( o.percent, 10 ) || 150,
11504
-		factor = percent / 100,
11505
-		original = {
11506
-			height: elem.height(),
11507
-			width: elem.width(),
11508
-			outerHeight: elem.outerHeight(),
11509
-			outerWidth: elem.outerWidth()
11510
-		};
13384
+	_removeActiveClass: function() {
13385
+		this._removeClass( "ui-droppable-active" );
13386
+	}
13387
+} );
11511 13388
 
11512
-	$.extend( o, {
11513
-		effect: "scale",
11514
-		queue: false,
11515
-		fade: true,
11516
-		mode: mode,
11517
-		complete: done,
11518
-		percent: hide ? percent : 100,
11519
-		from: hide ?
11520
-			original :
11521
-			{
11522
-				height: original.height * factor,
11523
-				width: original.width * factor,
11524
-				outerHeight: original.outerHeight * factor,
11525
-				outerWidth: original.outerWidth * factor
13389
+$.ui.intersect = ( function() {
13390
+	function isOverAxis( x, reference, size ) {
13391
+		return ( x >= reference ) && ( x < ( reference + size ) );
13392
+	}
13393
+
13394
+	return function( draggable, droppable, toleranceMode, event ) {
13395
+
13396
+		if ( !droppable.offset ) {
13397
+			return false;
13398
+		}
13399
+
13400
+		var x1 = ( draggable.positionAbs ||
13401
+				draggable.position.absolute ).left + draggable.margins.left,
13402
+			y1 = ( draggable.positionAbs ||
13403
+				draggable.position.absolute ).top + draggable.margins.top,
13404
+			x2 = x1 + draggable.helperProportions.width,
13405
+			y2 = y1 + draggable.helperProportions.height,
13406
+			l = droppable.offset.left,
13407
+			t = droppable.offset.top,
13408
+			r = l + droppable.proportions().width,
13409
+			b = t + droppable.proportions().height;
13410
+
13411
+		switch ( toleranceMode ) {
13412
+		case "fit":
13413
+			return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b );
13414
+		case "intersect":
13415
+			return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half
13416
+				x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half
13417
+				t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half
13418
+				y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half
13419
+		case "pointer":
13420
+			return isOverAxis( event.pageY, t, droppable.proportions().height ) &&
13421
+				isOverAxis( event.pageX, l, droppable.proportions().width );
13422
+		case "touch":
13423
+			return (
13424
+				( y1 >= t && y1 <= b ) || // Top edge touching
13425
+				( y2 >= t && y2 <= b ) || // Bottom edge touching
13426
+				( y1 < t && y2 > b ) // Surrounded vertically
13427
+			) && (
13428
+				( x1 >= l && x1 <= r ) || // Left edge touching
13429
+				( x2 >= l && x2 <= r ) || // Right edge touching
13430
+				( x1 < l && x2 > r ) // Surrounded horizontally
13431
+			);
13432
+		default:
13433
+			return false;
11526 13434
 		}
11527
-	});
11528
-
11529
-	elem.effect( o );
11530 13435
 	};
13436
+} )();
11531 13437
 
11532
-
11533
-/*!
11534
- * jQuery UI Effects Pulsate 1.11.4
11535
- * http://jqueryui.com
11536
- *
11537
- * Copyright jQuery Foundation and other contributors
11538
- * Released under the MIT license.
11539
- * http://jquery.org/license
11540
- *
11541
- * http://api.jqueryui.com/pulsate-effect/
13438
+/*
13439
+	This manager tracks offsets of draggables and droppables
11542 13440
 */
13441
+$.ui.ddmanager = {
13442
+	current: null,
13443
+	droppables: { "default": [] },
13444
+	prepareOffsets: function( t, event ) {
11543 13445
 
13446
+		var i, j,
13447
+			m = $.ui.ddmanager.droppables[ t.options.scope ] || [],
13448
+			type = event ? event.type : null, // workaround for #2317
13449
+			list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack();
11544 13450
 
11545
-var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
11546
-	var elem = $( this ),
11547
-		mode = $.effects.setMode( elem, o.mode || "show" ),
11548
-		show = mode === "show",
11549
-		hide = mode === "hide",
11550
-		showhide = ( show || mode === "hide" ),
11551
-
11552
-		// showing or hiding leaves of the "last" animation
11553
-		anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ),
11554
-		duration = o.duration / anims,
11555
-		animateTo = 0,
11556
-		queue = elem.queue(),
11557
-		queuelen = queue.length,
11558
-		i;
13451
+		droppablesLoop: for ( i = 0; i < m.length; i++ ) {
11559 13452
 
11560
-	if ( show || !elem.is(":visible")) {
11561
-		elem.css( "opacity", 0 ).show();
11562
-		animateTo = 1;
13453
+			// No disabled and non-accepted
13454
+			if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ],
13455
+					( t.currentItem || t.element ) ) ) ) {
13456
+				continue;
11563 13457
 			}
11564 13458
 
11565
-	// anims - 1 opacity "toggles"
11566
-	for ( i = 1; i < anims; i++ ) {
11567
-		elem.animate({
11568
-			opacity: animateTo
11569
-		}, duration, o.easing );
11570
-		animateTo = 1 - animateTo;
13459
+			// Filter out elements in the current dragged item
13460
+			for ( j = 0; j < list.length; j++ ) {
13461
+				if ( list[ j ] === m[ i ].element[ 0 ] ) {
13462
+					m[ i ].proportions().height = 0;
13463
+					continue droppablesLoop;
13464
+				}
11571 13465
 			}
11572 13466
 
11573
-	elem.animate({
11574
-		opacity: animateTo
11575
-	}, duration, o.easing);
11576
-
11577
-	elem.queue(function() {
11578
-		if ( hide ) {
11579
-			elem.hide();
13467
+			m[ i ].visible = m[ i ].element.css( "display" ) !== "none";
13468
+			if ( !m[ i ].visible ) {
13469
+				continue;
11580 13470
 			}
11581
-		done();
11582
-	});
11583 13471
 
11584
-	// We just queued up "anims" animations, we need to put them next in the queue
11585
-	if ( queuelen > 1 ) {
11586
-		queue.splice.apply( queue,
11587
-			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
13472
+			// Activate the droppable if used directly from draggables
13473
+			if ( type === "mousedown" ) {
13474
+				m[ i ]._activate.call( m[ i ], event );
11588 13475
 			}
11589
-	elem.dequeue();
11590
-};
11591 13476
 
13477
+			m[ i ].offset = m[ i ].element.offset();
13478
+			m[ i ].proportions( {
13479
+				width: m[ i ].element[ 0 ].offsetWidth,
13480
+				height: m[ i ].element[ 0 ].offsetHeight
13481
+			} );
11592 13482
 
11593
-/*!
11594
- * jQuery UI Effects Shake 1.11.4
11595
- * http://jqueryui.com
11596
- *
11597
- * Copyright jQuery Foundation and other contributors
11598
- * Released under the MIT license.
11599
- * http://jquery.org/license
11600
- *
11601
- * http://api.jqueryui.com/shake-effect/
11602
- */
13483
+		}
11603 13484
 
13485
+	},
13486
+	drop: function( draggable, event ) {
11604 13487
 
11605
-var effectShake = $.effects.effect.shake = function( o, done ) {
13488
+		var dropped = false;
11606 13489
 
11607
-	var el = $( this ),
11608
-		props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
11609
-		mode = $.effects.setMode( el, o.mode || "effect" ),
11610
-		direction = o.direction || "left",
11611
-		distance = o.distance || 20,
11612
-		times = o.times || 3,
11613
-		anims = times * 2 + 1,
11614
-		speed = Math.round( o.duration / anims ),
11615
-		ref = (direction === "up" || direction === "down") ? "top" : "left",
11616
-		positiveMotion = (direction === "up" || direction === "left"),
11617
-		animation = {},
11618
-		animation1 = {},
11619
-		animation2 = {},
11620
-		i,
13490
+		// Create a copy of the droppables in case the list changes during the drop (#9116)
13491
+		$.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() {
11621 13492
 
11622
-		// we will need to re-assemble the queue to stack our animations in place
11623
-		queue = el.queue(),
11624
-		queuelen = queue.length;
13493
+			if ( !this.options ) {
13494
+				return;
13495
+			}
13496
+			if ( !this.options.disabled && this.visible &&
13497
+					$.ui.intersect( draggable, this, this.options.tolerance, event ) ) {
13498
+				dropped = this._drop.call( this, event ) || dropped;
13499
+			}
11625 13500
 
11626
-	$.effects.save( el, props );
11627
-	el.show();
11628
-	$.effects.createWrapper( el );
13501
+			if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ],
13502
+					( draggable.currentItem || draggable.element ) ) ) {
13503
+				this.isout = true;
13504
+				this.isover = false;
13505
+				this._deactivate.call( this, event );
13506
+			}
11629 13507
 
11630
-	// Animation
11631
-	animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance;
11632
-	animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2;
11633
-	animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2;
13508
+		} );
13509
+		return dropped;
11634 13510
 
11635
-	// Animate
11636
-	el.animate( animation, speed, o.easing );
13511
+	},
13512
+	dragStart: function( draggable, event ) {
11637 13513
 
11638
-	// Shakes
11639
-	for ( i = 1; i < times; i++ ) {
11640
-		el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing );
11641
-	}
11642
-	el
11643
-		.animate( animation1, speed, o.easing )
11644
-		.animate( animation, speed / 2, o.easing )
11645
-		.queue(function() {
11646
-			if ( mode === "hide" ) {
11647
-				el.hide();
11648
-			}
11649
-			$.effects.restore( el, props );
11650
-			$.effects.removeWrapper( el );
11651
-			done();
13514
+		// Listen for scrolling so that if the dragging causes scrolling the position of the
13515
+		// droppables can be recalculated (see #5003)
13516
+		draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() {
13517
+			if ( !draggable.options.refreshPositions ) {
13518
+				$.ui.ddmanager.prepareOffsets( draggable, event );
13519
+			}
11652 13520
 		} );
13521
+	},
13522
+	drag: function( draggable, event ) {
11653 13523
 
11654
-	// inject all the animations we just queued to be first in line (after "inprogress")
11655
-	if ( queuelen > 1) {
11656
-		queue.splice.apply( queue,
11657
-			[ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) );
13524
+		// If you have a highly dynamic page, you might try this option. It renders positions
13525
+		// every time you move the mouse.
13526
+		if ( draggable.options.refreshPositions ) {
13527
+			$.ui.ddmanager.prepareOffsets( draggable, event );
11658 13528
 		}
11659
-	el.dequeue();
11660 13529
 
11661
-};
13530
+		// Run through all droppables and check their positions based on specific tolerance options
13531
+		$.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() {
11662 13532
 
13533
+			if ( this.options.disabled || this.greedyChild || !this.visible ) {
13534
+				return;
13535
+			}
11663 13536
 
11664
-/*!
11665
- * jQuery UI Effects Slide 1.11.4
11666
- * http://jqueryui.com
11667
- *
11668
- * Copyright jQuery Foundation and other contributors
11669
- * Released under the MIT license.
11670
- * http://jquery.org/license
11671
- *
11672
- * http://api.jqueryui.com/slide-effect/
11673
- */
13537
+			var parentInstance, scope, parent,
13538
+				intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ),
13539
+				c = !intersects && this.isover ?
13540
+					"isout" :
13541
+					( intersects && !this.isover ? "isover" : null );
13542
+			if ( !c ) {
13543
+				return;
13544
+			}
11674 13545
 
13546
+			if ( this.options.greedy ) {
11675 13547
 
11676
-var effectSlide = $.effects.effect.slide = function( o, done ) {
13548
+				// find droppable parents with same scope
13549
+				scope = this.options.scope;
13550
+				parent = this.element.parents( ":data(ui-droppable)" ).filter( function() {
13551
+					return $( this ).droppable( "instance" ).options.scope === scope;
13552
+				} );
11677 13553
 
11678
-	// Create element
11679
-	var el = $( this ),
11680
-		props = [ "position", "top", "bottom", "left", "right", "width", "height" ],
11681
-		mode = $.effects.setMode( el, o.mode || "show" ),
11682
-		show = mode === "show",
11683
-		direction = o.direction || "left",
11684
-		ref = (direction === "up" || direction === "down") ? "top" : "left",
11685
-		positiveMotion = (direction === "up" || direction === "left"),
11686
-		distance,
11687
-		animation = {};
13554
+				if ( parent.length ) {
13555
+					parentInstance = $( parent[ 0 ] ).droppable( "instance" );
13556
+					parentInstance.greedyChild = ( c === "isover" );
13557
+				}
13558
+			}
11688 13559
 
11689
-	// Adjust
11690
-	$.effects.save( el, props );
11691
-	el.show();
11692
-	distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true );
13560
+			// We just moved into a greedy child
13561
+			if ( parentInstance && c === "isover" ) {
13562
+				parentInstance.isover = false;
13563
+				parentInstance.isout = true;
13564
+				parentInstance._out.call( parentInstance, event );
13565
+			}
11693 13566
 
11694
-	$.effects.createWrapper( el ).css({
11695
-		overflow: "hidden"
11696
-	});
13567
+			this[ c ] = true;
13568
+			this[ c === "isout" ? "isover" : "isout" ] = false;
13569
+			this[ c === "isover" ? "_over" : "_out" ].call( this, event );
11697 13570
 
11698
-	if ( show ) {
11699
-		el.css( ref, positiveMotion ? (isNaN(distance) ? "-" + distance : -distance) : distance );
13571
+			// We just moved out of a greedy child
13572
+			if ( parentInstance && c === "isout" ) {
13573
+				parentInstance.isout = false;
13574
+				parentInstance.isover = true;
13575
+				parentInstance._over.call( parentInstance, event );
11700 13576
 			}
13577
+		} );
11701 13578
 
11702
-	// Animation
11703
-	animation[ ref ] = ( show ?
11704
-		( positiveMotion ? "+=" : "-=") :
11705
-		( positiveMotion ? "-=" : "+=")) +
11706
-		distance;
13579
+	},
13580
+	dragStop: function( draggable, event ) {
13581
+		draggable.element.parentsUntil( "body" ).off( "scroll.droppable" );
11707 13582
 
11708
-	// Animate
11709
-	el.animate( animation, {
11710
-		queue: false,
11711
-		duration: o.duration,
11712
-		easing: o.easing,
11713
-		complete: function() {
11714
-			if ( mode === "hide" ) {
11715
-				el.hide();
13583
+		// Call prepareOffsets one final time since IE does not fire return scroll events when
13584
+		// overflow was caused by drag (see #5003)
13585
+		if ( !draggable.options.refreshPositions ) {
13586
+			$.ui.ddmanager.prepareOffsets( draggable, event );
11716 13587
 		}
11717
-			$.effects.restore( el, props );
11718
-			$.effects.removeWrapper( el );
11719
-			done();
11720 13588
 	}
11721
-	});
11722 13589
 };
11723 13590
 
13591
+// DEPRECATED
13592
+// TODO: switch return back to widget declaration at top of file when this is removed
13593
+if ( $.uiBackCompat !== false ) {
11724 13594
 
11725
-/*!
11726
- * jQuery UI Effects Transfer 1.11.4
11727
- * http://jqueryui.com
11728
- *
11729
- * Copyright jQuery Foundation and other contributors
11730
- * Released under the MIT license.
11731
- * http://jquery.org/license
11732
- *
11733
- * http://api.jqueryui.com/transfer-effect/
11734
- */
11735
-
11736
-
11737
-var effectTransfer = $.effects.effect.transfer = function( o, done ) {
11738
-	var elem = $( this ),
11739
-		target = $( o.to ),
11740
-		targetFixed = target.css( "position" ) === "fixed",
11741
-		body = $("body"),
11742
-		fixTop = targetFixed ? body.scrollTop() : 0,
11743
-		fixLeft = targetFixed ? body.scrollLeft() : 0,
11744
-		endPosition = target.offset(),
11745
-		animation = {
11746
-			top: endPosition.top - fixTop,
11747
-			left: endPosition.left - fixLeft,
11748
-			height: target.innerHeight(),
11749
-			width: target.innerWidth()
13595
+	// Backcompat for activeClass and hoverClass options
13596
+	$.widget( "ui.droppable", $.ui.droppable, {
13597
+		options: {
13598
+			hoverClass: false,
13599
+			activeClass: false
11750 13600
 		},
11751
-		startPosition = elem.offset(),
11752
-		transfer = $( "<div class='ui-effects-transfer'></div>" )
11753
-			.appendTo( document.body )
11754
-			.addClass( o.className )
11755
-			.css({
11756
-				top: startPosition.top - fixTop,
11757
-				left: startPosition.left - fixLeft,
11758
-				height: elem.innerHeight(),
11759
-				width: elem.innerWidth(),
11760
-				position: targetFixed ? "fixed" : "absolute"
11761
-			})
11762
-			.animate( animation, o.duration, o.easing, function() {
11763
-				transfer.remove();
11764
-				done();
13601
+		_addActiveClass: function() {
13602
+			this._super();
13603
+			if ( this.options.activeClass ) {
13604
+				this.element.addClass( this.options.activeClass );
13605
+			}
13606
+		},
13607
+		_removeActiveClass: function() {
13608
+			this._super();
13609
+			if ( this.options.activeClass ) {
13610
+				this.element.removeClass( this.options.activeClass );
13611
+			}
13612
+		},
13613
+		_addHoverClass: function() {
13614
+			this._super();
13615
+			if ( this.options.hoverClass ) {
13616
+				this.element.addClass( this.options.hoverClass );
13617
+			}
13618
+		},
13619
+		_removeHoverClass: function() {
13620
+			this._super();
13621
+			if ( this.options.hoverClass ) {
13622
+				this.element.removeClass( this.options.hoverClass );
13623
+			}
13624
+		}
11765 13625
 	} );
11766
-};
13626
+}
13627
+
13628
+var widgetsDroppable = $.ui.droppable;
11767 13629
 
11768 13630
 
11769 13631
 /*!
11770
- * jQuery UI Progressbar 1.11.4
13632
+ * jQuery UI Progressbar 1.13.2
11771 13633
  * http://jqueryui.com
11772 13634
  *
11773 13635
  * Copyright jQuery Foundation and other contributors
11774 13636
  * Released under the MIT license.
11775 13637
  * http://jquery.org/license
11776
- *
11777
- * http://api.jqueryui.com/progressbar/
11778 13638
  */
11779 13639
 
13640
+//>>label: Progressbar
13641
+//>>group: Widgets
13642
+/* eslint-disable max-len */
13643
+//>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators.
13644
+/* eslint-enable max-len */
13645
+//>>docs: http://api.jqueryui.com/progressbar/
13646
+//>>demos: http://jqueryui.com/progressbar/
13647
+//>>css.structure: ../../themes/base/core.css
13648
+//>>css.structure: ../../themes/base/progressbar.css
13649
+//>>css.theme: ../../themes/base/theme.css
11780 13650
 
11781
-var progressbar = $.widget( "ui.progressbar", {
11782
-	version: "1.11.4",
13651
+
13652
+var widgetsProgressbar = $.widget( "ui.progressbar", {
13653
+	version: "1.13.2",
11783 13654
 	options: {
13655
+		classes: {
13656
+			"ui-progressbar": "ui-corner-all",
13657
+			"ui-progressbar-value": "ui-corner-left",
13658
+			"ui-progressbar-complete": "ui-corner-right"
13659
+		},
11784 13660
 		max: 100,
11785 13661
 		value: 0,
11786 13662
 
... ...
@@ -11794,28 +13671,22 @@ var progressbar = $.widget( "ui.progressbar", {
11794 13671
 		// Constrain initial value
11795 13672
 		this.oldValue = this.options.value = this._constrainedValue();
11796 13673
 
11797
-		this.element
11798
-			.addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
11799
-			.attr({
11800
-				// Only set static values, aria-valuenow and aria-valuemax are
13674
+		this.element.attr( {
13675
+
13676
+			// Only set static values; aria-valuenow and aria-valuemax are
11801 13677
 			// set inside _refreshValue()
11802 13678
 			role: "progressbar",
11803 13679
 			"aria-valuemin": this.min
11804 13680
 		} );
13681
+		this._addClass( "ui-progressbar", "ui-widget ui-widget-content" );
11805 13682
 
11806
-		this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
11807
-			.appendTo( this.element );
11808
-
13683
+		this.valueDiv = $( "<div>" ).appendTo( this.element );
13684
+		this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" );
11809 13685
 		this._refreshValue();
11810 13686
 	},
11811 13687
 
11812 13688
 	_destroy: function() {
11813
-		this.element
11814
-			.removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
11815
-			.removeAttr( "role" )
11816
-			.removeAttr( "aria-valuemin" )
11817
-			.removeAttr( "aria-valuemax" )
11818
-			.removeAttr( "aria-valuenow" );
13689
+		this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" );
11819 13690
 
11820 13691
 		this.valueDiv.remove();
11821 13692
 	},
... ...
@@ -11836,7 +13707,7 @@ var progressbar = $.widget( "ui.progressbar", {
11836 13707
 
11837 13708
 		this.indeterminate = newValue === false;
11838 13709
 
11839
-		// sanitize value
13710
+		// Sanitize value
11840 13711
 		if ( typeof newValue !== "number" ) {
11841 13712
 			newValue = 0;
11842 13713
 		}
... ...
@@ -11861,16 +13734,20 @@ var progressbar = $.widget( "ui.progressbar", {
11861 13734
 			// Don't allow a max less than min
11862 13735
 			value = Math.max( this.min, value );
11863 13736
 		}
11864
-		if ( key === "disabled" ) {
11865
-			this.element
11866
-				.toggleClass( "ui-state-disabled", !!value )
11867
-				.attr( "aria-disabled", value );
11868
-		}
11869 13737
 		this._super( key, value );
11870 13738
 	},
11871 13739
 
13740
+	_setOptionDisabled: function( value ) {
13741
+		this._super( value );
13742
+
13743
+		this.element.attr( "aria-disabled", value );
13744
+		this._toggleClass( null, "ui-state-disabled", !!value );
13745
+	},
13746
+
11872 13747
 	_percentage: function() {
11873
-		return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
13748
+		return this.indeterminate ?
13749
+			100 :
13750
+			100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
11874 13751
 	},
11875 13752
 
11876 13753
 	_refreshValue: function() {
... ...
@@ -11879,15 +13756,18 @@ var progressbar = $.widget( "ui.progressbar", {
11879 13756
 
11880 13757
 		this.valueDiv
11881 13758
 			.toggle( this.indeterminate || value > this.min )
11882
-			.toggleClass( "ui-corner-right", value === this.options.max )
11883 13759
 			.width( percentage.toFixed( 0 ) + "%" );
11884 13760
 
11885
-		this.element.toggleClass( "ui-progressbar-indeterminate", this.indeterminate );
13761
+		this
13762
+			._toggleClass( this.valueDiv, "ui-progressbar-complete", null,
13763
+				value === this.options.max )
13764
+			._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate );
11886 13765
 
11887 13766
 		if ( this.indeterminate ) {
11888 13767
 			this.element.removeAttr( "aria-valuenow" );
11889 13768
 			if ( !this.overlayDiv ) {
11890
-				this.overlayDiv = $( "<div class='ui-progressbar-overlay'></div>" ).appendTo( this.valueDiv );
13769
+				this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv );
13770
+				this._addClass( this.overlayDiv, "ui-progressbar-overlay" );
11891 13771
 			}
11892 13772
 		} else {
11893 13773
 			this.element.attr( {
... ...
@@ -11912,19 +13792,24 @@ var progressbar = $.widget( "ui.progressbar", {
11912 13792
 
11913 13793
 
11914 13794
 /*!
11915
- * jQuery UI Selectable 1.11.4
13795
+ * jQuery UI Selectable 1.13.2
11916 13796
  * http://jqueryui.com
11917 13797
  *
11918 13798
  * Copyright jQuery Foundation and other contributors
11919 13799
  * Released under the MIT license.
11920 13800
  * http://jquery.org/license
11921
- *
11922
- * http://api.jqueryui.com/selectable/
11923 13801
  */
11924 13802
 
13803
+//>>label: Selectable
13804
+//>>group: Interactions
13805
+//>>description: Allows groups of elements to be selected with the mouse.
13806
+//>>docs: http://api.jqueryui.com/selectable/
13807
+//>>demos: http://jqueryui.com/selectable/
13808
+//>>css.structure: ../../themes/base/selectable.css
11925 13809
 
11926
-var selectable = $.widget("ui.selectable", $.ui.mouse, {
11927
-	version: "1.11.4",
13810
+
13811
+var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, {
13812
+	version: "1.13.2",
11928 13813
 	options: {
11929 13814
 		appendTo: "body",
11930 13815
 		autoRefresh: true,
... ...
@@ -11932,7 +13817,7 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
11932 13817
 		filter: "*",
11933 13818
 		tolerance: "touch",
11934 13819
 
11935
-		// callbacks
13820
+		// Callbacks
11936 13821
 		selected: null,
11937 13822
 		selecting: null,
11938 13823
 		start: null,
... ...
@@ -11941,20 +13826,24 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
11941 13826
 		unselecting: null
11942 13827
 	},
11943 13828
 	_create: function() {
11944
-		var selectees,
11945
-			that = this;
13829
+		var that = this;
11946 13830
 
11947
-		this.element.addClass("ui-selectable");
13831
+		this._addClass( "ui-selectable" );
11948 13832
 
11949 13833
 		this.dragged = false;
11950 13834
 
11951
-		// cache selectee children based on filter
13835
+		// Cache selectee children based on filter
11952 13836
 		this.refresh = function() {
11953
-			selectees = $(that.options.filter, that.element[0]);
11954
-			selectees.addClass("ui-selectee");
11955
-			selectees.each(function() {
13837
+			that.elementPos = $( that.element[ 0 ] ).offset();
13838
+			that.selectees = $( that.options.filter, that.element[ 0 ] );
13839
+			that._addClass( that.selectees, "ui-selectee" );
13840
+			that.selectees.each( function() {
11956 13841
 				var $this = $( this ),
11957
-					pos = $this.offset();
13842
+					selecteeOffset = $this.offset(),
13843
+					pos = {
13844
+						left: selecteeOffset.left - that.elementPos.left,
13845
+						top: selecteeOffset.top - that.elementPos.top
13846
+					};
11958 13847
 				$.data( this, "selectable-item", {
11959 13848
 					element: this,
11960 13849
 					$element: $this,
... ...
@@ -11971,19 +13860,14 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
11971 13860
 		};
11972 13861
 		this.refresh();
11973 13862
 
11974
-		this.selectees = selectees.addClass("ui-selectee");
11975
-
11976 13863
 		this._mouseInit();
11977 13864
 
11978
-		this.helper = $("<div class='ui-selectable-helper'></div>");
13865
+		this.helper = $( "<div>" );
13866
+		this._addClass( this.helper, "ui-selectable-helper" );
11979 13867
 	},
11980 13868
 
11981 13869
 	_destroy: function() {
11982
-		this.selectees
11983
-			.removeClass("ui-selectee")
11984
-			.removeData("selectable-item");
11985
-		this.element
11986
-			.removeClass("ui-selectable ui-selectable-disabled");
13870
+		this.selectees.removeData( "selectable-item" );
11987 13871
 		this._mouseDestroy();
11988 13872
 	},
11989 13873
 
... ...
@@ -11992,6 +13876,7 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
11992 13876
 			options = this.options;
11993 13877
 
11994 13878
 		this.opos = [ event.pageX, event.pageY ];
13879
+		this.elementPos = $( this.element[ 0 ] ).offset();
11995 13880
 
11996 13881
 		if ( this.options.disabled ) {
11997 13882
 			return;
... ...
@@ -12018,10 +13904,11 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12018 13904
 			var selectee = $.data( this, "selectable-item" );
12019 13905
 			selectee.startselected = true;
12020 13906
 			if ( !event.metaKey && !event.ctrlKey ) {
12021
-				selectee.$element.removeClass("ui-selected");
13907
+				that._removeClass( selectee.$element, "ui-selected" );
12022 13908
 				selectee.selected = false;
12023
-				selectee.$element.addClass("ui-unselecting");
13909
+				that._addClass( selectee.$element, "ui-unselecting" );
12024 13910
 				selectee.unselecting = true;
13911
+
12025 13912
 				// selectable UNSELECTING callback
12026 13913
 				that._trigger( "unselecting", event, {
12027 13914
 					unselecting: selectee.element
... ...
@@ -12033,10 +13920,10 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12033 13920
 			var doSelect,
12034 13921
 				selectee = $.data( this, "selectable-item" );
12035 13922
 			if ( selectee ) {
12036
-				doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass("ui-selected");
12037
-				selectee.$element
12038
-					.removeClass(doSelect ? "ui-unselecting" : "ui-selected")
12039
-					.addClass(doSelect ? "ui-selecting" : "ui-unselecting");
13923
+				doSelect = ( !event.metaKey && !event.ctrlKey ) ||
13924
+					!selectee.$element.hasClass( "ui-selected" );
13925
+				that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" )
13926
+					._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" );
12040 13927
 				selectee.unselecting = !doSelect;
12041 13928
 				selectee.selecting = doSelect;
12042 13929
 				selectee.selected = doSelect;
... ...
@@ -12072,38 +13960,52 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12072 13960
 			x2 = event.pageX,
12073 13961
 			y2 = event.pageY;
12074 13962
 
12075
-		if (x1 > x2) { tmp = x2; x2 = x1; x1 = tmp; }
12076
-		if (y1 > y2) { tmp = y2; y2 = y1; y1 = tmp; }
13963
+		if ( x1 > x2 ) {
13964
+			tmp = x2; x2 = x1; x1 = tmp;
13965
+		}
13966
+		if ( y1 > y2 ) {
13967
+			tmp = y2; y2 = y1; y1 = tmp;
13968
+		}
12077 13969
 		this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } );
12078 13970
 
12079 13971
 		this.selectees.each( function() {
12080 13972
 			var selectee = $.data( this, "selectable-item" ),
12081
-				hit = false;
13973
+				hit = false,
13974
+				offset = {};
12082 13975
 
12083 13976
 			//prevent helper from being selected if appendTo: selectable
12084 13977
 			if ( !selectee || selectee.element === that.element[ 0 ] ) {
12085 13978
 				return;
12086 13979
 			}
12087 13980
 
13981
+			offset.left   = selectee.left   + that.elementPos.left;
13982
+			offset.right  = selectee.right  + that.elementPos.left;
13983
+			offset.top    = selectee.top    + that.elementPos.top;
13984
+			offset.bottom = selectee.bottom + that.elementPos.top;
13985
+
12088 13986
 			if ( options.tolerance === "touch" ) {
12089
-				hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
13987
+				hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 ||
13988
+                    offset.bottom < y1 ) );
12090 13989
 			} else if ( options.tolerance === "fit" ) {
12091
-				hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
13990
+				hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 &&
13991
+                    offset.bottom < y2 );
12092 13992
 			}
12093 13993
 
12094 13994
 			if ( hit ) {
13995
+
12095 13996
 				// SELECT
12096 13997
 				if ( selectee.selected ) {
12097
-					selectee.$element.removeClass("ui-selected");
13998
+					that._removeClass( selectee.$element, "ui-selected" );
12098 13999
 					selectee.selected = false;
12099 14000
 				}
12100 14001
 				if ( selectee.unselecting ) {
12101
-					selectee.$element.removeClass("ui-unselecting");
14002
+					that._removeClass( selectee.$element, "ui-unselecting" );
12102 14003
 					selectee.unselecting = false;
12103 14004
 				}
12104 14005
 				if ( !selectee.selecting ) {
12105
-					selectee.$element.addClass("ui-selecting");
14006
+					that._addClass( selectee.$element, "ui-selecting" );
12106 14007
 					selectee.selecting = true;
14008
+
12107 14009
 					// selectable SELECTING callback
12108 14010
 					that._trigger( "selecting", event, {
12109 14011
 						selecting: selectee.element
... ...
@@ -12113,17 +14016,18 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12113 14016
 				// UNSELECT
12114 14017
 				if ( selectee.selecting ) {
12115 14018
 					if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) {
12116
-						selectee.$element.removeClass("ui-selecting");
14019
+						that._removeClass( selectee.$element, "ui-selecting" );
12117 14020
 						selectee.selecting = false;
12118
-						selectee.$element.addClass("ui-selected");
14021
+						that._addClass( selectee.$element, "ui-selected" );
12119 14022
 						selectee.selected = true;
12120 14023
 					} else {
12121
-						selectee.$element.removeClass("ui-selecting");
14024
+						that._removeClass( selectee.$element, "ui-selecting" );
12122 14025
 						selectee.selecting = false;
12123 14026
 						if ( selectee.startselected ) {
12124
-							selectee.$element.addClass("ui-unselecting");
14027
+							that._addClass( selectee.$element, "ui-unselecting" );
12125 14028
 							selectee.unselecting = true;
12126 14029
 						}
14030
+
12127 14031
 						// selectable UNSELECTING callback
12128 14032
 						that._trigger( "unselecting", event, {
12129 14033
 							unselecting: selectee.element
... ...
@@ -12132,11 +14036,12 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12132 14036
 				}
12133 14037
 				if ( selectee.selected ) {
12134 14038
 					if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) {
12135
-						selectee.$element.removeClass("ui-selected");
14039
+						that._removeClass( selectee.$element, "ui-selected" );
12136 14040
 						selectee.selected = false;
12137 14041
 
12138
-						selectee.$element.addClass("ui-unselecting");
14042
+						that._addClass( selectee.$element, "ui-unselecting" );
12139 14043
 						selectee.unselecting = true;
14044
+
12140 14045
 						// selectable UNSELECTING callback
12141 14046
 						that._trigger( "unselecting", event, {
12142 14047
 							unselecting: selectee.element
... ...
@@ -12156,7 +14061,7 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12156 14061
 
12157 14062
 		$( ".ui-unselecting", this.element[ 0 ] ).each( function() {
12158 14063
 			var selectee = $.data( this, "selectable-item" );
12159
-			selectee.$element.removeClass("ui-unselecting");
14064
+			that._removeClass( selectee.$element, "ui-unselecting" );
12160 14065
 			selectee.unselecting = false;
12161 14066
 			selectee.startselected = false;
12162 14067
 			that._trigger( "unselected", event, {
... ...
@@ -12165,7 +14070,8 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12165 14070
 		} );
12166 14071
 		$( ".ui-selecting", this.element[ 0 ] ).each( function() {
12167 14072
 			var selectee = $.data( this, "selectable-item" );
12168
-			selectee.$element.removeClass("ui-selecting").addClass("ui-selected");
14073
+			that._removeClass( selectee.$element, "ui-selecting" )
14074
+				._addClass( selectee.$element, "ui-selected" );
12169 14075
 			selectee.selecting = false;
12170 14076
 			selectee.selected = true;
12171 14077
 			selectee.startselected = true;
... ...
@@ -12184,22 +14090,35 @@ var selectable = $.widget("ui.selectable", $.ui.mouse, {
12184 14090
 
12185 14091
 
12186 14092
 /*!
12187
- * jQuery UI Selectmenu 1.11.4
14093
+ * jQuery UI Selectmenu 1.13.2
12188 14094
  * http://jqueryui.com
12189 14095
  *
12190 14096
  * Copyright jQuery Foundation and other contributors
12191 14097
  * Released under the MIT license.
12192 14098
  * http://jquery.org/license
12193
- *
12194
- * http://api.jqueryui.com/selectmenu
12195 14099
  */
12196 14100
 
14101
+//>>label: Selectmenu
14102
+//>>group: Widgets
14103
+/* eslint-disable max-len */
14104
+//>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select.
14105
+/* eslint-enable max-len */
14106
+//>>docs: http://api.jqueryui.com/selectmenu/
14107
+//>>demos: http://jqueryui.com/selectmenu/
14108
+//>>css.structure: ../../themes/base/core.css
14109
+//>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css
14110
+//>>css.theme: ../../themes/base/theme.css
12197 14111
 
12198
-var selectmenu = $.widget( "ui.selectmenu", {
12199
-	version: "1.11.4",
14112
+
14113
+var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, {
14114
+	version: "1.13.2",
12200 14115
 	defaultElement: "<select>",
12201 14116
 	options: {
12202 14117
 		appendTo: null,
14118
+		classes: {
14119
+			"ui-selectmenu-button-open": "ui-corner-top",
14120
+			"ui-selectmenu-button-closed": "ui-corner-all"
14121
+		},
12203 14122
 		disabled: null,
12204 14123
 		icons: {
12205 14124
 			button: "ui-icon-triangle-1-s"
... ...
@@ -12209,9 +14128,9 @@ var selectmenu = $.widget( "ui.selectmenu", {
12209 14128
 			at: "left bottom",
12210 14129
 			collision: "none"
12211 14130
 		},
12212
-		width: null,
14131
+		width: false,
12213 14132
 
12214
-		// callbacks
14133
+		// Callbacks
12215 14134
 		change: null,
12216 14135
 		close: null,
12217 14136
 		focus: null,
... ...
@@ -12229,20 +14148,25 @@ var selectmenu = $.widget( "ui.selectmenu", {
12229 14148
 
12230 14149
 		this._drawButton();
12231 14150
 		this._drawMenu();
14151
+		this._bindFormResetHandler();
12232 14152
 
12233
-		if ( this.options.disabled ) {
12234
-			this.disable();
12235
-		}
14153
+		this._rendered = false;
14154
+		this.menuItems = $();
12236 14155
 	},
12237 14156
 
12238 14157
 	_drawButton: function() {
12239
-		var that = this;
14158
+		var icon,
14159
+			that = this,
14160
+			item = this._parseOption(
14161
+				this.element.find( "option:selected" ),
14162
+				this.element[ 0 ].selectedIndex
14163
+			);
12240 14164
 
12241 14165
 		// Associate existing label with the new button
12242
-		this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
12243
-		this._on( this.label, {
14166
+		this.labels = this.element.labels().attr( "for", this.ids.button );
14167
+		this._on( this.labels, {
12244 14168
 			click: function( event ) {
12245
-				this.button.focus();
14169
+				this.button.trigger( "focus" );
12246 14170
 				event.preventDefault();
12247 14171
 			}
12248 14172
 		} );
... ...
@@ -12252,41 +14176,38 @@ var selectmenu = $.widget( "ui.selectmenu", {
12252 14176
 
12253 14177
 		// Create button
12254 14178
 		this.button = $( "<span>", {
12255
-			"class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
12256 14179
 			tabindex: this.options.disabled ? -1 : 0,
12257 14180
 			id: this.ids.button,
12258 14181
 			role: "combobox",
12259 14182
 			"aria-expanded": "false",
12260 14183
 			"aria-autocomplete": "list",
12261 14184
 			"aria-owns": this.ids.menu,
12262
-			"aria-haspopup": "true"
14185
+			"aria-haspopup": "true",
14186
+			title: this.element.attr( "title" )
12263 14187
 		} )
12264 14188
 			.insertAfter( this.element );
12265 14189
 
12266
-		$( "<span>", {
12267
-			"class": "ui-icon " + this.options.icons.button
12268
-		})
12269
-			.prependTo( this.button );
14190
+		this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
14191
+			"ui-button ui-widget" );
12270 14192
 
12271
-		this.buttonText = $( "<span>", {
12272
-			"class": "ui-selectmenu-text"
12273
-		})
14193
+		icon = $( "<span>" ).appendTo( this.button );
14194
+		this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button );
14195
+		this.buttonItem = this._renderButtonItem( item )
12274 14196
 			.appendTo( this.button );
12275 14197
 
12276
-		this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
14198
+		if ( this.options.width !== false ) {
12277 14199
 			this._resizeButton();
14200
+		}
12278 14201
 
12279 14202
 		this._on( this.button, this._buttonEvents );
12280 14203
 		this.button.one( "focusin", function() {
12281 14204
 
12282 14205
 			// Delay rendering the menu items until the button receives focus.
12283 14206
 			// The menu may have already been rendered via a programmatic open.
12284
-			if ( !that.menuItems ) {
14207
+			if ( !that._rendered ) {
12285 14208
 				that._refreshMenu();
12286 14209
 			}
12287 14210
 		} );
12288
-		this._hoverable( this.button );
12289
-		this._focusable( this.button );
12290 14211
 	},
12291 14212
 
12292 14213
 	_drawMenu: function() {
... ...
@@ -12300,20 +14221,21 @@ var selectmenu = $.widget( "ui.selectmenu", {
12300 14221
 		} );
12301 14222
 
12302 14223
 		// Wrap menu
12303
-		this.menuWrap = $( "<div>", {
12304
-			"class": "ui-selectmenu-menu ui-front"
12305
-		})
12306
-			.append( this.menu )
12307
-			.appendTo( this._appendTo() );
14224
+		this.menuWrap = $( "<div>" ).append( this.menu );
14225
+		this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" );
14226
+		this.menuWrap.appendTo( this._appendTo() );
12308 14227
 
12309 14228
 		// Initialize menu widget
12310 14229
 		this.menuInstance = this.menu
12311 14230
 			.menu( {
14231
+				classes: {
14232
+					"ui-menu": "ui-corner-bottom"
14233
+				},
12312 14234
 				role: "listbox",
12313 14235
 				select: function( event, ui ) {
12314 14236
 					event.preventDefault();
12315 14237
 
12316
-					// support: IE8
14238
+					// Support: IE8
12317 14239
 					// If the item was selected via a click, the text selection
12318 14240
 					// will be destroyed in IE
12319 14241
 					that._setSelection();
... ...
@@ -12338,11 +14260,6 @@ var selectmenu = $.widget( "ui.selectmenu", {
12338 14260
 			} )
12339 14261
 			.menu( "instance" );
12340 14262
 
12341
-		// Adjust menu styles to dropdown
12342
-		this.menu
12343
-			.addClass( "ui-corner-bottom" )
12344
-			.removeClass( "ui-corner-all" );
12345
-
12346 14263
 		// Don't close the menu on mouseleave
12347 14264
 		this.menuInstance._off( this.menu, "mouseleave" );
12348 14265
 
... ...
@@ -12359,27 +14276,37 @@ var selectmenu = $.widget( "ui.selectmenu", {
12359 14276
 
12360 14277
 	refresh: function() {
12361 14278
 		this._refreshMenu();
12362
-		this._setText( this.buttonText, this._getSelectedItem().text() );
12363
-		if ( !this.options.width ) {
14279
+		this.buttonItem.replaceWith(
14280
+			this.buttonItem = this._renderButtonItem(
14281
+
14282
+				// Fall back to an empty object in case there are no options
14283
+				this._getSelectedItem().data( "ui-selectmenu-item" ) || {}
14284
+			)
14285
+		);
14286
+		if ( this.options.width === null ) {
12364 14287
 			this._resizeButton();
12365 14288
 		}
12366 14289
 	},
12367 14290
 
12368 14291
 	_refreshMenu: function() {
12369
-		this.menu.empty();
12370
-
12371 14292
 		var item,
12372 14293
 			options = this.element.find( "option" );
12373 14294
 
12374
-		if ( !options.length ) {
12375
-			return;
12376
-		}
14295
+		this.menu.empty();
12377 14296
 
12378 14297
 		this._parseOptions( options );
12379 14298
 		this._renderMenu( this.menu, this.items );
12380 14299
 
12381 14300
 		this.menuInstance.refresh();
12382
-		this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
14301
+		this.menuItems = this.menu.find( "li" )
14302
+			.not( ".ui-selectmenu-optgroup" )
14303
+				.find( ".ui-menu-item-wrapper" );
14304
+
14305
+		this._rendered = true;
14306
+
14307
+		if ( !options.length ) {
14308
+			return;
14309
+		}
12383 14310
 
12384 14311
 		item = this._getSelectedItem();
12385 14312
 
... ...
@@ -12397,15 +14324,20 @@ var selectmenu = $.widget( "ui.selectmenu", {
12397 14324
 		}
12398 14325
 
12399 14326
 		// If this is the first time the menu is being opened, render the items
12400
-		if ( !this.menuItems ) {
14327
+		if ( !this._rendered ) {
12401 14328
 			this._refreshMenu();
12402 14329
 		} else {
12403 14330
 
12404 14331
 			// Menu clears focus on close, reset focus to selected item
12405
-			this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
14332
+			this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" );
12406 14333
 			this.menuInstance.focus( null, this._getSelectedItem() );
12407 14334
 		}
12408 14335
 
14336
+		// If there are no options, don't open the menu
14337
+		if ( !this.menuItems.length ) {
14338
+			return;
14339
+		}
14340
+
12409 14341
 		this.isOpen = true;
12410 14342
 		this._toggleAttr();
12411 14343
 		this._resizeMenu();
... ...
@@ -12442,20 +14374,32 @@ var selectmenu = $.widget( "ui.selectmenu", {
12442 14374
 		return this.menu;
12443 14375
 	},
12444 14376
 
14377
+	_renderButtonItem: function( item ) {
14378
+		var buttonItem = $( "<span>" );
14379
+
14380
+		this._setText( buttonItem, item.label );
14381
+		this._addClass( buttonItem, "ui-selectmenu-text" );
14382
+
14383
+		return buttonItem;
14384
+	},
14385
+
12445 14386
 	_renderMenu: function( ul, items ) {
12446 14387
 		var that = this,
12447 14388
 			currentOptgroup = "";
12448 14389
 
12449 14390
 		$.each( items, function( index, item ) {
14391
+			var li;
14392
+
12450 14393
 			if ( item.optgroup !== currentOptgroup ) {
12451
-				$( "<li>", {
12452
-					"class": "ui-selectmenu-optgroup ui-menu-divider" +
14394
+				li = $( "<li>", {
14395
+					text: item.optgroup
14396
+				} );
14397
+				that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" +
12453 14398
 					( item.element.parent( "optgroup" ).prop( "disabled" ) ?
12454 14399
 						" ui-state-disabled" :
12455
-							"" ),
12456
-					text: item.optgroup
12457
-				})
12458
-					.appendTo( ul );
14400
+						"" ) );
14401
+
14402
+				li.appendTo( ul );
12459 14403
 
12460 14404
 				currentOptgroup = item.optgroup;
12461 14405
 			}
... ...
@@ -12469,14 +14413,17 @@ var selectmenu = $.widget( "ui.selectmenu", {
12469 14413
 	},
12470 14414
 
12471 14415
 	_renderItem: function( ul, item ) {
12472
-		var li = $( "<li>" );
14416
+		var li = $( "<li>" ),
14417
+			wrapper = $( "<div>", {
14418
+				title: item.element.attr( "title" )
14419
+			} );
12473 14420
 
12474 14421
 		if ( item.disabled ) {
12475
-			li.addClass( "ui-state-disabled" );
14422
+			this._addClass( li, null, "ui-state-disabled" );
12476 14423
 		}
12477
-		this._setText( li, item.label );
14424
+		this._setText( wrapper, item.label );
12478 14425
 
12479
-		return li.appendTo( ul );
14426
+		return li.append( wrapper ).appendTo( ul );
12480 14427
 	},
12481 14428
 
12482 14429
 	_setText: function( element, value ) {
... ...
@@ -12492,9 +14439,9 @@ var selectmenu = $.widget( "ui.selectmenu", {
12492 14439
 			filter = ".ui-menu-item";
12493 14440
 
12494 14441
 		if ( this.isOpen ) {
12495
-			item = this.menuItems.eq( this.focusIndex );
14442
+			item = this.menuItems.eq( this.focusIndex ).parent( "li" );
12496 14443
 		} else {
12497
-			item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
14444
+			item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
12498 14445
 			filter += ":not(.ui-state-disabled)";
12499 14446
 		}
12500 14447
 
... ...
@@ -12510,7 +14457,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
12510 14457
 	},
12511 14458
 
12512 14459
 	_getSelectedItem: function() {
12513
-		return this.menuItems.eq( this.element[ 0 ].selectedIndex );
14460
+		return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" );
12514 14461
 	},
12515 14462
 
12516 14463
 	_toggle: function( event ) {
... ...
@@ -12529,15 +14476,15 @@ var selectmenu = $.widget( "ui.selectmenu", {
12529 14476
 			selection.removeAllRanges();
12530 14477
 			selection.addRange( this.range );
12531 14478
 
12532
-		// support: IE8
14479
+		// Support: IE8
12533 14480
 		} else {
12534 14481
 			this.range.select();
12535 14482
 		}
12536 14483
 
12537
-		// support: IE
14484
+		// Support: IE
12538 14485
 		// Setting the text selection kills the button focus in IE, but
12539 14486
 		// restoring the focus doesn't kill the selection.
12540
-		this.button.focus();
14487
+		this.button.trigger( "focus" );
12541 14488
 	},
12542 14489
 
12543 14490
 	_documentClick: {
... ...
@@ -12546,7 +14493,8 @@ var selectmenu = $.widget( "ui.selectmenu", {
12546 14493
 				return;
12547 14494
 			}
12548 14495
 
12549
-			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
14496
+			if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" +
14497
+				$.escapeSelector( this.ids.button ) ).length ) {
12550 14498
 				this.close( event );
12551 14499
 			}
12552 14500
 		}
... ...
@@ -12564,7 +14512,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
12564 14512
 					this.range = selection.getRangeAt( 0 );
12565 14513
 				}
12566 14514
 
12567
-			// support: IE8
14515
+			// Support: IE8
12568 14516
 			} else {
12569 14517
 				this.range = document.selection.createRange();
12570 14518
 			}
... ...
@@ -12635,7 +14583,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
12635 14583
 	},
12636 14584
 
12637 14585
 	_selectFocusedItem: function( event ) {
12638
-		var item = this.menuItems.eq( this.focusIndex );
14586
+		var item = this.menuItems.eq( this.focusIndex ).parent( "li" );
12639 14587
 		if ( !item.hasClass( "ui-state-disabled" ) ) {
12640 14588
 			this._select( item.data( "ui-selectmenu-item" ), event );
12641 14589
 		}
... ...
@@ -12646,7 +14594,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
12646 14594
 
12647 14595
 		// Change native select element
12648 14596
 		this.element[ 0 ].selectedIndex = item.index;
12649
-		this._setText( this.buttonText, item.label );
14597
+		this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) );
12650 14598
 		this._setAria( item );
12651 14599
 		this._trigger( "select", event, { item: item } );
12652 14600
 
... ...
@@ -12669,9 +14617,9 @@ var selectmenu = $.widget( "ui.selectmenu", {
12669 14617
 
12670 14618
 	_setOption: function( key, value ) {
12671 14619
 		if ( key === "icons" ) {
12672
-			this.button.find( "span.ui-icon" )
12673
-				.removeClass( this.options.icons.button )
12674
-				.addClass( value.button );
14620
+			var icon = this.button.find( "span.ui-icon" );
14621
+			this._removeClass( icon, null, this.options.icons.button )
14622
+				._addClass( icon, null, value.button );
12675 14623
 		}
12676 14624
 
12677 14625
 		this._super( key, value );
... ...
@@ -12680,11 +14628,17 @@ var selectmenu = $.widget( "ui.selectmenu", {
12680 14628
 			this.menuWrap.appendTo( this._appendTo() );
12681 14629
 		}
12682 14630
 
12683
-		if ( key === "disabled" ) {
14631
+		if ( key === "width" ) {
14632
+			this._resizeButton();
14633
+		}
14634
+	},
14635
+
14636
+	_setOptionDisabled: function( value ) {
14637
+		this._super( value );
14638
+
12684 14639
 		this.menuInstance.option( "disabled", value );
12685
-			this.button
12686
-				.toggleClass( "ui-state-disabled", value )
12687
-				.attr( "aria-disabled", value );
14640
+		this.button.attr( "aria-disabled", value );
14641
+		this._toggleClass( this.button, null, "ui-state-disabled", value );
12688 14642
 
12689 14643
 		this.element.prop( "disabled", value );
12690 14644
 		if ( value ) {
... ...
@@ -12693,11 +14647,6 @@ var selectmenu = $.widget( "ui.selectmenu", {
12693 14647
 		} else {
12694 14648
 			this.button.attr( "tabindex", 0 );
12695 14649
 		}
12696
-		}
12697
-
12698
-		if ( key === "width" ) {
12699
-			this._resizeButton();
12700
-		}
12701 14650
 	},
12702 14651
 
12703 14652
 	_appendTo: function() {
... ...
@@ -12710,7 +14659,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
12710 14659
 		}
12711 14660
 
12712 14661
 		if ( !element || !element[ 0 ] ) {
12713
-			element = this.element.closest( ".ui-front" );
14662
+			element = this.element.closest( ".ui-front, dialog" );
12714 14663
 		}
12715 14664
 
12716 14665
 		if ( !element.length ) {
... ...
@@ -12721,18 +14670,31 @@ var selectmenu = $.widget( "ui.selectmenu", {
12721 14670
 	},
12722 14671
 
12723 14672
 	_toggleAttr: function() {
12724
-		this.button
12725
-			.toggleClass( "ui-corner-top", this.isOpen )
12726
-			.toggleClass( "ui-corner-all", !this.isOpen )
12727
-			.attr( "aria-expanded", this.isOpen );
12728
-		this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
14673
+		this.button.attr( "aria-expanded", this.isOpen );
14674
+
14675
+		// We can't use two _toggleClass() calls here, because we need to make sure
14676
+		// we always remove classes first and add them second, otherwise if both classes have the
14677
+		// same theme class, it will be removed after we add it.
14678
+		this._removeClass( this.button, "ui-selectmenu-button-" +
14679
+			( this.isOpen ? "closed" : "open" ) )
14680
+			._addClass( this.button, "ui-selectmenu-button-" +
14681
+				( this.isOpen ? "open" : "closed" ) )
14682
+			._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );
14683
+
12729 14684
 		this.menu.attr( "aria-hidden", !this.isOpen );
12730 14685
 	},
12731 14686
 
12732 14687
 	_resizeButton: function() {
12733 14688
 		var width = this.options.width;
12734 14689
 
12735
-		if ( !width ) {
14690
+		// For `width: false`, just remove inline style and stop
14691
+		if ( width === false ) {
14692
+			this.button.css( "width", "" );
14693
+			return;
14694
+		}
14695
+
14696
+		// For `width: null`, match the width of the original element
14697
+		if ( width === null ) {
12736 14698
 			width = this.element.show().outerWidth();
12737 14699
 			this.element.hide();
12738 14700
 		}
... ...
@@ -12744,7 +14706,7 @@ var selectmenu = $.widget( "ui.selectmenu", {
12744 14706
 		this.menu.outerWidth( Math.max(
12745 14707
 			this.button.outerWidth(),
12746 14708
 
12747
-			// support: IE10
14709
+			// Support: IE10
12748 14710
 			// IE10 wraps long text (possibly a rounding bug)
12749 14711
 			// so we add 1px to avoid the wrapping
12750 14712
 			this.menu.width( "" ).outerWidth() + 1
... ...
@@ -12752,54 +14714,83 @@ var selectmenu = $.widget( "ui.selectmenu", {
12752 14714
 	},
12753 14715
 
12754 14716
 	_getCreateOptions: function() {
12755
-		return { disabled: this.element.prop( "disabled" ) };
14717
+		var options = this._super();
14718
+
14719
+		options.disabled = this.element.prop( "disabled" );
14720
+
14721
+		return options;
12756 14722
 	},
12757 14723
 
12758 14724
 	_parseOptions: function( options ) {
12759
-		var data = [];
14725
+		var that = this,
14726
+			data = [];
12760 14727
 		options.each( function( index, item ) {
12761
-			var option = $( item ),
12762
-				optgroup = option.parent( "optgroup" );
12763
-			data.push({
14728
+			if ( item.hidden ) {
14729
+				return;
14730
+			}
14731
+
14732
+			data.push( that._parseOption( $( item ), index ) );
14733
+		} );
14734
+		this.items = data;
14735
+	},
14736
+
14737
+	_parseOption: function( option, index ) {
14738
+		var optgroup = option.parent( "optgroup" );
14739
+
14740
+		return {
12764 14741
 			element: option,
12765 14742
 			index: index,
12766 14743
 			value: option.val(),
12767 14744
 			label: option.text(),
12768 14745
 			optgroup: optgroup.attr( "label" ) || "",
12769 14746
 			disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
12770
-			});
12771
-		});
12772
-		this.items = data;
14747
+		};
12773 14748
 	},
12774 14749
 
12775 14750
 	_destroy: function() {
14751
+		this._unbindFormResetHandler();
12776 14752
 		this.menuWrap.remove();
12777 14753
 		this.button.remove();
12778 14754
 		this.element.show();
12779 14755
 		this.element.removeUniqueId();
12780
-		this.label.attr( "for", this.ids.element );
14756
+		this.labels.attr( "for", this.ids.element );
12781 14757
 	}
12782
-});
14758
+} ] );
12783 14759
 
12784 14760
 
12785 14761
 /*!
12786
- * jQuery UI Slider 1.11.4
14762
+ * jQuery UI Slider 1.13.2
12787 14763
  * http://jqueryui.com
12788 14764
  *
12789 14765
  * Copyright jQuery Foundation and other contributors
12790 14766
  * Released under the MIT license.
12791 14767
  * http://jquery.org/license
12792
- *
12793
- * http://api.jqueryui.com/slider/
12794 14768
  */
12795 14769
 
14770
+//>>label: Slider
14771
+//>>group: Widgets
14772
+//>>description: Displays a flexible slider with ranges and accessibility via keyboard.
14773
+//>>docs: http://api.jqueryui.com/slider/
14774
+//>>demos: http://jqueryui.com/slider/
14775
+//>>css.structure: ../../themes/base/core.css
14776
+//>>css.structure: ../../themes/base/slider.css
14777
+//>>css.theme: ../../themes/base/theme.css
14778
+
12796 14779
 
12797
-var slider = $.widget( "ui.slider", $.ui.mouse, {
12798
-	version: "1.11.4",
14780
+var widgetsSlider = $.widget( "ui.slider", $.ui.mouse, {
14781
+	version: "1.13.2",
12799 14782
 	widgetEventPrefix: "slide",
12800 14783
 
12801 14784
 	options: {
12802 14785
 		animate: false,
14786
+		classes: {
14787
+			"ui-slider": "ui-corner-all",
14788
+			"ui-slider-handle": "ui-corner-all",
14789
+
14790
+			// Note: ui-widget-header isn't the most fittingly semantic framework class for this
14791
+			// element, but worked best visually with a variety of themes
14792
+			"ui-slider-range": "ui-corner-all ui-widget-header"
14793
+		},
12803 14794
 		distance: 0,
12804 14795
 		max: 100,
12805 14796
 		min: 0,
... ...
@@ -12809,14 +14800,14 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12809 14800
 		value: 0,
12810 14801
 		values: null,
12811 14802
 
12812
-		// callbacks
14803
+		// Callbacks
12813 14804
 		change: null,
12814 14805
 		slide: null,
12815 14806
 		start: null,
12816 14807
 		stop: null
12817 14808
 	},
12818 14809
 
12819
-	// number of pages in a slider
14810
+	// Number of pages in a slider
12820 14811
 	// (how many times can you page up/down to go through the whole range)
12821 14812
 	numPages: 5,
12822 14813
 
... ...
@@ -12829,15 +14820,10 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12829 14820
 		this._mouseInit();
12830 14821
 		this._calculateNewMax();
12831 14822
 
12832
-		this.element
12833
-			.addClass( "ui-slider" +
12834
-				" ui-slider-" + this.orientation +
12835
-				" ui-widget" +
12836
-				" ui-widget-content" +
12837
-				" ui-corner-all");
14823
+		this._addClass( "ui-slider ui-slider-" + this.orientation,
14824
+			"ui-widget ui-widget-content" );
12838 14825
 
12839 14826
 		this._refresh();
12840
-		this._setOption( "disabled", this.options.disabled );
12841 14827
 
12842 14828
 		this._animateOff = false;
12843 14829
 	},
... ...
@@ -12852,8 +14838,8 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12852 14838
 	_createHandles: function() {
12853 14839
 		var i, handleCount,
12854 14840
 			options = this.options,
12855
-			existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
12856
-			handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
14841
+			existingHandles = this.element.find( ".ui-slider-handle" ),
14842
+			handle = "<span tabindex='0'></span>",
12857 14843
 			handles = [];
12858 14844
 
12859 14845
 		handleCount = ( options.values && options.values.length ) || 1;
... ...
@@ -12869,16 +14855,19 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12869 14855
 
12870 14856
 		this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) );
12871 14857
 
14858
+		this._addClass( this.handles, "ui-slider-handle", "ui-state-default" );
14859
+
12872 14860
 		this.handle = this.handles.eq( 0 );
12873 14861
 
12874 14862
 		this.handles.each( function( i ) {
12875
-			$( this ).data( "ui-slider-handle-index", i );
14863
+			$( this )
14864
+				.data( "ui-slider-handle-index", i )
14865
+				.attr( "tabIndex", 0 );
12876 14866
 		} );
12877 14867
 	},
12878 14868
 
12879 14869
 	_createRange: function() {
12880
-		var options = this.options,
12881
-			classes = "";
14870
+		var options = this.options;
12882 14871
 
12883 14872
 		if ( options.range ) {
12884 14873
 			if ( options.range === true ) {
... ...
@@ -12886,30 +14875,28 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12886 14875
 					options.values = [ this._valueMin(), this._valueMin() ];
12887 14876
 				} else if ( options.values.length && options.values.length !== 2 ) {
12888 14877
 					options.values = [ options.values[ 0 ], options.values[ 0 ] ];
12889
-				} else if ( $.isArray( options.values ) ) {
14878
+				} else if ( Array.isArray( options.values ) ) {
12890 14879
 					options.values = options.values.slice( 0 );
12891 14880
 				}
12892 14881
 			}
12893 14882
 
12894 14883
 			if ( !this.range || !this.range.length ) {
12895
-				this.range = $( "<div></div>" )
14884
+				this.range = $( "<div>" )
12896 14885
 					.appendTo( this.element );
12897 14886
 
12898
-				classes = "ui-slider-range" +
12899
-				// note: this isn't the most fittingly semantic framework class for this element,
12900
-				// but worked best visually with a variety of themes
12901
-				" ui-widget-header ui-corner-all";
14887
+				this._addClass( this.range, "ui-slider-range" );
12902 14888
 			} else {
12903
-				this.range.removeClass( "ui-slider-range-min ui-slider-range-max" )
14889
+				this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" );
14890
+
12904 14891
 				// Handle range switching from true to min/max
12905
-					.css({
14892
+				this.range.css( {
12906 14893
 					"left": "",
12907 14894
 					"bottom": ""
12908 14895
 				} );
12909 14896
 			}
12910
-
12911
-			this.range.addClass( classes +
12912
-				( ( options.range === "min" || options.range === "max" ) ? " ui-slider-range-" + options.range : "" ) );
14897
+			if ( options.range === "min" || options.range === "max" ) {
14898
+				this._addClass( this.range, "ui-slider-range-" + options.range );
14899
+			}
12913 14900
 		} else {
12914 14901
 			if ( this.range ) {
12915 14902
 				this.range.remove();
... ...
@@ -12931,14 +14918,6 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12931 14918
 			this.range.remove();
12932 14919
 		}
12933 14920
 
12934
-		this.element
12935
-			.removeClass( "ui-slider" +
12936
-				" ui-slider-horizontal" +
12937
-				" ui-slider-vertical" +
12938
-				" ui-widget" +
12939
-				" ui-widget-content" +
12940
-				" ui-corner-all" );
12941
-
12942 14921
 		this._mouseDestroy();
12943 14922
 	},
12944 14923
 
... ...
@@ -12979,9 +14958,8 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
12979 14958
 
12980 14959
 		this._handleIndex = index;
12981 14960
 
12982
-		closestHandle
12983
-			.addClass( "ui-state-active" )
12984
-			.focus();
14961
+		this._addClass( closestHandle, null, "ui-state-active" );
14962
+		closestHandle.trigger( "focus" );
12985 14963
 
12986 14964
 		offset = closestHandle.offset();
12987 14965
 		mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
... ...
@@ -13015,7 +14993,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13015 14993
 	},
13016 14994
 
13017 14995
 	_mouseStop: function( event ) {
13018
-		this.handles.removeClass( "ui-state-active" );
14996
+		this._removeClass( this.handles, null, "ui-state-active" );
13019 14997
 		this._mouseSliding = false;
13020 14998
 
13021 14999
 		this._stop( event, this._handleIndex );
... ...
@@ -13041,10 +15019,12 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13041 15019
 
13042 15020
 		if ( this.orientation === "horizontal" ) {
13043 15021
 			pixelTotal = this.elementSize.width;
13044
-			pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
15022
+			pixelMouse = position.x - this.elementOffset.left -
15023
+				( this._clickOffset ? this._clickOffset.left : 0 );
13045 15024
 		} else {
13046 15025
 			pixelTotal = this.elementSize.height;
13047
-			pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
15026
+			pixelMouse = position.y - this.elementOffset.top -
15027
+				( this._clickOffset ? this._clickOffset.top : 0 );
13048 15028
 		}
13049 15029
 
13050 15030
 		percentMouse = ( pixelMouse / pixelTotal );
... ...
@@ -13064,88 +15044,73 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13064 15044
 		return this._trimAlignValue( valueMouse );
13065 15045
 	},
13066 15046
 
13067
-	_start: function( event, index ) {
15047
+	_uiHash: function( index, value, values ) {
13068 15048
 		var uiHash = {
13069 15049
 			handle: this.handles[ index ],
13070
-			value: this.value()
15050
+			handleIndex: index,
15051
+			value: value !== undefined ? value : this.value()
13071 15052
 		};
13072
-		if ( this.options.values && this.options.values.length ) {
13073
-			uiHash.value = this.values( index );
13074
-			uiHash.values = this.values();
15053
+
15054
+		if ( this._hasMultipleValues() ) {
15055
+			uiHash.value = value !== undefined ? value : this.values( index );
15056
+			uiHash.values = values || this.values();
13075 15057
 		}
13076
-		return this._trigger( "start", event, uiHash );
15058
+
15059
+		return uiHash;
15060
+	},
15061
+
15062
+	_hasMultipleValues: function() {
15063
+		return this.options.values && this.options.values.length;
15064
+	},
15065
+
15066
+	_start: function( event, index ) {
15067
+		return this._trigger( "start", event, this._uiHash( index ) );
13077 15068
 	},
13078 15069
 
13079 15070
 	_slide: function( event, index, newVal ) {
13080
-		var otherVal,
13081
-			newValues,
13082
-			allowed;
15071
+		var allowed, otherVal,
15072
+			currentValue = this.value(),
15073
+			newValues = this.values();
13083 15074
 
13084
-		if ( this.options.values && this.options.values.length ) {
15075
+		if ( this._hasMultipleValues() ) {
13085 15076
 			otherVal = this.values( index ? 0 : 1 );
15077
+			currentValue = this.values( index );
13086 15078
 
13087
-			if ( ( this.options.values.length === 2 && this.options.range === true ) &&
13088
-					( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
13089
-				) {
13090
-				newVal = otherVal;
15079
+			if ( this.options.values.length === 2 && this.options.range === true ) {
15080
+				newVal =  index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal );
13091 15081
 			}
13092 15082
 
13093
-			if ( newVal !== this.values( index ) ) {
13094
-				newValues = this.values();
13095 15083
 			newValues[ index ] = newVal;
13096
-				// A slide can be canceled by returning false from the slide callback
13097
-				allowed = this._trigger( "slide", event, {
13098
-					handle: this.handles[ index ],
13099
-					value: newVal,
13100
-					values: newValues
13101
-				} );
13102
-				otherVal = this.values( index ? 0 : 1 );
13103
-				if ( allowed !== false ) {
13104
-					this.values( index, newVal );
13105 15084
 		}
15085
+
15086
+		if ( newVal === currentValue ) {
15087
+			return;
15088
+		}
15089
+
15090
+		allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) );
15091
+
15092
+		// A slide can be canceled by returning false from the slide callback
15093
+		if ( allowed === false ) {
15094
+			return;
13106 15095
 		}
15096
+
15097
+		if ( this._hasMultipleValues() ) {
15098
+			this.values( index, newVal );
13107 15099
 		} else {
13108
-			if ( newVal !== this.value() ) {
13109
-				// A slide can be canceled by returning false from the slide callback
13110
-				allowed = this._trigger( "slide", event, {
13111
-					handle: this.handles[ index ],
13112
-					value: newVal
13113
-				} );
13114
-				if ( allowed !== false ) {
13115 15100
 			this.value( newVal );
13116 15101
 		}
13117
-			}
13118
-		}
13119 15102
 	},
13120 15103
 
13121 15104
 	_stop: function( event, index ) {
13122
-		var uiHash = {
13123
-			handle: this.handles[ index ],
13124
-			value: this.value()
13125
-		};
13126
-		if ( this.options.values && this.options.values.length ) {
13127
-			uiHash.value = this.values( index );
13128
-			uiHash.values = this.values();
13129
-		}
13130
-
13131
-		this._trigger( "stop", event, uiHash );
15105
+		this._trigger( "stop", event, this._uiHash( index ) );
13132 15106
 	},
13133 15107
 
13134 15108
 	_change: function( event, index ) {
13135 15109
 		if ( !this._keySliding && !this._mouseSliding ) {
13136
-			var uiHash = {
13137
-				handle: this.handles[ index ],
13138
-				value: this.value()
13139
-			};
13140
-			if ( this.options.values && this.options.values.length ) {
13141
-				uiHash.value = this.values( index );
13142
-				uiHash.values = this.values();
13143
-			}
13144 15110
 
13145 15111
 			//store the last changed value index for reference when handles overlap
13146 15112
 			this._lastChangedValue = index;
13147
-
13148
-			this._trigger( "change", event, uiHash );
15113
+			this._trigger( "change", event, this._uiHash( index ) );
13149 15114
 		}
13150 15115
 	},
13151 15116
 
... ...
@@ -13173,7 +15138,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13173 15138
 		}
13174 15139
 
13175 15140
 		if ( arguments.length ) {
13176
-			if ( $.isArray( arguments[ 0 ] ) ) {
15141
+			if ( Array.isArray( arguments[ 0 ] ) ) {
13177 15142
 				vals = this.options.values;
13178 15143
 				newValues = arguments[ 0 ];
13179 15144
 				for ( i = 0; i < vals.length; i += 1 ) {
... ...
@@ -13182,7 +15147,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13182 15147
 				}
13183 15148
 				this._refreshValue();
13184 15149
 			} else {
13185
-				if ( this.options.values && this.options.values.length ) {
15150
+				if ( this._hasMultipleValues() ) {
13186 15151
 					return this._values( index );
13187 15152
 				} else {
13188 15153
 					return this.value();
... ...
@@ -13207,23 +15172,21 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13207 15172
 			}
13208 15173
 		}
13209 15174
 
13210
-		if ( $.isArray( this.options.values ) ) {
15175
+		if ( Array.isArray( this.options.values ) ) {
13211 15176
 			valsLength = this.options.values.length;
13212 15177
 		}
13213 15178
 
13214
-		if ( key === "disabled" ) {
13215
-			this.element.toggleClass( "ui-state-disabled", !!value );
13216
-		}
13217
-
13218 15179
 		this._super( key, value );
13219 15180
 
13220 15181
 		switch ( key ) {
13221 15182
 			case "orientation":
13222 15183
 				this._detectOrientation();
13223
-				this.element
13224
-					.removeClass( "ui-slider-horizontal ui-slider-vertical" )
13225
-					.addClass( "ui-slider-" + this.orientation );
15184
+				this._removeClass( "ui-slider-horizontal ui-slider-vertical" )
15185
+					._addClass( "ui-slider-" + this.orientation );
13226 15186
 				this._refreshValue();
15187
+				if ( this.options.range ) {
15188
+					this._refreshRange( value );
15189
+				}
13227 15190
 
13228 15191
 				// Reset positioning from previous orientation
13229 15192
 				this.handles.css( value === "horizontal" ? "bottom" : "left", "" );
... ...
@@ -13237,7 +15200,9 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13237 15200
 			case "values":
13238 15201
 				this._animateOff = true;
13239 15202
 				this._refreshValue();
13240
-				for ( i = 0; i < valsLength; i += 1 ) {
15203
+
15204
+				// Start from the last handle to prevent unreachable handles (#9046)
15205
+				for ( i = valsLength - 1; i >= 0; i-- ) {
13241 15206
 					this._change( null, i );
13242 15207
 				}
13243 15208
 				this._animateOff = false;
... ...
@@ -13258,6 +15223,12 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13258 15223
 		}
13259 15224
 	},
13260 15225
 
15226
+	_setOptionDisabled: function( value ) {
15227
+		this._super( value );
15228
+
15229
+		this._toggleClass( null, "ui-state-disabled", !!value );
15230
+	},
15231
+
13261 15232
 	//internal value getter
13262 15233
 	// _value() returns value trimmed by min and max, aligned by step
13263 15234
 	_value: function() {
... ...
@@ -13280,7 +15251,8 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13280 15251
 			val = this._trimAlignValue( val );
13281 15252
 
13282 15253
 			return val;
13283
-		} else if ( this.options.values && this.options.values.length ) {
15254
+		} else if ( this._hasMultipleValues() ) {
15255
+
13284 15256
 			// .slice() creates a copy of the array
13285 15257
 			// this copy gets trimmed by min and max and then returned
13286 15258
 			vals = this.options.values.slice();
... ...
@@ -13294,7 +15266,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13294 15266
 		}
13295 15267
 	},
13296 15268
 
13297
-	// returns the step-aligned value that val is closest to, between (inclusive) min and max
15269
+	// Returns the step-aligned value that val is closest to, between (inclusive) min and max
13298 15270
 	_trimAlignValue: function( val ) {
13299 15271
 		if ( val <= this._valueMin() ) {
13300 15272
 			return this._valueMin();
... ...
@@ -13319,8 +15291,13 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13319 15291
 		var max = this.options.max,
13320 15292
 			min = this._valueMin(),
13321 15293
 			step = this.options.step,
13322
-			aboveMin = Math.floor( ( +( max - min ).toFixed( this._precision() ) ) / step ) * step;
15294
+			aboveMin = Math.round( ( max - min ) / step ) * step;
13323 15295
 		max = aboveMin + min;
15296
+		if ( max > this.options.max ) {
15297
+
15298
+			//If max is not divisible by step, rounding off may increase its value
15299
+			max -= step;
15300
+		}
13324 15301
 		this.max = parseFloat( max.toFixed( this._precision() ) );
13325 15302
 	},
13326 15303
 
... ...
@@ -13346,6 +15323,15 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13346 15323
 		return this.max;
13347 15324
 	},
13348 15325
 
15326
+	_refreshRange: function( orientation ) {
15327
+		if ( orientation === "vertical" ) {
15328
+			this.range.css( { "width": "", "left": "" } );
15329
+		}
15330
+		if ( orientation === "horizontal" ) {
15331
+			this.range.css( { "height": "", "bottom": "" } );
15332
+		}
15333
+	},
15334
+
13349 15335
 	_refreshValue: function() {
13350 15336
 		var lastValPercent, valPercent, value, valueMin, valueMax,
13351 15337
 			oRange = this.options.range,
... ...
@@ -13354,25 +15340,40 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13354 15340
 			animate = ( !this._animateOff ) ? o.animate : false,
13355 15341
 			_set = {};
13356 15342
 
13357
-		if ( this.options.values && this.options.values.length ) {
15343
+		if ( this._hasMultipleValues() ) {
13358 15344
 			this.handles.each( function( i ) {
13359
-				valPercent = ( that.values(i) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100;
15345
+				valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() -
15346
+					that._valueMin() ) * 100;
13360 15347
 				_set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
13361 15348
 				$( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
13362 15349
 				if ( that.options.range === true ) {
13363 15350
 					if ( that.orientation === "horizontal" ) {
13364 15351
 						if ( i === 0 ) {
13365
-							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
15352
+							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15353
+								left: valPercent + "%"
15354
+							}, o.animate );
13366 15355
 						}
13367 15356
 						if ( i === 1 ) {
13368
-							that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
15357
+							that.range[ animate ? "animate" : "css" ]( {
15358
+								width: ( valPercent - lastValPercent ) + "%"
15359
+							}, {
15360
+								queue: false,
15361
+								duration: o.animate
15362
+							} );
13369 15363
 						}
13370 15364
 					} else {
13371 15365
 						if ( i === 0 ) {
13372
-							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
15366
+							that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15367
+								bottom: ( valPercent ) + "%"
15368
+							}, o.animate );
13373 15369
 						}
13374 15370
 						if ( i === 1 ) {
13375
-							that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
15371
+							that.range[ animate ? "animate" : "css" ]( {
15372
+								height: ( valPercent - lastValPercent ) + "%"
15373
+							}, {
15374
+								queue: false,
15375
+								duration: o.animate
15376
+							} );
13376 15377
 						}
13377 15378
 					}
13378 15379
 				}
... ...
@@ -13389,16 +15390,24 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13389 15390
 			this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
13390 15391
 
13391 15392
 			if ( oRange === "min" && this.orientation === "horizontal" ) {
13392
-				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
15393
+				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15394
+					width: valPercent + "%"
15395
+				}, o.animate );
13393 15396
 			}
13394 15397
 			if ( oRange === "max" && this.orientation === "horizontal" ) {
13395
-				this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
15398
+				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15399
+					width: ( 100 - valPercent ) + "%"
15400
+				}, o.animate );
13396 15401
 			}
13397 15402
 			if ( oRange === "min" && this.orientation === "vertical" ) {
13398
-				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
15403
+				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15404
+					height: valPercent + "%"
15405
+				}, o.animate );
13399 15406
 			}
13400 15407
 			if ( oRange === "max" && this.orientation === "vertical" ) {
13401
-				this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
15408
+				this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( {
15409
+					height: ( 100 - valPercent ) + "%"
15410
+				}, o.animate );
13402 15411
 			}
13403 15412
 		}
13404 15413
 	},
... ...
@@ -13420,7 +15429,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13420 15429
 					event.preventDefault();
13421 15430
 					if ( !this._keySliding ) {
13422 15431
 						this._keySliding = true;
13423
-						$( event.target ).addClass( "ui-state-active" );
15432
+						this._addClass( $( event.target ), null, "ui-state-active" );
13424 15433
 						allowed = this._start( event, index );
13425 15434
 						if ( allowed === false ) {
13426 15435
 							return;
... ...
@@ -13430,7 +15439,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13430 15439
 			}
13431 15440
 
13432 15441
 			step = this.options.step;
13433
-			if ( this.options.values && this.options.values.length ) {
15442
+			if ( this._hasMultipleValues() ) {
13434 15443
 				curVal = newVal = this.values( index );
13435 15444
 			} else {
13436 15445
 				curVal = newVal = this.value();
... ...
@@ -13477,7 +15486,7 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13477 15486
 				this._keySliding = false;
13478 15487
 				this._stop( event, index );
13479 15488
 				this._change( event, index );
13480
-				$( event.target ).removeClass( "ui-state-active" );
15489
+				this._removeClass( $( event.target ), null, "ui-state-active" );
13481 15490
 			}
13482 15491
 		}
13483 15492
 	}
... ...
@@ -13485,19 +15494,24 @@ var slider = $.widget( "ui.slider", $.ui.mouse, {
13485 15494
 
13486 15495
 
13487 15496
 /*!
13488
- * jQuery UI Sortable 1.11.4
15497
+ * jQuery UI Sortable 1.13.2
13489 15498
  * http://jqueryui.com
13490 15499
  *
13491 15500
  * Copyright jQuery Foundation and other contributors
13492 15501
  * Released under the MIT license.
13493 15502
  * http://jquery.org/license
13494
- *
13495
- * http://api.jqueryui.com/sortable/
13496 15503
  */
13497 15504
 
15505
+//>>label: Sortable
15506
+//>>group: Interactions
15507
+//>>description: Enables items in a list to be sorted using the mouse.
15508
+//>>docs: http://api.jqueryui.com/sortable/
15509
+//>>demos: http://jqueryui.com/sortable/
15510
+//>>css.structure: ../../themes/base/sortable.css
15511
+
13498 15512
 
13499
-var sortable = $.widget("ui.sortable", $.ui.mouse, {
13500
-	version: "1.11.4",
15513
+var widgetsSortable = $.widget( "ui.sortable", $.ui.mouse, {
15514
+	version: "1.13.2",
13501 15515
 	widgetEventPrefix: "sort",
13502 15516
 	ready: false,
13503 15517
 	options: {
... ...
@@ -13524,7 +15538,7 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13524 15538
 		tolerance: "intersect",
13525 15539
 		zIndex: 1000,
13526 15540
 
13527
-		// callbacks
15541
+		// Callbacks
13528 15542
 		activate: null,
13529 15543
 		beforeStop: null,
13530 15544
 		change: null,
... ...
@@ -13544,12 +15558,13 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13544 15558
 	},
13545 15559
 
13546 15560
 	_isFloating: function( item ) {
13547
-		return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
15561
+		return ( /left|right/ ).test( item.css( "float" ) ) ||
15562
+			( /inline|table-cell/ ).test( item.css( "display" ) );
13548 15563
 	},
13549 15564
 
13550 15565
 	_create: function() {
13551 15566
 		this.containerCache = {};
13552
-		this.element.addClass("ui-sortable");
15567
+		this._addClass( "ui-sortable" );
13553 15568
 
13554 15569
 		//Get the items
13555 15570
 		this.refresh();
... ...
@@ -13576,19 +15591,19 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13576 15591
 	},
13577 15592
 
13578 15593
 	_setHandleClassName: function() {
13579
-		this.element.find( ".ui-sortable-handle" ).removeClass( "ui-sortable-handle" );
15594
+		var that = this;
15595
+		this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" );
13580 15596
 		$.each( this.items, function() {
13581
-			( this.instance.options.handle ?
13582
-				this.item.find( this.instance.options.handle ) : this.item )
13583
-				.addClass( "ui-sortable-handle" );
15597
+			that._addClass(
15598
+				this.instance.options.handle ?
15599
+					this.item.find( this.instance.options.handle ) :
15600
+					this.item,
15601
+				"ui-sortable-handle"
15602
+			);
13584 15603
 		} );
13585 15604
 	},
13586 15605
 
13587 15606
 	_destroy: function() {
13588
-		this.element
13589
-			.removeClass( "ui-sortable ui-sortable-disabled" )
13590
-			.find( ".ui-sortable-handle" )
13591
-				.removeClass( "ui-sortable-handle" );
13592 15607
 		this._mouseDestroy();
13593 15608
 
13594 15609
 		for ( var i = this.items.length - 1; i >= 0; i-- ) {
... ...
@@ -13652,9 +15667,15 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13652 15667
 
13653 15668
 		this.currentContainer = this;
13654 15669
 
13655
-		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
15670
+		//We only need to call refreshPositions, because the refreshItems call has been moved to
15671
+		// mouseCapture
13656 15672
 		this.refreshPositions();
13657 15673
 
15674
+		//Prepare the dragged items parent
15675
+		this.appendTo = $( o.appendTo !== "parent" ?
15676
+				o.appendTo :
15677
+				this.currentItem.parent() );
15678
+
13658 15679
 		//Create and append the visible helper
13659 15680
 		this.helper = this._createHelper( event );
13660 15681
 
... ...
@@ -13669,9 +15690,6 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13669 15690
 		//Cache the margins of the original element
13670 15691
 		this._cacheMargins();
13671 15692
 
13672
-		//Get the next scrolling parent
13673
-		this.scrollParent = this.helper.scrollParent();
13674
-
13675 15693
 		//The element's absolute position on the page minus margins
13676 15694
 		this.offset = this.currentItem.offset();
13677 15695
 		this.offset = {
... ...
@@ -13684,27 +15702,31 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13684 15702
 				left: event.pageX - this.offset.left,
13685 15703
 				top: event.pageY - this.offset.top
13686 15704
 			},
13687
-			parent: this._getParentOffset(),
13688
-			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
15705
+
15706
+			// This is a relative to absolute position minus the actual position calculation -
15707
+			// only used for relative positioned helper
15708
+			relative: this._getRelativeOffset()
13689 15709
 		} );
13690 15710
 
13691
-		// Only after we got the offset, we can change the helper's position to absolute
15711
+		// After we get the helper offset, but before we get the parent offset we can
15712
+		// change the helper's position to absolute
13692 15713
 		// TODO: Still need to figure out a way to make relative sorting possible
13693 15714
 		this.helper.css( "position", "absolute" );
13694 15715
 		this.cssPosition = this.helper.css( "position" );
13695 15716
 
13696
-		//Generate the original position
13697
-		this.originalPosition = this._generatePosition(event);
13698
-		this.originalPageX = event.pageX;
13699
-		this.originalPageY = event.pageY;
13700
-
13701 15717
 		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
13702
-		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
15718
+		if ( o.cursorAt ) {
15719
+			this._adjustOffsetFromHelper( o.cursorAt );
15720
+		}
13703 15721
 
13704 15722
 		//Cache the former DOM position
13705
-		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
15723
+		this.domPosition = {
15724
+			prev: this.currentItem.prev()[ 0 ],
15725
+			parent: this.currentItem.parent()[ 0 ]
15726
+		};
13706 15727
 
13707
-		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
15728
+		// If the helper is not the original, hide the original so it's not playing any role during
15729
+		// the drag, won't cause anything bad this way
13708 15730
 		if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
13709 15731
 			this.currentItem.hide();
13710 15732
 		}
... ...
@@ -13712,6 +15734,13 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13712 15734
 		//Create the placeholder
13713 15735
 		this._createPlaceholder();
13714 15736
 
15737
+		//Get the next scrolling parent
15738
+		this.scrollParent = this.placeholder.scrollParent();
15739
+
15740
+		$.extend( this.offset, {
15741
+			parent: this._getParentOffset()
15742
+		} );
15743
+
13715 15744
 		//Set a containment if given in the options
13716 15745
 		if ( o.containment ) {
13717 15746
 			this._setContainment();
... ...
@@ -13720,20 +15749,17 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13720 15749
 		if ( o.cursor && o.cursor !== "auto" ) { // cursor option
13721 15750
 			body = this.document.find( "body" );
13722 15751
 
13723
-			// support: IE
15752
+			// Support: IE
13724 15753
 			this.storedCursor = body.css( "cursor" );
13725 15754
 			body.css( "cursor", o.cursor );
13726 15755
 
13727
-			this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
13728
-		}
13729
-
13730
-		if(o.opacity) { // opacity option
13731
-			if (this.helper.css("opacity")) {
13732
-				this._storedOpacity = this.helper.css("opacity");
13733
-			}
13734
-			this.helper.css("opacity", o.opacity);
15756
+			this.storedStylesheet =
15757
+				$( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body );
13735 15758
 		}
13736 15759
 
15760
+		// We need to make sure to grab the zIndex before setting the
15761
+		// opacity, because setting the opacity to anything lower than 1
15762
+		// causes the zIndex to change from "auto" to 0.
13737 15763
 		if ( o.zIndex ) { // zIndex option
13738 15764
 			if ( this.helper.css( "zIndex" ) ) {
13739 15765
 				this._storedZIndex = this.helper.css( "zIndex" );
... ...
@@ -13741,8 +15767,16 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13741 15767
 			this.helper.css( "zIndex", o.zIndex );
13742 15768
 		}
13743 15769
 
15770
+		if ( o.opacity ) { // opacity option
15771
+			if ( this.helper.css( "opacity" ) ) {
15772
+				this._storedOpacity = this.helper.css( "opacity" );
15773
+			}
15774
+			this.helper.css( "opacity", o.opacity );
15775
+		}
15776
+
13744 15777
 		//Prepare scrolling
13745
-		if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
15778
+		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
15779
+				this.scrollParent[ 0 ].tagName !== "HTML" ) {
13746 15780
 			this.overflowOffset = this.scrollParent.offset();
13747 15781
 		}
13748 15782
 
... ...
@@ -13773,63 +15806,84 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13773 15806
 
13774 15807
 		this.dragging = true;
13775 15808
 
13776
-		this.helper.addClass("ui-sortable-helper");
13777
-		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
15809
+		this._addClass( this.helper, "ui-sortable-helper" );
15810
+
15811
+		//Move the helper, if needed
15812
+		if ( !this.helper.parent().is( this.appendTo ) ) {
15813
+			this.helper.detach().appendTo( this.appendTo );
15814
+
15815
+			//Update position
15816
+			this.offset.parent = this._getParentOffset();
15817
+		}
15818
+
15819
+		//Generate the original position
15820
+		this.position = this.originalPosition = this._generatePosition( event );
15821
+		this.originalPageX = event.pageX;
15822
+		this.originalPageY = event.pageY;
15823
+		this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" );
15824
+
15825
+		this._mouseDrag( event );
15826
+
13778 15827
 		return true;
13779 15828
 
13780 15829
 	},
13781 15830
 
13782
-	_mouseDrag: function(event) {
13783
-		var i, item, itemElement, intersection,
13784
-			o = this.options,
15831
+	_scroll: function( event ) {
15832
+		var o = this.options,
13785 15833
 			scrolled = false;
13786 15834
 
13787
-		//Compute the helpers position
13788
-		this.position = this._generatePosition(event);
13789
-		this.positionAbs = this._convertPositionTo("absolute");
13790
-
13791
-		if (!this.lastPositionAbs) {
13792
-			this.lastPositionAbs = this.positionAbs;
13793
-		}
13794
-
13795
-		//Do scrolling
13796
-		if(this.options.scroll) {
13797
-			if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
15835
+		if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
15836
+				this.scrollParent[ 0 ].tagName !== "HTML" ) {
13798 15837
 
13799
-				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
13800
-					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
15838
+			if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) -
15839
+					event.pageY < o.scrollSensitivity ) {
15840
+				this.scrollParent[ 0 ].scrollTop =
15841
+					scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed;
13801 15842
 			} else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) {
13802
-					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
15843
+				this.scrollParent[ 0 ].scrollTop =
15844
+					scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed;
13803 15845
 			}
13804 15846
 
13805
-				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
13806
-					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
15847
+			if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) -
15848
+					event.pageX < o.scrollSensitivity ) {
15849
+				this.scrollParent[ 0 ].scrollLeft = scrolled =
15850
+					this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed;
13807 15851
 			} else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) {
13808
-					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
15852
+				this.scrollParent[ 0 ].scrollLeft = scrolled =
15853
+					this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed;
13809 15854
 			}
13810 15855
 
13811 15856
 		} else {
13812 15857
 
13813 15858
 			if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) {
13814 15859
 				scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed );
13815
-				} else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
15860
+			} else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) <
15861
+					o.scrollSensitivity ) {
13816 15862
 				scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed );
13817 15863
 			}
13818 15864
 
13819 15865
 			if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) {
13820
-					scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
13821
-				} else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
13822
-					scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
15866
+				scrolled = this.document.scrollLeft(
15867
+					this.document.scrollLeft() - o.scrollSpeed
15868
+				);
15869
+			} else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) <
15870
+					o.scrollSensitivity ) {
15871
+				scrolled = this.document.scrollLeft(
15872
+					this.document.scrollLeft() + o.scrollSpeed
15873
+				);
13823 15874
 			}
13824 15875
 
13825 15876
 		}
13826 15877
 
13827
-			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
13828
-				$.ui.ddmanager.prepareOffsets(this, event);
13829
-			}
13830
-		}
15878
+		return scrolled;
15879
+	},
15880
+
15881
+	_mouseDrag: function( event ) {
15882
+		var i, item, itemElement, intersection,
15883
+			o = this.options;
13831 15884
 
13832
-		//Regenerate the absolute position used for position checks
15885
+		//Compute the helpers position
15886
+		this.position = this._generatePosition( event );
13833 15887
 		this.positionAbs = this._convertPositionTo( "absolute" );
13834 15888
 
13835 15889
 		//Set the helper position
... ...
@@ -13840,6 +15894,24 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13840 15894
 			this.helper[ 0 ].style.top = this.position.top + "px";
13841 15895
 		}
13842 15896
 
15897
+		//Do scrolling
15898
+		if ( o.scroll ) {
15899
+			if ( this._scroll( event ) !== false ) {
15900
+
15901
+				//Update item positions used in position checks
15902
+				this._refreshItemPositions( true );
15903
+
15904
+				if ( $.ui.ddmanager && !o.dropBehaviour ) {
15905
+					$.ui.ddmanager.prepareOffsets( this, event );
15906
+				}
15907
+			}
15908
+		}
15909
+
15910
+		this.dragDirection = {
15911
+			vertical: this._getDragVerticalDirection(),
15912
+			horizontal: this._getDragHorizontalDirection()
15913
+		};
15914
+
13843 15915
 		//Rearrange
13844 15916
 		for ( i = this.items.length - 1; i >= 0; i-- ) {
13845 15917
 
... ...
@@ -13862,18 +15934,23 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13862 15934
 				continue;
13863 15935
 			}
13864 15936
 
13865
-			// cannot intersect with itself
15937
+			// Cannot intersect with itself
13866 15938
 			// no useless actions that have been done before
13867 15939
 			// no action if the item moved is the parent of the item checked
13868 15940
 			if ( itemElement !== this.currentItem[ 0 ] &&
13869
-				this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
15941
+				this.placeholder[ intersection === 1 ?
15942
+				"next" : "prev" ]()[ 0 ] !== itemElement &&
13870 15943
 				!$.contains( this.placeholder[ 0 ], itemElement ) &&
13871
-				(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
15944
+				( this.options.type === "semi-dynamic" ?
15945
+					!$.contains( this.element[ 0 ], itemElement ) :
15946
+					true
15947
+				)
13872 15948
 			) {
13873 15949
 
13874 15950
 				this.direction = intersection === 1 ? "down" : "up";
13875 15951
 
13876
-				if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
15952
+				if ( this.options.tolerance === "pointer" ||
15953
+						this._intersectsWithSides( item ) ) {
13877 15954
 					this._rearrange( event, item );
13878 15955
 				} else {
13879 15956
 					break;
... ...
@@ -13918,15 +15995,27 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13918 15995
 				animation = {};
13919 15996
 
13920 15997
 			if ( !axis || axis === "x" ) {
13921
-				animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
15998
+				animation.left = cur.left - this.offset.parent.left - this.margins.left +
15999
+					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
16000
+						0 :
16001
+						this.offsetParent[ 0 ].scrollLeft
16002
+					);
13922 16003
 			}
13923 16004
 			if ( !axis || axis === "y" ) {
13924
-				animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
16005
+				animation.top = cur.top - this.offset.parent.top - this.margins.top +
16006
+					( this.offsetParent[ 0 ] === this.document[ 0 ].body ?
16007
+						0 :
16008
+						this.offsetParent[ 0 ].scrollTop
16009
+					);
13925 16010
 			}
13926 16011
 			this.reverting = true;
13927
-			$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
16012
+			$( this.helper ).animate(
16013
+				animation,
16014
+				parseInt( this.options.revert, 10 ) || 500,
16015
+				function() {
13928 16016
 					that._clear( event );
13929
-			});
16017
+				}
16018
+			);
13930 16019
 		} else {
13931 16020
 			this._clear( event, noPropagation );
13932 16021
 		}
... ...
@@ -13939,10 +16028,11 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13939 16028
 
13940 16029
 		if ( this.dragging ) {
13941 16030
 
13942
-			this._mouseUp({ target: null });
16031
+			this._mouseUp( new $.Event( "mouseup", { target: null } ) );
13943 16032
 
13944 16033
 			if ( this.options.helper === "original" ) {
13945
-				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
16034
+				this.currentItem.css( this._storedCSS );
16035
+				this._removeClass( this.currentItem, "ui-sortable-helper" );
13946 16036
 			} else {
13947 16037
 				this.currentItem.show();
13948 16038
 			}
... ...
@@ -13959,11 +16049,14 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13959 16049
 		}
13960 16050
 
13961 16051
 		if ( this.placeholder ) {
13962
-			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
16052
+
16053
+			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
16054
+			// it unbinds ALL events from the original node!
13963 16055
 			if ( this.placeholder[ 0 ].parentNode ) {
13964 16056
 				this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
13965 16057
 			}
13966
-			if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
16058
+			if ( this.options.helper !== "original" && this.helper &&
16059
+					this.helper[ 0 ].parentNode ) {
13967 16060
 				this.helper.remove();
13968 16061
 			}
13969 16062
 
... ...
@@ -13992,9 +16085,12 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
13992 16085
 		o = o || {};
13993 16086
 
13994 16087
 		$( items ).each( function() {
13995
-			var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
16088
+			var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" )
16089
+				.match( o.expression || ( /(.+)[\-=_](.+)/ ) );
13996 16090
 			if ( res ) {
13997
-				str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
16091
+				str.push(
16092
+					( o.key || res[ 1 ] + "[]" ) +
16093
+					"=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) );
13998 16094
 			}
13999 16095
 		} );
14000 16096
 
... ...
@@ -14013,7 +16109,9 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14013 16109
 
14014 16110
 		o = o || {};
14015 16111
 
14016
-		items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
16112
+		items.each( function() {
16113
+			ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" );
16114
+		} );
14017 16115
 		return ret;
14018 16116
 
14019 16117
 	},
... ...
@@ -14031,13 +16129,17 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14031 16129
 			b = t + item.height,
14032 16130
 			dyClick = this.offset.click.top,
14033 16131
 			dxClick = this.offset.click.left,
14034
-			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
14035
-			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
16132
+			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t &&
16133
+				( y1 + dyClick ) < b ),
16134
+			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l &&
16135
+				( x1 + dxClick ) < r ),
14036 16136
 			isOverElement = isOverElementHeight && isOverElementWidth;
14037 16137
 
14038 16138
 		if ( this.options.tolerance === "pointer" ||
14039 16139
 			this.options.forcePointerForContainers ||
14040
-			(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
16140
+			( this.options.tolerance !== "pointer" &&
16141
+				this.helperProportions[ this.floating ? "width" : "height" ] >
16142
+				item[ this.floating ? "width" : "height" ] )
14041 16143
 		) {
14042 16144
 			return isOverElement;
14043 16145
 		} else {
... ...
@@ -14051,34 +16153,43 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14051 16153
 	},
14052 16154
 
14053 16155
 	_intersectsWithPointer: function( item ) {
14054
-
14055
-		var isOverElementHeight = (this.options.axis === "x") || this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
14056
-			isOverElementWidth = (this.options.axis === "y") || this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
14057
-			isOverElement = isOverElementHeight && isOverElementWidth,
14058
-			verticalDirection = this._getDragVerticalDirection(),
14059
-			horizontalDirection = this._getDragHorizontalDirection();
16156
+		var verticalDirection, horizontalDirection,
16157
+			isOverElementHeight = ( this.options.axis === "x" ) ||
16158
+				this._isOverAxis(
16159
+					this.positionAbs.top + this.offset.click.top, item.top, item.height ),
16160
+			isOverElementWidth = ( this.options.axis === "y" ) ||
16161
+				this._isOverAxis(
16162
+					this.positionAbs.left + this.offset.click.left, item.left, item.width ),
16163
+			isOverElement = isOverElementHeight && isOverElementWidth;
14060 16164
 
14061 16165
 		if ( !isOverElement ) {
14062 16166
 			return false;
14063 16167
 		}
14064 16168
 
16169
+		verticalDirection = this.dragDirection.vertical;
16170
+		horizontalDirection = this.dragDirection.horizontal;
16171
+
14065 16172
 		return this.floating ?
14066
-			( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
14067
-			: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
16173
+			( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) :
16174
+			( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) );
14068 16175
 
14069 16176
 	},
14070 16177
 
14071 16178
 	_intersectsWithSides: function( item ) {
14072 16179
 
14073
-		var isOverBottomHalf = this._isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
14074
-			isOverRightHalf = this._isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
14075
-			verticalDirection = this._getDragVerticalDirection(),
14076
-			horizontalDirection = this._getDragHorizontalDirection();
16180
+		var isOverBottomHalf = this._isOverAxis( this.positionAbs.top +
16181
+				this.offset.click.top, item.top + ( item.height / 2 ), item.height ),
16182
+			isOverRightHalf = this._isOverAxis( this.positionAbs.left +
16183
+				this.offset.click.left, item.left + ( item.width / 2 ), item.width ),
16184
+			verticalDirection = this.dragDirection.vertical,
16185
+			horizontalDirection = this.dragDirection.horizontal;
14077 16186
 
14078 16187
 		if ( this.floating && horizontalDirection ) {
14079
-			return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
16188
+			return ( ( horizontalDirection === "right" && isOverRightHalf ) ||
16189
+				( horizontalDirection === "left" && !isOverRightHalf ) );
14080 16190
 		} else {
14081
-			return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
16191
+			return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) ||
16192
+				( verticalDirection === "up" && !isOverBottomHalf ) );
14082 16193
 		}
14083 16194
 
14084 16195
 	},
... ...
@@ -14102,7 +16213,9 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14102 16213
 
14103 16214
 	_connectWith: function() {
14104 16215
 		var options = this.options;
14105
-		return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
16216
+		return options.connectWith.constructor === String ?
16217
+			[ options.connectWith ] :
16218
+			options.connectWith;
14106 16219
 	},
14107 16220
 
14108 16221
 	_getItemsAsjQuery: function( connected ) {
... ...
@@ -14118,13 +16231,22 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14118 16231
 				for ( j = cur.length - 1; j >= 0; j-- ) {
14119 16232
 					inst = $.data( cur[ j ], this.widgetFullName );
14120 16233
 					if ( inst && inst !== this && !inst.options.disabled ) {
14121
-						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
16234
+						queries.push( [ typeof inst.options.items === "function" ?
16235
+							inst.options.items.call( inst.element ) :
16236
+							$( inst.options.items, inst.element )
16237
+								.not( ".ui-sortable-helper" )
16238
+								.not( ".ui-sortable-placeholder" ), inst ] );
14122 16239
 					}
14123 16240
 				}
14124 16241
 			}
14125 16242
 		}
14126 16243
 
14127
-		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
16244
+		queries.push( [ typeof this.options.items === "function" ?
16245
+			this.options.items
16246
+				.call( this.element, null, { options: this.options, item: this.currentItem } ) :
16247
+			$( this.options.items, this.element )
16248
+				.not( ".ui-sortable-helper" )
16249
+				.not( ".ui-sortable-placeholder" ), this ] );
14128 16250
 
14129 16251
 		function addItems() {
14130 16252
 			items.push( this );
... ...
@@ -14159,16 +16281,22 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14159 16281
 
14160 16282
 		var i, j, cur, inst, targetData, _queries, item, queriesLength,
14161 16283
 			items = this.items,
14162
-			queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
16284
+			queries = [ [ typeof this.options.items === "function" ?
16285
+				this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) :
16286
+				$( this.options.items, this.element ), this ] ],
14163 16287
 			connectWith = this._connectWith();
14164 16288
 
14165
-		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
16289
+		//Shouldn't be run the first time through due to massive slow-down
16290
+		if ( connectWith && this.ready ) {
14166 16291
 			for ( i = connectWith.length - 1; i >= 0; i-- ) {
14167 16292
 				cur = $( connectWith[ i ], this.document[ 0 ] );
14168 16293
 				for ( j = cur.length - 1; j >= 0; j-- ) {
14169 16294
 					inst = $.data( cur[ j ], this.widgetFullName );
14170 16295
 					if ( inst && inst !== this && !inst.options.disabled ) {
14171
-						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
16296
+						queries.push( [ typeof inst.options.items === "function" ?
16297
+							inst.options.items
16298
+								.call( inst.element[ 0 ], event, { item: this.currentItem } ) :
16299
+							$( inst.options.items, inst.element ), inst ] );
14172 16300
 						this.containers.push( inst );
14173 16301
 					}
14174 16302
 				}
... ...
@@ -14182,7 +16310,8 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14182 16310
 			for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) {
14183 16311
 				item = $( _queries[ j ] );
14184 16312
 
14185
-				item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
16313
+				// Data for target checking (mouse manager)
16314
+				item.data( this.widgetName + "-item", targetData );
14186 16315
 
14187 16316
 				items.push( {
14188 16317
 					item: item,
... ...
@@ -14195,29 +16324,21 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14195 16324
 
14196 16325
 	},
14197 16326
 
14198
-	refreshPositions: function(fast) {
14199
-
14200
-		// Determine whether items are being displayed horizontally
14201
-		this.floating = this.items.length ?
14202
-			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
14203
-			false;
14204
-
14205
-		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
14206
-		if(this.offsetParent && this.helper) {
14207
-			this.offset.parent = this._getParentOffset();
14208
-		}
14209
-
16327
+	_refreshItemPositions: function( fast ) {
14210 16328
 		var i, item, t, p;
14211 16329
 
14212 16330
 		for ( i = this.items.length - 1; i >= 0; i-- ) {
14213 16331
 			item = this.items[ i ];
14214 16332
 
14215 16333
 			//We ignore calculating positions of all connected containers when we're not over them
14216
-			if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
16334
+			if ( this.currentContainer && item.instance !== this.currentContainer &&
16335
+					item.item[ 0 ] !== this.currentItem[ 0 ] ) {
14217 16336
 				continue;
14218 16337
 			}
14219 16338
 
14220
-			t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
16339
+			t = this.options.toleranceElement ?
16340
+				$( this.options.toleranceElement, item.item ) :
16341
+				item.item;
14221 16342
 
14222 16343
 			if ( !fast ) {
14223 16344
 				item.width = t.outerWidth();
... ...
@@ -14228,6 +16349,24 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14228 16349
 			item.left = p.left;
14229 16350
 			item.top = p.top;
14230 16351
 		}
16352
+	},
16353
+
16354
+	refreshPositions: function( fast ) {
16355
+
16356
+		// Determine whether items are being displayed horizontally
16357
+		this.floating = this.items.length ?
16358
+			this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
16359
+			false;
16360
+
16361
+		// This has to be redone because due to the item being moved out/into the offsetParent,
16362
+		// the offsetParent's position will change
16363
+		if ( this.offsetParent && this.helper ) {
16364
+			this.offset.parent = this._getParentOffset();
16365
+		}
16366
+
16367
+		this._refreshItemPositions( fast );
16368
+
16369
+		var i, p;
14231 16370
 
14232 16371
 		if ( this.options.custom && this.options.custom.refreshContainers ) {
14233 16372
 			this.options.custom.refreshContainers.call( this );
... ...
@@ -14236,8 +16375,10 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14236 16375
 				p = this.containers[ i ].element.offset();
14237 16376
 				this.containers[ i ].containerCache.left = p.left;
14238 16377
 				this.containers[ i ].containerCache.top = p.top;
14239
-				this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
14240
-				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
16378
+				this.containers[ i ].containerCache.width =
16379
+					this.containers[ i ].element.outerWidth();
16380
+				this.containers[ i ].containerCache.height =
16381
+					this.containers[ i ].element.outerHeight();
14241 16382
 			}
14242 16383
 		}
14243 16384
 
... ...
@@ -14246,18 +16387,20 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14246 16387
 
14247 16388
 	_createPlaceholder: function( that ) {
14248 16389
 		that = that || this;
14249
-		var className,
16390
+		var className, nodeName,
14250 16391
 			o = that.options;
14251 16392
 
14252 16393
 		if ( !o.placeholder || o.placeholder.constructor === String ) {
14253 16394
 			className = o.placeholder;
16395
+			nodeName = that.currentItem[ 0 ].nodeName.toLowerCase();
14254 16396
 			o.placeholder = {
14255 16397
 				element: function() {
14256 16398
 
14257
-					var nodeName = that.currentItem[0].nodeName.toLowerCase(),
14258
-						element = $( "<" + nodeName + ">", that.document[0] )
14259
-							.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
14260
-							.removeClass("ui-sortable-helper");
16399
+					var element = $( "<" + nodeName + ">", that.document[ 0 ] );
16400
+
16401
+					that._addClass( element, "ui-sortable-placeholder",
16402
+							className || that.currentItem[ 0 ].className )
16403
+						._removeClass( element, "ui-sortable-helper" );
14261 16404
 
14262 16405
 					if ( nodeName === "tbody" ) {
14263 16406
 						that._createTrPlaceholder(
... ...
@@ -14278,15 +16421,34 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14278 16421
 				},
14279 16422
 				update: function( container, p ) {
14280 16423
 
14281
-					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
14282
-					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
16424
+					// 1. If a className is set as 'placeholder option, we don't force sizes -
16425
+					// the class is responsible for that
16426
+					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a
16427
+					// class name is specified
14283 16428
 					if ( className && !o.forcePlaceholderSize ) {
14284 16429
 						return;
14285 16430
 					}
14286 16431
 
14287
-					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
14288
-					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
14289
-					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
16432
+					// If the element doesn't have a actual height or width by itself (without
16433
+					// styles coming from a stylesheet), it receives the inline height and width
16434
+					// from the dragged item. Or, if it's a tbody or tr, it's going to have a height
16435
+					// anyway since we're populating them with <td>s above, but they're unlikely to
16436
+					// be the correct height on their own if the row heights are dynamic, so we'll
16437
+					// always assign the height of the dragged item given forcePlaceholderSize
16438
+					// is true.
16439
+					if ( !p.height() || ( o.forcePlaceholderSize &&
16440
+							( nodeName === "tbody" || nodeName === "tr" ) ) ) {
16441
+						p.height(
16442
+							that.currentItem.innerHeight() -
16443
+							parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) -
16444
+							parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) );
16445
+					}
16446
+					if ( !p.width() ) {
16447
+						p.width(
16448
+							that.currentItem.innerWidth() -
16449
+							parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) -
16450
+							parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) );
16451
+					}
14290 16452
 				}
14291 16453
 			};
14292 16454
 		}
... ...
@@ -14313,22 +16475,26 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14313 16475
 	},
14314 16476
 
14315 16477
 	_contactContainers: function( event ) {
14316
-		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
16478
+		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom,
16479
+			floating, axis,
14317 16480
 			innermostContainer = null,
14318 16481
 			innermostIndex = null;
14319 16482
 
14320
-		// get innermost container that intersects with item
16483
+		// Get innermost container that intersects with item
14321 16484
 		for ( i = this.containers.length - 1; i >= 0; i-- ) {
14322 16485
 
14323
-			// never consider a container that's located within the item itself
16486
+			// Never consider a container that's located within the item itself
14324 16487
 			if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) {
14325 16488
 				continue;
14326 16489
 			}
14327 16490
 
14328 16491
 			if ( this._intersectsWith( this.containers[ i ].containerCache ) ) {
14329 16492
 
14330
-				// if we've already found a container and it's more "inner" than this, then continue
14331
-				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
16493
+				// If we've already found a container and it's more "inner" than this, then continue
16494
+				if ( innermostContainer &&
16495
+						$.contains(
16496
+							this.containers[ i ].element[ 0 ],
16497
+							innermostContainer.element[ 0 ] ) ) {
14332 16498
 					continue;
14333 16499
 				}
14334 16500
 
... ...
@@ -14345,12 +16512,12 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14345 16512
 
14346 16513
 		}
14347 16514
 
14348
-		// if no intersecting containers found, return
16515
+		// If no intersecting containers found, return
14349 16516
 		if ( !innermostContainer ) {
14350 16517
 			return;
14351 16518
 		}
14352 16519
 
14353
-		// move the item into the container if it's not there already
16520
+		// Move the item into the container if it's not there already
14354 16521
 		if ( this.containers.length === 1 ) {
14355 16522
 			if ( !this.containers[ innermostIndex ].containerCache.over ) {
14356 16523
 				this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
... ...
@@ -14358,16 +16525,19 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14358 16525
 			}
14359 16526
 		} else {
14360 16527
 
14361
-			//When entering a new container, we will find the item with the least distance and append our item near it
16528
+			// When entering a new container, we will find the item with the least distance and
16529
+			// append our item near it
14362 16530
 			dist = 10000;
14363 16531
 			itemWithLeastDistance = null;
14364 16532
 			floating = innermostContainer.floating || this._isFloating( this.currentItem );
14365 16533
 			posProperty = floating ? "left" : "top";
14366 16534
 			sizeProperty = floating ? "width" : "height";
14367
-			axis = floating ? "clientX" : "clientY";
16535
+			axis = floating ? "pageX" : "pageY";
14368 16536
 
14369 16537
 			for ( j = this.items.length - 1; j >= 0; j-- ) {
14370
-				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
16538
+				if ( !$.contains(
16539
+						this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] )
16540
+				) {
14371 16541
 					continue;
14372 16542
 				}
14373 16543
 				if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) {
... ...
@@ -14400,7 +16570,11 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14400 16570
 				return;
14401 16571
 			}
14402 16572
 
14403
-			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
16573
+			if ( itemWithLeastDistance ) {
16574
+				this._rearrange( event, itemWithLeastDistance, null, true );
16575
+			} else {
16576
+				this._rearrange( event, null, this.containers[ innermostIndex ].element, true );
16577
+			}
14404 16578
 			this._trigger( "change", event, this._uiHash() );
14405 16579
 			this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) );
14406 16580
 			this.currentContainer = this.containers[ innermostIndex ];
... ...
@@ -14408,6 +16582,15 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14408 16582
 			//Update the placeholder
14409 16583
 			this.options.placeholder.update( this.currentContainer, this.placeholder );
14410 16584
 
16585
+			//Update scrollParent
16586
+			this.scrollParent = this.placeholder.scrollParent();
16587
+
16588
+			//Update overflowOffset
16589
+			if ( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16590
+					this.scrollParent[ 0 ].tagName !== "HTML" ) {
16591
+				this.overflowOffset = this.scrollParent.offset();
16592
+			}
16593
+
14411 16594
 			this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) );
14412 16595
 			this.containers[ innermostIndex ].containerCache.over = 1;
14413 16596
 		}
... ...
@@ -14418,15 +16600,23 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14418 16600
 	_createHelper: function( event ) {
14419 16601
 
14420 16602
 		var o = this.options,
14421
-			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
16603
+			helper = typeof o.helper === "function" ?
16604
+				$( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) :
16605
+				( o.helper === "clone" ? this.currentItem.clone() : this.currentItem );
14422 16606
 
14423 16607
 		//Add the helper to the DOM if that didn't happen already
14424 16608
 		if ( !helper.parents( "body" ).length ) {
14425
-			$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
16609
+			this.appendTo[ 0 ].appendChild( helper[ 0 ] );
14426 16610
 		}
14427 16611
 
14428 16612
 		if ( helper[ 0 ] === this.currentItem[ 0 ] ) {
14429
-			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") };
16613
+			this._storedCSS = {
16614
+				width: this.currentItem[ 0 ].style.width,
16615
+				height: this.currentItem[ 0 ].style.height,
16616
+				position: this.currentItem.css( "position" ),
16617
+				top: this.currentItem.css( "top" ),
16618
+				left: this.currentItem.css( "left" )
16619
+			};
14430 16620
 		}
14431 16621
 
14432 16622
 		if ( !helper[ 0 ].style.width || o.forceHelperSize ) {
... ...
@@ -14444,7 +16634,7 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14444 16634
 		if ( typeof obj === "string" ) {
14445 16635
 			obj = obj.split( " " );
14446 16636
 		}
14447
-		if ($.isArray(obj)) {
16637
+		if ( Array.isArray( obj ) ) {
14448 16638
 			obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 };
14449 16639
 		}
14450 16640
 		if ( "left" in obj ) {
... ...
@@ -14468,18 +16657,24 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14468 16657
 		this.offsetParent = this.helper.offsetParent();
14469 16658
 		var po = this.offsetParent.offset();
14470 16659
 
14471
-		// This is a special case where we need to modify a offset calculated on start, since the following happened:
14472
-		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
14473
-		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
14474
-		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
14475
-		if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
16660
+		// This is a special case where we need to modify a offset calculated on start, since the
16661
+		// following happened:
16662
+		// 1. The position of the helper is absolute, so it's position is calculated based on the
16663
+		// next positioned parent
16664
+		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't
16665
+		// the document, which means that the scroll is included in the initial calculation of the
16666
+		// offset of the parent, and never recalculated upon drag
16667
+		if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16668
+				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) {
14476 16669
 			po.left += this.scrollParent.scrollLeft();
14477 16670
 			po.top += this.scrollParent.scrollTop();
14478 16671
 		}
14479 16672
 
14480
-		// This needs to be actually done for all browsers, since pageX/pageY includes this information
14481
-		// with an ugly IE fix
14482
-		if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
16673
+		// This needs to be actually done for all browsers, since pageX/pageY includes this
16674
+		// information with an ugly IE fix
16675
+		if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ||
16676
+				( this.offsetParent[ 0 ].tagName &&
16677
+				this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) {
14483 16678
 			po = { top: 0, left: 0 };
14484 16679
 		}
14485 16680
 
... ...
@@ -14495,8 +16690,10 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14495 16690
 		if ( this.cssPosition === "relative" ) {
14496 16691
 			var p = this.currentItem.position();
14497 16692
 			return {
14498
-				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
14499
-				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
16693
+				top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) +
16694
+					this.scrollParent.scrollTop(),
16695
+				left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) +
16696
+					this.scrollParent.scrollLeft()
14500 16697
 			};
14501 16698
 		} else {
14502 16699
 			return { top: 0, left: 0 };
... ...
@@ -14529,8 +16726,13 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14529 16726
 			this.containment = [
14530 16727
 				0 - this.offset.relative.left - this.offset.parent.left,
14531 16728
 				0 - this.offset.relative.top - this.offset.parent.top,
14532
-				o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
14533
-				(o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
16729
+				o.containment === "document" ?
16730
+					this.document.width() :
16731
+					this.window.width() - this.helperProportions.width - this.margins.left,
16732
+				( o.containment === "document" ?
16733
+					( this.document.height() || document.body.parentNode.scrollHeight ) :
16734
+					this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight
16735
+				) - this.helperProportions.height - this.margins.top
14534 16736
 			];
14535 16737
 		}
14536 16738
 
... ...
@@ -14540,10 +16742,18 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14540 16742
 			over = ( $( ce ).css( "overflow" ) !== "hidden" );
14541 16743
 
14542 16744
 			this.containment = [
14543
-				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
14544
-				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
14545
-				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
14546
-				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
16745
+				co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) +
16746
+					( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left,
16747
+				co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) +
16748
+					( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top,
16749
+				co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
16750
+					( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) -
16751
+					( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) -
16752
+					this.helperProportions.width - this.margins.left,
16753
+				co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
16754
+					( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) -
16755
+					( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) -
16756
+					this.helperProportions.height - this.margins.top
14547 16757
 			];
14548 16758
 		}
14549 16759
 
... ...
@@ -14555,21 +16765,41 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14555 16765
 			pos = this.position;
14556 16766
 		}
14557 16767
 		var mod = d === "absolute" ? 1 : -1,
14558
-			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
16768
+			scroll = this.cssPosition === "absolute" &&
16769
+				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16770
+				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
16771
+					this.offsetParent :
16772
+					this.scrollParent,
14559 16773
 			scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
14560 16774
 
14561 16775
 		return {
14562 16776
 			top: (
14563
-				pos.top	+																// The absolute mouse position
14564
-				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
14565
-				this.offset.parent.top * mod -											// The offsetParent's offset without borders (offset + border)
14566
-				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
16777
+
16778
+				// The absolute mouse position
16779
+				pos.top	+
16780
+
16781
+				// Only for relative positioned nodes: Relative offset from element to offset parent
16782
+				this.offset.relative.top * mod +
16783
+
16784
+				// The offsetParent's offset without borders (offset + border)
16785
+				this.offset.parent.top * mod -
16786
+				( ( this.cssPosition === "fixed" ?
16787
+					-this.scrollParent.scrollTop() :
16788
+					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod )
14567 16789
 			),
14568 16790
 			left: (
14569
-				pos.left +																// The absolute mouse position
14570
-				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
14571
-				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
14572
-				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
16791
+
16792
+				// The absolute mouse position
16793
+				pos.left +
16794
+
16795
+				// Only for relative positioned nodes: Relative offset from element to offset parent
16796
+				this.offset.relative.left * mod +
16797
+
16798
+				// The offsetParent's offset without borders (offset + border)
16799
+				this.offset.parent.left * mod	-
16800
+				( ( this.cssPosition === "fixed" ?
16801
+					-this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 :
16802
+					scroll.scrollLeft() ) * mod )
14573 16803
 			)
14574 16804
 		};
14575 16805
 
... ...
@@ -14581,13 +16811,19 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14581 16811
 			o = this.options,
14582 16812
 			pageX = event.pageX,
14583 16813
 			pageY = event.pageY,
14584
-			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
16814
+			scroll = this.cssPosition === "absolute" &&
16815
+				!( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16816
+				$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ?
16817
+					this.offsetParent :
16818
+					this.scrollParent,
16819
+				scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName );
14585 16820
 
14586 16821
 		// This is another very weird special case that only happens for relative elements:
14587 16822
 		// 1. If the css position is relative
14588 16823
 		// 2. and the scroll parent is the document or similar to the offset parent
14589 16824
 		// we have to refresh the relative offset during the scroll so there are no jumps
14590
-		if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
16825
+		if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] &&
16826
+				this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) {
14591 16827
 			this.offset.relative = this._getRelativeOffset();
14592 16828
 		}
14593 16829
 
... ...
@@ -14614,29 +16850,63 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14614 16850
 			}
14615 16851
 
14616 16852
 			if ( o.grid ) {
14617
-				top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
14618
-				pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
16853
+				top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) /
16854
+					o.grid[ 1 ] ) * o.grid[ 1 ];
16855
+				pageY = this.containment ?
16856
+					( ( top - this.offset.click.top >= this.containment[ 1 ] &&
16857
+						top - this.offset.click.top <= this.containment[ 3 ] ) ?
16858
+							top :
16859
+							( ( top - this.offset.click.top >= this.containment[ 1 ] ) ?
16860
+								top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) :
16861
+								top;
14619 16862
 
14620
-				left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
14621
-				pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
16863
+				left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) /
16864
+					o.grid[ 0 ] ) * o.grid[ 0 ];
16865
+				pageX = this.containment ?
16866
+					( ( left - this.offset.click.left >= this.containment[ 0 ] &&
16867
+						left - this.offset.click.left <= this.containment[ 2 ] ) ?
16868
+							left :
16869
+							( ( left - this.offset.click.left >= this.containment[ 0 ] ) ?
16870
+								left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) :
16871
+								left;
14622 16872
 			}
14623 16873
 
14624 16874
 		}
14625 16875
 
14626 16876
 		return {
14627 16877
 			top: (
14628
-				pageY -																// The absolute mouse position
14629
-				this.offset.click.top -													// Click offset (relative to the element)
14630
-				this.offset.relative.top	-											// Only for relative positioned nodes: Relative offset from element to offset parent
14631
-				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
14632
-				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
16878
+
16879
+				// The absolute mouse position
16880
+				pageY -
16881
+
16882
+				// Click offset (relative to the element)
16883
+				this.offset.click.top -
16884
+
16885
+				// Only for relative positioned nodes: Relative offset from element to offset parent
16886
+				this.offset.relative.top -
16887
+
16888
+				// The offsetParent's offset without borders (offset + border)
16889
+				this.offset.parent.top +
16890
+				( ( this.cssPosition === "fixed" ?
16891
+					-this.scrollParent.scrollTop() :
16892
+					( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) )
14633 16893
 			),
14634 16894
 			left: (
14635
-				pageX -																// The absolute mouse position
14636
-				this.offset.click.left -												// Click offset (relative to the element)
14637
-				this.offset.relative.left	-											// Only for relative positioned nodes: Relative offset from element to offset parent
14638
-				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
14639
-				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
16895
+
16896
+				// The absolute mouse position
16897
+				pageX -
16898
+
16899
+				// Click offset (relative to the element)
16900
+				this.offset.click.left -
16901
+
16902
+				// Only for relative positioned nodes: Relative offset from element to offset parent
16903
+				this.offset.relative.left -
16904
+
16905
+				// The offsetParent's offset without borders (offset + border)
16906
+				this.offset.parent.left +
16907
+				( ( this.cssPosition === "fixed" ?
16908
+					-this.scrollParent.scrollLeft() :
16909
+					scrollIsRootNode ? 0 : scroll.scrollLeft() ) )
14640 16910
 			)
14641 16911
 		};
14642 16912
 
... ...
@@ -14644,19 +16914,27 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14644 16914
 
14645 16915
 	_rearrange: function( event, i, a, hardRefresh ) {
14646 16916
 
14647
-		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
16917
+		if ( a ) {
16918
+			a[ 0 ].appendChild( this.placeholder[ 0 ] );
16919
+		} else {
16920
+			i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ],
16921
+				( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) );
16922
+		}
14648 16923
 
14649 16924
 		//Various things done here to improve the performance:
14650 16925
 		// 1. we create a setTimeout, that calls refreshPositions
14651 16926
 		// 2. on the instance, we have a counter variable, that get's higher after every append
14652
-		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
16927
+		// 3. on the local scope, we copy the counter variable, and check in the timeout,
16928
+		// if it's still the same
14653 16929
 		// 4. this lets only the last addition to the timeout stack through
14654 16930
 		this.counter = this.counter ? ++this.counter : 1;
14655 16931
 		var counter = this.counter;
14656 16932
 
14657 16933
 		this._delay( function() {
14658 16934
 			if ( counter === this.counter ) {
14659
-				this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
16935
+
16936
+				//Precompute after each DOM insertion, NOT on mousemove
16937
+				this.refreshPositions( !hardRefresh );
14660 16938
 			}
14661 16939
 		} );
14662 16940
 
... ...
@@ -14665,13 +16943,15 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14665 16943
 	_clear: function( event, noPropagation ) {
14666 16944
 
14667 16945
 		this.reverting = false;
14668
-		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
14669
-		// everything else normalized again
16946
+
16947
+		// We delay all events that have to be triggered to after the point where the placeholder
16948
+		// has been removed and everything else normalized again
14670 16949
 		var i,
14671 16950
 			delayedTriggers = [];
14672 16951
 
14673 16952
 		// We first have to update the dom position of the actual currentItem
14674
-		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
16953
+		// Note: don't do it if the current item is already removed (by a user), or it gets
16954
+		// reappended (see #4088)
14675 16955
 		if ( !this._noFinalSort && this.currentItem.parent().length ) {
14676 16956
 			this.placeholder.before( this.currentItem );
14677 16957
 		}
... ...
@@ -14683,25 +16963,45 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14683 16963
 					this._storedCSS[ i ] = "";
14684 16964
 				}
14685 16965
 			}
14686
-			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
16966
+			this.currentItem.css( this._storedCSS );
16967
+			this._removeClass( this.currentItem, "ui-sortable-helper" );
14687 16968
 		} else {
14688 16969
 			this.currentItem.show();
14689 16970
 		}
14690 16971
 
14691 16972
 		if ( this.fromOutside && !noPropagation ) {
14692
-			delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
16973
+			delayedTriggers.push( function( event ) {
16974
+				this._trigger( "receive", event, this._uiHash( this.fromOutside ) );
16975
+			} );
14693 16976
 		}
14694
-		if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
14695
-			delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
16977
+		if ( ( this.fromOutside ||
16978
+				this.domPosition.prev !==
16979
+				this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] ||
16980
+				this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) {
16981
+
16982
+			// Trigger update callback if the DOM position has changed
16983
+			delayedTriggers.push( function( event ) {
16984
+				this._trigger( "update", event, this._uiHash() );
16985
+			} );
14696 16986
 		}
14697 16987
 
14698 16988
 		// Check if the items Container has Changed and trigger appropriate
14699 16989
 		// events.
14700 16990
 		if ( this !== this.currentContainer ) {
14701 16991
 			if ( !noPropagation ) {
14702
-				delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
14703
-				delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
14704
-				delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
16992
+				delayedTriggers.push( function( event ) {
16993
+					this._trigger( "remove", event, this._uiHash() );
16994
+				} );
16995
+				delayedTriggers.push( ( function( c ) {
16996
+					return function( event ) {
16997
+						c._trigger( "receive", event, this._uiHash( this ) );
16998
+					};
16999
+				} ).call( this, this.currentContainer ) );
17000
+				delayedTriggers.push( ( function( c ) {
17001
+					return function( event ) {
17002
+						c._trigger( "update", event, this._uiHash( this ) );
17003
+					};
17004
+				} ).call( this, this.currentContainer ) );
14705 17005
 			}
14706 17006
 		}
14707 17007
 
... ...
@@ -14740,7 +17039,8 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14740 17039
 			this._trigger( "beforeStop", event, this._uiHash() );
14741 17040
 		}
14742 17041
 
14743
-		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
17042
+		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately,
17043
+		// it unbinds ALL events from the original node!
14744 17044
 		this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] );
14745 17045
 
14746 17046
 		if ( !this.cancelHelperRemoval ) {
... ...
@@ -14752,8 +17052,10 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14752 17052
 
14753 17053
 		if ( !noPropagation ) {
14754 17054
 			for ( i = 0; i < delayedTriggers.length; i++ ) {
17055
+
17056
+				// Trigger all delayed events
14755 17057
 				delayedTriggers[ i ].call( this, event );
14756
-			} //Trigger all delayed events
17058
+			}
14757 17059
 			this._trigger( "stop", event, this._uiHash() );
14758 17060
 		}
14759 17061
 
... ...
@@ -14785,18 +17087,25 @@ var sortable = $.widget("ui.sortable", $.ui.mouse, {
14785 17087
 
14786 17088
 
14787 17089
 /*!
14788
- * jQuery UI Spinner 1.11.4
17090
+ * jQuery UI Spinner 1.13.2
14789 17091
  * http://jqueryui.com
14790 17092
  *
14791 17093
  * Copyright jQuery Foundation and other contributors
14792 17094
  * Released under the MIT license.
14793 17095
  * http://jquery.org/license
14794
- *
14795
- * http://api.jqueryui.com/spinner/
14796 17096
  */
14797 17097
 
17098
+//>>label: Spinner
17099
+//>>group: Widgets
17100
+//>>description: Displays buttons to easily input numbers via the keyboard or mouse.
17101
+//>>docs: http://api.jqueryui.com/spinner/
17102
+//>>demos: http://jqueryui.com/spinner/
17103
+//>>css.structure: ../../themes/base/core.css
17104
+//>>css.structure: ../../themes/base/spinner.css
17105
+//>>css.theme: ../../themes/base/theme.css
17106
+
14798 17107
 
14799
-function spinner_modifier( fn ) {
17108
+function spinnerModifier( fn ) {
14800 17109
 	return function() {
14801 17110
 		var previous = this.element.val();
14802 17111
 		fn.apply( this, arguments );
... ...
@@ -14807,11 +17116,16 @@ function spinner_modifier( fn ) {
14807 17116
 	};
14808 17117
 }
14809 17118
 
14810
-var spinner = $.widget( "ui.spinner", {
14811
-	version: "1.11.4",
17119
+$.widget( "ui.spinner", {
17120
+	version: "1.13.2",
14812 17121
 	defaultElement: "<input>",
14813 17122
 	widgetEventPrefix: "spin",
14814 17123
 	options: {
17124
+		classes: {
17125
+			"ui-spinner": "ui-corner-all",
17126
+			"ui-spinner-down": "ui-corner-br",
17127
+			"ui-spinner-up": "ui-corner-tr"
17128
+		},
14815 17129
 		culture: null,
14816 17130
 		icons: {
14817 17131
 			down: "ui-icon-triangle-1-s",
... ...
@@ -14847,7 +17163,7 @@ var spinner = $.widget( "ui.spinner", {
14847 17163
 		this._on( this._events );
14848 17164
 		this._refresh();
14849 17165
 
14850
-		// turning off autocomplete prevents the browser from remembering the
17166
+		// Turning off autocomplete prevents the browser from remembering the
14851 17167
 		// value when navigating through history, so we re-enable autocomplete
14852 17168
 		// if the page is unloaded before the widget is destroyed. #7790
14853 17169
 		this._on( this.window, {
... ...
@@ -14858,12 +17174,12 @@ var spinner = $.widget( "ui.spinner", {
14858 17174
 	},
14859 17175
 
14860 17176
 	_getCreateOptions: function() {
14861
-		var options = {},
14862
-			element = this.element;
17177
+		var options = this._super();
17178
+		var element = this.element;
14863 17179
 
14864 17180
 		$.each( [ "min", "max", "step" ], function( i, option ) {
14865 17181
 			var value = element.attr( option );
14866
-			if ( value !== undefined && value.length ) {
17182
+			if ( value != null && value.length ) {
14867 17183
 				options[ option ] = value;
14868 17184
 			}
14869 17185
 		} );
... ...
@@ -14894,9 +17210,13 @@ var spinner = $.widget( "ui.spinner", {
14894 17210
 			}
14895 17211
 		},
14896 17212
 		mousewheel: function( event, delta ) {
14897
-			if ( !delta ) {
17213
+			var activeElement = $.ui.safeActiveElement( this.document[ 0 ] );
17214
+			var isActive = this.element[ 0 ] === activeElement;
17215
+
17216
+			if ( !isActive || !delta ) {
14898 17217
 				return;
14899 17218
 			}
17219
+
14900 17220
 			if ( !this.spinning && !this._start( event ) ) {
14901 17221
 				return false;
14902 17222
 			}
... ...
@@ -14918,13 +17238,14 @@ var spinner = $.widget( "ui.spinner", {
14918 17238
 			// If the input is focused then this.previous is properly set from
14919 17239
 			// when the input first received focus. If the input is not focused
14920 17240
 			// then we need to set this.previous based on the value before spinning.
14921
-			previous = this.element[0] === this.document[0].activeElement ?
17241
+			previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ?
14922 17242
 				this.previous : this.element.val();
14923 17243
 			function checkFocus() {
14924
-				var isActive = this.element[0] === this.document[0].activeElement;
17244
+				var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] );
14925 17245
 				if ( !isActive ) {
14926
-					this.element.focus();
17246
+					this.element.trigger( "focus" );
14927 17247
 					this.previous = previous;
17248
+
14928 17249
 					// support: IE
14929 17250
 					// IE sets focus asynchronously, so we need to check if focus
14930 17251
 					// moved off of the input because the user clicked on the button.
... ...
@@ -14934,11 +17255,11 @@ var spinner = $.widget( "ui.spinner", {
14934 17255
 				}
14935 17256
 			}
14936 17257
 
14937
-			// ensure focus is on (or stays on) the text field
17258
+			// Ensure focus is on (or stays on) the text field
14938 17259
 			event.preventDefault();
14939 17260
 			checkFocus.call( this );
14940 17261
 
14941
-			// support: IE
17262
+			// Support: IE
14942 17263
 			// IE doesn't prevent moving focus even with event.preventDefault()
14943 17264
 			// so we set a flag to know when we should ignore the blur event
14944 17265
 			// and check (again) if focus moved off of the input.
... ...
@@ -14952,7 +17273,8 @@ var spinner = $.widget( "ui.spinner", {
14952 17273
 				return;
14953 17274
 			}
14954 17275
 
14955
-			this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
17276
+			this._repeat( null, $( event.currentTarget )
17277
+				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14956 17278
 		},
14957 17279
 		"mouseup .ui-spinner-button": "_stop",
14958 17280
 		"mouseenter .ui-spinner-button": function( event ) {
... ...
@@ -14964,41 +17287,66 @@ var spinner = $.widget( "ui.spinner", {
14964 17287
 			if ( this._start( event ) === false ) {
14965 17288
 				return false;
14966 17289
 			}
14967
-			this._repeat( null, $( event.currentTarget ).hasClass( "ui-spinner-up" ) ? 1 : -1, event );
17290
+			this._repeat( null, $( event.currentTarget )
17291
+				.hasClass( "ui-spinner-up" ) ? 1 : -1, event );
14968 17292
 		},
17293
+
14969 17294
 		// TODO: do we really want to consider this a stop?
14970 17295
 		// shouldn't we just stop the repeater and wait until mouseup before
14971 17296
 		// we trigger the stop event?
14972 17297
 		"mouseleave .ui-spinner-button": "_stop"
14973 17298
 	},
14974 17299
 
14975
-	_draw: function() {
14976
-		var uiSpinner = this.uiSpinner = this.element
14977
-			.addClass( "ui-spinner-input" )
17300
+	// Support mobile enhanced option and make backcompat more sane
17301
+	_enhance: function() {
17302
+		this.uiSpinner = this.element
14978 17303
 			.attr( "autocomplete", "off" )
14979
-			.wrap( this._uiSpinnerHtml() )
17304
+			.wrap( "<span>" )
14980 17305
 			.parent()
14981
-				// add buttons
14982
-				.append( this._buttonHtml() );
17306
+
17307
+				// Add buttons
17308
+				.append(
17309
+					"<a></a><a></a>"
17310
+				);
17311
+	},
17312
+
17313
+	_draw: function() {
17314
+		this._enhance();
17315
+
17316
+		this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" );
17317
+		this._addClass( "ui-spinner-input" );
14983 17318
 
14984 17319
 		this.element.attr( "role", "spinbutton" );
14985 17320
 
14986
-		// button bindings
14987
-		this.buttons = uiSpinner.find( ".ui-spinner-button" )
17321
+		// Button bindings
17322
+		this.buttons = this.uiSpinner.children( "a" )
14988 17323
 			.attr( "tabIndex", -1 )
14989
-			.button()
14990
-			.removeClass( "ui-corner-all" );
17324
+			.attr( "aria-hidden", true )
17325
+			.button( {
17326
+				classes: {
17327
+					"ui-button": ""
17328
+				}
17329
+			} );
17330
+
17331
+		// TODO: Right now button does not support classes this is already updated in button PR
17332
+		this._removeClass( this.buttons, "ui-corner-all" );
17333
+
17334
+		this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" );
17335
+		this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" );
17336
+		this.buttons.first().button( {
17337
+			"icon": this.options.icons.up,
17338
+			"showLabel": false
17339
+		} );
17340
+		this.buttons.last().button( {
17341
+			"icon": this.options.icons.down,
17342
+			"showLabel": false
17343
+		} );
14991 17344
 
14992 17345
 		// IE 6 doesn't understand height: 50% for the buttons
14993 17346
 		// unless the wrapper has an explicit height
14994
-		if ( this.buttons.height() > Math.ceil( uiSpinner.height() * 0.5 ) &&
14995
-				uiSpinner.height() > 0 ) {
14996
-			uiSpinner.height( uiSpinner.height() );
14997
-		}
14998
-
14999
-		// disable spinner if element was already disabled
15000
-		if ( this.options.disabled ) {
15001
-			this.disable();
17347
+		if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) &&
17348
+				this.uiSpinner.height() > 0 ) {
17349
+			this.uiSpinner.height( this.uiSpinner.height() );
15002 17350
 		}
15003 17351
 	},
15004 17352
 
... ...
@@ -15024,20 +17372,6 @@ var spinner = $.widget( "ui.spinner", {
15024 17372
 		return false;
15025 17373
 	},
15026 17374
 
15027
-	_uiSpinnerHtml: function() {
15028
-		return "<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>";
15029
-	},
15030
-
15031
-	_buttonHtml: function() {
15032
-		return "" +
15033
-			"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'>" +
15034
-				"<span class='ui-icon " + this.options.icons.up + "'>&#9650;</span>" +
15035
-			"</a>" +
15036
-			"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>" +
15037
-				"<span class='ui-icon " + this.options.icons.down + "'>&#9660;</span>" +
15038
-			"</a>";
15039
-	},
15040
-
15041 17375
 	_start: function( event ) {
15042 17376
 		if ( !this.spinning && this._trigger( "start", event ) === false ) {
15043 17377
 			return false;
... ...
@@ -15080,7 +17414,7 @@ var spinner = $.widget( "ui.spinner", {
15080 17414
 		var incremental = this.options.incremental;
15081 17415
 
15082 17416
 		if ( incremental ) {
15083
-			return $.isFunction( incremental ) ?
17417
+			return typeof incremental === "function" ?
15084 17418
 				incremental( i ) :
15085 17419
 				Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 );
15086 17420
 		}
... ...
@@ -15106,7 +17440,7 @@ var spinner = $.widget( "ui.spinner", {
15106 17440
 		var base, aboveMin,
15107 17441
 			options = this.options;
15108 17442
 
15109
-		// make sure we're at a valid step
17443
+		// Make sure we're at a valid step
15110 17444
 		// - find out where we are relative to the base (min or 0)
15111 17445
 		base = options.min !== null ? options.min : 0;
15112 17446
 		aboveMin = value - base;
... ...
@@ -15115,10 +17451,10 @@ var spinner = $.widget( "ui.spinner", {
15115 17451
 		// - rounding is based on 0, so adjust back to our base
15116 17452
 		value = base + aboveMin;
15117 17453
 
15118
-		// fix precision from bad JS floating point math
17454
+		// Fix precision from bad JS floating point math
15119 17455
 		value = parseFloat( value.toFixed( this._precision() ) );
15120 17456
 
15121
-		// clamp the value
17457
+		// Clamp the value
15122 17458
 		if ( options.max !== null && value > options.max ) {
15123 17459
 			return options.max;
15124 17460
 		}
... ...
@@ -15142,8 +17478,10 @@ var spinner = $.widget( "ui.spinner", {
15142 17478
 	},
15143 17479
 
15144 17480
 	_setOption: function( key, value ) {
17481
+		var prevValue, first, last;
17482
+
15145 17483
 		if ( key === "culture" || key === "numberFormat" ) {
15146
-			var prevValue = this._parse( this.element.val() );
17484
+			prevValue = this._parse( this.element.val() );
15147 17485
 			this.options[ key ] = value;
15148 17486
 			this.element.val( this._format( prevValue ) );
15149 17487
 			return;
... ...
@@ -15155,24 +17493,26 @@ var spinner = $.widget( "ui.spinner", {
15155 17493
 			}
15156 17494
 		}
15157 17495
 		if ( key === "icons" ) {
15158
-			this.buttons.first().find( ".ui-icon" )
15159
-				.removeClass( this.options.icons.up )
15160
-				.addClass( value.up );
15161
-			this.buttons.last().find( ".ui-icon" )
15162
-				.removeClass( this.options.icons.down )
15163
-				.addClass( value.down );
17496
+			first = this.buttons.first().find( ".ui-icon" );
17497
+			this._removeClass( first, null, this.options.icons.up );
17498
+			this._addClass( first, null, value.up );
17499
+			last = this.buttons.last().find( ".ui-icon" );
17500
+			this._removeClass( last, null, this.options.icons.down );
17501
+			this._addClass( last, null, value.down );
15164 17502
 		}
15165 17503
 
15166 17504
 		this._super( key, value );
17505
+	},
15167 17506
 
15168
-		if ( key === "disabled" ) {
15169
-			this.widget().toggleClass( "ui-state-disabled", !!value );
17507
+	_setOptionDisabled: function( value ) {
17508
+		this._super( value );
17509
+
17510
+		this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value );
15170 17511
 		this.element.prop( "disabled", !!value );
15171 17512
 		this.buttons.button( value ? "disable" : "enable" );
15172
-		}
15173 17513
 	},
15174 17514
 
15175
-	_setOptions: spinner_modifier(function( options ) {
17515
+	_setOptions: spinnerModifier( function( options ) {
15176 17516
 		this._super( options );
15177 17517
 	} ),
15178 17518
 
... ...
@@ -15205,16 +17546,16 @@ var spinner = $.widget( "ui.spinner", {
15205 17546
 	isValid: function() {
15206 17547
 		var value = this.value();
15207 17548
 
15208
-		// null is invalid
17549
+		// Null is invalid
15209 17550
 		if ( value === null ) {
15210 17551
 			return false;
15211 17552
 		}
15212 17553
 
15213
-		// if value gets adjusted, it's invalid
17554
+		// If value gets adjusted, it's invalid
15214 17555
 		return value === this._adjustValue( value );
15215 17556
 	},
15216 17557
 
15217
-	// update the value without triggering change
17558
+	// Update the value without triggering change
15218 17559
 	_value: function( value, allowAny ) {
15219 17560
 		var parsed;
15220 17561
 		if ( value !== "" ) {
... ...
@@ -15232,17 +17573,13 @@ var spinner = $.widget( "ui.spinner", {
15232 17573
 
15233 17574
 	_destroy: function() {
15234 17575
 		this.element
15235
-			.removeClass( "ui-spinner-input" )
15236 17576
 			.prop( "disabled", false )
15237
-			.removeAttr( "autocomplete" )
15238
-			.removeAttr( "role" )
15239
-			.removeAttr( "aria-valuemin" )
15240
-			.removeAttr( "aria-valuemax" )
15241
-			.removeAttr( "aria-valuenow" );
17577
+			.removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" );
17578
+
15242 17579
 		this.uiSpinner.replaceWith( this.element );
15243 17580
 	},
15244 17581
 
15245
-	stepUp: spinner_modifier(function( steps ) {
17582
+	stepUp: spinnerModifier( function( steps ) {
15246 17583
 		this._stepUp( steps );
15247 17584
 	} ),
15248 17585
 	_stepUp: function( steps ) {
... ...
@@ -15252,7 +17589,7 @@ var spinner = $.widget( "ui.spinner", {
15252 17589
 		}
15253 17590
 	},
15254 17591
 
15255
-	stepDown: spinner_modifier(function( steps ) {
17592
+	stepDown: spinnerModifier( function( steps ) {
15256 17593
 		this._stepDown( steps );
15257 17594
 	} ),
15258 17595
 	_stepDown: function( steps ) {
... ...
@@ -15262,11 +17599,11 @@ var spinner = $.widget( "ui.spinner", {
15262 17599
 		}
15263 17600
 	},
15264 17601
 
15265
-	pageUp: spinner_modifier(function( pages ) {
17602
+	pageUp: spinnerModifier( function( pages ) {
15266 17603
 		this._stepUp( ( pages || 1 ) * this.options.page );
15267 17604
 	} ),
15268 17605
 
15269
-	pageDown: spinner_modifier(function( pages ) {
17606
+	pageDown: spinnerModifier( function( pages ) {
15270 17607
 		this._stepDown( ( pages || 1 ) * this.options.page );
15271 17608
 	} ),
15272 17609
 
... ...
@@ -15274,7 +17611,7 @@ var spinner = $.widget( "ui.spinner", {
15274 17611
 		if ( !arguments.length ) {
15275 17612
 			return this._parse( this.element.val() );
15276 17613
 		}
15277
-		spinner_modifier( this._value ).call( this, newVal );
17614
+		spinnerModifier( this._value ).call( this, newVal );
15278 17615
 	},
15279 17616
 
15280 17617
 	widget: function() {
... ...
@@ -15282,31 +17619,71 @@ var spinner = $.widget( "ui.spinner", {
15282 17619
 	}
15283 17620
 } );
15284 17621
 
17622
+// DEPRECATED
17623
+// TODO: switch return back to widget declaration at top of file when this is removed
17624
+if ( $.uiBackCompat !== false ) {
17625
+
17626
+	// Backcompat for spinner html extension points
17627
+	$.widget( "ui.spinner", $.ui.spinner, {
17628
+		_enhance: function() {
17629
+			this.uiSpinner = this.element
17630
+				.attr( "autocomplete", "off" )
17631
+				.wrap( this._uiSpinnerHtml() )
17632
+				.parent()
17633
+
17634
+					// Add buttons
17635
+					.append( this._buttonHtml() );
17636
+		},
17637
+		_uiSpinnerHtml: function() {
17638
+			return "<span>";
17639
+		},
17640
+
17641
+		_buttonHtml: function() {
17642
+			return "<a></a><a></a>";
17643
+		}
17644
+	} );
17645
+}
17646
+
17647
+var widgetsSpinner = $.ui.spinner;
17648
+
15285 17649
 
15286 17650
 /*!
15287
- * jQuery UI Tabs 1.11.4
17651
+ * jQuery UI Tabs 1.13.2
15288 17652
  * http://jqueryui.com
15289 17653
  *
15290 17654
  * Copyright jQuery Foundation and other contributors
15291 17655
  * Released under the MIT license.
15292 17656
  * http://jquery.org/license
15293
- *
15294
- * http://api.jqueryui.com/tabs/
15295 17657
  */
15296 17658
 
17659
+//>>label: Tabs
17660
+//>>group: Widgets
17661
+//>>description: Transforms a set of container elements into a tab structure.
17662
+//>>docs: http://api.jqueryui.com/tabs/
17663
+//>>demos: http://jqueryui.com/tabs/
17664
+//>>css.structure: ../../themes/base/core.css
17665
+//>>css.structure: ../../themes/base/tabs.css
17666
+//>>css.theme: ../../themes/base/theme.css
15297 17667
 
15298
-var tabs = $.widget( "ui.tabs", {
15299
-	version: "1.11.4",
17668
+
17669
+$.widget( "ui.tabs", {
17670
+	version: "1.13.2",
15300 17671
 	delay: 300,
15301 17672
 	options: {
15302 17673
 		active: null,
17674
+		classes: {
17675
+			"ui-tabs": "ui-corner-all",
17676
+			"ui-tabs-nav": "ui-corner-all",
17677
+			"ui-tabs-panel": "ui-corner-bottom",
17678
+			"ui-tabs-tab": "ui-corner-top"
17679
+		},
15303 17680
 		collapsible: false,
15304 17681
 		event: "click",
15305 17682
 		heightStyle: "content",
15306 17683
 		hide: null,
15307 17684
 		show: null,
15308 17685
 
15309
-		// callbacks
17686
+		// Callbacks
15310 17687
 		activate: null,
15311 17688
 		beforeActivate: null,
15312 17689
 		beforeLoad: null,
... ...
@@ -15319,14 +17696,10 @@ var tabs = $.widget( "ui.tabs", {
15319 17696
 		return function( anchor ) {
15320 17697
 			var anchorUrl, locationUrl;
15321 17698
 
15322
-			// support: IE7
15323
-			// IE7 doesn't normalize the href property when set via script (#9317)
15324
-			anchor = anchor.cloneNode( false );
15325
-
15326 17699
 			anchorUrl = anchor.href.replace( rhash, "" );
15327 17700
 			locationUrl = location.href.replace( rhash, "" );
15328 17701
 
15329
-			// decoding may throw an error if the URL isn't UTF-8 (#9518)
17702
+			// Decoding may throw an error if the URL isn't UTF-8 (#9518)
15330 17703
 			try {
15331 17704
 				anchorUrl = decodeURIComponent( anchorUrl );
15332 17705
 			} catch ( error ) {}
... ...
@@ -15344,24 +17717,23 @@ var tabs = $.widget( "ui.tabs", {
15344 17717
 
15345 17718
 		this.running = false;
15346 17719
 
15347
-		this.element
15348
-			.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" )
15349
-			.toggleClass( "ui-tabs-collapsible", options.collapsible );
17720
+		this._addClass( "ui-tabs", "ui-widget ui-widget-content" );
17721
+		this._toggleClass( "ui-tabs-collapsible", null, options.collapsible );
15350 17722
 
15351 17723
 		this._processTabs();
15352 17724
 		options.active = this._initialActive();
15353 17725
 
15354 17726
 		// Take disabling tabs via class attribute from HTML
15355 17727
 		// into account and update option properly.
15356
-		if ( $.isArray( options.disabled ) ) {
15357
-			options.disabled = $.unique( options.disabled.concat(
17728
+		if ( Array.isArray( options.disabled ) ) {
17729
+			options.disabled = $.uniqueSort( options.disabled.concat(
15358 17730
 				$.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) {
15359 17731
 					return that.tabs.index( li );
15360 17732
 				} )
15361 17733
 			) ).sort();
15362 17734
 		}
15363 17735
 
15364
-		// check for length avoids error when initializing empty list
17736
+		// Check for length avoids error when initializing empty list
15365 17737
 		if ( this.options.active !== false && this.anchors.length ) {
15366 17738
 			this.active = this._findActive( options.active );
15367 17739
 		} else {
... ...
@@ -15391,18 +17764,18 @@ var tabs = $.widget( "ui.tabs", {
15391 17764
 				} );
15392 17765
 			}
15393 17766
 
15394
-			// check for a tab marked active via a class
17767
+			// Check for a tab marked active via a class
15395 17768
 			if ( active === null ) {
15396 17769
 				active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) );
15397 17770
 			}
15398 17771
 
15399
-			// no active tab, set to false
17772
+			// No active tab, set to false
15400 17773
 			if ( active === null || active === -1 ) {
15401 17774
 				active = this.tabs.length ? 0 : false;
15402 17775
 			}
15403 17776
 		}
15404 17777
 
15405
-		// handle numbers: negative, out of range
17778
+		// Handle numbers: negative, out of range
15406 17779
 		if ( active !== false ) {
15407 17780
 			active = this.tabs.index( this.tabs.eq( active ) );
15408 17781
 			if ( active === -1 ) {
... ...
@@ -15410,7 +17783,7 @@ var tabs = $.widget( "ui.tabs", {
15410 17783
 			}
15411 17784
 		}
15412 17785
 
15413
-		// don't allow collapsible: false and active: false
17786
+		// Don't allow collapsible: false and active: false
15414 17787
 		if ( !collapsible && active === false && this.anchors.length ) {
15415 17788
 			active = 0;
15416 17789
 		}
... ...
@@ -15426,7 +17799,7 @@ var tabs = $.widget( "ui.tabs", {
15426 17799
 	},
15427 17800
 
15428 17801
 	_tabKeydown: function( event ) {
15429
-		var focusedTab = $( this.document[0].activeElement ).closest( "li" ),
17802
+		var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ),
15430 17803
 			selectedIndex = this.tabs.index( focusedTab ),
15431 17804
 			goingForward = true;
15432 17805
 
... ...
@@ -15495,7 +17871,7 @@ var tabs = $.widget( "ui.tabs", {
15495 17871
 		// Ctrl+up moves focus to the current tab
15496 17872
 		if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) {
15497 17873
 			event.preventDefault();
15498
-			this.active.focus();
17874
+			this.active.trigger( "focus" );
15499 17875
 		}
15500 17876
 	},
15501 17877
 
... ...
@@ -15533,7 +17909,7 @@ var tabs = $.widget( "ui.tabs", {
15533 17909
 
15534 17910
 	_focusNextTab: function( index, goingForward ) {
15535 17911
 		index = this._findNextTab( index, goingForward );
15536
-		this.tabs.eq( index ).focus();
17912
+		this.tabs.eq( index ).trigger( "focus" );
15537 17913
 		return index;
15538 17914
 	},
15539 17915
 
... ...
@@ -15544,16 +17921,11 @@ var tabs = $.widget( "ui.tabs", {
15544 17921
 			return;
15545 17922
 		}
15546 17923
 
15547
-		if ( key === "disabled" ) {
15548
-			// don't use the widget factory's disabled handling
15549
-			this._setupDisabled( value );
15550
-			return;
15551
-		}
15552
-
15553 17924
 		this._super( key, value );
15554 17925
 
15555 17926
 		if ( key === "collapsible" ) {
15556
-			this.element.toggleClass( "ui-tabs-collapsible", value );
17927
+			this._toggleClass( "ui-tabs-collapsible", null, value );
17928
+
15557 17929
 			// Setting collapsible: false while collapsed; open first panel
15558 17930
 			if ( !value && this.options.active === false ) {
15559 17931
 				this._activate( 0 );
... ...
@@ -15577,7 +17949,7 @@ var tabs = $.widget( "ui.tabs", {
15577 17949
 		var options = this.options,
15578 17950
 			lis = this.tablist.children( ":has(a[href])" );
15579 17951
 
15580
-		// get disabled tabs from class attribute from HTML
17952
+		// Get disabled tabs from class attribute from HTML
15581 17953
 		// this will get converted to a boolean if needed in _refresh()
15582 17954
 		options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) {
15583 17955
 			return lis.index( tab );
... ...
@@ -15585,7 +17957,7 @@ var tabs = $.widget( "ui.tabs", {
15585 17957
 
15586 17958
 		this._processTabs();
15587 17959
 
15588
-		// was collapsed or no tabs
17960
+		// Was collapsed or no tabs
15589 17961
 		if ( options.active === false || !this.anchors.length ) {
15590 17962
 			options.active = false;
15591 17963
 			this.active = $();
... ...
@@ -15609,7 +17986,7 @@ var tabs = $.widget( "ui.tabs", {
15609 17986
 	},
15610 17987
 
15611 17988
 	_refresh: function() {
15612
-		this._setupDisabled( this.options.disabled );
17989
+		this._setOptionDisabled( this.options.disabled );
15613 17990
 		this._setupEvents( this.options.event );
15614 17991
 		this._setupHeightStyle( this.options.heightStyle );
15615 17992
 
... ...
@@ -15629,12 +18006,12 @@ var tabs = $.widget( "ui.tabs", {
15629 18006
 			this.tabs.eq( 0 ).attr( "tabIndex", 0 );
15630 18007
 		} else {
15631 18008
 			this.active
15632
-				.addClass( "ui-tabs-active ui-state-active" )
15633 18009
 				.attr( {
15634 18010
 					"aria-selected": "true",
15635 18011
 					"aria-expanded": "true",
15636 18012
 					tabIndex: 0
15637 18013
 				} );
18014
+			this._addClass( this.active, "ui-tabs-active", "ui-state-active" );
15638 18015
 			this._getPanelForTab( this.active )
15639 18016
 				.show()
15640 18017
 				.attr( {
... ...
@@ -15649,44 +18026,44 @@ var tabs = $.widget( "ui.tabs", {
15649 18026
 			prevAnchors = this.anchors,
15650 18027
 			prevPanels = this.panels;
15651 18028
 
15652
-		this.tablist = this._getList()
15653
-			.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
15654
-			.attr( "role", "tablist" )
18029
+		this.tablist = this._getList().attr( "role", "tablist" );
18030
+		this._addClass( this.tablist, "ui-tabs-nav",
18031
+			"ui-helper-reset ui-helper-clearfix ui-widget-header" );
15655 18032
 
15656 18033
 		// Prevent users from focusing disabled tabs via click
15657
-			.delegate( "> li", "mousedown" + this.eventNamespace, function( event ) {
18034
+		this.tablist
18035
+			.on( "mousedown" + this.eventNamespace, "> li", function( event ) {
15658 18036
 				if ( $( this ).is( ".ui-state-disabled" ) ) {
15659 18037
 					event.preventDefault();
15660 18038
 				}
15661 18039
 			} )
15662 18040
 
15663
-			// support: IE <9
18041
+			// Support: IE <9
15664 18042
 			// Preventing the default action in mousedown doesn't prevent IE
15665 18043
 			// from focusing the element, so if the anchor gets focused, blur.
15666 18044
 			// We don't have to worry about focusing the previously focused
15667 18045
 			// element since clicking on a non-focusable element should focus
15668 18046
 			// the body anyway.
15669
-			.delegate( ".ui-tabs-anchor", "focus" + this.eventNamespace, function() {
18047
+			.on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() {
15670 18048
 				if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) {
15671 18049
 					this.blur();
15672 18050
 				}
15673 18051
 			} );
15674 18052
 
15675 18053
 		this.tabs = this.tablist.find( "> li:has(a[href])" )
15676
-			.addClass( "ui-state-default ui-corner-top" )
15677 18054
 			.attr( {
15678 18055
 				role: "tab",
15679 18056
 				tabIndex: -1
15680 18057
 			} );
18058
+		this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" );
15681 18059
 
15682 18060
 		this.anchors = this.tabs.map( function() {
15683 18061
 			return $( "a", this )[ 0 ];
15684 18062
 		} )
15685
-			.addClass( "ui-tabs-anchor" )
15686 18063
 			.attr( {
15687
-				role: "presentation",
15688 18064
 				tabIndex: -1
15689 18065
 			} );
18066
+		this._addClass( this.anchors, "ui-tabs-anchor" );
15690 18067
 
15691 18068
 		this.panels = $();
15692 18069
 
... ...
@@ -15696,7 +18073,7 @@ var tabs = $.widget( "ui.tabs", {
15696 18073
 				tab = $( anchor ).closest( "li" ),
15697 18074
 				originalAriaControls = tab.attr( "aria-controls" );
15698 18075
 
15699
-			// inline tab
18076
+			// Inline tab
15700 18077
 			if ( that._isLocal( anchor ) ) {
15701 18078
 				selector = anchor.hash;
15702 18079
 				panelId = selector.substring( 1 );
... ...
@@ -15728,9 +18107,8 @@ var tabs = $.widget( "ui.tabs", {
15728 18107
 			panel.attr( "aria-labelledby", anchorId );
15729 18108
 		} );
15730 18109
 
15731
-		this.panels
15732
-			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
15733
-			.attr( "role", "tabpanel" );
18110
+		this.panels.attr( "role", "tabpanel" );
18111
+		this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" );
15734 18112
 
15735 18113
 		// Avoid memory leaks (#10056)
15736 18114
 		if ( prevTabs ) {
... ...
@@ -15740,7 +18118,7 @@ var tabs = $.widget( "ui.tabs", {
15740 18118
 		}
15741 18119
 	},
15742 18120
 
15743
-	// allow overriding how to find the list for rare usage scenarios (#7715)
18121
+	// Allow overriding how to find the list for rare usage scenarios (#7715)
15744 18122
 	_getList: function() {
15745 18123
 		return this.tablist || this.element.find( "ol, ul" ).eq( 0 );
15746 18124
 	},
... ...
@@ -15748,12 +18126,13 @@ var tabs = $.widget( "ui.tabs", {
15748 18126
 	_createPanel: function( id ) {
15749 18127
 		return $( "<div>" )
15750 18128
 			.attr( "id", id )
15751
-			.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
15752 18129
 			.data( "ui-tabs-destroy", true );
15753 18130
 	},
15754 18131
 
15755
-	_setupDisabled: function( disabled ) {
15756
-		if ( $.isArray( disabled ) ) {
18132
+	_setOptionDisabled: function( disabled ) {
18133
+		var currentItem, li, i;
18134
+
18135
+		if ( Array.isArray( disabled ) ) {
15757 18136
 			if ( !disabled.length ) {
15758 18137
 				disabled = false;
15759 18138
 			} else if ( disabled.length === this.anchors.length ) {
... ...
@@ -15761,20 +18140,22 @@ var tabs = $.widget( "ui.tabs", {
15761 18140
 			}
15762 18141
 		}
15763 18142
 
15764
-		// disable tabs
15765
-		for ( var i = 0, li; ( li = this.tabs[ i ] ); i++ ) {
18143
+		// Disable tabs
18144
+		for ( i = 0; ( li = this.tabs[ i ] ); i++ ) {
18145
+			currentItem = $( li );
15766 18146
 			if ( disabled === true || $.inArray( i, disabled ) !== -1 ) {
15767
-				$( li )
15768
-					.addClass( "ui-state-disabled" )
15769
-					.attr( "aria-disabled", "true" );
18147
+				currentItem.attr( "aria-disabled", "true" );
18148
+				this._addClass( currentItem, null, "ui-state-disabled" );
15770 18149
 			} else {
15771
-				$( li )
15772
-					.removeClass( "ui-state-disabled" )
15773
-					.removeAttr( "aria-disabled" );
18150
+				currentItem.removeAttr( "aria-disabled" );
18151
+				this._removeClass( currentItem, null, "ui-state-disabled" );
15774 18152
 			}
15775 18153
 		}
15776 18154
 
15777 18155
 		this.options.disabled = disabled;
18156
+
18157
+		this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null,
18158
+			disabled === true );
15778 18159
 	},
15779 18160
 
15780 18161
 	_setupEvents: function( event ) {
... ...
@@ -15882,7 +18268,7 @@ var tabs = $.widget( "ui.tabs", {
15882 18268
 		this._toggle( event, eventData );
15883 18269
 	},
15884 18270
 
15885
-	// handles show/hide for selecting tabs
18271
+	// Handles show/hide for selecting tabs
15886 18272
 	_toggle: function( event, eventData ) {
15887 18273
 		var that = this,
15888 18274
 			toShow = eventData.newPanel,
... ...
@@ -15896,7 +18282,7 @@ var tabs = $.widget( "ui.tabs", {
15896 18282
 		}
15897 18283
 
15898 18284
 		function show() {
15899
-			eventData.newTab.closest( "li" ).addClass( "ui-tabs-active ui-state-active" );
18285
+			that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" );
15900 18286
 
15901 18287
 			if ( toShow.length && that.options.show ) {
15902 18288
 				that._show( toShow, that.options.show, complete );
... ...
@@ -15906,14 +18292,16 @@ var tabs = $.widget( "ui.tabs", {
15906 18292
 			}
15907 18293
 		}
15908 18294
 
15909
-		// start out by hiding, then showing, then completing
18295
+		// Start out by hiding, then showing, then completing
15910 18296
 		if ( toHide.length && this.options.hide ) {
15911 18297
 			this._hide( toHide, this.options.hide, function() {
15912
-				eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
18298
+				that._removeClass( eventData.oldTab.closest( "li" ),
18299
+					"ui-tabs-active", "ui-state-active" );
15913 18300
 				show();
15914 18301
 			} );
15915 18302
 		} else {
15916
-			eventData.oldTab.closest( "li" ).removeClass( "ui-tabs-active ui-state-active" );
18303
+			this._removeClass( eventData.oldTab.closest( "li" ),
18304
+				"ui-tabs-active", "ui-state-active" );
15917 18305
 			toHide.hide();
15918 18306
 			show();
15919 18307
 		}
... ...
@@ -15947,12 +18336,12 @@ var tabs = $.widget( "ui.tabs", {
15947 18336
 		var anchor,
15948 18337
 			active = this._findActive( index );
15949 18338
 
15950
-		// trying to activate the already active panel
18339
+		// Trying to activate the already active panel
15951 18340
 		if ( active[ 0 ] === this.active[ 0 ] ) {
15952 18341
 			return;
15953 18342
 		}
15954 18343
 
15955
-		// trying to collapse, simulate a click on the current active header
18344
+		// Trying to collapse, simulate a click on the current active header
15956 18345
 		if ( !active.length ) {
15957 18346
 			active = this.active;
15958 18347
 		}
15959 18348
@@ -15970,9 +1835