@mstechusa/eviewer7
Version:
[](https://eviewer.net)\r #### A HTML5-based document viewer built on Angular and JavaScript technologies for the highest level of performance and integration into your appli
1 lines • 12.1 MB
JavaScript
(self.webpackChunkdemo_app=self.webpackChunkdemo_app||[]).push([[792],{236:Qn=>{"use strict";Qn.exports=function it(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},655:(Qn,it)=>{"use strict";var Zt=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function K(xe,Qe){return Object.prototype.hasOwnProperty.call(xe,Qe)}it.assign=function(xe){for(var Qe=Array.prototype.slice.call(arguments,1);Qe.length;){var He=Qe.shift();if(He){if("object"!=typeof He)throw new TypeError(He+"must be non-object");for(var Z in He)K(He,Z)&&(xe[Z]=He[Z])}}return xe},it.shrinkBuf=function(xe,Qe){return xe.length===Qe?xe:xe.subarray?xe.subarray(0,Qe):(xe.length=Qe,xe)};var Ue={arraySet:function(xe,Qe,He,Z,T){if(Qe.subarray&&xe.subarray)xe.set(Qe.subarray(He,He+Z),T);else for(var y=0;y<Z;y++)xe[T+y]=Qe[He+y]},flattenChunks:function(xe){var Qe,He,Z,T,y,x;for(Z=0,Qe=0,He=xe.length;Qe<He;Qe++)Z+=xe[Qe].length;for(x=new Uint8Array(Z),T=0,Qe=0,He=xe.length;Qe<He;Qe++)x.set(y=xe[Qe],T),T+=y.length;return x}},tt={arraySet:function(xe,Qe,He,Z,T){for(var y=0;y<Z;y++)xe[T+y]=Qe[He+y]},flattenChunks:function(xe){return[].concat.apply([],xe)}};it.setTyped=function(xe){xe?(it.Buf8=Uint8Array,it.Buf16=Uint16Array,it.Buf32=Int32Array,it.assign(it,Ue)):(it.Buf8=Array,it.Buf16=Array,it.Buf32=Array,it.assign(it,tt))},it.setTyped(Zt)},717:function(Qn,it,Zt){var xe,K=Zt(9293).default;xe=()=>(()=>{"use strict";var Ue=[,(He,Z,T)=>{Object.defineProperty(Z,"__esModule",{value:!0}),Z.VerbosityLevel=Z.Util=Z.UnknownErrorException=Z.UnexpectedResponseException=Z.UNSUPPORTED_FEATURES=Z.TextRenderingMode=Z.StreamType=Z.RenderingIntentFlag=Z.PermissionFlag=Z.PasswordResponses=Z.PasswordException=Z.PageActionEventType=Z.OPS=Z.MissingPDFException=Z.InvalidPDFException=Z.ImageKind=Z.IDENTITY_MATRIX=Z.FormatError=Z.FontType=Z.FeatureTest=Z.FONT_IDENTITY_MATRIX=Z.DocumentActionEventType=Z.CMapCompressionType=Z.BaseException=Z.AnnotationType=Z.AnnotationStateModelType=Z.AnnotationReviewState=Z.AnnotationReplyType=Z.AnnotationMode=Z.AnnotationMarkedState=Z.AnnotationFlag=Z.AnnotationFieldFlag=Z.AnnotationBorderStyleType=Z.AnnotationActionEventType=Z.AbortException=void 0,Z.arrayByteLength=Be,Z.arraysToBytes=function Re(dt){const St=dt.length;if(1===St&&dt[0]instanceof Uint8Array)return dt[0];let L=0;for(let ve=0;ve<St;ve++)L+=Be(dt[ve]);let ht=0;const ft=new Uint8Array(L);for(let ve=0;ve<St;ve++){let je=dt[ve];je instanceof Uint8Array||(je="string"==typeof je?Pe(je):new Uint8Array(je));const yt=je.byteLength;ft.set(je,ht),ht+=yt}return ft},Z.assert=function Je(dt,St){dt||ut(St)},Z.bytesToString=function pe(dt){("object"!=typeof dt||null===dt||void 0===dt.length)&&ut("Invalid argument for bytesToString");const St=dt.length,L=8192;if(St<L)return String.fromCharCode.apply(null,dt);const ht=[];for(let ft=0;ft<St;ft+=L){const ve=Math.min(ft+L,St),je=dt.subarray(ft,ve);ht.push(String.fromCharCode.apply(null,je))}return ht.join("")},Z.createPromiseCapability=function le(){const dt=Object.create(null);let St=!1;return Object.defineProperty(dt,"settled",{get:()=>St}),dt.promise=new Promise(function(L,ht){dt.resolve=function(ft){St=!0,L(ft)},dt.reject=function(ft){St=!0,ht(ft)}}),dt},Z.createValidAbsoluteUrl=function rt(dt,St=null,L=null){if(!dt)return null;try{if(L&&"string"==typeof dt){if(L.addDefaultProtocol&&dt.startsWith("www.")){const ft=dt.match(/\./g);ft&&ft.length>=2&&(dt=`http://${dt}`)}if(L.tryConvertEncoding)try{dt=Nt(dt)}catch{}}const ht=St?new URL(dt,St):new URL(dt);if(function We(dt){if(!dt)return!1;switch(dt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(ht))return ht}catch{}return null},Z.escapeString=function rn(dt){return dt.replace(/([()\\\n\r])/g,St=>"\n"===St?"\\n":"\r"===St?"\\r":`\\${St}`)},Z.getModificationDate=function Ct(dt=new Date){return[dt.getUTCFullYear().toString(),(dt.getUTCMonth()+1).toString().padStart(2,"0"),dt.getUTCDate().toString().padStart(2,"0"),dt.getUTCHours().toString().padStart(2,"0"),dt.getUTCMinutes().toString().padStart(2,"0"),dt.getUTCSeconds().toString().padStart(2,"0")].join("")},Z.getVerbosityLevel=function Le(){return we},Z.info=function De(dt){we>=Ee.INFOS&&console.log(`Info: ${dt}`)},Z.isArrayBuffer=function Lt(dt){return"object"==typeof dt&&null!==dt&&void 0!==dt.byteLength},Z.isArrayEqual=function _e(dt,St){if(dt.length!==St.length)return!1;for(let L=0,ht=dt.length;L<ht;L++)if(dt[L]!==St[L])return!1;return!0},Z.isAscii=function Ri(dt){return/^[\x00-\x7F]*$/.test(dt)},Z.objectFromMap=function lt(dt){const St=Object.create(null);for(const[L,ht]of dt)St[L]=ht;return St},Z.objectSize=function bt(dt){return Object.keys(dt).length},Z.setVerbosityLevel=function ge(dt){Number.isInteger(dt)&&(we=dt)},Z.shadow=At,Z.string32=function et(dt){return String.fromCharCode(dt>>24&255,dt>>16&255,dt>>8&255,255&dt)},Z.stringToBytes=Pe,Z.stringToPDFString=function mn(dt){if(dt[0]>="\xef"){let L;if("\xfe"===dt[0]&&"\xff"===dt[1]?L="utf-16be":"\xff"===dt[0]&&"\xfe"===dt[1]?L="utf-16le":"\xef"===dt[0]&&"\xbb"===dt[1]&&"\xbf"===dt[2]&&(L="utf-8"),L)try{const ht=new TextDecoder(L,{fatal:!0}),ft=Pe(dt);return ht.decode(ft)}catch(ht){Oe(`stringToPDFString: "${ht}".`)}}const St=[];for(let L=0,ht=dt.length;L<ht;L++){const ft=wn[dt.charCodeAt(L)];St.push(ft?String.fromCharCode(ft):dt.charAt(L))}return St.join("")},Z.stringToUTF16BEString=function Ce(dt){const St=["\xfe\xff"];for(let L=0,ht=dt.length;L<ht;L++){const ft=dt.charCodeAt(L);St.push(String.fromCharCode(ft>>8&255),String.fromCharCode(255&ft))}return St.join("")},Z.stringToUTF8String=Nt,Z.unreachable=ut,Z.utf8StringToString=function It(dt){return unescape(encodeURIComponent(dt))},Z.warn=Oe,T(2),Z.IDENTITY_MATRIX=[1,0,0,1,0,0],Z.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],Z.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},Z.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Z.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Z.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},Z.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Z.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},Z.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"},Z.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"},Z.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"},Z.AnnotationReplyType={GROUP:"Group",REPLY:"R"},Z.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},Z.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864},Z.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},Z.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"},Z.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},Z.PageActionEventType={O:"PageOpen",C:"PageClose"},Z.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"},Z.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const Ee={ERRORS:0,WARNINGS:1,INFOS:5};Z.VerbosityLevel=Ee,Z.CMapCompressionType={NONE:0,BINARY:1,STREAM:2},Z.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},Z.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"},Z.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let we=Ee.WARNINGS;function Oe(dt){we>=Ee.WARNINGS&&console.log(`Warning: ${dt}`)}function ut(dt){throw new Error(dt)}function At(dt,St,L){return Object.defineProperty(dt,St,{value:L,enumerable:!0,configurable:!0,writable:!1}),L}const Xe=function(){function St(L,ht){this.constructor===St&&ut("Cannot initialize BaseException."),this.message=L,this.name=ht}return St.prototype=new Error,St.constructor=St,St}();function Pe(dt){"string"!=typeof dt&&ut("Invalid argument for stringToBytes");const St=dt.length,L=new Uint8Array(St);for(let ht=0;ht<St;++ht)L[ht]=255&dt.charCodeAt(ht);return L}function Be(dt){return void 0!==dt.length?dt.length:void 0!==dt.byteLength?dt.byteLength:void ut("Invalid argument for arrayByteLength")}Z.BaseException=Xe,Z.PasswordException=class G extends Xe{constructor(St,L){super(St,"PasswordException"),this.code=L}},Z.UnknownErrorException=class ne extends Xe{constructor(St,L){super(St,"UnknownErrorException"),this.details=L}},Z.InvalidPDFException=class V extends Xe{constructor(St){super(St,"InvalidPDFException")}},Z.MissingPDFException=class me extends Xe{constructor(St){super(St,"MissingPDFException")}},Z.UnexpectedResponseException=class ce extends Xe{constructor(St,L){super(St,"UnexpectedResponseException"),this.status=L}},Z.FormatError=class se extends Xe{constructor(St){super(St,"FormatError")}},Z.AbortException=class he extends Xe{constructor(St){super(St,"AbortException")}},Z.FeatureTest=class Gt{static get isLittleEndian(){return At(this,"isLittleEndian",function Rt(){const dt=new Uint8Array(4);return dt[0]=1,1===new Uint32Array(dt.buffer,0,1)[0]}())}static get isEvalSupported(){return At(this,"isEvalSupported",function Vt(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return At(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}};const an=[...Array(256).keys()].map(dt=>dt.toString(16).padStart(2,"0"));class _t{static makeHexColor(St,L,ht){return`#${an[St]}${an[L]}${an[ht]}`}static scaleMinMax(St,L){let ht;St[0]?(St[0]<0&&(ht=L[0],L[0]=L[1],L[1]=ht),L[0]*=St[0],L[1]*=St[0],St[3]<0&&(ht=L[2],L[2]=L[3],L[3]=ht),L[2]*=St[3],L[3]*=St[3]):(ht=L[0],L[0]=L[2],L[2]=ht,ht=L[1],L[1]=L[3],L[3]=ht,St[1]<0&&(ht=L[2],L[2]=L[3],L[3]=ht),L[2]*=St[1],L[3]*=St[1],St[2]<0&&(ht=L[0],L[0]=L[1],L[1]=ht),L[0]*=St[2],L[1]*=St[2]),L[0]+=St[4],L[1]+=St[4],L[2]+=St[5],L[3]+=St[5]}static transform(St,L){return[St[0]*L[0]+St[2]*L[1],St[1]*L[0]+St[3]*L[1],St[0]*L[2]+St[2]*L[3],St[1]*L[2]+St[3]*L[3],St[0]*L[4]+St[2]*L[5]+St[4],St[1]*L[4]+St[3]*L[5]+St[5]]}static applyTransform(St,L){return[St[0]*L[0]+St[1]*L[2]+L[4],St[0]*L[1]+St[1]*L[3]+L[5]]}static applyInverseTransform(St,L){const ht=L[0]*L[3]-L[1]*L[2];return[(St[0]*L[3]-St[1]*L[2]+L[2]*L[5]-L[4]*L[3])/ht,(-St[0]*L[1]+St[1]*L[0]+L[4]*L[1]-L[5]*L[0])/ht]}static getAxialAlignedBoundingBox(St,L){const ht=_t.applyTransform(St,L),ft=_t.applyTransform(St.slice(2,4),L),ve=_t.applyTransform([St[0],St[3]],L),je=_t.applyTransform([St[2],St[1]],L);return[Math.min(ht[0],ft[0],ve[0],je[0]),Math.min(ht[1],ft[1],ve[1],je[1]),Math.max(ht[0],ft[0],ve[0],je[0]),Math.max(ht[1],ft[1],ve[1],je[1])]}static inverseTransform(St){const L=St[0]*St[3]-St[1]*St[2];return[St[3]/L,-St[1]/L,-St[2]/L,St[0]/L,(St[2]*St[5]-St[4]*St[3])/L,(St[4]*St[1]-St[5]*St[0])/L]}static apply3dTransform(St,L){return[St[0]*L[0]+St[1]*L[1]+St[2]*L[2],St[3]*L[0]+St[4]*L[1]+St[5]*L[2],St[6]*L[0]+St[7]*L[1]+St[8]*L[2]]}static singularValueDecompose2dScale(St){const L=[St[0],St[2],St[1],St[3]],ht=St[0]*L[0]+St[1]*L[2],je=St[2]*L[1]+St[3]*L[3],yt=(ht+je)/2,vn=Math.sqrt((ht+je)**2-4*(ht*je-(St[2]*L[0]+St[3]*L[2])*(St[0]*L[1]+St[1]*L[3])))/2,zt=yt-vn||1;return[Math.sqrt(yt+vn||1),Math.sqrt(zt)]}static normalizeRect(St){const L=St.slice(0);return St[0]>St[2]&&(L[0]=St[2],L[2]=St[0]),St[1]>St[3]&&(L[1]=St[3],L[3]=St[1]),L}static intersect(St,L){const ht=Math.max(Math.min(St[0],St[2]),Math.min(L[0],L[2])),ft=Math.min(Math.max(St[0],St[2]),Math.max(L[0],L[2]));if(ht>ft)return null;const ve=Math.max(Math.min(St[1],St[3]),Math.min(L[1],L[3])),je=Math.min(Math.max(St[1],St[3]),Math.max(L[1],L[3]));return ve>je?null:[ht,ve,ft,je]}static bezierBoundingBox(St,L,ht,ft,ve,je,yt,vn){const jt=[],zt=[[],[]];let ni,wi,_n,Bn,_i,Go,Ar,Ft;for(let Fo=0;Fo<2;++Fo)if(0===Fo?(wi=6*St-12*ht+6*ve,ni=-3*St+9*ht-9*ve+3*yt,_n=3*ht-3*St):(wi=6*L-12*ft+6*je,ni=-3*L+9*ft-9*je+3*vn,_n=3*ft-3*L),Math.abs(ni)<1e-12){if(Math.abs(wi)<1e-12)continue;Bn=-_n/wi,0<Bn&&Bn<1&&jt.push(Bn)}else Ar=wi*wi-4*_n*ni,Ft=Math.sqrt(Ar),!(Ar<0)&&(_i=(-wi+Ft)/(2*ni),0<_i&&_i<1&&jt.push(_i),Go=(-wi-Ft)/(2*ni),0<Go&&Go<1&&jt.push(Go));let mi,hA=jt.length;const cr=hA;for(;hA--;)Bn=jt[hA],mi=1-Bn,zt[0][hA]=mi*mi*mi*St+3*mi*mi*Bn*ht+3*mi*Bn*Bn*ve+Bn*Bn*Bn*yt,zt[1][hA]=mi*mi*mi*L+3*mi*mi*Bn*ft+3*mi*Bn*Bn*je+Bn*Bn*Bn*vn;return zt[0][cr]=St,zt[1][cr]=L,zt[0][cr+1]=yt,zt[1][cr+1]=vn,zt[0].length=zt[1].length=cr+2,[Math.min(...zt[0]),Math.min(...zt[1]),Math.max(...zt[0]),Math.max(...zt[1])]}}Z.Util=_t;const wn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function Nt(dt){return decodeURIComponent(escape(dt))}},(He,Z,T)=>{T(3)},(He,Z)=>{Object.defineProperty(Z,"__esModule",{value:!0}),Z.isNodeJS=void 0;const T=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);Z.isNodeJS=T},(He,Z,T)=>{Object.defineProperty(Z,"__esModule",{value:!0}),Z.build=Z.RenderTask=Z.PDFWorkerUtil=Z.PDFWorker=Z.PDFPageProxy=Z.PDFDocumentProxy=Z.PDFDocumentLoadingTask=Z.PDFDataRangeTransport=Z.LoopbackPort=Z.DefaultStandardFontDataFactory=Z.DefaultCanvasFactory=Z.DefaultCMapReaderFactory=void 0,Z.getDocument=function Ae(Xe){localStorage.removeItem("globalUrlObj"),!(Xe instanceof Uint8Array)&&null!=Xe.viewerUrl&&localStorage.setItem("globalUrlObj",JSON.stringify(Xe));const G=new be;let ne;if("string"==typeof Xe||Xe instanceof URL)ne={url:Xe};else if((0,y.isArrayBuffer)(Xe))ne={data:Xe};else if(Xe instanceof ke)ne={range:Xe};else{if("object"!=typeof Xe)throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!Xe.url&&!Xe.data&&!Xe.range)throw new Error("Invalid parameter object: need either .data, .range or .url");ne=Xe}const V=Object.create(null);let me=null,ce=null;for(const he in ne){const pe=ne[he];switch(he){case"url":if(typeof window<"u")try{V[he]=new URL(pe,window.location).href;continue}catch(Pe){(0,y.warn)(`Cannot create valid URL: "${Pe}".`)}else if("string"==typeof pe||pe instanceof URL){V[he]=pe.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":me=pe;continue;case"worker":ce=pe;continue;case"data":if(D.isNodeJS&&typeof Buffer<"u"&&pe instanceof Buffer)V[he]=new Uint8Array(pe);else{if(pe instanceof Uint8Array)break;if("string"==typeof pe)V[he]=(0,y.stringToBytes)(pe);else if("object"!=typeof pe||null===pe||isNaN(pe.length)){if(!(0,y.isArrayBuffer)(pe))throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.");V[he]=new Uint8Array(pe)}else V[he]=new Uint8Array(pe)}continue}V[he]=pe}if(V.CMapReaderFactory=V.CMapReaderFactory||Se,V.StandardFontDataFactory=V.StandardFontDataFactory||ue,V.ignoreErrors=!0!==V.stopAtErrors,V.fontExtraProperties=!0===V.fontExtraProperties,V.pdfBug=!0===V.pdfBug,V.enableXfa=!0===V.enableXfa,(!Number.isInteger(V.rangeChunkSize)||V.rangeChunkSize<1)&&(V.rangeChunkSize=ee),("string"!=typeof V.docBaseUrl||(0,x.isDataScheme)(V.docBaseUrl))&&(V.docBaseUrl=null),(!Number.isInteger(V.maxImageSize)||V.maxImageSize<-1)&&(V.maxImageSize=-1),"string"!=typeof V.cMapUrl&&(V.cMapUrl=null),"string"!=typeof V.standardFontDataUrl&&(V.standardFontDataUrl=null),"boolean"!=typeof V.useWorkerFetch&&(V.useWorkerFetch=V.CMapReaderFactory===x.DOMCMapReaderFactory&&V.StandardFontDataFactory===x.DOMStandardFontDataFactory),"boolean"!=typeof V.isEvalSupported&&(V.isEvalSupported=!0),"boolean"!=typeof V.disableFontFace&&(V.disableFontFace=D.isNodeJS),"boolean"!=typeof V.useSystemFonts&&(V.useSystemFonts=!D.isNodeJS&&!V.disableFontFace),("object"!=typeof V.ownerDocument||null===V.ownerDocument)&&(V.ownerDocument=globalThis.document),"boolean"!=typeof V.disableRange&&(V.disableRange=!1),"boolean"!=typeof V.disableStream&&(V.disableStream=!1),"boolean"!=typeof V.disableAutoFetch&&(V.disableAutoFetch=!1),(0,y.setVerbosityLevel)(V.verbosity),!ce){const he={verbosity:V.verbosity,port:f.GlobalWorkerOptions.workerPort};ce=he.port?De.fromPort(he):new De(he),G._worker=ce}const se=G.docId;return ce.promise.then(function(){if(G.destroyed)throw new Error("Loading aborted");const he=function Ee(Xe,G,ne,V){return Me.apply(this,arguments)}(ce,V,me,se),pe=new Promise(function(Pe){let Be;me?Be=new X.PDFDataTransportStream({length:V.length,initialData:V.initialData,progressiveDone:V.progressiveDone,contentDispositionFilename:V.contentDispositionFilename,disableRange:V.disableRange,disableStream:V.disableStream},me):V.data||(Be=ae({url:V.url,length:V.length,httpHeaders:V.httpHeaders,withCredentials:V.withCredentials,rangeChunkSize:V.rangeChunkSize,disableRange:V.disableRange,disableStream:V.disableStream})),Pe(Be)});return Promise.all([he,pe]).then(function([Pe,Be]){if(G.destroyed)throw new Error("Loading aborted");const Re=new b.MessageHandler(se,Pe,ce.port),et=new Oe(Re,G,Be,V);G._transport=et,Re.send("Ready",null)})}).catch(G._capability.reject),G},Z.setPDFNetworkStreamFactory=function H(Xe){ae=Xe},Z.version=void 0;var y=T(1),x=T(5),w=T(7),C=T(8),g=T(10),f=T(13),D=T(3),b=T(14),E=T(15),k=T(16),X=T(17),F=T(18);const ee=65536;let de=x.DOMCanvasFactory;Z.DefaultCanvasFactory=de;let Se=x.DOMCMapReaderFactory;Z.DefaultCMapReaderFactory=Se;let ae,ue=x.DOMStandardFontDataFactory;if(Z.DefaultStandardFontDataFactory=ue,D.isNodeJS){const{NodeCanvasFactory:Xe,NodeCMapReaderFactory:G,NodeStandardFontDataFactory:ne}=T(19);Z.DefaultCanvasFactory=de=Xe,Z.DefaultCMapReaderFactory=Se=G,Z.DefaultStandardFontDataFactory=ue=ne}function Me(){return(Me=K(function*(Xe,G,ne,V){if(Xe.destroyed)throw new Error("Worker was destroyed");ne&&(G.length=ne.length,G.initialData=ne.initialData,G.progressiveDone=ne.progressiveDone,G.contentDispositionFilename=ne.contentDispositionFilename);const me=yield Xe.messageHandler.sendWithPromise("GetDocRequest",{docId:V,apiVersion:"2.14.305",source:{data:G.data,url:G.url,password:G.password,disableAutoFetch:G.disableAutoFetch,rangeChunkSize:G.rangeChunkSize,length:G.length},maxImageSize:G.maxImageSize,disableFontFace:G.disableFontFace,docBaseUrl:G.docBaseUrl,ignoreErrors:G.ignoreErrors,isEvalSupported:G.isEvalSupported,fontExtraProperties:G.fontExtraProperties,enableXfa:G.enableXfa,useSystemFonts:G.useSystemFonts,cMapUrl:G.useWorkerFetch?G.cMapUrl:null,standardFontDataUrl:G.useWorkerFetch?G.standardFontDataUrl:null});if(Xe.destroyed)throw new Error("Worker was destroyed");return me})).apply(this,arguments)}class be{static#e=0;constructor(){this._capability=(0,y.createPromiseCapability)(),this._transport=null,this._worker=null,this.docId="d"+be.#e++,this.destroyed=!1,this.onPassword=null,this.onProgress=null,this.onUnsupportedFeature=null}get promise(){return this._capability.promise}destroy(){var G=this;return K(function*(){G.destroyed=!0,yield G._transport?.destroy(),G._transport=null,G._worker&&(G._worker.destroy(),G._worker=null)})()}}Z.PDFDocumentLoadingTask=be;class ke{constructor(G,ne,V=!1,me=null){this.length=G,this.initialData=ne,this.progressiveDone=V,this.contentDispositionFilename=me,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=(0,y.createPromiseCapability)()}addRangeListener(G){this._rangeListeners.push(G)}addProgressListener(G){this._progressListeners.push(G)}addProgressiveReadListener(G){this._progressiveReadListeners.push(G)}addProgressiveDoneListener(G){this._progressiveDoneListeners.push(G)}onDataRange(G,ne){for(const V of this._rangeListeners)V(G,ne)}onDataProgress(G,ne){this._readyCapability.promise.then(()=>{for(const V of this._progressListeners)V(G,ne)})}onDataProgressiveRead(G){this._readyCapability.promise.then(()=>{for(const ne of this._progressiveReadListeners)ne(G)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const G of this._progressiveDoneListeners)G()})}transportReady(){this._readyCapability.resolve()}requestDataRange(G,ne){(0,y.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}Z.PDFDataRangeTransport=ke;class Ve{constructor(G,ne){var me,V=this;this._pdfInfo=G,this._transport=ne,Object.defineProperty(this,"fingerprint",{get(){return(0,x.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead."),this.fingerprints[0]}}),Object.defineProperty(this,"getStats",{value:(me=K(function*(){return(0,x.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead."),V.stats||{streamTypes:{},fontTypes:{}}}),function(){return me.apply(this,arguments)})})}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(G){return this._transport.getPage(G)}getPageIndex(G){return this._transport.getPageIndex(G)}getDestinations(){return this._transport.getDestinations()}getDestination(G){return this._transport.getDestination(G)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(G=!1){return this._transport.startCleanup(G||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}saveDocument(){return this._transport.annotationStorage.size<=0&&(0,x.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead."),this._transport.saveDocument()}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}Z.PDFDocumentProxy=Ve;class we{constructor(G,ne,V,me,ce=!1){this._pageIndex=G,this._pageInfo=ne,this._ownerDocument=me,this._transport=V,this._stats=ce?new x.StatTimer:null,this._pdfBug=ce,this.commonObjs=V.commonObjs,this.objs=new ut,this._bitmaps=new Set,this.cleanupAfterRender=!1,this.pendingCleanup=!1,this._intentStates=new Map,this._annotationPromises=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:G,rotation:ne=this.rotate,offsetX:V=0,offsetY:me=0,dontFlip:ce=!1}={}){return new x.PageViewport({viewBox:this.view,scale:G,rotation:ne,offsetX:V,offsetY:me,dontFlip:ce})}getAnnotations({intent:G="display"}={}){const ne=this._transport.getRenderingIntent(G);let V=this._annotationPromises.get(ne.cacheKey);return V||(V=this._transport.getAnnotations(this._pageIndex,ne.renderingIntent),this._annotationPromises.set(ne.cacheKey,V),V=V.then(me=>{for(const ce of me)void 0!==ce.titleObj&&Object.defineProperty(ce,"title",{get:()=>((0,x.deprecated)("`title`-property on annotation, please use `titleObj` instead."),ce.titleObj.str)}),void 0!==ce.contentsObj&&Object.defineProperty(ce,"contents",{get:()=>((0,x.deprecated)("`contents`-property on annotation, please use `contentsObj` instead."),ce.contentsObj.str)});return me})),V}getJSActions(){return this._jsActionsPromise||=this._transport.getPageJSActions(this._pageIndex)}getXfa(){var G=this;return K(function*(){return G._transport._htmlForXfa?.children[G._pageIndex]||null})()}render({canvasContext:G,viewport:ne,intent:V="display",annotationMode:me=y.AnnotationMode.ENABLE,transform:ce=null,imageLayer:se=null,canvasFactory:he=null,background:pe=null,optionalContentConfigPromise:Pe=null,annotationCanvasMap:Be=null,pageColors:Re=null}){void 0!==arguments[0]?.renderInteractiveForms&&((0,x.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead."),!0===arguments[0].renderInteractiveForms&&me===y.AnnotationMode.ENABLE&&(me=y.AnnotationMode.ENABLE_FORMS)),void 0!==arguments[0]?.includeAnnotationStorage&&((0,x.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead."),!0===arguments[0].includeAnnotationStorage&&me===y.AnnotationMode.ENABLE&&(me=y.AnnotationMode.ENABLE_STORAGE)),this._stats&&this._stats.time("Overall");const et=this._transport.getRenderingIntent(V,me);this.pendingCleanup=!1,Pe||(Pe=this._transport.getOptionalContentConfig());let bt=this._intentStates.get(et.cacheKey);bt||(bt=Object.create(null),this._intentStates.set(et.cacheKey,bt)),bt.streamReaderCancelTimeout&&(clearTimeout(bt.streamReaderCancelTimeout),bt.streamReaderCancelTimeout=null);const lt=he||new de({ownerDocument:this._ownerDocument}),Rt=!!(et.renderingIntent&y.RenderingIntentFlag.PRINT);bt.displayReadyCapability||(bt.displayReadyCapability=(0,y.createPromiseCapability)(),bt.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(et));const Vt=_t=>{bt.renderTasks.delete(Gt),(this.cleanupAfterRender||Rt)&&(this.pendingCleanup=!0),this._tryCleanup(),_t?(Gt.capability.reject(_t),this._abortOperatorList({intentState:bt,reason:_t instanceof Error?_t:new Error(_t)})):Gt.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"))},Gt=new We({callback:Vt,params:{canvasContext:G,viewport:ne,transform:ce,imageLayer:se,background:pe},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Be,operatorList:bt.operatorList,pageIndex:this._pageIndex,canvasFactory:lt,useRequestAnimationFrame:!Rt,pdfBug:this._pdfBug,pageColors:Re});(bt.renderTasks||=new Set).add(Gt);const an=Gt.task;return Promise.all([bt.displayReadyCapability.promise,Pe]).then(([_t,wn])=>{this.pendingCleanup?Vt():(this._stats&&this._stats.time("Rendering"),Gt.initializeGraphics({transparency:_t,optionalContentConfig:wn}),Gt.operatorListChanged())}).catch(Vt),an}getOperatorList({intent:G="display",annotationMode:ne=y.AnnotationMode.ENABLE}={}){const me=this._transport.getRenderingIntent(G,ne,!0);let se,ce=this._intentStates.get(me.cacheKey);return ce||(ce=Object.create(null),this._intentStates.set(me.cacheKey,ce)),ce.opListReadCapability||(se=Object.create(null),se.operatorListChanged=function V(){ce.operatorList.lastChunk&&(ce.opListReadCapability.resolve(ce.operatorList),ce.renderTasks.delete(se))},ce.opListReadCapability=(0,y.createPromiseCapability)(),(ce.renderTasks||=new Set).add(se),ce.operatorList={fnArray:[],argsArray:[],lastChunk:!1},this._stats&&this._stats.time("Page Request"),this._pumpOperatorList(me)),ce.opListReadCapability.promise}streamTextContent({disableCombineTextItems:G=!1,includeMarkedContent:ne=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==G,includeMarkedContent:!0===ne},{highWaterMark:100,size:me=>me.items.length})}getTextContent(G={}){if(this._transport._htmlForXfa)return this.getXfa().then(V=>F.XfaText.textContent(V));const ne=this.streamTextContent(G);return new Promise(function(V,me){const se=ne.getReader(),he={items:[],styles:Object.create(null)};!function ce(){se.read().then(function({value:pe,done:Pe}){Pe?V(he):(Object.assign(he.styles,pe.styles),he.items.push(...pe.items),ce())},me)}()})}getStructTree(){return this._structTreePromise||=this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const G=[];for(const ne of this._intentStates.values())if(this._abortOperatorList({intentState:ne,reason:new Error("Page was destroyed."),force:!0}),!ne.opListReadCapability)for(const V of ne.renderTasks)G.push(V.completed),V.cancel();this.objs.clear();for(const ne of this._bitmaps)ne.close();return this._bitmaps.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,this.pendingCleanup=!1,Promise.all(G)}cleanup(G=!1){return this.pendingCleanup=!0,this._tryCleanup(G)}_tryCleanup(G=!1){if(!this.pendingCleanup)return!1;for(const{renderTasks:ne,operatorList:V}of this._intentStates.values())if(ne.size>0||!V.lastChunk)return!1;this._intentStates.clear(),this.objs.clear(),this._annotationPromises.clear(),this._jsActionsPromise=null,this._structTreePromise=null,G&&this._stats&&(this._stats=new x.StatTimer);for(const ne of this._bitmaps)ne.close();return this._bitmaps.clear(),this.pendingCleanup=!1,!0}_startRenderPage(G,ne){const V=this._intentStates.get(ne);V&&(this._stats&&this._stats.timeEnd("Page Request"),V.displayReadyCapability&&V.displayReadyCapability.resolve(G))}_renderPageChunk(G,ne){for(let V=0,me=G.length;V<me;V++)ne.operatorList.fnArray.push(G.fnArray[V]),ne.operatorList.argsArray.push(G.argsArray[V]);ne.operatorList.lastChunk=G.lastChunk;for(const V of ne.renderTasks)V.operatorListChanged();G.lastChunk&&this._tryCleanup()}_pumpOperatorList({renderingIntent:G,cacheKey:ne}){const me=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:G,cacheKey:ne,annotationStorage:G&y.RenderingIntentFlag.ANNOTATIONS_STORAGE?this._transport.annotationStorage.serializable:null}).getReader(),ce=this._intentStates.get(ne);ce.streamReader=me;const se=()=>{me.read().then(({value:he,done:pe})=>{pe?ce.streamReader=null:this._transport.destroyed||(this._renderPageChunk(he,ce),se())},he=>{if(ce.streamReader=null,!this._transport.destroyed){if(ce.operatorList){ce.operatorList.lastChunk=!0;for(const pe of ce.renderTasks)pe.operatorListChanged();this._tryCleanup()}if(ce.displayReadyCapability)ce.displayReadyCapability.reject(he);else{if(!ce.opListReadCapability)throw he;ce.opListReadCapability.reject(he)}}})};se()}_abortOperatorList({intentState:G,reason:ne,force:V=!1}){if(G.streamReader){if(!V){if(G.renderTasks.size>0)return;if(ne instanceof x.RenderingCancelledException)return void(G.streamReaderCancelTimeout=setTimeout(()=>{this._abortOperatorList({intentState:G,reason:ne,force:!0}),G.streamReaderCancelTimeout=null},100))}if(G.streamReader.cancel(new y.AbortException(ne.message)).catch(()=>{}),G.streamReader=null,!this._transport.destroyed){for(const[me,ce]of this._intentStates)if(ce===G){this._intentStates.delete(me);break}this.cleanup()}}}get stats(){return this._stats}}Z.PDFPageProxy=we;class ge{constructor(){this._listeners=[],this._deferred=Promise.resolve()}postMessage(G,ne){const V={data:structuredClone(G,ne)};this._deferred.then(()=>{for(const me of this._listeners)me.call(this,V)})}addEventListener(G,ne){this._listeners.push(ne)}removeEventListener(G,ne){const V=this._listeners.indexOf(ne);this._listeners.splice(V,1)}terminate(){this._listeners.length=0}}Z.LoopbackPort=ge;const Le={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};if(Z.PDFWorkerUtil=Le,D.isNodeJS)Le.isWorkerDisabled=!0,Le.fallbackWorkerSrc="./pdf.worker.js";else if("object"==typeof document){const Xe=document?.currentScript?.src;Xe&&(Le.fallbackWorkerSrc=Xe.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}Le.isSameOrigin=function(Xe,G){let ne;try{if(ne=new URL(Xe),!ne.origin||"null"===ne.origin)return!1}catch{return!1}const V=new URL(G,ne);return ne.origin===V.origin},Le.createCDNWrapper=function(Xe){return URL.createObjectURL(new Blob([`importScripts("${Xe}");`]))};class De{static#e=new WeakMap;constructor({name:G=null,port:ne=null,verbosity:V=(0,y.getVerbosityLevel)()}={}){if(ne&&De.#e.has(ne))throw new Error("Cannot use more than one PDFWorker per port.");if(this.name=G,this.destroyed=!1,this.verbosity=V,this._readyCapability=(0,y.createPromiseCapability)(),this._port=null,this._webWorker=null,this._messageHandler=null,ne)return De.#e.set(ne,this),void this._initializeFromPort(ne);this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(G){this._port=G,this._messageHandler=new b.MessageHandler("main","worker",G),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve()}_initialize(){if(typeof Worker<"u"&&!Le.isWorkerDisabled&&!De._mainThreadWorkerMessageHandler){let G=De.workerSrc;try{Le.isSameOrigin(window.location.href,G)||(G=Le.createCDNWrapper(new URL(G,window.location).href));const ne=new Worker(G),V=new b.MessageHandler("main","worker",ne),me=()=>{ne.removeEventListener("error",ce),V.destroy(),ne.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},ce=()=>{this._webWorker||me()};ne.addEventListener("error",ce),V.on("test",he=>{ne.removeEventListener("error",ce),this.destroyed?me():he?(this._messageHandler=V,this._port=ne,this._webWorker=ne,this._readyCapability.resolve(),V.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),V.destroy(),ne.terminate())}),V.on("ready",he=>{if(ne.removeEventListener("error",ce),this.destroyed)me();else try{se()}catch{this._setupFakeWorker()}});const se=()=>{const he=new Uint8Array;V.send("test",he,[he.buffer])};return void se()}catch{(0,y.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){Le.isWorkerDisabled||((0,y.warn)("Setting up fake worker."),Le.isWorkerDisabled=!0),De._setupFakeWorkerGlobal.then(G=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const ne=new ge;this._port=ne;const V="fake"+Le.fakeWorkerId++,me=new b.MessageHandler(V+"_worker",V,ne);G.setup(me,ne);const ce=new b.MessageHandler(V,V+"_worker",ne);this._messageHandler=ce,this._readyCapability.resolve(),ce.send("configure",{verbosity:this.verbosity})}).catch(G=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${G.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),De.#e.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(G){if(!G?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return this.#e.has(G.port)?this.#e.get(G.port):new De(G)}static get workerSrc(){if(f.GlobalWorkerOptions.workerSrc)return f.GlobalWorkerOptions.workerSrc;if(null!==Le.fallbackWorkerSrc)return D.isNodeJS||(0,x.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),Le.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){var G=this;const ne=function(){var V=K(function*(){return G._mainThreadWorkerMessageHandler||(D.isNodeJS?null:(yield(0,x.loadScript)(G.workerSrc),window.pdfjsWorker.WorkerMessageHandler))});return function(){return V.apply(this,arguments)}}();return(0,y.shadow)(this,"_setupFakeWorkerGlobal",ne())}}Z.PDFWorker=De,De.getWorkerSrc=function(){return(0,x.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead."),this.workerSrc};class Oe{#e=null;#t=new Map;#n=new Map;#o=null;constructor(G,ne,V,me){this.messageHandler=G,this.loadingTask=ne,this.commonObjs=new ut,this.fontLoader=new w.FontLoader({docId:ne.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:me.ownerDocument,styleElement:me.styleElement}),this._params=me,me.useWorkerFetch||(this.CMapReaderFactory=new me.CMapReaderFactory({baseUrl:me.cMapUrl,isCompressed:me.cMapPacked}),this.StandardFontDataFactory=new me.StandardFontDataFactory({baseUrl:me.standardFontDataUrl})),this.destroyed=!1,this.destroyCapability=null,this._passwordCapability=null,this._networkStream=V,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=(0,y.createPromiseCapability)(),this.setupMessageHandler()}get annotationStorage(){return(0,y.shadow)(this,"annotationStorage",new C.AnnotationStorage)}get stats(){return this.#e}getRenderingIntent(G,ne=y.AnnotationMode.ENABLE,V=!1){let me=y.RenderingIntentFlag.DISPLAY,ce="";switch(G){case"any":me=y.RenderingIntentFlag.ANY;break;case"display":break;case"print":me=y.RenderingIntentFlag.PRINT;break;default:(0,y.warn)(`getRenderingIntent - invalid intent: ${G}`)}switch(ne){case y.AnnotationMode.DISABLE:me+=y.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case y.AnnotationMode.ENABLE:break;case y.AnnotationMode.ENABLE_FORMS:me+=y.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case y.AnnotationMode.ENABLE_STORAGE:me+=y.RenderingIntentFlag.ANNOTATIONS_STORAGE,ce=this.annotationStorage.hash;break;default:(0,y.warn)(`getRenderingIntent - invalid annotationMode: ${ne}`)}return V&&(me+=y.RenderingIntentFlag.OPLIST),{renderingIntent:me,cacheKey:`${me}_${ce}`}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=(0,y.createPromiseCapability)(),this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const G=[];for(const V of this.#t.values())G.push(V._destroy());this.#t.clear(),this.#n.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const ne=this.messageHandler.sendWithPromise("Terminate",null);return G.push(ne),Promise.all(G).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#o=null,this._getFieldObjectsPromise=null,this._hasJSActionsPromise=null,this._networkStream&&this._networkStream.cancelAllRequests(new y.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:G,loadingTask:ne}=this;G.on("GetReader",(V,me)=>{(0,y.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=ce=>{this._lastProgress={loaded:ce.loaded,total:ce.total}},me.onPull=()=>{this._fullReader.read().then(function({value:ce,done:se}){se?me.close():((0,y.assert)((0,y.isArrayBuffer)(ce),"GetReader - expected an ArrayBuffer."),me.enqueue(new Uint8Array(ce),1,[ce]))}).catch(ce=>{me.error(ce)})},me.onCancel=ce=>{this._fullReader.cancel(ce),me.ready.catch(se=>{if(!this.destroyed)throw se})}}),G.on("ReaderHeadersReady",V=>{const me=(0,y.createPromiseCapability)(),ce=this._fullReader;return ce.headersReady.then(()=>{(!ce.isStreamingSupported||!ce.isRangeSupported)&&(this._lastProgress&&ne.onProgress?.(this._lastProgress),ce.onProgress=se=>{ne.onProgress?.({loaded:se.loaded,total:se.total})}),me.resolve({isStreamingSupported:ce.isStreamingSupported,isRangeSupported:ce.isRangeSupported,contentLength:ce.contentLength})},me.reject),me.promise}),G.on("GetRangeReader",(V,me)=>{(0,y.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const ce=this._networkStream.getRangeReader(V.begin,V.end);ce?(me.onPull=()=>{ce.read().then(function({value:se,done:he}){he?me.close():((0,y.assert)((0,y.isArrayBuffer)(se),"GetRangeReader - expected an ArrayBuffer."),me.enqueue(new Uint8Array(se),1,[se]))}).catch(se=>{me.error(se)})},me.onCancel=se=>{ce.cancel(se),me.ready.catch(he=>{if(!this.destroyed)throw he})}):me.close()}),G.on("GetDoc",({pdfInfo:V})=>{this._numPages=V.numPages,this._htmlForXfa=V.htmlForXfa,delete V.htmlForXfa,ne._capability.resolve(new Ve(V,this))}),G.on("DocException",function(V){let me;switch(V.name){case"PasswordException":me=new y.PasswordException(V.message,V.code);break;case"InvalidPDFException":me=new y.InvalidPDFException(V.message);break;case"MissingPDFException":me=new y.MissingPDFException(V.message);break;case"UnexpectedResponseException":me=new y.UnexpectedResponseException(V.message,V.status);break;case"UnknownErrorException":me=new y.UnknownErrorException(V.message,V.details);break;default:(0,y.unreachable)("DocException - expected a valid Error.")}ne._capability.reject(me)}),G.on("PasswordRequest",V=>{if(this._passwordCapability=(0,y.createPromiseCapability)(),ne.onPassword){const me=ce=>{ce instanceof Error?this._passwordCapability.reject(ce):this._passwordCapability.resolve({password:ce})};try{ne.onPassword(me,V.code)}catch(ce){this._passwordCapability.reject(ce)}}else this._passwordCapability.reject(new y.PasswordException(V.message,V.code));return this._passwordCapability.promise}),G.on("DataLoaded",V=>{ne.onProgress?.({loaded:V.length,total:V.length}),this.downloadInfoCapability.resolve(V)}),G.on("StartRenderPage",V=>{this.destroyed||this.#t.get(V.pageIndex)._startRenderPage(V.transparency,V.cacheKey)}),G.on("commonobj",([V,me,ce])=>{if(!this.destroyed&&!this.commonObjs.has(V))switch(me){case"Font":const se=this._params;if("error"in ce){const Pe=ce.error;(0,y.warn)(`Error during font loading: ${Pe}`),this.commonObjs.resolve(V,Pe);break}let he=null;se.pdfBug&&globalThis.FontInspector?.enabled&&(he={registerFont(Pe,Be){globalThis.FontInspector.fontAdded(Pe,Be)}});const pe=new w.FontFaceObject(ce,{isEvalSupported:se.isEvalSupported,disableFontFace:se.disableFontFace,ignoreErrors:se.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:he});this.fontLoader.bind(pe).catch(Pe=>G.sendWithPromise("FontFallback",{id:V})).finally(()=>{!se.fontExtraProperties&&pe.data&&(pe.data=null),this.commonObjs.resolve(V,pe)});break;case"FontPath":case"Image":this.commonObjs.resolve(V,ce);break;default:throw new Error(`Got unknown common object type ${me}`)}}),G.on("obj",([V,me,ce,se])=>{if(this.destroyed)return;const he=this.#t.get(me);if(!he.objs.has(V))switch(ce){case"Image":he.objs.resolve(V,se);const pe=8e6;if(se){let Pe;if(se.bitmap){const{bitmap:Be,width:Re,height:et}=se;Pe=Re*et*4,he._bitmaps.add(Be)}else Pe=se.data?.length||0;Pe>pe&&(he.cleanupAfterRender=!0)}break;case"Pattern":he.objs.resolve(V,se);break;default:throw new Error(`Got unknown object type ${ce}`)}}),G.on("DocProgress",V=>{this.destroyed||ne.onProgress?.({loaded:V.loaded,total:V.total})}),G.on("DocStats",V=>{this.destroyed||(this.#e=Object.freeze({streamTypes:Object.freeze(V.streamTypes),fontTypes:Object.freeze(V.fontTypes)}))}),G.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this)),G.on("FetchBuiltInCMap",V=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.CMapReaderFactory?this.CMapReaderFactory.fetch(V):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),G.on("FetchStandardFontData",V=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.StandardFontDataFactory?this.StandardFontDataFactory.fetch(V):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}_onUnsupportedFeature({featureId:G}){this.destroyed||this.loadingTask.onUnsupportedFeature?.(G)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}getPage(G){if(!Number.isInteger(G)||G<=0||G>this._numPages)return Promise.reject(new Error("Invalid page request."));const ne=G-1,V=this.#n.get(ne);if(V)return V;const me=this.messageHandler.sendWithPromise("GetPage",{pageIndex:ne}).then(ce=>{if(this.destroyed)throw new Error("Transport destroyed");const se=new we(ne,ce,this,this._params.ownerDocument,this._params.pdfBug);return this.#t.set(ne,se),se});return this.#n.set(ne,me),me}getPageIndex(G){return"object"!=typeof G||null===G||!Number.isInteger(G.num)||G.num<0||!Number.isInteger(G.gen)||G.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:G.num,gen:G.gen})}getAnnotations(G,ne){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:G,intent:ne})}saveDocument(){return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:this._fullReader?.filename??null}).finally(()=>{this.annotationStorage.resetModified()})}getFieldObjects(){return this._getFieldObjectsPromise||=this.messageHandler.sendWithPromise("GetFieldObjects",null)}hasJSActions(){return this._hasJSActionsPromise||=this.messageHandler.sendWithPromise("HasJSActions",null)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(G){return"string"!=typeof G?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:G})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}getPageJSActions(G){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:G})}getStructTree(G){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:G})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(G=>new k.OptionalContentConfig(G))}getPermissions(){re