diff --git a/editor/jspdf/jspdf.min.js b/editor/jspdf/jspdf.min.js index 63c63f2f..cf0d7977 100644 --- a/editor/jspdf/jspdf.min.js +++ b/editor/jspdf/jspdf.min.js @@ -165,7 +165,7 @@ MIT license. * Collected from public resources by * https://github.com/diegocr */ -!function(t,e){e["true"]=t;var r=function(t){"use strict";function e(e){var r={};this.subscribe=function(t,e,n){if("function"!=typeof e)return!1;r.hasOwnProperty(t)||(r[t]={});var s=Math.random().toString(35);return r[t][s]=[e,!!n],s},this.unsubscribe=function(t){for(var e in r)if(r[e][t])return delete r[e][t],!0;return!1},this.publish=function(n){if(r.hasOwnProperty(n)){var s=Array.prototype.slice.call(arguments,1),o=[];for(var i in r[n]){var a=r[n][i];try{a[0].apply(e,s)}catch(u){t.console&&console.error("jsPDF PubSub Error",u.message,u)}a[1]&&o.push(i)}o.length&&o.forEach(this.unsubscribe)}}}function r(a,u,c,l){var f={};"object"==typeof a&&(f=a,a=f.orientation,u=f.unit||u,c=f.format||c,l=f.compress||f.compressPdf||l),u=u||"mm",c=c||"a4",a=(""+(a||"P")).toLowerCase();var d,h,p,m,w,y=(""+c).toLowerCase(),g=!!l&&"function"==typeof Uint8Array,v=f.textColor||"0 g",b=f.drawColor||"0 G",q=f.fontSize||16,x=f.lineHeight||1.15,k=f.lineWidth||.200025,_=2,A=!1,C=[],S={},E={},z=0,I=[],T=[],B=0,O=0,P=0,R={title:"",subject:"",author:"",keywords:"",creator:""},D={},U=new e(D),F=function(t){return t.toFixed(2)},L=function(t){return t.toFixed(3)},j=function(t){return("0"+parseInt(t)).slice(-2)},N=function(t){A?I[z].push(t):(P+=t.length+1,T.push(t))},M=function(){return _++,C[_]=P,N(_+" 0 obj"),_},H=function(t){N("stream"),N(t),N("endstream")},G=function(){var e,n,o,i,a,u,c,l=m*h,f=w*h;for(c=t.adler32cs||r.adler32cs,g&&"undefined"==typeof c&&(g=!1),e=1;z>=e;e++){if(M(),N("<>"),N("endobj"),n=I[e].join("\n"),M(),g){for(o=[],i=n.length;i--;)o[i]=n.charCodeAt(i);u=c.from(n),a=new s(6),a.append(new Uint8Array(o)),n=a.flush(),o=new Uint8Array(n.length+6),o.set(new Uint8Array([120,156])),o.set(n,2),o.set(new Uint8Array([255&u,u>>8&255,u>>16&255,u>>24&255]),n.length+2),n=String.fromCharCode.apply(null,o),N("<>")}else N("<>");H(n),N("endobj")}C[1]=P,N("1 0 obj"),N("<i;i++)d+=3+2*i+" 0 R ";N(d+"]"),N("/Count "+z),N("/MediaBox [0 0 "+F(l)+" "+F(f)+"]"),N(">>"),N("endobj")},J=function(t){t.objectNumber=M(),N("<>"),N("endobj")},V=function(){for(var t in S)S.hasOwnProperty(t)&&J(S[t])},W=function(){U.publish("putXobjectDict")},X=function(){N("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),N("/Font <<");for(var t in S)S.hasOwnProperty(t)&&N("/"+t+" "+S[t].objectNumber+" 0 R");N(">>"),N("/XObject <<"),W(),N(">>")},Y=function(){V(),U.publish("putResources"),C[2]=P,N("2 0 obj"),N("<<"),X(),N(">>"),N("endobj"),U.publish("postPutResources")},K=function(t,e,r){E.hasOwnProperty(e)||(E[e]={}),E[e][r]=t},Q=function(t,e,r,n){var s="F"+(Object.keys(S).length+1).toString(10),o=S[s]={id:s,PostScriptName:t,fontName:e,fontStyle:r,encoding:n,metadata:{}};return K(s,e,r),U.publish("addFont",o),s},$=function(){for(var t="helvetica",e="times",r="courier",n="normal",s="bold",o="italic",i="bolditalic",a="StandardEncoding",u=[["Helvetica",t,n],["Helvetica-Bold",t,s],["Helvetica-Oblique",t,o],["Helvetica-BoldOblique",t,i],["Courier",r,n],["Courier-Bold",r,s],["Courier-Oblique",r,o],["Courier-BoldOblique",r,i],["Times-Roman",e,n],["Times-Bold",e,s],["Times-Italic",e,o],["Times-BoldItalic",e,i]],c=0,l=u.length;l>c;c++){var f=Q(u[c][0],u[c][1],u[c][2],a),d=u[c][0].split("-");K(f,d[0],d[1]||"")}U.publish("addFonts",{fonts:S,dictionary:E})},Z=function(e){return e.foo=function(){try{return e.apply(this,arguments)}catch(r){var n=r.stack||"";~n.indexOf(" at ")&&(n=n.split(" at ")[1]);var s="Error in function "+n.split("\n")[0].split("<")[0]+": "+r.message;if(!t.console)throw new Error(s);console.log(s,r),t.alert&&alert(s),console.trace()}},e.foo.bar=e,e.foo},te=function(t,e){var r,n,s,o,i,a,u,c,l;if(e=e||{},s=e.sourceEncoding||"Unicode",i=e.outputEncoding,(e.autoencode||i)&&S[d].metadata&&S[d].metadata[s]&&S[d].metadata[s].encoding&&(o=S[d].metadata[s].encoding,!i&&S[d].encoding&&(i=S[d].encoding),!i&&o.codePages&&(i=o.codePages[0]),"string"==typeof i&&(i=o[i]),i)){for(u=!1,a=[],r=0,n=t.length;n>r;r++)c=i[t.charCodeAt(r)],c?a.push(String.fromCharCode(c)):a.push(t[r]),a[r].charCodeAt(0)>>8&&(u=!0);t=a.join("")}for(r=t.length;void 0===u&&0!==r;)t.charCodeAt(r-1)>>8&&(u=!0),r--;if(!u)return t;for(a=e.noBOM?[]:[254,255],r=0,n=t.length;n>r;r++){if(c=t.charCodeAt(r),l=c>>8,l>>8)throw new Error("Character at position "+r+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(l),a.push(c-(l<<8))}return String.fromCharCode.apply(void 0,a)},ee=function(t,e){return te(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},re=function(){N("/Producer (jsPDF "+r.version+")");for(var t in R)R.hasOwnProperty(t)&&R[t]&&N("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+ee(R[t])+")");var e=new Date;N(["/CreationDate (D:",e.getFullYear(),j(e.getMonth()+1),j(e.getDate()),j(e.getHours()),j(e.getMinutes()),j(e.getSeconds()),")"].join(""))},ne=function(){N("/Type /Catalog"),N("/Pages 1 0 R"),N("/OpenAction [3 0 R /FitH null]"),N("/PageLayout /OneColumn"),U.publish("putCatalog")},se=function(){N("/Size "+(_+1)),N("/Root "+_+" 0 R"),N("/Info "+(_-1)+" 0 R")},oe=function(){z++,A=!0,I[z]=[]},ie=function(){oe(),N(F(k*h)+" w"),N(b),0!==B&&N(B+" J"),0!==O&&N(O+" j"),U.publish("addPage",{pageNumber:z})},ae=function(t,e){var r;t=void 0!==t?t:S[d].fontName,e=void 0!==e?e:S[d].fontStyle;try{r=E[t][e]}catch(n){}if(!r)throw new Error("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts.");return r},ue=function(){A=!1,_=2,T=[],C=[],N("%PDF-"+o),G(),Y(),M(),N("<<"),re(),N(">>"),N("endobj"),M(),N("<<"),ne(),N(">>"),N("endobj");var t,e=P,r="0000000000";for(N("xref"),N("0 "+(_+1)),N(r+" 65535 f "),t=1;_>=t;t++)N((r+C[t]).slice(-10)+" 00000 n ");return N("trailer"),N("<<"),se(),N(">>"),N("startxref"),N(e),N("%%EOF"),A=!0,T.join("\n")},ce=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":("f"===t||"f*"===t||"B"===t||"B*"===t)&&(e=t),e},le=function(){for(var t=ue(),e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r);e--;)n[e]=t.charCodeAt(e);return r},fe=function(){return new Blob([le()],{type:"application/pdf"})},de=Z(function(e,r){switch(e){case void 0:return ue();case"save":if(navigator.getUserMedia&&(void 0===t.URL||void 0===t.URL.createObjectURL))return D.output("dataurlnewwindow");n(fe(),r),"function"==typeof n.unload&&t.setTimeout&&setTimeout(n.unload,70);break;case"arraybuffer":return le();case"blob":return fe();case"datauristring":case"dataurlstring":return"data:application/pdf;base64,"+btoa(ue());case"datauri":case"dataurl":t.document.location.href="data:application/pdf;base64,"+btoa(ue());break;case"dataurlnewwindow":t.open("data:application/pdf;base64,"+btoa(ue()));break;default:throw new Error('Output type "'+e+'" is not supported.')}});switch(u){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=96/72;break;case"pc":h=12;break;case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+u}if(i.hasOwnProperty(y))w=i[y][1]/h,m=i[y][0]/h;else try{w=c[1],m=c[0]}catch(he){throw new Error("Invalid format: "+c)}if("p"===a||"portrait"===a)a="p",m>w&&(p=m,m=w,w=p);else{if("l"!==a&&"landscape"!==a)throw"Invalid orientation: "+a;a="l",w>m&&(p=m,m=w,w=p)}D.internal={pdfEscape:ee,getStyle:ce,getFont:function(){return S[ae.apply(D,arguments)]},getFontSize:function(){return q},getLineHeight:function(){return q*x},write:function(t){N(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return F(t*h)},getVerticalCoordinateString:function(t){return F((w-t)*h)},collections:{},newObject:M,putStream:H,events:U,scaleFactor:h,pageSize:{width:m,height:w},output:function(t,e){return de(t,e)},getNumberOfPages:function(){return I.length-1},pages:I},D.addPage=function(){return ie(),this},D.text=function(t,e,r,n,s){function o(t){return t=t.split(" ").join(Array(f.TabLen||9).join(" ")),ee(t,n)}"number"==typeof t&&(p=r,r=e,e=t,t=p),"string"==typeof t&&t.match(/[\n\r]/)&&(t=t.split(/\r\n|\r|\n/g)),"number"==typeof n&&(s=n,n=null);var i="",a="Td";if(s){s*=Math.PI/180;var u=Math.cos(s),c=Math.sin(s);i=[F(u),F(c),F(-1*c),F(u),""].join(" "),a="Tm"}if(n=n||{},"noBOM"in n||(n.noBOM=!0),"autoencode"in n||(n.autoencode=!0),"string"==typeof t)t=o(t);else{if(!(t instanceof Array))throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');for(var l=t.concat(),m=[],y=l.length;y--;)m.push(o(l.shift()));t=m.join(") Tj\nT* (")}return N("BT\n/"+d+" "+q+" Tf\n"+q*x+" TL\n"+v+"\n"+i+F(e*h)+" "+F((w-r)*h)+" "+a+"\n("+t+") Tj\nET"),this},D.line=function(t,e,r,n){return this.lines([[r-t,n-e]],t,e)},D.lines=function(t,e,r,n,s,o){var i,a,u,c,l,f,d,m,y,g,v;for("number"==typeof t&&(p=r,r=e,e=t,t=p),n=n||[1,1],N(L(e*h)+" "+L((w-r)*h)+" m "),i=n[0],a=n[1],c=t.length,g=e,v=r,u=0;c>u;u++)l=t[u],2===l.length?(g=l[0]*i+g,v=l[1]*a+v,N(L(g*h)+" "+L((w-v)*h)+" l")):(f=l[0]*i+g,d=l[1]*a+v,m=l[2]*i+g,y=l[3]*a+v,g=l[4]*i+g,v=l[5]*a+v,N(L(f*h)+" "+L((w-d)*h)+" "+L(m*h)+" "+L((w-y)*h)+" "+L(g*h)+" "+L((w-v)*h)+" c"));return o&&N(" h"),null!==s&&N(ce(s)),this},D.rect=function(t,e,r,n,s){ce(s);return N([F(t*h),F((w-e)*h),F(r*h),F(-n*h),"re"].join(" ")),null!==s&&N(ce(s)),this},D.triangle=function(t,e,r,n,s,o,i){return this.lines([[r-t,n-e],[s-r,o-n],[t-s,e-o]],t,e,[1,1],i,!0),this},D.roundedRect=function(t,e,r,n,s,o,i){var a=4/3*(Math.SQRT2-1);return this.lines([[r-2*s,0],[s*a,0,s,o-o*a,s,o],[0,n-2*o],[0,o*a,-(s*a),o,-s,o],[-r+2*s,0],[-(s*a),0,-s,-(o*a),-s,-o],[0,-n+2*o],[0,-(o*a),s*a,-o,s,-o]],t+s,e,[1,1],i),this},D.ellipse=function(t,e,r,n,s){var o=4/3*(Math.SQRT2-1)*r,i=4/3*(Math.SQRT2-1)*n;return N([F((t+r)*h),F((w-e)*h),"m",F((t+r)*h),F((w-(e-i))*h),F((t+o)*h),F((w-(e-n))*h),F(t*h),F((w-(e-n))*h),"c"].join(" ")),N([F((t-o)*h),F((w-(e-n))*h),F((t-r)*h),F((w-(e-i))*h),F((t-r)*h),F((w-e)*h),"c"].join(" ")),N([F((t-r)*h),F((w-(e+i))*h),F((t-o)*h),F((w-(e+n))*h),F(t*h),F((w-(e+n))*h),"c"].join(" ")),N([F((t+o)*h),F((w-(e+n))*h),F((t+r)*h),F((w-(e+i))*h),F((t+r)*h),F((w-e)*h),"c"].join(" ")),null!==s&&N(ce(s)),this},D.circle=function(t,e,r,n){return this.ellipse(t,e,r,r,n)},D.setProperties=function(t){for(var e in R)R.hasOwnProperty(e)&&t[e]&&(R[e]=t[e]);return this},D.setFontSize=function(t){return q=t,this},D.setFont=function(t,e){return d=ae(t,e),this},D.setFontStyle=D.setFontType=function(t){return d=ae(void 0,t),this},D.getFontList=function(){var t,e,r,n={};for(t in E)if(E.hasOwnProperty(t)){n[t]=r=[];for(e in E[t])E[t].hasOwnProperty(e)&&r.push(e)}return n},D.setLineWidth=function(t){return N((t*h).toFixed(2)+" w"),this},D.setDrawColor=function(t,e,r,n){var s;return s=void 0===e||void 0===n&&t===e===r?"string"==typeof t?t+" G":F(t/255)+" G":void 0===n?"string"==typeof t?[t,e,r,"RG"].join(" "):[F(t/255),F(e/255),F(r/255),"RG"].join(" "):"string"==typeof t?[t,e,r,n,"K"].join(" "):[F(t),F(e),F(r),F(n),"K"].join(" "),N(s),this},D.setFillColor=function(t,e,r,n){var s;return s=void 0===e||void 0===n&&t===e===r?"string"==typeof t?t+" g":F(t/255)+" g":void 0===n?"string"==typeof t?[t,e,r,"rg"].join(" "):[F(t/255),F(e/255),F(r/255),"rg"].join(" "):"string"==typeof t?[t,e,r,n,"k"].join(" "):[F(t),F(e),F(r),F(n),"k"].join(" "),N(s),this},D.setTextColor=function(t,e,r){if("string"==typeof t&&/^#[0-9A-Fa-f]{6}$/.test(t)){var n=parseInt(t.substr(1),16);t=n>>16&255,e=n>>8&255,r=255&n}return v=0===t&&0===e&&0===r||"undefined"==typeof e?L(t/255)+" g":[L(t/255),L(e/255),L(r/255),"rg"].join(" "),this},D.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},D.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return B=e,N(e+" J"),this},D.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return O=e,N(e+" j"),this},D.output=de,D.save=function(t){D.output("save",t)};for(var pe in r.API)r.API.hasOwnProperty(pe)&&("events"===pe&&r.API.events.length?!function(t,e){var r,n,s;for(s=e.length-1;-1!==s;s--)r=e[s][0],n=e[s][1],t.subscribe.apply(t,[r].concat("function"==typeof n?[n]:n))}(U,r.API.events):D[pe]=r.API[pe]);return $(),d="F1",ie(),U.publish("initialized"),D}var o="1.3",i={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]};return r.API={events:[]},r.version="1.0.150-git 2014-05-30T00:40:diegocr","function"==typeof define&&define.amd?define(function(){return r}):t.jsPDF=r,r}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this);!function(t){"use strict";t.addHTML=function(t,e,r,n,s){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof e&&(n=e,s=r),"function"==typeof n&&(s=n,n=null);var o=this.internal,i=o.scaleFactor,a=o.pageSize.width,u=o.pageSize.height;if(n=n||{},n.onrendered=function(t){e=parseInt(e)||0,r=parseInt(r)||0;var o=n.dim||{},c=o.h||0,l=o.w||Math.min(a,t.width/i)-e,f="JPEG";if(n.format&&(f=n.format),t.height>u&&n.pagesplit){var d=function(){for(var n=0;;){var o=document.createElement("canvas");o.width=Math.min(a*i,t.width),o.height=Math.min(u*i,t.height-n);var c=o.getContext("2d");c.drawImage(t,0,n,t.width,o.height,0,0,o.width,o.height);var d=[o,e,n?0:r,o.width/i,o.height/i,f,null,"SLOW"];if(this.addImage.apply(this,d),n+=o.height,n>=t.height)break;this.addPage()}s(l,n,null,d)}.bind(this);if("CANVAS"===t.nodeName){var h=new Image;h.onload=d,h.src=t.toDataURL("image/png"),t=h}else d()}else{var p=Math.random().toString(35),m=[t,e,r,l,c,f,p,"SLOW"];this.addImage.apply(this,m),s(l,c,p,m)}}.bind(this),"undefined"!=typeof html2canvas&&!n.rstz)return html2canvas(t,n);if("undefined"!=typeof rasterizeHTML){var c="drawDocument";return"string"==typeof t&&(c=/^http/.test(t)?"drawURL":"drawHTML"),n.width=n.width||a*i,rasterizeHTML[c](t,void 0,n).then(function(t){n.onrendered(t.image)},function(t){s(null,t)})}return null}}(r.API),function(t){"use strict";var e="addImage_",r=["jpeg","jpg","png"],n=function(t){var e=this.internal.newObject(),r=this.internal.write,s=this.internal.putStream;if(t.n=e,r("<>"),"trns"in t&&t.trns.constructor==Array){for(var o="",i=0,a=t.trns.length;a>i;i++)o+=t.trns[i]+" "+t.trns[i]+" ";r("/Mask ["+o+"]")}if("smask"in t&&r("/SMask "+(e+1)+" 0 R"),r("/Length "+t.data.length+">>"),s(t.data),r("endobj"),"smask"in t){var u="/Predictor 15 /Colors 1 /BitsPerComponent "+t.bpc+" /Columns "+t.w,c={w:t.w,h:t.h,cs:"DeviceGray",bpc:t.bpc,dp:u,data:t.smask};"f"in t&&(c.f=t.f),n.call(this,c)}t.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+t.pal.length+">>"),s(this.arrayBufferToBinaryString(new Uint8Array(t.pal))),r("endobj"))},s=function(){var t=this.internal.collections[e+"images"];for(var r in t)n.call(this,t[r])},o=function(){var t,r=this.internal.collections[e+"images"],n=this.internal.write;for(var s in r)t=r[s],n("/I"+t.i,t.n,"0","R")},i=function(e){return e&&"string"==typeof e&&(e=e.toUpperCase()),e in t.image_compression?e:t.image_compression.NONE},a=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",o)),t},u=function(t){var e=0;return t&&(e=Object.keys?Object.keys(t).length:function(t){var e=0;for(var r in t)t.hasOwnProperty(r)&&e++;return e}(t)),e},c=function(t){return"undefined"==typeof t||null===t},l=function(){return void 0},f=function(t){return-1===r.indexOf(t)},d=function(e){return"function"!=typeof t["process"+e.toUpperCase()]},h=function(t){return"object"==typeof t&&1===t.nodeType},p=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")&&0===(""+t.getAttribute("src")).indexOf("data:image/"))return t.getAttribute("src");if("CANVAS"===t.nodeName)var r=t;else{var r=document.createElement("canvas");r.width=t.clientWidth||t.width,r.height=t.clientHeight||t.height;var n=r.getContext("2d");if(!n)throw"addImage requires canvas to be supported by browser.";n.drawImage(t,0,0,r.width,r.height)}return r.toDataURL("png"==e?"image/png":"image/jpeg")},m=function(t,e){var r;if(e)for(var n in e)if(t===e[n].alias){r=e[n];break}return r},w=function(t,e,r){return t||e||(t=-96,e=-96),0>t&&(t=-1*r.w*72/t/this.internal.scaleFactor),0>e&&(e=-1*r.h*72/e/this.internal.scaleFactor),0===t&&(t=e*r.w/r.h),0===e&&(e=t*r.h/r.w),[t,e]},y=function(t,e,r,n,s,o,i){var a=w.call(this,r,n,s),u=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;r=a[0],n=a[1],i[o]=s,this.internal.write("q",u(r),"0 0",u(n),u(t),c(e+n),"cm /I"+s.i,"Do Q")};t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPERATION:"Seperation",DEVICE_N:"DeviceN"},t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},t.isString=function(t){return"string"==typeof t},t.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t)},t.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},t.isArrayBuffer=function(t){return this.supportsArrayBuffer()?t instanceof ArrayBuffer:!1},t.isArrayBufferView=function(t){return this.supportsArrayBuffer()?"undefined"==typeof Uint32Array?!1:t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array:!1},t.binaryStringToUint8Array=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;e>n;n++)r[n]=t.charCodeAt(n);return r},t.arrayBufferToBinaryString=function(t){this.isArrayBuffer(t)&&(t=new Uint8Array(t));for(var e="",r=t.byteLength,n=0;r>n;n++)e+=String.fromCharCode(t[n]);return e},t.arrayBufferToBase64=function(t){for(var e,r,n,s,o,i="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=new Uint8Array(t),c=u.byteLength,l=c%3,f=c-l,d=0;f>d;d+=3)o=u[d]<<16|u[d+1]<<8|u[d+2],e=(16515072&o)>>18,r=(258048&o)>>12,n=(4032&o)>>6,s=63&o,i+=a[e]+a[r]+a[n]+a[s];return 1==l?(o=u[f],e=(252&o)>>2,r=(3&o)<<4,i+=a[e]+a[r]+"=="):2==l&&(o=u[f]<<8|u[f+1],e=(64512&o)>>10,r=(1008&o)>>4,n=(15&o)<<2,i+=a[e]+a[r]+a[n]+"="),i},t.createImageInfo=function(t,e,r,n,s,o,i,a,u,c,l,f){var d={alias:a,w:e,h:r,cs:n,bpc:s,i:i,data:t};return o&&(d.f=o),u&&(d.dp=u),c&&(d.trns=c),l&&(d.pal=l),f&&(d.smask=f),d},t.addImage=function(t,e,n,s,o,w,g,v){if("number"==typeof e){var b=w;w=o,o=s,s=n,n=e,e=b}var q,x,k=a.call(this);if(v=i(v),e=(e||"JPEG").toLowerCase(),c(g)&&(g=l(t)),h(t)&&(t=p(t,e)),this.isString(t)){var _=this.extractInfoFromBase64DataURI(t);_?(e=_[2],t=atob(_[3]),this.supportsArrayBuffer()&&(x=t,t=this.binaryStringToUint8Array(t))):255!==t.charCodeAt(0)&&(q=m(t,k))}if(f(e))throw new Error("addImage currently only supports formats "+r+", not '"+e+"'");if(d(e))throw new Error("please ensure that the plugin for '"+e+"' support is added");var A=u(k),C=q;if(C||(C=this["process"+e.toUpperCase()](t,A,g,v,x)),!C)throw new Error("An unkwown error occurred whilst processing the image");return y.call(this,n,s,o,w,C,A,k),this};var g=function(t){var e,r;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),s=4,o=t.length;o>s;){if(s+=n,255!==t.charCodeAt(s))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(s+1)||193===t.charCodeAt(s+1)||194===t.charCodeAt(s+1)||195===t.charCodeAt(s+1)||196===t.charCodeAt(s+1)||197===t.charCodeAt(s+1)||198===t.charCodeAt(s+1)||199===t.charCodeAt(s+1))return r=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),e=256*t.charCodeAt(s+7)+t.charCodeAt(s+8),[e,r];s+=2,n=256*t.charCodeAt(s)+t.charCodeAt(s+1)}},v=function(t){var e=t[0]<<8|t[1];if(65496!==e)throw new Error("Supplied data is not a JPEG");for(var r,n,s,o=t.length,i=(t[4]<<8)+t[5],a=4;o>a;){if(a+=i,r=b(t,a),i=(r[2]<<8)+r[3],(192===r[1]||194===r[1])&&255===r[0]&&i>7)return r=b(t,a+5),n=(r[2]<<8)+r[3],s=(r[0]<<8)+r[1],{width:n,height:s};a+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")},b=function(t,e){return t.subarray(e,e+4)};t.processJPEG=function(t,e,r,n,s){var o,i=this.color_spaces.DEVICE_RGB,a=this.decode.DCT_DECODE,u=8;return this.isString(t)?(o=g(t),this.createImageInfo(t,o[0],o[1],i,u,a,e,r)):(this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)?(o=v(t),t=s||this.arrayBufferToBinaryString(t),this.createImageInfo(t,o.width,o.height,i,u,a,e,r)):null)},t.processJPG=function(){return this.processJPEG.apply(this,arguments)}}(r.API),function(t){"use strict";t.autoPrint=function(){var t;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this}}(r.API),function(t){"use strict";var e,r,n,s,o=3,i=13,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1,c=function(t,e,r,n,s){a={x:t,y:e,w:r,h:n,ln:s}},l=function(){return a},f={left:0,top:0,bottom:0};t.setHeaderFunction=function(t){s=t},t.getTextDimensions=function(t){e=this.internal.getFont().fontName,r=this.table_font_size||this.internal.getFontSize(),n=this.internal.getFont().fontStyle;var s,o,i=19.049976/25.4;return o=document.createElement("font"),o.id="jsPDFCell",o.style.fontStyle=n,o.style.fontName=e,o.style.fontSize=r+"pt",o.innerText=t,document.body.appendChild(o),s={w:(o.offsetWidth+1)*i,h:(o.offsetHeight+1)*i},document.body.removeChild(o),s},t.cellAddPage=function(){var t=this.margins||f;this.addPage(),c(t.left,t.top,void 0,void 0),u+=1},t.cellInitialize=function(){a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1},t.cell=function(t,e,r,n,s,a,u){var d=l();if(void 0!==d.ln)if(d.ln===a)t=d.x+d.w,e=d.y;else{var h=this.margins||f;d.y+d.h+n+i>=this.internal.pageSize.height-h.bottom&&(this.cellAddPage(),this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(a,!0)),e=l().y+l().h}if(void 0!==s[0])if(this.printingHeaderRow?this.rect(t,e,r,n,"FD"):this.rect(t,e,r,n),"right"===u){if(s instanceof Array)for(var p=0;pr;r+=1)s=t[r],e?-1===e(o,s)&&(o=s):s>o&&(o=s);return o},t.table=function(e,r,n,s,o){if(!n)throw"No data for PDF table";var i,c,l,d,h,p,m,w,y,g,v=[],b=[],q={},x={},k=[],_=[],A=!1,C=!0,S=12,E=f;if(E.width=this.internal.pageSize.width,o&&(o.autoSize===!0&&(A=!0),o.printHeaders===!1&&(C=!1),o.fontSize&&(S=o.fontSize),o.margins&&(E=o.margins)),this.lnMod=0,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1,this.printHeaders=C,this.margins=E,this.setFontSize(S),this.table_font_size=S,void 0===s||null===s)v=Object.keys(n[0]);else if(s[0]&&"string"!=typeof s[0]){var z=19.049976/25.4;for(c=0,l=s.length;l>c;c+=1)i=s[c],v.push(i.name),b.push(i.prompt),x[i.name]=i.width*z}else v=s;if(A)for(g=function(t){return t[i]},c=0,l=v.length;l>c;c+=1){for(i=v[c],q[i]=n.map(g),k.push(this.getTextDimensions(b[c]||i).w),p=q[i],m=0,d=p.length;d>m;m+=1)h=p[m],k.push(this.getTextDimensions(h).w);x[i]=t.arrayMax(k)}if(C){var I=this.calculateLineHeight(v,x,b.length?b:v);for(c=0,l=v.length;l>c;c+=1)i=v[c],_.push([e,r,x[i],I,String(b.length?b[c]:i)]);this.setTableHeaderRow(_),this.printHeaderRow(1,!1)}for(c=0,l=n.length;l>c;c+=1){var I;for(w=n[c],I=this.calculateLineHeight(v,x,w),m=0,y=v.length;y>m;m+=1)i=v[m],this.cell(e,r,x[i],I,w[i],c+2,i.align)}return this.lastCellPos=a,this.table_x=e,this.table_y=r,this},t.calculateLineHeight=function(t,e,r){for(var n,s=0,i=0;is&&(s=a)}return s},t.setTableHeaderRow=function(t){this.tableHeaderRow=t},t.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var r,n,o,i;if(this.printingHeaderRow=!0,void 0!==s){var a=s(this,u);c(a[0],a[1],a[2],a[3],-1)}this.setFontStyle("bold");var l=[];for(o=0,i=this.tableHeaderRow.length;i>o;o+=1)this.setFillColor(200,200,200),r=this.tableHeaderRow[o],e&&(r[1]=this.margins&&this.margins.top||0,l.push(r)),n=[].concat(r),this.cell.apply(this,n.concat(t));l.length>0&&this.setTableHeaderRow(l),this.setFontStyle("normal"),this.printingHeaderRow=!1}}(r.API),function(t){var e,r,n,s,o,i,a,u,c,l,f,d,h,p,m,w,y;e=function(){function t(){}return function(e){return t.prototype=e,new t}}(),a=function(t){var e,r,n,s,o,i,a;for(r=0,n=t.length,e=void 0,s=!1,i=!1;!s&&r!==n;)e=t[r]=t[r].trimLeft(),e&&(s=!0),r++;for(r=n-1;n&&!i&&-1!==r;)e=t[r]=t[r].trimRight(),e&&(i=!0),r--;for(o=/\s+$/g,a=!0,r=0;r!==n;)e=t[r].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[r]=e,r++;return t},u=function(t,e,r,n){return this.pdf=t,this.x=e,this.y=r,this.settings=n,this.init(),this},c=function(t){var e,r,s;for(e=void 0,s=t.split(","),r=s.shift();!e&&r;)e=n[r.trim().toLowerCase()],r=s.shift();return e},l=function(t){t="auto"===t?"0px":t,t.indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px");var e,r,n;return r=void 0,e=16,(n=f[t])?n:(n={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[{css_line_height_string:t}],n!==r?f[t]=n/e:(n=parseFloat(t))?f[t]=n/e:(n=t.match(/([\d\.]+)(px)/),f[t]=3===n.length?parseFloat(n[1])/e:1))},i=function(t){var e,r,n;return n=function(t){var e;return e=function(t){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(t,null):t.currentStyle?t.currentStyle:t.style}(t),function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),e[t]}}(t),e={},r=void 0,e["font-family"]=c(n("font-family"))||"times",e["font-style"]=s[n("font-style")]||"normal",e["text-align"]=TextAlignMap[n("text-align")]||"left",r=o[n("font-weight")]||"normal","bold"===r&&(e["font-style"]="normal"===e["font-style"]?r:r+e["font-style"]),e["font-size"]=l(n("font-size"))||1,e["line-height"]=l(n("line-height"))||1,e.display="inline"===n("display")?"inline":"block","block"===e.display&&(e["margin-top"]=l(n("margin-top"))||0,e["margin-bottom"]=l(n("margin-bottom"))||0,e["padding-top"]=l(n("padding-top"))||0,e["padding-bottom"]=l(n("padding-bottom"))||0,e["margin-left"]=l(n("margin-left"))||0,e["margin-right"]=l(n("margin-right"))||0,e["padding-left"]=l(n("padding-left"))||0,e["padding-right"]=l(n("padding-right"))||0),e},d=function(t,e,r){var n,s,o,i,a;if(o=!1,s=void 0,i=void 0,a=void 0,n=r["#"+t.id])if("function"==typeof n)o=n(t,e);else for(s=0,i=n.length;!o&&s!==i;)o=n[s](t,e),s++;if(n=r[t.nodeName],!o&&n)if("function"==typeof n)o=n(t,e);else for(s=0,i=n.length;!o&&s!==i;)o=n[s](t,e),s++;return o},y=function(t,e){var r,n,s,o,i,a,u,c,l,f;for(r=[],n=[],s=0,f=t.rows[0].cells.length,c=t.clientWidth;f>s;)l=t.rows[0].cells[s],n[s]={name:l.textContent.toLowerCase().replace(/\s+/g,""),prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/c*e.pdf.internal.pageSize.width},s++;for(s=1;su;){if(s=o[u],"object"==typeof s){if(1===s.nodeType&&"HEADER"===s.nodeName){var w=s,b=e.pdf.margins_doc.top;e.pdf.internal.events.subscribe("addPage",function(){e.y=b,r(w,e,n),e.pdf.margins_doc.top=e.y+10,e.y+=10},!1)}if(8===s.nodeType&&"#comment"===s.nodeName)~s.textContent.indexOf("ADD_PAGE")&&(e.pdf.addPage(),e.y=e.pdf.margins_doc.top);else if(1!==s.nodeType||g[s.nodeName])if(3===s.nodeType){var q=s.nodeValue;if(s.nodeValue&&"LI"===s.parentNode.nodeName)if("OL"===s.parentNode.parentNode.nodeName)q=v++ +". "+q;else{var x=16*a["font-size"],k=2;x>20&&(k=3),m=function(t,e){this.pdf.circle(t,e,k,"FD")}}e.addText(q,a)}else"string"==typeof s&&e.addText(s,a);else if("IMG"===s.nodeName&&h[s.getAttribute("src")])e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottome.pdf.margins_doc.top&&(e.pdf.addPage(),e.y=e.pdf.margins_doc.top),e.pdf.addImage(h[s.getAttribute("src")],e.x,e.y,s.width,s.height),e.y+=s.height;else if("TABLE"===s.nodeName)p=y(s,e),e.y+=10,e.pdf.table(e.x,e.y,p.rows,p.headers,{autoSize:!1,printHeaders:!0,margins:e.pdf.margins_doc}),e.y=e.pdf.lastCellPos.y+e.pdf.lastCellPos.h+20;else if("OL"===s.nodeName||"UL"===s.nodeName)v=1,d(s,e,n)||r(s,e,n),e.y+=10;else if("LI"===s.nodeName){var _=e.x;e.x+="UL"===s.parentNode.nodeName?22:10,e.y+=3,d(s,e,n)||r(s,e,n),e.x=_}else d(s,e,n)||r(s,e,n)}u++}return c?e.setBlockBoundary(m):void 0},h={},p=function(t,e,r,n){function s(){e.pdf.internal.events.publish("imagesLoaded"),n()}function o(t,e,r){if(t){var n=new Image;++u,n.crossOrigin="",n.onerror=n.onload=function(){n.complete&&(0===n.src.indexOf("data:image/")&&(n.width=e||n.width||0,n.height=r||n.height||0),n.width+n.height&&(h[t]=h[t]||n)),--u||s()},n.src=t}}for(var i=t.getElementsByTagName("img"),a=i.length,u=0;a--;)o(i[a].getAttribute("src"),i[a].width,i[a].height);return u||s()},m=function(t,e,n,s){var o=t.getElementsByTagName("footer");if(o.length>0){o=o[0];var i=e.pdf.internal.write,a=e.y;e.pdf.internal.write=function(){},r(o,e,n);var u=Math.ceil(e.y-a)+5;e.y=a,e.pdf.internal.write=i,e.pdf.margins_doc.bottom+=u; +!function(t,e){e["true"]=t;var r=function(t){"use strict";function e(e){var r={};this.subscribe=function(t,e,n){if("function"!=typeof e)return!1;r.hasOwnProperty(t)||(r[t]={});var s=Math.random().toString(35);return r[t][s]=[e,!!n],s},this.unsubscribe=function(t){for(var e in r)if(r[e][t])return delete r[e][t],!0;return!1},this.publish=function(n){if(r.hasOwnProperty(n)){var s=Array.prototype.slice.call(arguments,1),o=[];for(var i in r[n]){var a=r[n][i];try{a[0].apply(e,s)}catch(u){t.console&&console.error("jsPDF PubSub Error",u.message,u)}a[1]&&o.push(i)}o.length&&o.forEach(this.unsubscribe)}}}function r(a,u,c,l){var f={};"object"==typeof a&&(f=a,a=f.orientation,u=f.unit||u,c=f.format||c,l=f.compress||f.compressPdf||l),u=u||"mm",c=c||"a4",a=(""+(a||"P")).toLowerCase();var d,h,p,m,w,y=(""+c).toLowerCase(),g=!!l&&"function"==typeof Uint8Array,v=f.textColor||"0 g",b=f.drawColor||"0 G",q=f.fontSize||16,x=f.lineHeight||1.15,k=f.lineWidth||.200025,_=2,A=!1,C=[],S={},E={},z=0,I=[],T=[],B=0,O=0,P=0,R={title:"",subject:"",author:"",keywords:"",creator:""},D={},U=new e(D),F=function(t){return t.toFixed(2)},L=function(t){return t.toFixed(3)},j=function(t){return("0"+parseInt(t)).slice(-2)},N=function(t){A?I[z].push(t):(P+=t.length+1,T.push(t))},M=function(){return _++,C[_]=P,N(_+" 0 obj"),_},H=function(t){N("stream"),N(t),N("endstream")},G=function(){var e,n,o,i,a,u,c,l=m*h,f=w*h;for(c=t.adler32cs||r.adler32cs,g&&"undefined"==typeof c&&(g=!1),e=1;z>=e;e++){if(M(),N("<>"),N("endobj"),n=I[e].join("\n"),M(),g){for(o=[],i=n.length;i--;)o[i]=n.charCodeAt(i);u=c.from(n),a=new s(6),a.append(new Uint8Array(o)),n=a.flush(),o=new Uint8Array(n.length+6),o.set(new Uint8Array([120,156])),o.set(n,2),o.set(new Uint8Array([255&u,u>>8&255,u>>16&255,u>>24&255]),n.length+2),n=String.fromCharCode.apply(null,o),N("<>")}else N("<>");H(n),N("endobj")}C[1]=P,N("1 0 obj"),N("<i;i++)d+=3+2*i+" 0 R ";N(d+"]"),N("/Count "+z),N("/MediaBox [0 0 "+F(l)+" "+F(f)+"]"),N(">>"),N("endobj")},J=function(t){t.objectNumber=M(),N("<>"),N("endobj")},V=function(){for(var t in S)S.hasOwnProperty(t)&&J(S[t])},W=function(){U.publish("putXobjectDict")},X=function(){N("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),N("/Font <<");for(var t in S)S.hasOwnProperty(t)&&N("/"+t+" "+S[t].objectNumber+" 0 R");N(">>"),N("/XObject <<"),W(),N(">>")},Y=function(){V(),U.publish("putResources"),C[2]=P,N("2 0 obj"),N("<<"),X(),N(">>"),N("endobj"),U.publish("postPutResources")},K=function(t,e,r){E.hasOwnProperty(e)||(E[e]={}),E[e][r]=t},Q=function(t,e,r,n){var s="F"+(Object.keys(S).length+1).toString(10),o=S[s]={id:s,PostScriptName:t,fontName:e,fontStyle:r,encoding:n,metadata:{}};return K(s,e,r),U.publish("addFont",o),s},$=function(){for(var t="helvetica",e="times",r="courier",n="normal",s="bold",o="italic",i="bolditalic",a="StandardEncoding",u=[["Helvetica",t,n],["Helvetica-Bold",t,s],["Helvetica-Oblique",t,o],["Helvetica-BoldOblique",t,i],["Courier",r,n],["Courier-Bold",r,s],["Courier-Oblique",r,o],["Courier-BoldOblique",r,i],["Times-Roman",e,n],["Times-Bold",e,s],["Times-Italic",e,o],["Times-BoldItalic",e,i]],c=0,l=u.length;l>c;c++){var f=Q(u[c][0],u[c][1],u[c][2],a),d=u[c][0].split("-");K(f,d[0],d[1]||"")}U.publish("addFonts",{fonts:S,dictionary:E})},Z=function(e){return e.foo=function(){try{return e.apply(this,arguments)}catch(r){var n=r.stack||"";~n.indexOf(" at ")&&(n=n.split(" at ")[1]);var s="Error in function "+n.split("\n")[0].split("<")[0]+": "+r.message;if(!t.console)throw new Error(s);console.log(s,r),t.alert&&alert(s),console.trace()}},e.foo.bar=e,e.foo},te=function(t,e){var r,n,s,o,i,a,u,c,l;if(e=e||{},s=e.sourceEncoding||"Unicode",i=e.outputEncoding,(e.autoencode||i)&&S[d].metadata&&S[d].metadata[s]&&S[d].metadata[s].encoding&&(o=S[d].metadata[s].encoding,!i&&S[d].encoding&&(i=S[d].encoding),!i&&o.codePages&&(i=o.codePages[0]),"string"==typeof i&&(i=o[i]),i)){for(u=!1,a=[],r=0,n=t.length;n>r;r++)c=i[t.charCodeAt(r)],c?a.push(String.fromCharCode(c)):a.push(t[r]),a[r].charCodeAt(0)>>8&&(u=!0);t=a.join("")}for(r=t.length;void 0===u&&0!==r;)t.charCodeAt(r-1)>>8&&(u=!0),r--;if(!u)return t;for(a=e.noBOM?[]:[254,255],r=0,n=t.length;n>r;r++){if(c=t.charCodeAt(r),l=c>>8,l>>8)throw new Error("Character at position "+r+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(l),a.push(c-(l<<8))}return String.fromCharCode.apply(void 0,a)},ee=function(t,e){return te(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},re=function(){N("/Producer (jsPDF "+r.version+")");for(var t in R)R.hasOwnProperty(t)&&R[t]&&N("/"+t.substr(0,1).toUpperCase()+t.substr(1)+" ("+ee(R[t])+")");var e=new Date;N(["/CreationDate (D:",e.getFullYear(),j(e.getMonth()+1),j(e.getDate()),j(e.getHours()),j(e.getMinutes()),j(e.getSeconds()),")"].join(""))},ne=function(){N("/Type /Catalog"),N("/Pages 1 0 R"),N("/OpenAction [3 0 R /FitH null]"),N("/PageLayout /OneColumn"),U.publish("putCatalog")},se=function(){N("/Size "+(_+1)),N("/Root "+_+" 0 R"),N("/Info "+(_-1)+" 0 R")},oe=function(){z++,A=!0,I[z]=[]},ie=function(){oe(),N(F(k*h)+" w"),N(b),0!==B&&N(B+" J"),0!==O&&N(O+" j"),U.publish("addPage",{pageNumber:z})},ae=function(t,e){var r;t=void 0!==t?t:S[d].fontName,e=void 0!==e?e:S[d].fontStyle;try{r=E[t][e]||E[t].normal}catch(n){}if(!r)throw new Error("Unable to look up font label for font '"+t+"', '"+e+"'. Refer to getFontList() for available fonts.");return r},ue=function(){A=!1,_=2,T=[],C=[],N("%PDF-"+o),G(),Y(),M(),N("<<"),re(),N(">>"),N("endobj"),M(),N("<<"),ne(),N(">>"),N("endobj");var t,e=P,r="0000000000";for(N("xref"),N("0 "+(_+1)),N(r+" 65535 f "),t=1;_>=t;t++)N((r+C[t]).slice(-10)+" 00000 n ");return N("trailer"),N("<<"),se(),N(">>"),N("startxref"),N(e),N("%%EOF"),A=!0,T.join("\n")},ce=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":("f"===t||"f*"===t||"B"===t||"B*"===t)&&(e=t),e},le=function(){for(var t=ue(),e=t.length,r=new ArrayBuffer(e),n=new Uint8Array(r);e--;)n[e]=t.charCodeAt(e);return r},fe=function(){return new Blob([le()],{type:"application/pdf"})},de=Z(function(e,r){switch(e){case void 0:return ue();case"save":if(navigator.getUserMedia&&(void 0===t.URL||void 0===t.URL.createObjectURL))return D.output("dataurlnewwindow");n(fe(),r),"function"==typeof n.unload&&t.setTimeout&&setTimeout(n.unload,70);break;case"arraybuffer":return le();case"blob":return fe();case"datauristring":case"dataurlstring":return"data:application/pdf;base64,"+btoa(ue());case"datauri":case"dataurl":t.document.location.href="data:application/pdf;base64,"+btoa(ue());break;case"dataurlnewwindow":t.open("data:application/pdf;base64,"+btoa(ue()));break;default:throw new Error('Output type "'+e+'" is not supported.')}});switch(u){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=96/72;break;case"pc":h=12;break;case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+u}if(i.hasOwnProperty(y))w=i[y][1]/h,m=i[y][0]/h;else try{w=c[1],m=c[0]}catch(he){throw new Error("Invalid format: "+c)}if("p"===a||"portrait"===a)a="p",m>w&&(p=m,m=w,w=p);else{if("l"!==a&&"landscape"!==a)throw"Invalid orientation: "+a;a="l",w>m&&(p=m,m=w,w=p)}D.internal={pdfEscape:ee,getStyle:ce,getFont:function(){return S[ae.apply(D,arguments)]},getFontSize:function(){return q},getLineHeight:function(){return q*x},write:function(t){N(1===arguments.length?t:Array.prototype.join.call(arguments," "))},getCoordinateString:function(t){return F(t*h)},getVerticalCoordinateString:function(t){return F((w-t)*h)},collections:{},newObject:M,putStream:H,events:U,scaleFactor:h,pageSize:{width:m,height:w},output:function(t,e){return de(t,e)},getNumberOfPages:function(){return I.length-1},pages:I},D.addPage=function(){return ie(),this},D.text=function(t,e,r,n,s){function o(t){return t=t.split(" ").join(Array(f.TabLen||9).join(" ")),ee(t,n)}"number"==typeof t&&(p=r,r=e,e=t,t=p),"string"==typeof t&&t.match(/[\n\r]/)&&(t=t.split(/\r\n|\r|\n/g)),"number"==typeof n&&(s=n,n=null);var i="",a="Td";if(s){s*=Math.PI/180;var u=Math.cos(s),c=Math.sin(s);i=[F(u),F(c),F(-1*c),F(u),""].join(" "),a="Tm"}if(n=n||{},"noBOM"in n||(n.noBOM=!0),"autoencode"in n||(n.autoencode=!0),"string"==typeof t)t=o(t);else{if(!(t instanceof Array))throw new Error('Type of text must be string or Array. "'+t+'" is not recognized.');for(var l=t.concat(),m=[],y=l.length;y--;)m.push(o(l.shift()));t=m.join(") Tj\nT* (")}return N("BT\n/"+d+" "+q+" Tf\n"+q*x+" TL\n"+v+"\n"+i+F(e*h)+" "+F((w-r)*h)+" "+a+"\n("+t+") Tj\nET"),this},D.line=function(t,e,r,n){return this.lines([[r-t,n-e]],t,e)},D.lines=function(t,e,r,n,s,o){var i,a,u,c,l,f,d,m,y,g,v;for("number"==typeof t&&(p=r,r=e,e=t,t=p),n=n||[1,1],N(L(e*h)+" "+L((w-r)*h)+" m "),i=n[0],a=n[1],c=t.length,g=e,v=r,u=0;c>u;u++)l=t[u],2===l.length?(g=l[0]*i+g,v=l[1]*a+v,N(L(g*h)+" "+L((w-v)*h)+" l")):(f=l[0]*i+g,d=l[1]*a+v,m=l[2]*i+g,y=l[3]*a+v,g=l[4]*i+g,v=l[5]*a+v,N(L(f*h)+" "+L((w-d)*h)+" "+L(m*h)+" "+L((w-y)*h)+" "+L(g*h)+" "+L((w-v)*h)+" c"));return o&&N(" h"),null!==s&&N(ce(s)),this},D.rect=function(t,e,r,n,s){ce(s);return N([F(t*h),F((w-e)*h),F(r*h),F(-n*h),"re"].join(" ")),null!==s&&N(ce(s)),this},D.triangle=function(t,e,r,n,s,o,i){return this.lines([[r-t,n-e],[s-r,o-n],[t-s,e-o]],t,e,[1,1],i,!0),this},D.roundedRect=function(t,e,r,n,s,o,i){var a=4/3*(Math.SQRT2-1);return this.lines([[r-2*s,0],[s*a,0,s,o-o*a,s,o],[0,n-2*o],[0,o*a,-(s*a),o,-s,o],[-r+2*s,0],[-(s*a),0,-s,-(o*a),-s,-o],[0,-n+2*o],[0,-(o*a),s*a,-o,s,-o]],t+s,e,[1,1],i),this},D.ellipse=function(t,e,r,n,s){var o=4/3*(Math.SQRT2-1)*r,i=4/3*(Math.SQRT2-1)*n;return N([F((t+r)*h),F((w-e)*h),"m",F((t+r)*h),F((w-(e-i))*h),F((t+o)*h),F((w-(e-n))*h),F(t*h),F((w-(e-n))*h),"c"].join(" ")),N([F((t-o)*h),F((w-(e-n))*h),F((t-r)*h),F((w-(e-i))*h),F((t-r)*h),F((w-e)*h),"c"].join(" ")),N([F((t-r)*h),F((w-(e+i))*h),F((t-o)*h),F((w-(e+n))*h),F(t*h),F((w-(e+n))*h),"c"].join(" ")),N([F((t+o)*h),F((w-(e+n))*h),F((t+r)*h),F((w-(e+i))*h),F((t+r)*h),F((w-e)*h),"c"].join(" ")),null!==s&&N(ce(s)),this},D.circle=function(t,e,r,n){return this.ellipse(t,e,r,r,n)},D.setProperties=function(t){for(var e in R)R.hasOwnProperty(e)&&t[e]&&(R[e]=t[e]);return this},D.setFontSize=function(t){return q=t,this},D.setFont=function(t,e){return d=ae(t,e),this},D.setFontStyle=D.setFontType=function(t){return d=ae(void 0,t),this},D.getFontList=function(){var t,e,r,n={};for(t in E)if(E.hasOwnProperty(t)){n[t]=r=[];for(e in E[t])E[t].hasOwnProperty(e)&&r.push(e)}return n},D.setLineWidth=function(t){return N((t*h).toFixed(2)+" w"),this},D.setDrawColor=function(t,e,r,n){var s;return s=void 0===e||void 0===n&&t===e===r?"string"==typeof t?t+" G":F(t/255)+" G":void 0===n?"string"==typeof t?[t,e,r,"RG"].join(" "):[F(t/255),F(e/255),F(r/255),"RG"].join(" "):"string"==typeof t?[t,e,r,n,"K"].join(" "):[F(t),F(e),F(r),F(n),"K"].join(" "),N(s),this},D.setFillColor=function(t,e,r,n){var s;return s=void 0===e||void 0===n&&t===e===r?"string"==typeof t?t+" g":F(t/255)+" g":void 0===n?"string"==typeof t?[t,e,r,"rg"].join(" "):[F(t/255),F(e/255),F(r/255),"rg"].join(" "):"string"==typeof t?[t,e,r,n,"k"].join(" "):[F(t),F(e),F(r),F(n),"k"].join(" "),N(s),this},D.setTextColor=function(t,e,r){if("string"==typeof t&&/^#[0-9A-Fa-f]{6}$/.test(t)){var n=parseInt(t.substr(1),16);t=n>>16&255,e=n>>8&255,r=255&n}return v=0===t&&0===e&&0===r||"undefined"==typeof e?L(t/255)+" g":[L(t/255),L(e/255),L(r/255),"rg"].join(" "),this},D.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},D.setLineCap=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line cap style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return B=e,N(e+" J"),this},D.setLineJoin=function(t){var e=this.CapJoinStyles[t];if(void 0===e)throw new Error("Line join style of '"+t+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return O=e,N(e+" j"),this},D.output=de,D.save=function(t){D.output("save",t)};for(var pe in r.API)r.API.hasOwnProperty(pe)&&("events"===pe&&r.API.events.length?!function(t,e){var r,n,s;for(s=e.length-1;-1!==s;s--)r=e[s][0],n=e[s][1],t.subscribe.apply(t,[r].concat("function"==typeof n?[n]:n))}(U,r.API.events):D[pe]=r.API[pe]);return $(),d="F1",ie(),U.publish("initialized"),D}var o="1.3",i={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]};return r.API={events:[]},r.version="1.0.150-git 2014-05-30T00:40:diegocr","function"==typeof define&&define.amd?define(function(){return r}):t.jsPDF=r,r}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this);!function(t){"use strict";t.addHTML=function(t,e,r,n,s){if("undefined"==typeof html2canvas&&"undefined"==typeof rasterizeHTML)throw new Error("You need either https://github.com/niklasvh/html2canvas or https://github.com/cburgmer/rasterizeHTML.js");"number"!=typeof e&&(n=e,s=r),"function"==typeof n&&(s=n,n=null);var o=this.internal,i=o.scaleFactor,a=o.pageSize.width,u=o.pageSize.height;if(n=n||{},n.onrendered=function(t){e=parseInt(e)||0,r=parseInt(r)||0;var o=n.dim||{},c=o.h||0,l=o.w||Math.min(a,t.width/i)-e,f="JPEG";if(n.format&&(f=n.format),t.height>u&&n.pagesplit){var d=function(){for(var n=0;;){var o=document.createElement("canvas");o.width=Math.min(a*i,t.width),o.height=Math.min(u*i,t.height-n);var c=o.getContext("2d");c.drawImage(t,0,n,t.width,o.height,0,0,o.width,o.height);var d=[o,e,n?0:r,o.width/i,o.height/i,f,null,"SLOW"];if(this.addImage.apply(this,d),n+=o.height,n>=t.height)break;this.addPage()}s(l,n,null,d)}.bind(this);if("CANVAS"===t.nodeName){var h=new Image;h.onload=d,h.src=t.toDataURL("image/png"),t=h}else d()}else{var p=Math.random().toString(35),m=[t,e,r,l,c,f,p,"SLOW"];this.addImage.apply(this,m),s(l,c,p,m)}}.bind(this),"undefined"!=typeof html2canvas&&!n.rstz)return html2canvas(t,n);if("undefined"!=typeof rasterizeHTML){var c="drawDocument";return"string"==typeof t&&(c=/^http/.test(t)?"drawURL":"drawHTML"),n.width=n.width||a*i,rasterizeHTML[c](t,void 0,n).then(function(t){n.onrendered(t.image)},function(t){s(null,t)})}return null}}(r.API),function(t){"use strict";var e="addImage_",r=["jpeg","jpg","png"],n=function(t){var e=this.internal.newObject(),r=this.internal.write,s=this.internal.putStream;if(t.n=e,r("<>"),"trns"in t&&t.trns.constructor==Array){for(var o="",i=0,a=t.trns.length;a>i;i++)o+=t.trns[i]+" "+t.trns[i]+" ";r("/Mask ["+o+"]")}if("smask"in t&&r("/SMask "+(e+1)+" 0 R"),r("/Length "+t.data.length+">>"),s(t.data),r("endobj"),"smask"in t){var u="/Predictor 15 /Colors 1 /BitsPerComponent "+t.bpc+" /Columns "+t.w,c={w:t.w,h:t.h,cs:"DeviceGray",bpc:t.bpc,dp:u,data:t.smask};"f"in t&&(c.f=t.f),n.call(this,c)}t.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+t.pal.length+">>"),s(this.arrayBufferToBinaryString(new Uint8Array(t.pal))),r("endobj"))},s=function(){var t=this.internal.collections[e+"images"];for(var r in t)n.call(this,t[r])},o=function(){var t,r=this.internal.collections[e+"images"],n=this.internal.write;for(var s in r)t=r[s],n("/I"+t.i,t.n,"0","R")},i=function(e){return e&&"string"==typeof e&&(e=e.toUpperCase()),e in t.image_compression?e:t.image_compression.NONE},a=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",o)),t},u=function(t){var e=0;return t&&(e=Object.keys?Object.keys(t).length:function(t){var e=0;for(var r in t)t.hasOwnProperty(r)&&e++;return e}(t)),e},c=function(t){return"undefined"==typeof t||null===t},l=function(){return void 0},f=function(t){return-1===r.indexOf(t)},d=function(e){return"function"!=typeof t["process"+e.toUpperCase()]},h=function(t){return"object"==typeof t&&1===t.nodeType},p=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")&&0===(""+t.getAttribute("src")).indexOf("data:image/"))return t.getAttribute("src");if("CANVAS"===t.nodeName)var r=t;else{var r=document.createElement("canvas");r.width=t.clientWidth||t.width,r.height=t.clientHeight||t.height;var n=r.getContext("2d");if(!n)throw"addImage requires canvas to be supported by browser.";n.drawImage(t,0,0,r.width,r.height)}return r.toDataURL("png"==e?"image/png":"image/jpeg")},m=function(t,e){var r;if(e)for(var n in e)if(t===e[n].alias){r=e[n];break}return r},w=function(t,e,r){return t||e||(t=-96,e=-96),0>t&&(t=-1*r.w*72/t/this.internal.scaleFactor),0>e&&(e=-1*r.h*72/e/this.internal.scaleFactor),0===t&&(t=e*r.w/r.h),0===e&&(e=t*r.h/r.w),[t,e]},y=function(t,e,r,n,s,o,i){var a=w.call(this,r,n,s),u=this.internal.getCoordinateString,c=this.internal.getVerticalCoordinateString;r=a[0],n=a[1],i[o]=s,this.internal.write("q",u(r),"0 0",u(n),u(t),c(e+n),"cm /I"+s.i,"Do Q")};t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPERATION:"Seperation",DEVICE_N:"DeviceN"},t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"},t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},t.isString=function(t){return"string"==typeof t},t.extractInfoFromBase64DataURI=function(t){return/^data:([\w]+?\/([\w]+?));base64,(.+?)$/g.exec(t)},t.supportsArrayBuffer=function(){return"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array},t.isArrayBuffer=function(t){return this.supportsArrayBuffer()?t instanceof ArrayBuffer:!1},t.isArrayBufferView=function(t){return this.supportsArrayBuffer()?"undefined"==typeof Uint32Array?!1:t instanceof Int8Array||t instanceof Uint8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array:!1},t.binaryStringToUint8Array=function(t){for(var e=t.length,r=new Uint8Array(e),n=0;e>n;n++)r[n]=t.charCodeAt(n);return r},t.arrayBufferToBinaryString=function(t){this.isArrayBuffer(t)&&(t=new Uint8Array(t));for(var e="",r=t.byteLength,n=0;r>n;n++)e+=String.fromCharCode(t[n]);return e},t.arrayBufferToBase64=function(t){for(var e,r,n,s,o,i="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=new Uint8Array(t),c=u.byteLength,l=c%3,f=c-l,d=0;f>d;d+=3)o=u[d]<<16|u[d+1]<<8|u[d+2],e=(16515072&o)>>18,r=(258048&o)>>12,n=(4032&o)>>6,s=63&o,i+=a[e]+a[r]+a[n]+a[s];return 1==l?(o=u[f],e=(252&o)>>2,r=(3&o)<<4,i+=a[e]+a[r]+"=="):2==l&&(o=u[f]<<8|u[f+1],e=(64512&o)>>10,r=(1008&o)>>4,n=(15&o)<<2,i+=a[e]+a[r]+a[n]+"="),i},t.createImageInfo=function(t,e,r,n,s,o,i,a,u,c,l,f){var d={alias:a,w:e,h:r,cs:n,bpc:s,i:i,data:t};return o&&(d.f=o),u&&(d.dp=u),c&&(d.trns=c),l&&(d.pal=l),f&&(d.smask=f),d},t.addImage=function(t,e,n,s,o,w,g,v){if("number"==typeof e){var b=w;w=o,o=s,s=n,n=e,e=b}var q,x,k=a.call(this);if(v=i(v),e=(e||"JPEG").toLowerCase(),c(g)&&(g=l(t)),h(t)&&(t=p(t,e)),this.isString(t)){var _=this.extractInfoFromBase64DataURI(t);_?(e=_[2],t=atob(_[3]),this.supportsArrayBuffer()&&(x=t,t=this.binaryStringToUint8Array(t))):255!==t.charCodeAt(0)&&(q=m(t,k))}if(f(e))throw new Error("addImage currently only supports formats "+r+", not '"+e+"'");if(d(e))throw new Error("please ensure that the plugin for '"+e+"' support is added");var A=u(k),C=q;if(C||(C=this["process"+e.toUpperCase()](t,A,g,v,x)),!C)throw new Error("An unkwown error occurred whilst processing the image");return y.call(this,n,s,o,w,C,A,k),this};var g=function(t){var e,r;if(255===!t.charCodeAt(0)||216===!t.charCodeAt(1)||255===!t.charCodeAt(2)||224===!t.charCodeAt(3)||!t.charCodeAt(6)==="J".charCodeAt(0)||!t.charCodeAt(7)==="F".charCodeAt(0)||!t.charCodeAt(8)==="I".charCodeAt(0)||!t.charCodeAt(9)==="F".charCodeAt(0)||0===!t.charCodeAt(10))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),s=4,o=t.length;o>s;){if(s+=n,255!==t.charCodeAt(s))throw new Error("getJpegSize could not find the size of the image");if(192===t.charCodeAt(s+1)||193===t.charCodeAt(s+1)||194===t.charCodeAt(s+1)||195===t.charCodeAt(s+1)||196===t.charCodeAt(s+1)||197===t.charCodeAt(s+1)||198===t.charCodeAt(s+1)||199===t.charCodeAt(s+1))return r=256*t.charCodeAt(s+5)+t.charCodeAt(s+6),e=256*t.charCodeAt(s+7)+t.charCodeAt(s+8),[e,r];s+=2,n=256*t.charCodeAt(s)+t.charCodeAt(s+1)}},v=function(t){var e=t[0]<<8|t[1];if(65496!==e)throw new Error("Supplied data is not a JPEG");for(var r,n,s,o=t.length,i=(t[4]<<8)+t[5],a=4;o>a;){if(a+=i,r=b(t,a),i=(r[2]<<8)+r[3],(192===r[1]||194===r[1])&&255===r[0]&&i>7)return r=b(t,a+5),n=(r[2]<<8)+r[3],s=(r[0]<<8)+r[1],{width:n,height:s};a+=2}throw new Error("getJpegSizeFromBytes could not find the size of the image")},b=function(t,e){return t.subarray(e,e+4)};t.processJPEG=function(t,e,r,n,s){var o,i=this.color_spaces.DEVICE_RGB,a=this.decode.DCT_DECODE,u=8;return this.isString(t)?(o=g(t),this.createImageInfo(t,o[0],o[1],i,u,a,e,r)):(this.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.isArrayBufferView(t)?(o=v(t),t=s||this.arrayBufferToBinaryString(t),this.createImageInfo(t,o.width,o.height,i,u,a,e,r)):null)},t.processJPG=function(){return this.processJPEG.apply(this,arguments)}}(r.API),function(t){"use strict";t.autoPrint=function(){var t;return this.internal.events.subscribe("postPutResources",function(){t=this.internal.newObject(),this.internal.write("<< /S/Named /Type/Action /N/Print >>","endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.write("/OpenAction "+t+" 0 R")}),this}}(r.API),function(t){"use strict";var e,r,n,s,o=3,i=13,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1,c=function(t,e,r,n,s){a={x:t,y:e,w:r,h:n,ln:s}},l=function(){return a},f={left:0,top:0,bottom:0};t.setHeaderFunction=function(t){s=t},t.getTextDimensions=function(t){e=this.internal.getFont().fontName,r=this.table_font_size||this.internal.getFontSize(),n=this.internal.getFont().fontStyle;var s,o,i=19.049976/25.4;return o=document.createElement("font"),o.id="jsPDFCell",o.style.fontStyle=n,o.style.fontName=e,o.style.fontSize=r+"pt",o.innerText=t,document.body.appendChild(o),s={w:(o.offsetWidth+1)*i,h:(o.offsetHeight+1)*i},document.body.removeChild(o),s},t.cellAddPage=function(){var t=this.margins||f;this.addPage(),c(t.left,t.top,void 0,void 0),u+=1},t.cellInitialize=function(){a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1},t.cell=function(t,e,r,n,s,a,u){var d=l();if(void 0!==d.ln)if(d.ln===a)t=d.x+d.w,e=d.y;else{var h=this.margins||f;d.y+d.h+n+i>=this.internal.pageSize.height-h.bottom&&(this.cellAddPage(),this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(a,!0)),e=l().y+l().h}if(void 0!==s[0])if(this.printingHeaderRow?this.rect(t,e,r,n,"FD"):this.rect(t,e,r,n),"right"===u){if(s instanceof Array)for(var p=0;pr;r+=1)s=t[r],e?-1===e(o,s)&&(o=s):s>o&&(o=s);return o},t.table=function(e,r,n,s,o){if(!n)throw"No data for PDF table";var i,c,l,d,h,p,m,w,y,g,v=[],b=[],q={},x={},k=[],_=[],A=!1,C=!0,S=12,E=f;if(E.width=this.internal.pageSize.width,o&&(o.autoSize===!0&&(A=!0),o.printHeaders===!1&&(C=!1),o.fontSize&&(S=o.fontSize),o.margins&&(E=o.margins)),this.lnMod=0,a={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},u=1,this.printHeaders=C,this.margins=E,this.setFontSize(S),this.table_font_size=S,void 0===s||null===s)v=Object.keys(n[0]);else if(s[0]&&"string"!=typeof s[0]){var z=19.049976/25.4;for(c=0,l=s.length;l>c;c+=1)i=s[c],v.push(i.name),b.push(i.prompt),x[i.name]=i.width*z}else v=s;if(A)for(g=function(t){return t[i]},c=0,l=v.length;l>c;c+=1){for(i=v[c],q[i]=n.map(g),k.push(this.getTextDimensions(b[c]||i).w),p=q[i],m=0,d=p.length;d>m;m+=1)h=p[m],k.push(this.getTextDimensions(h).w);x[i]=t.arrayMax(k)}if(C){var I=this.calculateLineHeight(v,x,b.length?b:v);for(c=0,l=v.length;l>c;c+=1)i=v[c],_.push([e,r,x[i],I,String(b.length?b[c]:i)]);this.setTableHeaderRow(_),this.printHeaderRow(1,!1)}for(c=0,l=n.length;l>c;c+=1){var I;for(w=n[c],I=this.calculateLineHeight(v,x,w),m=0,y=v.length;y>m;m+=1)i=v[m],this.cell(e,r,x[i],I,w[i],c+2,i.align)}return this.lastCellPos=a,this.table_x=e,this.table_y=r,this},t.calculateLineHeight=function(t,e,r){for(var n,s=0,i=0;is&&(s=a)}return s},t.setTableHeaderRow=function(t){this.tableHeaderRow=t},t.printHeaderRow=function(t,e){if(!this.tableHeaderRow)throw"Property tableHeaderRow does not exist.";var r,n,o,i;if(this.printingHeaderRow=!0,void 0!==s){var a=s(this,u);c(a[0],a[1],a[2],a[3],-1)}this.setFontStyle("bold");var l=[];for(o=0,i=this.tableHeaderRow.length;i>o;o+=1)this.setFillColor(200,200,200),r=this.tableHeaderRow[o],e&&(r[1]=this.margins&&this.margins.top||0,l.push(r)),n=[].concat(r),this.cell.apply(this,n.concat(t));l.length>0&&this.setTableHeaderRow(l),this.setFontStyle("normal"),this.printingHeaderRow=!1}}(r.API),function(t){var e,r,n,s,o,i,a,u,c,l,f,d,h,p,m,w,y;e=function(){function t(){}return function(e){return t.prototype=e,new t}}(),a=function(t){var e,r,n,s,o,i,a;for(r=0,n=t.length,e=void 0,s=!1,i=!1;!s&&r!==n;)e=t[r]=t[r].trimLeft(),e&&(s=!0),r++;for(r=n-1;n&&!i&&-1!==r;)e=t[r]=t[r].trimRight(),e&&(i=!0),r--;for(o=/\s+$/g,a=!0,r=0;r!==n;)e=t[r].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[r]=e,r++;return t},u=function(t,e,r,n){return this.pdf=t,this.x=e,this.y=r,this.settings=n,this.init(),this},c=function(t){var e,r,s;for(e=void 0,s=t.split(","),r=s.shift();!e&&r;)e=n[r.trim().toLowerCase()],r=s.shift();return e},l=function(t){t="auto"===t?"0px":t,t.indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px");var e,r,n;return r=void 0,e=16,(n=f[t])?n:(n={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[{css_line_height_string:t}],n!==r?f[t]=n/e:(n=parseFloat(t))?f[t]=n/e:(n=t.match(/([\d\.]+)(px)/),f[t]=3===n.length?parseFloat(n[1])/e:1))},i=function(t){var e,r,n;return n=function(t){var e;return e=function(t){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(t,null):t.currentStyle?t.currentStyle:t.style}(t),function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),e[t]}}(t),e={},r=void 0,e["font-family"]=c(n("font-family"))||"times",e["font-style"]=s[n("font-style")]||"normal",e["text-align"]=TextAlignMap[n("text-align")]||"left",r=o[n("font-weight")]||"normal","bold"===r&&(e["font-style"]="normal"===e["font-style"]?r:r+e["font-style"]),e["font-size"]=l(n("font-size"))||1,e["line-height"]=l(n("line-height"))||1,e.display="inline"===n("display")?"inline":"block","block"===e.display&&(e["margin-top"]=l(n("margin-top"))||0,e["margin-bottom"]=l(n("margin-bottom"))||0,e["padding-top"]=l(n("padding-top"))||0,e["padding-bottom"]=l(n("padding-bottom"))||0,e["margin-left"]=l(n("margin-left"))||0,e["margin-right"]=l(n("margin-right"))||0,e["padding-left"]=l(n("padding-left"))||0,e["padding-right"]=l(n("padding-right"))||0),e},d=function(t,e,r){var n,s,o,i,a;if(o=!1,s=void 0,i=void 0,a=void 0,n=r["#"+t.id])if("function"==typeof n)o=n(t,e);else for(s=0,i=n.length;!o&&s!==i;)o=n[s](t,e),s++;if(n=r[t.nodeName],!o&&n)if("function"==typeof n)o=n(t,e);else for(s=0,i=n.length;!o&&s!==i;)o=n[s](t,e),s++;return o},y=function(t,e){var r,n,s,o,i,a,u,c,l,f;for(r=[],n=[],s=0,f=t.rows[0].cells.length,c=t.clientWidth;f>s;)l=t.rows[0].cells[s],n[s]={name:l.textContent.toLowerCase().replace(/\s+/g,""),prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/c*e.pdf.internal.pageSize.width},s++;for(s=1;su;){if(s=o[u],"object"==typeof s){if(1===s.nodeType&&"HEADER"===s.nodeName){var w=s,b=e.pdf.margins_doc.top;e.pdf.internal.events.subscribe("addPage",function(){e.y=b,r(w,e,n),e.pdf.margins_doc.top=e.y+10,e.y+=10},!1)}if(8===s.nodeType&&"#comment"===s.nodeName)~s.textContent.indexOf("ADD_PAGE")&&(e.pdf.addPage(),e.y=e.pdf.margins_doc.top);else if(1!==s.nodeType||g[s.nodeName])if(3===s.nodeType){var q=s.nodeValue;if(s.nodeValue&&"LI"===s.parentNode.nodeName)if("OL"===s.parentNode.parentNode.nodeName)q=v++ +". "+q;else{var x=16*a["font-size"],k=2;x>20&&(k=3),m=function(t,e){this.pdf.circle(t,e,k,"FD")}}e.addText(q,a)}else"string"==typeof s&&e.addText(s,a);else if("IMG"===s.nodeName&&h[s.getAttribute("src")])e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottome.pdf.margins_doc.top&&(e.pdf.addPage(),e.y=e.pdf.margins_doc.top),e.pdf.addImage(h[s.getAttribute("src")],e.x,e.y,s.width,s.height),e.y+=s.height;else if("TABLE"===s.nodeName)p=y(s,e),e.y+=10,e.pdf.table(e.x,e.y,p.rows,p.headers,{autoSize:!1,printHeaders:!0,margins:e.pdf.margins_doc}),e.y=e.pdf.lastCellPos.y+e.pdf.lastCellPos.h+20;else if("OL"===s.nodeName||"UL"===s.nodeName)v=1,d(s,e,n)||r(s,e,n),e.y+=10;else if("LI"===s.nodeName){var _=e.x;e.x+="UL"===s.parentNode.nodeName?22:10,e.y+=3,d(s,e,n)||r(s,e,n),e.x=_}else d(s,e,n)||r(s,e,n)}u++}return c?e.setBlockBoundary(m):void 0},h={},p=function(t,e,r,n){function s(){e.pdf.internal.events.publish("imagesLoaded"),n()}function o(t,e,r){if(t){var n=new Image;++u,n.crossOrigin="",n.onerror=n.onload=function(){n.complete&&(0===n.src.indexOf("data:image/")&&(n.width=e||n.width||0,n.height=r||n.height||0),n.width+n.height&&(h[t]=h[t]||n)),--u||s()},n.src=t}}for(var i=t.getElementsByTagName("img"),a=i.length,u=0;a--;)o(i[a].getAttribute("src"),i[a].width,i[a].height);return u||s()},m=function(t,e,n,s){var o=t.getElementsByTagName("footer");if(o.length>0){o=o[0];var i=e.pdf.internal.write,a=e.y;e.pdf.internal.write=function(){},r(o,e,n);var u=Math.ceil(e.y-a)+5;e.y=a,e.pdf.internal.write=i,e.pdf.margins_doc.bottom+=u; for(var c=function(t){var s=void 0!==t?t.pageNumber:1,i=e.y;e.y=e.pdf.internal.pageSize.height-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=u;for(var a=o.getElementsByTagName("span"),c=0;c-1&&(a[c].innerHTML=s),(" "+a[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(a[c].innerHTML="###jsPDFVarTotalPages###");r(o,e,n),e.pdf.margins_doc.bottom+=u,e.y=i},l=o.getElementsByTagName("span"),f=0;f-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",c,!1),c(),g.FOOTER=1}s()},w=function(t,e,n,s,o,i){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,r,n,s;return n="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),s="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",r=document.createElement("div"),r.style.cssText=s,r.innerHTML='