/** @license * * jsPDF - PDF Document creation from JavaScript * Version 2.1.1 Built on 2020-09-07T12:58:19.950Z * CommitID 00000000 * * Copyright (c) 2010-2020 James Hall , https://github.com/MrRio/jsPDF * 2015-2020 yWorks GmbH, http://www.yworks.com * 2015-2020 Lukas Holländer , https://github.com/HackbrettXXX * 2016-2018 Aras Abbasi * 2010 Aaron Spike, https://github.com/acspike * 2012 Willow Systems Corporation, willow-systems.com * 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 */ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,r=function(){return"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this}(); /** * A class to parse color values * @author Stoyan Stefanov * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} * @license Use it if you like it */function n(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 r=[{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)]}}],n=0;n255?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),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r}}function i(){r.console&&"function"==typeof r.console.log&&r.console.log.apply(r.console,arguments)}t=require("atob"),e=require("btoa");var a={log:i,warn:function(t){r.console&&("function"==typeof r.console.warn?r.console.warn.apply(r.console,arguments):i.call(null,arguments))},error:function(t){r.console&&("function"==typeof r.console.error?r.console.error.apply(r.console,arguments):i(t))}};function o(t){if("object"!=typeof t)throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(t,r,n){if(n=n||!1,"string"!=typeof t||"function"!=typeof r||"boolean"!=typeof n)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]=[r,!!n],i},this.unsubscribe=function(t){for(var r in e)if(e[r][t])return delete e[r][t],0===Object.keys(e[r]).length&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var i=Array.prototype.slice.call(arguments,1),o=[];for(var s in e[n]){var u=e[n][s];try{u[0].apply(t,i)}catch(t){r.console&&a.error("jsPDF PubSub Error",t.message,t)}u[1]&&o.push(s)}o.length&&o.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function s(t){if(!(this instanceof s))return new s(t);var e="opacity,stroke-opacity".split(",");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id="",this.objectNumber=-1}function u(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function c(t,e,r,n,i){if(!(this instanceof c))return new c(t,e,r,n,i);this.type="axial"===t?2:3,this.coords=e,this.colors=r,u.call(this,n,i)}function h(t,e,r,n,i){if(!(this instanceof h))return new h(t,e,r,n,i);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream="",this.cloneIndex=0,u.call(this,n,i)}function l(t){var i,u="string"==typeof arguments[0]?arguments[0]:"p",f=arguments[1],d=arguments[2],p=arguments[3],g=[],m=1,v=16,b="S";"object"==typeof(t=t||{})&&(u=t.orientation,f=t.unit||f,d=t.format||d,p=t.compress||t.compressPdf||p,m="number"==typeof t.userUnit?Math.abs(t.userUnit):1,void 0!==t.precision&&(i=t.precision),void 0!==t.floatPrecision&&(v=t.floatPrecision),b=t.defaultPathOperation||"S"),g=t.filters||(!0===p?["FlateEncode"]:g),f=f||"mm",u=(""+(u||"P")).toLowerCase();var y=t.putOnlyUsedFonts||!1,w={},N={internal:{},__private__:{}};N.__private__.PubSub=o;var x="1.3",A=N.__private__.getPdfVersion=function(){return x};N.__private__.setPdfVersion=function(t){x=t};var L={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]};N.__private__.getPageFormats=function(){return L};var _=N.__private__.getPageFormat=function(t){return L[t]};d=d||"a4";var S={COMPAT:"compat",ADVANCED:"advanced"},P=S.COMPAT;function k(){this.saveGraphicsState(),at(new Rt(wt,0,0,-wt,0,Fr()*wt).toString()+" cm"),this.setFontSize(this.getFontSize()/wt),b="n",P=S.ADVANCED}function F(){this.restoreGraphicsState(),b="S",P=S.COMPAT}N.advancedAPI=function(t){var e=P===S.COMPAT;return e&&k.call(this),"function"!=typeof t||(t(this),e&&F.call(this)),this},N.compatAPI=function(t){var e=P===S.ADVANCED;return e&&F.call(this),"function"!=typeof t||(t(this),e&&k.call(this)),this},N.isAdvancedAPI=function(){return P===S.ADVANCED};var I,C=function(t){if(P!==S.ADVANCED)throw new Error(t+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},j=N.roundToPrecision=N.__private__.roundToPrecision=function(t,e){var r=i||e;if(isNaN(t)||isNaN(r))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return t.toFixed(r).replace(/0+$/,"")};I=N.hpf=N.__private__.hpf="number"==typeof v?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return j(t,v)}:"smart"===v?function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return j(t,t>-1&&t<1?16:5)}:function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.hpf");return j(t,16)};var B=N.f2=N.__private__.f2=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f2");return j(t,2)},O=N.__private__.f3=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.f3");return j(t,3)},M=N.scale=N.__private__.scale=function(t){if(isNaN(t))throw new Error("Invalid argument passed to jsPDF.scale");return P===S.COMPAT?t*wt:P===S.ADVANCED?t:void 0},q=function(t){return P===S.COMPAT?Fr()-t:P===S.ADVANCED?t:void 0},E=function(t){return M(q(t))};N.__private__.setPrecision=N.setPrecision=function(t){"number"==typeof parseInt(t,10)&&(i=parseInt(t,10))};var D,R="00000000000000000000000000000000",T=N.__private__.getFileId=function(){return R},U=N.__private__.setFileId=function(t){return R=void 0!==t&&/^[a-fA-F0-9]{32}$/.test(t)?t.toUpperCase():R.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join("")};N.setFileId=function(t){return U(t),this},N.getFileId=function(){return T()};var z=N.__private__.convertDateToPDFDate=function(t){var e=t.getTimezoneOffset(),r=e<0?"+":"-",n=Math.floor(Math.abs(e/60)),i=Math.abs(e%60),a=[r,Y(n),"'",Y(i),"'"].join("");return["D:",t.getFullYear(),Y(t.getMonth()+1),Y(t.getDate()),Y(t.getHours()),Y(t.getMinutes()),Y(t.getSeconds()),a].join("")},H=N.__private__.convertPDFDateToDate=function(t){var e=parseInt(t.substr(2,4),10),r=parseInt(t.substr(6,2),10)-1,n=parseInt(t.substr(8,2),10),i=parseInt(t.substr(10,2),10),a=parseInt(t.substr(12,2),10),o=parseInt(t.substr(14,2),10);return new Date(e,r,n,i,a,o,0)},W=N.__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 D=e},V=N.__private__.getCreationDate=function(t){var e=D;return"jsDate"===t&&(e=H(D)),e};N.setCreationDate=function(t){return W(t),this},N.getCreationDate=function(t){return V(t)};var G,Y=N.__private__.padd2=function(t){return("0"+parseInt(t)).slice(-2)},J=N.__private__.padd2Hex=function(t){return("00"+(t=t.toString())).substr(t.length)},X=0,K=[],Z=[],$=0,Q=[],tt=[],et=!1,rt=Z,nt=function(){X=0,$=0,Z=[],K=[],Q=[],Yt=Wt(),Jt=Wt()};N.__private__.setCustomOutputDestination=function(t){et=!0,rt=t};var it=function(t){et||(rt=t)};N.__private__.resetCustomOutputDestination=function(){et=!1,rt=Z};var at=N.__private__.out=function(t){return t=t.toString(),$+=t.length+1,rt.push(t),rt},ot=N.__private__.write=function(t){return at(1===arguments.length?t.toString():Array.prototype.join.call(arguments," "))},st=N.__private__.getArrayBuffer=function(t){for(var e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r);e--;)n[e]=t.charCodeAt(e);return r},ut=[["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]];N.__private__.getStandardFonts=function(){return ut};var ct=t.fontSize||16;N.__private__.setFontSize=N.setFontSize=function(t){return ct=P===S.ADVANCED?t/wt:t,this};var ht,lt=N.__private__.getFontSize=N.getFontSize=function(){return P===S.COMPAT?ct:ct*wt},ft=t.R2L||!1;N.__private__.setR2L=N.setR2L=function(t){return ft=t,this},N.__private__.getR2L=N.getR2L=function(){return ft};var dt,pt=N.__private__.setZoomMode=function(t){var e=[void 0,null,"fullwidth","fullheight","fullpage","original"];if(/^\d*\.?\d*%$/.test(t))ht=t;else if(isNaN(t)){if(-1===e.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.');ht=t}else ht=parseInt(t,10)};N.__private__.getZoomMode=function(){return ht};var gt,mt=N.__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.');dt=t};N.__private__.getPageMode=function(){return dt};var vt=N.__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.');gt=t};N.__private__.getLayoutMode=function(){return gt},N.__private__.setDisplayMode=N.setDisplayMode=function(t,e,r){return pt(t),vt(e),mt(r),this};var bt={title:"",subject:"",author:"",keywords:"",creator:""};N.__private__.getDocumentProperty=function(t){if(-1===Object.keys(bt).indexOf(t))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return bt[t]},N.__private__.getDocumentProperties=function(){return bt},N.__private__.setDocumentProperties=N.setProperties=N.setDocumentProperties=function(t){for(var e in bt)bt.hasOwnProperty(e)&&t[e]&&(bt[e]=t[e]);return this},N.__private__.setDocumentProperty=function(t,e){if(-1===Object.keys(bt).indexOf(t))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return bt[t]=e};var yt,wt,Nt,xt,At,Lt={},_t={},St=[],Pt={},kt={},Ft={},It={},Ct=null,jt=0,Bt=[],Ot=new o(N),Mt=t.hotfixes||[],qt={},Et={},Dt=[],Rt=function(t,e,r,n,i,a){if(!(this instanceof Rt))return new Rt(t,e,r,n,i,a);isNaN(t)&&(t=1),isNaN(e)&&(e=0),isNaN(r)&&(r=0),isNaN(n)&&(n=1),isNaN(i)&&(i=0),isNaN(a)&&(a=0),this._matrix=[t,e,r,n,i,a]};Object.defineProperty(Rt.prototype,"sx",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Rt.prototype,"shy",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Rt.prototype,"shx",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Rt.prototype,"sy",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Rt.prototype,"tx",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Rt.prototype,"ty",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Rt.prototype,"a",{get:function(){return this._matrix[0]},set:function(t){this._matrix[0]=t}}),Object.defineProperty(Rt.prototype,"b",{get:function(){return this._matrix[1]},set:function(t){this._matrix[1]=t}}),Object.defineProperty(Rt.prototype,"c",{get:function(){return this._matrix[2]},set:function(t){this._matrix[2]=t}}),Object.defineProperty(Rt.prototype,"d",{get:function(){return this._matrix[3]},set:function(t){this._matrix[3]=t}}),Object.defineProperty(Rt.prototype,"e",{get:function(){return this._matrix[4]},set:function(t){this._matrix[4]=t}}),Object.defineProperty(Rt.prototype,"f",{get:function(){return this._matrix[5]},set:function(t){this._matrix[5]=t}}),Object.defineProperty(Rt.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Rt.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Rt.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Rt.prototype,"isIdentity",{get:function(){return 1===this.sx&&(0===this.shy&&(0===this.shx&&(1===this.sy&&(0===this.tx&&0===this.ty))))}}),Rt.prototype.join=function(t){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(I).join(t)},Rt.prototype.multiply=function(t){var e=t.sx*this.sx+t.shy*this.shx,r=t.sx*this.shy+t.shy*this.sy,n=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,o=t.tx*this.shy+t.ty*this.sy+this.ty;return new Rt(e,r,n,i,a,o)},Rt.prototype.decompose=function(){var t=this.sx,e=this.shy,r=this.shx,n=this.sy,i=this.tx,a=this.ty,o=Math.sqrt(t*t+e*e),s=(t/=o)*r+(e/=o)*n;r-=t*s,n-=e*s;var u=Math.sqrt(r*r+n*n);return s/=u,t*(n/=u)>16&255,i=c>>8&255,a=255&c}if(void 0===i||void 0===o&&r===i&&i===a)if("string"==typeof r)e=r+" "+s[0];else switch(t.precision){case 2:e=B(r/255)+" "+s[0];break;case 3:default:e=O(r/255)+" "+s[0]}else if(void 0===o||"object"==typeof o){if(o&&!isNaN(o.a)&&0===o.a)return e=["1.","1.","1.",s[1]].join(" ");if("string"==typeof r)e=[r,i,a,s[1]].join(" ");else switch(t.precision){case 2:e=[B(r/255),B(i/255),B(a/255),s[1]].join(" ");break;default:case 3:e=[O(r/255),O(i/255),O(a/255),s[1]].join(" ")}}else if("string"==typeof r)e=[r,i,a,o,s[2]].join(" ");else switch(t.precision){case 2:e=[B(r),B(i),B(a),B(o),s[2]].join(" ");break;case 3:default:e=[O(r),O(i),O(a),O(o),s[2]].join(" ")}return e},Zt=N.__private__.getFilters=function(){return g},$t=N.__private__.putStream=function(t){var e=(t=t||{}).data||"",r=t.filters||Zt(),n=t.alreadyAppliedFilters||[],i=t.addLength1||!1,a=e.length,o={};!0===r&&(r=["FlateEncode"]);var s=t.additionalKeyValues||[],u=(o=void 0!==l.API.processDataByFilters?l.API.processDataByFilters(e,r):{data:e,reverseChain:[]}).reverseChain+(Array.isArray(n)?n.join(" "):n.toString());if(0!==o.data.length&&(s.push({key:"Length",value:o.data.length}),!0===i&&s.push({key:"Length1",value:a})),0!=u.length)if(u.split("/").length-1==1)s.push({key:"Filter",value:u});else{s.push({key:"Filter",value:"["+u+"]"});for(var c=0;c>"),0!==o.data.length&&(at("stream"),at(o.data),at("endstream"))},Qt=N.__private__.putPage=function(t){var e=t.number,r=t.data,n=t.objId,i=t.contentsObjId;Vt(n,!0),at("<>"),at("endobj");var a=r.join("\n");return P===S.ADVANCED&&(a+="\nQ"),Vt(i,!0),$t({data:a,filters:Zt()}),at("endobj"),n},te=N.__private__.putPages=function(){var t,e,r=[];for(t=1;t<=jt;t++)Bt[t].objId=Wt(),Bt[t].contentsObjId=Wt();for(t=1;t<=jt;t++)r.push(Qt({number:t,data:tt[t],objId:Bt[t].objId,contentsObjId:Bt[t].contentsObjId,mediaBox:Bt[t].mediaBox,cropBox:Bt[t].cropBox,bleedBox:Bt[t].bleedBox,trimBox:Bt[t].trimBox,artBox:Bt[t].artBox,userUnit:Bt[t].userUnit,rootDictionaryObjId:Yt,resourceDictionaryObjId:Jt}));Vt(Yt,!0),at("<>"),at("endobj"),Ot.publish("postPutPages")},ee=function(t){var e=function(t,e){return-1!==t.indexOf(" ")?"("+Le(t,e)+")":Le(t,e)};Ot.publish("putFont",{font:t,out:at,newObject:Ht,putStream:$t,pdfEscapeWithNeededParanthesis:e}),!0!==t.isAlreadyPutted&&(t.objectNumber=Ht(),at("<<"),at("/Type /Font"),at("/BaseFont /"+e(t.postScriptName)),at("/Subtype /Type1"),"string"==typeof t.encoding&&at("/Encoding /"+t.encoding),at("/FirstChar 32"),at("/LastChar 255"),at(">>"),at("endobj"))},re=function(){for(var t in Lt)Lt.hasOwnProperty(t)&&(!1===y||!0===y&&w.hasOwnProperty(t))&&ee(Lt[t])},ne=function(t){t.objectNumber=Ht();var e=[];e.push({key:"Type",value:"/XObject"}),e.push({key:"Subtype",value:"/Form"}),e.push({key:"BBox",value:"["+[I(t.x),I(t.y),I(t.x+t.width),I(t.y+t.height)].join(" ")+"]"}),e.push({key:"Matrix",value:"["+t.matrix.toString()+"]"});var r=t.pages[1].join("\n");$t({data:r,additionalKeyValues:e}),at("endobj")},ie=function(){for(var t in qt)qt.hasOwnProperty(t)&&ne(qt[t])},ae=function(t,e){var r,n=[],i=1/(e-1);for(r=0;r<1;r+=i)n.push(r);if(n.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 o={offset:1,color:t[t.length-1].color};t.push(o)}for(var s="",u=0,c=0;ct[u+1].offset;)u++;var h=t[u].offset,l=(r-h)/(t[u+1].offset-h),f=t[u].color,d=t[u+1].color;s+=J(Math.round((1-l)*f[0]+l*d[0]).toString(16))+J(Math.round((1-l)*f[1]+l*d[1]).toString(16))+J(Math.round((1-l)*f[2]+l*d[2]).toString(16))}return s.trim()},oe=function(t,e){e||(e=21);var r=Ht(),n=ae(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]"}),$t({data:n,additionalKeyValues:i,alreadyAppliedFilters:["/ASCIIHexDecode"]}),at("endobj"),t.objectNumber=Ht(),at("<< /ShadingType "+t.type),at("/ColorSpace /DeviceRGB");var a="/Coords ["+I(parseFloat(t.coords[0]))+" "+I(parseFloat(t.coords[1]))+" ";2===t.type?a+=I(parseFloat(t.coords[2]))+" "+I(parseFloat(t.coords[3])):a+=I(parseFloat(t.coords[2]))+" "+I(parseFloat(t.coords[3]))+" "+I(parseFloat(t.coords[4]))+" "+I(parseFloat(t.coords[5])),at(a+="]"),t.matrix&&at("/Matrix ["+t.matrix.toString()+"]"),at("/Function "+r+" 0 R"),at("/Extend [true true]"),at(">>"),at("endobj")},se=function(t,e){var r=Wt(),n=Ht();e.push({resourcesOid:r,objectOid:n}),t.objectNumber=n;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(I).join(" ")+"]"}),i.push({key:"XStep",value:I(t.xStep)}),i.push({key:"YStep",value:I(t.yStep)}),i.push({key:"Resources",value:r+" 0 R"}),t.matrix&&i.push({key:"Matrix",value:"["+t.matrix.toString()+"]"}),$t({data:t.stream,additionalKeyValues:i}),at("endobj")},ue=function(t){var e;for(e in Pt)Pt.hasOwnProperty(e)&&(Pt[e]instanceof c?oe(Pt[e]):Pt[e]instanceof h&&se(Pt[e],t))},ce=function(t){for(var e in t.objectNumber=Ht(),at("<<"),t)switch(e){case"opacity":at("/ca "+B(t[e]));break;case"stroke-opacity":at("/CA "+B(t[e]))}at(">>"),at("endobj")},he=function(){var t;for(t in Ft)Ft.hasOwnProperty(t)&&ce(Ft[t])},le=function(){for(var t in at("/XObject <<"),qt)qt.hasOwnProperty(t)&&qt[t].objectNumber>=0&&at("/"+t+" "+qt[t].objectNumber+" 0 R");Ot.publish("putXobjectDict"),at(">>")},fe=function(){for(var t in at("/Font <<"),Lt)Lt.hasOwnProperty(t)&&(!1===y||!0===y&&w.hasOwnProperty(t))&&at("/"+t+" "+Lt[t].objectNumber+" 0 R");at(">>")},de=function(){if(Object.keys(Pt).length>0){for(var t in at("/Shading <<"),Pt)Pt.hasOwnProperty(t)&&Pt[t]instanceof c&&Pt[t].objectNumber>=0&&at("/"+t+" "+Pt[t].objectNumber+" 0 R");Ot.publish("putShadingPatternDict"),at(">>")}},pe=function(t){if(Object.keys(Pt).length>0){for(var e in at("/Pattern <<"),Pt)Pt.hasOwnProperty(e)&&Pt[e]instanceof N.TilingPattern&&Pt[e].objectNumber>=0&&Pt[e].objectNumber>")}},ge=function(){if(Object.keys(Ft).length>0){var t;for(t in at("/ExtGState <<"),Ft)Ft.hasOwnProperty(t)&&Ft[t].objectNumber>=0&&at("/"+t+" "+Ft[t].objectNumber+" 0 R");Ot.publish("putGStateDict"),at(">>")}},me=function(t){Vt(t.resourcesOid,!0),at("<<"),at("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),fe(),de(),pe(t.objectOid),ge(),le(),at(">>"),at("endobj")},ve=function(){var t=[];re(),he(),ie(),ue(t),Ot.publish("putResources"),t.forEach(me),me({resourcesOid:Jt,objectOid:Number.MAX_SAFE_INTEGER}),Ot.publish("postPutResources")},be=function(){Ot.publish("putAdditionalObjects");for(var t=0;t>8&&(u=!0);t=s.join("")}for(r=t.length;void 0===u&&0!==r;)t.charCodeAt(r-1)>>8&&(u=!0),r--;if(!u)return t;for(s=e.noBOM?[]:[254,255],r=0,n=t.length;r>8)>>8)throw new Error("Character at position "+r+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");s.push(h),s.push(c-(h<<8))}return String.fromCharCode.apply(void 0,s)},Le=N.__private__.pdfEscape=N.pdfEscape=function(t,e){return Ae(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},_e=N.__private__.beginPage=function(t){tt[++jt]=[],Bt[jt]={objId:0,contentsObjId:0,userUnit:Number(m),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(t[0]),topRightY:Number(t[1])}},ke(jt),it(tt[G])},Se=function(t,e){var r,n,i;switch(u=e||u,"string"==typeof t&&(r=_(t.toLowerCase()),Array.isArray(r)&&(n=r[0],i=r[1])),Array.isArray(t)&&(n=t[0]*wt,i=t[1]*wt),isNaN(n)&&(n=d[0],i=d[1]),(n>14400||i>14400)&&(a.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),n=Math.min(14400,n),i=Math.min(14400,i)),d=[n,i],u.substr(0,1)){case"l":i>n&&(d=[i,n]);break;case"p":n>i&&(d=[i,n])}_e(d),ir(nr),at(fr),0!==br&&at(br+" J"),0!==yr&&at(yr+" j"),Ot.publish("addPage",{pageNumber:jt})},Pe=function(t){t>0&&t<=jt&&(tt.splice(t,1),Bt.splice(t,1),jt--,G>jt&&(G=jt),this.setPage(G))},ke=function(t){t>0&&t<=jt&&(G=t)},Fe=N.__private__.getNumberOfPages=N.getNumberOfPages=function(){return tt.length-1},Ie=function(t,e,r){var n,i=void 0;return r=r||{},t=void 0!==t?t:Lt[yt].fontName,e=void 0!==e?e:Lt[yt].fontStyle,n=t.toLowerCase(),void 0!==_t[n]&&void 0!==_t[n][e]?i=_t[n][e]:void 0!==_t[t]&&void 0!==_t[t][e]?i=_t[t][e]:!1===r.disableWarning&&a.warn("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts."),i||r.noFallback||null==(i=_t.times[e])&&(i=_t.times.normal),i},Ce=N.__private__.putInfo=function(){for(var t in Ht(),at("<<"),at("/Producer (jsPDF "+l.version+")"),bt)bt.hasOwnProperty(t)&&bt[t]&&at("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+Le(bt[t])+")");at("/CreationDate ("+D+")"),at(">>"),at("endobj")},je=N.__private__.putCatalog=function(t){var e=(t=t||{}).rootDictionaryObjId||Yt;switch(Ht(),at("<<"),at("/Type /Catalog"),at("/Pages "+e+" 0 R"),ht||(ht="fullwidth"),ht){case"fullwidth":at("/OpenAction [3 0 R /FitH null]");break;case"fullheight":at("/OpenAction [3 0 R /FitV null]");break;case"fullpage":at("/OpenAction [3 0 R /Fit]");break;case"original":at("/OpenAction [3 0 R /XYZ null null 1]");break;default:var r=""+ht;"%"===r.substr(r.length-1)&&(ht=parseInt(ht)/100),"number"==typeof ht&&at("/OpenAction [3 0 R /XYZ null null "+B(ht)+"]")}switch(gt||(gt="continuous"),gt){case"continuous":at("/PageLayout /OneColumn");break;case"single":at("/PageLayout /SinglePage");break;case"two":case"twoleft":at("/PageLayout /TwoColumnLeft");break;case"tworight":at("/PageLayout /TwoColumnRight")}dt&&at("/PageMode /"+dt),Ot.publish("putCatalog"),at(">>"),at("endobj")},Be=N.__private__.putTrailer=function(){at("trailer"),at("<<"),at("/Size "+(X+1)),at("/Root "+X+" 0 R"),at("/Info "+(X-1)+" 0 R"),at("/ID [ <"+R+"> <"+R+"> ]"),at(">>")},Oe=N.__private__.putHeader=function(){at("%PDF-"+x),at("%ºß¬à")},Me=N.__private__.putXRef=function(){var t="0000000000";at("xref"),at("0 "+(X+1)),at("0000000000 65535 f ");for(var e=1;e<=X;e++){"function"==typeof K[e]?at((t+K[e]()).slice(-10)+" 00000 n "):void 0!==K[e]?at((t+K[e]).slice(-10)+" 00000 n "):at("0000000000 00000 n ")}},qe=N.__private__.buildDocument=function(){nt(),it(Z),Ot.publish("buildDocument"),Oe(),te(),be(),ve(),Ce(),je();var t=$;return Me(),Be(),at("startxref"),at(""+t),at("%%EOF"),it(tt[G]),Z.join("\n")},Ee=N.__private__.getBlob=function(t){return new Blob([st(t)],{type:"application/pdf"})},De=N.output=N.__private__.output=xe((function(t,n){switch("string"==typeof(n=n||{})?n={filename:n}:n.filename=n.filename||"generated.pdf",t){case void 0:return qe();case"save":N.save(n.filename);break;case"arraybuffer":return st(qe());case"blob":return Ee(qe());case"bloburi":case"bloburl":if(void 0!==r.URL&&"function"==typeof r.URL.createObjectURL)return r.URL&&r.URL.createObjectURL(Ee(qe()))||void 0;a.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var i="",o=qe();try{i=e(o)}catch(t){i=e(unescape(encodeURIComponent(o)))}return"data:application/pdf;filename="+n.filename+";base64,"+i;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(r)){var s='