jspdf
Version:
PDF Document creation from JavaScript
86 lines (85 loc) • 419 kB
JavaScript
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 3.0.2 Built on 2025-08-26T11:48:30.929Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
* 2015-2021 yWorks GmbH, http://www.yworks.com
* 2015-2021 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
* 2010 Aaron Spike, https://github.com/acspike
* 2012 Willow Systems Corporation, https://github.com/willowsystems
* 2012 Pablo Hess, https://github.com/pablohess
* 2012 Florian Jenett, https://github.com/fjenett
* 2013 Warren Weckesser, https://github.com/warrenweckesser
* 2013 Youssef Beddad, https://github.com/lifof
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2013 Stefan Slonevskiy, https://github.com/stefslon
* 2013 Jeremy Morel, https://github.com/jmorel
* 2013 Christoph Hartmann, https://github.com/chris-rock
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Makes, https://github.com/dollaruw
* 2014 Diego Casorran, https://github.com/diegocr
* 2014 Steven Spungin, https://github.com/Flamenco
* 2014 Kenneth Glassey, https://github.com/Gavvers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributor(s):
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
* kim3er, mfo, alnorth, Flamenco
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).jspdf={})}(this,function(t){function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function n(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,s,o=[],h=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;h=!1}else for(;!(h=(r=a.call(n)).done)&&(o.push(r.value),o.length!==e);h=!0);}catch(t){l=!0,i=t}finally{try{if(!h&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var i=function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this}();function a(){i.console&&"function"==typeof i.console.log&&i.console.log.apply(i.console,arguments)}var s={log:a,warn:function(t){i.console&&("function"==typeof i.console.warn?i.console.warn.apply(i.console,arguments):a.call(null,arguments))},error:function(t){i.console&&("function"==typeof i.console.error?i.console.error.apply(i.console,arguments):a(t))}};function o(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){u(r.response,e,n)},r.onerror=function(){s.error("could not download file")},r.send()}function h(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch(n){}return e.status>=200&&e.status<=299}function l(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(n){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var u=i.saveAs||("object"!==("undefined"==typeof window?"undefined":r(window))||window!==i?function(){}:"undefined"!=typeof HTMLAnchorElement&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=i.URL||i.webkitURL,a=document.createElement("a");e=e||t.name||"download",a.download=e,a.rel="noopener","string"==typeof t?(a.href=t,a.origin!==location.origin?h(a.href)?o(t,e,n):l(a,a.target="_blank"):l(a)):(a.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){l(a)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download","string"==typeof t)if(h(t))o(t,e,n);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){l(i)})}else navigator.msSaveOrOpenBlob(function(t,e){return void 0===e?e={autoBom:!1}:"object"!==r(e)&&(s.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t}(t,n),e)}:function(t,e,n,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof t)return o(t,e,n);var s="application/octet-stream"===t.type,h=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&h)&&"object"===("undefined"==typeof FileReader?"undefined":r(FileReader))){var u=new FileReader;u.onloadend=function(){var t=u.result;t=l?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=t:location=t,a=null},u.readAsDataURL(t)}else{var c=i.URL||i.webkitURL,f=c.createObjectURL(t);a?a.location=f:location.href=f,a=null,setTimeout(function(){c.revokeObjectURL(f)},4e4)}});
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/function c(t){var e;t=t||"",this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<n.length;r++){var i=n[r].re,a=n[r].process,s=i.exec(t);s&&(e=a(s),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),n=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==n.length&&(n="0"+n),"#"+t+e+n}}var f=i.atob.bind(i),d=i.btoa.bind(i);
/**
* @license
* Joseph Myers does not specify a particular license for his work.
*
* Author: Joseph Myers
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
*
* Modified by: Owen Leong
*/
function p(t,e){var n=t[0],r=t[1],i=t[2],a=t[3];n=m(n,r,i,a,e[0],7,-680876936),a=m(a,n,r,i,e[1],12,-389564586),i=m(i,a,n,r,e[2],17,606105819),r=m(r,i,a,n,e[3],22,-1044525330),n=m(n,r,i,a,e[4],7,-176418897),a=m(a,n,r,i,e[5],12,1200080426),i=m(i,a,n,r,e[6],17,-1473231341),r=m(r,i,a,n,e[7],22,-45705983),n=m(n,r,i,a,e[8],7,1770035416),a=m(a,n,r,i,e[9],12,-1958414417),i=m(i,a,n,r,e[10],17,-42063),r=m(r,i,a,n,e[11],22,-1990404162),n=m(n,r,i,a,e[12],7,1804603682),a=m(a,n,r,i,e[13],12,-40341101),i=m(i,a,n,r,e[14],17,-1502002290),n=b(n,r=m(r,i,a,n,e[15],22,1236535329),i,a,e[1],5,-165796510),a=b(a,n,r,i,e[6],9,-1069501632),i=b(i,a,n,r,e[11],14,643717713),r=b(r,i,a,n,e[0],20,-373897302),n=b(n,r,i,a,e[5],5,-701558691),a=b(a,n,r,i,e[10],9,38016083),i=b(i,a,n,r,e[15],14,-660478335),r=b(r,i,a,n,e[4],20,-405537848),n=b(n,r,i,a,e[9],5,568446438),a=b(a,n,r,i,e[14],9,-1019803690),i=b(i,a,n,r,e[3],14,-187363961),r=b(r,i,a,n,e[8],20,1163531501),n=b(n,r,i,a,e[13],5,-1444681467),a=b(a,n,r,i,e[2],9,-51403784),i=b(i,a,n,r,e[7],14,1735328473),n=v(n,r=b(r,i,a,n,e[12],20,-1926607734),i,a,e[5],4,-378558),a=v(a,n,r,i,e[8],11,-2022574463),i=v(i,a,n,r,e[11],16,1839030562),r=v(r,i,a,n,e[14],23,-35309556),n=v(n,r,i,a,e[1],4,-1530992060),a=v(a,n,r,i,e[4],11,1272893353),i=v(i,a,n,r,e[7],16,-155497632),r=v(r,i,a,n,e[10],23,-1094730640),n=v(n,r,i,a,e[13],4,681279174),a=v(a,n,r,i,e[0],11,-358537222),i=v(i,a,n,r,e[3],16,-722521979),r=v(r,i,a,n,e[6],23,76029189),n=v(n,r,i,a,e[9],4,-640364487),a=v(a,n,r,i,e[12],11,-421815835),i=v(i,a,n,r,e[15],16,530742520),n=w(n,r=v(r,i,a,n,e[2],23,-995338651),i,a,e[0],6,-198630844),a=w(a,n,r,i,e[7],10,1126891415),i=w(i,a,n,r,e[14],15,-1416354905),r=w(r,i,a,n,e[5],21,-57434055),n=w(n,r,i,a,e[12],6,1700485571),a=w(a,n,r,i,e[3],10,-1894986606),i=w(i,a,n,r,e[10],15,-1051523),r=w(r,i,a,n,e[1],21,-2054922799),n=w(n,r,i,a,e[8],6,1873313359),a=w(a,n,r,i,e[15],10,-30611744),i=w(i,a,n,r,e[6],15,-1560198380),r=w(r,i,a,n,e[13],21,1309151649),n=w(n,r,i,a,e[4],6,-145523070),a=w(a,n,r,i,e[11],10,-1120210379),i=w(i,a,n,r,e[2],15,718787259),r=w(r,i,a,n,e[9],21,-343485551),t[0]=k(n,t[0]),t[1]=k(r,t[1]),t[2]=k(i,t[2]),t[3]=k(a,t[3])}function g(t,e,n,r,i,a){return e=k(k(e,t),k(r,a)),k(e<<i|e>>>32-i,n)}function m(t,e,n,r,i,a,s){return g(e&n|~e&r,t,e,i,a,s)}function b(t,e,n,r,i,a,s){return g(e&r|n&~r,t,e,i,a,s)}function v(t,e,n,r,i,a,s){return g(e^n^r,t,e,i,a,s)}function w(t,e,n,r,i,a,s){return g(n^(e|~r),t,e,i,a,s)}function y(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)p(r,_(t.substring(e-64,e)));t=t.substring(e-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(i[e>>2]|=128<<(e%4<<3),e>55)for(p(r,i),e=0;e<16;e++)i[e]=0;return i[14]=8*n,p(r,i),r}function _(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}var x="0123456789abcdef".split("");function A(t){for(var e="",n=0;n<4;n++)e+=x[t>>8*n+4&15]+x[t>>8*n&15];return e}function L(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function N(t){return function(t){return t.map(L).join("")}(y(t))}var S="5d41402abc4b2a76b9719d911017c592"!=function(t){for(var e=0;e<t.length;e++)t[e]=A(t[e]);return t.join("")}(y("hello"));function k(t,e){if(S){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}
/**
* @license
* FPDF is released under a permissive license: there is no usage restriction.
* You may embed it freely in your application (commercial or not), with or
* without modifications.
*
* Reference: http://www.fpdf.org/en/script/script37.php
*/function P(t,e){var n,r,i,a;if(t!==n){for(var s=(i=t,a=1+(256/t.length|0),new Array(a+1).join(i)),o=[],h=0;h<256;h++)o[h]=h;var l=0;for(h=0;h<256;h++){var u=o[h];l=(l+u+s.charCodeAt(h))%256,o[h]=o[l],o[l]=u}n=t,r=o}else o=r;var c=e.length,f=0,d=0,p="";for(h=0;h<c;h++)d=(d+(u=o[f=(f+1)%256]))%256,o[f]=o[d],o[d]=u,s=o[(o[f]+o[d])%256],p+=String.fromCharCode(e.charCodeAt(h)^s);return p}
/**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
* Author: Owen Leong (@owenl131)
* Date: 15 Oct 2020
* References:
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
* http://www.fpdf.org/en/script/script37.php
*/var F={print:4,modify:8,copy:16,"annot-forms":32};function I(t,e,n,r){this.v=1,this.r=2;var i=192;t.forEach(function(t){if(void 0!==F.perm)throw new Error("Invalid permission: "+t);i+=F[t]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(e+this.padding).substr(0,32),s=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,s),this.P=-(1+(255^i)),this.encryptionKey=N(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=P(this.encryptionKey,this.padding)}function C(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var i=t.charCodeAt(r);e+=i<33||35===i||37===i||40===i||41===i||47===i||60===i||62===i||91===i||93===i||123===i||125===i||i>126?"#"+("0"+i.toString(16)).slice(-2):t[r]}return e}function j(t){if("object"!==r(t))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,n,r){if(r=r||!1,"string"!=typeof t||"function"!=typeof n||"boolean"!=typeof r)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(t)||(e[t]={});var i=Math.random().toString(35);return e[t][i]=[n,!!r],i},this.unsubscribe=function(t){for(var n in e)if(e[n][t])return delete e[n][t],0===Object.keys(e[n]).length&&delete e[n],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var o in e[n]){var h=e[n][o];try{h[0].apply(t,r)}catch(l){i.console&&s.error("jsPDF PubSub Error",l.message,l)}h[1]&&a.push(o)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function E(t){if(!(this instanceof E))return new E(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function O(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function B(t,e,n,r,i){if(!(this instanceof B))return new B(t,e,n,r,i);this.type="axial"===t?2:3,this.coords=e,this.colors=n,O.call(this,r,i)}function M(t,e,n,r,i){if(!(this instanceof M))return new M(t,e,n,r,i);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,O.call(this,r,i)}function R(t){var e,n="string"==typeof arguments[0]?arguments[0]:"p",a=arguments[1],o=arguments[2],h=arguments[3],l=[],f=1,p=16,g="S",m=null;"object"===r(t=t||{})&&(n=t.orientation,a=t.unit||a,o=t.format||o,h=t.compress||t.compressPdf||h,null!==(m=t.encryption||null)&&(m.userPassword=m.userPassword||"",m.ownerPassword=m.ownerPassword||"",m.userPermissions=m.userPermissions||[]),f="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(e=t.precision),void 0!==t.floatPrecision&&(p=t.floatPrecision),g=t.defaultPathOperation||"S"),l=t.filters||(!0===h?["FlateEncode"]:l),a=a||"mm",n=(""+(n||"P")).toLowerCase();var b=t.putOnlyUsedFonts||!1,v={},w={internal:{},__private__:{}};w.__private__.PubSub=j;var y="1.3",_=w.__private__.getPdfVersion=function(){return y};w.__private__.setPdfVersion=function(t){y=t};var x={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};w.__private__.getPageFormats=function(){return x};var A=w.__private__.getPageFormat=function(t){return x[t]};o=o||"a4";var L="compat",N="advanced",S=L;function k(){this.saveGraphicsState(),ut(new Wt(Nt,0,0,-Nt,0,xn()*Nt).toString()+" cm"),this.setFontSize(this.getFontSize()/Nt),g="n",S=N}function P(){this.restoreGraphicsState(),g="S",S=L}var F=w.__private__.combineFontStyleAndFontWeight=function(t,e){if("bold"==t&&"normal"==e||"bold"==t&&400==e||"normal"==t&&"italic"==e||"bold"==t&&"italic"==e)throw new Error("Invalid Combination of fontweight and fontstyle");return e&&(t=400==e||"normal"===e?"italic"===t?"italic":"normal":700!=e&&"bold"!==e||"normal"!==t?(700==e?"bold":e)+""+t:"bold"),t};w.advancedAPI=function(t){var e=S===L;return e&&k.call(this),"function"!=typeof t||(t(this),e&&P.call(this)),this},w.compatAPI=function(t){var e=S===N;return e&&P.call(this),"function"!=typeof t||(t(this),e&&k.call(this)),this},w.isAdvancedAPI=function(){return S===N};var O,T=function(t){if(S!==N)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},q=w.roundToPrecision=w.__private__.roundToPrecision=function(t,n){var r=e||n;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};O=w.hpf=w.__private__.hpf="number"==typeof p?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,p)}:"smart"===p?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return q(t,16)};var D=w.f2=w.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return q(t,2)},z=w.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return q(t,3)},U=w.scale=w.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return S===L?t*Nt:S===N?t:void 0},H=function(t){return U(function(t){return S===L?xn()-t:S===N?t:void 0}(t))};w.__private__.setPrecision=w.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(e=parseInt(t,10))};var W,V="00000000000000000000000000000000",G=w.__private__.getFileId=function(){return V},Y=w.__private__.setFileId=function(t){return V=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():V.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),null!==m&&(Ce=new I(m.userPermissions,m.userPassword,m.ownerPassword,V)),V};w.setFileId=function(t){return Y(t),this},w.getFileId=function(){return G()};var Z=w.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),n=e<0?"+":"-",r=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[n,Q(r),"'",Q(i),"'"].join("");return["D:",t.getFullYear(),Q(t.getMonth()+1),Q(t.getDate()),Q(t.getHours()),Q(t.getMinutes()),Q(t.getSeconds()),a].join("")},J=w.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),n=parseInt(t.substr(6,2),10)-1,r=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),s=parseInt(t.substr(14,2),10);return new Date(e,n,r,i,a,s,0)},X=w.__private__.setCreationDate=function(t){var e;if(void 0===t&&(t=new Date),t instanceof Date)e=Z(t);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(t))throw new Error("Invalid argument passed to jsPDF.setCreationDate");e=t}return W=e},K=w.__private__.getCreationDate=function(t){var e=W;return"jsDate"===t&&(e=J(W)),e};w.setCreationDate=function(t){return X(t),this},w.getCreationDate=function(t){return K(t)};var $,Q=w.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},tt=w.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},et=0,nt=[],rt=[],it=0,at=[],st=[],ot=!1,ht=rt;w.__private__.setCustomOutputDestination=function(t){ot=!0,ht=t};var lt=function(t){ot||(ht=t)};w.__private__.resetCustomOutputDestination=function(){ot=!1,ht=rt};var ut=w.__private__.out=function(t){return t=t.toString(),it+=t.length+1,ht.push(t),ht},ct=w.__private__.write=function(t){return ut(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},ft=w.__private__.getArrayBuffer=function(t){for(var e=t.length,n=new ArrayBuffer(e),r=new Uint8Array(n);e--;)r[e]=t.charCodeAt(e);return n},dt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];w.__private__.getStandardFonts=function(){return dt};var pt=t.fontSize||16;w.__private__.setFontSize=w.setFontSize=function(t){return pt=S===N?t/Nt:t,this};var gt,mt=w.__private__.getFontSize=w.getFontSize=function(){return S===L?pt:pt*Nt},bt=t.R2L||!1;w.__private__.setR2L=w.setR2L=function(t){return bt=t,this},w.__private__.getR2L=w.getR2L=function(){return bt};var vt,wt=w.__private__.setZoomMode=function(t){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(t))gt=t;else if(isNaN(t)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(t))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+t+'" is not recognized.');gt=t}else gt=parseInt(t,10)};w.__private__.getZoomMode=function(){return gt};var yt,_t=w.__private__.setPageMode=function(t){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(t))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+t+'" is not recognized.');vt=t};w.__private__.getPageMode=function(){return vt};var xt=w.__private__.setLayoutMode=function(t){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(t))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+t+'" is not recognized.');yt=t};w.__private__.getLayoutMode=function(){return yt},w.__private__.setDisplayMode=w.setDisplayMode=function(t,e,n){return wt(t),xt(e),_t(n),this};var At={title:"",subject:"",author:"",keywords:"",creator:""};w.__private__.getDocumentProperty=function(t){if(-1===Object.keys(At).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return At[t]},w.__private__.getDocumentProperties=function(){return At},w.__private__.setDocumentProperties=w.setProperties=w.setDocumentProperties=function(t){for(var e in At)At.hasOwnProperty(e)&&t[e]&&(At[e]=t[e]);return this},w.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(At).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return At[t]=e};var Lt,Nt,St,kt,Pt,Ft={},It={},Ct=[],jt={},Et={},Ot={},Bt={},Mt=null,Rt=0,Tt=[],qt=new j(w),Dt=t.hotfixes||[],zt={},Ut={},Ht=[],Wt=function t(e,n,r,i,a,s){if(!(this instanceof t))return new t(e,n,r,i,a,s);isNaN(e)&&(e=1),isNaN(n)&&(n=0),isNaN(r)&&(r=0),isNaN(i)&&(i=1),isNaN(a)&&(a=0),isNaN(s)&&(s=0),this._matrix=[e,n,r,i,a,s]};Object.defineProperty(Wt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Wt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Wt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Wt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Wt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Wt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Wt.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Wt.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Wt.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Wt.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Wt.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Wt.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Wt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Wt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Wt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Wt.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Wt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(O).join(t)},Wt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,n=t.sx*this.shy+t.shy*this.sy,r=t.shx*this.sx+t.sy*this.shx,i=t.shx*this.shy+t.sy*this.sy,a=t.tx*this.sx+t.ty*this.shx+this.tx,s=t.tx*this.shy+t.ty*this.sy+this.ty;return new Wt(e,n,r,i,a,s)},Wt.prototype.decompose=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,s=Math.sqrt(t*t+e*e),o=(t/=s)*n+(e/=s)*r;n-=t*o,r-=e*o;var h=Math.sqrt(n*n+r*r);return o/=h,t*(r/=h)<e*(n/=h)&&(t=-t,e=-e,o=-o,s=-s),{scale:new Wt(s,0,0,h,0,0),translate:new Wt(1,0,0,1,i,a),rotate:new Wt(t,e,-e,t,0,0),skew:new Wt(1,0,o,1,0,0)}},Wt.prototype.toString=function(t){return this.join(" ")},Wt.prototype.inversed=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty,s=1/(t*r-e*n),o=r*s,h=-e*s,l=-n*s,u=t*s;return new Wt(o,h,l,u,-o*i-l*a,-h*i-u*a)},Wt.prototype.applyToPoint=function(t){var e=t.x*this.sx+t.y*this.shx+this.tx,n=t.x*this.shy+t.y*this.sy+this.ty;return new gn(e,n)},Wt.prototype.applyToRectangle=function(t){var e=this.applyToPoint(t),n=this.applyToPoint(new gn(t.x+t.w,t.y+t.h));return new mn(e.x,e.y,n.x-e.x,n.y-e.y)},Wt.prototype.clone=function(){var t=this.sx,e=this.shy,n=this.shx,r=this.sy,i=this.tx,a=this.ty;return new Wt(t,e,n,r,i,a)},w.Matrix=Wt;var Vt=w.matrixMult=function(t,e){return e.multiply(t)},Gt=new Wt(1,0,0,1,0,0);w.unitMatrix=w.identityMatrix=Gt;var Yt=function(t,e){if(!Et[t]){var n=(e instanceof B?"Sh":"P")+(Object.keys(jt).length+1).toString(10);e.id=n,Et[t]=n,jt[n]=e,qt.publish("addPattern",e)}};w.ShadingPattern=B,w.TilingPattern=M,w.addShadingPattern=function(t,e){return T("addShadingPattern()"),Yt(t,e),this},w.beginTilingPattern=function(t){T("beginTilingPattern()"),vn(t.boundingBox[0],t.boundingBox[1],t.boundingBox[2]-t.boundingBox[0],t.boundingBox[3]-t.boundingBox[1],t.matrix)},w.endTilingPattern=function(t,e){T("endTilingPattern()"),e.stream=st[$].join("\n"),Yt(t,e),qt.publish("endTilingPattern",e),Ht.pop().restore()};var Zt,Jt=w.__private__.newObject=function(){var t=Xt();return Kt(t,!0),t},Xt=w.__private__.newObjectDeferred=function(){return et++,nt[et]=function(){return it},et},Kt=function(t,e){return e="boolean"==typeof e&&e,nt[t]=it,e&&ut(t+" 0 obj"),t},$t=w.__private__.newAdditionalObject=function(){var t={objId:Xt(),content:""};return at.push(t),t},Qt=Xt(),te=Xt(),ee=w.__private__.decodeColorString=function(t){var e=t.split(" ");if(2!==e.length||"g"!==e[1]&&"G"!==e[1])5!==e.length||"k"!==e[4]&&"K"!==e[4]||(e=[(1-e[0])*(1-e[3]),(1-e[1])*(1-e[3]),(1-e[2])*(1-e[3]),"r"]);else{var n=parseFloat(e[0]);e=[n,n,n,"r"]}for(var r="#",i=0;i<3;i++)r+=("0"+Math.floor(255*parseFloat(e[i])).toString(16)).slice(-2);return r},ne=w.__private__.encodeColorString=function(t){var e;"string"==typeof t&&(t={ch1:t});var n=t.ch1,i=t.ch2,a=t.ch3,s=t.ch4,o="draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof n&&"#"!==n.charAt(0)){var h=new c(n);if(h.ok)n=h.toHex();else if(!/^\d*\.?\d*$/.test(n))throw new Error('Invalid color "'+n+'" passed to jsPDF.encodeColorString.')}if("string"==typeof n&&/^#[0-9A-Fa-f]{3}$/.test(n)&&(n="#"+n[1]+n[1]+n[2]+n[2]+n[3]+n[3]),"string"==typeof n&&/^#[0-9A-Fa-f]{6}$/.test(n)){var l=parseInt(n.substr(1),16);n=l>>16&255,i=l>>8&255,a=255&l}if(void 0===i||void 0===s&&n===i&&i===a)e="string"==typeof n?n+" "+o[0]:2===t.precision?D(n/255)+" "+o[0]:z(n/255)+" "+o[0];else if(void 0===s||"object"===r(s)){if(s&&!isNaN(s.a)&&0===s.a)return["1.","1.","1.",o[1]].join(" ");e="string"==typeof n?[n,i,a,o[1]].join(" "):2===t.precision?[D(n/255),D(i/255),D(a/255),o[1]].join(" "):[z(n/255),z(i/255),z(a/255),o[1]].join(" ")}else e="string"==typeof n?[n,i,a,s,o[2]].join(" "):2===t.precision?[D(n),D(i),D(a),D(s),o[2]].join(" "):[z(n),z(i),z(a),z(s),o[2]].join(" ");return e},re=w.__private__.getFilters=function(){return l},ie=w.__private__.putStream=function(t){var e=(t=t||{}).data||"",n=t.filters||re(),r=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,s=t.objectId,o=function(t){return t};if(null!==m&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==m&&(o=Ce.encryptor(s,0));var h={};!0===n&&(n=["FlateEncode"]);var l=t.additionalKeyValues||[],u=(h=void 0!==R.API.processDataByFilters?R.API.processDataByFilters(e,n):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(r)?r.join(" "):r.toString());if(0!==h.data.length&&(l.push({key:"Length",value:h.data.length}),!0===i&&l.push({key:"Length1",value:a})),0!=u.length)if(u.split("/").length-1==1)l.push({key:"Filter",value:u});else{l.push({key:"Filter",value:"["+u+"]"});for(var c=0;c<l.length;c+=1)if("DecodeParms"===l[c].key){for(var f=[],d=0;d<h.reverseChain.split("/").length-1;d+=1)f.push("null");f.push(l[c].value),l[c].value="["+f.join(" ")+"]"}}ut("<<");for(var p=0;p<l.length;p++)ut("/"+l[p].key+" "+l[p].value);ut(">>"),0!==h.data.length&&(ut("stream"),ut(o(h.data)),ut("endstream"))},ae=w.__private__.putPage=function(t){var e=t.number,n=t.data,r=t.objId,i=t.contentsObjId;Kt(r,!0),ut("<</Type /Page"),ut("/Parent "+t.rootDictionaryObjId+" 0 R"),ut("/Resources "+t.resourceDictionaryObjId+" 0 R"),ut("/MediaBox ["+parseFloat(O(t.mediaBox.bottomLeftX))+" "+parseFloat(O(t.mediaBox.bottomLeftY))+" "+O(t.mediaBox.topRightX)+" "+O(t.mediaBox.topRightY)+"]"),null!==t.cropBox&&ut("/CropBox ["+O(t.cropBox.bottomLeftX)+" "+O(t.cropBox.bottomLeftY)+" "+O(t.cropBox.topRightX)+" "+O(t.cropBox.topRightY)+"]"),null!==t.bleedBox&&ut("/BleedBox ["+O(t.bleedBox.bottomLeftX)+" "+O(t.bleedBox.bottomLeftY)+" "+O(t.bleedBox.topRightX)+" "+O(t.bleedBox.topRightY)+"]"),null!==t.trimBox&&ut("/TrimBox ["+O(t.trimBox.bottomLeftX)+" "+O(t.trimBox.bottomLeftY)+" "+O(t.trimBox.topRightX)+" "+O(t.trimBox.topRightY)+"]"),null!==t.artBox&&ut("/ArtBox ["+O(t.artBox.bottomLeftX)+" "+O(t.artBox.bottomLeftY)+" "+O(t.artBox.topRightX)+" "+O(t.artBox.topRightY)+"]"),"number"==typeof t.userUnit&&1!==t.userUnit&&ut("/UserUnit "+t.userUnit),qt.publish("putPage",{objId:r,pageContext:Tt[e],pageNumber:e,page:n}),ut("/Contents "+i+" 0 R"),ut(">>"),ut("endobj");var a=n.join("\n");return S===N&&(a+="\nQ"),Kt(i,!0),ie({data:a,filters:re(),objectId:i}),ut("endobj"),r},se=w.__private__.putPages=function(){var t,e,n=[];for(t=1;t<=Rt;t++)Tt[t].objId=Xt(),Tt[t].contentsObjId=Xt();for(t=1;t<=Rt;t++)n.push(ae({number:t,data:st[t],objId:Tt[t].objId,contentsObjId:Tt[t].contentsObjId,mediaBox:Tt[t].mediaBox,cropBox:Tt[t].cropBox,bleedBox:Tt[t].bleedBox,trimBox:Tt[t].trimBox,artBox:Tt[t].artBox,userUnit:Tt[t].userUnit,rootDictionaryObjId:Qt,resourceDictionaryObjId:te}));Kt(Qt,!0),ut("<</Type /Pages");var r="/Kids [";for(e=0;e<Rt;e++)r+=n[e]+" 0 R ";ut(r+"]"),ut("/Count "+Rt),ut(">>"),ut("endobj"),qt.publish("postPutPages")},oe=function(t){qt.publish("putFont",{font:t,out:ut,newObject:Jt,putStream:ie}),!0!==t.isAlreadyPutted&&(t.objectNumber=Jt(),ut("<<"),ut("/Type /Font"),ut("/BaseFont /"+C(t.postScriptName)),ut("/Subtype /Type1"),"string"==typeof t.encoding&&ut("/Encoding /"+t.encoding),ut("/FirstChar 32"),ut("/LastChar 255"),ut(">>"),ut("endobj"))},he=function(t){t.objectNumber=Jt();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[O(t.x),O(t.y),O(t.x+t.width),O(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var n=t.pages[1].join("\n");ie({data:n,additionalKeyValues:e,objectId:t.objectNumber}),ut("endobj")},le=function(t,e){e||(e=21);var n=Jt(),r=function(t,e){var n,r=[],i=1/(e-1);for(n=0;n<1;n+=i)r.push(n);if(r.push(1),0!=t[0].offset){var a={offset:0,color:t[0].color};t.unshift(a)}if(1!=t[t.length-1].offset){var s={offset:1,color:t[t.length-1].color};t.push(s)}for(var o="",h=0,l=0;l<r.length;l++){for(n=r[l];n>t[h+1].offset;)h++;var u=t[h].offset,c=(n-u)/(t[h+1].offset-u),f=t[h].color,d=t[h+1].color;o+=tt(Math.round((1-c)*f[0]+c*d[0]).toString(16))+tt(Math.round((1-c)*f[1]+c*d[1]).toString(16))+tt(Math.round((1-c)*f[2]+c*d[2]).toString(16))}return o.trim()}(t.colors,e),i=[];i.push({key:"FunctionType",value:"0"}),i.push({key:"Domain",value:"[0.0 1.0]"}),i.push({key:"Size",value:"["+e+"]"}),i.push({key:"BitsPerSample",value:"8"}),i.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),i.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),ie({data:r,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:n}),ut("endobj"),t.objectNumber=Jt(),ut("<< /ShadingType "+t.type),ut("/ColorSpace /DeviceRGB");var a="/Coords ["+O(parseFloat(t.coords[0]))+" "+O(parseFloat(t.coords[1]))+" ";2===t.type?a+=O(parseFloat(t.coords[2]))+" "+O(parseFloat(t.coords[3])):a+=O(parseFloat(t.coords[2]))+" "+O(parseFloat(t.coords[3]))+" "+O(parseFloat(t.coords[4]))+" "+O(parseFloat(t.coords[5])),ut(a+="]"),t.matrix&&ut("/Matrix ["+t.matrix.toString()+"]"),ut("/Function "+n+" 0 R"),ut("/Extend [true true]"),ut(">>"),ut("endobj")},ue=function(t,e){var n=Xt(),r=Jt();e.push({resourcesOid:n,objectOid:r}),t.objectNumber=r;var i=[];i.push({key:"Type",value:"/Pattern"}),i.push({key:"PatternType",value:"1"}),i.push({key:"PaintType",value:"1"}),i.push({key:"TilingType",value:"1"}),i.push({key:"BBox",value:"["+t.boundingBox.map(O).join(" ")+"]"}),i.push({key:"XStep",value:O(t.xStep)}),i.push({key:"YStep",value:O(t.yStep)}),i.push({key:"Resources",value:n+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),ie({data:t.stream,additionalKeyValues:i,objectId:t.objectNumber}),ut("endobj")},ce=function(t){for(var e in t.objectNumber=Jt(),ut("<<"),t)switch(e){case"opacity":ut("/ca "+D(t[e]));break;case"stroke-opacity":ut("/CA "+D(t[e]))}ut(">>"),ut("endobj")},fe=function(t){Kt(t.resourcesOid,!0),ut("<<"),ut("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var t in ut("/Font <<"),Ft)Ft.hasOwnProperty(t)&&(!1===b||!0===b&&v.hasOwnProperty(t))&&ut("/"+t+" "+Ft[t].objectNumber+" 0 R");ut(">>")}(),function(){if(Object.keys(jt).length>0){for(var t in ut("/Shading <<"),jt)jt.hasOwnProperty(t)&&jt[t]instanceof B&&jt[t].objectNumber>=0&&ut("/"+t+" "+jt[t].objectNumber+" 0 R");qt.publish("putShadingPatternDict"),ut(">>")}}(),function(t){if(Object.keys(jt).length>0){for(var e in ut("/Pattern <<"),jt)jt.hasOwnProperty(e)&&jt[e]instanceof w.TilingPattern&&jt[e].objectNumber>=0&&jt[e].objectNumber<t&&ut("/"+e+" "+jt[e].objectNumber+" 0 R");qt.publish("putTilingPatternDict"),ut(">>")}}(t.objectOid),function(){if(Object.keys(Ot).length>0){var t;for(t in ut("/ExtGState <<"),Ot)Ot.hasOwnProperty(t)&&Ot[t].objectNumber>=0&&ut("/"+t+" "+Ot[t].objectNumber+" 0 R");qt.publish("putGStateDict"),ut(">>")}}(),function(){for(var t in ut("/XObject <<"),zt)zt.hasOwnProperty(t)&&zt[t].objectNumber>=0&&ut("/"+t+" "+zt[t].objectNumber+" 0 R");qt.publish("putXobjectDict"),ut(">>")}(),ut(">>"),ut("endobj")},de=function(t){It[t.fontName]=It[t.fontName]||{},It[t.fontName][t.fontStyle]=t.id},pe=function(t,e,n,r,i){var a={id:"F"+(Object.keys(Ft).length+1).toString(10),postScriptName:t,fontName:e,fontStyle:n,encoding:r,isStandardFont:i||!1,metadata:{}};return qt.publish("addFont",{font:a,instance:this}),Ft[a.id]=a,de(a),a.id},ge=w.__private__.pdfEscape=w.pdfEscape=function(t,e){return function(t,e){var n,r,i,a,s,o,h,l,u;if(i=(e=e||{}).sourceEncoding||"Unicode",s=e.outputEncoding,(e.autoencode||s)&&Ft[Lt].metadata&&Ft[Lt].metadata[i]&&Ft[Lt].metadata[i].encoding&&(a=Ft[Lt].metadata[i].encoding,!s&&Ft[Lt].encoding&&(s=Ft[Lt].encoding),!s&&a.codePages&&(s=a.codePages[0]),"string"==typeof s&&(s=a[s]),s)){for(h=!1,o=[],n=0,r=t.length;n<r;n++)(l=s[t.charCodeAt(n)])?o.push(String.fromCharCode(l)):o.push(t[n]),o[n].charCodeAt(0)>>8&&(h=!0);t=o.join("")}for(n=t.length;void 0===h&&0!==n;)t.charCodeAt(n-1)>>8&&(h=!0),n--;if(!h)return t;for(o=e.noBOM?[]:[254,255],n=0,r=t.length;n<r;n++){if((u=(l=t.charCodeAt(n))>>8)>>8)throw new Error("Character at position "+n+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");o.push(u),o.push(l-(u<<8))}return String.fromCharCode.apply(void 0,o)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},me=w.__private__.beginPage=function(t){st[++Rt]=[],Tt[Rt]={objId:0,contentsObjId:0,userUnit:Number(f),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},we(Rt),lt(st[$])},be=function(t,e){var r,i,a;switch(n=e||n,"string"==typeof t&&(r=A(t.toLowerCase()),Array.isArray(r)&&(i=r[0],a=r[1])),Array.isArray(t)&&(i=t[0]*Nt,a=t[1]*Nt),isNaN(i)&&(i=o[0],a=o[1]),(i>14400||a>14400)&&(s.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),i=Math.min(14400,i),a=Math.min(14400,a)),o=[i,a],n.substr(0,1)){case"l":a>i&&(o=[a,i]);break;case"p":i>a&&(o=[a,i])}me(o),Ke(Je),ut(sn),0!==fn&&ut(fn+" J"),0!==dn&&ut(dn+" j"),qt.publish("addPage",{pageNumber:Rt})},ve=function(t){t>0&&t<=Rt&&(st.splice(t,1),Tt.splice(t,1),Rt--,$>Rt&&($=Rt),this.setPage($))},we=function(t){t>0&&t<=Rt&&($=t)},ye=w.__private__.getNumberOfPages=w.getNumberOfPages=function(){return st.length-1},_e=function(t,e,n){var r,i=void 0;return n=n||{},t=void 0!==t?t:Ft[Lt].fontName,e=void 0!==e?e:Ft[Lt].fontStyle,r=t.toLowerCase(),void 0!==It[r]&&void 0!==It[r][e]?i=It[r][e]:void 0!==It[t]&&void 0!==It[t][e]?i=It[t][e]:!1===n.disableWarning&&s.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||n.noFallback||null==(i=It.times[e])&&(i=It.times.normal),i},xe=w.__private__.putInfo=function(){var t=Jt(),e=function(t){return t};for(var n in null!==m&&(e=Ce.encryptor(t,0)),ut("<<"),ut("/Producer ("+ge(e("jsPDF "+R.version))+")"),At)At.hasOwnProperty(n)&&At[n]&&ut("/"+n.substr(0,1).toUpperCase()+n.substr(1)+" ("+ge(e(At[n]))+")");ut("/CreationDate ("+ge(e(W))+")"),ut(">>"),ut("endobj")},Ae=w.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Qt;switch(Jt(),ut("<<"),ut("/Type /Catalog"),ut("/Pages "+e+" 0 R"),gt||(gt="fullwidth"),gt){case"fullwidth":ut("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ut("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ut("/OpenAction [3 0 R /Fit]");break;case"original":ut("/OpenAction [3 0 R /XYZ null null 1]");break;default:var n=""+gt;"%"===n.substr(n.length-1)&&(gt=parseInt(gt)/100),"number"==typeof gt&&ut("/OpenAction [3 0 R /XYZ null null "+D(gt)+"]")}switch(yt||(yt="continuous"),yt){case"continuous":ut("/PageLayout /OneColumn");break;case"single":ut("/PageLayout /SinglePage");break;case"two":case"twoleft":ut("/PageLayout /TwoColumnLeft");break;case"tworight":ut("/PageLayout /TwoColumnRight")}vt&&ut("/PageMode /"+vt),qt.publish("putCatalog"),ut(">>"),ut("endobj")},Le=w.__private__.putTrailer=function(){ut("trailer"),ut("<<"),ut("/Size "+(et+1)),ut("/Root "+et+" 0 R"),ut("/Info "+(et-1)+" 0 R"),null!==m&&ut("/Encrypt "+Ce.oid+" 0 R"),ut("/ID [ <"+V+"> <"+V+"> ]"),ut(">>")},Ne=w.__private__.putHeader=function(){ut("%PDF-"+y),ut("%ºß¬à")},Se=w.__private__.putXRef=function(){var t="0000000000";ut("xref"),ut("0 "+(et+1)),ut("0000000000 65535 f ");for(var e=1;e<=et;e++)"function"==typeof nt[e]?ut((t+nt[e]()).slice(-10)+" 00000 n "):void 0!==nt[e]?ut((t+nt[e]).slice(-10)+" 00000 n "):ut("0000000000 00000 n ")},ke=w.__private__.buildDocument=function(){var t;et=0,it=0,rt=[],nt=[],at=[],Qt=Xt(),te=Xt(),lt(rt),qt.publish("buildDocument"),Ne(),se(),function(){qt.publish("putAdditionalObjects");for(var t=0;t<at.length;t++){var e=at[t];Kt(e.objId,!0),ut(e.content),ut("endobj")}qt.publish("postPutAdditionalObjects")}(),t=[],function(){for(var t in Ft)Ft.hasOwnProperty(t)&&(!1===b||!0===b&&v.hasOwnProperty(t))&&oe(Ft[t])}(),function(){var t;for(t in Ot)Ot.hasOwnProperty(t)&&ce(Ot[t])}(),function(){for(var t in zt)zt.hasOwnProperty(t)&&he(zt[t])}(),function(t){var e;for(e in jt)jt.hasOwnProperty(e)&&(jt[e]instanceof B?le(jt[e]):jt[e]instanceof M&&ue(jt[e],t))}(t),qt.publish("putResources"),t.forEach(fe),fe({resourcesOid:te,objectOid:Number.MAX_SAFE_INTEGER}),qt.publish("postPutResources"),null!==m&&(Ce.oid=Jt(),ut("<<"),ut("/Filter /Standard"),ut("/V "+Ce.v),ut("/R "+Ce.r),ut("/U <"+Ce.toHexString(Ce.U)+">"),ut("/O <"+Ce.toHexString(Ce.O)+">"),ut("/P "+Ce.P),ut(">>"),ut("endobj")),xe(),Ae();var e=it;return Se(),Le(),ut("startxref"),ut(""+e),ut("%%EOF"),lt(st[$]),rt.join("\n")},Pe=w.__private__.getBlob=function(t){return new Blob([ft(t)],{type:"application/pdf"})},Fe=w.output=w.__private__.output=(Zt=function(t,e){switch("string"==typeof(e=e||{})?e={filename:e}:e.filename=e.filename||"generated.pdf",t){case void 0:return ke();case"save":w.save(e.filename);break;case"arraybuffer":return ft(ke());case"blob":return Pe(ke());case"bloburi":case"bloburl":if(void 0!==i.URL&&"function"==typeof i.URL.createObjectURL)return i.URL&&i.URL.createObjectURL(Pe(ke()))||void 0;s.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var n="",r=ke();try{n=d(r)}catch(m){n=d(unescape(encodeURIComponent(r)))}return"data:application/pdf;filename="+e.filename+";base64,"+n;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(i)){var a="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",o=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';e.pdfObjectUrl&&(a=e.pdfObjectUrl,o="");var h='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+a+'"'+o+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(e)+");<\/script></body></html>",l=i.open();return null!==l&&l.document.write(h),l}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(i)){var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(e.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+e.filename+'" width="500px" height="400px" /></body></html>',c=i.open();if(null!==c){c.document.write(u);var f=this;c.document.documentElement.querySelector("#pdfViewer").onload=function(){c.document.title=e.filename,c.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(f.output("bloburl"))}}return c}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(i))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var p='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",e)+'"></iframe></body></html>',g=i.open();if(null!==g&&(g.document.write(p),g.document.title=e.filename),g||"undefined"==typeof safari)return g;break;case"datauri":case"dataurl":return i.document.location.href=this.output("datauristring",e);default:return null}},Zt.foo=function(){try{return Zt.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!i.console)throw new Error(e);i.console.error(e,n),i.alert&&alert(e)}},Zt.foo.bar=Zt,Zt.foo),Ie=function(t){return!0===Array.isArray(Dt)&&Dt.indexOf(t)>-1};switch(a){case"pt":Nt=1;break;case"mm":Nt=72/25.4;break;case"cm":Nt=72/2.54;break;case"in":Nt=72;break;case"px":Nt=1==Ie("px_scaling")?.75:96/72;break;case"pc":case"em":Nt=12;break;case"ex":Nt=6;break;default:if("number"!=typeof a)throw new Error("Invalid unit: "+a);Nt=a}var Ce=null;X(),Y();var je=w.__private__.getPageInfo=w.getPageInfo=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Tt[t].objId,pageNumber:t,pageContext:Tt[t]}},Ee=w.__private__.getPageInfoByObjId=function(t){if(isNaN(t)||t%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var e in Tt)if(Tt[e].objId===t)break;return je(e)},Oe=w.__private__.getCurrentPageInfo=w.getCurrentPageInfo=function(){return{objId:Tt[$].objId,pageNumber:$,pageContext:Tt[$]}};w.addPage=function(){return be.apply(this,arguments),this},w.setPage=function(){return we.apply(this,arguments),lt.call(this,st[$]),this},w.insertPage=function(t){return this.addPage(),this.movePage($,t),this},w.movePage=function(t,e){var n,r;if(t>e){n=st[t],r=Tt[t];for(var i=t;i>e;i--)st[i]=st[i-1],Tt[i]=Tt[i-1];st[e]=n,Tt[e]=r,this.setPage(e)}else if(t<e){n=st[t],r=Tt[t];for(var a=t;a<e;a++)st[a]=st[a+1],Tt[a]=Tt[a+1];st[e]=n,Tt[e]=r,this.setPa