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.

5 lines
146 KiB

!function(t,e){"use strict";"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",["exports"],e):e("undefined"!=typeof exports?exports:t.pdfjsDistBuildPdf={})}(this,function(t){"use strict";var e="1.6.440",n="e5cea05",i="undefined"!=typeof document&&document.currentScript?document.currentScript.src:null,r={};(function(){!function(t,e){e(t.pdfjsSharedUtil={})}(this,function(t){function e(t){Z=t}function n(){return Z}function i(t){Z>=Q.infos&&console.log("Info: "+t)}function r(t){Z>=Q.warnings&&console.log("Warning: "+t)}function a(t){console.log("Deprecated API usage: "+t)}function s(t){throw Z>=Q.errors&&(console.log("Error: "+t),console.log(o())),new Error(t)}function o(){try{throw new Error}catch(t){return t.stack?t.stack.split("\n").slice(2).join("\n"):""}}function c(t,e){t||s(e)}function l(t,e){try{var n=new URL(t);if(!n.origin||"null"===n.origin)return!1}catch(t){return!1}var i=new URL(e,n);return n.origin===i.origin}function h(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function u(t,e){if(!t)return null;try{var n=e?new URL(t,e):new URL(t);if(h(n))return n}catch(t){}return null}function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!1}),n}function f(t){var e;return function(){return t&&(e=Object.create(null),t(e),t=null),e}}function p(t){return"string"!=typeof t?(r("The argument for removeNullCharacters must be a string."),t):t.replace(lt,"")}function g(t){c(null!==t&&"object"==typeof t&&void 0!==t.length,"Invalid argument for bytesToString");var e=t.length,n=8192;if(e<n)return String.fromCharCode.apply(null,t);for(var i=[],r=0;r<e;r+=n){var a=Math.min(r+n,e),s=t.subarray(r,a);i.push(String.fromCharCode.apply(null,s))}return i.join("")}function m(t){c("string"==typeof t,"Invalid argument for stringToBytes");for(var e=t.length,n=new Uint8Array(e),i=0;i<e;++i)n[i]=255&t.charCodeAt(i);return n}function A(t){return void 0!==t.length?t.length:(c(void 0!==t.byteLength),t.byteLength)}function v(t){if(1===t.length&&t[0]instanceof Uint8Array)return t[0];var e,n,i,r=0,a=t.length;for(e=0;e<a;e++)n=t[e],i=A(n),r+=i;var s=0,o=new Uint8Array(r);for(e=0;e<a;e++)n=t[e],n instanceof Uint8Array||(n="string"==typeof n?m(n):new Uint8Array(n)),i=n.byteLength,o.set(n,s),s+=i;return o}function b(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)}function y(t){for(var e=1,n=0;t>e;)e<<=1,n++;return n}function x(t,e){return t[e]<<24>>24}function S(t,e){return t[e]<<8|t[e+1]}function k(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}function _(){var t=new Uint8Array(2);t[0]=1;var e=new Uint16Array(t.buffer);return 1===e[0]}function C(){try{return new Function(""),!0}catch(t){return!1}}function w(t){var e,n=t.length,i=[];if("þ"===t[0]&&"ÿ"===t[1])for(e=2;e<n;e+=2)i.push(String.fromCharCode(t.charCodeAt(e)<<8|t.charCodeAt(e+1)));else for(e=0;e<n;++e){var r=pt[t.charCodeAt(e)];i.push(r?String.fromCharCode(r):t.charAt(e))}return i.join("")}function T(t){return decodeURIComponent(escape(t))}function L(t){return unescape(encodeURIComponent(t))}function P(t){for(var e in t)return!1;return!0}function E(t){return"boolean"==typeof t}function R(t){return"number"==typeof t&&(0|t)===t}function I(t){return"number"==typeof t}function D(t){return"string"==typeof t}function j(t){return t instanceof Array}function O(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength}function F(t){return 32===t||9===t||13===t||10===t}function M(){var t={};return t.promise=new Promise(function(e,n){t.resolve=e,t.reject=n}),t}function N(t,e,n){this.sourceName=t,this.targetName=e,this.comObj=n,this.callbackIndex=1,this.postMessageTransfers=!0;var i=this.callbacksCapabilities=Object.create(null),r=this.actionHandler=Object.create(null);this._onComObjOnMessage=function(t){var e=t.data;if(e.targetName===this.sourceName)if(e.isReply){var a=e.callbackId;if(e.callbackId in i){var o=i[a];delete i[a],"error"in e?o.reject(e.error):o.resolve(e.data)}else s("Cannot resolve callback "+a)}else if(e.action in r){var c=r[e.ac
this.loadingContext={requests:[],nextRequestId:0}}var i=e.assert,r=e.bytesToString,a=e.string32,s=e.shadow,o=e.warn;n.prototype={insertRule:function(t){var e=this.styleElement;e||(e=this.styleElement=document.createElement("style"),e.id="PDFJS_FONT_STYLE_TAG_"+this.docId,document.documentElement.getElementsByTagName("head")[0].appendChild(e));var n=e.sheet;n.insertRule(t,n.cssRules.length)},clear:function(){var t=this.styleElement;t&&(t.parentNode.removeChild(t),t=this.styleElement=null),this.nativeFontFaces.forEach(function(t){document.fonts.delete(t)}),this.nativeFontFaces.length=0}};var c=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};Object.defineProperty(n.prototype,"loadTestFont",{get:function(){return s(this,"loadTestFont",c())},configurable:!0}),n.prototype.addNativeFontFace=function(t){this.nativeFontFaces.push(t),document.fonts.add(t)},n.prototype.bind=function(t,e){for(var i=[],r=[],a=[],s=function(t){return t.loaded.catch(function(e){o('Failed to load font "'+t.family+'": '+e)})},c=n.isFontLoadingAPISupported&&!n.isSyncFontLoadingSupported,l=0,h=t.length;l<h;l++){var u=t[l];if(!u.attached&&u.loading!==!1)if(u.attached=!0,c){var d=u.createNativeFontFace();d&&(this.addNativeFontFace(d),a.push(s(d)))}else{var f=u.createFontFaceRule();f&&(this.insertRule(f),i.push(f),r.push(u))}}var p=this.queueLoadingCallback(e);c?Promise.all(a).then(function(){p.complete()}):i.length>0&&!n.isSyncFontLoadingSupported?this.prepareFontLoadEvent(i,r,p):p.complete()},n.prototype.queueLoadingCallback=function(t){function e(){for(i(!a.end,"completeRequest() cannot be called twice"),a.end=Date.now();n.requests.length>0&&n.requests[0].end;){var t=n.requests.shift();setTimeout(t.callback,0)}}var n=this.loadingContext,r="pdfjs-font-loading-"+n.nextRequestId++,a={id:r,complete:e,callback:t,started:Date.now()};return n.requests.push(a),a},n.prototype.prepareFontLoadEvent=function(t,e,n){function i(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function r(t,e,n,i){var r=t.substr(0,e),a=t.substr(e+n);return r+i+a}function s(t,e){if(d++,d>30)return o("Load test font never loaded."),void e();u.font="30px "+t,u.fillText(".",0,20);var n=u.getImageData(0,0,1,1);return n.data[3]>0?void e():void setTimeout(s.bind(null,t,e))}var c,l,h=document.createElement("canvas");h.width=1,h.height=1;var u=h.getContext("2d"),d=0,f="lt"+Date.now()+this.loadTestFontId++,p=this.loadTestFont,g=976;p=r(p,g,f.length,f);var m=16,A=1482184792,v=i(p,m);for(c=0,l=f.length-3;c<l;c+=4)v=v-A+i(f,c)|0;c<f.length&&(v=v-A+i(f+"XXX",c)|0),p=r(p,m,4,a(v));var b="url(data:font/openty
this.container.appendChild(t),this.container}}),t}(),b=function(){function t(t){m.call(this,t,t.renderInteractiveForms)}return s.inherit(t,m,{render:function(){this.container.className="buttonWidgetAnnotation radioButton";var t=document.createElement("input");return t.disabled=this.data.readOnly,t.type="radio",t.name=this.data.fieldName,this.data.fieldValue===this.data.buttonValue&&t.setAttribute("checked",!0),this.container.appendChild(t),this.container}}),t}(),y=function(){function t(t){m.call(this,t,t.renderInteractiveForms)}return s.inherit(t,m,{render:function(){this.container.className="choiceWidgetAnnotation";var t=document.createElement("select");t.disabled=this.data.readOnly,this.data.combo||(t.size=this.data.options.length,this.data.multiSelect&&(t.multiple=!0));for(var e=0,n=this.data.options.length;e<n;e++){var i=this.data.options[e],r=document.createElement("option");r.textContent=i.displayValue,r.value=i.exportValue,this.data.fieldValue.indexOf(i.displayValue)>=0&&r.setAttribute("selected",!0),t.appendChild(r)}return this.container.appendChild(t),this.container}}),t}(),x=function(){function t(t){var e=!(!t.data.title&&!t.data.contents);f.call(this,t,e)}return s.inherit(t,f,{render:function(){this.container.className="popupAnnotation";var t='[data-annotation-id="'+this.data.parentId+'"]',e=this.layer.querySelector(t);if(!e)return this.container;var n=new S({container:this.container,trigger:e,color:this.data.color,title:this.data.title,contents:this.data.contents}),i=parseFloat(e.style.left),r=parseFloat(e.style.width);return u.setProp("transformOrigin",this.container,-(i+r)+"px -"+e.style.top),this.container.style.left=i+r+"px",this.container.appendChild(n.render()),this.container}}),t}(),S=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}var e=.7;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 n=document.createElement("div");n.className="popup";var i=this.color;if(i){var r=e*(255-i[0])+i[0],a=e*(255-i[1])+i[1],o=e*(255-i[2])+i[2];n.style.backgroundColor=s.makeCssRgb(0|r,0|a,0|o)}var c=this._formatContents(this.contents),l=document.createElement("h1");return l.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)),n.addEventListener("click",this._hide.bind(this,!0)),n.appendChild(l),n.appendChild(c),t.appendChild(n),t},_formatContents:function(t){for(var e=document.createElement("p"),n=t.split(/(?:\r\n?|\n)/),i=0,r=n.length;i<r;++i){var a=n[i];e.appendChild(document.createTextNode(a)),i<r-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}(),k=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);f.call(this,t,e)}return s.inherit(t,f,{render:function(){return this.container.className="highlightAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}),t}(),_=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);f.call(this,t,e)}return s.inherit(t,f,{render:function(){return this.container.className="underlineAnnotation",this.data.hasPopup||this._createPopup(this.container,null,this.data),this.container}}),t}(),C=function(){function t(t){var e=!!(t.data.hasPopup||t.data.title||t.data.contents);f.call(this,t,e)}return s.inherit(t,f,{render:function(){return this.container.classNa
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.textRenderingMode=d.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.resumeSMaskCtx=null,this.old=t}return t.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(t,e){this.x=t,this.y=e}},t}(),N=function(){function t(t,e,n,i){this.ctx=t,this.current=new M,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=e,this.objs=n,this.imageLayer=i,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.cachedCanvases=new F,t&&s(t),this.cachedGetSinglePixelWidth=null}function e(t,e){if("undefined"!=typeof ImageData&&e instanceof ImageData)return void t.putImageData(e,0,0);var n,i,r,a,s,o=e.height,c=e.width,l=o%D,u=(o-l)/D,d=0===l?u:u+1,p=t.createImageData(c,D),g=0,m=e.data,A=p.data;if(e.kind===h.GRAYSCALE_1BPP){var v=m.byteLength,b=j.value?new Uint32Array(A.buffer):new f(A),x=b.length,S=c+7>>3,k=4294967295,_=O.value||!j.value?4278190080:255;for(i=0;i<d;i++){for(a=i<u?D:l,n=0,r=0;r<a;r++){for(var C=v-g,w=0,T=C>S?c:8*C-7,L=T&-8,P=0,E=0;w<L;w+=8)E=m[g++],b[n++]=128&E?k:_,b[n++]=64&E?k:_,b[n++]=32&E?k:_,b[n++]=16&E?k:_,b[n++]=8&E?k:_,b[n++]=4&E?k:_,b[n++]=2&E?k:_,b[n++]=1&E?k:_;for(;w<T;w++)0===P&&(E=m[g++],P=128),b[n++]=E&P?k:_,P>>=1}for(;n<x;)b[n++]=0;t.putImageData(p,0,i*D)}}else if(e.kind===h.RGBA_32BPP){for(r=0,s=c*D*4,i=0;i<u;i++)A.set(m.subarray(g,g+s)),g+=s,t.putImageData(p,0,r),r+=D;i<d&&(s=c*l*4,A.set(m.subarray(g,g+s)),t.putImageData(p,0,r))}else if(e.kind===h.RGB_24BPP)for(a=D,s=c*a,i=0;i<d;i++){for(i>=u&&(a=l,s=c*a),n=0,r=s;r--;)A[n++]=m[g++],A[n++]=m[g++],A[n++]=m[g++],A[n++]=255;t.putImageData(p,0,i*D)}else y("bad image kind: "+e.kind)}function n(t,e){for(var n=e.height,i=e.width,r=n%D,a=(n-r)/D,s=0===r?a:a+1,o=t.createImageData(i,D),c=0,l=e.data,h=o.data,u=0;u<s;u++){for(var d=u<a?D:r,f=3,p=0;p<d;p++)for(var g=0,m=0;m<i;m++){if(!g){var A=l[c++];g=128}h[f]=A&g?0:255,f+=4,g>>=1}t.putImageData(o,0,u*D)}}function i(t,e){for(var n=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],i=0,r=n.length;i<r;i++){var a=n[i];void 0!==t[a]&&(e[a]=t[a])}void 0!==t.setLineDash&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function r(t,e,n,i){for(var r=t.length,a=3;a<r;a+=4){var s=t[a];if(0===s)t[a-3]=e,t[a-2]=n,t[a-1]=i;else if(s<255){var o=255-s;t[a-3]=t[a-3]*s+e*o>>8,t[a-2]=t[a-2]*s+n*o>>8,t[a-1]=t[a-1]*s+i*o>>8}}}function a(t,e,n){for(var i=t.length,r=1/255,a=3;a<i;a+=4){var s=n?n[t[a]]:t[a];e[a]=e[a]*s*r|0}}function b(t,e,n){for(var i=t.length,r=3;r<i;r+=4){var a=77*t[r-3]+152*t[r-2]+28*t[r-1];e[r]=n?e[r]*n[a>>8]>>8:e[r]*a>>16}}function w(t,e,n,i,s,o,c){var l,h=!!o,u=h?o[0]:0,d=h?o[1]:0,f=h?o[2]:0;l="Luminosity"===s?b:a;for(var p=1048576,g=Math.min(i,Math.ceil(p/n)),m=0;m<i;m+=g){var A=Math.min(g,i-m),v=t.getImageData(0,m,n,A),y=e.getImageData(0,m,n,A);h&&r(v.data,u,d,f),l(v.data,y.data,c),t.putImageData(y,0,m)}}function N(t,e,n){var i=e.canvas,r=e.context;t.setTransform(e.scaleX,0,0,e.scaleY,e.offsetX,e.offsetY);var a=e.backdrop||null;if(!e.transferMap&&C.isEnabled){var s=C.composeSMask(n.canvas,i,{subtype:e.subtype,backdrop:a});return t.setTransform(1,0,0,1,0,0),void t.drawImage(s,e.offsetX,e.offsetY)}w(r,n,i.width,i.height,e.subtype,a,e.transferMap),t.drawImage(i,0,0)}var U=15,B=10,W=["butt","round","square"],G=["miter","round","bevel"],X={},z={};t.prototype={beginDrawing:function(t,e,n){var i=this.ctx.canvas.width,r=this.ctx.canvas.height;if(this.ctx.save(),this.ctx.fillStyle="rgb(255, 255, 255)",this.ctx.fillRect(0,0,i,r),this.ctx.restore(),n){var a=this.cachedCanvases.getCanvas("transparent",i,r,!0);this.compositeCtx=this.ctx,this.transparentCanvas=a.canvas,this.ctx=a.context,this.ct
o.onContinue=t.continueCallback);var c=this;return a.displayReadyCapability.promise.then(function(t){return c.pendingCleanup?void e():(n.time("Rendering"),s.initializeGraphics(t),void s.operatorListChanged())},function(t){e(t)}),o},getOperatorList:function(){function t(){if(i.operatorList.lastChunk){i.opListReadCapability.resolve(i.operatorList);var t=i.renderTasks.indexOf(n);t>=0&&i.renderTasks.splice(t,1)}}var e="oplist";this.intentStates[e]||(this.intentStates[e]=Object.create(null));var n,i=this.intentStates[e];return i.opListReadCapability||(n={},n.operatorListChanged=t,i.receivingOperatorList=!0,i.opListReadCapability=S(),i.renderTasks=[],i.renderTasks.push(n),i.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:e})),i.opListReadCapability.promise},getTextContent:function(t){return this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1,normalizeWhitespace:!(!t||t.normalizeWhitespace!==!0),combineTextItems:!t||t.disableCombineTextItems!==!0})},_destroy:function(){this.destroyed=!0,this.transport.pageCache[this.pageIndex]=null;var t=[];return Object.keys(this.intentStates).forEach(function(e){if("oplist"!==e){var n=this.intentStates[e];n.renderTasks.forEach(function(e){var n=e.capability.promise.catch(function(){});t.push(n),e.cancel()})}},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1,Promise.all(t)},destroy:function(){_("page destroy method, use cleanup() instead"),this.cleanup()},cleanup:function(){this.pendingCleanup=!0,this._tryCleanup()},_tryCleanup:function(){this.pendingCleanup&&!Object.keys(this.intentStates).some(function(t){var e=this.intentStates[t];return 0!==e.renderTasks.length||e.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(t){delete this.intentStates[t]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingCleanup=!1)},_startRenderPage:function(t,e){var n=this.intentStates[e];n.displayReadyCapability&&n.displayReadyCapability.resolve(t)},_renderPageChunk:function(t,e){var n,i,r=this.intentStates[e];for(n=0,i=t.length;n<i;n++)r.operatorList.fnArray.push(t.fnArray[n]),r.operatorList.argsArray.push(t.argsArray[n]);for(r.operatorList.lastChunk=t.lastChunk,n=0;n<r.renderTasks.length;n++)r.renderTasks[n].operatorListChanged();t.lastChunk&&(r.receivingOperatorList=!1,this._tryCleanup())}},t}(),K=function(){function t(){return"undefined"!=typeof d?d:B("workerSrc")?B("workerSrc"):i?i.replace(/\.js$/i,".worker.js"):void k("No PDFJS.workerSrc specified")}function e(){if(s)return s.promise;s=S();var e=z||function(e){x.loadScript(t(),function(){e(window.pdfjsDistBuildPdfWorker.WorkerMessageHandler)})};return e(s.resolve),s.promise}function n(t){this._listeners=[],this._defer=t,this._deferred=Promise.resolve(void 0)}function r(t){var e="importScripts('"+t+"');";return URL.createObjectURL(new Blob([e]))}function a(t){this.name=t,this.destroyed=!1,this._readyCapability=S(),this._port=null,this._webWorker=null,this._messageHandler=null,this._initialize()}var s,o=0;return n.prototype={postMessage:function(t,e){function n(t){if("object"!=typeof t||null===t)return t;if(i.has(t))return i.get(t);var r,a;if((a=t.buffer)&&P(a)){var s=e&&e.indexOf(a)>=0;return r=t===a?t:s?new t.constructor(a,t.byteOffset,t.byteLength):new t.constructor(t),i.set(t,r),r}r=L(t)?[]:{},i.set(t,r);for(var o in t){for(var c,l=t;!(c=Object.getOwnPropertyDescriptor(l,o));)l=Object.getPrototypeOf(l);"undefined"!=typeof c.value&&"function"!=typeof c.value&&(r[o]=n(c.value))}return r}if(!this._defer)return void this._listeners.forEach(function(e){e.call(this,{data:t})},this);var i=new WeakMap,r={data:n(t)};this._deferred.then(function(){this._listeners.forEach(function(t){t.call(this,r)},this)}.bind(this))},addEventListener:function(t,e){this._listeners.push(e)},removeEventListener:function(t,e){var n=this._listeners.indexOf(e);this._listeners.splice(n,1)},terminate:function(){this._listeners=[]}},a.prototype={get promise(){return this._readyCapability.pr