"undefined"==typeof PDFJS&&(("undefined"!=typeof window?window:this).PDFJS={}),PDFJS.version="1.0.814",PDFJS.build="d6328bb",function(){"use strict";function info(msg){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.infos&&console.log("Info: "+msg)}function warn(msg){PDFJS.verbosity>=PDFJS.VERBOSITY_LEVELS.warnings&&console.log("Warning: "+msg)}function error(msg){if(arguments.length>1){var logArguments=["Error:"];logArguments.push.apply(logArguments,arguments),console.log.apply(console,logArguments),msg=[].join.call(arguments," ")}else console.log("Error: "+msg);throw console.log(backtrace()),UnsupportedManager.notify(UNSUPPORTED_FEATURES.unknown),new Error(msg)}function backtrace(){try{throw new Error}catch(e){return e.stack?e.stack.split("\n").slice(2).join("\n"):""}}function assert(cond,msg){cond||error(msg)}function combineUrl(baseUrl,url){if(!url)return baseUrl;if(/^[a-z][a-z0-9+\-.]*:/i.test(url))return url;var i;if("/"===url.charAt(0))return i=baseUrl.indexOf("://"),"/"===url.charAt(1)?++i:i=baseUrl.indexOf("/",i+3),baseUrl.substring(0,i)+url;var pathLength=baseUrl.length;i=baseUrl.lastIndexOf("#"),pathLength=i>=0?i:pathLength,i=baseUrl.lastIndexOf("?",pathLength),pathLength=i>=0?i:pathLength;var prefixLength=baseUrl.lastIndexOf("/",pathLength);return baseUrl.substring(0,prefixLength+1)+url}function isValidUrl(url,allowRelative){if(!url)return!1;var protocol=/^[a-z][a-z0-9+\-.]*(?=:)/i.exec(url);if(!protocol)return allowRelative;switch(protocol=protocol[0].toLowerCase()){case"http":case"https":case"ftp":case"mailto":return!0;default:return!1}}function shadow(obj,prop,value){return Object.defineProperty(obj,prop,{value:value,enumerable:!0,configurable:!0,writable:!1}),value}function bytesToString(bytes){var length=bytes.length,MAX_ARGUMENT_COUNT=8192;if(MAX_ARGUMENT_COUNT>length)return String.fromCharCode.apply(null,bytes);for(var strBuf=[],i=0;length>i;i+=MAX_ARGUMENT_COUNT){var chunkEnd=Math.min(i+MAX_ARGUMENT_COUNT,length),chunk=bytes.subarray(i,chunkEnd);strBuf.push(String.fromCharCode.apply(null,chunk))}return strBuf.join("")}function string32(value){return String.fromCharCode(value>>24&255,value>>16&255,value>>8&255,255&value)}function isLittleEndian(){var buffer8=new Uint8Array(2);buffer8[0]=1;var buffer16=new Uint16Array(buffer8.buffer);return 1===buffer16[0]}function hasCanvasTypedArrays(){var canvas=document.createElement("canvas");canvas.width=canvas.height=1;var ctx=canvas.getContext("2d"),imageData=ctx.createImageData(1,1);return"undefined"!=typeof imageData.data.buffer}function isNum(v){return"number"==typeof v}function isArray(v){return v instanceof Array}function isArrayBuffer(v){return"object"==typeof v&&null!==v&&void 0!==v.byteLength}function createPromiseCapability(){var capability={};return capability.promise=new Promise(function(resolve,reject){capability.resolve=resolve,capability.reject=reject}),capability}function MessageHandler(name,comObj){this.name=name,this.comObj=comObj,this.callbackIndex=1,this.postMessageTransfers=!0;var callbacksCapabilities=this.callbacksCapabilities={},ah=this.actionHandler={};ah.console_log=[function(data){console.log.apply(console,data)}],ah.console_error=[function(data){console.error.apply(console,data)}],ah._unsupported_feature=[function(data){UnsupportedManager.notify(data)}],comObj.onmessage=function(event){var data=event.data;if(data.isReply){var callbackId=data.callbackId;if(data.callbackId in callbacksCapabilities){var callback=callbacksCapabilities[callbackId];delete callbacksCapabilities[callbackId],"error"in data?callback.reject(data.error):callback.resolve(data.data)}else error("Cannot resolve callback "+callbackId)}else if(data.action in ah){var action=ah[data.action];data.callbackId?Promise.resolve().then(function(){return action[0].call(action[1],data.data)}).then(function(result){comObj.postMessage({isReply:!0,callbackId:data.callbackId,data:result})},function(reason){comObj.postMessage({isReply:!0,callbackId:data.callbackId,error:reason})}):action[0].call(action[1],data.data)}else error("Unknown action from worker: "+data.action)}}function loadJpegStream(id,imageUrl,objs){var img=new Image;img.onload=function(){objs.resolve(id,img)},img.onerror=function(){objs.resolve(id,null),warn("Error during JPEG image loading")},img.src=imageUrl}function createScratchCanvas(width,height){var canvas=document.createElement("canvas");return canvas.width=width,canvas.height=height,canvas}function addContextCurrentTransform(ctx){ctx.mozCurrentTransform||(ctx._scaleX=ctx._scaleX||1,ctx._scaleY=ctx._scaleY||1,ctx._originalSave=ctx.save,ctx._originalRestore=ctx.restore,ctx._originalRotate=ctx.rotate,ctx._originalScale=ctx.scale,ctx._originalTranslate=ctx.translate,ctx._originalTransform=ctx.transform,ctx._originalSetTransform=ctx.setTransform,ctx._transformMatrix=[ctx._scaleX,0,0,ctx._scaleY,0,0],ctx._transformStack=[],Object.defineProperty(ctx,"mozCurrentTransform",{get:function(){return this._transformMatrix}}),Object.defineProperty(ctx,"mozCurrentTransformInverse",{get:function(){var m=this._transformMatrix,a=m[0],b=m[1],c=m[2],d=m[3],e=m[4],f=m[5],ad_bc=a*d-b*c,bc_ad=b*c-a*d;return[d/ad_bc,b/bc_ad,c/bc_ad,a/ad_bc,(d*e-c*f)/bc_ad,(b*e-a*f)/ad_bc]}}),ctx.save=function(){var old=this._transformMatrix;this._transformStack.push(old),this._transformMatrix=old.slice(0,6),this._originalSave()},ctx.restore=function(){var prev=this._transformStack.pop();prev&&(this._transformMatrix=prev,this._originalRestore())},ctx.translate=function(x,y){var m=this._transformMatrix;m[4]=m[0]*x+m[2]*y+m[4],m[5]=m[1]*x+m[3]*y+m[5],this._originalTranslate(x,y)},ctx.scale=function(x,y){var m=this._transformMatrix;m[0]=m[0]*x,m[1]=m[1]*x,m[2]=m[2]*y,m[3]=m[3]*y,this._originalScale(x,y)},ctx.transform=function(a,b,c,d,e,f){var m=this._transformMatrix;this._transformMatrix=[m[0]*a+m[2]*b,m[1]*a+m[3]*b,m[0]*c+m[2]*d,m[1]*c+m[3]*d,m[0]*e+m[2]*f+m[4],m[1]*e+m[3]*f+m[5]],ctx._originalTransform(a,b,c,d,e,f)},ctx.setTransform=function(a,b,c,d,e,f){this._transformMatrix=[a,b,c,d,e,f],ctx._originalSetTransform(a,b,c,d,e,f)},ctx.rotate=function(angle){var cosValue=Math.cos(angle),sinValue=Math.sin(angle),m=this._transformMatrix;this._transformMatrix=[m[0]*cosValue+m[2]*sinValue,m[1]*cosValue+m[3]*sinValue,m[0]*-sinValue+m[2]*cosValue,m[1]*-sinValue+m[3]*cosValue,m[4],m[5]],this._originalRotate(angle)})}function compileType3Glyph(imgData){var i,j,j0,ii,POINT_TO_PROCESS_LIMIT=1e3,width=imgData.width,height=imgData.height,width1=width+1,points=new Uint8Array(width1*(height+1)),POINT_TYPES=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),lineSize=width+7&-8,data0=imgData.data,data=new Uint8Array(lineSize*height),pos=0;for(i=0,ii=data0.length;ii>i;i++)for(var mask=128,elem=data0[i];mask>0;)data[pos++]=elem&mask?0:255,mask>>=1;var count=0;for(pos=0,0!==data[pos]&&(points[0]=1,++count),j=1;width>j;j++)data[pos]!==data[pos+1]&&(points[j]=data[pos]?2:1,++count),pos++;for(0!==data[pos]&&(points[j]=2,++count),i=1;height>i;i++){pos=i*lineSize,j0=i*width1,data[pos-lineSize]!==data[pos]&&(points[j0]=data[pos]?1:8,++count);var sum=(data[pos]?4:0)+(data[pos-lineSize]?8:0);for(j=1;width>j;j++)sum=(sum>>2)+(data[pos+1]?4:0)+(data[pos-lineSize+1]?8:0),POINT_TYPES[sum]&&(points[j0+j]=POINT_TYPES[sum],++count),pos++;if(data[pos-lineSize]!==data[pos]&&(points[j0+j]=data[pos]?2:4,++count),count>POINT_TO_PROCESS_LIMIT)return null}for(pos=lineSize*(height-1),j0=i*width1,0!==data[pos]&&(points[j0]=8,++count),j=1;width>j;j++)data[pos]!==data[pos+1]&&(points[j0+j]=data[pos]?4:8,++count),pos++;if(0!==data[pos]&&(points[j0+j]=4,++count),count>POINT_TO_PROCESS_LIMIT)return null;var steps=new Int32Array([0,width1,-1,0,-width1,0,0,0,1]),outlines=[];for(i=0;count&&height>=i;i++){for(var p=i*width1,end=p+width;end>p&&!points[p];)p++;if(p!==end){var pp,coords=[p%width1,i],type=points[p],p0=p;do{var step=steps[type];do p+=step;while(!points[p]);pp=points[p],5!==pp&&10!==pp?(type=pp,points[p]=0):(type=pp&51*type>>4,points[p]&=type>>2|type<<2),coords.push(p%width1),coords.push(p/width1|0),--count}while(p0!==p);outlines.push(coords),--i}}var drawOutline=function(c){c.save(),c.scale(1/width,-1/height),c.translate(0,-height),c.beginPath();for(var i=0,ii=outlines.length;ii>i;i++){var o=outlines[i];c.moveTo(o[0],o[1]);for(var j=2,jj=o.length;jj>j;j+=2)c.lineTo(o[j],o[j+1])}c.fill(),c.beginPath(),c.restore()};return drawOutline}function getShadingPatternFromIR(raw){var shadingIR=ShadingIRs[raw[0]];return shadingIR||error("Unknown IR type: "+raw[0]),shadingIR.fromIR(raw)}var globalScope="undefined"==typeof window?this:window,isWorker="undefined"==typeof window,FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},AnnotationType={WIDGET:1,TEXT:2,LINK:3};globalScope.PDFJS||(globalScope.PDFJS={}),globalScope.PDFJS.pdfBug=!1,PDFJS.VERBOSITY_LEVELS={errors:0,warnings:1,infos:5};var OPS=PDFJS.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},UNSUPPORTED_FEATURES=PDFJS.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",smask:"smask",shadingPattern:"shadingPattern",font:"font"},UnsupportedManager=PDFJS.UnsupportedManager=function(){var listeners=[];return{listen:function(cb){listeners.push(cb)},notify:function(featureId){warn('Unsupported feature "'+featureId+'"');for(var i=0,ii=listeners.length;ii>i;i++)listeners[i](featureId)}}}();PDFJS.isValidUrl=isValidUrl;var PasswordResponses=PDFJS.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},PasswordException=function(){function PasswordException(msg,code){this.name="PasswordException",this.message=msg,this.code=code}return PasswordException.prototype=new Error,PasswordException.constructor=PasswordException,PasswordException}();PDFJS.PasswordException=PasswordException;var UnknownErrorException=function(){function UnknownErrorException(msg,details){this.name="UnknownErrorException",this.message=msg,this.details=details}return UnknownErrorException.prototype=new Error,UnknownErrorException.constructor=UnknownErrorException,UnknownErrorException}();PDFJS.UnknownErrorException=UnknownErrorException;var InvalidPDFException=function(){function InvalidPDFException(msg){this.name="InvalidPDFException",this.message=msg}return InvalidPDFException.prototype=new Error,InvalidPDFException.constructor=InvalidPDFException,InvalidPDFException}();PDFJS.InvalidPDFException=InvalidPDFException;var MissingPDFException=function(){function MissingPDFException(msg){this.name="MissingPDFException",this.message=msg}return MissingPDFException.prototype=new Error,MissingPDFException.constructor=MissingPDFException,MissingPDFException}();PDFJS.MissingPDFException=MissingPDFException;var UnexpectedResponseException=function(){function UnexpectedResponseException(msg,status){this.name="UnexpectedResponseException",this.message=msg,this.status=status}return UnexpectedResponseException.prototype=new Error,UnexpectedResponseException.constructor=UnexpectedResponseException,UnexpectedResponseException}();PDFJS.UnexpectedResponseException=UnexpectedResponseException;!function(){function NotImplementedException(msg){this.message=msg}return NotImplementedException.prototype=new Error,NotImplementedException.prototype.name="NotImplementedException",NotImplementedException.constructor=NotImplementedException,NotImplementedException}(),function(){function MissingDataException(begin,end){this.begin=begin,this.end=end,this.message="Missing data ["+begin+", "+end+")"}return MissingDataException.prototype=new Error,MissingDataException.prototype.name="MissingDataException",MissingDataException.constructor=MissingDataException,MissingDataException}(),function(){function XRefParseException(msg){this.message=msg}return XRefParseException.prototype=new Error,XRefParseException.prototype.name="XRefParseException",XRefParseException.constructor=XRefParseException,XRefParseException}();Object.defineProperty(PDFJS,"isLittleEndian",{configurable:!0,get:function(){return shadow(PDFJS,"isLittleEndian",isLittleEndian())}}),Object.defineProperty(PDFJS,"hasCanvasTypedArrays",{configurable:!0,get:function(){return shadow(PDFJS,"hasCanvasTypedArrays",hasCanvasTypedArrays())}});{var Uint32ArrayView=function(){function Uint32ArrayView(buffer,length){this.buffer=buffer,this.byteLength=buffer.length,this.length=void 0===length?this.byteLength>>2:length,ensureUint32ArrayViewProps(this.length)}function createUint32ArrayProp(index){return{get:function(){var buffer=this.buffer,offset=index<<2;return(buffer[offset]|buffer[offset+1]<<8|buffer[offset+2]<<16|buffer[offset+3]<<24)>>>0},set:function(value){var buffer=this.buffer,offset=index<<2;buffer[offset]=255&value,buffer[offset+1]=value>>8&255,buffer[offset+2]=value>>16&255,buffer[offset+3]=value>>>24&255}}}function ensureUint32ArrayViewProps(length){for(;length>uint32ArrayViewSetters;)Object.defineProperty(Uint32ArrayView.prototype,uint32ArrayViewSetters,createUint32ArrayProp(uint32ArrayViewSetters)),uint32ArrayViewSetters++}Uint32ArrayView.prototype=Object.create(null);var uint32ArrayViewSetters=0;return Uint32ArrayView}(),IDENTITY_MATRIX=[1,0,0,1,0,0],Util=PDFJS.Util=function(){function Util(){}var rgbBuf=["rgb(",0,",",0,",",0,")"];return Util.makeCssRgb=function(rgb){return rgbBuf[1]=rgb[0],rgbBuf[3]=rgb[1],rgbBuf[5]=rgb[2],rgbBuf.join("")},Util.transform=function(m1,m2){return[m1[0]*m2[0]+m1[2]*m2[1],m1[1]*m2[0]+m1[3]*m2[1],m1[0]*m2[2]+m1[2]*m2[3],m1[1]*m2[2]+m1[3]*m2[3],m1[0]*m2[4]+m1[2]*m2[5]+m1[4],m1[1]*m2[4]+m1[3]*m2[5]+m1[5]]},Util.applyTransform=function(p,m){var xt=p[0]*m[0]+p[1]*m[2]+m[4],yt=p[0]*m[1]+p[1]*m[3]+m[5];return[xt,yt]},Util.applyInverseTransform=function(p,m){var d=m[0]*m[3]-m[1]*m[2],xt=(p[0]*m[3]-p[1]*m[2]+m[2]*m[5]-m[4]*m[3])/d,yt=(-p[0]*m[1]+p[1]*m[0]+m[4]*m[1]-m[5]*m[0])/d;return[xt,yt]},Util.getAxialAlignedBoundingBox=function(r,m){var p1=Util.applyTransform(r,m),p2=Util.applyTransform(r.slice(2,4),m),p3=Util.applyTransform([r[0],r[3]],m),p4=Util.applyTransform([r[2],r[1]],m);return[Math.min(p1[0],p2[0],p3[0],p4[0]),Math.min(p1[1],p2[1],p3[1],p4[1]),Math.max(p1[0],p2[0],p3[0],p4[0]),Math.max(p1[1],p2[1],p3[1],p4[1])]},Util.inverseTransform=function(m){var d=m[0]*m[3]-m[1]*m[2];return[m[3]/d,-m[1]/d,-m[2]/d,m[0]/d,(m[2]*m[5]-m[4]*m[3])/d,(m[4]*m[1]-m[5]*m[0])/d]},Util.apply3dTransform=function(m,v){return[m[0]*v[0]+m[1]*v[1]+m[2]*v[2],m[3]*v[0]+m[4]*v[1]+m[5]*v[2],m[6]*v[0]+m[7]*v[1]+m[8]*v[2]]},Util.singularValueDecompose2dScale=function(m){var transpose=[m[0],m[2],m[1],m[3]],a=m[0]*transpose[0]+m[1]*transpose[2],b=m[0]*transpose[1]+m[1]*transpose[3],c=m[2]*transpose[0]+m[3]*transpose[2],d=m[2]*transpose[1]+m[3]*transpose[3],first=(a+d)/2,second=Math.sqrt((a+d)*(a+d)-4*(a*d-c*b))/2,sx=first+second||1,sy=first-second||1;return[Math.sqrt(sx),Math.sqrt(sy)]},Util.normalizeRect=function(rect){var r=rect.slice(0);return rect[0]>rect[2]&&(r[0]=rect[2],r[2]=rect[0]),rect[1]>rect[3]&&(r[1]=rect[3],r[3]=rect[1]),r},Util.intersect=function(rect1,rect2){function compare(a,b){return a-b}var orderedX=[rect1[0],rect1[2],rect2[0],rect2[2]].sort(compare),orderedY=[rect1[1],rect1[3],rect2[1],rect2[3]].sort(compare),result=[];return rect1=Util.normalizeRect(rect1),rect2=Util.normalizeRect(rect2),orderedX[0]===rect1[0]&&orderedX[1]===rect2[0]||orderedX[0]===rect2[0]&&orderedX[1]===rect1[0]?(result[0]=orderedX[1],result[2]=orderedX[2],orderedY[0]===rect1[1]&&orderedY[1]===rect2[1]||orderedY[0]===rect2[1]&&orderedY[1]===rect1[1]?(result[1]=orderedY[1],result[3]=orderedY[2],result):!1):!1},Util.sign=function(num){return 0>num?-1:1},Util.appendToArray=function(arr1,arr2){Array.prototype.push.apply(arr1,arr2)},Util.prependToArray=function(arr1,arr2){Array.prototype.unshift.apply(arr1,arr2)},Util.extendObj=function(obj1,obj2){for(var key in obj2)obj1[key]=obj2[key]},Util.getInheritableProperty=function(dict,name){for(;dict&&!dict.has(name);)dict=dict.get("Parent");return dict?dict.get(name):null},Util.inherit=function(sub,base,prototype){sub.prototype=Object.create(base.prototype),sub.prototype.constructor=sub;for(var prop in prototype)sub.prototype[prop]=prototype[prop]},Util.loadScript=function(src,callback){var script=document.createElement("script"),loaded=!1;script.setAttribute("src",src),callback&&(script.onload=function(){loaded||callback(),loaded=!0}),document.getElementsByTagName("head")[0].appendChild(script)},Util}();PDFJS.PageViewport=function(){function PageViewport(viewBox,scale,rotation,offsetX,offsetY,dontFlip){this.viewBox=viewBox,this.scale=scale,this.rotation=rotation,this.offsetX=offsetX,this.offsetY=offsetY;var rotateA,rotateB,rotateC,rotateD,centerX=(viewBox[2]+viewBox[0])/2,centerY=(viewBox[3]+viewBox[1])/2;switch(rotation%=360,rotation=0>rotation?rotation+360:rotation){case 180:rotateA=-1,rotateB=0,rotateC=0,rotateD=1;break;case 90:rotateA=0,rotateB=1,rotateC=1,rotateD=0;break;case 270:rotateA=0,rotateB=-1,rotateC=-1,rotateD=0;break;default:rotateA=1,rotateB=0,rotateC=0,rotateD=-1}dontFlip&&(rotateC=-rotateC,rotateD=-rotateD);var offsetCanvasX,offsetCanvasY,width,height;0===rotateA?(offsetCanvasX=Math.abs(centerY-viewBox[1])*scale+offsetX,offsetCanvasY=Math.abs(centerX-viewBox[0])*scale+offsetY,width=Math.abs(viewBox[3]-viewBox[1])*scale,height=Math.abs(viewBox[2]-viewBox[0])*scale):(offsetCanvasX=Math.abs(centerX-viewBox[0])*scale+offsetX,offsetCanvasY=Math.abs(centerY-viewBox[1])*scale+offsetY,width=Math.abs(viewBox[2]-viewBox[0])*scale,height=Math.abs(viewBox[3]-viewBox[1])*scale),this.transform=[rotateA*scale,rotateB*scale,rotateC*scale,rotateD*scale,offsetCanvasX-rotateA*scale*centerX-rotateC*scale*centerY,offsetCanvasY-rotateB*scale*centerX-rotateD*scale*centerY],this.width=width,this.height=height,this.fontScale=scale}return PageViewport.prototype={clone:function(args){args=args||{};var scale="scale"in args?args.scale:this.scale,rotation="rotation"in args?args.rotation:this.rotation;return new PageViewport(this.viewBox.slice(),scale,rotation,this.offsetX,this.offsetY,args.dontFlip)},convertToViewportPoint:function(x,y){return Util.applyTransform([x,y],this.transform)},convertToViewportRectangle:function(rect){var tl=Util.applyTransform([rect[0],rect[1]],this.transform),br=Util.applyTransform([rect[2],rect[3]],this.transform);return[tl[0],tl[1],br[0],br[1]]},convertToPdfPoint:function(x,y){return Util.applyInverseTransform([x,y],this.transform)}},PageViewport}()}PDFJS.createPromiseCapability=createPromiseCapability,function(){function Promise(resolver){this._status=STATUS_PENDING,this._handlers=[];try{resolver.call(this,this._resolve.bind(this),this._reject.bind(this))}catch(e){this._reject(e)}}if(globalScope.Promise)return"function"!=typeof globalScope.Promise.all&&(globalScope.Promise.all=function(iterable){var resolve,reject,count=0,results=[],promise=new globalScope.Promise(function(resolve_,reject_){resolve=resolve_,reject=reject_});return iterable.forEach(function(p,i){count++,p.then(function(result){results[i]=result,count--,0===count&&resolve(results)},reject)}),0===count&&resolve(results),promise}),"function"!=typeof globalScope.Promise.resolve&&(globalScope.Promise.resolve=function(value){return new globalScope.Promise(function(resolve){resolve(value)})}),"function"!=typeof globalScope.Promise.reject&&(globalScope.Promise.reject=function(reason){return new globalScope.Promise(function(resolve,reject){reject(reason)})}),void("function"!=typeof globalScope.Promise.prototype.catch&&(globalScope.Promise.prototype.catch=function(onReject){return globalScope.Promise.prototype.then(void 0,onReject)}));var STATUS_PENDING=0,STATUS_RESOLVED=1,STATUS_REJECTED=2,REJECTION_TIMEOUT=500,HandlerManager={handlers:[],running:!1,unhandledRejections:[],pendingRejectionCheck:!1,scheduleHandlers:function(promise){promise._status!==STATUS_PENDING&&(this.handlers=this.handlers.concat(promise._handlers),promise._handlers=[],this.running||(this.running=!0,setTimeout(this.runHandlers.bind(this),0)))},runHandlers:function(){for(var RUN_TIMEOUT=1,timeoutAt=Date.now()+RUN_TIMEOUT;this.handlers.length>0;){var handler=this.handlers.shift(),nextStatus=handler.thisPromise._status,nextValue=handler.thisPromise._value;try{nextStatus===STATUS_RESOLVED?"function"==typeof handler.onResolve&&(nextValue=handler.onResolve(nextValue)):"function"==typeof handler.onReject&&(nextValue=handler.onReject(nextValue),nextStatus=STATUS_RESOLVED,handler.thisPromise._unhandledRejection&&this.removeUnhandeledRejection(handler.thisPromise))}catch(ex){nextStatus=STATUS_REJECTED,nextValue=ex}if(handler.nextPromise._updateStatus(nextStatus,nextValue),Date.now()>=timeoutAt)break}return this.handlers.length>0?void setTimeout(this.runHandlers.bind(this),0):void(this.running=!1)},addUnhandledRejection:function(promise){this.unhandledRejections.push({promise:promise,time:Date.now()}),this.scheduleRejectionCheck()},removeUnhandeledRejection:function(promise){promise._unhandledRejection=!1;for(var i=0;iREJECTION_TIMEOUT){var unhandled=this.unhandledRejections[i].promise._value,msg="Unhandled rejection: "+unhandled;unhandled.stack&&(msg+="\n"+unhandled.stack),warn(msg),this.unhandledRejections.splice(i),i--}this.unhandledRejections.length&&this.scheduleRejectionCheck()}.bind(this),REJECTION_TIMEOUT))}};Promise.all=function(promises){function reject(reason){deferred._status!==STATUS_REJECTED&&(results=[],rejectAll(reason))}var resolveAll,rejectAll,deferred=new Promise(function(resolve,reject){resolveAll=resolve,rejectAll=reject}),unresolved=promises.length,results=[];if(0===unresolved)return resolveAll(results),deferred;for(var i=0,ii=promises.length;ii>i;++i){var promise=promises[i],resolve=function(i){return function(value){deferred._status!==STATUS_REJECTED&&(results[i]=value,unresolved--,0===unresolved&&resolveAll(results))}}(i);Promise.isPromise(promise)?promise.then(resolve,reject):resolve(promise)}return deferred},Promise.isPromise=function(value){return value&&"function"==typeof value.then},Promise.resolve=function(value){return new Promise(function(resolve){resolve(value)})},Promise.reject=function(reason){return new Promise(function(resolve,reject){reject(reason)})},Promise.prototype={_status:null,_value:null,_handlers:null,_unhandledRejection:null,_updateStatus:function(status,value){if(this._status!==STATUS_RESOLVED&&this._status!==STATUS_REJECTED){if(status===STATUS_RESOLVED&&Promise.isPromise(value))return void value.then(this._updateStatus.bind(this,STATUS_RESOLVED),this._updateStatus.bind(this,STATUS_REJECTED));this._status=status,this._value=value,status===STATUS_REJECTED&&0===this._handlers.length&&(this._unhandledRejection=!0,HandlerManager.addUnhandledRejection(this)),HandlerManager.scheduleHandlers(this)}},_resolve:function(value){this._updateStatus(STATUS_RESOLVED,value)},_reject:function(reason){this._updateStatus(STATUS_REJECTED,reason)},then:function(onResolve,onReject){var nextPromise=new Promise(function(resolve,reject){this.resolve=resolve,this.reject=reject});return this._handlers.push({thisPromise:this,onResolve:onResolve,onReject:onReject,nextPromise:nextPromise}),HandlerManager.scheduleHandlers(this),nextPromise},"catch":function(onReject){return this.then(void 0,onReject)}},globalScope.Promise=Promise}();var StatTimer=function(){function rpad(str,pad,length){for(;str.lengthi;++i){var name=times[i].name;name.length>longest&&(longest=name.length)}for(i=0,ii=times.length;ii>i;++i){var span=times[i],duration=span.end-span.start;out+=rpad(span.name," ",longest)+" "+duration+"ms\n"}return out}},StatTimer}();PDFJS.createBlob=function(data,contentType){if("undefined"!=typeof Blob)return new Blob([data],{type:contentType});var bb=new MozBlobBuilder;return bb.append(data),bb.getBlob(contentType)},PDFJS.createObjectURL=function(){var digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return function(data,contentType){if(!PDFJS.disableCreateObjectURL&&"undefined"!=typeof URL&&URL.createObjectURL){var blob=PDFJS.createBlob(data,contentType);return URL.createObjectURL(blob)}for(var buffer="data:"+contentType+";base64,",i=0,ii=data.length;ii>i;i+=3){var b1=255&data[i],b2=255&data[i+1],b3=255&data[i+2],d1=b1>>2,d2=(3&b1)<<4|b2>>4,d3=ii>i+1?(15&b2)<<2|b3>>6:64,d4=ii>i+2?63&b3:64;buffer+=digits[d1]+digits[d2]+digits[d3]+digits[d4]}return buffer}}(),MessageHandler.prototype={on:function(actionName,handler,scope){var ah=this.actionHandler;ah[actionName]&&error('There is already an actionName called "'+actionName+'"'),ah[actionName]=[handler,scope]},send:function(actionName,data,transfers){var message={action:actionName,data:data};this.postMessage(message,transfers)},sendWithPromise:function(actionName,data,transfers){var callbackId=this.callbackIndex++,message={action:actionName,data:data,callbackId:callbackId},capability=createPromiseCapability();this.callbacksCapabilities[callbackId]=capability;try{this.postMessage(message,transfers)}catch(e){capability.reject(e)}return capability.promise},postMessage:function(message,transfers){transfers&&this.postMessageTransfers?this.comObj.postMessage(message,transfers):this.comObj.postMessage(message)}},PDFJS.maxImageSize=void 0===PDFJS.maxImageSize?-1:PDFJS.maxImageSize,PDFJS.cMapUrl=void 0===PDFJS.cMapUrl?null:PDFJS.cMapUrl,PDFJS.cMapPacked=void 0===PDFJS.cMapPacked?!1:PDFJS.cMapPacked,PDFJS.disableFontFace=void 0===PDFJS.disableFontFace?!1:PDFJS.disableFontFace,PDFJS.imageResourcesPath=void 0===PDFJS.imageResourcesPath?"":PDFJS.imageResourcesPath,PDFJS.disableWorker=void 0===PDFJS.disableWorker?!1:PDFJS.disableWorker,PDFJS.workerSrc=void 0===PDFJS.workerSrc?null:PDFJS.workerSrc,PDFJS.disableRange=void 0===PDFJS.disableRange?!1:PDFJS.disableRange,PDFJS.disableAutoFetch=void 0===PDFJS.disableAutoFetch?!1:PDFJS.disableAutoFetch,PDFJS.pdfBug=void 0===PDFJS.pdfBug?!1:PDFJS.pdfBug,PDFJS.postMessageTransfers=void 0===PDFJS.postMessageTransfers?!0:PDFJS.postMessageTransfers,PDFJS.disableCreateObjectURL=void 0===PDFJS.disableCreateObjectURL?!1:PDFJS.disableCreateObjectURL,PDFJS.disableWebGL=void 0===PDFJS.disableWebGL?!0:PDFJS.disableWebGL,PDFJS.useOnlyCssZoom=void 0===PDFJS.useOnlyCssZoom?!1:PDFJS.useOnlyCssZoom,PDFJS.verbosity=void 0===PDFJS.verbosity?PDFJS.VERBOSITY_LEVELS.warnings:PDFJS.verbosity,PDFJS.maxCanvasPixels=void 0===PDFJS.maxCanvasPixels?16777216:PDFJS.maxCanvasPixels,PDFJS.getDocument=function(source,pdfDataRangeTransport,passwordCallback,progressCallback){var workerInitializedCapability,workerReadyCapability,transport;"string"==typeof source?source={url:source}:isArrayBuffer(source)?source={data:source}:"object"!=typeof source&&error("Invalid parameter in getDocument, need either Uint8Array, string or a parameter object"),source.url||source.data||error("Invalid parameter array, need either .data or .url");var params={};for(var key in source)params[key]="url"!==key||"undefined"==typeof window?source[key]:combineUrl(window.location.href,source[key]);return workerInitializedCapability=createPromiseCapability(),workerReadyCapability=createPromiseCapability(),transport=new WorkerTransport(workerInitializedCapability,workerReadyCapability,pdfDataRangeTransport,progressCallback),workerInitializedCapability.promise.then(function(){transport.passwordCallback=passwordCallback,transport.fetchDocument(params)}),workerReadyCapability.promise};var PDFDocumentProxy=function(){function PDFDocumentProxy(pdfInfo,transport){this.pdfInfo=pdfInfo,this.transport=transport}return PDFDocumentProxy.prototype={get numPages(){return this.pdfInfo.numPages},get fingerprint(){return this.pdfInfo.fingerprint},getPage:function(pageNumber){return this.transport.getPage(pageNumber)},getPageIndex:function(ref){return this.transport.getPageIndex(ref)},getDestinations:function(){return this.transport.getDestinations()},getAttachments:function(){return this.transport.getAttachments()},getJavaScript:function(){return this.transport.getJavaScript()},getOutline:function(){return this.transport.getOutline()},getMetadata:function(){return this.transport.getMetadata()},getData:function(){return this.transport.getData()},getDownloadInfo:function(){return this.transport.downloadInfoCapability.promise},getStats:function(){return this.transport.getStats()},cleanup:function(){this.transport.startCleanup()},destroy:function(){this.transport.destroy()}},PDFDocumentProxy}(),PDFPageProxy=function(){function PDFPageProxy(pageIndex,pageInfo,transport){this.pageIndex=pageIndex,this.pageInfo=pageInfo,this.transport=transport,this.stats=new StatTimer,this.stats.enabled=!!globalScope.PDFJS.enableStats,this.commonObjs=transport.commonObjs,this.objs=new PDFObjects,this.cleanupAfterRender=!1,this.pendingDestroy=!1,this.intentStates={}}return PDFPageProxy.prototype={get pageNumber(){return this.pageIndex+1},get rotate(){return this.pageInfo.rotate},get ref(){return this.pageInfo.ref},get view(){return this.pageInfo.view},getViewport:function(scale,rotate){return arguments.length<2&&(rotate=this.rotate),new PDFJS.PageViewport(this.view,scale,rotate,0,0)},getAnnotations:function(){if(this.annotationsPromise)return this.annotationsPromise;var promise=this.transport.getAnnotations(this.pageIndex);return this.annotationsPromise=promise,promise},render:function(params){function complete(error){var i=intentState.renderTasks.indexOf(internalRenderTask);i>=0&&intentState.renderTasks.splice(i,1),self.cleanupAfterRender&&(self.pendingDestroy=!0),self._tryDestroy(),error?internalRenderTask.capability.reject(error):internalRenderTask.capability.resolve(),stats.timeEnd("Rendering"),stats.timeEnd("Overall") }var stats=this.stats;stats.time("Overall"),this.pendingDestroy=!1;var renderingIntent="print"===params.intent?"print":"display";this.intentStates[renderingIntent]||(this.intentStates[renderingIntent]={});var intentState=this.intentStates[renderingIntent];intentState.displayReadyCapability||(intentState.receivingOperatorList=!0,intentState.displayReadyCapability=createPromiseCapability(),intentState.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.stats.time("Page Request"),this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageNumber-1,intent:renderingIntent}));var internalRenderTask=new InternalRenderTask(complete,params,this.objs,this.commonObjs,intentState.operatorList,this.pageNumber);intentState.renderTasks||(intentState.renderTasks=[]),intentState.renderTasks.push(internalRenderTask);var renderTask=new RenderTask(internalRenderTask),self=this;return intentState.displayReadyCapability.promise.then(function(transparency){return self.pendingDestroy?void complete():(stats.time("Rendering"),internalRenderTask.initalizeGraphics(transparency),void internalRenderTask.operatorListChanged())},function(reason){complete(reason)}),renderTask},getOperatorList:function(){function operatorListChanged(){intentState.operatorList.lastChunk&&intentState.opListReadCapability.resolve(intentState.operatorList)}var renderingIntent="oplist";this.intentStates[renderingIntent]||(this.intentStates[renderingIntent]={});var intentState=this.intentStates[renderingIntent];if(!intentState.opListReadCapability){var opListTask={};opListTask.operatorListChanged=operatorListChanged,intentState.receivingOperatorList=!0,intentState.opListReadCapability=createPromiseCapability(),intentState.renderTasks=[],intentState.renderTasks.push(opListTask),intentState.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this.transport.messageHandler.send("RenderPageRequest",{pageIndex:this.pageIndex,intent:renderingIntent})}return intentState.opListReadCapability.promise},getTextContent:function(){return this.transport.messageHandler.sendWithPromise("GetTextContent",{pageIndex:this.pageNumber-1})},destroy:function(){this.pendingDestroy=!0,this._tryDestroy()},_tryDestroy:function(){this.pendingDestroy&&!Object.keys(this.intentStates).some(function(intent){var intentState=this.intentStates[intent];return 0!==intentState.renderTasks.length||intentState.receivingOperatorList},this)&&(Object.keys(this.intentStates).forEach(function(intent){delete this.intentStates[intent]},this),this.objs.clear(),this.annotationsPromise=null,this.pendingDestroy=!1)},_startRenderPage:function(transparency,intent){var intentState=this.intentStates[intent];intentState.displayReadyCapability&&intentState.displayReadyCapability.resolve(transparency)},_renderPageChunk:function(operatorListChunk,intent){var i,ii,intentState=this.intentStates[intent];for(i=0,ii=operatorListChunk.length;ii>i;i++)intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]),intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);for(intentState.operatorList.lastChunk=operatorListChunk.lastChunk,i=0;iMAX_IMAGE_SIZE_TO_STORE&&(pageProxy.cleanupAfterRender=!0);break;default:error("Got unknown object type "+type)}},this),messageHandler.on("DocProgress",function(data){this.progressCallback&&this.progressCallback({loaded:data.loaded,total:data.total})},this),messageHandler.on("PageError",function(data){var page=this.pageCache[data.pageNum-1],intentState=page.intentStates[data.intent];intentState.displayReadyCapability?intentState.displayReadyCapability.reject(data.error):error(data.error)},this),messageHandler.on("JpegDecode",function(data){var imageUrl=data[0],components=data[1];return 3!==components&&1!==components?Promise.reject(new Error("Only 3 components or 1 component can be returned")):new Promise(function(resolve,reject){var img=new Image;img.onload=function(){var width=img.width,height=img.height,size=width*height,rgbaLength=4*size,buf=new Uint8Array(size*components),tmpCanvas=createScratchCanvas(width,height),tmpCtx=tmpCanvas.getContext("2d");tmpCtx.drawImage(img,0,0);var i,j,data=tmpCtx.getImageData(0,0,width,height).data;if(3===components)for(i=0,j=0;rgbaLength>i;i+=4,j+=3)buf[j]=data[i],buf[j+1]=data[i+1],buf[j+2]=data[i+2];else if(1===components)for(i=0,j=0;rgbaLength>i;i+=4,j++)buf[j]=data[i];resolve({data:buf,width:width,height:height})},img.onerror=function(){reject(new Error("JpegDecode failed to load image"))},img.src=imageUrl})})},fetchDocument:function(source){source.disableAutoFetch=PDFJS.disableAutoFetch,source.chunkedViewerLoading=!!this.pdfDataRangeTransport,this.messageHandler.send("GetDocRequest",{source:source,disableRange:PDFJS.disableRange,maxImageSize:PDFJS.maxImageSize,cMapUrl:PDFJS.cMapUrl,cMapPacked:PDFJS.cMapPacked,disableFontFace:PDFJS.disableFontFace,disableCreateObjectURL:PDFJS.disableCreateObjectURL,verbosity:PDFJS.verbosity})},getData:function(){return this.messageHandler.sendWithPromise("GetData",null)},getPage:function(pageNumber){if(0>=pageNumber||pageNumber>this.numPages||(0|pageNumber)!==pageNumber)return Promise.reject(new Error("Invalid page request"));var pageIndex=pageNumber-1;if(pageIndex in this.pagePromises)return this.pagePromises[pageIndex];var promise=this.messageHandler.sendWithPromise("GetPage",{pageIndex:pageIndex}).then(function(pageInfo){var page=new PDFPageProxy(pageIndex,pageInfo,this);return this.pageCache[pageIndex]=page,page}.bind(this));return this.pagePromises[pageIndex]=promise,promise},getPageIndex:function(ref){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:ref})},getAnnotations:function(pageIndex){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:pageIndex})},getDestinations:function(){return this.messageHandler.sendWithPromise("GetDestinations",null)},getAttachments:function(){return this.messageHandler.sendWithPromise("GetAttachments",null)},getJavaScript:function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)},getOutline:function(){return this.messageHandler.sendWithPromise("GetOutline",null)},getMetadata:function(){return this.messageHandler.sendWithPromise("GetMetadata",null).then(function(results){return{info:results[0],metadata:results[1]?new PDFJS.Metadata(results[1]):null}})},getStats:function(){return this.messageHandler.sendWithPromise("GetStats",null)},startCleanup:function(){this.messageHandler.sendWithPromise("Cleanup",null).then(function(){for(var i=0,ii=this.pageCache.length;ii>i;i++){var page=this.pageCache[i];page&&page.destroy()}this.commonObjs.clear(),FontLoader.clear()}.bind(this))}},WorkerTransport}(),PDFObjects=function(){function PDFObjects(){this.objs={}}return PDFObjects.prototype={ensureObj:function(objId){if(this.objs[objId])return this.objs[objId];var obj={capability:createPromiseCapability(),data:null,resolved:!1};return this.objs[objId]=obj,obj},get:function(objId,callback){if(callback)return this.ensureObj(objId).capability.promise.then(callback),null;var obj=this.objs[objId];return obj&&obj.resolved||error("Requesting object that isn't resolved yet "+objId),obj.data},resolve:function(objId,data){var obj=this.ensureObj(objId);obj.resolved=!0,obj.data=data,obj.capability.resolve(data)},isResolved:function(objId){var objs=this.objs;return objs[objId]?objs[objId].resolved:!1},hasData:function(objId){return this.isResolved(objId)},getData:function(objId){var objs=this.objs;return objs[objId]&&objs[objId].resolved?objs[objId].data:null},clear:function(){this.objs={}}},PDFObjects}(),RenderTask=function(){function RenderTask(internalRenderTask){this.internalRenderTask=internalRenderTask,this.promise=this.internalRenderTask.capability.promise}return RenderTask.prototype={cancel:function(){this.internalRenderTask.cancel()},then:function(onFulfilled,onRejected){return this.promise.then(onFulfilled,onRejected)}},RenderTask}(),InternalRenderTask=function(){function InternalRenderTask(callback,params,objs,commonObjs,operatorList,pageNumber){this.callback=callback,this.params=params,this.objs=objs,this.commonObjs=commonObjs,this.operatorListIdx=null,this.operatorList=operatorList,this.pageNumber=pageNumber,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this.cancelled=!1,this.capability=createPromiseCapability(),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this)}return InternalRenderTask.prototype={initalizeGraphics:function(transparency){if(!this.cancelled){PDFJS.pdfBug&&"StepperManager"in globalScope&&globalScope.StepperManager.enabled&&(this.stepper=globalScope.StepperManager.create(this.pageNumber-1),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());var params=this.params;this.gfx=new CanvasGraphics(params.canvasContext,this.commonObjs,this.objs,params.imageLayer),this.gfx.beginDrawing(params.viewport,transparency),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback&&this.graphicsReadyCallback()}},cancel:function(){this.running=!1,this.cancelled=!0,this.callback("cancelled")},operatorListChanged:function(){return this.graphicsReady?(this.stepper&&this.stepper.updateOperatorList(this.operatorList),void(this.running||this._continue())):void(this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound))},_continue:function(){this.running=!0,this.cancelled||(this.params.continueCallback?this.params.continueCallback(this._scheduleNextBound):this._scheduleNext())},_scheduleNext:function(){window.requestAnimationFrame(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())))}},InternalRenderTask}(),MIN_FONT_SIZE=(PDFJS.Metadata=function(){function fixMetadata(meta){return meta.replace(/>\\376\\377([^<]+)/g,function(all,codes){for(var bytes=codes.replace(/\\([0-3])([0-7])([0-7])/g,function(code,d1,d2,d3){return String.fromCharCode(64*d1+8*d2+1*d3)}),chars="",i=0;i"+chars})}function Metadata(meta){if("string"==typeof meta){meta=fixMetadata(meta);var parser=new DOMParser;meta=parser.parseFromString(meta,"application/xml")}else meta instanceof Document||error("Metadata: Invalid metadata object");this.metaDocument=meta,this.metadata={},this.parse()}return Metadata.prototype={parse:function(){var doc=this.metaDocument,rdf=doc.documentElement;if("rdf:rdf"!==rdf.nodeName.toLowerCase())for(rdf=rdf.firstChild;rdf&&"rdf:rdf"!==rdf.nodeName.toLowerCase();)rdf=rdf.nextSibling;var nodeName=rdf?rdf.nodeName.toLowerCase():null;if(rdf&&"rdf:rdf"===nodeName&&rdf.hasChildNodes()){var desc,entry,name,i,ii,length,iLength,children=rdf.childNodes;for(i=0,length=children.length;length>i;i++)if(desc=children[i],"rdf:description"===desc.nodeName.toLowerCase())for(ii=0,iLength=desc.childNodes.length;iLength>ii;ii++)"#text"!==desc.childNodes[ii].nodeName.toLowerCase()&&(entry=desc.childNodes[ii],name=entry.nodeName.toLowerCase(),this.metadata[name]=entry.textContent.trim())}},get:function(name){return this.metadata[name]||null},has:function(name){return"undefined"!=typeof this.metadata[name]}},Metadata}(),16),MAX_GROUP_SIZE=4096,COMPILE_TYPE3_GLYPHS=!0,CachedCanvases=function(){var cache={};return{getCanvas:function(id,width,height,trackTransform){var canvasEntry;if(id in cache)canvasEntry=cache[id],canvasEntry.canvas.width=width,canvasEntry.canvas.height=height,canvasEntry.context.setTransform(1,0,0,1,0,0);else{var canvas=createScratchCanvas(width,height),ctx=canvas.getContext("2d");trackTransform&&addContextCurrentTransform(ctx),cache[id]=canvasEntry={canvas:canvas,context:ctx}}return canvasEntry},clear:function(){for(var id in cache){var canvasEntry=cache[id];canvasEntry.canvas.width=0,canvasEntry.canvas.height=0,delete cache[id]}}}}(),CanvasExtraState=function(){function CanvasExtraState(old){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=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.textRenderingMode=TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.old=old}return CanvasExtraState.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(x,y){this.x=x,this.y=y}},CanvasExtraState}(),CanvasGraphics=function(){function CanvasGraphics(canvasCtx,commonObjs,objs,imageLayer){this.ctx=canvasCtx,this.current=new CanvasExtraState,this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=commonObjs,this.objs=objs,this.imageLayer=imageLayer,this.groupStack=[],this.processingType3=null,this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,canvasCtx&&addContextCurrentTransform(canvasCtx)}function putBinaryImageData(ctx,imgData){if("undefined"!=typeof ImageData&&imgData instanceof ImageData)return void ctx.putImageData(imgData,0,0);var destPos,i,j,thisChunkHeight,elemsInThisChunk,height=imgData.height,width=imgData.width,fullChunkHeight=16,fracChunks=height/fullChunkHeight,fullChunks=Math.floor(fracChunks),totalChunks=Math.ceil(fracChunks),partialChunkHeight=height-fullChunks*fullChunkHeight,chunkImgData=ctx.createImageData(width,fullChunkHeight),srcPos=0,src=imgData.data,dest=chunkImgData.data;if(imgData.kind===ImageKind.GRAYSCALE_1BPP){var srcLength=src.byteLength,dest32=PDFJS.hasCanvasTypedArrays?new Uint32Array(dest.buffer):new Uint32ArrayView(dest),dest32DataLength=dest32.length,fullSrcDiff=width+7>>3,white=4294967295,black=PDFJS.isLittleEndian||!PDFJS.hasCanvasTypedArrays?4278190080:255;for(i=0;totalChunks>i;i++){for(thisChunkHeight=fullChunks>i?fullChunkHeight:partialChunkHeight,destPos=0,j=0;thisChunkHeight>j;j++){for(var srcDiff=srcLength-srcPos,k=0,kEnd=srcDiff>fullSrcDiff?width:8*srcDiff-7,kEndUnrolled=-8&kEnd,mask=0,srcByte=0;kEndUnrolled>k;k+=8)srcByte=src[srcPos++],dest32[destPos++]=128&srcByte?white:black,dest32[destPos++]=64&srcByte?white:black,dest32[destPos++]=32&srcByte?white:black,dest32[destPos++]=16&srcByte?white:black,dest32[destPos++]=8&srcByte?white:black,dest32[destPos++]=4&srcByte?white:black,dest32[destPos++]=2&srcByte?white:black,dest32[destPos++]=1&srcByte?white:black;for(;kEnd>k;k++)0===mask&&(srcByte=src[srcPos++],mask=128),dest32[destPos++]=srcByte&mask?white:black,mask>>=1}for(;dest32DataLength>destPos;)dest32[destPos++]=0;ctx.putImageData(chunkImgData,0,i*fullChunkHeight)}}else if(imgData.kind===ImageKind.RGBA_32BPP){for(j=0,elemsInThisChunk=width*fullChunkHeight*4,i=0;fullChunks>i;i++)dest.set(src.subarray(srcPos,srcPos+elemsInThisChunk)),srcPos+=elemsInThisChunk,ctx.putImageData(chunkImgData,0,j),j+=fullChunkHeight;totalChunks>i&&(elemsInThisChunk=width*partialChunkHeight*4,dest.set(src.subarray(srcPos,srcPos+elemsInThisChunk)),ctx.putImageData(chunkImgData,0,j))}else if(imgData.kind===ImageKind.RGB_24BPP)for(thisChunkHeight=fullChunkHeight,elemsInThisChunk=width*thisChunkHeight,i=0;totalChunks>i;i++){for(i>=fullChunks&&(thisChunkHeight=partialChunkHeight,elemsInThisChunk=width*thisChunkHeight),destPos=0,j=elemsInThisChunk;j--;)dest[destPos++]=src[srcPos++],dest[destPos++]=src[srcPos++],dest[destPos++]=src[srcPos++],dest[destPos++]=255;ctx.putImageData(chunkImgData,0,i*fullChunkHeight)}else error("bad image kind: "+imgData.kind)}function putBinaryImageMask(ctx,imgData){for(var height=imgData.height,width=imgData.width,fullChunkHeight=16,fracChunks=height/fullChunkHeight,fullChunks=Math.floor(fracChunks),totalChunks=Math.ceil(fracChunks),partialChunkHeight=height-fullChunks*fullChunkHeight,chunkImgData=ctx.createImageData(width,fullChunkHeight),srcPos=0,src=imgData.data,dest=chunkImgData.data,i=0;totalChunks>i;i++){for(var thisChunkHeight=fullChunks>i?fullChunkHeight:partialChunkHeight,destPos=3,j=0;thisChunkHeight>j;j++)for(var mask=0,k=0;width>k;k++){if(!mask){var elem=src[srcPos++];mask=128}dest[destPos]=elem&mask?0:255,destPos+=4,mask>>=1}ctx.putImageData(chunkImgData,0,i*fullChunkHeight)}}function copyCtxState(sourceCtx,destCtx){for(var properties=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],i=0,ii=properties.length;ii>i;i++){var property=properties[i];property in sourceCtx&&(destCtx[property]=sourceCtx[property])}"setLineDash"in sourceCtx?(destCtx.setLineDash(sourceCtx.getLineDash()),destCtx.lineDashOffset=sourceCtx.lineDashOffset):"mozDash"in sourceCtx&&(destCtx.mozDash=sourceCtx.mozDash,destCtx.mozDashOffset=sourceCtx.mozDashOffset)}function composeSMaskBackdrop(bytes,r0,g0,b0){for(var length=bytes.length,i=3;length>i;i+=4){var alpha=bytes[i];if(0===alpha)bytes[i-3]=r0,bytes[i-2]=g0,bytes[i-1]=b0;else if(255>alpha){var alpha_=255-alpha;bytes[i-3]=bytes[i-3]*alpha+r0*alpha_>>8,bytes[i-2]=bytes[i-2]*alpha+g0*alpha_>>8,bytes[i-1]=bytes[i-1]*alpha+b0*alpha_>>8}}}function composeSMaskAlpha(maskData,layerData){for(var length=maskData.length,scale=1/255,i=3;length>i;i+=4){var alpha=maskData[i];layerData[i]=layerData[i]*alpha*scale|0}}function composeSMaskLuminosity(maskData,layerData){for(var length=maskData.length,i=3;length>i;i+=4){var y=77*maskData[i-3]+152*maskData[i-2]+28*maskData[i-1]|0;layerData[i]=layerData[i]*y>>16}}function genericComposeSMask(maskCtx,layerCtx,width,height,subtype,backdrop){var composeFn,hasBackdrop=!!backdrop,r0=hasBackdrop?backdrop[0]:0,g0=hasBackdrop?backdrop[1]:0,b0=hasBackdrop?backdrop[2]:0;composeFn="Luminosity"===subtype?composeSMaskLuminosity:composeSMaskAlpha;for(var PIXELS_TO_PROCESS=65536,chunkSize=Math.min(height,Math.ceil(PIXELS_TO_PROCESS/width)),row=0;height>row;row+=chunkSize){var chunkHeight=Math.min(chunkSize,height-row),maskData=maskCtx.getImageData(0,row,width,chunkHeight),layerData=layerCtx.getImageData(0,row,width,chunkHeight);hasBackdrop&&composeSMaskBackdrop(maskData.data,r0,g0,b0),composeFn(maskData.data,layerData.data),maskCtx.putImageData(layerData,0,row)}}function composeSMask(ctx,smask,layerCtx){var mask=smask.canvas,maskCtx=smask.context;ctx.setTransform(smask.scaleX,0,0,smask.scaleY,smask.offsetX,smask.offsetY);var backdrop=smask.backdrop||null;if(WebGLUtils.isEnabled){var composed=WebGLUtils.composeSMask(layerCtx.canvas,mask,{subtype:smask.subtype,backdrop:backdrop});return ctx.setTransform(1,0,0,1,0,0),void ctx.drawImage(composed,smask.offsetX,smask.offsetY)}genericComposeSMask(maskCtx,layerCtx,mask.width,mask.height,smask.subtype,backdrop),ctx.drawImage(mask,0,0)}var EXECUTION_TIME=15,EXECUTION_STEPS=10,LINE_CAP_STYLES=["butt","round","square"],LINE_JOIN_STYLES=["miter","round","bevel"],NORMAL_CLIP={},EO_CLIP={};CanvasGraphics.prototype={beginDrawing:function(viewport,transparency){var width=this.ctx.canvas.width,height=this.ctx.canvas.height;transparency?this.ctx.clearRect(0,0,width,height):(this.ctx.mozOpaque=!0,this.ctx.save(),this.ctx.fillStyle="rgb(255, 255, 255)",this.ctx.fillRect(0,0,width,height),this.ctx.restore());var transform=viewport.transform;this.ctx.save(),this.ctx.transform.apply(this.ctx,transform),this.baseTransform=this.ctx.mozCurrentTransform.slice(),this.imageLayer&&this.imageLayer.beginLayout()},executeOperatorList:function(operatorList,executionStartIdx,continueCallback,stepper){var argsArray=operatorList.argsArray,fnArray=operatorList.fnArray,i=executionStartIdx||0,argsArrayLen=argsArray.length;if(argsArrayLen===i)return i;for(var fnId,chunkOperations=argsArrayLen-i>EXECUTION_STEPS&&"function"==typeof continueCallback,endTime=chunkOperations?Date.now()+EXECUTION_TIME:0,steps=0,commonObjs=this.commonObjs,objs=this.objs;;){if(void 0!==stepper&&i===stepper.nextBreakPoint)return stepper.breakIt(i,continueCallback),i;if(fnId=fnArray[i],fnId!==OPS.dependency)this[fnId].apply(this,argsArray[i]);else for(var deps=argsArray[i],n=0,nn=deps.length;nn>n;n++){var depObjId=deps[n],common="g"===depObjId[0]&&"_"===depObjId[1],objsPool=common?commonObjs:objs;if(!objsPool.isResolved(depObjId))return objsPool.get(depObjId,continueCallback),i}if(i++,i===argsArrayLen)return i;if(chunkOperations&&++steps>EXECUTION_STEPS){if(Date.now()>endTime)return continueCallback(),i;steps=0}}},endDrawing:function(){this.ctx.restore(),CachedCanvases.clear(),WebGLUtils.clear(),this.imageLayer&&this.imageLayer.endLayout()},setLineWidth:function(width){this.current.lineWidth=width,this.ctx.lineWidth=width},setLineCap:function(style){this.ctx.lineCap=LINE_CAP_STYLES[style]},setLineJoin:function(style){this.ctx.lineJoin=LINE_JOIN_STYLES[style]},setMiterLimit:function(limit){this.ctx.miterLimit=limit},setDash:function(dashArray,dashPhase){var ctx=this.ctx;"setLineDash"in ctx?(ctx.setLineDash(dashArray),ctx.lineDashOffset=dashPhase):(ctx.mozDash=dashArray,ctx.mozDashOffset=dashPhase)},setRenderingIntent:function(){},setFlatness:function(){},setGState:function(states){for(var i=0,ii=states.length;ii>i;i++){var state=states[i],key=state[0],value=state[1];switch(key){case"LW":this.setLineWidth(value);break;case"LC":this.setLineCap(value);break;case"LJ":this.setLineJoin(value);break;case"ML":this.setMiterLimit(value);break;case"D":this.setDash(value[0],value[1]);break;case"RI":this.setRenderingIntent(value);break;case"FL":this.setFlatness(value);break;case"Font":this.setFont(value[0],value[1]);break;case"CA":this.current.strokeAlpha=state[1];break;case"ca":this.current.fillAlpha=state[1],this.ctx.globalAlpha=state[1];break;case"BM":if(value&&value.name&&"Normal"!==value.name){var mode=value.name.replace(/([A-Z])/g,function(c){return"-"+c.toLowerCase()}).substring(1);this.ctx.globalCompositeOperation=mode,this.ctx.globalCompositeOperation!==mode&&warn('globalCompositeOperation "'+mode+'" is not supported')}else this.ctx.globalCompositeOperation="source-over";break;case"SMask":this.current.activeSMask&&this.endSMaskGroup(),this.current.activeSMask=value?this.tempSMask:null,this.current.activeSMask&&this.beginSMaskGroup(),this.tempSMask=null}}},beginSMaskGroup:function(){var activeSMask=this.current.activeSMask,drawnWidth=activeSMask.canvas.width,drawnHeight=activeSMask.canvas.height,cacheId="smaskGroupAt"+this.groupLevel,scratchCanvas=CachedCanvases.getCanvas(cacheId,drawnWidth,drawnHeight,!0),currentCtx=this.ctx,currentTransform=currentCtx.mozCurrentTransform;this.ctx.save();var groupCtx=scratchCanvas.context;groupCtx.scale(1/activeSMask.scaleX,1/activeSMask.scaleY),groupCtx.translate(-activeSMask.offsetX,-activeSMask.offsetY),groupCtx.transform.apply(groupCtx,currentTransform),copyCtxState(currentCtx,groupCtx),this.ctx=groupCtx,this.setGState([["BM","Normal"],["ca",1],["CA",1]]),this.groupStack.push(currentCtx),this.groupLevel++},endSMaskGroup:function(){var groupCtx=this.ctx;this.groupLevel--,this.ctx=this.groupStack.pop(),composeSMask(this.ctx,this.current.activeSMask,groupCtx),this.ctx.restore()},save:function(){this.ctx.save();var old=this.current;this.stateStack.push(old),this.current=old.clone(),this.current.activeSMask=null},restore:function(){0!==this.stateStack.length&&(null!==this.current.activeSMask&&this.endSMaskGroup(),this.current=this.stateStack.pop(),this.ctx.restore())},transform:function(a,b,c,d,e,f){this.ctx.transform(a,b,c,d,e,f)},constructPath:function(ops,args){for(var ctx=this.ctx,current=this.current,x=current.x,y=current.y,i=0,j=0,ii=ops.length;ii>i;i++)switch(0|ops[i]){case OPS.rectangle:x=args[j++],y=args[j++];var width=args[j++],height=args[j++];0===width&&(width=this.getSinglePixelWidth()),0===height&&(height=this.getSinglePixelWidth());var xw=x+width,yh=y+height;this.ctx.moveTo(x,y),this.ctx.lineTo(xw,y),this.ctx.lineTo(xw,yh),this.ctx.lineTo(x,yh),this.ctx.lineTo(x,y),this.ctx.closePath();break;case OPS.moveTo:x=args[j++],y=args[j++],ctx.moveTo(x,y);break;case OPS.lineTo:x=args[j++],y=args[j++],ctx.lineTo(x,y);break;case OPS.curveTo:x=args[j+4],y=args[j+5],ctx.bezierCurveTo(args[j],args[j+1],args[j+2],args[j+3],x,y),j+=6;break;case OPS.curveTo2:ctx.bezierCurveTo(x,y,args[j],args[j+1],args[j+2],args[j+3]),x=args[j+2],y=args[j+3],j+=4;break;case OPS.curveTo3:x=args[j+2],y=args[j+3],ctx.bezierCurveTo(args[j],args[j+1],x,y,x,y),j+=4;break;case OPS.closePath:ctx.closePath()}current.setCurrentPoint(x,y)},closePath:function(){this.ctx.closePath()},stroke:function(consumePath){consumePath="undefined"!=typeof consumePath?consumePath:!0;var ctx=this.ctx,strokeColor=this.current.strokeColor;0===this.current.lineWidth&&(ctx.lineWidth=this.getSinglePixelWidth()),ctx.globalAlpha=this.current.strokeAlpha,strokeColor&&strokeColor.hasOwnProperty("type")&&"Pattern"===strokeColor.type?(ctx.save(),ctx.strokeStyle=strokeColor.getPattern(ctx,this),ctx.stroke(),ctx.restore()):ctx.stroke(),consumePath&&this.consumePath(),ctx.globalAlpha=this.current.fillAlpha},closeStroke:function(){this.closePath(),this.stroke()},fill:function(consumePath){consumePath="undefined"!=typeof consumePath?consumePath:!0;var ctx=this.ctx,fillColor=this.current.fillColor,needRestore=!1;if(fillColor&&fillColor.hasOwnProperty("type")&&"Pattern"===fillColor.type&&(ctx.save(),ctx.fillStyle=fillColor.getPattern(ctx,this),needRestore=!0),this.pendingEOFill){if(void 0!==ctx.mozFillRule)ctx.mozFillRule="evenodd",ctx.fill(),ctx.mozFillRule="nonzero";else try{ctx.fill("evenodd")}catch(ex){ctx.fill()}this.pendingEOFill=!1}else ctx.fill();needRestore&&ctx.restore(),consumePath&&this.consumePath()},eoFill:function(){this.pendingEOFill=!0,this.fill()},fillStroke:function(){this.fill(!1),this.stroke(!1),this.consumePath()},eoFillStroke:function(){this.pendingEOFill=!0,this.fillStroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},closeEOFillStroke:function(){this.pendingEOFill=!0,this.closePath(),this.fillStroke()},endPath:function(){this.consumePath()},clip:function(){this.pendingClip=NORMAL_CLIP},eoClip:function(){this.pendingClip=EO_CLIP },beginText:function(){this.current.textMatrix=IDENTITY_MATRIX,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},endText:function(){var paths=this.pendingTextPaths,ctx=this.ctx;if(void 0===paths)return void ctx.beginPath();ctx.save(),ctx.beginPath();for(var i=0;isize?(size=-size,current.fontDirection=-1):current.fontDirection=1,this.current.font=fontObj,this.current.fontSize=size,!fontObj.isType3Font){var name=fontObj.loadedName||"sans-serif",bold=fontObj.black?fontObj.bold?"bolder":"bold":fontObj.bold?"bold":"normal",italic=fontObj.italic?"italic":"normal",typeface='"'+name+'", '+fontObj.fallbackName,browserFontSize=size>=MIN_FONT_SIZE?size:MIN_FONT_SIZE;this.current.fontSizeScale=browserFontSize!==MIN_FONT_SIZE?1:size/MIN_FONT_SIZE;var rule=italic+" "+bold+" "+browserFontSize+"px "+typeface;this.ctx.font=rule}},setTextRenderingMode:function(mode){this.current.textRenderingMode=mode},setTextRise:function(rise){this.current.textRise=rise},moveText:function(x,y){this.current.x=this.current.lineX+=x,this.current.y=this.current.lineY+=y},setLeadingMoveText:function(x,y){this.setLeading(-y),this.moveText(x,y)},setTextMatrix:function(a,b,c,d,e,f){this.current.textMatrix=[a,b,c,d,e,f],this.current.textMatrixScale=Math.sqrt(a*a+b*b),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0},nextLine:function(){this.moveText(0,this.current.leading)},paintChar:function(character,x,y){var addToPath,ctx=this.ctx,current=this.current,font=current.font,textRenderingMode=current.textRenderingMode,fontSize=current.fontSize/current.fontSizeScale,fillStrokeMode=textRenderingMode&TextRenderingMode.FILL_STROKE_MASK,isAddToPathSet=!!(textRenderingMode&TextRenderingMode.ADD_TO_PATH_FLAG);if((font.disableFontFace||isAddToPathSet)&&(addToPath=font.getPathGenerator(this.commonObjs,character)),font.disableFontFace?(ctx.save(),ctx.translate(x,y),ctx.beginPath(),addToPath(ctx,fontSize),(fillStrokeMode===TextRenderingMode.FILL||fillStrokeMode===TextRenderingMode.FILL_STROKE)&&ctx.fill(),(fillStrokeMode===TextRenderingMode.STROKE||fillStrokeMode===TextRenderingMode.FILL_STROKE)&&ctx.stroke(),ctx.restore()):((fillStrokeMode===TextRenderingMode.FILL||fillStrokeMode===TextRenderingMode.FILL_STROKE)&&ctx.fillText(character,x,y),(fillStrokeMode===TextRenderingMode.STROKE||fillStrokeMode===TextRenderingMode.FILL_STROKE)&&ctx.strokeText(character,x,y)),isAddToPathSet){var paths=this.pendingTextPaths||(this.pendingTextPaths=[]);paths.push({transform:ctx.mozCurrentTransform,x:x,y:y,fontSize:fontSize,addToPath:addToPath})}},get isFontSubpixelAAEnabled(){var ctx=document.createElement("canvas").getContext("2d");ctx.scale(1.5,1),ctx.fillText("I",0,10);for(var data=ctx.getImageData(0,0,10,10).data,enabled=!1,i=3;i0&&data[i]<255){enabled=!0;break}return shadow(this,"isFontSubpixelAAEnabled",enabled)},showText:function(glyphs){var current=this.current,font=current.font;if(font.isType3Font)return this.showType3Text(glyphs);var fontSize=current.fontSize;if(0!==fontSize){var ctx=this.ctx,fontSizeScale=current.fontSizeScale,charSpacing=current.charSpacing,wordSpacing=current.wordSpacing,fontDirection=current.fontDirection,textHScale=current.textHScale*fontDirection,glyphsLength=glyphs.length,vertical=font.vertical,defaultVMetrics=font.defaultVMetrics,widthAdvanceScale=fontSize*current.fontMatrix[0],simpleFillText=current.textRenderingMode===TextRenderingMode.FILL&&!font.disableFontFace;ctx.save(),ctx.transform.apply(ctx,current.textMatrix),ctx.translate(current.x,current.y+current.textRise),fontDirection>0?ctx.scale(textHScale,-1):ctx.scale(textHScale,1);var lineWidth=current.lineWidth,scale=current.textMatrixScale;0===scale||0===lineWidth?lineWidth=this.getSinglePixelWidth():lineWidth/=scale,1!==fontSizeScale&&(ctx.scale(fontSizeScale,fontSizeScale),lineWidth/=fontSizeScale),ctx.lineWidth=lineWidth;var i,x=0;for(i=0;glyphsLength>i;++i){var glyph=glyphs[i];if(null!==glyph)if(isNum(glyph))x+=-glyph*fontSize*.001;else{var scaledX,scaledY,scaledAccentX,scaledAccentY,restoreNeeded=!1,character=glyph.fontChar,accent=glyph.accent,width=glyph.width;if(vertical){var vmetric,vx,vy;vmetric=glyph.vmetric||defaultVMetrics,vx=glyph.vmetric?vmetric[1]:.5*width,vx=-vx*widthAdvanceScale,vy=vmetric[2]*widthAdvanceScale,width=vmetric?-vmetric[0]:width,scaledX=vx/fontSizeScale,scaledY=(x+vy)/fontSizeScale}else scaledX=x/fontSizeScale,scaledY=0;if(font.remeasure&&width>0&&this.isFontSubpixelAAEnabled){var measuredWidth=1e3*ctx.measureText(character).width/fontSize*fontSizeScale,characterScaleX=width/measuredWidth;restoreNeeded=!0,ctx.save(),ctx.scale(characterScaleX,1),scaledX/=characterScaleX}simpleFillText&&!accent?ctx.fillText(character,scaledX,scaledY):(this.paintChar(character,scaledX,scaledY),accent&&(scaledAccentX=scaledX+accent.offset.x/fontSizeScale,scaledAccentY=scaledY-accent.offset.y/fontSizeScale,this.paintChar(accent.fontChar,scaledAccentX,scaledAccentY)));var charWidth=width*widthAdvanceScale+charSpacing*fontDirection;x+=charWidth,restoreNeeded&&ctx.restore()}else x+=fontDirection*wordSpacing}vertical?current.y-=x*textHScale:current.x+=x*textHScale,ctx.restore()}},showType3Text:function(glyphs){var i,glyph,width,ctx=this.ctx,current=this.current,font=current.font,fontSize=current.fontSize,fontDirection=current.fontDirection,charSpacing=current.charSpacing,wordSpacing=current.wordSpacing,textHScale=current.textHScale*fontDirection,fontMatrix=current.fontMatrix||FONT_IDENTITY_MATRIX,glyphsLength=glyphs.length;if(0!==fontSize){for(ctx.save(),ctx.transform.apply(ctx,current.textMatrix),ctx.translate(current.x,current.y),ctx.scale(textHScale,fontDirection),i=0;glyphsLength>i;++i)if(glyph=glyphs[i],null!==glyph)if(isNum(glyph)){var spacingLength=.001*-glyph*fontSize;this.ctx.translate(spacingLength,0),current.x+=spacingLength*textHScale}else{var operatorList=font.charProcOperatorList[glyph.operatorListId];if(operatorList){this.processingType3=glyph,this.save(),ctx.scale(fontSize,fontSize),ctx.transform.apply(ctx,fontMatrix),this.executeOperatorList(operatorList),this.restore();var transformed=Util.applyTransform([glyph.width,0],fontMatrix);width=transformed[0]*fontSize+charSpacing,ctx.translate(width,0),current.x+=width*textHScale}else warn('Type3 character "'+glyph.operatorListId+'" is not available')}else this.ctx.translate(wordSpacing,0),current.x+=wordSpacing*textHScale;ctx.restore(),this.processingType3=null}},setCharWidth:function(){},setCharWidthAndBounds:function(xWidth,yWidth,llx,lly,urx,ury){this.ctx.rect(llx,lly,urx-llx,ury-lly),this.clip(),this.endPath()},getColorN_Pattern:function(IR){var pattern;if("TilingPattern"===IR[0]){var color=IR[1];pattern=new TilingPattern(IR,color,this.ctx,this.objs,this.commonObjs,this.baseTransform)}else pattern=getShadingPatternFromIR(IR);return pattern},setStrokeColorN:function(){this.current.strokeColor=this.getColorN_Pattern(arguments)},setFillColorN:function(){this.current.fillColor=this.getColorN_Pattern(arguments)},setStrokeRGBColor:function(){var color=Util.makeCssRgb(arguments);this.ctx.strokeStyle=color,this.current.strokeColor=color},setFillRGBColor:function(){var color=Util.makeCssRgb(arguments);this.ctx.fillStyle=color,this.current.fillColor=color},shadingFill:function(patternIR){var ctx=this.ctx;this.save();var pattern=getShadingPatternFromIR(patternIR);ctx.fillStyle=pattern.getPattern(ctx,this,!0);var inv=ctx.mozCurrentTransformInverse;if(inv){var canvas=ctx.canvas,width=canvas.width,height=canvas.height,bl=Util.applyTransform([0,0],inv),br=Util.applyTransform([0,height],inv),ul=Util.applyTransform([width,0],inv),ur=Util.applyTransform([width,height],inv),x0=Math.min(bl[0],br[0],ul[0],ur[0]),y0=Math.min(bl[1],br[1],ul[1],ur[1]),x1=Math.max(bl[0],br[0],ul[0],ur[0]),y1=Math.max(bl[1],br[1],ul[1],ur[1]);this.ctx.fillRect(x0,y0,x1-x0,y1-y0)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.restore()},beginInlineImage:function(){error("Should not call beginInlineImage")},beginImageData:function(){error("Should not call beginImageData")},paintFormXObjectBegin:function(matrix,bbox){if(this.save(),this.baseTransformStack.push(this.baseTransform),isArray(matrix)&&6===matrix.length&&this.transform.apply(this,matrix),this.baseTransform=this.ctx.mozCurrentTransform,isArray(bbox)&&4===bbox.length){var width=bbox[2]-bbox[0],height=bbox[3]-bbox[1];this.ctx.rect(bbox[0],bbox[1],width,height),this.clip(),this.endPath()}},paintFormXObjectEnd:function(){this.restore(),this.baseTransform=this.baseTransformStack.pop()},beginGroup:function(group){this.save();var currentCtx=this.ctx;group.isolated||info("TODO: Support non-isolated groups."),group.knockout&&warn("Knockout groups not supported.");var currentTransform=currentCtx.mozCurrentTransform;group.matrix&¤tCtx.transform.apply(currentCtx,group.matrix),assert(group.bbox,"Bounding box is required.");var bounds=Util.getAxialAlignedBoundingBox(group.bbox,currentCtx.mozCurrentTransform),canvasBounds=[0,0,currentCtx.canvas.width,currentCtx.canvas.height];bounds=Util.intersect(bounds,canvasBounds)||[0,0,0,0];var offsetX=Math.floor(bounds[0]),offsetY=Math.floor(bounds[1]),drawnWidth=Math.max(Math.ceil(bounds[2])-offsetX,1),drawnHeight=Math.max(Math.ceil(bounds[3])-offsetY,1),scaleX=1,scaleY=1;drawnWidth>MAX_GROUP_SIZE&&(scaleX=drawnWidth/MAX_GROUP_SIZE,drawnWidth=MAX_GROUP_SIZE),drawnHeight>MAX_GROUP_SIZE&&(scaleY=drawnHeight/MAX_GROUP_SIZE,drawnHeight=MAX_GROUP_SIZE);var cacheId="groupAt"+this.groupLevel;group.smask&&(cacheId+="_smask_"+this.smaskCounter++%2);var scratchCanvas=CachedCanvases.getCanvas(cacheId,drawnWidth,drawnHeight,!0),groupCtx=scratchCanvas.context;groupCtx.scale(1/scaleX,1/scaleY),groupCtx.translate(-offsetX,-offsetY),groupCtx.transform.apply(groupCtx,currentTransform),group.smask?this.smaskStack.push({canvas:scratchCanvas.canvas,context:groupCtx,offsetX:offsetX,offsetY:offsetY,scaleX:scaleX,scaleY:scaleY,subtype:group.smask.subtype,backdrop:group.smask.backdrop}):(currentCtx.setTransform(1,0,0,1,0,0),currentCtx.translate(offsetX,offsetY),currentCtx.scale(scaleX,scaleY)),copyCtxState(currentCtx,groupCtx),this.ctx=groupCtx,this.setGState([["BM","Normal"],["ca",1],["CA",1]]),this.groupStack.push(currentCtx),this.groupLevel++},endGroup:function(group){this.groupLevel--;var groupCtx=this.ctx;this.ctx=this.groupStack.pop(),void 0!==this.ctx.imageSmoothingEnabled?this.ctx.imageSmoothingEnabled=!1:this.ctx.mozImageSmoothingEnabled=!1,group.smask?this.tempSMask=this.smaskStack.pop():this.ctx.drawImage(groupCtx.canvas,0,0),this.restore()},beginAnnotations:function(){this.save(),this.current=new CanvasExtraState},endAnnotations:function(){this.restore()},beginAnnotation:function(rect,transform,matrix){if(this.save(),isArray(rect)&&4===rect.length){var width=rect[2]-rect[0],height=rect[3]-rect[1];this.ctx.rect(rect[0],rect[1],width,height),this.clip(),this.endPath()}this.transform.apply(this,transform),this.transform.apply(this,matrix)},endAnnotation:function(){this.restore()},paintJpegXObject:function(objId,w,h){var domImage=this.objs.get(objId);if(!domImage)return void warn("Dependent image isn't ready yet");this.save();var ctx=this.ctx;if(ctx.scale(1/w,-1/h),ctx.drawImage(domImage,0,0,domImage.width,domImage.height,0,-h,w,h),this.imageLayer){var currentTransform=ctx.mozCurrentTransformInverse,position=this.getCanvasPosition(0,0);this.imageLayer.appendImage({objId:objId,left:position[0],top:position[1],width:w/currentTransform[0],height:h/currentTransform[3]})}this.restore()},paintImageMaskXObject:function(img){var ctx=this.ctx,width=img.width,height=img.height,glyph=this.processingType3;if(COMPILE_TYPE3_GLYPHS&&glyph&&!("compiled"in glyph)){var MAX_SIZE_TO_COMPILE=1e3;glyph.compiled=MAX_SIZE_TO_COMPILE>=width&&MAX_SIZE_TO_COMPILE>=height?compileType3Glyph({data:img.data,width:width,height:height}):null}if(glyph&&glyph.compiled)return void glyph.compiled(ctx);var maskCanvas=CachedCanvases.getCanvas("maskCanvas",width,height),maskCtx=maskCanvas.context;maskCtx.save(),putBinaryImageMask(maskCtx,img),maskCtx.globalCompositeOperation="source-in";var fillColor=this.current.fillColor;maskCtx.fillStyle=fillColor&&fillColor.hasOwnProperty("type")&&"Pattern"===fillColor.type?fillColor.getPattern(maskCtx,this):fillColor,maskCtx.fillRect(0,0,width,height),maskCtx.restore(),this.paintInlineImageXObject(maskCanvas.canvas)},paintImageMaskXObjectRepeat:function(imgData,scaleX,scaleY,positions){var width=imgData.width,height=imgData.height,ctx=this.ctx,maskCanvas=CachedCanvases.getCanvas("maskCanvas",width,height),maskCtx=maskCanvas.context;maskCtx.save(),putBinaryImageMask(maskCtx,imgData),maskCtx.globalCompositeOperation="source-in";var fillColor=this.current.fillColor;maskCtx.fillStyle=fillColor&&fillColor.hasOwnProperty("type")&&"Pattern"===fillColor.type?fillColor.getPattern(maskCtx,this):fillColor,maskCtx.fillRect(0,0,width,height),maskCtx.restore();for(var i=0,ii=positions.length;ii>i;i+=2)ctx.save(),ctx.transform(scaleX,0,0,scaleY,positions[i],positions[i+1]),ctx.scale(1,-1),ctx.drawImage(maskCanvas.canvas,0,0,width,height,0,-1,1,1),ctx.restore()},paintImageMaskXObjectGroup:function(images){for(var ctx=this.ctx,i=0,ii=images.length;ii>i;i++){var image=images[i],width=image.width,height=image.height,maskCanvas=CachedCanvases.getCanvas("maskCanvas",width,height),maskCtx=maskCanvas.context;maskCtx.save(),putBinaryImageMask(maskCtx,image),maskCtx.globalCompositeOperation="source-in";var fillColor=this.current.fillColor;maskCtx.fillStyle=fillColor&&fillColor.hasOwnProperty("type")&&"Pattern"===fillColor.type?fillColor.getPattern(maskCtx,this):fillColor,maskCtx.fillRect(0,0,width,height),maskCtx.restore(),ctx.save(),ctx.transform.apply(ctx,image.transform),ctx.scale(1,-1),ctx.drawImage(maskCanvas.canvas,0,0,width,height,0,-1,1,1),ctx.restore()}},paintImageXObject:function(objId){var imgData=this.objs.get(objId);return imgData?void this.paintInlineImageXObject(imgData):void warn("Dependent image isn't ready yet")},paintImageXObjectRepeat:function(objId,scaleX,scaleY,positions){var imgData=this.objs.get(objId);if(!imgData)return void warn("Dependent image isn't ready yet");for(var width=imgData.width,height=imgData.height,map=[],i=0,ii=positions.length;ii>i;i+=2)map.push({transform:[scaleX,0,0,scaleY,positions[i],positions[i+1]],x:0,y:0,w:width,h:height});this.paintInlineImageXObjectGroup(imgData,map)},paintInlineImageXObject:function(imgData){var width=imgData.width,height=imgData.height,ctx=this.ctx;this.save(),ctx.scale(1/width,-1/height);var imgToPaint,tmpCanvas,currentTransform=ctx.mozCurrentTransformInverse,a=currentTransform[0],b=currentTransform[1],widthScale=Math.max(Math.sqrt(a*a+b*b),1),c=currentTransform[2],d=currentTransform[3],heightScale=Math.max(Math.sqrt(c*c+d*d),1);if(imgData instanceof HTMLElement||!imgData.data)imgToPaint=imgData;else{tmpCanvas=CachedCanvases.getCanvas("inlineImage",width,height);var tmpCtx=tmpCanvas.context;putBinaryImageData(tmpCtx,imgData),imgToPaint=tmpCanvas.canvas}for(var paintWidth=width,paintHeight=height,tmpCanvasId="prescale1";widthScale>2&&paintWidth>1||heightScale>2&&paintHeight>1;){var newWidth=paintWidth,newHeight=paintHeight;widthScale>2&&paintWidth>1&&(newWidth=Math.ceil(paintWidth/2),widthScale/=paintWidth/newWidth),heightScale>2&&paintHeight>1&&(newHeight=Math.ceil(paintHeight/2),heightScale/=paintHeight/newHeight),tmpCanvas=CachedCanvases.getCanvas(tmpCanvasId,newWidth,newHeight),tmpCtx=tmpCanvas.context,tmpCtx.clearRect(0,0,newWidth,newHeight),tmpCtx.drawImage(imgToPaint,0,0,paintWidth,paintHeight,0,0,newWidth,newHeight),imgToPaint=tmpCanvas.canvas,paintWidth=newWidth,paintHeight=newHeight,tmpCanvasId="prescale1"===tmpCanvasId?"prescale2":"prescale1"}if(ctx.drawImage(imgToPaint,0,0,paintWidth,paintHeight,0,-height,width,height),this.imageLayer){var position=this.getCanvasPosition(0,-height);this.imageLayer.appendImage({imgData:imgData,left:position[0],top:position[1],width:width/currentTransform[0],height:height/currentTransform[3]})}this.restore()},paintInlineImageXObjectGroup:function(imgData,map){var ctx=this.ctx,w=imgData.width,h=imgData.height,tmpCanvas=CachedCanvases.getCanvas("inlineImage",w,h),tmpCtx=tmpCanvas.context;putBinaryImageData(tmpCtx,imgData);for(var i=0,ii=map.length;ii>i;i++){var entry=map[i];if(ctx.save(),ctx.transform.apply(ctx,entry.transform),ctx.scale(1,-1),ctx.drawImage(tmpCanvas.canvas,entry.x,entry.y,entry.w,entry.h,0,-1,1,1),this.imageLayer){var position=this.getCanvasPosition(entry.x,entry.y);this.imageLayer.appendImage({imgData:imgData,left:position[0],top:position[1],width:w,height:h})}ctx.restore()}},paintSolidColorImageMask:function(){this.ctx.fillRect(0,0,1,1)},markPoint:function(){},markPointProps:function(){},beginMarkedContent:function(){},beginMarkedContentProps:function(){},endMarkedContent:function(){},beginCompat:function(){},endCompat:function(){},consumePath:function(){var ctx=this.ctx;if(this.pendingClip){if(this.pendingClip===EO_CLIP)if(void 0!==ctx.mozFillRule)ctx.mozFillRule="evenodd",ctx.clip(),ctx.mozFillRule="nonzero";else try{ctx.clip("evenodd")}catch(ex){ctx.clip()}else ctx.clip();this.pendingClip=null}ctx.beginPath()},getSinglePixelWidth:function(){var inverse=this.ctx.mozCurrentTransformInverse;return Math.sqrt(Math.max(inverse[0]*inverse[0]+inverse[1]*inverse[1],inverse[2]*inverse[2]+inverse[3]*inverse[3]))},getCanvasPosition:function(x,y){var transform=this.ctx.mozCurrentTransform;return[transform[0]*x+transform[2]*y+transform[4],transform[1]*x+transform[3]*y+transform[5]]}};for(var op in OPS)CanvasGraphics.prototype[OPS[op]]=CanvasGraphics.prototype[op];return CanvasGraphics}(),WebGLUtils=function(){function loadShader(gl,code,shaderType){var shader=gl.createShader(shaderType);gl.shaderSource(shader,code),gl.compileShader(shader);var compiled=gl.getShaderParameter(shader,gl.COMPILE_STATUS);if(!compiled){var errorMsg=gl.getShaderInfoLog(shader);throw new Error("Error during shader compilation: "+errorMsg)}return shader}function createVertexShader(gl,code){return loadShader(gl,code,gl.VERTEX_SHADER)}function createFragmentShader(gl,code){return loadShader(gl,code,gl.FRAGMENT_SHADER)}function createProgram(gl,shaders){for(var program=gl.createProgram(),i=0,ii=shaders.length;ii>i;++i)gl.attachShader(program,shaders[i]);gl.linkProgram(program);var linked=gl.getProgramParameter(program,gl.LINK_STATUS);if(!linked){var errorMsg=gl.getProgramInfoLog(program);throw new Error("Error during program linking: "+errorMsg)}return program}function createTexture(gl,image,textureId){gl.activeTexture(textureId);var texture=gl.createTexture();return gl.bindTexture(gl.TEXTURE_2D,texture),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST),gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE,image),texture}function generageGL(){currentGL||(currentCanvas=document.createElement("canvas"),currentGL=currentCanvas.getContext("webgl",{premultipliedalpha:!1}))}function initSmaskGL(){var canvas,gl;generageGL(),canvas=currentCanvas,currentCanvas=null,gl=currentGL,currentGL=null;var vertexShader=createVertexShader(gl,smaskVertexShaderCode),fragmentShader=createFragmentShader(gl,smaskFragmentShaderCode),program=createProgram(gl,[vertexShader,fragmentShader]);gl.useProgram(program);var cache={};cache.gl=gl,cache.canvas=canvas,cache.resolutionLocation=gl.getUniformLocation(program,"u_resolution"),cache.positionLocation=gl.getAttribLocation(program,"a_position"),cache.backdropLocation=gl.getUniformLocation(program,"u_backdrop"),cache.subtypeLocation=gl.getUniformLocation(program,"u_subtype");var texCoordLocation=gl.getAttribLocation(program,"a_texCoord"),texLayerLocation=gl.getUniformLocation(program,"u_image"),texMaskLocation=gl.getUniformLocation(program,"u_mask"),texCoordBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,texCoordBuffer),gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),gl.STATIC_DRAW),gl.enableVertexAttribArray(texCoordLocation),gl.vertexAttribPointer(texCoordLocation,2,gl.FLOAT,!1,0,0),gl.uniform1i(texLayerLocation,0),gl.uniform1i(texMaskLocation,1),smaskCache=cache}function composeSMask(layer,mask,properties){var width=layer.width,height=layer.height;smaskCache||initSmaskGL();var cache=smaskCache,canvas=cache.canvas,gl=cache.gl;canvas.width=width,canvas.height=height,gl.viewport(0,0,gl.drawingBufferWidth,gl.drawingBufferHeight),gl.uniform2f(cache.resolutionLocation,width,height),properties.backdrop?gl.uniform4f(cache.resolutionLocation,properties.backdrop[0],properties.backdrop[1],properties.backdrop[2],1):gl.uniform4f(cache.resolutionLocation,0,0,0,0),gl.uniform1i(cache.subtypeLocation,"Luminosity"===properties.subtype?1:0);var texture=createTexture(gl,layer,gl.TEXTURE0),maskTexture=createTexture(gl,mask,gl.TEXTURE1),buffer=gl.createBuffer();return gl.bindBuffer(gl.ARRAY_BUFFER,buffer),gl.bufferData(gl.ARRAY_BUFFER,new Float32Array([0,0,width,0,0,height,0,height,width,0,width,height]),gl.STATIC_DRAW),gl.enableVertexAttribArray(cache.positionLocation),gl.vertexAttribPointer(cache.positionLocation,2,gl.FLOAT,!1,0,0),gl.clearColor(0,0,0,0),gl.enable(gl.BLEND),gl.blendFunc(gl.ONE,gl.ONE_MINUS_SRC_ALPHA),gl.clear(gl.COLOR_BUFFER_BIT),gl.drawArrays(gl.TRIANGLES,0,6),gl.flush(),gl.deleteTexture(texture),gl.deleteTexture(maskTexture),gl.deleteBuffer(buffer),canvas}function initFiguresGL(){var canvas,gl;generageGL(),canvas=currentCanvas,currentCanvas=null,gl=currentGL,currentGL=null;var vertexShader=createVertexShader(gl,figuresVertexShaderCode),fragmentShader=createFragmentShader(gl,figuresFragmentShaderCode),program=createProgram(gl,[vertexShader,fragmentShader]);gl.useProgram(program);var cache={};cache.gl=gl,cache.canvas=canvas,cache.resolutionLocation=gl.getUniformLocation(program,"u_resolution"),cache.scaleLocation=gl.getUniformLocation(program,"u_scale"),cache.offsetLocation=gl.getUniformLocation(program,"u_offset"),cache.positionLocation=gl.getAttribLocation(program,"a_position"),cache.colorLocation=gl.getAttribLocation(program,"a_color"),figuresCache=cache}function drawFigures(width,height,backgroundColor,figures,context){figuresCache||initFiguresGL();var cache=figuresCache,canvas=cache.canvas,gl=cache.gl;canvas.width=width,canvas.height=height,gl.viewport(0,0,gl.drawingBufferWidth,gl.drawingBufferHeight),gl.uniform2f(cache.resolutionLocation,width,height);var i,ii,rows,count=0;for(i=0,ii=figures.length;ii>i;i++)switch(figures[i].type){case"lattice":rows=figures[i].coords.length/figures[i].verticesPerRow|0,count+=(rows-1)*(figures[i].verticesPerRow-1)*6;break;case"triangles":count+=figures[i].coords.length}var coords=new Float32Array(2*count),colors=new Uint8Array(3*count),coordsMap=context.coords,colorsMap=context.colors,pIndex=0,cIndex=0;for(i=0,ii=figures.length;ii>i;i++){var figure=figures[i],ps=figure.coords,cs=figure.colors;switch(figure.type){case"lattice":var cols=figure.verticesPerRow;rows=ps.length/cols|0;for(var row=1;rows>row;row++)for(var offset=row*cols+1,col=1;cols>col;col++,offset++)coords[pIndex]=coordsMap[ps[offset-cols-1]],coords[pIndex+1]=coordsMap[ps[offset-cols-1]+1],coords[pIndex+2]=coordsMap[ps[offset-cols]],coords[pIndex+3]=coordsMap[ps[offset-cols]+1],coords[pIndex+4]=coordsMap[ps[offset-1]],coords[pIndex+5]=coordsMap[ps[offset-1]+1],colors[cIndex]=colorsMap[cs[offset-cols-1]],colors[cIndex+1]=colorsMap[cs[offset-cols-1]+1],colors[cIndex+2]=colorsMap[cs[offset-cols-1]+2],colors[cIndex+3]=colorsMap[cs[offset-cols]],colors[cIndex+4]=colorsMap[cs[offset-cols]+1],colors[cIndex+5]=colorsMap[cs[offset-cols]+2],colors[cIndex+6]=colorsMap[cs[offset-1]],colors[cIndex+7]=colorsMap[cs[offset-1]+1],colors[cIndex+8]=colorsMap[cs[offset-1]+2],coords[pIndex+6]=coords[pIndex+2],coords[pIndex+7]=coords[pIndex+3],coords[pIndex+8]=coords[pIndex+4],coords[pIndex+9]=coords[pIndex+5],coords[pIndex+10]=coordsMap[ps[offset]],coords[pIndex+11]=coordsMap[ps[offset]+1],colors[cIndex+9]=colors[cIndex+3],colors[cIndex+10]=colors[cIndex+4],colors[cIndex+11]=colors[cIndex+5],colors[cIndex+12]=colors[cIndex+6],colors[cIndex+13]=colors[cIndex+7],colors[cIndex+14]=colors[cIndex+8],colors[cIndex+15]=colorsMap[cs[offset]],colors[cIndex+16]=colorsMap[cs[offset]+1],colors[cIndex+17]=colorsMap[cs[offset]+2],pIndex+=12,cIndex+=18;break;case"triangles":for(var j=0,jj=ps.length;jj>j;j++)coords[pIndex]=coordsMap[ps[j]],coords[pIndex+1]=coordsMap[ps[j]+1],colors[cIndex]=colorsMap[cs[i]],colors[cIndex+1]=colorsMap[cs[j]+1],colors[cIndex+2]=colorsMap[cs[j]+2],pIndex+=2,cIndex+=3}}backgroundColor?gl.clearColor(backgroundColor[0]/255,backgroundColor[1]/255,backgroundColor[2]/255,1):gl.clearColor(0,0,0,0),gl.clear(gl.COLOR_BUFFER_BIT);var coordsBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,coordsBuffer),gl.bufferData(gl.ARRAY_BUFFER,coords,gl.STATIC_DRAW),gl.enableVertexAttribArray(cache.positionLocation),gl.vertexAttribPointer(cache.positionLocation,2,gl.FLOAT,!1,0,0);var colorsBuffer=gl.createBuffer();return gl.bindBuffer(gl.ARRAY_BUFFER,colorsBuffer),gl.bufferData(gl.ARRAY_BUFFER,colors,gl.STATIC_DRAW),gl.enableVertexAttribArray(cache.colorLocation),gl.vertexAttribPointer(cache.colorLocation,3,gl.UNSIGNED_BYTE,!1,0,0),gl.uniform2f(cache.scaleLocation,context.scaleX,context.scaleY),gl.uniform2f(cache.offsetLocation,context.offsetX,context.offsetY),gl.drawArrays(gl.TRIANGLES,0,count),gl.flush(),gl.deleteBuffer(coordsBuffer),gl.deleteBuffer(colorsBuffer),canvas}function cleanup(){smaskCache&&smaskCache.canvas&&(smaskCache.canvas.width=0,smaskCache.canvas.height=0),figuresCache&&figuresCache.canvas&&(figuresCache.canvas.width=0,figuresCache.canvas.height=0),smaskCache=null,figuresCache=null}var currentGL,currentCanvas,smaskVertexShaderCode=" 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; } ",smaskFragmentShaderCode=" 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; if (u_subtype == 0) { lum = maskColor.a; } else { lum = maskColor.r * 0.3 + maskColor.g * 0.59 + maskColor.b * 0.11; } imageColor.a *= lum; imageColor.rgb *= imageColor.a; gl_FragColor = imageColor; } ",smaskCache=null,figuresVertexShaderCode=" attribute vec2 a_position; attribute vec3 a_color; uniform vec2 u_resolution; uniform vec2 u_scale; uniform vec2 u_offset; varying vec4 v_color; void main() { vec2 position = (a_position + u_offset) * u_scale; vec2 clipSpace = (position / u_resolution) * 2.0 - 1.0; gl_Position = vec4(clipSpace * vec2(1, -1), 0, 1); v_color = vec4(a_color / 255.0, 1.0); } ",figuresFragmentShaderCode=" precision mediump float; varying vec4 v_color; void main() { gl_FragColor = v_color; } ",figuresCache=null;return{get isEnabled(){if(PDFJS.disableWebGL)return!1;var enabled=!1;try{generageGL(),enabled=!!currentGL}catch(e){}return shadow(this,"isEnabled",enabled)},composeSMask:composeSMask,drawFigures:drawFigures,clear:cleanup}}(),ShadingIRs={};ShadingIRs.RadialAxial={fromIR:function(raw){var type=raw[1],colorStops=raw[2],p0=raw[3],p1=raw[4],r0=raw[5],r1=raw[6];return{type:"Pattern",getPattern:function(ctx){var grad;"axial"===type?grad=ctx.createLinearGradient(p0[0],p0[1],p1[0],p1[1]):"radial"===type&&(grad=ctx.createRadialGradient(p0[0],p0[1],r0,p1[0],p1[1],r1));for(var i=0,ii=colorStops.length;ii>i;++i){var c=colorStops[i];grad.addColorStop(c[0],c[1])}return grad}}}};var createMeshCanvas=function(){function drawTriangle(data,context,p1,p2,p3,c1,c2,c3){var tmp,coords=context.coords,colors=context.colors,bytes=data.data,rowSize=4*data.width;coords[p1+1]>coords[p2+1]&&(tmp=p1,p1=p2,p2=tmp,tmp=c1,c1=c2,c2=tmp),coords[p2+1]>coords[p3+1]&&(tmp=p2,p2=p3,p3=tmp,tmp=c2,c2=c3,c3=tmp),coords[p1+1]>coords[p2+1]&&(tmp=p1,p1=p2,p2=tmp,tmp=c1,c1=c2,c2=tmp);var x1=(coords[p1]+context.offsetX)*context.scaleX,y1=(coords[p1+1]+context.offsetY)*context.scaleY,x2=(coords[p2]+context.offsetX)*context.scaleX,y2=(coords[p2+1]+context.offsetY)*context.scaleY,x3=(coords[p3]+context.offsetX)*context.scaleX,y3=(coords[p3+1]+context.offsetY)*context.scaleY; if(!(y1>=y3))for(var xa,car,cag,cab,xb,cbr,cbg,cbb,k,c1r=colors[c1],c1g=colors[c1+1],c1b=colors[c1+2],c2r=colors[c2],c2g=colors[c2+1],c2b=colors[c2+2],c3r=colors[c3],c3g=colors[c3+1],c3b=colors[c3+2],minY=Math.round(y1),maxY=Math.round(y3),y=minY;maxY>=y;y++){y2>y?(k=y1>y?0:y1===y2?1:(y1-y)/(y1-y2),xa=x1-(x1-x2)*k,car=c1r-(c1r-c2r)*k,cag=c1g-(c1g-c2g)*k,cab=c1b-(c1b-c2b)*k):(k=y>y3?1:y2===y3?0:(y2-y)/(y2-y3),xa=x2-(x2-x3)*k,car=c2r-(c2r-c3r)*k,cag=c2g-(c2g-c3g)*k,cab=c2b-(c2b-c3b)*k),k=y1>y?0:y>y3?1:(y1-y)/(y1-y3),xb=x1-(x1-x3)*k,cbr=c1r-(c1r-c3r)*k,cbg=c1g-(c1g-c3g)*k,cbb=c1b-(c1b-c3b)*k;for(var x1_=Math.round(Math.min(xa,xb)),x2_=Math.round(Math.max(xa,xb)),j=rowSize*y+4*x1_,x=x1_;x2_>=x;x++)k=(xa-x)/(xa-xb),k=0>k?0:k>1?1:k,bytes[j++]=car-(car-cbr)*k|0,bytes[j++]=cag-(cag-cbg)*k|0,bytes[j++]=cab-(cab-cbb)*k|0,bytes[j++]=255}}function drawFigure(data,figure,context){var i,ii,ps=figure.coords,cs=figure.colors;switch(figure.type){case"lattice":var verticesPerRow=figure.verticesPerRow,rows=Math.floor(ps.length/verticesPerRow)-1,cols=verticesPerRow-1;for(i=0;rows>i;i++)for(var q=i*verticesPerRow,j=0;cols>j;j++,q++)drawTriangle(data,context,ps[q],ps[q+1],ps[q+verticesPerRow],cs[q],cs[q+1],cs[q+verticesPerRow]),drawTriangle(data,context,ps[q+verticesPerRow+1],ps[q+1],ps[q+verticesPerRow],cs[q+verticesPerRow+1],cs[q+1],cs[q+verticesPerRow]);break;case"triangles":for(i=0,ii=ps.length;ii>i;i+=3)drawTriangle(data,context,ps[i],ps[i+1],ps[i+2],cs[i],cs[i+1],cs[i+2]);break;default:error("illigal figure")}}function createMeshCanvas(bounds,combinesScale,coords,colors,figures,backgroundColor){var canvas,tmpCanvas,i,ii,EXPECTED_SCALE=1.1,MAX_PATTERN_SIZE=3e3,offsetX=Math.floor(bounds[0]),offsetY=Math.floor(bounds[1]),boundsWidth=Math.ceil(bounds[2])-offsetX,boundsHeight=Math.ceil(bounds[3])-offsetY,width=Math.min(Math.ceil(Math.abs(boundsWidth*combinesScale[0]*EXPECTED_SCALE)),MAX_PATTERN_SIZE),height=Math.min(Math.ceil(Math.abs(boundsHeight*combinesScale[1]*EXPECTED_SCALE)),MAX_PATTERN_SIZE),scaleX=boundsWidth/width,scaleY=boundsHeight/height,context={coords:coords,colors:colors,offsetX:-offsetX,offsetY:-offsetY,scaleX:1/scaleX,scaleY:1/scaleY};if(WebGLUtils.isEnabled)canvas=WebGLUtils.drawFigures(width,height,backgroundColor,figures,context),tmpCanvas=CachedCanvases.getCanvas("mesh",width,height,!1),tmpCanvas.context.drawImage(canvas,0,0),canvas=tmpCanvas.canvas;else{tmpCanvas=CachedCanvases.getCanvas("mesh",width,height,!1);var tmpCtx=tmpCanvas.context,data=tmpCtx.createImageData(width,height);if(backgroundColor){var bytes=data.data;for(i=0,ii=bytes.length;ii>i;i+=4)bytes[i]=backgroundColor[0],bytes[i+1]=backgroundColor[1],bytes[i+2]=backgroundColor[2],bytes[i+3]=255}for(i=0;i=14?!0:"node"===userAgent?!0:!1}(),bind:function(fonts,callback){assert(!isWorker,"bind() shall be called from main thread");for(var rules=[],fontsToLoad=[],i=0,ii=fonts.length;ii>i;i++){var font=fonts[i];if(!font.attached&&font.loading!==!1){font.attached=!0;var rule=font.bindDOM();rule&&(rules.push(rule),fontsToLoad.push(font))}}var request=FontLoader.queueLoadingCallback(callback);rules.length>0&&!this.isSyncFontLoadingSupported?FontLoader.prepareFontLoadEvent(rules,fontsToLoad,request):request.complete()},queueLoadingCallback:function(callback){function LoadLoader_completeRequest(){for(assert(!request.end,"completeRequest() cannot be called twice"),request.end=Date.now();context.requests.length>0&&context.requests[0].end;){var otherRequest=context.requests.shift();setTimeout(otherRequest.callback,0)}}var context=FontLoader.loadingContext,requestId="pdfjs-font-loading-"+context.nextRequestId++,request={id:requestId,complete:LoadLoader_completeRequest,callback:callback,started:Date.now()};return context.requests.push(request),request},prepareFontLoadEvent:function(rules,fonts,request){function int32(data,offset){return data.charCodeAt(offset)<<24|data.charCodeAt(offset+1)<<16|data.charCodeAt(offset+2)<<8|255&data.charCodeAt(offset+3)}function spliceString(s,offset,remove,insert){var chunk1=s.substr(0,offset),chunk2=s.substr(offset+remove);return chunk1+insert+chunk2}function isFontReady(name,callback){if(called++,called>30)return warn("Load test font never loaded."),void callback();ctx.font="30px "+name,ctx.fillText(".",0,20);var imageData=ctx.getImageData(0,0,1,1);return imageData.data[3]>0?void callback():void setTimeout(isFontReady.bind(null,name,callback))}var i,ii,canvas=document.createElement("canvas");canvas.width=1,canvas.height=1;var ctx=canvas.getContext("2d"),called=0,loadTestFontId="lt"+Date.now()+this.loadTestFontId++,data=this.loadTestFont,COMMENT_OFFSET=976;data=spliceString(data,COMMENT_OFFSET,loadTestFontId.length,loadTestFontId);var CFF_CHECKSUM_OFFSET=16,XXXX_VALUE=1482184792,checksum=int32(data,CFF_CHECKSUM_OFFSET);for(i=0,ii=loadTestFontId.length-3;ii>i;i+=4)checksum=checksum-XXXX_VALUE+int32(loadTestFontId,i)|0;ii;i++)names.push(fonts[i].loadedName);names.push(loadTestFontId);var div=document.createElement("div");for(div.setAttribute("style","visibility: hidden;width: 10px; height: 10px;position: absolute; top: 0px; left: 0px;"),i=0,ii=names.length;ii>i;++i){var span=document.createElement("span");span.textContent="Hi",span.style.fontFamily=names[i],div.appendChild(span)}document.body.appendChild(div),isFontReady(loadTestFontId,function(){document.body.removeChild(div),request.complete()})}},FontFace=function(){function FontFace(){if(this.compiledGlyphs={},1!==arguments.length);else{var data=arguments[0];for(var i in data)this[i]=data[i]}}return FontFace.prototype={bindDOM:function(){if(!this.data)return null;if(PDFJS.disableFontFace)return this.disableFontFace=!0,null;var data=bytesToString(new Uint8Array(this.data)),fontName=this.loadedName,url="url(data:"+this.mimetype+";base64,"+window.btoa(data)+");",rule='@font-face { font-family:"'+fontName+'";src:'+url+"}";return FontLoader.insertRule(rule),PDFJS.pdfBug&&"FontInspector"in globalScope&&globalScope.FontInspector.enabled&&globalScope.FontInspector.fontAdded(this,url),rule},getPathGenerator:function(objs,character){if(!(character in this.compiledGlyphs)){var js=objs.get(this.loadedName+"_path_"+character);this.compiledGlyphs[character]=new Function("c","size",js)}return this.compiledGlyphs[character]}},FontFace}(),HIGHLIGHT_OFFSET=4,ANNOT_MIN_SIZE=10,AnnotationUtils=function(){function setTextStyles(element,item,fontObj){var style=element.style;if(style.fontSize=item.fontSize+"px",style.direction=item.fontDirection<0?"rtl":"ltr",fontObj){style.fontWeight=fontObj.black?fontObj.bold?"bolder":"bold":fontObj.bold?"bold":"normal",style.fontStyle=fontObj.italic?"italic":"normal";var fontName=fontObj.loadedName,fontFamily=fontName?'"'+fontName+'", ':"",fallbackName=fontObj.fallbackName||"Helvetica, sans-serif";style.fontFamily=fontFamily+fallbackName}}function getEmptyContainer(tagName,rect,borderWidth){var bWidth=borderWidth||0,element=document.createElement(tagName);element.style.borderWidth=bWidth+"px";var width=rect[2]-rect[0]-2*bWidth,height=rect[3]-rect[1]-2*bWidth;return element.style.width=width+"px",element.style.height=height+"px",element}function initContainer(item){var container=getEmptyContainer("section",item.rect,item.borderWidth);container.style.backgroundColor=item.color;for(var color=item.color,rgb=[],i=0;3>i;++i)rgb[i]=Math.round(255*color[i]);item.colorCssRgb=Util.makeCssRgb(rgb);var highlight=document.createElement("div");return highlight.className="annotationHighlight",highlight.style.left=highlight.style.top=-HIGHLIGHT_OFFSET+"px",highlight.style.right=highlight.style.bottom=-HIGHLIGHT_OFFSET+"px",highlight.setAttribute("hidden",!0),item.highlightElement=highlight,container.appendChild(item.highlightElement),container}function getHtmlElementForTextWidgetAnnotation(item,commonObjs){var element=getEmptyContainer("div",item.rect,0);element.style.display="table";var content=document.createElement("div");content.textContent=item.fieldValue;var textAlignment=item.textAlignment;content.style.textAlign=["left","center","right"][textAlignment],content.style.verticalAlign="middle",content.style.display="table-cell";var fontObj=item.fontRefName?commonObjs.getData(item.fontRefName):null;return setTextStyles(content,item,fontObj),element.appendChild(content),element}function getHtmlElementForTextAnnotation(item){var rect=item.rect;rect[3]-rect[1]i;++i){var c=Math.round(255*color[i]);rgb[i]=Math.round(.7*(255-c))+c}content.style.backgroundColor=Util.makeCssRgb(rgb)}var title=document.createElement("h1"),text=document.createElement("p");if(title.textContent=item.title,item.content||item.title){var e=document.createElement("span"),lines=item.content.split(/(?:\r\n?|\n)/);for(i=0,ii=lines.length;ii>i;++i){var line=lines[i];e.appendChild(document.createTextNode(line)),ii-1>i&&e.appendChild(document.createElement("br"))}text.appendChild(e);var pinned=!1,showAnnotation=function(pin){pin&&(pinned=!0),content.hasAttribute("hidden")&&(container.style.zIndex+=1,content.removeAttribute("hidden"))},hideAnnotation=function(unpin){unpin&&(pinned=!1),content.hasAttribute("hidden")||pinned||(container.style.zIndex-=1,content.setAttribute("hidden",!0))},toggleAnnotation=function(){pinned?hideAnnotation(!0):showAnnotation(!0)};image.addEventListener("click",function(){toggleAnnotation()},!1),image.addEventListener("mouseover",function(){showAnnotation()},!1),image.addEventListener("mouseout",function(){hideAnnotation()},!1),content.addEventListener("click",function(){hideAnnotation(!0)},!1)}else content.setAttribute("hidden",!0);return content.appendChild(title),content.appendChild(text),contentWrapper.appendChild(content),container.appendChild(image),container.appendChild(contentWrapper),container}function getHtmlElementForLinkAnnotation(item){var container=initContainer(item);container.className="annotLink",container.style.borderColor=item.colorCssRgb,container.style.borderStyle="solid";var link=document.createElement("a");return link.href=link.title=item.url||"",container.appendChild(link),container}function getHtmlElement(data,objs){switch(data.annotationType){case AnnotationType.WIDGET:return getHtmlElementForTextWidgetAnnotation(data,objs);case AnnotationType.TEXT:return getHtmlElementForTextAnnotation(data);case AnnotationType.LINK:return getHtmlElementForLinkAnnotation(data);default:throw new Error("Unsupported annotationType: "+data.annotationType)}}return{getHtmlElement:getHtmlElement}}();PDFJS.AnnotationUtils=AnnotationUtils;var SVG_DEFAULTS={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},convertImgDataToPng=function(){function crc32(data,start,end){for(var crc=-1,i=start;end>i;i++){var a=255&(crc^data[i]),b=crcTable[a];crc=crc>>>8^b}return-1^crc}function writePngChunk(type,body,data,offset){var p=offset,len=body.length;data[p]=len>>24&255,data[p+1]=len>>16&255,data[p+2]=len>>8&255,data[p+3]=255&len,p+=4,data[p]=255&type.charCodeAt(0),data[p+1]=255&type.charCodeAt(1),data[p+2]=255&type.charCodeAt(2),data[p+3]=255&type.charCodeAt(3),p+=4,data.set(body,p),p+=body.length;var crc=crc32(data,offset+4,p);data[p]=crc>>24&255,data[p+1]=crc>>16&255,data[p+2]=crc>>8&255,data[p+3]=255&crc}function adler32(data,start,end){for(var a=1,b=0,i=start;end>i;++i)a=(a+(255&data[i]))%65521,b=(b+a)%65521;return b<<16|a}function encode(imgData,kind){var bitDepth,colorType,lineSize,width=imgData.width,height=imgData.height,bytes=imgData.data;switch(kind){case ImageKind.GRAYSCALE_1BPP:colorType=0,bitDepth=1,lineSize=width+7>>3;break;case ImageKind.RGB_24BPP:colorType=2,bitDepth=8,lineSize=3*width;break;case ImageKind.RGBA_32BPP:colorType=6,bitDepth=8,lineSize=4*width;break;default:throw new Error("invalid format")}var y,i,literals=new Uint8Array((1+lineSize)*height),offsetLiterals=0,offsetBytes=0;for(y=0;height>y;++y)literals[offsetLiterals++]=0,literals.set(bytes.subarray(offsetBytes,offsetBytes+lineSize),offsetLiterals),offsetBytes+=lineSize,offsetLiterals+=lineSize;if(kind===ImageKind.GRAYSCALE_1BPP)for(offsetLiterals=0,y=0;height>y;y++)for(offsetLiterals++,i=0;lineSize>i;i++)literals[offsetLiterals++]^=255;var ihdr=new Uint8Array([width>>24&255,width>>16&255,width>>8&255,255&width,height>>24&255,height>>16&255,height>>8&255,255&height,bitDepth,colorType,0,0,0]),len=literals.length,maxBlockLength=65535,deflateBlocks=Math.ceil(len/maxBlockLength),idat=new Uint8Array(2+len+5*deflateBlocks+4),pi=0;idat[pi++]=120,idat[pi++]=156;for(var pos=0;len>maxBlockLength;)idat[pi++]=0,idat[pi++]=255,idat[pi++]=255,idat[pi++]=0,idat[pi++]=0,idat.set(literals.subarray(pos,pos+maxBlockLength),pi),pi+=maxBlockLength,pos+=maxBlockLength,len-=maxBlockLength;idat[pi++]=1,idat[pi++]=255&len,idat[pi++]=len>>8&255,idat[pi++]=65535&~len&255,idat[pi++]=(65535&~len)>>8&255,idat.set(literals.subarray(pos),pi),pi+=literals.length-pos;var adler=adler32(literals,0,literals.length);idat[pi++]=adler>>24&255,idat[pi++]=adler>>16&255,idat[pi++]=adler>>8&255,idat[pi++]=255&adler;var pngLength=PNG_HEADER.length+3*CHUNK_WRAPPER_SIZE+ihdr.length+idat.length,data=new Uint8Array(pngLength),offset=0;return data.set(PNG_HEADER,offset),offset+=PNG_HEADER.length,writePngChunk("IHDR",ihdr,data,offset),offset+=CHUNK_WRAPPER_SIZE+ihdr.length,writePngChunk("IDATA",idat,data,offset),offset+=CHUNK_WRAPPER_SIZE+idat.length,writePngChunk("IEND",new Uint8Array(0),data,offset),PDFJS.createObjectURL(data,"image/png")}for(var PNG_HEADER=new Uint8Array([137,80,78,71,13,10,26,10]),CHUNK_WRAPPER_SIZE=12,crcTable=new Int32Array(256),i=0;256>i;i++){for(var c=i,h=0;8>h;h++)c=1&c?3988292384^c>>1&2147483647:c>>1&2147483647;crcTable[i]=c}return function(imgData){var kind=void 0===imgData.kind?ImageKind.GRAYSCALE_1BPP:imgData.kind;return encode(imgData,kind)}}(),SVGExtraState=function(){function SVGExtraState(){this.fontSizeScale=1,this.fontWeight=SVG_DEFAULTS.fontWeight,this.fontSize=0,this.textMatrix=IDENTITY_MATRIX,this.fontMatrix=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=SVG_DEFAULTS.fillColor,this.strokeColor="#000000",this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.lineJoin="",this.lineCap="",this.miterLimit=0,this.dashArray=[],this.dashPhase=0,this.dependencies=[],this.clipId="",this.pendingClip=!1,this.maskId=""}return SVGExtraState.prototype={clone:function(){return Object.create(this)},setCurrentPoint:function(x,y){this.x=x,this.y=y}},SVGExtraState}(),SVGGraphics=function(){function createScratchSVG(width,height){var NS="http://www.w3.org/2000/svg",svg=document.createElementNS(NS,"svg:svg");return svg.setAttributeNS(null,"version","1.1"),svg.setAttributeNS(null,"width",width+"px"),svg.setAttributeNS(null,"height",height+"px"),svg.setAttributeNS(null,"viewBox","0 0 "+width+" "+height),svg}function opListToTree(opList){for(var opTree=[],tmp=[],opListLen=opList.length,x=0;opListLen>x;x++)"save"!==opList[x].fn?"restore"===opList[x].fn?opTree=tmp.pop():opTree.push(opList[x]):(opTree.push({fnId:92,fn:"group",items:[]}),tmp.push(opTree),opTree=opTree[opTree.length-1].items);return opTree}function pf(value){if(value===(0|value))return value.toString();var s=value.toFixed(10),i=s.length-1;if("0"!==s[i])return s;do i--;while("0"===s[i]);return s.substr(0,"."===s[i]?i:i+1)}function pm(m){if(0===m[4]&&0===m[5]){if(0===m[1]&&0===m[2])return 1===m[0]&&1===m[3]?"":"scale("+pf(m[0])+" "+pf(m[3])+")";if(m[0]===m[3]&&m[1]===-m[2]){var a=180*Math.acos(m[0])/Math.PI;return"rotate("+pf(a)+")"}}else if(1===m[0]&&0===m[1]&&0===m[2]&&1===m[3])return"translate("+pf(m[4])+" "+pf(m[5])+")";return"matrix("+pf(m[0])+" "+pf(m[1])+" "+pf(m[2])+" "+pf(m[3])+" "+pf(m[4])+" "+pf(m[5])+")"}function SVGGraphics(commonObjs,objs){this.current=new SVGExtraState,this.transformMatrix=IDENTITY_MATRIX,this.transformStack=[],this.extraStack=[],this.commonObjs=commonObjs,this.objs=objs,this.pendingEOFill=!1,this.embedFonts=!1,this.embeddedFonts={},this.cssStyle=null}var NS="http://www.w3.org/2000/svg",XML_NS="http://www.w3.org/XML/1998/namespace",XLINK_NS="http://www.w3.org/1999/xlink",LINE_CAP_STYLES=["butt","round","square"],LINE_JOIN_STYLES=["miter","round","bevel"],clipCount=0,maskCount=0;return SVGGraphics.prototype={save:function(){this.transformStack.push(this.transformMatrix);var old=this.current;this.extraStack.push(old),this.current=old.clone()},restore:function(){this.transformMatrix=this.transformStack.pop(),this.current=this.extraStack.pop(),this.tgrp=document.createElementNS(NS,"svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix)),this.pgrp.appendChild(this.tgrp)},group:function(items){this.save(),this.executeOpTree(items),this.restore()},loadDependencies:function(operatorList){for(var fnArray=operatorList.fnArray,fnArrayLen=fnArray.length,argsArray=operatorList.argsArray,self=this,i=0;fnArrayLen>i;i++)if(OPS.dependency===fnArray[i])for(var deps=argsArray[i],n=0,nn=deps.length;nn>n;n++){var promise,obj=deps[n],common="g_"===obj.substring(0,2);promise=new Promise(common?function(resolve){self.commonObjs.get(obj,resolve)}:function(resolve){self.objs.get(obj,resolve)}),this.current.dependencies.push(promise)}return Promise.all(this.current.dependencies)},transform:function(a,b,c,d,e,f){var transformMatrix=[a,b,c,d,e,f];this.transformMatrix=PDFJS.Util.transform(this.transformMatrix,transformMatrix),this.tgrp=document.createElementNS(NS,"svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix))},getSVG:function(operatorList,viewport){return this.svg=createScratchSVG(viewport.width,viewport.height),this.viewport=viewport,this.loadDependencies(operatorList).then(function(){this.transformMatrix=IDENTITY_MATRIX,this.pgrp=document.createElementNS(NS,"svg:g"),this.pgrp.setAttributeNS(null,"transform",pm(viewport.transform)),this.tgrp=document.createElementNS(NS,"svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix)),this.defs=document.createElementNS(NS,"svg:defs"),this.pgrp.appendChild(this.defs),this.pgrp.appendChild(this.tgrp),this.svg.appendChild(this.pgrp);var opTree=this.convertOpList(operatorList);return this.executeOpTree(opTree),this.svg}.bind(this))},convertOpList:function(operatorList){var argsArray=operatorList.argsArray,fnArray=operatorList.fnArray,fnArrayLen=fnArray.length,REVOPS=[],opList=[];for(var op in OPS)REVOPS[OPS[op]]=op;for(var x=0;fnArrayLen>x;x++){var fnId=fnArray[x];opList.push({fnId:fnId,fn:REVOPS[fnId],args:argsArray[x]})}return opListToTree(opList)},executeOpTree:function(opTree){for(var opTreeLen=opTree.length,x=0;opTreeLen>x;x++){var fn=opTree[x].fn,fnId=opTree[x].fnId,args=opTree[x].args;switch(0|fnId){case OPS.beginText:this.beginText();break;case OPS.setLeading:this.setLeading(args);break;case OPS.setLeadingMoveText:this.setLeadingMoveText(args[0],args[1]);break;case OPS.setFont:this.setFont(args);break;case OPS.showText:this.showText(args[0]);break;case OPS.showSpacedText:this.showText(args[0]);break;case OPS.endText:this.endText();break;case OPS.moveText:this.moveText(args[0],args[1]);break;case OPS.setCharSpacing:this.setCharSpacing(args[0]);break;case OPS.setWordSpacing:this.setWordSpacing(args[0]);break;case OPS.setTextMatrix:this.setTextMatrix(args[0],args[1],args[2],args[3],args[4],args[5]);break;case OPS.setLineWidth:this.setLineWidth(args[0]);break;case OPS.setLineJoin:this.setLineJoin(args[0]);break;case OPS.setLineCap:this.setLineCap(args[0]);break;case OPS.setMiterLimit:this.setMiterLimit(args[0]);break;case OPS.setFillRGBColor:this.setFillRGBColor(args[0],args[1],args[2]);break;case OPS.setStrokeRGBColor:this.setStrokeRGBColor(args[0],args[1],args[2]);break;case OPS.setDash:this.setDash(args[0],args[1]);break;case OPS.setGState:this.setGState(args[0]);break;case OPS.fill:this.fill();break;case OPS.eoFill:this.eoFill();break;case OPS.stroke:this.stroke();break;case OPS.fillStroke:this.fillStroke();break;case OPS.eoFillStroke:this.eoFillStroke();break;case OPS.clip:this.clip("nonzero");break;case OPS.eoClip:this.clip("evenodd");break;case OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case OPS.paintJpegXObject:this.paintJpegXObject(args[0],args[1],args[2]);break;case OPS.paintImageXObject:this.paintImageXObject(args[0]);break;case OPS.paintInlineImageXObject:this.paintInlineImageXObject(args[0]);break;case OPS.paintImageMaskXObject:this.paintImageMaskXObject(args[0]);break;case OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(args[0],args[1]);break;case OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case OPS.closePath:this.closePath();break;case OPS.closeStroke:this.closeStroke();break;case OPS.closeFillStroke:this.closeFillStroke();break;case OPS.nextLine:this.nextLine();break;case OPS.transform:this.transform(args[0],args[1],args[2],args[3],args[4],args[5]);break;case OPS.constructPath:this.constructPath(args[0],args[1]);break;case OPS.endPath:this.endPath();break;case 92:this.group(opTree[x].items);break;default:warn("Unimplemented method "+fn)}}},setWordSpacing:function(wordSpacing){this.current.wordSpacing=wordSpacing},setCharSpacing:function(charSpacing){this.current.charSpacing=charSpacing},nextLine:function(){this.moveText(0,this.current.leading)},setTextMatrix:function(a,b,c,d,e,f){var current=this.current;this.current.textMatrix=this.current.lineMatrix=[a,b,c,d,e,f],this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,current.xcoords=[],current.tspan=document.createElementNS(NS,"svg:tspan"),current.tspan.setAttributeNS(null,"font-family",current.fontFamily),current.tspan.setAttributeNS(null,"font-size",pf(current.fontSize)+"px"),current.tspan.setAttributeNS(null,"y",pf(-current.y)),current.txtElement=document.createElementNS(NS,"svg:text"),current.txtElement.appendChild(current.tspan)},beginText:function(){this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.current.textMatrix=IDENTITY_MATRIX,this.current.lineMatrix=IDENTITY_MATRIX,this.current.tspan=document.createElementNS(NS,"svg:tspan"),this.current.txtElement=document.createElementNS(NS,"svg:text"),this.current.txtgrp=document.createElementNS(NS,"svg:g"),this.current.xcoords=[]},moveText:function(x,y){var current=this.current;this.current.x=this.current.lineX+=x,this.current.y=this.current.lineY+=y,current.xcoords=[],current.tspan=document.createElementNS(NS,"svg:tspan"),current.tspan.setAttributeNS(null,"font-family",current.fontFamily),current.tspan.setAttributeNS(null,"font-size",pf(current.fontSize)+"px"),current.tspan.setAttributeNS(null,"y",pf(-current.y))},showText:function(glyphs){var current=this.current,font=current.font,fontSize=current.fontSize;if(0!==fontSize){var i,charSpacing=current.charSpacing,wordSpacing=current.wordSpacing,fontDirection=current.fontDirection,textHScale=current.textHScale*fontDirection,glyphsLength=glyphs.length,vertical=font.vertical,widthAdvanceScale=fontSize*current.fontMatrix[0],x=0;for(i=0;glyphsLength>i;++i){var glyph=glyphs[i];if(null!==glyph)if(isNum(glyph))x+=-glyph*fontSize*.001;else{current.xcoords.push(current.x+x*textHScale);var width=glyph.width,character=glyph.fontChar,charWidth=width*widthAdvanceScale+charSpacing*fontDirection;x+=charWidth,current.tspan.textContent+=character}else x+=fontDirection*wordSpacing}vertical?current.y-=x*textHScale:current.x+=x*textHScale,current.tspan.setAttributeNS(null,"x",current.xcoords.map(pf).join(" ")),current.tspan.setAttributeNS(null,"y",pf(-current.y)),current.tspan.setAttributeNS(null,"font-family",current.fontFamily),current.tspan.setAttributeNS(null,"font-size",pf(current.fontSize)+"px"),current.fontStyle!==SVG_DEFAULTS.fontStyle&¤t.tspan.setAttributeNS(null,"font-style",current.fontStyle),current.fontWeight!==SVG_DEFAULTS.fontWeight&¤t.tspan.setAttributeNS(null,"font-weight",current.fontWeight),current.fillColor!==SVG_DEFAULTS.fillColor&¤t.tspan.setAttributeNS(null,"fill",current.fillColor),current.txtElement.setAttributeNS(null,"transform",pm(current.textMatrix)+" scale(1, -1)"),current.txtElement.setAttributeNS(XML_NS,"xml:space","preserve"),current.txtElement.appendChild(current.tspan),current.txtgrp.appendChild(current.txtElement),this.tgrp.appendChild(current.txtElement)}},setLeadingMoveText:function(x,y){this.setLeading(-y),this.moveText(x,y)},addFontStyle:function(fontObj){this.cssStyle||(this.cssStyle=document.createElementNS(NS,"svg:style"),this.cssStyle.setAttributeNS(null,"type","text/css"),this.defs.appendChild(this.cssStyle)); var url=PDFJS.createObjectURL(fontObj.data,fontObj.mimetype);this.cssStyle.textContent+='@font-face { font-family: "'+fontObj.loadedName+'"; src: url('+url+"); }\n"},setFont:function(details){var current=this.current,fontObj=this.commonObjs.get(details[0]),size=details[1];this.current.font=fontObj,this.embedFonts&&fontObj.data&&!this.embeddedFonts[fontObj.loadedName]&&(this.addFontStyle(fontObj),this.embeddedFonts[fontObj.loadedName]=fontObj),current.fontMatrix=fontObj.fontMatrix?fontObj.fontMatrix:FONT_IDENTITY_MATRIX;var bold=fontObj.black?fontObj.bold?"bolder":"bold":fontObj.bold?"bold":"normal",italic=fontObj.italic?"italic":"normal";0>size?(size=-size,current.fontDirection=-1):current.fontDirection=1,current.fontSize=size,current.fontFamily=fontObj.loadedName,current.fontWeight=bold,current.fontStyle=italic,current.tspan=document.createElementNS(NS,"svg:tspan"),current.tspan.setAttributeNS(null,"y",pf(-current.y)),current.xcoords=[]},endText:function(){this.current.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp),this.tgrp=document.createElementNS(NS,"svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix))},setLineWidth:function(width){this.current.lineWidth=width},setLineCap:function(style){this.current.lineCap=LINE_CAP_STYLES[style]},setLineJoin:function(style){this.current.lineJoin=LINE_JOIN_STYLES[style]},setMiterLimit:function(limit){this.current.miterLimit=limit},setStrokeRGBColor:function(){var color=Util.makeCssRgb(arguments);this.current.strokeColor=color},setFillRGBColor:function(){var color=Util.makeCssRgb(arguments);this.current.fillColor=color,this.current.tspan=document.createElementNS(NS,"svg:tspan"),this.current.xcoords=[]},setDash:function(dashArray,dashPhase){this.current.dashArray=dashArray,this.current.dashPhase=dashPhase},constructPath:function(ops,args){var current=this.current,x=current.x,y=current.y;current.path=document.createElementNS(NS,"svg:path");for(var d=[],opLength=ops.length,i=0,j=0;opLength>i;i++)switch(0|ops[i]){case OPS.rectangle:x=args[j++],y=args[j++];var width=args[j++],height=args[j++],xw=x+width,yh=y+height;d.push("M",pf(x),pf(y),"L",pf(xw),pf(y),"L",pf(xw),pf(yh),"L",pf(x),pf(yh),"Z");break;case OPS.moveTo:x=args[j++],y=args[j++],d.push("M",pf(x),pf(y));break;case OPS.lineTo:x=args[j++],y=args[j++],d.push("L",pf(x),pf(y));break;case OPS.curveTo:x=args[j+4],y=args[j+5],d.push("C",pf(args[j]),pf(args[j+1]),pf(args[j+2]),pf(args[j+3]),pf(x),pf(y)),j+=6;break;case OPS.curveTo2:x=args[j+2],y=args[j+3],d.push("C",pf(x),pf(y),pf(args[j]),pf(args[j+1]),pf(args[j+2]),pf(args[j+3])),j+=4;break;case OPS.curveTo3:x=args[j+2],y=args[j+3],d.push("C",pf(args[j]),pf(args[j+1]),pf(x),pf(y),pf(x),pf(y)),j+=4;break;case OPS.closePath:d.push("Z")}current.path.setAttributeNS(null,"d",d.join(" ")),current.path.setAttributeNS(null,"stroke-miterlimit",pf(current.miterLimit)),current.path.setAttributeNS(null,"stroke-linecap",current.lineCap),current.path.setAttributeNS(null,"stroke-linejoin",current.lineJoin),current.path.setAttributeNS(null,"stroke-width",pf(current.lineWidth)+"px"),current.path.setAttributeNS(null,"stroke-dasharray",current.dashArray.map(pf).join(" ")),current.path.setAttributeNS(null,"stroke-dashoffset",pf(current.dashPhase)+"px"),current.path.setAttributeNS(null,"fill","none"),this.tgrp.appendChild(current.path),current.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp),current.element=current.path,current.setCurrentPoint(x,y)},endPath:function(){var current=this.current;current.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp),this.tgrp=document.createElementNS(NS,"svg:g"),this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix))},clip:function(type){var current=this.current;current.clipId="clippath"+clipCount,clipCount++,this.clippath=document.createElementNS(NS,"svg:clipPath"),this.clippath.setAttributeNS(null,"id",current.clipId);var clipElement=current.element.cloneNode();"evenodd"===type?clipElement.setAttributeNS(null,"clip-rule","evenodd"):clipElement.setAttributeNS(null,"clip-rule","nonzero"),this.clippath.setAttributeNS(null,"transform",pm(this.transformMatrix)),this.clippath.appendChild(clipElement),this.defs.appendChild(this.clippath),current.pendingClip=!0,this.cgrp=document.createElementNS(NS,"svg:g"),this.cgrp.setAttributeNS(null,"clip-path","url(#"+current.clipId+")"),this.pgrp.appendChild(this.cgrp)},closePath:function(){var current=this.current,d=current.path.getAttributeNS(null,"d");d+="Z",current.path.setAttributeNS(null,"d",d)},setLeading:function(leading){this.current.leading=-leading},setTextRise:function(textRise){this.current.textRise=textRise},setHScale:function(scale){this.current.textHScale=scale/100},setGState:function(states){for(var i=0,ii=states.length;ii>i;i++){var state=states[i],key=state[0],value=state[1];switch(key){case"LW":this.setLineWidth(value);break;case"LC":this.setLineCap(value);break;case"LJ":this.setLineJoin(value);break;case"ML":this.setMiterLimit(value);break;case"D":this.setDash(value[0],value[1]);break;case"RI":break;case"FL":break;case"Font":this.setFont(value);break;case"CA":break;case"ca":break;case"BM":break;case"SMask":}}},fill:function(){var current=this.current;current.element.setAttributeNS(null,"fill",current.fillColor)},stroke:function(){var current=this.current;current.element.setAttributeNS(null,"stroke",current.strokeColor),current.element.setAttributeNS(null,"fill","none")},eoFill:function(){var current=this.current;current.element.setAttributeNS(null,"fill",current.fillColor),current.element.setAttributeNS(null,"fill-rule","evenodd")},fillStroke:function(){this.stroke(),this.fill()},eoFillStroke:function(){this.current.element.setAttributeNS(null,"fill-rule","evenodd"),this.fillStroke()},closeStroke:function(){this.closePath(),this.stroke()},closeFillStroke:function(){this.closePath(),this.fillStroke()},paintSolidColorImageMask:function(){var current=this.current,rect=document.createElementNS(NS,"svg:rect");rect.setAttributeNS(null,"x","0"),rect.setAttributeNS(null,"y","0"),rect.setAttributeNS(null,"width","1px"),rect.setAttributeNS(null,"height","1px"),rect.setAttributeNS(null,"fill",current.fillColor),this.tgrp.appendChild(rect)},paintJpegXObject:function(objId,w,h){var current=this.current,imgObj=this.objs.get(objId),imgEl=document.createElementNS(NS,"svg:image");imgEl.setAttributeNS(XLINK_NS,"xlink:href",imgObj.src),imgEl.setAttributeNS(null,"width",imgObj.width+"px"),imgEl.setAttributeNS(null,"height",imgObj.height+"px"),imgEl.setAttributeNS(null,"x","0"),imgEl.setAttributeNS(null,"y",pf(-h)),imgEl.setAttributeNS(null,"transform","scale("+pf(1/w)+" "+pf(-1/h)+")"),this.tgrp.appendChild(imgEl),current.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp)},paintImageXObject:function(objId){var imgData=this.objs.get(objId);return imgData?void this.paintInlineImageXObject(imgData):void warn("Dependent image isn't ready yet")},paintInlineImageXObject:function(imgData,mask){var current=this.current,width=imgData.width,height=imgData.height,imgSrc=convertImgDataToPng(imgData),cliprect=document.createElementNS(NS,"svg:rect");cliprect.setAttributeNS(null,"x","0"),cliprect.setAttributeNS(null,"y","0"),cliprect.setAttributeNS(null,"width",pf(width)),cliprect.setAttributeNS(null,"height",pf(height)),current.element=cliprect,this.clip("nonzero");var imgEl=document.createElementNS(NS,"svg:image");imgEl.setAttributeNS(XLINK_NS,"xlink:href",imgSrc),imgEl.setAttributeNS(null,"x","0"),imgEl.setAttributeNS(null,"y",pf(-height)),imgEl.setAttributeNS(null,"width",pf(width)+"px"),imgEl.setAttributeNS(null,"height",pf(height)+"px"),imgEl.setAttributeNS(null,"transform","scale("+pf(1/width)+" "+pf(-1/height)+")"),mask?mask.appendChild(imgEl):this.tgrp.appendChild(imgEl),current.pendingClip?(this.cgrp.appendChild(this.tgrp),this.pgrp.appendChild(this.cgrp)):this.pgrp.appendChild(this.tgrp)},paintImageMaskXObject:function(imgData){var current=this.current,width=imgData.width,height=imgData.height,fillColor=current.fillColor;current.maskId="mask"+maskCount++;var mask=document.createElementNS(NS,"svg:mask");mask.setAttributeNS(null,"id",current.maskId);var rect=document.createElementNS(NS,"svg:rect");rect.setAttributeNS(null,"x","0"),rect.setAttributeNS(null,"y","0"),rect.setAttributeNS(null,"width",pf(width)),rect.setAttributeNS(null,"height",pf(height)),rect.setAttributeNS(null,"fill",fillColor),rect.setAttributeNS(null,"mask","url(#"+current.maskId+")"),this.defs.appendChild(mask),this.tgrp.appendChild(rect),this.paintInlineImageXObject(imgData,mask)},paintFormXObjectBegin:function(matrix,bbox){if(this.save(),isArray(matrix)&&6===matrix.length&&this.transform(matrix[0],matrix[1],matrix[2],matrix[3],matrix[4],matrix[5]),isArray(bbox)&&4===bbox.length){var width=bbox[2]-bbox[0],height=bbox[3]-bbox[1],cliprect=document.createElementNS(NS,"svg:rect");cliprect.setAttributeNS(null,"x",bbox[0]),cliprect.setAttributeNS(null,"y",bbox[1]),cliprect.setAttributeNS(null,"width",pf(width)),cliprect.setAttributeNS(null,"height",pf(height)),this.current.element=cliprect,this.clip("nonzero"),this.endPath()}},paintFormXObjectEnd:function(){this.restore()}},SVGGraphics}();PDFJS.SVGGraphics=SVGGraphics}.call("undefined"==typeof window?this:window),PDFJS.workerSrc||"undefined"==typeof document||(PDFJS.workerSrc=function(){"use strict";var scriptTagContainer=document.body||document.getElementsByTagName("head")[0],pdfjsSrc=scriptTagContainer.lastChild.src;return pdfjsSrc&&pdfjsSrc.replace(/\.js$/i,".worker.js")}());