@blockcerts/blockcerts-verifier 1.67.0 → 1.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-stats.html +1 -1
- package/dist/{EcdsaSd2023-pKawgefE-BjAwvHAC.js → EcdsaSd2023-Bf8oG6yE-DXSfendb.js} +6 -6
- package/dist/{EcdsaSecp256k1Signature2019-CRRIiHFR-CvD31J8J.js → EcdsaSecp256k1Signature2019-BALmC57B-DCQW1A4n.js} +1 -1
- package/dist/{Ed25519Signature2020-DjL_FhDh-CA1Qf5Gf.js → Ed25519Signature2020-B6Av-H9i-Bi3NyI0E.js} +7 -7
- package/dist/{MerkleProof2017-DUjdbiQD-cvAJLFQa.js → MerkleProof2017-Dy-NSqLc-DHQ59Wvo.js} +1 -1
- package/dist/{MerkleProof2019-FYgdlZOm-D01-ewqk.js → MerkleProof2019-0fhn8kLR-C2H_q6nV.js} +2 -2
- package/dist/{checkCredentialSchemaConformity-BAaThQfx-B48ozDA8.js → checkCredentialSchemaConformity-D70pJ-aV-ziU-1LIq.js} +1 -1
- package/dist/{controlVerificationMethod-Dup4teK9-DYo4OJRU.js → controlVerificationMethod-suRC0MnA-D4JcJT1N.js} +1 -1
- package/dist/{did-key-common.esm-DBOb9N8j-DNcrFCWj.js → did-key-common.esm-C8HA3Pjo-CSneo-V8.js} +1 -1
- package/dist/{did-key-ed25519.esm-Br9nZmXw-D_gjmUgP.js → did-key-ed25519.esm-DysNS-Zl-DSKpuDIg.js} +1 -1
- package/dist/{did-key-secp256k1.esm-777F8mD3-BaGBNoUc.js → did-key-secp256k1.esm-CLndQyAu-BYDTpSgR.js} +1 -1
- package/dist/{downloadPDF-XZlmMePj.js → downloadPDF-DzV0Jwr0.js} +3 -3
- package/dist/{elliptic-BIvJGowH-BRLTdj5Y.js → elliptic-e2d4_kYF-DQmYEk-8.js} +1 -1
- package/dist/{index-DVormXBF-B-pGO0d3.js → index-BC_5sEeg-CEsb2-mf.js} +1 -1
- package/dist/index-BEHg4rC3-AHOWkvj-.js +78 -0
- package/dist/{index-m_ndwqCF-CkZbwhan.js → index-CKc12B0M-CY2IlTam.js} +7 -7
- package/dist/{index.es-B13oYDrC.js → index.es-D_fMtNlx.js} +1 -1
- package/dist/{jsonld-GvjJx4Wj-C61cS9xX.js → jsonld-Cuz6c95c-CQeQQNYP.js} +13 -10
- package/dist/main.js +116 -116
- package/dist/{purify-hA3K4SAZ.js → purify-mEiDmpQD.js} +1 -1
- package/dist/{retrieveVerificationMethodPublicKey-CqAYJ2Jj-0nfxll3J.js → retrieveVerificationMethodPublicKey-CogYoUma-CqFMEtDL.js} +1 -1
- package/dist/verifyIssuerProfile-2DvLibZC-DDE-mATS.js +1 -0
- package/dist/{webcrypto.es-tAywRHzi-B87Lqr9a.js → webcrypto.es-CGaF2VaX-TCzLuarM.js} +1 -1
- package/package.json +2 -2
- package/dist/index-WJXe0QUW-DmXFAWKQ.js +0 -60
- /package/dist/{HashlinkVerifier-B5AIxwF--dg5WNZnc.js → HashlinkVerifier-CUj0d9D3-dg5WNZnc.js} +0 -0
- /package/dist/{checkRevocationStatusList2021-BhUc-vna-XCu3zkCJ.js → checkRevocationStatusList2021-u7qIPszJ-XCu3zkCJ.js} +0 -0
- /package/dist/{ensureNotRevoked-DtC0S-17-DvMIgM4L.js → ensureNotRevoked-D2jnsCd0-DvMIgM4L.js} +0 -0
- /package/dist/{ensureValidIssuingKey-CST0cCIj-wu9SdYxL.js → ensureValidIssuingKey-LBboe5mO-wu9SdYxL.js} +0 -0
- /package/dist/{index-D6zPgx9c-Dgus2xdV.js → index-DuuEF8T4-Dgus2xdV.js} +0 -0
- /package/dist/{index-CPeLwMJp-C0eXpZGn.js → index-qLsUsSDH-C0eXpZGn.js} +0 -0
- /package/dist/{sha256-BmHSm4R7-C1PUWFZm.js → sha256-mf0I6iCn-C1PUWFZm.js} +0 -0
- /package/dist/{tslib.es6-CNEFicEt-CmLYFWVC.js → tslib.es6--gQC4x5c-CmLYFWVC.js} +0 -0
- /package/dist/{x25519-fnqXrhwD-NSl6svWQ.js → x25519-DrRZ9GHv-NSl6svWQ.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as A,
|
|
1
|
+
import{_ as A,K as t,L as e,M as r,N as n}from"./main.js";function i(A,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in A)){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(A,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(A)}function o(A){const{offsetWidth:t,offsetHeight:e}=A;return{width:t,height:e}}function s(A){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},s(A)}var a=Uint8Array,c=Uint16Array,u=Int32Array,l=new a([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),h=new a([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),f=new a([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),B=function(A,t){for(var e=new c(31),r=0;r<31;++r)e[r]=t+=1<<A[r-1];var n=new u(e[30]);for(r=1;r<30;++r)for(var i=e[r];i<e[r+1];++i)n[i]=i-e[r]<<5|r;return{b:e,r:n}},d=B(l,2),g=d.b,p=d.r;g[28]=258,p[258]=28;for(var w=B(h,0),m=w.b,Q=w.r,C=new c(32768),v=0;v<32768;++v){var F=(43690&v)>>1|(21845&v)<<1;F=(61680&(F=(52428&F)>>2|(13107&F)<<2))>>4|(3855&F)<<4,C[v]=((65280&F)>>8|(255&F)<<8)>>1}var y=function(A,t,e){for(var r=A.length,n=0,i=new c(t);n<r;++n)A[n]&&++i[A[n]-1];var o,s=new c(t);for(n=1;n<t;++n)s[n]=s[n-1]+i[n-1]<<1;if(e){o=new c(1<<t);var a=15-t;for(n=0;n<r;++n)if(A[n])for(var u=n<<4|A[n],l=t-A[n],h=s[A[n]-1]++<<l,f=h|(1<<l)-1;h<=f;++h)o[C[h]>>a]=u}else for(o=new c(r),n=0;n<r;++n)A[n]&&(o[n]=C[s[A[n]-1]++]>>15-A[n]);return o},b=new a(288);for(v=0;v<144;++v)b[v]=8;for(v=144;v<256;++v)b[v]=9;for(v=256;v<280;++v)b[v]=7;for(v=280;v<288;++v)b[v]=8;var U=new a(32);for(v=0;v<32;++v)U[v]=5;var L=y(b,9,0),I=y(b,9,1),E=y(U,5,0),x=y(U,5,1),H=function(A){for(var t=A[0],e=1;e<A.length;++e)A[e]>t&&(t=A[e]);return t},N=function(A,t,e){var r=t/8|0;return(A[r]|A[r+1]<<8)>>(7&t)&e},S=function(A,t){var e=t/8|0;return(A[e]|A[e+1]<<8|A[e+2]<<16)>>(7&t)},P=function(A){return(A+7)/8|0},D=function(A,t,e){return(null==e||e>A.length)&&(e=A.length),new a(A.subarray(t,e))},k=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_=function(A,t,e){var r=new Error(t||k[A]);if(r.code=A,Error.captureStackTrace&&Error.captureStackTrace(r,_),!e)throw r;return r},M=function(A,t,e){e<<=7&t;var r=t/8|0;A[r]|=e,A[r+1]|=e>>8},O=function(A,t,e){e<<=7&t;var r=t/8|0;A[r]|=e,A[r+1]|=e>>8,A[r+2]|=e>>16},K=function(A,t){for(var e=[],r=0;r<A.length;++r)A[r]&&e.push({s:r,f:A[r]});var n=e.length,i=e.slice();if(!n)return{t:X,l:0};if(1==n){var o=new a(e[0].s+1);return o[e[0].s]=1,{t:o,l:1}}e.sort((function(A,t){return A.f-t.f})),e.push({s:-1,f:25001});var s=e[0],u=e[1],l=0,h=1,f=2;for(e[0]={s:-1,f:s.f+u.f,l:s,r:u};h!=n-1;)s=e[e[l].f<e[f].f?l++:f++],u=e[l!=h&&e[l].f<e[f].f?l++:f++],e[h++]={s:-1,f:s.f+u.f,l:s,r:u};var B=i[0].s;for(r=1;r<n;++r)i[r].s>B&&(B=i[r].s);var d=new c(B+1),g=T(e[h-1],d,0);if(g>t){r=0;var p=0,w=g-t,m=1<<w;for(i.sort((function(A,t){return d[t.s]-d[A.s]||A.f-t.f}));r<n;++r){var Q=i[r].s;if(!(d[Q]>t))break;p+=m-(1<<g-d[Q]),d[Q]=t}for(p>>=w;p>0;){var C=i[r].s;d[C]<t?p-=1<<t-d[C]++-1:++r}for(;r>=0&&p;--r){var v=i[r].s;d[v]==t&&(--d[v],++p)}g=t}return{t:new a(d),l:g}},T=function(A,t,e){return-1==A.s?Math.max(T(A.l,t,e+1),T(A.r,t,e+1)):t[A.s]=e},R=function(A){for(var t=A.length;t&&!A[--t];);for(var e=new c(++t),r=0,n=A[0],i=1,o=function(A){e[r++]=A},s=1;s<=t;++s)if(A[s]==n&&s!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(n),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(n);i=1,n=A[s]}return{c:e.subarray(0,r),n:t}},j=function(A,t){for(var e=0,r=0;r<t.length;++r)e+=A[r]*t[r];return e},G=function(A,t,e){var r=e.length,n=P(t+2);A[n]=255&r,A[n+1]=r>>8,A[n+2]=255^A[n],A[n+3]=255^A[n+1];for(var i=0;i<r;++i)A[n+i+4]=e[i];return 8*(n+4+r)},V=function(A,t,e,r,n,i,o,s,a,u,B){M(t,B++,e),++n[256];for(var d=K(n,15),g=d.t,p=d.l,w=K(i,15),m=w.t,Q=w.l,C=R(g),v=C.c,F=C.n,I=R(m),x=I.c,H=I.n,N=new c(19),S=0;S<v.length;++S)++N[31&v[S]];for(S=0;S<x.length;++S)++N[31&x[S]];for(var P=K(N,7),D=P.t,k=P.l,_=19;_>4&&!D[f[_-1]];--_);var T,V,q,X,J=u+5<<3,W=j(n,b)+j(i,U)+o,z=j(n,g)+j(i,m)+o+14+3*_+j(N,D)+2*N[16]+3*N[17]+7*N[18];if(a>=0&&J<=W&&J<=z)return G(t,B,A.subarray(a,a+u));if(M(t,B,1+(z<W)),B+=2,z<W){T=y(g,p,0),V=g,q=y(m,Q,0),X=m;var Y=y(D,k,0);M(t,B,F-257),M(t,B+5,H-1),M(t,B+10,_-4),B+=14;for(S=0;S<_;++S)M(t,B+3*S,D[f[S]]);B+=3*_;for(var Z=[v,x],$=0;$<2;++$){var AA=Z[$];for(S=0;S<AA.length;++S){var tA=31&AA[S];M(t,B,Y[tA]),B+=D[tA],tA>15&&(M(t,B,AA[S]>>5&127),B+=AA[S]>>12)}}}else T=L,V=b,q=E,X=U;for(S=0;S<s;++S){var eA=r[S];if(eA>255){O(t,B,T[(tA=eA>>18&31)+257]),B+=V[tA+257],tA>7&&(M(t,B,eA>>23&31),B+=l[tA]);var rA=31&eA;O(t,B,q[rA]),B+=X[rA],rA>3&&(O(t,B,eA>>5&8191),B+=h[rA])}else O(t,B,T[eA]),B+=V[eA]}return O(t,B,T[256]),B+V[256]},q=new u([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),X=new a(0),J=function(){var A=1,t=0;return{p:function(e){for(var r=A,n=t,i=0|e.length,o=0;o!=i;){for(var s=Math.min(o+2655,i);o<s;++o)n+=r+=e[o];r=(65535&r)+15*(r>>16),n=(65535&n)+15*(n>>16)}A=r,t=n},d:function(){return(255&(A%=65521))<<24|(65280&A)<<8|(255&(t%=65521))<<8|t>>8}}},W=function(A,t,e,r,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),o=new a(i.length+A.length);o.set(i),o.set(A,i.length),A=o,n.w=i.length}return function(A,t,e,r,n,i){var o=i.z||A.length,s=new a(r+o+5*(1+Math.ceil(o/7e3))+n),f=s.subarray(r,s.length-n),B=i.l,d=7&(i.r||0);if(t){d&&(f[0]=i.r>>3);for(var g=q[t-1],w=g>>13,m=8191&g,C=(1<<e)-1,v=i.p||new c(32768),F=i.h||new c(C+1),y=Math.ceil(e/3),b=2*y,U=function(t){return(A[t]^A[t+1]<<y^A[t+2]<<b)&C},L=new u(25e3),I=new c(288),E=new c(32),x=0,H=0,N=i.i||0,S=0,k=i.w||0,_=0;N+2<o;++N){var M=U(N),O=32767&N,K=F[M];if(v[O]=K,F[M]=O,k<=N){var T=o-N;if((x>7e3||S>24576)&&(T>423||!B)){d=V(A,f,0,L,I,E,H,S,_,N-_,d),S=x=H=0,_=N;for(var R=0;R<286;++R)I[R]=0;for(R=0;R<30;++R)E[R]=0}var j=2,X=0,J=m,W=O-K&32767;if(T>2&&M==U(N-W))for(var z=Math.min(w,T)-1,Y=Math.min(32767,N),Z=Math.min(258,T);W<=Y&&--J&&O!=K;){if(A[N+j]==A[N+j-W]){for(var $=0;$<Z&&A[N+$]==A[N+$-W];++$);if($>j){if(j=$,X=W,$>z)break;var AA=Math.min(W,$-2),tA=0;for(R=0;R<AA;++R){var eA=N-W+R&32767,rA=eA-v[eA]&32767;rA>tA&&(tA=rA,K=eA)}}}W+=(O=K)-(K=v[O])&32767}if(X){L[S++]=268435456|p[j]<<18|Q[X];var nA=31&p[j],iA=31&Q[X];H+=l[nA]+h[iA],++I[257+nA],++E[iA],k=N+j,++x}else L[S++]=A[N],++I[A[N]]}}for(N=Math.max(N,k);N<o;++N)L[S++]=A[N],++I[A[N]];d=V(A,f,B,L,I,E,H,S,_,N-_,d),B||(i.r=7&d|f[d/8|0]<<3,d-=7,i.h=F,i.p=v,i.i=N,i.w=k)}else{for(N=i.w||0;N<o+B;N+=65535){var oA=N+65535;oA>=o&&(f[d/8|0]=B,oA=o),d=G(f,d+1,A.subarray(N,oA))}i.i=o}return D(s,0,r+P(d)+n)}(A,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(A.length)))):20:12+t.mem,e,r,n)},z=function(A,t,e){for(;e;++t)A[t]=e,e>>>=8};function Y(A,t){t||(t={});var e=J();e.p(A);var r=W(A,t,t.dictionary?6:2,4);return function(A,t){var e=t.level,r=0==e?0:e<6?1:9==e?3:2;if(A[0]=120,A[1]=r<<6|(t.dictionary&&32),A[1]|=31-(A[0]<<8|A[1])%31,t.dictionary){var n=J();n.p(t.dictionary),z(A,2,n.d())}}(r,t),z(r,r.length-4,e.d()),r}function Z(A,t){return function(A,t,e,r){var n=A.length;if(!n||t.f&&!t.l)return e||new a(0);var i=!e,o=i||2!=t.i,s=t.i;i&&(e=new a(3*n));var c=function(A){var t=e.length;if(A>t){var r=new a(Math.max(2*t,A));r.set(e),e=r}},u=t.f||0,B=t.p||0,d=t.b||0,p=t.l,w=t.d,Q=t.m,C=t.n,v=8*n;do{if(!p){u=N(A,B,1);var F=N(A,B+1,3);if(B+=3,!F){var b=A[(G=P(B)+4)-4]|A[G-3]<<8,U=G+b;if(U>n){s&&_(0);break}o&&c(d+b),e.set(A.subarray(G,U),d),t.b=d+=b,t.p=B=8*U,t.f=u;continue}if(1==F)p=I,w=x,Q=9,C=5;else if(2==F){var L=N(A,B,31)+257,E=N(A,B+10,15)+4,k=L+N(A,B+5,31)+1;B+=14;for(var M=new a(k),O=new a(19),K=0;K<E;++K)O[f[K]]=N(A,B+3*K,7);B+=3*E;var T=H(O),R=(1<<T)-1,j=y(O,T,1);for(K=0;K<k;){var G,V=j[N(A,B,R)];if(B+=15&V,(G=V>>4)<16)M[K++]=G;else{var q=0,X=0;for(16==G?(X=3+N(A,B,3),B+=2,q=M[K-1]):17==G?(X=3+N(A,B,7),B+=3):18==G&&(X=11+N(A,B,127),B+=7);X--;)M[K++]=q}}var J=M.subarray(0,L),W=M.subarray(L);Q=H(J),C=H(W),p=y(J,Q,1),w=y(W,C,1)}else _(1);if(B>v){s&&_(0);break}}o&&c(d+131072);for(var z=(1<<Q)-1,Y=(1<<C)-1,Z=B;;Z=B){var $=(q=p[S(A,B)&z])>>4;if((B+=15&q)>v){s&&_(0);break}if(q||_(2),$<256)e[d++]=$;else{if(256==$){Z=B,p=null;break}var AA=$-254;if($>264){var tA=l[K=$-257];AA=N(A,B,(1<<tA)-1)+g[K],B+=tA}var eA=w[S(A,B)&Y],rA=eA>>4;if(eA||_(3),B+=15&eA,W=m[rA],rA>3&&(tA=h[rA],W+=S(A,B)&(1<<tA)-1,B+=tA),B>v){s&&_(0);break}o&&c(d+131072);var nA=d+AA;if(d<W){var iA=0-W,oA=Math.min(W,nA);for(iA+d<0&&_(3);d<oA;++d)e[d]=r[iA+d]}for(;d<nA;++d)e[d]=e[d-W]}}t.l=p,t.p=Z,t.b=d,t.f=u,p&&(u=1,t.m=Q,t.d=w,t.n=C)}while(!u);return d!=e.length&&i?D(e,0,d):e.subarray(0,d)}(A.subarray(function(A,t){return(8!=(15&A[0])||A[0]>>4>7||(A[0]<<8|A[1])%31)&&_(6,"invalid zlib data"),(A[1]>>5&1)==+!t&&_(6,"invalid zlib data: "+(32&A[1]?"need":"unexpected")+" dictionary"),2+(A[1]>>3&4)}(A,t),-4),{i:2},t,t)}var $="undefined"!=typeof TextDecoder&&new TextDecoder;try{$.decode(X,{stream:!0})}catch(Ct){}
|
|
2
2
|
/** @license
|
|
3
3
|
*
|
|
4
4
|
* jsPDF - PDF Document creation from JavaScript
|
|
@@ -123,7 +123,7 @@ function(A){var t=function(A){var t,e,r,n,i,o,s,a,c,u;for(e=[],r=0,n=(A+=t="\0\0
|
|
|
123
123
|
* Licensed under the MIT License.
|
|
124
124
|
* http://opensource.org/licenses/mit-license
|
|
125
125
|
*/
|
|
126
|
-
function(A){A.loadFile=function(A,t,e){return function(A,t,e){t=!1!==t,e="function"==typeof e?e:function(){};var r=void 0;try{r=function(A,t,e){var r=new XMLHttpRequest,n=0,i=function(A){var t=A.length,e=[],r=String.fromCharCode;for(n=0;n<t;n+=1)e.push(r(255&A.charCodeAt(n)));return e.join("")};if(r.open("GET",A,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?e(i(this.responseText)):e(void 0)}),r.send(null),t&&200===r.status)return i(r.responseText)}(A,t,e)}catch(A){}return r}(A,t,e)},A.loadImageFile=A.loadFile}(SA.API),function(A){function t(){return(AA.html2canvas?Promise.resolve(AA.html2canvas):Promise.resolve().then((function(){return ye}))).catch((function(A){return Promise.reject(new Error("Could not load html2canvas: "+A))})).then((function(A){return A.default?A.default:A}))}function e(){return(AA.DOMPurify?Promise.resolve(AA.DOMPurify):import("./purify-hA3K4SAZ.js").then((function(A){return A.p}))).catch((function(A){return Promise.reject(new Error("Could not load dompurify: "+A))})).then((function(A){return A.default?A.default:A}))}var r=function(A){var t=s(A);return"undefined"===t?"undefined":"string"===t||A instanceof String?"string":"number"===t||A instanceof Number?"number":"function"===t||A instanceof Function?"function":A&&A.constructor===Array?"array":A&&1===A.nodeType?"element":"object"===t?"object":"unknown"},n=function(A,t){var e=document.createElement(A);for(var r in t.className&&(e.className=t.className),t.innerHTML&&t.dompurify&&(e.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)e.style[r]=t.style[r];return e},i=function A(t){var e=Object.assign(A.convert(Promise.resolve()),JSON.parse(JSON.stringify(A.template))),r=A.convert(Promise.resolve(),e);return(r=r.setProgress(1,A,1,[A])).set(t)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(A,t){return A.__proto__=t||i.prototype,A},i.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},i.prototype.from=function(A,t){return this.then((function(){switch(t=t||function(A){switch(r(A)){case"string":return"string";case"element":return"canvas"===A.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(A)){case"string":return this.then(e).then((function(t){return this.set({src:n("div",{innerHTML:A,dompurify:t})})}));case"element":return this.set({src:A});case"canvas":return this.set({canvas:A});case"img":return this.set({img:A});default:return this.error("Unknown source type.")}}))},i.prototype.to=function(A){switch(A){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},i.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var A={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=function A(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;n=n.nextSibling)!0!==e&&1===n.nodeType&&"SCRIPT"===n.nodeName||r.appendChild(A(n,e));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",(function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft}),!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(A.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:A}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},i.prototype.toCanvas=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then((function(A){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,A(this.prop.container,t)})).then((function(A){(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)}))},i.prototype.toContext2d=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then((function(A){var t=this.opt.jsPDF,e=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,n=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete n.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=e,e)for(var i=0;i<e.length;++i){var o=e[i],s=o.src.find((function(A){return"truetype"===A.format}));s&&t.addFont(s.url,o.ref.name,o.ref.style)}return n.windowHeight=n.windowHeight||0,n.windowHeight=0==n.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):n.windowHeight,t.context2d.save(!0),A(this.prop.container,n)})).then((function(A){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)}))},i.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var A=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=A}))},i.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},i.prototype.output=function(A,t,e){return"img"===(e=e||"pdf").toLowerCase()||"image"===e.toLowerCase()?this.outputImg(A,t):this.outputPdf(A,t)},i.prototype.outputPdf=function(A,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(A,t)}))},i.prototype.outputImg=function(A){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(A){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+A+'" is not supported.'}}))},i.prototype.save=function(A){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(A?{filename:A}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},i.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},i.prototype.set=function(A){if("object"!==r(A))return this;var t=Object.keys(A||{}).map((function(t){if(t in i.template.prop)return function(){this.prop[t]=A[t]};switch(t){case"margin":return this.setMargin.bind(this,A.margin);case"jsPDF":return function(){return this.opt.jsPDF=A.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,A.pageSize);default:return function(){this.opt[t]=A[t]}}}),this);return this.then((function(){return this.thenList(t)}))},i.prototype.get=function(A,t){return this.then((function(){var e=A in i.template.prop?this.prop[A]:this.opt[A];return t?t(e):e}))},i.prototype.setMargin=function(A){return this.then((function(){switch(r(A)){case"number":A=[A,A,A,A];case"array":if(2===A.length&&(A=[A[0],A[1],A[0],A[1]]),4===A.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=A})).then(this.setPageSize)},i.prototype.setPageSize=function(A){function t(A,t){return Math.floor(A*t/72*96)}return this.then((function(){(A=A||SA.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(A.inner={width:A.width-this.opt.margin[1]-this.opt.margin[3],height:A.height-this.opt.margin[0]-this.opt.margin[2]},A.inner.px={width:t(A.inner.width,A.k),height:t(A.inner.height,A.k)},A.inner.ratio=A.inner.height/A.inner.width),this.prop.pageSize=A}))},i.prototype.setProgress=function(A,t,e,r){return null!=A&&(this.progress.val=A),null!=t&&(this.progress.state=t),null!=e&&(this.progress.n=e),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},i.prototype.updateProgress=function(A,t,e,r){return this.setProgress(A?this.progress.val+A:null,t||null,e?this.progress.n+e:null,r?this.progress.stack.concat(r):null)},i.prototype.then=function(A,t){var e=this;return this.thenCore(A,t,(function(A,t){return e.updateProgress(null,null,1,[A]),Promise.prototype.then.call(this,(function(t){return e.updateProgress(null,A),t})).then(A,t).then((function(A){return e.updateProgress(1),A}))}))},i.prototype.thenCore=function(A,t,e){e=e||Promise.prototype.then,A&&(A=A.bind(this)),t&&(t=t.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:i.convert(Object.assign({},this),Promise.prototype),n=e.call(r,A,t);return i.convert(n,this.__proto__)},i.prototype.thenExternal=function(A,t){return Promise.prototype.then.call(this,A,t)},i.prototype.thenList=function(A){var t=this;return A.forEach((function(A){t=t.thenCore(A)})),t},i.prototype.catch=function(A){A&&(A=A.bind(this));var t=Promise.prototype.catch.call(this,A);return i.convert(t,this)},i.prototype.catchExternal=function(A){return Promise.prototype.catch.call(this,A)},i.prototype.error=function(A){return this.then((function(){throw new Error(A)}))},i.prototype.using=i.prototype.set,i.prototype.saveAs=i.prototype.save,i.prototype.export=i.prototype.output,i.prototype.run=i.prototype.then,SA.getPageSize=function(A,t,e){if("object"===s(A)){var r=A;A=r.orientation,t=r.unit||t,e=r.format||e}t=t||"mm",e=e||"a4",A=(""+(A||"P")).toLowerCase();var n,i=(""+e).toLowerCase(),o={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]};switch(t){case"pt":n=1;break;case"mm":n=72/25.4;break;case"cm":n=72/2.54;break;case"in":n=72;break;case"px":n=.75;break;case"pc":case"em":n=12;break;case"ex":n=6;break;default:throw"Invalid unit: "+t}var a,c=0,u=0;if(o.hasOwnProperty(i))c=o[i][1]/n,u=o[i][0]/n;else try{c=e[1],u=e[0]}catch(A){throw new Error("Invalid format: "+e)}if("p"===A||"portrait"===A)A="p",u>c&&(a=u,u=c,c=a);else{if("l"!==A&&"landscape"!==A)throw"Invalid orientation: "+A;A="l",c>u&&(a=u,u=c,c=a)}return{width:u,height:c,unit:t,k:n,orientation:A}},A.html=function(A,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(Et):null;var e=new i(t);return t.worker?e:e.from(A).doCallback()}}(SA.API),SA.API.addJS=function(A){return Ot=A,this.internal.events.subscribe("postPutResources",(function(){_t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(_t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Mt=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Ot+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==_t&&void 0!==Mt&&this.internal.out("/Names <</JavaScript "+_t+" 0 R>>")})),this
|
|
126
|
+
function(A){A.loadFile=function(A,t,e){return function(A,t,e){t=!1!==t,e="function"==typeof e?e:function(){};var r=void 0;try{r=function(A,t,e){var r=new XMLHttpRequest,n=0,i=function(A){var t=A.length,e=[],r=String.fromCharCode;for(n=0;n<t;n+=1)e.push(r(255&A.charCodeAt(n)));return e.join("")};if(r.open("GET",A,!t),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(r.onload=function(){200===r.status?e(i(this.responseText)):e(void 0)}),r.send(null),t&&200===r.status)return i(r.responseText)}(A,t,e)}catch(A){}return r}(A,t,e)},A.loadImageFile=A.loadFile}(SA.API),function(A){function t(){return(AA.html2canvas?Promise.resolve(AA.html2canvas):Promise.resolve().then((function(){return ye}))).catch((function(A){return Promise.reject(new Error("Could not load html2canvas: "+A))})).then((function(A){return A.default?A.default:A}))}function e(){return(AA.DOMPurify?Promise.resolve(AA.DOMPurify):import("./purify-mEiDmpQD.js").then((function(A){return A.p}))).catch((function(A){return Promise.reject(new Error("Could not load dompurify: "+A))})).then((function(A){return A.default?A.default:A}))}var r=function(A){var t=s(A);return"undefined"===t?"undefined":"string"===t||A instanceof String?"string":"number"===t||A instanceof Number?"number":"function"===t||A instanceof Function?"function":A&&A.constructor===Array?"array":A&&1===A.nodeType?"element":"object"===t?"object":"unknown"},n=function(A,t){var e=document.createElement(A);for(var r in t.className&&(e.className=t.className),t.innerHTML&&t.dompurify&&(e.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)e.style[r]=t.style[r];return e},i=function A(t){var e=Object.assign(A.convert(Promise.resolve()),JSON.parse(JSON.stringify(A.template))),r=A.convert(Promise.resolve(),e);return(r=r.setProgress(1,A,1,[A])).set(t)};(i.prototype=Object.create(Promise.prototype)).constructor=i,i.convert=function(A,t){return A.__proto__=t||i.prototype,A},i.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},i.prototype.from=function(A,t){return this.then((function(){switch(t=t||function(A){switch(r(A)){case"string":return"string";case"element":return"canvas"===A.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(A)){case"string":return this.then(e).then((function(t){return this.set({src:n("div",{innerHTML:A,dompurify:t})})}));case"element":return this.set({src:A});case"canvas":return this.set({canvas:A});case"img":return this.set({img:A});default:return this.error("Unknown source type.")}}))},i.prototype.to=function(A){switch(A){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},i.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var A={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=function A(t,e){for(var r=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;n=n.nextSibling)!0!==e&&1===n.nodeType&&"SCRIPT"===n.nodeName||r.appendChild(A(n,e));return 1===t.nodeType&&("CANVAS"===t.nodeName?(r.width=t.width,r.height=t.height,r.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(r.value=t.value),r.addEventListener("load",(function(){r.scrollTop=t.scrollTop,r.scrollLeft=t.scrollLeft}),!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(A.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:A}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},i.prototype.toCanvas=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then((function(A){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,A(this.prop.container,t)})).then((function(A){(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)}))},i.prototype.toContext2d=function(){var A=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(A).then(t).then((function(A){var t=this.opt.jsPDF,e=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,n=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete n.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=e,e)for(var i=0;i<e.length;++i){var o=e[i],s=o.src.find((function(A){return"truetype"===A.format}));s&&t.addFont(s.url,o.ref.name,o.ref.style)}return n.windowHeight=n.windowHeight||0,n.windowHeight=0==n.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):n.windowHeight,t.context2d.save(!0),A(this.prop.container,n)})).then((function(A){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(A),this.prop.canvas=A,document.body.removeChild(this.prop.overlay)}))},i.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var A=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=A}))},i.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},i.prototype.output=function(A,t,e){return"img"===(e=e||"pdf").toLowerCase()||"image"===e.toLowerCase()?this.outputImg(A,t):this.outputPdf(A,t)},i.prototype.outputPdf=function(A,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(A,t)}))},i.prototype.outputImg=function(A){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(A){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+A+'" is not supported.'}}))},i.prototype.save=function(A){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(A?{filename:A}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},i.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},i.prototype.set=function(A){if("object"!==r(A))return this;var t=Object.keys(A||{}).map((function(t){if(t in i.template.prop)return function(){this.prop[t]=A[t]};switch(t){case"margin":return this.setMargin.bind(this,A.margin);case"jsPDF":return function(){return this.opt.jsPDF=A.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,A.pageSize);default:return function(){this.opt[t]=A[t]}}}),this);return this.then((function(){return this.thenList(t)}))},i.prototype.get=function(A,t){return this.then((function(){var e=A in i.template.prop?this.prop[A]:this.opt[A];return t?t(e):e}))},i.prototype.setMargin=function(A){return this.then((function(){switch(r(A)){case"number":A=[A,A,A,A];case"array":if(2===A.length&&(A=[A[0],A[1],A[0],A[1]]),4===A.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=A})).then(this.setPageSize)},i.prototype.setPageSize=function(A){function t(A,t){return Math.floor(A*t/72*96)}return this.then((function(){(A=A||SA.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(A.inner={width:A.width-this.opt.margin[1]-this.opt.margin[3],height:A.height-this.opt.margin[0]-this.opt.margin[2]},A.inner.px={width:t(A.inner.width,A.k),height:t(A.inner.height,A.k)},A.inner.ratio=A.inner.height/A.inner.width),this.prop.pageSize=A}))},i.prototype.setProgress=function(A,t,e,r){return null!=A&&(this.progress.val=A),null!=t&&(this.progress.state=t),null!=e&&(this.progress.n=e),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},i.prototype.updateProgress=function(A,t,e,r){return this.setProgress(A?this.progress.val+A:null,t||null,e?this.progress.n+e:null,r?this.progress.stack.concat(r):null)},i.prototype.then=function(A,t){var e=this;return this.thenCore(A,t,(function(A,t){return e.updateProgress(null,null,1,[A]),Promise.prototype.then.call(this,(function(t){return e.updateProgress(null,A),t})).then(A,t).then((function(A){return e.updateProgress(1),A}))}))},i.prototype.thenCore=function(A,t,e){e=e||Promise.prototype.then,A&&(A=A.bind(this)),t&&(t=t.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:i.convert(Object.assign({},this),Promise.prototype),n=e.call(r,A,t);return i.convert(n,this.__proto__)},i.prototype.thenExternal=function(A,t){return Promise.prototype.then.call(this,A,t)},i.prototype.thenList=function(A){var t=this;return A.forEach((function(A){t=t.thenCore(A)})),t},i.prototype.catch=function(A){A&&(A=A.bind(this));var t=Promise.prototype.catch.call(this,A);return i.convert(t,this)},i.prototype.catchExternal=function(A){return Promise.prototype.catch.call(this,A)},i.prototype.error=function(A){return this.then((function(){throw new Error(A)}))},i.prototype.using=i.prototype.set,i.prototype.saveAs=i.prototype.save,i.prototype.export=i.prototype.output,i.prototype.run=i.prototype.then,SA.getPageSize=function(A,t,e){if("object"===s(A)){var r=A;A=r.orientation,t=r.unit||t,e=r.format||e}t=t||"mm",e=e||"a4",A=(""+(A||"P")).toLowerCase();var n,i=(""+e).toLowerCase(),o={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]};switch(t){case"pt":n=1;break;case"mm":n=72/25.4;break;case"cm":n=72/2.54;break;case"in":n=72;break;case"px":n=.75;break;case"pc":case"em":n=12;break;case"ex":n=6;break;default:throw"Invalid unit: "+t}var a,c=0,u=0;if(o.hasOwnProperty(i))c=o[i][1]/n,u=o[i][0]/n;else try{c=e[1],u=e[0]}catch(A){throw new Error("Invalid format: "+e)}if("p"===A||"portrait"===A)A="p",u>c&&(a=u,u=c,c=a);else{if("l"!==A&&"landscape"!==A)throw"Invalid orientation: "+A;A="l",c>u&&(a=u,u=c,c=a)}return{width:u,height:c,unit:t,k:n,orientation:A}},A.html=function(A,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(Et):null;var e=new i(t);return t.worker?e:e.from(A).doCallback()}}(SA.API),SA.API.addJS=function(A){return Ot=A,this.internal.events.subscribe("postPutResources",(function(){_t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(_t+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Mt=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Ot+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==_t&&void 0!==Mt&&this.internal.out("/Names <</JavaScript "+_t+" 0 R>>")})),this
|
|
127
127
|
/**
|
|
128
128
|
* @license
|
|
129
129
|
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
|
|
@@ -284,7 +284,7 @@ function(A){var t=function(A){for(var t=A.length,e=new Uint8Array(t),r=0;r<t;r++
|
|
|
284
284
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
285
285
|
* ====================================================================
|
|
286
286
|
*/
|
|
287
|
-
function(){function A(){return(AA.canvg?Promise.resolve(AA.canvg):import("./index.es-
|
|
287
|
+
function(){function A(){return(AA.canvg?Promise.resolve(AA.canvg):import("./index.es-D_fMtNlx.js")).catch((function(A){return Promise.reject(new Error("Could not load canvg: "+A))})).then((function(A){return A.default?A.default:A}))}SA.API.addSvgAsImage=function(t,e,r,n,i,o,s,a){if(isNaN(e)||isNaN(r))throw eA.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(i))throw eA.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=n,c.height=i;var u=c.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,c.width,c.height);var l={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return A().then((function(A){return A.fromString(u,t,l)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(A){return A.render(l)})).then((function(){h.addImage(c.toDataURL("image/jpeg",1),e,r,n,i,s,a)}))}}(),SA.API.putTotalPages=function(A){var t,e=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(A,"g"),e=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(A,this.internal.getFont()),"g"),e=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var n=0;n<this.internal.pages[r].length;n++)this.internal.pages[r][n]=this.internal.pages[r][n].replace(t,e);return this},SA.API.viewerPreferences=function(A,t){var e;A=A||{},t=t||!1;var r,n,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),c=[],u=0,l=0,h=0;function f(A,t){var e,r=!1;for(e=0;e<A.length;e+=1)A[e]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),e=this.internal.viewerpreferences.configuration,"reset"===A||!0===t){var B=a.length;for(h=0;h<B;h+=1)e[a[h]].value=e[a[h]].defaultValue,e[a[h]].explicitSet=!1}if("object"===s(A))for(n in A)if(i=A[n],f(a,n)&&void 0!==i){if("boolean"===e[n].type&&"boolean"==typeof i)e[n].value=i;else if("name"===e[n].type&&f(e[n].valueSet,i))e[n].value=i;else if("integer"===e[n].type&&Number.isInteger(i))e[n].value=i;else if("array"===e[n].type){for(u=0;u<i.length;u+=1)if(r=!0,1===i[u].length&&"number"==typeof i[u][0])c.push(String(i[u]-1));else if(i[u].length>1){for(l=0;l<i[u].length;l+=1)"number"!=typeof i[u][l]&&(r=!1);!0===r&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}e[n].value="["+c.join(" ")+"]"}else e[n].value=e[n].defaultValue;e[n].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var A,t=[];for(A in e)!0===e[A].explicitSet&&("name"===e[A].type?t.push("/"+A+" /"+e[A].value):t.push("/"+A+" "+e[A].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=e,this
|
|
288
288
|
/** ====================================================================
|
|
289
289
|
* @license
|
|
290
290
|
* jsPDF XMP metadata plugin
|