jspdf-autotable
Version:
Generate pdf tables with javascript (jsPDF plugin)
10 lines • 25.9 kB
JavaScript
!function(t,e,n){"use strict";!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){n(1),n(50),n(53),n(54),t.exports=n(61)},function(t,e,r){var o=r(2),i=r(3),a=r(4),f=r(6),s=r(16),u=r(20).KEY,l=r(5),c=r(21),h=r(22),d=r(17),y=r(23),p=r(24),g=r(25),v=r(27),b=r(40),w=r(43),m=r(10),x=r(30),S=r(14),O=r(15),j=r(44),P=r(47),W=r(49),C=r(9),E=r(28),T=W.f,A=C.f,F=P.f,k=o.Symbol,R=o.JSON,z=R&&R.stringify,_="prototype",I=y("_hidden"),H=y("toPrimitive"),K={}.propertyIsEnumerable,M=c("symbol-registry"),N=c("symbols"),U=c("op-symbols"),Y=Object[_],D="function"==typeof k,B=o.QObject,J=!B||!B[_]||!B[_].findChild,q=a&&l(function(){return 7!=j(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=T(Y,e);r&&delete Y[e],A(t,e,n),r&&t!==Y&&A(Y,e,r)}:A,G=function(t){var e=N[t]=j(k[_]);return e._k=t,e},L=D&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},Q=function(t,e,n){return t===Y&&Q(U,e,n),m(t),e=S(e,!0),m(n),i(N,e)?(n.enumerable?(i(t,I)&&t[I][e]&&(t[I][e]=!1),n=j(n,{enumerable:O(0,!1)})):(i(t,I)||A(t,I,O(1,{})),t[I][e]=!0),q(t,e,n)):A(t,e,n)},V=function(t,e){m(t);for(var n,r=b(e=x(e)),o=0,i=r.length;i>o;)Q(t,n=r[o++],e[n]);return t},X=function(t,e){return e===n?j(t):V(j(t),e)},Z=function(t){var e=K.call(this,t=S(t,!0));return!(this===Y&&i(N,t)&&!i(U,t))&&(!(e||!i(this,t)||!i(N,t)||i(this,I)&&this[I][t])||e)},$=function(t,e){if(t=x(t),e=S(e,!0),t!==Y||!i(N,e)||i(U,e)){var n=T(t,e);return!n||!i(N,e)||i(t,I)&&t[I][e]||(n.enumerable=!0),n}},tt=function(t){for(var e,n=F(x(t)),r=[],o=0;n.length>o;)i(N,e=n[o++])||e==I||e==u||r.push(e);return r},et=function(t){for(var e,n=t===Y,r=F(n?U:x(t)),o=[],a=0;r.length>a;)!i(N,e=r[a++])||n&&!i(Y,e)||o.push(N[e]);return o};D||(k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=d(arguments.length>0?arguments[0]:n),e=function(n){this===Y&&e.call(U,n),i(this,I)&&i(this[I],t)&&(this[I][t]=!1),q(this,t,O(1,n))};return a&&J&&q(Y,t,{configurable:!0,set:e}),G(t)},s(k[_],"toString",function(){return this._k}),W.f=$,C.f=Q,r(48).f=P.f=tt,r(42).f=Z,r(41).f=et,a&&!r(26)&&s(Y,"propertyIsEnumerable",Z,!0),p.f=function(t){return G(y(t))}),f(f.G+f.W+f.F*!D,{Symbol:k});for(var nt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;nt.length>rt;)y(nt[rt++]);for(var nt=E(y.store),rt=0;nt.length>rt;)g(nt[rt++]);f(f.S+f.F*!D,"Symbol",{for:function(t){return i(M,t+="")?M[t]:M[t]=k(t)},keyFor:function(t){if(L(t))return v(M,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){J=!0},useSimple:function(){J=!1}}),f(f.S+f.F*!D,"Object",{create:X,defineProperty:Q,defineProperties:V,getOwnPropertyDescriptor:$,getOwnPropertyNames:tt,getOwnPropertySymbols:et}),R&&f(f.S+f.F*(!D||l(function(){var t=k();return"[null]"!=z([t])||"{}"!=z({a:t})||"{}"!=z(Object(t))})),"JSON",{stringify:function(t){if(t!==n&&!L(t)){for(var e,r,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);return e=o[1],"function"==typeof e&&(r=e),!r&&w(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!L(e))return e}),o[1]=e,z.apply(R,o)}}}),k[_][H]||r(8)(k[_],H,k[_].valueOf),h(k,"Symbol"),h(Math,"Math",!0),h(o.JSON,"JSON",!0)},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof e&&(e=r)},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){t.exports=!n(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var o=r(2),i=r(7),a=r(8),f=r(16),s=r(18),u="prototype",l=function(t,e,r){var c,h,d,y,p=t&l.F,g=t&l.G,v=t&l.S,b=t&l.P,w=t&l.B,m=g?o:v?o[e]||(o[e]={}):(o[e]||{})[u],x=g?i:i[e]||(i[e]={}),S=x[u]||(x[u]={});g&&(r=e);for(c in r)h=!p&&m&&m[c]!==n,d=(h?m:r)[c],y=w&&h?s(d,o):b&&"function"==typeof d?s(Function.call,d):d,m&&f(m,c,d,t&l.U),x[c]!=d&&a(x,c,y),b&&S[c]!=d&&(S[c]=d)};o.core=i,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,t.exports=l},function(e,n){var r=e.exports={version:"2.4.0"};"number"==typeof t&&(t=r)},function(t,e,n){var r=n(9),o=n(15);t.exports=n(4)?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(10),o=n(12),i=n(14),a=Object.defineProperty;e.f=n(4)?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(11);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){t.exports=!n(4)&&!n(5)(function(){return 7!=Object.defineProperty(n(13)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(11),o=n(2).document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},function(t,e,n){var r=n(11);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r=n(2),o=n(8),i=n(3),a=n(17)("src"),f="toString",s=Function[f],u=(""+s).split(f);n(7).inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,f){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(s&&(i(n,a)||o(n,a,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:f?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,f,function(){return"function"==typeof this&&this[a]||s.call(this)})},function(t,e){var r=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(t===n?"":t,")_",(++r+o).toString(36))}},function(t,e,r){var o=r(19);t.exports=function(t,e,r){if(o(t),e===n)return t;switch(r){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var r=n(17)("meta"),o=n(11),i=n(3),a=n(9).f,f=0,s=Object.isExtensible||function(){return!0},u=!n(5)(function(){return s(Object.preventExtensions({}))}),l=function(t){a(t,r,{value:{i:"O"+ ++f,w:{}}})},c=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!s(t))return"F";if(!e)return"E";l(t)}return t[r].i},h=function(t,e){if(!i(t,r)){if(!s(t))return!0;if(!e)return!1;l(t)}return t[r].w},d=function(t){return u&&y.NEED&&s(t)&&!i(t,r)&&l(t),t},y=t.exports={KEY:r,NEED:!1,fastKey:c,getWeak:h,onFreeze:d}},function(t,e,n){var r=n(2),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var r=n(9).f,o=n(3),i=n(23)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){var r=n(21)("wks"),o=n(17),i=n(2).Symbol,a="function"==typeof i,f=t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))};f.store=r},function(t,e,n){e.f=n(23)},function(t,e,n){var r=n(2),o=n(7),i=n(26),a=n(24),f=n(9).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||f(e,t,{value:a.f(t)})}},function(t,e){t.exports=!1},function(t,e,n){var r=n(28),o=n(30);t.exports=function(t,e){for(var n,i=o(t),a=r(i),f=a.length,s=0;f>s;)if(i[n=a[s++]]===e)return n}},function(t,e,n){var r=n(29),o=n(39);t.exports=Object.keys||function(t){return r(t,o)}},function(t,e,n){var r=n(3),o=n(30),i=n(34)(!1),a=n(38)("IE_PROTO");t.exports=function(t,e){var n,f=o(t),s=0,u=[];for(n in f)n!=a&&r(f,n)&&u.push(n);for(;e.length>s;)r(f,n=e[s++])&&(~i(u,n)||u.push(n));return u}},function(t,e,n){var r=n(31),o=n(33);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(32);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(t==n)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(30),o=n(35),i=n(37);t.exports=function(t){return function(e,n,a){var f,s=r(e),u=o(s.length),l=i(a,u);if(t&&n!=n){for(;u>l;)if(f=s[l++],f!=f)return!0}else for(;u>l;l++)if((t||l in s)&&s[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var r=n(36),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(36),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},function(t,e,n){var r=n(21)("keys"),o=n(17);t.exports=function(t){return r[t]||(r[t]=o(t))}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(28),o=n(41),i=n(42);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,f=n(t),s=i.f,u=0;f.length>u;)s.call(t,a=f[u++])&&e.push(a);return e}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(32);t.exports=Array.isArray||function(t){return"Array"==r(t)}},function(t,e,r){var o=r(10),i=r(45),a=r(39),f=r(38)("IE_PROTO"),s=function(){},u="prototype",l=function(){var t,e=r(13)("iframe"),n=a.length,o="<",i=">";for(e.style.display="none",r(46).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+i+"document.F=Object"+o+"/script"+i),t.close(),l=t.F;n--;)delete l[u][a[n]];return l()};t.exports=Object.create||function(t,e){var r;return null!==t?(s[u]=o(t),r=new s,s[u]=null,r[f]=t):r=l(),e===n?r:i(r,e)}},function(t,e,n){var r=n(9),o=n(10),i=n(28);t.exports=n(4)?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),f=a.length,s=0;f>s;)r.f(t,n=a[s++],e[n]);return t}},function(t,e,n){t.exports=n(2).document&&document.documentElement},function(t,e,n){var r=n(30),o=n(48).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],f=function(t){try{return o(t)}catch(t){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?f(t):o(r(t))}},function(t,e,n){var r=n(29),o=n(39).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},function(t,e,n){var r=n(42),o=n(15),i=n(30),a=n(14),f=n(3),s=n(12),u=Object.getOwnPropertyDescriptor;e.f=n(4)?u:function(t,e){if(t=i(t),e=a(e,!0),s)try{return u(t,e)}catch(t){}if(f(t,e))return o(!r.f.call(t,e),t[e])}},function(t,e,n){var r=n(6);r(r.S+r.F,"Object",{assign:n(51)})},function(t,e,n){var r=n(28),o=n(41),i=n(42),a=n(52),f=n(31),s=Object.assign;t.exports=!s||n(5)(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=s({},t)[n]||Object.keys(s({},e)).join("")!=r})?function(t,e){for(var n=a(t),s=arguments.length,u=1,l=o.f,c=i.f;s>u;)for(var h,d=f(arguments[u++]),y=l?r(d).concat(l(d)):r(d),p=y.length,g=0;p>g;)c.call(d,h=y[g++])&&(n[h]=d[h]);return n}:s},function(t,e,n){var r=n(33);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(6);r(r.S,"Array",{isArray:n(43)})},function(t,e,r){var o=r(55),i=r(56),a=r(57),f=r(30);t.exports=r(58)(Array,"Array",function(t,e){this._t=f(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=n,i(1)):"keys"==e?i(0,r):"values"==e?i(0,t[r]):i(0,[r,t[r]])},"values"),a.Arguments=a.Array,o("keys"),o("values"),o("entries")},function(t,e,r){var o=r(23)("unscopables"),i=Array.prototype;i[o]==n&&r(8)(i,o,{}),t.exports=function(t){i[o][t]=!0}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports={}},function(t,e,r){var o=r(26),i=r(6),a=r(16),f=r(8),s=r(3),u=r(57),l=r(59),c=r(22),h=r(60),d=r(23)("iterator"),y=!([].keys&&"next"in[].keys()),p="@@iterator",g="keys",v="values",b=function(){return this};t.exports=function(t,e,r,w,m,x,S){l(r,e,w);var O,j,P,W=function(t){if(!y&&t in A)return A[t];switch(t){case g:return function(){return new r(this,t)};case v:return function(){return new r(this,t)}}return function(){return new r(this,t)}},C=e+" Iterator",E=m==v,T=!1,A=t.prototype,F=A[d]||A[p]||m&&A[m],k=F||W(m),R=m?E?W("entries"):k:n,z="Array"==e?A.entries||F:F;if(z&&(P=h(z.call(new t)),P!==Object.prototype&&(c(P,C,!0),o||s(P,d)||f(P,d,b))),E&&F&&F.name!==v&&(T=!0,k=function(){return F.call(this)}),o&&!S||!y&&!T&&A[d]||f(A,d,k),u[e]=k,u[C]=b,m)if(O={values:E?k:W(v),keys:x?k:W(g),entries:R},S)for(j in O)j in A||a(A,j,O[j]);else i(i.P+i.F*(y||T),e,O);return O}},function(t,e,n){var r=n(44),o=n(15),i=n(22),a={};n(8)(a,n(23)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},function(t,e,n){var r=n(3),o=n(52),i=n(38)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){var r=n(6),o=n(62)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},function(t,e,n){var r=n(28),o=n(30),i=n(42).f;t.exports=function(t){return function(e){for(var n,a=o(e),f=r(a),s=f.length,u=0,l=[];s>u;)i.call(a,n=f[u++])&&l.push(t?[n,a[n]]:a[n]);return l}}}]),"undefined"!=typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd?define(function(){return t}):e.core=t}(1,1),/**
* jsPDF AutoTable plugin v2.0.29
* Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*
* @preserve
*/
function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("jspdf")):"function"==typeof define&&define.amd?define(["jspdf"],e):e(t.jsPDF)}(this,function(t){"use strict";function e(){return{theme:"striped",styles:{},headerStyles:{},bodyStyles:{},alternateRowStyles:{},columnStyles:{},startY:!1,margin:40,pageBreak:"auto",tableWidth:"auto",createdHeaderCell:function(t,e){},createdCell:function(t,e){},drawHeaderRow:function(t,e){},drawRow:function(t,e){},drawHeaderCell:function(t,e){},drawCell:function(t,e){},beforePageContent:function(t){},afterPageContent:function(t){}}}function n(){return{cellPadding:5,fontSize:10,font:"helvetica",lineColor:200,lineWidth:.1,fontStyle:"normal",overflow:"ellipsize",fillColor:255,textColor:20,halign:"left",valign:"top",fillStyle:"F",rowHeight:20,columnWidth:"auto"}}function r(t,e,n){t&&"object"===("undefined"==typeof t?"undefined":x(t))||console.error("The headers should be an object or array, is: "+("undefined"==typeof t?"undefined":x(t))),e&&"object"===("undefined"==typeof e?"undefined":x(e))||console.error("The data should be an object or array, is: "+("undefined"==typeof e?"undefined":x(e))),n&&"object"!==("undefined"==typeof n?"undefined":x(n))&&console.error("The data should be an object or array, is: "+("undefined"==typeof e?"undefined":x(e))),Array.prototype.forEach||console.error("The current browser does not support Array.prototype.forEach which is required for jsPDF-AutoTable. You can try polyfilling it by including this script https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Polyfill")}function o(t,e){m=new j;var n=/\r\n|\r|\n/g,r=new P(t);r.index=-1;var o=A.styles([T[w.theme].table,T[w.theme].header]);r.styles=Object.assign({},o,w.styles,w.headerStyles),t.forEach(function(t,e){"object"===("undefined"==typeof t?"undefined":x(t))&&(e="undefined"!=typeof t.dataKey?t.dataKey:t.key),"undefined"!=typeof t.width&&console.error("Use of deprecated option: column.width, use column.styles.columnWidth instead.");var o=new C(e);o.styles=w.columnStyles[o.dataKey]||{},m.columns.push(o);var i=new W;i.raw="object"===("undefined"==typeof t?"undefined":x(t))?t.title:t,i.styles=Object.assign({},r.styles),i.text=""+i.raw,i.contentWidth=2*i.styles.cellPadding+d(i.text,i.styles),i.text=i.text.split(n),r.cells[e]=i,w.createdHeaderCell(i,{column:o,row:r,settings:w})}),m.headerRow=r,e.forEach(function(t,e){var r=new P(t),o=e%2===0,i=A.styles([T[w.theme].table,o?T[w.theme].alternateRow:{}]),a=Object.assign({},w.styles,w.bodyStyles,o?w.alternateRowStyles:{});r.styles=Object.assign({},i,a),r.index=e,m.columns.forEach(function(e){var o=new W;o.raw=t[e.dataKey],o.styles=Object.assign({},r.styles,e.styles),o.text="undefined"!=typeof o.raw?""+o.raw:"",r.cells[e.dataKey]=o,w.createdCell(o,h({column:e,row:r})),o.contentWidth=2*o.styles.cellPadding+d(o.text,o.styles),o.text=o.text.split(n)}),m.rows.push(r)})}function i(t,e){var n=0;m.columns.forEach(function(t){t.contentWidth=m.headerRow.cells[t.dataKey].contentWidth,m.rows.forEach(function(e){var n=e.cells[t.dataKey].contentWidth;n>t.contentWidth&&(t.contentWidth=n)}),t.width=t.contentWidth,n+=t.contentWidth}),m.contentWidth=n;var r=e-w.margin.left-w.margin.right,o=r;"number"==typeof w.tableWidth?o=w.tableWidth:"wrap"===w.tableWidth&&(o=m.contentWidth),m.width=o<r?o:r;var i=[],f=0,s=m.width/m.columns.length,u=0;m.columns.forEach(function(t){var e=A.styles([T[w.theme].table,w.styles,t.styles]);"wrap"===e.columnWidth?t.width=t.contentWidth:"number"==typeof e.columnWidth?t.width=e.columnWidth:("auto"===e.columnWidth,t.contentWidth<=s&&m.contentWidth>m.width?t.width=t.contentWidth:(i.push(t),f+=t.contentWidth,t.width=0)),u+=t.width}),a(i,u,f,s),m.height=0;var l=m.rows.concat(m.headerRow);l.forEach(function(e,n){var r=0;m.columns.forEach(function(n){var o=e.cells[n.dataKey];c(o.styles);var i=n.width-2*o.styles.cellPadding;if("linebreak"===o.styles.overflow)try{o.text=t.splitTextToSize(o.text,i+1,{fontSize:o.styles.fontSize})}catch(e){if(!(e instanceof TypeError&&Array.isArray(o.text)))throw e;o.text=t.splitTextToSize(o.text.join(" "),i+1,{fontSize:o.styles.fontSize})}else"ellipsize"===o.styles.overflow?o.text=y(o.text,i,o.styles):"visible"===o.styles.overflow||("hidden"===o.styles.overflow?o.text=y(o.text,i,o.styles,""):"function"==typeof o.styles.overflow?o.text=o.styles.overflow(o.text,i):console.error("Unrecognized overflow type: "+o.styles.overflow));var a=Array.isArray(o.text)?o.text.length-1:0;a>r&&(r=a)}),e.heightStyle=e.styles.rowHeight,e.height=e.heightStyle+r*e.styles.fontSize*E,m.height+=e.height})}function a(t,e,n,r){for(var o=m.width-e-n,i=0;i<t.length;i++){var f=t[i],s=f.contentWidth/n,u=f.contentWidth+o*s<r;if(o<0&&u){t.splice(i,1),n-=f.contentWidth,f.width=r,e+=f.width,a(t,e,n,r);break}f.width=f.contentWidth+o*s}}function f(t){w.afterPageContent(h()),t(),m.pageCount++,g={x:w.margin.left,y:w.margin.top},w.beforePageContent(h()),w.drawHeaderRow(m.headerRow,h({row:m.headerRow}))!==!1&&l(m.headerRow,w.drawHeaderCell)}function s(t){var e=g.y+t+w.margin.bottom;return e>=b.height}function u(t){m.rows.forEach(function(e,n){if(s(e.height)){f(t)}e.y=g.y,w.drawRow(e,h({row:e}))!==!1&&l(e,w.drawCell)})}function l(t,e){g.x=w.margin.left;for(var n=0;n<m.columns.length;n++){var r=m.columns[n],o=t.cells[r.dataKey];if(o){c(o.styles),o.x=g.x,o.y=g.y,o.height=t.height,o.width=r.width,"top"===o.styles.valign?o.textPos.y=g.y+o.styles.cellPadding:"bottom"===o.styles.valign?o.textPos.y=g.y+t.height-o.styles.cellPadding:o.textPos.y=g.y+t.height/2,"right"===o.styles.halign?o.textPos.x=o.x+o.width-o.styles.cellPadding:"center"===o.styles.halign?o.textPos.x=o.x+o.width/2:o.textPos.x=o.x+o.styles.cellPadding;var i=h({column:r,row:t});e(o,i)!==!1&&(p.rect(o.x,o.y,o.width,o.height,o.styles.fillStyle),p.autoTableText(o.text,o.textPos.x,o.textPos.y,{halign:o.styles.halign,valign:o.styles.valign})),g.x+=o.width}}g.y+=t.height}function c(t){Object.keys(v).forEach(function(e){var n=t[e],r=v[e];"undefined"!=typeof n&&(n.constructor===Array?r.apply(this,n):r(n))})}function h(t){return Object.assign({pageCount:m.pageCount,settings:w,table:m,cursor:g},t||{})}function d(t,e){c(e);var n=p.getStringUnitWidth(t);return n*e.fontSize}function y(t,e,n,r){if(r="undefined"!=typeof r?r:"...",Array.isArray(t))return t.forEach(function(o,i){t[i]=y(o,e,n,r)}),t;if(e>=d(t,n))return t;for(;e<d(t+r,n)&&!(t.length<2);)t=t.substring(0,t.length-1);return t.trim()+r}t="default"in t?t.default:t;var p,g,v,b,w,m,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},S=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},O=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),j=function t(){S(this,t),this.height=0,this.width=0,this.contentWidth=0,this.rows=[],this.columns=[],this.headerRow=null,this.settings={},this.pageCount=1},P=function t(e){S(this,t),this.raw=e||{},this.index=0,this.styles={},this.cells={},this.height=0,this.y=0},W=function t(e){S(this,t),this.raw=e,this.styles={},this.text="",this.contentWidth=0,this.textPos={},this.height=0,this.width=0,this.x=0,this.y=0},C=function t(e){S(this,t),this.dataKey=e,this.options={},this.styles={},this.contentWidth=0,this.width=0,this.x=0},E=1.15,T={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal",fillStyle:"F"},header:{textColor:255,fillColor:[41,128,185],rowHeight:23,fontStyle:"bold"},body:{},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1,fillStyle:"DF"},header:{textColor:255,fillColor:[26,188,156],rowHeight:23,fillStyle:"F",fontStyle:"bold"},body:{},alternateRow:{}},plain:{header:{fontStyle:"bold"}}},A=function(){function t(){S(this,t)}return O(t,null,[{key:"initSettings",value:function(t){var n=Object.assign({},e(),t);"undefined"!=typeof n.extendWidth&&(n.tableWidth=n.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),"undefined"!=typeof n.margins&&("undefined"==typeof n.margin&&(n.margin=n.margins),console.error("Use of deprecated option: margins, use margin instead.")),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach(function(t){var e="string"==typeof t?t:t[0],r="string"==typeof t?t:t[1];"undefined"!=typeof n[e]&&("undefined"==typeof n.styles[r]&&(n.styles[r]=n[e]),console.error("Use of deprecated option: "+e+", use the style "+r+" instead."))});var r=n.margin;return n.margin={},"number"==typeof r.horizontal&&(r.right=r.horizontal,r.left=r.horizontal),"number"==typeof r.vertical&&(r.top=r.vertical,r.bottom=r.vertical),["top","right","bottom","left"].forEach(function(t,e){if("number"==typeof r)n.margin[t]=r;else{var o=Array.isArray(r)?e:t;n.margin[t]="number"==typeof r[o]?r[o]:40}}),n}},{key:"styles",value:function(t){return t.unshift(n()),t.unshift({}),Object.assign.apply(this,t)}}]),t}();t.API.autoTable=function(t,e,n){r(t,e,n),p=this,b=p.internal.pageSize,v={fillColor:p.setFillColor,textColor:p.setTextColor,fontStyle:p.setFontStyle,lineColor:p.setDrawColor,lineWidth:p.setLineWidth,font:p.setFont,fontSize:p.setFontSize},w=A.initSettings(n||{}),g={x:w.margin.left,y:w.startY===!1?w.margin.top:w.startY};var a={textColor:30,fontSize:p.internal.getFontSize(),fontStyle:p.internal.getFont().fontStyle};o(t,e),i(this,b.width);var f=m.rows[0]&&"auto"===w.pageBreak?m.rows[0].height:0,s=w.startY+w.margin.bottom+m.headerRow.height+f;return"avoid"===w.pageBreak&&(s+=m.height),("always"===w.pageBreak&&w.startY!==!1||w.startY!==!1&&s>b.height)&&(this.addPage(this.addPage),g.y=w.margin.top),c(a),w.beforePageContent(h()),w.drawHeaderRow(m.headerRow,h({row:m.headerRow}))!==!1&&l(m.headerRow,w.drawHeaderCell),c(a),u(this.addPage),w.afterPageContent(h()),c(a),this},t.API.autoTableEndPosY=function(){return"undefined"==typeof g||"undefined"==typeof g.y?0:g.y},t.API.autoTableHtmlToJson=function(t,e){e=e||!1;for(var n={},r=[],o=t.rows[0],i=0;i<o.cells.length;i++){var a=o.cells[i],f=window.getComputedStyle(a);(e||"none"!==f.display)&&(n[i]=a?a.textContent.trim():"")}for(var s=1;s<t.rows.length;s++){var u=t.rows[s],f=window.getComputedStyle(u);if(e||"none"!==f.display){var l=[],c=!0,h=!1,d=void 0;try{for(var y,p=Object.keys(n)[Symbol.iterator]();!(c=(y=p.next()).done);c=!0){var g=y.value,a=u.cells[g],v=a?a.textContent.trim():"";l.push(v)}}catch(t){h=!0,d=t}finally{try{!c&&p.return&&p.return()}finally{if(h)throw d}}r.push(l)}}return{columns:Object.values(n),rows:r,data:r}},t.API.autoTableAddPage=function(){f(p.addPage)},t.API.autoTableText=function(t,e,n,r){"number"==typeof e&&"number"==typeof n||console.error("The x and y parameters are required. Missing for the text: ",t);var o=this.internal.getFontSize()/this.internal.scaleFactor,i=E,a=/\r\n|\r|\n/g,f=null,s=1;if("middle"!==r.valign&&"bottom"!==r.valign&&"center"!==r.halign&&"right"!==r.halign||(f="string"==typeof t?t.split(a):t,s=f.length||1),n+=o*(2-i),"middle"===r.valign?n-=s/2*o:"bottom"===r.valign&&(n-=s*o),"center"===r.halign||"right"===r.halign){var u=o;if("center"===r.halign&&(u*=.5),s>=1){for(var l=0;l<f.length;l++)this.text(f[l],e-this.getStringUnitWidth(f[l])*u,n),n+=o;return p}e-=this.getStringUnitWidth(t)*u}return this.text(t,e,n),this}});