@selfcommunity/react-templates
Version:
React Templates Components to integrate a Community created with SelfCommunity.
2 lines • 1.05 MB
JavaScript
/*! For license information please see 73cbb3dbfaa3ddd4df47.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=e.pdfjsWorker=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf.worker",[],(()=>e.pdfjsWorker=t())):"object"==typeof exports?exports["pdfjs-dist/build/pdf.worker"]=e.pdfjsWorker=t():e["pdfjs-dist/build/pdf.worker"]=e.pdfjsWorker=t()}(globalThis,(()=>(()=>{"use strict";var e=[,(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerTask=t.WorkerMessageHandler=void 0;var n=a(2),r=a(3),i=a(4),s=a(6),o=a(10),c=a(68),l=a(73),h=a(104),u=a(105),d=a(72);class f{constructor(e){this.name=e,this.terminated=!1,this._capability=new n.PromiseCapability}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}t.WorkerTask=f;class g{static setup(e,t){let a=!1;e.on("test",(function(t){a||(a=!0,e.send("test",t instanceof Uint8Array))})),e.on("configure",(function(e){(0,n.setVerbosityLevel)(e.verbosity)})),e.on("GetDocRequest",(function(e){return g.createDocumentHandler(e,t)}))}static createDocumentHandler(e,t){let a,g=!1,p=null;const m=new Set,b=(0,n.getVerbosityLevel)(),{docId:y,apiVersion:w}=e,x="3.11.174";if(w!==x)throw new Error(`The API version "${w}" does not match the Worker version "${x}".`);const S=[];for(const e in[])S.push(e);if(S.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+S.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");const A=y+"_worker";let k=new h.MessageHandler(A,y,t);function C(){if(g)throw new Error("Worker was terminated")}function v(e){m.add(e)}function F(e){e.finish(),m.delete(e)}async function O(e){await a.ensureDoc("checkHeader"),await a.ensureDoc("parseStartXRef"),await a.ensureDoc("parse",[e]),await a.ensureDoc("checkFirstPage",[e]),await a.ensureDoc("checkLastPage",[e]);const t=await a.ensureDoc("isPureXfa");if(t){const e=new f("loadXfaFonts");v(e),await Promise.all([a.loadXfaFonts(k,e).catch((e=>{})).then((()=>F(e))),a.loadXfaImages()])}const[n,r]=await Promise.all([a.ensureDoc("numPages"),a.ensureDoc("fingerprints")]);return{numPages:n,fingerprints:r,htmlForXfa:t?await a.ensureDoc("htmlForXfa"):null}}return k.on("GetPage",(function(e){return a.getPage(e.pageIndex).then((function(e){return Promise.all([a.ensure(e,"rotate"),a.ensure(e,"ref"),a.ensure(e,"userUnit"),a.ensure(e,"view")]).then((function([e,t,a,n]){return{rotate:e,ref:t,userUnit:a,view:n}}))}))})),k.on("GetPageIndex",(function(e){const t=i.Ref.get(e.num,e.gen);return a.ensureCatalog("getPageIndex",[t])})),k.on("GetDestinations",(function(e){return a.ensureCatalog("destinations")})),k.on("GetDestination",(function(e){return a.ensureCatalog("getDestination",[e.id])})),k.on("GetPageLabels",(function(e){return a.ensureCatalog("pageLabels")})),k.on("GetPageLayout",(function(e){return a.ensureCatalog("pageLayout")})),k.on("GetPageMode",(function(e){return a.ensureCatalog("pageMode")})),k.on("GetViewerPreferences",(function(e){return a.ensureCatalog("viewerPreferences")})),k.on("GetOpenAction",(function(e){return a.ensureCatalog("openAction")})),k.on("GetAttachments",(function(e){return a.ensureCatalog("attachments")})),k.on("GetDocJSActions",(function(e){return a.ensureCatalog("jsActions")})),k.on("GetPageJSActions",(function({pageIndex:e}){return a.getPage(e).then((function(e){return a.ensure(e,"jsActions")}))})),k.on("GetOutline",(function(e){return a.ensureCatalog("documentOutline")})),k.on("GetOptionalContentConfig",(function(e){return a.ensureCatalog("optionalContentConfig")})),k.on("GetPermissions",(function(e){return a.ensureCatalog("permissions")})),k.on("GetMetadata",(function(e){return Promise.all([a.ensureDoc("documentInfo"),a.ensureCatalog("metadata")])})),k.on("GetMarkInfo",(function(e){return a.ensureCatalog("markInfo")})),k.on("GetData",(function(e){return a.requestLoadedStream().then((function(e){return e.bytes}))})),k.on("GetAnnotations",(function({pageIndex:e,intent:t}){return a.getPage(e).then((function(a){const n=new f(`GetAnnotations: page ${e}`);return v(n),a.getAnnotationsData(k,n,t).then((e=>(F(n),e)),(e=>{throw F(n),e}))}))})),k.on("GetFieldObjects",(function(e){return a.ensureDoc("fieldObjects")})),k.on("HasJSActions",(function(e){return a.ensureDoc("hasJSActions")})),k.on("GetCalculationOrderIds",(function(e){return a.ensureDoc("calculationOrderIds")})),k.on("SaveDocument",(async function({isPureXfa:e,numPages:t,annotationStorage:s,filename:c}){const h=[a.requestLoadedStream(),a.ensureCatalog("acroForm"),a.ensureCatalog("acroFormRef"),a.ensureDoc("startXRef"),a.ensureDoc("xref"),a.ensureDoc("linearization"),a.ensureCatalog("structTreeRoot")],u=[],g=e?null:(0,r.getNewAnnotationsMap)(s),[p,m,b,y,w,x,S]=await Promise.all(h),A=w.trailer.getRaw("Root")||null;let C;if(g){S?await S.canUpdateStructTree({pdfManager:a,newAnnotationsByPage:g})&&(C=S):await d.StructTreeRoot.canCreateStructureTree({catalogRef:A,pdfManager:a,newAnnotationsByPage:g})&&(C=null);const e=o.AnnotationFactory.generateImages(s.values(),w,a.evaluatorOptions.isOffscreenCanvasSupported),t=void 0===C?u:[];for(const[n,r]of g)t.push(a.getPage(n).then((t=>{const a=new f(`Save (editor): page ${n}`);return t.saveNewAnnotations(k,a,r,e).finally((function(){F(a)}))})));null===C?u.push(Promise.all(t).then((async e=>(await d.StructTreeRoot.createStructureTree({newAnnotationsByPage:g,xref:w,catalogRef:A,pdfManager:a,newRefs:e}),e)))):C&&u.push(Promise.all(t).then((async e=>(await C.updateStructureTree({newAnnotationsByPage:g,pdfManager:a,newRefs:e}),e))))}if(e)u.push(a.serializeXfaData(s));else for(let e=0;e<t;e++)u.push(a.getPage(e).then((function(t){const a=new f(`Save: page ${e}`);return t.save(k,a,s).finally((function(){F(a)}))})));const v=await Promise.all(u);let O=[],I=null;if(e){if(I=v[0],!I)return p.bytes}else if(O=v.flat(2),0===O.length)return p.bytes;const T=b&&m instanceof i.Dict&&O.some((e=>e.needAppearances)),M=m instanceof i.Dict&&m.get("XFA")||null;let P=null,N=!1;if(Array.isArray(M)){for(let e=0,t=M.length;e<t;e+=2)"datasets"===M[e]&&(P=M[e+1],N=!0);null===P&&(P=w.getNewTemporaryRef())}else M&&(0,n.warn)("Unsupported XFA type.");let D=Object.create(null);if(w.trailer){const e=Object.create(null),t=w.trailer.get("Info")||null;t instanceof i.Dict&&t.forEach(((t,a)=>{"string"==typeof a&&(e[t]=(0,n.stringToPDFString)(a))})),D={rootRef:A,encryptRef:w.trailer.getRaw("Encrypt")||null,newRef:w.getNewTemporaryRef(),infoRef:w.trailer.getRaw("Info")||null,info:e,fileIds:w.trailer.get("ID")||null,startXRef:x?y:w.lastXRefStreamPos??y,filename:c}}return(0,l.incrementalUpdate)({originalData:p.bytes,xrefInfo:D,newRefs:O,xref:w,hasXfa:!!M,xfaDatasetsRef:P,hasXfaDatasetsEntry:N,needAppearances:T,acroFormRef:b,acroForm:m,xfaData:I}).finally((()=>{w.resetNewTemporaryRef()}))})),k.on("GetOperatorList",(function(e,t){const r=e.pageIndex;a.getPage(r).then((function(a){const i=new f(`GetOperatorList: page ${r}`);v(i);const s=b>=n.VerbosityLevel.INFOS?Date.now():0;a.getOperatorList({handler:k,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage}).then((function(e){F(i),s&&(0,n.info)(`page=${r+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`),t.close()}),(function(e){F(i),i.terminated||t.error(e)}))}))})),k.on("GetTextContent",(function(e,t){const{pageIndex:r,includeMarkedContent:i,disableNormalization:s}=e;a.getPage(r).then((function(e){const a=new f("GetTextContent: page "+r);v(a);const o=b>=n.VerbosityLevel.INFOS?Date.now():0;e.extractTextContent({handler:k,task:a,sink:t,includeMarkedContent:i,disableNormalization:s}).then((function(){F(a),o&&(0,n.info)(`page=${r+1} - getTextContent: time=`+(Date.now()-o)+"ms"),t.close()}),(function(e){F(a),a.terminated||t.error(e)}))}))})),k.on("GetStructTree",(function(e){return a.getPage(e.pageIndex).then((function(e){return a.ensure(e,"getStructTree")}))})),k.on("FontFallback",(function(e){return a.fontFallback(e.id,k)})),k.on("Cleanup",(function(e){return a.cleanup(!0)})),k.on("Terminate",(function(e){g=!0;const t=[];if(a){a.terminate(new n.AbortException("Worker was terminated."));const e=a.cleanup();t.push(e),a=null}else(0,c.clearGlobalCaches)();p&&p(new n.AbortException("Worker was terminated."));for(const e of m)t.push(e.finished),e.terminate();return Promise.all(t).then((function(){k.destroy(),k=null}))})),k.on("Ready",(function(t){!function(e){function t(e){C(),k.send("GetDoc",{pdfInfo:e})}function i(e){if(C(),e instanceof n.PasswordException){const t=new f(`PasswordException: response ${e.code}`);v(t),k.sendWithPromise("PasswordRequest",e).then((function({password:e}){F(t),a.updatePassword(e),o()})).catch((function(){F(t),k.send("DocException",e)}))}else e instanceof n.InvalidPDFException||e instanceof n.MissingPDFException||e instanceof n.UnexpectedResponseException||e instanceof n.UnknownErrorException?k.send("DocException",e):k.send("DocException",new n.UnknownErrorException(e.message,e.toString()))}function o(){C(),O(!1).then(t,(function(e){C(),e instanceof r.XRefParseException?a.requestLoadedStream().then((function(){C(),O(!0).then(t,i)})):i(e)}))}C(),function({data:e,password:t,disableAutoFetch:a,rangeChunkSize:i,length:o,docBaseUrl:c,enableXfa:l,evaluatorOptions:h}){const d={source:null,disableAutoFetch:a,docBaseUrl:c,docId:y,enableXfa:l,evaluatorOptions:h,handler:k,length:o,password:t,rangeChunkSize:i},f=new n.PromiseCapability;let g;if(e){try{d.source=e,g=new s.LocalPdfManager(d),f.resolve(g)}catch(e){f.reject(e)}return f.promise}let m,b=[];try{m=new u.PDFWorkerStream(k)}catch(e){return f.reject(e),f.promise}const w=m.getFullReader();w.headersReady.then((function(){if(w.isRangeSupported){d.source=m,d.length=w.contentLength,d.disableAutoFetch||=w.isStreamingSupported,g=new s.NetworkPdfManager(d);for(const e of b)g.sendProgressiveData(e);b=[],f.resolve(g),p=null}})).catch((function(e){f.reject(e),p=null}));let x=0;return new Promise((function(e,t){const a=function({value:e,done:i}){try{if(C(),i)return g||function(){const e=(0,r.arrayBuffersToBytes)(b);o&&e.length!==o&&(0,n.warn)("reported HTTP length is different from actual");try{d.source=e,g=new s.LocalPdfManager(d),f.resolve(g)}catch(e){f.reject(e)}b=[]}(),void(p=null);x+=e.byteLength,w.isStreamingSupported||k.send("DocProgress",{loaded:x,total:Math.max(x,w.contentLength||0)}),g?g.sendProgressiveData(e):b.push(e),w.read().then(a,t)}catch(e){t(e)}};w.read().then(a,t)})).catch((function(e){f.reject(e),p=null})),p=function(e){m.cancelAllRequests(e)},f.promise}(e).then((function(e){if(g)throw e.terminate(new n.AbortException("Worker was terminated.")),new Error("Worker was terminated");a=e,a.requestLoadedStream(!0).then((e=>{k.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(o,i)}(e),e=null})),A}static initializeFromPort(e){const t=new h.MessageHandler("worker","main",e);g.setup(t,e),t.send("ready",null)}}t.WorkerMessageHandler=g,"undefined"==typeof window&&!n.isNodeJS&&"undefined"!=typeof self&&function(e){return"function"==typeof e.postMessage&&"onmessage"in e}(self)&&g.initializeFromPort(self)},(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.TextRenderingMode=t.RenderingIntentFlag=t.PromiseCapability=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.MAX_IMAGE_SIZE_TO_CACHE=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.BASELINE_FACTOR=t.AnnotationType=t.AnnotationReplyType=t.AnnotationPrefix=t.AnnotationMode=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0,t.assert=function(e,t){e||s(t)},t.bytesToString=l,t.createValidAbsoluteUrl=function(e,t=null,a=null){if(!e)return null;try{if(a&&"string"==typeof e&&(a.addDefaultProtocol&&e.startsWith("www.")&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),a.tryConvertEncoding))try{e=f(e)}catch{}const n=t?new URL(e,t):new URL(e);if(function(e){switch(e?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}(n))return n}catch{}return null},t.getModificationDate=function(e=new Date){return[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")].join("")},t.getUuid=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto?.randomUUID)return crypto.randomUUID();const e=new Uint8Array(32);if("undefined"!=typeof crypto&&"function"==typeof crypto?.getRandomValues)crypto.getRandomValues(e);else for(let t=0;t<32;t++)e[t]=Math.floor(255*Math.random());return l(e)},t.getVerbosityLevel=function(){return r},t.info=function(e){r>=n.INFOS&&console.log(`Info: ${e}`)},t.isArrayBuffer=function(e){return"object"==typeof e&&void 0!==e?.byteLength},t.isArrayEqual=function(e,t){if(e.length!==t.length)return!1;for(let a=0,n=e.length;a<n;a++)if(e[a]!==t[a])return!1;return!0},t.isNodeJS=void 0,t.normalizeUnicode=function(e){return g||(g=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,p=new Map([["ſt","ſt"]])),e.replaceAll(g,((e,t,a)=>t?t.normalize("NFKC"):p.get(a)))},t.objectFromMap=function(e){const t=Object.create(null);for(const[a,n]of e)t[a]=n;return t},t.objectSize=function(e){return Object.keys(e).length},t.setVerbosityLevel=function(e){Number.isInteger(e)&&(r=e)},t.shadow=o,t.string32=function(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)},t.stringToBytes=h,t.stringToPDFString=function(e){if(e[0]>="ï"){let t;if("þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8"),t)try{const a=new TextDecoder(t,{fatal:!0}),n=h(e);return a.decode(n)}catch(e){i(`stringToPDFString: "${e}".`)}}const t=[];for(let a=0,n=e.length;a<n;a++){const n=d[e.charCodeAt(a)];t.push(n?String.fromCharCode(n):e.charAt(a))}return t.join("")},t.stringToUTF8String=f,t.unreachable=s,t.utf8StringToString=function(e){return unescape(encodeURIComponent(e))},t.warn=i;const a=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=a,t.IDENTITY_MATRIX=[1,0,0,1,0,0],t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0],t.MAX_IMAGE_SIZE_TO_CACHE=1e7,t.LINE_FACTOR=1.35,t.LINE_DESCENT_FACTOR=.35,t.BASELINE_FACTOR=.25925925925925924,t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256},t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},t.AnnotationEditorPrefix="pdfjs_internal_editor_",t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15},t.AnnotationEditorParamsType={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23},t.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},t.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},t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},t.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},t.AnnotationReplyType={GROUP:"Group",REPLY:"R"},t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512},t.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},t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},t.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"},t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"},t.PageActionEventType={O:"PageOpen",C:"PageClose"};const n={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=n,t.CMapCompressionType={NONE:0,BINARY:1},t.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,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91},t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let r=n.WARNINGS;function i(e){r>=n.WARNINGS&&console.log(`Warning: ${e}`)}function s(e){throw new Error(e)}function o(e,t,a,n=!1){return Object.defineProperty(e,t,{value:a,enumerable:!n,configurable:!0,writable:!1}),a}const c=function(){function e(t,a){this.constructor===e&&s("Cannot initialize BaseException."),this.message=t,this.name=a}return e.prototype=new Error,e.constructor=e,e}();function l(e){"object"==typeof e&&void 0!==e?.length||s("Invalid argument for bytesToString");const t=e.length,a=8192;if(t<a)return String.fromCharCode.apply(null,e);const n=[];for(let r=0;r<t;r+=a){const i=Math.min(r+a,t),s=e.subarray(r,i);n.push(String.fromCharCode.apply(null,s))}return n.join("")}function h(e){"string"!=typeof e&&s("Invalid argument for stringToBytes");const t=e.length,a=new Uint8Array(t);for(let n=0;n<t;++n)a[n]=255&e.charCodeAt(n);return a}t.BaseException=c,t.PasswordException=class extends c{constructor(e,t){super(e,"PasswordException"),this.code=t}},t.UnknownErrorException=class extends c{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},t.InvalidPDFException=class extends c{constructor(e){super(e,"InvalidPDFException")}},t.MissingPDFException=class extends c{constructor(e){super(e,"MissingPDFException")}},t.UnexpectedResponseException=class extends c{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}},t.FormatError=class extends c{constructor(e){super(e,"FormatError")}},t.AbortException=class extends c{constructor(e){super(e,"AbortException")}},t.FeatureTest=class{static get isLittleEndian(){return o(this,"isLittleEndian",function(){const e=new Uint8Array(4);return e[0]=1,1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return o(this,"isEvalSupported",function(){try{return new Function(""),!0}catch{return!1}}())}static get isOffscreenCanvasSupported(){return o(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}static get platform(){return"undefined"==typeof navigator?o(this,"platform",{isWin:!1,isMac:!1}):o(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){return o(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}};const u=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));t.Util=class{static makeHexColor(e,t,a){return`#${u[e]}${u[t]}${u[a]}`}static scaleMinMax(e,t){let a;e[0]?(e[0]<0&&(a=t[0],t[0]=t[1],t[1]=a),t[0]*=e[0],t[1]*=e[0],e[3]<0&&(a=t[2],t[2]=t[3],t[3]=a),t[2]*=e[3],t[3]*=e[3]):(a=t[0],t[0]=t[2],t[2]=a,a=t[1],t[1]=t[3],t[3]=a,e[1]<0&&(a=t[2],t[2]=t[3],t[3]=a),t[2]*=e[1],t[3]*=e[1],e[2]<0&&(a=t[0],t[0]=t[1],t[1]=a),t[0]*=e[2],t[1]*=e[2]),t[0]+=e[4],t[1]+=e[4],t[2]+=e[5],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const a=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/a,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/a]}static getAxialAlignedBoundingBox(e,t){const a=this.applyTransform(e,t),n=this.applyTransform(e.slice(2,4),t),r=this.applyTransform([e[0],e[3]],t),i=this.applyTransform([e[2],e[1]],t);return[Math.min(a[0],n[0],r[0],i[0]),Math.min(a[1],n[1],r[1],i[1]),Math.max(a[0],n[0],r[0],i[0]),Math.max(a[1],n[1],r[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],a=e[0]*t[0]+e[1]*t[2],n=e[0]*t[1]+e[1]*t[3],r=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],s=(a+i)/2,o=Math.sqrt((a+i)**2-4*(a*i-r*n))/2,c=s+o||1,l=s-o||1;return[Math.sqrt(c),Math.sqrt(l)]}static normalizeRect(e){const t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){const a=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),n=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(a>n)return null;const r=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return r>i?null:[a,r,n,i]}static bezierBoundingBox(e,t,a,n,r,i,s,o){const c=[],l=[[],[]];let h,u,d,f,g,p,m,b;for(let l=0;l<2;++l)if(0===l?(u=6*e-12*a+6*r,h=-3*e+9*a-9*r+3*s,d=3*a-3*e):(u=6*t-12*n+6*i,h=-3*t+9*n-9*i+3*o,d=3*n-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-d/u,0<f&&f<1&&c.push(f)}else m=u*u-4*d*h,b=Math.sqrt(m),m<0||(g=(-u+b)/(2*h),0<g&&g<1&&c.push(g),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p));let y,w=c.length;const x=w;for(;w--;)f=c[w],y=1-f,l[0][w]=y*y*y*e+3*y*y*f*a+3*y*f*f*r+f*f*f*s,l[1][w]=y*y*y*t+3*y*y*f*n+3*y*f*f*i+f*f*f*o;return l[0][x]=e,l[1][x]=t,l[0][x+1]=s,l[1][x+1]=o,l[0].length=l[1].length=x+2,[Math.min(...l[0]),Math.min(...l[1]),Math.max(...l[0]),Math.max(...l[1])]}};const d=[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 f(e){return decodeURIComponent(escape(e))}t.PromiseCapability=class{#e=!1;constructor(){this.promise=new Promise(((e,t)=>{this.resolve=t=>{this.#e=!0,e(t)},this.reject=e=>{this.#e=!0,t(e)}}))}get settled(){return this.#e}};let g=null,p=null;t.AnnotationPrefix="pdfjs_internal_id_"},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.XRefParseException=t.XRefEntryException=t.ParserEOFException=t.PDF_VERSION_REGEXP=t.MissingDataException=void 0,t.arrayBuffersToBytes=function(e){const t=e.length;if(0===t)return new Uint8Array(0);if(1===t)return new Uint8Array(e[0]);let a=0;for(let n=0;n<t;n++)a+=e[n].byteLength;const n=new Uint8Array(a);let r=0;for(let a=0;a<t;a++){const t=new Uint8Array(e[a]);n.set(t,r),r+=t.byteLength}return n},t.collectActions=function(e,t,a){const i=Object.create(null),s=h({dict:t,key:"AA",stopWhenFound:!1});if(s)for(let t=s.length-1;t>=0;t--){const n=s[t];if(n instanceof r.Dict)for(const t of n.getKeys()){const s=a[t];if(!s)continue;const o=[];d(n.getRaw(t),e,o,new r.RefSet),o.length>0&&(i[s]=o)}}if(t.has("A")){const a=[];d(t.get("A"),e,a,new r.RefSet),a.length>0&&(i.Action=a)}return(0,n.objectSize)(i)>0?i:null},t.encodeToXmlString=function(e){const t=[];let a=0;for(let n=0,r=e.length;n<r;n++){const r=e.codePointAt(n);if(32<=r&&r<=126){const i=f[r];i&&(a<n&&t.push(e.substring(a,n)),t.push(i),a=n+1)}else a<n&&t.push(e.substring(a,n)),t.push(`&#x${r.toString(16).toUpperCase()};`),r>55295&&(r<57344||r>65533)&&n++,a=n+1}return 0===t.length?e:(a<e.length&&t.push(e.substring(a,e.length)),t.join(""))},t.escapePDFName=function(e){const t=[];let a=0;for(let n=0,r=e.length;n<r;n++){const r=e.charCodeAt(n);(r<33||r>126||35===r||40===r||41===r||60===r||62===r||91===r||93===r||123===r||125===r||47===r||37===r)&&(a<n&&t.push(e.substring(a,n)),t.push(`#${r.toString(16)}`),a=n+1)}return 0===t.length?e:(a<e.length&&t.push(e.substring(a,e.length)),t.join(""))},t.escapeString=function(e){return e.replaceAll(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))},t.getInheritableProperty=h,t.getLookupTableFactory=function(e){let t;return function(){return e&&(t=Object.create(null),e(t),e=null),t}},t.getNewAnnotationsMap=function(e){if(!e)return null;const t=new Map;for(const[a,r]of e){if(!a.startsWith(n.AnnotationEditorPrefix))continue;let e=t.get(r.pageIndex);e||(e=[],t.set(r.pageIndex,e)),e.push(r)}return t.size>0?t:null},t.getRotationMatrix=function(e,t,a){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,a];case 270:return[0,-1,1,0,0,a];default:throw new Error("Invalid rotation")}},t.isAscii=function(e){return/^[\x00-\x7F]*$/.test(e)},t.isWhiteSpace=function(e){return 32===e||9===e||13===e||10===e},t.log2=function(e){return e<=0?0:Math.ceil(Math.log2(e))},t.numberToString=function(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);return t%100==0?(t/100).toString():t%10==0?e.toFixed(1):e.toFixed(2)},t.parseXFAPath=function(e){const t=/(.+)\[(\d+)\]$/;return e.split(".").map((e=>{const a=e.match(t);return a?{name:a[1],pos:parseInt(a[2],10)}:{name:e,pos:0}}))},t.readInt8=function(e,t){return e[t]<<24>>24},t.readUint16=function(e,t){return e[t]<<8|e[t+1]},t.readUint32=function(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0},t.recoverJsURL=function(e){const t=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").replaceAll(".","\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(e);if(t?.[2]){const e=t[2];let a=!1;return"true"===t[3]&&"app.launchURL"===t[1]&&(a=!0),{url:e,newWindow:a}}return null},t.stringToUTF16HexString=function(e){const t=[];for(let a=0,n=e.length;a<n;a++){const n=e.charCodeAt(a);t.push((n>>8&255).toString(16).padStart(2,"0"),(255&n).toString(16).padStart(2,"0"))}return t.join("")},t.stringToUTF16String=function(e,t=!1){const a=[];t&&a.push("þÿ");for(let t=0,n=e.length;t<n;t++){const n=e.charCodeAt(t);a.push(String.fromCharCode(n>>8&255),String.fromCharCode(255&n))}return a.join("")},t.toRomanNumerals=function(e,t=!1){(0,n.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const a=[];let r;for(;e>=1e3;)e-=1e3,a.push("M");r=e/100|0,e%=100,a.push(u[r]),r=e/10|0,e%=10,a.push(u[10+r]),a.push(u[20+e]);const i=a.join("");return t?i.toLowerCase():i},t.validateCSSFont=function(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:a,fontWeight:n,italicAngle:r}=e;if(!g(a,!0))return!1;const i=n?n.toString():"";e.fontWeight=t.has(i)?i:"400";const s=parseFloat(r);return e.italicAngle=isNaN(s)||s<-90||s>90?"14":r.toString(),!0},t.validateFontName=g;var n=a(2),r=a(4),i=a(5);t.PDF_VERSION_REGEXP=/^[1-9]\.\d$/;class s extends n.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException"),this.begin=e,this.end=t}}t.MissingDataException=s;class o extends n.BaseException{constructor(e){super(e,"ParserEOFException")}}t.ParserEOFException=o;class c extends n.BaseException{constructor(e){super(e,"XRefEntryException")}}t.XRefEntryException=c;class l extends n.BaseException{constructor(e){super(e,"XRefParseException")}}function h({dict:e,key:t,getArray:a=!1,stopWhenFound:n=!0}){let i;const s=new r.RefSet;for(;e instanceof r.Dict&&(!e.objId||!s.has(e.objId));){e.objId&&s.put(e.objId);const r=a?e.getArray(t):e.get(t);if(void 0!==r){if(n)return r;(i||=[]).push(r)}e=e.get("Parent")}return i}t.XRefParseException=l;const u=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function d(e,t,a,s){if(!e)return;let o=null;if(e instanceof r.Ref){if(s.has(e))return;o=e,s.put(o),e=t.fetch(e)}if(Array.isArray(e))for(const n of e)d(n,t,a,s);else if(e instanceof r.Dict){if((0,r.isName)(e.get("S"),"JavaScript")){const t=e.get("JS");let r;t instanceof i.BaseStream?r=t.getString():"string"==typeof t&&(r=t),r&&=(0,n.stringToPDFString)(r).replaceAll("\0",""),r&&a.push(r)}d(e.getRaw("Next"),t,a,s)}o&&s.remove(o)}const f={60:"<",62:">",38:"&",34:""",39:"'"};function g(e,t=!1){const a=/^("|').*("|')$/.exec(e);if(a&&a[1]===a[2]){if(new RegExp(`[^\\\\]${a[1]}`).test(e.slice(1,-1)))return t&&(0,n.warn)(`FontFamily contains unescaped ${a[1]}: ${e}.`),!1}else for(const a of e.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(a)||!/^[\w-\\]+$/.test(a))return t&&(0,n.warn)(`FontFamily contains invalid <custom-ident>: ${e}.`),!1;return!0}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RefSetCache=t.RefSet=t.Ref=t.Name=t.EOF=t.Dict=t.Cmd=t.CIRCULAR_REF=void 0,t.clearPrimitiveCaches=function(){s=Object.create(null),o=Object.create(null),c=Object.create(null)},t.isCmd=function(e,t){return e instanceof h&&(void 0===t||e.cmd===t)},t.isDict=function(e,t){return e instanceof d&&(void 0===t||m(e.get("Type"),t))},t.isName=m,t.isRefsEqual=function(e,t){return e.num===t.num&&e.gen===t.gen};var n=a(2);const r=Symbol("CIRCULAR_REF");t.CIRCULAR_REF=r;const i=Symbol("EOF");t.EOF=i;let s=Object.create(null),o=Object.create(null),c=Object.create(null);class l{constructor(e){this.name=e}static get(e){return o[e]||=new l(e)}}t.Name=l;class h{constructor(e){this.cmd=e}static get(e){return s[e]||=new h(e)}}t.Cmd=h;const u=function(){return u};class d{constructor(e=null){this._map=Object.create(null),this.xref=e,this.objId=null,this.suppressEncryption=!1,this.__nonSerializable__=u}assignXref(e){this.xref=e}get size(){return Object.keys(this._map).length}get(e,t,a){let n=this._map[e];return void 0===n&&void 0!==t&&(n=this._map[t],void 0===n&&void 0!==a&&(n=this._map[a])),n instanceof f&&this.xref?this.xref.fetch(n,this.suppressEncryption):n}async getAsync(e,t,a){let n=this._map[e];return void 0===n&&void 0!==t&&(n=this._map[t],void 0===n&&void 0!==a&&(n=this._map[a])),n instanceof f&&this.xref?this.xref.fetchAsync(n,this.suppressEncryption):n}getArray(e,t,a){let n=this._map[e];if(void 0===n&&void 0!==t&&(n=this._map[t],void 0===n&&void 0!==a&&(n=this._map[a])),n instanceof f&&this.xref&&(n=this.xref.fetch(n,this.suppressEncryption)),Array.isArray(n)){n=n.slice();for(let e=0,t=n.length;e<t;e++)n[e]instanceof f&&this.xref&&(n[e]=this.xref.fetch(n[e],this.suppressEncryption))}return n}getRaw(e){return this._map[e]}getKeys(){return Object.keys(this._map)}getRawValues(){return Object.values(this._map)}set(e,t){this._map[e]=t}has(e){return void 0!==this._map[e]}forEach(e){for(const t in this._map)e(t,this.get(t))}static get empty(){const e=new d(null);return e.set=(e,t)=>{(0,n.unreachable)("Should not call `set` on the empty dictionary.")},(0,n.shadow)(this,"empty",e)}static merge({xref:e,dictArray:t,mergeSubDicts:a=!1}){const n=new d(e),r=new Map;for(const e of t)if(e instanceof d)for(const[t,n]of Object.entries(e._map)){let e=r.get(t);if(void 0===e)e=[],r.set(t,e);else if(!(a&&n instanceof d))continue;e.push(n)}for(const[t,a]of r){if(1===a.length||!(a[0]instanceof d)){n._map[t]=a[0];continue}const r=new d(e);for(const e of a)for(const[t,a]of Object.entries(e._map))void 0===r._map[t]&&(r._map[t]=a);r.size>0&&(n._map[t]=r)}return r.clear(),n.size>0?n:d.empty}clone(){const e=new d(this.xref);for(const t of this.getKeys())e.set(t,this.getRaw(t));return e}}t.Dict=d;class f{constructor(e,t){this.num=e,this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static fromString(e){const t=c[e];if(t)return t;const a=/^(\d+)R(\d*)$/.exec(e);return a&&"0"!==a[1]?c[e]=new f(parseInt(a[1]),a[2]?parseInt(a[2]):0):null}static get(e,t){const a=0===t?`${e}R`:`${e}R${t}`;return c[a]||=new f(e,t)}}t.Ref=f;class g{constructor(e=null){this._set=new Set(e?._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}t.RefSet=g;class p{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}}function m(e,t){return e instanceof l&&(void 0===t||e.name===t)}t.RefSetCache=p},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BaseStream=void 0;var n=a(2);class r{constructor(){this.constructor===r&&(0,n.unreachable)("Cannot initialize BaseStream.")}get length(){(0,n.unreachable)("Abstract getter `length` accessed")}get isEmpty(){(0,n.unreachable)("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return(0,n.shadow)(this,"isDataLoaded",!0)}getByte(){(0,n.unreachable)("Abstract method `getByte` called")}getBytes(e){(0,n.unreachable)("Abstract method `getBytes` called")}peekByte(){const e=this.getByte();return-1!==e&&this.pos--,e}peekBytes(e){const t=this.getBytes(e);return this.pos-=t.length,t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){(0,n.unreachable)("Abstract method `getByteRange` called")}getString(e){return(0,n.bytesToString)(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){(0,n.unreachable)("Abstract method `reset` called")}moveStart(){(0,n.unreachable)("Abstract method `moveStart` called")}makeSubStream(e,t,a=null){(0,n.unreachable)("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}t.BaseStream=r},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkPdfManager=t.LocalPdfManager=void 0;var n=a(2),r=a(7),i=a(3),s=a(9),o=a(8);class c{constructor(e){this.constructor===c&&(0,n.unreachable)("Cannot initialize BasePdfManager."),this._docBaseUrl=function(e){if(e){const t=(0,n.createValidAbsoluteUrl)(e);if(t)return t.href;(0,n.warn)(`Invalid absolute docBaseUrl: "${e}".`)}return null}(e.docBaseUrl),this._docId=e.docId,this._password=e.password,this.enableXfa=e.enableXfa,e.evaluatorOptions.isOffscreenCanvasSupported&&=n.FeatureTest.isOffscreenCanvasSupported,this.evaluatorOptions=e.evaluatorOptions}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){return this._docBaseUrl}get catalog(){return this.pdfDocument.catalog}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}loadXfaFonts(e,t){return this.pdfDocument.loadXfaFonts(e,t)}loadXfaImages(){return this.pdfDocument.loadXfaImages()}serializeXfaData(e){return this.pdfDocument.serializeXfaData(e)}cleanup(e=!1){return this.pdfDocument.cleanup(e)}async ensure(e,t,a){(0,n.unreachable)("Abstract method `ensure` called")}requestRange(e,t){(0,n.unreachable)("Abstract method `requestRange` called")}requestLoadedStream(e=!1){(0,n.unreachable)("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){(0,n.unreachable)("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){(0,n.unreachable)("Abstract method `terminate` called")}}t.LocalPdfManager=class extends c{constructor(e){super(e);const t=new o.Stream(e.source);this.pdfDocument=new s.PDFDocument(this,t),this._loadedStreamPromise=Promise.resolve(t)}async ensure(e,t,a){const n=e[t];return"function"==typeof n?n.apply(e,a):n}requestRange(e,t){return Promise.resolve()}requestLoadedStream(e=!1){return this._loadedStreamPromise}terminate(e){}},t.NetworkPdfManager=class extends c{constructor(e){super(e),this.streamManager=new r.ChunkedStreamManager(e.source,{msgHandler:e.handler,length:e.length,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize}),this.pdfDocument=new s.PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,a){try{const n=e[t];return"function"==typeof n?n.apply(e,a):n}catch(n){if(!(n instanceof i.MissingDataException))throw n;return await this.requestRange(n.begin,n.end),this.ensure(e,t,a)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(e=!1){return this.streamManager.requestAllChunks(e)}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}terminate(e){this.streamManager.abort(e)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ChunkedStreamManager=t.ChunkedStream=void 0;var n=a(3),r=a(2),i=a(8);class s extends i.Stream{constructor(e,t,a){super(new Uint8Array(e),0,e,null),this.chunkSize=t,this._loadedChunks=new Set,this.numChunks=Math.ceil(e/t),this.manager=a,this.progressiveDataLength=0,this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,a=this.numChunks;t<a;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const a=this.chunkSize;if(e%a!=0)throw new Error(`Bad begin offset: ${e}`);const n=e+t.byteLength;if(n%a!=0&&n!==this.bytes.length)throw new Error(`Bad end offset: ${n}`);this.bytes.set(new Uint8Array(t),e);const r=Math.floor(e/a),i=Math.floor((n-1)/a)+1;for(let e=r;e<i;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const a=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t),t+=e.byteLength,this.progressiveDataLength=t;const n=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=a;e<n;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new n.MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const a=Math.floor(e/this.chunkSize);if(a>this.numChunks)return;const r=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=a;i<r;++i)if(!this._loadedChunks.has(i))throw new n.MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let a=0;a<t;++a){const n=(e+a)%t;if(!this._loadedChunks.has(n))return n}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;return e>=this.end?-1:(e>=this.progressiveDataLength&&this.ensureByte(e),this.bytes[this.pos++])}getBytes(e){const t=this.bytes,a=this.pos,n=this.end;if(!e)return n>this.progressiveDataLength&&this.ensureRange(a,n),t.subarray(a,n);let r=a+e;return r>n&&(r=n),r>this.progressiveDataLength&&this.ensureRange(a,r),this.pos=r,t.subarray(a,r)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),t>this.progressiveDataLength&&this.ensureRange(e,t),this.bytes.subarray(e,t)}makeSubStream(e,t,a=null){function n(){}t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e),n.prototype=Object.create(this),n.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),a=Math.floor((this.end-1)/e)+1,n=[];for(let e=t;e<a;++e)this._loadedChunks.has(e)||n.push(e);return n},Object.defineProperty(n.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const r=new n;return r.pos=r.start=e,r.end=e+t||this.end,r.dict=a,r}getBaseStreams(){return[this]}}t.ChunkedStream=s,t.ChunkedStreamManager=class{constructor(e,t){this.length=t.length,this.chunkSize=t.rangeChunkSize,this.stream=new s(this.length,this.chunkSize,this),this.pdfNetworkStream=e,this.disableAutoFetch=t.disableAutoFetch,this.msgHandler=t.msgHandler,this.currRequestId=0,this._chunksNeededByRequest=new Map,this._requestsByChunk=new Map,this._promisesByRequest=new Map,this.progressiveDataLength=0,this.aborted=!1,this._loadedStreamCapability=new r.PromiseCapability}sendRequest(e,t){const a=this.pdfNetworkStream.getRangeReader(e,t);a.isStreamingSupported||(a.onProgress=this.onProgress.bind(this));let r=[],i=0;return new Promise(((e,t)=>{const s=({value:o,done:c})=>{try{if(c){const t=(0,n.arrayBuffersToBytes)(r);return r=null,void e(t)}i+=o.byteLength,a.isStreamingSupported&&this.onProgress({loaded:i}),r.push(o),a.read().then(s,t)}catch(e){t(e)}};a.read().then(s,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(e=!1){if(!e){const e=this.stream.getMissingChunks();this._requestChunks(e)}return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,a=new Set;this._chunksNeededByRequest.set(t,a);for(const t of e)this.stream.hasChunk(t)||a.add(t);if(0===a.size)return Promise.resolve();const n=new r.PromiseCapability;this._promisesByRequest.set(t,n);const i=[];for(const e of a){let a=this._requestsByChunk.get(e);a||(a=[],this._requestsByChunk.set(e,a),i.push(e)),a.push(t)}if(i.length>0){const e=this.groupChunks(i);for(const t of e){const e=t.beginChunk*this.chunkSize,a=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,a).catch(n.reject)}}return n.promise.catch((e=>{if(!this.aborted)throw e}))}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const a=this.getBeginChunk(e),n=this.getEndChunk(t),r=[];for(let e=a;e<n;++e)r.push(e);return this._requestChunks(r)}requestRanges(e=[]){const t=[];for(const a of e){const e=this.getBeginChunk(a.begin),n=this.getEndChunk(a.end);for(let a=e;a<n;++a)t.includes(a)||t.push(a)}return t.sort((function(e,t){return e-t})),this._requestChunks(t)}groupChunks(e){const t=[];let a=-1,n=-1;for(let r=0,i=e.length;r<i;++r){const i=e[r];a<0&&(a=i),n>=0&&n+1!==i&&(t.push({beginChunk:a,endChunk:n+1}),a=i),r+1===e.length&&t.push({beginChunk:a,endChunk:i+1}),n=i}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,a=void 0===e.begin,n=a?this.progressiveDataLength:e.begin,r=n+t.byteLength,i=Math.floor(n/this.chunkSize),s=r<this.length?Math.floor(r/this.chunkSize):Math.ceil(r/this.chunkSize);a?(this.stream.onReceiveProgressiveData(t),this.progressiveDataLength=r):this.stream.onReceiveData(n,t),this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=i;e<s;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const a of t){const t=this._chunksNeededByRequest.get(a);t.has(e)&&t.delete(e),t.size>0||o.push(a)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(s);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e),t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0,this.pdfNetworkStream?.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StringStream=t.Stream=t.NullStream=void 0;var n=a(5),r=a(2);class i extends n.BaseStream{constructor(e,t,a,n){super(),this.bytes=e instanceof Uint8Array?e:new Uint8Array(e),this.start=t||0,this.pos=this.start,this.end=t+a||this.bytes.length,this.dict=n}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,a=this.pos,n=this.end;if(!e)return t.subarray(a,n);let r=a+e;return r>n&&(r=n),this.pos=r,t.subarray(a,r)}getByteRange(e,t){return e<0&&(e=0),t>this.end&&(t=this.end),this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t,a=null){return new i(this.bytes.buffer,e,t,a)}}t.Stream=i,t.StringStream=class extends i{constructor(e){super((0,r.stringToBytes)(e))}},t.NullStream=class extends i{constructor(){super(new Uint8Array(0))}}},(e,t,a)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Page=t.PDFDocument=void 0;var n=a(2),r=a(10),i=a(3),s=a(4),o=a(51),c=a(5),l=a(74),h=a(66),u=a(68),d=a(102),f=a(16),g=a(8),p=a(76),m=a(64),b=a(13),y=a(18),w=a(72),x=a(73),S=a(77),A=a(103);const k=[0,0,612,792];class C{constructor({pdfManager:e,xref:t,pageIndex:a,pageDict:n,ref:r,globalIdFactory:i,fontCache:s,builtInCMapCache:o,standardFontDataCache:c,globalImageCache:l,systemFontCache:h,nonBlendModesSet:u,xfaFactory:d}){this.pdfManager=e,this.pageIndex=a,this.pageDict=n,this.xref=t,this.ref=r,this.fontCache=s,this.builtInCMapCache=o,this.standardFontDataCache=c,this.globalImageCache=l,this.systemFontCache=h,this.nonBlendModesSet=u,this.evaluatorOptions=e.evaluatorOptions,this.resourcesPromise=null,this.xfaFactory=d;const f={obj:0};this._localIdFactory=class extends i{static createObjId(){return`p${a}_${++f.obj}`}static getPageObjId(){return`p${r.toString()}`}}}_getInheritableProperty(e,t=!1){const a=(0,i.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(a)?1!==a.length&&a[0]instanceof s.Dict?s.Dict.merge({xref:this.xref,dictArray:a}):a[0]:a}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this._getInheritableProperty("Resources");return(0,n.shadow)(this,"resources",e instanceof s.Dict?e:s.Dict.empty)}_getBoundingBox(e){if(this.xfaData)return this.xfaData.bbox;let t=this._getInheritableProperty(e,!0);if(Array.isArray(t)&&4===t.length){if(t=n.Util.normalizeRect(t),t[2]-t[0]>0&&t[3]-t[1]>0)return t;(0,n.warn)(`Empty, or invalid, /${e} entry.`)}return null}get mediaBox(){return(0,n.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||k)}get cropBox(){return(0,n.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let e=this.pageDict.get("UserUnit");return("number"!=typeof e||e<=0)&&(e=1),(0,n.shadow)(this,"userUnit",e)}get view(){const{cropBox:e,mediaBox:t}=this;if(e!==t&&!(0,n.isArrayEqual)(e,t)){const a=n.Util.intersect(e,t);if(a&&a[2]-a[0]>0&&a[3]-a[1]>0)return(0,n.shadow)(this,"view",a);(0,n.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,n.shadow)(this,"view",t)}get rotate(){let e=this._getInheritableProperty("Rotate")||0;return e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360),(0,n.shadow)(this,"rotate",e)}_onSubStreamError(e,t){if(!this.evaluatorOptions.ignoreErrors)throw e;(0,n.warn)(`getContentStream - ignoring sub-stream (${t}): "${e}".`)}getContentStream(){return this.pdfManager.ensure(this,"content").then((e=>e instanceof c.BaseStream?e:Array.isArray(e)?new y.StreamsSequenceStream(e,this._onSubStreamError.bind(this)):new g.NullStream))}get xfaData(){return(0,n.shadow)(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}#t(e,t,a){for(const r of e)if(r.id){const e=s.Ref.fromString(r.id);if(!e){(0,n.warn)(`A non-linked annotation cannot be modified: ${r.id}`);continue}if(r.deleted){t.put(e);continue}a?.put(e),r.ref=e,delete r.id}}async saveNewAnnotations(e,t,a,n){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const i=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,systemFontCache:this.systemFontCache,options:this.evaluatorOptions}),o=new s.RefSet,c=new s.RefSet;this.#t(a,o,c);cons