diff --git a/CHANGELOG.md b/CHANGELOG.md index ae62aaf627..5afa00b3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,18 @@ - - # Changelog +## Release v1.7.2 + +Bug Fix: + +- Fixed issue in Server Health Info +- Fixed Security vulnerability in dependencies +- Fixed client string in trace message + +Additional Changes: + +- Remove live logs in Call Home Page +- Update License page + ## Release v1.7.1 Bug Fix: diff --git a/web-app/build/asset-manifest.json b/web-app/build/asset-manifest.json index 21dd436200..52dc12f448 100644 --- a/web-app/build/asset-manifest.json +++ b/web-app/build/asset-manifest.json @@ -1,7 +1,7 @@ { "files": { "main.css": "./static/css/main.e60e4760.css", - "main.js": "./static/js/main.13652d0f.js", + "main.js": "./static/js/main.7830da11.js", "static/js/5301.79001158.chunk.js": "./static/js/5301.79001158.chunk.js", "static/js/9361.ce3b326c.chunk.js": "./static/js/9361.ce3b326c.chunk.js", "static/js/843.791dd143.chunk.js": "./static/js/843.791dd143.chunk.js", @@ -16,7 +16,7 @@ "static/js/6164.8759ced6.chunk.js": "./static/js/6164.8759ced6.chunk.js", "static/js/2372.d67d02b5.chunk.js": "./static/js/2372.d67d02b5.chunk.js", "static/js/1324.71a25603.chunk.js": "./static/js/1324.71a25603.chunk.js", - "static/js/5693.741d3c68.chunk.js": "./static/js/5693.741d3c68.chunk.js", + "static/js/5693.42442779.chunk.js": "./static/js/5693.42442779.chunk.js", "static/js/5872.62eb672b.chunk.js": "./static/js/5872.62eb672b.chunk.js", "static/js/6758.c83201ee.chunk.js": "./static/js/6758.c83201ee.chunk.js", "static/js/755.ac098541.chunk.js": "./static/js/755.ac098541.chunk.js", @@ -33,7 +33,7 @@ "static/js/7041.cfb08b62.chunk.js": "./static/js/7041.cfb08b62.chunk.js", "static/js/2138.7ef0755e.chunk.js": "./static/js/2138.7ef0755e.chunk.js", "static/js/5699.6a74f983.chunk.js": "./static/js/5699.6a74f983.chunk.js", - "static/js/5153.24546201.chunk.js": "./static/js/5153.24546201.chunk.js", + "static/js/5153.c7e382fa.chunk.js": "./static/js/5153.c7e382fa.chunk.js", "static/js/7052.37bcb35a.chunk.js": "./static/js/7052.37bcb35a.chunk.js", "static/js/144.45106af8.chunk.js": "./static/js/144.45106af8.chunk.js", "static/js/5978.e6638d0b.chunk.js": "./static/js/5978.e6638d0b.chunk.js", @@ -91,7 +91,7 @@ "static/js/5079.118cae1f.chunk.js": "./static/js/5079.118cae1f.chunk.js", "static/js/4581.41480fcf.chunk.js": "./static/js/4581.41480fcf.chunk.js", "static/js/6016.2a05d7e1.chunk.js": "./static/js/6016.2a05d7e1.chunk.js", - "static/js/2346.b8159dba.chunk.js": "./static/js/2346.b8159dba.chunk.js", + "static/js/2346.9d72333b.chunk.js": "./static/js/2346.9d72333b.chunk.js", "static/js/1195.955963a0.chunk.js": "./static/js/1195.955963a0.chunk.js", "static/js/1011.925632a1.chunk.js": "./static/js/1011.925632a1.chunk.js", "static/media/videoBG.mp4": "./static/media/videoBG.17363418b3c2246a0e27.mp4", @@ -117,7 +117,7 @@ "static/media/placeholderimage.png": "./static/media/placeholderimage.077ea48bd1ef1f4a883f.png", "index.html": "./index.html", "main.e60e4760.css.map": "./static/css/main.e60e4760.css.map", - "main.13652d0f.js.map": "./static/js/main.13652d0f.js.map", + "main.7830da11.js.map": "./static/js/main.7830da11.js.map", "5301.79001158.chunk.js.map": "./static/js/5301.79001158.chunk.js.map", "9361.ce3b326c.chunk.js.map": "./static/js/9361.ce3b326c.chunk.js.map", "843.791dd143.chunk.js.map": "./static/js/843.791dd143.chunk.js.map", @@ -132,7 +132,7 @@ "6164.8759ced6.chunk.js.map": "./static/js/6164.8759ced6.chunk.js.map", "2372.d67d02b5.chunk.js.map": "./static/js/2372.d67d02b5.chunk.js.map", "1324.71a25603.chunk.js.map": "./static/js/1324.71a25603.chunk.js.map", - "5693.741d3c68.chunk.js.map": "./static/js/5693.741d3c68.chunk.js.map", + "5693.42442779.chunk.js.map": "./static/js/5693.42442779.chunk.js.map", "5872.62eb672b.chunk.js.map": "./static/js/5872.62eb672b.chunk.js.map", "6758.c83201ee.chunk.js.map": "./static/js/6758.c83201ee.chunk.js.map", "755.ac098541.chunk.js.map": "./static/js/755.ac098541.chunk.js.map", @@ -149,7 +149,7 @@ "7041.cfb08b62.chunk.js.map": "./static/js/7041.cfb08b62.chunk.js.map", "2138.7ef0755e.chunk.js.map": "./static/js/2138.7ef0755e.chunk.js.map", "5699.6a74f983.chunk.js.map": "./static/js/5699.6a74f983.chunk.js.map", - "5153.24546201.chunk.js.map": "./static/js/5153.24546201.chunk.js.map", + "5153.c7e382fa.chunk.js.map": "./static/js/5153.c7e382fa.chunk.js.map", "7052.37bcb35a.chunk.js.map": "./static/js/7052.37bcb35a.chunk.js.map", "144.45106af8.chunk.js.map": "./static/js/144.45106af8.chunk.js.map", "5978.e6638d0b.chunk.js.map": "./static/js/5978.e6638d0b.chunk.js.map", @@ -207,12 +207,12 @@ "5079.118cae1f.chunk.js.map": "./static/js/5079.118cae1f.chunk.js.map", "4581.41480fcf.chunk.js.map": "./static/js/4581.41480fcf.chunk.js.map", "6016.2a05d7e1.chunk.js.map": "./static/js/6016.2a05d7e1.chunk.js.map", - "2346.b8159dba.chunk.js.map": "./static/js/2346.b8159dba.chunk.js.map", + "2346.9d72333b.chunk.js.map": "./static/js/2346.9d72333b.chunk.js.map", "1195.955963a0.chunk.js.map": "./static/js/1195.955963a0.chunk.js.map", "1011.925632a1.chunk.js.map": "./static/js/1011.925632a1.chunk.js.map" }, "entrypoints": [ "static/css/main.e60e4760.css", - "static/js/main.13652d0f.js" + "static/js/main.7830da11.js" ] } \ No newline at end of file diff --git a/web-app/build/index.html b/web-app/build/index.html index 1f73d22889..cf1c507182 100644 --- a/web-app/build/index.html +++ b/web-app/build/index.html @@ -1 +1 @@ -
{const s=new Array(256),n=(f-p)/i,a=t/255,r=(e-t)/(255*i);let o=0;for(let l=0;l<=i;l++){const t=Math.round(p+l*n),e=a+l*r;for(let i=o;i<=t;i++)s[i]=e;o=t+1}for(let l=o;l<256;l++)s[l]=s[o-1];return s.join(",")},b="g_".concat(_(ge,this),"_hcm_").concat(t,"_filter"),A=h.filter=r(Ae,this,Se).call(this,b);return r(Ae,this,Ee).call(this,A),r(Ae,this,Ce).call(this,v(g[0],m[0],5),v(g[1],m[1],5),v(g[2],m[2],5),A),h.url="url(#".concat(b,")"),h.url}destroy(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&0!==o(Ae,this,we).size||(_(fe,this)&&(_(fe,this).parentNode.parentNode.remove(),x(fe,this,null)),_(pe,this)&&(_(pe,this).clear(),x(pe,this,null)),x(be,this,0))}},Fo=S?class extends he{_fetchData(t){return ca(t)}}:De;function Oo(){var t,e;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"string"===typeof i||i instanceof URL?i={url:i}:(i instanceof ArrayBuffer||ArrayBuffer.isView(i))&&(i={data:i});const s=new Wo,{docId:n}=s,a=i.url?function(t){if(t instanceof URL)return t.href;try{return new URL(t,window.location).href}catch{if(S&&"string"===typeof t)return t}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}(i.url):null,r=i.data?function(t){if(S&&"undefined"!==typeof Buffer&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if("string"===typeof t)return jt(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||"object"===typeof t&&!isNaN(null===t||void 0===t?void 0:t.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}(i.data):null,o=i.httpHeaders||null,l=!0===i.withCredentials,h=null!==(t=i.password)&&void 0!==t?t:null,c=i.range instanceof Bo?i.range:null,d=Number.isInteger(i.rangeChunkSize)&&i.rangeChunkSize>0?i.rangeChunkSize:Po;let u=i.worker instanceof $o?i.worker:null;const p=i.verbosity,f="string"!==typeof i.docBaseUrl||Ne(i.docBaseUrl)?null:i.docBaseUrl,g="string"===typeof i.cMapUrl?i.cMapUrl:null,m=!1!==i.cMapPacked,v=i.CMapReaderFactory||Do,b="string"===typeof i.standardFontDataUrl?i.standardFontDataUrl:null,A=i.StandardFontDataFactory||Fo,y=!0!==i.stopAtErrors,w=Number.isInteger(i.maxImageSize)&&i.maxImageSize>-1?i.maxImageSize:-1,_=!1!==i.isEvalSupported,x="boolean"===typeof i.isOffscreenCanvasSupported?i.isOffscreenCanvasSupported:!S,k=Number.isInteger(i.canvasMaxAreaInBytes)?i.canvasMaxAreaInBytes:-1,E="boolean"===typeof i.disableFontFace?i.disableFontFace:S,M=!0===i.fontExtraProperties,C=!0===i.enableXfa,R=i.ownerDocument||globalThis.document,T=!0===i.disableRange,P=!0===i.disableStream,L=!0===i.disableAutoFetch,D=!0===i.pdfBug,I=!0===i.enableHWA,F=c?c.length:null!==(e=i.length)&&void 0!==e?e:NaN,O="boolean"===typeof i.useSystemFonts?i.useSystemFonts:!S&&!E,N="boolean"===typeof i.useWorkerFetch?i.useWorkerFetch:v===Le&&A===De&&g&&b&&ze(g,document.baseURI)&&ze(b,document.baseURI),W=i.canvasFactory||new Lo({ownerDocument:R,enableHWA:I}),j=i.filterFactory||new Io({docId:n,ownerDocument:R});_t(p);const B={canvasFactory:W,filterFactory:j};if(N||(B.cMapReaderFactory=new v({baseUrl:g,isCompressed:m}),B.standardFontDataFactory=new A({baseUrl:b})),!u){const t={verbosity:p,port:za.workerPort};u=t.port?$o.fromPort(t):new $o(t),s._worker=u}const H={docId:n,apiVersion:"4.4.168",data:r,password:h,disableAutoFetch:L,rangeChunkSize:d,length:F,docBaseUrl:f,enableXfa:C,evaluatorOptions:{maxImageSize:w,disableFontFace:E,ignoreErrors:y,isEvalSupported:_,isOffscreenCanvasSupported:x,canvasMaxAreaInBytes:k,fontExtraProperties:M,useSystemFonts:O,cMapUrl:N?g:null,standardFontDataUrl:N?b:null}},z={disableFontFace:E,fontExtraProperties:M,ownerDocument:R,pdfBug:D,styleElement:null,loadingParams:{disableAutoFetch:L,enableXfa:C}};return u.promise.then((function(){if(s.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const t=u.messageHandler.sendWithPromise("GetDocRequest",H,r?[r.buffer]:null);let e;if(c)e=new xr(c,{disableRange:T,disableStream:P});else if(!r){if(!a)throw new Error("getDocument - no `url` parameter provided.");e=(t=>{if(S){return function(){return"undefined"!==typeof fetch&&"undefined"!==typeof Response&&"body"in Response.prototype}()&&ze(t.url)?new Dr(t):new Hr(t)}return ze(t.url)?new Dr(t):new Nr(t)})({url:a,length:F,httpHeaders:o,withCredentials:l,rangeChunkSize:d,disableRange:T,disableStream:P})}return t.then((t=>{if(s.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");const i=new sr(n,t,u.port),a=new hl(i,s,e,z,B);s._transport=a,i.send("Ready",null)}))})).catch(s._capability.reject),s}function No(t){return"object"===typeof t&&Number.isInteger(null===t||void 0===t?void 0:t.num)&&t.num>=0&&Number.isInteger(null===t||void 0===t?void 0:t.gen)&&t.gen>=0}class Wo{constructor(){var t,e;this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId="d".concat((jo._=(t=jo._,e=t++,t),e)),this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{var t,e;null!==(t=this._worker)&&void 0!==t&&t.port&&(this._worker._pendingDestroy=!0),await(null===(e=this._transport)||void 0===e?void 0:e.destroy())}catch(s){var i;throw null!==(i=this._worker)&&void 0!==i&&i.port&&delete this._worker._pendingDestroy,s}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}}var jo={_:0};class Bo{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t,this.initialData=e,this.progressiveDone=i,this.contentDispositionFilename=s,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(t){this._rangeListeners.push(t)}addProgressListener(t){this._progressListeners.push(t)}addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}onDataRange(t,e){for(const i of this._rangeListeners)i(t,e)}onDataProgress(t,e){this._readyCapability.promise.then((()=>{for(const i of this._progressListeners)i(t,e)}))}onDataProgressiveRead(t){this._readyCapability.promise.then((()=>{for(const e of this._progressiveReadListeners)e(t)}))}onDataProgressiveDone(){this._readyCapability.promise.then((()=>{for(const t of this._progressiveDoneListeners)t()}))}transportReady(){this._readyCapability.resolve()}requestDataRange(t,e){St("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class Ho{constructor(t,e){this._pdfInfo=t,this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Rt(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(t){return this._transport.getPage(t)}getPageIndex(t){return this._transport.getPageIndex(t)}getDestinations(){return this._transport.getDestinations()}getDestination(t){return this._transport.getDestination(t)}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()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getOptionalContentConfig(e)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(t){return this._transport.cachedPageNumber(t)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}var zo=new WeakMap,Vo=new WeakMap,Go=new WeakSet;class Uo{constructor(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a(this,Go),w(this,zo,null),w(this,Vo,!1),this._pageIndex=t,this._pageInfo=e,this._transport=i,this._stats=s?new He:null,this._pdfBug=s,this.commonObjs=i.commonObjs,this.objs=new fl,this._maybeCleanupAfterRender=!1,this._intentStates=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(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:s=0,dontFlip:n=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Fe({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:s,dontFlip:n})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{renderingIntent:e}=this._transport.getRenderingIntent(t);return this._transport.getAnnotations(this._pageIndex,e)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Rt(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var t;return(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null}render(t){var e,i;let{canvasContext:s,viewport:n,intent:a="display",annotationMode:o=N.ENABLE,transform:l=null,background:h=null,optionalContentConfigPromise:c=null,annotationCanvasMap:d=null,pageColors:u=null,printAnnotationStorage:p=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const f=this._transport.getRenderingIntent(a,o,p),{renderingIntent:g,cacheKey:m}=f;x(Vo,this,!1),r(Go,this,Xo).call(this),c||(c=this._transport.getOptionalContentConfig(g));let v=this._intentStates.get(m);v||(v=Object.create(null),this._intentStates.set(m,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const b=!!(g&L);var A;v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(A=this._stats)||void 0===A||A.time("Page Request"),this._pumpOperatorList(f));const y=t=>{var e;(v.renderTasks.delete(w),(this._maybeCleanupAfterRender||b)&&x(Vo,this,!0),r(Go,this,qo).call(this,!b),t?(w.capability.reject(t),this._abortOperatorList({intentState:v,reason:t instanceof Error?t:new Error(t)})):w.capability.resolve(),this._stats)&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),null!==(e=globalThis.Stats)&&void 0!==e&&e.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=new Al({callback:y,params:{canvasContext:s,viewport:n,transform:l,background:h},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:d,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!b,pdfBug:this._pdfBug,pageColors:u});((i=v).renderTasks||(i.renderTasks=new Set)).add(w);const _=w.task;return Promise.all([v.displayReadyCapability.promise,c]).then((t=>{var e;let[i,s]=t;if(this.destroyed)y();else{if(null===(e=this._stats)||void 0===e||e.time("Rendering"),!(s.renderingIntent&g))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");w.initializeGraphics({transparency:i,optionalContentConfig:s}),w.operatorListChanged()}})).catch(y),_}getOperatorList(){let{intent:t="display",annotationMode:e=N.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=this._transport.getRenderingIntent(t,e,i,!0);let n,a=this._intentStates.get(s.cacheKey);var r,o;(a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a)),a.opListReadCapability)||(n=Object.create(null),n.operatorListChanged=function(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(n))},a.opListReadCapability=Promise.withResolvers(),((r=a).renderTasks||(r.renderTasks=new Set)).add(n),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},null===(o=this._stats)||void 0===o||o.time("Page Request"),this._pumpOperatorList(s));return a.opListReadCapability.promise}streamTextContent(){let{includeMarkedContent:t=!1,disableNormalization:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:!0===t,disableNormalization:!0===e},{highWaterMark:100,size:t=>t.items.length})}getTextContent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((t=>To.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const s=e.getReader(),n={items:[],styles:Object.create(null),lang:null};!function e(){s.read().then((function(i){var s;let{value:a,done:r}=i;r?t(n):(null!==(s=n.lang)&&void 0!==s||(n.lang=a.lang),Object.assign(n.styles,a.styles),n.items.push(...a.items),e())}),i)}()}))}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values())if(this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0}),!e.opListReadCapability)for(const i of e.renderTasks)t.push(i.completed),i.cancel();return this.objs.clear(),x(Vo,this,!1),r(Go,this,Xo).call(this),Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];x(Vo,this,!0);const e=r(Go,this,qo).call(this,!1);return t&&e&&this._stats&&(this._stats=new He),e}_startRenderPage(t,e){var i,s;const n=this._intentStates.get(e);n&&(null===(i=this._stats)||void 0===i||i.timeEnd("Page Request"),null===(s=n.displayReadyCapability)||void 0===s||s.resolve(t))}_renderPageChunk(t,e){for(let i=0,s=t.length;i Drag 'n' drop some files here, or click to select files Drag and drop some files here, or click to select files{o.read().then((t=>{let{value:e,done:i}=t;i?l.streamReader=null:this._transport.destroyed||(this._renderPageChunk(e,l),h())}),(t=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const t of l.renderTasks)t.operatorListChanged();r(Go,this,qo).call(this,!0)}if(l.displayReadyCapability)l.displayReadyCapability.reject(t);else{if(!l.opListReadCapability)throw t;l.opListReadCapability.reject(t)}}}))};h()}_abortOperatorList(t){let{intentState:e,reason:i,force:s=!1}=t;if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!s){if(e.renderTasks.size>0)return;if(i instanceof Oe){let t=100;return i.extraDelay>0&&i.extraDelay<1e3&&(t+=i.extraDelay),void(e.streamReaderCancelTimeout=setTimeout((()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})}),t))}}if(e.streamReader.cancel(new Nt(i.message)).catch((()=>{})),e.streamReader=null,!this._transport.destroyed){for(const[t,i]of this._intentStates)if(i===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}}function qo(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(r(Go,this,Xo).call(this),!_(Vo,this)||this.destroyed)return!1;if(t)return x(zo,this,setTimeout((()=>{x(zo,this,null),r(Go,this,qo).call(this,!1)}),5e3)),!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),x(Vo,this,!1),!0}function Xo(){_(zo,this)&&(clearTimeout(_(zo,this)),x(zo,this,null))}var Ko=new WeakMap,Yo=new WeakMap;class Qo{constructor(){w(this,Ko,new Set),w(this,Yo,Promise.resolve())}postMessage(t,e){const i={data:structuredClone(t,e?{transfer:e}:null)};_(Yo,this).then((()=>{for(const t of _(Ko,this))t.call(this,i)}))}addEventListener(t,e){_(Ko,this).add(e)}removeEventListener(t,e){_(Ko,this).delete(e)}terminate(){_(Ko,this).clear()}}const Jo={isWorkerDisabled:!1,fakeWorkerId:0};S&&(Jo.isWorkerDisabled=!0,za.workerSrc||(za.workerSrc="./pdf.worker.mjs")),Jo.isSameOrigin=function(t,e){let i;try{if(i=new URL(t),!i.origin||"null"===i.origin)return!1}catch{return!1}const s=new URL(e,i);return i.origin===s.origin},Jo.createCDNWrapper=function(t){const e='await import("'.concat(t,'");');return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};var Zo=new WeakSet;class $o{constructor(){let{name:t=null,port:e=null,verbosity:i=xt()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(a(this,Zo),this.name=t,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,e){var s;if(null!==(s=il._)&&void 0!==s&&s.has(e))throw new Error("Cannot use more than one PDFWorker per port.");return(il._||(il._=new WeakMap)).set(e,this),void this._initializeFromPort(e)}this._initialize()}get promise(){return S?Promise.all([ha.promise,this._readyCapability.promise]):this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t,this._messageHandler=new sr("main","worker",t),this._messageHandler.on("ready",(function(){})),r(Zo,this,tl).call(this)}_initialize(){if(Jo.isWorkerDisabled||el($o))return void this._setupFakeWorker();let{workerSrc:t}=$o;try{Jo.isSameOrigin(window.location.href,t)||(t=Jo.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new sr("main","worker",e),s=()=>{n.abort(),i.destroy(),e.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},n=new AbortController;e.addEventListener("error",(()=>{this._webWorker||s()}),{signal:n.signal}),i.on("test",(t=>{n.abort(),!this.destroyed&&t?(this._messageHandler=i,this._port=e,this._webWorker=e,r(Zo,this,tl).call(this)):s()})),i.on("ready",(t=>{if(n.abort(),this.destroyed)s();else try{a()}catch{this._setupFakeWorker()}}));const a=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};return void a()}catch{kt("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){Jo.isWorkerDisabled||(Et("Setting up fake worker."),Jo.isWorkerDisabled=!0),$o._setupFakeWorkerGlobal.then((t=>{if(this.destroyed)return void this._readyCapability.reject(new Error("Worker was destroyed"));const e=new Qo;this._port=e;const i="fake".concat(Jo.fakeWorkerId++),s=new sr(i+"_worker",i,e);t.setup(s,e),this._messageHandler=new sr(i,i+"_worker",e),r(Zo,this,tl).call(this)})).catch((t=>{this._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))}))}destroy(){var t;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),null===(t=il._)||void 0===t||t.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(t){var e;if(null===t||void 0===t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");const i=null===(e=r($o,this,il)._)||void 0===e?void 0:e.get(t.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new $o(t)}static get workerSrc(){if(za.workerSrc)return za.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Rt(this,"_setupFakeWorkerGlobal",(async()=>{if(o($o,this,el))return o($o,this,el);return(await import(this.workerSrc)).WorkerMessageHandler})())}}function tl(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}function el(t){try{var e;return(null===(e=globalThis.pdfjsWorker)||void 0===e?void 0:e.WorkerMessageHandler)||null}catch{return null}}var il={_:void 0},sl=new WeakMap,nl=new WeakMap,al=new WeakMap,rl=new WeakMap,ol=new WeakMap,ll=new WeakSet;class hl{constructor(t,e,i,s,n){a(this,ll),w(this,sl,new Map),w(this,nl,new Map),w(this,al,new Map),w(this,rl,new Map),w(this,ol,null),this.messageHandler=t,this.loadingTask=e,this.commonObjs=new fl,this.fontLoader=new aa({ownerDocument:s.ownerDocument,styleElement:s.styleElement}),this.loadingParams=s.loadingParams,this._params=s,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}get annotationStorage(){return Rt(this,"annotationStorage",new ta)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=P,a=Qn;switch(t){case"any":n=T;break;case"display":break;case"print":n=L;break;default:Et("getRenderingIntent - invalid intent: ".concat(t))}switch(e){case N.DISABLE:n+=F;break;case N.ENABLE:break;case N.ENABLE_FORMS:n+=D;break;case N.ENABLE_STORAGE:n+=I;a=(n&L&&i instanceof sa?i:this.annotationStorage).serializable;break;default:Et("getRenderingIntent - invalid annotationMode: ".concat(e))}return s&&(n+=O),{renderingIntent:n,cacheKey:"".concat(n,"_").concat(a.hash),annotationStorageSerializable:a}}destroy(){var t;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),null===(t=_(ol,this))||void 0===t||t.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const s of _(nl,this).values())e.push(s._destroy());_(nl,this).clear(),_(al,this).clear(),_(rl,this).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then((()=>{var t;this.commonObjs.clear(),this.fontLoader.clear(),_(sl,this).clear(),this.filterFactory.destroy(),vo.cleanup(),null===(t=this._networkStream)||void 0===t||t.cancelAllRequests(new Nt("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()}),this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{Mt(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=t=>{this._lastProgress={loaded:t.loaded,total:t.total}},e.onPull=()=>{this._fullReader.read().then((function(t){let{value:i,done:s}=t;s?e.close():(Mt(i instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{this._fullReader.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}})),t.on("ReaderHeadersReady",(t=>{const i=Promise.withResolvers(),s=this._fullReader;return s.headersReady.then((()=>{if(!s.isStreamingSupported||!s.isRangeSupported){var t;if(this._lastProgress)null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress);s.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:s.isStreamingSupported,isRangeSupported:s.isRangeSupported,contentLength:s.contentLength})}),i.reject),i.promise})),t.on("GetRangeReader",((t,e)=>{Mt(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);i?(e.onPull=()=>{i.read().then((function(t){let{value:i,done:s}=t;s?e.close():(Mt(i instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),e.enqueue(new Uint8Array(i),1,[i]))})).catch((t=>{e.error(t)}))},e.onCancel=t=>{i.cancel(t),e.ready.catch((t=>{if(!this.destroyed)throw t}))}):e.close()})),t.on("GetDoc",(t=>{let{pdfInfo:i}=t;this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,e._capability.resolve(new Ho(i,this))})),t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new Pt(t.message,t.code);break;case"InvalidPDFException":i=new Dt(t.message);break;case"MissingPDFException":i=new It(t.message);break;case"UnexpectedResponseException":i=new Ft(t.message,t.status);break;case"UnknownErrorException":i=new Lt(t.message,t.details);break;default:St("DocException - expected a valid Error.")}e._capability.reject(i)})),t.on("PasswordRequest",(t=>{if(x(ol,this,Promise.withResolvers()),e.onPassword){const s=t=>{t instanceof Error?_(ol,this).reject(t):_(ol,this).resolve({password:t})};try{e.onPassword(s,t.code)}catch(i){_(ol,this).reject(i)}}else _(ol,this).reject(new Pt(t.message,t.code));return _(ol,this).promise})),t.on("DataLoaded",(t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.length,total:t.length}),this.downloadInfoCapability.resolve(t)})),t.on("StartRenderPage",(t=>{if(this.destroyed)return;_(nl,this).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)})),t.on("commonobj",(e=>{var i;let[s,n,a]=e;if(this.destroyed)return null;if(this.commonObjs.has(s))return null;switch(n){case"Font":const{disableFontFace:e,fontExtraProperties:r,pdfBug:o}=this._params;if("error"in a){const t=a.error;Et("Error during font loading: ".concat(t)),this.commonObjs.resolve(s,t);break}const l=o&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled?(t,e)=>globalThis.FontInspector.fontAdded(t,e):null,h=new ra(a,{disableFontFace:e,inspectFont:l});this.fontLoader.bind(h).catch((()=>t.sendWithPromise("FontFallback",{id:s}))).finally((()=>{!r&&h.data&&(h.data=null),this.commonObjs.resolve(s,h)}));break;case"CopyLocalImage":const{imageRef:c}=a;Mt(c,"The imageRef must be defined.");for(const t of _(nl,this).values())for(const[,e]of t.objs)if((null===e||void 0===e?void 0:e.ref)===c)return e.dataLen?(this.commonObjs.resolve(s,structuredClone(e)),e.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(s,a);break;default:throw new Error("Got unknown common object type ".concat(n))}return null})),t.on("obj",(t=>{let[e,i,s,n]=t;if(this.destroyed)return;const a=_(nl,this).get(i);var r;if(!a.objs.has(e))if(0!==a._intentStates.size)switch(s){case"Image":a.objs.resolve(e,n),(null===n||void 0===n?void 0:n.dataLen)>1e7&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(e,n);break;default:throw new Error("Got unknown object type ".concat(s))}else null===n||void 0===n||null===(r=n.bitmap)||void 0===r||r.close()})),t.on("DocProgress",(t=>{var i;this.destroyed||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})})),t.on("FetchBuiltInCMap",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(t):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")))),t.on("FetchStandardFontData",(t=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(t):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t,e;this.annotationStorage.size<=0&&Et("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:i,transfer:s}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:i,filename:null!==(t=null===(e=this._fullReader)||void 0===e?void 0:e.filename)&&void 0!==t?t:null},s).finally((()=>{this.annotationStorage.resetModified()}))}getPage(t){if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));const e=t-1,i=_(al,this).get(e);if(i)return i;const s=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((i=>{if(this.destroyed)throw new Error("Transport destroyed");i.refStr&&_(rl,this).set(i.refStr,t);const s=new Uo(e,i,this,this._params.pdfBug);return _(nl,this).set(e,s),s}));return _(al,this).set(e,s),s}getPageIndex(t){return No(t)?this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return r(ll,this,cl).call(this,"GetFieldObjects")}hasJSActions(){return r(ll,this,cl).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(t){return"string"!==typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}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)}getDocJSActions(){return r(ll,this,cl).call(this,"GetDocJSActions")}getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(t){return r(ll,this,cl).call(this,"GetOptionalContentConfig").then((e=>new wr(e,t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const t="GetMetadata",e=_(sl,this).get(t);if(e)return e;const i=this.messageHandler.sendWithPromise(t,null).then((t=>{var e,i,s,n;return{info:t[0],metadata:t[1]?new hr(t[1]):null,contentDispositionFilename:null!==(e=null===(i=this._fullReader)||void 0===i?void 0:i.filename)&&void 0!==e?e:null,contentLength:null!==(s=null===(n=this._fullReader)||void 0===n?void 0:n.contentLength)&&void 0!==s?s:null}}));return _(sl,this).set(t,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const t of _(nl,this).values()){if(!t.cleanup())throw new Error("startCleanup: Page ".concat(t.pageNumber," is currently rendering."))}this.commonObjs.clear(),t||this.fontLoader.clear(),_(sl,this).clear(),this.filterFactory.destroy(!0),vo.cleanup()}}cachedPageNumber(t){var e;if(!No(t))return null;const i=0===t.gen?"".concat(t.num,"R"):"".concat(t.num,"R").concat(t.gen);return null!==(e=_(rl,this).get(i))&&void 0!==e?e:null}}function cl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=_(sl,this).get(t);if(i)return i;const s=this.messageHandler.sendWithPromise(t,e);return _(sl,this).set(t,s),s}const dl=Symbol("INITIAL_DATA");var ul=new WeakMap,pl=new WeakSet;class fl{constructor(){a(this,pl),w(this,ul,Object.create(null))}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=r(pl,this,gl).call(this,t);return i.promise.then((()=>e(i.data))),null}const i=_(ul,this)[t];if(!i||i.data===dl)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}has(t){const e=_(ul,this)[t];return!!e&&e.data!==dl}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=r(pl,this,gl).call(this,t);i.data=e,i.resolve()}clear(){for(const e in _(ul,this)){var t;const{data:i}=_(ul,this)[e];null===i||void 0===i||null===(t=i.bitmap)||void 0===t||t.close()}x(ul,this,Object.create(null))}*[Symbol.iterator](){for(const t in _(ul,this)){const{data:e}=_(ul,this)[t];e!==dl&&(yield[t,e])}}}function gl(t){var e;return(e=_(ul,this))[t]||(e[t]={...Promise.withResolvers(),data:dl})}var ml=new WeakMap;class vl{constructor(t){w(this,ml,null),x(ml,this,t),this.onContinue=null}get promise(){return _(ml,this).capability.promise}cancel(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;_(ml,this).cancel(null,t)}get separateAnnots(){const{separateAnnots:t}=_(ml,this).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=_(ml,this);return t.form||t.canvas&&(null===e||void 0===e?void 0:e.size)>0}}var bl=new WeakMap;class Al{constructor(t){let{callback:e,params:i,objs:s,commonObjs:n,annotationCanvasMap:a,operatorList:r,pageIndex:o,canvasFactory:l,filterFactory:h,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:u=null}=t;w(this,bl,null),this.callback=e,this.params=i,this.objs=s,this.commonObjs=n,this.annotationCanvasMap=a,this.operatorListIdx=null,this.operatorList=r,this._pageIndex=o,this.canvasFactory=l,this.filterFactory=h,this._pdfBug=d,this.pageColors=u,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=!0===c&&"undefined"!==typeof window,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new vl(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvasContext.canvas}get completed(){return this.capability.promise.catch((function(){}))}initializeGraphics(t){var e,i;let{transparency:s=!1,optionalContentConfig:n}=t;if(this.cancelled)return;if(this._canvas){if(yl._.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");yl._.add(this._canvas)}this._pdfBug&&null!==(e=globalThis.StepperManager)&&void 0!==e&&e.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:a,viewport:r,transform:o,background:l}=this.params;this.gfx=new ja(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:o,viewport:r,transparency:s,background:l}),this.operatorListIdx=0,this.graphicsReady=!0,null===(i=this.graphicsReadyCallback)||void 0===i||i.call(this)}cancel(){var t;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.running=!1,this.cancelled=!0,null===(t=this.gfx)||void 0===t||t.endDrawing(),_(bl,this)&&(window.cancelAnimationFrame(_(bl,this)),x(bl,this,null)),yl._.delete(this._canvas),this.callback(e||new Oe("Rendering cancelled, page ".concat(this._pageIndex+1),i))}operatorListChanged(){var t;this.graphicsReady?(null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList),this.running||this._continue()):this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}_continue(){this.running=!0,this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?x(bl,this,window.requestAnimationFrame((()=>{x(bl,this,null),this._nextBound().catch(this._cancelBound)}))):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),yl._.delete(this._canvas),this.callback())))}}var yl={_:new WeakSet};const wl="4.4.168",_l="19fbc8998";function xl(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}function kl(t){return Math.max(0,Math.min(255,255*t))}class El{static CMYK_G(t){let[e,i,s,n]=t;return["G",1-Math.min(1,.3*e+.59*s+.11*i+n)]}static G_CMYK(t){let[e]=t;return["CMYK",0,0,0,1-e]}static G_RGB(t){let[e]=t;return["RGB",e,e,e]}static G_rgb(t){let[e]=t;return e=kl(e),[e,e,e]}static G_HTML(t){let[e]=t;const i=xl(e);return"#".concat(i).concat(i).concat(i)}static RGB_G(t){let[e,i,s]=t;return["G",.3*e+.59*i+.11*s]}static RGB_rgb(t){return t.map(kl)}static RGB_HTML(t){return"#".concat(t.map(xl).join(""))}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB(t){let[e,i,s,n]=t;return["RGB",1-Math.min(1,e+n),1-Math.min(1,s+n),1-Math.min(1,i+n)]}static CMYK_rgb(t){let[e,i,s,n]=t;return[kl(1-Math.min(1,e+n)),kl(1-Math.min(1,s+n)),kl(1-Math.min(1,i+n))]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,s]=t;const n=1-e,a=1-i,r=1-s;return["CMYK",n,a,r,Math.min(n,a,r)]}}class Sl{static setupStorage(t,e,i,s,n){const a=s.getValue(e,{value:null});switch(i.name){case"textarea":if(null!==a.value&&(t.textContent=a.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){if(a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked"),"print"===n)break;t.addEventListener("change",(t=>{s.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{if(null!==a.value&&t.setAttribute("value",a.value),"print"===n)break;t.addEventListener("input",(t=>{s.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value){t.setAttribute("value",a.value);for(const t of i.children)t.attributes.value===a.value?t.attributes.selected=!0:t.attributes.hasOwnProperty("selected")&&delete t.attributes.selected}t.addEventListener("input",(t=>{const i=t.target.options,n=-1===i.selectedIndex?"":i[i.selectedIndex].value;s.setValue(e,{value:n})}))}}static setAttributes(t){let{html:e,element:i,storage:s=null,intent:n,linkService:a}=t;const{attributes:r}=i,o=e instanceof HTMLAnchorElement;"radio"===r.type&&(r.name="".concat(r.name,"-").concat(n));for(const[l,h]of Object.entries(r))if(null!==h&&void 0!==h)switch(l){case"class":h.length&&e.setAttribute(l,h.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",h);break;case"style":Object.assign(e.style,h);break;case"textContent":e.textContent=h;break;default:(!o||"href"!==l&&"newWindow"!==l)&&e.setAttribute(l,h)}o&&a.addLinkAttributes(e,r.href,r.newWindow),s&&r.dataId&&this.setupStorage(e,r.dataId,i,s)}static render(t){const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,n=t.intent||"display",a=document.createElement(s.name);s.attributes&&this.setAttributes({html:a,element:s,intent:n,linkService:i});const r="richText"!==n,o=t.div;if(o.append(a),t.viewport){const e="matrix(".concat(t.viewport.transform.join(","),")");o.style.transform=e}r&&o.setAttribute("class","xfaLayer xfaFont");const l=[];if(0===s.children.length){if(s.value){const t=document.createTextNode(s.value);a.append(t),r&&To.shouldBuildText(s.name)&&l.push(t)}return{textDivs:l}}const h=[[s,-1,a]];for(;h.length>0;){var c,d;const[t,s,a]=h.at(-1);if(s+1===t.children.length){h.pop();continue}const o=t.children[++h.at(-1)[1]];if(null===o)continue;const{name:u}=o;if("#text"===u){const t=document.createTextNode(o.value);l.push(t),a.append(t);continue}const p=null!==o&&void 0!==o&&null!==(c=o.attributes)&&void 0!==c&&c.xmlns?document.createElementNS(o.attributes.xmlns,u):document.createElement(u);if(a.append(p),o.attributes&&this.setAttributes({html:p,element:o,storage:e,intent:n,linkService:i}),(null===(d=o.children)||void 0===d?void 0:d.length)>0)h.push([o,-1,p]);else if(o.value){const t=document.createTextNode(o.value);r&&To.shouldBuildText(u)&&l.push(t),p.append(t)}}for(const u of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:l}}static update(t){const e="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=e,t.div.hidden=!1}}const Ml=1e3,Cl=new WeakSet;function Rl(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class Tl{static create(t){switch(t.data.annotationType){case Y:return new Wl(t);case K:return new zl(t);case dt:switch(t.data.fieldType){case"Tx":return new Gl(t);case"Btn":return t.data.radioButton?new Xl(t):t.data.checkBox?new ql(t):new Kl(t);case"Ch":return new Yl(t);case"Sig":return new Ul(t)}return new Vl(t);case ht:return new Ql(t);case Q:return new Mh(t);case J:return new Rh(t);case Z:return new Ph(t);case $:return new Dh(t);case et:return new Fh(t);case ot:return new Nh(t);case lt:return new jh(t);case tt:return new Oh(t);case it:return new Bh(t);case st:return new Hh(t);case nt:return new zh(t);case at:return new Vh(t);case rt:return new Gh(t);case ct:return new Xh(t);default:return new Fl(t)}}}var Pl=new WeakMap,Ll=new WeakMap,Dl=new WeakMap,Il=new WeakSet;class Fl{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,Il),w(this,Pl,null),w(this,Ll,!1),w(this,Dl,null),this.isRenderable=e,this.data=t.data,this.layer=t.layer,this.linkService=t.linkService,this.downloadManager=t.downloadManager,this.imageResourcesPath=t.imageResourcesPath,this.renderForms=t.renderForms,this.svgFactory=t.svgFactory,this.annotationStorage=t.annotationStorage,this.enableScripting=t.enableScripting,this.hasJSActions=t.hasJSActions,this._fieldObjects=t.fieldObjects,this.parent=t.parent,e&&(this.container=this._createContainer(i)),s&&this._createQuadrilaterals()}static _hasPopupData(t){let{titleObj:e,contentsObj:i,richText:s}=t;return!!(null!==e&&void 0!==e&&e.str||null!==i&&void 0!==i&&i.str||null!==s&&void 0!==s&&s.str)}get hasPopupData(){return Fl._hasPopupData(this.data)}updateEdited(t){var e;if(!this.container)return;_(Pl,this)||x(Pl,this,{rect:this.data.rect.slice(0)});const{rect:i}=t;i&&r(Il,this,Ol).call(this,i),null===(e=_(Dl,this))||void 0===e||e.popup.updateEdited(t)}resetEdited(){var t;_(Pl,this)&&(r(Il,this,Ol).call(this,_(Pl,this).rect),null===(t=_(Dl,this))||void 0===t||t.popup.resetEdited(),x(Pl,this,null))}_createContainer(t){const{data:e,parent:{page:i,viewport:s}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",e.id),this instanceof Vl||(n.tabIndex=Ml);const{style:a}=n;if(a.zIndex=this.parent.zIndex++,e.popupRef&&n.setAttribute("aria-haspopup","dialog"),e.alternativeText&&(n.title=e.alternativeText),e.noRotate&&n.classList.add("norotate"),!e.rect||this instanceof Ql){const{rotation:t}=e;return e.hasOwnCanvas||0===t||this.setRotation(t,n),n}const{width:r,height:o}=Rl(e.rect);if(!t&&e.borderStyle.width>0){a.borderWidth="".concat(e.borderStyle.width,"px");const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e="calc(".concat(t,"px * var(--scale-factor)) / calc(").concat(i,"px * var(--scale-factor))");a.borderRadius=e}else if(this instanceof Xl){const t="calc(".concat(r,"px * var(--scale-factor)) / calc(").concat(o,"px * var(--scale-factor))");a.borderRadius=t}switch(e.borderStyle.style){case ut:a.borderStyle="solid";break;case pt:a.borderStyle="dashed";break;case ft:Et("Unimplemented border style: beveled");break;case gt:Et("Unimplemented border style: inset");break;case mt:a.borderBottomStyle="solid"}const s=e.borderColor||null;s?(x(Ll,this,!0),a.borderColor=Vt.makeHexColor(0|s[0],0|s[1],0|s[2])):a.borderWidth=0}const l=Vt.normalizeRect([e.rect[0],i.view[3]-e.rect[1]+i.view[1],e.rect[2],i.view[3]-e.rect[3]+i.view[1]]),{pageWidth:h,pageHeight:c,pageX:d,pageY:u}=s.rawDims;a.left="".concat(100*(l[0]-d)/h,"%"),a.top="".concat(100*(l[1]-u)/c,"%");const{rotation:p}=e;return e.hasOwnCanvas||0===p?(a.width="".concat(100*r/h,"%"),a.height="".concat(100*o/c,"%")):this.setRotation(p,n),n}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;if(!this.data.rect)return;const{pageWidth:i,pageHeight:s}=this.parent.viewport.rawDims,{width:n,height:a}=Rl(this.data.rect);let r,o;t%180===0?(r=100*n/i,o=100*a/s):(r=100*a/i,o=100*n/s),e.style.width="".concat(r,"%"),e.style.height="".concat(o,"%"),e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const t=(t,e,i)=>{const s=i.detail[t],n=s[0],a=s.slice(1);i.target.style[e]=El["".concat(n,"_HTML")](a),this.annotationStorage.setValue(this.data.id,{[e]:El["".concat(n,"_rgb")](a)})};return Rt(this,"_commonActions",{display:t=>{const{display:e}=t.detail,i=e%2===1;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:i,noPrint:1===e||2===e})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{const{hidden:e}=t.detail;this.container.style.visibility=e?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:e,noView:e})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:e=>{t("bgColor","backgroundColor",e)},fillColor:e=>{t("fillColor","backgroundColor",e)},fgColor:e=>{t("fgColor","color",e)},textColor:e=>{t("textColor","color",e)},borderColor:e=>{t("borderColor","borderColor",e)},strokeColor:e=>{t("strokeColor","borderColor",e)},rotation:t=>{const e=t.detail.rotation;this.setRotation(e),this.annotationStorage.setValue(this.data.id,{rotation:e})}})}_dispatchEventFromSandbox(t,e){const i=this._commonActions;for(const s of Object.keys(e.detail)){const n=t[s]||i[s];null===n||void 0===n||n(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[s,n]of Object.entries(e)){const a=i[s];if(a){a({detail:{[s]:n},target:t}),delete e[s]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:t}=this.data;if(!t)return;const[e,i,s,n]=this.data.rect.map((t=>Math.fround(t)));if(8===t.length){const[a,r,o,l]=t.subarray(2,6);if(s===a&&n===r&&e===o&&i===l)return}const{style:a}=this.container;let r;if(_(Ll,this)){const{borderColor:t,borderWidth:e}=a;a.borderWidth=0,r=["url('data:image/svg+xml;utf8,",'')"),a.backgroundImage=r.join("")),this.container.append(c),this.container.style.clipPath="url(#".concat(p,")")}_createPopup(){const{container:t,data:e}=this;t.setAttribute("aria-haspopup","dialog");const i=x(Dl,this,new Ql({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:"popup_".concat(e.id),rotation:e.rotation},parent:this.parent,elements:[this]}));this.parent.div.append(i.render())}render(){St("Abstract method `AnnotationElement.render` called")}_getElementsByName(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[];if(this._fieldObjects){const s=this._fieldObjects[t];if(s)for(const{page:t,id:n,exportValues:a}of s){if(-1===t)continue;if(n===e)continue;const s="string"===typeof a?a:null,r=document.querySelector('[data-element-id="'.concat(n,'"]'));!r||Cl.has(r)?i.push({id:n,exportValue:s,domElement:r}):Et("_getElementsByName - element not allowed: ".concat(n))}return i}for(const s of document.getElementsByName(t)){const{exportValue:t}=s,n=s.getAttribute("data-element-id");n!==e&&(Cl.has(s)&&i.push({id:n,exportValue:t,domElement:s}))}return i}show(){var t;this.container&&(this.container.hidden=!1),null===(t=this.popup)||void 0===t||t.maybeShow()}hide(){var t;this.container&&(this.container.hidden=!0),null===(t=this.popup)||void 0===t||t.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const t=this.getElementsToTriggerPopup();if(Array.isArray(t))for(const e of t)e.classList.add("highlightArea");else t.classList.add("highlightArea")}get _isEditable(){return!1}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:t,data:{id:e}}=this;this.container.addEventListener("dblclick",(()=>{var i;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("switchannotationeditormode",{source:this,mode:t,editId:e})}))}}function Ol(t){const{container:{style:e},data:{rect:i,rotation:s},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:a,pageX:r,pageY:o}}}}=this;null===i||void 0===i||i.splice(0,4,...t);const{width:l,height:h}=Rl(t);e.left="".concat(100*(t[0]-r)/n,"%"),e.top="".concat(100*(a-t[3]+o)/a,"%"),0===s?(e.width="".concat(100*l/n,"%"),e.height="".concat(100*h/a,"%")):this.setRotation(s)}var Nl=new WeakSet;class Wl extends Fl{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null===e||void 0===e||!e.ignoreBorder),createQuadrilaterals:!0}),a(this,Nl),this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let s=!1;return t.url?(e.addLinkAttributes(i,t.url,t.newWindow),s=!0):t.action?(this._bindNamedAction(i,t.action),s=!0):t.attachment?(r(Nl,this,Bl).call(this,i,t.attachment,t.attachmentDest),s=!0):t.setOCGState?(r(Nl,this,Hl).call(this,i,t.setOCGState),s=!0):t.dest?(this._bindLink(i,t.dest),s=!0):(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,t),s=!0),t.resetForm?(this._bindResetFormAction(i,t.resetForm),s=!0):this.isTooltipOnly&&!s&&(this._bindLink(i,""),s=!0)),this.container.classList.add("linkAnnotation"),s&&this.container.append(i),this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e),t.onclick=()=>(e&&this.linkService.goToDestination(e),!1),(e||""===e)&&r(Nl,this,jl).call(this)}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeNamedAction(e),!1),r(Nl,this,jl).call(this)}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const s of Object.keys(e.actions)){const n=i.get(s);n&&(t[n]=()=>{var t;return null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:s}}),!1})}t.onclick||(t.onclick=()=>!1),r(Nl,this,jl).call(this)}_bindResetFormAction(t,e){const i=t.onclick;if(i||(t.href=this.linkService.getAnchorUrl("")),r(Nl,this,jl).call(this),!this._fieldObjects)return Et('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),void(i||(t.onclick=()=>!1));t.onclick=()=>{null===i||void 0===i||i();const{fields:t,refs:s,include:n}=e,a=[];if(0!==t.length||0!==s.length){const e=new Set(s);for(const i of t){const t=this._fieldObjects[i]||[];for(const{id:i}of t)e.add(i)}for(const t of Object.values(this._fieldObjects))for(const i of t)e.has(i.id)===n&&a.push(i)}else for(const e of Object.values(this._fieldObjects))a.push(...e);const r=this.annotationStorage,o=[];for(const e of a){const{id:t}=e;switch(o.push(t),e.type){case"text":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}case"checkbox":case"radiobutton":{const i=e.defaultValue===e.exportValues;r.setValue(t,{value:i});break}case"combobox":case"listbox":{const i=e.defaultValue||"";r.setValue(t,{value:i});break}default:continue}const i=document.querySelector('[data-element-id="'.concat(t,'"]'));i&&(Cl.has(i)?i.dispatchEvent(new Event("resetform")):Et("_bindResetFormAction - element not allowed: ".concat(t)))}var l;this.enableScripting&&(null===(l=this.linkService.eventBus)||void 0===l||l.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:o,name:"ResetForm"}}));return!1}}}function jl(){this.container.setAttribute("data-internal-link","")}function Bl(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t.href=this.linkService.getAnchorUrl(""),e.description&&(t.title=e.description),t.onclick=()=>{var t;return null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(e.content,e.filename,i),!1},r(Nl,this,jl).call(this)}function Hl(t,e){t.href=this.linkService.getAnchorUrl(""),t.onclick=()=>(this.linkService.executeSetOCGState(e),!1),r(Nl,this,jl).call(this)}class zl extends Fl{constructor(t){super(t,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const t=document.createElement("img");return t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",t.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),t.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(t),this.container}}class Vl extends Fl{render(){return this.container}showElementAndHideCanvas(t){var e;this.data.hasOwnCanvas&&("CANVAS"===(null===(e=t.previousSibling)||void 0===e?void 0:e.nodeName)&&(t.previousSibling.hidden=!0),t.hidden=!1)}_getKeyModifier(t){return Ht.platform.isMac?t.metaKey:t.ctrlKey}_setEventListener(t,e,i,s,n){i.includes("mouse")?t.addEventListener(i,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(i,(t=>{var a;if("blur"===i){if(!e.focused||!t.relatedTarget)return;e.focused=!1}else if("focus"===i){if(e.focused)return;e.focused=!0}n&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:s,value:n(t)}}))}))}_setEventListeners(t,e,i,s){for(const[o,l]of i){var n,a,r;if("Action"===l||null!==(n=this.data.actions)&&void 0!==n&&n[l])"Focus"!==l&&"Blur"!==l||e||(e={focused:!1}),this._setEventListener(t,e,o,l,s),"Focus"!==l||null!==(a=this.data.actions)&&void 0!==a&&a.Blur?"Blur"!==l||null!==(r=this.data.actions)&&void 0!==r&&r.Focus||this._setEventListener(t,e,"focus","Focus",null):this._setEventListener(t,e,"blur","Blur",null)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":Vt.makeHexColor(e[0],e[1],e[2])}_setTextStyle(t){const e=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,s=this.data.defaultAppearanceData.fontSize||9,n=t.style;let a;const r=t=>Math.round(10*t)/10;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2),e=t/(Math.round(t/(R*s))||1);a=Math.min(s,r(e/R))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(s,r(t/R))}n.fontSize="calc(".concat(a,"px * var(--scale-factor))"),n.color=Vt.makeHexColor(i[0],i[1],i[2]),null!==this.data.textAlignment&&(n.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required"),t.setAttribute("aria-required",e)}}class Gl extends Vl{constructor(t){super(t,{isRenderable:t.renderForms||t.data.hasOwnCanvas||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,s){const n=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id))a.domElement&&(a.domElement[e]=i),n.setValue(a.id,{[s]:i})}render(){const t=this.annotationStorage,e=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){var s;const o=t.getValue(e,{value:this.data.fieldValue});let l=o.value||"";const h=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;h&&l.length>h&&(l=l.slice(0,h));let c=o.formattedValue||(null===(s=this.data.textContent)||void 0===s?void 0:s.join("\n"))||null;c&&this.data.comb&&(c=c.replaceAll(/\s+/g,""));const d={userValue:l,formattedValue:c,lastCommittedValue:null,commitKey:1,focused:!1};var n,a;if(this.data.multiLine)i=document.createElement("textarea"),i.textContent=null!==(n=c)&&void 0!==n?n:l,this.data.doNotScroll&&(i.style.overflowY="hidden");else i=document.createElement("input"),i.type="text",i.setAttribute("value",null!==(a=c)&&void 0!==a?a:l),this.data.doNotScroll&&(i.style.overflowX="hidden");this.data.hasOwnCanvas&&(i.hidden=!0),Cl.add(i),i.setAttribute("data-element-id",e),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=Ml,this._setRequired(i,this.data.required),h&&(i.maxLength=h),i.addEventListener("input",(s=>{t.setValue(e,{value:s.target.value}),this.setPropertyOnSiblings(i,"value",s.target.value,"value"),d.formattedValue=null})),i.addEventListener("resetform",(t=>{var e;const s=null!==(e=this.data.defaultFieldValue)&&void 0!==e?e:"";i.value=d.userValue=s,d.formattedValue=null}));let u=t=>{const{formattedValue:e}=d;null!==e&&void 0!==e&&(t.target.value=e),t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var r;i.addEventListener("focus",(t=>{var e;if(d.focused)return;const{target:i}=t;d.userValue&&(i.value=d.userValue),d.lastCommittedValue=i.value,d.commitKey=1,null!==(e=this.data.actions)&&void 0!==e&&e.Focus||(d.focused=!0)})),i.addEventListener("updatefromsandbox",(i=>{this.showElementAndHideCanvas(i.target);const s={value(i){var s;d.userValue=null!==(s=i.detail.value)&&void 0!==s?s:"",t.setValue(e,{value:d.userValue.toString()}),i.target.value=d.userValue},formattedValue(i){const{formattedValue:s}=i.detail;d.formattedValue=s,null!==s&&void 0!==s&&i.target!==document.activeElement&&(i.target.value=s),t.setValue(e,{formattedValue:s})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var s;const{charLimit:n}=i.detail,{target:a}=i;if(0===n)return void a.removeAttribute("maxLength");a.setAttribute("maxLength",n);let r=d.userValue;!r||r.length<=n||(r=r.slice(0,n),a.value=d.userValue=r,t.setValue(e,{value:r}),null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:r,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}}))}};this._dispatchEventFromSandbox(s,i)})),i.addEventListener("keydown",(t=>{var i;d.commitKey=1;let s=-1;if("Escape"===t.key?s=0:"Enter"!==t.key||this.data.multiLine?"Tab"===t.key&&(d.commitKey=3):s=2,-1===s)return;const{value:n}=t.target;d.lastCommittedValue!==n&&(d.lastCommittedValue=n,d.userValue=n,null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:s,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}))}));const s=u;u=null,i.addEventListener("blur",(t=>{var i;if(!d.focused||!t.relatedTarget)return;null!==(i=this.data.actions)&&void 0!==i&&i.Blur||(d.focused=!1);const{value:n}=t.target;var a;(d.userValue=n,d.lastCommittedValue!==n)&&(null===(a=this.linkService.eventBus)||void 0===a||a.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:d.commitKey,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}}));s(t)})),null!==(r=this.data.actions)&&void 0!==r&&r.Keystroke&&i.addEventListener("beforeinput",(t=>{var i;d.lastCommittedValue=null;const{data:s,target:n}=t,{value:a,selectionStart:r,selectionEnd:o}=n;let l=r,h=o;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,r).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=a.substring(r).match(/^[^\w]*\w*/);t&&(h+=t[0].length);break}case"deleteContentBackward":r===o&&(l-=1);break;case"deleteContentForward":r===o&&(h+=1)}t.preventDefault(),null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:s||"",willCommit:!1,selStart:l,selEnd:h}})})),this._setEventListeners(i,d,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}if(u&&i.addEventListener("blur",u),this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/h;i.classList.add("comb"),i.style.letterSpacing="calc(".concat(t,"px * var(--scale-factor) - 1ch)")}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}}class Ul extends Vl{constructor(t){super(t,{isRenderable:!!t.data.hasOwnCanvas})}}class ql extends Vl{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;"string"===typeof s&&(s="Off"!==s,t.setValue(i,{value:s})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return Cl.add(n),n.setAttribute("data-element-id",i),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=e.fieldName,s&&n.setAttribute("checked",!0),n.setAttribute("exportValue",e.exportValue),n.tabIndex=Ml,n.addEventListener("change",(s=>{const{name:n,checked:a}=s.target;for(const r of this._getElementsByName(n,i)){const i=a&&r.exportValue===e.exportValue;r.domElement&&(r.domElement.checked=i),t.setValue(r.id,{value:i})}t.setValue(i,{value:a})})),n.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue})),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",(e=>{const s={value(e){e.target.checked="Off"!==e.detail.value,t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(s,e)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Xl extends Vl{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const t=this.annotationStorage,e=this.data,i=e.id;let s=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"===typeof s&&(s=s!==e.buttonValue,t.setValue(i,{value:s})),s)for(const a of this._getElementsByName(e.fieldName,i))t.setValue(a.id,{value:!1});const n=document.createElement("input");if(Cl.add(n),n.setAttribute("data-element-id",i),n.disabled=e.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=e.fieldName,s&&n.setAttribute("checked",!0),n.tabIndex=Ml,n.addEventListener("change",(e=>{const{name:s,checked:n}=e.target;for(const a of this._getElementsByName(s,i))t.setValue(a.id,{value:!1});t.setValue(i,{value:n})})),n.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!==i&&void 0!==i&&i===e.buttonValue})),this.enableScripting&&this.hasJSActions){const s=e.buttonValue;n.addEventListener("updatefromsandbox",(e=>{const n={value:e=>{const n=s===e.detail.value;for(const s of this._getElementsByName(e.target.name)){const e=n&&s.id===i;s.domElement&&(s.domElement.checked=e),t.setValue(s.id,{value:e})}}};this._dispatchEventFromSandbox(n,e)})),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.checked))}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class Kl extends Wl{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.classList.add("buttonWidgetAnnotation","pushButton");const e=t.lastChild;return this.enableScripting&&this.hasJSActions&&e&&(this._setDefaultPropertiesFromJS(e),e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))),t}}class Yl extends Vl{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),s=document.createElement("select");Cl.add(s),s.setAttribute("data-element-id",e),s.disabled=this.data.readOnly,this._setRequired(s,this.data.required),s.name=this.data.fieldName,s.tabIndex=Ml;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(s.size=this.data.options.length,this.data.multiSelect&&(s.multiple=!0)),s.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const i of s.options)i.selected=i.value===e}));for(const h of this.data.options){const t=document.createElement("option");t.textContent=h.displayValue,t.value=h.exportValue,i.value.includes(h.exportValue)&&(t.setAttribute("selected",!0),n=!1),s.append(t)}let a=null;if(n){const t=document.createElement("option");t.value=" ",t.setAttribute("hidden",!0),t.setAttribute("selected",!0),s.prepend(t),a=()=>{t.remove(),s.removeEventListener("input",a),a=null},s.addEventListener("input",a)}const r=t=>{const e=t?"value":"textContent",{options:i,multiple:n}=s;return n?Array.prototype.filter.call(i,(t=>t.selected)).map((t=>t[e])):-1===i.selectedIndex?null:i[i.selectedIndex][e]};let o=r(!1);const l=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};return this.enableScripting&&this.hasJSActions?(s.addEventListener("updatefromsandbox",(i=>{const n={value(i){var n;null===(n=a)||void 0===n||n();const l=i.detail.value,h=new Set(Array.isArray(l)?l:[l]);for(const t of s.options)t.selected=h.has(t.value);t.setValue(e,{value:r(!0)}),o=r(!1)},multipleSelection(t){s.multiple=!0},remove(i){const n=s.options,a=i.detail.remove;if(n[a].selected=!1,s.remove(a),n.length>0){-1===Array.prototype.findIndex.call(n,(t=>t.selected))&&(n[0].selected=!0)}t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},clear(i){for(;0!==s.length;)s.remove(0);t.setValue(e,{value:null,items:[]}),o=r(!1)},insert(i){const{index:n,displayValue:a,exportValue:h}=i.detail.insert,c=s.children[n],d=document.createElement("option");d.textContent=a,d.value=h,c?c.before(d):s.append(d),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},items(i){const{items:n}=i.detail;for(;0!==s.length;)s.remove(0);for(const t of n){const{displayValue:e,exportValue:i}=t,n=document.createElement("option");n.textContent=e,n.value=i,s.append(n)}s.options.length>0&&(s.options[0].selected=!0),t.setValue(e,{value:r(!0),items:l(i)}),o=r(!1)},indices(i){const s=new Set(i.detail.indices);for(const t of i.target.options)t.selected=s.has(t.index);t.setValue(e,{value:r(!0)}),o=r(!1)},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(n,i)})),s.addEventListener("input",(i=>{var s;const n=r(!0),a=r(!1);t.setValue(e,{value:n}),i.preventDefault(),null===(s=this.linkService.eventBus)||void 0===s||s.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:o,change:a,changeEx:n,willCommit:!1,commitKey:1,keyDown:!1}})})),this._setEventListeners(s,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],(t=>t.target.value))):s.addEventListener("input",(function(i){t.setValue(e,{value:r(!0)})})),this.data.combo&&this._setTextStyle(s),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}}class Ql extends Fl{constructor(t){const{data:e,elements:i}=t;super(t,{isRenderable:Fl._hasPopupData(e)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");const t=this.popup=new vh({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),e=[];for(const i of this.elements)i.popup=t,e.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",e.map((t=>"".concat(Yt).concat(t))).join(",")),this.container}}var Jl=new WeakMap,Zl=new WeakMap,$l=new WeakMap,th=new WeakMap,eh=new WeakMap,ih=new WeakMap,sh=new WeakMap,nh=new WeakMap,ah=new WeakMap,rh=new WeakMap,oh=new WeakMap,lh=new WeakMap,hh=new WeakMap,ch=new WeakMap,dh=new WeakMap,uh=new WeakMap,ph=new WeakMap,fh=new WeakMap,gh=new WeakMap,mh=new WeakSet;class vh{constructor(t){let{container:e,color:i,elements:s,titleObj:n,modificationDate:o,contentsObj:l,richText:h,parent:c,rect:d,parentRect:u,open:p}=t;a(this,mh),w(this,Jl,r(mh,this,_h).bind(this)),w(this,Zl,r(mh,this,Sh).bind(this)),w(this,$l,r(mh,this,Eh).bind(this)),w(this,th,r(mh,this,kh).bind(this)),w(this,eh,null),w(this,ih,null),w(this,sh,null),w(this,nh,null),w(this,ah,null),w(this,rh,null),w(this,oh,null),w(this,lh,!1),w(this,hh,null),w(this,ch,null),w(this,dh,null),w(this,uh,null),w(this,ph,null),w(this,fh,null),w(this,gh,!1),x(ih,this,e),x(ph,this,n),x(sh,this,l),x(uh,this,h),x(rh,this,c),x(eh,this,i),x(dh,this,d),x(oh,this,u),x(ah,this,s),x(nh,this,qe.toDateObject(o)),this.trigger=s.flatMap((t=>t.getElementsToTriggerPopup()));for(const a of this.trigger)a.addEventListener("click",_(th,this)),a.addEventListener("mouseenter",_($l,this)),a.addEventListener("mouseleave",_(Zl,this)),a.classList.add("popupTriggerArea");for(const a of s){var f;null===(f=a.container)||void 0===f||f.addEventListener("keydown",_(Jl,this))}_(ih,this).hidden=!0,p&&r(mh,this,kh).call(this)}render(){if(_(hh,this))return;const t=x(hh,this,document.createElement("div"));if(t.className="popup",_(eh,this)){const e=t.style.outlineColor=Vt.makeHexColor(..._(eh,this));if(CSS.supports("background-color","color-mix(in srgb, red 30%, white)"))t.style.backgroundColor="color-mix(in srgb, ".concat(e," 30%, white)");else{const e=.7;t.style.backgroundColor=Vt.makeHexColor(..._(eh,this).map((t=>Math.floor(e*(255-t)+t))))}}const e=document.createElement("span");e.className="header";const i=document.createElement("h1");if(e.append(i),({dir:i.dir,str:i.textContent}=_(ph,this)),t.append(e),_(nh,this)){const t=document.createElement("span");t.classList.add("popupDate"),t.setAttribute("data-l10n-id","pdfjs-annotation-date-string"),t.setAttribute("data-l10n-args",JSON.stringify({date:_(nh,this).toLocaleDateString(),time:_(nh,this).toLocaleTimeString()})),e.append(t)}const s=o(mh,this,bh);if(s)Sl.render({xfaHtml:s,intent:"richText",div:t}),t.lastChild.classList.add("richText","popupContent");else{const e=this._formatContents(_(sh,this));t.append(e)}_(ih,this).append(t)}_formatContents(t){let{str:e,dir:i}=t;const s=document.createElement("p");s.classList.add("popupContent"),s.dir=i;const n=e.split(/(?:\r\n?|\n)/);for(let a=0,r=n.length;a0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_(ku,this))return void r(Pu,this,Uu).call(this);const e=r(Pu,this,ip).call(this),i=r(Pu,this,sp).call(this);x(vu,this,Math.max(Tn.MIN_SIZE,e[2]-e[0])),x(mu,this,Math.max(Tn.MIN_SIZE,e[3]-e[1]));const s=Math.ceil(i+_(vu,this)*this.scaleFactor),n=Math.ceil(i+_(mu,this)*this.scaleFactor),[a,o]=this.parentDimensions;this.width=s/a,this.height=n/o,this.setAspectRatio(s,n);const l=this.translationX,h=this.translationY;this.translationX=-e[0],this.translationY=-e[1],r(Pu,this,Yu).call(this),r(Pu,this,Uu).call(this),x(Cu,this,s),x(Ru,this,n),this.setDims(s,n);const c=t?i/this.scaleFactor/2:0;this.translate(l-this.translationX-c,h-this.translationY-c)}v=Lu,(0,y.A)(Lu,"_defaultColor",null),(0,y.A)(Lu,"_defaultOpacity",1),(0,y.A)(Lu,"_defaultThickness",1),(0,y.A)(Lu,"_type","ink"),(0,y.A)(Lu,"_editorType",W.INK);var ap=new WeakMap,rp=new WeakMap,op=new WeakMap,lp=new WeakMap,hp=new WeakMap,cp=new WeakMap,dp=new WeakMap,up=new WeakMap,pp=new WeakMap,fp=new WeakMap,gp=new WeakMap,mp=new WeakSet;class vp extends Tn{constructor(t){super({...t,name:"stampEditor"}),a(this,mp),w(this,ap,null),w(this,rp,null),w(this,op,null),w(this,lp,null),w(this,hp,null),w(this,cp,""),w(this,dp,null),w(this,up,null),w(this,pp,null),w(this,fp,!1),w(this,gp,!1),x(lp,this,t.bitmapUrl),x(hp,this,t.bitmapFile)}static initialize(t,e){Tn.initialize(t,e)}static get supportedTypes(){return Rt(this,"supportedTypes",["apng","avif","bmp","gif","jpeg","png","svg+xml","webp","x-icon"].map((t=>"image/".concat(t))))}static get supportedTypesStr(){return Rt(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(t){return this.supportedTypes.includes(t)}static paste(t,e){e.pasteEditor(W.STAMP,{bitmapFile:t.getAsFile()})}remove(){var t,e;_(rp,this)&&(x(ap,this,null),this._uiManager.imageManager.deleteId(_(rp,this)),null===(t=_(dp,this))||void 0===t||t.remove(),x(dp,this,null),null===(e=_(up,this))||void 0===e||e.disconnect(),x(up,this,null),_(pp,this)&&(clearTimeout(_(pp,this)),x(pp,this,null)));super.remove()}rebuild(){this.parent?(super.rebuild(),null!==this.div&&(_(rp,this)&&null===_(dp,this)&&r(mp,this,yp).call(this),this.isAttachedToDOM||this.parent.add(this))):_(rp,this)&&r(mp,this,yp).call(this)}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(_(op,this)||_(ap,this)||_(lp,this)||_(hp,this)||_(rp,this))}get isResizable(){return!0}render(){if(this.div)return this.div;let t,e;if(this.width&&(t=this.x,e=this.y),super.render(),this.div.hidden=!0,this.addAltTextButton(),_(ap,this)?r(mp,this,wp).call(this):r(mp,this,yp).call(this),this.width){const[i,s]=this.parentDimensions;this.setAt(t*i,e*s,this.width*i,this.height*s)}return this.div}getImageForAltText(){return _(dp,this)}static deserialize(t,e,i){if(t instanceof Gh)return null;const s=super.deserialize(t,e,i),{rect:n,bitmapUrl:a,bitmapId:r,isSvg:o,accessibilityData:l}=t;r&&i.imageManager.isValidId(r)?x(rp,s,r):x(lp,s,a),x(fp,s,o);const[h,c]=s.pageDimensions;return s.width=(n[2]-n[0])/h,s.height=(n[3]-n[1])/c,l&&(s.altTextData=l),s}serialize(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.isEmpty())return null;const i={annotationType:W.STAMP,bitmapId:_(rp,this),pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:_(fp,this),structTreeParentId:this._structTreeParentId};if(t)return i.bitmapUrl=r(mp,this,Ep).call(this,!0),i.accessibilityData=this.altTextData,i;const{decorative:s,altText:n}=this.altTextData;if(!s&&n&&(i.accessibilityData={type:"Figure",alt:n}),null===e)return i;e.stamps||(e.stamps=new Map);const a=_(fp,this)?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(e.stamps.has(_(rp,this))){if(_(fp,this)){const t=e.stamps.get(_(rp,this));a>t.area&&(t.area=a,t.serialized.bitmap.close(),t.serialized.bitmap=r(mp,this,Ep).call(this,!1))}}else e.stamps.set(_(rp,this),{area:a,serialized:i}),i.bitmap=r(mp,this,Ep).call(this,!1);return i}}function bp(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?(x(ap,this,t.bitmap),e||(x(rp,this,t.id),x(fp,this,t.isSvg)),t.file&&x(cp,this,t.file.name),r(mp,this,wp).call(this)):this.remove()}function Ap(){x(op,this,null),this._uiManager.enableWaiting(!1),_(dp,this)&&this.div.focus()}function yp(){if(_(rp,this))return this._uiManager.enableWaiting(!0),void this._uiManager.imageManager.getFromId(_(rp,this)).then((t=>r(mp,this,bp).call(this,t,!0))).finally((()=>r(mp,this,Ap).call(this)));if(_(lp,this)){const t=_(lp,this);return x(lp,this,null),this._uiManager.enableWaiting(!0),void x(op,this,this._uiManager.imageManager.getFromUrl(t).then((t=>r(mp,this,bp).call(this,t))).finally((()=>r(mp,this,Ap).call(this))))}if(_(hp,this)){const t=_(hp,this);return x(hp,this,null),this._uiManager.enableWaiting(!0),void x(op,this,this._uiManager.imageManager.getFromFile(t).then((t=>r(mp,this,bp).call(this,t))).finally((()=>r(mp,this,Ap).call(this))))}const t=document.createElement("input");t.type="file",t.accept=b.supportedTypesStr;const e=this._uiManager._signal;x(op,this,new Promise((i=>{t.addEventListener("change",(async()=>{if(t.files&&0!==t.files.length){this._uiManager.enableWaiting(!0);const e=await this._uiManager.imageManager.getFromFile(t.files[0]);r(mp,this,bp).call(this,e)}else this.remove();i()}),{signal:e}),t.addEventListener("cancel",(()=>{this.remove(),i()}),{signal:e})})).finally((()=>r(mp,this,Ap).call(this)))),t.click()}function wp(){const{div:t}=this;let{width:e,height:i}=_(ap,this);const[s,n]=this.pageDimensions,a=.75;if(this.width)e=this.width*s,i=this.height*n;else if(e>a*s||i>a*n){const t=Math.min(a*s/e,a*n/i);e*=t,i*=t}const[o,l]=this.parentDimensions;this.setDims(e*o/s,i*l/n),this._uiManager.enableWaiting(!1);const h=x(dp,this,document.createElement("canvas"));t.append(h),t.hidden=!1,r(mp,this,kp).call(this,e,i),r(mp,this,Sp).call(this),_(gp,this)||(this.parent.addUndoableEditor(this),x(gp,this,!0)),this._reportTelemetry({action:"inserted_image"}),_(cp,this)&&h.setAttribute("aria-label",_(cp,this))}function _p(t,e){var i;const[s,n]=this.parentDimensions;this.width=t/s,this.height=e/n,this.setDims(t,e),null!==(i=this._initialOptions)&&void 0!==i&&i.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,null!==_(pp,this)&&clearTimeout(_(pp,this));x(pp,this,setTimeout((()=>{x(pp,this,null),r(mp,this,kp).call(this,t,e)}),200))}function xp(t,e){const{width:i,height:s}=_(ap,this);let n=i,a=s,r=_(ap,this);for(;n>2*t||a>2*e;){const i=n,s=a;n>2*t&&(n=n>=16384?Math.floor(n/2)-1:Math.ceil(n/2)),a>2*e&&(a=a>=16384?Math.floor(a/2)-1:Math.ceil(a/2));const o=new OffscreenCanvas(n,a);o.getContext("2d").drawImage(r,0,0,i,s,0,0,n,a),r=o.transferToImageBitmap()}return r}function kp(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=_(dp,this);if(!i||i.width===t&&i.height===e)return;i.width=t,i.height=e;const s=_(fp,this)?_(ap,this):r(mp,this,xp).call(this,t,e);if(this._uiManager.hasMLManager&&!this.hasAltText()){const i=new OffscreenCanvas(t,e).getContext("2d");i.drawImage(s,0,0,s.width,s.height,0,0,t,e),this._uiManager.mlGuess({service:"image-to-text",request:{data:i.getImageData(0,0,t,e).data,width:t,height:e,channels:4}}).then((t=>{const e=(null===t||void 0===t?void 0:t.output)||"";this.parent&&e&&!this.hasAltText()&&(this.altTextData={altText:e,decorative:!1})}))}const n=i.getContext("2d");n.filter=this._uiManager.hcmFilter,n.drawImage(s,0,0,s.width,s.height,0,0,t,e)}function Ep(t){if(t){if(_(fp,this)){const t=this._uiManager.imageManager.getSvgUrl(_(rp,this));if(t)return t}const t=document.createElement("canvas");({width:t.width,height:t.height}=_(ap,this));return t.getContext("2d").drawImage(_(ap,this),0,0),t.toDataURL()}if(_(fp,this)){const[t,e]=this.pageDimensions,i=Math.round(this.width*t*ue.PDF_TO_CSS_UNITS),s=Math.round(this.height*e*ue.PDF_TO_CSS_UNITS),n=new OffscreenCanvas(i,s);return n.getContext("2d").drawImage(_(ap,this),0,0,_(ap,this).width,_(ap,this).height,0,0,i,s),n.transferToImageBitmap()}return structuredClone(_(ap,this))}function Sp(){this._uiManager._signal&&(x(up,this,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&r(mp,this,_p).call(this,e.width,e.height)}))),_(up,this).observe(this.div),this._uiManager._signal.addEventListener("abort",(()=>{var t;null===(t=_(up,this))||void 0===t||t.disconnect(),x(up,this,null)}),{once:!0}))}b=vp,(0,y.A)(vp,"_type","stamp"),(0,y.A)(vp,"_editorType",W.STAMP);var Mp=new WeakMap,Cp=new WeakMap,Rp=new WeakMap,Tp=new WeakMap,Pp=new WeakMap,Lp=new WeakMap,Dp=new WeakMap,Ip=new WeakMap,Fp=new WeakMap,Op=new WeakMap,Np=new WeakMap,Wp=new WeakMap,jp=new WeakMap,Bp=new WeakSet;class Hp{constructor(t){let{uiManager:e,pageIndex:i,div:s,accessibilityManager:n,annotationLayer:r,drawLayer:o,textLayer:l,viewport:h,l10n:c}=t;a(this,Bp),w(this,Mp,void 0),w(this,Cp,!1),w(this,Rp,null),w(this,Tp,null),w(this,Pp,null),w(this,Lp,null),w(this,Dp,null),w(this,Ip,new Map),w(this,Fp,!1),w(this,Op,!1),w(this,Np,!1),w(this,Wp,null),w(this,jp,void 0);const d=[...Xp._.values()];if(!Hp._initialized){Hp._initialized=!0;for(const t of d)t.initialize(c,e)}e.registerEditorTypes(d),x(jp,this,e),this.pageIndex=i,this.div=s,x(Mp,this,n),x(Rp,this,r),this.viewport=h,x(Wp,this,l),this.drawLayer=o,_(jp,this).addLayer(this)}get isEmpty(){return 0===_(Ip,this).size}get isInvisible(){return this.isEmpty&&_(jp,this).getMode()===W.NONE}updateToolbar(t){_(jp,this).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_(jp,this).getMode();switch(r(Bp,this,qp).call(this),t){case W.NONE:return this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),void this.disableClick();case W.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case W.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);const{classList:e}=this.div;for(const i of Xp._.values())e.toggle("".concat(i._type,"Editing"),t===i._editorType);this.div.hidden=!1}hasTextLayer(t){var e;return t===(null===(e=_(Wp,this))||void 0===e?void 0:e.div)}addInkEditorIfNeeded(t){if(_(jp,this).getMode()!==W.INK)return;if(!t)for(const e of _(Ip,this).values())if(e.isEmpty())return void e.setInBackground();this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){_(jp,this).setEditingState(t)}addCommands(t){_(jp,this).addCommands(t)}togglePointerEvents(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(){var t;let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];null===(t=_(Rp,this))||void 0===t||t.div.classList.toggle("disabled",!e)}enable(){this.div.tabIndex=0,this.togglePointerEvents(!0);const t=new Set;for(const i of _(Ip,this).values())i.enableEditing(),i.show(!0),i.annotationElementId&&(_(jp,this).removeChangedExistingAnnotation(i),t.add(i.annotationElementId));if(!_(Rp,this))return;const e=_(Rp,this).getEditableAnnotations();for(const i of e){if(i.hide(),_(jp,this).isDeletedAnnotationElement(i.data.id))continue;if(t.has(i.data.id))continue;const e=this.deserialize(i);e&&(this.addOrRebuild(e),e.enableEditing())}}disable(){x(Np,this,!0),this.div.tabIndex=-1,this.togglePointerEvents(!1);const t=new Map,e=new Map;for(const n of _(Ip,this).values()){var i;n.disableEditing(),n.annotationElementId&&(null===n.serialize()?(e.set(n.annotationElementId,n),null===(i=this.getEditableAnnotation(n.annotationElementId))||void 0===i||i.show(),n.remove()):t.set(n.annotationElementId,n))}if(_(Rp,this)){const i=_(Rp,this).getEditableAnnotations();for(const s of i){const{id:i}=s.data;if(_(jp,this).isDeletedAnnotationElement(i))continue;let n=e.get(i);n?(n.resetAnnotationElement(s),n.show(!1),s.show()):(n=t.get(i),n&&(_(jp,this).addChangedExistingAnnotation(n),n.renderAnnotationElement(s),n.show(!1)),s.show())}}r(Bp,this,qp).call(this),this.isEmpty&&(this.div.hidden=!0);const{classList:s}=this.div;for(const n of Xp._.values())s.remove("".concat(n._type,"Editing"));this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),x(Np,this,!1)}getEditableAnnotation(t){var e;return(null===(e=_(Rp,this))||void 0===e?void 0:e.getEditableAnnotation(t))||null}setActiveEditor(t){_(jp,this).getActive()!==t&&_(jp,this).setActiveEditor(t)}enableTextSelection(){var t;this.div.tabIndex=-1,null!==(t=_(Wp,this))&&void 0!==t&&t.div&&!_(Lp,this)&&(x(Lp,this,r(Bp,this,zp).bind(this)),_(Wp,this).div.addEventListener("pointerdown",_(Lp,this),{signal:_(jp,this)._signal}),_(Wp,this).div.classList.add("highlighting"))}disableTextSelection(){var t;this.div.tabIndex=0,null!==(t=_(Wp,this))&&void 0!==t&&t.div&&_(Lp,this)&&(_(Wp,this).div.removeEventListener("pointerdown",_(Lp,this)),x(Lp,this,null),_(Wp,this).div.classList.remove("highlighting"))}enableClick(){if(_(Pp,this))return;const t=_(jp,this)._signal;x(Pp,this,this.pointerdown.bind(this)),x(Tp,this,this.pointerup.bind(this)),this.div.addEventListener("pointerdown",_(Pp,this),{signal:t}),this.div.addEventListener("pointerup",_(Tp,this),{signal:t})}disableClick(){_(Pp,this)&&(this.div.removeEventListener("pointerdown",_(Pp,this)),this.div.removeEventListener("pointerup",_(Tp,this)),x(Pp,this,null),x(Tp,this,null))}attach(t){_(Ip,this).set(t.id,t);const{annotationElementId:e}=t;e&&_(jp,this).isDeletedAnnotationElement(e)&&_(jp,this).removeDeletedAnnotationElement(t)}detach(t){var e;_(Ip,this).delete(t.id),null===(e=_(Mp,this))||void 0===e||e.removePointerInTextLayer(t.contentDiv),!_(Np,this)&&t.annotationElementId&&_(jp,this).addDeletedAnnotationElement(t)}remove(t){this.detach(t),_(jp,this).removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,_(Op,this)||this.addInkEditorIfNeeded(!1)}changeParent(t){var e;t.parent!==this&&(t.parent&&t.annotationElementId&&(_(jp,this).addDeletedAnnotationElement(t.annotationElementId),Tn.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),null===(e=t.parent)||void 0===e||e.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(t.parent!==this||!t.isAttachedToDOM){if(this.changeParent(t),_(jp,this).addEditor(t),this.attach(t),!t.isAttachedToDOM){const e=t.render();this.div.append(e),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),_(jp,this).addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){var e;if(!t.isAttachedToDOM)return;const{activeElement:i}=document;t.div.contains(i)&&!_(Dp,this)&&(t._focusEventsAllowed=!1,x(Dp,this,setTimeout((()=>{x(Dp,this,null),t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",(()=>{t._focusEventsAllowed=!0}),{once:!0,signal:_(jp,this)._signal}),i.focus())}),0))),t._structTreeParentId=null===(e=_(Mp,this))||void 0===e?void 0:e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||(t.parent=this),t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){this.addCommands({cmd:()=>t._uiManager.rebuild(t),undo:()=>{t.remove()},mustExec:!1})}getNextId(){return _(jp,this).getId()}get _signal(){return _(jp,this)._signal}canCreateNewEmptyEditor(){var t;return null===(t=o(Bp,this,Vp))||void 0===t?void 0:t.canCreateNewEmptyEditor()}pasteEditor(t,e){_(jp,this).updateToolbar(t),_(jp,this).updateMode(t);const{offsetX:i,offsetY:s}=r(Bp,this,Up).call(this),n=this.getNextId(),a=r(Bp,this,Gp).call(this,{parent:this,id:n,x:i,y:s,uiManager:_(jp,this),isCentered:!0,...e});a&&this.add(a)}deserialize(t){var e,i;return(null===(e=Xp._.get(null!==(i=t.annotationType)&&void 0!==i?i:t.annotationEditorType))||void 0===e?void 0:e.deserialize(t,this,_(jp,this)))||null}createAndAddNewEditor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getNextId(),n=r(Bp,this,Gp).call(this,{parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:_(jp,this),isCentered:e,...i});return n&&this.add(n),n}addNewEditor(){this.createAndAddNewEditor(r(Bp,this,Up).call(this),!0)}setSelected(t){_(jp,this).setSelected(t)}toggleSelected(t){_(jp,this).toggleSelected(t)}isSelected(t){return _(jp,this).isSelected(t)}unselect(t){_(jp,this).unselect(t)}pointerup(t){const{isMac:e}=Ht.platform;0!==t.button||t.ctrlKey&&e||t.target===this.div&&_(Fp,this)&&(x(Fp,this,!1),_(Cp,this)?_(jp,this).getMode()!==W.STAMP?this.createAndAddNewEditor(t,!1):_(jp,this).unselectAll():x(Cp,this,!0))}pointerdown(t){if(_(jp,this).getMode()===W.HIGHLIGHT&&this.enableTextSelection(),_(Fp,this))return void x(Fp,this,!1);const{isMac:e}=Ht.platform;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;x(Fp,this,!0);const i=_(jp,this).getActive();x(Cp,this,!i||i.isEmpty())}findNewParent(t,e,i){const s=_(jp,this).findParent(e,i);return null!==s&&s!==this&&(s.changeParent(t),!0)}destroy(){var t;(null===(t=_(jp,this).getActive())||void 0===t?void 0:t.parent)===this&&(_(jp,this).commitOrRemove(),_(jp,this).setActiveEditor(null)),_(Dp,this)&&(clearTimeout(_(Dp,this)),x(Dp,this,null));for(const i of _(Ip,this).values()){var e;null===(e=_(Mp,this))||void 0===e||e.removePointerInTextLayer(i.contentDiv),i.setParent(null),i.isAttachedToDOM=!1,i.div.remove()}this.div=null,_(Ip,this).clear(),_(jp,this).removeLayer(this)}render(t){let{viewport:e}=t;this.viewport=e,Je(this.div,e);for(const i of _(jp,this).getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update(t){let{viewport:e}=t;_(jp,this).commitOrRemove(),r(Bp,this,qp).call(this);const i=this.viewport.rotation,s=e.rotation;if(this.viewport=e,Je(this.div,{rotation:s}),i!==s)for(const n of _(Ip,this).values())n.rotate(s);this.addInkEditorIfNeeded(!1)}get pageDimensions(){const{pageWidth:t,pageHeight:e}=this.viewport.rawDims;return[t,e]}get scale(){return _(jp,this).viewParameters.realScale}}function zp(t){if(_(jp,this).unselectAll(),t.target===_(Wp,this).div){const{isMac:e}=Ht.platform;if(0!==t.button||t.ctrlKey&&e)return;_(jp,this).showAllEditors("highlight",!0,!0),_(Wp,this).div.classList.add("free"),tu.startHighlighting(this,"ltr"===_(jp,this).direction,t),_(Wp,this).div.addEventListener("pointerup",(()=>{_(Wp,this).div.classList.remove("free")}),{once:!0,signal:_(jp,this)._signal}),t.preventDefault()}}function Vp(t){return Xp._.get(_(jp,t).getMode())}function Gp(t){const e=o(Bp,this,Vp);return e?new e.prototype.constructor(t):null}function Up(){const{x:t,y:e,width:i,height:s}=this.div.getBoundingClientRect(),n=Math.max(0,t),a=Math.max(0,e),r=(n+Math.min(window.innerWidth,t+i))/2-t,o=(a+Math.min(window.innerHeight,e+s))/2-e,[l,h]=this.viewport.rotation%180===0?[r,o]:[o,r];return{offsetX:l,offsetY:h}}function qp(){x(Op,this,!0);for(const t of _(Ip,this).values())t.isEmpty()&&t.remove();x(Op,this,!1)}(0,y.A)(Hp,"_initialized",!1);var Xp={_:new Map([fc,Lu,vp,tu].map((t=>[t._editorType,t])))},Kp=new WeakMap,Yp=new WeakMap,Qp=new WeakMap,Jp=new WeakMap,Zp=new WeakSet;class $p{constructor(t){let{pageIndex:e}=t;a(this,Zp),w(this,Kp,null),w(this,Yp,0),w(this,Qp,new Map),w(this,Jp,new Map),this.pageIndex=e}setParent(t){if(_(Kp,this)){if(_(Kp,this)!==t){if(_(Qp,this).size>0)for(const e of _(Qp,this).values())e.remove(),t.append(e);x(Kp,this,t)}}else x(Kp,this,t)}static get _svgFactory(){return Rt(this,"_svgFactory",new Ie)}highlight(t,e,i){var s,n;let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const o=(x(Yp,this,(s=_(Yp,this),n=s++,s)),n),l=r(Zp,this,ef).call(this,t.box);l.classList.add("highlight"),t.free&&l.classList.add("free");const h=$p._svgFactory.createElement("defs");l.append(h);const c=$p._svgFactory.createElement("path");h.append(c);const d="path_p".concat(this.pageIndex,"_").concat(o);c.setAttribute("id",d),c.setAttribute("d",t.toSVGPath()),a&&_(Jp,this).set(o,c);const u=r(Zp,this,sf).call(this,h,d),p=$p._svgFactory.createElement("use");return l.append(p),l.setAttribute("fill",e),l.setAttribute("fill-opacity",i),p.setAttribute("href","#".concat(d)),_(Qp,this).set(o,l),{id:o,clipPathId:"url(#".concat(u,")")}}highlightOutline(t){var e,i;const s=(x(Yp,this,(e=_(Yp,this),i=e++,e)),i),n=r(Zp,this,ef).call(this,t.box);n.classList.add("highlightOutline");const a=$p._svgFactory.createElement("defs");n.append(a);const o=$p._svgFactory.createElement("path");a.append(o);const l="path_p".concat(this.pageIndex,"_").concat(s);let h;if(o.setAttribute("id",l),o.setAttribute("d",t.toSVGPath()),o.setAttribute("vector-effect","non-scaling-stroke"),t.free){n.classList.add("free");const t=$p._svgFactory.createElement("mask");a.append(t),h="mask_p".concat(this.pageIndex,"_").concat(s),t.setAttribute("id",h),t.setAttribute("maskUnits","objectBoundingBox");const e=$p._svgFactory.createElement("rect");t.append(e),e.setAttribute("width","1"),e.setAttribute("height","1"),e.setAttribute("fill","white");const i=$p._svgFactory.createElement("use");t.append(i),i.setAttribute("href","#".concat(l)),i.setAttribute("stroke","none"),i.setAttribute("fill","black"),i.setAttribute("fill-rule","nonzero"),i.classList.add("mask")}const c=$p._svgFactory.createElement("use");n.append(c),c.setAttribute("href","#".concat(l)),h&&c.setAttribute("mask","url(#".concat(h,")"));const d=c.cloneNode();return n.append(d),c.classList.add("mainOutline"),d.classList.add("secondaryOutline"),_(Qp,this).set(s,n),s}finalizeLine(t,e){const i=_(Jp,this).get(t);_(Jp,this).delete(t),this.updateBox(t,e.box),i.setAttribute("d",e.toSVGPath())}updateLine(t,e){_(Qp,this).get(t).firstChild.firstChild.setAttribute("d",e.toSVGPath())}removeFreeHighlight(t){this.remove(t),_(Jp,this).delete(t)}updatePath(t,e){_(Jp,this).get(t).setAttribute("d",e.toSVGPath())}updateBox(t,e){tf.call($p,_(Qp,this).get(t),e)}show(t,e){_(Qp,this).get(t).classList.toggle("hidden",!e)}rotate(t,e){_(Qp,this).get(t).setAttribute("data-main-rotation",e)}changeColor(t,e){_(Qp,this).get(t).setAttribute("fill",e)}changeOpacity(t,e){_(Qp,this).get(t).setAttribute("fill-opacity",e)}addClass(t,e){_(Qp,this).get(t).classList.add(e)}removeClass(t,e){_(Qp,this).get(t).classList.remove(e)}remove(t){null!==_(Kp,this)&&(_(Qp,this).get(t).remove(),_(Qp,this).delete(t))}destroy(){x(Kp,this,null);for(const t of _(Qp,this).values())t.remove();_(Qp,this).clear()}}function tf(t){let{x:e=0,y:i=0,width:s=1,height:n=1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{style:a}=t;a.top="".concat(100*i,"%"),a.left="".concat(100*e,"%"),a.width="".concat(100*s,"%"),a.height="".concat(100*n,"%")}function ef(t){const e=A._svgFactory.create(1,1,!0);return _(Kp,this).append(e),e.setAttribute("aria-hidden",!0),tf.call(A,e,t),e}function sf(t,e){const i=A._svgFactory.createElement("clipPath");t.append(i);const s="clip_".concat(e);i.setAttribute("id",s),i.setAttribute("clipPathUnits","objectBoundingBox");const n=A._svgFactory.createElement("use");return i.append(n),n.setAttribute("href","#".concat(e)),n.classList.add("clip"),s}A=$p;var nf=E.AnnotationLayer,af=E.AnnotationMode,rf=E.GlobalWorkerOptions,of=E.PDFDataRangeTransport,lf=E.TextLayer,hf=E.getDocument},97806:(t,e,i)=>{"use strict";i.d(e,{A:()=>E});var s=i(70579),n=i(65043),a=i(77906),r=i(40645),o=i(58387),l=i(3404),h=i(96440),c=Object.prototype.hasOwnProperty;function d(t,e,i){for(i of t.keys())if(u(i,e))return i}function u(t,e){var i,s,n;if(t===e)return!0;if(t&&e&&(i=t.constructor)===e.constructor){if(i===Date)return t.getTime()===e.getTime();if(i===RegExp)return t.toString()===e.toString();if(i===Array){if((s=t.length)===e.length)for(;s--&&u(t[s],e[s]););return-1===s}if(i===Set){if(t.size!==e.size)return!1;for(s of t){if((n=s)&&"object"===typeof n&&!(n=d(e,n)))return!1;if(!e.has(n))return!1}return!0}if(i===Map){if(t.size!==e.size)return!1;for(s of t){if((n=s[0])&&"object"===typeof n&&!(n=d(e,n)))return!1;if(!u(s[1],e.get(n)))return!1}return!0}if(i===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(i===DataView){if((s=t.byteLength)===e.byteLength)for(;s--&&t.getInt8(s)===e.getInt8(s););return-1===s}if(ArrayBuffer.isView(t)){if((s=t.byteLength)===e.byteLength)for(;s--&&t[s]===e[s];);return-1===s}if(!i||"object"===typeof t){for(i in s=0,t){if(c.call(t,i)&&++s&&!c.call(e,i))return!1;if(!(i in e)||!u(t[i],e[i]))return!1}return Object.keys(e).length===s}}return t!==t&&e!==e}var p=i(77397),f=i(16512),g=i(48599);class m{constructor(){this.externalLinkEnabled=!0,this.externalLinkRel=void 0,this.externalLinkTarget=void 0,this.isInPresentationMode=!1,this.pdfDocument=void 0,this.pdfViewer=void 0}setDocument(t){this.pdfDocument=t}setViewer(t){this.pdfViewer=t}setExternalLinkRel(t){this.externalLinkRel=t}setExternalLinkTarget(t){this.externalLinkTarget=t}setHistory(){}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber||0}set page(t){(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),this.pdfViewer.currentPageNumber=t}get rotation(){return 0}set rotation(t){}goToDestination(t){return new Promise((e=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),(0,l.A)(t,"Destination is not specified."),"string"===typeof t?this.pdfDocument.getDestination(t).then(e):Array.isArray(t)?e(t):t.then(e)})).then((t=>{(0,l.A)(Array.isArray(t),'"'.concat(t,'" is not a valid destination array.'));const e=t[0];new Promise((t=>{(0,l.A)(this.pdfDocument,"PDF document not loaded."),e instanceof Object?this.pdfDocument.getPageIndex(e).then((e=>{t(e)})).catch((()=>{(0,l.A)(!1,'"'.concat(e,'" is not a valid page reference.'))})):"number"===typeof e?t(e):(0,l.A)(!1,'"'.concat(e,'" is not a valid destination reference.'))})).then((e=>{const i=e+1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(i>=1&&i<=this.pagesCount,'"'.concat(i,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({dest:t,pageIndex:e,pageNumber:i})}))}))}navigateTo(t){this.goToDestination(t)}goToPage(t){const e=t-1;(0,l.A)(this.pdfViewer,"PDF viewer is not initialized."),(0,l.A)(t>=1&&t<=this.pagesCount,'"'.concat(t,'" is not a valid page number.')),this.pdfViewer.scrollPageIntoView({pageIndex:e,pageNumber:t})}addLinkAttributes(t,e,i){t.href=e,t.rel=this.externalLinkRel||"noopener noreferrer nofollow",t.target=i?"_blank":this.externalLinkTarget||""}getDestinationHash(){return"#"}getAnchorUrl(){return"#"}setHash(){}executeNamedAction(){}cachePageRef(){}isPageVisible(){return!0}isPageCached(){return!0}executeSetOCGState(){}}const v={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var b=i(20665),A=i(28234),y=function(t,e,i,s){return new(i||(i=Promise))((function(n,a){function r(t){try{l(s.next(t))}catch(e){a(e)}}function o(t){try{l(s.throw(t))}catch(e){a(e)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(r,o)}l((s=s.apply(t,e||[])).next())}))},w=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"===typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n