/*! * TableSorter (FORK) 2.19.1 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach; fork maintained by Rob Garrison */ (function(h){"function"===typeof define&&define.amd?define(["jquery"],h):"object"===typeof module&&"object"===typeof module.exports?module.exports=h(require("jquery")):h(jQuery)})(function(h){h.extend({tablesorter:new function(){function e(){var b=arguments[0],a=1':"";l.$headers=h(h.map(h(b).find(l.selectorHeaders),function(k,e){d=h(k);if(!d.parent().hasClass(l.cssIgnoreRow))return a=g.getColumnData(b,l.headers,e,!0),l.headerContent[e]=d.html(),""===l.headerTemplate||d.find("."+g.css.headerIn).length||(m=l.headerTemplate.replace(/\{content\}/g,d.html()).replace(/\{icon\}/g,d.find("."+g.css.icon).length?"":f),l.onRenderTemplate&&(c=l.onRenderTemplate.apply(d,[e,m]))&&"string"===typeof c&&(m=c),d.html('
'+m+"
")),l.onRenderHeader&& l.onRenderHeader.apply(d,[e,l,l.$table]),k.column=parseInt(d.attr("data-column"),10),k.order=F(g.getData(d,a,"sortInitialOrder")||l.sortInitialOrder)?[1,0,2]:[0,1,2],k.count=-1,k.lockedOrder=!1,t=g.getData(d,a,"lockedOrder")||!1,"undefined"!==typeof t&&!1!==t&&(k.order=k.lockedOrder=F(t)?[1,1,1]:[0,0,0]),d.addClass(g.css.header+" "+l.cssHeader),l.headerList[e]=k,d.parent().addClass(g.css.headerRow+" "+l.cssHeaderRow).attr("role","row"),l.tabIndex&&d.attr("tabindex",0),k}));h(b).find(l.selectorHeaders).attr({scope:"col", role:"columnheader"});H(b);l.debug&&(w("Built headers:",k),e(l.$headers))}function I(b,a,d){var c=b.config;c.$table.find(c.selectorRemove).remove();p(b);z(b);J(c,a,d)}function H(b){var a,d,c,f=b.config;f.$headers.each(function(m,t){d=h(t);c=g.getColumnData(b,f.headers,m,!0);a="false"===g.getData(t,c,"sorter")||"false"===g.getData(t,c,"parser");t.sortDisabled=a;d[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?d.removeAttr("aria-controls"):d.attr("aria-controls",b.id))})} function G(b){var a,d,c=b.config,f=c.sortList,m=f.length,t=g.css.sortNone+" "+c.cssNone,k=[g.css.sortAsc+" "+c.cssAsc,g.css.sortDesc+" "+c.cssDesc],e=[c.cssIconAsc,c.cssIconDesc,c.cssIconNone],n=["ascending","descending"],q=h(b).find("tfoot tr").children().add(c.$extraHeaders).removeClass(k.join(" "));c.$headers.removeClass(k.join(" ")).addClass(t).attr("aria-sort","none").find("."+c.cssIcon).removeClass(e.join(" ")).addClass(e[2]);for(a=0;ac&&(k.sortList.push([f,c]),1c&&(k.sortList.push([f,c]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.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",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"};g.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"};g.log=e;g.benchmark=w;g.construct=function(b){return this.each(function(){var a= h.extend(!0,{},g.defaults,b);a.originalSettings=b;!this.hasInitialized&&g.buildTable&&"TABLE"!==this.tagName?g.buildTable(this,a):g.setup(this,a)})};g.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?e("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var d="",c=h(b),f=h.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;h.data(b,"tablesorter",a);a.debug&&h.data(b,"startoveralltimer",new Date); a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),a=c.$table.width(),h(b.tBodies).not("."+c.cssInfoBlock).find("tr:first").children(":visible").each(function(){d=parseInt(h(this).width()/a*1E3,10)/10+"%";f.append(h("").css("width",d))}),c.$table.prepend(f))};g.getColumnData=function(b,a,d,c,f){if("undefined"!==typeof a&&null!==a){b=h(b)[0];var g;b=b.config;f=f||b.$headers;if(a[d])return c?a[d]:a[f.index(f.filter('[data-column="'+ d+'"]:last'))];for(g in a)if("string"===typeof g&&(c=f.filter('[data-column="'+d+'"]:last').filter(g).add(f.filter('[data-column="'+d+'"]:last').find(g)),c.length))return a[g]}};g.computeColumnIndex=function(b){var a=[],d=0,c,f,g,e,k,l,n,q,u,p;for(c=0;c'),d=h.fn.detach?a.detach():a.remove();d=h(b).find("span.tablesorter-savemyplace");a.insertAfter(d);d.remove();b.isProcessing=!1};g.clearTableBody=function(b){h(b)[0].config.$tbodies.children().detach()};g.bindEvents=function(b,a,d){b=h(b)[0];var c,f=b.config;!0!==d&&(f.$extraHeaders=f.$extraHeaders?f.$extraHeaders.add(a):a);a.find(f.selectorSort).add(a.filter(f.selectorSort)).unbind(h.trim(["mousedown", "mouseup","sort","keyup",""].join(f.namespace+" "))).bind(h.trim(["mousedown","mouseup","sort","keyup",""].join(f.namespace+" ")),function(d,g){var e;e=d.type;if(!(1!==(d.which||d.button)&&!/sort|keyup/.test(e)||"keyup"===e&&13!==d.which||"mouseup"===e&&!0!==g&&250<(new Date).getTime()-c)){if("mousedown"===e)return c=(new Date).getTime(),/(input|select|button|textarea)/i.test(d.target.tagName)||h(d.target).closest("td,th").hasClass(f.cssAllowClicks)?"":!f.cancelSelection;f.delayInit&&n(f.cache)&& z(b);e=h.fn.closest?h(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:h(this).parents("th, td")[0];e=f.$headers[a.index(e)];e.sortDisabled||O(b,e,d)}});f.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};g.restoreHeaders=function(b){var a,d=h(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){a=h(this);a.find("."+g.css.headerIn).length&&a.html(d.headerContent[b])})};g.destroy=function(b,a,d){b=h(b)[0];if(b.hasInitialized){g.removeWidget(b, !0,!1);var c,f=h(b),e=b.config;c=f.find("thead:first");var n=c.find("tr."+g.css.headerRow).removeClass(g.css.headerRow+" "+e.cssHeaderRow),k=f.find("tfoot:first > tr").children("th, td");!1===a&&0<=h.inArray("uitheme",e.widgets)&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"]));c.find("tr").not(n).remove();c="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(e.namespace+ " ");f.removeData("tablesorter").unbind(h.trim(c));e.$headers.add(k).removeClass([g.css.header,e.cssHeader,e.cssAsc,e.cssDesc,g.css.sortAsc,g.css.sortDesc,g.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");n.find(e.selectorSort).unbind(h.trim(["mousedown","mouseup","keypress",""].join(e.namespace+" ")));g.restoreHeaders(b);f.toggleClass(g.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"=== typeof d&&d(b)}};g.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};g.sortNatural=function(b,a){if(b===a)return 0;var d,c,f,e,h,k;c=g.regex;if(c.hex.test(a)){d=parseInt(b.match(c.hex),16);f=parseInt(a.match(c.hex),16);if(df)return 1}d=b.replace(c.chunk,"\\0$1\\0").replace(c.chunks,"").split("\\0");c=a.replace(c.chunk,"\\0$1\\0").replace(c.chunks,"").split("\\0");k=Math.max(d.length,c.length);for(h= 0;he)return 1}return 0};g.sortNaturalAsc=function(b,a,d,c,f){if(b===a)return 0;d=f.string[f.empties[d]||f.emptyTo];return""===b&&0!==d?"boolean"===typeof d?d?-1:1:-d||-1:""===a&&0!==d?"boolean"===typeof d?d?1:-1:d||1:g.sortNatural(b,a)};g.sortNaturalDesc=function(b,a,d,c,f){if(b===a)return 0;d=f.string[f.empties[d]|| f.emptyTo];return""===b&&0!==d?"boolean"===typeof d?d?-1:1:d||1:""===a&&0!==d?"boolean"===typeof d?d?1:-1:-d||-1:g.sortNatural(a,b)};g.sortText=function(b,a){return b>a?1:bh.inArray(d.id,c))&&f.push(d.id)});g.removeWidget(b,f.join(","),!0);!0!==d?(g.applyWidget(b,a||!1,e),a&&g.applyWidget(b, !1,e)):e(b)};g.getData=function(b,a,d){var c="";b=h(b);var f,e;if(!b.length)return"";f=h.metadata?b.metadata():!1;e=" "+(b.attr("class")||"");"undefined"!==typeof b.data(d)||"undefined"!==typeof b.data(d.toLowerCase())?c+=b.data(d)||b.data(d.toLowerCase()):f&&"undefined"!==typeof f[d]?c+=f[d]:a&&"undefined"!==typeof a[d]?c+=a[d]:" "!==e&&e.match(" "+d+"-")&&(c=e.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||"");return h.trim(c)};g.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var d; b=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));d=parseFloat(b);return isNaN(d)?h.trim(b):d};g.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=h.tablesorter;h.fn.extend({tablesorter:p.construct});p.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}); p.addParser({id:"text",is:function(){return!0},format:function(e,w){var n=w.config;e&&(e=h.trim(n.ignoreCase?e.toLocaleLowerCase():e),e=n.sortLocaleCompare?p.replaceAccents(e):e);return e},type:"text"});p.addParser({id:"digit",is:function(e){return p.isDigit(e)},format:function(e,w){var n=p.formatFloat((e||"").replace(/[^\w,. \-()]/g,""),w);return e&&"number"===typeof n?n:e?h.trim(e&&w.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"});p.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((e|| "").replace(/[+\-,. ]/g,""))},format:function(e,w){var n=p.formatFloat((e||"").replace(/[^\w,. \-()]/g,""),w);return e&&"number"===typeof n?n:e?h.trim(e&&w.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"});p.addParser({id:"url",is:function(e){return/^(https?|ftp|file):\/\//.test(e)},format:function(e){return e?h.trim(e.replace(/(https?|ftp|file):\/\//,"")):e},parsed:!0,type:"text"});p.addParser({id:"isoDate",is:function(e){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(e)},format:function(e, h){var n=e?new Date(e.replace(/-/g,"/")):e;return n instanceof Date&&isFinite(n)?n.getTime():e},type:"numeric"});p.addParser({id:"percent",is:function(e){return/(\d\s*?%|%\s*?\d)/.test(e)&&15>e.length},format:function(e,h){return e?p.formatFloat(e.replace(/%/g,""),h):e},type:"numeric"});p.addParser({id:"image",is:function(e,h,n,p){return 0