UNPKG

gentelella-rtl

Version:

Gentelella RTL Admin is a free to use Bootstrap admin template

3 lines 972 kB
/*! pdfmake v0.1.35, @license MIT, @link http://pdfmake.org */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){(function(e){t.exports=e.pdfMake=n(1)}).call(e,function(){return this}())},function(t,e,n){(function(e,r){"use strict";function i(t,e,n,r){this.docDefinition=t,this.tableLayouts=e||null,this.fonts=n||c,this.vfs=r}function a(){return!!Object.keys}var o=n(6),s=n(8).isFunction,l=n(304),u=l.saveAs,c={Roboto:{normal:"Roboto-Regular.ttf",bold:"Roboto-Medium.ttf",italics:"Roboto-Italic.ttf",bolditalics:"Roboto-MediumItalic.ttf"}};i.prototype._createDoc=function(t,n){t=t||{},this.tableLayouts&&(t.tableLayouts=this.tableLayouts);var r=new o(this.fonts);r.fs.bindFS(this.vfs);var i,a=r.createPdfKitDocument(this.docDefinition,t),s=[];a.on("readable",function(){for(var t;null!==(t=a.read(9007199254740991));)s.push(t)}),a.on("end",function(){i=e.concat(s),n(i,a._pdfMakePages)}),a.end()},i.prototype._getPages=function(t,e){if(!e)throw"_getPages is an async method and needs a callback argument";this._createDoc(t,function(t,n){e(n)})},i.prototype._bufferToBlob=function(t){var e;try{e=new Blob([t],{type:"application/pdf"})}catch(r){if("InvalidStateError"===r.name){var n=new Uint8Array(t);e=new Blob([n.buffer],{type:"application/pdf"})}}if(!e)throw"Could not generate blob";return e},i.prototype._openWindow=function(){var t=r.open("","_blank");if(null===t)throw"Open PDF in new window blocked by browser";return t},i.prototype._openPdf=function(t,e){e||(e=this._openWindow());try{this.getBlob(function(t){var n=r.URL||r.webkitURL,i=n.createObjectURL(t);e.location.href=i},t)}catch(t){throw e.close(),t}},i.prototype.open=function(t,e){t=t||{},t.autoPrint=!1,e=e||null,this._openPdf(t,e)},i.prototype.print=function(t,e){t=t||{},t.autoPrint=!0,e=e||null,this._openPdf(t,e)},i.prototype.download=function(t,e,n){s(t)&&(e=t,t=null),t=t||"file.pdf",this.getBlob(function(n){u(n,t),s(e)&&e()},n)},i.prototype.getBase64=function(t,e){if(!t)throw"getBase64 is an async method and needs a callback argument";this.getBuffer(function(e){t(e.toString("base64"))},e)},i.prototype.getDataUrl=function(t,e){if(!t)throw"getDataUrl is an async method and needs a callback argument";this.getBuffer(function(e){t("data:application/pdf;base64,"+e.toString("base64"))},e)},i.prototype.getBlob=function(t,e){if(!t)throw"getBlob is an async method and needs a callback argument";var n=this;this.getBuffer(function(e){var r=n._bufferToBlob(e);t(r)},e)},i.prototype.getBuffer=function(t,e){if(!t)throw"getBuffer is an async method and needs a callback argument";this._createDoc(e,function(e){t(e)})},t.exports={createPdf:function(t){if(!a())throw"Your browser does not provide the level of support needed";return new i(t,r.pdfMake.tableLayouts,r.pdfMake.fonts,r.pdfMake.vfs)}}}).call(e,n(2).Buffer,function(){return this}())},function(t,e,n){(function(t){"use strict";function r(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,e){if(r()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=a.prototype):(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,n){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(this,t)}return o(this,t,e,n)}function o(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?f(t,e,n,r):"string"==typeof e?c(t,e,n):d(t,e)}function s(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e,n,r){return s(e),e<=0?i(t,e):void 0!==n?"string"==typeof r?i(t,e).fill(n,r):i(t,e).fill(n):i(t,e)}function u(t,e){if(s(e),t=i(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function c(t,e,n){if("string"==typeof n&&""!==n||(n="utf8"),!a.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|y(e,n);t=i(t,r);var o=t.write(e,n);return o!==r&&(t=t.slice(0,o)),t}function h(t,e){var n=e.length<0?0:0|p(e.length);t=i(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function f(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),a.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=a.prototype):t=h(t,e),t}function d(t,e){if(a.isBuffer(e)){var n=0|p(e.length);return t=i(t,n),0===t.length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||X(e.length)?i(t,0):h(t,e);if("Buffer"===e.type&&Q(e.data))return h(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function p(t){if(t>=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),a.alloc(+t)}function y(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return j(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Z(t).length;default:if(r)return j(t).length;e=(""+e).toLowerCase(),r=!0}}function v(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return L(this,e,n);case"utf8":case"utf-8":return E(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return O(this,e,n);case"base64":return P(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=a.from(e,r)),a.isBuffer(e))return 0===e.length?-1:w(t,e,n,r,i);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):w(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,n,r,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var o=1,s=t.length,l=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,n/=2}var u;if(i){var c=-1;for(u=n;u<s;u++)if(a(t,u)===a(e,-1===c?0:u-c)){if(-1===c&&(c=u),u-c+1===l)return c*o}else-1!==c&&(u-=u-c),c=-1}else for(n+l>s&&(n=s-l),u=n;u>=0;u--){for(var h=!0,f=0;f<l;f++)if(a(t,u+f)!==a(e,f)){h=!1;break}if(h)return u}return-1}function x(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(e.substr(2*o,2),16);if(isNaN(s))return o;t[n+o]=s}return o}function S(t,e,n,r){return Y(j(e,t.length-n),t,n,r)}function k(t,e,n,r){return Y(H(e),t,n,r)}function _(t,e,n,r){return k(t,e,n,r)}function C(t,e,n,r){return Y(Z(e),t,n,r)}function A(t,e,n,r){return Y(q(e,t.length-n),t,n,r)}function P(t,e,n){return 0===e&&n===t.length?K.fromByteArray(t):K.fromByteArray(t.slice(e,n))}function E(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=n){var l,u,c,h;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128==(192&l)&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],u=t[i+2],128==(192&l)&&128==(192&u)&&(h=(15&a)<<12|(63&l)<<6|63&u)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],u=t[i+2],c=t[i+3],128==(192&l)&&128==(192&u)&&128==(192&c)&&(h=(15&a)<<18|(63&l)<<12|(63&u)<<6|63&c)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),i+=s}return I(r)}function I(t){var e=t.length;if(e<=$)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=$));return n}function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function O(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function L(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=e;a<n;++a)i+=V(t[a]);return i}function B(t,e,n){for(var r=t.slice(e,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function M(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,r,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function F(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-n,2);i<a;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function D(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-n,4);i<a;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function z(t,e,n,r,i,a){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(t,e,n,r,i){return i||z(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),J.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,i){return i||z(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),J.write(t,e,n,r,52,8),n+8}function W(t){if(t=G(t).replace(tt,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function G(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function V(t){return t<16?"0"+t.toString(16):t.toString(16)}function j(t,e){e=e||1/0;for(var n,r=t.length,i=null,a=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function H(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function q(t,e){for(var n,r,i,a=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function Z(t){return K.toByteArray(W(t))}function Y(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function X(t){return t!==t}var K=n(3),J=n(4),Q=n(5);e.Buffer=a,e.SlowBuffer=g,e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=r(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,n){return o(null,t,e,n)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,n){return l(null,t,e,n)},a.allocUnsafe=function(t){return u(null,t)},a.allocUnsafeSlow=function(t){return u(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Q(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=a.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},a.byteLength=y,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)b(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)b(this,e,e+3),b(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)b(this,e,e+7),b(this,e+1,e+6),b(this,e+2,e+5),b(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?E(this,0,t):v.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,n,r,i){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,s=n-e,l=Math.min(o,s),u=this.slice(r,i),c=t.slice(e,n),h=0;h<l;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},a.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},a.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},a.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return x(this,t,e,n);case"utf8":case"utf-8":return S(this,t,e,n);case"ascii":return k(this,t,e,n);case"latin1":case"binary":return _(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;a.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(t,e),r.__proto__=a.prototype;else{var i=e-t;r=new a(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+t]}return r},a.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,a=0;++a<e&&(i*=256);)r+=this[t+a]*i;return r},a.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},a.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=this[t],i=1,a=0;++a<e&&(i*=256);)r+=this[t+a]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*e)),r},a.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var r=e,i=1,a=this[t+--r];r>0&&(i*=256);)a+=this[t+--r]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},a.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),J.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),J.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),J.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),J.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){R(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=1,a=0;for(this[e]=255&t;++a<n&&(i*=256);)this[e+a]=t/i&255;return e+n},a.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){R(this,t,e,n,Math.pow(2,8*n)-1,0)}var i=n-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+n},a.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):D(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);R(this,t,e,n,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a<n&&(o*=256);)t<0&&0===s&&0!==this[e+a-1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+n},a.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);R(this,t,e,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+n},a.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):F(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):F(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):D(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):D(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,n){return N(this,t,e,!0,n)},a.prototype.writeFloatBE=function(t,e,n){return N(this,t,e,!1,n)},a.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},a.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},a.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},a.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=a.isBuffer(t)?t:j(new a(t,r).toString()),l=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%l]}return this};var tt=/[^+\/0-9A-Za-z-_]/g}).call(e,function(){return this}())},function(t,e){"use strict";function n(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function r(t){return 3*t.length/4-n(t)}function i(t){var e,r,i,a,o,s=t.length;a=n(t),o=new c(3*s/4-a),r=a>0?s-4:s;var l=0;for(e=0;e<r;e+=4)i=u[t.charCodeAt(e)]<<18|u[t.charCodeAt(e+1)]<<12|u[t.charCodeAt(e+2)]<<6|u[t.charCodeAt(e+3)],o[l++]=i>>16&255,o[l++]=i>>8&255,o[l++]=255&i;return 2===a?(i=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,o[l++]=255&i):1===a&&(i=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,o[l++]=i>>8&255,o[l++]=255&i),o}function a(t){return l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}function o(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16)+(t[o+1]<<8)+t[o+2],i.push(a(r));return i.join("")}function s(t){for(var e,n=t.length,r=n%3,i="",a=[],s=0,u=n-r;s<u;s+=16383)a.push(o(t,s,s+16383>u?u:s+16383));return 1===r?(e=t[n-1],i+=l[e>>2],i+=l[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=l[e>>10],i+=l[e>>4&63],i+=l[e<<2&63],i+="="),a.push(i),a.join("")}e.byteLength=r,e.toByteArray=i,e.fromByteArray=s;for(var l=[],u=[],c="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,d=h.length;f<d;++f)l[f]=h[f],u[h.charCodeAt(f)]=f;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var a,o,s=8*i-r-1,l=(1<<s)-1,u=l>>1,c=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+t[e+h],h+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=r;c>0;o=256*o+t[e+h],h+=f,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),a-=u}return(d?-1:1)*o*Math.pow(2,a-r)},e.write=function(t,e,n,r,i,a){var o,s,l,u=8*a-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),e+=o+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;t[n+d]=255&o,d+=p,o/=256,u-=8);t[n+d-p]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";function r(t){this.fontDescriptors=t}function i(t,e){if(e.info.Producer="pdfmake",e.info.Creator="pdfmake",t.info)for(var n in t.info){var r=t.info[n];r&&(n=function(t){var e=["Title","Author","Subject","Keywords","Creator","Producer","CreationDate","ModDate","Trapped"],n=t.charAt(0).toUpperCase()+t.slice(1);return-1!==e.indexOf(n)?n:t.replace(/\s+/g,"")}(n),e.info[n]=r)}}function a(t,e){function n(t){return C(t.item.getHeight)?t.item.getHeight():t.item._height?t.item._height:0}var r=s(e||40),i=r.top+r.bottom;return t.forEach(function(t){t.items.forEach(function(t){i+=n(t)})}),i}function o(t,e){t&&"auto"===t.height&&(t.height=1/0);var n=u(t||"A4");return function(t){return!!A(t)&&("portrait"===(t=t.toLowerCase())&&n.width>n.height||"landscape"===t&&n.width<n.height)}(e)&&(n={width:n.height,height:n.width}),n.orientation=n.width>n.height?"landscape":"portrait",n}function s(t){if(!t)return null;if(P(t))t={left:t,right:t,top:t,bottom:t};else if(I(t))if(2===t.length)t={left:t[0],top:t[1],right:t[0],bottom:t[1]};else{if(4!==t.length)throw"Invalid pageMargins definition";t={left:t[0],top:t[1],right:t[2],bottom:t[3]}}return t}function l(t){t.registerTableLayouts({noBorders:{hLineWidth:function(t){return 0},vLineWidth:function(t){return 0},paddingLeft:function(t){return t&&4||0},paddingRight:function(t,e){return t<e.table.widths.length-1?4:0}},headerLineOnly:{hLineWidth:function(t,e){return 0===t||t===e.table.body.length?0:t===e.table.headerRows?2:0},vLineWidth:function(t){return 0},paddingLeft:function(t){return 0===t?0:8},paddingRight:function(t,e){return t===e.table.widths.length-1?0:8}},lightHorizontalLines:{hLineWidth:function(t,e){return 0===t||t===e.table.body.length?0:t===e.table.headerRows?2:1},vLineWidth:function(t){return 0},hLineColor:function(t){return 1===t?"black":"#aaa"},paddingLeft:function(t){return 0===t?0:8},paddingRight:function(t,e){return t===e.table.widths.length-1?0:8}}})}function u(t){if(A(t)){var e=x[t.toUpperCase()];if(!e)throw"Page size "+t+" not recognized";return{width:e[0],height:e[1]}}return t}function c(t,e){var n=e.options.size[0]>e.options.size[1]?"landscape":"portrait";if(t.pageSize.orientation!==n){var r=e.options.size[0],i=e.options.size[1];e.options.size=[i,r]}}function h(t,e,n,r){n._pdfMakePages=t,n.addPage();var i=0;r&&t.forEach(function(t){i+=t.items.length});var a=0;r=r||function(){};for(var o=0;o<t.length;o++){o>0&&(c(t[o],n),n.addPage(n.options));for(var s=t[o],l=0,u=s.items.length;l<u;l++){var h=s.items[l];switch(h.type){case"vector":p(h.item,n);break;case"line":f(h.item,h.item.x,h.item.y,n);break;case"image":g(h.item,h.item.x,h.item.y,n);break;case"beginClip":y(h.item,n);break;case"endClip":v(n)}a++,r(a/i)}s.watermark&&d(s,n)}}function f(t,e,n,r){if(t._pageNodeRef){var i,a,o=new _(null),s=t._pageNodeRef.positions[0].pageNumber.toString();switch(t.inlines[0].text=s,t.inlines[0].linkToPage=s,i=o.widthOfString(t.inlines[0].text,t.inlines[0].font,t.inlines[0].fontSize,t.inlines[0].characterSpacing,t.inlines[0].fontFeatures),a=t.inlines[0].width-i,t.inlines[0].width=i,t.inlines[0].alignment){case"right":t.inlines[0].x+=a;break;case"center":t.inlines[0].x+=a/2}}e=e||0,n=n||0;var l=t.getHeight(),u=t.getAscenderHeight(),c=l-u;k.drawBackground(t,e,n,r);for(var h=0,f=t.inlines.length;h<f;h++){var d=t.inlines[h],p=l-d.font.ascender/1e3*d.fontSize-c,g={lineBreak:!1,textWidth:d.width,characterSpacing:d.characterSpacing,wordCount:1,link:d.link};if(d.fontFeatures&&(g.features=d.fontFeatures),r.fill(d.color||"black"),r._font=d.font,r.fontSize(d.fontSize),r.text(d.text,e+d.x,n+p,g),d.linkToPage){r.ref({Type:"Action",S:"GoTo",D:[d.linkToPage,0,0]}).end();r.annotate(e+d.x,n+p,d.width,d.height,{Subtype:"Link",Dest:[d.linkToPage-1,"XYZ",null,null,null]})}}k.drawDecorations(t,e,n,r)}function d(t,e){var n=t.watermark;e.fill(n.color),e.opacity(n.opacity),e.save();var r=-180*Math.atan2(e.page.height,e.page.width)/Math.PI;e.rotate(r,{origin:[e.page.width/2,e.page.height/2]});var i=e.page.width/2-n.size.size.width/2,a=e.page.height/2-n.size.size.height/4;e._font=n.font,e.fontSize(n.size.fontSize),e.text(n.text,i,a,{lineBreak:!1}),e.restore()}function p(t,e){switch(e.lineWidth(t.lineWidth||1),t.dash?e.dash(t.dash.length,{space:t.dash.space||t.dash.length,phase:t.dash.phase||0}):e.undash(),e.lineJoin(t.lineJoin||"miter"),e.lineCap(t.lineCap||"butt"),t.type){case"ellipse":e.ellipse(t.x,t.y,t.r1,t.r2);break;case"rect":if(t.r?e.roundedRect(t.x,t.y,t.w,t.h,t.r):e.rect(t.x,t.y,t.w,t.h),t.linearGradient){for(var n=e.linearGradient(t.x,t.y,t.x+t.w,t.y),r=1/(t.linearGradient.length-1),i=0;i<t.linearGradient.length;i++)n.stop(i*r,t.linearGradient[i]);t.color=n}break;case"line":e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2);break;case"polyline":if(0===t.points.length)break;e.moveTo(t.points[0].x,t.points[0].y);for(var i=1,a=t.points.length;i<a;i++)e.lineTo(t.points[i].x,t.points[i].y);if(t.points.length>1){var o=t.points[0],s=t.points[t.points.length-1];(t.closePath||o.x===s.x&&o.y===s.y)&&e.closePath()}break;case"path":e.path(t.d)}t.color&&t.lineColor?(e.fillColor(t.color,t.fillOpacity||1),e.strokeColor(t.lineColor,t.strokeOpacity||1),e.fillAndStroke()):t.color?(e.fillColor(t.color,t.fillOpacity||1),e.fill()):(e.strokeColor(t.lineColor||"black",t.strokeOpacity||1),e.stroke())}function g(t,e,n,r){r.image(t.image,t.x,t.y,{width:t._width,height:t._height}),t.link&&r.link(t.x,t.y,t._width,t._height,t.link)}function y(t,e){e.save(),e.addContent(t.x+" "+t.y+" "+t.width+" "+t.height+" re"),e.clip()}function v(t){t.restore()}var b=n(7),m=n(9),w=n(28),x=n(301),S=n(302),k=n(303),_=n(13),C=n(8).isFunction,A=n(8).isString,P=n(8).isNumber,E=n(8).isBoolean,I=n(8).isArray;r.prototype.createPdfKitDocument=function(t,e){e=e||{};var n=o(t.pageSize,t.pageOrientation),r=!E(t.compress)||t.compress;this.pdfKitDoc=new w({size:[n.width,n.height],autoFirstPage:!1,compress:r}),i(t,this.pdfKitDoc),this.fontProvider=new b(this.fontDescriptors,this.pdfKitDoc),t.images=t.images||{};var u=new m(n,s(t.pageMargins||40),new S(this.pdfKitDoc,t.images));l(u),e.tableLayouts&&u.registerTableLayouts(e.tableLayouts);var c=u.layoutDocument(t.content,this.fontProvider,t.styles||{},t.defaultStyle||{fontSize:12,font:"Roboto"},t.background,t.header,t.footer,t.images,t.watermark,t.pageBreakBefore),f=t.maxPagesNumber||-1;if(P(f)&&f>-1&&(c=c.slice(0,f)),n.height===1/0){var d=a(c,t.pageMargins);this.pdfKitDoc.options.size=[n.width,d]}if(h(c,this.fontProvider,this.pdfKitDoc,e.progressCallback),e.autoPrint){var p=this.pdfKitDoc.ref({Type:"Action",S:"Named",N:"Print"});this.pdfKitDoc._root.data.OpenAction=p, p.end()}return this.pdfKitDoc},t.exports=r,r.prototype.fs=n(54)},function(t,e,n){"use strict";function r(t,e){var n="normal";return t&&e?n="bolditalics":t?n="bold":e&&(n="italics"),n}function i(t,e){this.fonts={},this.pdfKitDoc=e,this.fontCache={};for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];this.fonts[n]={normal:r.normal,bold:r.bold,italics:r.italics,bolditalics:r.bolditalics}}}var a=n(8).isArray;i.prototype.provideFont=function(t,e,n){var i=r(e,n);if(!this.fonts[t]||!this.fonts[t][i])throw new Error("Font '"+t+"' in style '"+i+"' is not defined in the font section of the document definition.");if(this.fontCache[t]=this.fontCache[t]||{},!this.fontCache[t][i]){var o=this.fonts[t][i];a(o)||(o=[o]),this.fontCache[t][i]=this.pdfKitDoc.font.apply(this.pdfKitDoc,o)._font}return this.fontCache[t][i]},t.exports=i},function(t,e){"use strict";function n(t){return"string"==typeof t||t instanceof String}function r(t){return"number"==typeof t||t instanceof Number}function i(t){return"boolean"==typeof t}function a(t){return Array.isArray(t)}function o(t){return"function"==typeof t}function s(t){return null!==t&&"object"==typeof t}function l(){for(var t={},e=0,n=arguments.length;e<n;e++){var r=arguments[e];if(r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}function u(t,e,n){switch(t.type){case"ellipse":case"rect":t.x+=e,t.y+=n;break;case"line":t.x1+=e,t.x2+=e,t.y1+=n,t.y2+=n;break;case"polyline":for(var r=0,i=t.points.length;r<i;r++)t.points[r].x+=e,t.points[r].y+=n}}function c(t,e){return"font"===t?"font":e}t.exports={isString:n,isNumber:r,isBoolean:i,isArray:a,isFunction:o,isObject:s,pack:l,fontStringify:c,offsetVector:u}},function(t,e,n){"use strict";function r(t,e){e.forEach(function(e){t.push(e)})}function i(t,e,n){this.pageSize=t,this.pageMargins=e,this.tracker=new o,this.imageMeasure=n,this.tableLayouts={}}function a(t){var e=t.x,n=t.y;t.positions=[],g(t.canvas)&&t.canvas.forEach(function(t){var e=t.x,n=t.y,r=t.x1,i=t.y1,a=t.x2,o=t.y2;t.resetXY=function(){t.x=e,t.y=n,t.x1=r,t.y1=i,t.x2=a,t.y2=o}}),t.resetXY=function(){t.x=e,t.y=n,g(t.canvas)&&t.canvas.forEach(function(t){t.resetXY()})}}var o=n(10),s=n(11),l=n(12),u=n(23),c=n(24),h=n(21),f=n(27),d=n(26),p=n(8).isString,g=n(8).isArray,y=n(8).pack,v=n(8).offsetVector,b=n(8).fontStringify,m=n(8).isFunction,w=n(13),x=n(20);i.prototype.registerTableLayouts=function(t){this.tableLayouts=y(this.tableLayouts,t)},i.prototype.layoutDocument=function(t,e,n,r,i,a,o,u,c,h){this.docPreprocessor=new s,this.docMeasure=new l(e,n,r,this.imageMeasure,this.tableLayouts,u);for(var f=this.tryLayoutDocument(t,e,n,r,i,a,o,u,c);function(t,e){return!!m(h)&&(t=t.filter(function(t){return t.positions.length>0}),t.forEach(function(t){var n={};["id","text","ul","ol","table","image","qr","canvas","columns","headlineLevel","style","pageBreak","pageOrientation","width","height"].forEach(function(e){void 0!==t[e]&&(n[e]=t[e])}),n.startPosition=t.positions[0],n.pageNumbers=t.positions.map(function(t){return t.pageNumber}).filter(function(t,e,n){return n.indexOf(t)===e}),n.pages=e.length,n.stack=g(t.stack),t.nodeInfo=n}),t.some(function(t,e,n){if("before"!==t.pageBreak&&!t.pageBreakCalculated){t.pageBreakCalculated=!0;var r=t.nodeInfo.pageNumbers[0],i=n.slice(e+1).filter(function(t){return t.nodeInfo.pageNumbers.indexOf(r)>-1}),a=n.slice(e+1).filter(function(t){return t.nodeInfo.pageNumbers.indexOf(r+1)>-1}),o=n.slice(0,e).filter(function(t){return t.nodeInfo.pageNumbers.indexOf(r)>-1});if(h(t.nodeInfo,i.map(function(t){return t.nodeInfo}),a.map(function(t){return t.nodeInfo}),o.map(function(t){return t.nodeInfo})))return t.pageBreak="before",!0}}))}(f.linearNodeList,f.pages);)!function(t){t.linearNodeList.forEach(function(t){t.resetXY()})}(f),f=this.tryLayoutDocument(t,e,n,r,i,a,o,u,c);return f.pages},i.prototype.tryLayoutDocument=function(t,e,n,r,i,a,o,s,l,h){this.linearNodeList=[],t=this.docPreprocessor.preprocessDocument(t),t=this.docMeasure.measureDocument(t),this.writer=new c(new u(this.pageSize,this.pageMargins),this.tracker);var f=this;return this.writer.context().tracker.startTracking("pageAdded",function(){f.addBackground(i)}),this.addBackground(i),this.processNode(t),this.addHeadersAndFooters(a,o),null!=l&&this.addWatermark(l,e,r),{pages:this.writer.context().pages,linearNodeList:this.linearNodeList}},i.prototype.addBackground=function(t){var e=m(t)?t:function(){return t},n=e(this.writer.context().page+1);if(n){var r=this.writer.context().getCurrentPage().pageSize;this.writer.beginUnbreakableBlock(r.width,r.height),n=this.docPreprocessor.preprocessDocument(n),this.processNode(this.docMeasure.measureDocument(n)),this.writer.commitUnbreakableBlock(0,0),this.writer.context().hasBackground=!0}},i.prototype.addStaticRepeatable=function(t,e){this.addDynamicRepeatable(function(){return JSON.parse(JSON.stringify(t))},e)},i.prototype.addDynamicRepeatable=function(t,e){for(var n=this.writer.context().pages,r=0,i=n.length;r<i;r++){this.writer.context().page=r;var a=t(r+1,i,this.writer.context().pages[r].pageSize);if(a){var o=e(this.writer.context().getCurrentPage().pageSize,this.pageMargins);this.writer.beginUnbreakableBlock(o.width,o.height),a=this.docPreprocessor.preprocessDocument(a),this.processNode(this.docMeasure.measureDocument(a)),this.writer.commitUnbreakableBlock(o.x,o.y)}}},i.prototype.addHeadersAndFooters=function(t,e){var n=function(t,e){return{x:0,y:0,width:t.width,height:e.top}},r=function(t,e){return{x:0,y:t.height-e.bottom,width:t.width,height:e.bottom}};m(t)?this.addDynamicRepeatable(t,n):t&&this.addStaticRepeatable(t,n),m(e)?this.addDynamicRepeatable(e,r):e&&this.addStaticRepeatable(e,r)},i.prototype.addWatermark=function(t,e,n){if(p(t)&&(t={text:t}),t.text){t.font=t.font||n.font||"Roboto",t.color=t.color||"black",t.opacity=t.opacity||.6,t.bold=t.bold||!1,t.italics=t.italics||!1;for(var r={text:t.text,font:e.provideFont(t.font,t.bold,t.italics),size:function(t,e,n){for(var r,i=t.width,a=t.height,o=.8*Math.sqrt(i*i+a*a),s=new w(n),l=new x(null,{font:e.font,bold:e.bold,italics:e.italics}),u=0,c=1e3,h=(u+c)/2;Math.abs(u-c)>1;)l.push({fontSize:h}),r=s.sizeOfString(e.text,l),r.width>o?(c=h,h=(u+c)/2):r.width<o&&(u=h,h=(u+c)/2),l.pop();return{size:r,fontSize:h}}(this.pageSize,t,e),color:t.color,opacity:t.opacity},i=this.writer.context().pages,a=0,o=i.length;a<o;a++)i[a].watermark=r}},i.prototype.processNode=function(t){var e=this;this.linearNodeList.push(t),a(t),function(n){var r=t._margin;"before"===t.pageBreak&&e.writer.moveToNextPage(t.pageOrientation),r&&(e.writer.context().moveDown(r[1]),e.writer.context().addMargin(r[0],r[2])),n(),r&&(e.writer.context().addMargin(-r[0],-r[2]),e.writer.context().moveDown(r[3])),"after"===t.pageBreak&&e.writer.moveToNextPage(t.pageOrientation)}(function(){var n=t.unbreakable;n&&e.writer.beginUnbreakableBlock();var r=t.absolutePosition;r&&(e.writer.context().beginDetachedBlock(),e.writer.context().moveTo(r.x||0,r.y||0));var i=t.relativePosition;if(i&&(e.writer.context().beginDetachedBlock(),e.writer.context().moveTo((i.x||0)+e.writer.context().x,(i.y||0)+e.writer.context().y)),t.stack)e.processVerticalContainer(t);else if(t.columns)e.processColumns(t);else if(t.ul)e.processList(!1,t);else if(t.ol)e.processList(!0,t);else if(t.table)e.processTable(t);else if(void 0!==t.text)e.processLeaf(t);else if(t.toc)e.processToc(t);else if(t.image)e.processImage(t);else if(t.canvas)e.processCanvas(t);else if(t.qr)e.processQr(t);else if(!t._span)throw"Unrecognized document structure: "+JSON.stringify(t,b);(r||i)&&e.writer.context().endDetachedBlock(),n&&e.writer.commitUnbreakableBlock()})},i.prototype.processVerticalContainer=function(t){var e=this;t.stack.forEach(function(n){e.processNode(n),r(t.positions,n.positions)})},i.prototype.processColumns=function(t){var e=t.columns,n=this.writer.context().availableWidth,i=function(t){if(!t)return null;var n=[];n.push(0);for(var r=e.length-1;r>0;r--)n.push(t);return n}(t._gap);i&&(n-=(i.length-1)*t._gap),h.buildColumnWidths(e,n);var a=this.processRow(e,e,i);r(t.positions,a.positions)},i.prototype.processRow=function(t,e,n,i,a,o){function s(t){for(var e,n=0,r=h.length;n<r;n++){var i=h[n];if(i.prevPage===t.prevPage){e=i;break}}e||(e=t,h.push(e)),e.prevY=Math.max(e.prevY,t.prevY),e.y=Math.min(e.y,t.y)}function l(t){return n&&n.length>t?n[t]:0}function u(t,e){if(t.rowSpan&&t.rowSpan>1){var n=a+t.rowSpan-1;if(n>=i.length)throw"Row span for column "+e+" (with indexes starting from 0) exceeded row count";return i[n][e]}return null}var c=this,h=[],f=[];return this.tracker.auto("pageChanged",s,function(){e=e||t,c.writer.context().beginColumnGroup();for(var i=0,a=t.length;i<a;i++){var s=t[i],h=e[i]._calcWidth,d=l(i);if(s.colSpan&&s.colSpan>1)for(var p=1;p<s.colSpan;p++)h+=e[++i]._calcWidth+n[i];c.writer.context().beginColumn(h,d,u(s,i)),s._span?s._columnEndingContext&&c.writer.context().markEnding(s):(c.processNode(s),r(f,s.positions))}c.writer.context().completeColumnGroup(o)}),{pageBreaks:h,positions:f}},i.prototype.processList=function(t,e){function n(t){if(s){var e=s;if(s=null,e.canvas){var n=e.canvas[0];v(n,-e._minWidth,0),i.writer.addVector(n)}else if(e._inlines){var r=new d(i.pageSize.width);r.addInline(e._inlines[0]),r.x=-e._minWidth,r.y=t.getAscenderHeight()-r.getAscenderHeight(),i.writer.addLine(r,!0)}}}var i=this,a=t?e.ol:e.ul,o=e._gapSize;this.writer.context().addMargin(o.width);var s;this.tracker.auto("lineAdded",n,function(){a.forEach(function(t){s=t.listMarker,i.processNode(t),r(e.positions,t.positions)})}),this.writer.context().addMargin(-o.width)},i.prototype.processTable=function(t){var e=new f(t);e.beginTable(this.writer);for(var n=t.table.heights,i=0,a=t.table.body.length;i<a;i++){e.beginRow(i,this.writer);var o;o=m(n)?n(i):g(n)?n[i]:n,"auto"===o&&(o=void 0);var s=this.processRow(t.table.body[i],t.table.widths,t._offsets.offsets,t.table.body,i,o);r(t.positions,s.positions),e.endRow(i,this.writer,s.pageBreaks)}e.endTable(this.writer)},i.prototype.processLeaf=function(t){var e=this.buildNextLine(t),n=e?e.getHeight():0,r=t.maxHeight||-1;for(t._tocItemRef&&(e._pageNodeRef=t._tocItemRef),t._pageRef&&(e._pageNodeRef=t._pageRef._nodeRef);e&&(-1===r||n<r);){var i=this.writer.addLine(e);t.positions.push(i),e=this.buildNextLine(t),e&&(n+=e.getHeight())}},i.prototype.processToc=function(t){t.toc.title&&this.processNode(t.toc.title),this.processNode(t.toc._table)},i.prototype.buildNextLine=function(t){if(!t._inlines||0===t._inlines.length)return null;for(var e=new d(this.writer.context().availableWidth),n=new w(null);t._inlines&&t._inlines.length>0&&e.hasEnoughSpaceForInline(t._inlines[0]);){var r=t._inlines.shift();if(!r.noWrap&&r.text.length>1&&r.width>e.maxWidth){var i=r.width/r.text.length,a=Math.floor(e.maxWidth/i);if(a<1&&(a=1),a<r.text.length){var o=function(t){var e=t.constructor();for(var n in t)e[n]=t[n];return e}(r);o.text=r.text.substr(a),r.text=r.text.substr(0,a),o.width=n.widthOfString(o.text,o.font,o.fontSize,o.characterSpacing,o.fontFeatures),r.width=n.widthOfString(r.text,r.font,r.fontSize,r.characterSpacing,r.fontFeatures),t._inlines.unshift(o)}}e.addInline(r)}return e.lastLineInParagraph=0===t._inlines.length,e},i.prototype.processImage=function(t){var e=this.writer.addImage(t);t.positions.push(e)},i.prototype.processCanvas=function(t){var e=t._minHeight;void 0===t.absolutePosition&&this.writer.context().availableHeight<e&&this.writer.moveToNextPage(),this.writer.alignCanvas(t),t.canvas.forEach(function(e){var n=this.writer.addVector(e);t.positions.push(n)},this),this.writer.context().moveDown(e)},i.prototype.processQr=function(t){var e=this.writer.addQr(t);t.positions.push(e)},t.exports=i},function(t,e){"use strict";function n(){this.events={}}n.prototype.startTracking=function(t,e){var n=this.events[t]||(this.events[t]=[]);n.indexOf(e)<0&&n.push(e)},n.prototype.stopTracking=function(t,e){var n=this.events[t];if(n){var r=n.indexOf(e);r>=0&&n.splice(r,1)}},n.prototype.emit=function(t){var e=Array.prototype.slice.call(arguments,1),n=this.events[t];n&&n.forEach(function(t){t.apply(this,e)})},n.prototype.auto=function(t,e,n){this.startTracking(t,e),n(),this.stopTracking(t,e)},t.exports=n},function(t,e,n){"use strict";function r(){}var i=n(8).isString,a=n(8).isNumber,o=n(8).isBoolean,s=n(8).isArray,l=n(8).fontStringify;r.prototype.preprocessDocument=function(t){return this.tocs=[],this.nodeReferences=[],this.preprocessNode(t)},r.prototype.preprocessNode=function(t){if(s(t)?t={stack:t}:i(t)?t={text:t}:a(t)||o(t)?t={text:t.toString()}:null===t?t={text:""}:0===Object.keys(t).length&&(t={text:""}),t.columns)return this.preprocessColumns(t);if(t.stack)return this.preprocessVerticalContainer(t);if(t.ul)return this.preprocessList(t);if(t.ol)return this.preprocessList(t);if(t.table)return this.preprocessTable(t);if(void 0!==t.text)return this.preprocessText(t);if(t.toc)return this.preprocessToc(t);if(t.image)return this.preprocessImage(t);if(t.canvas)return this.preprocessCanvas(t);if(t.qr)return this.preprocessQr(t);if(t.pageReference||t.textReference)return this.preprocessText(t);throw"Unrecognized document structure: "+JSON.stringify(t,l)},r.prototype.preprocessColumns=function(t){for(var e=t.columns,n=0,r=e.length;n<r;n++)e[n]=this.preprocessNode(e[n]);return t},r.prototype.preprocessVerticalContainer=function(t){for(var e=t.stack,n=0,r=e.length;n<r;n++)e[n]=this.preprocessNode(e[n]);return t},r.prototype.preprocessList=function(t){for(var e=t.ul||t.ol,n=0,r=e.length;n<r;n++)e[n]=this.preprocessNode(e[n]);return t},r.prototype.preprocessTable=function(t){var e,n,r,i;for(e=0,r=t.table.body[0].length;e<r;e++)for(n=0,i=t.table.body.length;n<i;n++){var a=t.table.body[n],o=a[e];void 0!==o&&(null===o&&(o=""),o._span||(a[e]=this.preprocessNode(o)))}return t},r.prototype.preprocessText=function(t){if(t.tocItem){s(t.tocItem)||(t.tocItem=[t.tocItem]);for(var e=0,n=t.tocItem.length;e<n;e++){i(t.tocItem[e])||(t.tocItem[e]="_default_");var r=t.tocItem[e];this.tocs[r]||(this.tocs[r]={toc:{_items:[],_pseudo:!0}}),this.tocs[r].toc._items.push(t)}}if(t.id)if(this.nodeReferences[t.id]){if(!this.nodeReferences[t.id]._pseudo)throw"Node id '"+t.id+"' already exists";this.nodeReferences[t.id]._nodeRef=t,this.nodeReferences[t.id]._pseudo=!1}else this.nodeReferences[t.id]={_nodeRef:t};return t.pageReference&&(this.nodeReferences[t.pageReference]||(this.nodeReferences[t.pageReference]={_nodeRef:{},_pseudo:!0}),t.text="00000",t._pageRef=this.nodeReferences[t.pageReference]),t.textReference&&(this.nodeReferences[t.textReference]||(this.nodeReferences[t.textReference]={_nodeRef:{},_pseudo:!0}),t.text="",t._textRef=this.nodeReferences[t.textReference]),t.text&&t.text.text&&(t.text=[this.preprocessNode(t.text)]),t},r.prototype.preprocessToc=function(t){if(t.toc.id||(t.toc.id="_default_"),t.toc.title=t.toc.title?this.preprocessNode(t.toc.title):null,t.toc._items=[],this.tocs[t.toc.id]){if(!this.tocs[t.toc.id].toc._pseudo)throw"TOC '"+t.toc.id+"' already exists";t.toc._items=this.tocs[t.toc.id].toc._items}return this.tocs[t.toc.id]=t,t},r.prototype.preprocessImage=function(t){return t},r.prototype.preprocessCanvas=function(t){return t},r.prototype.preprocessQr=function(t){return t},t.exports=r},function(t,e,n){"use strict";function r(t,e,n,r,o,s){this.textTools=new i(t),this.styleStack=new a(e,n),this.imageMeasure=r,this.tableLayouts=o,this.images=s,this.autoImageIndex=1}var i=n(13),a=n(20),o=n(21),s=n(8).isString,l=n(8).isNumber,u=n(8).isObject,c=n(8).isArray,h=n(8).fontStringify,f=n(8).pack,d=n(22);r.prototype.measureDocument=function(t){return this.measureNode(t)},r.prototype.measureNode=function(t){function e(t){var e=t._margin;return e&&(t._minWidth+=e[0]+e[2],t._maxWidth+=e[0]+e[2]),t}function n(){function e(t,e){return t.marginLeft||t.marginTop||t.marginRight||t.marginBottom?[t.marginLeft||e[0]||0,t.marginTop||e[1]||0,t.marginRight||e[2]||0,t.marginBottom||e[3]||0]:e}function n(t){return l(t)?t=[t,t,t,t]:c(t)&&2===t.length&&(t=[t[0],t[1],t[0],t[1]]),t}var i=[void 0,void 0,void 0,void 0];if(t.style){var a=c(t.style)?t.style:[t.style],o=function(t){for(var e={},n=t.length-1;n>=0;n--){var i=t[n],a=r.styleStack.styleDictionary[i];for(var o in a)a.hasOwnProperty(o)&&(e[o]=a[o])}return e}(a);o&&(i=e(o,i)),o.margin&&(i=n(o.margin))}return i=e(t,i),t.margin&&(i=n(t.margin)),void 0===i[0]&&void 0===i[1]&&void 0===i[2]&&void 0===i[3]?null:i}var r=this;return this.styleStack.auto(t,function(){if(t._margin=n(),t.columns)return e(r.measureColumns(t));if(t.stack)return e(r.measureVerticalContainer(t));if(t.ul)return e(r.measureUnorderedList(t));if(t.ol)return e(r.measureOrderedList(t));if(t.table)return e(r.measureTable(t));if(void 0!==t.text)return e(r.measureLeaf(t));if(t.toc)return e(r.measureToc(t));if(t.image)return e(r.measureImage(t));if(t.canvas)return e(r.measureCanvas(t));if(t.qr)return e(r.measureQr(t));throw"Unrecognized document structure: "+JSON.stringify(t,h)})},r.prototype.convertIfBase64Image=function(t){if(/^data:image\/(jpeg|jpg|png);base64,/.test(t.image)){var e="$$pdfmake$$"+this.autoImageIndex++;this.images[e]=t.image,t.image=e}},r.prototype.measureImage=function(t){this.images&&this.convertIfBase64Image(t);var e=this.imageMeasure.measureImage(t.image);if(t.fit){var n=e.width/e.height>t.fit[0]/t.fit[1]?t.fit[0]/e.width:t.fit[1]/e.height;t._width=t._minWidth=t._maxWidth=e.width*n,t._height=e.height*n}else t._width=t._minWidth=t._maxWidth=t.width||e.width,t._height=t.height||e.height*t._width/e.width,l(t.maxWidth)&&t.maxWidth<t._width&&(t._width=t._minWidth=t._maxWidth=t.maxWidth,t._height=t._width*e.height/e.width),l(t.maxHeight)&&t.maxHeight<t._height&&(t._height=t.maxHeight,t._width=t._minWidth=t._maxWidth=t._height*e.width/e.height),l(t.minWidth)&&t.minWidth>t._width&&(t._width=t._minWidth=t._maxWidth=t.minWidth,t._height=t._width*e.height/e.width),l(t.minHeight)&&t.minHeight>t._height&&(t._height=t.minHeight,t._width=t._minWidth=t._maxWidth=t._height*e.width/e.height);return t._alignment=this.style