diff --git a/README.md b/README.md index 5d637b0..3824e9c 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ jspdf: orientation: 'p' tableExport: onAfterAutotable: null onBeforeAutotable: null onTable: null + outputImages: true numbers: html: decimalMark: '.' thousandsSeparator: ',' output: decimalMark: '.', @@ -161,7 +162,9 @@ There is an extended setting for ``` jsPDF option 'format' ```. Setting the opti Also there is an extended setting for the ``` jsPDF-AutoTable options 'fillColor', 'textColor' and 'fontStyle'```. When setting these option values to ``` 'inherit' ``` the original css values for background and text color will be used as fill and text color while exporting to pdf. A css font-weight >= 700 results in a bold fontStyle and the italic css font-style will be used as italic fontStyle. -To export in XSLX format [protobi/js-xlsx](https://github.com/protobi/js-xlsx) forked from [SheetJS/js-xlsx](https://github.com/SheetJS/js-xlsx) is used. Please note that the implementation of this format type lets you only export table data but not any styling information of the htm table. +When exporting to pdf the option ```outputImages``` lets you disable the output of images that are located in the original html table. + +To export in XSLX format [protobi/js-xlsx](https://github.com/protobi/js-xlsx) forked from [SheetJS/js-xlsx](https://github.com/SheetJS/js-xlsx) is used. Please note that the implementation of this format type lets you only export table data, but not any styling information of the html table. Optional html data attributes diff --git a/tableExport.js b/tableExport.js index 3ceb825..09d1327 100644 --- a/tableExport.js +++ b/tableExport.js @@ -46,7 +46,8 @@ }, tableExport: {onAfterAutotable: null, onBeforeAutotable: null, - onTable: null + onTable: null, + outputImages: true } } }, @@ -608,7 +609,7 @@ var body = []; rowIndex = 0; - $hrows = $(el).find('thead').first().find(defaults.theadSelector); + $hrows = $(this).find('thead').first().find(defaults.theadSelector); $hrows.each(function () { var h = []; @@ -626,11 +627,11 @@ rowIndex++; }); - $(el).find('tbody').each(function() { + $(this).find('tbody').each(function() { $rows.push.apply ($rows, $(this).find(defaults.tbodySelector)); }); if (defaults.tfootSelector.length) - $rows.push.apply ($rows, $(el).find('tfoot').find(defaults.tfootSelector)); + $rows.push.apply ($rows, $(this).find('tfoot').find(defaults.tfootSelector)); $($rows).each(function () { var r = []; @@ -743,248 +744,293 @@ defaults.jspdf.unit, defaults.jspdf.format); - $(el).filter(function() { - return $(this).data("tableexport-display") != 'none' && - ($(this).is(':visible') || - $(this).data("tableexport-display") == 'always'); - }).each(function () { - var colKey; - var rowIndex = 0; - - colNames = GetColumnNames (this); - - teOptions.columns = []; - teOptions.rows = []; - teOptions.rowoptions = {}; - - // onTable: optional callback function for every matching table that can be used - // to modify the tableExport options or to skip the output of a particular table - // if the table selector targets multiple tables - if (typeof teOptions.onTable === 'function') - if (teOptions.onTable($(this), defaults) === false) - return true; // continue to next iteration step (table) - - // each table works with an own copy of AutoTable options - defaults.jspdf.autotable.tableExport = null; // avoid deep recursion error - var atOptions = $.extend(true, {}, defaults.jspdf.autotable); - defaults.jspdf.autotable.tableExport = teOptions; - - atOptions.margin = {}; - $.extend(true, atOptions.margin, defaults.jspdf.margins); - atOptions.tableExport = teOptions; - - // Fix jsPDF Autotable's row height calculation - if (typeof atOptions.beforePageContent !== 'function') { - atOptions.beforePageContent = function (data) { - if (data.pageCount == 1) { - var all = data.table.rows.concat(data.table.headerRow); - all.forEach(function (row) { - if ( row.height > 0 ) { - row.height += (2 - FONT_ROW_RATIO) / 2 * row.styles.fontSize; - data.table.height += (2 - FONT_ROW_RATIO) / 2 * row.styles.fontSize; + if (teOptions.outputImages === true) + teOptions.images = {}; + + if (typeof teOptions.images != 'undefined') { + $(el).filter(function() { + return $(this).data("tableexport-display") != 'none' && + ($(this).is(':visible') || + $(this).data("tableexport-display") == 'always'); + }).each(function () { + var rowCount = 0; + + $hrows = $(this).find('thead').find(defaults.theadSelector); + $(this).find('tbody').each(function() { + $rows.push.apply ($rows, $(this).find(defaults.tbodySelector)); + }); + if (defaults.tfootSelector.length) + $rows.push.apply ($rows, $(this).find('tfoot').find(defaults.tfootSelector)); + + $($rows).each(function () { + var rowData = []; + colKey = 0; + + ForEachVisibleCell(this, 'td', $hrows.length + rowCount, $hrows.length + $rows.length, + function (cell, row, col) { + if (typeof cell !== 'undefined' && cell != null) { + var kids = $(cell).children(); + if (typeof kids != 'undefined' && kids.length > 0) + collectImages (cell, kids, teOptions); } }); + rowCount++ + }); + }); + + $hrows = []; + $rows = []; + } + + loadImages ( teOptions, function (imageCount) { + + $(el).filter(function() { + return $(this).data("tableexport-display") != 'none' && + ($(this).is(':visible') || + $(this).data("tableexport-display") == 'always'); + }).each(function () { + var colKey; + var rowIndex = 0; + + colNames = GetColumnNames (this); + + teOptions.columns = []; + teOptions.rows = []; + teOptions.rowoptions = {}; + + // onTable: optional callback function for every matching table that can be used + // to modify the tableExport options or to skip the output of a particular table + // if the table selector targets multiple tables + if (typeof teOptions.onTable === 'function') + if (teOptions.onTable($(this), defaults) === false) + return true; // continue to next iteration step (table) + + // each table works with an own copy of AutoTable options + defaults.jspdf.autotable.tableExport = null; // avoid deep recursion error + var atOptions = $.extend(true, {}, defaults.jspdf.autotable); + defaults.jspdf.autotable.tableExport = teOptions; + + atOptions.margin = {}; + $.extend(true, atOptions.margin, defaults.jspdf.margins); + atOptions.tableExport = teOptions; + + // Fix jsPDF Autotable's row height calculation + if (typeof atOptions.beforePageContent !== 'function') { + atOptions.beforePageContent = function (data) { + if (data.pageCount == 1) { + var all = data.table.rows.concat(data.table.headerRow); + all.forEach(function (row) { + if ( row.height > 0 ) { + row.height += (2 - FONT_ROW_RATIO) / 2 * row.styles.fontSize; + data.table.height += (2 - FONT_ROW_RATIO) / 2 * row.styles.fontSize; + } + }); + } } } - } - if (typeof atOptions.createdHeaderCell !== 'function') { - // apply some original css styles to pdf header cells - atOptions.createdHeaderCell = function (cell, data) { + if (typeof atOptions.createdHeaderCell !== 'function') { + // apply some original css styles to pdf header cells + atOptions.createdHeaderCell = function (cell, data) { + + // jsPDF AutoTable plugin v2.0.14 fix: each cell needs its own styles object + cell.styles = $.extend({}, data.row.styles); - // jsPDF AutoTable plugin v2.0.14 fix: each cell needs its own styles object - cell.styles = $.extend({}, data.row.styles); + if (typeof teOptions.columns [data.column.dataKey] != 'undefined') { + var col = teOptions.columns [data.column.dataKey]; - if (typeof teOptions.columns [data.column.dataKey] != 'undefined') { - var col = teOptions.columns [data.column.dataKey]; + if (typeof col.rect != 'undefined') { + var rh; - if (typeof col.rect != 'undefined') { - var rh; + cell.contentWidth = col.rect.width; - cell.contentWidth = col.rect.width; + if (typeof teOptions.heightRatio == 'undefined' || teOptions.heightRatio == 0) { + if (data.row.raw [data.column.dataKey].rowspan) + rh = data.row.raw [data.column.dataKey].rect.height / data.row.raw [data.column.dataKey].rowspan; + else + rh = data.row.raw [data.column.dataKey].rect.height; - if (typeof teOptions.heightRatio == 'undefined' || teOptions.heightRatio == 0) { - if (data.row.raw [data.column.dataKey].rowspan) - rh = data.row.raw [data.column.dataKey].rect.height / data.row.raw [data.column.dataKey].rowspan; - else - rh = data.row.raw [data.column.dataKey].rect.height; + teOptions.heightRatio = cell.styles.rowHeight / rh; + } - teOptions.heightRatio = cell.styles.rowHeight / rh; + rh = data.row.raw [data.column.dataKey].rect.height * teOptions.heightRatio; + if (rh > cell.styles.rowHeight) + cell.styles.rowHeight = rh; } - rh = data.row.raw [data.column.dataKey].rect.height * teOptions.heightRatio; - if (rh > cell.styles.rowHeight) - cell.styles.rowHeight = rh; + if (typeof col.style != 'undefined' && col.style.hidden !== true) { + cell.styles.halign = col.style.align; + if (atOptions.styles.fillColor === 'inherit') + cell.styles.fillColor = col.style.bcolor; + if (atOptions.styles.textColor === 'inherit') + cell.styles.textColor = col.style.color; + if (atOptions.styles.fontStyle === 'inherit') + cell.styles.fontStyle = col.style.fstyle; + } } + } + } + + if (typeof atOptions.createdCell !== 'function') { + // apply some original css styles to pdf table cells + atOptions.createdCell = function (cell, data) { + var rowopt = teOptions.rowoptions [data.row.index + ":" + data.column.dataKey]; - if (typeof col.style != 'undefined' && col.style.hidden !== true) { - cell.styles.halign = col.style.align; + if (typeof rowopt != 'undefined' && + typeof rowopt.style != 'undefined' && + rowopt.style.hidden !== true) { + cell.styles.halign = rowopt.style.align; if (atOptions.styles.fillColor === 'inherit') - cell.styles.fillColor = col.style.bcolor; + cell.styles.fillColor = rowopt.style.bcolor; if (atOptions.styles.textColor === 'inherit') - cell.styles.textColor = col.style.color; + cell.styles.textColor = rowopt.style.color; if (atOptions.styles.fontStyle === 'inherit') - cell.styles.fontStyle = col.style.fstyle; + cell.styles.fontStyle = rowopt.style.fstyle; } } } - } - if (typeof atOptions.createdCell !== 'function') { - // apply some original css styles to pdf table cells - atOptions.createdCell = function (cell, data) { - var rowopt = teOptions.rowoptions [data.row.index + ":" + data.column.dataKey]; - - if (typeof rowopt != 'undefined' && - typeof rowopt.style != 'undefined' && - rowopt.style.hidden !== true) { - cell.styles.halign = rowopt.style.align; - if (atOptions.styles.fillColor === 'inherit') - cell.styles.fillColor = rowopt.style.bcolor; - if (atOptions.styles.textColor === 'inherit') - cell.styles.textColor = rowopt.style.color; - if (atOptions.styles.fontStyle === 'inherit') - cell.styles.fontStyle = rowopt.style.fstyle; - } - } - } + if (typeof atOptions.drawHeaderCell !== 'function') { + atOptions.drawHeaderCell = function (cell, data) { + var colopt = teOptions.columns [data.column.dataKey]; - if (typeof atOptions.drawHeaderCell !== 'function') { - atOptions.drawHeaderCell = function (cell, data) { - var colopt = teOptions.columns [data.column.dataKey]; - - if ((colopt.style.hasOwnProperty("hidden") != true || colopt.style.hidden !== true) && - colopt.rowIndex >= 0 ) - return prepareAutoTableText (cell, data, colopt); - else - return false; // cell is hidden + if ((colopt.style.hasOwnProperty("hidden") != true || colopt.style.hidden !== true) && + colopt.rowIndex >= 0 ) + return prepareAutoTableText (cell, data, colopt); + else + return false; // cell is hidden + } } - } - if (typeof atOptions.drawCell !== 'function') { - atOptions.drawCell = function (cell, data) { - var rowopt = teOptions.rowoptions [data.row.index + ":" + data.column.dataKey]; - if ( prepareAutoTableText (cell, data, rowopt) ) { + if (typeof atOptions.drawCell !== 'function') { + atOptions.drawCell = function (cell, data) { + var rowopt = teOptions.rowoptions [data.row.index + ":" + data.column.dataKey]; + if ( prepareAutoTableText (cell, data, rowopt) ) { - teOptions.doc.rect(cell.x, cell.y, cell.width, cell.height, cell.styles.fillStyle); + teOptions.doc.rect(cell.x, cell.y, cell.width, cell.height, cell.styles.fillStyle); - if (typeof rowopt != 'undefined' && typeof rowopt.kids != 'undefined' && rowopt.kids.length > 0) { + if (typeof rowopt != 'undefined' && typeof rowopt.kids != 'undefined' && rowopt.kids.length > 0) { - var dh = cell.height / rowopt.rect.height; - if ( dh > teOptions.dh || typeof teOptions.dh == 'undefined' ) - teOptions.dh = dh; - teOptions.dw = cell.width / rowopt.rect.width; + var dh = cell.height / rowopt.rect.height; + if ( dh > teOptions.dh || typeof teOptions.dh == 'undefined' ) + teOptions.dh = dh; + teOptions.dw = cell.width / rowopt.rect.width; - drawCellElements (cell, rowopt.kids, teOptions); + drawCellElements (cell, rowopt.kids, teOptions); + } + teOptions.doc.autoTableText (cell.text, cell.textPos.x, cell.textPos.y, { + halign: cell.styles.halign, + valign: cell.styles.valign + }); } - teOptions.doc.autoTableText(cell.text, cell.textPos.x, cell.textPos.y, { - halign: cell.styles.halign, - valign: cell.styles.valign - }); + return false; } - return false; } - } - // collect header and data rows - teOptions.headerrows = []; - $hrows = $(this).find('thead').find(defaults.theadSelector); - $hrows.each(function () { - colKey = 0; - - teOptions.headerrows[rowIndex] = []; - - ForEachVisibleCell(this, 'th,td', rowIndex, $hrows.length, - function (cell, row, col) { - var obj = getCellStyles (cell); - obj.title = parseString(cell, row, col); - obj.key = colKey++; - obj.rowIndex = rowIndex; - teOptions.headerrows[rowIndex].push(obj); - }); - rowIndex++; - }); + // collect header and data rows + teOptions.headerrows = []; + $hrows = $(this).find('thead').find(defaults.theadSelector); + $hrows.each(function () { + colKey = 0; - if (rowIndex > 0) { - // iterate through last row - $.each(teOptions.headerrows[rowIndex-1], function () { - if (rowIndex > 1 && this.rect == null) - obj = teOptions.headerrows[rowIndex-2][this.key]; - else - obj = this; + teOptions.headerrows[rowIndex] = []; - if (obj != null) - teOptions.columns.push(obj); + ForEachVisibleCell(this, 'th,td', rowIndex, $hrows.length, + function (cell, row, col) { + var obj = getCellStyles (cell); + obj.title = parseString(cell, row, col); + obj.key = colKey++; + obj.rowIndex = rowIndex; + teOptions.headerrows[rowIndex].push(obj); + }); + rowIndex++; }); - } - var rowCount = 0; - $rows = $(this).find('tbody').find(defaults.tbodySelector); - if (defaults.tfootSelector.length) - $rows.push.apply ($rows, $(this).find('tfoot').find(defaults.tfootSelector)); - $($rows).each(function () { - var rowData = []; - colKey = 0; - - ForEachVisibleCell(this, 'td', rowIndex, $hrows.length + $rows.length, - function (cell, row, col) { - if (typeof teOptions.columns[colKey] === 'undefined') { - // jsPDF-Autotable needs columns. Thus define hidden ones for tables without thead - var obj = { - title: '', - key: colKey, - style: { - hidden: true - } - }; - teOptions.columns.push(obj); - } - if (typeof cell !== 'undefined' && cell != null) { - var obj = getCellStyles (cell); - obj.kids = $(cell).children(); - teOptions.rowoptions [rowCount + ":" + colKey++] = obj; - } - else { - var obj = $.extend(true, {}, teOptions.rowoptions [rowCount + ":" + (colKey-1)]); - obj.colspan = -1; - teOptions.rowoptions [rowCount + ":" + colKey++] = obj; - } + if (rowIndex > 0) { + // iterate through last row + $.each(teOptions.headerrows[rowIndex-1], function () { + if (rowIndex > 1 && this.rect == null) + obj = teOptions.headerrows[rowIndex-2][this.key]; + else + obj = this; - rowData.push(parseString(cell, row, col)); - }); - if (rowData.length) { - teOptions.rows.push(rowData); - rowCount++ + if (obj != null) + teOptions.columns.push(obj); + }); } - rowIndex++; - }); - // onBeforeAutotable: optional callback function before calling - // jsPDF AutoTable that can be used to modify the AutoTable options - if (typeof teOptions.onBeforeAutotable === 'function') - teOptions.onBeforeAutotable($(this), teOptions.columns, teOptions.rows, atOptions); + var rowCount = 0; + $rows = []; + $(this).find('tbody').each(function() { + $rows.push.apply ($rows, $(this).find(defaults.tbodySelector)); + }); + if (defaults.tfootSelector.length) + $rows.push.apply ($rows, $(this).find('tfoot').find(defaults.tfootSelector)); + $($rows).each(function () { + var rowData = []; + colKey = 0; + + ForEachVisibleCell(this, 'td', rowIndex, $hrows.length + $rows.length, + function (cell, row, col) { + if (typeof teOptions.columns[colKey] === 'undefined') { + // jsPDF-Autotable needs columns. Thus define hidden ones for tables without thead + var obj = { + title: '', + key: colKey, + style: { + hidden: true + } + }; + teOptions.columns.push(obj); + } + if (typeof cell !== 'undefined' && cell != null) { + var obj = getCellStyles (cell); + obj.kids = $(cell).children(); + teOptions.rowoptions [rowCount + ":" + colKey++] = obj; + } + else { + var obj = $.extend(true, {}, teOptions.rowoptions [rowCount + ":" + (colKey-1)]); + obj.colspan = -1; + teOptions.rowoptions [rowCount + ":" + colKey++] = obj; + } - teOptions.doc.autoTable(teOptions.columns, teOptions.rows, atOptions); + rowData.push(parseString(cell, row, col)); + }); + if (rowData.length) { + teOptions.rows.push(rowData); + rowCount++ + } + rowIndex++; + }); - // onAfterAutotable: optional callback function after returning - // from jsPDF AutoTable that can be used to modify the AutoTable options - if (typeof teOptions.onAfterAutotable === 'function') - teOptions.onAfterAutotable($(this), atOptions); + // onBeforeAutotable: optional callback function before calling + // jsPDF AutoTable that can be used to modify the AutoTable options + if (typeof teOptions.onBeforeAutotable === 'function') + teOptions.onBeforeAutotable($(this), teOptions.columns, teOptions.rows, atOptions); - // set the start position for the next table (in case there is one) - defaults.jspdf.autotable.startY = teOptions.doc.autoTableEndPosY() + atOptions.margin.top; - }); + teOptions.doc.autoTable(teOptions.columns, teOptions.rows, atOptions); + + // onAfterAutotable: optional callback function after returning + // from jsPDF AutoTable that can be used to modify the AutoTable options + if (typeof teOptions.onAfterAutotable === 'function') + teOptions.onAfterAutotable($(this), atOptions); + + // set the start position for the next table (in case there is one) + defaults.jspdf.autotable.startY = teOptions.doc.autoTableEndPosY() + atOptions.margin.top; + + }); - jsPdfOutput(teOptions.doc); + jsPdfOutput(teOptions.doc); - if (typeof teOptions.headerrows != 'undefined') - teOptions.headerrows.length = 0; - if (typeof teOptions.columns != 'undefined') - teOptions.columns.length = 0; - if (typeof teOptions.rows != 'undefined') - teOptions.rows.length = 0; - delete teOptions.doc; - teOptions.doc = null; + if (typeof teOptions.headerrows != 'undefined') + teOptions.headerrows.length = 0; + if (typeof teOptions.columns != 'undefined') + teOptions.columns.length = 0; + if (typeof teOptions.rows != 'undefined') + teOptions.rows.length = 0; + delete teOptions.doc; + teOptions.doc = null; + }); } } @@ -1169,6 +1215,75 @@ return false; // cell is hidden (colspan = -1), don't draw it } + function collectImages (cell, elements, teOptions) { + if (typeof teOptions.images != 'undefined') { + elements.each(function () { + var kids = $(this).children(); + + if ( $(this).is("img") ) { + var hash = strHashCode(this.src); + + teOptions.images[hash] = { url: this.src, + src: this.src }; + } + + if (typeof kids != 'undefined' && kids.length > 0) + collectImages (cell, kids, teOptions); + }); + } + } + + function loadImages (teOptions, callback) { + var i; + var imageCount = 0; + var x = 0; + + function done() { + callback(imageCount); + } + function loadImage(image) { + if (!image.url) + return; + var img = new Image(); + imageCount = ++x; + //img.crossOrigin = ''; + img.crossOrigin = 'Anonymous'; + img.onerror = img.onload = function () { + if(img.complete) { + + if (img.src.indexOf('data:image/') === 0) { + img.width = image.width || img.width || 0; + img.height = image.height || img.height || 0; + } + + if (img.width + img.height) { + var hash = strHashCode(image.url); + + var canvas = document.createElement("canvas"); + var ctx = canvas.getContext("2d"); + + canvas.width = img.width; + canvas.height = img.height; + ctx.drawImage( img, 0, 0 ); + + image.src = canvas.toDataURL("image/jpeg"); + } + } + if(!--x) + done(); + }; + img.src = image.url; + } + + if (typeof teOptions.images != 'undefined') { + for (i in teOptions.images) + if (teOptions.images.hasOwnProperty(i)) + loadImage(teOptions.images[i]); + } + + return x || done(); + } + function drawCellElements (cell, elements, teOptions) { elements.each(function () { var kids = $(this).children(); @@ -1189,6 +1304,17 @@ teOptions.doc.setLineWidth (lwidth); teOptions.doc.rect(cell.x + ux, cell.y + uy, uw, uh, lwidth ? "FD" : "F"); } + else if ( $(this).is("img") ) { + if (typeof teOptions.images != 'undefined') { + var hash = strHashCode(this.src); + var image = teOptions.images[hash]; + + if (typeof image != 'undefined') { + teOptions.doc.addImage (image.src, cell.textPos.x, cell.y, this.width, this.height); + cell.textPos.x += this.width; + } + } + } if (typeof kids != 'undefined' && kids.length > 0) drawCellElements (cell, kids, teOptions); @@ -1234,7 +1360,6 @@ return typeof value === "number" || jQuery.isNumeric(value) !== false ? value : false; } - function parseString(cell, rowIndex, colIndex) { var result = ''; @@ -1440,6 +1565,17 @@ return ws; } + function strHashCode (str) { + var hash = 0, i, chr, len; + if (str.length === 0) return hash; + for (i = 0, len = str.length; i < len; i++) { + chr = str.charCodeAt(i); + hash = ((hash << 5) - hash) + chr; + hash |= 0; // Convert to 32bit integer + } + return hash; + }; + function downloadFile(filename, header, data) { var ua = window.navigator.userAgent; diff --git a/tableExport.min.js b/tableExport.min.js index 1ea129d..0831d0c 100644 --- a/tableExport.min.js +++ b/tableExport.min.js @@ -6,49 +6,52 @@ Licensed under the MIT License, http://opensource.org/licenses/mit-license */ -(function(b){b.fn.extend({tableExport:function(v){function Q(f){var a=[];b(f).find("thead").first().find("th").each(function(f,h){void 0!==b(h).attr("data-field")?a[f]=b(h).attr("data-field"):a[f]=f.toString()});return a}function x(f,e,d,h,k){if(-1==b.inArray(d,a.ignoreRow)&&-1==b.inArray(d-h,a.ignoreRow)){var m=b(f).filter(function(){return"none"!=b(this).data("tableexport-display")&&(b(this).is(":visible")||"always"==b(this).data("tableexport-display")||"always"==b(this).closest("table").data("tableexport-display"))}).find(e), -n=0;m.each(function(f){if("always"==b(this).data("tableexport-display")||"none"!=b(this).css("display")&&"hidden"!=b(this).css("visibility")&&"none"!=b(this).data("tableexport-display")){var e=f,h=!1;0e&&"undefined"!=typeof G[e]&&-1!=b.inArray(G[e],a.ignoreColumn)&&(h=!0):"number"!=typeof a.ignoreColumn[0]||-1==b.inArray(e,a.ignoreColumn)&&-1==b.inArray(e-m.length,a.ignoreColumn)||(h=!0));if(0==h&&"function"===typeof k){var h=0, -g,l=0;if("undefined"!=typeof y[d]&&0/gi,"\u2060");k=b("
").html(m).contents(); -m="";b.each(k.text().split("\u2028"),function(f,a){0k?"-":"")+(a.numbers.output.thousandsSeparator?(g?n[0].substr(0,g)+a.numbers.output.thousandsSeparator: -"")+n[0].substr(g).replace(/(\d{3})(?=\d)/g,"$1"+a.numbers.output.thousandsSeparator):n[0])+(n[1].length?a.numbers.output.decimalMark+n[1]:"")}}!0===a.escape&&(h=escape(h));"function"===typeof a.onCellData&&(h=a.onCellData(f,e,d,h))}return h}function ha(f,a,d){return a+"-"+d.toLowerCase()}function M(f,a){var d=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(f),b=a;d&&(b=[parseInt(d[1]),parseInt(d[2]),parseInt(d[3])]);return b}function ca(a){var e=C(a,"text-align"),d=C(a,"font-weight"),h=C(a,"font-style"), -k="";"start"==e&&(e="rtl"==C(a,"direction")?"right":"left");700<=d&&(k="bold");"italic"==h&&(k+=h);""==k&&(k="normal");e={style:{align:e,bcolor:M(C(a,"background-color"),[255,255,255]),color:M(C(a,"color"),[0,0,0]),fstyle:k},colspan:parseInt(b(a).attr("colspan"))||0,rowspan:parseInt(b(a).attr("rowspan"))||0};null!==a&&(a=a.getBoundingClientRect(),e.rect={width:a.width,height:a.height});return e}function C(a,e){try{return window.getComputedStyle?(e=e.replace(/([a-z])([A-Z])/,ha),window.getComputedStyle(a, -null).getPropertyValue(e)):a.currentStyle?a.currentStyle[e]:a.style[e]}catch(d){}return""}function N(a,e,d){e=C(a,e).match(/\d+/);if(null!==e){e=e[0];a=a.parentElement;var b=document.createElement("div");b.style.overflow="hidden";b.style.visibility="hidden";a.appendChild(b);b.style.width=100+d;d=100/b.offsetWidth;a.removeChild(b);return e*d}return 0}function S(){if(!(this instanceof S))return new S;this.SheetNames=[];this.Sheets={}}function ia(a){for(var e=new ArrayBuffer(a.length),d=new Uint8Array(e), -b=0;b!=a.length;++b)d[b]=a.charCodeAt(b)&255;return e}function ja(a){for(var e={},d={s:{c:1E7,r:1E7},e:{c:0,r:0}},b=0;b!=a.length;++b)for(var k=0;k!=a[b].length;++k){d.s.r>b&&(d.s.r=b);d.s.c>k&&(d.s.c=k);d.e.rd.s.c&&(e["!ref"]=XLSX.utils.encode_range(d)); -return e}function B(a,e,b){var h=window.navigator.userAgent;if(0m?h+=String.fromCharCode(m):(127m?h+=String.fromCharCode(m>> -6|192):(h+=String.fromCharCode(m>>12|224),h+=String.fromCharCode(m>>6&63|128)),h+=String.fromCharCode(m&63|128));for(a=h;l>2,d=(d&3)<<4|h>>4,n=(h&15)<<2|k>>6,g=k&63,isNaN(h)?n=g=64:isNaN(k)&&(g=64),b=b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)+ -"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g);return b}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8,fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left", -valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onTable:null}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,onCellHtmlData:null,outputMode:"file",pdfmake:{enabled:!1},tbodySelector:"tr",tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"xlsWorksheetName"}, -O=null,t=[],l=[],p=0,y=[],q="",G=[];b.extend(!0,a,v);G=Q(this);if("csv"==a.type||"txt"==a.type){var T=function(f,e,d){f.each(function(){q="";x(this,e,p,d+f.length,function(b,f,e){var d=q,g="";if(null!=b)if(b=w(b,f,e),f=null===b||""==b?"":b.toString(),b instanceof Date)g=a.csvEnclosure+b.toLocaleString()+a.csvEnclosure;else if(g=R(f,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=g.indexOf(a.csvSeparator)||/[\r\n ]/g.test(g))g=a.csvEnclosure+g+a.csvEnclosure;q=d+(g+a.csvSeparator)});q=b.trim(q).substring(0, -q.length-1);0',A=A+"",t=b(this).find("thead").first().find(a.theadSelector);t.each(function(){x(this,"th,td",p,t.length,function(a,b,d){A+=""+w(a,b,d)+""});p++});var A=A+"",da=1;b(this).find("tbody").each(function(){l.push.apply(l,b(this).find(a.tbodySelector))});a.tfootSelector.length&&l.push.apply(l,b(this).find("tfoot").find(a.tfootSelector));b(l).each(function(){var a=1;q="";x(this, -"td",p,t.length+l.length,function(b,d,g){q+=""+w(b,d,g)+"";a++});0"!=q&&(A+=''+q+"",da++);p++});A+="";!0===a.consoleLog&&console.log(A);if("string"===a.outputMode)return A;if("base64"===a.outputMode)return E(A);try{z=new Blob([A],{type:"application/xml;charset=utf-8"}),saveAs(z,a.fileName+".xml")}catch(f){B(a.fileName+".xml","data:application/xml;charset=utf-8;base64,",A)}}else if("excel"==a.type|| -"xls"==a.type||"word"==a.type||"doc"==a.type){v="excel"==a.type||"xls"==a.type?"excel":"word";var J="excel"==v?"xls":"doc",r='xmlns:x="urn:schemas-microsoft-com:office:'+v+'"',F="";b(this).filter(function(){return"none"!=b(this).data("tableexport-display")&&(b(this).is(":visible")||"always"==b(this).data("tableexport-display"))}).each(function(){var f=b(this);p=0;G=Q(this);F+="";t=f.find("thead").first().find(a.theadSelector);t.each(function(){q="";x(this,"th,td",p,t.length,function(e, -d,f){if(null!=e){var k="";q+=""}});0"+q+"");p++});F+="";f.find("tbody").each(function(){l.push.apply(l, -b(this).find(a.tbodySelector))});a.tfootSelector.length&&l.push.apply(l,f.find("tfoot").find(a.tfootSelector));b(l).each(function(){var f=b(this);q="";x(this,"td",p,t.length+l.length,function(d,g,k){if(null!=d){var m="",n=b(d).data("tableexport-msonumberformat");"undefined"==typeof n&&"function"===typeof a.onMsoNumberFormat&&(n=a.onMsoNumberFormat(d,g,k));"undefined"!=typeof n&&""!=n&&(m="style=\"mso-number-format:'"+n+"'");q+=""}});0"+q+"");p++});a.displayTableName&&(F+="");F+="
"+w(b("

"+a.tableName+"

"))+"
"; -!0===a.consoleLog&&console.log(F)});r=''+('')+"";"excel"===v&&(r+="\x3c!--[if gte mso 9]>",r+="",r+="",r+="",r+="",r+="",r+=a.worksheetName,r+="",r+="",r+="",r+="",r+="", -r+="",r+="",r+="",r+="";r+="";r+=F;r+="";r+="";!0===a.consoleLog&&console.log(r);if("string"===a.outputMode)return r;if("base64"===a.outputMode)return E(r);try{z=new Blob([r],{type:"application/vnd.ms-"+a.type}),saveAs(z,a.fileName+"."+J)}catch(f){B(a.fileName+"."+J,"data:application/vnd.ms-"+v+";base64,",r)}}else if("xlsx"==a.type){var V=[],W=[],p=0,l=b(this).find("thead").first().find(a.theadSelector);b(this).find("tbody").each(function(){l.push.apply(l, -b(this).find(a.tbodySelector))});a.tfootSelector.length&&l.push.apply(l,b(this).find("tfoot").find(a.tfootSelector));b(l).each(function(){var a=[];x(this,"th,td",p,l.length,function(b,d,g){if("undefined"!==typeof b&&null!=b){var k=b.getAttribute("colspan"),m=b.getAttribute("rowspan");b=w(b,d,g);""!==b&&b==+b&&(b=+b);W.forEach(function(b){if(p>=b.s.r&&p<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var d=0;d<=b.e.c-b.s.c;++d)a.push(null)});if(m||k)k=k||1,W.push({s:{r:p,c:a.length},e:{r:p+(m||1)-1,c:a.length+ -k-1}});a.push(""!==b?b:null);if(k)for(m=0;mfa){a>K.a0[0]&&(P="a0",L="l");for(var e in K)K.hasOwnProperty(e)&&K[e][1]>a&&(P=e,L="l",K[e][0]>a&&(L="p"));fa=a}}});a.jspdf.format=""==P?"a4":P;a.jspdf.orientation=""==L?"w":L}g.doc= -new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);b(this).filter(function(){return"none"!=b(this).data("tableexport-display")&&(b(this).is(":visible")||"always"==b(this).data("tableexport-display"))}).each(function(){var f,e=0;G=Q(this);g.columns=[];g.rows=[];g.rowoptions={};if("function"===typeof g.onTable&&!1===g.onTable(b(this),a))return!0;a.jspdf.autotable.tableExport=null;var d=b.extend(!0,{},a.jspdf.autotable);a.jspdf.autotable.tableExport=g;d.margin={};b.extend(!0,d.margin,a.jspdf.margins); -d.tableExport=g;"function"!==typeof d.beforePageContent&&(d.beforePageContent=function(a){1==a.pageCount&&a.table.rows.concat(a.table.headerRow).forEach(function(b){0a.styles.rowHeight&&(a.styles.rowHeight=h)}"undefined"!=typeof f.style&&!0!==f.style.hidden&&(a.styles.halign=f.style.align,"inherit"===d.styles.fillColor&&(a.styles.fillColor= -f.style.bcolor),"inherit"===d.styles.textColor&&(a.styles.textColor=f.style.color),"inherit"===d.styles.fontStyle&&(a.styles.fontStyle=f.style.fstyle))}});"function"!==typeof d.createdCell&&(d.createdCell=function(a,b){var e=g.rowoptions[b.row.index+":"+b.column.dataKey];"undefined"!=typeof e&&"undefined"!=typeof e.style&&!0!==e.style.hidden&&(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.drawHeaderCell&&(d.drawHeaderCell=function(a,b){var d=g.columns[b.column.dataKey];return(1!=d.style.hasOwnProperty("hidden")||!0!==d.style.hidden)&&0<=d.rowIndex?aa(a,b,d):!1});"function"!==typeof d.drawCell&&(d.drawCell=function(a,b){var d=g.rowoptions[b.row.index+":"+b.column.dataKey];if(aa(a,b,d)){g.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle);if("undefined"!=typeof d&&"undefined"!=typeof d.kids&& -0g.dh||"undefined"==typeof g.dh)g.dh=e;g.dw=a.width/d.rect.width;ba(a,d.kids,g)}g.doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign})}return!1});g.headerrows=[];t=b(this).find("thead").find(a.theadSelector);t.each(function(){f=0;g.headerrows[e]=[];x(this,"th,td",e,t.length,function(a,b,d){var h=ca(a);h.title=w(a,b,d);h.key=f++;h.rowIndex=e;g.headerrows[e].push(h)});e++});0h&&"undefined"!=typeof H[h]&&-1!=b.inArray(H[h],a.ignoreColumn)&&(e=!0):"number"!=typeof a.ignoreColumn[0]||-1==b.inArray(h,a.ignoreColumn)&&-1==b.inArray(h-l.length,a.ignoreColumn)||(e=!0));if(0==e&&"function"===typeof w){var e=0, +g,k=0;if("undefined"!=typeof z[d]&&0/gi,"\u2060");w=b("
").html(l).contents();l="";b.each(w.text().split("\u2028"),function(f,a){0w?"-":"")+(a.numbers.output.thousandsSeparator?(g?m[0].substr(0,g)+a.numbers.output.thousandsSeparator:"")+m[0].substr(g).replace(/(\d{3})(?=\d)/g,"$1"+ +a.numbers.output.thousandsSeparator):m[0])+(m[1].length?a.numbers.output.decimalMark+m[1]:"")}}!0===a.escape&&(e=escape(e));"function"===typeof a.onCellData&&(e=a.onCellData(f,h,d,e))}return e}function ma(f,a,d){return a+"-"+d.toLowerCase()}function N(f,a){var d=/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/.exec(f),e=a;d&&(e=[parseInt(d[1]),parseInt(d[2]),parseInt(d[3])]);return e}function ga(f){var a=D(f,"text-align"),d=D(f,"font-weight"),e=D(f,"font-style"),g="";"start"==a&&(a="rtl"==D(f,"direction")? +"right":"left");700<=d&&(g="bold");"italic"==e&&(g+=e);""==g&&(g="normal");a={style:{align:a,bcolor:N(D(f,"background-color"),[255,255,255]),color:N(D(f,"color"),[0,0,0]),fstyle:g},colspan:parseInt(b(f).attr("colspan"))||0,rowspan:parseInt(b(f).attr("rowspan"))||0};null!==f&&(f=f.getBoundingClientRect(),a.rect={width:f.width,height:f.height});return a}function D(a,h){try{return window.getComputedStyle?(h=h.replace(/([a-z])([A-Z])/,ma),window.getComputedStyle(a,null).getPropertyValue(h)):a.currentStyle? +a.currentStyle[h]:a.style[h]}catch(d){}return""}function O(a,h,d){h=D(a,h).match(/\d+/);if(null!==h){h=h[0];a=a.parentElement;var e=document.createElement("div");e.style.overflow="hidden";e.style.visibility="hidden";a.appendChild(e);e.style.width=100+d;d=100/e.offsetWidth;a.removeChild(e);return h*d}return 0}function V(){if(!(this instanceof V))return new V;this.SheetNames=[];this.Sheets={}}function na(a){for(var h=new ArrayBuffer(a.length),d=new Uint8Array(h),e=0;e!=a.length;++e)d[e]=a.charCodeAt(e)& +255;return h}function oa(a){for(var h={},d={s:{c:1E7,r:1E7},e:{c:0,r:0}},e=0;e!=a.length;++e)for(var b=0;b!=a[e].length;++b){d.s.r>e&&(d.s.r=e);d.s.c>b&&(d.s.c=b);d.e.rd.s.c&&(h["!ref"]=XLSX.utils.encode_range(d));return h}function T(a){var h=0, +d,e,b;if(0===a.length)return h;d=0;for(b=a.length;dl?e+=String.fromCharCode(l):(127l?e+=String.fromCharCode(l>>6|192):(e+=String.fromCharCode(l>>12|224),e+=String.fromCharCode(l>>6&63|128)),e+=String.fromCharCode(l&63|128));for(a=e;k>2,d=(d&3)<<4|e>>4,m=(e&15)<<2|b>>6,g=b&63,isNaN(e)?m=g=64:isNaN(b)&&(g=64),h=h+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+ +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g);return h}var a={consoleLog:!1,csvEnclosure:'"',csvSeparator:",",csvUseBOM:!0,displayTableName:!1,escape:!1,excelstyles:[],fileName:"tableExport",htmlContent:!1,ignoreColumn:[],ignoreRow:[],jsonScope:"all",jspdf:{orientation:"p",unit:"pt",format:"a4",margins:{left:20,right:10,top:10,bottom:10},autotable:{styles:{cellPadding:2,rowHeight:12,fontSize:8, +fillColor:255,textColor:50,fontStyle:"normal",overflow:"ellipsize",halign:"left",valign:"middle"},headerStyles:{fillColor:[52,73,94],textColor:255,fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:245},tableExport:{onAfterAutotable:null,onBeforeAutotable:null,onTable:null,outputImages:!0}}},numbers:{html:{decimalMark:".",thousandsSeparator:","},output:{decimalMark:".",thousandsSeparator:","}},onCellData:null,onCellHtmlData:null,outputMode:"file",pdfmake:{enabled:!1},tbodySelector:"tr", +tfootSelector:"tr",theadSelector:"tr",tableName:"myTableName",type:"csv",worksheetName:"xlsWorksheetName"},t=this,P=null,q=[],k=[],p=0,z=[],n="",H=[];b.extend(!0,a,v);H=R(t);if("csv"==a.type||"txt"==a.type){var W=function(f,h,d){f.each(function(){n="";y(this,h,p,d+f.length,function(f,b,d){var h=n,g="";if(null!=f)if(f=x(f,b,d),b=null===f||""==f?"":f.toString(),f instanceof Date)g=a.csvEnclosure+f.toLocaleString()+a.csvEnclosure;else if(g=U(b,a.csvEnclosure,a.csvEnclosure+a.csvEnclosure),0<=g.indexOf(a.csvSeparator)|| +/[\r\n ]/g.test(g))g=a.csvEnclosure+g+a.csvEnclosure;n=h+(g+a.csvSeparator)});n=b.trim(n).substring(0,n.length-1);0',B=B+"",q=b(t).find("thead").first().find(a.theadSelector);q.each(function(){y(this,"th,td",p,q.length,function(a,b,d){B+=""+x(a,b,d)+""});p++});var B=B+"",ha=1;b(t).find("tbody").each(function(){k.push.apply(k,b(this).find(a.tbodySelector))});a.tfootSelector.length&&k.push.apply(k, +b(t).find("tfoot").find(a.tfootSelector));b(k).each(function(){var a=1;n="";y(this,"td",p,q.length+k.length,function(b,d,e){n+=""+x(b,d,e)+"";a++});0"!=n&&(B+=''+n+"",ha++);p++});B+="";!0===a.consoleLog&&console.log(B);if("string"===a.outputMode)return B;if("base64"===a.outputMode)return F(B);try{A=new Blob([B],{type:"application/xml;charset=utf-8"}),saveAs(A,a.fileName+".xml")}catch(f){C(a.fileName+ +".xml","data:application/xml;charset=utf-8;base64,",B)}}else if("excel"==a.type||"xls"==a.type||"word"==a.type||"doc"==a.type){v="excel"==a.type||"xls"==a.type?"excel":"word";var K="excel"==v?"xls":"doc",r='xmlns:x="urn:schemas-microsoft-com:office:'+v+'"',G="";b(t).filter(function(){return"none"!=b(this).data("tableexport-display")&&(b(this).is(":visible")||"always"==b(this).data("tableexport-display"))}).each(function(){var f=b(this);p=0;H=R(this);G+="";q=f.find("thead").first().find(a.theadSelector); +q.each(function(){n="";y(this,"th,td",p,q.length,function(f,d,e){if(null!=f){var g="";n+=""}});0"+n+"");p++});G+= +"";f.find("tbody").each(function(){k.push.apply(k,b(this).find(a.tbodySelector))});a.tfootSelector.length&&k.push.apply(k,f.find("tfoot").find(a.tfootSelector));b(k).each(function(){var f=b(this);n="";y(this,"td",p,q.length+k.length,function(d,e,g){if(null!=d){var l="",m=b(d).data("tableexport-msonumberformat");"undefined"==typeof m&&"function"===typeof a.onMsoNumberFormat&&(m=a.onMsoNumberFormat(d,e,g));"undefined"!=typeof m&&""!=m&&(l="style=\"mso-number-format:'"+m+"'");n+=""}});0"+n+"");p++});a.displayTableName&&(G+="");G+="
"+ +x(b("

"+a.tableName+"

"))+"
";!0===a.consoleLog&&console.log(G)});r=''+('')+"";"excel"===v&&(r+="\x3c!--[if gte mso 9]>",r+="",r+="",r+="",r+="",r+="",r+=a.worksheetName,r+="",r+="", +r+="",r+="",r+="",r+="",r+="",r+="",r+="";r+="";r+=G;r+="";r+="";!0===a.consoleLog&&console.log(r);if("string"===a.outputMode)return r;if("base64"===a.outputMode)return F(r);try{A=new Blob([r],{type:"application/vnd.ms-"+a.type}),saveAs(A,a.fileName+"."+K)}catch(f){C(a.fileName+"."+K,"data:application/vnd.ms-"+v+";base64,",r)}}else if("xlsx"==a.type){var Y= +[],Z=[],p=0,k=b(t).find("thead").first().find(a.theadSelector);b(t).find("tbody").each(function(){k.push.apply(k,b(this).find(a.tbodySelector))});a.tfootSelector.length&&k.push.apply(k,b(t).find("tfoot").find(a.tfootSelector));b(k).each(function(){var a=[];y(this,"th,td",p,k.length,function(b,d,e){if("undefined"!==typeof b&&null!=b){var g=b.getAttribute("colspan"),l=b.getAttribute("rowspan");b=x(b,d,e);""!==b&&b==+b&&(b=+b);Z.forEach(function(b){if(p>=b.s.r&&p<=b.e.r&&a.length>=b.s.c&&a.length<=b.e.c)for(var e= +0;e<=b.e.c-b.s.c;++e)a.push(null)});if(l||g)g=g||1,Z.push({s:{r:p,c:a.length},e:{r:p+(l||1)-1,c:a.length+g-1}});a.push(""!==b?b:null);if(g)for(l=0;lja){a>L.a0[0]&&(Q="a0",M="l");for(var g in L)L.hasOwnProperty(g)&&L[g][1]>a&&(Q=g,M="l",L[g][0]>a&&(M="p"));ja=a}}});a.jspdf.format=""==Q?"a4":Q;a.jspdf.orientation=""==M?"w":M}g.doc=new jsPDF(a.jspdf.orientation,a.jspdf.unit,a.jspdf.format);!0===g.outputImages&&(g.images={});"undefined"!=typeof g.images&&(b(t).filter(function(){return"none"!=b(this).data("tableexport-display")&&(b(this).is(":visible")||"always"==b(this).data("tableexport-display"))}).each(function(){var f=0;q=b(this).find("thead").find(a.theadSelector); +b(this).find("tbody").each(function(){k.push.apply(k,b(this).find(a.tbodySelector))});a.tfootSelector.length&&k.push.apply(k,b(this).find("tfoot").find(a.tfootSelector));b(k).each(function(){colKey=0;y(this,"td",q.length+f,q.length+k.length,function(a,d,e){"undefined"!==typeof a&&null!=a&&(d=b(a).children(),"undefined"!=typeof d&&0a.styles.rowHeight&&(a.styles.rowHeight=h)}"undefined"!=typeof f.style&&!0!==f.style.hidden&&(a.styles.halign=f.style.align,"inherit"===e.styles.fillColor&&(a.styles.fillColor=f.style.bcolor),"inherit"===e.styles.textColor&&(a.styles.textColor=f.style.color),"inherit"===e.styles.fontStyle&&(a.styles.fontStyle=f.style.fstyle))}});"function"!==typeof e.createdCell&&(e.createdCell= +function(a,b){var d=g.rowoptions[b.row.index+":"+b.column.dataKey];"undefined"!=typeof d&&"undefined"!=typeof d.style&&!0!==d.style.hidden&&(a.styles.halign=d.style.align,"inherit"===e.styles.fillColor&&(a.styles.fillColor=d.style.bcolor),"inherit"===e.styles.textColor&&(a.styles.textColor=d.style.color),"inherit"===e.styles.fontStyle&&(a.styles.fontStyle=d.style.fstyle))});"function"!==typeof e.drawHeaderCell&&(e.drawHeaderCell=function(a,b){var d=g.columns[b.column.dataKey];return(1!=d.style.hasOwnProperty("hidden")|| +!0!==d.style.hidden)&&0<=d.rowIndex?da(a,b,d):!1});"function"!==typeof e.drawCell&&(e.drawCell=function(a,b){var d=g.rowoptions[b.row.index+":"+b.column.dataKey];if(da(a,b,d)){g.doc.rect(a.x,a.y,a.width,a.height,a.styles.fillStyle);if("undefined"!=typeof d&&"undefined"!=typeof d.kids&&0g.dh||"undefined"==typeof g.dh)g.dh=e;g.dw=a.width/d.rect.width;fa(a,d.kids,g)}g.doc.autoTableText(a.text,a.textPos.x,a.textPos.y,{halign:a.styles.halign,valign:a.styles.valign})}return!1}); +g.headerrows=[];q=b(this).find("thead").find(a.theadSelector);q.each(function(){f=0;g.headerrows[d]=[];y(this,"th,td",d,q.length,function(a,b,e){var k=ga(a);k.title=x(a,b,e);k.key=f++;k.rowIndex=d;g.headerrows[d].push(k)});d++});0