tableExport.min.js 39.6 KB
/*
 tableExport.jquery.plugin

 Version 1.10.11

 Copyright (c) 2015-2019 hhurz, https://github.com/hhurz

 Original Work Copyright (c) 2014 Giri Raj

 Licensed under the MIT License
*/
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(c,h,x){c instanceof String&&(c=String(c));for(var B=c.length,D=0;D<B;D++){var T=c[D];if(h.call(x,T,D,c))return{i:D,v:T}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,h,x){c!=Array.prototype&&c!=Object.prototype&&(c[h]=x.value)};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,h,x,B){if(h){x=$jscomp.global;c=c.split(".");for(B=0;B<c.length-1;B++){var D=c[B];D in x||(x[D]={});x=x[D]}c=c[c.length-1];B=x[c];h=h(B);h!=B&&null!=h&&$jscomp.defineProperty(x,c,{configurable:!0,writable:!0,value:h})}};
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,x){return $jscomp.findInternal(this,c,x).v}},"es6","es3");
(function(c){c.fn.tableExport=function(h){function x(b){var d=[];D(b,"thead").each(function(){d.push.apply(d,D(c(this),a.theadSelector).toArray())});return d}function B(b){var d=[];D(b,"tbody").each(function(){d.push.apply(d,D(c(this),a.tbodySelector).toArray())});a.tfootSelector.length&&D(b,"tfoot").each(function(){d.push.apply(d,D(c(this),a.tfootSelector).toArray())});return d}function D(b,a){var d=b[0].tagName,q=b.parents(d).length;return b.find(a).filter(function(){return q===c(this).closest(d).parents(d).length})}
function T(b){var a=[];c(b).find("thead").first().find("th").each(function(b,d){void 0!==c(d).attr("data-field")?a[b]=c(d).attr("data-field"):a[b]=b.toString()});return a}function J(b){var a="undefined"!==typeof b[0].rowIndex,e=!1===a&&"undefined"!==typeof b[0].cellIndex,q=e||a?La(b):b.is(":visible"),f=b.attr("data-tableexport-display");e&&"none"!==f&&"always"!==f&&(b=c(b[0].parentNode),a="undefined"!==typeof b[0].rowIndex,f=b.attr("data-tableexport-display"));a&&"none"!==f&&"always"!==f&&(f=b.closest("table").attr("data-tableexport-display"));
return"none"!==f&&(!0===q||"always"===f)}function La(b){var a=[];W&&(a=K.filter(function(){var a=!1;this.nodeType===b[0].nodeType&&("undefined"!==typeof this.rowIndex&&this.rowIndex===b[0].rowIndex?a=!0:"undefined"!==typeof this.cellIndex&&this.cellIndex===b[0].cellIndex&&"undefined"!==typeof this.parentNode.rowIndex&&"undefined"!==typeof b[0].parentNode.rowIndex&&this.parentNode.rowIndex===b[0].parentNode.rowIndex&&(a=!0));return a}));return!1===W||0===a.length}function ua(b,d,e){var q=!1;J(b)?0<
a.ignoreColumn.length&&(-1!==c.inArray(e,a.ignoreColumn)||-1!==c.inArray(e-d,a.ignoreColumn)||U.length>e&&"undefined"!==typeof U[e]&&-1!==c.inArray(U[e],a.ignoreColumn))&&(q=!0):q=!0;return q}function C(b,d,e,q,f){if("function"===typeof f){var m=!1;"function"===typeof a.onIgnoreRow&&(m=a.onIgnoreRow(c(b),e));if(!1===m&&(0===a.ignoreRow.length||-1===c.inArray(e,a.ignoreRow)&&-1===c.inArray(e-q,a.ignoreRow))&&J(c(b))){var r=D(c(b),d),k=0;r.each(function(b){var a=c(this),d,m=P(this),q=V(this);c.each(H,
function(){if(e>=this.s.r&&e<=this.e.r&&k>=this.s.c&&k<=this.e.c)for(d=0;d<=this.e.c-this.s.c;++d)f(null,e,k++)});if(!1===ua(a,r.length,b)){if(q||m)m=m||1,H.push({s:{r:e,c:k},e:{r:e+(q||1)-1,c:k+m-1}});f(this,e,k++)}if(m)for(d=0;d<m-1;++d)f(null,e,k++)});c.each(H,function(){if(e>=this.s.r&&e<=this.e.r&&k>=this.s.c&&k<=this.e.c)for(da=0;da<=this.e.c-this.s.c;++da)f(null,e,k++)})}}}function va(b,a,e,c){if("undefined"!==typeof c.images&&(e=c.images[e],"undefined"!==typeof e)){a=a.getBoundingClientRect();
var d=b.width/b.height,m=a.width/a.height,q=b.width,k=b.height,y=19.049976/25.4,g=0;m<=d?(k=Math.min(b.height,a.height),q=a.width*k/a.height):m>d&&(q=Math.min(b.width,a.width),k=a.height*q/a.width);q*=y;k*=y;k<b.height&&(g=(b.height-k)/2);try{c.doc.addImage(e.src,b.textPos.x,b.y+g,q,k)}catch(Qa){}b.textPos.x+=q}}function wa(b,d){if("string"===a.outputMode)return b.output();if("base64"===a.outputMode)return L(b.output());if("window"===a.outputMode)window.URL=window.URL||window.webkitURL,window.open(window.URL.createObjectURL(b.output("blob")));
else try{var e=b.output("blob");saveAs(e,a.fileName+".pdf")}catch(q){ka(a.fileName+".pdf","data:application/pdf"+(d?"":";base64")+",",d?b.output("blob"):b.output())}}function xa(b,a,e){var d=0;"undefined"!==typeof e&&(d=e.colspan);if(0<=d){for(var f=b.width,c=b.textPos.x,r=a.table.columns.indexOf(a.column),k=1;k<d;k++)f+=a.table.columns[r+k].width;1<d&&("right"===b.styles.halign?c=b.textPos.x+f-b.width:"center"===b.styles.halign&&(c=b.textPos.x+(f-b.width)/2));b.width=f;b.textPos.x=c;"undefined"!==
typeof e&&1<e.rowspan&&(b.height*=e.rowspan);if("middle"===b.styles.valign||"bottom"===b.styles.valign)e=("string"===typeof b.text?b.text.split(/\r\n|\r|\n/g):b.text).length||1,2<e&&(b.textPos.y-=(2-1.15)/2*a.row.styles.fontSize*(e-2)/3);return!0}return!1}function ya(b,a,e){"undefined"!==typeof b&&null!==b&&(b.hasAttribute("data-tableexport-canvas")?(a=(new Date).getTime(),c(b).attr("data-tableexport-canvas",a),e.images[a]={url:'[data-tableexport-canvas="'+a+'"]',src:null}):"undefined"!==a&&null!=
a&&a.each(function(){if(c(this).is("img")){var a=za(this.src);e.images[a]={url:this.src,src:this.src}}ya(b,c(this).children(),e)}))}function Ma(b,a){function d(b){if(b.url)if(b.src){var d=new Image;q=++f;d.crossOrigin="Anonymous";d.onerror=d.onload=function(){if(d.complete&&(0===d.src.indexOf("data:image/")&&(d.width=b.width||d.width||0,d.height=b.height||d.height||0),d.width+d.height)){var e=document.createElement("canvas"),c=e.getContext("2d");e.width=d.width;e.height=d.height;c.drawImage(d,0,0);
b.src=e.toDataURL("image/png")}--f||a(q)};d.src=b.url}else{var e=c(b.url);e.length&&(q=++f,html2canvas(e[0]).then(function(d){b.src=d.toDataURL("image/png");--f||a(q)}))}}var q=0,f=0;if("undefined"!==typeof b.images)for(var m in b.images)b.images.hasOwnProperty(m)&&d(b.images[m]);(b=f)||(a(q),b=void 0);return b}function Aa(b,d,e){d.each(function(){if(c(this).is("div")){var d=ea(M(this,"background-color"),[255,255,255]),f=ea(M(this,"border-top-color"),[0,0,0]),m=fa(this,"border-top-width",a.jspdf.unit),
r=this.getBoundingClientRect(),k=this.offsetLeft*e.wScaleFactor,y=this.offsetTop*e.hScaleFactor,g=r.width*e.wScaleFactor;r=r.height*e.hScaleFactor;e.doc.setDrawColor.apply(void 0,f);e.doc.setFillColor.apply(void 0,d);e.doc.setLineWidth(m);e.doc.rect(b.x+k,b.y+y,g,r,m?"FD":"F")}else c(this).is("img")&&(d=za(this.src),va(b,this,d,e));Aa(b,c(this).children(),e)})}function Ba(b,d,e){if("function"===typeof e.onAutotableText)e.onAutotableText(e.doc,b,d);else{var q=b.textPos.x,f=b.textPos.y,m={halign:b.styles.halign,
valign:b.styles.valign};if(d.length){for(d=d[0];d.previousSibling;)d=d.previousSibling;for(var r=!1,k=!1;d;){var y=d.innerText||d.textContent||"",g=y.length&&" "===y[0]?" ":"",h=1<y.length&&" "===y[y.length-1]?" ":"";!0!==a.preserve.leadingWS&&(y=g+la(y));!0!==a.preserve.trailingWS&&(y=ma(y)+h);c(d).is("br")&&(q=b.textPos.x,f+=e.doc.internal.getFontSize());c(d).is("b")?r=!0:c(d).is("i")&&(k=!0);(r||k)&&e.doc.setFontType(r&&k?"bolditalic":r?"bold":"italic");if(g=e.doc.getStringUnitWidth(y)*e.doc.internal.getFontSize()){"linebreak"===
b.styles.overflow&&q>b.textPos.x&&q+g>b.textPos.x+b.width&&(0<=".,!%*;:=-".indexOf(y.charAt(0))&&(h=y.charAt(0),g=e.doc.getStringUnitWidth(h)*e.doc.internal.getFontSize(),q+g<=b.textPos.x+b.width&&(e.doc.autoTableText(h,q,f,m),y=y.substring(1,y.length)),g=e.doc.getStringUnitWidth(y)*e.doc.internal.getFontSize()),q=b.textPos.x,f+=e.doc.internal.getFontSize());if("visible"!==b.styles.overflow)for(;y.length&&q+g>b.textPos.x+b.width;)y=y.substring(0,y.length-1),g=e.doc.getStringUnitWidth(y)*e.doc.internal.getFontSize();
e.doc.autoTableText(y,q,f,m);q+=g}if(r||k)c(d).is("b")?r=!1:c(d).is("i")&&(k=!1),e.doc.setFontType(r||k?r?"bold":"italic":"normal");d=d.nextSibling}b.textPos.x=q;b.textPos.y=f}else e.doc.autoTableText(b.text,b.textPos.x,b.textPos.y,m)}}function ha(b,a,e){return null==b?"":b.toString().replace(new RegExp(null==a?"":a.toString().replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),e)}function la(b){return null==b?"":b.toString().replace(/^\s+/,"")}function ma(b){return null==b?"":b.toString().replace(/\s+$/,
"")}function Ca(b){a.date.pattern.lastIndex=0;var d=a.date.pattern.exec(b);if(null==d)return!1;b=+d[a.date.match_y];if(0>b||8099<b)return!1;var e=1*d[a.date.match_m];d=1*d[a.date.match_d];if(isNaN(d))return!1;var c=new Date(b,e-1,d);return c.getFullYear()===b&&c.getMonth()===e-1&&c.getDate()===d?c:!1}function na(b){b=b||"0";""!==a.numbers.html.thousandsSeparator&&(b=ha(b,a.numbers.html.thousandsSeparator,""));"."!==a.numbers.html.decimalMark&&(b=ha(b,a.numbers.html.decimalMark,"."));return"number"===
typeof b||!1!==jQuery.isNumeric(b)?b:!1}function Na(b){-1<b.indexOf("%")?(b=na(b.replace(/%/g,"")),!1!==b&&(b/=100)):b=!1;return b}function F(b,d,e,q){var f="",m="text";if(null!==b){var r=c(b);if(r[0].hasAttribute("data-tableexport-canvas"))var k="";else if(r[0].hasAttribute("data-tableexport-value"))k=(k=r.attr("data-tableexport-value"))?k+"":"";else if(k=r.html(),"function"===typeof a.onCellHtmlData)k=a.onCellHtmlData(r,d,e,k);else if(""!==k){b=c.parseHTML(k);var g=0,h=0;k="";c.each(b,function(){if(c(this).is("input"))k+=
r.find("input").eq(g++).val();else if(c(this).is("select"))k+=r.find("select option:selected").eq(h++).text();else if(c(this).is("br"))k+="<br>";else{if("undefined"===typeof c(this).html())k+=c(this).text();else if(void 0===jQuery().bootstrapTable||!1===c(this).hasClass("fht-cell")&&!1===c(this).hasClass("filterControl")&&0===r.parents(".detail-view").length)k+=c(this).html();if(c(this).is("a")){var b=r.find("a").attr("href")||"";f="function"===typeof a.onCellHtmlHyperlink?a.onCellHtmlHyperlink(r,
d,e,b,k):"href"===a.htmlHyperlink?b:k;k=""}}})}if(k&&""!==k&&!0===a.htmlContent)f=c.trim(k);else if(k&&""!==k)if(""!==r.attr("data-tableexport-cellformat")){var l=k.replace(/\n/g,"\u2028").replace(/(<\s*br([^>]*)>)/gi,"\u2060"),p=c("<div/>").html(l).contents();b=!1;l="";c.each(p.text().split("\u2028"),function(b,d){0<b&&(l+=" ");!0!==a.preserve.leadingWS&&(d=la(d));l+=!0!==a.preserve.trailingWS?ma(d):d});c.each(l.split("\u2060"),function(b,d){0<b&&(f+="\n");!0!==a.preserve.leadingWS&&(d=la(d));!0!==
a.preserve.trailingWS&&(d=ma(d));f+=d.replace(/\u00AD/g,"")});f=f.replace(/\u00A0/g," ");if("json"===a.type||"excel"===a.type&&"xmlss"===a.mso.fileFormat||!1===a.numbers.output)b=na(f),!1!==b&&(m="number",f=Number(b));else if(a.numbers.html.decimalMark!==a.numbers.output.decimalMark||a.numbers.html.thousandsSeparator!==a.numbers.output.thousandsSeparator)if(b=na(f),!1!==b){p=(""+b.substr(0>b?1:0)).split(".");1===p.length&&(p[1]="");var n=3<p[0].length?p[0].length%3:0;m="number";f=(0>b?"-":"")+(a.numbers.output.thousandsSeparator?
(n?p[0].substr(0,n)+a.numbers.output.thousandsSeparator:"")+p[0].substr(n).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):p[0])+(p[1].length?a.numbers.output.decimalMark+p[1]:"")}}else f=k;!0===a.escape&&(f=escape(f));"function"===typeof a.onCellData&&(f=a.onCellData(r,d,e,f,m))}void 0!==q&&(q.type=m);return f}function Da(b){return 0<b.length&&!0===a.preventInjection&&0<="=+-@".indexOf(b.charAt(0))?"'"+b:b}function Oa(b,a,e){return a+"-"+e.toLowerCase()}function ea(b,a){(b=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(b))&&
(a=[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]);return a}function Ea(b){var a=M(b,"text-align"),e=M(b,"font-weight"),c=M(b,"font-style"),f="";"start"===a&&(a="rtl"===M(b,"direction")?"right":"left");700<=e&&(f="bold");"italic"===c&&(f+=c);""===f&&(f="normal");a={style:{align:a,bcolor:ea(M(b,"background-color"),[255,255,255]),color:ea(M(b,"color"),[0,0,0]),fstyle:f},colspan:P(b),rowspan:V(b)};null!==b&&(b=b.getBoundingClientRect(),a.rect={width:b.width,height:b.height});return a}function P(b){var a=
c(b).attr("data-tableexport-colspan");"undefined"===typeof a&&c(b).is("[colspan]")&&(a=c(b).attr("colspan"));return parseInt(a)||0}function V(b){var a=c(b).attr("data-tableexport-rowspan");"undefined"===typeof a&&c(b).is("[rowspan]")&&(a=c(b).attr("rowspan"));return parseInt(a)||0}function M(b,a){try{return window.getComputedStyle?(a=a.replace(/([a-z])([A-Z])/,Oa),window.getComputedStyle(b,null).getPropertyValue(a)):b.currentStyle?b.currentStyle[a]:b.style[a]}catch(e){}return""}function fa(a,d,e){d=
M(a,d).match(/\d+/);if(null!==d){d=d[0];a=a.parentElement;var b=document.createElement("div");b.style.overflow="hidden";b.style.visibility="hidden";a.appendChild(b);b.style.width=100+e;e=100/b.offsetWidth;a.removeChild(b);return d*e}return 0}function Pa(a){for(var b=new ArrayBuffer(a.length),e=new Uint8Array(b),c=0;c!==a.length;++c)e[c]=a.charCodeAt(c)&255;return b}function oa(a){var b=a.c,e="";for(++b;b;b=Math.floor((b-1)/26))e=String.fromCharCode((b-1)%26+65)+e;return e+(""+(a.r+1))}function pa(a,
d){if("undefined"===typeof d||"number"===typeof d)return pa(a.s,a.e);"string"!==typeof a&&(a=oa(a));"string"!==typeof d&&(d=oa(d));return a===d?a:a+":"+d}function Fa(a,d){var b=Number(a);if(!isNaN(b))return b;var c=1;""!==d.thousandsSeparator&&(a=a.replace(new RegExp("([\\d])"+d.thousandsSeparator+"([\\d])","g"),"$1$2"));"."!==d.decimalMark&&(a=a.replace(new RegExp("([\\d])"+d.decimalMark+"([\\d])","g"),"$1.$2"));a=a.replace(/[$]/g,"").replace(/[%]/g,function(){c*=100;return""});if(!isNaN(b=Number(a)))return b/
c;a=a.replace(/[(](.*)[)]/,function(a,b){c=-c;return b});return isNaN(b=Number(a))?b:b/c}function za(a){var b=0,c;if(0===a.length)return b;var q=0;for(c=a.length;q<c;q++){var f=a.charCodeAt(q);b=(b<<5)-b+f;b|=0}return b}function N(b,d,c,q,f,m){var e=!0;"function"===typeof a.onBeforeSaveToFile&&(e=a.onBeforeSaveToFile(b,d,c,q,f),"boolean"!==typeof e&&(e=!0));if(e)try{if(Ga=new Blob([b],{type:c+";charset="+q}),saveAs(Ga,d,!1===m),"function"===typeof a.onAfterSaveToFile)a.onAfterSaveToFile(b,d)}catch(k){ka(d,
"data:"+c+(q.length?";charset="+q:"")+(f.length?";"+f:"")+",",m?"\ufeff"+b:b)}}function ka(b,d,c){var e=window.navigator.userAgent;if(!1!==b&&window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(new Blob([c]),b);else if(!1!==b&&(0<e.indexOf("MSIE ")||e.match(/Trident.*rv\:11\./))){if(d=document.createElement("iframe")){document.body.appendChild(d);d.setAttribute("style","display:none");d.contentDocument.open("txt/plain","replace");d.contentDocument.write(c);d.contentDocument.close();
d.contentWindow.focus();switch(b.substr(b.lastIndexOf(".")+1)){case "doc":case "json":case "png":case "pdf":case "xls":case "xlsx":b+=".txt"}d.contentDocument.execCommand("SaveAs",!0,b);document.body.removeChild(d)}}else{var f=document.createElement("a");if(f){var m=null;f.style.display="none";!1!==b?f.download=b:f.target="_blank";"object"===typeof c?(window.URL=window.URL||window.webkitURL,e=[],e.push(c),m=window.URL.createObjectURL(new Blob(e,{type:d})),f.href=m):0<=d.toLowerCase().indexOf("base64,")?
f.href=d+L(c):f.href=d+encodeURIComponent(c);document.body.appendChild(f);if(document.createEvent)null===ia&&(ia=document.createEvent("MouseEvents")),ia.initEvent("click",!0,!1),f.dispatchEvent(ia);else if(document.createEventObject)f.fireEvent("onclick");else if("function"===typeof f.onclick)f.onclick();setTimeout(function(){m&&window.URL.revokeObjectURL(m);document.body.removeChild(f);if("function"===typeof a.onAfterSaveToFile)a.onAfterSaveToFile(c,b)},100)}}}function L(a){var b,c="",q=0;if("string"===
typeof a){a=a.replace(/\x0d\x0a/g,"\n");var f="";for(b=0;b<a.length;b++){var m=a.charCodeAt(b);128>m?f+=String.fromCharCode(m):(127<m&&2048>m?f+=String.fromCharCode(m>>6|192):(f+=String.fromCharCode(m>>12|224),f+=String.fromCharCode(m>>6&63|128)),f+=String.fromCharCode(m&63|128))}a=f}for(;q<a.length;){var r=a.charCodeAt(q++);f=a.charCodeAt(q++);b=a.charCodeAt(q++);m=r>>2;r=(r&3)<<4|f>>4;var k=(f&15)<<2|b>>6;var g=b&63;isNaN(f)?k=g=64:isNaN(b)&&(g=64);c=c+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(r)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g)}return c}var a={csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,date:{html:"dd/mm/yyyy"},displayTableName:!1,escape:!1,exportHiddenCells:!1,fileName:"tableExport",htmlContent:!1,htmlHyperlink:"content",ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",
unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},onDocCreated:null,autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"inherit",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"inherit",valign:"middle"},alternateRowStyles:{fillColor:245},tableExport:{doc:null,onAfterAutotable:null,onBeforeAutotable:null,onAutotableText:null,onTable:null,outputImages:!0}}},mso:{fileFormat:"xlshtml",
onMsoNumberFormat:null,pageFormat:"a4",pageOrientation:"portrait",rtl:!1,styles:[],worksheetName:"",xslx:{formatId:{date:14,numbers:2}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onAfterSaveToFile:null,onBeforeSaveToFile:null,onCellData:null,onCellHtmlData:null,onCellHtmlHyperlink:null,onIgnoreRow:null,outputMode:"file",pdfmake:{enabled:!1,docDefinition:{pageOrientation:"portrait",defaultStyle:{font:"Roboto"}},fonts:{}},preserve:{leadingWS:!1,
trailingWS:!1},preventInjection:!0,sql:{tableEnclosure:"`",columnEnclosure:"`"},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"Table",type:"csv"},O={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],
b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]},A=this,ia=null,u=[],t=
[],p=0,n="",U=[],H=[],Ga,K=[],W=!1;c.extend(!0,a,h);"xlsx"===a.type&&(a.mso.fileFormat=a.type,a.type="excel");"undefined"!==typeof a.excelFileFormat&&"undefined"===a.mso.fileFormat&&(a.mso.fileFormat=a.excelFileFormat);"undefined"!==typeof a.excelPageFormat&&"undefined"===a.mso.pageFormat&&(a.mso.pageFormat=a.excelPageFormat);"undefined"!==typeof a.excelPageOrientation&&"undefined"===a.mso.pageOrientation&&(a.mso.pageOrientation=a.excelPageOrientation);"undefined"!==typeof a.excelRTL&&"undefined"===
a.mso.rtl&&(a.mso.rtl=a.excelRTL);"undefined"!==typeof a.excelstyles&&"undefined"===a.mso.styles&&(a.mso.styles=a.excelstyles);"undefined"!==typeof a.onMsoNumberFormat&&"undefined"===a.mso.onMsoNumberFormat&&(a.mso.onMsoNumberFormat=a.onMsoNumberFormat);"undefined"!==typeof a.worksheetName&&"undefined"===a.mso.worksheetName&&(a.mso.worksheetName=a.worksheetName);a.mso.pageOrientation="l"===a.mso.pageOrientation.substr(0,1)?"landscape":"portrait";a.date.html=a.date.html||"";if(a.date.html.length){h=
[];h.dd="(3[01]|[12][0-9]|0?[1-9])";h.mm="(1[012]|0?[1-9])";h.yyyy="((?:1[6-9]|2[0-2])\\d{2})";h.yy="(\\d{2})";var v=a.date.html.match(/[^a-zA-Z0-9]/)[0];v=a.date.html.toLowerCase().split(v);a.date.regex="^\\s*";a.date.regex+=h[v[0]];a.date.regex+="(.)";a.date.regex+=h[v[1]];a.date.regex+="\\2";a.date.regex+=h[v[2]];a.date.regex+="\\s*$";a.date.pattern=new RegExp(a.date.regex,"g");h=v.indexOf("dd")+1;a.date.match_d=h+(1<h?1:0);h=v.indexOf("mm")+1;a.date.match_m=h+(1<h?1:0);h=(0<=v.indexOf("yyyy")?
v.indexOf("yyyy"):v.indexOf("yy"))+1;a.date.match_y=h+(1<h?1:0)}U=T(A);if("csv"===a.type||"tsv"===a.type||"txt"===a.type){var Q="",Z=0;H=[];p=0;var qa=function(b,d,e){b.each(function(){n="";C(this,d,p,e+b.length,function(b,c,d){var e=n,f="";if(null!==b)if(b=F(b,c,d),c=null===b||""===b?"":b.toString(),"tsv"===a.type)b instanceof Date&&b.toLocaleString(),f=ha(c,"\t"," ");else if(b instanceof Date)f=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(f=Da(c),f=ha(f,a.csvEnclosure,a.csvEnclosure+
a.csvEnclosure),0<=f.indexOf(a.csvSeparator)||/[\r\n ]/g.test(f))f=a.csvEnclosure+f+a.csvEnclosure;n=e+(f+("tsv"===a.type?"\t":a.csvSeparator))});n=c.trim(n).substring(0,n.length-1);0<n.length&&(0<Q.length&&(Q+="\n"),Q+=n);p++});return b.length};Z+=qa(c(A).find("thead").first().find(a.theadSelector),"th,td",Z);D(c(A),"tbody").each(function(){Z+=qa(D(c(this),a.tbodySelector),"td,th",Z)});a.tfootSelector.length&&qa(c(A).find("tfoot").first().find(a.tfootSelector),"td,th",Z);Q+="\n";if("string"===a.outputMode)return Q;
if("base64"===a.outputMode)return L(Q);if("window"===a.outputMode){ka(!1,"data:text/"+("csv"===a.type?"csv":"plain")+";charset=utf-8,",Q);return}N(Q,a.fileName+"."+a.type,"text/"+("csv"===a.type?"csv":"plain"),"utf-8","","csv"===a.type&&a.csvUseBOM)}else if("sql"===a.type){p=0;H=[];var z="INSERT INTO "+a.sql.tableEnclosure+a.tableName+a.sql.tableEnclosure+" (";u=x(c(A));c(u).each(function(){C(this,"th,td",p,u.length,function(b,c,e){z+=a.sql.columnEnclosure+F(b,c,e)+a.sql.columnEnclosure+","});p++;
z=c.trim(z).substring(0,z.length-1)});z+=") VALUES ";t=B(c(A));c(t).each(function(){n="";C(this,"td,th",p,u.length+t.length,function(a,c,e){n+="'"+F(a,c,e)+"',"});3<n.length&&(z+="("+n,z=c.trim(z).substring(0,z.length-1),z+="),");p++});z=c.trim(z).substring(0,z.length-1);z+=";";if("string"===a.outputMode)return z;if("base64"===a.outputMode)return L(z);N(z,a.fileName+".sql","application/sql","utf-8","",!1)}else if("json"===a.type){var X=[];H=[];u=x(c(A));c(u).each(function(){var a=[];C(this,"th,td",
p,u.length,function(b,c,g){a.push(F(b,c,g))});X.push(a)});var ra=[];t=B(c(A));c(t).each(function(){var a={},d=0;C(this,"td,th",p,u.length+t.length,function(b,c,f){X.length?a[X[X.length-1][d]]=F(b,c,f):a[d]=F(b,c,f);d++});!1===c.isEmptyObject(a)&&ra.push(a);p++});h="";h="head"===a.jsonScope?JSON.stringify(X):"data"===a.jsonScope?JSON.stringify(ra):JSON.stringify({header:X,data:ra});if("string"===a.outputMode)return h;if("base64"===a.outputMode)return L(h);N(h,a.fileName+".json","application/json",
"utf-8","base64",!1)}else if("xml"===a.type){p=0;H=[];var R='<?xml version="1.0" encoding="utf-8"?>';R+="<tabledata><fields>";u=x(c(A));c(u).each(function(){C(this,"th,td",p,u.length,function(a,c,e){R+="<field>"+F(a,c,e)+"</field>"});p++});R+="</fields><data>";var sa=1;t=B(c(A));c(t).each(function(){var a=1;n="";C(this,"td,th",p,u.length+t.length,function(b,c,g){n+="<column-"+a+">"+F(b,c,g)+"</column-"+a+">";a++});0<n.length&&"<column-1></column-1>"!==n&&(R+='<row id="'+sa+'">'+n+"</row>",sa++);p++});
R+="</data></tabledata>";if("string"===a.outputMode)return R;if("base64"===a.outputMode)return L(R);N(R,a.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===a.type&&"xmlss"===a.mso.fileFormat){var ta=[],G=[];c(A).filter(function(){return J(c(this))}).each(function(){function b(a,b,d){var f=[];c(a).each(function(){var b=0,e=0;n="";C(this,"td,th",p,d+a.length,function(a,d,m){if(null!==a){var k="";d=F(a,d,m);m="String";if(!1!==jQuery.isNumeric(d))m="Number";else{var g=Na(d);!1!==
g&&(d=g,m="Number",k+=' ss:StyleID="pct1"')}"Number"!==m&&(d=d.replace(/\n/g,"<br>"));g=P(a);a=V(a);c.each(f,function(){if(p>=this.s.r&&p<=this.e.r&&e>=this.s.c&&e<=this.e.c)for(var a=0;a<=this.e.c-this.s.c;++a)e++,b++});if(a||g)a=a||1,g=g||1,f.push({s:{r:p,c:e},e:{r:p+a-1,c:e+g-1}});1<g&&(k+=' ss:MergeAcross="'+(g-1)+'"',e+=g-1);1<a&&(k+=' ss:MergeDown="'+(a-1)+'" ss:StyleID="rsp1"');0<b&&(k+=' ss:Index="'+(e+1)+'"',b=0);n+="<Cell"+k+'><Data ss:Type="'+m+'">'+c("<div />").text(d).html()+"</Data></Cell>\r";
e++}});0<n.length&&(I+='<Row ss:AutoFitHeight="0">\r'+n+"</Row>\r");p++});return a.length}var d=c(this),e="";"string"===typeof a.mso.worksheetName&&a.mso.worksheetName.length?e=a.mso.worksheetName+" "+(G.length+1):"undefined"!==typeof a.mso.worksheetName[G.length]&&(e=a.mso.worksheetName[G.length]);e.length||(e=d.find("caption").text()||"");e.length||(e="Table "+(G.length+1));e=c.trim(e.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));G.push(c("<div />").text(e).html());!1===a.exportHiddenCells&&(K=
d.find("tr, th, td").filter(":hidden"),W=0<K.length);p=0;U=T(this);I="<Table>\r";e=b(x(d),"th,td",0);b(B(d),"td,th",e);I+="</Table>\r";ta.push(I)});h={};v={};for(var l,S,Y=0,da=G.length;Y<da;Y++)l=G[Y],S=h[l],S=h[l]=null==S?1:S+1,2===S&&(G[v[l]]=G[v[l]].substring(0,29)+"-1"),1<h[l]?G[Y]=G[Y].substring(0,29)+"-"+h[l]:v[l]=Y;h='<?xml version="1.0" encoding="UTF-8"?>\r<?mso-application progid="Excel.Sheet"?>\r<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"\r xmlns:o="urn:schemas-microsoft-com:office:office"\r xmlns:x="urn:schemas-microsoft-com:office:excel"\r xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"\r xmlns:html="http://www.w3.org/TR/REC-html40">\r<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">\r  <Created>'+
(new Date).toISOString()+'</Created>\r</DocumentProperties>\r<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">\r  <AllowPNG/>\r</OfficeDocumentSettings>\r<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">\r  <WindowHeight>9000</WindowHeight>\r  <WindowWidth>13860</WindowWidth>\r  <WindowTopX>0</WindowTopX>\r  <WindowTopY>0</WindowTopY>\r  <ProtectStructure>False</ProtectStructure>\r  <ProtectWindows>False</ProtectWindows>\r</ExcelWorkbook>\r<Styles>\r  <Style ss:ID="Default" ss:Name="Normal">\r    <Alignment ss:Vertical="Bottom"/>\r    <Borders/>\r    <Font/>\r    <Interior/>\r    <NumberFormat/>\r    <Protection/>\r  </Style>\r  <Style ss:ID="rsp1">\r    <Alignment ss:Vertical="Center"/>\r  </Style>\r  <Style ss:ID="pct1">\r    <NumberFormat ss:Format="Percent"/>\r  </Style>\r</Styles>\r';
for(v=0;v<ta.length;v++)h+='<Worksheet ss:Name="'+G[v]+'" ss:RightToLeft="'+(a.mso.rtl?"1":"0")+'">\r'+ta[v],h=a.mso.rtl?h+'<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">\r<DisplayRightToLeft/>\r</WorksheetOptions>\r':h+'<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel"/>\r',h+="</Worksheet>\r";h+="</Workbook>\r";if("string"===a.outputMode)return h;if("base64"===a.outputMode)return L(h);N(h,a.fileName+".xml","application/xml","utf-8","base64",!1)}else if("excel"===
a.type&&"xlsx"===a.mso.fileFormat){var aa=[],Ha=XLSX.utils.book_new();c(A).filter(function(){return J(c(this))}).each(function(){for(var b=c(this),d={},e=this.getElementsByTagName("tr"),g={s:{r:0,c:0},e:{r:0,c:0}},f=[],m,r=[],k=0,h=0,l,n,u,v,t,x=XLSX.SSF.get_table();k<e.length&&1E7>h;++k)if(l=e[k],n=!1,"function"===typeof a.onIgnoreRow&&(n=a.onIgnoreRow(c(l),k)),!1===n&&-1===c.inArray(p,a.ignoreRow)&&-1===c.inArray(p-sa,a.ignoreRow)&&J(c(l))){var A=l.children,D=0;for(l=0;l<A.length;++l)t=A[l],v=+P(t)||
1,D+=v;var B=0;for(l=n=0;l<A.length;++l)if(t=A[l],v=+P(t)||1,m=l+B,!ua(c(t),D,m+(m<n?n-m:0))){B+=v-1;for(m=0;m<f.length;++m){var E=f[m];E.s.c==n&&E.s.r<=h&&h<=E.e.r&&(n=E.e.c+1,m=-1)}(0<(u=+V(t))||1<v)&&f.push({s:{r:h,c:n},e:{r:h+(u||1)-1,c:n+v-1}});m={type:""};E=F(t,k,l+B,m);var z={t:"s",v:E},C="",w=parseInt(c(t).attr("data-tableexport-xlsxformatid")||0);0===w&&"function"===typeof a.mso.xslx.formatId.numbers&&(w=a.mso.xslx.formatId.numbers(c(t),k,l+B));0===w&&"function"===typeof a.mso.xslx.formatId.date&&
(w=a.mso.xslx.formatId.date(c(t),k,l+B));if(49===w||"@"===w)C="s";else if("number"===m.type||0<w&&14>w||36<w&&41>w||48===w)C="n";else if("date"===m.type||13<w&&37>w||44<w&&48>w||56===w)C="d";null!=E&&(0===E.length?z.t=C||"z":0!==E.trim().length&&"s"!==C&&("function"===m.type?z={f:E}:"TRUE"===E?z={t:"b",v:!0}:"FALSE"===E?z={t:"b",v:!1}:"n"!==C&&isNaN(Fa(E,a.numbers.output))?"d"===C||!1!==Ca(E)?(0===w&&"function"!==typeof a.mso.xslx.formatId.date&&(w=a.mso.xslx.formatId.date),z={t:"d",v:Ca(E),z:"string"===
typeof w?w:w in x?x[w]:"m/d/yy"}):""===C&&c(t).find("a").length&&(E="href"!==a.htmlHyperlink?E:"",z={f:'=HYPERLINK("'+c(t).find("a").attr("href")+(E.length?'","'+E:"")+'")'}):(0===w&&"function"!==typeof a.mso.xslx.formatId.numbers&&(w=a.mso.xslx.formatId.numbers),z={t:"n",v:Fa(E,a.numbers.output),z:"string"===typeof w?w:w in x?x[w]:"0.00"})));d[oa({c:n,r:h})]=z;g.e.c<n&&(g.e.c=n);n+=v}++h}f.length&&(d["!merges"]=f);r.length&&(d["!rows"]=r);g.e.r=h-1;d["!ref"]=pa(g);1E7<=h&&(d["!fullref"]=pa((g.e.r=
e.length-k+h-1,g)));e="";"string"===typeof a.mso.worksheetName&&a.mso.worksheetName.length?e=a.mso.worksheetName+" "+(aa.length+1):"undefined"!==typeof a.mso.worksheetName[aa.length]&&(e=a.mso.worksheetName[aa.length]);e.length||(e=b.find("caption").text()||"");e.length||(e="Table "+(aa.length+1));e=c.trim(e.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31));aa.push(e);XLSX.utils.book_append_sheet(Ha,d,e)});h=XLSX.write(Ha,{type:"binary",bookType:a.mso.fileFormat,bookSST:!1});N(Pa(h),a.fileName+"."+a.mso.fileFormat,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","UTF-8","",!1)}else if("excel"===a.type||"xls"===a.type||"word"===a.type||"doc"===a.type){h="excel"===a.type||"xls"===a.type?"excel":"word";v="excel"===h?"xls":"doc";l='xmlns:x="urn:schemas-microsoft-com:office:'+h+'"';var I="",ba="";c(A).filter(function(){return J(c(this))}).each(function(){var b=c(this);""===ba&&(ba=a.mso.worksheetName||b.find("caption").text()||"Table",ba=c.trim(ba.replace(/[\\\/[\]*:?'"]/g,"").substring(0,31)));
!1===a.exportHiddenCells&&(K=b.find("tr, th, td").filter(":hidden"),W=0<K.length);p=0;H=[];U=T(this);I+="<table><thead>";u=x(b);c(u).each(function(){var b=c(this);n="";C(this,"th,td",p,u.length,function(c,d,f){if(null!==c){var e="";n+="<th";if(a.mso.styles.length){var g=document.defaultView.getComputedStyle(c,null),k=document.defaultView.getComputedStyle(b[0],null),h;for(h in a.mso.styles){var l=g[a.mso.styles[h]];""===l&&(l=k[a.mso.styles[h]]);""!==l&&"0px none rgb(0, 0, 0)"!==l&&"rgba(0, 0, 0, 0)"!==
l&&(e+=""===e?'style="':";",e+=a.mso.styles[h]+":"+l)}}""!==e&&(n+=" "+e+'"');e=P(c);0<e&&(n+=' colspan="'+e+'"');e=V(c);0<e&&(n+=' rowspan="'+e+'"');n+=">"+F(c,d,f)+"</th>"}});0<n.length&&(I+="<tr>"+n+"</tr>");p++});I+="</thead><tbody>";t=B(b);c(t).each(function(){var b=c(this);n="";C(this,"td,th",p,u.length+t.length,function(d,g,f){if(null!==d){var e=F(d,g,f),h="",k=c(d).attr("data-tableexport-msonumberformat");"undefined"===typeof k&&"function"===typeof a.mso.onMsoNumberFormat&&(k=a.mso.onMsoNumberFormat(d,
g,f));"undefined"!==typeof k&&""!==k&&(h="style=\"mso-number-format:'"+k+"'");if(a.mso.styles.length){g=document.defaultView.getComputedStyle(d,null);f=document.defaultView.getComputedStyle(b[0],null);for(var l in a.mso.styles)k=g[a.mso.styles[l]],""===k&&(k=f[a.mso.styles[l]]),""!==k&&"0px none rgb(0, 0, 0)"!==k&&"rgba(0, 0, 0, 0)"!==k&&(h+=""===h?'style="':";",h+=a.mso.styles[l]+":"+k)}n+="<td";""!==h&&(n+=" "+h+'"');h=P(d);0<h&&(n+=' colspan="'+h+'"');d=V(d);0<d&&(n+=' rowspan="'+d+'"');"string"===
typeof e&&""!==e&&(e=Da(e),e=e.replace(/\n/g,"<br>"));n+=">"+e+"</td>"}});0<n.length&&(I+="<tr>"+n+"</tr>");p++});a.displayTableName&&(I+="<tr><td></td></tr><tr><td></td></tr><tr><td>"+F(c("<p>"+a.tableName+"</p>"))+"</td></tr>");I+="</tbody></table>"});l='<html xmlns:o="urn:schemas-microsoft-com:office:office" '+l+' xmlns="http://www.w3.org/TR/REC-html40">'+('<meta http-equiv="content-type" content="application/vnd.ms-'+h+'; charset=UTF-8">');l+="<head>";"excel"===h&&(l+="\x3c!--[if gte mso 9]>",
l+="<xml>",l+="<x:ExcelWorkbook>",l+="<x:ExcelWorksheets>",l+="<x:ExcelWorksheet>",l+="<x:Name>",l+=ba,l+="</x:Name>",l+="<x:WorksheetOptions>",l+="<x:DisplayGridlines/>",a.mso.rtl&&(l+="<x:DisplayRightToLeft/>"),l+="</x:WorksheetOptions>",l+="</x:ExcelWorksheet>",l+="</x:ExcelWorksheets>",l+="</x:ExcelWorkbook>",l+="</xml>",l+="<![endif]--\x3e");l+="<style>";l+="@page { size:"+a.mso.pageOrientation+"; mso-page-orientation:"+a.mso.pageOrientation+"; }";l+="@page Section1 {size:"+O[a.mso.pageFormat][0]+
"pt "+O[a.mso.pageFormat][1]+"pt";l+="; margin:1.0in 1.25in 1.0in 1.25in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";l+="div.Section1 {page:Section1;}";l+="@page Section2 {size:"+O[a.mso.pageFormat][1]+"pt "+O[a.mso.pageFormat][0]+"pt";l+=";mso-page-orientation:"+a.mso.pageOrientation+";margin:1.25in 1.0in 1.25in 1.0in;mso-header-margin:.5in;mso-footer-margin:.5in;mso-paper-source:0;}";l+="div.Section2 {page:Section2;}";l+="br {mso-data-placement:same-cell;}";l+="</style>";
l+="</head>";l+="<body>";l+='<div class="Section'+("landscape"===a.mso.pageOrientation?"2":"1")+'">';l+=I;l+="</div>";l+="</body>";l+="</html>";if("string"===a.outputMode)return l;if("base64"===a.outputMode)return L(l);N(l,a.fileName+"."+v,"application/vnd.ms-"+h,"","base64",!1)}else if("png"===a.type)html2canvas(c(A)[0]).then(function(b){b=b.toDataURL();for(var c=atob(b.substring(22)),e=new ArrayBuffer(c.length),g=new Uint8Array(e),f=0;f<c.length;f++)g[f]=c.charCodeAt(f);if("string"===a.outputMode)return c;
if("base64"===a.outputMode)return L(b);"window"===a.outputMode?window.open(b):N(e,a.fileName+".png","image/png","","",!1)});else if("pdf"===a.type)if(!0===a.pdfmake.enabled){h=[];var Ia=[];p=0;H=[];v=function(a,d,e){var b=0;c(a).each(function(){var a=[];C(this,d,p,e,function(b,c,d){if("undefined"!==typeof b&&null!==b){var e=P(b),f=V(b);b=F(b,c,d)||" ";1<e||1<f?a.push({colSpan:e||1,rowSpan:f||1,text:b}):a.push(b)}else a.push(" ")});a.length&&Ia.push(a);b<a.length&&(b=a.length);p++});return b};u=x(c(this));
l=v(u,"th,td",u.length);for(S=h.length;S<l;S++)h.push("*");t=B(c(this));v(t,"th,td",u.length+t.length);h={content:[{table:{headerRows:u.length,widths:h,body:Ia}}]};c.extend(!0,h,a.pdfmake.docDefinition);pdfMake.fonts={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-MediumItalic.ttf"}};c.extend(!0,pdfMake.fonts,a.pdfmake.fonts);pdfMake.createPdf(h).getBuffer(function(b){N(b,a.fileName+".pdf","application/pdf","","",!1)})}else if(!1===a.jspdf.autotable){h=
{dim:{w:fa(c(A).first().get(0),"width","mm"),h:fa(c(A).first().get(0),"height","mm")},pagesplit:!1};var Ja=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);Ja.addHTML(c(A).first(),a.jspdf.margins.left,a.jspdf.margins.top,h,function(){wa(Ja,!1)})}else{var g=a.jspdf.autotable.tableExport;if("string"===typeof a.jspdf.format&&"bestfit"===a.jspdf.format.toLowerCase()){var ja="",ca="",Ka=0;c(A).each(function(){if(J(c(this))){var a=fa(c(this).get(0),"width","pt");if(a>Ka){a>O.a0[0]&&(ja="a0",ca=
"l");for(var d in O)O.hasOwnProperty(d)&&O[d][1]>a&&(ja=d,ca="l",O[d][0]>a&&(ca="p"));Ka=a}}});a.jspdf.format=""===ja?"a4":ja;a.jspdf.orientation=""===ca?"w":ca}if(null==g.doc&&(g.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format),g.wScaleFactor=1,g.hScaleFactor=1,"function"===typeof a.jspdf.onDocCreated))a.jspdf.onDocCreated(g.doc);!0===g.outputImages&&(g.images={});"undefined"!==typeof g.images&&(c(A).filter(function(){return J(c(this))}).each(function(){var b=0;H=[];!1===a.exportHiddenCells&&
(K=c(this).find("tr, th, td").filter(":hidden"),W=0<K.length);u=x(c(this));t=B(c(this));c(t).each(function(){C(this,"td,th",u.length+b,u.length+t.length,function(a){ya(a,c(a).children(),g)});b++})}),u=[],t=[]);Ma(g,function(){c(A).filter(function(){return J(c(this))}).each(function(){var b;p=0;H=[];!1===a.exportHiddenCells&&(K=c(this).find("tr, th, td").filter(":hidden"),W=0<K.length);U=T(this);g.columns=[];g.rows=[];g.teCells={};if("function"===typeof g.onTable&&!1===g.onTable(c(this),a))return!0;
a.jspdf.autotable.tableExport=null;var d=c.extend(!0,{},a.jspdf.autotable);a.jspdf.autotable.tableExport=g;d.margin={};c.extend(!0,d.margin,a.jspdf.margins);d.tableExport=g;"function"!==typeof d.beforePageContent&&(d.beforePageContent=function(a){if(1===a.pageCount){var b=a.table.rows.concat(a.table.headerRow);c.each(b,function(){0<this.height&&(this.height+=(2-1.15)/2*this.styles.fontSize,a.table.height+=(2-1.15)/2*this.styles.fontSize)})}});"function"!==typeof d.createdHeaderCell&&(d.createdHeaderCell=
function(a,b){a.styles=c.extend({},b.row.styles);if("undefined"!==typeof g.columns[b.column.dataKey]){var e=g.columns[b.column.dataKey];if("undefined"!==typeof e.rect){a.contentWidth=e.rect.width;if("undefined"===typeof g.heightRatio||0===g.heightRatio){var f=b.row.raw[b.column.dataKey].rowspan?b.row.raw[b.column.dataKey].rect.height/b.row.raw[b.column.dataKey].rowspan:b.row.raw[b.column.dataKey].rect.height;g.heightRatio=a.styles.rowHeight/f}f=b.row.raw[b.column.dataKey].rect.height*g.heightRatio;
f>a.styles.rowHeight&&(a.styles.rowHeight=f)}a.styles.halign="inherit"===d.headerStyles.halign?"center":d.headerStyles.halign;a.styles.valign=d.headerStyles.valign;"undefined"!==typeof e.style&&!0!==e.style.hidden&&("inherit"===d.headerStyles.halign&&(a.styles.halign=e.style.align),"inherit"===d.styles.fillColor&&(a.styles.fillColor=e.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=e.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=e.style.fstyle))}});"function"!==
typeof d.createdCell&&(d.createdCell=function(a,b){b=g.teCells[b.row.index+":"+b.column.dataKey];a.styles.halign="inherit"===d.styles.halign?"center":d.styles.halign;a.styles.valign=d.styles.valign;"undefined"!==typeof b&&"undefined"!==typeof b.style&&!0!==b.style.hidden&&("inherit"===d.styles.halign&&(a.styles.halign=b.style.align),"inherit"===d.styles.fillColor&&(a.styles.fillColor=b.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=b.style.color),"inherit"===d.styles.fontStyle&&
(a.styles.fontStyle=b.style.fstyle))});"function"!==typeof d.drawHeaderCell&&(d.drawHeaderCell=function(a,b){var c=g.columns[b.column.dataKey];return(!0!==c.style.hasOwnProperty("hidden")||!0!==c.style.hidden)&&0<=c.rowIndex?xa(a,b,c):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var d=g.teCells[b.row.index+":"+b.column.dataKey];if(!0!==("undefined"!==typeof d&&d.isCanvas))xa(a,b,d)&&(g.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle),"undefined"!==typeof d&&"undefined"!==typeof d.elements&&
d.elements.length?(b=a.height/d.rect.height,b>g.hScaleFactor&&(g.hScaleFactor=b),g.wScaleFactor=a.width/d.rect.width,b=a.textPos.y,Aa(a,d.elements,g),a.textPos.y=b,Ba(a,d.elements,g)):Ba(a,{},g));else{d=d.elements[0];var e=c(d).attr("data-tableexport-canvas"),f=d.getBoundingClientRect();a.width=f.width*g.wScaleFactor;a.height=f.height*g.hScaleFactor;b.row.height=a.height;va(a,d,e,g)}return!1});g.headerrows=[];u=x(c(this));c(u).each(function(){b=0;g.headerrows[p]=[];C(this,"th,td",p,u.length,function(a,
c,d){var e=Ea(a);e.title=F(a,c,d);e.key=b++;e.rowIndex=p;g.headerrows[p].push(e)});p++});if(0<p)for(var e=p-1;0<=e;)c.each(g.headerrows[e],function(){var a=this;0<e&&null===this.rect&&(a=g.headerrows[e-1][this.key]);null!==a&&0<=a.rowIndex&&(!0!==a.style.hasOwnProperty("hidden")||!0!==a.style.hidden)&&g.columns.push(a)}),e=0<g.columns.length?-1:e-1;var h=0;t=[];t=B(c(this));c(t).each(function(){var a=[];b=0;C(this,"td,th",p,u.length+t.length,function(d,e,f){if("undefined"===typeof g.columns[b]){var k=
{title:"",key:b,style:{hidden:!0}};g.columns.push(k)}"undefined"!==typeof d&&null!==d?(k=Ea(d),k.isCanvas=d.hasAttribute("data-tableexport-canvas"),k.elements=k.isCanvas?c(d):c(d).children()):(k=c.extend(!0,{},g.teCells[h+":"+(b-1)]),k.colspan=-1);g.teCells[h+":"+b++]=k;a.push(F(d,e,f))});a.length&&(g.rows.push(a),h++);p++});if("function"===typeof g.onBeforeAutotable)g.onBeforeAutotable(c(this),g.columns,g.rows,d);g.doc.autoTable(g.columns,g.rows,d);if("function"===typeof g.onAfterAutotable)g.onAfterAutotable(c(this),
d);a.jspdf.autotable.startY=g.doc.autoTableEndPosY()+d.margin.top});wa(g.doc,"undefined"!==typeof g.images&&!1===jQuery.isEmptyObject(g.images));"undefined"!==typeof g.headerrows&&(g.headerrows.length=0);"undefined"!==typeof g.columns&&(g.columns.length=0);"undefined"!==typeof g.rows&&(g.rows.length=0);delete g.doc;g.doc=null})}return this}})(jQuery);