summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@vdwaa.nl>2018-11-19 14:03:46 +0100
committerJelle van der Waa <jelle@archlinux.org>2019-02-18 16:42:51 +0100
commit6b22bedd82ae69a54f15c2f5f64f9f3945e5fb43 (patch)
treed6beb6d935d35e1915e06b35df0682eef729ae70
parent37a51bc78902a213dde155a76a9fa290cd776fd7 (diff)
downloadarchweb-6b22bedd82ae69a54f15c2f5f64f9f3945e5fb43.tar.gz
archweb-6b22bedd82ae69a54f15c2f5f64f9f3945e5fb43.zip
sitestatic: Update jQuery and tablesorter
-rw-r--r--main/templatetags/cdn.py4
-rw-r--r--sitestatic/jquery-1.8.3.min.js2
-rw-r--r--sitestatic/jquery-3.3.1.min.js2
-rw-r--r--sitestatic/jquery.tablesorter-2.31.0.js2914
-rw-r--r--sitestatic/jquery.tablesorter-2.31.0.min.js1
-rw-r--r--sitestatic/jquery.tablesorter-2.7.js1374
-rw-r--r--sitestatic/jquery.tablesorter-2.7.min.js5
7 files changed, 2919 insertions, 1383 deletions
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index 2439cfb2..c0ce83d8 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -8,7 +8,7 @@ register = template.Library()
@register.simple_tag
def jquery():
- version = '1.8.3'
+ version = '3.3.1'
filename = 'jquery-%s.min.js' % version
link = staticfiles_storage.url(filename)
return mark_safe('<script type="text/javascript" src="%s"></script>' % link)
@@ -16,7 +16,7 @@ def jquery():
@register.simple_tag
def jquery_tablesorter():
- version = '2.7'
+ version = '2.31.0'
filename = 'jquery.tablesorter-%s.min.js' % version
link = staticfiles_storage.url(filename)
return format_html('<script type="text/javascript" src="%s"></script>' % link)
diff --git a/sitestatic/jquery-1.8.3.min.js b/sitestatic/jquery-1.8.3.min.js
deleted file mode 100644
index 83589daa..00000000
--- a/sitestatic/jquery-1.8.3.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery v1.8.3 jquery.com | jquery.org/license */
-(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.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(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.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):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file
diff --git a/sitestatic/jquery-3.3.1.min.js b/sitestatic/jquery-3.3.1.min.js
new file mode 100644
index 00000000..4d9b3a25
--- /dev/null
+++ b/sitestatic/jquery-3.3.1.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
+!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(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.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||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+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]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(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},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.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=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),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("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(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 fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){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[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.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},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.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"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.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},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(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?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,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(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===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]||oe.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]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(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(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!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!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.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:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(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 Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.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&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(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},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(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[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(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(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.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&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.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=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.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 le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={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,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;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&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}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"===x(o))w.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]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,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}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(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=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.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)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.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&&e.button>=1))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?w(i,this).index(l)>-1:w.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(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,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&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.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,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:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(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=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.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 Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(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&&(w.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 w.clone(this,e,t)})},html:function(e){return z(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&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.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}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(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+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,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:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.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=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.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=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.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):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.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=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(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=J.get(e,"fxshow");n.queue||(null==(a=w._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--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.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]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.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;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.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(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.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=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(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(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.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=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.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)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.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||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(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]}function Ut(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}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,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":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(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(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.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 w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.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"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.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,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.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)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
diff --git a/sitestatic/jquery.tablesorter-2.31.0.js b/sitestatic/jquery.tablesorter-2.31.0.js
new file mode 100644
index 00000000..5cd99745
--- /dev/null
+++ b/sitestatic/jquery.tablesorter-2.31.0.js
@@ -0,0 +1,2914 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+/*! TableSorter (FORK) v2.31.0 *//*
+* Client-side table sorting with ease!
+* @requires jQuery v1.2.6+
+*
+* Copyright (c) 2007 Christian Bach
+* fork maintained by Rob Garrison
+*
+* Examples and original docs at: http://tablesorter.com
+* Dual licensed under the MIT and GPL licenses:
+* http://www.opensource.org/licenses/mit-license.php
+* http://www.gnu.org/licenses/gpl.html
+*
+* @type jQuery
+* @name tablesorter (FORK)
+* @cat Plugins/Tablesorter
+* @author Christian Bach - christian.bach@polyester.se
+* @contributor Rob Garrison - https://github.com/Mottie/tablesorter
+* @docs (fork) - https://mottie.github.io/tablesorter/docs/
+*/
+/*jshint browser:true, jquery:true, unused:false, expr: true */
+;( function( $ ) {
+ 'use strict';
+ var ts = $.tablesorter = {
+
+ version : '2.31.0',
+
+ parsers : [],
+ widgets : [],
+ defaults : {
+
+ // *** appearance
+ theme : 'default', // adds tablesorter-{theme} to the table for styling
+ widthFixed : false, // adds colgroup to fix widths of columns
+ showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
+
+ headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
+ onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
+ onRenderHeader : null, // function( index ) {}, // nothing to return
+
+ // *** functionality
+ cancelSelection : true, // prevent text selection in the header
+ tabIndex : true, // add tabindex to header for keyboard accessibility
+ dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd'
+ sortMultiSortKey : 'shiftKey', // key used to select additional columns
+ sortResetKey : 'ctrlKey', // key used to remove sorting on a column
+ usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89'
+ delayInit : false, // if false, the parsed table contents will not update until the first sort
+ serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
+ resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed
+
+ // *** sort options
+ headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
+ ignoreCase : true, // ignore case while sorting
+ sortForce : null, // column(s) first sorted; always applied
+ sortList : [], // Initial sort order; applied initially; updated when manually sorted
+ sortAppend : null, // column(s) sorted last; always applied
+ sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained
+
+ sortInitialOrder : 'asc', // sort direction on first click
+ sortLocaleCompare: false, // replace equivalent character (accented characters)
+ sortReset : false, // third click on the header will reset column to default - unsorted
+ sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns
+
+ emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
+ stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
+ duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
+ textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
+ textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
+ textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
+ numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
+
+ // *** widget options
+ initWidgets : true, // apply widgets on tablesorter initialization
+ widgetClass : 'widget-{name}', // table class name template to match to include a widget
+ widgets : [], // method to add widgets, e.g. widgets: ['zebra']
+ widgetOptions : {
+ zebra : [ 'even', 'odd' ] // zebra widget alternating row class names
+ },
+
+ // *** callbacks
+ initialized : null, // function( table ) {},
+
+ // *** extra css class names
+ tableClass : '',
+ cssAsc : '',
+ cssDesc : '',
+ cssNone : '',
+ cssHeader : '',
+ cssHeaderRow : '',
+ cssProcessing : '', // processing icon applied to header during sort/filter
+
+ cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to its parent
+ cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!)
+ cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort
+ cssIgnoreRow : 'tablesorter-ignoreRow',// header row to ignore; cells within this row will not be added to c.$headers
+
+ cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate
+ cssIconNone : '', // class name added to the icon when there is no column sort
+ cssIconAsc : '', // class name added to the icon when the column has an ascending sort
+ cssIconDesc : '', // class name added to the icon when the column has a descending sort
+ cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
+
+ // *** events
+ pointerClick : 'click',
+ pointerDown : 'mousedown',
+ pointerUp : 'mouseup',
+
+ // *** selectors
+ selectorHeaders : '> thead th, > thead td',
+ selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort
+ selectorRemove : '.remove-me',
+
+ // *** advanced
+ debug : false,
+
+ // *** Internal variables
+ headerList: [],
+ empties: {},
+ strings: {},
+ parsers: [],
+
+ // *** parser options for validator; values must be falsy!
+ globalize: 0,
+ imgAttr: 0
+
+ // removed: widgetZebra: { css: ['even', 'odd'] }
+
+ },
+
+ // internal css classes - these will ALWAYS be added to
+ // the table and MUST only contain one class name - fixes #381
+ css : {
+ table : 'tablesorter',
+ cssHasChild: 'tablesorter-hasChildRow',
+ childRow : 'tablesorter-childRow',
+ colgroup : 'tablesorter-colgroup',
+ header : 'tablesorter-header',
+ headerRow : 'tablesorter-headerRow',
+ headerIn : 'tablesorter-header-inner',
+ icon : 'tablesorter-icon',
+ processing : 'tablesorter-processing',
+ sortAsc : 'tablesorter-headerAsc',
+ sortDesc : 'tablesorter-headerDesc',
+ sortNone : 'tablesorter-headerUnSorted'
+ },
+
+ // labels applied to sortable headers for accessibility (aria) support
+ language : {
+ sortAsc : 'Ascending sort applied, ',
+ sortDesc : 'Descending sort applied, ',
+ sortNone : 'No sort applied, ',
+ sortDisabled : 'sorting is disabled',
+ nextAsc : 'activate to apply an ascending sort',
+ nextDesc : 'activate to apply a descending sort',
+ nextNone : 'activate to remove the sort'
+ },
+
+ regex : {
+ templateContent : /\{content\}/g,
+ templateIcon : /\{icon\}/g,
+ templateName : /\{name\}/i,
+ spaces : /\s+/g,
+ nonWord : /\W/g,
+ formElements : /(input|select|button|textarea)/i,
+
+ // *** sort functions ***
+ // regex used in natural sort
+ // chunk/tokenize numbers & letters
+ chunk : /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,
+ // replace chunks @ ends
+ chunks : /(^\\0|\\0$)/,
+ hex : /^0x[0-9a-f]+$/i,
+
+ // *** formatFloat ***
+ comma : /,/g,
+ digitNonUS : /[\s|\.]/g,
+ digitNegativeTest : /^\s*\([.\d]+\)/,
+ digitNegativeReplace : /^\s*\(([.\d]+)\)/,
+
+ // *** isDigit ***
+ digitTest : /^[\-+(]?\d+[)]?$/,
+ digitReplace : /[,.'"\s]/g
+
+ },
+
+ // digit sort, text location
+ string : {
+ max : 1,
+ min : -1,
+ emptymin : 1,
+ emptymax : -1,
+ zero : 0,
+ none : 0,
+ 'null' : 0,
+ top : true,
+ bottom : false
+ },
+
+ keyCodes : {
+ enter : 13
+ },
+
+ // placeholder date parser data (globalize)
+ dates : {},
+
+ // These methods can be applied on table.config instance
+ instanceMethods : {},
+
+ /*
+ ▄█████ ██████ ██████ ██ ██ █████▄
+ ▀█▄ ██▄▄ ██ ██ ██ ██▄▄██
+ ▀█▄ ██▀▀ ██ ██ ██ ██▀▀▀
+ █████▀ ██████ ██ ▀████▀ ██
+ */
+
+ setup : function( table, c ) {
+ // if no thead or tbody, or tablesorter is already present, quit
+ if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
+ if ( ts.debug(c, 'core') ) {
+ if ( table.hasInitialized ) {
+ console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
+ } else {
+ console.error( 'Stopping initialization! No table, thead or tbody', table );
+ }
+ }
+ return;
+ }
+
+ var tmp = '',
+ $table = $( table ),
+ meta = $.metadata;
+ // initialization flag
+ table.hasInitialized = false;
+ // table is being processed flag
+ table.isProcessing = true;
+ // make sure to store the config object
+ table.config = c;
+ // save the settings where they read
+ $.data( table, 'tablesorter', c );
+ if ( ts.debug(c, 'core') ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
+ $.data( table, 'startoveralltimer', new Date() );
+ }
+
+ // removing this in version 3 (only supports jQuery 1.7+)
+ c.supportsDataObject = ( function( version ) {
+ version[ 0 ] = parseInt( version[ 0 ], 10 );
+ return ( version[ 0 ] > 1 ) || ( version[ 0 ] === 1 && parseInt( version[ 1 ], 10 ) >= 4 );
+ })( $.fn.jquery.split( '.' ) );
+ // ensure case insensitivity
+ c.emptyTo = c.emptyTo.toLowerCase();
+ c.stringTo = c.stringTo.toLowerCase();
+ c.last = { sortList : [], clickedIndex : -1 };
+ // add table theme class only if there isn't already one there
+ if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) {
+ tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
+ }
+
+ // give the table a unique id, which will be used in namespace binding
+ if ( !c.namespace ) {
+ c.namespace = '.tablesorter' + Math.random().toString( 16 ).slice( 2 );
+ } else {
+ // make sure namespace starts with a period & doesn't have weird characters
+ c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
+ }
+
+ c.table = table;
+ c.$table = $table
+ // add namespace to table to allow bindings on extra elements to target
+ // the parent table (e.g. parser-input-select)
+ .addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
+ .attr( 'role', 'grid' );
+ c.$headers = $table.find( c.selectorHeaders );
+
+ c.$table.children().children( 'tr' ).attr( 'role', 'row' );
+ c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({
+ 'aria-live' : 'polite',
+ 'aria-relevant' : 'all'
+ });
+ if ( c.$table.children( 'caption' ).length ) {
+ tmp = c.$table.children( 'caption' )[ 0 ];
+ if ( !tmp.id ) { tmp.id = c.namespace.slice( 1 ) + 'caption'; }
+ c.$table.attr( 'aria-labelledby', tmp.id );
+ }
+ c.widgetInit = {}; // keep a list of initialized widgets
+ // change textExtraction via data-attribute
+ c.textExtraction = c.$table.attr( 'data-text-extraction' ) || c.textExtraction || 'basic';
+ // build headers
+ ts.buildHeaders( c );
+ // fixate columns if the users supplies the fixedWidth option
+ // do this after theme has been applied
+ ts.fixColumnWidth( table );
+ // add widgets from class name
+ ts.addWidgetFromClass( table );
+ // add widget options before parsing (e.g. grouping widget has parser settings)
+ ts.applyWidgetOptions( table );
+ // try to auto detect column type, and store in tables config
+ ts.setupParsers( c );
+ // start total row count at zero
+ c.totalRows = 0;
+ // only validate options while debugging. See #1528
+ if (c.debug) {
+ ts.validateOptions( c );
+ }
+ // build the cache for the tbody cells
+ // delayInit will delay building the cache until the user starts a sort
+ if ( !c.delayInit ) { ts.buildCache( c ); }
+ // bind all header events and methods
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ // get sort list from jQuery data or metadata
+ // in jQuery < 1.4, an error occurs when calling $table.data()
+ if ( c.supportsDataObject && typeof $table.data().sortlist !== 'undefined' ) {
+ c.sortList = $table.data().sortlist;
+ } else if ( meta && ( $table.metadata() && $table.metadata().sortlist ) ) {
+ c.sortList = $table.metadata().sortlist;
+ }
+ // apply widget init code
+ ts.applyWidget( table, true );
+ // if user has supplied a sort list to constructor
+ if ( c.sortList.length > 0 ) {
+ ts.sortOn( c, c.sortList, {}, !c.initWidgets );
+ } else {
+ ts.setHeadersCss( c );
+ if ( c.initWidgets ) {
+ // apply widget format
+ ts.applyWidget( table, false );
+ }
+ }
+
+ // show processesing icon
+ if ( c.showProcessing ) {
+ $table
+ .unbind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace )
+ .bind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace, function( e ) {
+ clearTimeout( c.timerProcessing );
+ ts.isProcessing( table );
+ if ( e.type === 'sortBegin' ) {
+ c.timerProcessing = setTimeout( function() {
+ ts.isProcessing( table, true );
+ }, 500 );
+ }
+ });
+ }
+
+ // initialized
+ table.hasInitialized = true;
+ table.isProcessing = false;
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
+ if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
+ }
+ $table.triggerHandler( 'tablesorter-initialized', table );
+ if ( typeof c.initialized === 'function' ) {
+ c.initialized( table );
+ }
+ },
+
+ bindMethods : function( c ) {
+ var $table = c.$table,
+ namespace = c.namespace,
+ events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
+ 'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
+ 'mouseleave ' ).split( ' ' )
+ .join( namespace + ' ' );
+ // apply easy methods that trigger bound events
+ $table
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'sortReset' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // using this.config to ensure functions are getting a non-cached version of the config
+ ts.sortReset( this.config, function( table ) {
+ if (table.isApplyingWidgets) {
+ // multiple triggers in a row... filterReset, then sortReset - see #1361
+ // wait to update widgets
+ setTimeout( function() {
+ ts.applyWidget( table, '', callback );
+ }, 100 );
+ } else {
+ ts.applyWidget( table, '', callback );
+ }
+ });
+ })
+ .bind( 'updateAll' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.updateAll( this.config, resort, callback );
+ })
+ .bind( 'update' + namespace + ' updateRows' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.update( this.config, resort, callback );
+ })
+ .bind( 'updateHeaders' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ ts.updateHeaders( this.config, callback );
+ })
+ .bind( 'updateCell' + namespace, function( e, cell, resort, callback ) {
+ e.stopPropagation();
+ ts.updateCell( this.config, cell, resort, callback );
+ })
+ .bind( 'addRows' + namespace, function( e, $row, resort, callback ) {
+ e.stopPropagation();
+ ts.addRows( this.config, $row, resort, callback );
+ })
+ .bind( 'updateComplete' + namespace, function() {
+ this.isUpdating = false;
+ })
+ .bind( 'sorton' + namespace, function( e, list, callback, init ) {
+ e.stopPropagation();
+ ts.sortOn( this.config, list, callback, init );
+ })
+ .bind( 'appendCache' + namespace, function( e, callback, init ) {
+ e.stopPropagation();
+ ts.appendCache( this.config, init );
+ if ( $.isFunction( callback ) ) {
+ callback( this );
+ }
+ })
+ // $tbodies variable is used by the tbody sorting widget
+ .bind( 'updateCache' + namespace, function( e, callback, $tbodies ) {
+ e.stopPropagation();
+ ts.updateCache( this.config, callback, $tbodies );
+ })
+ .bind( 'applyWidgetId' + namespace, function( e, id ) {
+ e.stopPropagation();
+ ts.applyWidgetId( this, id );
+ })
+ .bind( 'applyWidgets' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // apply widgets (false = not initializing)
+ ts.applyWidget( this, false, callback );
+ })
+ .bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) {
+ e.stopPropagation();
+ ts.refreshWidgets( this, all, dontapply );
+ })
+ .bind( 'removeWidget' + namespace, function( e, name, refreshing ) {
+ e.stopPropagation();
+ ts.removeWidget( this, name, refreshing );
+ })
+ .bind( 'destroy' + namespace, function( e, removeClasses, callback ) {
+ e.stopPropagation();
+ ts.destroy( this, removeClasses, callback );
+ })
+ .bind( 'resetToLoadState' + namespace, function( e ) {
+ e.stopPropagation();
+ // remove all widgets
+ ts.removeWidget( this, true, false );
+ var tmp = $.extend( true, {}, c.originalSettings );
+ // restore original settings; this clears out current settings, but does not clear
+ // values saved to storage.
+ c = $.extend( true, {}, ts.defaults, tmp );
+ c.originalSettings = tmp;
+ this.hasInitialized = false;
+ // setup the entire table again
+ ts.setup( this, c );
+ });
+ },
+
+ bindEvents : function( table, $headers, core ) {
+ table = $( table )[ 0 ];
+ var tmp,
+ c = table.config,
+ namespace = c.namespace,
+ downTarget = null;
+ if ( core !== true ) {
+ $headers.addClass( namespace.slice( 1 ) + '_extra_headers' );
+ tmp = ts.getClosest( $headers, 'table' );
+ if ( tmp.length && tmp[ 0 ].nodeName === 'TABLE' && tmp[ 0 ] !== table ) {
+ $( tmp[ 0 ] ).addClass( namespace.slice( 1 ) + '_extra_table' );
+ }
+ }
+ tmp = ( c.pointerDown + ' ' + c.pointerUp + ' ' + c.pointerClick + ' sort keyup ' )
+ .replace( ts.regex.spaces, ' ' )
+ .split( ' ' )
+ .join( namespace + ' ' );
+ // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc)
+ $headers
+ // http://stackoverflow.com/questions/5312849/jquery-find-self;
+ .find( c.selectorSort )
+ .add( $headers.filter( c.selectorSort ) )
+ .unbind( tmp )
+ .bind( tmp, function( e, external ) {
+ var $cell, cell, temp,
+ $target = $( e.target ),
+ // wrap event type in spaces, so the match doesn't trigger on inner words
+ type = ' ' + e.type + ' ';
+ // only recognize left clicks
+ if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) ||
+ // allow pressing enter
+ ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) ||
+ // allow triggering a click event (e.which is undefined) & ignore physical clicks
+ ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) {
+ return;
+ }
+ // ignore mouseup if mousedown wasn't on the same target
+ if ( type.match( ' ' + c.pointerUp + ' ' ) && downTarget !== e.target && external !== true ) {
+ return;
+ }
+ // set target on mousedown
+ if ( type.match( ' ' + c.pointerDown + ' ' ) ) {
+ downTarget = e.target;
+ // preventDefault needed or jQuery v1.3.2 and older throws an
+ // "Uncaught TypeError: handler.apply is not a function" error
+ temp = $target.jquery.split( '.' );
+ if ( temp[ 0 ] === '1' && temp[ 1 ] < 4 ) { e.preventDefault(); }
+ return;
+ }
+ downTarget = null;
+ $cell = ts.getClosest( $( this ), '.' + ts.css.header );
+ // prevent sort being triggered on form elements
+ if ( ts.regex.formElements.test( e.target.nodeName ) ||
+ // nosort class name, or elements within a nosort container
+ $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 ||
+ // disabled cell directly clicked
+ $cell.hasClass( 'sorter-false' ) ||
+ // elements within a button
+ $target.parents( 'button' ).length > 0 ) {
+ return !c.cancelSelection;
+ }
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ // use column index from data-attribute or index of current row; fixes #1116
+ c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
+ cell = c.$headerIndexed[ c.last.clickedIndex ][0];
+ if ( cell && !cell.sortDisabled ) {
+ ts.initSort( c, cell, e );
+ }
+ });
+ if ( c.cancelSelection ) {
+ // cancel selection
+ $headers
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart', false )
+ .css({
+ 'user-select' : 'none',
+ 'MozUserSelect' : 'none' // not needed for jQuery 1.8+
+ });
+ }
+ },
+
+ buildHeaders : function( c ) {
+ var $temp, icon, timer, indx;
+ c.headerList = [];
+ c.headerContent = [];
+ c.sortVars = [];
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ // children tr in tfoot - see issue #196 & #547
+ // don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells
+ c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) );
+ // add icon if cssIcon option exists
+ icon = c.cssIcon ?
+ '<i class="' + ( c.cssIcon === ts.css.icon ? ts.css.icon : c.cssIcon + ' ' + ts.css.icon ) + '"></i>' :
+ '';
+ // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683
+ c.$headers = $( $.map( c.$table.find( c.selectorHeaders ), function( elem, index ) {
+ var configHeaders, header, column, template, tmp,
+ $elem = $( elem );
+ // ignore cell (don't add it to c.$headers) if row has ignoreRow class
+ if ( ts.getClosest( $elem, 'tr' ).hasClass( c.cssIgnoreRow ) ) { return; }
+ // transfer data-column to element if not th/td - #1459
+ if ( !/(th|td)/i.test( elem.nodeName ) ) {
+ tmp = ts.getClosest( $elem, 'th, td' );
+ $elem.attr( 'data-column', tmp.attr( 'data-column' ) );
+ }
+ // make sure to get header cell & not column indexed cell
+ configHeaders = ts.getColumnData( c.table, c.headers, index, true );
+ // save original header content
+ c.headerContent[ index ] = $elem.html();
+ // if headerTemplate is empty, don't reformat the header cell
+ if ( c.headerTemplate !== '' && !$elem.find( '.' + ts.css.headerIn ).length ) {
+ // set up header template
+ template = c.headerTemplate
+ .replace( ts.regex.templateContent, $elem.html() )
+ .replace( ts.regex.templateIcon, $elem.find( '.' + ts.css.icon ).length ? '' : icon );
+ if ( c.onRenderTemplate ) {
+ header = c.onRenderTemplate.apply( $elem, [ index, template ] );
+ // only change t if something is returned
+ if ( header && typeof header === 'string' ) {
+ template = header;
+ }
+ }
+ $elem.html( '<div class="' + ts.css.headerIn + '">' + template + '</div>' ); // faster than wrapInner
+ }
+ if ( c.onRenderHeader ) {
+ c.onRenderHeader.apply( $elem, [ index, c, c.$table ] );
+ }
+ column = parseInt( $elem.attr( 'data-column' ), 10 );
+ elem.column = column;
+ tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
+ // this may get updated numerous times if there are multiple rows
+ c.sortVars[ column ] = {
+ count : -1, // set to -1 because clicking on the header automatically adds one
+ order : tmp ?
+ ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
+ ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
+ lockedOrder : false,
+ sortedBy : ''
+ };
+ tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
+ if ( typeof tmp !== 'undefined' && tmp !== false ) {
+ c.sortVars[ column ].lockedOrder = true;
+ c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1 ] : [ 0, 0 ];
+ }
+ // add cell to headerList
+ c.headerList[ index ] = elem;
+ $elem.addClass( ts.css.header + ' ' + c.cssHeader );
+ // add to parent in case there are multiple rows
+ ts.getClosest( $elem, 'tr' )
+ .addClass( ts.css.headerRow + ' ' + c.cssHeaderRow )
+ .attr( 'role', 'row' );
+ // allow keyboard cursor to focus on element
+ if ( c.tabIndex ) {
+ $elem.attr( 'tabindex', 0 );
+ }
+ return elem;
+ }) );
+ // cache headers per column
+ c.$headerIndexed = [];
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ // colspan in header making a column undefined
+ if ( ts.isEmptyObject( c.sortVars[ indx ] ) ) {
+ c.sortVars[ indx ] = {};
+ }
+ // Use c.$headers.parent() in case selectorHeaders doesn't point to the th/td
+ $temp = c.$headers.filter( '[data-column="' + indx + '"]' );
+ // target sortable column cells, unless there are none, then use non-sortable cells
+ // .last() added in jQuery 1.4; use .filter(':last') to maintain compatibility with jQuery v1.2.6
+ c.$headerIndexed[ indx ] = $temp.length ?
+ $temp.not( '.sorter-false' ).length ?
+ $temp.not( '.sorter-false' ).filter( ':last' ) :
+ $temp.filter( ':last' ) :
+ $();
+ }
+ c.$table.find( c.selectorHeaders ).attr({
+ scope: 'col',
+ role : 'columnheader'
+ });
+ // enable/disable sorting
+ ts.updateHeader( c );
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Built headers:' + ts.benchmark( timer ) );
+ console.log( c.$headers );
+ }
+ },
+
+ // Use it to add a set of methods to table.config which will be available for all tables.
+ // This should be done before table initialization
+ addInstanceMethods : function( methods ) {
+ $.extend( ts.instanceMethods, methods );
+ },
+
+ /*
+ █████▄ ▄████▄ █████▄ ▄█████ ██████ █████▄ ▄█████
+ ██▄▄██ ██▄▄██ ██▄▄██ ▀█▄ ██▄▄ ██▄▄██ ▀█▄
+ ██▀▀▀ ██▀▀██ ██▀██ ▀█▄ ██▀▀ ██▀██ ▀█▄
+ ██ ██ ██ ██ ██ █████▀ ██████ ██ ██ █████▀
+ */
+ setupParsers : function( c, $tbodies ) {
+ var rows, list, span, max, colIndex, indx, header, configHeaders,
+ noParser, parser, extractor, time, tbody, len,
+ table = c.table,
+ tbodyIndex = 0,
+ debug = ts.debug(c, 'core'),
+ debugOutput = {};
+ // update table bodies in case we start with an empty table
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
+ len = tbody.length;
+ if ( len === 0 ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
+ } else if ( debug ) {
+ time = new Date();
+ console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
+ }
+ list = {
+ extractors: [],
+ parsers: []
+ };
+ while ( tbodyIndex < len ) {
+ rows = tbody[ tbodyIndex ].rows;
+ if ( rows.length ) {
+ colIndex = 0;
+ max = c.columns;
+ for ( indx = 0; indx < max; indx++ ) {
+ header = c.$headerIndexed[ colIndex ];
+ if ( header && header.length ) {
+ // get column indexed table cell; adding true parameter fixes #1362 but
+ // it would break backwards compatibility...
+ configHeaders = ts.getColumnData( table, c.headers, colIndex ); // , true );
+ // get column parser/extractor
+ extractor = ts.getParserById( ts.getData( header, configHeaders, 'extractor' ) );
+ parser = ts.getParserById( ts.getData( header, configHeaders, 'sorter' ) );
+ noParser = ts.getData( header, configHeaders, 'parser' ) === 'false';
+ // empty cells behaviour - keeping emptyToBottom for backwards compatibility
+ c.empties[colIndex] = (
+ ts.getData( header, configHeaders, 'empty' ) ||
+ c.emptyTo || ( c.emptyToBottom ? 'bottom' : 'top' ) ).toLowerCase();
+ // text strings behaviour in numerical sorts
+ c.strings[colIndex] = (
+ ts.getData( header, configHeaders, 'string' ) ||
+ c.stringTo ||
+ 'max' ).toLowerCase();
+ if ( noParser ) {
+ parser = ts.getParserById( 'no-parser' );
+ }
+ if ( !extractor ) {
+ // For now, maybe detect someday
+ extractor = false;
+ }
+ if ( !parser ) {
+ parser = ts.detectParserForColumn( c, rows, -1, colIndex );
+ }
+ if ( debug ) {
+ debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
+ parser : parser.id,
+ extractor : extractor ? extractor.id : 'none',
+ string : c.strings[ colIndex ],
+ empty : c.empties[ colIndex ]
+ };
+ }
+ list.parsers[ colIndex ] = parser;
+ list.extractors[ colIndex ] = extractor;
+ span = header[ 0 ].colSpan - 1;
+ if ( span > 0 ) {
+ colIndex += span;
+ max += span;
+ while ( span + 1 > 0 ) {
+ // set colspan columns to use the same parsers & extractors
+ list.parsers[ colIndex - span ] = parser;
+ list.extractors[ colIndex - span ] = extractor;
+ span--;
+ }
+ }
+ }
+ colIndex++;
+ }
+ }
+ tbodyIndex += ( list.parsers.length ) ? len : 1;
+ }
+ if ( debug ) {
+ if ( !ts.isEmptyObject( debugOutput ) ) {
+ console[ console.table ? 'table' : 'log' ]( debugOutput );
+ } else {
+ console.warn( ' No parsers detected!' );
+ }
+ console.log( 'Completed detecting parsers' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ c.parsers = list.parsers;
+ c.extractors = list.extractors;
+ },
+
+ addParser : function( parser ) {
+ var indx,
+ len = ts.parsers.length,
+ add = true;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === parser.id.toLowerCase() ) {
+ add = false;
+ }
+ }
+ if ( add ) {
+ ts.parsers[ ts.parsers.length ] = parser;
+ }
+ },
+
+ getParserById : function( name ) {
+ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
+ if ( name == 'false' ) { return false; }
+ var indx,
+ len = ts.parsers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === ( name.toString() ).toLowerCase() ) {
+ return ts.parsers[ indx ];
+ }
+ }
+ return false;
+ },
+
+ detectParserForColumn : function( c, rows, rowIndex, cellIndex ) {
+ var cur, $node, row,
+ indx = ts.parsers.length,
+ node = false,
+ nodeValue = '',
+ debug = ts.debug(c, 'core'),
+ keepLooking = true;
+ while ( nodeValue === '' && keepLooking ) {
+ rowIndex++;
+ row = rows[ rowIndex ];
+ // stop looking after 50 empty rows
+ if ( row && rowIndex < 50 ) {
+ if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) {
+ node = rows[ rowIndex ].cells[ cellIndex ];
+ nodeValue = ts.getElementText( c, node, cellIndex );
+ $node = $( node );
+ if ( debug ) {
+ console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
+ cellIndex + ': "' + nodeValue + '"' );
+ }
+ }
+ } else {
+ keepLooking = false;
+ }
+ }
+ while ( --indx >= 0 ) {
+ cur = ts.parsers[ indx ];
+ // ignore the default text parser because it will always be true
+ if ( cur && cur.id !== 'text' && cur.is && cur.is( nodeValue, c.table, node, $node ) ) {
+ return cur;
+ }
+ }
+ // nothing found, return the generic parser (text)
+ return ts.getParserById( 'text' );
+ },
+
+ getElementText : function( c, node, cellIndex ) {
+ if ( !node ) { return ''; }
+ var tmp,
+ extract = c.textExtraction || '',
+ // node could be a jquery object
+ // http://jsperf.com/jquery-vs-instanceof-jquery/2
+ $node = node.jquery ? node : $( node );
+ if ( typeof extract === 'string' ) {
+ // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow!
+ // http://www.kellegous.com/j/2013/02/27/innertext-vs-textcontent/
+ if ( extract === 'basic' && typeof ( tmp = $node.attr( c.textAttribute ) ) !== 'undefined' ) {
+ return $.trim( tmp );
+ }
+ return $.trim( node.textContent || $node.text() );
+ } else {
+ if ( typeof extract === 'function' ) {
+ return $.trim( extract( $node[ 0 ], c.table, cellIndex ) );
+ } else if ( typeof ( tmp = ts.getColumnData( c.table, extract, cellIndex ) ) === 'function' ) {
+ return $.trim( tmp( $node[ 0 ], c.table, cellIndex ) );
+ }
+ }
+ // fallback
+ return $.trim( $node[ 0 ].textContent || $node.text() );
+ },
+
+ // centralized function to extract/parse cell contents
+ getParsedText : function( c, cell, colIndex, txt ) {
+ if ( typeof txt === 'undefined' ) {
+ txt = ts.getElementText( c, cell, colIndex );
+ }
+ // if no parser, make sure to return the txt
+ var val = '' + txt,
+ parser = c.parsers[ colIndex ],
+ extractor = c.extractors[ colIndex ];
+ if ( parser ) {
+ // do extract before parsing, if there is one
+ if ( extractor && typeof extractor.format === 'function' ) {
+ txt = extractor.format( txt, c.table, cell, colIndex );
+ }
+ // allow parsing if the string is empty, previously parsing would change it to zero,
+ // in case the parser needs to extract data from the table cell attributes
+ val = parser.id === 'no-parser' ? '' :
+ // make sure txt is a string (extractor may have converted it)
+ parser.format( '' + txt, c.table, cell, colIndex );
+ if ( c.ignoreCase && typeof val === 'string' ) {
+ val = val.toLowerCase();
+ }
+ }
+ return val;
+ },
+
+ /*
+ ▄████▄ ▄████▄ ▄████▄ ██ ██ ██████
+ ██ ▀▀ ██▄▄██ ██ ▀▀ ██▄▄██ ██▄▄
+ ██ ▄▄ ██▀▀██ ██ ▄▄ ██▀▀██ ██▀▀
+ ▀████▀ ██ ██ ▀████▀ ██ ██ ██████
+ */
+ buildCache : function( c, callback, $tbodies ) {
+ var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
+ cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
+ colMax, span, cacheIndex, hasParser, max, len, index,
+ table = c.table,
+ parsers = c.parsers,
+ debug = ts.debug(c, 'core');
+ // update tbody variable
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
+ c.cache = {};
+ c.totalRows = 0;
+ // if no parsers found, return - it's an empty table.
+ if ( !parsers ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
+ }
+ if ( debug ) {
+ cacheTime = new Date();
+ }
+ // processing icon
+ if ( c.showProcessing ) {
+ ts.isProcessing( table, true );
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbody.length; tbodyIndex++ ) {
+ colMax = []; // column max value per tbody
+ cache = c.cache[ tbodyIndex ] = {
+ normalized: [] // array of normalized row data; last entry contains 'rowData' above
+ // colMax: # // added at the end
+ };
+
+ totalRows = ( $tbody[ tbodyIndex ] && $tbody[ tbodyIndex ].rows.length ) || 0;
+ for ( rowIndex = 0; rowIndex < totalRows; ++rowIndex ) {
+ rowData = {
+ // order: original row order #
+ // $row : jQuery Object[]
+ child: [], // child row text (filter widget)
+ raw: [] // original row text
+ };
+ /** Add the table data to main data array */
+ $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] );
+ cols = [];
+ // ignore "remove-me" rows
+ if ( $row.hasClass( c.selectorRemove.slice(1) ) ) {
+ continue;
+ }
+ // if this is a child row, add it to the last row's children and continue to the next row
+ // ignore child row class, if it is the first row
+ if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) {
+ len = cache.normalized.length - 1;
+ prevRowData = cache.normalized[ len ][ c.columns ];
+ prevRowData.$row = prevRowData.$row.add( $row );
+ // add 'hasChild' class name to parent row
+ if ( !$row.prev().hasClass( c.cssChildRow ) ) {
+ $row.prev().addClass( ts.css.cssHasChild );
+ }
+ // save child row content (un-parsed!)
+ $cells = $row.children( 'th, td' );
+ len = prevRowData.child.length;
+ prevRowData.child[ len ] = [];
+ // child row content does not account for colspans/rowspans; so indexing may be off
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; colIndex++ ) {
+ cell = $cells[ colIndex ];
+ if ( cell ) {
+ prevRowData.child[ len ][ colIndex ] = ts.getParsedText( c, cell, colIndex );
+ span = $cells[ colIndex ].colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // go to the next for loop
+ continue;
+ }
+ rowData.$row = $row;
+ rowData.order = rowIndex; // add original row position to rowCache
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; ++colIndex ) {
+ cell = $row[ 0 ].cells[ colIndex ];
+ if ( cell && cacheIndex < c.columns ) {
+ hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
+ if ( !hasParser && debug ) {
+ console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
+ '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
+ }
+ val = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = val; // save original row text
+ // save raw column text even if there is no parser set
+ txt = ts.getParsedText( c, cell, cacheIndex, val );
+ cols[ cacheIndex ] = txt;
+ if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // determine column max value (ignore sign)
+ colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
+ }
+ // allow colSpan in tbody
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ index = 0;
+ while ( index <= span ) {
+ // duplicate text (or not) to spanned columns
+ // instead of setting duplicate span to empty string, use textExtraction to try to get a value
+ // see http://stackoverflow.com/q/36449711/145346
+ txt = c.duplicateSpan || index === 0 ?
+ val :
+ typeof c.textExtraction !== 'string' ?
+ ts.getElementText( c, cell, cacheIndex + index ) || '' :
+ '';
+ rowData.raw[ cacheIndex + index ] = txt;
+ cols[ cacheIndex + index ] = txt;
+ index++;
+ }
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // ensure rowData is always in the same location (after the last column)
+ cols[ c.columns ] = rowData;
+ cache.normalized[ cache.normalized.length ] = cols;
+ }
+ cache.colMax = colMax;
+ // total up rows, not including child rows
+ c.totalRows += cache.normalized.length;
+
+ }
+ if ( c.showProcessing ) {
+ ts.isProcessing( table ); // remove processing icon
+ }
+ if ( debug ) {
+ len = Math.min( 5, c.cache[ 0 ].normalized.length );
+ console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
+ ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
+ ts.benchmark( cacheTime ) );
+ val = {};
+ for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
+ for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
+ if ( !val[ 'row: ' + cacheIndex ] ) {
+ val[ 'row: ' + cacheIndex ] = {};
+ }
+ val[ 'row: ' + cacheIndex ][ c.$headerIndexed[ colIndex ].text() ] =
+ c.cache[ 0 ].normalized[ cacheIndex ][ colIndex ];
+ }
+ }
+ console[ console.table ? 'table' : 'log' ]( val );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ getColumnText : function( table, column, callback, rowFilter ) {
+ table = $( table )[0];
+ var tbodyIndex, rowIndex, cache, row, tbodyLen, rowLen, raw, parsed, $cell, result,
+ hasCallback = typeof callback === 'function',
+ allColumns = column === 'all',
+ data = { raw : [], parsed: [], $cell: [] },
+ c = table.config;
+ if ( ts.isEmptyObject( c ) ) {
+ if ( ts.debug(c, 'core') ) {
+ console.warn( 'No cache found - aborting getColumnText function!' );
+ }
+ } else {
+ tbodyLen = c.$tbodies.length;
+ for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) {
+ cache = c.cache[ tbodyIndex ].normalized;
+ rowLen = cache.length;
+ for ( rowIndex = 0; rowIndex < rowLen; rowIndex++ ) {
+ row = cache[ rowIndex ];
+ if ( rowFilter && !row[ c.columns ].$row.is( rowFilter ) ) {
+ continue;
+ }
+ result = true;
+ parsed = ( allColumns ) ? row.slice( 0, c.columns ) : row[ column ];
+ row = row[ c.columns ];
+ raw = ( allColumns ) ? row.raw : row.raw[ column ];
+ $cell = ( allColumns ) ? row.$row.children() : row.$row.children().eq( column );
+ if ( hasCallback ) {
+ result = callback({
+ tbodyIndex : tbodyIndex,
+ rowIndex : rowIndex,
+ parsed : parsed,
+ raw : raw,
+ $row : row.$row,
+ $cell : $cell
+ });
+ }
+ if ( result !== false ) {
+ data.parsed[ data.parsed.length ] = parsed;
+ data.raw[ data.raw.length ] = raw;
+ data.$cell[ data.$cell.length ] = $cell;
+ }
+ }
+ }
+ // return everything
+ return data;
+ }
+ },
+
+ /*
+ ██ ██ █████▄ █████▄ ▄████▄ ██████ ██████
+ ██ ██ ██▄▄██ ██ ██ ██▄▄██ ██ ██▄▄
+ ██ ██ ██▀▀▀ ██ ██ ██▀▀██ ██ ██▀▀
+ ▀████▀ ██ █████▀ ██ ██ ██ ██████
+ */
+ setHeadersCss : function( c ) {
+ var indx, column,
+ list = c.sortList,
+ len = list.length,
+ none = ts.css.sortNone + ' ' + c.cssNone,
+ css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ],
+ cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
+ aria = [ 'ascending', 'descending' ],
+ updateColumnSort = function($el, index) {
+ $el
+ .removeClass( none )
+ .addClass( css[ index ] )
+ .attr( 'aria-sort', aria[ index ] )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon[ 2 ] )
+ .addClass( cssIcon[ index ] );
+ },
+ // find the footer
+ $extras = c.$table
+ .find( 'tfoot tr' )
+ .children( 'td, th' )
+ .add( $( c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) ),
+ // remove all header information
+ $sorted = c.$headers
+ .add( $( 'thead ' + c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) )
+ .addClass( none )
+ .attr( 'aria-sort', 'none' )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon.join( ' ' ) )
+ .end();
+ // add css none to all sortable headers
+ $sorted
+ .not( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( cssIcon[ 2 ] );
+ // add disabled css icon class
+ if ( c.cssIconDisabled ) {
+ $sorted
+ .filter( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( c.cssIconDisabled );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ // direction = 2 means reset!
+ if ( list[ indx ][ 1 ] !== 2 ) {
+ // multicolumn sorting updating - see #1005
+ // .not(function() {}) needs jQuery 1.4
+ // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
+ $sorted = c.$headers.filter( function( i ) {
+ // only include headers that are in the sortList (this includes colspans)
+ var include = true,
+ $el = c.$headers.eq( i ),
+ col = parseInt( $el.attr( 'data-column' ), 10 ),
+ end = col + ts.getClosest( $el, 'th, td' )[0].colSpan;
+ for ( ; col < end; col++ ) {
+ include = include ? include || ts.isValueInArray( col, c.sortList ) > -1 : false;
+ }
+ return include;
+ });
+
+ // choose the :last in case there are nested columns
+ $sorted = $sorted
+ .not( '.sorter-false' )
+ .filter( '[data-column="' + list[ indx ][ 0 ] + '"]' + ( len === 1 ? ':last' : '' ) );
+ if ( $sorted.length ) {
+ for ( column = 0; column < $sorted.length; column++ ) {
+ if ( !$sorted[ column ].sortDisabled ) {
+ updateColumnSort( $sorted.eq( column ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add sorted class to footer & extra headers, if they exist
+ if ( $extras.length ) {
+ updateColumnSort( $extras.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add verbose aria labels
+ len = c.$headers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ ts.setColumnAriaLabel( c, c.$headers.eq( indx ) );
+ }
+ },
+
+ getClosest : function( $el, selector ) {
+ // jQuery v1.2.6 doesn't have closest()
+ if ( $.fn.closest ) {
+ return $el.closest( selector );
+ }
+ return $el.is( selector ) ?
+ $el :
+ $el.parents( selector ).filter( ':first' );
+ },
+
+ // nextSort (optional), lets you disable next sort text
+ setColumnAriaLabel : function( c, $header, nextSort ) {
+ if ( $header.length ) {
+ var column = parseInt( $header.attr( 'data-column' ), 10 ),
+ vars = c.sortVars[ column ],
+ tmp = $header.hasClass( ts.css.sortAsc ) ?
+ 'sortAsc' :
+ $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone',
+ txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ];
+ if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) {
+ txt += ts.language.sortDisabled;
+ } else {
+ tmp = ( vars.count + 1 ) % vars.order.length;
+ nextSort = vars.order[ tmp ];
+ // if nextSort
+ txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
+ }
+ $header.attr( 'aria-label', txt );
+ if (vars.sortedBy) {
+ $header.attr( 'data-sortedBy', vars.sortedBy );
+ } else {
+ $header.removeAttr('data-sortedBy');
+ }
+ }
+ },
+
+ updateHeader : function( c ) {
+ var index, isDisabled, $header, col,
+ table = c.table,
+ len = c.$headers.length;
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ col = ts.getColumnData( table, c.headers, index, true );
+ // add 'sorter-false' class if 'parser-false' is set
+ isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false';
+ ts.setColumnSort( c, $header, isDisabled );
+ }
+ },
+
+ setColumnSort : function( c, $header, isDisabled ) {
+ var id = c.table.id;
+ $header[ 0 ].sortDisabled = isDisabled;
+ $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' )
+ .attr( 'aria-disabled', '' + isDisabled );
+ // disable tab index on disabled cells
+ if ( c.tabIndex ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'tabindex' );
+ } else {
+ $header.attr( 'tabindex', '0' );
+ }
+ }
+ // aria-controls - requires table ID
+ if ( id ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'aria-controls' );
+ } else {
+ $header.attr( 'aria-controls', id );
+ }
+ }
+ },
+
+ updateHeaderSortCount : function( c, list ) {
+ var col, dir, group, indx, primary, temp, val, order,
+ sortList = list || c.sortList,
+ len = sortList.length;
+ c.sortList = [];
+ for ( indx = 0; indx < len; indx++ ) {
+ val = sortList[ indx ];
+ // ensure all sortList values are numeric - fixes #127
+ col = parseInt( val[ 0 ], 10 );
+ // prevents error if sorton array is wrong
+ if ( col < c.columns ) {
+
+ // set order if not already defined - due to colspan header without associated header cell
+ // adding this check prevents a javascript error
+ if ( !c.sortVars[ col ].order ) {
+ if ( ts.getOrder( c.sortInitialOrder ) ) {
+ order = c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ];
+ } else {
+ order = c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ];
+ }
+ c.sortVars[ col ].order = order;
+ c.sortVars[ col ].count = 0;
+ }
+
+ order = c.sortVars[ col ].order;
+ dir = ( '' + val[ 1 ] ).match( /^(1|d|s|o|n)/ );
+ dir = dir ? dir[ 0 ] : '';
+ // 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext
+ switch ( dir ) {
+ case '1' : case 'd' : // descending
+ dir = 1;
+ break;
+ case 's' : // same direction (as primary column)
+ // if primary sort is set to 's', make it ascending
+ dir = primary || 0;
+ break;
+ case 'o' :
+ temp = order[ ( primary || 0 ) % order.length ];
+ // opposite of primary column; but resets if primary resets
+ dir = temp === 0 ? 1 : temp === 1 ? 0 : 2;
+ break;
+ case 'n' :
+ dir = order[ ( ++c.sortVars[ col ].count ) % order.length ];
+ break;
+ default : // ascending
+ dir = 0;
+ break;
+ }
+ primary = indx === 0 ? dir : primary;
+ group = [ col, parseInt( dir, 10 ) || 0 ];
+ c.sortList[ c.sortList.length ] = group;
+ dir = $.inArray( group[ 1 ], order ); // fixes issue #167
+ c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % order.length;
+ }
+ }
+ },
+
+ updateAll : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ ts.refreshWidgets( table, true, true );
+ ts.buildHeaders( c );
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ update : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ // update sorting (if enabled/disabled)
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ // simple header update - see #989
+ updateHeaders : function( c, callback ) {
+ c.table.isUpdating = true;
+ ts.buildHeaders( c );
+ ts.bindEvents( c.table, c.$headers, true );
+ ts.resortComplete( c, callback );
+ },
+
+ updateCell : function( c, cell, resort, callback ) {
+ // updateCell for child rows is a mess - we'll ignore them for now
+ // eventually I'll break out the "update" row cache code to make everything consistent
+ if ( $( cell ).closest( 'tr' ).hasClass( c.cssChildRow ) ) {
+ console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');
+ return;
+ }
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #1099
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ return;
+ }
+ c.table.isUpdating = true;
+ c.$table.find( c.selectorRemove ).remove();
+ // get position from the dom
+ var tmp, indx, row, icell, cache, len,
+ $tbodies = c.$tbodies,
+ $cell = $( cell ),
+ // update cache - format: function( s, table, cell, cellIndex )
+ // no closest in jQuery v1.2.6
+ tbodyIndex = $tbodies.index( ts.getClosest( $cell, 'tbody' ) ),
+ tbcache = c.cache[ tbodyIndex ],
+ $row = ts.getClosest( $cell, 'tr' );
+ cell = $cell[ 0 ]; // in case cell is a jQuery object
+ // tbody may not exist if update is initialized while tbody is removed for processing
+ if ( $tbodies.length && tbodyIndex >= 0 ) {
+ row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
+ cache = tbcache.normalized[ row ];
+ len = $row[ 0 ].cells.length;
+ if ( len !== c.columns ) {
+ // colspan in here somewhere!
+ icell = 0;
+ tmp = false;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( !tmp && $row[ 0 ].cells[ indx ] !== cell ) {
+ icell += $row[ 0 ].cells[ indx ].colSpan;
+ } else {
+ tmp = true;
+ }
+ }
+ } else {
+ icell = $cell.index();
+ }
+ tmp = ts.getElementText( c, cell, icell ); // raw
+ cache[ c.columns ].raw[ icell ] = tmp;
+ tmp = ts.getParsedText( c, cell, icell, tmp );
+ cache[ icell ] = tmp; // parsed
+ if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
+ }
+ tmp = resort !== 'undefined' ? resort : c.resort;
+ if ( tmp !== false ) {
+ // widgets will be reapplied
+ ts.checkResort( c, tmp, callback );
+ } else {
+ // don't reapply widgets is resort is false, just in case it causes
+ // problems with element focus
+ ts.resortComplete( c, callback );
+ }
+ } else {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
+ }
+ c.table.isUpdating = false;
+ }
+ },
+
+ addRows : function( c, $row, resort, callback ) {
+ var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
+ cacheIndex, rowData, cells, cell, span,
+ // allow passing a row string if only one non-info tbody exists in the table
+ valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
+ table = c.table;
+ if ( valid ) {
+ $row = $( $row );
+ c.$tbodies.append( $row );
+ } else if (
+ !$row ||
+ // row is a jQuery object?
+ !( $row instanceof $ ) ||
+ // row contained in the table?
+ ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
+ ) {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
+ 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
+ }
+ return false;
+ }
+ table.isUpdating = true;
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #450
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ } else {
+ rows = $row.filter( 'tr' ).attr( 'role', 'row' ).length;
+ tbodyIndex = c.$tbodies.index( $row.parents( 'tbody' ).filter( ':first' ) );
+ // fixes adding rows to an empty table - see issue #179
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c );
+ }
+ // add each row
+ for ( rowIndex = 0; rowIndex < rows; rowIndex++ ) {
+ cacheIndex = 0;
+ len = $row[ rowIndex ].cells.length;
+ order = c.cache[ tbodyIndex ].normalized.length;
+ cells = [];
+ rowData = {
+ child : [],
+ raw : [],
+ $row : $row.eq( rowIndex ),
+ order : order
+ };
+ // add each cell
+ for ( cellIndex = 0; cellIndex < len; cellIndex++ ) {
+ cell = $row[ rowIndex ].cells[ cellIndex ];
+ txt = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = txt;
+ val = ts.getParsedText( c, cell, cacheIndex, txt );
+ cells[ cacheIndex ] = val;
+ if ( ( c.parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ c.cache[ tbodyIndex ].colMax[ cacheIndex ] =
+ Math.max( Math.abs( val ) || 0, c.cache[ tbodyIndex ].colMax[ cacheIndex ] || 0 );
+ }
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ }
+ cacheIndex++;
+ }
+ // add the row data to the end
+ cells[ c.columns ] = rowData;
+ // update cache
+ c.cache[ tbodyIndex ].normalized[ order ] = cells;
+ }
+ // resort using current settings
+ ts.checkResort( c, resort, callback );
+ }
+ },
+
+ updateCache : function( c, callback, $tbodies ) {
+ // rebuild parsers
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c, $tbodies );
+ }
+ // rebuild the cache map
+ ts.buildCache( c, callback, $tbodies );
+ },
+
+ // init flag (true) used by pager plugin to prevent widget application
+ // renamed from appendToTable
+ appendCache : function( c, init ) {
+ var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
+ table = c.table,
+ $tbodies = c.$tbodies,
+ rows = [],
+ cache = c.cache;
+ // empty table - fixes #206/#346
+ if ( ts.isEmptyObject( cache ) ) {
+ // run pager appender in case the table was just emptied
+ return c.appender ? c.appender( table, rows ) :
+ table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
+ }
+ if ( ts.debug(c, 'core') ) {
+ appendTime = new Date();
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = $tbodies.eq( tbodyIndex );
+ if ( $tbody.length ) {
+ // detach tbody for manipulation
+ $curTbody = ts.processTbody( table, $tbody, true );
+ parsed = cache[ tbodyIndex ].normalized;
+ totalRows = parsed.length;
+ for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
+ rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
+ // removeRows used by the pager plugin; don't render if using ajax - fixes #411
+ if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
+ $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
+ }
+ }
+ // restore tbody
+ ts.processTbody( table, $curTbody, false );
+ }
+ }
+ if ( c.appender ) {
+ c.appender( table, rows );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
+ }
+ // apply table widgets; but not before ajax completes
+ if ( !init && !c.appender ) {
+ ts.applyWidget( table );
+ }
+ if ( table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', table );
+ }
+ },
+
+ commonUpdate : function( c, resort, callback ) {
+ // remove rows/elements before update
+ c.$table.find( c.selectorRemove ).remove();
+ // rebuild parsers
+ ts.setupParsers( c );
+ // rebuild the cache map
+ ts.buildCache( c );
+ ts.checkResort( c, resort, callback );
+ },
+
+ /*
+ ▄█████ ▄████▄ █████▄ ██████ ██ █████▄ ▄████▄
+ ▀█▄ ██ ██ ██▄▄██ ██ ██ ██ ██ ██ ▄▄▄
+ ▀█▄ ██ ██ ██▀██ ██ ██ ██ ██ ██ ▀██
+ █████▀ ▀████▀ ██ ██ ██ ██ ██ ██ ▀████▀
+ */
+ initSort : function( c, cell, event ) {
+ if ( c.table.isUpdating ) {
+ // let any updates complete before initializing a sort
+ return setTimeout( function() {
+ ts.initSort( c, cell, event );
+ }, 50 );
+ }
+
+ var arry, indx, headerIndx, dir, temp, tmp, $header,
+ notMultiSort = !event[ c.sortMultiSortKey ],
+ table = c.table,
+ len = c.$headers.length,
+ th = ts.getClosest( $( cell ), 'th, td' ),
+ col = parseInt( th.attr( 'data-column' ), 10 ),
+ sortedBy = event.type === 'mouseup' ? 'user' : event.type,
+ order = c.sortVars[ col ].order;
+ th = th[0];
+ // Only call sortStart if sorting is enabled
+ c.$table.triggerHandler( 'sortStart', table );
+ // get current column sort order
+ tmp = ( c.sortVars[ col ].count + 1 ) % order.length;
+ c.sortVars[ col ].count = event[ c.sortResetKey ] ? 2 : tmp;
+ // reset all sorts on non-current column - issue #30
+ if ( c.sortRestart ) {
+ for ( headerIndx = 0; headerIndx < len; headerIndx++ ) {
+ $header = c.$headers.eq( headerIndx );
+ tmp = parseInt( $header.attr( 'data-column' ), 10 );
+ // only reset counts on columns that weren't just clicked on and if not included in a multisort
+ if ( col !== tmp && ( notMultiSort || $header.hasClass( ts.css.sortNone ) ) ) {
+ c.sortVars[ tmp ].count = -1;
+ }
+ }
+ }
+ // user only wants to sort on one column
+ if ( notMultiSort ) {
+ $.each( c.sortVars, function( i ) {
+ c.sortVars[ i ].sortedBy = '';
+ });
+ // flush the sort list
+ c.sortList = [];
+ c.last.sortList = [];
+ if ( c.sortForce !== null ) {
+ arry = c.sortForce;
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col ) {
+ c.sortList[ c.sortList.length ] = arry[ indx ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortForce';
+ }
+ }
+ }
+ // add column to sort list
+ dir = order[ c.sortVars[ col ].count ];
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ // multi column sorting
+ } else {
+ // get rid of the sortAppend before adding more - fixes issue #115 & #523
+ c.sortList = $.extend( [], c.last.sortList );
+
+ // the user has clicked on an already sorted column
+ if ( ts.isValueInArray( col, c.sortList ) >= 0 ) {
+ // reverse the sorting direction
+ c.sortVars[ col ].sortedBy = sortedBy;
+ for ( indx = 0; indx < c.sortList.length; indx++ ) {
+ tmp = c.sortList[ indx ];
+ if ( tmp[ 0 ] === col ) {
+ // order.count seems to be incorrect when compared to cell.count
+ tmp[ 1 ] = order[ c.sortVars[ col ].count ];
+ if ( tmp[1] === 2 ) {
+ c.sortList.splice( indx, 1 );
+ c.sortVars[ col ].count = -1;
+ }
+ }
+ }
+ } else {
+ // add column to sort list array
+ dir = order[ c.sortVars[ col ].count ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ }
+ }
+ // save sort before applying sortAppend
+ c.last.sortList = $.extend( [], c.sortList );
+ if ( c.sortList.length && c.sortAppend ) {
+ arry = $.isArray( c.sortAppend ) ? c.sortAppend : c.sortAppend[ c.sortList[ 0 ][ 0 ] ];
+ if ( !ts.isEmptyObject( arry ) ) {
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col && ts.isValueInArray( arry[ indx ][ 0 ], c.sortList ) < 0 ) {
+ dir = arry[ indx ][ 1 ];
+ temp = ( '' + dir ).match( /^(a|d|s|o|n)/ );
+ if ( temp ) {
+ tmp = c.sortList[ 0 ][ 1 ];
+ switch ( temp[ 0 ] ) {
+ case 'd' :
+ dir = 1;
+ break;
+ case 's' :
+ dir = tmp;
+ break;
+ case 'o' :
+ dir = tmp === 0 ? 1 : 0;
+ break;
+ case 'n' :
+ dir = ( tmp + 1 ) % order.length;
+ break;
+ default:
+ dir = 0;
+ break;
+ }
+ }
+ c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortAppend';
+ }
+ }
+ }
+ }
+ // sortBegin event triggered immediately before the sort
+ c.$table.triggerHandler( 'sortBegin', table );
+ // setTimeout needed so the processing icon shows up
+ setTimeout( function() {
+ // set css for headers
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ }, 1 );
+ },
+
+ // sort multiple columns
+ multisort : function( c ) { /*jshint loopfunc:true */
+ var tbodyIndex, sortTime, colMax, rows, tmp,
+ table = c.table,
+ sorter = [],
+ dir = 0,
+ textSorter = c.textSorter || '',
+ sortList = c.sortList,
+ sortLen = sortList.length,
+ len = c.$tbodies.length;
+ if ( c.serverSideSorting || ts.isEmptyObject( c.cache ) ) {
+ // empty table - fixes #206/#346
+ return;
+ }
+ if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
+ // cache textSorter to optimize speed
+ if ( typeof textSorter === 'object' ) {
+ colMax = c.columns;
+ while ( colMax-- ) {
+ tmp = ts.getColumnData( table, textSorter, colMax );
+ if ( typeof tmp === 'function' ) {
+ sorter[ colMax ] = tmp;
+ }
+ }
+ }
+ for ( tbodyIndex = 0; tbodyIndex < len; tbodyIndex++ ) {
+ colMax = c.cache[ tbodyIndex ].colMax;
+ rows = c.cache[ tbodyIndex ].normalized;
+
+ rows.sort( function( a, b ) {
+ var sortIndex, num, col, order, sort, x, y;
+ // rows is undefined here in IE, so don't use it!
+ for ( sortIndex = 0; sortIndex < sortLen; sortIndex++ ) {
+ col = sortList[ sortIndex ][ 0 ];
+ order = sortList[ sortIndex ][ 1 ];
+ // sort direction, true = asc, false = desc
+ dir = order === 0;
+
+ if ( c.sortStable && a[ col ] === b[ col ] && sortLen === 1 ) {
+ return a[ c.columns ].order - b[ c.columns ].order;
+ }
+
+ // fallback to natural sort since it is more robust
+ num = /n/i.test( ts.getSortType( c.parsers, col ) );
+ if ( num && c.strings[ col ] ) {
+ // sort strings in numerical columns
+ if ( typeof ( ts.string[ c.strings[ col ] ] ) === 'boolean' ) {
+ num = ( dir ? 1 : -1 ) * ( ts.string[ c.strings[ col ] ] ? -1 : 1 );
+ } else {
+ num = ( c.strings[ col ] ) ? ts.string[ c.strings[ col ] ] || 0 : 0;
+ }
+ // fall back to built-in numeric sort
+ // var sort = $.tablesorter['sort' + s]( a[col], b[col], dir, colMax[col], table );
+ sort = c.numberSorter ? c.numberSorter( a[ col ], b[ col ], dir, colMax[ col ], table ) :
+ ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], num, colMax[ col ], col, c );
+ } else {
+ // set a & b depending on sort direction
+ x = dir ? a : b;
+ y = dir ? b : a;
+ // text sort function
+ if ( typeof textSorter === 'function' ) {
+ // custom OVERALL text sorter
+ sort = textSorter( x[ col ], y[ col ], dir, col, table );
+ } else if ( typeof sorter[ col ] === 'function' ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ sort = sorter[ col ]( x[ col ], y[ col ], dir, col, table );
+ } else {
+ // fall back to natural sort
+ sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ] || '', b[ col ] || '', col, c );
+ }
+ }
+ if ( sort ) { return sort; }
+ }
+ return a[ c.columns ].order - b[ c.columns ].order;
+ });
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
+ }
+ },
+
+ resortComplete : function( c, callback ) {
+ if ( c.table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', c.table );
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ checkResort : function( c, resort, callback ) {
+ var sortList = $.isArray( resort ) ? resort : c.sortList,
+ // if no resort parameter is passed, fallback to config.resort (true by default)
+ resrt = typeof resort === 'undefined' ? c.resort : resort;
+ // don't try to resort if the table is still processing
+ // this will catch spamming of the updateCell method
+ if ( resrt !== false && !c.serverSideSorting && !c.table.isProcessing ) {
+ if ( sortList.length ) {
+ ts.sortOn( c, sortList, function() {
+ ts.resortComplete( c, callback );
+ }, true );
+ } else {
+ ts.sortReset( c, function() {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ } );
+ }
+ } else {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ }
+ },
+
+ sortOn : function( c, list, callback, init ) {
+ var indx,
+ table = c.table;
+ c.$table.triggerHandler( 'sortStart', table );
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].sortedBy = ts.isValueInArray( indx, list ) > -1 ? 'sorton' : '';
+ }
+ // update header count index
+ ts.updateHeaderSortCount( c, list );
+ // set css for headers
+ ts.setHeadersCss( c );
+ // fixes #346
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ c.$table.triggerHandler( 'sortBegin', table );
+ // sort the table and append it to the dom
+ ts.multisort( c );
+ ts.appendCache( c, init );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ ts.applyWidget( table );
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ sortReset : function( c, callback ) {
+ c.sortList = [];
+ var indx;
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].count = -1;
+ c.sortVars[ indx ].sortedBy = '';
+ }
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ getSortType : function( parsers, column ) {
+ return ( parsers && parsers[ column ] ) ? parsers[ column ].type || '' : '';
+ },
+
+ getOrder : function( val ) {
+ // look for 'd' in 'desc' order; return true
+ return ( /^d/i.test( val ) || val === 1 );
+ },
+
+ // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
+ sortNatural : function( a, b ) {
+ if ( a === b ) { return 0; }
+ a = ( a || '' ).toString();
+ b = ( b || '' ).toString();
+ var aNum, bNum, aFloat, bFloat, indx, max,
+ regex = ts.regex;
+ // first try and sort Hex codes
+ if ( regex.hex.test( b ) ) {
+ aNum = parseInt( a.match( regex.hex ), 16 );
+ bNum = parseInt( b.match( regex.hex ), 16 );
+ if ( aNum < bNum ) { return -1; }
+ if ( aNum > bNum ) { return 1; }
+ }
+ // chunk/tokenize
+ aNum = a.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ bNum = b.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ max = Math.max( aNum.length, bNum.length );
+ // natural sorting through split numeric strings and default strings
+ for ( indx = 0; indx < max; indx++ ) {
+ // find floats not starting with '0', string or 0 if not defined
+ aFloat = isNaN( aNum[ indx ] ) ? aNum[ indx ] || 0 : parseFloat( aNum[ indx ] ) || 0;
+ bFloat = isNaN( bNum[ indx ] ) ? bNum[ indx ] || 0 : parseFloat( bNum[ indx ] ) || 0;
+ // handle numeric vs string comparison - number < string - (Kyle Adams)
+ if ( isNaN( aFloat ) !== isNaN( bFloat ) ) { return isNaN( aFloat ) ? 1 : -1; }
+ // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
+ if ( typeof aFloat !== typeof bFloat ) {
+ aFloat += '';
+ bFloat += '';
+ }
+ if ( aFloat < bFloat ) { return -1; }
+ if ( aFloat > bFloat ) { return 1; }
+ }
+ return 0;
+ },
+
+ sortNaturalAsc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ return ts.sortNatural( a, b );
+ },
+
+ sortNaturalDesc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ return ts.sortNatural( b, a );
+ },
+
+ // basic alphabetical sort
+ sortText : function( a, b ) {
+ return a > b ? 1 : ( a < b ? -1 : 0 );
+ },
+
+ // return text string value by adding up ascii value
+ // so the text is somewhat sorted when using a digital sort
+ // this is NOT an alphanumeric sort
+ getTextValue : function( val, num, max ) {
+ if ( max ) {
+ // make sure the text value is greater than the max numerical value (max)
+ var indx,
+ len = val ? val.length : 0,
+ n = max + num;
+ for ( indx = 0; indx < len; indx++ ) {
+ n += val.charCodeAt( indx );
+ }
+ return num * n;
+ }
+ return 0;
+ },
+
+ sortNumericAsc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return a - b;
+ },
+
+ sortNumericDesc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return b - a;
+ },
+
+ sortNumeric : function( a, b ) {
+ return a - b;
+ },
+
+ /*
+ ██ ██ ██ ██ █████▄ ▄████▄ ██████ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ▄▄▄ ██▄▄ ██ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ▀██ ██▀▀ ██ ▀█▄
+ ███████▀ ██ █████▀ ▀████▀ ██████ ██ █████▀
+ */
+ addWidget : function( widget ) {
+ if ( widget.id && !ts.isEmptyObject( ts.getWidgetById( widget.id ) ) ) {
+ console.warn( '"' + widget.id + '" widget was loaded more than once!' );
+ }
+ ts.widgets[ ts.widgets.length ] = widget;
+ },
+
+ hasWidget : function( $table, name ) {
+ $table = $( $table );
+ return $table.length && $table[ 0 ].config && $table[ 0 ].config.widgetInit[ name ] || false;
+ },
+
+ getWidgetById : function( name ) {
+ var indx, widget,
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id && widget.id.toLowerCase() === name.toLowerCase() ) {
+ return widget;
+ }
+ }
+ },
+
+ applyWidgetOptions : function( table ) {
+ var indx, widget, wo,
+ c = table.config,
+ len = c.widgets.length;
+ if ( len ) {
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( c.widgets[ indx ] );
+ if ( widget && widget.options ) {
+ wo = $.extend( true, {}, widget.options );
+ c.widgetOptions = $.extend( true, wo, c.widgetOptions );
+ // add widgetOptions to defaults for option validator
+ $.extend( true, ts.defaults.widgetOptions, widget.options );
+ }
+ }
+ }
+ },
+
+ addWidgetFromClass : function( table ) {
+ var len, indx,
+ c = table.config,
+ // look for widgets to apply from table class
+ // don't match from 'ui-widget-content'; use \S instead of \w to include widgets
+ // with dashes in the name, e.g. "widget-test-2" extracts out "test-2"
+ regex = '^' + c.widgetClass.replace( ts.regex.templateName, '(\\S+)+' ) + '$',
+ widgetClass = new RegExp( regex, 'g' ),
+ // split up table class (widget id's can include dashes) - stop using match
+ // otherwise only one widget gets extracted, see #1109
+ widgets = ( table.className || '' ).split( ts.regex.spaces );
+ if ( widgets.length ) {
+ len = widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( widgets[ indx ].match( widgetClass ) ) {
+ c.widgets[ c.widgets.length ] = widgets[ indx ].replace( widgetClass, '$1' );
+ }
+ }
+ }
+ },
+
+ applyWidgetId : function( table, id, init ) {
+ table = $(table)[0];
+ var applied, time, name,
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'core'),
+ widget = ts.getWidgetById( id );
+ if ( widget ) {
+ name = widget.id;
+ applied = false;
+ // add widget name to option list so it gets reapplied after sorting, filtering, etc
+ if ( $.inArray( name, c.widgets ) < 0 ) {
+ c.widgets[ c.widgets.length ] = name;
+ }
+ if ( debug ) { time = new Date(); }
+
+ if ( init || !( c.widgetInit[ name ] ) ) {
+ // set init flag first to prevent calling init more than once (e.g. pager)
+ c.widgetInit[ name ] = true;
+ if ( table.hasInitialized ) {
+ // don't reapply widget options on tablesorter init
+ ts.applyWidgetOptions( table );
+ }
+ if ( typeof widget.init === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
+ }
+ widget.init( table, widget, c, wo );
+ }
+ }
+ if ( !init && typeof widget.format === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
+ }
+ widget.format( table, c, wo, false );
+ }
+ if ( debug ) {
+ if ( applied ) {
+ console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ }
+ }
+ },
+
+ applyWidget : function( table, init, callback ) {
+ table = $( table )[ 0 ]; // in case this is called externally
+ var indx, len, names, widget, time,
+ c = table.config,
+ debug = ts.debug(c, 'core'),
+ widgets = [];
+ // prevent numerous consecutive widget applications
+ if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
+ return;
+ }
+ if ( debug ) { time = new Date(); }
+ ts.addWidgetFromClass( table );
+ // prevent "tablesorter-ready" from firing multiple times in a row
+ clearTimeout( c.timerReady );
+ if ( c.widgets.length ) {
+ table.isApplyingWidgets = true;
+ // ensure unique widget ids
+ c.widgets = $.grep( c.widgets, function( val, index ) {
+ return $.inArray( val, c.widgets ) === index;
+ });
+ names = c.widgets || [];
+ len = names.length;
+ // build widget array & add priority as needed
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( names[ indx ] );
+ if ( widget && widget.id ) {
+ // set priority to 10 if not defined
+ if ( !widget.priority ) { widget.priority = 10; }
+ widgets[ indx ] = widget;
+ } else if ( debug ) {
+ console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
+ }
+ }
+ // sort widgets by priority
+ widgets.sort( function( a, b ) {
+ return a.priority < b.priority ? -1 : a.priority === b.priority ? 0 : 1;
+ });
+ // add/update selected widgets
+ len = widgets.length;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id ) {
+ ts.applyWidgetId( table, widget.id, init );
+ }
+ }
+ if ( debug && console.groupEnd ) { console.groupEnd(); }
+ }
+ c.timerReady = setTimeout( function() {
+ table.isApplyingWidgets = false;
+ $.data( table, 'lastWidgetApplication', new Date() );
+ c.$table.triggerHandler( 'tablesorter-ready' );
+ // callback executed on init only
+ if ( !init && typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( debug ) {
+ widget = c.widgets.length;
+ console.log( 'Completed ' +
+ ( init === true ? 'initializing ' : 'applying ' ) + widget +
+ ' widget' + ( widget !== 1 ? 's' : '' ) + ts.benchmark( time ) );
+ }
+ }, 10 );
+ },
+
+ removeWidget : function( table, name, refreshing ) {
+ table = $( table )[ 0 ];
+ var index, widget, indx, len,
+ c = table.config;
+ // if name === true, add all widgets from $.tablesorter.widgets
+ if ( name === true ) {
+ name = [];
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id ) {
+ name[ name.length ] = widget.id;
+ }
+ }
+ } else {
+ // name can be either an array of widgets names,
+ // or a space/comma separated list of widget names
+ name = ( $.isArray( name ) ? name.join( ',' ) : name || '' ).toLowerCase().split( /[\s,]+/ );
+ }
+ len = name.length;
+ for ( index = 0; index < len; index++ ) {
+ widget = ts.getWidgetById( name[ index ] );
+ indx = $.inArray( name[ index ], c.widgets );
+ // don't remove the widget from config.widget if refreshing
+ if ( indx >= 0 && refreshing !== true ) {
+ c.widgets.splice( indx, 1 );
+ }
+ if ( widget && widget.remove ) {
+ if ( ts.debug(c, 'core') ) {
+ console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
+ }
+ widget.remove( table, c, c.widgetOptions, refreshing );
+ c.widgetInit[ name[ index ] ] = false;
+ }
+ }
+ c.$table.triggerHandler( 'widgetRemoveEnd', table );
+ },
+
+ refreshWidgets : function( table, doAll, dontapply ) {
+ table = $( table )[ 0 ]; // see issue #243
+ var indx, widget,
+ c = table.config,
+ curWidgets = c.widgets,
+ widgets = ts.widgets,
+ len = widgets.length,
+ list = [],
+ callback = function( table ) {
+ $( table ).triggerHandler( 'refreshComplete' );
+ };
+ // remove widgets not defined in config.widgets, unless doAll is true
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id && ( doAll || $.inArray( widget.id, curWidgets ) < 0 ) ) {
+ list[ list.length ] = widget.id;
+ }
+ }
+ ts.removeWidget( table, list.join( ',' ), true );
+ if ( dontapply !== true ) {
+ // call widget init if
+ ts.applyWidget( table, doAll || false, callback );
+ if ( doAll ) {
+ // apply widget format
+ ts.applyWidget( table, false, callback );
+ }
+ } else {
+ callback( table );
+ }
+ },
+
+ /*
+ ██ ██ ██████ ██ ██ ██ ██████ ██ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▄▄ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀█▄
+ ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀
+ */
+ benchmark : function( diff ) {
+ return ( ' (' + ( new Date().getTime() - diff.getTime() ) + ' ms)' );
+ },
+ // deprecated ts.log
+ log : function() {
+ console.log( arguments );
+ },
+ debug : function(c, name) {
+ return c && (
+ c.debug === true ||
+ typeof c.debug === 'string' && c.debug.indexOf(name) > -1
+ );
+ },
+
+ // $.isEmptyObject from jQuery v1.4
+ isEmptyObject : function( obj ) {
+ /*jshint forin: false */
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isValueInArray : function( column, arry ) {
+ var indx,
+ len = arry && arry.length || 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( arry[ indx ][ 0 ] === column ) {
+ return indx;
+ }
+ }
+ return -1;
+ },
+
+ formatFloat : function( str, table ) {
+ if ( typeof str !== 'string' || str === '' ) { return str; }
+ // allow using formatFloat without a table; defaults to US number format
+ var num,
+ usFormat = table && table.config ? table.config.usNumberFormat !== false :
+ typeof table !== 'undefined' ? table : true;
+ if ( usFormat ) {
+ // US Format - 1,234,567.89 -> 1234567.89
+ str = str.replace( ts.regex.comma, '' );
+ } else {
+ // German Format = 1.234.567,89 -> 1234567.89
+ // French Format = 1 234 567,89 -> 1234567.89
+ str = str.replace( ts.regex.digitNonUS, '' ).replace( ts.regex.comma, '.' );
+ }
+ if ( ts.regex.digitNegativeTest.test( str ) ) {
+ // make (#) into a negative number -> (10) = -10
+ str = str.replace( ts.regex.digitNegativeReplace, '-$1' );
+ }
+ num = parseFloat( str );
+ // return the text instead of zero
+ return isNaN( num ) ? $.trim( str ) : num;
+ },
+
+ isDigit : function( str ) {
+ // replace all unwanted chars and match
+ return isNaN( str ) ?
+ ts.regex.digitTest.test( str.toString().replace( ts.regex.digitReplace, '' ) ) :
+ str !== '';
+ },
+
+ // computeTableHeaderCellIndexes from:
+ // http://www.javascripttoolbox.com/lib/table/examples.php
+ // http://www.javascripttoolbox.com/temp/table_cellindex.html
+ computeColumnIndex : function( $rows, c ) {
+ var i, j, k, l, cell, cells, rowIndex, rowSpan, colSpan, firstAvailCol,
+ // total columns has been calculated, use it to set the matrixrow
+ columns = c && c.columns || 0,
+ matrix = [],
+ matrixrow = new Array( columns );
+ for ( i = 0; i < $rows.length; i++ ) {
+ cells = $rows[ i ].cells;
+ for ( j = 0; j < cells.length; j++ ) {
+ cell = cells[ j ];
+ rowIndex = i;
+ rowSpan = cell.rowSpan || 1;
+ colSpan = cell.colSpan || 1;
+ if ( typeof matrix[ rowIndex ] === 'undefined' ) {
+ matrix[ rowIndex ] = [];
+ }
+ // Find first available column in the first row
+ for ( k = 0; k < matrix[ rowIndex ].length + 1; k++ ) {
+ if ( typeof matrix[ rowIndex ][ k ] === 'undefined' ) {
+ firstAvailCol = k;
+ break;
+ }
+ }
+ // jscs:disable disallowEmptyBlocks
+ if ( columns && cell.cellIndex === firstAvailCol ) {
+ // don't to anything
+ } else if ( cell.setAttribute ) {
+ // jscs:enable disallowEmptyBlocks
+ // add data-column (setAttribute = IE8+)
+ cell.setAttribute( 'data-column', firstAvailCol );
+ } else {
+ // remove once we drop support for IE7 - 1/12/2016
+ $( cell ).attr( 'data-column', firstAvailCol );
+ }
+ for ( k = rowIndex; k < rowIndex + rowSpan; k++ ) {
+ if ( typeof matrix[ k ] === 'undefined' ) {
+ matrix[ k ] = [];
+ }
+ matrixrow = matrix[ k ];
+ for ( l = firstAvailCol; l < firstAvailCol + colSpan; l++ ) {
+ matrixrow[ l ] = 'x';
+ }
+ }
+ }
+ }
+ ts.checkColumnCount($rows, matrix, matrixrow.length);
+ return matrixrow.length;
+ },
+
+ checkColumnCount : function($rows, matrix, columns) {
+ // this DOES NOT report any tbody column issues, except for the math and
+ // and column selector widgets
+ var i, len,
+ valid = true,
+ cells = [];
+ for ( i = 0; i < matrix.length; i++ ) {
+ // some matrix entries are undefined when testing the footer because
+ // it is using the rowIndex property
+ if ( matrix[i] ) {
+ len = matrix[i].length;
+ if ( matrix[i].length !== columns ) {
+ valid = false;
+ break;
+ }
+ }
+ }
+ if ( !valid ) {
+ $rows.each( function( indx, el ) {
+ var cell = el.parentElement.nodeName;
+ if ( cells.indexOf( cell ) < 0 ) {
+ cells.push( cell );
+ }
+ });
+ console.error(
+ 'Invalid or incorrect number of columns in the ' +
+ cells.join( ' or ' ) + '; expected ' + columns +
+ ', but found ' + len + ' columns'
+ );
+ }
+ },
+
+ // automatically add a colgroup with col elements set to a percentage width
+ fixColumnWidth : function( table ) {
+ table = $( table )[ 0 ];
+ var overallWidth, percent, $tbodies, len, index,
+ c = table.config,
+ $colgroup = c.$table.children( 'colgroup' );
+ // remove plugin-added colgroup, in case we need to refresh the widths
+ if ( $colgroup.length && $colgroup.hasClass( ts.css.colgroup ) ) {
+ $colgroup.remove();
+ }
+ if ( c.widthFixed && c.$table.children( 'colgroup' ).length === 0 ) {
+ $colgroup = $( '<colgroup class="' + ts.css.colgroup + '">' );
+ overallWidth = c.$table.width();
+ // only add col for visible columns - fixes #371
+ $tbodies = c.$tbodies.find( 'tr:first' ).children( ':visible' );
+ len = $tbodies.length;
+ for ( index = 0; index < len; index++ ) {
+ percent = parseInt( ( $tbodies.eq( index ).width() / overallWidth ) * 1000, 10 ) / 10 + '%';
+ $colgroup.append( $( '<col>' ).css( 'width', percent ) );
+ }
+ c.$table.prepend( $colgroup );
+ }
+ },
+
+ // get sorter, string, empty, etc options for each column from
+ // jQuery data, metadata, header option or header class name ('sorter-false')
+ // priority = jQuery data > meta > headers option > header class name
+ getData : function( header, configHeader, key ) {
+ var meta, cl4ss,
+ val = '',
+ $header = $( header );
+ if ( !$header.length ) { return ''; }
+ meta = $.metadata ? $header.metadata() : false;
+ cl4ss = ' ' + ( $header.attr( 'class' ) || '' );
+ if ( typeof $header.data( key ) !== 'undefined' ||
+ typeof $header.data( key.toLowerCase() ) !== 'undefined' ) {
+ // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder'
+ // 'data-sort-initial-order' is assigned to 'sortInitialOrder'
+ val += $header.data( key ) || $header.data( key.toLowerCase() );
+ } else if ( meta && typeof meta[ key ] !== 'undefined' ) {
+ val += meta[ key ];
+ } else if ( configHeader && typeof configHeader[ key ] !== 'undefined' ) {
+ val += configHeader[ key ];
+ } else if ( cl4ss !== ' ' && cl4ss.match( ' ' + key + '-' ) ) {
+ // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser'
+ val = cl4ss.match( new RegExp( '\\s' + key + '-([\\w-]+)' ) )[ 1 ] || '';
+ }
+ return $.trim( val );
+ },
+
+ getColumnData : function( table, obj, indx, getCell, $headers ) {
+ if ( typeof obj !== 'object' || obj === null ) {
+ return obj;
+ }
+ table = $( table )[ 0 ];
+ var $header, key,
+ c = table.config,
+ $cells = ( $headers || c.$headers ),
+ // c.$headerIndexed is not defined initially
+ $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
+ $cells.find( '[data-column="' + indx + '"]:last' );
+ if ( typeof obj[ indx ] !== 'undefined' ) {
+ return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
+ }
+ for ( key in obj ) {
+ if ( typeof key === 'string' ) {
+ $header = $cell
+ // header cell with class/id
+ .filter( key )
+ // find elements within the header cell with cell/id
+ .add( $cell.find( key ) );
+ if ( $header.length ) {
+ return obj[ key ];
+ }
+ }
+ }
+ return;
+ },
+
+ // *** Process table ***
+ // add processing indicator
+ isProcessing : function( $table, toggle, $headers ) {
+ $table = $( $table );
+ var c = $table[ 0 ].config,
+ // default to all headers
+ $header = $headers || $table.find( '.' + ts.css.header );
+ if ( toggle ) {
+ // don't use sortList if custom $headers used
+ if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) {
+ // get headers from the sortList
+ $header = $header.filter( function() {
+ // get data-column from attr to keep compatibility with jQuery 1.2.6
+ return this.sortDisabled ?
+ false :
+ ts.isValueInArray( parseFloat( $( this ).attr( 'data-column' ) ), c.sortList ) >= 0;
+ });
+ }
+ $table.add( $header ).addClass( ts.css.processing + ' ' + c.cssProcessing );
+ } else {
+ $table.add( $header ).removeClass( ts.css.processing + ' ' + c.cssProcessing );
+ }
+ },
+
+ // detach tbody but save the position
+ // don't use tbody because there are portions that look for a tbody index (updateCell)
+ processTbody : function( table, $tb, getIt ) {
+ table = $( table )[ 0 ];
+ if ( getIt ) {
+ table.isProcessing = true;
+ $tb.before( '<colgroup class="tablesorter-savemyplace"/>' );
+ return $.fn.detach ? $tb.detach() : $tb.remove();
+ }
+ var holdr = $( table ).find( 'colgroup.tablesorter-savemyplace' );
+ $tb.insertAfter( holdr );
+ holdr.remove();
+ table.isProcessing = false;
+ },
+
+ clearTableBody : function( table ) {
+ $( table )[ 0 ].config.$tbodies.children().detach();
+ },
+
+ // used when replacing accented characters during sorting
+ characterEquivalents : {
+ 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå
+ 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ
+ 'c' : '\u00e7\u0107\u010d', // çćč
+ 'C' : '\u00c7\u0106\u010c', // ÇĆČ
+ 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę
+ 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ
+ 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı
+ 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ
+ 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6\u014d', // óòôõöō
+ 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6\u014c', // ÓÒÔÕÖŌ
+ 'ss': '\u00df', // ß (s sharp)
+ 'SS': '\u1e9e', // ẞ (Capital sharp s)
+ 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů
+ 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ
+ },
+
+ replaceAccents : function( str ) {
+ var chr,
+ acc = '[',
+ eq = ts.characterEquivalents;
+ if ( !ts.characterRegex ) {
+ ts.characterRegexArray = {};
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ acc += eq[ chr ];
+ ts.characterRegexArray[ chr ] = new RegExp( '[' + eq[ chr ] + ']', 'g' );
+ }
+ }
+ ts.characterRegex = new RegExp( acc + ']' );
+ }
+ if ( ts.characterRegex.test( str ) ) {
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ str = str.replace( ts.characterRegexArray[ chr ], chr );
+ }
+ }
+ }
+ return str;
+ },
+
+ validateOptions : function( c ) {
+ var setting, setting2, typ, timer,
+ // ignore options containing an array
+ ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
+ orig = c.originalSettings;
+ if ( orig ) {
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ for ( setting in orig ) {
+ typ = typeof ts.defaults[setting];
+ if ( typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '" option not recognized' );
+ } else if ( typ === 'object' ) {
+ for ( setting2 in orig[setting] ) {
+ typ = ts.defaults[setting] && typeof ts.defaults[setting][setting2];
+ if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
+ }
+ }
+ }
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'validate options time:' + ts.benchmark( timer ) );
+ }
+ }
+ },
+
+ // restore headers
+ restoreHeaders : function( table ) {
+ var index, $cell,
+ c = $( table )[ 0 ].config,
+ $headers = c.$table.find( c.selectorHeaders ),
+ len = $headers.length;
+ // don't use c.$headers here in case header cells were swapped
+ for ( index = 0; index < len; index++ ) {
+ $cell = $headers.eq( index );
+ // only restore header cells if it is wrapped
+ // because this is also used by the updateAll method
+ if ( $cell.find( '.' + ts.css.headerIn ).length ) {
+ $cell.html( c.headerContent[ index ] );
+ }
+ }
+ },
+
+ destroy : function( table, removeClasses, callback ) {
+ table = $( table )[ 0 ];
+ if ( !table.hasInitialized ) { return; }
+ // remove all widgets
+ ts.removeWidget( table, true, false );
+ var events,
+ $t = $( table ),
+ c = table.config,
+ $h = $t.find( 'thead:first' ),
+ $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
+ $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
+ if ( removeClasses === false && $.inArray( 'uitheme', c.widgets ) >= 0 ) {
+ // reapply uitheme classes, in case we want to maintain appearance
+ $t.triggerHandler( 'applyWidgetId', [ 'uitheme' ] );
+ $t.triggerHandler( 'applyWidgetId', [ 'zebra' ] );
+ }
+ // remove widget added rows, just in case
+ $h.find( 'tr' ).not( $r ).remove();
+ // disable tablesorter - not using .unbind( namespace ) because namespacing was
+ // added in jQuery v1.4.3 - see http://api.jquery.com/event.namespace/
+ events = 'sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton ' +
+ 'appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave ' +
+ 'keypress sortBegin sortEnd resetToLoadState '.split( ' ' )
+ .join( c.namespace + ' ' );
+ $t
+ .removeData( 'tablesorter' )
+ .unbind( events.replace( ts.regex.spaces, ' ' ) );
+ c.$headers
+ .add( $f )
+ .removeClass( [ ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone ].join( ' ' ) )
+ .removeAttr( 'data-column' )
+ .removeAttr( 'aria-label' )
+ .attr( 'aria-disabled', 'true' );
+ $r
+ .find( c.selectorSort )
+ .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) );
+ ts.restoreHeaders( table );
+ $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false );
+ $t.removeClass(c.namespace.slice(1));
+ // clear flag in case the plugin is initialized again
+ table.hasInitialized = false;
+ delete table.config.cache;
+ if ( typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'tablesorter has been removed' );
+ }
+ }
+
+ };
+
+ $.fn.tablesorter = function( settings ) {
+ return this.each( function() {
+ var table = this,
+ // merge & extend config options
+ c = $.extend( true, {}, ts.defaults, settings, ts.instanceMethods );
+ // save initial settings
+ c.originalSettings = settings;
+ // create a table from data (build table widget)
+ if ( !table.hasInitialized && ts.buildTable && this.nodeName !== 'TABLE' ) {
+ // return the table (in case the original target is the table's container)
+ ts.buildTable( table, c );
+ } else {
+ ts.setup( table, c );
+ }
+ });
+ };
+
+ // set up debug logs
+ if ( !( window.console && window.console.log ) ) {
+ // access $.tablesorter.logs for browsers that don't have a console...
+ ts.logs = [];
+ /*jshint -W020 */
+ console = {};
+ console.log = console.warn = console.error = console.table = function() {
+ var arg = arguments.length > 1 ? arguments : arguments[0];
+ ts.logs[ ts.logs.length ] = { date: Date.now(), log: arg };
+ };
+ }
+
+ // add default parsers
+ ts.addParser({
+ id : 'no-parser',
+ is : function() {
+ return false;
+ },
+ format : function() {
+ return '';
+ },
+ type : 'text'
+ });
+
+ ts.addParser({
+ id : 'text',
+ is : function() {
+ return true;
+ },
+ format : function( str, table ) {
+ var c = table.config;
+ if ( str ) {
+ str = $.trim( c.ignoreCase ? str.toLocaleLowerCase() : str );
+ str = c.sortLocaleCompare ? ts.replaceAccents( str ) : str;
+ }
+ return str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.nondigit = /[^\w,. \-()]/g;
+ ts.addParser({
+ id : 'digit',
+ is : function( str ) {
+ return ts.isDigit( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.currencyReplace = /[+\-,. ]/g;
+ ts.regex.currencyTest = /^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/;
+ ts.addParser({
+ id : 'currency',
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.currencyReplace, '' );
+ // test for £$€¤¥¢
+ return ts.regex.currencyTest.test( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme
+ // now, this regex can be updated before initialization
+ ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
+ ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\/(www\.)?/;
+ ts.addParser({
+ id : 'url',
+ is : function( str ) {
+ return ts.regex.urlProtocolTest.test( str );
+ },
+ format : function( str ) {
+ return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.dash = /-/g;
+ ts.regex.isoDate = /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/;
+ ts.addParser({
+ id : 'isoDate',
+ is : function( str ) {
+ return ts.regex.isoDate.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.percent = /%/g;
+ ts.regex.percentTest = /(\d\s*?%|%\s*?\d)/;
+ ts.addParser({
+ id : 'percent',
+ is : function( str ) {
+ return ts.regex.percentTest.test( str ) && str.length < 15;
+ },
+ format : function( str, table ) {
+ return str ? ts.formatFloat( str.replace( ts.regex.percent, '' ), table ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // added image parser to core v2.17.9
+ ts.addParser({
+ id : 'image',
+ is : function( str, table, node, $node ) {
+ return $node.find( 'img' ).length > 0;
+ },
+ format : function( str, table, cell ) {
+ return $( cell ).find( 'img' ).attr( table.config.imgAttr || 'alt' ) || str;
+ },
+ parsed : true, // filter widget flag
+ type : 'text'
+ });
+
+ ts.regex.dateReplace = /(\S)([AP]M)$/i; // used by usLongDate & time parser
+ ts.regex.usLongDateTest1 = /^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i;
+ ts.regex.usLongDateTest2 = /^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i;
+ ts.addParser({
+ id : 'usLongDate',
+ is : function( str ) {
+ // two digit years are not allowed cross-browser
+ // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
+ return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included
+ ts.regex.shortDateTest = /(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/;
+ // escaped "-" because JSHint in Firefox was showing it as an error
+ ts.regex.shortDateReplace = /[\-.,]/g;
+ // XXY covers MDY & DMY formats
+ ts.regex.shortDateXXY = /(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/;
+ ts.regex.shortDateYMD = /(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/;
+ ts.convertFormat = function( dateString, format ) {
+ dateString = ( dateString || '' )
+ .replace( ts.regex.spaces, ' ' )
+ .replace( ts.regex.shortDateReplace, '/' );
+ if ( format === 'mmddyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$1/$2' );
+ } else if ( format === 'ddmmyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$2/$1' );
+ } else if ( format === 'yyyymmdd' ) {
+ dateString = dateString.replace( ts.regex.shortDateYMD, '$1/$2/$3' );
+ }
+ var date = new Date( dateString );
+ return date instanceof Date && isFinite( date ) ? date.getTime() : '';
+ };
+
+ ts.addParser({
+ id : 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd'
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.spaces, ' ' ).replace( ts.regex.shortDateReplace, '/' );
+ return ts.regex.shortDateTest.test( str );
+ },
+ format : function( str, table, cell, cellIndex ) {
+ if ( str ) {
+ var c = table.config,
+ $header = c.$headerIndexed[ cellIndex ],
+ format = $header.length && $header.data( 'dateFormat' ) ||
+ ts.getData( $header, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat' ) ||
+ c.dateFormat;
+ // save format because getData can be slow...
+ if ( $header.length ) {
+ $header.data( 'dateFormat', format );
+ }
+ return ts.convertFormat( str, format ) || str;
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ // match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk
+ ts.regex.timeTest = /^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i;
+ ts.regex.timeMatch = /(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i;
+ ts.addParser({
+ id : 'time',
+ is : function( str ) {
+ return ts.regex.timeTest.test( str );
+ },
+ format : function( str ) {
+ // isolate time... ignore month, day and year
+ var temp,
+ timePart = ( str || '' ).match( ts.regex.timeMatch ),
+ orig = new Date( str ),
+ // no time component? default to 00:00 by leaving it out, but only if str is defined
+ time = str && ( timePart !== null ? timePart[ 0 ] : '00:00 AM' ),
+ date = time ? new Date( '2000/01/01 ' + time.replace( ts.regex.dateReplace, '$1 $2' ) ) : time;
+ if ( date instanceof Date && isFinite( date ) ) {
+ temp = orig instanceof Date && isFinite( orig ) ? orig.getTime() : 0;
+ // if original string was a valid date, add it to the decimal so the column sorts in some kind of order
+ // luckily new Date() ignores the decimals
+ return temp ? parseFloat( date.getTime() + '.' + orig.getTime() ) : date.getTime();
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ ts.addParser({
+ id : 'metadata',
+ is : function() {
+ return false;
+ },
+ format : function( str, table, cell ) {
+ var c = table.config,
+ p = ( !c.parserMetadataName ) ? 'sortValue' : c.parserMetadataName;
+ return $( cell ).metadata()[ p ];
+ },
+ type : 'numeric'
+ });
+
+ /*
+ ██████ ██████ █████▄ █████▄ ▄████▄
+ ▄█▀ ██▄▄ ██▄▄██ ██▄▄██ ██▄▄██
+ ▄█▀ ██▀▀ ██▀▀██ ██▀▀█ ██▀▀██
+ ██████ ██████ █████▀ ██ ██ ██ ██
+ */
+ // add default widgets
+ ts.addWidget({
+ id : 'zebra',
+ priority : 90,
+ format : function( table, c, wo ) {
+ var $visibleRows, $row, count, isEven, tbodyIndex, rowIndex, len,
+ child = new RegExp( c.cssChildRow, 'i' ),
+ $tbodies = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody:not(.' + c.cssInfoBlock + ')' ) );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ // loop through the visible rows
+ count = 0;
+ $visibleRows = $tbodies.eq( tbodyIndex ).children( 'tr:visible' ).not( c.selectorRemove );
+ len = $visibleRows.length;
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ $row = $visibleRows.eq( rowIndex );
+ // style child rows the same way the parent row was styled
+ if ( !child.test( $row[ 0 ].className ) ) { count++; }
+ isEven = ( count % 2 === 0 );
+ $row
+ .removeClass( wo.zebra[ isEven ? 1 : 0 ] )
+ .addClass( wo.zebra[ isEven ? 0 : 1 ] );
+ }
+ }
+ },
+ remove : function( table, c, wo, refreshing ) {
+ if ( refreshing ) { return; }
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( toRemove );
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ }
+ });
+
+})( jQuery );
+return jQuery.tablesorter;}));
diff --git a/sitestatic/jquery.tablesorter-2.31.0.min.js b/sitestatic/jquery.tablesorter-2.31.0.min.js
new file mode 100644
index 00000000..1fc5792f
--- /dev/null
+++ b/sitestatic/jquery.tablesorter-2.31.0.min.js
@@ -0,0 +1 @@
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(A){"use strict";var L=A.tablesorter={version:"2.31.0",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",duplicateSpan:!0,textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,initWidgets:!0,widgetClass:"widget-{name}",widgets:[],widgetOptions:{zebra:["even","odd"]},initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssIconDisabled:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[],globalize:0,imgAttr:0},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},keyCodes:{enter:13},dates:{},instanceMethods:{},setup:function(t,r){if(t&&t.tHead&&0!==t.tBodies.length&&!0!==t.hasInitialized){var e,o="",s=A(t),a=A.metadata;t.hasInitialized=!1,t.isProcessing=!0,t.config=r,A.data(t,"tablesorter",r),L.debug(r,"core")&&(console[console.group?"group":"log"]("Initializing tablesorter v"+L.version),A.data(t,"startoveralltimer",new Date)),r.supportsDataObject=((e=A.fn.jquery.split("."))[0]=parseInt(e[0],10),1<e[0]||1===e[0]&&4<=parseInt(e[1],10)),r.emptyTo=r.emptyTo.toLowerCase(),r.stringTo=r.stringTo.toLowerCase(),r.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(s.attr("class"))||(o=""!==r.theme?" tablesorter-"+r.theme:""),r.namespace?r.namespace="."+r.namespace.replace(L.regex.nonWord,""):r.namespace=".tablesorter"+Math.random().toString(16).slice(2),r.table=t,r.$table=s.addClass(L.css.table+" "+r.tableClass+o+" "+r.namespace.slice(1)).attr("role","grid"),r.$headers=s.find(r.selectorHeaders),r.$table.children().children("tr").attr("role","row"),r.$tbodies=s.children("tbody:not(."+r.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),r.$table.children("caption").length&&((o=r.$table.children("caption")[0]).id||(o.id=r.namespace.slice(1)+"caption"),r.$table.attr("aria-labelledby",o.id)),r.widgetInit={},r.textExtraction=r.$table.attr("data-text-extraction")||r.textExtraction||"basic",L.buildHeaders(r),L.fixColumnWidth(t),L.addWidgetFromClass(t),L.applyWidgetOptions(t),L.setupParsers(r),r.totalRows=0,r.debug&&L.validateOptions(r),r.delayInit||L.buildCache(r),L.bindEvents(t,r.$headers,!0),L.bindMethods(r),r.supportsDataObject&&void 0!==s.data().sortlist?r.sortList=s.data().sortlist:a&&s.metadata()&&s.metadata().sortlist&&(r.sortList=s.metadata().sortlist),L.applyWidget(t,!0),0<r.sortList.length?L.sortOn(r,r.sortList,{},!r.initWidgets):(L.setHeadersCss(r),r.initWidgets&&L.applyWidget(t,!1)),r.showProcessing&&s.unbind("sortBegin"+r.namespace+" sortEnd"+r.namespace).bind("sortBegin"+r.namespace+" sortEnd"+r.namespace,function(e){clearTimeout(r.timerProcessing),L.isProcessing(t),"sortBegin"===e.type&&(r.timerProcessing=setTimeout(function(){L.isProcessing(t,!0)},500))}),t.hasInitialized=!0,t.isProcessing=!1,L.debug(r,"core")&&(console.log("Overall initialization time:"+L.benchmark(A.data(t,"startoveralltimer"))),L.debug(r,"core")&&console.groupEnd&&console.groupEnd()),s.triggerHandler("tablesorter-initialized",t),"function"==typeof r.initialized&&r.initialized(t)}else L.debug(r,"core")&&(t.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody",t))},bindMethods:function(r){var e=r.$table,t=r.namespace,o="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(t+" ");e.unbind(o.replace(L.regex.spaces," ")).bind("sortReset"+t,function(e,t){e.stopPropagation(),L.sortReset(this.config,function(e){e.isApplyingWidgets?setTimeout(function(){L.applyWidget(e,"",t)},100):L.applyWidget(e,"",t)})}).bind("updateAll"+t,function(e,t,r){e.stopPropagation(),L.updateAll(this.config,t,r)}).bind("update"+t+" updateRows"+t,function(e,t,r){e.stopPropagation(),L.update(this.config,t,r)}).bind("updateHeaders"+t,function(e,t){e.stopPropagation(),L.updateHeaders(this.config,t)}).bind("updateCell"+t,function(e,t,r,o){e.stopPropagation(),L.updateCell(this.config,t,r,o)}).bind("addRows"+t,function(e,t,r,o){e.stopPropagation(),L.addRows(this.config,t,r,o)}).bind("updateComplete"+t,function(){this.isUpdating=!1}).bind("sorton"+t,function(e,t,r,o){e.stopPropagation(),L.sortOn(this.config,t,r,o)}).bind("appendCache"+t,function(e,t,r){e.stopPropagation(),L.appendCache(this.config,r),A.isFunction(t)&&t(this)}).bind("updateCache"+t,function(e,t,r){e.stopPropagation(),L.updateCache(this.config,t,r)}).bind("applyWidgetId"+t,function(e,t){e.stopPropagation(),L.applyWidgetId(this,t)}).bind("applyWidgets"+t,function(e,t){e.stopPropagation(),L.applyWidget(this,!1,t)}).bind("refreshWidgets"+t,function(e,t,r){e.stopPropagation(),L.refreshWidgets(this,t,r)}).bind("removeWidget"+t,function(e,t,r){e.stopPropagation(),L.removeWidget(this,t,r)}).bind("destroy"+t,function(e,t,r){e.stopPropagation(),L.destroy(this,t,r)}).bind("resetToLoadState"+t,function(e){e.stopPropagation(),L.removeWidget(this,!0,!1);var t=A.extend(!0,{},r.originalSettings);(r=A.extend(!0,{},L.defaults,t)).originalSettings=t,this.hasInitialized=!1,L.setup(this,r)})},bindEvents:function(e,t,r){var o,i=(e=A(e)[0]).config,s=i.namespace,d=null;!0!==r&&(t.addClass(s.slice(1)+"_extra_headers"),(o=L.getClosest(t,"table")).length&&"TABLE"===o[0].nodeName&&o[0]!==e&&A(o[0]).addClass(s.slice(1)+"_extra_table")),o=(i.pointerDown+" "+i.pointerUp+" "+i.pointerClick+" sort keyup ").replace(L.regex.spaces," ").split(" ").join(s+" "),t.find(i.selectorSort).add(t.filter(i.selectorSort)).unbind(o).bind(o,function(e,t){var r,o,s,a=A(e.target),n=" "+e.type+" ";if(!(1!==(e.which||e.button)&&!n.match(" "+i.pointerClick+" | sort | keyup ")||" keyup "===n&&e.which!==L.keyCodes.enter||n.match(" "+i.pointerClick+" ")&&void 0!==e.which||n.match(" "+i.pointerUp+" ")&&d!==e.target&&!0!==t)){if(n.match(" "+i.pointerDown+" "))return d=e.target,void("1"===(s=a.jquery.split("."))[0]&&s[1]<4&&e.preventDefault());if(d=null,r=L.getClosest(A(this),"."+L.css.header),L.regex.formElements.test(e.target.nodeName)||a.hasClass(i.cssNoSort)||0<a.parents("."+i.cssNoSort).length||r.hasClass("sorter-false")||0<a.parents("button").length)return!i.cancelSelection;i.delayInit&&L.isEmptyObject(i.cache)&&L.buildCache(i),i.last.clickedIndex=r.attr("data-column")||r.index(),(o=i.$headerIndexed[i.last.clickedIndex][0])&&!o.sortDisabled&&L.initSort(i,o,e)}}),i.cancelSelection&&t.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(d){var e,l,t,r;for(d.headerList=[],d.headerContent=[],d.sortVars=[],L.debug(d,"core")&&(t=new Date),d.columns=L.computeColumnIndex(d.$table.children("thead, tfoot").children("tr")),l=d.cssIcon?'<i class="'+(d.cssIcon===L.css.icon?L.css.icon:d.cssIcon+" "+L.css.icon)+'"></i>':"",d.$headers=A(A.map(d.$table.find(d.selectorHeaders),function(e,t){var r,o,s,a,n,i=A(e);if(!L.getClosest(i,"tr").hasClass(d.cssIgnoreRow))return/(th|td)/i.test(e.nodeName)||(n=L.getClosest(i,"th, td"),i.attr("data-column",n.attr("data-column"))),r=L.getColumnData(d.table,d.headers,t,!0),d.headerContent[t]=i.html(),""===d.headerTemplate||i.find("."+L.css.headerIn).length||(a=d.headerTemplate.replace(L.regex.templateContent,i.html()).replace(L.regex.templateIcon,i.find("."+L.css.icon).length?"":l),d.onRenderTemplate&&(o=d.onRenderTemplate.apply(i,[t,a]))&&"string"==typeof o&&(a=o),i.html('<div class="'+L.css.headerIn+'">'+a+"</div>")),d.onRenderHeader&&d.onRenderHeader.apply(i,[t,d,d.$table]),s=parseInt(i.attr("data-column"),10),e.column=s,n=L.getOrder(L.getData(i,r,"sortInitialOrder")||d.sortInitialOrder),d.sortVars[s]={count:-1,order:n?d.sortReset?[1,0,2]:[1,0]:d.sortReset?[0,1,2]:[0,1],lockedOrder:!1,sortedBy:""},void 0!==(n=L.getData(i,r,"lockedOrder")||!1)&&!1!==n&&(d.sortVars[s].lockedOrder=!0,d.sortVars[s].order=L.getOrder(n)?[1,1]:[0,0]),d.headerList[t]=e,i.addClass(L.css.header+" "+d.cssHeader),L.getClosest(i,"tr").addClass(L.css.headerRow+" "+d.cssHeaderRow).attr("role","row"),d.tabIndex&&i.attr("tabindex",0),e})),d.$headerIndexed=[],r=0;r<d.columns;r++)L.isEmptyObject(d.sortVars[r])&&(d.sortVars[r]={}),e=d.$headers.filter('[data-column="'+r+'"]'),d.$headerIndexed[r]=e.length?e.not(".sorter-false").length?e.not(".sorter-false").filter(":last"):e.filter(":last"):A();d.$table.find(d.selectorHeaders).attr({scope:"col",role:"columnheader"}),L.updateHeader(d),L.debug(d,"core")&&(console.log("Built headers:"+L.benchmark(t)),console.log(d.$headers))},addInstanceMethods:function(e){A.extend(L.instanceMethods,e)},setupParsers:function(e,t){var r,o,s,a,n,i,d,l,c,g,p,u,f,h,m=e.table,b=0,y=L.debug(e,"core"),w={};if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),0===(h=(f=void 0===t?e.$tbodies:t).length))return y?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(y&&(u=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),o={extractors:[],parsers:[]};b<h;){if((r=f[b].rows).length)for(n=0,a=e.columns,i=0;i<a;i++){if((d=e.$headerIndexed[n])&&d.length&&(l=L.getColumnData(m,e.headers,n),p=L.getParserById(L.getData(d,l,"extractor")),g=L.getParserById(L.getData(d,l,"sorter")),c="false"===L.getData(d,l,"parser"),e.empties[n]=(L.getData(d,l,"empty")||e.emptyTo||(e.emptyToBottom?"bottom":"top")).toLowerCase(),e.strings[n]=(L.getData(d,l,"string")||e.stringTo||"max").toLowerCase(),c&&(g=L.getParserById("no-parser")),p||(p=!1),g||(g=L.detectParserForColumn(e,r,-1,n)),y&&(w["("+n+") "+d.text()]={parser:g.id,extractor:p?p.id:"none",string:e.strings[n],empty:e.empties[n]}),o.parsers[n]=g,o.extractors[n]=p,0<(s=d[0].colSpan-1)))for(n+=s,a+=s;0<s+1;)o.parsers[n-s]=g,o.extractors[n-s]=p,s--;n++}b+=o.parsers.length?h:1}y&&(L.isEmptyObject(w)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](w),console.log("Completed detecting parsers"+L.benchmark(u)),console.groupEnd&&console.groupEnd()),e.parsers=o.parsers,e.extractors=o.extractors},addParser:function(e){var t,r=L.parsers.length,o=!0;for(t=0;t<r;t++)L.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(o=!1);o&&(L.parsers[L.parsers.length]=e)},getParserById:function(e){if("false"==e)return!1;var t,r=L.parsers.length;for(t=0;t<r;t++)if(L.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return L.parsers[t];return!1},detectParserForColumn:function(e,t,r,o){for(var s,a,n,i=L.parsers.length,d=!1,l="",c=L.debug(e,"core"),g=!0;""===l&&g;)(n=t[++r])&&r<50?n.className.indexOf(L.cssIgnoreRow)<0&&(d=t[r].cells[o],l=L.getElementText(e,d,o),a=A(d),c&&console.log("Checking if value was empty on row "+r+", column: "+o+': "'+l+'"')):g=!1;for(;0<=--i;)if((s=L.parsers[i])&&"text"!==s.id&&s.is&&s.is(l,e.table,d,a))return s;return L.getParserById("text")},getElementText:function(e,t,r){if(!t)return"";var o,s=e.textExtraction||"",a=t.jquery?t:A(t);return"string"==typeof s?"basic"===s&&void 0!==(o=a.attr(e.textAttribute))?A.trim(o):A.trim(t.textContent||a.text()):"function"==typeof s?A.trim(s(a[0],e.table,r)):"function"==typeof(o=L.getColumnData(e.table,s,r))?A.trim(o(a[0],e.table,r)):A.trim(a[0].textContent||a.text())},getParsedText:function(e,t,r,o){void 0===o&&(o=L.getElementText(e,t,r));var s=""+o,a=e.parsers[r],n=e.extractors[r];return a&&(n&&"function"==typeof n.format&&(o=n.format(o,e.table,t,r)),s="no-parser"===a.id?"":a.format(""+o,e.table,t,r),e.ignoreCase&&"string"==typeof s&&(s=s.toLowerCase())),s},buildCache:function(e,t,r){var o,s,a,n,i,d,l,c,g,p,u,f,h,m,b,y,w,x,v,C,$,I,D=e.table,R=e.parsers,T=L.debug(e,"core");if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),l=void 0===r?e.$tbodies:r,e.cache={},e.totalRows=0,!R)return T?console.warn("Warning: *Empty table!* Not building a cache"):"";for(T&&(f=new Date),e.showProcessing&&L.isProcessing(D,!0),d=0;d<l.length;d++){for(y=[],o=e.cache[d]={normalized:[]},h=l[d]&&l[d].rows.length||0,n=0;n<h;++n)if(m={child:[],raw:[]},g=[],!(c=A(l[d].rows[n])).hasClass(e.selectorRemove.slice(1)))if(c.hasClass(e.cssChildRow)&&0!==n)for($=o.normalized.length-1,(b=o.normalized[$][e.columns]).$row=b.$row.add(c),c.prev().hasClass(e.cssChildRow)||c.prev().addClass(L.css.cssHasChild),p=c.children("th, td"),$=b.child.length,b.child[$]=[],x=0,C=e.columns,i=0;i<C;i++)(u=p[i])&&(b.child[$][i]=L.getParsedText(e,u,i),0<(w=p[i].colSpan-1)&&(x+=w,C+=w)),x++;else{for(m.$row=c,m.order=n,x=0,C=e.columns,i=0;i<C;++i){if((u=c[0].cells[i])&&x<e.columns&&(!(v=void 0!==R[x])&&T&&console.warn("No parser found for row: "+n+", column: "+i+'; cell containing: "'+A(u).text()+'"; does it have a header?'),s=L.getElementText(e,u,x),m.raw[x]=s,a=L.getParsedText(e,u,x,s),g[x]=a,v&&"numeric"===(R[x].type||"").toLowerCase()&&(y[x]=Math.max(Math.abs(a)||0,y[x]||0)),0<(w=u.colSpan-1))){for(I=0;I<=w;)a=e.duplicateSpan||0===I?s:"string"!=typeof e.textExtraction&&L.getElementText(e,u,x+I)||"",m.raw[x+I]=a,g[x+I]=a,I++;x+=w,C+=w}x++}g[e.columns]=m,o.normalized[o.normalized.length]=g}o.colMax=y,e.totalRows+=o.normalized.length}if(e.showProcessing&&L.isProcessing(D),T){for($=Math.min(5,e.cache[0].normalized.length),console[console.group?"group":"log"]("Building cache for "+e.totalRows+" rows (showing "+$+" rows in log) and "+e.columns+" columns"+L.benchmark(f)),s={},i=0;i<e.columns;i++)for(x=0;x<$;x++)s["row: "+x]||(s["row: "+x]={}),s["row: "+x][e.$headerIndexed[i].text()]=e.cache[0].normalized[x][i];console[console.table?"table":"log"](s),console.groupEnd&&console.groupEnd()}A.isFunction(t)&&t(D)},getColumnText:function(e,t,r,o){var s,a,n,i,d,l,c,g,p,u,f="function"==typeof r,h="all"===t,m={raw:[],parsed:[],$cell:[]},b=(e=A(e)[0]).config;if(!L.isEmptyObject(b)){for(d=b.$tbodies.length,s=0;s<d;s++)for(l=(n=b.cache[s].normalized).length,a=0;a<l;a++)i=n[a],o&&!i[b.columns].$row.is(o)||(u=!0,g=h?i.slice(0,b.columns):i[t],i=i[b.columns],c=h?i.raw:i.raw[t],p=h?i.$row.children():i.$row.children().eq(t),f&&(u=r({tbodyIndex:s,rowIndex:a,parsed:g,raw:c,$row:i.$row,$cell:p})),!1!==u&&(m.parsed[m.parsed.length]=g,m.raw[m.raw.length]=c,m.$cell[m.$cell.length]=p));return m}L.debug(b,"core")&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(a){var e,t,r=a.sortList,o=r.length,s=L.css.sortNone+" "+a.cssNone,n=[L.css.sortAsc+" "+a.cssAsc,L.css.sortDesc+" "+a.cssDesc],i=[a.cssIconAsc,a.cssIconDesc,a.cssIconNone],d=["ascending","descending"],l=function(e,t){e.removeClass(s).addClass(n[t]).attr("aria-sort",d[t]).find("."+L.css.icon).removeClass(i[2]).addClass(i[t])},c=a.$table.find("tfoot tr").children("td, th").add(A(a.namespace+"_extra_headers")).removeClass(n.join(" ")),g=a.$headers.add(A("thead "+a.namespace+"_extra_headers")).removeClass(n.join(" ")).addClass(s).attr("aria-sort","none").find("."+L.css.icon).removeClass(i.join(" ")).end();for(g.not(".sorter-false").find("."+L.css.icon).addClass(i[2]),a.cssIconDisabled&&g.filter(".sorter-false").find("."+L.css.icon).addClass(a.cssIconDisabled),e=0;e<o;e++)if(2!==r[e][1]){if((g=(g=a.$headers.filter(function(e){for(var t=!0,r=a.$headers.eq(e),o=parseInt(r.attr("data-column"),10),s=o+L.getClosest(r,"th, td")[0].colSpan;o<s;o++)t=!!t&&(t||-1<L.isValueInArray(o,a.sortList));return t})).not(".sorter-false").filter('[data-column="'+r[e][0]+'"]'+(1===o?":last":""))).length)for(t=0;t<g.length;t++)g[t].sortDisabled||l(g.eq(t),r[e][1]);c.length&&l(c.filter('[data-column="'+r[e][0]+'"]'),r[e][1])}for(o=a.$headers.length,e=0;e<o;e++)L.setColumnAriaLabel(a,a.$headers.eq(e))},getClosest:function(e,t){return A.fn.closest?e.closest(t):e.is(t)?e:e.parents(t).filter(":first")},setColumnAriaLabel:function(e,t,r){if(t.length){var o=parseInt(t.attr("data-column"),10),s=e.sortVars[o],a=t.hasClass(L.css.sortAsc)?"sortAsc":t.hasClass(L.css.sortDesc)?"sortDesc":"sortNone",n=A.trim(t.text())+": "+L.language[a];t.hasClass("sorter-false")||!1===r?n+=L.language.sortDisabled:(a=(s.count+1)%s.order.length,r=s.order[a],n+=L.language[0===r?"nextAsc":1===r?"nextDesc":"nextNone"]),t.attr("aria-label",n),s.sortedBy?t.attr("data-sortedBy",s.sortedBy):t.removeAttr("data-sortedBy")}},updateHeader:function(e){var t,r,o,s,a=e.table,n=e.$headers.length;for(t=0;t<n;t++)o=e.$headers.eq(t),s=L.getColumnData(a,e.headers,t,!0),r="false"===L.getData(o,s,"sorter")||"false"===L.getData(o,s,"parser"),L.setColumnSort(e,o,r)},setColumnSort:function(e,t,r){var o=e.table.id;t[0].sortDisabled=r,t[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.tabIndex&&(r?t.removeAttr("tabindex"):t.attr("tabindex","0")),o&&(r?t.removeAttr("aria-controls"):t.attr("aria-controls",o))},updateHeaderSortCount:function(e,t){var r,o,s,a,n,i,d,l,c=t||e.sortList,g=c.length;for(e.sortList=[],a=0;a<g;a++)if(d=c[a],(r=parseInt(d[0],10))<e.columns){switch(e.sortVars[r].order||(l=L.getOrder(e.sortInitialOrder)?e.sortReset?[1,0,2]:[1,0]:e.sortReset?[0,1,2]:[0,1],e.sortVars[r].order=l,e.sortVars[r].count=0),l=e.sortVars[r].order,o=(o=(""+d[1]).match(/^(1|d|s|o|n)/))?o[0]:""){case"1":case"d":o=1;break;case"s":o=n||0;break;case"o":o=0===(i=l[(n||0)%l.length])?1:1===i?0:2;break;case"n":o=l[++e.sortVars[r].count%l.length];break;default:o=0}n=0===a?o:n,s=[r,parseInt(o,10)||0],e.sortList[e.sortList.length]=s,o=A.inArray(s[1],l),e.sortVars[r].count=0<=o?o:s[1]%l.length}},updateAll:function(e,t,r){var o=e.table;o.isUpdating=!0,L.refreshWidgets(o,!0,!0),L.buildHeaders(e),L.bindEvents(o,e.$headers,!0),L.bindMethods(e),L.commonUpdate(e,t,r)},update:function(e,t,r){e.table.isUpdating=!0,L.updateHeader(e),L.commonUpdate(e,t,r)},updateHeaders:function(e,t){e.table.isUpdating=!0,L.buildHeaders(e),L.bindEvents(e.table,e.$headers,!0),L.resortComplete(e,t)},updateCell:function(e,t,r,o){if(A(t).closest("tr").hasClass(e.cssChildRow))console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');else{if(L.isEmptyObject(e.cache))return L.updateHeader(e),void L.commonUpdate(e,r,o);e.table.isUpdating=!0,e.$table.find(e.selectorRemove).remove();var s,a,n,i,d,l,c=e.$tbodies,g=A(t),p=c.index(L.getClosest(g,"tbody")),u=e.cache[p],f=L.getClosest(g,"tr");if(t=g[0],c.length&&0<=p){if(n=c.eq(p).find("tr").not("."+e.cssChildRow).index(f),d=u.normalized[n],(l=f[0].cells.length)!==e.columns)for(s=!1,a=i=0;a<l;a++)s||f[0].cells[a]===t?s=!0:i+=f[0].cells[a].colSpan;else i=g.index();s=L.getElementText(e,t,i),d[e.columns].raw[i]=s,s=L.getParsedText(e,t,i,s),d[i]=s,"numeric"===(e.parsers[i].type||"").toLowerCase()&&(u.colMax[i]=Math.max(Math.abs(s)||0,u.colMax[i]||0)),!1!==(s="undefined"!==r?r:e.resort)?L.checkResort(e,s,o):L.resortComplete(e,o)}else L.debug(e,"core")&&console.error("updateCell aborted, tbody missing or not within the indicated table"),e.table.isUpdating=!1}},addRows:function(e,t,r,o){var s,a,n,i,d,l,c,g,p,u,f,h,m,b="string"==typeof t&&1===e.$tbodies.length&&/<tr/.test(t||""),y=e.table;if(b)t=A(t),e.$tbodies.append(t);else if(!(t&&t instanceof A&&L.getClosest(t,"table")[0]===e.table))return L.debug(e,"core")&&console.error("addRows method requires (1) a jQuery selector reference to rows that have already been added to the table, or (2) row HTML string to be added to a table with only one tbody"),!1;if(y.isUpdating=!0,L.isEmptyObject(e.cache))L.updateHeader(e),L.commonUpdate(e,r,o);else{for(d=t.filter("tr").attr("role","row").length,n=e.$tbodies.index(t.parents("tbody").filter(":first")),e.parsers&&e.parsers.length||L.setupParsers(e),i=0;i<d;i++){for(p=0,c=t[i].cells.length,g=e.cache[n].normalized.length,f=[],u={child:[],raw:[],$row:t.eq(i),order:g},l=0;l<c;l++)h=t[i].cells[l],s=L.getElementText(e,h,p),u.raw[p]=s,a=L.getParsedText(e,h,p,s),f[p]=a,"numeric"===(e.parsers[p].type||"").toLowerCase()&&(e.cache[n].colMax[p]=Math.max(Math.abs(a)||0,e.cache[n].colMax[p]||0)),0<(m=h.colSpan-1)&&(p+=m),p++;f[e.columns]=u,e.cache[n].normalized[g]=f}L.checkResort(e,r,o)}},updateCache:function(e,t,r){e.parsers&&e.parsers.length||L.setupParsers(e,r),L.buildCache(e,t,r)},appendCache:function(e,t){var r,o,s,a,n,i,d,l=e.table,c=e.$tbodies,g=[],p=e.cache;if(L.isEmptyObject(p))return e.appender?e.appender(l,g):l.isUpdating?e.$table.triggerHandler("updateComplete",l):"";for(L.debug(e,"core")&&(d=new Date),i=0;i<c.length;i++)if((s=c.eq(i)).length){for(a=L.processTbody(l,s,!0),o=(r=p[i].normalized).length,n=0;n<o;n++)g[g.length]=r[n][e.columns].$row,e.appender&&(!e.pager||e.pager.removeRows||e.pager.ajax)||a.append(r[n][e.columns].$row);L.processTbody(l,a,!1)}e.appender&&e.appender(l,g),L.debug(e,"core")&&console.log("Rebuilt table"+L.benchmark(d)),t||e.appender||L.applyWidget(l),l.isUpdating&&e.$table.triggerHandler("updateComplete",l)},commonUpdate:function(e,t,r){e.$table.find(e.selectorRemove).remove(),L.setupParsers(e),L.buildCache(e),L.checkResort(e,t,r)},initSort:function(t,e,r){if(t.table.isUpdating)return setTimeout(function(){L.initSort(t,e,r)},50);var o,s,a,n,i,d,l,c=!r[t.sortMultiSortKey],g=t.table,p=t.$headers.length,u=L.getClosest(A(e),"th, td"),f=parseInt(u.attr("data-column"),10),h="mouseup"===r.type?"user":r.type,m=t.sortVars[f].order;if(u=u[0],t.$table.triggerHandler("sortStart",g),d=(t.sortVars[f].count+1)%m.length,t.sortVars[f].count=r[t.sortResetKey]?2:d,t.sortRestart)for(a=0;a<p;a++)l=t.$headers.eq(a),f!==(d=parseInt(l.attr("data-column"),10))&&(c||l.hasClass(L.css.sortNone))&&(t.sortVars[d].count=-1);if(c){if(A.each(t.sortVars,function(e){t.sortVars[e].sortedBy=""}),t.sortList=[],t.last.sortList=[],null!==t.sortForce)for(o=t.sortForce,s=0;s<o.length;s++)o[s][0]!==f&&(t.sortList[t.sortList.length]=o[s],t.sortVars[o[s][0]].sortedBy="sortForce");if((n=m[t.sortVars[f].count])<2&&(t.sortList[t.sortList.length]=[f,n],t.sortVars[f].sortedBy=h,1<u.colSpan))for(s=1;s<u.colSpan;s++)t.sortList[t.sortList.length]=[f+s,n],t.sortVars[f+s].count=A.inArray(n,m),t.sortVars[f+s].sortedBy=h}else if(t.sortList=A.extend([],t.last.sortList),0<=L.isValueInArray(f,t.sortList))for(t.sortVars[f].sortedBy=h,s=0;s<t.sortList.length;s++)(d=t.sortList[s])[0]===f&&(d[1]=m[t.sortVars[f].count],2===d[1]&&(t.sortList.splice(s,1),t.sortVars[f].count=-1));else if(n=m[t.sortVars[f].count],t.sortVars[f].sortedBy=h,n<2&&(t.sortList[t.sortList.length]=[f,n],1<u.colSpan))for(s=1;s<u.colSpan;s++)t.sortList[t.sortList.length]=[f+s,n],t.sortVars[f+s].count=A.inArray(n,m),t.sortVars[f+s].sortedBy=h;if(t.last.sortList=A.extend([],t.sortList),t.sortList.length&&t.sortAppend&&(o=A.isArray(t.sortAppend)?t.sortAppend:t.sortAppend[t.sortList[0][0]],!L.isEmptyObject(o)))for(s=0;s<o.length;s++)if(o[s][0]!==f&&L.isValueInArray(o[s][0],t.sortList)<0){if(i=(""+(n=o[s][1])).match(/^(a|d|s|o|n)/))switch(d=t.sortList[0][1],i[0]){case"d":n=1;break;case"s":n=d;break;case"o":n=0===d?1:0;break;case"n":n=(d+1)%m.length;break;default:n=0}t.sortList[t.sortList.length]=[o[s][0],n],t.sortVars[o[s][0]].sortedBy="sortAppend"}t.$table.triggerHandler("sortBegin",g),setTimeout(function(){L.setHeadersCss(t),L.multisort(t),L.appendCache(t),t.$table.triggerHandler("sortBeforeEnd",g),t.$table.triggerHandler("sortEnd",g)},1)},multisort:function(l){var e,t,c,r,g=l.table,p=[],u=0,f=l.textSorter||"",h=l.sortList,m=h.length,o=l.$tbodies.length;if(!l.serverSideSorting&&!L.isEmptyObject(l.cache)){if(L.debug(l,"core")&&(t=new Date),"object"==typeof f)for(c=l.columns;c--;)"function"==typeof(r=L.getColumnData(g,f,c))&&(p[c]=r);for(e=0;e<o;e++)c=l.cache[e].colMax,l.cache[e].normalized.sort(function(e,t){var r,o,s,a,n,i,d;for(r=0;r<m;r++){if(s=h[r][0],a=h[r][1],u=0===a,l.sortStable&&e[s]===t[s]&&1===m)return e[l.columns].order-t[l.columns].order;if((o=/n/i.test(L.getSortType(l.parsers,s)))&&l.strings[s]?(o="boolean"==typeof L.string[l.strings[s]]?(u?1:-1)*(L.string[l.strings[s]]?-1:1):l.strings[s]&&L.string[l.strings[s]]||0,n=l.numberSorter?l.numberSorter(e[s],t[s],u,c[s],g):L["sortNumeric"+(u?"Asc":"Desc")](e[s],t[s],o,c[s],s,l)):(i=u?e:t,d=u?t:e,n="function"==typeof f?f(i[s],d[s],u,s,g):"function"==typeof p[s]?p[s](i[s],d[s],u,s,g):L["sortNatural"+(u?"Asc":"Desc")](e[s]||"",t[s]||"",s,l)),n)return n}return e[l.columns].order-t[l.columns].order});L.debug(l,"core")&&console.log("Applying sort "+h.toString()+L.benchmark(t))}},resortComplete:function(e,t){e.table.isUpdating&&e.$table.triggerHandler("updateComplete",e.table),A.isFunction(t)&&t(e.table)},checkResort:function(e,t,r){var o=A.isArray(t)?t:e.sortList;!1===(void 0===t?e.resort:t)||e.serverSideSorting||e.table.isProcessing?(L.resortComplete(e,r),L.applyWidget(e.table,!1)):o.length?L.sortOn(e,o,function(){L.resortComplete(e,r)},!0):L.sortReset(e,function(){L.resortComplete(e,r),L.applyWidget(e.table,!1)})},sortOn:function(e,t,r,o){var s,a=e.table;for(e.$table.triggerHandler("sortStart",a),s=0;s<e.columns;s++)e.sortVars[s].sortedBy=-1<L.isValueInArray(s,t)?"sorton":"";L.updateHeaderSortCount(e,t),L.setHeadersCss(e),e.delayInit&&L.isEmptyObject(e.cache)&&L.buildCache(e),e.$table.triggerHandler("sortBegin",a),L.multisort(e),L.appendCache(e,o),e.$table.triggerHandler("sortBeforeEnd",a),e.$table.triggerHandler("sortEnd",a),L.applyWidget(a),A.isFunction(r)&&r(a)},sortReset:function(e,t){var r;for(e.sortList=[],r=0;r<e.columns;r++)e.sortVars[r].count=-1,e.sortVars[r].sortedBy="";L.setHeadersCss(e),L.multisort(e),L.appendCache(e),A.isFunction(t)&&t(e.table)},getSortType:function(e,t){return e&&e[t]&&e[t].type||""},getOrder:function(e){return/^d/i.test(e)||1===e},sortNatural:function(e,t){if(e===t)return 0;e=(e||"").toString(),t=(t||"").toString();var r,o,s,a,n,i,d=L.regex;if(d.hex.test(t)){if((r=parseInt(e.match(d.hex),16))<(o=parseInt(t.match(d.hex),16)))return-1;if(o<r)return 1}for(r=e.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),o=t.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),i=Math.max(r.length,o.length),n=0;n<i;n++){if(s=isNaN(r[n])?r[n]||0:parseFloat(r[n])||0,a=isNaN(o[n])?o[n]||0:parseFloat(o[n])||0,isNaN(s)!==isNaN(a))return isNaN(s)?1:-1;if(typeof s!=typeof a&&(s+="",a+=""),s<a)return-1;if(a<s)return 1}return 0},sortNaturalAsc:function(e,t,r,o){if(e===t)return 0;var s=L.string[o.empties[r]||o.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:-s||-1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:s||1:L.sortNatural(e,t)},sortNaturalDesc:function(e,t,r,o){if(e===t)return 0;var s=L.string[o.empties[r]||o.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:s||1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:-s||-1:L.sortNatural(t,e)},sortText:function(e,t){return t<e?1:e<t?-1:0},getTextValue:function(e,t,r){if(r){var o,s=e?e.length:0,a=r+t;for(o=0;o<s;o++)a+=e.charCodeAt(o);return t*a}return 0},sortNumericAsc:function(e,t,r,o,s,a){if(e===t)return 0;var n=L.string[a.empties[s]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:n||1:(isNaN(e)&&(e=L.getTextValue(e,r,o)),isNaN(t)&&(t=L.getTextValue(t,r,o)),e-t)},sortNumericDesc:function(e,t,r,o,s,a){if(e===t)return 0;var n=L.string[a.empties[s]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:(isNaN(e)&&(e=L.getTextValue(e,r,o)),isNaN(t)&&(t=L.getTextValue(t,r,o)),t-e)},sortNumeric:function(e,t){return e-t},addWidget:function(e){e.id&&!L.isEmptyObject(L.getWidgetById(e.id))&&console.warn('"'+e.id+'" widget was loaded more than once!'),L.widgets[L.widgets.length]=e},hasWidget:function(e,t){return(e=A(e)).length&&e[0].config&&e[0].config.widgetInit[t]||!1},getWidgetById:function(e){var t,r,o=L.widgets.length;for(t=0;t<o;t++)if((r=L.widgets[t])&&r.id&&r.id.toLowerCase()===e.toLowerCase())return r},applyWidgetOptions:function(e){var t,r,o,s=e.config,a=s.widgets.length;if(a)for(t=0;t<a;t++)(r=L.getWidgetById(s.widgets[t]))&&r.options&&(o=A.extend(!0,{},r.options),s.widgetOptions=A.extend(!0,o,s.widgetOptions),A.extend(!0,L.defaults.widgetOptions,r.options))},addWidgetFromClass:function(e){var t,r,o=e.config,s="^"+o.widgetClass.replace(L.regex.templateName,"(\\S+)+")+"$",a=new RegExp(s,"g"),n=(e.className||"").split(L.regex.spaces);if(n.length)for(t=n.length,r=0;r<t;r++)n[r].match(a)&&(o.widgets[o.widgets.length]=n[r].replace(a,"$1"))},applyWidgetId:function(e,t,r){var o,s,a,n=(e=A(e)[0]).config,i=n.widgetOptions,d=L.debug(n,"core"),l=L.getWidgetById(t);l&&(a=l.id,o=!1,A.inArray(a,n.widgets)<0&&(n.widgets[n.widgets.length]=a),d&&(s=new Date),!r&&n.widgetInit[a]||(n.widgetInit[a]=!0,e.hasInitialized&&L.applyWidgetOptions(e),"function"==typeof l.init&&(o=!0,d&&console[console.group?"group":"log"]("Initializing "+a+" widget"),l.init(e,l,n,i))),r||"function"!=typeof l.format||(o=!0,d&&console[console.group?"group":"log"]("Updating "+a+" widget"),l.format(e,n,i,!1)),d&&o&&(console.log("Completed "+(r?"initializing ":"applying ")+a+" widget"+L.benchmark(s)),console.groupEnd&&console.groupEnd()))},applyWidget:function(e,t,r){var o,s,a,n,i,d=(e=A(e)[0]).config,l=L.debug(d,"core"),c=[];if(!1===t||!e.hasInitialized||!e.isApplyingWidgets&&!e.isUpdating){if(l&&(i=new Date),L.addWidgetFromClass(e),clearTimeout(d.timerReady),d.widgets.length){for(e.isApplyingWidgets=!0,d.widgets=A.grep(d.widgets,function(e,t){return A.inArray(e,d.widgets)===t}),s=(a=d.widgets||[]).length,o=0;o<s;o++)(n=L.getWidgetById(a[o]))&&n.id?(n.priority||(n.priority=10),c[o]=n):l&&console.warn('"'+a[o]+'" was enabled, but the widget code has not been loaded!');for(c.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),s=c.length,l&&console[console.group?"group":"log"]("Start "+(t?"initializing":"applying")+" widgets"),o=0;o<s;o++)(n=c[o])&&n.id&&L.applyWidgetId(e,n.id,t);l&&console.groupEnd&&console.groupEnd()}d.timerReady=setTimeout(function(){e.isApplyingWidgets=!1,A.data(e,"lastWidgetApplication",new Date),d.$table.triggerHandler("tablesorter-ready"),t||"function"!=typeof r||r(e),l&&(n=d.widgets.length,console.log("Completed "+(!0===t?"initializing ":"applying ")+n+" widget"+(1!==n?"s":"")+L.benchmark(i)))},10)}},removeWidget:function(e,t,r){var o,s,a,n,i=(e=A(e)[0]).config;if(!0===t)for(t=[],n=L.widgets.length,a=0;a<n;a++)(s=L.widgets[a])&&s.id&&(t[t.length]=s.id);else t=(A.isArray(t)?t.join(","):t||"").toLowerCase().split(/[\s,]+/);for(n=t.length,o=0;o<n;o++)s=L.getWidgetById(t[o]),0<=(a=A.inArray(t[o],i.widgets))&&!0!==r&&i.widgets.splice(a,1),s&&s.remove&&(L.debug(i,"core")&&console.log((r?"Refreshing":"Removing")+' "'+t[o]+'" widget'),s.remove(e,i,i.widgetOptions,r),i.widgetInit[t[o]]=!1);i.$table.triggerHandler("widgetRemoveEnd",e)},refreshWidgets:function(e,t,r){var o,s,a=(e=A(e)[0]).config.widgets,n=L.widgets,i=n.length,d=[],l=function(e){A(e).triggerHandler("refreshComplete")};for(o=0;o<i;o++)(s=n[o])&&s.id&&(t||A.inArray(s.id,a)<0)&&(d[d.length]=s.id);L.removeWidget(e,d.join(","),!0),!0!==r?(L.applyWidget(e,t||!1,l),t&&L.applyWidget(e,!1,l)):l(e)},benchmark:function(e){return" ("+((new Date).getTime()-e.getTime())+" ms)"},log:function(){console.log(arguments)},debug:function(e,t){return e&&(!0===e.debug||"string"==typeof e.debug&&-1<e.debug.indexOf(t))},isEmptyObject:function(e){for(var t in e)return!1;return!0},isValueInArray:function(e,t){var r,o=t&&t.length||0;for(r=0;r<o;r++)if(t[r][0]===e)return r;return-1},formatFloat:function(e,t){return"string"!=typeof e||""===e?e:(e=(t&&t.config?!1!==t.config.usNumberFormat:void 0===t||t)?e.replace(L.regex.comma,""):e.replace(L.regex.digitNonUS,"").replace(L.regex.comma,"."),L.regex.digitNegativeTest.test(e)&&(e=e.replace(L.regex.digitNegativeReplace,"-$1")),r=parseFloat(e),isNaN(r)?A.trim(e):r);var r},isDigit:function(e){return isNaN(e)?L.regex.digitTest.test(e.toString().replace(L.regex.digitReplace,"")):""!==e},computeColumnIndex:function(e,t){var r,o,s,a,n,i,d,l,c,g,p=t&&t.columns||0,u=[],f=new Array(p);for(r=0;r<e.length;r++)for(i=e[r].cells,o=0;o<i.length;o++){for(d=r,l=(n=i[o]).rowSpan||1,c=n.colSpan||1,void 0===u[d]&&(u[d]=[]),s=0;s<u[d].length+1;s++)if(void 0===u[d][s]){g=s;break}for(p&&n.cellIndex===g||(n.setAttribute?n.setAttribute("data-column",g):A(n).attr("data-column",g)),s=d;s<d+l;s++)for(void 0===u[s]&&(u[s]=[]),f=u[s],a=g;a<g+c;a++)f[a]="x"}return L.checkColumnCount(e,u,f.length),f.length},checkColumnCount:function(e,t,r){var o,s,a=!0,n=[];for(o=0;o<t.length;o++)if(t[o]&&(s=t[o].length,t[o].length!==r)){a=!1;break}a||(e.each(function(e,t){var r=t.parentElement.nodeName;n.indexOf(r)<0&&n.push(r)}),console.error("Invalid or incorrect number of columns in the "+n.join(" or ")+"; expected "+r+", but found "+s+" columns"))},fixColumnWidth:function(e){var t,r,o,s,a,n=(e=A(e)[0]).config,i=n.$table.children("colgroup");if(i.length&&i.hasClass(L.css.colgroup)&&i.remove(),n.widthFixed&&0===n.$table.children("colgroup").length){for(i=A('<colgroup class="'+L.css.colgroup+'">'),t=n.$table.width(),s=(o=n.$tbodies.find("tr:first").children(":visible")).length,a=0;a<s;a++)r=parseInt(o.eq(a).width()/t*1e3,10)/10+"%",i.append(A("<col>").css("width",r));n.$table.prepend(i)}},getData:function(e,t,r){var o,s,a="",n=A(e);return n.length?(o=!!A.metadata&&n.metadata(),s=" "+(n.attr("class")||""),void 0!==n.data(r)||void 0!==n.data(r.toLowerCase())?a+=n.data(r)||n.data(r.toLowerCase()):o&&void 0!==o[r]?a+=o[r]:t&&void 0!==t[r]?a+=t[r]:" "!==s&&s.match(" "+r+"-")&&(a=s.match(new RegExp("\\s"+r+"-([\\w-]+)"))[1]||""),A.trim(a)):""},getColumnData:function(e,t,r,o,s){if("object"!=typeof t||null===t)return t;var a,n=(e=A(e)[0]).config,i=s||n.$headers,d=n.$headerIndexed&&n.$headerIndexed[r]||i.find('[data-column="'+r+'"]:last');if(void 0!==t[r])return o?t[r]:t[i.index(d)];for(a in t)if("string"==typeof a&&d.filter(a).add(d.find(a)).length)return t[a]},isProcessing:function(e,t,r){var o=(e=A(e))[0].config,s=r||e.find("."+L.css.header);t?(void 0!==r&&0<o.sortList.length&&(s=s.filter(function(){return!this.sortDisabled&&0<=L.isValueInArray(parseFloat(A(this).attr("data-column")),o.sortList)})),e.add(s).addClass(L.css.processing+" "+o.cssProcessing)):e.add(s).removeClass(L.css.processing+" "+o.cssProcessing)},processTbody:function(e,t,r){if(e=A(e)[0],r)return e.isProcessing=!0,t.before('<colgroup class="tablesorter-savemyplace"/>'),A.fn.detach?t.detach():t.remove();var o=A(e).find("colgroup.tablesorter-savemyplace");t.insertAfter(o),o.remove(),e.isProcessing=!1},clearTableBody:function(e){A(e)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(e){var t,r="[",o=L.characterEquivalents;if(!L.characterRegex){for(t in L.characterRegexArray={},o)"string"==typeof t&&(r+=o[t],L.characterRegexArray[t]=new RegExp("["+o[t]+"]","g"));L.characterRegex=new RegExp(r+"]")}if(L.characterRegex.test(e))for(t in o)"string"==typeof t&&(e=e.replace(L.characterRegexArray[t],t));return e},validateOptions:function(e){var t,r,o,s,a="headers sortForce sortList sortAppend widgets".split(" "),n=e.originalSettings;if(n){for(t in L.debug(e,"core")&&(s=new Date),n)if("undefined"===(o=typeof L.defaults[t]))console.warn('Tablesorter Warning! "table.config.'+t+'" option not recognized');else if("object"===o)for(r in n[t])o=L.defaults[t]&&typeof L.defaults[t][r],A.inArray(t,a)<0&&"undefined"===o&&console.warn('Tablesorter Warning! "table.config.'+t+"."+r+'" option not recognized');L.debug(e,"core")&&console.log("validate options time:"+L.benchmark(s))}},restoreHeaders:function(e){var t,r,o=A(e)[0].config,s=o.$table.find(o.selectorHeaders),a=s.length;for(t=0;t<a;t++)(r=s.eq(t)).find("."+L.css.headerIn).length&&r.html(o.headerContent[t])},destroy:function(e,t,r){if((e=A(e)[0]).hasInitialized){L.removeWidget(e,!0,!1);var o,s=A(e),a=e.config,n=s.find("thead:first"),i=n.find("tr."+L.css.headerRow).removeClass(L.css.headerRow+" "+a.cssHeaderRow),d=s.find("tfoot:first > tr").children("th, td");!1===t&&0<=A.inArray("uitheme",a.widgets)&&(s.triggerHandler("applyWidgetId",["uitheme"]),s.triggerHandler("applyWidgetId",["zebra"])),n.find("tr").not(i).remove(),o="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave "+"keypress sortBegin sortEnd resetToLoadState ".split(" ").join(a.namespace+" "),s.removeData("tablesorter").unbind(o.replace(L.regex.spaces," ")),a.$headers.add(d).removeClass([L.css.header,a.cssHeader,a.cssAsc,a.cssDesc,L.css.sortAsc,L.css.sortDesc,L.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(a.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(a.namespace+" ").replace(L.regex.spaces," ")),L.restoreHeaders(e),s.toggleClass(L.css.table+" "+a.tableClass+" tablesorter-"+a.theme,!1===t),s.removeClass(a.namespace.slice(1)),e.hasInitialized=!1,delete e.config.cache,"function"==typeof r&&r(e),L.debug(a,"core")&&console.log("tablesorter has been removed")}}};A.fn.tablesorter=function(t){return this.each(function(){var e=A.extend(!0,{},L.defaults,t,L.instanceMethods);e.originalSettings=t,!this.hasInitialized&&L.buildTable&&"TABLE"!==this.nodeName?L.buildTable(this,e):L.setup(this,e)})},window.console&&window.console.log||(L.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var e=1<arguments.length?arguments:arguments[0];L.logs[L.logs.length]={date:Date.now(),log:e}}),L.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),L.addParser({id:"text",is:function(){return!0},format:function(e,t){var r=t.config;return e&&(e=A.trim(r.ignoreCase?e.toLocaleLowerCase():e),e=r.sortLocaleCompare?L.replaceAccents(e):e),e},type:"text"}),L.regex.nondigit=/[^\w,. \-()]/g,L.addParser({id:"digit",is:function(e){return L.isDigit(e)},format:function(e,t){var r=L.formatFloat((e||"").replace(L.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?A.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),L.regex.currencyReplace=/[+\-,. ]/g,L.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,L.addParser({id:"currency",is:function(e){return e=(e||"").replace(L.regex.currencyReplace,""),L.regex.currencyTest.test(e)},format:function(e,t){var r=L.formatFloat((e||"").replace(L.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?A.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),L.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,L.regex.urlProtocolReplace=/(https?|ftp|file):\/\/(www\.)?/,L.addParser({id:"url",is:function(e){return L.regex.urlProtocolTest.test(e)},format:function(e){return e?A.trim(e.replace(L.regex.urlProtocolReplace,"")):e},type:"text"}),L.regex.dash=/-/g,L.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,L.addParser({id:"isoDate",is:function(e){return L.regex.isoDate.test(e)},format:function(e){var t=e?new Date(e.replace(L.regex.dash,"/")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),L.regex.percent=/%/g,L.regex.percentTest=/(\d\s*?%|%\s*?\d)/,L.addParser({id:"percent",is:function(e){return L.regex.percentTest.test(e)&&e.length<15},format:function(e,t){return e?L.formatFloat(e.replace(L.regex.percent,""),t):e},type:"numeric"}),L.addParser({id:"image",is:function(e,t,r,o){return 0<o.find("img").length},format:function(e,t,r){return A(r).find("img").attr(t.config.imgAttr||"alt")||e},parsed:!0,type:"text"}),L.regex.dateReplace=/(\S)([AP]M)$/i,L.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,L.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,L.addParser({id:"usLongDate",is:function(e){return L.regex.usLongDateTest1.test(e)||L.regex.usLongDateTest2.test(e)},format:function(e){var t=e?new Date(e.replace(L.regex.dateReplace,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),L.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,L.regex.shortDateReplace=/[\-.,]/g,L.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,L.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,L.convertFormat=function(e,t){e=(e||"").replace(L.regex.spaces," ").replace(L.regex.shortDateReplace,"/"),"mmddyyyy"===t?e=e.replace(L.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===t?e=e.replace(L.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===t&&(e=e.replace(L.regex.shortDateYMD,"$1/$2/$3"));var r=new Date(e);return r instanceof Date&&isFinite(r)?r.getTime():""},L.addParser({id:"shortDate",is:function(e){return e=(e||"").replace(L.regex.spaces," ").replace(L.regex.shortDateReplace,"/"),L.regex.shortDateTest.test(e)},format:function(e,t,r,o){if(e){var s=t.config,a=s.$headerIndexed[o],n=a.length&&a.data("dateFormat")||L.getData(a,L.getColumnData(t,s.headers,o),"dateFormat")||s.dateFormat;return a.length&&a.data("dateFormat",n),L.convertFormat(e,n)||e}return e},type:"numeric"}),L.regex.timeTest=/^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i,L.regex.timeMatch=/(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,L.addParser({id:"time",is:function(e){return L.regex.timeTest.test(e)},format:function(e){var t=(e||"").match(L.regex.timeMatch),r=new Date(e),o=e&&(null!==t?t[0]:"00:00 AM"),s=o?new Date("2000/01/01 "+o.replace(L.regex.dateReplace,"$1 $2")):o;return s instanceof Date&&isFinite(s)?(r instanceof Date&&isFinite(r)?r.getTime():0)?parseFloat(s.getTime()+"."+r.getTime()):s.getTime():e},type:"numeric"}),L.addParser({id:"metadata",is:function(){return!1},format:function(e,t,r){var o=t.config,s=o.parserMetadataName?o.parserMetadataName:"sortValue";return A(r).metadata()[s]},type:"numeric"}),L.addWidget({id:"zebra",priority:90,format:function(e,t,r){var o,s,a,n,i,d,l,c=new RegExp(t.cssChildRow,"i"),g=t.$tbodies.add(A(t.namespace+"_extra_table").children("tbody:not(."+t.cssInfoBlock+")"));for(i=0;i<g.length;i++)for(a=0,l=(o=g.eq(i).children("tr:visible").not(t.selectorRemove)).length,d=0;d<l;d++)s=o.eq(d),c.test(s[0].className)||a++,n=a%2==0,s.removeClass(r.zebra[n?1:0]).addClass(r.zebra[n?0:1])},remove:function(e,t,r,o){if(!o){var s,a,n=t.$tbodies,i=(r.zebra||["even","odd"]).join(" ");for(s=0;s<n.length;s++)(a=L.processTbody(e,n.eq(s),!0)).children().removeClass(i),L.processTbody(e,a,!1)}}})}(e),e.tablesorter}); \ No newline at end of file
diff --git a/sitestatic/jquery.tablesorter-2.7.js b/sitestatic/jquery.tablesorter-2.7.js
deleted file mode 100644
index f8c443ab..00000000
--- a/sitestatic/jquery.tablesorter-2.7.js
+++ /dev/null
@@ -1,1374 +0,0 @@
-/*!
-* TableSorter 2.7 - Client-side table sorting with ease!
-* @requires jQuery v1.2.6+
-*
-* Copyright (c) 2007 Christian Bach
-* Examples and docs at: http://tablesorter.com
-* Dual licensed under the MIT and GPL licenses:
-* http://www.opensource.org/licenses/mit-license.php
-* http://www.gnu.org/licenses/gpl.html
-*
-* @type jQuery
-* @name tablesorter
-* @cat Plugins/Tablesorter
-* @author Christian Bach/christian.bach@polyester.se
-* @contributor Rob Garrison/https://github.com/Mottie/tablesorter
-*/
-/*jshint browser:true, jquery:true, unused:false, expr: true */
-/*global console:false, alert:false */
-!(function($) {
- "use strict";
- $.extend({
- /*jshint supernew:true */
- tablesorter: new function() {
-
- var ts = this;
-
- ts.version = "2.7";
-
- ts.parsers = [];
- ts.widgets = [];
- ts.defaults = {
-
- // *** appearance
- theme : 'default', // adds tablesorter-{theme} to the table for styling
- widthFixed : false, // adds colgroup to fix widths of columns
- showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
-
- headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> (class from cssIcon)
- onRenderTemplate : null, // function(index, template){ return template; }, (template is a string)
- onRenderHeader : null, // function(index){}, (nothing to return)
-
- // *** functionality
- cancelSelection : true, // prevent text selection in the header
- dateFormat : 'mmddyyyy', // other options: "ddmmyyy" or "yyyymmdd"
- sortMultiSortKey : 'shiftKey', // key used to select additional columns
- sortResetKey : 'ctrlKey', // key used to remove sorting on a column
- usNumberFormat : true, // false for German "1.234.567,89" or French "1 234 567,89"
- delayInit : false, // if false, the parsed table contents will not update until the first sort
- serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
-
- // *** sort options
- headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
- ignoreCase : true, // ignore case while sorting
- sortForce : null, // column(s) first sorted; always applied
- sortList : [], // Initial sort order; applied initially; updated when manually sorted
- sortAppend : null, // column(s) sorted last; always applied
-
- sortInitialOrder : 'asc', // sort direction on first click
- sortLocaleCompare: false, // replace equivalent character (accented characters)
- sortReset : false, // third click on the header will reset column to default - unsorted
- sortRestart : false, // restart sort to "sortInitialOrder" when clicking on previously unsorted columns
-
- emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero
- stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
- textExtraction : 'simple', // text extraction method/function - function(node, table, cellIndex){}
- textSorter : null, // use custom text sorter - function(a,b){ return a.sort(b); } // basic sort
-
- // *** widget options
- widgets: [], // method to add widgets, e.g. widgets: ['zebra']
- widgetOptions : {
- zebra : [ 'even', 'odd' ] // zebra widget alternating row class names
- },
- initWidgets : true, // apply widgets on tablesorter initialization
-
- // *** callbacks
- initialized : null, // function(table){},
-
- // *** css class names
- tableClass : 'tablesorter',
- cssAsc : 'tablesorter-headerAsc',
- cssChildRow : 'tablesorter-childRow', // previously "expand-child"
- cssDesc : 'tablesorter-headerDesc',
- cssHeader : 'tablesorter-header',
- cssHeaderRow : 'tablesorter-headerRow',
- cssIcon : 'tablesorter-icon', // if this class exists, a <i> will be added to the header automatically
- cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name
- cssProcessing : 'tablesorter-processing', // processing icon applied to header during sort/filter
-
- // *** selectors
- selectorHeaders : '> thead th, > thead td',
- selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort
- selectorRemove : '.remove-me',
-
- // *** advanced
- debug : false,
-
- // *** Internal variables
- headerList: [],
- empties: {},
- strings: {},
- parsers: []
-
- // deprecated; but retained for backwards compatibility
- // widgetZebra: { css: ["even", "odd"] }
-
- };
-
- /* debuging utils */
- function log(s) {
- if (typeof console !== "undefined" && typeof console.log !== "undefined") {
- console.log(s);
- } else {
- alert(s);
- }
- }
-
- function benchmark(s, d) {
- log(s + " (" + (new Date().getTime() - d.getTime()) + "ms)");
- }
-
- ts.benchmark = benchmark;
-
- function getElementText(table, node, cellIndex) {
- if (!node) { return ""; }
- var c = table.config,
- t = c.textExtraction, text = "";
- if (t === "simple") {
- if (c.supportsTextContent) {
- text = node.textContent; // newer browsers support this
- } else {
- text = $(node).text();
- }
- } else {
- if (typeof(t) === "function") {
- text = t(node, table, cellIndex);
- } else if (typeof(t) === "object" && t.hasOwnProperty(cellIndex)) {
- text = t[cellIndex](node, table, cellIndex);
- } else {
- text = c.supportsTextContent ? node.textContent : $(node).text();
- }
- }
- return $.trim(text);
- }
-
- function detectParserForColumn(table, rows, rowIndex, cellIndex) {
- var i, l = ts.parsers.length,
- node = false,
- nodeValue = '',
- keepLooking = true;
- while (nodeValue === '' && keepLooking) {
- rowIndex++;
- if (rows[rowIndex]) {
- node = rows[rowIndex].cells[cellIndex];
- nodeValue = getElementText(table, node, cellIndex);
- if (table.config.debug) {
- log('Checking if value was empty on row ' + rowIndex + ', column: ' + cellIndex + ': ' + nodeValue);
- }
- } else {
- keepLooking = false;
- }
- }
- for (i = 1; i < l; i++) {
- if (ts.parsers[i].is(nodeValue, table, node)) {
- return ts.parsers[i];
- }
- }
- // 0 is always the generic parser (text)
- return ts.parsers[0];
- }
-
- function buildParserCache(table) {
- var c = table.config,
- tb = $(table.tBodies).filter(':not(.' + c.cssInfoBlock + ')'),
- rows, list, l, i, h, ch, p, parsersDebug = "";
- if ( tb.length === 0) {
- return c.debug ? log('*Empty table!* Not building a parser cache') : '';
- }
- rows = tb[0].rows;
- if (rows[0]) {
- list = [];
- l = rows[0].cells.length;
- for (i = 0; i < l; i++) {
- // tons of thanks to AnthonyM1229 for working out the following selector (issue #74) to make this work in IE8!
- // More fixes to this selector to work properly in iOS and jQuery 1.8+ (issue #132 & #174)
- h = c.$headers.filter(':not([colspan])');
- h = h.add( c.$headers.filter('[colspan="1"]') ) // ie8 fix
- .filter('[data-column="' + i + '"]:last');
- ch = c.headers[i];
- // get column parser
- p = ts.getParserById( ts.getData(h, ch, 'sorter') );
- // empty cells behaviour - keeping emptyToBottom for backwards compatibility
- c.empties[i] = ts.getData(h, ch, 'empty') || c.emptyTo || (c.emptyToBottom ? 'bottom' : 'top' );
- // text strings behaviour in numerical sorts
- c.strings[i] = ts.getData(h, ch, 'string') || c.stringTo || 'max';
- if (!p) {
- p = detectParserForColumn(table, rows, -1, i);
- }
- if (c.debug) {
- parsersDebug += "column:" + i + "; parser:" + p.id + "; string:" + c.strings[i] + '; empty: ' + c.empties[i] + "\n";
- }
- list.push(p);
- }
- }
- if (c.debug) {
- log(parsersDebug);
- }
- return list;
- }
-
- /* utils */
- function buildCache(table) {
- var b = table.tBodies,
- tc = table.config,
- totalRows,
- totalCells,
- parsers = tc.parsers,
- t, v, i, j, k, c, cols, cacheTime, colMax = [];
- tc.cache = {};
- // if no parsers found, return - it's an empty table.
- if (!parsers) {
- return tc.debug ? log('*Empty table!* Not building a cache') : '';
- }
- if (tc.debug) {
- cacheTime = new Date();
- }
- // processing icon
- if (tc.showProcessing) {
- ts.isProcessing(table, true);
- }
- for (k = 0; k < b.length; k++) {
- tc.cache[k] = { row: [], normalized: [] };
- // ignore tbodies with class name from css.cssInfoBlock
- if (!$(b[k]).hasClass(tc.cssInfoBlock)) {
- totalRows = (b[k] && b[k].rows.length) || 0;
- totalCells = (b[k].rows[0] && b[k].rows[0].cells.length) || 0;
- for (i = 0; i < totalRows; ++i) {
- /** Add the table data to main data array */
- c = $(b[k].rows[i]);
- cols = [];
- // if this is a child row, add it to the last row's children and continue to the next row
- if (c.hasClass(tc.cssChildRow)) {
- tc.cache[k].row[tc.cache[k].row.length - 1] = tc.cache[k].row[tc.cache[k].row.length - 1].add(c);
- // go to the next for loop
- continue;
- }
- tc.cache[k].row.push(c);
- for (j = 0; j < totalCells; ++j) {
- t = getElementText(table, c[0].cells[j], j);
- // allow parsing if the string is empty, previously parsing would change it to zero,
- // in case the parser needs to extract data from the table cell attributes
- v = parsers[j].format(t, table, c[0].cells[j], j);
- cols.push(v);
- if ((parsers[j].type || '').toLowerCase() === "numeric") {
- colMax[j] = Math.max(Math.abs(v), colMax[j] || 0); // determine column max value (ignore sign)
- }
- }
- cols.push(tc.cache[k].normalized.length); // add position for rowCache
- tc.cache[k].normalized.push(cols);
- }
- tc.cache[k].colMax = colMax;
- }
- }
- if (tc.showProcessing) {
- ts.isProcessing(table); // remove processing icon
- }
- if (tc.debug) {
- benchmark("Building cache for " + totalRows + " rows", cacheTime);
- }
- }
-
- // init flag (true) used by pager plugin to prevent widget application
- function appendToTable(table, init) {
- var c = table.config,
- b = table.tBodies,
- rows = [],
- c2 = c.cache,
- r, n, totalRows, checkCell, $bk, $tb,
- i, j, k, l, pos, appendTime;
- if (!c2[0]) { return; } // empty table - fixes #206
- if (c.debug) {
- appendTime = new Date();
- }
- for (k = 0; k < b.length; k++) {
- $bk = $(b[k]);
- if (!$bk.hasClass(c.cssInfoBlock)) {
- // get tbody
- $tb = ts.processTbody(table, $bk, true);
- r = c2[k].row;
- n = c2[k].normalized;
- totalRows = n.length;
- checkCell = totalRows ? (n[0].length - 1) : 0;
- for (i = 0; i < totalRows; i++) {
- pos = n[i][checkCell];
- rows.push(r[pos]);
- // removeRows used by the pager plugin
- if (!c.appender || !c.removeRows) {
- l = r[pos].length;
- for (j = 0; j < l; j++) {
- $tb.append(r[pos][j]);
- }
- }
- }
- // restore tbody
- ts.processTbody(table, $tb, false);
- }
- }
- if (c.appender) {
- c.appender(table, rows);
- }
- if (c.debug) {
- benchmark("Rebuilt table", appendTime);
- }
- // apply table widgets
- if (!init) { ts.applyWidget(table); }
- // trigger sortend
- $(table).trigger("sortEnd", table);
- }
-
- // computeTableHeaderCellIndexes from:
- // http://www.javascripttoolbox.com/lib/table/examples.php
- // http://www.javascripttoolbox.com/temp/table_cellindex.html
- function computeThIndexes(t) {
- var matrix = [],
- lookup = {},
- trs = $(t).find('thead:eq(0), tfoot').children('tr'), // children tr in tfoot - see issue #196
- i, j, k, l, c, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
- for (i = 0; i < trs.length; i++) {
- cells = trs[i].cells;
- for (j = 0; j < cells.length; j++) {
- c = cells[j];
- rowIndex = c.parentNode.rowIndex;
- cellId = rowIndex + "-" + c.cellIndex;
- rowSpan = c.rowSpan || 1;
- colSpan = c.colSpan || 1;
- if (typeof(matrix[rowIndex]) === "undefined") {
- matrix[rowIndex] = [];
- }
- // Find first available column in the first row
- for (k = 0; k < matrix[rowIndex].length + 1; k++) {
- if (typeof(matrix[rowIndex][k]) === "undefined") {
- firstAvailCol = k;
- break;
- }
- }
- lookup[cellId] = firstAvailCol;
- // add data-column
- $(c).attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
- for (k = rowIndex; k < rowIndex + rowSpan; k++) {
- if (typeof(matrix[k]) === "undefined") {
- matrix[k] = [];
- }
- matrixrow = matrix[k];
- for (l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
- matrixrow[l] = "x";
- }
- }
- }
- }
- return lookup;
- }
-
- function formatSortingOrder(v) {
- // look for "d" in "desc" order; return true
- return (/^d/i.test(v) || v === 1);
- }
-
- function buildHeaders(table) {
- var header_index = computeThIndexes(table), ch, $t,
- h, i, t, lock, time, $tableHeaders, c = table.config;
- c.headerList = [], c.headerContent = [];
- if (c.debug) {
- time = new Date();
- }
- i = c.cssIcon ? '<i class="' + c.cssIcon + '"></i>' : ''; // add icon if cssIcon option exists
- $tableHeaders = $(table).find(c.selectorHeaders).each(function(index) {
- $t = $(this);
- ch = c.headers[index];
- c.headerContent[index] = this.innerHTML; // save original header content
- // set up header template
- t = c.headerTemplate.replace(/\{content\}/g, this.innerHTML).replace(/\{icon\}/g, i);
- if (c.onRenderTemplate) {
- h = c.onRenderTemplate.apply($t, [index, t]);
- if (h && typeof h === 'string') { t = h; } // only change t if something is returned
- }
- this.innerHTML = '<div class="tablesorter-header-inner">' + t + '</div>'; // faster than wrapInner
-
- if (c.onRenderHeader) { c.onRenderHeader.apply($t, [index]); }
-
- this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
- this.order = formatSortingOrder( ts.getData($t, ch, 'sortInitialOrder') || c.sortInitialOrder ) ? [1,0,2] : [0,1,2];
- this.count = -1; // set to -1 because clicking on the header automatically adds one
- if (ts.getData($t, ch, 'sorter') === 'false') {
- this.sortDisabled = true;
- $t.addClass('sorter-false');
- } else {
- $t.removeClass('sorter-false');
- }
- this.lockedOrder = false;
- lock = ts.getData($t, ch, 'lockedOrder') || false;
- if (typeof(lock) !== 'undefined' && lock !== false) {
- this.order = this.lockedOrder = formatSortingOrder(lock) ? [1,1,1] : [0,0,0];
- }
- $t.addClass( (this.sortDisabled ? 'sorter-false ' : ' ') + c.cssHeader );
- // add cell to headerList
- c.headerList[index] = this;
- // add to parent in case there are multiple rows
- $t.parent().addClass(c.cssHeaderRow);
- });
- if (table.config.debug) {
- benchmark("Built headers:", time);
- log($tableHeaders);
- }
- return $tableHeaders;
- }
-
- function setHeadersCss(table) {
- var f, i, j, l,
- c = table.config,
- list = c.sortList,
- css = [c.cssAsc, c.cssDesc],
- // find the footer
- $t = $(table).find('tfoot tr').children().removeClass(css.join(' '));
- // remove all header information
- c.$headers.removeClass(css.join(' '));
- l = list.length;
- for (i = 0; i < l; i++) {
- // direction = 2 means reset!
- if (list[i][1] !== 2) {
- // multicolumn sorting updating - choose the :last in case there are nested columns
- f = c.$headers.not('.sorter-false').filter('[data-column="' + list[i][0] + '"]' + (l === 1 ? ':last' : '') );
- if (f.length) {
- for (j = 0; j < f.length; j++) {
- if (!f[j].sortDisabled) {
- f.eq(j).addClass(css[list[i][1]]);
- // add sorted class to footer, if it exists
- if ($t.length) {
- $t.filter('[data-column="' + list[i][0] + '"]').eq(j).addClass(css[list[i][1]]);
- }
- }
- }
- }
- }
- }
- }
-
- function fixColumnWidth(table) {
- if (table.config.widthFixed && $(table).find('colgroup').length === 0) {
- var colgroup = $('<colgroup>'),
- overallWidth = $(table).width();
- $("tr:first td", table.tBodies[0]).each(function() {
- colgroup.append($('<col>').css('width', parseInt(($(this).width()/overallWidth)*1000, 10)/10 + '%'));
- });
- $(table).prepend(colgroup);
- }
- }
-
- function updateHeaderSortCount(table, list) {
- var s, t, o, c = table.config,
- sl = list || c.sortList;
- c.sortList = [];
- $.each(sl, function(i,v){
- // ensure all sortList values are numeric - fixes #127
- s = [ parseInt(v[0], 10), parseInt(v[1], 10) ];
- // make sure header exists
- o = c.headerList[s[0]];
- if (o) { // prevents error if sorton array is wrong
- c.sortList.push(s);
- t = $.inArray(s[1], o.order); // fixes issue #167
- o.count = t >= 0 ? t : s[1] % (c.sortReset ? 3 : 2);
- }
- });
- }
-
- function getCachedSortType(parsers, i) {
- return (parsers && parsers[i]) ? parsers[i].type || '' : '';
- }
-
- // sort multiple columns
- function multisort(table) { /*jshint loopfunc:true */
- var dynamicExp, sortWrapper, col, mx = 0, dir = 0, tc = table.config,
- sortList = tc.sortList, l = sortList.length, bl = table.tBodies.length,
- sortTime, i, j, k, c, colMax, cache, lc, s, e, order, orgOrderCol;
- if (tc.serverSideSorting || !tc.cache[0]) { // empty table - fixes #206
- return;
- }
- if (tc.debug) { sortTime = new Date(); }
- for (k = 0; k < bl; k++) {
- colMax = tc.cache[k].colMax;
- cache = tc.cache[k].normalized;
- lc = cache.length;
- orgOrderCol = (cache && cache[0]) ? cache[0].length - 1 : 0;
- cache.sort(function(a, b) {
- // cache is undefined here in IE, so don't use it!
- for (i = 0; i < l; i++) {
- c = sortList[i][0];
- order = sortList[i][1];
- // fallback to natural sort since it is more robust
- s = /n/i.test(getCachedSortType(tc.parsers, c)) ? "Numeric" : "Text";
- s += order === 0 ? "" : "Desc";
- if (/Numeric/.test(s) && tc.strings[c]) {
- // sort strings in numerical columns
- if (typeof (tc.string[tc.strings[c]]) === 'boolean') {
- dir = (order === 0 ? 1 : -1) * (tc.string[tc.strings[c]] ? -1 : 1);
- } else {
- dir = (tc.strings[c]) ? tc.string[tc.strings[c]] || 0 : 0;
- }
- }
- var sort = $.tablesorter["sort" + s](table, a[c], b[c], c, colMax[c], dir);
- if (sort) { return sort; }
- }
- return a[orgOrderCol] - b[orgOrderCol];
- });
- }
- if (tc.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time", sortTime); }
- }
-
- function resortComplete($table, callback){
- $table.trigger('updateComplete');
- if (typeof callback === "function") {
- callback($table[0]);
- }
- }
-
- function checkResort($table, flag, callback) {
- if (flag !== false) {
- $table.trigger("sorton", [$table[0].config.sortList, function(){
- resortComplete($table, callback);
- }]);
- } else {
- resortComplete($table, callback);
- }
- }
-
- /* public methods */
- ts.construct = function(settings) {
- return this.each(function() {
- // if no thead or tbody, or tablesorter is already present, quit
- if (!this.tHead || this.tBodies.length === 0 || this.hasInitialized === true) {
- return (this.config.debug) ? log('stopping initialization! No thead, tbody or tablesorter has already been initialized') : '';
- }
- // declare
- var $cell, $this = $(this),
- c, i, j, k = '', a, s, o, downTime,
- m = $.metadata;
- // initialization flag
- this.hasInitialized = false;
- // new blank config object
- this.config = {};
- // merge and extend
- c = $.extend(true, this.config, ts.defaults, settings);
- // save the settings where they read
- $.data(this, "tablesorter", c);
- if (c.debug) { $.data( this, 'startoveralltimer', new Date()); }
- // constants
- c.supportsTextContent = $('<span>x</span>')[0].textContent === 'x';
- c.supportsDataObject = parseFloat($.fn.jquery) >= 1.4;
- // digit sort text location; keeping max+/- for backwards compatibility
- c.string = { 'max': 1, 'min': -1, 'max+': 1, 'max-': -1, 'zero': 0, 'none': 0, 'null': 0, 'top': true, 'bottom': false };
- // add table theme class only if there isn't already one there
- if (!/tablesorter\-/.test($this.attr('class'))) {
- k = (c.theme !== '' ? ' tablesorter-' + c.theme : '');
- }
- $this.addClass(c.tableClass + k);
- // build headers
- c.$headers = buildHeaders(this);
- // try to auto detect column type, and store in tables config
- c.parsers = buildParserCache(this);
- // build the cache for the tbody cells
- // delayInit will delay building the cache until the user starts a sort
- if (!c.delayInit) { buildCache(this); }
- // apply event handling to headers
- // this is to big, perhaps break it out?
- c.$headers
- // http://stackoverflow.com/questions/5312849/jquery-find-self
- .find('*').andSelf().filter(c.selectorSort)
- .unbind('mousedown.tablesorter mouseup.tablesorter')
- .bind('mousedown.tablesorter mouseup.tablesorter', function(e, external) {
- // jQuery v1.2.6 doesn't have closest()
- var $cell = this.tagName.match('TH|TD') ? $(this) : $(this).parents('th, td').filter(':last'), cell = $cell[0];
- // only recognize left clicks
- if ((e.which || e.button) !== 1) { return false; }
- // set timer on mousedown
- if (e.type === 'mousedown') {
- downTime = new Date().getTime();
- return e.target.tagName === "INPUT" ? '' : !c.cancelSelection;
- }
- // ignore long clicks (prevents resizable widget from initializing a sort)
- if (external !== true && (new Date().getTime() - downTime > 250)) { return false; }
- if (c.delayInit && !c.cache) { buildCache($this[0]); }
- if (!cell.sortDisabled) {
- // Only call sortStart if sorting is enabled
- $this.trigger("sortStart", $this[0]);
- // store exp, for speed
- // $cell = $(this);
- k = !e[c.sortMultiSortKey];
- // get current column sort order
- cell.count = e[c.sortResetKey] ? 2 : (cell.count + 1) % (c.sortReset ? 3 : 2);
- // reset all sorts on non-current column - issue #30
- if (c.sortRestart) {
- i = cell;
- c.$headers.each(function() {
- // only reset counts on columns that weren't just clicked on and if not included in a multisort
- if (this !== i && (k || !$(this).is('.' + c.cssDesc + ',.' + c.cssAsc))) {
- this.count = -1;
- }
- });
- }
- // get current column index
- i = cell.column;
- // user only wants to sort on one column
- if (k) {
- // flush the sort list
- c.sortList = [];
- if (c.sortForce !== null) {
- a = c.sortForce;
- for (j = 0; j < a.length; j++) {
- if (a[j][0] !== i) {
- c.sortList.push(a[j]);
- }
- }
- }
- // add column to sort list
- o = cell.order[cell.count];
- if (o < 2) {
- c.sortList.push([i, o]);
- // add other columns if header spans across multiple
- if (cell.colSpan > 1) {
- for (j = 1; j < cell.colSpan; j++) {
- c.sortList.push([i + j, o]);
- }
- }
- }
- // multi column sorting
- } else {
- // get rid of the sortAppend before adding more - fixes issue #115
- if (c.sortAppend && c.sortList.length > 1) {
- if (ts.isValueInArray(c.sortAppend[0][0], c.sortList)) {
- c.sortList.pop();
- }
- }
- // the user has clicked on an already sorted column
- if (ts.isValueInArray(i, c.sortList)) {
- // reverse the sorting direction for all tables
- for (j = 0; j < c.sortList.length; j++) {
- s = c.sortList[j];
- o = c.headerList[s[0]];
- if (s[0] === i) {
- s[1] = o.order[o.count];
- if (s[1] === 2) {
- c.sortList.splice(j,1);
- o.count = -1;
- }
- }
- }
- } else {
- // add column to sort list array
- o = cell.order[cell.count];
- if (o < 2) {
- c.sortList.push([i, o]);
- // add other columns if header spans across multiple
- if (cell.colSpan > 1) {
- for (j = 1; j < cell.colSpan; j++) {
- c.sortList.push([i + j, o]);
- }
- }
- }
- }
- }
- if (c.sortAppend !== null) {
- a = c.sortAppend;
- for (j = 0; j < a.length; j++) {
- if (a[j][0] !== i) {
- c.sortList.push(a[j]);
- }
- }
- }
- // sortBegin event triggered immediately before the sort
- $this.trigger("sortBegin", $this[0]);
- // setTimeout needed so the processing icon shows up
- setTimeout(function(){
- // set css for headers
- setHeadersCss($this[0]);
- multisort($this[0]);
- appendToTable($this[0]);
- }, 1);
- }
- });
- if (c.cancelSelection) {
- // cancel selection
- c.$headers.each(function() {
- this.onselectstart = function() {
- return false;
- };
- });
- }
- // apply easy methods that trigger binded events
- $this
- .unbind('sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
- .bind("sortReset", function(){
- c.sortList = [];
- setHeadersCss(this);
- multisort(this);
- appendToTable(this);
- })
- .bind("update", function(e, resort, callback) {
- // remove rows/elements before update
- $(c.selectorRemove, this).remove();
- // rebuild parsers
- c.parsers = buildParserCache(this);
- // rebuild the cache map
- buildCache(this);
- checkResort($this, resort, callback);
- })
- .bind("updateCell", function(e, cell, resort, callback) {
- // get position from the dom
- var l, row, icell,
- t = this, $tb = $(this).find('tbody'),
- // update cache - format: function(s, table, cell, cellIndex)
- // no closest in jQuery v1.2.6 - tbdy = $tb.index( $(cell).closest('tbody') ),$row = $(cell).closest('tr');
- tbdy = $tb.index( $(cell).parents('tbody').filter(':last') ),
- $row = $(cell).parents('tr').filter(':last');
- cell = $(cell)[0]; // in case cell is a jQuery object
- // tbody may not exist if update is initialized while tbody is removed for processing
- if ($tb.length && tbdy >= 0) {
- row = $tb.eq(tbdy).find('tr').index( $row );
- icell = cell.cellIndex;
- l = t.config.cache[tbdy].normalized[row].length - 1;
- t.config.cache[tbdy].row[t.config.cache[tbdy].normalized[row][l]] = $row;
- t.config.cache[tbdy].normalized[row][icell] = c.parsers[icell].format( getElementText(t, cell, icell), t, cell, icell );
- checkResort($this, resort, callback);
- }
- })
- .bind("addRows", function(e, $row, resort, callback) {
- var i, rows = $row.filter('tr').length,
- dat = [], l = $row[0].cells.length, t = this,
- tbdy = $(this).find('tbody').index( $row.closest('tbody') );
- // fixes adding rows to an empty table - see issue #179
- if (!c.parsers) {
- c.parsers = buildParserCache(t);
- }
- // add each row
- for (i = 0; i < rows; i++) {
- // add each cell
- for (j = 0; j < l; j++) {
- dat[j] = c.parsers[j].format( getElementText(t, $row[i].cells[j], j), t, $row[i].cells[j], j );
- }
- // add the row index to the end
- dat.push(c.cache[tbdy].row.length);
- // update cache
- c.cache[tbdy].row.push([$row[i]]);
- c.cache[tbdy].normalized.push(dat);
- dat = [];
- }
- // resort using current settings
- checkResort($this, resort, callback);
- })
- .bind("sorton", function(e, list, callback, init) {
- $(this).trigger("sortStart", this);
- // update header count index
- updateHeaderSortCount(this, list);
- // set css for headers
- setHeadersCss(this);
- // sort the table and append it to the dom
- multisort(this);
- appendToTable(this, init);
- if (typeof callback === "function") {
- callback(this);
- }
- })
- .bind("appendCache", function(e, callback, init) {
- appendToTable(this, init);
- if (typeof callback === "function") {
- callback(this);
- }
- })
- .bind("applyWidgetId", function(e, id) {
- ts.getWidgetById(id).format(this, c, c.widgetOptions);
- })
- .bind("applyWidgets", function(e, init) {
- // apply widgets
- ts.applyWidget(this, init);
- })
- .bind("refreshWidgets", function(e, all, dontapply){
- ts.refreshWidgets(this, all, dontapply);
- })
- .bind("destroy", function(e, c, cb){
- ts.destroy(this, c, cb);
- });
-
- // get sort list from jQuery data or metadata
- // in jQuery < 1.4, an error occurs when calling $this.data()
- if (c.supportsDataObject && typeof $this.data().sortlist !== 'undefined') {
- c.sortList = $this.data().sortlist;
- } else if (m && ($this.metadata() && $this.metadata().sortlist)) {
- c.sortList = $this.metadata().sortlist;
- }
- // apply widget init code
- ts.applyWidget(this, true);
- // if user has supplied a sort list to constructor
- if (c.sortList.length > 0) {
- $this.trigger("sorton", [c.sortList, {}, !c.initWidgets]);
- } else if (c.initWidgets) {
- // apply widget format
- ts.applyWidget(this);
- }
-
- // fixate columns if the users supplies the fixedWidth option
- // do this after theme has been applied
- fixColumnWidth(this);
-
- // show processesing icon
- if (c.showProcessing) {
- $this
- .unbind('sortBegin sortEnd')
- .bind('sortBegin sortEnd', function(e) {
- ts.isProcessing($this[0], e.type === 'sortBegin');
- });
- }
-
- // initialized
- this.hasInitialized = true;
- if (c.debug) {
- ts.benchmark("Overall initialization time", $.data( this, 'startoveralltimer'));
- }
- $this.trigger('tablesorter-initialized', this);
- if (typeof c.initialized === 'function') { c.initialized(this); }
- });
- };
-
- // *** Process table ***
- // add processing indicator
- ts.isProcessing = function(table, toggle, $ths) {
- var c = table.config,
- // default to all headers
- $h = $ths || $(table).find('.' + c.cssHeader);
- if (toggle) {
- if (c.sortList.length > 0) {
- // get headers from the sortList
- $h = $h.filter(function(){
- // get data-column from attr to keep compatibility with jQuery 1.2.6
- return this.sortDisabled ? false : ts.isValueInArray( parseFloat($(this).attr('data-column')), c.sortList);
- });
- }
- $h.addClass(c.cssProcessing);
- } else {
- $h.removeClass(c.cssProcessing);
- }
- };
-
- // detach tbody but save the position
- // don't use tbody because there are portions that look for a tbody index (updateCell)
- ts.processTbody = function(table, $tb, getIt){
- var t, holdr;
- if (getIt) {
- $tb.before('<span class="tablesorter-savemyplace"/>');
- holdr = ($.fn.detach) ? $tb.detach() : $tb.remove();
- return holdr;
- }
- holdr = $(table).find('span.tablesorter-savemyplace');
- $tb.insertAfter( holdr );
- holdr.remove();
- };
-
- ts.clearTableBody = function(table) {
- $(table.tBodies).filter(':not(.' + table.config.cssInfoBlock + ')').empty();
- };
-
- ts.destroy = function(table, removeClasses, callback){
- var $t = $(table), c = table.config,
- $h = $t.find('thead:first');
- // clear flag in case the plugin is initialized again
- table.hasInitialized = false;
- // remove widget added rows
- $h.find('tr:not(.' + c.cssHeaderRow + ')').remove();
- // remove resizer widget stuff
- $h.find('.tablesorter-resizer').remove();
- // remove all widgets
- ts.refreshWidgets(table, true, true);
- // disable tablesorter
- $t
- .removeData('tablesorter')
- .unbind('sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
- .find('.' + c.cssHeader)
- .unbind('click mousedown mousemove mouseup')
- .removeClass(c.cssHeader + ' ' + c.cssAsc + ' ' + c.cssDesc)
- .find('.tablesorter-header-inner').each(function(){
- if (c.cssIcon !== '') { $(this).find('.' + c.cssIcon).remove(); }
- $(this).replaceWith( $(this).contents() );
- });
- if (removeClasses !== false) {
- $t.removeClass(c.tableClass);
- }
- if (typeof callback === 'function') {
- callback(table);
- }
- };
-
- // *** sort functions ***
- // regex used in natural sort
- ts.regex = [
- /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi, // chunk/tokenize numbers & letters
- /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, //date
- /^0x[0-9a-f]+$/i // hex
- ];
-
- // Natural sort - https://github.com/overset/javascript-natural-sort
- ts.sortText = function(table, a, b, col) {
- if (a === b) { return 0; }
- var c = table.config, e = c.string[ (c.empties[col] || c.emptyTo ) ],
- r = ts.regex, xN, xD, yN, yD, xF, yF, i, mx;
- if (a === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? -1 : 1) : -e || -1; }
- if (b === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? 1 : -1) : e || 1; }
- if (typeof c.textSorter === 'function') { return c.textSorter(a, b, table, col); }
- // chunk/tokenize
- xN = a.replace(r[0], '\\0$1\\0').replace(/\\0$/, '').replace(/^\\0/, '').split('\\0');
- yN = b.replace(r[0], '\\0$1\\0').replace(/\\0$/, '').replace(/^\\0/, '').split('\\0');
- // numeric, hex or date detection
- xD = parseInt(a.match(r[2]),16) || (xN.length !== 1 && a.match(r[1]) && Date.parse(a));
- yD = parseInt(b.match(r[2]),16) || (xD && b.match(r[1]) && Date.parse(b)) || null;
- // first try and sort Hex codes or Dates
- if (yD) {
- if ( xD < yD ) { return -1; }
- if ( xD > yD ) { return 1; }
- }
- mx = Math.max(xN.length, yN.length);
- // natural sorting through split numeric strings and default strings
- for (i = 0; i < mx; i++) {
- // find floats not starting with '0', string or 0 if not defined
- xF = isNaN(xN[i]) ? xN[i] || 0 : parseFloat(xN[i]) || 0;
- yF = isNaN(yN[i]) ? yN[i] || 0 : parseFloat(yN[i]) || 0;
- // handle numeric vs string comparison - number < string - (Kyle Adams)
- if (isNaN(xF) !== isNaN(yF)) { return (isNaN(xF)) ? 1 : -1; }
- // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
- if (typeof xF !== typeof yF) {
- xF += '';
- yF += '';
- }
- if (xF < yF) { return -1; }
- if (xF > yF) { return 1; }
- }
- return 0;
- };
-
- ts.sortTextDesc = function(table, a, b, col) {
- if (a === b) { return 0; }
- var c = table.config, e = c.string[ (c.empties[col] || c.emptyTo ) ];
- if (a === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? -1 : 1) : e || 1; }
- if (b === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? 1 : -1) : -e || -1; }
- if (typeof c.textSorter === 'function') { return c.textSorter(b, a, table, col); }
- return ts.sortText(table, b, a);
- };
-
- // return text string value by adding up ascii value
- // so the text is somewhat sorted when using a digital sort
- // this is NOT an alphanumeric sort
- ts.getTextValue = function(a, mx, d) {
- if (mx) {
- // make sure the text value is greater than the max numerical value (mx)
- var i, l = a.length, n = mx + d;
- for (i = 0; i < l; i++) {
- n += a.charCodeAt(i);
- }
- return d * n;
- }
- return 0;
- };
-
- ts.sortNumeric = function(table, a, b, col, mx, d) {
- if (a === b) { return 0; }
- var c = table.config, e = c.string[ (c.empties[col] || c.emptyTo ) ];
- if (a === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? -1 : 1) : -e || -1; }
- if (b === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? 1 : -1) : e || 1; }
- if (isNaN(a)) { a = ts.getTextValue(a, mx, d); }
- if (isNaN(b)) { b = ts.getTextValue(b, mx, d); }
- return a - b;
- };
-
- ts.sortNumericDesc = function(table, a, b, col, mx, d) {
- if (a === b) { return 0; }
- var c = table.config, e = c.string[ (c.empties[col] || c.emptyTo ) ];
- if (a === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? -1 : 1) : e || 1; }
- if (b === '' && e !== 0) { return (typeof(e) === 'boolean') ? (e ? 1 : -1) : -e || -1; }
- if (isNaN(a)) { a = ts.getTextValue(a, mx, d); }
- if (isNaN(b)) { b = ts.getTextValue(b, mx, d); }
- return b - a;
- };
-
- // used when replacing accented characters during sorting
- ts.characterEquivalents = {
- "a" : "\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5", // áàâãäąå
- "A" : "\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5", // ÁÀÂÃÄĄÅ
- "c" : "\u00e7\u0107\u010d", // çćč
- "C" : "\u00c7\u0106\u010c", // ÇĆČ
- "e" : "\u00e9\u00e8\u00ea\u00eb\u011b\u0119", // éèêëěę
- "E" : "\u00c9\u00c8\u00ca\u00cb\u011a\u0118", // ÉÈÊËĚĘ
- "i" : "\u00ed\u00ec\u0130\u00ee\u00ef\u0131", // íìİîïı
- "I" : "\u00cd\u00cc\u0130\u00ce\u00cf", // ÍÌİÎÏ
- "o" : "\u00f3\u00f2\u00f4\u00f5\u00f6", // óòôõö
- "O" : "\u00d3\u00d2\u00d4\u00d5\u00d6", // ÓÒÔÕÖ
- "ss": "\u00df", // ß (s sharp)
- "SS": "\u1e9e", // ẞ (Capital sharp s)
- "u" : "\u00fa\u00f9\u00fb\u00fc\u016f", // úùûüů
- "U" : "\u00da\u00d9\u00db\u00dc\u016e" // ÚÙÛÜŮ
- };
- ts.replaceAccents = function(s) {
- var a, acc = '[', eq = ts.characterEquivalents;
- if (!ts.characterRegex) {
- ts.characterRegexArray = {};
- for (a in eq) {
- if (typeof a === 'string') {
- acc += eq[a];
- ts.characterRegexArray[a] = new RegExp('[' + eq[a] + ']', 'g');
- }
- }
- ts.characterRegex = new RegExp(acc + ']');
- }
- if (ts.characterRegex.test(s)) {
- for (a in eq) {
- if (typeof a === 'string') {
- s = s.replace( ts.characterRegexArray[a], a );
- }
- }
- }
- return s;
- };
-
- // *** utilities ***
- ts.isValueInArray = function(v, a) {
- var i, l = a.length;
- for (i = 0; i < l; i++) {
- if (a[i][0] === v) {
- return true;
- }
- }
- return false;
- };
-
- ts.addParser = function(parser) {
- var i, l = ts.parsers.length, a = true;
- for (i = 0; i < l; i++) {
- if (ts.parsers[i].id.toLowerCase() === parser.id.toLowerCase()) {
- a = false;
- }
- }
- if (a) {
- ts.parsers.push(parser);
- }
- };
-
- ts.getParserById = function(name) {
- var i, l = ts.parsers.length;
- for (i = 0; i < l; i++) {
- if (ts.parsers[i].id.toLowerCase() === (name.toString()).toLowerCase()) {
- return ts.parsers[i];
- }
- }
- return false;
- };
-
- ts.addWidget = function(widget) {
- ts.widgets.push(widget);
- };
-
- ts.getWidgetById = function(name) {
- var i, w, l = ts.widgets.length;
- for (i = 0; i < l; i++) {
- w = ts.widgets[i];
- if (w && w.hasOwnProperty('id') && w.id.toLowerCase() === name.toLowerCase()) {
- return w;
- }
- }
- };
-
- ts.applyWidget = function(table, init) {
- var c = table.config,
- wo = c.widgetOptions,
- ws = c.widgets.sort().reverse(), // ensure that widgets are always applied in a certain order
- time, i, w, l = ws.length;
- // make zebra last
- i = $.inArray('zebra', c.widgets);
- if (i >= 0) {
- c.widgets.splice(i,1);
- c.widgets.push('zebra');
- }
- if (c.debug) {
- time = new Date();
- }
- // add selected widgets
- for (i = 0; i < l; i++) {
- w = ts.getWidgetById(ws[i]);
- if ( w ) {
- if (init === true && w.hasOwnProperty('init')) {
- w.init(table, w, c, wo);
- } else if (!init && w.hasOwnProperty('format')) {
- w.format(table, c, wo);
- }
- }
- }
- if (c.debug) {
- benchmark("Completed " + (init === true ? "initializing" : "applying") + " widgets", time);
- }
- };
-
- ts.refreshWidgets = function(table, doAll, dontapply) {
- var i, c = table.config,
- cw = c.widgets,
- w = ts.widgets, l = w.length;
- // remove previous widgets
- for (i = 0; i < l; i++){
- if ( w[i] && w[i].id && (doAll || $.inArray( w[i].id, cw ) < 0) ) {
- if (c.debug) { log( 'Refeshing widgets: Removing ' + w[i].id ); }
- if (w[i].hasOwnProperty('remove')) { w[i].remove(table, c, c.widgetOptions); }
- }
- }
- if (dontapply !== true) {
- ts.applyWidget(table, doAll);
- }
- };
-
- // get sorter, string, empty, etc options for each column from
- // jQuery data, metadata, header option or header class name ("sorter-false")
- // priority = jQuery data > meta > headers option > header class name
- ts.getData = function(h, ch, key) {
- var val = '', $h = $(h), m, cl;
- if (!$h.length) { return ''; }
- m = $.metadata ? $h.metadata() : false;
- cl = ' ' + ($h.attr('class') || '');
- if (typeof $h.data(key) !== 'undefined' || typeof $h.data(key.toLowerCase()) !== 'undefined'){
- // "data-lockedOrder" is assigned to "lockedorder"; but "data-locked-order" is assigned to "lockedOrder"
- // "data-sort-initial-order" is assigned to "sortInitialOrder"
- val += $h.data(key) || $h.data(key.toLowerCase());
- } else if (m && typeof m[key] !== 'undefined') {
- val += m[key];
- } else if (ch && typeof ch[key] !== 'undefined') {
- val += ch[key];
- } else if (cl !== ' ' && cl.match(' ' + key + '-')) {
- // include sorter class name "sorter-text", etc
- val = cl.match( new RegExp(' ' + key + '-(\\w+)') )[1] || '';
- }
- return $.trim(val);
- };
-
- ts.formatFloat = function(s, table) {
- if (typeof(s) !== 'string' || s === '') { return s; }
- // allow using formatFloat without a table; defaults to US number format
- var i,
- t = table && table.config ? table.config.usNumberFormat !== false :
- typeof table !== "undefined" ? table : true;
- if (t) {
- // US Format - 1,234,567.89 -> 1234567.89
- s = s.replace(/,/g,'');
- } else {
- // German Format = 1.234.567,89 -> 1234567.89
- // French Format = 1 234 567,89 -> 1234567.89
- s = s.replace(/[\s|\.]/g,'').replace(/,/g,'.');
- }
- if(/^\s*\([.\d]+\)/.test(s)) {
- // make (#) into a negative number -> (10) = -10
- s = s.replace(/^\s*\(/,'-').replace(/\)/,'');
- }
- i = parseFloat(s);
- // return the text instead of zero
- return isNaN(i) ? $.trim(s) : i;
- };
-
- ts.isDigit = function(s) {
- // replace all unwanted chars and match
- return isNaN(s) ? (/^[\-+(]?\d+[)]?$/).test(s.toString().replace(/[,.'"\s]/g, '')) : true;
- };
-
- }()
- });
-
- // make shortcut
- var ts = $.tablesorter;
-
- // extend plugin scope
- $.fn.extend({
- tablesorter: ts.construct
- });
-
- // add default parsers
- ts.addParser({
- id: "text",
- is: function(s, table, node) {
- return true;
- },
- format: function(s, table, cell, cellIndex) {
- var c = table.config;
- s = $.trim( c.ignoreCase ? s.toLocaleLowerCase() : s );
- return c.sortLocaleCompare ? ts.replaceAccents(s) : s;
- },
- type: "text"
- });
-
- ts.addParser({
- id: "currency",
- is: function(s) {
- return (/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/).test(s); // £$€¤¥¢
- },
- format: function(s, table) {
- return ts.formatFloat(s.replace(/[^\w,. \-()]/g, ""), table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "ipAddress",
- is: function(s) {
- return (/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/).test(s);
- },
- format: function(s, table) {
- var i, a = s.split("."),
- r = "",
- l = a.length;
- for (i = 0; i < l; i++) {
- r += ("00" + a[i]).slice(-3);
- }
- return ts.formatFloat(r, table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "url",
- is: function(s) {
- return (/^(https?|ftp|file):\/\//).test(s);
- },
- format: function(s) {
- return $.trim(s.replace(/(https?|ftp|file):\/\//, ''));
- },
- type: "text"
- });
-
- ts.addParser({
- id: "isoDate",
- is: function(s) {
- return (/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/).test(s);
- },
- format: function(s, table) {
- return ts.formatFloat((s !== "") ? (new Date(s.replace(/-/g, "/")).getTime() || "") : "", table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "percent",
- is: function(s) {
- return (/(\d\s?%|%\s?\d)/).test(s);
- },
- format: function(s, table) {
- return ts.formatFloat(s.replace(/%/g, ""), table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "usLongDate",
- is: function(s) {
- // two digit years are not allowed cross-browser
- return (/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i).test(s);
- },
- format: function(s, table) {
- return ts.formatFloat( (new Date(s.replace(/(\S)([AP]M)$/i, "$1 $2")).getTime() || ''), table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "shortDate", // "mmddyyyy", "ddmmyyyy" or "yyyymmdd"
- is: function(s) {
- // testing for ####-##-####, so it's not perfect
- return (/^(\d{1,2}|\d{4})[\/\-\,\.\s+]\d{1,2}[\/\-\.\,\s+](\d{1,2}|\d{4})$/).test(s);
- },
- format: function(s, table, cell, cellIndex) {
- var c = table.config, ci = c.headerList[cellIndex],
- format = ci.shortDateFormat;
- if (typeof format === 'undefined') {
- // cache header formatting so it doesn't getData for every cell in the column
- format = ci.shortDateFormat = ts.getData( ci, c.headers[cellIndex], 'dateFormat') || c.dateFormat;
- }
- s = s.replace(/\s+/g," ").replace(/[\-|\.|\,]/g, "/");
- if (format === "mmddyyyy") {
- s = s.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2");
- } else if (format === "ddmmyyyy") {
- s = s.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$2/$1");
- } else if (format === "yyyymmdd") {
- s = s.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/, "$1/$2/$3");
- }
- return ts.formatFloat( (new Date(s).getTime() || ''), table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "time",
- is: function(s) {
- return (/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i).test(s);
- },
- format: function(s, table) {
- return ts.formatFloat( (new Date("2000/01/01 " + s.replace(/(\S)([AP]M)$/i, "$1 $2")).getTime() || ""), table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "digit",
- is: function(s) {
- return ts.isDigit(s);
- },
- format: function(s, table) {
- return ts.formatFloat(s.replace(/[^\w,. \-()]/g, ""), table);
- },
- type: "numeric"
- });
-
- ts.addParser({
- id: "metadata",
- is: function(s) {
- return false;
- },
- format: function(s, table, cell) {
- var c = table.config,
- p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
- return $(cell).metadata()[p];
- },
- type: "numeric"
- });
-
- // add default widgets
- ts.addWidget({
- id: "zebra",
- format: function(table, c, wo) {
- var $tb, $tv, $tr, row, even, time, k, l,
- child = new RegExp(c.cssChildRow, 'i'),
- b = $(table).children('tbody:not(.' + c.cssInfoBlock + ')');
- if (c.debug) {
- time = new Date();
- }
- for (k = 0; k < b.length; k++ ) {
- // loop through the visible rows
- $tb = $(b[k]);
- l = $tb.children('tr').length;
- if (l > 1) {
- row = 0;
- $tv = $tb.children('tr:visible');
- // revered back to using jQuery each - strangely it's the fastest method
- /*jshint loopfunc:true */
- $tv.each(function(){
- $tr = $(this);
- // style children rows the same way the parent row was styled
- if (!child.test(this.className)) { row++; }
- even = (row % 2 === 0);
- $tr.removeClass(wo.zebra[even ? 1 : 0]).addClass(wo.zebra[even ? 0 : 1]);
- });
- }
- }
- if (c.debug) {
- ts.benchmark("Applying Zebra widget", time);
- }
- },
- remove: function(table, c, wo){
- var k, $tb,
- b = $(table).children('tbody:not(.' + c.cssInfoBlock + ')'),
- rmv = (c.widgetOptions.zebra || [ "even", "odd" ]).join(' ');
- for (k = 0; k < b.length; k++ ){
- $tb = $.tablesorter.processTbody(table, $(b[k]), true); // remove tbody
- $tb.children().removeClass(rmv);
- $.tablesorter.processTbody(table, $tb, false); // restore tbody
- }
- }
- });
-
-})(jQuery); \ No newline at end of file
diff --git a/sitestatic/jquery.tablesorter-2.7.min.js b/sitestatic/jquery.tablesorter-2.7.min.js
deleted file mode 100644
index cf5e3068..00000000
--- a/sitestatic/jquery.tablesorter-2.7.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
-* TableSorter 2.7 min - Client-side table sorting with ease!
-* Copyright (c) 2007 Christian Bach
-*/
-!function(g){g.extend({tablesorter:new function(){function d(c){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(c):alert(c)}function v(c,b){d(c+" ("+((new Date).getTime()-b.getTime())+"ms)")}function p(c,b,a){if(!b)return"";var f=c.config,h=f.textExtraction,e="",e="simple"===h?f.supportsTextContent?b.textContent:g(b).text():"function"===typeof h?h(b,c,a):"object"===typeof h&&h.hasOwnProperty(a)?h[a](b,c,a):f.supportsTextContent?b.textContent:g(b).text();return g.trim(e)} function k(c){var b=c.config,a=g(c.tBodies).filter(":not(."+b.cssInfoBlock+")"),f,h,s,j,m,l,n="";if(0===a.length)return b.debug?d("*Empty table!* Not building a parser cache"):"";a=a[0].rows;if(a[0]){f=[];h=a[0].cells.length;for(s=0;s<h;s++){j=b.$headers.filter(":not([colspan])");j=j.add(b.$headers.filter('[colspan="1"]')).filter('[data-column="'+s+'"]:last');m=b.headers[s];l=e.getParserById(e.getData(j,m,"sorter"));b.empties[s]=e.getData(j,m,"empty")||b.emptyTo||(b.emptyToBottom?"bottom":"top"); b.strings[s]=e.getData(j,m,"string")||b.stringTo||"max";if(!l)a:{j=c;m=a;l=-1;for(var v=s,r=void 0,t=e.parsers.length,y=!1,q="",r=!0;""===q&&r;)l++,m[l]?(y=m[l].cells[v],q=p(j,y,v),j.config.debug&&d("Checking if value was empty on row "+l+", column: "+v+": "+q)):r=!1;for(r=1;r<t;r++)if(e.parsers[r].is(q,j,y)){l=e.parsers[r];break a}l=e.parsers[0]}b.debug&&(n+="column:"+s+"; parser:"+l.id+"; string:"+b.strings[s]+"; empty: "+b.empties[s]+"\n");f.push(l)}}b.debug&&d(n);return f}function q(c){var b= c.tBodies,a=c.config,f,h,s=a.parsers,j,m,l,n,k,r,q,y=[];a.cache={};if(!s)return a.debug?d("*Empty table!* Not building a cache"):"";a.debug&&(q=new Date);a.showProcessing&&e.isProcessing(c,!0);for(n=0;n<b.length;n++)if(a.cache[n]={row:[],normalized:[]},!g(b[n]).hasClass(a.cssInfoBlock)){f=b[n]&&b[n].rows.length||0;h=b[n].rows[0]&&b[n].rows[0].cells.length||0;for(m=0;m<f;++m)if(k=g(b[n].rows[m]),r=[],k.hasClass(a.cssChildRow))a.cache[n].row[a.cache[n].row.length-1]=a.cache[n].row[a.cache[n].row.length- 1].add(k);else{a.cache[n].row.push(k);for(l=0;l<h;++l)if(j=p(c,k[0].cells[l],l),j=s[l].format(j,c,k[0].cells[l],l),r.push(j),"numeric"===(s[l].type||"").toLowerCase())y[l]=Math.max(Math.abs(j),y[l]||0);r.push(a.cache[n].normalized.length);a.cache[n].normalized.push(r)}a.cache[n].colMax=y}a.showProcessing&&e.isProcessing(c);a.debug&&v("Building cache for "+f+" rows",q)}function t(c,b){var a=c.config,f=c.tBodies,h=[],d=a.cache,j,m,l,n,k,r,p,q,t,u,x;if(d[0]){a.debug&&(x=new Date);for(q=0;q<f.length;q++)if(j= g(f[q]),!j.hasClass(a.cssInfoBlock)){k=e.processTbody(c,j,!0);j=d[q].row;m=d[q].normalized;n=(l=m.length)?m[0].length-1:0;for(r=0;r<l;r++)if(u=m[r][n],h.push(j[u]),!a.appender||!a.removeRows){t=j[u].length;for(p=0;p<t;p++)k.append(j[u][p])}e.processTbody(c,k,!1)}a.appender&&a.appender(c,h);a.debug&&v("Rebuilt table",x);b||e.applyWidget(c);g(c).trigger("sortEnd",c)}}function C(c){var b,a,f,h=c.config,e=h.sortList,d=[h.cssAsc,h.cssDesc],m=g(c).find("tfoot tr").children().removeClass(d.join(" "));h.$headers.removeClass(d.join(" ")); f=e.length;for(b=0;b<f;b++)if(2!==e[b][1]&&(c=h.$headers.not(".sorter-false").filter('[data-column="'+e[b][0]+'"]'+(1===f?":last":"")),c.length))for(a=0;a<c.length;a++)c[a].sortDisabled||(c.eq(a).addClass(d[e[b][1]]),m.length&&m.filter('[data-column="'+e[b][0]+'"]').eq(a).addClass(d[e[b][1]]))}function E(c){var b=0,a=c.config,f=a.sortList,h=f.length,e=c.tBodies.length,d,m,l,n,k,r,p,q,t;if(!a.serverSideSorting&&a.cache[0]){a.debug&&(d=new Date);for(l=0;l<e;l++)k=a.cache[l].colMax,t=(r=a.cache[l].normalized)&& r[0]?r[0].length-1:0,r.sort(function(e,d){for(m=0;m<h;m++){n=f[m][0];q=f[m][1];p=/n/i.test(a.parsers&&a.parsers[n]?a.parsers[n].type||"":"")?"Numeric":"Text";p+=0===q?"":"Desc";/Numeric/.test(p)&&a.strings[n]&&(b="boolean"===typeof a.string[a.strings[n]]?(0===q?1:-1)*(a.string[a.strings[n]]?-1:1):a.strings[n]?a.string[a.strings[n]]||0:0);var j=g.tablesorter["sort"+p](c,e[n],d[n],n,k[n],b);if(j)return j}return e[t]-d[t]});a.debug&&v("Sorting on "+f.toString()+" and dir "+q+" time",d)}}function D(c, b){c.trigger("updateComplete");"function"===typeof b&&b(c[0])}function F(c,b,a){!1!==b?c.trigger("sorton",[c[0].config.sortList,function(){D(c,a)}]):D(c,a)}var e=this;e.version="2.7";e.parsers=[];e.widgets=[];e.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,headers:{},ignoreCase:!0, sortForce:null,sortList:[],sortAppend:null,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,initialized:null,tableClass:"tablesorter",cssAsc:"tablesorter-headerAsc",cssChildRow:"tablesorter-childRow",cssDesc:"tablesorter-headerDesc",cssHeader:"tablesorter-header",cssHeaderRow:"tablesorter-headerRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly", cssProcessing:"tablesorter-processing",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};e.benchmark=v;e.construct=function(c){return this.each(function(){if(!this.tHead||0===this.tBodies.length||!0===this.hasInitialized)return this.config.debug?d("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var b=g(this),a,f,h,s="",j,m,l,n,D=g.metadata;this.hasInitialized= !1;this.config={};a=g.extend(!0,this.config,e.defaults,c);g.data(this,"tablesorter",a);a.debug&&g.data(this,"startoveralltimer",new Date);a.supportsTextContent="x"===g("<span>x</span>")[0].textContent;a.supportsDataObject=1.4<=parseFloat(g.fn.jquery);a.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(b.attr("class"))||(s=""!==a.theme?" tablesorter-"+a.theme:"");b.addClass(a.tableClass+s);var r=[],P={},y=g(this).find("thead:eq(0), tfoot").children("tr"), I,J,x,z,N,B,K,Q,R,G;for(I=0;I<y.length;I++){N=y[I].cells;for(J=0;J<N.length;J++){z=N[J];B=z.parentNode.rowIndex;K=B+"-"+z.cellIndex;Q=z.rowSpan||1;R=z.colSpan||1;"undefined"===typeof r[B]&&(r[B]=[]);for(x=0;x<r[B].length+1;x++)if("undefined"===typeof r[B][x]){G=x;break}P[K]=G;g(z).attr({"data-column":G});for(x=B;x<B+Q;x++){"undefined"===typeof r[x]&&(r[x]=[]);K=r[x];for(z=G;z<G+R;z++)K[z]="x"}}}var L,A,O,S,M,H,T,w=this.config;w.headerList=[];w.headerContent=[];w.debug&&(T=new Date);S=w.cssIcon?'<i class="'+ w.cssIcon+'"></i>':"";r=g(this).find(w.selectorHeaders).each(function(a){A=g(this);L=w.headers[a];w.headerContent[a]=this.innerHTML;M=w.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,S);w.onRenderTemplate&&(O=w.onRenderTemplate.apply(A,[a,M]))&&"string"===typeof O&&(M=O);this.innerHTML='<div class="tablesorter-header-inner">'+M+"</div>";w.onRenderHeader&&w.onRenderHeader.apply(A,[a]);this.column=P[this.parentNode.rowIndex+"-"+this.cellIndex];var b=e.getData(A,L,"sortInitialOrder")|| w.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;"false"===e.getData(A,L,"sorter")?(this.sortDisabled=!0,A.addClass("sorter-false")):A.removeClass("sorter-false");this.lockedOrder=!1;H=e.getData(A,L,"lockedOrder")||!1;"undefined"!==typeof H&&!1!==H&&(this.order=this.lockedOrder=/^d/i.test(H)||1===H?[1,1,1]:[0,0,0]);A.addClass((this.sortDisabled?"sorter-false ":" ")+w.cssHeader);w.headerList[a]=this;A.parent().addClass(w.cssHeaderRow)});this.config.debug&&(v("Built headers:", T),d(r));a.$headers=r;a.parsers=k(this);a.delayInit||q(this);a.$headers.find("*").andSelf().filter(a.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(c,d){var k=(this.tagName.match("TH|TD")?g(this):g(this).parents("th, td").filter(":last"))[0];if(1!==(c.which||c.button))return!1;if("mousedown"===c.type)return n=(new Date).getTime(),"INPUT"===c.target.tagName?"":!a.cancelSelection;if(!0!==d&&250<(new Date).getTime()-n)return!1; a.delayInit&&!a.cache&&q(b[0]);if(!k.sortDisabled){b.trigger("sortStart",b[0]);s=!c[a.sortMultiSortKey];k.count=c[a.sortResetKey]?2:(k.count+1)%(a.sortReset?3:2);a.sortRestart&&(f=k,a.$headers.each(function(){if(this!==f&&(s||!g(this).is("."+a.cssDesc+",."+a.cssAsc)))this.count=-1}));f=k.column;if(s){a.sortList=[];if(null!==a.sortForce){j=a.sortForce;for(h=0;h<j.length;h++)j[h][0]!==f&&a.sortList.push(j[h])}l=k.order[k.count];if(2>l&&(a.sortList.push([f,l]),1<k.colSpan))for(h=1;h<k.colSpan;h++)a.sortList.push([f+ h,l])}else if(a.sortAppend&&1<a.sortList.length&&e.isValueInArray(a.sortAppend[0][0],a.sortList)&&a.sortList.pop(),e.isValueInArray(f,a.sortList))for(h=0;h<a.sortList.length;h++)m=a.sortList[h],l=a.headerList[m[0]],m[0]===f&&(m[1]=l.order[l.count],2===m[1]&&(a.sortList.splice(h,1),l.count=-1));else if(l=k.order[k.count],2>l&&(a.sortList.push([f,l]),1<k.colSpan))for(h=1;h<k.colSpan;h++)a.sortList.push([f+h,l]);if(null!==a.sortAppend){j=a.sortAppend;for(h=0;h<j.length;h++)j[h][0]!==f&&a.sortList.push(j[h])}b.trigger("sortBegin", b[0]);setTimeout(function(){C(b[0]);E(b[0]);t(b[0])},1)}});a.cancelSelection&&a.$headers.each(function(){this.onselectstart=function(){return!1}});b.unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").bind("sortReset",function(){a.sortList=[];C(this);E(this);t(this)}).bind("update",function(c,f,h){g(a.selectorRemove,this).remove();a.parsers=k(this);q(this);F(b,f,h)}).bind("updateCell",function(c,f,h,e){var d,j,s;d=g(this).find("tbody"); c=d.index(g(f).parents("tbody").filter(":last"));var k=g(f).parents("tr").filter(":last");f=g(f)[0];d.length&&0<=c&&(j=d.eq(c).find("tr").index(k),s=f.cellIndex,d=this.config.cache[c].normalized[j].length-1,this.config.cache[c].row[this.config.cache[c].normalized[j][d]]=k,this.config.cache[c].normalized[j][s]=a.parsers[s].format(p(this,f,s),this,f,s),F(b,h,e))}).bind("addRows",function(c,f,e,d){var j=f.filter("tr").length,s=[],l=f[0].cells.length,m=g(this).find("tbody").index(f.closest("tbody")); a.parsers||(a.parsers=k(this));for(c=0;c<j;c++){for(h=0;h<l;h++)s[h]=a.parsers[h].format(p(this,f[c].cells[h],h),this,f[c].cells[h],h);s.push(a.cache[m].row.length);a.cache[m].row.push([f[c]]);a.cache[m].normalized.push(s);s=[]}F(b,e,d)}).bind("sorton",function(a,b,c,f){g(this).trigger("sortStart",this);var h,e,d,j=this.config;a=b||j.sortList;j.sortList=[];g.each(a,function(a,b){h=[parseInt(b[0],10),parseInt(b[1],10)];if(d=j.headerList[h[0]])j.sortList.push(h),e=g.inArray(h[1],d.order),d.count=0<= e?e:h[1]%(j.sortReset?3:2)});C(this);E(this);t(this,f);"function"===typeof c&&c(this)}).bind("appendCache",function(a,b,c){t(this,c);"function"===typeof b&&b(this)}).bind("applyWidgetId",function(b,c){e.getWidgetById(c).format(this,a,a.widgetOptions)}).bind("applyWidgets",function(a,b){e.applyWidget(this,b)}).bind("refreshWidgets",function(a,b,c){e.refreshWidgets(this,b,c)}).bind("destroy",function(a,b,c){e.destroy(this,b,c)});a.supportsDataObject&&"undefined"!==typeof b.data().sortlist?a.sortList= b.data().sortlist:D&&(b.metadata()&&b.metadata().sortlist)&&(a.sortList=b.metadata().sortlist);e.applyWidget(this,!0);0<a.sortList.length?b.trigger("sorton",[a.sortList,{},!a.initWidgets]):a.initWidgets&&e.applyWidget(this);if(this.config.widthFixed&&0===g(this).find("colgroup").length){var U=g("<colgroup>"),V=g(this).width();g("tr:first td",this.tBodies[0]).each(function(){U.append(g("<col>").css("width",parseInt(1E3*(g(this).width()/V),10)/10+"%"))});g(this).prepend(U)}a.showProcessing&&b.unbind("sortBegin sortEnd").bind("sortBegin sortEnd", function(a){e.isProcessing(b[0],"sortBegin"===a.type)});this.hasInitialized=!0;a.debug&&e.benchmark("Overall initialization time",g.data(this,"startoveralltimer"));b.trigger("tablesorter-initialized",this);"function"===typeof a.initialized&&a.initialized(this)})};e.isProcessing=function(c,b,a){var f=c.config;c=a||g(c).find("."+f.cssHeader);b?(0<f.sortList.length&&(c=c.filter(function(){return this.sortDisabled?!1:e.isValueInArray(parseFloat(g(this).attr("data-column")),f.sortList)})),c.addClass(f.cssProcessing)): c.removeClass(f.cssProcessing)};e.processTbody=function(c,b,a){if(a)return b.before('<span class="tablesorter-savemyplace"/>'),c=g.fn.detach?b.detach():b.remove();c=g(c).find("span.tablesorter-savemyplace");b.insertAfter(c);c.remove()};e.clearTableBody=function(c){g(c.tBodies).filter(":not(."+c.config.cssInfoBlock+")").empty()};e.destroy=function(c,b,a){var f=g(c),h=c.config,d=f.find("thead:first");c.hasInitialized=!1;d.find("tr:not(."+h.cssHeaderRow+")").remove();d.find(".tablesorter-resizer").remove(); e.refreshWidgets(c,!0,!0);f.removeData("tablesorter").unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+h.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(h.cssHeader+" "+h.cssAsc+" "+h.cssDesc).find(".tablesorter-header-inner").each(function(){""!==h.cssIcon&&g(this).find("."+h.cssIcon).remove();g(this).replaceWith(g(this).contents())});!1!==b&&f.removeClass(h.tableClass);"function"===typeof a&& a(c)};e.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];e.sortText=function(c,b,a,f){if(b===a)return 0;var h=c.config,d=h.string[h.empties[f]||h.emptyTo],j=e.regex;if(""===b&&0!==d)return"boolean"===typeof d?d?-1:1:-d||-1;if(""===a&&0!==d)return"boolean"===typeof d?d?1:-1:d||1;if("function"===typeof h.textSorter)return h.textSorter(b,a,c,f);c=b.replace(j[0], "\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");f=a.replace(j[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(j[2]),16)||1!==c.length&&b.match(j[1])&&Date.parse(b);if(a=parseInt(a.match(j[2]),16)||b&&a.match(j[1])&&Date.parse(a)||null){if(b<a)return-1;if(b>a)return 1}h=Math.max(c.length,f.length);for(b=0;b<h;b++){a=isNaN(c[b])?c[b]||0:parseFloat(c[b])||0;j=isNaN(f[b])?f[b]||0:parseFloat(f[b])||0;if(isNaN(a)!==isNaN(j))return isNaN(a)?1:-1;typeof a!== typeof j&&(a+="",j+="");if(a<j)return-1;if(a>j)return 1}return 0};e.sortTextDesc=function(c,b,a,f){if(b===a)return 0;var d=c.config,g=d.string[d.empties[f]||d.emptyTo];return""===b&&0!==g?"boolean"===typeof g?g?-1:1:g||1:""===a&&0!==g?"boolean"===typeof g?g?1:-1:-g||-1:"function"===typeof d.textSorter?d.textSorter(a,b,c,f):e.sortText(c,a,b)};e.getTextValue=function(c,b,a){if(b){var f=c.length,d=b+a;for(b=0;b<f;b++)d+=c.charCodeAt(b);return a*d}return 0};e.sortNumeric=function(c,b,a,f,d,g){if(b=== a)return 0;c=c.config;f=c.string[c.empties[f]||c.emptyTo];if(""===b&&0!==f)return"boolean"===typeof f?f?-1:1:-f||-1;if(""===a&&0!==f)return"boolean"===typeof f?f?1:-1:f||1;isNaN(b)&&(b=e.getTextValue(b,d,g));isNaN(a)&&(a=e.getTextValue(a,d,g));return b-a};e.sortNumericDesc=function(c,b,a,f,d,g){if(b===a)return 0;c=c.config;f=c.string[c.empties[f]||c.emptyTo];if(""===b&&0!==f)return"boolean"===typeof f?f?-1:1:f||1;if(""===a&&0!==f)return"boolean"===typeof f?f?1:-1:-f||-1;isNaN(b)&&(b=e.getTextValue(b, d,g));isNaN(a)&&(a=e.getTextValue(a,d,g));return a-b};e.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5",A:"\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5",c:"\u00e7\u0107\u010d",C:"\u00c7\u0106\u010c",e:"\u00e9\u00e8\u00ea\u00eb\u011b\u0119",E:"\u00c9\u00c8\u00ca\u00cb\u011a\u0118",i:"\u00ed\u00ec\u0130\u00ee\u00ef\u0131",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6",O:"\u00d3\u00d2\u00d4\u00d5\u00d6",ss:"\u00df",SS:"\u1e9e",u:"\u00fa\u00f9\u00fb\u00fc\u016f", U:"\u00da\u00d9\u00db\u00dc\u016e"};e.replaceAccents=function(c){var b,a="[",d=e.characterEquivalents;if(!e.characterRegex){e.characterRegexArray={};for(b in d)"string"===typeof b&&(a+=d[b],e.characterRegexArray[b]=RegExp("["+d[b]+"]","g"));e.characterRegex=RegExp(a+"]")}if(e.characterRegex.test(c))for(b in d)"string"===typeof b&&(c=c.replace(e.characterRegexArray[b],b));return c};e.isValueInArray=function(c,b){var a,d=b.length;for(a=0;a<d;a++)if(b[a][0]===c)return!0;return!1};e.addParser=function(c){var b, a=e.parsers.length,d=!0;for(b=0;b<a;b++)e.parsers[b].id.toLowerCase()===c.id.toLowerCase()&&(d=!1);d&&e.parsers.push(c)};e.getParserById=function(c){var b,a=e.parsers.length;for(b=0;b<a;b++)if(e.parsers[b].id.toLowerCase()===c.toString().toLowerCase())return e.parsers[b];return!1};e.addWidget=function(c){e.widgets.push(c)};e.getWidgetById=function(c){var b,a,d=e.widgets.length;for(b=0;b<d;b++)if((a=e.widgets[b])&&a.hasOwnProperty("id")&&a.id.toLowerCase()===c.toLowerCase())return a};e.applyWidget= function(c,b){var a=c.config,d=a.widgetOptions,h=a.widgets.sort().reverse(),k,j,m,l=h.length;j=g.inArray("zebra",a.widgets);0<=j&&(a.widgets.splice(j,1),a.widgets.push("zebra"));a.debug&&(k=new Date);for(j=0;j<l;j++)(m=e.getWidgetById(h[j]))&&(!0===b&&m.hasOwnProperty("init")?m.init(c,m,a,d):!b&&m.hasOwnProperty("format")&&m.format(c,a,d));a.debug&&v("Completed "+(!0===b?"initializing":"applying")+" widgets",k)};e.refreshWidgets=function(c,b,a){var f,h=c.config,k=h.widgets,j=e.widgets,m=j.length; for(f=0;f<m;f++)if(j[f]&&j[f].id&&(b||0>g.inArray(j[f].id,k)))h.debug&&d("Refeshing widgets: Removing "+j[f].id),j[f].hasOwnProperty("remove")&&j[f].remove(c,h,h.widgetOptions);!0!==a&&e.applyWidget(c,b)};e.getData=function(c,b,a){var d="";c=g(c);var e,k;if(!c.length)return"";e=g.metadata?c.metadata():!1;k=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):e&&"undefined"!==typeof e[a]?d+=e[a]:b&&"undefined"!== typeof b[a]?d+=b[a]:" "!==k&&k.match(" "+a+"-")&&(d=k.match(RegExp(" "+a+"-(\\w+)"))[1]||"");return g.trim(d)};e.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;var a;c=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?g.trim(c):a};e.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g, "")):!0}}});var k=g.tablesorter;g.fn.extend({tablesorter:k.construct});k.addParser({id:"text",is:function(){return!0},format:function(d,v){var p=v.config;d=g.trim(p.ignoreCase?d.toLocaleLowerCase():d);return p.sortLocaleCompare?k.replaceAccents(d):d},type:"text"});k.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test(d)},format:function(d,g){return k.formatFloat(d.replace(/[^\w,. \-()]/g,""),g)},type:"numeric"}); k.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var p,u=d.split("."),q="",t=u.length;for(p=0;p<t;p++)q+=("00"+u[p]).slice(-3);return k.formatFloat(q,g)},type:"numeric"});k.addParser({id:"url",is:function(d){return/^(https?|ftp|file):\/\//.test(d)},format:function(d){return g.trim(d.replace(/(https?|ftp|file):\/\//,""))},type:"text"});k.addParser({id:"isoDate",is:function(d){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(d)}, format:function(d,g){return k.formatFloat(""!==d?(new Date(d.replace(/-/g,"/"))).getTime()||"":"",g)},type:"numeric"});k.addParser({id:"percent",is:function(d){return/(\d\s?%|%\s?\d)/.test(d)},format:function(d,g){return k.formatFloat(d.replace(/%/g,""),g)},type:"numeric"});k.addParser({id:"usLongDate",is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)},format:function(d,g){return k.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()|| "",g)},type:"numeric"});k.addParser({id:"shortDate",is:function(d){return/^(\d{1,2}|\d{4})[\/\-\,\.\s+]\d{1,2}[\/\-\.\,\s+](\d{1,2}|\d{4})$/.test(d)},format:function(d,g,p,u){p=g.config;var q=p.headerList[u],t=q.shortDateFormat;"undefined"===typeof t&&(t=q.shortDateFormat=k.getData(q,p.headers[u],"dateFormat")||p.dateFormat);d=d.replace(/\s+/g," ").replace(/[\-|\.|\,]/g,"/");"mmddyyyy"===t?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===t?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$2/$1"):"yyyymmdd"===t&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"));return k.formatFloat((new Date(d)).getTime()||"",g)},type:"numeric"});k.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return k.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g)},type:"numeric"});k.addParser({id:"digit",is:function(d){return k.isDigit(d)},format:function(d,g){return k.formatFloat(d.replace(/[^\w,. \-()]/g, ""),g)},type:"numeric"});k.addParser({id:"metadata",is:function(){return!1},format:function(d,k,p){d=k.config;d=!d.parserMetadataName?"sortValue":d.parserMetadataName;return g(p).metadata()[d]},type:"numeric"});k.addWidget({id:"zebra",format:function(d,v,p){var u,q,t,C,E,D,F=RegExp(v.cssChildRow,"i"),e=g(d).children("tbody:not(."+v.cssInfoBlock+")");v.debug&&(E=new Date);for(d=0;d<e.length;d++)u=g(e[d]),D=u.children("tr").length,1<D&&(t=0,u=u.children("tr:visible"),u.each(function(){q=g(this);F.test(this.className)|| t++;C=0===t%2;q.removeClass(p.zebra[C?1:0]).addClass(p.zebra[C?0:1])}));v.debug&&k.benchmark("Applying Zebra widget",E)},remove:function(d,k){var p,u,q=g(d).children("tbody:not(."+k.cssInfoBlock+")"),t=(k.widgetOptions.zebra||["even","odd"]).join(" ");for(p=0;p<q.length;p++)u=g.tablesorter.processTbody(d,g(q[p]),!0),u.children().removeClass(t),g.tablesorter.processTbody(d,u,!1)}})}(jQuery);