Generic build of PDF.js library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6 lines
165 KiB

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsDistBuildPdf=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=13)}([function(t,e,n){"use strict";(function(t){function r(t){it=t}function i(){return it}function a(t){it>=et.infos&&console.log("Info: "+t)}function s(t){it>=et.warnings&&console.log("Warning: "+t)}function o(t){console.log("Deprecated API usage: "+t)}function c(t){throw it>=et.errors&&(console.log("Error: "+t),console.log(l())),new Error(t)}function l(){try{throw new Error}catch(t){return t.stack?t.stack.split("\n").slice(2).join("\n"):""}}function u(t,e){t||c(e)}function h(t,e){try{var n=new URL(t);if(!n.origin||"null"===n.origin)return!1}catch(t){return!1}var r=new URL(e,n);return n.origin===r.origin}function d(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function f(t,e){if(!t)return null;try{var n=e?new URL(t,e):new URL(t);if(d(n))return n}catch(t){}return null}function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}function g(t){var e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}}function m(t){return"string"!=typeof t?(s("The argument for removeNullCharacters must be a string."),t):t.replace(gt,"")}function v(t){u(null!==t&&"object"===(void 0===t?"undefined":X(t))&&void 0!==t.length,"Invalid argument for bytesToString");var e=t.length;if(e<8192)return String.fromCharCode.apply(null,t);for(var n=[],r=0;r<e;r+=8192){var i=Math.min(r+8192,e),a=t.subarray(r,i);n.push(String.fromCharCode.apply(null,a))}return n.join("")}function A(t){u("string"==typeof t,"Invalid argument for stringToBytes");for(var e=t.length,n=new Uint8Array(e),r=0;r<e;++r)n[r]=255&t.charCodeAt(r);return n}function b(t){return void 0!==t.length?t.length:(u(void 0!==t.byteLength),t.byteLength)}function y(t){if(1===t.length&&t[0]instanceof Uint8Array)return t[0];var e,n,r,i=0,a=t.length;for(e=0;e<a;e++)n=t[e],r=b(n),i+=r;var s=0,o=new Uint8Array(i);for(e=0;e<a;e++)n=t[e],n instanceof Uint8Array||(n="string"==typeof n?A(n):new Uint8Array(n)),r=n.byteLength,o.set(n,s),s+=r;return o}function S(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function x(t){for(var e=1,n=0;t>e;)e<<=1,n++;return n}function w(t,e){return t[e]<<24>>24}function T(t,e){return t[e]<<8|t[e+1]}function _(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function k(){var t=new Uint8Array(4);return t[0]=1,1===new Uint32Array(t.buffer,0,1)[0]}function C(){try{return new Function(""),!0}catch(t){return!1}}function P(t){var e,n=t.length,r=[];if("þ"===t[0]&&"ÿ"===t[1])for(e=2;e<n;e+=2)r.push(String.fromCharCode(t.charCodeAt(e)<<8|t.charCodeAt(e+1)));else for(e=0;e<n;++e){var i=bt[t.charCodeAt(e)];r.push(i?String.fromCharCode(i):t.charAt(e))}return r.join("")}function E(t){return decodeURIComponent(escape(t))}function L(t){return unescape(encodeURIComponent(t))}function R(t){for(var e in t)return!1;return!0}function O(t){return"boolean"==typeof t}function I(t){return"number"==typeof t&&(0|t)===t}function D(t){return"number"==typeof t}function F(t){return"string"==typeof t}function M(t){return t instanceof Array}function N(t){return"object"===(void 0===t?"undefined":X(t))&&null!==t&&void 0!==t.byteLength}function j(t){return 32===t||9===t||13===t||10===t}function U(){return"undefined"==typeof __pdfjsdev_webpack__&&("object"===("undefined"==typeof proce
;return i.CustomStyle.setProp("transformOrigin",this.container,-(a+s)+"px -"+n.style.top),this.container.style.left=a+s+"px",this.container.appendChild(r.render()),this.container}}),t}(),g=function(){function t(t){this.container=t.container,this.trigger=t.trigger,this.color=t.color,this.title=t.title,this.contents=t.contents,this.hideWrapper=t.hideWrapper||!1,this.pinned=!1}return t.prototype={render:function(){var t=document.createElement("div");t.className="popupWrapper",this.hideElement=this.hideWrapper?t:this.container,this.hideElement.setAttribute("hidden",!0);var e=document.createElement("div");e.className="popup";var n=this.color;if(n){var r=.7*(255-n[0])+n[0],i=.7*(255-n[1])+n[1],s=.7*(255-n[2])+n[2];e.style.backgroundColor=a.Util.makeCssRgb(0|r,0|i,0|s)}var o=this._formatContents(this.contents),c=document.createElement("h1");return c.textContent=this.title,this.trigger.addEventListener("click",this._toggle.bind(this)),this.trigger.addEventListener("mouseover",this._show.bind(this,!1)),this.trigger.addEventListener("mouseout",this._hide.bind(this,!1)),e.addEventListener("click",this._hide.bind(this,!0)),e.appendChild(c),e.appendChild(o),t.appendChild(e),t},_formatContents:function(t){for(var e=document.createElement("p"),n=t.split(/(?:\r\n?|\n)/),r=0,i=n.length;r<i;++r){var a=n[r];e.appendChild(document.createTextNode(a)),r<i-1&&e.appendChild(document.createElement("br"))}return e},_toggle:function(){this.pinned?this._hide(!0):this._show(!0)},_show:function(t){t&&(this.pinned=!0),this.hideElement.hasAttribute("hidden")&&(this.hideElement.removeAttribute("hidden"),this.container.style.zIndex+=1)},_hide:function(t){t&&(this.pinned=!1),this.hideElement.hasAttribute("hidden")||this.pinned||(this.hideElement.setAttribute("hidden",!0),this.container.style.zIndex-=1)}},t}(),m=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);s.call(this,t,e,!0)}var e="http://www.w3.org/2000/svg";return a.Util.inherit(t,s,{render:function(){this.container.className="lineAnnotation";var t=this.data,n=t.rect[2]-t.rect[0],r=t.rect[3]-t.rect[1],i=document.createElementNS(e,"svg:svg");i.setAttributeNS(null,"version","1.1"),i.setAttributeNS(null,"width",n+"px"),i.setAttributeNS(null,"height",r+"px"),i.setAttributeNS(null,"preserveAspectRatio","none"),i.setAttributeNS(null,"viewBox","0 0 "+n+" "+r);var a=document.createElementNS(e,"svg:line");return a.setAttributeNS(null,"x1",t.rect[2]-t.lineCoordinates[0]),a.setAttributeNS(null,"y1",t.rect[3]-t.lineCoordinates[1]),a.setAttributeNS(null,"x2",t.rect[2]-t.lineCoordinates[2]),a.setAttributeNS(null,"y2",t.rect[3]-t.lineCoordinates[3]),a.setAttributeNS(null,"stroke-width",t.borderStyle.width),a.setAttributeNS(null,"stroke","transparent"),i.appendChild(a),this.container.append(i),this._createPopup(this.container,a,this.data),this.container}}),t}(),v=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);s.call(this,t,e,!0)}return a.Util.inherit(t,s,{render:function(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}),t}(),A=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);s.call(this,t,e,!0)}return a.Util.inherit(t,s,{render:function(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}),t}(),b=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);s.call(this,t,e,!0)}return a.Util.inherit(t,s,{render:function(){return this.container.className="squigglyAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}),t}(),y=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);s.call(this,t,e,!0)}return a.Util.inherit(t,s,{render:function(){return this.container.className="strikeoutAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}),t}(),S=function(){function t(t){s.call(this,t,!0);var e=this.data.file
u.getDefaultSetting)("pdfjsNext")?this.callback(new u.RenderingCancelledException("Rendering cancelled, page "+this.pageNumber,"canvas")):this.callback("cancelled")},operatorListChanged:function(){if(!this.graphicsReady)return void(this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound));this.stepper&&this.stepper.updateOperatorList(this.operatorList),this.running||this._continue()},_continue:function(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())},_scheduleNext:function(){this.useRequestAnimationFrame&&"undefined"!=typeof window?window.requestAnimationFrame(this._nextBound):Promise.resolve(void 0).then(this._nextBound)},_next:function(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),this.callback())))}},t}(),I=function(){var t=[];return{listen:function(e){(0,l.deprecated)("Global UnsupportedManager.listen is used: use PDFDocumentLoadingTask.onUnsupportedFeature instead"),t.push(e)},notify:function(e){for(var n=0,r=t.length;n<r;n++)t[n](e)}}}();e.version=S="1.8.398",e.build=x="96377832",e.getDocument=i,e.LoopbackPort=C,e.PDFDataRangeTransport=T,e.PDFWorker=P,e.PDFDocumentProxy=_,e.PDFPageProxy=k,e._UnsupportedManager=I,e.version=S,e.build=x},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVGGraphics=void 0;var r=n(0),i=function(){throw new Error("Not implemented: SVGGraphics")},a={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},s=function(){function t(t,e,n){for(var r=-1,i=e;i<n;i++){var a=255&(r^t[i]);r=r>>>8^o[a]}return-1^r}function e(e,n,r,i){var a=i,s=n.length;r[a]=s>>24&255,r[a+1]=s>>16&255,r[a+2]=s>>8&255,r[a+3]=255&s,a+=4,r[a]=255&e.charCodeAt(0),r[a+1]=255&e.charCodeAt(1),r[a+2]=255&e.charCodeAt(2),r[a+3]=255&e.charCodeAt(3),a+=4,r.set(n,a),a+=n.length;var o=t(r,i+4,a);r[a]=o>>24&255,r[a+1]=o>>16&255,r[a+2]=o>>8&255,r[a+3]=255&o}function n(t,e,n){for(var r=1,i=0,a=e;a<n;++a)r=(r+(255&t[a]))%65521,i=(i+r)%65521;return i<<16|r}function i(t,i,o){var c,l,u,h=t.width,d=t.height,f=t.data;switch(i){case r.ImageKind.GRAYSCALE_1BPP:l=0,c=1,u=h+7>>3;break;case r.ImageKind.RGB_24BPP:l=2,c=8,u=3*h;break;case r.ImageKind.RGBA_32BPP:l=6,c=8,u=4*h;break;default:throw new Error("invalid format")}var p,g,m=new Uint8Array((1+u)*d),v=0,A=0;for(p=0;p<d;++p)m[v++]=0,m.set(f.subarray(A,A+u),v),A+=u,v+=u;if(i===r.ImageKind.GRAYSCALE_1BPP)for(v=0,p=0;p<d;p++)for(v++,g=0;g<u;g++)m[v++]^=255;var b=new Uint8Array([h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,c,l,0,0,0]),y=m.length,S=Math.ceil(y/65535),x=new Uint8Array(2+y+5*S+4),w=0;x[w++]=120,x[w++]=156;for(var T=0;y>65535;)x[w++]=0,x[w++]=255,x[w++]=255,x[w++]=0,x[w++]=0,x.set(m.subarray(T,T+65535),w),w+=65535,T+=65535,y-=65535;x[w++]=1,x[w++]=255&y,x[w++]=y>>8&255,x[w++]=255&~y,x[w++]=(65535&~y)>>8&255,x.set(m.subarray(T),w),w+=m.length-T;var _=n(m,0,m.length);x[w++]=_>>24&255,x[w++]=_>>16&255,x[w++]=_>>8&255,x[w++]=255&_;var k=a.length+3*s+b.length+x.length,C=new Uint8Array(k),P=0;return C.set(a,P),P+=a.length,e("IHDR",b,C,P),P+=s+b.length,e("IDATA",x,C,P),P+=s+x.length,e("IEND",new Uint8Array(0),C,P),(0,r.createObjectURL)(C,"image/png",o)}for(var a=new Uint8Array([137,80,78,71,13,10,26,10]),s=12,o=new Int32Array(256),c=0;c<256;c++){for(var l=c,u=0;u<8;u++)l=1&l?3988292384^l>>1&2147483647:l>>1&2147483647;o[c]=l}return function(t,e){return i(t,void 0===t.kind?r.ImageKind.GRAYSCALE_1BPP:t.kind,e)}}(),o=function(){function t(){this.fontSizeScale=1,this.fontWeight=a.fontWeight,this.fontSize=0,this.textMatrix=r.IDENTITY_MATRIX,this.fontMatrix=r.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRise=0,this.fillColor=a.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lin
l.colorLocation=r.getAttribLocation(c,"a_color"),y=l}function h(t,e,n,r,i){y||u();var a=y,s=a.canvas,o=a.gl;s.width=t,s.height=e,o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.uniform2f(a.resolutionLocation,t,e);var c,l,h,d=0;for(c=0,l=r.length;c<l;c++)switch(r[c].type){case"lattice":h=r[c].coords.length/r[c].verticesPerRow|0,d+=(h-1)*(r[c].verticesPerRow-1)*6;break;case"triangles":d+=r[c].coords.length}var f=new Float32Array(2*d),p=new Uint8Array(3*d),g=i.coords,m=i.colors,v=0,A=0;for(c=0,l=r.length;c<l;c++){var b=r[c],S=b.coords,x=b.colors;switch(b.type){case"lattice":var w=b.verticesPerRow;h=S.length/w|0;for(var T=1;T<h;T++)for(var _=T*w+1,k=1;k<w;k++,_++)f[v]=g[S[_-w-1]],f[v+1]=g[S[_-w-1]+1],f[v+2]=g[S[_-w]],f[v+3]=g[S[_-w]+1],f[v+4]=g[S[_-1]],f[v+5]=g[S[_-1]+1],p[A]=m[x[_-w-1]],p[A+1]=m[x[_-w-1]+1],p[A+2]=m[x[_-w-1]+2],p[A+3]=m[x[_-w]],p[A+4]=m[x[_-w]+1],p[A+5]=m[x[_-w]+2],p[A+6]=m[x[_-1]],p[A+7]=m[x[_-1]+1],p[A+8]=m[x[_-1]+2],f[v+6]=f[v+2],f[v+7]=f[v+3],f[v+8]=f[v+4],f[v+9]=f[v+5],f[v+10]=g[S[_]],f[v+11]=g[S[_]+1],p[A+9]=p[A+3],p[A+10]=p[A+4],p[A+11]=p[A+5],p[A+12]=p[A+6],p[A+13]=p[A+7],p[A+14]=p[A+8],p[A+15]=m[x[_]],p[A+16]=m[x[_]+1],p[A+17]=m[x[_]+2],v+=12,A+=18;break;case"triangles":for(var C=0,P=S.length;C<P;C++)f[v]=g[S[C]],f[v+1]=g[S[C]+1],p[A]=m[x[C]],p[A+1]=m[x[C]+1],p[A+2]=m[x[C]+2],v+=2,A+=3}}n?o.clearColor(n[0]/255,n[1]/255,n[2]/255,1):o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT);var E=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,E),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(a.positionLocation),o.vertexAttribPointer(a.positionLocation,2,o.FLOAT,!1,0,0);var L=o.createBuffer();return o.bindBuffer(o.ARRAY_BUFFER,L),o.bufferData(o.ARRAY_BUFFER,p,o.STATIC_DRAW),o.enableVertexAttribArray(a.colorLocation),o.vertexAttribPointer(a.colorLocation,3,o.UNSIGNED_BYTE,!1,0,0),o.uniform2f(a.scaleLocation,i.scaleX,i.scaleY),o.uniform2f(a.offsetLocation,i.offsetX,i.offsetY),o.drawArrays(o.TRIANGLES,0,d),o.flush(),o.deleteBuffer(E),o.deleteBuffer(L),s}function d(){v&&v.canvas&&(v.canvas.width=0,v.canvas.height=0),y&&y.canvas&&(y.canvas.width=0,y.canvas.height=0),v=null,y=null}var f,p,g=" attribute vec2 a_position; attribute vec2 a_texCoord; uniform vec2 u_resolution; varying vec2 v_texCoord; void main() { vec2 clipSpace = (a_position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_texCoord = a_texCoord; } ",m=" precision mediump float; uniform vec4 u_backdrop; uniform int u_subtype; uniform sampler2D u_image; uniform sampler2D u_mask; varying vec2 v_texCoord; void main() { vec4 imageColor = texture2D(u_image, v_texCoord); vec4 maskColor = texture2D(u_mask, v_texCoord); if (u_backdrop.a > 0.0) { maskColor.rgb = maskColor.rgb * maskColor.a + u_backdrop.rgb * (1.0 - maskColor.a); } float lum;
this.baseTransform=this.ctx.mozCurrentTransform,(0,a.isArray)(e)&&4===e.length){var n=e[2]-e[0],r=e[3]-e[1];this.ctx.rect(e[0],e[1],n,r),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(t){this.save();var e=this.ctx;t.isolated||(0,a.info)("TODO: Support non-isolated groups."),t.knockout&&(0,a.warn)("Knockout groups not supported.");var n=e.mozCurrentTransform;t.matrix&&e.transform.apply(e,t.matrix),(0,a.assert)(t.bbox,"Bounding box is required.");var r=a.Util.getAxialAlignedBoundingBox(t.bbox,e.mozCurrentTransform),i=[0,0,e.canvas.width,e.canvas.height];r=a.Util.intersect(r,i)||[0,0,0,0];var s=Math.floor(r[0]),o=Math.floor(r[1]),c=Math.max(Math.ceil(r[2])-s,1),l=Math.max(Math.ceil(r[3])-o,1),u=1,h=1;c>4096&&(u=c/4096,c=4096),l>4096&&(h=l/4096,l=4096);var f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);var p=this.cachedCanvases.getCanvas(f,c,l,!0),g=p.context;g.scale(1/u,1/h),g.translate(-s,-o),g.transform.apply(g,n),t.smask?this.smaskStack.push({canvas:p.canvas,context:g,offsetX:s,offsetY:o,scaleX:u,scaleY:h,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null}):(e.setTransform(1,0,0,1,0,0),e.translate(s,o),e.scale(u,h)),d(e,g),this.ctx=g,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(e),this.groupLevel++,this.current.activeSMask=null},endGroup:function(t){this.groupLevel--;var e=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,t.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(e.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)},endAnnotations:function(){this.restore()},beginAnnotation:function(t,e,n){if(this.save(),f(this.ctx),this.current=new h,(0,a.isArray)(t)&&4===t.length){var r=t[2]-t[0],i=t[3]-t[1];this.ctx.rect(t[0],t[1],r,i),this.clip(),this.endPath()}this.transform.apply(this,e),this.transform.apply(this,n)},endAnnotation:function(){this.restore()},paintJpegXObject:function(t,e,n){var r=this.objs.get(t);if(!r)return void(0,a.warn)("Dependent image isn't ready yet");this.save();var i=this.ctx;if(i.scale(1/e,-1/n),i.drawImage(r,0,0,r.width,r.height,0,-n,e,n),this.imageLayer){var s=i.mozCurrentTransformInverse,o=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:t,left:o[0],top:o[1],width:e/s[0],height:n/s[3]})}this.restore()},paintImageMaskXObject:function(t){var e=this.ctx,r=t.width,a=t.height,s=this.current.fillColor,o=this.current.patternFill,c=this.processingType3;if(c&&void 0===c.compiled&&(c.compiled=r<=1e3&&a<=1e3?i({data:t.data,width:r,height:a}):null),c&&c.compiled)return void c.compiled(e);var l=this.cachedCanvases.getCanvas("maskCanvas",r,a),u=l.context;u.save(),n(u,t),u.globalCompositeOperation="source-in",u.fillStyle=o?s.getPattern(u,this):s,u.fillRect(0,0,r,a),u.restore(),this.paintInlineImageXObject(l.canvas)},paintImageMaskXObjectRepeat:function(t,e,r,i){var a=t.width,s=t.height,o=this.current.fillColor,c=this.current.patternFill,l=this.cachedCanvases.getCanvas("maskCanvas",a,s),u=l.context;u.save(),n(u,t),u.globalCompositeOperation="source-in",u.fillStyle=c?o.getPattern(u,this):o,u.fillRect(0,0,a,s),u.restore();for(var h=this.ctx,d=0,f=i.length;d<f;d+=2)h.save(),h.transform(e,0,0,r,i[d],i[d+1]),h.scale(1,-1),h.drawImage(l.canvas,0,0,a,s,0,-1,1,1),h.restore()},paintImageMaskXObjectGroup:function(t){for(var e=this.ctx,r=this.current.fillColor,i=this.current.patternFill,a=0,s=t.length;a<s;a++){var o=t[a],c=o.width,l=o.height,u=this.cachedCanvases.getCanvas("maskCanvas",c,l),h=u.context;h.save(),n(h,o),h.globalCompositeOperation="source-in",h.fillStyle=i?r.getPattern(h,this):r,h.fillRect(0,0,c,l),h.restore(),e.save(),e.transform.apply(e,o.transform),e.scale(1,-1),e.drawImage(u.canvas,0,0,c,l,0,-1,1,1),e.restore()}},paintImageXObject:function(t){var e=this.objs.get(t);if
}),o=e.length,c=[];if(0===o)return i(c),s;for(var l=0,u=e.length;l<u;++l){var h=e[l],d=function(e){return function(n){s._status!==t&&(c[e]=n,0===--o&&i(c))}}(l);r.isPromise(h)?h.then(d,n):d(h)}return s},r.isPromise=function(t){return t&&"function"==typeof t.then},r.resolve=function(t){return new r(function(e){e(t)})},r.reject=function(t){return new r(function(e,n){n(t)})},r.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(n,i){if(1!==this._status&&this._status!==t){if(1===n&&r.isPromise(i))return void i.then(this._updateStatus.bind(this,1),this._updateStatus.bind(this,t));this._status=n,this._value=i,n===t&&0===this._handlers.length&&(this._unhandledRejection=!0,e.addUnhandledRejection(this)),e.scheduleHandlers(this)}},_resolve:function(t){this._updateStatus(1,t)},_reject:function(e){this._updateStatus(t,e)},then:function(t,n){var i=new r(function(t,e){this.resolve=t,this.reject=e});return this._handlers.push({thisPromise:this,onResolve:t,onReject:n,nextPromise:i}),e.scheduleHandlers(this),i},catch:function(t){return this.then(void 0,t)}},n.Promise=r}(),function(){function t(){this.id="$weakmap"+e++}if(!n.WeakMap){var e=0;t.prototype={has:function(t){return!!Object.getOwnPropertyDescriptor(t,this.id)},get:function(t,e){return this.has(t)?t[this.id]:e},set:function(t,e){Object.defineProperty(t,this.id,{value:e,enumerable:!1,configurable:!0})},delete:function(t){delete t[this.id]}},n.WeakMap=t}}(),function(){function t(t){return void 0!==d[t]}function r(){c.call(this),this._isInvalid=!0}function i(t){return""===t&&r.call(this),t.toLowerCase()}function a(t){var e=t.charCodeAt(0);return e>32&&e<127&&-1===[34,35,60,62,63,96].indexOf(e)?t:encodeURIComponent(t)}function s(t){var e=t.charCodeAt(0);return e>32&&e<127&&-1===[34,35,60,62,96].indexOf(e)?t:encodeURIComponent(t)}function o(e,n,o){function c(t){b.push(t)}var l=n||"scheme start",u=0,h="",v=!1,A=!1,b=[];t:for(;(e[u-1]!==p||0===u)&&!this._isInvalid;){var y=e[u];switch(l){case"scheme start":if(!y||!g.test(y)){if(n){c("Invalid scheme.");break t}h="",l="no scheme";continue}h+=y.toLowerCase(),l="scheme";break;case"scheme":if(y&&m.test(y))h+=y.toLowerCase();else{if(":"!==y){if(n){if(y===p)break t;c("Code point not allowed in scheme: "+y);break t}h="",u=0,l="no scheme";continue}if(this._scheme=h,h="",n)break t;t(this._scheme)&&(this._isRelative=!0),l="file"===this._scheme?"relative":this._isRelative&&o&&o._scheme===this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"===y?(this._query="?",l="query"):"#"===y?(this._fragment="#",l="fragment"):y!==p&&"\t"!==y&&"\n"!==y&&"\r"!==y&&(this._schemeData+=a(y));break;case"no scheme":if(o&&t(o._scheme)){l="relative";continue}c("Missing scheme."),r.call(this);break;case"relative or authority":if("/"!==y||"/"!==e[u+1]){c("Expected /, got: "+y),l="relative";continue}l="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!==this._scheme&&(this._scheme=o._scheme),y===p){this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._username=o._username,this._password=o._password;break t}if("/"===y||"\\"===y)"\\"===y&&c("\\ is an invalid code point."),l="relative slash";else if("?"===y)this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query="?",this._username=o._username,this._password=o._password,l="query";else{if("#"!==y){var S=e[u+1],x=e[u+2];("file"!==this._scheme||!g.test(y)||":"!==S&&"|"!==S||x!==p&&"/"!==x&&"\\"!==x&&"?"!==x&&"#"!==x)&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password,this._path=o._path.slice(),this._path.pop()),l="relative path";continue}this._host=o._host,this._port=o._port,this._path=o._path.slice(),this._query=o._query,this._fragment="#",this._username=o._username,this._password=o._password,l="fragment"}break;case"relative slash":if("/"!==y&&"\\"!==y){"file"!==this._scheme&&(this._host=o._host,this._port=o._port,this._username=o._username,this._password=o._password),l="relative path";con