jspdf-fontkit
Version:
jsPDF with fontkit for complex glyph support
46 lines • 756 kB
JavaScript
(function(Pn,ot){typeof exports=="object"&&typeof module<"u"?ot(exports):typeof define=="function"&&define.amd?define(["exports"],ot):(Pn=typeof globalThis<"u"?globalThis:Pn||self,ot(Pn["jspdf-fontkit"]={}))})(this,function(Pn){"use strict";var ot=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function as(){ot.console&&typeof ot.console.log=="function"&&ot.console.log.apply(ot.console,arguments)}function $u(r){ot.console&&(typeof ot.console.warn=="function"?ot.console.warn.apply(ot.console,arguments):as.call(null,arguments))}function Xu(r){ot.console&&(typeof ot.console.error=="function"?ot.console.error.apply(ot.console,arguments):as(r))}var Et={log:as,warn:$u,error:Xu};/**
* @license
* FileSaver.js
* A saveAs() FileSaver implementation.
*
* By Eli Grey, http://eligrey.com
*
* License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)
* source : http://purl.eligrey.com/github/FileSaver.js
*/function Yu(r,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(Et.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(r.type)?new Blob(["\uFEFF",r],{type:r.type}):r}function ss(r,t,e){var n=new XMLHttpRequest;n.open("GET",r),n.responseType="blob",n.onload=function(){li(n.response,t,e)},n.onerror=function(){Et.error("could not download file")},n.send()}function zo(r){var t=new XMLHttpRequest;t.open("HEAD",r,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function i0(r){try{r.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),r.dispatchEvent(t)}}var li=ot.saveAs||(typeof window!="object"||window!==ot?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var i=ot.URL||ot.webkitURL,u=document.createElement("a");e=e||t.name||"download",u.download=e,u.rel="noopener",typeof t=="string"?(u.href=t,u.origin!==location.origin?zo(u.href)?ss(t,e,n):i0(u,u.target="_blank"):i0(u)):(u.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(u.href)},4e4),setTimeout(function(){i0(u)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download",typeof t=="string")if(zo(t))ss(t,e,n);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){i0(i)})}else navigator.msSaveOrOpenBlob(Yu(t,n),e)}:function(t,e,n,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return ss(t,e,n);var u=t.type==="application/octet-stream",h=/constructor/i.test(ot.HTMLElement)||ot.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||u&&h)&&typeof FileReader=="object"){var s=new FileReader;s.onloadend=function(){var c=s.result;c=o?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=c:location=c,i=null},s.readAsDataURL(t)}else{var l=ot.URL||ot.webkitURL,f=l.createObjectURL(t);i?i.location=f:location.href=f,i=null,setTimeout(function(){l.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 jo(r){r=r||"",this.ok=!1,r.charAt(0)=="#"&&(r=r.substr(1,6)),r=r.replace(/ /g,""),r=r.toLowerCase();var t,e={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"};r=e[r]||r;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(s){return[parseInt(s[1]),parseInt(s[2]),parseInt(s[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(s){return[parseInt(s[1],16),parseInt(s[2],16),parseInt(s[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(s){return[parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16),parseInt(s[3]+s[3],16)]}}],i=0;i<n.length;i++){var u=n[i].re,h=n[i].process,o=u.exec(r);o&&(t=h(o),this.r=t[0],this.g=t[1],this.b=t[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 s=this.r.toString(16),l=this.g.toString(16),f=this.b.toString(16);return s.length==1&&(s="0"+s),l.length==1&&(l="0"+l),f.length==1&&(f="0"+f),"#"+s+l+f}}var Ca,os;(function(){Ca=ot.atob.bind(ot),os=ot.btoa.bind(ot)})();/**
* @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 ls(r,t){var e=r[0],n=r[1],i=r[2],u=r[3];e=pr(e,n,i,u,t[0],7,-680876936),u=pr(u,e,n,i,t[1],12,-389564586),i=pr(i,u,e,n,t[2],17,606105819),n=pr(n,i,u,e,t[3],22,-1044525330),e=pr(e,n,i,u,t[4],7,-176418897),u=pr(u,e,n,i,t[5],12,1200080426),i=pr(i,u,e,n,t[6],17,-1473231341),n=pr(n,i,u,e,t[7],22,-45705983),e=pr(e,n,i,u,t[8],7,1770035416),u=pr(u,e,n,i,t[9],12,-1958414417),i=pr(i,u,e,n,t[10],17,-42063),n=pr(n,i,u,e,t[11],22,-1990404162),e=pr(e,n,i,u,t[12],7,1804603682),u=pr(u,e,n,i,t[13],12,-40341101),i=pr(i,u,e,n,t[14],17,-1502002290),n=pr(n,i,u,e,t[15],22,1236535329),e=vr(e,n,i,u,t[1],5,-165796510),u=vr(u,e,n,i,t[6],9,-1069501632),i=vr(i,u,e,n,t[11],14,643717713),n=vr(n,i,u,e,t[0],20,-373897302),e=vr(e,n,i,u,t[5],5,-701558691),u=vr(u,e,n,i,t[10],9,38016083),i=vr(i,u,e,n,t[15],14,-660478335),n=vr(n,i,u,e,t[4],20,-405537848),e=vr(e,n,i,u,t[9],5,568446438),u=vr(u,e,n,i,t[14],9,-1019803690),i=vr(i,u,e,n,t[3],14,-187363961),n=vr(n,i,u,e,t[8],20,1163531501),e=vr(e,n,i,u,t[13],5,-1444681467),u=vr(u,e,n,i,t[2],9,-51403784),i=vr(i,u,e,n,t[7],14,1735328473),n=vr(n,i,u,e,t[12],20,-1926607734),e=gr(e,n,i,u,t[5],4,-378558),u=gr(u,e,n,i,t[8],11,-2022574463),i=gr(i,u,e,n,t[11],16,1839030562),n=gr(n,i,u,e,t[14],23,-35309556),e=gr(e,n,i,u,t[1],4,-1530992060),u=gr(u,e,n,i,t[4],11,1272893353),i=gr(i,u,e,n,t[7],16,-155497632),n=gr(n,i,u,e,t[10],23,-1094730640),e=gr(e,n,i,u,t[13],4,681279174),u=gr(u,e,n,i,t[0],11,-358537222),i=gr(i,u,e,n,t[3],16,-722521979),n=gr(n,i,u,e,t[6],23,76029189),e=gr(e,n,i,u,t[9],4,-640364487),u=gr(u,e,n,i,t[12],11,-421815835),i=gr(i,u,e,n,t[15],16,530742520),n=gr(n,i,u,e,t[2],23,-995338651),e=br(e,n,i,u,t[0],6,-198630844),u=br(u,e,n,i,t[7],10,1126891415),i=br(i,u,e,n,t[14],15,-1416354905),n=br(n,i,u,e,t[5],21,-57434055),e=br(e,n,i,u,t[12],6,1700485571),u=br(u,e,n,i,t[3],10,-1894986606),i=br(i,u,e,n,t[10],15,-1051523),n=br(n,i,u,e,t[1],21,-2054922799),e=br(e,n,i,u,t[8],6,1873313359),u=br(u,e,n,i,t[15],10,-30611744),i=br(i,u,e,n,t[6],15,-1560198380),n=br(n,i,u,e,t[13],21,1309151649),e=br(e,n,i,u,t[4],6,-145523070),u=br(u,e,n,i,t[11],10,-1120210379),i=br(i,u,e,n,t[2],15,718787259),n=br(n,i,u,e,t[9],21,-343485551),r[0]=Un(e,r[0]),r[1]=Un(n,r[1]),r[2]=Un(i,r[2]),r[3]=Un(u,r[3])}function a0(r,t,e,n,i,u){return t=Un(Un(t,r),Un(n,u)),Un(t<<i|t>>>32-i,e)}function pr(r,t,e,n,i,u,h){return a0(t&e|~t&n,r,t,i,u,h)}function vr(r,t,e,n,i,u,h){return a0(t&n|e&~n,r,t,i,u,h)}function gr(r,t,e,n,i,u,h){return a0(t^e^n,r,t,i,u,h)}function br(r,t,e,n,i,u,h){return a0(e^(t|~n),r,t,i,u,h)}function Go(r){var t=r.length,e=[1732584193,-271733879,-1732584194,271733878],n;for(n=64;n<=r.length;n+=64)ls(e,Ju(r.substring(n-64,n)));r=r.substring(n-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(n=0;n<r.length;n++)i[n>>2]|=r.charCodeAt(n)<<(n%4<<3);if(i[n>>2]|=128<<(n%4<<3),n>55)for(ls(e,i),n=0;n<16;n++)i[n]=0;return i[14]=t*8,ls(e,i),e}function Ju(r){var t=[],e;for(e=0;e<64;e+=4)t[e>>2]=r.charCodeAt(e)+(r.charCodeAt(e+1)<<8)+(r.charCodeAt(e+2)<<16)+(r.charCodeAt(e+3)<<24);return t}var Vo="0123456789abcdef".split("");function Zu(r){for(var t="",e=0;e<4;e++)t+=Vo[r>>e*8+4&15]+Vo[r>>e*8&15];return t}function Ku(r){for(var t=0;t<r.length;t++)r[t]=Zu(r[t]);return r.join("")}function Qu(r){return String.fromCharCode((r&255)>>0,(r&65280)>>8,(r&16711680)>>16,(r&4278190080)>>24)}function ef(r){return r.map(Qu).join("")}function us(r){return ef(Go(r))}function tf(r){return Ku(Go(r))}var rf=tf("hello")!="5d41402abc4b2a76b9719d911017c592";function Un(r,t){if(rf){var e=(r&65535)+(t&65535),n=(r>>16)+(t>>16)+(e>>16);return n<<16|e&65535}else return r+t&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 nf(r,t){return new Array(t+1).join(r)}function fs(r,t){var e,n;if(r!==e){for(var i=nf(r,(256/r.length>>0)+1),u=[],h=0;h<256;h++)u[h]=h;for(var o=0,h=0;h<256;h++){var s=u[h];o=(o+s+i.charCodeAt(h))%256,u[h]=u[o],u[o]=s}e=r,n=u}else u=n;for(var l=t.length,f=0,c=0,b="",h=0;h<l;h++)f=(f+1)%256,s=u[f],c=(c+s)%256,u[f]=u[c],u[c]=s,i=u[(u[f]+u[c])%256],b+=String.fromCharCode(t.charCodeAt(h)^i);return b}/**
* @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 Ho={print:4,modify:8,copy:16,"annot-forms":32};function Ei(r,t,e,n){this.v=1,this.r=2;let i=192;r.forEach(function(o){if(typeof Ho.perm<"u")throw new Error("Invalid permission: "+o);i+=Ho[o]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";let u=(t+this.padding).substr(0,32),h=(e+this.padding).substr(0,32);this.O=this.processOwnerPassword(u,h),this.P=-((i^255)+1),this.encryptionKey=us(u+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=fs(this.encryptionKey,this.padding)}Ei.prototype.lsbFirstWord=function(r){return String.fromCharCode(r>>0&255,r>>8&255,r>>16&255,r>>24&255)},Ei.prototype.toHexString=function(r){return r.split("").map(function(t){return("0"+(t.charCodeAt(0)&255).toString(16)).slice(-2)}).join("")},Ei.prototype.hexToBytes=function(r){for(var t=[],e=0;e<r.length;e+=2)t.push(String.fromCharCode(parseInt(r.substr(e,2),16)));return t.join("")},Ei.prototype.processOwnerPassword=function(r,t){let e=us(t).substr(0,5);return fs(e,r)},Ei.prototype.encryptor=function(r,t){let e=us(this.encryptionKey+String.fromCharCode(r&255,r>>8&255,r>>16&255,t&255,t>>8&255)).substr(0,10);return function(n){return fs(e,n)}};function Ti(r){if(/[^\u0000-\u00ff]/.test(r))throw new Error("Invalid PDF Name Object: "+r+", Only accept ASCII characters.");for(var t="",e=r.length,n=0;n<e;n++){var i=r.charCodeAt(n);if(i<33||i===35||i===37||i===40||i===41||i===47||i===60||i===62||i===91||i===93||i===123||i===125||i>126){var u=i.toString(16),h=("0"+u).slice(-2);t+="#"+h}else t+=r[n]}return t}function Wo(r){if(typeof r!="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(e,n,i){if(i=i||!1,typeof e!="string"||typeof n!="function"||typeof i!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(e)||(t[e]={});var u=Math.random().toString(35);return t[e][u]=[n,!!i],u},this.unsubscribe=function(e){for(var n in t)if(t[n][e])return delete t[n][e],Object.keys(t[n]).length===0&&delete t[n],!0;return!1},this.publish=function(e){if(t.hasOwnProperty(e)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var u in t[e]){var h=t[e][u];try{h[0].apply(r,n)}catch(o){ot.console&&Et.error("jsPDF PubSub Error",o.message,o)}h[1]&&i.push(u)}i.length&&i.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function s0(r){if(!(this instanceof s0))return new s0(r);var t="opacity,stroke-opacity".split(",");for(var e in r)r.hasOwnProperty(e)&&t.indexOf(e)>=0&&(this[e]=r[e]);this.id="",this.objectNumber=-1}s0.prototype.equals=function(t){var e="id,objectNumber,equals",n;if(!t||typeof t!=typeof this)return!1;var i=0;for(n in this)if(!(e.indexOf(n)>=0)){if(this.hasOwnProperty(n)&&!t.hasOwnProperty(n)||this[n]!==t[n])return!1;i++}for(n in t)t.hasOwnProperty(n)&&e.indexOf(n)<0&&i--;return i===0};function $o(r,t){this.gState=r,this.matrix=t,this.id="",this.objectNumber=-1}function ui(r,t,e,n,i){if(!(this instanceof ui))return new ui(r,t,e,n,i);this.type=r==="axial"?2:3,this.coords=t,this.colors=e,$o.call(this,n,i)}function _i(r,t,e,n,i){if(!(this instanceof _i))return new _i(r,t,e,n,i);this.boundingBox=r,this.xStep=t,this.yStep=e,this.stream="",this.cloneIndex=0,$o.call(this,n,i)}function lt(r){var t=typeof arguments[0]=="string"?arguments[0]:"p",e=arguments[1],n=arguments[2],i=arguments[3],u=[],h=1,o,s=16,l="S",f=null;r=r||{},typeof r=="object"&&(t=r.orientation,e=r.unit||e,n=r.format||n,i=r.compress||r.compressPdf||i,f=r.encryption||null,f!==null&&(f.userPassword=f.userPassword||"",f.ownerPassword=f.ownerPassword||"",f.userPermissions=f.userPermissions||[]),h=typeof r.userUnit=="number"?Math.abs(r.userUnit):1,typeof r.precision<"u"&&(o=r.precision),typeof r.floatPrecision<"u"&&(s=r.floatPrecision),l=r.defaultPathOperation||"S"),u=r.filters||(i===!0?["FlateEncode"]:u),e=e||"mm",t=(""+(t||"P")).toLowerCase();var c=r.putOnlyUsedFonts||!1,b={},v={internal:{},__private__:{}};v.__private__.PubSub=Wo;var A="1.3",S=v.__private__.getPdfVersion=function(){return A};v.__private__.setPdfVersion=function(p){A=p};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]};v.__private__.getPageFormats=function(){return x};var E=v.__private__.getPageFormat=function(p){return x[p]};n=n||"a4";var F={COMPAT:"compat",ADVANCED:"advanced"},N=F.COMPAT;function B(){this.saveGraphicsState(),X(new st(yt,0,0,-yt,0,Bn()*yt).toString()+" cm"),this.setFontSize(this.getFontSize()/yt),l="n",N=F.ADVANCED}function y(){this.restoreGraphicsState(),l="S",N=F.COMPAT}var C=v.__private__.combineFontStyleAndFontWeight=function(p,T){if(p=="bold"&&T=="normal"||p=="bold"&&T==400||p=="normal"&&T=="italic"||p=="bold"&&T=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return T&&(p=T==400||T==="normal"?p==="italic"?"italic":"normal":(T==700||T==="bold")&&p==="normal"?"bold":(T==700?"bold":T)+""+p),p};v.advancedAPI=function(p){var T=N===F.COMPAT;return T&&B.call(this),typeof p!="function"?this:(p(this),T&&y.call(this),this)},v.compatAPI=function(p){var T=N===F.ADVANCED;return T&&y.call(this),typeof p!="function"?this:(p(this),T&&B.call(this),this)},v.isAdvancedAPI=function(){return N===F.ADVANCED};var D=function(p){if(N!==F.ADVANCED)throw new Error(p+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},V=v.roundToPrecision=v.__private__.roundToPrecision=function(p,T){var Z=o||T;if(isNaN(p)||isNaN(Z))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return p.toFixed(Z).replace(/0+$/,"")},R;typeof s=="number"?R=v.hpf=v.__private__.hpf=function(p){if(isNaN(p))throw new Error("Invalid argument passed to jsPDF.hpf");return V(p,s)}:s==="smart"?R=v.hpf=v.__private__.hpf=function(p){if(isNaN(p))throw new Error("Invalid argument passed to jsPDF.hpf");return p>-1&&p<1?V(p,16):V(p,5)}:R=v.hpf=v.__private__.hpf=function(p){if(isNaN(p))throw new Error("Invalid argument passed to jsPDF.hpf");return V(p,16)};var L=v.f2=v.__private__.f2=function(p){if(isNaN(p))throw new Error("Invalid argument passed to jsPDF.f2");return V(p,2)},J=v.__private__.f3=function(p){if(isNaN(p))throw new Error("Invalid argument passed to jsPDF.f3");return V(p,3)},_=v.scale=v.__private__.scale=function(p){if(isNaN(p))throw new Error("Invalid argument passed to jsPDF.scale");if(N===F.COMPAT)return p*yt;if(N===F.ADVANCED)return p},re=function(p){if(N===F.COMPAT)return Bn()-p;if(N===F.ADVANCED)return p},ee=function(p){return _(re(p))};v.__private__.setPrecision=v.setPrecision=function(p){typeof parseInt(p,10)=="number"&&(o=parseInt(p,10))};var te="00000000000000000000000000000000",O=v.__private__.getFileId=function(){return te},G=v.__private__.setFileId=function(p){return typeof p<"u"&&/^[a-fA-F0-9]{32}$/.test(p)?te=p.toUpperCase():te=te.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(Math.random()*16))}).join(""),f!==null&&(xr=new Ei(f.userPermissions,f.userPassword,f.ownerPassword,te)),te};v.setFileId=function(p){return G(p),this},v.getFileId=function(){return O()};var z,Q=v.__private__.convertDateToPDFDate=function(p){var T="",Z=p.getTimezoneOffset(),le=Z<0?"+":"-",we=Math.floor(Math.abs(Z/60)),Oe=Math.abs(Z%60),Ge=[le,I(we),"'",I(Oe),"'"].join("");return T=["D:",p.getFullYear(),I(p.getMonth()+1),I(p.getDate()),I(p.getHours()),I(p.getMinutes()),I(p.getSeconds()),Ge].join(""),T},oe=v.__private__.convertPDFDateToDate=function(p){var T=parseInt(p.substr(2,4),10),Z=parseInt(p.substr(6,2),10)-1,le=parseInt(p.substr(8,2),10),we=parseInt(p.substr(10,2),10),Oe=parseInt(p.substr(12,2),10),Ge=parseInt(p.substr(14,2),10),Xe=new Date(T,Z,le,we,Oe,Ge,0);return Xe},ue=v.__private__.setCreationDate=function(p){var T,Z=/^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])'?$/;if(typeof p>"u"&&(p=new Date),p instanceof Date)T=Q(p);else if(Z.test(p))T=p;else throw new Error("Invalid argument passed to jsPDF.setCreationDate");return z=T,z},ie=v.__private__.getCreationDate=function(p){var T=z;return p==="jsDate"&&(T=oe(z)),T};v.setCreationDate=function(p){return ue(p),this},v.getCreationDate=function(p){return ie(p)};var I=v.__private__.padd2=function(p){return("0"+parseInt(p)).slice(-2)},$=v.__private__.padd2Hex=function(p){return p=p.toString(),("00"+p).substr(p.length)},W=0,pe=[],he=[],q=0,K=[],se=[],Y,ye=!1,Ne=he,ne=function(){W=0,q=0,he=[],pe=[],K=[],Qt=qt(),Ir=qt()};v.__private__.setCustomOutputDestination=function(p){ye=!0,Ne=p};var ve=function(p){ye||(Ne=p)};v.__private__.resetCustomOutputDestination=function(){ye=!1,Ne=he};var X=v.__private__.out=function(p){return p=p.toString(),q+=p.length+1,Ne.push(p),Ne},ce=v.__private__.write=function(p){return X(arguments.length===1?p.toString():Array.prototype.join.call(arguments," "))},fe=v.__private__.getArrayBuffer=function(p){for(var T=p.length,Z=new ArrayBuffer(T),le=new Uint8Array(Z);T--;)le[T]=p.charCodeAt(T);return Z},Fe=[["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]];v.__private__.getStandardFonts=function(){return Fe};var Me=r.fontSize||16;v.__private__.setFontSize=v.setFontSize=function(p){return N===F.ADVANCED?Me=p/yt:Me=p,this};var He=v.__private__.getFontSize=v.getFontSize=function(){return N===F.COMPAT?Me:Me*yt},_e=r.R2L||!1;v.__private__.setR2L=v.setR2L=function(p){return _e=p,this},v.__private__.getR2L=v.getR2L=function(){return _e};var je,Ue=v.__private__.setZoomMode=function(p){var T=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(p))je=p;else if(!isNaN(p))je=parseInt(p,10);else if(T.indexOf(p)!==-1)je=p;else throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+p+'" is not recognized.')};v.__private__.getZoomMode=function(){return je};var We,at=v.__private__.setPageMode=function(p){var T=[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"];if(T.indexOf(p)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+p+'" is not recognized.');We=p};v.__private__.getPageMode=function(){return We};var qe,gt=v.__private__.setLayoutMode=function(p){var T=[void 0,null,"continuous","single","twoleft","tworight","two"];if(T.indexOf(p)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+p+'" is not recognized.');qe=p};v.__private__.getLayoutMode=function(){return qe},v.__private__.setDisplayMode=v.setDisplayMode=function(p,T,Z){return Ue(p),gt(T),at(Z),this};var nt={title:"",subject:"",author:"",keywords:"",creator:""};v.__private__.getDocumentProperty=function(p){if(Object.keys(nt).indexOf(p)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return nt[p]},v.__private__.getDocumentProperties=function(){return nt},v.__private__.setDocumentProperties=v.setProperties=v.setDocumentProperties=function(p){for(var T in nt)nt.hasOwnProperty(T)&&p[T]&&(nt[T]=p[T]);return this},v.__private__.setDocumentProperty=function(p,T){if(Object.keys(nt).indexOf(p)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return nt[p]=T};var $e={},rt={},Ke,pt=[],it={},Mt={},Pt={},nr={},ir=null,yt,Tt=0,ut=[],mt=new Wo(v),_r=r.hotfixes||[],ar={},Gr={},Pr=[],Vr,Hr,rn,st=function(p,T,Z,le,we,Oe){if(!(this instanceof st))return new st(p,T,Z,le,we,Oe);isNaN(p)&&(p=1),isNaN(T)&&(T=0),isNaN(Z)&&(Z=0),isNaN(le)&&(le=1),isNaN(we)&&(we=0),isNaN(Oe)&&(Oe=0),this._matrix=[p,T,Z,le,we,Oe]};Object.defineProperty(st.prototype,"sx",{get:function(){return this._matrix[0]},set:function(p){this._matrix[0]=p}}),Object.defineProperty(st.prototype,"shy",{get:function(){return this._matrix[1]},set:function(p){this._matrix[1]=p}}),Object.defineProperty(st.prototype,"shx",{get:function(){return this._matrix[2]},set:function(p){this._matrix[2]=p}}),Object.defineProperty(st.prototype,"sy",{get:function(){return this._matrix[3]},set:function(p){this._matrix[3]=p}}),Object.defineProperty(st.prototype,"tx",{get:function(){return this._matrix[4]},set:function(p){this._matrix[4]=p}}),Object.defineProperty(st.prototype,"ty",{get:function(){return this._matrix[5]},set:function(p){this._matrix[5]=p}}),Object.defineProperty(st.prototype,"a",{get:function(){return this._matrix[0]},set:function(p){this._matrix[0]=p}}),Object.defineProperty(st.prototype,"b",{get:function(){return this._matrix[1]},set:function(p){this._matrix[1]=p}}),Object.defineProperty(st.prototype,"c",{get:function(){return this._matrix[2]},set:function(p){this._matrix[2]=p}}),Object.defineProperty(st.prototype,"d",{get:function(){return this._matrix[3]},set:function(p){this._matrix[3]=p}}),Object.defineProperty(st.prototype,"e",{get:function(){return this._matrix[4]},set:function(p){this._matrix[4]=p}}),Object.defineProperty(st.prototype,"f",{get:function(){return this._matrix[5]},set:function(p){this._matrix[5]=p}}),Object.defineProperty(st.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(st.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(st.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(st.prototype,"isIdentity",{get:function(){return!(this.sx!==1||this.shy!==0||this.shx!==0||this.sy!==1||this.tx!==0||this.ty!==0)}}),st.prototype.join=function(p){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(R).join(p)},st.prototype.multiply=function(p){var T=p.sx*this.sx+p.shy*this.shx,Z=p.sx*this.shy+p.shy*this.sy,le=p.shx*this.sx+p.sy*this.shx,we=p.shx*this.shy+p.sy*this.sy,Oe=p.tx*this.sx+p.ty*this.shx+this.tx,Ge=p.tx*this.shy+p.ty*this.sy+this.ty;return new st(T,Z,le,we,Oe,Ge)},st.prototype.decompose=function(){var p=this.sx,T=this.shy,Z=this.shx,le=this.sy,we=this.tx,Oe=this.ty,Ge=Math.sqrt(p*p+T*T);p/=Ge,T/=Ge;var Xe=p*Z+T*le;Z-=p*Xe,le-=T*Xe;var et=Math.sqrt(Z*Z+le*le);return Z/=et,le/=et,Xe/=et,p*le<T*Z&&(p=-p,T=-T,Xe=-Xe,Ge=-Ge),{scale:new st(Ge,0,0,et,0,0),translate:new st(1,0,0,1,we,Oe),rotate:new st(p,T,-T,p,0,0),skew:new st(1,0,Xe,1,0,0)}},st.prototype.toString=function(p){return this.join(" ")},st.prototype.inversed=function(){var p=this.sx,T=this.shy,Z=this.shx,le=this.sy,we=this.tx,Oe=this.ty,Ge=1/(p*le-T*Z),Xe=le*Ge,et=-T*Ge,dt=-Z*Ge,At=p*Ge,xt=-Xe*we-dt*Oe,wt=-et*we-At*Oe;return new st(Xe,et,dt,At,xt,wt)},st.prototype.applyToPoint=function(p){var T=p.x*this.sx+p.y*this.shx+this.tx,Z=p.x*this.shy+p.y*this.sy+this.ty;return new aa(T,Z)},st.prototype.applyToRectangle=function(p){var T=this.applyToPoint(p),Z=this.applyToPoint(new aa(p.x+p.w,p.y+p.h));return new R0(T.x,T.y,Z.x-T.x,Z.y-T.y)},st.prototype.clone=function(){var p=this.sx,T=this.shy,Z=this.shx,le=this.sy,we=this.tx,Oe=this.ty;return new st(p,T,Z,le,we,Oe)},v.Matrix=st;var nn=v.matrixMult=function(p,T){return T.multiply(p)},Br=new st(1,0,0,1,0,0);v.unitMatrix=v.identityMatrix=Br;var Dr=function(p,T){if(!Mt[p]){var Z=T instanceof ui?"Sh":"P",le=Z+(Object.keys(it).length+1).toString(10);T.id=le,Mt[p]=le,it[le]=T,mt.publish("addPattern",T)}};v.ShadingPattern=ui,v.TilingPattern=_i,v.addShadingPattern=function(p,T){return D("addShadingPattern()"),Dr(p,T),this},v.beginTilingPattern=function(p){D("beginTilingPattern()"),U0(p.boundingBox[0],p.boundingBox[1],p.boundingBox[2]-p.boundingBox[0],p.boundingBox[3]-p.boundingBox[1],p.matrix)},v.endTilingPattern=function(p,T){D("endTilingPattern()"),T.stream=se[Y].join(`
`),Dr(p,T),mt.publish("endTilingPattern",T),Pr.pop().restore()};var Ut=v.__private__.newObject=function(){var p=qt();return Jt(p,!0),p},qt=v.__private__.newObjectDeferred=function(){return W++,pe[W]=function(){return q},W},Jt=function(p,T){return T=typeof T=="boolean"?T:!1,pe[p]=q,T&&X(p+" 0 obj"),p},Wr=v.__private__.newAdditionalObject=function(){var p=qt(),T={objId:p,content:""};return K.push(T),T},Qt=qt(),Ir=qt(),lr=v.__private__.decodeColorString=function(p){var T=p.split(" ");if(T.length===2&&(T[1]==="g"||T[1]==="G")){var Z=parseFloat(T[0]);T=[Z,Z,Z,"r"]}else if(T.length===5&&(T[4]==="k"||T[4]==="K")){var le=(1-T[0])*(1-T[3]),we=(1-T[1])*(1-T[3]),Oe=(1-T[2])*(1-T[3]);T=[le,we,Oe,"r"]}for(var Ge="#",Xe=0;Xe<3;Xe++)Ge+=("0"+Math.floor(parseFloat(T[Xe])*255).toString(16)).slice(-2);return Ge},Ar=v.__private__.encodeColorString=function(p){var T;typeof p=="string"&&(p={ch1:p});var Z=p.ch1,le=p.ch2,we=p.ch3,Oe=p.ch4,Ge=p.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof Z=="string"&&Z.charAt(0)!=="#"){var Xe=new jo(Z);if(Xe.ok)Z=Xe.toHex();else if(!/^\d*\.?\d*$/.test(Z))throw new Error('Invalid color "'+Z+'" passed to jsPDF.encodeColorString.')}if(typeof Z=="string"&&/^#[0-9A-Fa-f]{3}$/.test(Z)&&(Z="#"+Z[1]+Z[1]+Z[2]+Z[2]+Z[3]+Z[3]),typeof Z=="string"&&/^#[0-9A-Fa-f]{6}$/.test(Z)){var et=parseInt(Z.substr(1),16);Z=et>>16&255,le=et>>8&255,we=et&255}if(typeof le>"u"||typeof Oe>"u"&&Z===le&&le===we)if(typeof Z=="string")T=Z+" "+Ge[0];else switch(p.precision){case 2:T=L(Z/255)+" "+Ge[0];break;case 3:default:T=J(Z/255)+" "+Ge[0]}else if(typeof Oe>"u"||typeof Oe=="object"){if(Oe&&!isNaN(Oe.a)&&Oe.a===0)return T=["1.","1.","1.",Ge[1]].join(" "),T;if(typeof Z=="string")T=[Z,le,we,Ge[1]].join(" ");else switch(p.precision){case 2:T=[L(Z/255),L(le/255),L(we/255),Ge[1]].join(" ");break;default:case 3:T=[J(Z/255),J(le/255),J(we/255),Ge[1]].join(" ")}}else if(typeof Z=="string")T=[Z,le,we,Oe,Ge[2]].join(" ");else switch(p.precision){case 2:T=[L(Z),L(le),L(we),L(Oe),Ge[2]].join(" ");break;case 3:default:T=[J(Z),J(le),J(we),J(Oe),Ge[2]].join(" ")}return T},$r=v.__private__.getFilters=function(){return u},mr=v.__private__.putStream=function(p){p=p||{};var T=p.data||"",Z=p.filters||$r(),le=p.alreadyAppliedFilters||[],we=p.addLength1||!1,Oe=T.length,Ge=p.objectId,Xe=function(_t){return _t};if(f!==null&&typeof Ge>"u")throw new Error("ObjectId must be passed to putStream for file encryption");f!==null&&(Xe=xr.encryptor(Ge,0));var et={};Z===!0&&(Z=["FlateEncode"]);var dt=p.additionalKeyValues||[];typeof lt.API.processDataByFilters<"u"?et=lt.API.processDataByFilters(T,Z):et={data:T,reverseChain:[]};var At=et.reverseChain+(Array.isArray(le)?le.join(" "):le.toString());if(et.data.length!==0&&(dt.push({key:"Length",value:et.data.length}),we===!0&&dt.push({key:"Length1",value:Oe})),At.length!=0)if(At.split("/").length-1===1)dt.push({key:"Filter",value:At});else{dt.push({key:"Filter",value:"["+At+"]"});for(var xt=0;xt<dt.length;xt+=1)if(dt[xt].key==="DecodeParms"){for(var wt=[],ur=0;ur<et.reverseChain.split("/").length-1;ur+=1)wt.push("null");wt.push(dt[xt].value),dt[xt].value="["+wt.join(" ")+"]"}}X("<<");for(var jt=0;jt<dt.length;jt++)X("/"+dt[jt].key+" "+dt[jt].value);X(">>"),et.data.length!==0&&(X("stream"),X(Xe(et.data)),X("endstream"))},an=v.__private__.putPage=function(p){var T=p.number,Z=p.data,le=p.objId,we=p.contentsObjId;Jt(le,!0),X("<</Type /Page"),X("/Parent "+p.rootDictionaryObjId+" 0 R"),X("/Resources "+p.resourceDictionaryObjId+" 0 R"),X("/MediaBox ["+parseFloat(R(p.mediaBox.bottomLeftX))+" "+parseFloat(R(p.mediaBox.bottomLeftY))+" "+R(p.mediaBox.topRightX)+" "+R(p.mediaBox.topRightY)+"]"),p.cropBox!==null&&X("/CropBox ["+R(p.cropBox.bottomLeftX)+" "+R(p.cropBox.bottomLeftY)+" "+R(p.cropBox.topRightX)+" "+R(p.cropBox.topRightY)+"]"),p.bleedBox!==null&&X("/BleedBox ["+R(p.bleedBox.bottomLeftX)+" "+R(p.bleedBox.bottomLeftY)+" "+R(p.bleedBox.topRightX)+" "+R(p.bleedBox.topRightY)+"]"),p.trimBox!==null&&X("/TrimBox ["+R(p.trimBox.bottomLeftX)+" "+R(p.trimBox.bottomLeftY)+" "+R(p.trimBox.topRightX)+" "+R(p.trimBox.topRightY)+"]"),p.artBox!==null&&X("/ArtBox ["+R(p.artBox.bottomLeftX)+" "+R(p.artBox.bottomLeftY)+" "+R(p.artBox.topRightX)+" "+R(p.artBox.topRightY)+"]"),typeof p.userUnit=="number"&&p.userUnit!==1&&X("/UserUnit "+p.userUnit),mt.publish("putPage",{objId:le,pageContext:ut[T],pageNumber:T,page:Z}),X("/Contents "+we+" 0 R"),X(">>"),X("endobj");var Oe=Z.join(`
`);return N===F.ADVANCED&&(Oe+=`
Q`),Jt(we,!0),mr({data:Oe,filters:$r(),objectId:we}),X("endobj"),le},zt=v.__private__.putPages=function(){var p,T,Z=[];for(p=1;p<=Tt;p++)ut[p].objId=qt(),ut[p].contentsObjId=qt();for(p=1;p<=Tt;p++)Z.push(an({number:p,data:se[p],objId:ut[p].objId,contentsObjId:ut[p].contentsObjId,mediaBox:ut[p].mediaBox,cropBox:ut[p].cropBox,bleedBox:ut[p].bleedBox,trimBox:ut[p].trimBox,artBox:ut[p].artBox,userUnit:ut[p].userUnit,rootDictionaryObjId:Qt,resourceDictionaryObjId:Ir}));Jt(Qt,!0),X("<</Type /Pages");var le="/Kids [";for(T=0;T<Tt;T++)le+=Z[T]+" 0 R ";X(le+"]"),X("/Count "+Tt),X(">>"),X("endobj"),mt.publish("postPutPages")},Rt=function(p){mt.publish("putFont",{font:p,out:X,newObject:Ut,putStream:mr}),p.isAlreadyPutted!==!0&&(p.objectNumber=Ut(),X("<<"),X("/Type /Font"),X("/BaseFont /"+Ti(p.postScriptName)),X("/Subtype /Type1"),typeof p.encoding=="string"&&X("/Encoding /"+p.encoding),X("/FirstChar 32"),X("/LastChar 255"),X(">>"),X("endobj"))},kr=function(){for(var p in $e)$e.hasOwnProperty(p)&&(c===!1||c===!0&&b.hasOwnProperty(p))&&Rt($e[p])},xn=function(p){p.objectNumber=Ut();var T=[];T.push({key:"Type",value:"/XObject"}),T.push({key:"Subtype",value:"/Form"}),T.push({key:"BBox",value:"["+[R(p.x),R(p.y),R(p.x+p.width),R(p.y+p.height)].join(" ")+"]"}),T.push({key:"Matrix",value:"["+p.matrix.toString()+"]"});var Z=p.pages[1].join(`
`);mr({data:Z,additionalKeyValues:T,objectId:p.objectNumber}),X("endobj")},Fr=function(){for(var p in ar)ar.hasOwnProperty(p)&&xn(ar[p])},wn=function(p,T){var Z=[],le,we=1/(T-1);for(le=0;le<1;le+=we)Z.push(le);if(Z.push(1),p[0].offset!=0){var Oe={offset:0,color:p[0].color};p.unshift(Oe)}if(p[p.length-1].offset!=1){var Ge={offset:1,color:p[p.length-1].color};p.push(Ge)}for(var Xe="",et=0,dt=0;dt<Z.length;dt++){for(le=Z[dt];le>p[et+1].offset;)et++;var At=p[et].offset,xt=p[et+1].offset,wt=(le-At)/(xt-At),ur=p[et].color,jt=p[et+1].color;Xe+=$(Math.round((1-wt)*ur[0]+wt*jt[0]).toString(16))+$(Math.round((1-wt)*ur[1]+wt*jt[1]).toString(16))+$(Math.round((1-wt)*ur[2]+wt*jt[2]).toString(16))}return Xe.trim()},mi=function(p,T){T||(T=21);var Z=Ut(),le=wn(p.colors,T),we=[];we.push({key:"FunctionType",value:"0"}),we.push({key:"Domain",value:"[0.0 1.0]"}),we.push({key:"Size",value:"["+T+"]"}),we.push({key:"BitsPerSample",value:"8"}),we.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),we.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),mr({data:le,additionalKeyValues:we,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:Z}),X("endobj"),p.objectNumber=Ut(),X("<< /ShadingType "+p.type),X("/ColorSpace /DeviceRGB");var Oe="/Coords ["+R(parseFloat(p.coords[0]))+" "+R(parseFloat(p.coords[1]))+" ";p.type===2?Oe+=R(parseFloat(p.coords[2]))+" "+R(parseFloat(p.coords[3])):Oe+=R(parseFloat(p.coords[2]))+" "+R(parseFloat(p.coords[3]))+" "+R(parseFloat(p.coords[4]))+" "+R(parseFloat(p.coords[5])),Oe+="]",X(Oe),p.matrix&&X("/Matrix ["+p.matrix.toString()+"]"),X("/Function "+Z+" 0 R"),X("/Extend [true true]"),X(">>"),X("endobj")},Hi=function(p,T){var Z=qt(),le=Ut();T.push({resourcesOid:Z,objectOid:le}),p.objectNumber=le;var we=[];we.push({key:"Type",value:"/Pattern"}),we.push({key:"PatternType",value:"1"}),we.push({key:"PaintType",value:"1"}),we.push({key:"TilingType",value:"1"}),we.push({key:"BBox",value:"["+p.boundingBox.map(R).join(" ")+"]"}),we.push({key:"XStep",value:R(p.xStep)}),we.push({key:"YStep",value:R(p.yStep)}),we.push({key:"Resources",value:Z+" 0 R"}),p.matrix&&we.push({key:"Matrix",value:"["+p.matrix.toString()+"]"}),mr({data:p.stream,additionalKeyValues:we,objectId:p.objectNumber}),X("endobj")},Fn=function(p){var T;for(T in it)it.hasOwnProperty(T)&&(it[T]instanceof ui?mi(it[T]):it[T]instanceof _i&&Hi(it[T],p))},Wi=function(p){p.objectNumber=Ut(),X("<<");for(var T in p)switch(T){case"opacity":X("/ca "+L(p[T]));break;case"stroke-opacity":X("/CA "+L(p[T]));break}X(">>"),X("endobj")},$i=function(){var p;for(p in Pt)Pt.hasOwnProperty(p)&&Wi(Pt[p])},Xi=function(){X("/XObject <<");for(var p in ar)ar.hasOwnProperty(p)&&ar[p].objectNumber>=0&&X("/"+p+" "+ar[p].objectNumber+" 0 R");mt.publish("putXobjectDict"),X(">>")},_a=function(){xr.oid=Ut(),X("<<"),X("/Filter /Standard"),X("/V "+xr.v),X("/R "+xr.r),X("/U <"+xr.toHexString(xr.U)+">"),X("/O <"+xr.toHexString(xr.O)+">"),X("/P "+xr.P),X(">>"),X("endobj")},Yi=function(){X("/Font <<");for(var p in $e)$e.hasOwnProperty(p)&&(c===!1||c===!0&&b.hasOwnProperty(p))&&X("/"+p+" "+$e[p].objectNumber+" 0 R");X(">>")},yn=function(){if(Object.keys(it).length>0){X("/Shading <<");for(var p in it)it.hasOwnProperty(p)&&it[p]instanceof ui&&it[p].objectNumber>=0&&X("/"+p+" "+it[p].objectNumber+" 0 R");mt.publish("putShadingPatternDict"),X(">>")}},On=function(p){if(Object.keys(it).length>0){X("/Pattern <<");for(var T in it)it.hasOwnProperty(T)&&it[T]instanceof v.TilingPattern&&it[T].objectNumber>=0&&it[T].objectNumber<p&&X("/"+T+" "+it[T].objectNumber+" 0 R");mt.publish("putTilingPatternDict"),X(">>")}},Zs=function(){if(Object.keys(Pt).length>0){var p;X("/ExtGState <<");for(p in Pt)Pt.hasOwnProperty(p)&&Pt[p].objectNumber>=0&&X("/"+p+" "+Pt[p].objectNumber+" 0 R");mt.publish("putGStateDict"),X(">>")}},Ji=function(p){Jt(p.resourcesOid,!0),X("<<"),X("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),Yi(),yn(),On(p.objectOid),Zs(),Xi(),X(">>"),X("endobj")},Ks=function(){var p=[];kr(),$i(),Fr(),Fn(p),mt.publish("putResources"),p.forEach(Ji),Ji({resourcesOid:Ir,objectOid:Number.MAX_SAFE_INTEGER}),mt.publish("postPutResources")},L0=function(){mt.publish("putAdditionalObjects");for(var p=0;p<K.length;p++){var T=K[p];Jt(T.objId,!0),X(T.content),X("endobj")}mt.publish("postPutAdditionalObjects")},N0=function(p){rt[p.fontName]=rt[p.fontName]||{},rt[p.fontName][p.fontStyle]=p.id},xi=function(p,T,Z,le,we){var Oe={id:"F"+(Object.keys($e).length+1).toString(10),postScriptName:p,fontName:T,fontStyle:Z,encoding:le,isStandardFont:we||!1,metadata:{}};return mt.publish("addFont",{font:Oe,instance:this}),$e[Oe.id]=Oe,N0(Oe),Oe.id},Qs=function(p){for(var T=0,Z=Fe.length;T<Z;T++){var le=xi.call(this,p[T][0],p[T][1],p[T][2],Fe[T][3],!0);c===!1&&(b[le]=!0);var we=p[T][0].split("-");N0({id:le,fontName:we[0],fontStyle:we[1]||""})}mt.publish("addFonts",{fonts:$e,dictionary:rt})},er=function(T){return T.foo=function(){try{return T.apply(this,arguments)}catch(Oe){var le=Oe.stack||"";~le.indexOf(" at ")&&(le=le.split(" at ")[1]);var we="Error in function "+le.split(`
`)[0].split("<")[0]+": "+Oe.message;if(ot.console)ot.console.error(we,Oe),ot.alert&&alert(we);else throw new Error(we)}},T.foo.bar=T,T.foo},P0=function(p,T){var Z,le,we,Oe,Ge,Xe,et,dt,At;if(T=T||{},we=T.sourceEncoding||"Unicode",Ge=T.outputEncoding,(T.autoencode||Ge)&&$e[Ke].metadata&&$e[Ke].metadata[we]&&$e[Ke].metadata[we].encoding&&(Oe=$e[Ke].metadata[we].encoding,!Ge&&$e[Ke].encoding&&(Ge=$e[Ke].encoding),!Ge&&Oe.codePages&&(Ge=Oe.codePages[0]),typeof Ge=="string"&&(Ge=Oe[Ge]),Ge)){for(et=!1,Xe=[],Z=0,le=p.length;Z<le;Z++)dt=Ge[p.charCodeAt(Z)],dt?Xe.push(String.fromCharCode(dt)):Xe.push(p[Z]),Xe[Z].charCodeAt(0)>>8&&(et=!0);p=Xe.join("")}for(Z=p.length;et===void 0&&Z!==0;)p.charCodeAt(Z-1)>>8&&(et=!0),Z--;if(!et)return p;for(Xe=T.noBOM?[]:[254,255],Z=0,le=p.length;Z<le;Z++){if(dt=p.charCodeAt(Z),At=dt>>8,At>>8)throw new Error("Character at position "+Z+" of string '"+p+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Xe.push(At),Xe.push(dt-(At<<8))}return String.fromCharCode.apply(void 0,Xe)},An=v.__private__.pdfEscape=v.pdfEscape=function(p,T){return P0(p,T).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},I0=v.__private__.beginPage=function(p){se[++Tt]=[],ut[Tt]={objId:0,contentsObjId:0,userUnit:Number(h),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(p[0]),topRightY:Number(p[1])}},k0(Tt),ve(se[Y])},Ba=function(p,T){var Z,le,we;switch(t=T||t,typeof p=="string"&&(Z=E(p.toLowerCase()),Array.isArray(Z)&&(le=Z[0],we=Z[1])),Array.isArray(p)&&(le=p[0]*yt,we=p[1]*yt),isNaN(le)&&(le=n[0],we=n[1]),(le>14400||we>14400)&&(Et.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),le=Math.min(14400,le),we=Math.min(14400,we)),n=[le,we],t.substr(0,1)){case"l":we>le&&(n=[we,le]);break;case"p":le>we&&(n=[we,le]);break}I0(n),po(Ma),X(Ai),Cn!==0&&X(Cn+" J"),Ln!==0&&X(Ln+" j"),mt.publish("addPage",{pageNumber:Tt})},eo=function(p){p>0&&p<=Tt&&(se.splice(p,1),ut.splice(p,1),Tt--,Y>Tt&&(Y=Tt),this.setPage(Y))},k0=function(p){p>0&&p<=Tt&&(Y=p)},sn=v.__private__.getNumberOfPages=v.getNumberOfPages=function(){return se.length-1},wi=function(p,T,Z){var le=void 0,we;return Z=Z||{},p=p!==void 0?p:$e[Ke].fontName,T=T!==void 0?T:$e[Ke].fontStyle,we=p.toLowerCase(),rt[we]!==void 0&&rt[we][T]!==void 0?le=rt[we][T]:rt[p]!==void 0&&rt[p][T]!==void 0?le=rt[p][T]:Z.disableWarning===!1&&Et.warn("Unable to look up font label for font '"+p+"', '"+T+"'. Refer to getFontList() for available fonts."),!le&&!Z.noFallback&&(le=rt.times[T],le==null&&(le=rt.times.normal)),le},$n=v.__private__.putInfo=function(){var p=Ut(),T=function(le){return le};f!==null&&(T=xr.encryptor(p,0)),X("<<"),X("/Producer ("+An(T("jsPDF "+lt.version))+")");for(var Z in nt)nt.hasOwnProperty(Z)&&nt[Z]&&X("/"+Z.substr(0,1).toUpperCase()+Z.substr(1)+" ("+An(T(nt[Z]))+")");X("/CreationDate ("+An(T(z))+")"),X(">>"),X("endobj")},F0=v.__private__.putCatalog=function(p){p=p||{};var T=p.rootDictionaryObjId||Qt;switch(Ut(),X("<<"),X("/Type /Catalog"),X("/Pages "+T+" 0 R"),je||(je="fullwidth"),je){case"fullwidth":X("/OpenAction [3 0 R /FitH null]");break;case"fullheight":X("/OpenAction [3 0 R /FitV null]");break;case"fullpage":X("/OpenAction [3 0 R /Fit]");break;case"original":X("/OpenAction [3 0 R /XYZ null null 1]");break;default:var Z=""+je;Z.substr(Z.length-1)==="%"&&(je=parseInt(je)/100),typeof je=="number"&&X("/OpenAction [3 0 R /XYZ null null "+L(je)+"]")}switch(qe||(qe="continuous"),qe){case"continuous":X("/PageLayout /OneColumn");break;case"single":X("/PageLayout /SinglePage");break;case"two":case"twoleft":X("/PageLayout /TwoColumnLeft");break;case"tworight":X("/PageLayout /TwoColumnRight");break}We&&X("/PageMode /"+We),mt.publish("putCatalog"),X(">>"),X("endobj")},to=v.__private__.putTrailer=function(){X("trailer"),X("<<"),X("/Size "+(W+1)),X("/Root "+W+" 0 R"),X("/Info "+(W-1)+" 0 R"),f!==null&&X("/Encrypt "+xr.oid+" 0 R"),X("/ID [ <"+te+"> <"+te+"> ]"),X(">>")},ro=v.__private__.putHeader=function(){X("%PDF-"+A),X("%ºß¬à")},no=v.__private__.putXRef=function(){var p="0000000000";X("xref"),X("0 "+(W+1)),X("0000000000 65535 f ");for(var T=1;T<=W;T++){var Z=pe[T];typeof Z=="function"?X((p+pe[T]()).slice(-10)+" 00000 n "):typeof pe[T]<"u"?X((p+pe[T]).slice(-10)+" 00000 n "):X("0000000000 00000 n ")}},En=v.__private__.buildDocument=function(){ne(),ve(he),mt.publish("buildDocument"),ro(),zt(),L0(),Ks(),f!==null&&_a(),$n(),F0();var p=q;return no(),to(),X("startxref"),X(""+p),X("%%EOF"),ve(se[Y]),he.join(`
`)},Zi=v.__private__.getBlob=function(p){return new Blob([fe(p)],{type:"application/pdf"})},io=v.output=v.__private__.output=er(function(T,Z){switch(Z=Z||{},typeof Z=="string"?Z={filename:Z}:Z.filename=Z.filename||"generated.pdf",T){case void 0:return En();case"save":v.save(Z.filename);break;case"arraybuffer":return fe(En());case"blob":return Zi(En());case"bloburi":case"bloburl":if(typeof ot.URL<"u"&&typeof ot.URL.createObjectURL=="function")return ot.URL&&ot.URL.createObjectURL(Zi(En()))||void 0;Et.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var le="",we=En();try{le=os(we)}catch{le=os(unescape(encodeURIComponent(we)))}return"data:application/pdf;filename="+Z.filename+";base64,"+le;case"pdfobjectnewwindow":if(Object.prototype.toString.call(ot)==="[object Window]"){var Oe="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ge=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';Z.pdfObjectUrl&&(Oe=Z.pdfObjectUrl,Ge="");var Xe='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+Oe+'"'+Ge+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(Z)+");<\/script></body></html>",et=ot.open();return et!==null&&et.document.write(Xe),et}else throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(ot)==="[object Window]"){var dt=Z.pdfJsUrl||"examples/PDF.js/web/viewer.html",At='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+dt+"?file=&downloadName="+Z.filename+'" width="500px" height="400px" /></body></html>',xt=ot.open();if(xt!==null){xt.document.write(At);var wt=this;xt.document.documentElement.querySelector("#pdfViewer").onload=function(){xt.document.title=Z.filename,xt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(wt.output("bloburl"))}}return xt}else throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(ot)==="[object Window]"){var ur='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",Z)+'"></iframe></body></html>',jt=ot.open();if(jt!==null&&(jt.document.write(ur),jt.document.title=Z.filename),jt||typeof safari>"u")return jt}else throw new Error("The option dataurlnewwindow just works in a browser-environment.");break;case"datauri":case"dataurl":return ot.document.location.href=this.output("datauristring",Z);default:return null}}),Ki=function(p){return Array.isArray(_r)===!0&&_r.indexOf(p)>-1};switch(e){case"pt":yt=1;break;case"mm":yt=72/25.4;break;case"cm":yt=72/2.54;break;case"in":yt=72;break;case"px":Ki("px_scaling")==!0?yt=72/96:yt=96/72;break;case"pc":yt=12;break;case"em":yt=12;break;case"ex":yt=6;break;default:if(typeof e=="number")yt=e;else throw new Error("Invalid unit: "+e)}var xr=null;ue(),G();var ao=function(p){return f!==null?xr.encryptor(p,0):function(T){return T}},O0=v.__private__.getPageInfo=v.getPageInfo=function(p){if(isNaN(p)||p%1!==0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");var T=ut[p].objId;return{objId:T,pageNumber:p,pageContext:ut[p]}},so=v.__private__.getPageInfoByObjId=function(p){if(isNaN(p)||p%1!==0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var T in ut)if(ut[T].objId===p)break;return O0(T)},oo=v.__private__.getCurrentPageInfo=v.getCurrentPageInfo=function(){return{objId:ut[Y].objId,pageNumber:Y,pageContext:ut[Y]}};v.addPage=function(){return Ba.apply(this,arguments),this},v.setPage=function(){return k0.apply(this,arguments),ve.call(this,se[Y]),this},v.insertPage=function(p){return this.addPage(),this.movePage(Y,p),this},v.movePage=function(p,T){var Z,le;if(p>T){Z=se[p],le=ut[p];for(var we=p;we>T;we--)se[we]=se[we-1],ut[we]=ut[we-1];se[T]=Z,ut[T]=le,this.setPage(T)}else if(p<T){Z=se[p],le=ut[p];for(var Oe=p;Oe<T;Oe++)se[Oe]=se[Oe+1],ut[Oe]=ut[Oe+1];se[T]=Z,ut[T]=le,this.setPage(T)}return this},v.deletePage=function(){return eo.apply(this,arguments),this},v.__private__.text=v.text=function(p,T,Z,le,we){le=le||{};var Oe=le.scope||this,Ge,Xe,et,dt,At,xt,wt,ur;if(typeof p=="number"&&typeof T=="number"&&(typeof Z=="string"||Array.isArray(Z))){var jt=Z;Z=T,T=p,p=jt}var _t;if(arguments[3]instanceof st?(D("The transform parameter of text() with a Matrix value"),_t=we):(wt=arguments[3],et=arguments[4],dt=arguments[5],(typeof wt!="object"||wt===null)&&(typeof et=="string"&&(dt=et,et=null),typeof wt=="string"&&(dt=wt,wt=null),typeof wt=="number"&&(et=wt,wt=null),le={flags:wt,angle:et,align:dt})),isNaN(T)||isNaN(Z)||typeof p>"u"||p===null)throw new Error("Invalid arguments passed to jsPDF.text");if(p.length===0)return Oe;var tr="",Mr=!1,Jn=typeof le.lineHeightFactor=="number"?le.lineHeightFactor:yi,oa=Oe.internal.scaleFactor;function q0(vt){return vt=vt.split(" ").join(Array(le.TabLen||9).join(" ")),An(vt,wt)}function ja(vt){for(var It=vt.concat(),St=[],Wt=It.length,Kt;Wt--;)Kt=It.shift(),typeof Kt=="string"?St.push(Kt):Array.isArray(vt)&&(Kt.length===1||Kt[1]===void 0&&Kt[2]===void 0)?St.push(Kt[0]):St.push([Kt[0],Kt[1],Kt[2]]);return St}funct