/*! Widget: output - updated 4/2/2017 (v2.28.6) */ !function(t){"use strict";var e=t.tablesorter,o=e.output={event:"outputTable",noDblClick:600,lastEvent:0,busy:!1,regexQuote:/([\n\t\x09\x0d\x0a]|<[^<]+>)/,regexBR:/(|\n)/g,regexIMG:/]+alt\s*=\s*['"]([^'"]+)['"][^>]*>/i,regexHTML:/<[^<]+>/g,replaceCR:"\r\n",replaceTab:"\t",popupTitle:"Output",popupStyle:"width:100%;height:100%;margin:0;resize:none;",message:"Your device does not support downloading. Please try again in desktop browser.",init:function(t){t.$table.off(o.event).on(o.event,function(e){e.stopPropagation(),!o.busy&&e.timeStamp-o.lastEvent>o.noDblClick&&(o.lastEvent=e.timeStamp,o.busy=!0,o.process(t,t.widgetOptions))})},processRow:function(u,n,r,a){var p,i,l,s,c,d,f,_,w,g,h=u.widgetOptions,m=[],v=h.output_duplicateSpans,b=r&&a&&h.output_headerRows&&t.isFunction(h.output_callbackJSON),y=0,S=n.length;for(s=0;s-1||!n.output_hiddenColumns&&"none"===u.$headerIndexed[_].css("display")&&!u.$headerIndexed[_].hasClass("tablesorter-scroller-hidden-column");if(a=b.children("thead").children("tr").not("."+(e.css.filterRow||"tablesorter-filter-row")).filter(function(){return n.output_hiddenColumns||"none"!==t(this).css("display")}),i=o.processRow(u,a,!0,g),p=b.children("tbody").children("tr").not(u.selectorRemove),p="function"==typeof v?p.filter(v):/^f/.test(v)?p.not("."+(n.filter_filteredRow||"filtered")):/^v/.test(v)?p.filter(":visible"):/^[.#:\[]/.test(v)?p.filter(v):p,l=o.processRow(u,p),n.output_includeFooter&&(l=l.concat(o.processRow(u,b.children("tfoot").children("tr:visible")))),s=i.length,g){for(w=[],c=l.length,_=0;_1&&n.output_headerRows?_%s:s-1],w.push(o.row2Hash(d,l[_]));r=f?JSON.stringify(w):w}else n.output_includeHeader?(d=[i[s>1&&n.output_headerRows?_%s:s-1]],w=o.row2CSV(n,n.output_headerRows?i:d,h).concat(o.row2CSV(n,l,h))):w=o.row2CSV(n,l,h),r=h&&f?JSON.stringify(w):w.join("\n");if(t.isFunction(n.output_callback)){if(!1===(d=n.output_callback(u,r,u.pager&&u.pager.ajaxObject.url||null)))return;"string"==typeof d&&(r=d)}/p/i.test(n.output_delivery||"")?o.popup(r,n.output_popupStyle,g||h):o.download(u,n,r),o.busy=!1},row2CSV:function(t,e,o){var u,n,r=[],a=e.length;for(n=0;n0&&""!==u&&(r[r.length]=o?e[n]:e[n].join(t.output_separator));return r},row2Hash:function(t,e){var o,u={},n=e.length;for(o=0;o"+o.popupTitle+'"),n.document.close(),n.focus()}catch(r){return n.close(),o.popup(t,e,u)}return!0},download:function(t,e,u){if("function"==typeof e.output_savePlugin)return e.output_savePlugin(t,e,u);var n,r,a,p,i=window.navigator,l=document.createElement("a");if(/(iP)/g.test(i.userAgent))return alert(o.message),!1;try{a=!!new Blob}catch(t){a=!1}return a?(window.URL=window.URL||window.webkitURL,p=/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.output_encoding)?["\ufeff",u]:[u],r=new Blob(p,{type:e.output_encoding}),i.msSaveBlob?i.msSaveBlob(r,e.output_saveFileName):(l.href=window.URL.createObjectURL(r),l.download=e.output_saveFileName,document.createEvent&&((n=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),l.dispatchEvent(n))),!1):(window.open(e.output_encoding+encodeURIComponent(u)+"?download","_self"),!0)},remove:function(t){t.$table.off(o.event)}};e.addWidget({id:"output",options:{output_separator:",",output_ignoreColumns:[],output_hiddenColumns:!1,output_includeFooter:!1,output_includeHeader:!0,output_headerRows:!1,output_dataAttrib:"data-name",output_delivery:"popup",output_saveRows:"filtered",output_duplicateSpans:!0,output_replaceQuote:"“;",output_includeHTML:!1,output_trimSpaces:!0,output_wrapQuotes:!1,output_popupStyle:"width=500,height=300",output_saveFileName:"mytable.csv",output_formatContent:null,output_callback:function(t,e){return!0},output_callbackJSON:function(t,e,o){return e+"("+o+")"},output_encoding:"data:application/octet-stream;charset=utf8,",output_savePlugin:null},init:function(t,e,u){o.init(u)},remove:function(t,e){o.remove(e)}})}(jQuery);