/*! Widget: grouping - updated 9/27/2017 (v2.29.0) */ !function(r){"use strict";var o=r.tablesorter,e=o.grouping={types:{number:function(r,e,u,p){var t,a=e.hasClass(o.css.sortAsc);return p>1&&""!==u?(t=a?Math.floor(parseFloat(u)/p)*p:Math.ceil(parseFloat(u)/p)*p,t+=" - "+(t+(p-1)*(a?1:-1))):t=parseFloat(u)||u,t},separator:function(o,e,u,p){var t=(u+"").split(o.widgetOptions.group_separator);return r.trim(t[p-1]||"")},text:function(r,o,e){return e},word:function(r,o,e,u){return((e+" ").match(/\w+/g)||[])[u-1]||""},letter:function(r,o,e,u){return e?(e+" ").substring(0,u):""},date:function(r,o,u,p){var t,a,s=r.widgetOptions,n=new Date(u||"");return n instanceof Date&&isFinite(n)?(t=n.getFullYear(),a=e.findMonth(s,n.getMonth()),"year"===p?t:"month"===p?a:"monthyear"===p?a+" "+t:"day"===p?a+" "+n.getDate():"week"===p?e.findWeek(s,n.getDay()):"time"===p?e.findTime(s,n):"hour"===p?e.findTime(s,n,"hour"):s.group_dateString(n,r,o)):s.group_dateInvalid}},findMonth:function(r,o){return r.group_months[o+(""===(r.group_months[0]||"")?1:0)]},findWeek:function(o,e){if(r.isArray(o.group_week))return o.group_week[e];if(!r.isEmptyObject(o.group_week)){var u=["sun","mon","tue","wed","thu","fri","sat"];return o.group_week[u[e]]}},findTime:function(r,o,e){var u,p=r.group_time.am&&r.group_time.pm,t=o.getHours(),a=t>=12?1:0,s=("00"+(r.group_time24Hour&&t>12?t-12:r.group_time24Hour&&0===t?t+12:t)).slice(-2),n=("00"+o.getMinutes()).slice(-2);return u=r.group_time[p?["am","pm"][a]:a],"hour"===e?s:s+":"+n+(r.group_time24Hour?"":" "+(u||""))},update:function(o){if(!r.isEmptyObject(o.config.cache)){var u=o.config,p=u.widgetOptions,t=void 0!==u.sortList[0],a={},s=r.isArray(p.group_forceColumn)&&void 0!==p.group_forceColumn[0]?p.group_enforceSort&&!t?-1:p.group_forceColumn[0]:t?u.sortList[0][0]:-1;u.$table.find("tr.group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove(),p.group_collapsible&&u.$table.data("pagerSavedHeight",0),s>=0&&s-1,l.toggleClass("collapsed",t),n.toggleClass("group-hidden",t)):e.group_collapsed&&e.group_collapsible&&(l.addClass("collapsed"),n.addClass("group-hidden"))},groupHeaderHTML:function(r,o,e){var u=(e.currentGroup||"").toString().replace(//g,">");return''+(o.group_collapsible?"":"")+''+u+''},saveCurrentGrouping:function(r,e,u){var p,t,a=!1;return e.group_collapsible&&e.group_saveGroups&&(e.group_collapsedGroups=o.storage&&o.storage(r.table,"tablesorter-groups")||{},t="dir"+r.sortList[0][1],p=e.group_collapsedGroup=""+r.sortList[0][0]+t+u.grouping.join(""),e.group_collapsedGroups[p]?a=!0:e.group_collapsedGroups[p]=[]),a},findColumnGroups:function(r,u,p){var t,a,s,n,l=o.hasWidget(r.table,"pager"),g=r.pager||{};for(p.groupIndex=0,t=0;t-1&&t.group_collapsedGroups[t.group_collapsedGroup].splice(s,1),o.storage(u,"tablesorter-groups",t.group_collapsedGroups))}})),r(t.group_saveReset).on("click",function(){e.clearSavedGroups(u)}),p.$table.on("pagerChange.tsgrouping",function(){e.update(u)})},clearSavedGroups:function(r){r&&o.storage&&(o.storage(r,"tablesorter-groups",""),e.update(r))}};o.addWidget({id:"group",priority:100,options:{group_collapsible:!0,group_collapsed:!1,group_saveGroups:!0,group_saveReset:null,group_count:" ({num})",group_separator:"-",group_formatter:null,group_callback:null,group_complete:"groupingComplete",group_forceColumn:[],group_enforceSort:!0,group_checkbox:["checked","unchecked"],group_months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],group_week:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],group_time:["AM","PM"],group_time24Hour:!1,group_dateInvalid:"Invalid Date",group_dateString:function(r){return r.toLocaleString()}},init:function(r,o,u,p){e.bindEvents(r,u,p)},format:function(r){e.update(r)},remove:function(r,o){o.$table.off("click","tr.group-header").off("pagerChange.tsgrouping").find(".group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove()}})}(jQuery);