/** * html2pdf.js v0.9.1 * Copyright (c) 2018 Erik Koopmans * Released under the MIT License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.html2pdf=e()}(this,function(){"use strict";function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function A(t,e){return e={exports:{}},t(e,e.exports),e.exports}var r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(A(function(e,A){e.exports=function(){function e(t){return"function"==typeof t}function A(){var t=setTimeout;return function(){return t(n,1)}}function n(){for(var t=0;t>7,a=1<<1+(7&n);t[e++],t[e++];var s=null;o&&(s=e,e+=3*a);var c=!0,l=[],u=0,h=null,d=0,f=null;for(this.width=A,this.height=r;c&&e>2&7,e++;break;case 254:for(;0!==(b=t[e++]);)e+=b;break;default:throw"Unknown graphic control label: 0x"+t[e-1].toString(16)}break;case 44:var g=t[e++]|t[e++]<<8,B=t[e++]|t[e++]<<8,w=t[e++]|t[e++]<<8,m=t[e++]|t[e++]<<8,y=t[e++],v=y>>6&1,Q=s,C=!1;y>>7&&(C=!0,Q=e,e+=3*(1<<1+(7&y)));var U=e;for(e++;;){var b;if(0===(b=t[e++]))break;e+=b}l.push({x:g,y:B,width:w,height:m,has_local_palette:C,palette_offset:Q,data_offset:U,data_length:e-U,transparent_index:h,interlaced:!!v,delay:u,disposal:d});break;case 59:c=!1;break;default:throw"Unknown gif block: 0x"+t[e-1].toString(16)}this.numFrames=function(){return l.length},this.loopCount=function(){return f},this.frameInfo=function(t){if(t<0||t>=l.length)throw"Frame index out of range.";return l[t]},this.decodeAndBlitFrameBGRA=function(e,r){var n=this.frameInfo(e),o=n.width*n.height,a=new Uint8Array(o);i(t,n.data_offset,a,o);var s=n.palette_offset,c=n.transparent_index;null===c&&(c=256);var l=n.width,u=A-l,h=l,d=4*(n.y*A+n.x),f=4*((n.y+n.height)*A+n.x),p=d,g=4*u;!0===n.interlaced&&(g+=4*(l+u)*7);for(var B=8,w=0,m=a.length;w>=1)),y===c)p+=4;else{var v=t[s+3*y],Q=t[s+3*y+1],C=t[s+3*y+2];r[p++]=C,r[p++]=Q,r[p++]=v,r[p++]=255}--h}},this.decodeAndBlitFrameRGBA=function(e,r){var n=this.frameInfo(e),o=n.width*n.height,a=new Uint8Array(o);i(t,n.data_offset,a,o);var s=n.palette_offset,c=n.transparent_index;null===c&&(c=256);var l=n.width,u=A-l,h=l,d=4*(n.y*A+n.x),f=4*((n.y+n.height)*A+n.x),p=d,g=4*u;!0===n.interlaced&&(g+=4*(l+u)*7);for(var B=8,w=0,m=a.length;w>=1)),y===c)p+=4;else{var v=t[s+3*y],Q=t[s+3*y+1],C=t[s+3*y+2];r[p++]=v,r[p++]=Q,r[p++]=C,r[p++]=255}--h}}}function i(t,e,A,r){for(var n=t[e++],i=1<>=s,l-=s,g!==i){if(g===o)break;for(var B=g>8,++w;var y=m;if(r>=8;null!==p&&a<4096&&(f[a++]=p<<8|y,c+1<=a&&s<12&&(++s,c=c<<1|1)),p=g}else a=o+1,c=(1<<(s=n+1))-1,p=null}return h!==r&&console.log("Warning, gif stream shorter than expected."),A}function o(t){function e(t,e){for(var A=0,r=0,n=new Array,i=1;i<=16;i++){for(var o=1;o<=t[i];o++)n[e[r]]=[],n[e[r]][0]=A,n[e[r]][1]=i,r++,A++;A*=2}return n}function A(t){for(var e=t[0],A=t[1]-1;0<=A;)e&1<>8&255),r(255&t)}function i(t,e,r,n,i){for(var o,a=i[0],s=i[240],c=function(t,e){var A,r,n,i,o,a,s,c,l,u,h=0;for(l=0;l<8;++l){A=t[h],r=t[h+1],n=t[h+2],i=t[h+3],o=t[h+4],a=t[h+5],s=t[h+6];var d=A+(c=t[h+7]),f=A-c,p=r+s,g=r-s,B=n+a,w=n-a,y=i+o,v=i-o,Q=d+y,C=d-y,U=p+B,b=p-B;t[h]=Q+U,t[h+4]=Q-U;var F=.707106781*(b+C);t[h+2]=C+F,t[h+6]=C-F;var E=.382683433*((Q=v+w)-(b=g+f)),x=.5411961*Q+E,H=1.306562965*b+E,I=.707106781*(U=w+g),S=f+I,_=f-I;t[h+5]=_+x,t[h+3]=_-x,t[h+1]=S+H,t[h+7]=S-H,h+=8}for(l=h=0;l<8;++l){A=t[h],r=t[h+8],n=t[h+16],i=t[h+24],o=t[h+32],a=t[h+40],s=t[h+48];var T=A+(c=t[h+56]),N=A-c,k=r+s,O=r-s,P=n+a,D=n-a,L=i+o,R=i-o,M=T+L,K=T-L,z=k+P,q=k-P;t[h]=M+z,t[h+32]=M-z;var j=.707106781*(q+K);t[h+16]=K+j,t[h+48]=K-j;var X=.382683433*((M=R+D)-(q=O+N)),V=.5411961*M+X,G=1.306562965*q+X,W=.707106781*(z=D+O),Y=N+W,J=N-W;t[h+40]=J+V,t[h+24]=J-V,t[h+8]=Y+G,t[h+56]=Y-G,h++}for(l=0;l<64;++l)u=t[l]*e[l],m[l]=0>4;for(var v=1;v<=d;++v)A(s);g&=15}o=32767+y[f],A(i[(g<<4)+w[o]]),A(B[o]),f++}return 63!=h&&A(a),r}function o(t){t<=0&&(t=1),100>3)*V+(M=4*(7&z)),X<=G+K&&(R-=V*(G+1+K-X)),V<=y+M&&(R-=y+M-V+4),E=q[R++],H=q[R++],D=q[R++],U[z]=(x[E]+x[H+256>>0]+x[D+512>>0]>>16)-128,b[z]=(x[E+768>>0]+x[H+1024>>0]+x[D+1280>>0]>>16)-128,F[z]=(x[E+1280>>0]+x[H+1536>>0]+x[D+1792>>0]>>16)-128;B=i(U,p,B,a,c),w=i(b,g,w,s,l),m=i(F,g,m,s,l),y+=32}G+=8}if(0<=C){var W=[];W[1]=C+1,W[0]=(1<>0]=38470*t,x[t+512>>0]=7471*t+32768,x[t+768>>0]=-11059*t,x[t+1024>>0]=-21709*t,x[t+1280>>0]=32768*t+8421375,x[t+1536>>0]=-27439*t,x[t+1792>>0]=-5329*t}(),o(t),(new Date).getTime()}function a(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}var s,c,l,u,h,d,f,p,g,B,w,m,y,v,Q,C,U,b,F,E,x,H,I,S,_,T,N,k,O,P,D,L,R,M,K,z,q,j,X,V,G,W,Y,J,Z,$,tt,et,At,rt,nt,it,ot,at="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},st=function(t){function A(e,i,o,a){var s={};"object"===(void 0===e?"undefined":at(e))&&(e=(s=e).orientation,i=s.unit||i,o=s.format||o,a=s.compress||s.compressPdf||a),i=i||"mm",o=o||"a4",e=(""+(e||"P")).toLowerCase(),(""+o).toLowerCase();var c,l,u,h,d,f,p,g,B,w,m,y=!!a&&"function"==typeof Uint8Array,v=s.textColor||"0 g",Q=s.drawColor||"0 G",C=s.fontSize||16,U=s.charSpace||0,b=s.R2L||!1,F=s.lineHeight||1.15,E=s.lineWidth||.200025,x="00000000000000000000000000000000",H=2,I=!1,S=[],_={},T={},N=0,k=[],O=[],P=[],D=[],L=[],R=0,M=0,K=0,z={title:"",subject:"",author:"",keywords:"",creator:""},q={},j=new function(e){var A={};this.subscribe=function(t,e,r){if("function"!=typeof e)return!1;A.hasOwnProperty(t)||(A[t]={});var n=Math.random().toString(35);return A[t][n]=[e,!!r],n},this.unsubscribe=function(t){for(var e in A)if(A[e][t])return delete A[e][t],!0;return!1},this.publish=function(r){if(A.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),i=[];for(var o in A[r]){var a=A[r][o];try{a[0].apply(e,n)}catch(r){t.console&&console.error("jsPDF PubSub Error",r.message,r)}a[1]&&i.push(o)}i.length&&i.forEach(this.unsubscribe)}}}(q),X=s.hotfixes||[],V=function(t){var e,A=t.ch1,r=t.ch2,n=t.ch3,i=t.ch4,o=(t.precision,"draw"===t.pdfColorType?["G","RG","K"]:["g","rg","k"]);if("string"==typeof A&&"#"!==A.charAt(0)){var a=new RGBColor(A);a.ok&&(A=a.toHex())}if("string"==typeof A&&/^#[0-9A-Fa-f]{3}$/.test(A)&&(A="#"+A[1]+A[1]+A[2]+A[2]+A[3]+A[3]),"string"==typeof A&&/^#[0-9A-Fa-f]{6}$/.test(A)){var s=parseInt(A.substr(1),16);A=s>>16&255,r=s>>8&255,n=255&s}if(void 0===r||void 0===i&&A===r&&r===n)if("string"==typeof A)e=A+" "+o[0];else switch(t.precision){case 2:e=J(A/255)+" "+o[0];break;case 3:default:e=Z(A/255)+" "+o[0]}else if(void 0===i||"object"===(void 0===i?"undefined":at(i))){if("string"==typeof A)e=[A,r,n,o[1]].join(" ");else switch(t.precision){case 2:e=[J(A/255),J(r/255),J(n/255),o[1]].join(" ");break;default:case 3:e=[Z(A/255),Z(r/255),Z(n/255),o[1]].join(" ")}i&&0===i.a&&(e=["255","255","255",o[1]].join(" "))}else if("string"==typeof A)e=[A,r,n,i,o[2]].join(" ");else switch(t.precision){case 2:e=[J(A),J(r),J(n),J(i),o[2]].join(" ");break;case 3:default:e=[Z(A),Z(r),Z(n),Z(i),o[2]].join(" ")}return e},G=function(t){var e=function(t){return("0"+parseInt(t)).slice(-2)},A=t.getTimezoneOffset(),r=A<0?"+":"-",n=Math.floor(Math.abs(A/60)),i=Math.abs(A%60),o=[r,e(n),"'",e(i),"'"].join("");return["D:",t.getFullYear(),e(t.getMonth()+1),e(t.getDate()),e(t.getHours()),e(t.getMinutes()),e(t.getSeconds()),o].join("")},W=function(t){var e;return void 0===(void 0===t?"undefined":at(t))&&(t=new Date),e="object"===(void 0===t?"undefined":at(t))&&"[object Date]"===Object.prototype.toString.call(t)?G(t):/^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)?t:G(new Date),w=e},Y=function(t){return t=t||"12345678901234567890123456789012".split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),x=t},J=function(t){return t.toFixed(2)},Z=function(t){return t.toFixed(3)},$=function(t){t="string"==typeof t?t:t.toString(),I?k[h].push(t):(K+=t.length+1,D.push(t))},tt=function(){return S[++H]=K,$(H+" 0 obj"),H},et=function(t){$("stream"),$(t),$("endstream")},At=function(){!function(){for(var t in _)_.hasOwnProperty(t)&&(e=_[t],j.publish("putFont",{font:e,out:$,newObject:tt}),!0!==e.isAlreadyPutted&&(e.objectNumber=tt(),$("<<"),$("/Type /Font"),$("/BaseFont /"+e.postScriptName),$("/Subtype /Type1"),"string"==typeof e.encoding&&$("/Encoding /"+e.encoding),$("/FirstChar 32"),$("/LastChar 255"),$(">>"),$("endobj")));var e}(),j.publish("putResources"),S[2]=K,$("2 0 obj"),$("<<"),function(){for(var t in $("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),$("/Font <<"),_)_.hasOwnProperty(t)&&$("/"+t+" "+_[t].objectNumber+" 0 R");$(">>"),$("/XObject <<"),j.publish("putXobjectDict"),$(">>")}(),$(">>"),$("endobj"),j.publish("postPutResources")},rt=function(t,e,A){T.hasOwnProperty(e)||(T[e]={}),T[e][A]=t},nt=function(t,e,A,r){var n="F"+(Object.keys(_).length+1).toString(10),i=_[n]={id:n,postScriptName:t,fontName:e,fontStyle:A,encoding:r,metadata:{}};return rt(n,e,A),j.publish("addFont",i),n},it=function(t,e){return function(t,e){var A,r,n,i,o,a,s,l,u;if(n=(e=e||{}).sourceEncoding||"Unicode",o=e.outputEncoding,(e.autoencode||o)&&_[c].metadata&&_[c].metadata[n]&&_[c].metadata[n].encoding&&(i=_[c].metadata[n].encoding,!o&&_[c].encoding&&(o=_[c].encoding),!o&&i.codePages&&(o=i.codePages[0]),"string"==typeof o&&(o=i[o]),o)){for(s=!1,a=[],A=0,r=t.length;A>8&&(s=!0);t=a.join("")}for(A=t.length;void 0===s&&0!==A;)t.charCodeAt(A-1)>>8&&(s=!0),A--;if(!s)return t;for(a=e.noBOM?[]:[254,255],A=0,r=t.length;A>8)>>8)throw new Error("Character at position "+A+" of string '"+t+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");a.push(u),a.push(l-(u<<8))}return String.fromCharCode.apply(void 0,a)}(t,e).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ot=function(){(function(t,e){var A="string"==typeof e&&e.toLowerCase();if("string"==typeof t){var r=t.toLowerCase();n.hasOwnProperty(r)&&(t=n[r][0]/l,e=n[r][1]/l)}if(Array.isArray(t)&&(e=t[1],t=t[0]),A){switch(A.substr(0,1)){case"l":t>"),$("endobj"),r=k[e].join("\n"),tt(),y){for(n=[],i=r.length;i--;)n[i]=r.charCodeAt(i);a=s.from(r),(o=new Deflater(6)).append(new Uint8Array(n)),r=o.flush(),(n=new Uint8Array(r.length+6)).set(new Uint8Array([120,156])),n.set(r,2),n.set(new Uint8Array([255&a,a>>8&255,a>>16&255,a>>24&255]),r.length+2),r=String.fromCharCode.apply(null,n),$("<>")}else $("<>");et(r),$("endobj")}S[1]=K,$("1 0 obj"),$("<>"),$("endobj"),j.publish("postPutPages")}(),function(){j.publish("putAdditionalObjects");for(var t=0;t>"),$("endobj"),tt(),$("<<"),function(){switch($("/Type /Catalog"),$("/Pages 1 0 R"),g||(g="fullwidth"),g){case"fullwidth":$("/OpenAction [3 0 R /FitH null]");break;case"fullheight":$("/OpenAction [3 0 R /FitV null]");break;case"fullpage":$("/OpenAction [3 0 R /Fit]");break;case"original":$("/OpenAction [3 0 R /XYZ null null 1]");break;default:var t=""+g;"%"===t.substr(t.length-1)&&(g=parseInt(g)/100),"number"==typeof g&&$("/OpenAction [3 0 R /XYZ null null "+J(g)+"]")}switch(B||(B="continuous"),B){case"continuous":$("/PageLayout /OneColumn");break;case"single":$("/PageLayout /SinglePage");break;case"two":case"twoleft":$("/PageLayout /TwoColumnLeft");break;case"tworight":$("/PageLayout /TwoColumnRight")}p&&$("/PageMode /"+p),j.publish("putCatalog")}(),$(">>"),$("endobj");var e,n=K,i="0000000000";for($("xref"),$("0 "+(H+1)),$(i+" 65535 f "),e=1;e<=H;e++){var o=S[e];$("function"==typeof o?(i+S[e]()).slice(-10)+" 00000 n ":(i+S[e]).slice(-10)+" 00000 n ")}return $("trailer"),$("<<"),$("/Size "+(H+1)),$("/Root "+H+" 0 R"),$("/Info "+(H-1)+" 0 R"),$("/ID [ <"+x+"> <"+x+"> ]"),$(">>"),$("startxref"),$(""+n),$("%%EOF"),I=!0,D.join("\n")},ut=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},ht=function(){for(var t=lt(),e=t.length,A=new ArrayBuffer(e),r=new Uint8Array(A);e--;)r[e]=t.charCodeAt(e);return A},dt=function(){return new Blob([ht()],{type:"application/pdf"})},ft=((m=function(e,A){var r="dataur"===(""+e).substr(0,6)?"data:application/pdf;base64,"+btoa(lt()):0;switch(e){case void 0:return lt();case"save":if("object"===("undefined"==typeof navigator?"undefined":at(navigator))&&navigator.getUserMedia&&(void 0===t.URL||void 0===t.URL.createObjectURL))return q.output("dataurlnewwindow");bt(dt(),A),"function"==typeof bt.unload&&t.setTimeout&&setTimeout(bt.unload,911);break;case"arraybuffer":return ht();case"blob":return dt();case"bloburi":case"bloburl":return t.URL&&t.URL.createObjectURL(dt())||void 0;case"datauristring":case"dataurlstring":return r;case"dataurlnewwindow":var n=t.open(r);if(n||"undefined"==typeof safari)return n;case"datauri":case"dataurl":return t.document.location.href=r;default:throw new Error('Output type "'+e+'" is not supported.')}}).foo=function(){try{return m.apply(this,arguments)}catch(r){var e=r.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var A="Error in function "+e.split("\n")[0].split("<")[0]+": "+r.message;if(!t.console)throw new Error(A);t.console.error(A,r),t.alert&&alert(A)}},(m.foo.bar=m).foo),pt=function(t){return!0===Array.isArray(X)&&-1":")")):"[object Array]"===Object.prototype.toString.call(m[Y])&&(J=parseFloat(m[Y][1]).toFixed(2),Z=parseFloat(m[Y][2]).toFixed(2),tt=(o?"<":"(")+m[Y][0]+(o?">":")"),et=1),void 0!==q&&void 0!==q[Y]&&(At=q[Y]+" Tw\n"),0!==H.length&&0===Y?t.push(At+H.join(" ")+" "+J+" "+Z+" Tm\n"+tt):1===et||0===et&&0===Y?t.push(At+J+" "+Z+" Td\n"+tt):t.push(At+tt);t=0===et?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var rt="BT\n/"+c+" "+C+" Tf\n"+(C*l).toFixed(2)+" TL\n"+v+"\n";return rt+=s,rt+=t,$(rt+="ET"),u},q.lstext=function(t,e,A,r){console.warn("jsPDF.lstext is deprecated");for(var n=0,i=t.length;n=i.length-1;if(!Q||C){if(Q||C){if(C)g=v;else if(t.multiline&&a<(l+2)*(m+2)+2)continue t}else{if(!t.multiline)continue t;if(a<(l+2)*(m+2)+2)continue t;g=v}for(var U="",b=p;b<=g;b++)U+=i[b]+" ";switch(U=" "==U.substr(U.length-1)?U.substr(0,U.length-1):U,B=d(U,o+"px",A).width,t.Q){case 2:h=s-B-2;break;case 1:h=(s-B)/2;break;case 0:default:h=2}e+=h.toFixed(2)+" "+f.toFixed(2)+" Td\n",e+="("+U+") Tj\n",e+=-h.toFixed(2)+" 0 Td\n",f=-(o+2),B=0,p=g+1,m++,w=""}else w+=" "}break}return n.text=e,n.fontSize=o,n},d=function(t,e,r){r=r||"helvetica";var n=A.internal.getFont(r),i=A.getStringUnitWidth(t,{font:n,fontSize:parseFloat(e),charSpace:0})*parseFloat(e);return{height:A.getStringUnitWidth("3",{font:n,fontSize:parseFloat(e),charSpace:0})*parseFloat(e)*1.5,width:i}},f={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){for(var t in A.internal.acroformPlugin.acroFormDictionaryRoot.Fields){var e=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields[t];e.hasAnnotation&&B.call(A,e)}},g=function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||Q.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},B=function(t){var e={type:"reference",object:t};A.annotationPlugin.annotations[A.internal.getPageInfo(t.page).pageNumber].push(e)},w=function(){void 0!==A.internal.acroformPlugin.acroFormDictionaryRoot?A.internal.write("/AcroForm "+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R"):console.log("Root missing...")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},y=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId),A.internal.out(A.internal.acroformPlugin.acroFormDictionaryRoot.getString())),t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var r in t){var n=t[r],i=n.Rect;n.Rect&&(n.Rect=l.call(this,n.Rect)),A.internal.newObjectDeferredBegin(n.objId);var o=n.objId+" 0 obj\n<<\n";if("object"===(void 0===n?"undefined":at(n))&&"function"==typeof n.getContent&&(o+=n.getContent()),n.Rect=i,n.hasAppearanceStream&&!n.appearanceStreamContent){var a=u.call(this,n);o+="/AP << /N "+a+" >>\n",A.internal.acroformPlugin.xForms.push(a)}if(n.appearanceStreamContent){for(var s in o+="/AP << ",n.appearanceStreamContent){var c=n.appearanceStreamContent[s];if(o+="/"+s+" ",o+="<< ",1<=Object.keys(c).length||Array.isArray(c))for(var r in c){var h;"function"==typeof(h=c[r])&&(h=h.call(this,n)),o+="/"+r+" "+h+" ",0<=A.internal.acroformPlugin.xForms.indexOf(h)||A.internal.acroformPlugin.xForms.push(h)}else"function"==typeof(h=c)&&(h=h.call(this,n)),o+="/"+r+" "+h+" \n",0<=A.internal.acroformPlugin.xForms.indexOf(h)||A.internal.acroformPlugin.xForms.push(h);o+=" >>\n"}o+=">>\n"}o+=">>\nendobj\n",A.internal.out(o)}e&&v.call(this,A.internal.acroformPlugin.xForms)},v=function(t){for(var e in t){var r=e,n=t[e];A.internal.newObjectDeferredBegin(n&&n.objId);var i="";"object"===(void 0===n?"undefined":at(n))&&"function"==typeof n.getString&&(i=n.getString()),A.internal.out(i),delete t[r]}},Q=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,x.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(f)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");n=A.internal.scaleFactor,r=A.internal.pageSize.getHeight(),A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe("postPutResources",m),A.internal.events.subscribe("buildDocument",p),A.internal.events.subscribe("putCatalog",w),A.internal.events.subscribe("postPutPages",y),A.internal.acroformPlugin.isInitialized=!0}},C=function(t){if(Array.isArray(t)){var e=" [";for(var A in t)e+=t[A].toString(),e+=A>\n",this.stream&&(t+="stream\n",t+=this.stream,t+="\nendstream\n"),t+="endobj\n"},b.prototype.getContent=function(){var t="";return t+=function(t){var e="",A=Object.keys(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var r in A){var n=A[r],i=t[n];i&&(Array.isArray(i)?e+="/"+n+" "+C(i)+"\n":e+=i instanceof b?"/"+n+" "+i.objId+" 0 R\n":"/"+n+" "+i+"\n")}return e}(this)};var F=function(){var t;b.call(this),this.Type="/XObject",this.Subtype="/Form",this.FormType=1,this.BBox,this.Matrix,this.Resources="2 0 R",this.PieceInfo,Object.defineProperty(this,"Length",{enumerable:!0,get:function(){return void 0!==t?t.length:0}}),Object.defineProperty(this,"stream",{enumerable:!1,set:function(e){t=e.trim()},get:function(){return t||null}})};i(F,b);var E=function(){b.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return 0>"},YesPushDown:function(t){var e=a(t),r=[],n=A.internal.getFont("zapfdingbats","normal").id;t.Q=1;var i=h(t,"3","ZapfDingbats",50);return r.push("0.749023 g"),r.push("0 0 "+R.internal.getWidth(t).toFixed(2)+" "+R.internal.getHeight(t).toFixed(2)+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+i.fontSize.toFixed(2)+" Tf 0 g"),r.push("BT"),r.push(i.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join("\n"),e},YesNormal:function(t){var e=a(t),r=A.internal.getFont("zapfdingbats","normal").id,n=[];t.Q=1;var i=R.internal.getHeight(t),o=R.internal.getWidth(t),s=h(t,"3","ZapfDingbats",.9*i);return n.push("1 g"),n.push("0 0 "+o.toFixed(2)+" "+i.toFixed(2)+" re"),n.push("f"),n.push("q"),n.push("0 0 1 rg"),n.push("0 0 "+(o-1).toFixed(2)+" "+(i-1).toFixed(2)+" re"),n.push("W"),n.push("n"),n.push("0 g"),n.push("BT"),n.push("/"+r+" "+s.fontSize.toFixed(2)+" Tf 0 g"),n.push(s.text),n.push("ET"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=a(t),A=[];return A.push("0.749023 g"),A.push("0 0 "+R.internal.getWidth(t).toFixed(2)+" "+R.internal.getHeight(t).toFixed(2)+" re"),A.push("f"),e.stream=A.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:R.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=R.RadioButton.Circle.YesNormal,e.D[t]=R.RadioButton.Circle.YesPushDown,e},createMK:function(){return"<< /CA (l)>>"},YesNormal:function(t){var e=a(t),A=[],r=R.internal.getWidth(t)<=R.internal.getHeight(t)?R.internal.getWidth(t)/4:R.internal.getHeight(t)/4;r*=.9;var n=R.internal.Bezier_C;return A.push("q"),A.push("1 0 0 1 "+R.internal.getWidth(t)/2+" "+R.internal.getHeight(t)/2+" cm"),A.push(r+" 0 m"),A.push(r+" "+r*n+" "+r*n+" "+r+" 0 "+r+" c"),A.push("-"+r*n+" "+r+" -"+r+" "+r*n+" -"+r+" 0 c"),A.push("-"+r+" -"+r*n+" -"+r*n+" -"+r+" 0 -"+r+" c"),A.push(r*n+" -"+r+" "+r+" -"+r*n+" "+r+" 0 c"),A.push("f"),A.push("Q"),e.stream=A.join("\n"),e},YesPushDown:function(t){var e=a(t),A=[],r=R.internal.getWidth(t)<=R.internal.getHeight(t)?R.internal.getWidth(t)/4:R.internal.getHeight(t)/4,n=2*(r*=.9),i=n*R.internal.Bezier_C,o=r*R.internal.Bezier_C;return A.push("0.749023 g"),A.push("q"),A.push("1 0 0 1 "+(R.internal.getWidth(t)/2).toFixed(2)+" "+(R.internal.getHeight(t)/2).toFixed(2)+" cm"),A.push(n+" 0 m"),A.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),A.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),A.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),A.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),A.push("f"),A.push("Q"),A.push("0 g"),A.push("q"),A.push("1 0 0 1 "+(R.internal.getWidth(t)/2).toFixed(2)+" "+(R.internal.getHeight(t)/2).toFixed(2)+" cm"),A.push(r+" 0 m"),A.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),A.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),A.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),A.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),A.push("f"),A.push("Q"),e.stream=A.join("\n"),e},OffPushDown:function(t){var e=a(t),A=[],r=R.internal.getWidth(t)<=R.internal.getHeight(t)?R.internal.getWidth(t)/4:R.internal.getHeight(t)/4,n=2*(r*=.9),i=n*R.internal.Bezier_C;return A.push("0.749023 g"),A.push("q"),A.push("1 0 0 1 "+(R.internal.getWidth(t)/2).toFixed(2)+" "+(R.internal.getHeight(t)/2).toFixed(2)+" cm"),A.push(n+" 0 m"),A.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),A.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),A.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),A.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),A.push("f"),A.push("Q"),e.stream=A.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:R.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=R.RadioButton.Cross.YesNormal,e.D[t]=R.RadioButton.Cross.YesPushDown,e},createMK:function(){return"<< /CA (8)>>"},YesNormal:function(t){var e=a(t),A=[],r=R.internal.calculateCross(t);return A.push("q"),A.push("1 1 "+(R.internal.getWidth(t)-2).toFixed(2)+" "+(R.internal.getHeight(t)-2).toFixed(2)+" re"),A.push("W"),A.push("n"),A.push(r.x1.x.toFixed(2)+" "+r.x1.y.toFixed(2)+" m"),A.push(r.x2.x.toFixed(2)+" "+r.x2.y.toFixed(2)+" l"),A.push(r.x4.x.toFixed(2)+" "+r.x4.y.toFixed(2)+" m"),A.push(r.x3.x.toFixed(2)+" "+r.x3.y.toFixed(2)+" l"),A.push("s"),A.push("Q"),e.stream=A.join("\n"),e},YesPushDown:function(t){var e=a(t),A=R.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+R.internal.getWidth(t).toFixed(2)+" "+R.internal.getHeight(t).toFixed(2)+" re"),r.push("f"),r.push("q"),r.push("1 1 "+(R.internal.getWidth(t)-2).toFixed(2)+" "+(R.internal.getHeight(t)-2).toFixed(2)+" re"),r.push("W"),r.push("n"),r.push(A.x1.x.toFixed(2)+" "+A.x1.y.toFixed(2)+" m"),r.push(A.x2.x.toFixed(2)+" "+A.x2.y.toFixed(2)+" l"),r.push(A.x4.x.toFixed(2)+" "+A.x4.y.toFixed(2)+" m"),r.push(A.x3.x.toFixed(2)+" "+A.x3.y.toFixed(2)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=a(t),A=[];return A.push("0.749023 g"),A.push("0 0 "+R.internal.getWidth(t).toFixed(2)+" "+R.internal.getHeight(t).toFixed(2)+" re"),A.push("f"),e.stream=A.join("\n"),e}}},createDefaultAppearanceStream:function(t){return"/F1 0 Tf 0 g"}};R.internal={Bezier_C:.551915024494,calculateCross:function(t){var e,A,r=R.internal.getWidth(t),n=R.internal.getHeight(t),i=(A=n)<(e=r)?A:e;return{x1:{x:(r-i)/2,y:(n-i)/2+i},x2:{x:(r-i)/2+i,y:(n-i)/2},x3:{x:(r-i)/2,y:(n-i)/2},x4:{x:(r-i)/2+i,y:(n-i)/2+i}}}},R.internal.getWidth=function(t){var e=0;return"object"===(void 0===t?"undefined":at(t))&&(e=o(t.Rect[2])),e},R.internal.getHeight=function(t){var e=0;return"object"===(void 0===t?"undefined":at(t))&&(e=o(t.Rect[3])),e},t.addField=function(t){return Q.call(this),t instanceof D?this.addTextField.call(this,t):t instanceof H?this.addChoiceField.call(this,t):t instanceof T?this.addButton.call(this,t):t instanceof O?g.call(this,t):t&&g.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this},t.addButton=function(t){Q.call(this);var e=t||new x;e.FT="/Btn",e.Ff=c(e.Ff,t,A.internal.getPDFVersion()),g.call(this,e)},t.addTextField=function(t){Q.call(this);var e=t||new x;e.FT="/Tx",e.Ff=c(e.Ff,t,A.internal.getPDFVersion()),g.call(this,e)},t.addChoiceField=function(t){Q.call(this);var e=t||new x;e.FT="/Ch",e.Ff=c(e.Ff,t,A.internal.getPDFVersion()),g.call(this,e)},"object"==(void 0===e?"undefined":at(e))&&(e.ChoiceField=H,e.ListBox=I,e.ComboBox=S,e.EditBox=_,e.Button=T,e.PushButton=N,e.RadioButton=k,e.CheckBox=P,e.TextField=D,e.PasswordField=L,e.AcroForm={Appearance:R}),t.AcroFormChoiceField=H,t.AcroFormListBox=I,t.AcroFormComboBox=S,t.AcroFormEditBox=_,t.AcroFormButton=T,t.AcroFormPushButton=N,t.AcroFormRadioButton=k,t.AcroFormCheckBox=P,t.AcroFormTextField=D,t.AcroFormPasswordField=L,t.AcroForm={ChoiceField:H,ListBox:I,ComboBox:S,EditBox:_,Button:T,PushButton:N,RadioButton:k,CheckBox:P,TextField:D,PasswordField:L}}(st.API,"undefined"!=typeof window&&window||void 0!==r&&r),st.API.addHTML=function(t,e,A,r,n){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&&(r=e,n=A),"function"==typeof r&&(n=r,r=null),"function"!=typeof n&&(n=function(){});var i=this.internal,o=i.scaleFactor,a=i.pageSize.getWidth(),s=i.pageSize.getHeight();if((r=r||{}).onrendered=function(t){e=parseInt(e)||0,A=parseInt(A)||0;var i=r.dim||{},c=Object.assign({top:0,right:0,bottom:0,left:0,useFor:"content"},r.margin),l=i.h||Math.min(s,t.height/o),u=i.w||Math.min(a,t.width/o)-e,h=r.format||"JPEG",d=r.imageCompression||"SLOW";if(t.height>s-c.top-c.bottom&&r.pagesplit){var f=function(t,e,A,n,i){var o=document.createElement("canvas");o.height=i,o.width=n;var a=o.getContext("2d");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=r.backgroundColor||"#ffffff",a.fillRect(0,0,n,i),a.drawImage(t,e,A,n,i,0,0,n,i),o},p=function(){for(var r,i,l=0,p=0,g={},B=!1;;){var w;if(p=0,g.top=0!==l?c.top:A,g.left=0!==l?c.left:e,B=(a-c.left-c.right)*o=t.width)break;this.addPage()}else m=[w=f(t,0,l,r,i),g.left,g.top,w.width/o,w.height/o,h,null,d],this.addImage.apply(this,m);if((l+=i)>=t.height)break;this.addPage()}n(u,l,null,m)}.bind(this);if("CANVAS"===t.nodeName){var g=new Image;g.onload=p,g.src=t.toDataURL("image/png"),t=g}else p()}else{var B=Math.random().toString(35),w=[t,e,A,u,l,h,B,d];this.addImage.apply(this,w),n(u,l,B,w)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"!=typeof rasterizeHTML){var c="drawDocument";return"string"==typeof t&&(c=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||a*o,rasterizeHTML[c](t,void 0,r).then(function(t){r.onrendered(t.image)},function(t){n(null,t)})}return null},function(t){var e="addImage_",A={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]};t.getImageFileTypeByImageData=function(t,e){var r,n;e=e||"UNKNOWN";var i,o,a,s="UNKNOWN";for(a in A)for(i=A[a],r=0;r>"),"trns"in e&&e.trns.constructor==Array){for(var i="",o=0,a=e.trns.length;o>"),n(e.data),r("endobj"),"smask"in e){var s="/Predictor "+e.p+" /Colors 1 /BitsPerComponent "+e.bpc+" /Columns "+e.w,c={w:e.w,h:e.h,cs:"DeviceGray",bpc:e.bpc,dp:s,data:e.smask};"f"in e&&(c.f=e.f),t.call(this,c)}e.cs===this.color_spaces.INDEXED&&(this.internal.newObject(),r("<< /Length "+e.pal.length+">>"),n(this.arrayBufferToBinaryString(new Uint8Array(e.pal))),r("endobj"))},n=function(){var t=this.internal.collections[e+"images"];for(var A in t)r.call(this,t[A])},i=function(){var t,A=this.internal.collections[e+"images"],r=this.internal.write;for(var n in A)r("/I"+(t=A[n]).i,t.n,"0","R")},o=function(e){return"function"==typeof t["process"+e.toUpperCase()]},a=function(t){return"object"===(void 0===t?"undefined":at(t))&&1===t.nodeType},s=function(t,e){if("IMG"===t.nodeName&&t.hasAttribute("src")){var A=""+t.getAttribute("src");if(0===A.indexOf("data:image/"))return A;!e&&/\.png(?:[?#].*)?$/i.test(A)&&(e="png")}if("CANVAS"===t.nodeName)var r=t;else{(r=document.createElement("canvas")).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).toLowerCase()?"image/png":"image/jpeg")},c=function(t,e){var A;if(e)for(var r in e)if(t===e[r].alias){A=e[r];break}return A};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",SEPARATION:"Separation",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.sHashCode=function(t){return t=t||"",Array.prototype.reduce&&t.split("").reduce(function(t,e){return(t=(t<<5)-t+e.charCodeAt(0))&t},0)},t.isString=function(t){return"string"==typeof t},t.validateStringAsBase64=function(t){var e=!0;return(t=t||"").length%4!=0&&(e=!1),!1===/[A-Za-z0-9\/]+/.test(t.substr(0,t.length-2))&&(e=!1),!1===/[A-Za-z0-9\/][A-Za-z0-9+\/]|[A-Za-z0-9+\/]=|==/.test(t.substr(-2))&&(e=!1),e},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},t.isArrayBufferView=function(t){return!!this.supportsArrayBuffer()&&"undefined"!=typeof Uint32Array&&(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)},t.binaryStringToUint8Array=function(t){for(var e=t.length,A=new Uint8Array(e),r=0;r>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==o?A+=r[(252&(e=n[a]))>>2]+r[(3&e)<<4]+"==":2==o&&(A+=r[(64512&(e=n[a]<<8|n[a+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),A},t.createImageInfo=function(t,e,A,r,n,i,o,a,s,c,l,u,h){var d={alias:a,w:e,h:A,cs:r,bpc:n,i:o,data:t};return i&&(d.f=i),s&&(d.dp=s),c&&(d.trns=c),l&&(d.pal=l),u&&(d.smask=u),h&&(d.p=h),d},t.addImage=function(A,r,l,u,h,d,f,p,g){var B="";if("string"!=typeof r){var w=d;d=h,h=u,u=l,l=r,r=w}if("object"===(void 0===A?"undefined":at(A))&&!a(A)&&"imageData"in A){var m=A;A=m.imageData,r=m.format||r,l=m.x||l||0,u=m.y||u||0,h=m.w||h,d=m.h||d,f=m.alias||f,p=m.compression||p,g=m.rotation||m.angle||g}if(isNaN(l)||isNaN(u))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var y,v,Q,C,U,b,F,E=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",n),this.internal.events.subscribe("putXobjectDict",i)),t}.call(this);if(!((y=c(A,E))||(a(A)&&(A=s(A,r)),(null==(F=f)||0===F.length)&&(f="string"==typeof(b=A)&&t.sHashCode(b)),y=c(f,E)))){if(this.isString(A)&&(""!==(B=this.convertStringToImageData(A))?A=B:void 0!==(B=this.loadImageFile(A))&&(A=B)),r=this.getImageFileTypeByImageData(A,r),!o(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if(this.supportsArrayBuffer()&&(A instanceof Uint8Array||(v=A,A=this.binaryStringToUint8Array(A))),!(y=this["process"+r.toUpperCase()](A,(U=0,(C=E)&&(U=Object.keys?Object.keys(C).length:function(t){var e=0;for(var A in t)t.hasOwnProperty(A)&&e++;return e}(C)),U),f,((Q=p)&&"string"==typeof Q&&(Q=Q.toUpperCase()),Q in t.image_compression?Q:t.image_compression.NONE),v)))throw new Error("An unkwown error occurred whilst processing the image")}return function(t,e,A,r,n,i,o,a){var s=function(t,e,A){return t||e||(e=t=-96),t<0&&(t=-1*A.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*A.h*72/e/this.internal.scaleFactor),0===t&&(t=e*A.w/A.h),0===e&&(e=t*A.h/A.w),[t,e]}.call(this,A,r,n),c=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString;if(A=s[0],r=s[1],o[i]=n,a){a*=Math.PI/180;var u=Math.cos(a),h=Math.sin(a),d=function(t){return t.toFixed(4)},f=[d(u),d(h),d(-1*h),d(u),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,c(t),l(e+r),"cm"].join(" ")),this.internal.write(f.join(" ")),this.internal.write([c(A),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(A),"0","0",c(r),c(t),l(e+r),"cm"].join(" ")),this.internal.write("/I"+n.i+" Do"),this.internal.write("Q")}.call(this,l,u,h,d,y,y.i,E,g),this},t.convertStringToImageData=function(e){var A,r="";return this.isString(e)&&(null!==(A=this.extractInfoFromBase64DataURI(e))?t.validateStringAsBase64(A[3])&&(r=atob(A[3])):t.validateStringAsBase64(e)&&(r=atob(e))),r};var l=function(t,e){return t.subarray(e,e+5)};t.processJPEG=function(t,e,A,r,n,i){var o,a=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(o=function(t){var e;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 A=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,n=t.length;r>",l.content=B;var d=l.objId+" 0 R";B="<>";else if(s.options.pageNumber)switch(B="<>",this.internal.write(B))}}this.internal.write("]")}}]),s.createAnnotation=function(t){switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push(t)}},s.link=function(t,e,A,r,n){this.annotationPlugin.annotations[this.internal.getCurrentPageInfo().pageNumber].push({x:t,y:e,w:A,h:r,options:n,type:"link"})},s.textWithLink=function(t,e,A,r){var n=this.getTextWidth(t),i=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,A),A+=.2*i,this.link(e,A-i,n,i,r),n},s.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},s.getLineHeight=function(){return this.internal.getLineHeight()},function(t){function e(t){return void 0!==t&&void 0!==a[t.charCodeAt(0)]}function A(t){return void 0!==t&&0<=h.indexOf(t.charCodeAt(0))}function r(t){return void 0!==t&&0<=u.indexOf(t.charCodeAt(0))}function n(t){return e(t)&&2<=a[t.charCodeAt(0)].length}function i(t,i,o,s){return e(t)?(s=s||{},a=Object.assign(a,s),!n(t)||!e(i)&&!e(o)||!e(o)&&A(i)||A(t)&&!e(i)||A(t)&&r(i)||A(t)&&A(i)?(a=Object.assign(a,c),d):e(l=t)&&4==a[l.charCodeAt(0)].length&&e(i)&&!A(i)&&e(o)&&n(o)?(a=Object.assign(a,c),g):A(t)||!e(o)?(a=Object.assign(a,c),f):(a=Object.assign(a,c),p)):-1;var l}var o=Object.keys({ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",fa:"Persian","fa-IR":"Persian/Iran",ur:"Urdu"}),a={1569:[65152],1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1572:[65157,65158],1573:[65159,65160,65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166,65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194,65193],1584:[65195,65196,65195],1585:[65197,65198,65197],1586:[65199,65200,65199],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262,65261],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395,64394],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},s={1570:[65269,65270,65269,65270],1571:[65271,65272,65271,65272],1573:[65273,65274,65273,65274],1575:[65275,65276,65275,65276]},c={1570:[65153,65154,65153,65154],1571:[65155,65156,65155,65156],1573:[65159,65160,65159,65160],1575:[65165,65166,65165,65166]},l={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},u=[1570,1571,1573,1575],h=[1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688],d=0,f=1,p=2,g=3,B=t.processArabic=function(t,A){t=t||"",A=A||!1;var n,o,u,h="",d=0,f=0,p="",g="",B="";for(d=0;d>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})}return this},(l=st.API).events.push(["initialized",function(){this.canvas.pdf=this}]),l.canvas={getContext:function(t){return(this.pdf.context2d._canvas=this).pdf.context2d},childNodes:[]},Object.defineProperty(l.canvas,"width",{get:function(){return this._width},set:function(t){this._width=t,this.getContext("2d").pageWrapX=t+1}}),Object.defineProperty(l.canvas,"height",{get:function(){return this._height},set:function(t){this._height=t,this.getContext("2d").pageWrapY=t+1}}),u=st.API,g={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},B=1,w=function(t,e,A,r,n){g={x:t,y:e,w:A,h:r,ln:n}},m=function(){return g},y={left:0,top:0,bottom:0},u.setHeaderFunction=function(t){p=t},u.getTextDimensions=function(t){h=this.internal.getFont().fontName,d=this.table_font_size||this.internal.getFontSize(),f=this.internal.getFont().fontStyle;var e,A,r=19.049976/25.4;(A=document.createElement("font")).id="jsPDFCell";try{A.style.fontStyle=f}catch(e){A.style.fontWeight=f}A.style.fontSize=d+"pt",A.style.fontFamily=h;try{A.textContent=t}catch(e){A.innerText=t}return document.body.appendChild(A),e={w:(A.offsetWidth+1)*r,h:(A.offsetHeight+1)*r},document.body.removeChild(A),e},u.cellAddPage=function(){var t=this.margins||y;this.addPage(),w(t.left,t.top,void 0,void 0),B+=1},u.cellInitialize=function(){g={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},B=1},u.cell=function(t,e,A,r,n,i,o){var a=m(),s=!1;if(void 0!==a.ln)if(a.ln===i)t=a.x+a.w,e=a.y;else{var c=this.margins||y;a.y+a.h+r+13>=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(),s=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(i,!0)),e=m().y+m().h,s&&(e=23)}if(void 0!==n[0])if(this.printingHeaderRow?this.rect(t,e,A,r,"FD"):this.rect(t,e,A,r),"right"===o){n instanceof Array||(n=[n]);for(var l=0;l=this.pageBreaks[r]){e++,0===this.lastBreak&&A++;var n=this.pageBreaks[r]-this.lastBreak;this.lastBreak=this.pageBreaks[r],A+=Math.floor(n/this.pageWrapY)}return 0===this.lastBreak&&(A+=Math.floor(t/this.pageWrapY)+1),A+e}return this.pdf.internal.getCurrentPageInfo().pageNumber},_gotoPage:function(t){},lineTo:function(t,e){t=this._wrapX(t),e=this._wrapY(e);var A=this._matrix_map_point(this.ctx._transform,[t,e]),r={type:"lt",x:t=A[0],y:e=A[1]};this.path.push(r)},bezierCurveTo:function(t,e,A,r,n,i){var o;t=this._wrapX(t),e=this._wrapY(e),A=this._wrapX(A),r=this._wrapY(r),n=this._wrapX(n),i=this._wrapY(i),n=(o=this._matrix_map_point(this.ctx._transform,[n,i]))[0],i=o[1];var a={type:"bct",x1:t=(o=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=o[1],x2:A=(o=this._matrix_map_point(this.ctx._transform,[A,r]))[0],y2:r=o[1],x:n,y:i};this.path.push(a)},quadraticCurveTo:function(t,e,A,r){var n;t=this._wrapX(t),e=this._wrapY(e),A=this._wrapX(A),r=this._wrapY(r),A=(n=this._matrix_map_point(this.ctx._transform,[A,r]))[0],r=n[1];var i={type:"qct",x1:t=(n=this._matrix_map_point(this.ctx._transform,[t,e]))[0],y1:e=n[1],x:A,y:r};this.path.push(i)},arc:function(t,e,A,r,n,i){if(t=this._wrapX(t),e=this._wrapY(e),!this._matrix_is_identity(this.ctx._transform)){var o=this._matrix_map_point(this.ctx._transform,[t,e]);t=o[0],e=o[1];var a=this._matrix_map_point(this.ctx._transform,[0,0]),s=this._matrix_map_point(this.ctx._transform,[0,A]);A=Math.sqrt(Math.pow(s[0]-a[0],2)+Math.pow(s[1]-a[1],2))}var c={type:"arc",x:t,y:e,radius:A,startAngle:r,endAngle:n,anticlockwise:i};this.path.push(c)},drawImage:function(t,e,A,r,n,i,o,a,s){void 0!==i&&(e=i,A=o,r=a,n=s),e=this._wrapX(e),A=this._wrapY(A);var c,l=this._matrix_map_rect(this.ctx._transform,{x:e,y:A,w:r,h:n}),u=(this._matrix_map_rect(this.ctx._transform,{x:i,y:o,w:a,h:s}),/data:image\/(\w+).*/i.exec(t));c=null!=u?u[1]:"png",this.pdf.addImage(t,c,l.x,l.y,l.w,l.h)},_matrix_multiply:function(t,e){var A=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=A*t[0]+r*t[2],c=n*t[0]+i*t[2],l=o*t[0]+a*t[2]+t[4];return r=A*t[1]+r*t[3],i=n*t[1]+i*t[3],a=o*t[1]+a*t[3]+t[5],[A=s,r,n=c,i,o=l,a]},_matrix_rotation:function(t){return Math.atan2(t[2],t[0])},_matrix_decompose:function(t){var e=t[0],A=t[1],r=t[2],n=t[3],i=Math.sqrt(e*e+A*A),o=(e/=i)*r+(A/=i)*n;r-=e*o,n-=A*o;var a=Math.sqrt(r*r+n*n);return o/=a,e*(n/=a)>"),s.push(">>");var c="MASK"+s.objId;this.pdf.internal.addGraphicsState(c,s.objId);var l="/"+c+" gs";r.splice(0,0,"q"),r.splice(1,0,l),r.push("Q"),window.outIntercept=a;break;default:var u="/"+this.pdf.internal.blendModeMap[this.ctx.globalCompositeOperation.toUpperCase()];u&&this.pdf.internal.out(u+" gs")}var h=this.ctx.globalAlpha;if(this.ctx._fillOpacity<1&&(h=this.ctx._fillOpacity),n){var d=this.pdf.internal.newObject2();d.push("<>"),c="GS_O_"+d.objId,this.pdf.internal.addGraphicsState(c,d.objId),this.pdf.internal.out("/"+c+" gs")}for(var f=this.path,p=0;p>"),e.push(">>");var A="MASK"+e.objId;this.pdf.internal.addGraphicsState(A,e.objId);var r="/"+A+" gs";this.pdf.internal.out(r)}else console.log("jsPDF v2 not enabled")},clip:function(){if(0r.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(i));var x=c(i),H=r.x,I=12/r.pdf.internal.scaleFactor,S=(x["margin-left"]+x["padding-left"])*I,_=(x["margin-right"]+x["padding-right"])*I,T=(x["margin-top"]+x["padding-top"])*I,N=(x["margin-bottom"]+x["padding-bottom"])*I;void 0!==x.float&&"right"===x.float?H+=r.settings.width-i.width-_:H+=S,r.pdf.addImage(F,H,r.y+T,i.width,i.height),F=void 0,"right"===x.float||"left"===x.float?(r.watchFunctions.push(function(t,e,A,n){return r.y>=e?(r.x+=t,r.settings.width+=A,!0):!!(n&&1===n.nodeType&&!v[n.nodeName]&&r.x+n.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width)&&(r.x+=t,r.y=e,r.settings.width+=A,!0)}.bind(this,"left"===x.float?-i.width-S-_:0,r.y+i.height+T+N,i.width)),r.watchFunctions.push(function(t,e,A){return!(r.y]*?>/gi,""),l="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(c=document.createElement("div")).style.cssText="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;",c.innerHTML='