An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:arrow_up: fix https://github.com/siyuan-note/siyuan/issues/6035
Vanessada71f8c4aa32
diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.tsindex bd446ef75a..47c8f78755 100644--- a/app/src/asset/anno.ts+++ b/app/src/asset/anno.ts@@ -28,7 +28,7 @@ const rectAnno = (config: any, pdf: any, element: HTMLElement) => {// 右键return;}- const canvasRect = pdf.pdfViewer._getCurrentVisiblePage().first.view.canvas.getBoundingClientRect();+ const canvasRect = pdf.pdfViewer._getVisiblePages().first.view.canvas.getBoundingClientRect();const containerRet = config.mainContainer.getBoundingClientRect();const mostLeft = canvasRect.left;const mostRight = canvasRect.right;diff --git a/app/src/asset/index.ts b/app/src/asset/index.tsindex f693315a43..69c2f646f5 100644--- a/app/src/asset/index.ts+++ b/app/src/asset/index.ts@@ -322,7 +322,7 @@ export class Asset extends Model {</div></div><div id="overlayContainer" class="fn__hidden">- <div id="passwordOverlay" class="container fn__hidden">+ <div id="passwordDialog" class="container fn__hidden"><div class="dialog"><div class="row"><p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>@@ -336,7 +336,7 @@ export class Asset extends Model {</div></div></div>- <div id="documentPropertiesOverlay" class="container fn__hidden">+ <div id="documentPropertiesDialog" class="container fn__hidden"><div class="dialog b3-menu"><div class="row"><span>${window.siyuan.languages.fileName}</span> <p id="fileNameField">-</p>@@ -427,6 +427,13 @@ export class Asset extends Model {<span class="b3-menu__label">${window.siyuan.languages.remove}</span></button></div>+ <div class="fn__none">+ <input id="editorFreeTextFontSize">+ <input id="editorFreeTextColor">+ <input id="editorInkColor">+ <input id="editorInkThickness">+ <input id="editorInkOpacity">+ </div></div> <!-- outerContainer --><div id="printContainer"></div>`;// 初始化完成后需等待页签是否显示设置完成,才可以判断 pdf 是否能进行渲染diff --git a/app/src/asset/pdf/annotation_layer_builder.js b/app/src/asset/pdf/annotation_layer_builder.jsindex 8d65c45d9a..370756ad70 100644--- a/app/src/asset/pdf/annotation_layer_builder.js+++ b/app/src/asset/pdf/annotation_layer_builder.js@@ -13,6 +13,15 @@* limitations under the License.*/+/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */+/** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */+/** @typedef {import("./interfaces").IL10n} IL10n */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+// eslint-disable-next-line max-len+/** @typedef {import("./textaccessibility.js").TextAccessibilityManager} TextAccessibilityManager */+import { AnnotationLayer } from "./pdfjs";import { NullL10n } from "./l10n_utils.js";@@ -33,6 +42,7 @@ import { NullL10n } from "./l10n_utils.js";* [fieldObjectsPromise]* @property {Object} [mouseState]* @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]+ * @property {TextAccessibilityManager} accessibilityManager*/class AnnotationLayerBuilder {@@ -53,6 +63,7 @@ class AnnotationLayerBuilder {fieldObjectsPromise = null,mouseState = null,annotationCanvasMap = null,+ accessibilityManager = null,}) {this.pageDiv = pageDiv;this.pdfPage = pdfPage;@@ -67,6 +78,7 @@ class AnnotationLayerBuilder {this._fieldObjectsPromise = fieldObjectsPromise;this._mouseState = mouseState;this._annotationCanvasMap = annotationCanvasMap;+ this._accessibilityManager = accessibilityManager;this.div = null;this._cancelled = false;@@ -105,6 +117,7 @@ class AnnotationLayerBuilder {fieldObjects,mouseState: this._mouseState,annotationCanvasMap: this._annotationCanvasMap,+ accessibilityManager: this._accessibilityManager,};if (this.div) {@@ -116,7 +129,7 @@ class AnnotationLayerBuilder {// if there is at least one annotation.this.div = document.createElement("div");this.div.className = "annotationLayer";- this.pageDiv.appendChild(this.div);+ this.pageDiv.append(this.div);parameters.div = this.div;AnnotationLayer.render(parameters);diff --git a/app/src/asset/pdf/app.js b/app/src/asset/pdf/app.jsindex a73104124c..e6a6899a99 100644--- a/app/src/asset/pdf/app.js+++ b/app/src/asset/pdf/app.js@@ -12,7 +12,6 @@* See the License for the specific language governing permissions and* limitations under the License.*/-/* globals PDFBug, Stats */import {animationStarted,@@ -35,9 +34,8 @@ import {SpreadMode,TextLayerMode,} from './ui_utils.js'-import { AppOptions, OptionKind } from './app_options.js'-import { AutomationEventBus, EventBus } from './event_utils.js'import {+ AnnotationEditorType,build,createPromiseCapability,getDocument,@@ -55,8 +53,11 @@ import {UNSUPPORTED_FEATURES,version,} from './pdfjs'+import { AppOptions, OptionKind } from './app_options.js'+import { AutomationEventBus, EventBus } from './event_utils.js'import { CursorTool, PDFCursorTools } from './pdf_cursor_tools.js'import { LinkTarget, PDFLinkService } from './pdf_link_service.js'+import { AnnotationEditorParams } from './annotation_editor_params.js'import { OverlayManager } from './overlay_manager.js'import { PasswordPrompt } from './password_prompt.js'import { PDFAttachmentViewer } from './pdf_attachment_viewer.js'@@ -194,6 +195,8 @@ class PDFViewerApplication {this.eventBus = null/** @type {IL10n} */this.l10n = null+ /** @type {AnnotationEditorParams} */+ this.annotationEditorParams = nullthis.isInitialViewSet = falsethis.downloadComplete = falsethis.isViewerEmbedded = window.parent !== window@@ -209,7 +212,10 @@ class PDFViewerApplication {this._saveInProgress = falsethis._docStats = nullthis._wheelUnusedTicks = 0- this._idleCallbacks = new Set()+ this._PDFBug = null+ this._hasAnnotationEditors = false+ this._title = document.title+ this._printAnnotationStoragePromise = null}// Called once when the document is loaded.@@ -279,11 +285,15 @@ class PDFViewerApplication {if (!hash) {return}- const params = parseQueryString(hash),- waitOn = []+ const {mainContainer, viewerContainer} = this.appConfig,+ params = parseQueryString(hash)if (params.get('disableworker') === 'true') {- waitOn.push(loadFakeWorker())+ try {+ await loadFakeWorker()+ } catch (ex) {+ console.error(`_parseHashParameters: "${ex.message}".`)+ }}if (params.has('disablerange')) {AppOptions.set('disableRange', params.get('disablerange') === 'true')@@ -317,8 +327,13 @@ class PDFViewerApplication {case 'visible':case 'shadow':case 'hover':- const viewer = this.appConfig.viewerContainer- viewer.classList.add(`textLayer-${params.get('textlayer')}`)+ viewerContainer.classList.add(`textLayer-${params.get('textlayer')}`)+ try {+ await loadPDFBug(this)+ this._PDFBug.loadCSS()+ } catch (ex) {+ console.error(`_parseHashParameters: "${ex.message}".`)+ }break}}@@ -327,7 +342,12 @@ class PDFViewerApplication {AppOptions.set('fontExtraProperties', true)const enabled = params.get('pdfbug').split(',')- waitOn.push(initPDFBug(enabled, this))+ try {+ await loadPDFBug(this)+ this._PDFBug.init({OPS}, mainContainer, enabled)+ } catch (ex) {+ console.error(`_parseHashParameters: "${ex.message}".`)+ }}// It is not possible to change locale for the (various) extension builds.if (@@ -337,15 +357,6 @@ class PDFViewerApplication {) {AppOptions.set('locale', params.get('locale'))}-- if (waitOn.length === 0) {- return- }- try {- await Promise.all(waitOn)- } catch (reason) {- console.error(`_parseHashParameters: "${reason.message}".`)- }}/**@@ -435,8 +446,18 @@ class PDFViewerApplication {})this.pdfScriptingManager = pdfScriptingManager- const container = appConfig.mainContainer- const viewer = appConfig.viewerContainer+ const container = appConfig.mainContainer,+ viewer = appConfig.viewerContainer+ const annotationEditorMode = AppOptions.get('annotationEditorMode')+ const pageColors =+ AppOptions.get('forcePageColors') ||+ window.matchMedia('(forced-colors: active)').matches+ ? {+ background: AppOptions.get('pageColorsBackground'),+ foreground: AppOptions.get('pageColorsForeground'),+ }+ : null+this.pdfViewer = new PDFViewer({container,viewer,@@ -447,15 +468,21 @@ class PDFViewerApplication {findController,scriptingManager:AppOptions.get('enableScripting') && pdfScriptingManager,- renderer: AppOptions.get('renderer'),+ renderer:+ typeof PDFJSDev === 'undefined' ||+ PDFJSDev.test('!PRODUCTION || GENERIC')+ ? AppOptions.get('renderer')+ : null,l10n: this.l10n,textLayerMode: AppOptions.get('textLayerMode'),annotationMode: AppOptions.get('annotationMode'),+ annotationEditorMode,imageResourcesPath: AppOptions.get('imageResourcesPath'),enablePrintAutoRotate: AppOptions.get('enablePrintAutoRotate'),useOnlyCssZoom: AppOptions.get('useOnlyCssZoom'),maxCanvasPixels: AppOptions.get('maxCanvasPixels'),enablePermissions: AppOptions.get('enablePermissions'),+ pageColors,})pdfRenderingQueue.setViewer(this.pdfViewer)pdfLinkService.setViewer(this.pdfViewer)@@ -467,6 +494,7 @@ class PDFViewerApplication {renderingQueue: pdfRenderingQueue,linkService: pdfLinkService,l10n: this.l10n,+ pageColors,})pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer)@@ -484,11 +512,28 @@ class PDFViewerApplication {this.findBar = new PDFFindBar(appConfig.findBar, eventBus, this.l10n)}+ if (annotationEditorMode !== AnnotationEditorType.DISABLE) {+ this.annotationEditorParams = new AnnotationEditorParams(+ appConfig.annotationEditorParams,+ eventBus,+ )+ } else {+ for (const element of [+ document.getElementById('editorModeButtons'),+ document.getElementById('editorModeSeparator'),+ ]) {+ element.hidden = true+ }+ }+this.pdfDocumentProperties = new PDFDocumentProperties(appConfig.documentProperties,this.overlayManager,eventBus,this.l10n,+ /* fileNameLookup = */ () => {+ return this._docFilename+ },)this.pdfCursorTools = new PDFCursorTools({@@ -501,8 +546,8 @@ class PDFViewerApplication {this.secondaryToolbar = new SecondaryToolbar(appConfig.secondaryToolbar,- container,eventBus,+ this.externalServices,)if (this.supportsFullscreen) {@@ -556,9 +601,7 @@ class PDFViewerApplication {run (config) {// NOTE- this.initialize(config).then(() => {- webViewerInitialized(this)- })+ this.initialize(config).then(webViewerInitialized(this))}get initialized () {@@ -619,7 +662,7 @@ class PDFViewerApplication {}get loadingBar () {- const bar = new ProgressBar(this.appConfig.appContainer)+ const bar = new ProgressBar('loadingBar')return shadow(this, 'loadingBar', bar)}@@ -679,12 +722,16 @@ class PDFViewerApplication {this.setTitle(title)}- setTitle (title) {+ setTitle (title = this._title) {+ this._title = title+if (this.isViewerEmbedded) {// Embedded PDF viewers should not be changing their parent page's title.return}- // NOTE document.title = title+ const editorIndicator =+ this._hasAnnotationEditors && !this.pdfRenderingQueue.printing+ // NOTE document.title = `${editorIndicator ? '* ' : ''}${title}`}get _docFilename () {@@ -698,22 +745,7 @@ class PDFViewerApplication {*/_hideViewBookmark () {// URL does not reflect proper document location - hiding some buttons.- const {toolbar, secondaryToolbar} = this.appConfig- toolbar.viewBookmark.hidden = true- secondaryToolbar.viewBookmarkButton.hidden = true- }-- /**- * @private- */- _cancelIdleCallbacks () {- if (!this._idleCallbacks.size) {- return- }- for (const callback of this._idleCallbacks) {- window.cancelIdleCallback(callback)- }- this._idleCallbacks.clear()+ this.appConfig.secondaryToolbar.viewBookmarkButton.hidden = true}/**@@ -740,7 +772,7 @@ class PDFViewerApplication {) {try {// Trigger saving, to prevent data loss in forms; see issue 12257.- await this.save({sourceEventType: 'save'})+ await this.save()} catch (reason) {// Ignoring errors, to ensure that document closing won't break.}@@ -771,10 +803,11 @@ class PDFViewerApplication {this._contentLength = nullthis._saveInProgress = falsethis._docStats = null+ this._hasAnnotationEditors = false- this._cancelIdleCallbacks()promises.push(this.pdfScriptingManager.destroyPromise)+ this.setTitle()this.pdfSidebar.reset()this.pdfOutlineViewer.reset()this.pdfAttachmentViewer.reset()@@ -784,10 +817,8 @@ class PDFViewerApplication {this.findBar?.reset()this.toolbar.reset()this.secondaryToolbar.reset()+ this._PDFBug?.cleanup()- if (typeof PDFBug !== 'undefined') {- PDFBug.cleanup()- }await Promise.all(promises)}@@ -869,6 +900,7 @@ class PDFViewerApplication {return undefined // Ignore errors for previously opened PDF files.}+ // NOTElet key = 'loadingError'if (reason instanceof InvalidPDFException) {key = 'invalidFileError'@@ -894,7 +926,7 @@ class PDFViewerApplication {throw new Error('PDF document not downloaded.')}- async download ({sourceEventType = 'download'} = {}) {+ async download () {const url = this._downloadUrl,filename = this._docFilenametry {@@ -903,7 +935,7 @@ class PDFViewerApplication {const data = await this.pdfDocument.getData()const blob = new Blob([data], {type: 'application/pdf'})- await this.downloadManager.download(blob, url, filename, sourceEventType)+ await this.downloadManager.download(blob, url, filename)} catch (reason) {// When the PDF document isn't ready, or the PDF file is still// downloading, simply download using the URL.@@ -911,7 +943,7 @@ class PDFViewerApplication {}}- async save ({sourceEventType = 'download'} = {}) {+ async save () {if (this._saveInProgress) {return}@@ -926,23 +958,30 @@ class PDFViewerApplication {const data = await this.pdfDocument.saveDocument()const blob = new Blob([data], {type: 'application/pdf'})- await this.downloadManager.download(blob, url, filename, sourceEventType)+ await this.downloadManager.download(blob, url, filename)} catch (reason) {// When the PDF document isn't ready, or the PDF file is still// downloading, simply fallback to a "regular" download.console.error(`Error when saving the document: ${reason.message}`)- await this.download({sourceEventType})+ await this.download()} finally {await this.pdfScriptingManager.dispatchDidSave()this._saveInProgress = false}++ if (this._hasAnnotationEditors) {+ this.externalServices.reportTelemetry({+ type: 'editing',+ data: {type: 'save'},+ })+ }}- downloadOrSave (options) {+ downloadOrSave () {if (this.pdfDocument?.annotationStorage.size > 0) {- this.save(options)+ this.save()} else {- this.download(options)+ this.download()}}@@ -978,6 +1017,7 @@ class PDFViewerApplication {* optionally a 'stack' property.*/_otherError (message, moreInfo = null) {+ // NOTEconst moreInfoText = [`PDF.js v${version || '?'} (build: ${build || '?'})`,]@@ -1049,31 +1089,33 @@ class PDFViewerApplication {// that we discard some of the loaded data. This can cause the loading// bar to move backwards. So prevent this by only updating the bar if it// increases.- if (percent > this.loadingBar.percent || isNaN(percent)) {- this.loadingBar.percent = percent-- // When disableAutoFetch is enabled, it's not uncommon for the entire file- // to never be fetched (depends on e.g. the file structure). In this case- // the loading bar will not be completely filled, nor will it be hidden.- // To prevent displaying a partially filled loading bar permanently, we- // hide it when no data has been loaded during a certain amount of time.- const disableAutoFetch = this.pdfDocument- ? this.pdfDocument.loadingParams.disableAutoFetch- : AppOptions.get('disableAutoFetch')-- if (disableAutoFetch && percent) {- if (this.disableAutoFetchLoadingBarTimeout) {- clearTimeout(this.disableAutoFetchLoadingBarTimeout)- this.disableAutoFetchLoadingBarTimeout = null- }- this.loadingBar.show()+ if (percent <= this.loadingBar.percent) {+ return+ }+ this.loadingBar.percent = percent- this.disableAutoFetchLoadingBarTimeout = setTimeout(() => {- this.loadingBar.hide()- this.disableAutoFetchLoadingBarTimeout = null- }, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT)- }+ // When disableAutoFetch is enabled, it's not uncommon for the entire file+ // to never be fetched (depends on e.g. the file structure). In this case+ // the loading bar will not be completely filled, nor will it be hidden.+ // To prevent displaying a partially filled loading bar permanently, we+ // hide it when no data has been loaded during a certain amount of time.+ const disableAutoFetch =+ this.pdfDocument?.loadingParams.disableAutoFetch ??+ AppOptions.get('disableAutoFetch')++ if (!disableAutoFetch || isNaN(percent)) {+ return}+ if (this.disableAutoFetchLoadingBarTimeout) {+ clearTimeout(this.disableAutoFetchLoadingBarTimeout)+ this.disableAutoFetchLoadingBarTimeout = null+ }+ this.loadingBar.show()++ this.disableAutoFetchLoadingBarTimeout = setTimeout(() => {+ this.loadingBar.hide()+ this.disableAutoFetchLoadingBarTimeout = null+ }, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT)}load (pdfDocument) {@@ -1113,7 +1155,7 @@ class PDFViewerApplication {baseDocumentUrl = location.href.split('#')[0]}this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl)- this.pdfDocumentProperties.setDocument(pdfDocument, this.url)+ this.pdfDocumentProperties.setDocument(pdfDocument)const pdfViewer = this.pdfViewerpdfViewer.setDocument(pdfDocument)@@ -1291,19 +1333,6 @@ class PDFViewerApplication {}this.pdfLayerViewer.render({optionalContentConfig, pdfDocument})})- if (- (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) ||- 'requestIdleCallback' in window- ) {- const callback = window.requestIdleCallback(- () => {- this._collectTelemetry(pdfDocument)- this._idleCallbacks.delete(callback)- },- {timeout: 1000},- )- this._idleCallbacks.add(callback)- }})this._initializePageLabels(pdfDocument)@@ -1350,23 +1379,6 @@ class PDFViewerApplication {}}- /**- * A place to fetch data for telemetry after one page is rendered and the- * viewer is idle.- * @private- */- async _collectTelemetry (pdfDocument) {- const markInfo = await this.pdfDocument.getMarkInfo()- if (pdfDocument !== this.pdfDocument) {- return // Document was closed while waiting for mark info.- }- const tagged = markInfo?.Marked || false- this.externalServices.reportTelemetry({- type: 'tagged',- tagged,- })- }-/*** @private*/@@ -1427,21 +1439,21 @@ class PDFViewerApplication {this._contentLength ??= contentLength // See `getDownloadInfo`-call above.// Provides some basic debug information+ // NOTE// console.log(// `PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` +// `${(info.Producer || '-').trim()} / ${(info.Creator || '-').trim()}] ` +// `(PDF.js: ${version || '-'})`,// )- let pdfTitle = info?.Title+ let pdfTitle = info.Titleconst metadataTitle = metadata?.get('dc:title')if (metadataTitle) {// Ghostscript can produce invalid 'dc:title' Metadata entries:// - The title may be "Untitled" (fixes bug 1031612).// - The title may contain incorrectly encoded characters, which thus- // looks broken, hence we ignore the Metadata entry when it- // contains characters from the Specials Unicode block- // (fixes bug 1605526).+ // looks broken, hence we ignore the Metadata entry when it contains+ // characters from the Specials Unicode block (fixes bug 1605526).if (metadataTitle !== 'Untitled' &&!/[\uFFF0-\uFFFF]/g.test(metadataTitle)@@ -1451,10 +1463,10 @@ class PDFViewerApplication {}if (pdfTitle) {this.setTitle(- `${pdfTitle} - ${contentDispositionFilename || document.title}`,+ `${pdfTitle} - ${this._contentDispositionFilename || this._title}`,)- } else if (contentDispositionFilename) {- this.setTitle(contentDispositionFilename)+ } else if (this._contentDispositionFilename) {+ this.setTitle(this._contentDispositionFilename)}if (@@ -1606,12 +1618,23 @@ class PDFViewerApplication {}}annotationStorage.onResetModified = () => {- // NOTE window.removeEventListener('beforeunload', beforeUnload)+ // NOTE window.removeEventListener('beforeunload', beforeUnload)if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {delete this._annotationStorageModified}}+ annotationStorage.onAnnotationEditor = typeStr => {+ this._hasAnnotationEditors = !!typeStr+ this.setTitle()++ if (typeStr) {+ this.externalServices.reportTelemetry({+ type: 'editing',+ data: {type: typeStr},+ })+ }+ }}setInitialView (@@ -1673,23 +1696,34 @@ class PDFViewerApplication {this.pdfViewer.cleanup()this.pdfThumbnailViewer.cleanup()- // We don't want to remove fonts used by active page SVGs.- this.pdfDocument.cleanup(- /* keepLoadedFonts = */ this.pdfViewer.renderer === RendererType.SVG,- )+ if (+ typeof PDFJSDev === 'undefined' ||+ PDFJSDev.test('!PRODUCTION || GENERIC')+ ) {+ // We don't want to remove fonts used by active page SVGs.+ this.pdfDocument.cleanup(+ /* keepLoadedFonts = */ this.pdfViewer.renderer === RendererType.SVG,+ )+ } else {+ this.pdfDocument.cleanup()+ }}forceRendering () {this.pdfRenderingQueue.printing = !!this.printServicethis.pdfRenderingQueue.isThumbnailViewEnabled =- this.pdfSidebar.isThumbnailViewVisible+ this.pdfSidebar.visibleView === SidebarView.THUMBSthis.pdfRenderingQueue.renderHighestPriority()}beforePrint () {- // Given that the "beforeprint" browser event is synchronous, we- // unfortunately cannot await the scripting event dispatching here.- this.pdfScriptingManager.dispatchWillPrint()+ this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().+ catch(() => {+ /* Avoid breaking printing; ignoring errors. */+ }).+ then(() => {+ return this.pdfDocument?.annotationStorage.print+ })if (this.printService) {// There is no way to suppress beforePrint/afterPrint events,@@ -1699,6 +1733,7 @@ class PDFViewerApplication {}if (!this.supportsPrinting) {+ // NOTEthis._otherError(window.siyuan.languages.printingNotSupported)return}@@ -1706,6 +1741,7 @@ class PDFViewerApplication {// The beforePrint is a sync method and we need to know layout before// returning from this method. Ensure that we can get sizes of the pages.if (!this.pdfViewer.pageViewsReady) {+ // NOTEwindow.alert(window.siyuan.languages.printingNotReady)return}@@ -1722,22 +1758,35 @@ class PDFViewerApplication {printContainer,printResolution,optionalContentConfigPromise,+ this._printAnnotationStoragePromise,this.l10n,)this.printService = printServicethis.forceRendering()+ // Disable the editor-indicator during printing (fixes bug 1790552).+ this.setTitle()printService.layout()this.externalServices.reportTelemetry({type: 'print',})++ if (this._hasAnnotationEditors) {+ this.externalServices.reportTelemetry({+ type: 'editing',+ data: {type: 'print'},+ })+ }}afterPrint () {- // Given that the "afterprint" browser event is synchronous, we- // unfortunately cannot await the scripting event dispatching here.- this.pdfScriptingManager.dispatchDidPrint()+ if (this._printAnnotationStoragePromise) {+ this._printAnnotationStoragePromise.then(() => {+ this.pdfScriptingManager.dispatchDidPrint()+ })+ this._printAnnotationStoragePromise = null+ }if (this.printService) {this.printService.destroy()@@ -1746,6 +1795,8 @@ class PDFViewerApplication {this.pdfDocument?.annotationStorage.resetModified()}this.forceRendering()+ // Re-enable the editor-indicator after printing (fixes bug 1790552).+ this.setTitle()}rotatePages (delta) {@@ -1771,6 +1822,7 @@ class PDFViewerApplication {_boundEvents.beforePrint = this.beforePrint.bind(this)_boundEvents.afterPrint = this.afterPrint.bind(this)+ eventBus._on('resize', webViewerResize)eventBus._on('hashchange', webViewerHashchange)eventBus._on('beforeprint', _boundEvents.beforePrint)eventBus._on('afterprint', _boundEvents.afterPrint)@@ -1784,9 +1836,16 @@ class PDFViewerApplication {eventBus._on('namedaction', webViewerNamedAction)eventBus._on('presentationmodechanged', webViewerPresentationModeChanged)eventBus._on('presentationmode', webViewerPresentationMode)+ eventBus._on(+ 'switchannotationeditormode',+ webViewerSwitchAnnotationEditorMode,+ )+ eventBus._on(+ 'switchannotationeditorparams',+ webViewerSwitchAnnotationEditorParams,+ )eventBus._on('print', webViewerPrint)eventBus._on('download', webViewerDownload)- eventBus._on('save', webViewerSave)eventBus._on('firstpage', webViewerFirstPage)eventBus._on('lastpage', webViewerLastPage)eventBus._on('nextpage', webViewerNextPage)@@ -1818,12 +1877,39 @@ class PDFViewerApplication {eventBus._on('fileinputchange', webViewerFileInputChange)eventBus._on('openfile', webViewerOpenFile)}+ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {+ eventBus._on(+ 'annotationeditorstateschanged',+ webViewerAnnotationEditorStatesChanged,+ )+ }}bindWindowEvents () {- this.unbindWindowEvents()const {eventBus, _boundEvents} = this+ function addWindowResolutionChange (evt = null) {+ if (evt) {+ webViewerResolutionChange(evt)+ }+ const mediaQueryList = window.matchMedia(+ `(resolution: ${window.devicePixelRatio || 1}dppx)`,+ )+ mediaQueryList.addEventListener('change', addWindowResolutionChange, {+ once: true,+ })++ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {+ return+ }+ _boundEvents.removeWindowResolutionChange ||= function () {+ mediaQueryList.removeEventListener('change', addWindowResolutionChange)+ _boundEvents.removeWindowResolutionChange = null+ }+ }++ addWindowResolutionChange()+_boundEvents.windowResize = () => {eventBus.dispatch('resize', {source: window})}@@ -1864,8 +1950,12 @@ class PDFViewerApplication {}unbindEvents () {+ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {+ throw new Error('Not implemented: unbindEvents')+ }const {eventBus, _boundEvents} = this+ eventBus._off('resize', webViewerResize)eventBus._off('hashchange', webViewerHashchange)eventBus._off('beforeprint', _boundEvents.beforePrint)eventBus._off('afterprint', _boundEvents.afterPrint)@@ -1881,7 +1971,6 @@ class PDFViewerApplication {eventBus._off('presentationmode', webViewerPresentationMode)eventBus._off('print', webViewerPrint)eventBus._off('download', webViewerDownload)- eventBus._off('save', webViewerSave)eventBus._off('firstpage', webViewerFirstPage)eventBus._off('lastpage', webViewerLastPage)eventBus._off('nextpage', webViewerNextPage)@@ -1919,6 +2008,9 @@ class PDFViewerApplication {}unbindWindowEvents () {+ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {+ throw new Error('Not implemented: unbindWindowEvents')+ }const {_boundEvents} = thiswindow.removeEventListener('visibilitychange', webViewerVisibilityChange)@@ -1937,6 +2029,7 @@ class PDFViewerApplication {_boundEvents.windowUpdateFromSandbox,)+ _boundEvents.removeWindowResolutionChange?.()_boundEvents.windowResize = null_boundEvents.windowHashChange = null_boundEvents.windowBeforePrint = null@@ -1966,9 +2059,8 @@ class PDFViewerApplication {* @private*/_unblockDocumentLoadEvent () {- if (document.blockUnblockOnload) {- document.blockUnblockOnload(false)- }+ document.blockUnblockOnload?.(false)+// Ensure that this method is only ever run once.this._unblockDocumentLoadEvent = () => {}}@@ -1997,15 +2089,15 @@ class PDFViewerApplication {}}-let validateFileURLif (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {const HOSTED_VIEWER_ORIGINS = ['null','http://mozilla.github.io','https://mozilla.github.io',]- validateFileURL = function (file) {- if (file === undefined) {+ // eslint-disable-next-line no-var+ var validateFileURL = function (file) {+ if (!file) {return}try {@@ -2022,6 +2114,7 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {throw new Error('file origin does not match viewer\'s')}} catch (ex) {+ // NOTEconsole.log(window.siyuan.languages.loadingError, ex.message)throw ex}@@ -2029,155 +2122,140 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {}async function loadFakeWorker () {- if (!GlobalWorkerOptions.workerSrc) {- GlobalWorkerOptions.workerSrc = AppOptions.get('workerSrc')- }+ GlobalWorkerOptions.workerSrc ||= AppOptions.get('workerSrc')+if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {+ // NOTEwindow.pdfjsWorker = await import(`${Constants.PROTYLE_CDN}/js/pdf/pdf.worker.js?v=2.14.102`)return}await loadScript(PDFWorker.workerSrc)}-async function initPDFBug (enabledTabs, pdfInstance) {- const {debuggerScriptPath, mainContainer} = pdfInstance.appConfig- await loadScript(debuggerScriptPath)- PDFBug.init({OPS}, mainContainer, enabledTabs)+async function loadPDFBug (self) {+ const {debuggerScriptPath} = self.appConfig+ const {PDFBug} =+ typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')+ ? await import(debuggerScriptPath) // eslint-disable-line no-unsanitized/method+ : await __non_webpack_import__(debuggerScriptPath) // eslint-disable-line no-undef++ self._PDFBug = PDFBug}-function reportPageStatsPDFBug ({pageNumber, source}) {- const pdfInstance = getPdfInstance(source.div)- if (!pdfInstance || typeof Stats === 'undefined' || !Stats.enabled) {+function reportPageStatsPDFBug ({pageNumber}) {+ if (!globalThis.Stats?.enabled) {return}const pageView = PDFViewerApplication.pdfViewer.getPageView(/* index = */ pageNumber - 1,)- const pageStats = pageView?.pdfPage?.stats- if (!pageStats) {- return- }- Stats.add(pageNumber, pageStats)+ globalThis.Stats.add(pageNumber, pageView?.pdfPage?.stats)}function webViewerInitialized (pdf) {- const appConfig = pdf.appConfig- let file- if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {- validateFileURL(appConfig.file)- } else if (PDFJSDev.test('MOZCENTRAL')) {- file = window.location.href- } else if (PDFJSDev.test('CHROME')) {- file = AppOptions.get('defaultUrl')- }-- if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {- const fileInput = document.createElement('input')- fileInput.id = appConfig.openFileInputName- fileInput.className = 'fileInput'- fileInput.setAttribute('type', 'file')- fileInput.oncontextmenu = noContextMenuHandler- document.body.appendChild(fileInput)-- if (- !window.File ||- !window.FileReader ||- !window.FileList ||- !window.Blob- ) {- appConfig.toolbar.openFile.hidden = true- appConfig.secondaryToolbar.openFileButton.hidden = true- } else {- fileInput.value = null- }-- fileInput.addEventListener('change', function (evt) {- const files = evt.target.files- if (!files || files.length === 0) {- return- }- pdf.eventBus.dispatch('fileinputchange', {- source: this,- fileInput: evt.target,- })- })-- // Enable dragging-and-dropping a new PDF file onto the viewerContainer.- appConfig.mainContainer.addEventListener('dragover', function (evt) {- evt.preventDefault()-- evt.dataTransfer.dropEffect = 'move'- })- appConfig.mainContainer.addEventListener('drop', function (evt) {- evt.preventDefault()-- const files = evt.dataTransfer.files- if (!files || files.length === 0) {- return- }- pdf.eventBus.dispatch('fileinputchange', {- source: this,- fileInput: evt.dataTransfer,- })- })- } else {- appConfig.toolbar.openFile.hidden = true- appConfig.secondaryToolbar.openFileButton.hidden = true+ // NOTE+ const {appConfig, eventBus} = pdf+ const file = appConfig.file+ // NOTE+ // if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {+ // const queryString = document.location.search.substring(1)+ // const params = parseQueryString(queryString)+ // file = params.get('file') ?? AppOptions.get('defaultUrl')+ // validateFileURL(appConfig.file)+ // } else if (PDFJSDev.test('MOZCENTRAL')) {+ // file = window.location.href+ // } else if (PDFJSDev.test('CHROME')) {+ // file = AppOptions.get('defaultUrl')+ // }++ // NOTE+ // if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {+ // const fileInput = appConfig.openFileInput+ // fileInput.value = null+ //+ // fileInput.addEventListener('change', function (evt) {+ // const {files} = evt.target+ // if (!files || files.length === 0) {+ // return+ // }+ // eventBus.dispatch('fileinputchange', {+ // source: this,+ // fileInput: evt.target,+ // })+ // })+ //+ // // Enable dragging-and-dropping a new PDF file onto the viewerContainer.+ // appConfig.mainContainer.addEventListener('dragover', function (evt) {+ // evt.preventDefault()+ //+ // evt.dataTransfer.dropEffect =+ // evt.dataTransfer.effectAllowed === 'copy' ? 'copy' : 'move'+ // })+ // appConfig.mainContainer.addEventListener('drop', function (evt) {+ // evt.preventDefault()+ //+ // const {files} = evt.dataTransfer+ // if (!files || files.length === 0) {+ // return+ // }+ // eventBus.dispatch('fileinputchange', {+ // source: this,+ // fileInput: evt.dataTransfer,+ // })+ // })+ // }++ if (!pdf.supportsDocumentFonts) {+ AppOptions.set('disableFontFace', true)+ // NOTE+ console.warn('Web fonts are disabled: unable to use embedded PDF fonts.')}if (!pdf.supportsPrinting) {+ // NOTEappConfig.toolbar.print?.classList.add('fn__hidden')appConfig.secondaryToolbar.printButton?.classList.add('fn__hidden')}if (!pdf.supportsFullscreen) {- appConfig.toolbar.presentationModeButton.classList.add('fn__hidden')- appConfig.secondaryToolbar.presentationModeButton?.classList.add(- 'fn__hidden')+ // NOTE+ appConfig.secondaryToolbar.presentationModeButton?.classList.add('fn__hidden')}if (pdf.supportsIntegratedFind) {+ // NOTEappConfig.toolbar.viewFind.classList.add('fn__hidden')}appConfig.mainContainer.addEventListener('transitionend',function (evt) {- if (evt.target === /* mainContainer */ this) {- pdf.eventBus.dispatch('resize', {source: this})+ if (evt.target === /* mainContainer */ this && eventBus) {+ eventBus.dispatch('resize', {source: this})}},true,)try {- webViewerOpenFileViaURL(pdf)- } catch (reason) {- pdf._documentError(window.siyuan.languages.loadingError,- reason)- }-}--function webViewerOpenFileViaURL (pdf) {- const file = pdf.appConfig.file- if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {- if (file) {- pdf.open(file)- } else {- pdf._hideViewBookmark()- }- } else if (PDFJSDev.test('MOZCENTRAL || CHROME')) {- pdf.setTitleUsingUrl(file, /* downloadUrl = */ file)- pdf.initPassiveLoading()- } else {- if (file) {- throw new Error('Not implemented: webViewerOpenFileViaURL')+ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {+ if (file) {+ pdf.open(file)+ } else {+ pdf._hideViewBookmark()+ }+ } else if (PDFJSDev.test('MOZCENTRAL || CHROME')) {+ pdf.setTitleUsingUrl(file, /* downloadUrl = */ file)+ pdf.initPassiveLoading()} else {- pdf._hideViewBookmark()+ throw new Error('Not implemented: webViewerInitialized')}+ } catch (reason) {+ pdf._documentError(window.siyuan.languages.loadingError, reason)}}+// NOTEfunction webViewerPageRendered ({pageNumber, error, source}) {const pdfInstance = getPdfInstance(source.div)if (!pdfInstance) {@@ -2190,7 +2268,7 @@ function webViewerPageRendered ({pageNumber, error, source}) {}// Use the rendered page to set the corresponding thumbnail image.- if (pdfInstance.pdfSidebar.isThumbnailViewVisible) {+ if (pdfInstance.pdfSidebar.visibleView === SidebarView.THUMBS) {const pageView = pdfInstance.pdfViewer.getPageView(/* index = */ pageNumber - 1,)@@ -2211,6 +2289,7 @@ function webViewerPageRendered ({pageNumber, error, source}) {pdfInstance._reportDocumentStatsTelemetry()}+// NOTEfunction webViewerPageMode ({mode, source}) {const pdfInstance = getPdfInstance(source.externalLinkTarget)if (!pdfInstance) {@@ -2242,6 +2321,7 @@ function webViewerPageMode ({mode, source}) {pdfInstance.pdfSidebar.switchView(view, /* forceOpen = */ true)}+// NOTEfunction webViewerNamedAction (evt) {const pdfInstance = getPdfInstance(evt.source.externalLinkTarget)if (!pdfInstance) {@@ -2265,11 +2345,12 @@ function webViewerNamedAction (evt) {breakcase 'SaveAs':- webViewerSave()+ pdfInstance.downloadOrSave()break}}+// NOTEfunction webViewerPresentationModeChanged (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2278,29 +2359,29 @@ function webViewerPresentationModeChanged (evt) {pdfInstance.pdfViewer.presentationModeState = evt.state}-function webViewerSidebarViewChanged (evt) {- const pdfInstance = getPdfInstance(evt.source.outerContainer)+// NOTE+function webViewerSidebarViewChanged ({view, source}) {+ const pdfInstance = getPdfInstance(source.outerContainer)if (!pdfInstance) {return}pdfInstance.pdfRenderingQueue.isThumbnailViewEnabled =- pdfInstance.pdfSidebar.isThumbnailViewVisible+ view === SidebarView.THUMBSif (pdfInstance.isInitialViewSet) {// Only update the storage when the document has been loaded *and* rendered.- pdfInstance.store?.set('sidebarView', evt.view).catch(() => {+ pdfInstance.store?.set('sidebarView', view).catch(() => {// Unable to write to storage.})}}-function webViewerUpdateViewarea (evt) {- const pdfInstance = getPdfInstance(evt.source.container)+// NOTE+function webViewerUpdateViewarea ({location, source}) {+ const pdfInstance = getPdfInstance(source.container)if (!pdfInstance) {return}- const location = evt.location-if (pdfInstance.isInitialViewSet) {// Only update the storage when the document has been loaded *and* rendered.pdfInstance.store?.setMultiple({@@ -2316,7 +2397,6 @@ function webViewerUpdateViewarea (evt) {const href = pdfInstance.pdfLinkService.getAnchorUrl(location.pdfOpenParams,)- pdfInstance.appConfig.toolbar.viewBookmark.href = hrefpdfInstance.appConfig.secondaryToolbar.viewBookmarkButton.href =href@@ -2328,12 +2408,16 @@ function webViewerUpdateViewarea (evt) {pdfInstance.toolbar.updateLoadingIndicatorState(loading)}+// NOTEfunction webViewerScrollModeChanged (evt) {const pdfInstance = getPdfInstance(evt.source.container)if (!pdfInstance) {return}- if (pdfInstance.isInitialViewSet) {+ if (+ pdfInstance.isInitialViewSet &&+ !pdfInstance.pdfViewer.isInPresentationMode+ ) {// Only update the storage when the document has been loaded *and* rendered.pdfInstance.store?.set('scrollMode', evt.mode).catch(() => {// Unable to write to storage.@@ -2341,12 +2425,13 @@ function webViewerScrollModeChanged (evt) {}}+// NOTEfunction webViewerSpreadModeChanged (evt) {const pdfInstance = getPdfInstance(evt.source.container)if (!pdfInstance) {return}- if (pdfInstance.isInitialViewSet) {+ if (pdfInstance.isInitialViewSet && !pdfInstance.pdfViewer.isInPresentationMode) {// Only update the storage when the document has been loaded *and* rendered.pdfInstance.store?.set('spreadMode', evt.mode).catch(() => {// Unable to write to storage.@@ -2354,11 +2439,37 @@ function webViewerSpreadModeChanged (evt) {}}+// NOTE+function webViewerResize () {+ // const {pdfDocument, pdfViewer, pdfRenderingQueue} = PDFViewerApplication+ //+ // if (pdfRenderingQueue.printing && window.matchMedia('print').matches) {+ // // Work-around issue 15324 by ignoring "resize" events during printing.+ // return+ // }+ // pdfViewer.updateContainerHeightCss()+ //+ // if (!pdfDocument) {+ // return+ // }+ // const currentScaleValue = pdfViewer.currentScaleValue+ // if (+ // currentScaleValue === 'auto' ||+ // currentScaleValue === 'page-fit' ||+ // currentScaleValue === 'page-width'+ // ) {+ // // Note: the scale is constant for 'page-actual'.+ // pdfViewer.currentScaleValue = currentScaleValue+ // }+ // pdfViewer.update()+}+function webViewerHashchange (evt) {const hash = evt.hashif (!hash) {return}+ // NOTEconst pdfInstance = getPdfInstance(evt.source)if (!pdfInstance) {return@@ -2370,9 +2481,10 @@ function webViewerHashchange (evt) {}}-let webViewerFileInputChange, webViewerOpenFileif (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {- webViewerFileInputChange = function (evt) {+ // eslint-disable-next-line no-var+ var webViewerFileInputChange = function (evt) {+ // NOTEif (evt.source.pdfViewer?.isInPresentationMode) {return // Opening a new PDF file isn't supported in Presentation Mode.}@@ -2385,12 +2497,15 @@ if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {// NOTE PDFViewerApplication.open(url)}- webViewerOpenFile = function (evt) {- const openFileInputName = evt.pdfInstance.appConfig.openFileInputName- document.getElementById(openFileInputName).click()+ // eslint-disable-next-line no-var+ var webViewerOpenFile = function (evt) {+ // NOTE+ const fileInput = evt.pdfInstance.appConfig.openFileInput+ fileInput.click()}}+// NOTEfunction webViewerPresentationMode ({source}) {const pdfInstance = getPdfInstance(source.toolbar)if (!pdfInstance) {@@ -2399,32 +2514,45 @@ function webViewerPresentationMode ({source}) {pdfInstance.requestPresentationMode()}-function webViewerPrint ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerSwitchAnnotationEditorMode (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}- pdfInstance.triggerPrinting()+ pdfInstance.pdfViewer.annotationEditorMode = evt.mode}-function webViewerDownload ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerSwitchAnnotationEditorParams (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}- pdfInstance.downloadOrSave({sourceEventType: 'download'})+ pdfInstance.pdfViewer.annotationEditorParams = evt}-function webViewerSave ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerPrint (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}- pdfInstance.downloadOrSave({sourceEventType: 'save'})+ pdfInstance.triggerPrinting()}-function webViewerFirstPage ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerDownload (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)+ if (!pdfInstance) {+ return+ }+ pdfInstance.downloadOrSave()+}++// NOTE+function webViewerFirstPage (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}@@ -2433,8 +2561,9 @@ function webViewerFirstPage ({source}) {}}-function webViewerLastPage ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerLastPage (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}@@ -2443,46 +2572,52 @@ function webViewerLastPage ({source}) {}}-function webViewerNextPage ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerNextPage (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}pdfInstance.pdfViewer.nextPage()}-function webViewerPreviousPage ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerPreviousPage (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}pdfInstance.pdfViewer.previousPage()}-function webViewerZoomIn ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerZoomIn (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}pdfInstance.zoomIn()}-function webViewerZoomOut ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerZoomOut (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}pdfInstance.zoomOut()}-function webViewerZoomReset ({source}) {- const pdfInstance = getPdfInstance(source.toolbar)+// NOTE+function webViewerZoomReset (evt) {+ const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {return}pdfInstance.zoomReset()}+// NOTEfunction webViewerPageNumberChanged (evt) {let pdfInstanceif (evt.pdfInstance) {@@ -2499,6 +2634,7 @@ function webViewerPageNumberChanged (evt) {if (evt.value !== '') {pdfInstance.pdfLinkService.goToPage(evt.value)}+ // NOTEif (evt.id) {hlPDFRect(pdfInstance.pdfViewer.container, evt.id)}@@ -2515,6 +2651,7 @@ function webViewerPageNumberChanged (evt) {}}+// NOTEfunction webViewerScaleChanged (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2523,6 +2660,7 @@ function webViewerScaleChanged (evt) {pdfInstance.pdfViewer.currentScaleValue = evt.value}+// NOTEfunction webViewerRotateCw (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2531,6 +2669,7 @@ function webViewerRotateCw (evt) {pdfInstance.rotatePages(90)}+// NOTEfunction webViewerRotateCcw (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2539,6 +2678,7 @@ function webViewerRotateCcw (evt) {pdfInstance.rotatePages(-90)}+// NOTEfunction webViewerOptionalContentConfig (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2547,6 +2687,7 @@ function webViewerOptionalContentConfig (evt) {pdfInstance.pdfViewer.optionalContentConfigPromise = evt.promise}+// NOTEfunction webViewerSwitchScrollMode (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2555,6 +2696,7 @@ function webViewerSwitchScrollMode (evt) {pdfInstance.pdfViewer.scrollMode = evt.mode}+// NOTEfunction webViewerSwitchSpreadMode (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2563,6 +2705,7 @@ function webViewerSwitchSpreadMode (evt) {pdfInstance.pdfViewer.spreadMode = evt.mode}+// NOTEfunction webViewerDocumentProperties (evt) {const pdfInstance = getPdfInstance(evt.source.toolbar)if (!pdfInstance) {@@ -2571,6 +2714,7 @@ function webViewerDocumentProperties (evt) {pdfInstance.pdfDocumentProperties.open()}+// NOTEfunction webViewerFindFromUrlHash (evt) {const pdfInstance = getPdfInstance(evt.source.bar)if (!pdfInstance) {@@ -2589,6 +2733,7 @@ function webViewerFindFromUrlHash (evt) {})}+// NOTEfunction webViewerUpdateFindMatchesCount ({matchesCount, source}) {const pdfInstance = getPdfInstance(source._linkService.pdfViewer.container)if (!pdfInstance) {@@ -2601,6 +2746,7 @@ function webViewerUpdateFindMatchesCount ({matchesCount, source}) {}}+// NOTEfunction webViewerUpdateFindControlState ({state,previous,@@ -2608,9 +2754,6 @@ function webViewerUpdateFindControlState ({rawQuery,source,}) {- if (!source.state) {- return- }const pdfInstance = getPdfInstance(source.state.source.bar)if (!pdfInstance) {return@@ -2627,6 +2770,7 @@ function webViewerUpdateFindControlState ({}}+// NOTEfunction webViewerScaleChanging (evt) {const pdfInstance = getPdfInstance(evt.source.container)if (!pdfInstance) {@@ -2637,6 +2781,7 @@ function webViewerScaleChanging (evt) {pdfInstance.pdfViewer.update()}+// NOTEfunction webViewerRotationChanging (evt) {const pdfInstance = getPdfInstance(evt.source.container)if (!pdfInstance) {@@ -2649,6 +2794,7 @@ function webViewerRotationChanging (evt) {pdfInstance.pdfViewer.currentPageNumber = evt.pageNumber}+// NOTEfunction webViewerPageChanging ({pageNumber, pageLabel, source}) {const pdfInstance = getPdfInstance(source.container)if (!pdfInstance) {@@ -2657,11 +2803,20 @@ function webViewerPageChanging ({pageNumber, pageLabel, source}) {pdfInstance.toolbar.setPageNumber(pageNumber, pageLabel)pdfInstance.secondaryToolbar.setPageNumber(pageNumber)- if (pdfInstance.pdfSidebar.isThumbnailViewVisible) {+ if (pdfInstance.pdfSidebar.visibleView === SidebarView.THUMBS) {pdfInstance.pdfThumbnailViewer.scrollThumbnailIntoView(pageNumber)}}+// NOTE+function webViewerResolutionChange (evt) {+ const pdfInstance = getPdfInstance(evt.source.container)+ if (!pdfInstance) {+ return+ }+ pdfInstance.pdfViewer.refresh()+}+function webViewerVisibilityChange (evt) {if (document.visibilityState === 'visible') {// Ignore mouse wheel zooming during tab switches (bug 1503412).@@ -2680,6 +2835,7 @@ function setZoomDisabledTimeout () {}, WHEEL_ZOOM_DISABLED_TIMEOUT)}+// NOTEfunction webViewerWheel (evt) {const pdfInstance = getPdfInstance(evt.target)if (!pdfInstance) {@@ -2771,6 +2927,7 @@ function webViewerTouchStart (evt) {}}+// NOTEfunction webViewerClick (evt) {const pdfInstance = getPdfInstance(evt.target)if (!pdfInstance) {@@ -2783,17 +2940,21 @@ function webViewerClick (evt) {if (pdfInstance.pdfViewer.containsElement(evt.target) ||(appConfig.toolbar.container.contains(evt.target) &&- !appConfig.secondaryToolbar.toggleButton.contains(evt.target))+ evt.target !== appConfig.secondaryToolbar.toggleButton)) {pdfInstance.secondaryToolbar.close()}}+// NOTEfunction webViewerKeyDown (evt) {const pdfInstance = getPdfInstance(evt.target)if (!pdfInstance || pdfInstance.overlayManager.active) {return}+ if (pdfInstance.overlayManager.active) {+ return+ }const {eventBus, pdfViewer} = pdfInstanceconst isViewerInPresentationMode = pdfViewer.isInPresentationMode@@ -2890,7 +3051,7 @@ function webViewerKeyDown (evt) {case 79: // oif (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {- eventBus.dispatch('openfile', {source: window, pdfInstance: this})+ eventBus.dispatch('openfile', {source: window})handled = true}break@@ -2904,6 +3065,10 @@ function webViewerKeyDown (evt) {case 80: // ppdfInstance.requestPresentationMode()handled = true+ pdfInstance.externalServices.reportTelemetry({+ type: 'buttons',+ data: {id: 'presentationModeKeyboard'},+ })breakcase 71: // g// focuses input#pageNumber field@@ -3104,6 +3269,16 @@ function beforeUnload (evt) {return false}+// NOTE+function webViewerAnnotationEditorStatesChanged (data) {+ const pdfInstance = getPdfInstance(data.target)+ if (!pdfInstance || pdfInstance.overlayManager.active) {+ return+ }+ pdfInstance+ PDFViewerApplication.externalServices.updateEditorStates(data)+}+/* Abstract factory for the print service. */const PDFPrintServiceFactory = {instance: {@@ -3117,5 +3292,6 @@ const PDFPrintServiceFactory = {export {PDFPrintServiceFactory,PDFViewerApplication,+ // NOTEwebViewerPageNumberChanged,}diff --git a/app/src/asset/pdf/app_options.js b/app/src/asset/pdf/app_options.jsindex 3c650718b6..78b548a8bc 100644--- a/app/src/asset/pdf/app_options.js+++ b/app/src/asset/pdf/app_options.js@@ -17,28 +17,21 @@ import { Constants } from '../../constants'const compatibilityParams = Object.create(null)if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {- const userAgent =- (typeof navigator !== 'undefined' && navigator.userAgent) || ''- const platform =- (typeof navigator !== 'undefined' && navigator.platform) || ''- const maxTouchPoints =- (typeof navigator !== 'undefined' && navigator.maxTouchPoints) || 1+ if (+ typeof PDFJSDev !== 'undefined' &&+ PDFJSDev.test('LIB') &&+ typeof navigator === 'undefined'+ ) {+ globalThis.navigator = Object.create(null)+ }+ const userAgent = navigator.userAgent || ''+ const platform = navigator.platform || ''+ const maxTouchPoints = navigator.maxTouchPoints || 1const isAndroid = /Android/.test(userAgent)const isIOS =/\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||- (platform === 'MacIntel' && maxTouchPoints > 1)- const isIOSChrome = /CriOS/.test(userAgent);-- // Disables URL.createObjectURL() usage in some environments.- // Support: Chrome on iOS- (function checkOnBlobSupport () {- // Sometimes Chrome on iOS loses data created with createObjectURL(),- // see issue 8081.- if (isIOSChrome) {- compatibilityParams.disableCreateObjectURL = true- }- })();+ (platform === 'MacIntel' && maxTouchPoints > 1);// Limit canvas size to 5 mega-pixels on mobile.// Support: Android, iOS@@ -62,9 +55,14 @@ const OptionKind = {* primitive types and cannot rely on any imported types.*/const defaultOptions = {+ annotationEditorMode: {+ /** @type {number} */+ value: 0,+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE,+ },annotationMode: {/** @type {number} */- value: 2, // https://github.com/siyuan-note/siyuan/issues/2975 DISABLE: 0, ENABLE: 1, ENABLE_FORMS: 2 (default), ENABLE_STORAGE: 3+ value: 2,kind: OptionKind.VIEWER + OptionKind.PREFERENCE,},cursorToolOnLoad: {@@ -72,11 +70,6 @@ const defaultOptions = {value: 0,kind: OptionKind.VIEWER + OptionKind.PREFERENCE,},- defaultUrl: {- /** @type {string} */- value: 'compressed.tracemonkey-pldi-09.pdf',- kind: OptionKind.VIEWER,- },defaultZoomValue: {/** @type {string} */value: '',@@ -135,9 +128,23 @@ const defaultOptions = {maxCanvasPixels: {/** @type {number} */value: 16777216,- compatibility: compatibilityParams.maxCanvasPixels,kind: OptionKind.VIEWER,},+ forcePageColors: {+ /** @type {boolean} */+ value: false,+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE,+ },+ pageColorsBackground: {+ /** @type {string} */+ value: 'Canvas',+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE,+ },+ pageColorsForeground: {+ /** @type {string} */+ value: 'CanvasText',+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE,+ },pdfBugEnabled: {/** @type {boolean} */value: typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION'),@@ -148,11 +155,6 @@ const defaultOptions = {value: 150,kind: OptionKind.VIEWER,},- renderer: {- /** @type {string} */- value: 'canvas',- kind: OptionKind.VIEWER,- },sidebarViewOnLoad: {/** @type {number} */value: -1,@@ -196,7 +198,10 @@ const defaultOptions = {},cMapUrl: {/** @type {string} */- value: 'cmaps/',+ value:+ typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')+ ? '../external/bcmaps/'+ : 'cmaps/', // NOTEkind: OptionKind.API,},disableAutoFetch: {@@ -270,7 +275,8 @@ const defaultOptions = {},workerSrc: {/** @type {string} */- value: `${Constants.PROTYLE_CDN}/js/pdf/pdf.worker.js?v=2.14.102`,+ // NOTE+ value: `${Constants.PROTYLE_CDN}/js/pdf/pdf.worker.js?v=3.0.150`,kind: OptionKind.WORKER,},}@@ -278,6 +284,11 @@ if (typeof PDFJSDev === 'undefined' ||PDFJSDev.test('!PRODUCTION || GENERIC')) {+ defaultOptions.defaultUrl = {+ /** @type {string} */+ value: 'compressed.tracemonkey-pldi-09.pdf',+ kind: OptionKind.VIEWER,+ }defaultOptions.disablePreferences = {/** @type {boolean} */value: typeof PDFJSDev !== 'undefined' && PDFJSDev.test('TESTING'),@@ -285,9 +296,14 @@ if (}defaultOptions.locale = {/** @type {string} */- value: typeof navigator !== 'undefined' ? navigator.language : 'en-US',+ value: navigator.language || 'en-US',kind: OptionKind.VIEWER,}+ defaultOptions.renderer = {+ /** @type {string} */+ value: 'canvas',+ kind: OptionKind.VIEWER + OptionKind.PREFERENCE,+ }defaultOptions.sandboxBundleSrc = {/** @type {string} */value:@@ -296,9 +312,12 @@ if (: '../build/pdf.sandbox.js',kind: OptionKind.VIEWER,}-- defaultOptions.renderer.kind += OptionKind.PREFERENCE} else if (PDFJSDev.test('CHROME')) {+ defaultOptions.defaultUrl = {+ /** @type {string} */+ value: '',+ kind: OptionKind.VIEWER,+ }defaultOptions.disableTelemetry = {/** @type {boolean} */value: false,@@ -325,7 +344,7 @@ class AppOptions {}const defaultOption = defaultOptions[name]if (defaultOption !== undefined) {- return defaultOption.compatibility ?? defaultOption.value+ return compatibilityParams[name] ?? defaultOption.value}return undefined}@@ -357,7 +376,7 @@ class AppOptions {options[name] =userOption !== undefined? userOption- : defaultOption.compatibility ?? defaultOption.value+ : compatibilityParams[name] ?? defaultOption.value}return options}diff --git a/app/src/asset/pdf/base_tree_viewer.js b/app/src/asset/pdf/base_tree_viewer.jsindex b3eaee40dd..cfd04220d8 100644--- a/app/src/asset/pdf/base_tree_viewer.js+++ b/app/src/asset/pdf/base_tree_viewer.js@@ -13,7 +13,7 @@* limitations under the License.*/-import { removeNullCharacters } from "./ui_utils";+import { removeNullCharacters } from "./ui_utils.js";const TREEITEM_OFFSET_TOP = -100; // pxconst TREEITEM_SELECTED_CLASS = "selected";@@ -74,6 +74,7 @@ class BaseTreeViewer {*/_addToggleButton(div, hidden = false) {const toggler = document.createElement("div");+ // NOTEtoggler.innerHTML = `<svg><use xlink:href="#iconDown"></use></svg>`toggler.className = "treeItemToggler";if (hidden) {@@ -88,7 +89,7 @@ class BaseTreeViewer {this._toggleTreeItem(div, shouldShowAll);}};- div.insertBefore(toggler, div.firstChild);+ div.prepend(toggler);}/**@@ -123,7 +124,7 @@ class BaseTreeViewer {this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden");}- this.container.appendChild(fragment);+ this.container.append(fragment);this._dispatchEvent(count);}@@ -168,7 +169,7 @@ class BaseTreeViewer {this.container.scrollTo(treeItem.offsetLeft,- treeItem.offsetTop + TREEITEM_OFFSET_TOP + treeItem.offsetParent.offsetTop+ treeItem.offsetTop + TREEITEM_OFFSET_TOP);}}diff --git a/app/src/asset/pdf/base_viewer.js b/app/src/asset/pdf/base_viewer.jsdeleted file mode 100644index 0f838a1e16..0000000000--- a/app/src/asset/pdf/base_viewer.js+++ /dev/null@@ -1,2087 +0,0 @@-/* Copyright 2014 Mozilla Foundation- *- * Licensed under the Apache License, Version 2.0 (the "License");- * you may not use this file except in compliance with the License.- * You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */--import {- AnnotationMode,- createPromiseCapability,- PermissionFlag,- PixelsPerInch,- version,-} from "./pdfjs";-import {- DEFAULT_SCALE,- DEFAULT_SCALE_DELTA,- DEFAULT_SCALE_VALUE,- getVisibleElements,- isPortraitOrientation,- isValidRotation,- isValidScrollMode,- isValidSpreadMode,- MAX_AUTO_SCALE,- MAX_SCALE,- MIN_SCALE,- PresentationModeState,- RendererType,- RenderingStates,- SCROLLBAR_PADDING,- scrollIntoView,- ScrollMode,- SpreadMode,- TextLayerMode,- UNKNOWN_SCALE,- VERTICAL_PADDING,- watchScroll,-} from "./ui_utils.js";-import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";-import { NullL10n } from "./l10n_utils.js";-import { PDFPageView } from "./pdf_page_view.js";-import { PDFRenderingQueue } from "./pdf_rendering_queue.js";-import { SimpleLinkService } from "./pdf_link_service.js";-import { StructTreeLayerBuilder } from "./struct_tree_layer_builder.js";-import { TextHighlighter } from "./text_highlighter.js";-import { TextLayerBuilder } from "./text_layer_builder.js";-import { XfaLayerBuilder } from "./xfa_layer_builder.js";--const DEFAULT_CACHE_SIZE = 10;-const ENABLE_PERMISSIONS_CLASS = "enablePermissions";--const PagesCountLimit = {- FORCE_SCROLL_MODE_PAGE: 15000,- FORCE_LAZY_PAGE_INIT: 7500,- PAUSE_EAGER_PAGE_INIT: 250,-};--/**- * @typedef {Object} PDFViewerOptions- * @property {HTMLDivElement} container - The container for the viewer element.- * @property {HTMLDivElement} [viewer] - The viewer element.- * @property {EventBus} eventBus - The application event bus.- * @property {IPDFLinkService} linkService - The navigation/linking service.- * @property {IDownloadManager} [downloadManager] - The download manager- * component.- * @property {PDFFindController} [findController] - The find controller- * component.- * @property {PDFScriptingManager} [scriptingManager] - The scripting manager- * component.- * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.- * @property {boolean} [removePageBorders] - Removes the border shadow around- * the pages. The default value is `false`.- * @property {number} [textLayerMode] - Controls if the text layer used for- * selection and searching is created, and if the improved text selection- * behaviour is enabled. The constants from {TextLayerMode} should be used.- * The default value is `TextLayerMode.ENABLE`.- * @property {number} [annotationMode] - Controls if the annotation layer is- * created, and if interactive form elements or `AnnotationStorage`-data are- * being rendered. The constants from {@link AnnotationMode} should be used;- * see also {@link RenderParameters} and {@link GetOperatorListParameters}.- * The default value is `AnnotationMode.ENABLE_FORMS`.- * @property {string} [imageResourcesPath] - Path for image resources, mainly- * mainly for annotation icons. Include trailing slash.- * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of- * landscape pages upon printing. The default is `false`.- * @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.- * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default- * value is `false`.- * @property {number} [maxCanvasPixels] - The maximum supported canvas size in- * total pixels, i.e. width * height. Use -1 for no limit. The default value- * is 4096 * 4096 (16 mega-pixels).- * @property {IL10n} l10n - Localization service.- * @property {boolean} [enablePermissions] - Enables PDF document permissions,- * when they exist. The default value is `false`.- */--class PDFPageViewBuffer {- // Here we rely on the fact that `Set`s preserve the insertion order.- #buf = new Set();-- #size = 0;-- constructor(size) {- this.#size = size;- }-- push(view) {- const buf = this.#buf;- if (buf.has(view)) {- buf.delete(view); // Move the view to the "end" of the buffer.- }- buf.add(view);-- if (buf.size > this.#size) {- this.#destroyFirstView();- }- }-- /**- * After calling resize, the size of the buffer will be `newSize`.- * The optional parameter `idsToKeep` is, if present, a Set of page-ids to- * push to the back of the buffer, delaying their destruction. The size of- * `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`- * is larger than `newSize`, some of those pages will be destroyed anyway.- */- resize(newSize, idsToKeep = null) {- this.#size = newSize;-- const buf = this.#buf;- if (idsToKeep) {- const ii = buf.size;- let i = 1;- for (const view of buf) {- if (idsToKeep.has(view.id)) {- buf.delete(view); // Move the view to the "end" of the buffer.- buf.add(view);- }- if (++i > ii) {- break;- }- }- }-- while (buf.size > this.#size) {- this.#destroyFirstView();- }- }-- has(view) {- return this.#buf.has(view);- }-- [Symbol.iterator]() {- return this.#buf.keys();- }-- #destroyFirstView() {- const firstView = this.#buf.keys().next().value;-- firstView?.destroy();- this.#buf.delete(firstView);- }-}--/**- * Simple viewer control to display PDF content/pages.- *- * @implements {IPDFAnnotationLayerFactory}- * @implements {IPDFStructTreeLayerFactory}- * @implements {IPDFTextLayerFactory}- * @implements {IPDFXfaLayerFactory}- */-class BaseViewer {- #buffer = null;-- #annotationMode = AnnotationMode.ENABLE_FORMS;-- #previousAnnotationMode = null;-- #enablePermissions = false;-- #previousContainerHeight = 0;-- #scrollModePageState = null;-- #onVisibilityChange = null;-- /**- * @param {PDFViewerOptions} options- */- constructor(options) {- if (this.constructor === BaseViewer) {- throw new Error("Cannot initialize BaseViewer.");- }- this.container = options.container;- this.viewer = options.viewer || options.container.firstElementChild;-- if (- typeof PDFJSDev === "undefined" ||- PDFJSDev.test("!PRODUCTION || GENERIC")- ) {- if (- !(- this.container?.tagName.toUpperCase() === "DIV" &&- this.viewer?.tagName.toUpperCase() === "DIV"- )- ) {- throw new Error("Invalid `container` and/or `viewer` option.");- }-- if (- this.container.offsetParent &&- getComputedStyle(this.container).position !== "absolute"- ) {- throw new Error("The `container` must be absolutely positioned.");- }- }- this.eventBus = options.eventBus;- this.linkService = options.linkService || new SimpleLinkService();- this.downloadManager = options.downloadManager || null;- this.findController = options.findController || null;- this._scriptingManager = options.scriptingManager || null;- this.removePageBorders = options.removePageBorders || false;- this.textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;- this.#annotationMode =- options.annotationMode ?? AnnotationMode.ENABLE_FORMS;- this.imageResourcesPath = options.imageResourcesPath || "";- this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;- this.renderer = options.renderer || RendererType.CANVAS;- this.useOnlyCssZoom = options.useOnlyCssZoom || false;- this.maxCanvasPixels = options.maxCanvasPixels;- this.l10n = options.l10n || NullL10n;- this.#enablePermissions = options.enablePermissions || false;-- this.defaultRenderingQueue = !options.renderingQueue;- if (this.defaultRenderingQueue) {- // Custom rendering queue is not specified, using default one- this.renderingQueue = new PDFRenderingQueue();- this.renderingQueue.setViewer(this);- } else {- this.renderingQueue = options.renderingQueue;- }- this._doc = document.documentElement;-- this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));- this.presentationModeState = PresentationModeState.UNKNOWN;- this._onBeforeDraw = this._onAfterDraw = null;- this._resetView();-- if (this.removePageBorders) {- this.viewer.classList.add("removePageBorders");- }- // Defer the dispatching of this event, to give other viewer components- // time to initialize *and* register 'baseviewerinit' event listeners.- Promise.resolve().then(() => {- this.eventBus.dispatch("baseviewerinit", { source: this });- });- }-- get pagesCount() {- return this._pages.length;- }-- getPageView(index) {- return this._pages[index];- }-- /**- * @type {boolean} - True if all {PDFPageView} objects are initialized.- */- get pageViewsReady() {- if (!this._pagesCapability.settled) {- return false;- }- // Prevent printing errors when 'disableAutoFetch' is set, by ensuring- // that *all* pages have in fact been completely loaded.- return this._pages.every(function (pageView) {- return pageView?.pdfPage;- });- }-- /**- * @type {boolean}- */- get renderForms() {- return this.#annotationMode === AnnotationMode.ENABLE_FORMS;- }-- /**- * @type {boolean}- */- get enableScripting() {- return !!this._scriptingManager;- }-- /**- * @type {number}- */- get currentPageNumber() {- return this._currentPageNumber;- }-- /**- * @param {number} val - The page number.- */- set currentPageNumber(val) {- if (!Number.isInteger(val)) {- throw new Error("Invalid page number.");- }- if (!this.pdfDocument) {- return;- }- // The intent can be to just reset a scroll position and/or scale.- if (!this._setCurrentPageNumber(val, /* resetCurrentPageView = */ true)) {- console.error(`currentPageNumber: "${val}" is not a valid page.`);- }- }-- /**- * @returns {boolean} Whether the pageNumber is valid (within bounds).- * @private- */- _setCurrentPageNumber(val, resetCurrentPageView = false) {- if (this._currentPageNumber === val) {- if (resetCurrentPageView) {- this._resetCurrentPageView();- }- return true;- }-- if (!(0 < val && val <= this.pagesCount)) {- return false;- }- const previous = this._currentPageNumber;- this._currentPageNumber = val;-- this.eventBus.dispatch("pagechanging", {- source: this,- pageNumber: val,- pageLabel: this._pageLabels?.[val - 1] ?? null,- previous,- });-- if (resetCurrentPageView) {- this._resetCurrentPageView();- }- return true;- }-- /**- * @type {string|null} Returns the current page label, or `null` if no page- * labels exist.- */- get currentPageLabel() {- return this._pageLabels?.[this._currentPageNumber - 1] ?? null;- }-- /**- * @param {string} val - The page label.- */- set currentPageLabel(val) {- if (!this.pdfDocument) {- return;- }- let page = val | 0; // Fallback page number.- if (this._pageLabels) {- const i = this._pageLabels.indexOf(val);- if (i >= 0) {- page = i + 1;- }- }- // The intent can be to just reset a scroll position and/or scale.- if (!this._setCurrentPageNumber(page, /* resetCurrentPageView = */ true)) {- console.error(`currentPageLabel: "${val}" is not a valid page.`);- }- }-- /**- * @type {number}- */- get currentScale() {- return this._currentScale !== UNKNOWN_SCALE- ? this._currentScale- : DEFAULT_SCALE;- }-- /**- * @param {number} val - Scale of the pages in percents.- */- set currentScale(val) {- if (isNaN(val)) {- throw new Error("Invalid numeric scale.");- }- if (!this.pdfDocument) {- return;- }- this._setScale(val, false);- }-- /**- * @type {string}- */- get currentScaleValue() {- return this._currentScaleValue;- }-- /**- * @param val - The scale of the pages (in percent or predefined value).- */- set currentScaleValue(val) {- if (!this.pdfDocument) {- return;- }- this._setScale(val, false);- }-- /**- * @type {number}- */- get pagesRotation() {- return this._pagesRotation;- }-- /**- * @param {number} rotation - The rotation of the pages (0, 90, 180, 270).- */- set pagesRotation(rotation) {- if (!isValidRotation(rotation)) {- throw new Error("Invalid pages rotation angle.");- }- if (!this.pdfDocument) {- return;- }- // Normalize the rotation, by clamping it to the [0, 360) range.- rotation %= 360;- if (rotation < 0) {- rotation += 360;- }- if (this._pagesRotation === rotation) {- return; // The rotation didn't change.- }- this._pagesRotation = rotation;-- const pageNumber = this._currentPageNumber;-- const updateArgs = { rotation };- for (const pageView of this._pages) {- pageView.update(updateArgs);- }- // Prevent errors in case the rotation changes *before* the scale has been- // set to a non-default value.- if (this._currentScaleValue) {- this._setScale(this._currentScaleValue, true);- }-- this.eventBus.dispatch("rotationchanging", {- source: this,- pagesRotation: rotation,- pageNumber,- });-- if (this.defaultRenderingQueue) {- this.update();- }- }-- get firstPagePromise() {- return this.pdfDocument ? this._firstPageCapability.promise : null;- }-- get onePageRendered() {- return this.pdfDocument ? this._onePageRenderedCapability.promise : null;- }-- get pagesPromise() {- return this.pdfDocument ? this._pagesCapability.promise : null;- }-- /**- * Currently only *some* permissions are supported.- */- #initializePermissions(permissions) {- if (!permissions) {- return;- }-- if (!permissions.includes(PermissionFlag.COPY)) {- this.viewer.classList.add(ENABLE_PERMISSIONS_CLASS);- }-- if (- !permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) &&- !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS)- ) {- if (this.#annotationMode === AnnotationMode.ENABLE_FORMS) {- this.#previousAnnotationMode = this.#annotationMode; // Allow resetting.- this.#annotationMode = AnnotationMode.ENABLE;- }- }- }-- #onePageRenderedOrForceFetch() {- // Unless the viewer *and* its pages are visible, rendering won't start and- // `this._onePageRenderedCapability` thus won't be resolved.- // To ensure that automatic printing, on document load, still works even in- // those cases we force-allow fetching of all pages when:- // - The current window/tab is inactive, which will prevent rendering since- // `requestAnimationFrame` is being used; fixes bug 1746213.- // - The viewer is hidden in the DOM, e.g. in a `display: none` <iframe>- // element; fixes bug 1618621.- // - The viewer is visible, but none of the pages are (e.g. if the- // viewer is very small); fixes bug 1618955.- if (- document.visibilityState === "hidden" ||- !this.container.offsetParent ||- this._getVisiblePages().views.length === 0- ) {- return Promise.resolve();- }-- // Handle the window/tab becoming inactive *after* rendering has started;- // fixes (another part of) bug 1746213.- const visibilityChangePromise = new Promise(resolve => {- this.#onVisibilityChange = () => {- if (document.visibilityState !== "hidden") {- return;- }- resolve();-- document.removeEventListener(- "visibilitychange",- this.#onVisibilityChange- );- this.#onVisibilityChange = null;- };- document.addEventListener("visibilitychange", this.#onVisibilityChange);- });-- return Promise.race([- this._onePageRenderedCapability.promise,- visibilityChangePromise,- ]);- }-- /**- * @param {PDFDocumentProxy} pdfDocument- */- setDocument(pdfDocument) {- if (this.pdfDocument) {- this.eventBus.dispatch("pagesdestroy", { source: this });-- this._cancelRendering();- this._resetView();-- if (this.findController) {- this.findController.setDocument(null);- }- if (this._scriptingManager) {- this._scriptingManager.setDocument(null);- }- }-- this.pdfDocument = pdfDocument;- if (!pdfDocument) {- return;- }- const isPureXfa = pdfDocument.isPureXfa;- const pagesCount = pdfDocument.numPages;- const firstPagePromise = pdfDocument.getPage(1);- // Rendering (potentially) depends on this, hence fetching it immediately.- const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();- const permissionsPromise = this.#enablePermissions- ? pdfDocument.getPermissions()- : Promise.resolve();-- // Given that browsers don't handle huge amounts of DOM-elements very well,- // enforce usage of PAGE-scrolling when loading *very* long/large documents.- if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {- console.warn(- "Forcing PAGE-scrolling for performance reasons, given the length of the document."- );- const mode = (this._scrollMode = ScrollMode.PAGE);- this.eventBus.dispatch("scrollmodechanged", { source: this, mode });- }-- this._pagesCapability.promise.then(- () => {- this.eventBus.dispatch("pagesloaded", { source: this, pagesCount });- },- () => {- /* Prevent "Uncaught (in promise)"-messages in the console. */- }- );-- this._onBeforeDraw = evt => {- const pageView = this._pages[evt.pageNumber - 1];- if (!pageView) {- return;- }- // Add the page to the buffer at the start of drawing. That way it can be- // evicted from the buffer and destroyed even if we pause its rendering.- this.#buffer.push(pageView);- };- this.eventBus._on("pagerender", this._onBeforeDraw);-- this._onAfterDraw = evt => {- if (evt.cssTransform || this._onePageRenderedCapability.settled) {- return;- }- this._onePageRenderedCapability.resolve({ timestamp: evt.timestamp });-- this.eventBus._off("pagerendered", this._onAfterDraw);- this._onAfterDraw = null;-- if (this.#onVisibilityChange) {- document.removeEventListener(- "visibilitychange",- this.#onVisibilityChange- );- this.#onVisibilityChange = null;- }- };- this.eventBus._on("pagerendered", this._onAfterDraw);-- // Fetch a single page so we can get a viewport that will be the default- // viewport for all pages- Promise.all([firstPagePromise, permissionsPromise])- .then(([firstPdfPage, permissions]) => {- if (pdfDocument !== this.pdfDocument) {- return; // The document was closed while the first page resolved.- }- this._firstPageCapability.resolve(firstPdfPage);- this._optionalContentConfigPromise = optionalContentConfigPromise;- this.#initializePermissions(permissions);-- const viewerElement =- this._scrollMode === ScrollMode.PAGE ? null : this.viewer;- const scale = this.currentScale;- const viewport = firstPdfPage.getViewport({- scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS,- });- const textLayerFactory =- this.textLayerMode !== TextLayerMode.DISABLE && !isPureXfa- ? this- : null;- const annotationLayerFactory =- this.#annotationMode !== AnnotationMode.DISABLE ? this : null;- const xfaLayerFactory = isPureXfa ? this : null;-- for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {- const pageView = new PDFPageView({- container: viewerElement,- eventBus: this.eventBus,- id: pageNum,- scale,- defaultViewport: viewport.clone(),- optionalContentConfigPromise,- renderingQueue: this.renderingQueue,- textLayerFactory,- textLayerMode: this.textLayerMode,- annotationLayerFactory,- annotationMode: this.#annotationMode,- xfaLayerFactory,- textHighlighterFactory: this,- structTreeLayerFactory: this,- imageResourcesPath: this.imageResourcesPath,- renderer: this.renderer,- useOnlyCssZoom: this.useOnlyCssZoom,- maxCanvasPixels: this.maxCanvasPixels,- l10n: this.l10n,- });- this._pages.push(pageView);- }- // Set the first `pdfPage` immediately, since it's already loaded,- // rather than having to repeat the `PDFDocumentProxy.getPage` call in- // the `this.#ensurePdfPageLoaded` method before rendering can start.- const firstPageView = this._pages[0];- if (firstPageView) {- firstPageView.setPdfPage(firstPdfPage);- this.linkService.cachePageRef(1, firstPdfPage.ref);- }-- if (this._scrollMode === ScrollMode.PAGE) {- // Ensure that the current page becomes visible on document load.- this.#ensurePageViewVisible();- } else if (this._spreadMode !== SpreadMode.NONE) {- this._updateSpreadMode();- }-- // Fetch all the pages since the viewport is needed before printing- // starts to create the correct size canvas. Wait until one page is- // rendered so we don't tie up too many resources early on.- this.#onePageRenderedOrForceFetch().then(async () => {- if (this.findController) {- this.findController.setDocument(pdfDocument); // Enable searching.- }- if (this._scriptingManager) {- this._scriptingManager.setDocument(pdfDocument); // Enable scripting.- }-- // In addition to 'disableAutoFetch' being set, also attempt to reduce- // resource usage when loading *very* long/large documents.- if (- pdfDocument.loadingParams.disableAutoFetch ||- pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT- ) {- // XXX: Printing is semi-broken with auto fetch disabled.- this._pagesCapability.resolve();- return;- }- let getPagesLeft = pagesCount - 1; // The first page was already loaded.-- if (getPagesLeft <= 0) {- this._pagesCapability.resolve();- return;- }- for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {- const promise = pdfDocument.getPage(pageNum).then(- pdfPage => {- const pageView = this._pages[pageNum - 1];- if (!pageView.pdfPage) {- pageView.setPdfPage(pdfPage);- }- this.linkService.cachePageRef(pageNum, pdfPage.ref);- if (--getPagesLeft === 0) {- this._pagesCapability.resolve();- }- },- reason => {- console.error(- `Unable to get page ${pageNum} to initialize viewer`,- reason- );- if (--getPagesLeft === 0) {- this._pagesCapability.resolve();- }- }- );-- if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {- await promise;- }- }- });-- this.eventBus.dispatch("pagesinit", { source: this });-- pdfDocument.getMetadata().then(({ info }) => {- if (pdfDocument !== this.pdfDocument) {- return; // The document was closed while the metadata resolved.- }- if (info.Language) {- this.viewer.lang = info.Language;- }- });-- if (this.defaultRenderingQueue) {- this.update();- }- })- .catch(reason => {- console.error("Unable to initialize viewer", reason);-- this._pagesCapability.reject(reason);- });- }-- /**- * @param {Array|null} labels- */- setPageLabels(labels) {- if (!this.pdfDocument) {- return;- }- if (!labels) {- this._pageLabels = null;- } else if (- !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)- ) {- this._pageLabels = null;- console.error(`setPageLabels: Invalid page labels.`);- } else {- this._pageLabels = labels;- }- // Update all the `PDFPageView` instances.- for (let i = 0, ii = this._pages.length; i < ii; i++) {- this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);- }- }-- _resetView() {- this._pages = [];- this._currentPageNumber = 1;- this._currentScale = UNKNOWN_SCALE;- this._currentScaleValue = null;- this._pageLabels = null;- this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);- this._location = null;- this._pagesRotation = 0;- this._optionalContentConfigPromise = null;- this._firstPageCapability = createPromiseCapability();- this._onePageRenderedCapability = createPromiseCapability();- this._pagesCapability = createPromiseCapability();- this._scrollMode = ScrollMode.VERTICAL;- this._previousScrollMode = ScrollMode.UNKNOWN;- this._spreadMode = SpreadMode.NONE;-- this.#scrollModePageState = {- previousPageNumber: 1,- scrollDown: true,- pages: [],- };-- if (this._onBeforeDraw) {- this.eventBus._off("pagerender", this._onBeforeDraw);- this._onBeforeDraw = null;- }- if (this._onAfterDraw) {- this.eventBus._off("pagerendered", this._onAfterDraw);- this._onAfterDraw = null;- }- if (this.#onVisibilityChange) {- document.removeEventListener(- "visibilitychange",- this.#onVisibilityChange- );- this.#onVisibilityChange = null;- }- // Remove the pages from the DOM...- this.viewer.textContent = "";- // ... and reset the Scroll mode CSS class(es) afterwards.- this._updateScrollMode();-- this.viewer.removeAttribute("lang");- // Reset all PDF document permissions.- this.viewer.classList.remove(ENABLE_PERMISSIONS_CLASS);-- if (this.#previousAnnotationMode !== null) {- this.#annotationMode = this.#previousAnnotationMode;- this.#previousAnnotationMode = null;- }- }-- #ensurePageViewVisible() {- if (this._scrollMode !== ScrollMode.PAGE) {- throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");- }- const pageNumber = this._currentPageNumber,- state = this.#scrollModePageState,- viewer = this.viewer;-- // Temporarily remove all the pages from the DOM...- viewer.textContent = "";- // ... and clear out the active ones.- state.pages.length = 0;-- if (this._spreadMode === SpreadMode.NONE) {- // Finally, append the new page to the viewer.- const pageView = this._pages[pageNumber - 1];-- if (this.isInPresentationMode) {- const spread = document.createElement("div");- spread.className = "spread";- const dummyPage = document.createElement("div");- dummyPage.className = "dummyPage";- dummyPage.style.height = `${this.container.clientHeight}px`;-- spread.appendChild(dummyPage);- spread.appendChild(pageView.div);- viewer.appendChild(spread);- } else {- viewer.appendChild(pageView.div);- }-- state.pages.push(pageView);- } else {- const pageIndexSet = new Set(),- parity = this._spreadMode - 1;-- // Determine the pageIndices in the new spread.- if (pageNumber % 2 !== parity) {- // Left-hand side page.- pageIndexSet.add(pageNumber - 1);- pageIndexSet.add(pageNumber);- } else {- // Right-hand side page.- pageIndexSet.add(pageNumber - 2);- pageIndexSet.add(pageNumber - 1);- }-- // Finally, append the new pages to the viewer and apply the spreadMode.- let spread = null;- for (const i of pageIndexSet) {- const pageView = this._pages[i];- if (!pageView) {- continue;- }- if (spread === null) {- spread = document.createElement("div");- spread.className = "spread";- viewer.appendChild(spread);- } else if (i % 2 === parity) {- spread = spread.cloneNode(false);- viewer.appendChild(spread);- }- spread.appendChild(pageView.div);-- state.pages.push(pageView);- }- }-- state.scrollDown = pageNumber >= state.previousPageNumber;- state.previousPageNumber = pageNumber;- }-- _scrollUpdate() {- if (this.pagesCount === 0) {- return;- }- this.update();- }-- _scrollIntoView({ pageDiv, pageSpot = null, pageNumber = null }) {- if (this._scrollMode === ScrollMode.PAGE) {- if (pageNumber) {- // Ensure that `this._currentPageNumber` is correct.- this._setCurrentPageNumber(pageNumber);- }- this.#ensurePageViewVisible();- // Ensure that rendering always occurs, to avoid showing a blank page,- // even if the current position doesn't change when the page is scrolled.- this.update();- }-- if (!pageSpot && !this.isInPresentationMode) {- const left = pageDiv.offsetLeft + pageDiv.clientLeft;- const right = left + pageDiv.clientWidth;- const { scrollLeft, clientWidth } = this.container;- if (- this._scrollMode === ScrollMode.HORIZONTAL ||- left < scrollLeft ||- right > scrollLeft + clientWidth- ) {- pageSpot = { left: 0, top: 0 };- }- }- scrollIntoView(pageDiv, pageSpot);- }-- /**- * Prevent unnecessary re-rendering of all pages when the scale changes- * only because of limited numerical precision.- */- #isSameScale(newScale) {- if (- this.isInPresentationMode &&- this.container.clientHeight !== this.#previousContainerHeight- ) {- // Ensure that the current page remains centered vertically if/when- // the window is resized while PresentationMode is active.- return false;- }- return (- newScale === this._currentScale ||- Math.abs(newScale - this._currentScale) < 1e-15- );- }-- _setScaleUpdatePages(newScale, newValue, noScroll = false, preset = false) {- this._currentScaleValue = newValue.toString();-- if (this.#isSameScale(newScale)) {- if (preset) {- this.eventBus.dispatch("scalechanging", {- source: this,- scale: newScale,- presetValue: newValue,- });- }- return;- }-- this._doc.style.setProperty("--zoom-factor", newScale);- this._doc.style.setProperty(- "--viewport-scale-factor",- newScale * PixelsPerInch.PDF_TO_CSS_UNITS- );-- const updateArgs = { scale: newScale };- for (const pageView of this._pages) {- pageView.update(updateArgs);- }- this._currentScale = newScale;-- if (!noScroll) {- let page = this._currentPageNumber,- dest;- if (- this._location &&- !(this.isInPresentationMode || this.isChangingPresentationMode)- ) {- page = this._location.pageNumber;- dest = [- null,- { name: "XYZ" },- this._location.left,- this._location.top,- null,- ];- }- this.scrollPageIntoView({- pageNumber: page,- destArray: dest,- allowNegativeOffset: true,- });- }-- this.eventBus.dispatch("scalechanging", {- source: this,- scale: newScale,- presetValue: preset ? newValue : undefined,- });-- if (this.defaultRenderingQueue) {- this.update();- }-- this.#previousContainerHeight = this.container.clientHeight;- }-- /**- * @private- */- get _pageWidthScaleFactor() {- if (- this._spreadMode !== SpreadMode.NONE &&- this._scrollMode !== ScrollMode.HORIZONTAL- ) {- return 2;- }- return 1;- }-- _setScale(value, noScroll = false) {- let scale = parseFloat(value);-- if (scale > 0) {- this._setScaleUpdatePages(scale, value, noScroll, /* preset = */ false);- } else {- const currentPage = this._pages[this._currentPageNumber - 1];- if (!currentPage) {- return;- }- let hPadding = SCROLLBAR_PADDING,- vPadding = VERTICAL_PADDING;-- if (this.isInPresentationMode) {- hPadding = vPadding = 4;- } else if (this.removePageBorders) {- hPadding = vPadding = 0;- }- if (this._scrollMode === ScrollMode.HORIZONTAL) {- [hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.- }- const pageWidthScale =- (((this.container.clientWidth - hPadding) / currentPage.width) *- currentPage.scale) /- this._pageWidthScaleFactor;- const pageHeightScale =- ((this.container.clientHeight - vPadding) / currentPage.height) *- currentPage.scale;- switch (value) {- case "page-actual":- scale = 1;- break;- case "page-width":- scale = pageWidthScale;- break;- case "page-height":- scale = pageHeightScale;- break;- case "page-fit":- scale = Math.min(pageWidthScale, pageHeightScale);- break;- case "auto":- // For pages in landscape mode, fit the page height to the viewer- // *unless* the page would thus become too wide to fit horizontally.- const horizontalScale = isPortraitOrientation(currentPage)- ? pageWidthScale- : Math.min(pageHeightScale, pageWidthScale);- scale = Math.min(MAX_AUTO_SCALE, horizontalScale);- break;- default:- console.error(`_setScale: "${value}" is an unknown zoom value.`);- return;- }- this._setScaleUpdatePages(scale, value, noScroll, /* preset = */ true);- }- }-- /**- * Refreshes page view: scrolls to the current page and updates the scale.- * @private- */- _resetCurrentPageView() {- if (this.isInPresentationMode) {- // Fixes the case when PDF has different page sizes.- this._setScale(this._currentScaleValue, true);- }-- const pageView = this._pages[this._currentPageNumber - 1];- this._scrollIntoView({ pageDiv: pageView.div });- }-- /**- * @param {string} label - The page label.- * @returns {number|null} The page number corresponding to the page label,- * or `null` when no page labels exist and/or the input is invalid.- */- pageLabelToPageNumber(label) {- if (!this._pageLabels) {- return null;- }- const i = this._pageLabels.indexOf(label);- if (i < 0) {- return null;- }- return i + 1;- }-- /**- * @typedef {Object} ScrollPageIntoViewParameters- * @property {number} pageNumber - The page number.- * @property {Array} [destArray] - The original PDF destination array, in the- * format: <page-ref> </XYZ|/FitXXX> <args..>- * @property {boolean} [allowNegativeOffset] - Allow negative page offsets.- * The default value is `false`.- * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in- * the destination array. The default value is `false`.- */-- /**- * Scrolls page into view.- * @param {ScrollPageIntoViewParameters} params- */- scrollPageIntoView({- pageNumber,- destArray = null,- allowNegativeOffset = false,- ignoreDestinationZoom = false,- }) {- if (!this.pdfDocument) {- return;- }- const pageView =- Number.isInteger(pageNumber) && this._pages[pageNumber - 1];- if (!pageView) {- console.error(- `scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`- );- return;- }-- if (this.isInPresentationMode || !destArray) {- this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);- return;- }- let x = 0,- y = 0;- let width = 0,- height = 0,- widthScale,- heightScale;- const changeOrientation = pageView.rotation % 180 !== 0;- const pageWidth =- (changeOrientation ? pageView.height : pageView.width) /- pageView.scale /- PixelsPerInch.PDF_TO_CSS_UNITS;- const pageHeight =- (changeOrientation ? pageView.width : pageView.height) /- pageView.scale /- PixelsPerInch.PDF_TO_CSS_UNITS;- let scale = 0;- switch (destArray[1].name) {- case "XYZ":- x = destArray[2];- y = destArray[3];- scale = destArray[4];- // If x and/or y coordinates are not supplied, default to- // _top_ left of the page (not the obvious bottom left,- // since aligning the bottom of the intended page with the- // top of the window is rarely helpful).- x = x !== null ? x : 0;- y = y !== null ? y : pageHeight;- break;- case "Fit":- case "FitB":- scale = "page-fit";- break;- case "FitH":- case "FitBH":- y = destArray[2];- scale = "page-width";- // According to the PDF spec, section 12.3.2.2, a `null` value in the- // parameter should maintain the position relative to the new page.- if (y === null && this._location) {- x = this._location.left;- y = this._location.top;- } else if (typeof y !== "number" || y < 0) {- // The "top" value isn't optional, according to the spec, however some- // bad PDF generators will pretend that it is (fixes bug 1663390).- y = pageHeight;- }- break;- case "FitV":- case "FitBV":- x = destArray[2];- width = pageWidth;- height = pageHeight;- scale = "page-height";- break;- case "FitR":- x = destArray[2];- y = destArray[3];- width = destArray[4] - x;- height = destArray[5] - y;- const hPadding = this.removePageBorders ? 0 : SCROLLBAR_PADDING;- const vPadding = this.removePageBorders ? 0 : VERTICAL_PADDING;-- widthScale =- (this.container.clientWidth - hPadding) /- width /- PixelsPerInch.PDF_TO_CSS_UNITS;- heightScale =- (this.container.clientHeight - vPadding) /- height /- PixelsPerInch.PDF_TO_CSS_UNITS;- scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));- break;- default:- console.error(- `scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`- );- return;- }-- if (!ignoreDestinationZoom) {- if (scale && scale !== this._currentScale) {- this.currentScaleValue = scale;- } else if (this._currentScale === UNKNOWN_SCALE) {- this.currentScaleValue = DEFAULT_SCALE_VALUE;- }- }-- if (scale === "page-fit" && !destArray[4]) {- this._scrollIntoView({- pageDiv: pageView.div,- pageNumber,- });- return;- }-- const boundingRect = [- pageView.viewport.convertToViewportPoint(x, y),- pageView.viewport.convertToViewportPoint(x + width, y + height),- ];- let left = Math.min(boundingRect[0][0], boundingRect[1][0]);- let top = Math.min(boundingRect[0][1], boundingRect[1][1]);-- if (!allowNegativeOffset) {- // Some bad PDF generators will create destinations with e.g. top values- // that exceeds the page height. Ensure that offsets are not negative,- // to prevent a previous page from becoming visible (fixes bug 874482).- left = Math.max(left, 0);- top = Math.max(top, 0);- }- this._scrollIntoView({- pageDiv: pageView.div,- pageSpot: { left, top },- pageNumber,- });- }-- _updateLocation(firstPage) {- const currentScale = this._currentScale;- const currentScaleValue = this._currentScaleValue;- const normalizedScaleValue =- parseFloat(currentScaleValue) === currentScale- ? Math.round(currentScale * 10000) / 100- : currentScaleValue;-- const pageNumber = firstPage.id;- let pdfOpenParams = "#page=" + pageNumber;- pdfOpenParams += "&zoom=" + normalizedScaleValue;- const currentPageView = this._pages[pageNumber - 1];- const container = this.container;- const topLeft = currentPageView.getPagePoint(- container.scrollLeft - firstPage.x,- container.scrollTop - firstPage.y- );- const intLeft = Math.round(topLeft[0]);- const intTop = Math.round(topLeft[1]);- pdfOpenParams += "," + intLeft + "," + intTop;-- this._location = {- pageNumber,- scale: normalizedScaleValue,- top: intTop,- left: intLeft,- rotation: this._pagesRotation,- pdfOpenParams,- };- }-- update() {- const visible = this._getVisiblePages();- const visiblePages = visible.views,- numVisiblePages = visiblePages.length;-- if (numVisiblePages === 0) {- return;- }- const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);- this.#buffer.resize(newCacheSize, visible.ids);-- this.renderingQueue.renderHighestPriority(visible);-- if (!this.isInPresentationMode) {- const isSimpleLayout =- this._spreadMode === SpreadMode.NONE &&- (this._scrollMode === ScrollMode.PAGE ||- this._scrollMode === ScrollMode.VERTICAL);- let currentId = this._currentPageNumber;- let stillFullyVisible = false;-- for (const page of visiblePages) {- if (page.percent < 100) {- break;- }- if (page.id === currentId && isSimpleLayout) {- stillFullyVisible = true;- break;- }- }- if (!stillFullyVisible) {- currentId = visiblePages[0].id;- }- this._setCurrentPageNumber(currentId);- }-- this._updateLocation(visible.first);- this.eventBus.dispatch("updateviewarea", {- source: this,- location: this._location,- });- }-- containsElement(element) {- return this.container.contains(element);- }-- focus() {- this.container.focus();- }-- get _isContainerRtl() {- return getComputedStyle(this.container).direction === "rtl";- }-- get isInPresentationMode() {- return this.presentationModeState === PresentationModeState.FULLSCREEN;- }-- get isChangingPresentationMode() {- return this.presentationModeState === PresentationModeState.CHANGING;- }-- get isHorizontalScrollbarEnabled() {- return this.isInPresentationMode- ? false- : this.container.scrollWidth > this.container.clientWidth;- }-- get isVerticalScrollbarEnabled() {- return this.isInPresentationMode- ? false- : this.container.scrollHeight > this.container.clientHeight;- }-- /**- * Helper method for `this._getVisiblePages`. Should only ever be used when- * the viewer can only display a single page at a time, for example:- * - When PresentationMode is active.- */- _getCurrentVisiblePage() {- if (!this.pagesCount) {- return { views: [] };- }- const pageView = this._pages[this._currentPageNumber - 1];- // NOTE: Compute the `x` and `y` properties of the current view,- // since `this._updateLocation` depends of them being available.- const element = pageView.div;-- const view = {- id: pageView.id,- x: element.offsetLeft + element.clientLeft,- y: element.offsetTop + element.clientTop,- view: pageView,- };- const ids = new Set([pageView.id]);-- return { first: view, last: view, views: [view], ids };- }-- _getVisiblePages() {- if (this.isInPresentationMode) {- // The algorithm in `getVisibleElements` doesn't work in all browsers and- // configurations (e.g. Chrome) when PresentationMode is active.- return this._getCurrentVisiblePage();- }- const views =- this._scrollMode === ScrollMode.PAGE- ? this.#scrollModePageState.pages- : this._pages,- horizontal = this._scrollMode === ScrollMode.HORIZONTAL,- rtl = horizontal && this._isContainerRtl;-- return getVisibleElements({- scrollEl: this.container,- views,- sortByVisibility: true,- horizontal,- rtl,- });- }-- /**- * @param {number} pageNumber- */- isPageVisible(pageNumber) {- if (!this.pdfDocument) {- return false;- }- if (- !(- Number.isInteger(pageNumber) &&- pageNumber > 0 &&- pageNumber <= this.pagesCount- )- ) {- console.error(`isPageVisible: "${pageNumber}" is not a valid page.`);- return false;- }- return this._getVisiblePages().ids.has(pageNumber);- }-- /**- * @param {number} pageNumber- */- isPageCached(pageNumber) {- if (!this.pdfDocument) {- return false;- }- if (- !(- Number.isInteger(pageNumber) &&- pageNumber > 0 &&- pageNumber <= this.pagesCount- )- ) {- console.error(`isPageCached: "${pageNumber}" is not a valid page.`);- return false;- }- const pageView = this._pages[pageNumber - 1];- return this.#buffer.has(pageView);- }-- cleanup() {- for (let i = 0, ii = this._pages.length; i < ii; i++) {- if (- this._pages[i] &&- this._pages[i].renderingState !== RenderingStates.FINISHED- ) {- this._pages[i].reset();- }- }- }-- /**- * @private- */- _cancelRendering() {- for (let i = 0, ii = this._pages.length; i < ii; i++) {- if (this._pages[i]) {- this._pages[i].cancelRendering();- }- }- }-- /**- * @param {PDFPageView} pageView- * @returns {Promise<PDFPageProxy | null>}- */- async #ensurePdfPageLoaded(pageView) {- if (pageView.pdfPage) {- return pageView.pdfPage;- }- try {- const pdfPage = await this.pdfDocument.getPage(pageView.id);- if (!pageView.pdfPage) {- pageView.setPdfPage(pdfPage);- }- if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {- this.linkService.cachePageRef(pageView.id, pdfPage.ref);- }- return pdfPage;- } catch (reason) {- console.error("Unable to get page for page view", reason);- return null; // Page error -- there is nothing that can be done.- }- }-- #getScrollAhead(visible) {- if (visible.first?.id === 1) {- return true;- } else if (visible.last?.id === this.pagesCount) {- return false;- }- switch (this._scrollMode) {- case ScrollMode.PAGE:- return this.#scrollModePageState.scrollDown;- case ScrollMode.HORIZONTAL:- return this.scroll.right;- }- return this.scroll.down;- }-- /**- * Only show the `loadingIcon`-spinner on visible pages (see issue 14242).- */- #toggleLoadingIconSpinner(visibleIds) {- for (const id of visibleIds) {- const pageView = this._pages[id - 1];- pageView?.toggleLoadingIconSpinner(/* viewVisible = */ true);- }- for (const pageView of this.#buffer) {- if (visibleIds.has(pageView.id)) {- // Handled above, since the "buffer" may not contain all visible pages.- continue;- }- pageView.toggleLoadingIconSpinner(/* viewVisible = */ false);- }- }-- forceRendering(currentlyVisiblePages) {- const visiblePages = currentlyVisiblePages || this._getVisiblePages();- const scrollAhead = this.#getScrollAhead(visiblePages);- const preRenderExtra =- this._spreadMode !== SpreadMode.NONE &&- this._scrollMode !== ScrollMode.HORIZONTAL;-- const pageView = this.renderingQueue.getHighestPriority(- visiblePages,- this._pages,- scrollAhead,- preRenderExtra- );- this.#toggleLoadingIconSpinner(visiblePages.ids);-- if (pageView) {- this.#ensurePdfPageLoaded(pageView).then(() => {- this.renderingQueue.renderView(pageView);- });- return true;- }- return false;- }-- /**- * @param {HTMLDivElement} textLayerDiv- * @param {number} pageIndex- * @param {PageViewport} viewport- * @param {boolean} enhanceTextSelection- * @param {EventBus} eventBus- * @param {TextHighlighter} highlighter- * @returns {TextLayerBuilder}- */- createTextLayerBuilder(- textLayerDiv,- pageIndex,- viewport,- enhanceTextSelection = false,- eventBus,- highlighter- ) {- return new TextLayerBuilder({- textLayerDiv,- eventBus,- pageIndex,- viewport,- enhanceTextSelection: this.isInPresentationMode- ? false- : enhanceTextSelection,- highlighter,- });- }-- /**- * @param {number} pageIndex- * @param {EventBus} eventBus- * @returns {TextHighlighter}- */- createTextHighlighter(pageIndex, eventBus) {- return new TextHighlighter({- eventBus,- pageIndex,- findController: this.isInPresentationMode ? null : this.findController,- });- }-- /**- * @param {HTMLDivElement} pageDiv- * @param {PDFPageProxy} pdfPage- * @param {AnnotationStorage} [annotationStorage] - Storage for annotation- * data in forms.- * @param {string} [imageResourcesPath] - Path for image resources, mainly- * for annotation icons. Include trailing slash.- * @param {boolean} renderForms- * @param {IL10n} l10n- * @param {boolean} [enableScripting]- * @param {Promise<boolean>} [hasJSActionsPromise]- * @param {Object} [mouseState]- * @param {Promise<Object<string, Array<Object>> | null>}- * [fieldObjectsPromise]- * @param {Map<string, HTMLCanvasElement>} [annotationCanvasMap]- * @returns {AnnotationLayerBuilder}- */- createAnnotationLayerBuilder(- pageDiv,- pdfPage,- annotationStorage = null,- imageResourcesPath = "",- renderForms = true,- l10n = NullL10n,- enableScripting = null,- hasJSActionsPromise = null,- mouseState = null,- fieldObjectsPromise = null,- annotationCanvasMap = null- ) {- return new AnnotationLayerBuilder({- pageDiv,- pdfPage,- annotationStorage:- annotationStorage || this.pdfDocument?.annotationStorage,- imageResourcesPath,- renderForms,- linkService: this.linkService,- downloadManager: this.downloadManager,- l10n,- enableScripting: enableScripting ?? this.enableScripting,- hasJSActionsPromise:- hasJSActionsPromise || this.pdfDocument?.hasJSActions(),- fieldObjectsPromise:- fieldObjectsPromise || this.pdfDocument?.getFieldObjects(),- mouseState: mouseState || this._scriptingManager?.mouseState,- annotationCanvasMap,- });- }-- /**- * @param {HTMLDivElement} pageDiv- * @param {PDFPageProxy} pdfPage- * @param {AnnotationStorage} [annotationStorage] - Storage for annotation- * data in forms.- * @returns {XfaLayerBuilder}- */- createXfaLayerBuilder(pageDiv, pdfPage, annotationStorage = null) {- return new XfaLayerBuilder({- pageDiv,- pdfPage,- annotationStorage:- annotationStorage || this.pdfDocument?.annotationStorage,- linkService: this.linkService,- });- }-- /**- * @param {PDFPageProxy} pdfPage- * @returns {StructTreeLayerBuilder}- */- createStructTreeLayerBuilder(pdfPage) {- return new StructTreeLayerBuilder({- pdfPage,- });- }-- /**- * @type {boolean} Whether all pages of the PDF document have identical- * widths and heights.- */- get hasEqualPageSizes() {- const firstPageView = this._pages[0];- for (let i = 1, ii = this._pages.length; i < ii; ++i) {- const pageView = this._pages[i];- if (- pageView.width !== firstPageView.width ||- pageView.height !== firstPageView.height- ) {- return false;- }- }- return true;- }-- /**- * Returns sizes of the pages.- * @returns {Array} Array of objects with width/height/rotation fields.- */- getPagesOverview() {- return this._pages.map(pageView => {- const viewport = pageView.pdfPage.getViewport({ scale: 1 });-- if (!this.enablePrintAutoRotate || isPortraitOrientation(viewport)) {- return {- width: viewport.width,- height: viewport.height,- rotation: viewport.rotation,- };- }- // Landscape orientation.- return {- width: viewport.height,- height: viewport.width,- rotation: (viewport.rotation - 90) % 360,- };- });- }-- /**- * @type {Promise<OptionalContentConfig | null>}- */- get optionalContentConfigPromise() {- if (!this.pdfDocument) {- return Promise.resolve(null);- }- if (!this._optionalContentConfigPromise) {- // Prevent issues if the getter is accessed *before* the `onePageRendered`- // promise has resolved; won't (normally) happen in the default viewer.- return this.pdfDocument.getOptionalContentConfig();- }- return this._optionalContentConfigPromise;- }-- /**- * @param {Promise<OptionalContentConfig>} promise - A promise that is- * resolved with an {@link OptionalContentConfig} instance.- */- set optionalContentConfigPromise(promise) {- if (!(promise instanceof Promise)) {- throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);- }- if (!this.pdfDocument) {- return;- }- if (!this._optionalContentConfigPromise) {- // Ignore the setter *before* the `onePageRendered` promise has resolved,- // since it'll be overwritten anyway; won't happen in the default viewer.- return;- }- this._optionalContentConfigPromise = promise;-- const updateArgs = { optionalContentConfigPromise: promise };- for (const pageView of this._pages) {- pageView.update(updateArgs);- }- this.update();-- this.eventBus.dispatch("optionalcontentconfigchanged", {- source: this,- promise,- });- }-- /**- * @type {number} One of the values in {ScrollMode}.- */- get scrollMode() {- return this._scrollMode;- }-- /**- * @param {number} mode - The direction in which the document pages should be- * laid out within the scrolling container.- * The constants from {ScrollMode} should be used.- */- set scrollMode(mode) {- if (this._scrollMode === mode) {- return; // The Scroll mode didn't change.- }- if (!isValidScrollMode(mode)) {- throw new Error(`Invalid scroll mode: ${mode}`);- }- if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {- return; // Disabled for performance reasons.- }- this._previousScrollMode = this._scrollMode;-- this._scrollMode = mode;- this.eventBus.dispatch("scrollmodechanged", { source: this, mode });-- this._updateScrollMode(/* pageNumber = */ this._currentPageNumber);- }-- _updateScrollMode(pageNumber = null) {- const scrollMode = this._scrollMode,- viewer = this.viewer;-- viewer.classList.toggle(- "scrollHorizontal",- scrollMode === ScrollMode.HORIZONTAL- );- viewer.classList.toggle("scrollWrapped", scrollMode === ScrollMode.WRAPPED);-- if (!this.pdfDocument || !pageNumber) {- return;- }-- if (scrollMode === ScrollMode.PAGE) {- this.#ensurePageViewVisible();- } else if (this._previousScrollMode === ScrollMode.PAGE) {- // Ensure that the current spreadMode is still applied correctly when- // the *previous* scrollMode was `ScrollMode.PAGE`.- this._updateSpreadMode();- }- // Non-numeric scale values can be sensitive to the scroll orientation.- // Call this before re-scrolling to the current page, to ensure that any- // changes in scale don't move the current page.- if (this._currentScaleValue && isNaN(this._currentScaleValue)) {- this._setScale(this._currentScaleValue, true);- }- this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);- this.update();- }-- /**- * @type {number} One of the values in {SpreadMode}.- */- get spreadMode() {- return this._spreadMode;- }-- /**- * @param {number} mode - Group the pages in spreads, starting with odd- or- * even-number pages (unless `SpreadMode.NONE` is used).- * The constants from {SpreadMode} should be used.- */- set spreadMode(mode) {- if (this._spreadMode === mode) {- return; // The Spread mode didn't change.- }- if (!isValidSpreadMode(mode)) {- throw new Error(`Invalid spread mode: ${mode}`);- }- this._spreadMode = mode;- this.eventBus.dispatch("spreadmodechanged", { source: this, mode });-- this._updateSpreadMode(/* pageNumber = */ this._currentPageNumber);- }-- _updateSpreadMode(pageNumber = null) {- if (!this.pdfDocument) {- return;- }- const viewer = this.viewer,- pages = this._pages;-- if (this._scrollMode === ScrollMode.PAGE) {- this.#ensurePageViewVisible();- } else {- // Temporarily remove all the pages from the DOM.- viewer.textContent = "";-- if (this._spreadMode === SpreadMode.NONE) {- for (let i = 0, ii = pages.length; i < ii; ++i) {- viewer.appendChild(pages[i].div);- }- } else {- const parity = this._spreadMode - 1;- let spread = null;- for (let i = 0, ii = pages.length; i < ii; ++i) {- if (spread === null) {- spread = document.createElement("div");- spread.className = "spread";- viewer.appendChild(spread);- } else if (i % 2 === parity) {- spread = spread.cloneNode(false);- viewer.appendChild(spread);- }- spread.appendChild(pages[i].div);- }- }- }-- if (!pageNumber) {- return;- }- // Non-numeric scale values can be sensitive to the scroll orientation.- // Call this before re-scrolling to the current page, to ensure that any- // changes in scale don't move the current page.- if (this._currentScaleValue && isNaN(this._currentScaleValue)) {- this._setScale(this._currentScaleValue, true);- }- this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);- this.update();- }-- /**- * @private- */- _getPageAdvance(currentPageNumber, previous = false) {- switch (this._scrollMode) {- case ScrollMode.WRAPPED: {- const { views } = this._getVisiblePages(),- pageLayout = new Map();-- // Determine the current (visible) page layout.- for (const { id, y, percent, widthPercent } of views) {- if (percent === 0 || widthPercent < 100) {- continue;- }- let yArray = pageLayout.get(y);- if (!yArray) {- pageLayout.set(y, (yArray ||= []));- }- yArray.push(id);- }- // Find the row of the current page.- for (const yArray of pageLayout.values()) {- const currentIndex = yArray.indexOf(currentPageNumber);- if (currentIndex === -1) {- continue;- }- const numPages = yArray.length;- if (numPages === 1) {- break;- }- // Handle documents with varying page sizes.- if (previous) {- for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {- const currentId = yArray[i],- expectedId = yArray[i + 1] - 1;- if (currentId < expectedId) {- return currentPageNumber - expectedId;- }- }- } else {- for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {- const currentId = yArray[i],- expectedId = yArray[i - 1] + 1;- if (currentId > expectedId) {- return expectedId - currentPageNumber;- }- }- }- // The current row is "complete", advance to the previous/next one.- if (previous) {- const firstId = yArray[0];- if (firstId < currentPageNumber) {- return currentPageNumber - firstId + 1;- }- } else {- const lastId = yArray[numPages - 1];- if (lastId > currentPageNumber) {- return lastId - currentPageNumber + 1;- }- }- break;- }- break;- }- case ScrollMode.HORIZONTAL: {- break;- }- case ScrollMode.PAGE:- case ScrollMode.VERTICAL: {- if (this._spreadMode === SpreadMode.NONE) {- break; // Normal vertical scrolling.- }- const parity = this._spreadMode - 1;-- if (previous && currentPageNumber % 2 !== parity) {- break; // Left-hand side page.- } else if (!previous && currentPageNumber % 2 === parity) {- break; // Right-hand side page.- }- const { views } = this._getVisiblePages(),- expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;-- for (const { id, percent, widthPercent } of views) {- if (id !== expectedId) {- continue;- }- if (percent > 0 && widthPercent === 100) {- return 2;- }- break;- }- break;- }- }- return 1;- }-- /**- * Go to the next page, taking scroll/spread-modes into account.- * @returns {boolean} Whether navigation occured.- */- nextPage() {- const currentPageNumber = this._currentPageNumber,- pagesCount = this.pagesCount;-- if (currentPageNumber >= pagesCount) {- return false;- }- const advance =- this._getPageAdvance(currentPageNumber, /* previous = */ false) || 1;-- this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);- return true;- }-- /**- * Go to the previous page, taking scroll/spread-modes into account.- * @returns {boolean} Whether navigation occured.- */- previousPage() {- const currentPageNumber = this._currentPageNumber;-- if (currentPageNumber <= 1) {- return false;- }- const advance =- this._getPageAdvance(currentPageNumber, /* previous = */ true) || 1;-- this.currentPageNumber = Math.max(currentPageNumber - advance, 1);- return true;- }-- /**- * Increase the current zoom level one, or more, times.- * @param {number} [steps] - Defaults to zooming once.- */- increaseScale(steps = 1) {- let newScale = this._currentScale;- do {- newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);- newScale = Math.ceil(newScale * 10) / 10;- newScale = Math.min(MAX_SCALE, newScale);- } while (--steps > 0 && newScale < MAX_SCALE);- this.currentScaleValue = newScale;- }-- /**- * Decrease the current zoom level one, or more, times.- * @param {number} [steps] - Defaults to zooming once.- */- decreaseScale(steps = 1) {- let newScale = this._currentScale;- do {- newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);- newScale = Math.floor(newScale * 10) / 10;- newScale = Math.max(MIN_SCALE, newScale);- } while (--steps > 0 && newScale > MIN_SCALE);- this.currentScaleValue = newScale;- }-}--export { BaseViewer, PagesCountLimit, PDFPageViewBuffer };diff --git a/app/src/asset/pdf/download_manager.js b/app/src/asset/pdf/download_manager.jsindex 1a039c0e15..d0feccd983 100644--- a/app/src/asset/pdf/download_manager.js+++ b/app/src/asset/pdf/download_manager.js@@ -13,6 +13,8 @@* limitations under the License.*/+/** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */+import { createValidAbsoluteUrl, isPdfFile } from "./pdfjs";if (typeof PDFJSDev !== "undefined" && !PDFJSDev.test("CHROME || GENERIC")) {@@ -36,7 +38,7 @@ function download(blobUrl, filename) {}// <a> must be in the document for recent Firefox versions,// otherwise .click() is ignored.- (document.body || document.documentElement).appendChild(a);+ (document.body || document.documentElement).append(a);a.click();a.remove();}@@ -107,13 +109,7 @@ class DownloadManager {return false;}- /**- * @param sourceEventType {string} Used to signal what triggered the download.- * The version of PDF.js integrated with Firefox uses this to to determine- * which dialog to show. "save" triggers "save as" and "download" triggers- * the "open with" dialog.- */- download(blob, url, filename, sourceEventType = "download") {+ download(blob, url, filename) {const blobUrl = URL.createObjectURL(blob);download(blobUrl, filename);}diff --git a/app/src/asset/pdf/genericcom.js b/app/src/asset/pdf/genericcom.jsindex aae9f1796f..c45e1e0461 100644--- a/app/src/asset/pdf/genericcom.js+++ b/app/src/asset/pdf/genericcom.js@@ -13,29 +13,30 @@* limitations under the License.*/-import { BasePreferences } from './preferences.js'-import { DownloadManager } from './download_manager.js'-import { GenericScripting } from './generic_scripting.js'+import { BasePreferences } from "./preferences.js";+import { DownloadManager } from "./download_manager.js";+import { GenericScripting } from "./generic_scripting.js";import { shadow } from './pdfjs'-if (typeof PDFJSDev !== 'undefined' && !PDFJSDev.test('GENERIC')) {+if (typeof PDFJSDev !== "undefined" && !PDFJSDev.test("GENERIC")) {throw new Error(- 'Module "pdfjs-web/genericcom" shall not be used outside GENERIC build.',- )+ 'Module "pdfjs-web/genericcom" shall not be used outside GENERIC build.'+ );}-const GenericCom = {}+const GenericCom = {};class GenericPreferences extends BasePreferences {- async _writeToStorage (prefObj) {- localStorage.setItem('pdfjs.preferences', JSON.stringify(prefObj))+ async _writeToStorage(prefObj) {+ localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj));}- async _readFromStorage (prefObj) {- return JSON.parse(localStorage.getItem('pdfjs.preferences'))+ async _readFromStorage(prefObj) {+ return JSON.parse(localStorage.getItem("pdfjs.preferences"));}}+// NOTEclass GenericExternalServices {constructor () {throw new Error('Cannot initialize DefaultExternalServices.')@@ -70,17 +71,22 @@ class GenericExternalServices {return shadow(this, 'isInAutomation', false)}- static createDownloadManager (options) {- return new DownloadManager()+ static createDownloadManager(options) {+ return new DownloadManager();}- static createPreferences () {- return new GenericPreferences()+ static createPreferences() {+ return new GenericPreferences();}- static createScripting ({sandboxBundleSrc}) {- return new GenericScripting(sandboxBundleSrc)+ static createL10n({ locale = "en-US" }) {+ // NOTE+ // return new GenericL10n(locale);}-}-export { GenericCom, GenericExternalServices }+ static createScripting({ sandboxBundleSrc }) {+ return new GenericScripting(sandboxBundleSrc);+ }+}+// NOTE+export { GenericCom, GenericExternalServices };diff --git a/app/src/asset/pdf/grab_to_pan.js b/app/src/asset/pdf/grab_to_pan.jsindex c4b5094879..760e75e7c9 100644--- a/app/src/asset/pdf/grab_to_pan.js+++ b/app/src/asset/pdf/grab_to_pan.js@@ -153,7 +153,7 @@ class GrabToPan {this.element.scrollLeft = scrollLeft;}if (!this.overlay.parentNode) {- document.body.appendChild(this.overlay);+ document.body.append(this.overlay);}}diff --git a/app/src/asset/pdf/l10n_utils.js b/app/src/asset/pdf/l10n_utils.jsindex 8e08cd08c4..c91100600e 100644--- a/app/src/asset/pdf/l10n_utils.js+++ b/app/src/asset/pdf/l10n_utils.js@@ -81,6 +81,11 @@ const DEFAULT_L10N_STRINGS = {printing_not_ready: "Warning: The PDF is not fully loaded for printing.",web_fonts_disabled:"Web fonts are disabled: unable to use embedded PDF fonts.",++ free_text2_default_content: "Start typing…",+ editor_free_text2_aria_label: "Text Editor",+ editor_ink2_aria_label: "Draw Editor",+ editor_ink_canvas_aria_label: "User-created image",};function getL10nFallback(key, args) {diff --git a/app/src/asset/pdf/overlay_manager.js b/app/src/asset/pdf/overlay_manager.jsindex 4c2e5c1f52..82e1ddf666 100644--- a/app/src/asset/pdf/overlay_manager.js+++ b/app/src/asset/pdf/overlay_manager.js@@ -14,123 +14,103 @@*/class OverlayManager {- #overlays = Object.create(null);+ #overlays = new WeakMap();#active = null;- #keyDownBound = null;-get active() {return this.#active;}/**- * @param {string} name - The name of the overlay that is registered.- * @param {HTMLDivElement} element - The overlay's DOM element.- * @param {function} [callerCloseMethod] - The method that, if present, calls- * `OverlayManager.close` from the object registering the- * overlay. Access to this method is necessary in order to- * run cleanup code when e.g. the overlay is force closed.- * The default is `null`.+ * @param {HTMLDialogElement} dialog - The overlay's DOM element.* @param {boolean} [canForceClose] - Indicates if opening the overlay closes* an active overlay. The default is `false`.* @returns {Promise} A promise that is resolved when the overlay has been* registered.*/- async register(- name,- element,- callerCloseMethod = null,- canForceClose = false- ) {- let container;- if (!name || !element || !(container = element.parentNode)) {+ async register(dialog, canForceClose = false) {+ if (typeof dialog !== "object") {throw new Error("Not enough parameters.");- } else if (this.#overlays[name]) {+ } else if (this.#overlays.has(dialog)) {throw new Error("The overlay is already registered.");}- this.#overlays[name] = {- element,- container,- callerCloseMethod,- canForceClose,- };+ this.#overlays.set(dialog, { canForceClose });++ // NOTE+ // if (+ // typeof PDFJSDev !== "undefined" &&+ // PDFJSDev.test("GENERIC && !SKIP_BABEL") &&+ // !dialog.showModal+ // ) {+ // const dialogPolyfill = require("dialog-polyfill/dist/dialog-polyfill.js");+ // dialogPolyfill.registerDialog(dialog);+ //+ // if (!this._dialogPolyfillCSS) {+ // this._dialogPolyfillCSS = true;+ //+ // const style = document.createElement("style");+ // style.textContent = PDFJSDev.eval("DIALOG_POLYFILL_CSS");+ //+ // document.head.prepend(style);+ // }+ // }++ dialog.addEventListener("cancel", evt => {+ this.#active = null;+ });}/**- * @param {string} name - The name of the overlay that is unregistered.+ * @param {HTMLDialogElement} dialog - The overlay's DOM element.* @returns {Promise} A promise that is resolved when the overlay has been* unregistered.*/- async unregister(name) {- if (!this.#overlays[name]) {+ async unregister(dialog) {+ if (!this.#overlays.has(dialog)) {throw new Error("The overlay does not exist.");- } else if (this.#active === name) {+ } else if (this.#active === dialog) {throw new Error("The overlay cannot be removed while it is active.");}- delete this.#overlays[name];+ this.#overlays.delete(dialog);}/**- * @param {string} name - The name of the overlay that should be opened.+ * @param {HTMLDialogElement} dialog - The overlay's DOM element.* @returns {Promise} A promise that is resolved when the overlay has been* opened.*/- async open(name) {- if (!this.#overlays[name]) {+ async open(dialog) {+ if (!this.#overlays.has(dialog)) {throw new Error("The overlay does not exist.");} else if (this.#active) {- if (this.#active === name) {+ if (this.#active === dialog) {throw new Error("The overlay is already active.");- } else if (this.#overlays[name].canForceClose) {- this.#closeThroughCaller();+ } else if (this.#overlays.get(dialog).canForceClose) {+ await this.close();} else {throw new Error("Another overlay is currently active.");}}- this.#active = name;- this.#overlays[this.#active].element.classList.remove("fn__hidden");- this.#overlays[this.#active].container.classList.remove("fn__hidden");-- this.#keyDownBound = this.#keyDown.bind(this);- window.addEventListener("keydown", this.#keyDownBound);+ this.#active = dialog;+ dialog.showModal();}/**- * @param {string} name - The name of the overlay that should be closed.+ * @param {HTMLDialogElement} dialog - The overlay's DOM element.* @returns {Promise} A promise that is resolved when the overlay has been* closed.*/- async close(name) {- if (!this.#overlays[name]) {+ async close(dialog = this.#active) {+ if (!this.#overlays.has(dialog)) {throw new Error("The overlay does not exist.");} else if (!this.#active) {throw new Error("The overlay is currently not active.");- } else if (this.#active !== name) {+ } else if (this.#active !== dialog) {throw new Error("Another overlay is currently active.");}- this.#overlays[this.#active].container.classList.add("fn__hidden");- this.#overlays[this.#active].element.classList.add("fn__hidden");+ dialog.close();this.#active = null;-- window.removeEventListener("keydown", this.#keyDownBound);- this.#keyDownBound = null;- }-- #keyDown(evt) {- if (this.#active && evt.keyCode === /* Esc = */ 27) {- this.#closeThroughCaller();- evt.preventDefault();- }- }-- #closeThroughCaller() {- if (this.#overlays[this.#active].callerCloseMethod) {- this.#overlays[this.#active].callerCloseMethod();- }- if (this.#active) {- this.close(this.#active);- }}}diff --git a/app/src/asset/pdf/password_prompt.js b/app/src/asset/pdf/password_prompt.jsindex 4d0b4e2329..f0fc0799d9 100644--- a/app/src/asset/pdf/password_prompt.js+++ b/app/src/asset/pdf/password_prompt.js@@ -13,12 +13,11 @@* limitations under the License.*/-import { PasswordResponses } from "./pdfjs";+import { createPromiseCapability, PasswordResponses } from "./pdfjs";/*** @typedef {Object} PasswordPromptOptions- * @property {string} overlayName - Name of the overlay for the overlay manager.- * @property {HTMLDivElement} container - Div container for the overlay.+ * @property {HTMLDialogElement} dialog - The overlay's DOM element.* @property {HTMLParagraphElement} label - Label containing instructions for* entering the password.* @property {HTMLInputElement} input - Input field for entering the password.@@ -29,6 +28,12 @@ import { PasswordResponses } from "./pdfjs";*/class PasswordPrompt {+ #activeCapability = null;++ #updateCallback = null;++ #reason = null;+/*** @param {PasswordPromptOptions} options* @param {OverlayManager} overlayManager - Manager for the viewer overlays.@@ -37,8 +42,7 @@ class PasswordPrompt {* an <iframe> or an <object>. The default value is `false`.*/constructor(options, overlayManager, l10n, isViewerEmbedded = false) {- this.overlayName = options.overlayName;- this.container = options.container;+ this.dialog = options.dialog;this.label = options.label;this.input = options.input;this.submitButton = options.submitButton;@@ -47,61 +51,80 @@ class PasswordPrompt {this.l10n = l10n;this._isViewerEmbedded = isViewerEmbedded;- this.updateCallback = null;- this.reason = null;-// Attach the event listeners.this.submitButton.addEventListener("click", this.#verify.bind(this));- this.cancelButton.addEventListener("click", this.#cancel.bind(this));+ this.cancelButton.addEventListener("click", this.close.bind(this));this.input.addEventListener("keydown", e => {if (e.keyCode === /* Enter = */ 13) {this.#verify();}});- this.overlayManager.register(- this.overlayName,- this.container,- this.#cancel.bind(this),- true- );+ this.overlayManager.register(this.dialog, /* canForceClose = */ true);++ this.dialog.addEventListener("close", this.#cancel.bind(this));}async open() {- await this.overlayManager.open(this.overlayName);+ if (this.#activeCapability) {+ await this.#activeCapability.promise;+ }+ this.#activeCapability = createPromiseCapability();++ try {+ await this.overlayManager.open(this.dialog);+ } catch (ex) {+ this.#activeCapability = null;+ throw ex;+ }const passwordIncorrect =- this.reason === PasswordResponses.INCORRECT_PASSWORD;+ this.#reason === PasswordResponses.INCORRECT_PASSWORD;if (!this._isViewerEmbedded || passwordIncorrect) {this.input.focus();}+ // NOTEthis.label.textContent = window.siyuan.languages[`password_${passwordIncorrect? 'invalid': 'label'}`]}async close() {- await this.overlayManager.close(this.overlayName);- this.input.value = "";+ if (this.overlayManager.active === this.dialog) {+ this.overlayManager.close(this.dialog);+ }}#verify() {const password = this.input.value;if (password?.length > 0) {- this.close();- this.updateCallback(password);+ this.#invokeCallback(password);}}#cancel() {+ this.#invokeCallback(new Error("PasswordPrompt cancelled."));+ this.#activeCapability.resolve();+ }++ #invokeCallback(password) {+ if (!this.#updateCallback) {+ return; // Ensure that the callback is only invoked once.+ }this.close();- this.updateCallback(new Error("PasswordPrompt cancelled."));+ this.input.value = "";++ this.#updateCallback(password);+ this.#updateCallback = null;}- setUpdateCallback(updateCallback, reason) {- this.updateCallback = updateCallback;- this.reason = reason;+ async setUpdateCallback(updateCallback, reason) {+ if (this.#activeCapability) {+ await this.#activeCapability.promise;+ }+ this.#updateCallback = updateCallback;+ this.#reason = reason;}}diff --git a/app/src/asset/pdf/pdf_attachment_viewer.js b/app/src/asset/pdf/pdf_attachment_viewer.jsindex 03c3dcc6f6..741b1f3d45 100644--- a/app/src/asset/pdf/pdf_attachment_viewer.js+++ b/app/src/asset/pdf/pdf_attachment_viewer.js@@ -15,6 +15,7 @@import { createPromiseCapability, getFilenameFromUrl } from "./pdfjs";import { BaseTreeViewer } from "./base_tree_viewer.js";+import { waitOnEventOrTimeout } from "./event_utils.js";/*** @typedef {Object} PDFAttachmentViewerOptions@@ -38,7 +39,7 @@ class PDFAttachmentViewer extends BaseTreeViewer {this.eventBus._on("fileattachmentannotation",- this._appendAttachment.bind(this)+ this.#appendAttachment.bind(this));}@@ -51,36 +52,33 @@ class PDFAttachmentViewer extends BaseTreeViewer {// replaced is when appending FileAttachment annotations.this._renderedCapability = createPromiseCapability();}- if (this._pendingDispatchEvent) {- clearTimeout(this._pendingDispatchEvent);- }- this._pendingDispatchEvent = null;+ this._pendingDispatchEvent = false;}/*** @private*/- _dispatchEvent(attachmentsCount) {+ async _dispatchEvent(attachmentsCount) {this._renderedCapability.resolve();- if (this._pendingDispatchEvent) {- clearTimeout(this._pendingDispatchEvent);- this._pendingDispatchEvent = null;- }- if (attachmentsCount === 0) {+ if (attachmentsCount === 0 && !this._pendingDispatchEvent) {// Delay the event when no "regular" attachments exist, to allow time for// parsing of any FileAttachment annotations that may be present on the// *initially* rendered page; this reduces the likelihood of temporarily// disabling the attachmentsView when the `PDFSidebar` handles the event.- this._pendingDispatchEvent = setTimeout(() => {- this.eventBus.dispatch("attachmentsloaded", {- source: this,- attachmentsCount: 0,- });- this._pendingDispatchEvent = null;+ this._pendingDispatchEvent = true;++ await waitOnEventOrTimeout({+ target: this.eventBus,+ name: "annotationlayerrendered",+ delay: 1000,});- return;++ if (!this._pendingDispatchEvent) {+ return; // There was already another `_dispatchEvent`-call`.+ }}+ this._pendingDispatchEvent = false;this.eventBus.dispatch("attachmentsloaded", {source: this,@@ -129,9 +127,9 @@ class PDFAttachmentViewer extends BaseTreeViewer {this._bindLink(element, { content, filename });element.textContent = this._normalizeTextContent(filename);- div.appendChild(element);+ div.append(element);- fragment.appendChild(div);+ fragment.append(div);attachmentsCount++;}@@ -140,27 +138,22 @@ class PDFAttachmentViewer extends BaseTreeViewer {/*** Used to append FileAttachment annotations to the sidebar.- * @private*/- _appendAttachment({ id, filename, content }) {+ #appendAttachment({ filename, content }) {const renderedPromise = this._renderedCapability.promise;renderedPromise.then(() => {if (renderedPromise !== this._renderedCapability.promise) {return; // The FileAttachment annotation belongs to a previous document.}- let attachments = this._attachments;-- if (!attachments) {- attachments = Object.create(null);- } else {- for (const name in attachments) {- if (id === name) {- return; // Ignore the new attachment if it already exists.- }+ const attachments = this._attachments || Object.create(null);++ for (const name in attachments) {+ if (filename === name) {+ return; // Ignore the new attachment if it already exists.}}- attachments[id] = {+ attachments[filename] = {filename,content,};diff --git a/app/src/asset/pdf/pdf_cursor_tools.js b/app/src/asset/pdf/pdf_cursor_tools.jsindex b2a2ab2baf..b500bb5b43 100644--- a/app/src/asset/pdf/pdf_cursor_tools.js+++ b/app/src/asset/pdf/pdf_cursor_tools.js@@ -13,6 +13,7 @@* limitations under the License.*/+import { AnnotationEditorType } from "./pdfjs";import { GrabToPan } from "./grab_to_pan.js";import { PresentationModeState } from "./ui_utils.js";@@ -40,7 +41,7 @@ class PDFCursorTools {this.eventBus = eventBus;this.active = CursorTool.SELECT;- this.activeBeforePresentationMode = null;+ this.previouslyActive = null;this.handTool = new GrabToPan({element: this.container,@@ -63,13 +64,13 @@ class PDFCursorTools {}/**- * NOTE: This method is ignored while Presentation Mode is active.* @param {number} tool - The cursor mode that should be switched to,* must be one of the values in {CursorTool}.*/switchTool(tool) {- if (this.activeBeforePresentationMode !== null) {- return; // Cursor tools cannot be used in Presentation Mode.+ if (this.previouslyActive !== null) {+ // Cursor tools cannot be used in PresentationMode/AnnotationEditor.+ return;}if (tool === this.active) {return; // The requested tool is already active.@@ -121,22 +122,54 @@ class PDFCursorTools {this.switchTool(evt.tool);});- this.eventBus._on("presentationmodechanged", evt => {- switch (evt.state) {- case PresentationModeState.FULLSCREEN: {- const previouslyActive = this.active;+ let annotationEditorMode = AnnotationEditorType.NONE,+ presentationModeState = PresentationModeState.NORMAL;- this.switchTool(CursorTool.SELECT);- this.activeBeforePresentationMode = previouslyActive;- break;- }- case PresentationModeState.NORMAL: {- const previouslyActive = this.activeBeforePresentationMode;+ const disableActive = () => {+ const previouslyActive = this.active;- this.activeBeforePresentationMode = null;- this.switchTool(previouslyActive);- break;- }+ this.switchTool(CursorTool.SELECT);+ this.previouslyActive ??= previouslyActive; // Keep track of the first one.+ };+ const enableActive = () => {+ const previouslyActive = this.previouslyActive;++ if (+ previouslyActive !== null &&+ annotationEditorMode === AnnotationEditorType.NONE &&+ presentationModeState === PresentationModeState.NORMAL+ ) {+ this.previouslyActive = null;+ this.switchTool(previouslyActive);+ }+ };++ this.eventBus._on("secondarytoolbarreset", evt => {+ if (this.previouslyActive !== null) {+ annotationEditorMode = AnnotationEditorType.NONE;+ presentationModeState = PresentationModeState.NORMAL;++ enableActive();+ }+ });++ this.eventBus._on("annotationeditormodechanged", ({ mode }) => {+ annotationEditorMode = mode;++ if (mode === AnnotationEditorType.NONE) {+ enableActive();+ } else {+ disableActive();+ }+ });++ this.eventBus._on("presentationmodechanged", ({ state }) => {+ presentationModeState = state;++ if (state === PresentationModeState.NORMAL) {+ enableActive();+ } else if (state === PresentationModeState.FULLSCREEN) {+ disableActive();}});}diff --git a/app/src/asset/pdf/pdf_document_properties.js b/app/src/asset/pdf/pdf_document_properties.jsindex 36a9610ab2..de356d10e4 100644--- a/app/src/asset/pdf/pdf_document_properties.js+++ b/app/src/asset/pdf/pdf_document_properties.js@@ -13,11 +13,7 @@* limitations under the License.*/-import {- createPromiseCapability,- getPdfFilenameFromUrl,- PDFDateString,-} from "./pdfjs";+import { createPromiseCapability, PDFDateString } from "./pdfjs";import { getPageSizeInches, isPortraitOrientation } from "./ui_utils.js";const DEFAULT_FIELD_CONTENT = "-";@@ -45,9 +41,8 @@ function getPageName(size, isPortrait, pageNames) {/*** @typedef {Object} PDFDocumentPropertiesOptions- * @property {string} overlayName - Name/identifier for the overlay.+ * @property {HTMLDialogElement} dialog - The overlay's DOM element.* @property {Object} fields - Names and elements of the overlay's fields.- * @property {HTMLDivElement} container - Div container for the overlay.* @property {HTMLButtonElement} closeButton - Button for closing the overlay.*/@@ -59,28 +54,27 @@ class PDFDocumentProperties {* @param {OverlayManager} overlayManager - Manager for the viewer overlays.* @param {EventBus} eventBus - The application event bus.* @param {IL10n} l10n - Localization service.+ * @param {function} fileNameLookup - The function that is used to lookup+ * the document fileName.*/constructor(- { overlayName, fields, container, closeButton },+ { dialog, fields, closeButton },overlayManager,eventBus,- l10n+ l10n,+ fileNameLookup) {- this.overlayName = overlayName;+ this.dialog = dialog;this.fields = fields;- this.container = container;this.overlayManager = overlayManager;this.l10n = l10n;+ this._fileNameLookup = fileNameLookup;this.#reset();// Bind the event listener for the Close button.closeButton.addEventListener("click", this.close.bind(this));- this.overlayManager.register(- this.overlayName,- this.container,- this.close.bind(this)- );+ this.overlayManager.register(this.dialog);eventBus._on("pagechanging", evt => {this._currentPageNumber = evt.pageNumber;@@ -90,6 +84,10 @@ class PDFDocumentProperties {});this._isNonMetricLocale = true; // The default viewer locale is 'en-us'.+ // NOTE+ // l10n.getLanguage().then(locale => {+ // this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale);+ // });}/**@@ -97,7 +95,7 @@ class PDFDocumentProperties {*/async open() {await Promise.all([- this.overlayManager.open(this.overlayName),+ this.overlayManager.open(this.dialog),this._dataAvailableCapability.promise,]);const currentPageNumber = this._currentPageNumber;@@ -118,7 +116,7 @@ class PDFDocumentProperties {const {info,/* metadata, */- contentDispositionFilename,+ /* contentDispositionFilename, */contentLength,} = await this.pdfDocument.getMetadata();@@ -130,7 +128,7 @@ class PDFDocumentProperties {pageSize,isLinearized,] = await Promise.all([- contentDispositionFilename || getPdfFilenameFromUrl(this.url),+ this._fileNameLookup(),this.#parseFileSize(contentLength),this.#parseDate(info.CreationDate),this.#parseDate(info.ModDate),@@ -176,20 +174,18 @@ class PDFDocumentProperties {/*** Close the document properties overlay.*/- close() {- this.overlayManager.close(this.overlayName);+ async close() {+ this.overlayManager.close(this.dialog);}/**- * Set a reference to the PDF document and the URL in order- * to populate the overlay fields with the document properties.- * Note that the overlay will contain no information if this method- * is not called.+ * Set a reference to the PDF document in order to populate the dialog fields+ * with the document properties. Note that the dialog will contain no+ * information if this method is not called.** @param {PDFDocumentProxy} pdfDocument - A reference to the PDF document.- * @param {string} url - The URL of the document.*/- setDocument(pdfDocument, url = null) {+ setDocument(pdfDocument) {if (this.pdfDocument) {this.#reset();this.#updateUI(true);@@ -198,14 +194,12 @@ class PDFDocumentProperties {return;}this.pdfDocument = pdfDocument;- this.url = url;this._dataAvailableCapability.resolve();}#reset() {this.pdfDocument = null;- this.url = null;this.#fieldData = null;this._dataAvailableCapability = createPromiseCapability();@@ -225,7 +219,7 @@ class PDFDocumentProperties {}return;}- if (this.overlayManager.active !== this.overlayName) {+ if (this.overlayManager.active !== this.dialog) {// Don't bother updating the dialog if has already been closed,// since it will be updated the next time `this.open` is called.return;@@ -243,6 +237,7 @@ class PDFDocumentProperties {if (!kb) {return undefined;}+ // NOTEif (mb >= 1) {return `${mb >= 1 && (+mb.toPrecision(3)).toLocaleString()} MB ${fileSize.toLocaleString()} bytes)`@@ -315,6 +310,7 @@ class PDFDocumentProperties {}}+ // NOTEconst [{ width, height }, unit, name, orientation] = await Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters,this._isNonMetricLocale@@ -337,10 +333,12 @@ class PDFDocumentProperties {if (!dateObject) {return undefined;}+ // NOTEreturn `${dateObject.toLocaleDateString()}, ${dateObject.toLocaleTimeString()}`}#parseLinearization(isLinearized) {+ // NOTEreturn isLinearized ? 'Yes' : 'No'}}diff --git a/app/src/asset/pdf/pdf_find_bar.js b/app/src/asset/pdf/pdf_find_bar.jsindex 8056450c87..c9f1fee915 100644--- a/app/src/asset/pdf/pdf_find_bar.js+++ b/app/src/asset/pdf/pdf_find_bar.js@@ -13,9 +13,9 @@* limitations under the License.*/-import { FindState } from './pdf_find_controller.js'+import { FindState } from "./pdf_find_controller.js";-const MATCHES_COUNT_LIMIT = 1000+const MATCHES_COUNT_LIMIT = 1000;/*** Creates a "search bar" given a set of DOM elements that act as controls@@ -24,99 +24,102 @@ const MATCHES_COUNT_LIMIT = 1000* is done by PDFFindController.*/class PDFFindBar {- constructor (options, eventBus, l10n) {- this.opened = false-- this.bar = options.bar- this.toggleButton = options.toggleButton- this.findField = options.findField- this.highlightAll = options.highlightAllCheckbox- this.caseSensitive = options.caseSensitiveCheckbox- this.matchDiacritics = options.matchDiacriticsCheckbox- this.entireWord = options.entireWordCheckbox- this.findMsg = options.findMsg- this.findResultsCount = options.findResultsCount- this.findPreviousButton = options.findPreviousButton- this.findNextButton = options.findNextButton- this.eventBus = eventBus- this.l10n = l10n+ constructor(options, eventBus, l10n) {+ this.opened = false;++ this.bar = options.bar;+ this.toggleButton = options.toggleButton;+ this.findField = options.findField;+ this.highlightAll = options.highlightAllCheckbox;+ this.caseSensitive = options.caseSensitiveCheckbox;+ this.matchDiacritics = options.matchDiacriticsCheckbox;+ this.entireWord = options.entireWordCheckbox;+ this.findMsg = options.findMsg;+ this.findResultsCount = options.findResultsCount;+ this.findPreviousButton = options.findPreviousButton;+ this.findNextButton = options.findNextButton;+ this.eventBus = eventBus;+ this.l10n = l10n;// Add event listeners to the DOM elements.- this.toggleButton.addEventListener('click', () => {- this.toggle()- })+ this.toggleButton.addEventListener("click", () => {+ this.toggle();+ });- this.findField.addEventListener('input', () => {- this.dispatchEvent('')- })+ this.findField.addEventListener("input", () => {+ this.dispatchEvent("");+ });- this.bar.addEventListener('keydown', e => {+ this.bar.addEventListener("keydown", e => {switch (e.keyCode) {case 13: // Enterif (e.target === this.findField) {- this.dispatchEvent('again', e.shiftKey)+ this.dispatchEvent("again", e.shiftKey);}- break+ break;case 27: // Escape- this.close()- break+ this.close();+ break;}- })+ });- this.findPreviousButton.addEventListener('click', () => {- this.dispatchEvent('again', true)- })+ this.findPreviousButton.addEventListener("click", () => {+ this.dispatchEvent("again", true);+ });- this.findNextButton.addEventListener('click', () => {- this.dispatchEvent('again', false)- })+ this.findNextButton.addEventListener("click", () => {+ this.dispatchEvent("again", false);+ });- this.highlightAll.addEventListener('click', () => {- this.dispatchEvent('highlightallchange')- // NOTE: 以下三个相同 https://github.com/siyuan-note/siyuan/issues/5338+ this.highlightAll.addEventListener("click", () => {+ this.dispatchEvent("highlightallchange");+ // NOTEif (this.highlightAll.checked) {this.highlightAll.parentElement.classList.remove("b3-button--outline")} else {this.highlightAll.parentElement.classList.add("b3-button--outline")}- })+ });- this.caseSensitive.addEventListener('click', () => {- this.dispatchEvent('casesensitivitychange')+ this.caseSensitive.addEventListener("click", () => {+ this.dispatchEvent("casesensitivitychange");+ // NOTEif (this.caseSensitive.checked) {this.caseSensitive.parentElement.classList.remove("b3-button--outline")} else {this.caseSensitive.parentElement.classList.add("b3-button--outline")}- })+ });- this.entireWord.addEventListener('click', () => {- this.dispatchEvent('entirewordchange')+ this.entireWord.addEventListener("click", () => {+ this.dispatchEvent("entirewordchange");+ // NOTEif (this.entireWord.checked) {this.entireWord.parentElement.classList.remove("b3-button--outline")} else {this.entireWord.parentElement.classList.add("b3-button--outline")}- })+ });- this.matchDiacritics.addEventListener('click', () => {- this.dispatchEvent('diacriticmatchingchange')+ this.matchDiacritics.addEventListener("click", () => {+ this.dispatchEvent("diacriticmatchingchange");+ // NOTEif (this.matchDiacritics.checked) {this.matchDiacritics.parentElement.classList.remove("b3-button--outline")} else {this.matchDiacritics.parentElement.classList.add("b3-button--outline")}- })+ });- this.eventBus._on('resize', this.#adjustWidth.bind(this))+ this.eventBus._on("resize", this.#adjustWidth.bind(this));}- reset () {- this.updateUIState()+ reset() {+ this.updateUIState();}- dispatchEvent (type, findPrev = false) {- this.eventBus.dispatch('find', {+ dispatchEvent(type, findPrev = false) {+ this.eventBus.dispatch("find", {source: this,type,query: this.findField.value,@@ -126,108 +129,115 @@ class PDFFindBar {highlightAll: this.highlightAll.checked,findPrevious: findPrev,matchDiacritics: this.matchDiacritics.checked,- })+ });}- updateUIState (state, previous, matchesCount) {- let findMsg = ''- let status = ''+ updateUIState(state, previous, matchesCount) {+ // NOTE+ let findMsg = "";+ let status = "";switch (state) {case FindState.FOUND:- break+ break;case FindState.PENDING:- status = 'pending'- break+ status = "pending";+ break;case FindState.NOT_FOUND:+ // NOTEfindMsg = window.siyuan.languages.find_not_found- status = 'notFound'- break+ status = "notFound";+ break;case FindState.WRAPPED:findMsg = window.siyuan.languages.find_not_found[`find_reached_${previous? 'top': 'bottom'}`]- break+ break;}- this.findField.setAttribute('data-status', status)+ this.findField.setAttribute("data-status", status);+ this.findField.setAttribute("aria-invalid", state === FindState.NOT_FOUND);+ // NOTEthis.findMsg.textContent = findMsgthis.#adjustWidth()- this.updateResultsCount(matchesCount)+ this.updateResultsCount(matchesCount);}- updateResultsCount ({current = 0, total = 0} = {}) {- const limit = MATCHES_COUNT_LIMIT- let msg = ''+ updateResultsCount({ current = 0, total = 0 } = {}) {+ const limit = MATCHES_COUNT_LIMIT;+ // // NOTE+ let matchCountMsg = "";if (total > 0) {if (total > limit) {- msg = window.siyuan.languages.find_match_count_limit.replace(+ matchCountMsg = window.siyuan.languages.find_match_count_limit.replace('{{limit}}', limit)} else {- msg = window.siyuan.languages.find_match_count.replace('{{current}}',+ matchCountMsg = window.siyuan.languages.find_match_count.replace('{{current}}',current).replace('{{total}}', total)}}- this.findResultsCount.textContent = msg- this.findResultsCount.classList.toggle('fn__hidden', !total)++ this.findResultsCount.textContent = matchCountMsgthis.#adjustWidth()}- open () {+ open() {if (!this.opened) {- this.opened = true- this.toggleButton.classList.add('toggled')- this.toggleButton.setAttribute('aria-expanded', 'true')- this.bar.classList.remove('fn__hidden')+ this.opened = true;+ this.toggleButton.classList.add("toggled");+ this.toggleButton.setAttribute("aria-expanded", "true");+ // NOTE+ this.bar.classList.remove("fn__hidden");}- this.findField.select()- this.findField.focus()+ this.findField.select();+ this.findField.focus();- this.#adjustWidth()+ this.#adjustWidth();}- close () {+ close() {if (!this.opened) {- return+ return;}- this.opened = false- this.toggleButton.classList.remove('toggled')- this.toggleButton.setAttribute('aria-expanded', 'false')- this.bar.classList.add('fn__hidden')+ this.opened = false;+ this.toggleButton.classList.remove("toggled");+ this.toggleButton.setAttribute("aria-expanded", "false");+ // NOTE+ this.bar.classList.add("fn__hidden");- this.eventBus.dispatch('findbarclose', {source: this})+ this.eventBus.dispatch("findbarclose", { source: this });}- toggle () {+ toggle() {if (this.opened) {- this.close()+ this.close();} else {- this.open()+ this.open();}}- #adjustWidth () {+ #adjustWidth() {if (!this.opened) {- return+ return;}// The find bar has an absolute position and thus the browser extends// its width to the maximum possible width once the find bar does not fit// entirely within the window anymore (and its elements are automatically// wrapped). Here we detect and fix that.- this.bar.classList.remove('wrapContainers')+ this.bar.classList.remove("wrapContainers");- const findbarHeight = this.bar.clientHeight- const inputContainerHeight = this.bar.firstElementChild.clientHeight+ const findbarHeight = this.bar.clientHeight;+ const inputContainerHeight = this.bar.firstElementChild.clientHeight;if (findbarHeight > inputContainerHeight) {// The findbar is taller than the input container, which means that// the browser wrapped some of the elements. For a consistent look,// wrap all of them to adjust the width of the find bar.- this.bar.classList.add('wrapContainers')+ this.bar.classList.add("wrapContainers");}}}-export { PDFFindBar }+export { PDFFindBar };diff --git a/app/src/asset/pdf/pdf_find_controller.js b/app/src/asset/pdf/pdf_find_controller.jsindex ad52049372..b5309deb4c 100644--- a/app/src/asset/pdf/pdf_find_controller.js+++ b/app/src/asset/pdf/pdf_find_controller.js@@ -13,6 +13,10 @@* limitations under the License.*/+/** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+import { binarySearchFirstItem, scrollIntoView } from "./ui_utils.js";import { createPromiseCapability } from "./pdfjs";import { getCharacterType } from "./pdf_find_utils.js";@@ -82,19 +86,62 @@ const SPECIAL_CHARS_REG_EXP =const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;-let normalizationRegex = null;+// The range [AC00-D7AF] corresponds to the Hangul syllables.+// The few other chars are some CJK Compatibility Ideographs.+const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g;+const SYLLABLES_LENGTHS = new Map();+// When decomposed (in using NFD) the above syllables will start+// with one of the chars in this regexp.+const FIRST_CHAR_SYLLABLES_REG_EXP =+ "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]";++let noSyllablesRegExp = null;+let withSyllablesRegExp = null;+function normalize(text) {// The diacritics in the text or in the query can be composed or not.// So we use a decomposed text using NFD (and the same for the query)// in order to be sure that diacritics are in the same order.- if (!normalizationRegex) {+ // Collect syllables length and positions.+ const syllablePositions = [];+ let m;+ while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {+ let { index } = m;+ for (const char of m[0]) {+ let len = SYLLABLES_LENGTHS.get(char);+ if (!len) {+ len = char.normalize("NFD").length;+ SYLLABLES_LENGTHS.set(char, len);+ }+ syllablePositions.push([len, index++]);+ }+ }++ let normalizationRegex;+ if (syllablePositions.length === 0 && noSyllablesRegExp) {+ normalizationRegex = noSyllablesRegExp;+ } else if (syllablePositions.length > 0 && withSyllablesRegExp) {+ normalizationRegex = withSyllablesRegExp;+ } else {// Compile the regular expression for text normalization once.const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");- normalizationRegex = new RegExp(- `([${replace}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\n)`,- "gum"- );+ const regexp = `([${replace}])|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(\\p{Ideographic}\\n)|(\\n)`;++ if (syllablePositions.length === 0) {+ // Most of the syllables belong to Hangul so there are no need+ // to search for them in a non-Hangul document.+ // We use the \0 in order to have the same number of groups.+ normalizationRegex = noSyllablesRegExp = new RegExp(+ regexp + "|(\\u0000)",+ "gum"+ );+ } else {+ normalizationRegex = withSyllablesRegExp = new RegExp(+ regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`,+ "gum"+ );+ }}// The goal of this function is to normalize the string and@@ -126,14 +173,14 @@ function normalize(text) {// Collect diacritics length and positions.const rawDiacriticsPositions = [];- let m;while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {rawDiacriticsPositions.push([m[0].length, m.index]);}let normalized = text.normalize("NFD");const positions = [[0, 0]];- let k = 0;+ let rawDiacriticsIndex = 0;+ let syllableIndex = 0;let shift = 0;let shiftOrigin = 0;let eol = 0;@@ -141,7 +188,7 @@ function normalize(text) {normalized = normalized.replace(normalizationRegex,- (match, p1, p2, p3, p4, i) => {+ (match, p1, p2, p3, p4, p5, p6, i) => {i -= shiftOrigin;if (p1) {// Maybe fractions or quotations mark...@@ -161,12 +208,12 @@ function normalize(text) {// Diacritics.hasDiacritics = true;let jj = len;- if (i + eol === rawDiacriticsPositions[k]?.[1]) {- jj -= rawDiacriticsPositions[k][0];- ++k;+ if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {+ jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];+ ++rawDiacriticsIndex;}- for (let j = 1; j < jj + 1; j++) {+ for (let j = 1; j <= jj; j++) {// i is the position of the first diacritic// so (i - 1) is the position for the letter before.positions.push([i - 1 - shift + j, shift - j]);@@ -200,14 +247,38 @@ function normalize(text) {return p3.charAt(0);}- // p4- // eol is replaced by space: "foo\nbar" is likely equivalent to- // "foo bar".- positions.push([i - shift + 1, shift - 1]);- shift -= 1;- shiftOrigin += 1;- eol += 1;- return " ";+ if (p4) {+ // An ideographic at the end of a line doesn't imply adding an extra+ // white space.+ positions.push([i - shift + 1, shift]);+ shiftOrigin += 1;+ eol += 1;+ return p4.charAt(0);+ }++ if (p5) {+ // eol is replaced by space: "foo\nbar" is likely equivalent to+ // "foo bar".+ positions.push([i - shift + 1, shift - 1]);+ shift -= 1;+ shiftOrigin += 1;+ eol += 1;+ return " ";+ }++ // p6+ if (i + eol === syllablePositions[syllableIndex]?.[1]) {+ // A syllable (1 char) is replaced with several chars (n) so+ // newCharsLen = n - 1.+ const newCharLen = syllablePositions[syllableIndex][0] - 1;+ ++syllableIndex;+ for (let j = 1; j <= newCharLen; j++) {+ positions.push([i - (shift - j), shift - j]);+ }+ shift -= newCharLen;+ shiftOrigin += newCharLen;+ }+ return p6;});diff --git a/app/src/asset/pdf/pdf_history.js b/app/src/asset/pdf/pdf_history.jsindex 9a28428ed7..b7dec87af8 100644--- a/app/src/asset/pdf/pdf_history.js+++ b/app/src/asset/pdf/pdf_history.js@@ -13,11 +13,10 @@* limitations under the License.*/-import {- isValidRotation,- parseQueryString,- PresentationModeState,-} from "./ui_utils.js";+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */++import { isValidRotation, parseQueryString } from "./ui_utils.js";import { waitOnEventOrTimeout } from "./event_utils.js";// Heuristic value used when force-resetting `this._blockHashChange`.@@ -66,13 +65,8 @@ class PDFHistory {this.reset();this._boundEvents = null;- this._isViewerInPresentationMode = false;- // Ensure that we don't miss either a 'presentationmodechanged' or a- // 'pagesinit' event, by registering the listeners immediately.- this.eventBus._on("presentationmodechanged", evt => {- this._isViewerInPresentationMode =- evt.state !== PresentationModeState.NORMAL;- });+ // Ensure that we don't miss a "pagesinit" event,+ // by registering the listener immediately.this.eventBus._on("pagesinit", () => {this._isPagesLoaded = false;@@ -196,13 +190,13 @@ class PDFHistory {if (namedDest && typeof namedDest !== "string") {console.error("PDFHistory.push: " +- `"${namedDest}" is not a valid namedDest parameter.`+ `"${namedDest}" is not a valid namedDest parameter.`);return;} else if (!Array.isArray(explicitDest)) {console.error("PDFHistory.push: " +- `"${explicitDest}" is not a valid explicitDest parameter.`+ `"${explicitDest}" is not a valid explicitDest parameter.`);return;} else if (!this._isValidPage(pageNumber)) {@@ -211,7 +205,7 @@ class PDFHistory {if (pageNumber !== null || this._destination) {console.error("PDFHistory.push: " +- `"${pageNumber}" is not a valid pageNumber parameter.`+ `"${pageNumber}" is not a valid pageNumber parameter.`);return;}@@ -563,9 +557,7 @@ class PDFHistory {}this._position = {- hash: this._isViewerInPresentationMode- ? `page=${location.pageNumber}`- : location.pdfOpenParams.substring(1),+ hash: location.pdfOpenParams.substring(1),page: this.linkService.page,first: location.pageNumber,rotation: location.rotation,diff --git a/app/src/asset/pdf/pdf_layer_viewer.js b/app/src/asset/pdf/pdf_layer_viewer.jsindex 5aa87a2269..b330194948 100644--- a/app/src/asset/pdf/pdf_layer_viewer.js+++ b/app/src/asset/pdf/pdf_layer_viewer.js@@ -34,13 +34,19 @@ class PDFLayerViewer extends BaseTreeViewer {super(options);this.l10n = options.l10n;- this.eventBus._on("resetlayers", this._resetLayers.bind(this));+ this.eventBus._on("optionalcontentconfigchanged", evt => {+ this.#updateLayers(evt.promise);+ });+ this.eventBus._on("resetlayers", () => {+ this.#updateLayers();+ });this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this));}reset() {super.reset();this._optionalContentConfig = null;+ this._optionalContentHash = null;}/**@@ -59,6 +65,7 @@ class PDFLayerViewer extends BaseTreeViewer {_bindLink(element, { groupId, input }) {const setVisibility = () => {this._optionalContentConfig.setVisibility(groupId, input.checked);+ this._optionalContentHash = this._optionalContentConfig.getHash();this.eventBus.dispatch("optionalcontentconfig", {source: this,@@ -87,8 +94,9 @@ class PDFLayerViewer extends BaseTreeViewer {element.textContent = this._normalizeTextContent(name);return;}+ // NOTEelement.textContent = window.siyuan.languages.additionalLayers- element.style.fontStyle = 'italic'+ element.style.fontStyle = "italic";}/**@@ -123,6 +131,7 @@ class PDFLayerViewer extends BaseTreeViewer {this._dispatchEvent(/* layersCount = */ 0);return;}+ this._optionalContentHash = optionalContentConfig.getHash();const fragment = document.createDocumentFragment(),queue = [{ parent: fragment, groups }];@@ -135,7 +144,7 @@ class PDFLayerViewer extends BaseTreeViewer {div.className = "treeItem";const element = document.createElement("a");- div.appendChild(element);+ div.append(element);if (typeof groupId === "object") {hasAnyNesting = true;@@ -144,7 +153,7 @@ class PDFLayerViewer extends BaseTreeViewer {const itemsDiv = document.createElement("div");itemsDiv.className = "treeItems";- div.appendChild(itemsDiv);+ div.append(itemsDiv);queue.push({ parent: itemsDiv, groups: groupId.order });} else {@@ -153,43 +162,46 @@ class PDFLayerViewer extends BaseTreeViewer {const input = document.createElement("input");this._bindLink(element, { groupId, input });input.type = "checkbox";- input.id = groupId;input.checked = group.visible;const label = document.createElement("label");- label.setAttribute("for", groupId);label.textContent = this._normalizeTextContent(group.name);- element.appendChild(input);- element.appendChild(label);-+ label.append(input);+ element.append(label);layersCount++;}- levelData.parent.appendChild(div);+ levelData.parent.append(div);}}this._finishRendering(fragment, layersCount, hasAnyNesting);}- /**- * @private- */- async _resetLayers() {+ async #updateLayers(promise = null) {if (!this._optionalContentConfig) {return;}- // Fetch the default optional content configuration...- const optionalContentConfig =- await this._pdfDocument.getOptionalContentConfig();+ const pdfDocument = this._pdfDocument;+ const optionalContentConfig = await (promise ||+ pdfDocument.getOptionalContentConfig());- this.eventBus.dispatch("optionalcontentconfig", {- source: this,- promise: Promise.resolve(optionalContentConfig),- });+ if (pdfDocument !== this._pdfDocument) {+ return; // The document was closed while the optional content resolved.+ }+ if (promise) {+ if (optionalContentConfig.getHash() === this._optionalContentHash) {+ return; // The optional content didn't change, hence no need to reset the UI.+ }+ } else {+ this.eventBus.dispatch("optionalcontentconfig", {+ source: this,+ promise: Promise.resolve(optionalContentConfig),+ });+ }- // ... and reset the sidebarView to the default state.+ // Reset the sidebarView to the new state.this.render({optionalContentConfig,pdfDocument: this._pdfDocument,diff --git a/app/src/asset/pdf/pdf_link_service.js b/app/src/asset/pdf/pdf_link_service.jsindex b9ba695d91..52cba0ec25 100644--- a/app/src/asset/pdf/pdf_link_service.js+++ b/app/src/asset/pdf/pdf_link_service.js@@ -13,6 +13,9 @@* limitations under the License.*/+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+import { parseQueryString, removeNullCharacters } from "./ui_utils.js";const DEFAULT_LINK_REL = "noopener noreferrer nofollow";@@ -104,11 +107,11 @@ class PDFLinkService {* @param {PDFLinkServiceOptions} options*/constructor({- eventBus,- externalLinkTarget = null,- externalLinkRel = null,- ignoreDestinationZoom = false,- } = {}) {+ eventBus,+ externalLinkTarget = null,+ externalLinkRel = null,+ ignoreDestinationZoom = false,+ } = {}) {this.eventBus = eventBus;this.externalLinkTarget = externalLinkTarget;this.externalLinkRel = externalLinkRel;@@ -182,17 +185,17 @@ class PDFLinkService {// Fetch the page reference if it's not yet available. This could// only occur during loading, before all pages have been resolved.this.pdfDocument- .getPageIndex(destRef)- .then(pageIndex => {- this.cachePageRef(pageIndex + 1, destRef);- this.#goToDestinationHelper(rawDest, namedDest, explicitDest);- })- .catch(() => {- console.error(- `PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` +- `a valid page reference, for dest="${rawDest}".`- );- });+ .getPageIndex(destRef)+ .then(pageIndex => {+ this.cachePageRef(pageIndex + 1, destRef);+ this.#goToDestinationHelper(rawDest, namedDest, explicitDest);+ })+ .catch(() => {+ console.error(+ `PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` ++ `a valid page reference, for dest="${rawDest}".`+ );+ });return;}} else if (Number.isInteger(destRef)) {@@ -200,14 +203,14 @@ class PDFLinkService {} else {console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` +- `a valid destination reference, for dest="${rawDest}".`+ `a valid destination reference, for dest="${rawDest}".`);return;}if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {console.error(`PDFLinkService.#goToDestinationHelper: "${pageNumber}" is not ` +- `a valid page number, for dest="${rawDest}".`+ `a valid page number, for dest="${rawDest}".`);return;}@@ -246,7 +249,7 @@ class PDFLinkService {if (!Array.isArray(explicitDest)) {console.error(`PDFLinkService.goToDestination: "${explicitDest}" is not ` +- `a valid destination array, for dest="${dest}".`+ `a valid destination array, for dest="${dest}".`);return;}@@ -490,6 +493,48 @@ class PDFLinkService {});}+ /**+ * @param {Object} action+ */+ async executeSetOCGState(action) {+ const pdfDocument = this.pdfDocument;+ const optionalContentConfig = await this.pdfViewer+ .optionalContentConfigPromise;++ if (pdfDocument !== this.pdfDocument) {+ return; // The document was closed while the optional content resolved.+ }+ let operator;++ for (const elem of action.state) {+ switch (elem) {+ case "ON":+ case "OFF":+ case "Toggle":+ operator = elem;+ continue;+ }+ switch (operator) {+ case "ON":+ optionalContentConfig.setVisibility(elem, true);+ break;+ case "OFF":+ optionalContentConfig.setVisibility(elem, false);+ break;+ case "Toggle":+ const group = optionalContentConfig.getGroup(elem);+ if (group) {+ optionalContentConfig.setVisibility(elem, !group.visible);+ }+ break;+ }+ }++ this.pdfViewer.optionalContentConfigPromise = Promise.resolve(+ optionalContentConfig+ );+ }+/*** @param {number} pageNum - page number.* @param {Object} pageRef - reference to the page.@@ -673,6 +718,11 @@ class SimpleLinkService {*/executeNamedAction(action) {}+ /**+ * @param {Object} action+ */+ executeSetOCGState(action) {}+/*** @param {number} pageNum - page number.* @param {Object} pageRef - reference to the page.diff --git a/app/src/asset/pdf/pdf_outline_viewer.js b/app/src/asset/pdf/pdf_outline_viewer.jsindex cce8aa72cd..fcfcb28dab 100644--- a/app/src/asset/pdf/pdf_outline_viewer.js+++ b/app/src/asset/pdf/pdf_outline_viewer.js@@ -109,13 +109,29 @@ class PDFOutlineViewer extends BaseTreeViewer {/*** @private*/- _bindLink(element, { url, newWindow, dest }) {+ _bindLink(element, { url, newWindow, action, dest, setOCGState }) {const { linkService } = this;if (url) {linkService.addLinkAttributes(element, url, newWindow);return;}+ if (action) {+ element.href = linkService.getAnchorUrl("");+ element.onclick = () => {+ linkService.executeNamedAction(action);+ return false;+ };+ return;+ }+ if (setOCGState) {+ element.href = linkService.getAnchorUrl("");+ element.onclick = () => {+ linkService.executeSetOCGState(setOCGState);+ return false;+ };+ return;+ }element.href = linkService.getDestinationHash(dest);element.onclick = evt => {@@ -204,7 +220,7 @@ class PDFOutlineViewer extends BaseTreeViewer {this._setStyles(element, item);element.textContent = this._normalizeTextContent(item.title);- div.appendChild(element);+ div.append(element);if (item.items.length > 0) {hasAnyNesting = true;@@ -212,12 +228,12 @@ class PDFOutlineViewer extends BaseTreeViewer {const itemsDiv = document.createElement("div");itemsDiv.className = "treeItems";- div.appendChild(itemsDiv);+ div.append(itemsDiv);queue.push({ parent: itemsDiv, items: item.items });}- levelData.parent.appendChild(div);+ levelData.parent.append(div);outlineCount++;}}diff --git a/app/src/asset/pdf/pdf_page_view.js b/app/src/asset/pdf/pdf_page_view.jsindex e2539b303e..17cb7a9498 100644--- a/app/src/asset/pdf/pdf_page_view.js+++ b/app/src/asset/pdf/pdf_page_view.js@@ -13,6 +13,25 @@* limitations under the License.*/+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/optional_content_config").OptionalContentConfig} OptionalContentConfig */+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./interfaces").IL10n} IL10n */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFAnnotationLayerFactory} IPDFAnnotationLayerFactory */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFAnnotationEditorLayerFactory} IPDFAnnotationEditorLayerFactory */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFStructTreeLayerFactory} IPDFStructTreeLayerFactory */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFTextLayerFactory} IPDFTextLayerFactory */+/** @typedef {import("./interfaces").IPDFXfaLayerFactory} IPDFXfaLayerFactory */+/** @typedef {import("./interfaces").IRenderableView} IRenderableView */+// eslint-disable-next-line max-len+/** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */+import {AnnotationMode,createPromiseCapability,@@ -23,6 +42,7 @@ import {import {approximateFraction,DEFAULT_SCALE,+ docStyle,OutputScale,RendererType,RenderingStates,@@ -31,41 +51,44 @@ import {} from "./ui_utils.js";import { compatibilityParams } from "./app_options.js";import { NullL10n } from "./l10n_utils.js";+import { TextAccessibilityManager } from "./text_accessibility.js";/*** @typedef {Object} PDFPageViewOptions* @property {HTMLDivElement} [container] - The viewer element.* @property {EventBus} eventBus - The application event bus.* @property {number} id - The page unique ID (normally its number).- * @property {number} scale - The page scale display.+ * @property {number} [scale] - The page scale display.* @property {PageViewport} defaultViewport - The page viewport.* @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -* A promise that is resolved with an {@link OptionalContentConfig} instance.* The default value is `null`.- * @property {PDFRenderingQueue} renderingQueue - The rendering queue object.- * @property {IPDFTextLayerFactory} textLayerFactory+ * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.+ * @property {IPDFTextLayerFactory} [textLayerFactory]* @property {number} [textLayerMode] - Controls if the text layer used for- * selection and searching is created, and if the improved text selection- * behaviour is enabled. The constants from {TextLayerMode} should be used.- * The default value is `TextLayerMode.ENABLE`.+ * selection and searching is created. The constants from {TextLayerMode}+ * should be used. The default value is `TextLayerMode.ENABLE`.* @property {number} [annotationMode] - Controls if the annotation layer is* created, and if interactive form elements or `AnnotationStorage`-data are* being rendered. The constants from {@link AnnotationMode} should be used;* see also {@link RenderParameters} and {@link GetOperatorListParameters}.* The default value is `AnnotationMode.ENABLE_FORMS`.- * @property {IPDFAnnotationLayerFactory} annotationLayerFactory- * @property {IPDFXfaLayerFactory} xfaLayerFactory- * @property {IPDFStructTreeLayerFactory} structTreeLayerFactory+ * @property {IPDFAnnotationLayerFactory} [annotationLayerFactory]+ * @property {IPDFAnnotationEditorLayerFactory} [annotationEditorLayerFactory]+ * @property {IPDFXfaLayerFactory} [xfaLayerFactory]+ * @property {IPDFStructTreeLayerFactory} [structTreeLayerFactory]* @property {Object} [textHighlighterFactory]* @property {string} [imageResourcesPath] - Path for image resources, mainly* for annotation icons. Include trailing slash.- * @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.* @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default* value is `false`.* @property {number} [maxCanvasPixels] - The maximum supported canvas size in* total pixels, i.e. width * height. Use -1 for no limit. The default value* is 4096 * 4096 (16 mega-pixels).- * @property {IL10n} l10n - Localization service.+ * @property {Object} [pageColors] - Overwrites background and foreground colors+ * with user defined ones in order to improve readability in high contrast+ * mode.+ * @property {IL10n} [l10n] - Localization service.*/const MAX_CANVAS_PIXELS = compatibilityParams.maxCanvasPixels || 16777216;@@ -76,6 +99,11 @@ const MAX_CANVAS_PIXELS = compatibilityParams.maxCanvasPixels || 16777216;class PDFPageView {#annotationMode = AnnotationMode.ENABLE_FORMS;+ #useThumbnailCanvas = {+ initialOptionalContent: true,+ regularAnnotations: true,+ };+/*** @param {PDFPageViewOptions} options*/@@ -101,19 +129,26 @@ class PDFPageView {this.imageResourcesPath = options.imageResourcesPath || "";this.useOnlyCssZoom = options.useOnlyCssZoom || false;this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;+ this.pageColors = options.pageColors || null;this.eventBus = options.eventBus;this.renderingQueue = options.renderingQueue;this.textLayerFactory = options.textLayerFactory;this.annotationLayerFactory = options.annotationLayerFactory;+ this.annotationEditorLayerFactory = options.annotationEditorLayerFactory;this.xfaLayerFactory = options.xfaLayerFactory;this.textHighlighter =- options.textHighlighterFactory?.createTextHighlighter(- this.id - 1,- this.eventBus- );+ options.textHighlighterFactory?.createTextHighlighter({+ pageIndex: this.id - 1,+ eventBus: this.eventBus,+ });this.structTreeLayerFactory = options.structTreeLayerFactory;- this.renderer = options.renderer || RendererType.CANVAS;+ if (+ typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")+ ) {+ this.renderer = options.renderer || RendererType.CANVAS;+ }this.l10n = options.l10n || NullL10n;this.paintTask = null;@@ -121,11 +156,17 @@ class PDFPageView {this.renderingState = RenderingStates.INITIAL;this.resume = null;this._renderError = null;- this._isStandalone = !this.renderingQueue?.hasViewer();+ if (+ typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")+ ) {+ this._isStandalone = !this.renderingQueue?.hasViewer();+ }this._annotationCanvasMap = null;this.annotationLayer = null;+ this.annotationEditorLayer = null;this.textLayer = null;this.zoomLayer = null;this.xfaLayer = null;@@ -142,7 +183,28 @@ class PDFPageView {window.siyuan.languages.thumbPageTitle.replace('{{page}}', this.id))this.div = div;- container?.appendChild(div);+ container?.append(div);++ if (+ (typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")) &&+ this._isStandalone+ ) {+ const { optionalContentConfigPromise } = options;+ if (optionalContentConfigPromise) {+ // Ensure that the thumbnails always display the *initial* document+ // state, for documents with optional content.+ optionalContentConfigPromise.then(optionalContentConfig => {+ if (+ optionalContentConfigPromise !== this._optionalContentConfigPromise+ ) {+ return;+ }+ this.#useThumbnailCanvas.initialOptionalContent =+ optionalContentConfig.hasInitialVisibility;+ });+ }+ }}setPdfPage(pdfPage) {@@ -159,9 +221,7 @@ class PDFPageView {destroy() {this.reset();- if (this.pdfPage) {- this.pdfPage.cleanup();- }+ this.pdfPage?.cleanup();}/**@@ -172,6 +232,7 @@ class PDFPageView {try {await this.annotationLayer.render(this.viewport, "display");} catch (ex) {+ console.error(`_renderAnnotationLayer: "${ex}".`);error = ex;} finally {this.eventBus.dispatch("annotationlayerrendered", {@@ -182,6 +243,25 @@ class PDFPageView {}}+ /**+ * @private+ */+ async _renderAnnotationEditorLayer() {+ let error = null;+ try {+ await this.annotationEditorLayer.render(this.viewport, "display");+ } catch (ex) {+ console.error(`_renderAnnotationEditorLayer: "${ex}".`);+ error = ex;+ } finally {+ this.eventBus.dispatch("annotationeditorlayerrendered", {+ source: this,+ pageNumber: this.id,+ error,+ });+ }+ }+/*** @private*/@@ -189,10 +269,11 @@ class PDFPageView {let error = null;try {const result = await this.xfaLayer.render(this.viewport, "display");- if (this.textHighlighter) {+ if (result?.textDivs && this.textHighlighter) {this._buildXfaTextContentItems(result.textDivs);}} catch (ex) {+ console.error(`_renderXfaLayer: "${ex}".`);error = ex;} finally {this.eventBus.dispatch("xfalayerrendered", {@@ -235,11 +316,16 @@ class PDFPageView {}reset({- keepZoomLayer = false,- keepAnnotationLayer = false,- keepXfaLayer = false,- } = {}) {- this.cancelRendering({ keepAnnotationLayer, keepXfaLayer });+ keepZoomLayer = false,+ keepAnnotationLayer = false,+ keepAnnotationEditorLayer = false,+ keepXfaLayer = false,+ } = {}) {+ this.cancelRendering({+ keepAnnotationLayer,+ keepAnnotationEditorLayer,+ keepXfaLayer,+ });this.renderingState = RenderingStates.INITIAL;const div = this.div;@@ -250,12 +336,15 @@ class PDFPageView {zoomLayerNode = (keepZoomLayer && this.zoomLayer) || null,annotationLayerNode =(keepAnnotationLayer && this.annotationLayer?.div) || null,+ annotationEditorLayerNode =+ (keepAnnotationEditorLayer && this.annotationEditorLayer?.div) || null,xfaLayerNode = (keepXfaLayer && this.xfaLayer?.div) || null;for (let i = childNodes.length - 1; i >= 0; i--) {const node = childNodes[i];switch (node) {case zoomLayerNode:case annotationLayerNode:+ case annotationEditorLayerNode:case xfaLayerNode:continue;}@@ -268,6 +357,12 @@ class PDFPageView {// so they are not displayed on the already resized page.this.annotationLayer.hide();}++ if (annotationEditorLayerNode) {+ this.annotationEditorLayer.hide();+ } else {+ this.annotationEditorLayer?.destroy();+ }if (xfaLayerNode) {// Hide the XFA layer until all elements are resized// so they are not displayed on the already resized page.@@ -285,20 +380,29 @@ class PDFPageView {}this._resetZoomLayer();}- if (this.svg) {+ if (+ (typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")) &&+ this.svg+ ) {this.paintedViewportMap.delete(this.svg);delete this.svg;}this.loadingIconDiv = document.createElement("div");this.loadingIconDiv.className = "loadingIcon notVisible";- if (this._isStandalone) {+ if (+ (typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")) &&+ this._isStandalone+ ) {this.toggleLoadingIconSpinner(/* viewVisible = */ true);}this.loadingIconDiv.setAttribute("role", "img");+ // NOTEthis.loadingIconDiv?.setAttribute('aria-label',window.siyuan.languages.loading)- div.appendChild(this.loadingIconDiv);+ div.append(this.loadingIconDiv);}update({ scale = 0, rotation = null, optionalContentConfigPromise = null }) {@@ -308,25 +412,43 @@ class PDFPageView {}if (optionalContentConfigPromise instanceof Promise) {this._optionalContentConfigPromise = optionalContentConfigPromise;++ // Ensure that the thumbnails always display the *initial* document state,+ // for documents with optional content.+ optionalContentConfigPromise.then(optionalContentConfig => {+ if (+ optionalContentConfigPromise !== this._optionalContentConfigPromise+ ) {+ return;+ }+ this.#useThumbnailCanvas.initialOptionalContent =+ optionalContentConfig.hasInitialVisibility;+ });}const totalRotation = (this.rotation + this.pdfPageRotate) % 360;- const viewportScale = this.scale * PixelsPerInch.PDF_TO_CSS_UNITS;this.viewport = this.viewport.clone({- scale: viewportScale,+ scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,rotation: totalRotation,});- if (this._isStandalone) {- const { style } = document.documentElement;- style.setProperty("--zoom-factor", this.scale);- style.setProperty("--viewport-scale-factor", viewportScale);+ if (+ (typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")) &&+ this._isStandalone+ ) {+ docStyle.setProperty("--scale-factor", this.viewport.scale);}- if (this.svg) {+ if (+ (typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")) &&+ this.svg+ ) {this.cssTransform({target: this.svg,redrawAnnotationLayer: true,+ redrawAnnotationEditorLayer: true,redrawXfaLayer: true,});@@ -345,7 +467,7 @@ class PDFPageView {const outputScale = this.outputScale;if (((Math.floor(this.viewport.width) * outputScale.sx) | 0) *- ((Math.floor(this.viewport.height) * outputScale.sy) | 0) >+ ((Math.floor(this.viewport.height) * outputScale.sy) | 0) >this.maxCanvasPixels) {isScalingRestricted = true;@@ -360,6 +482,7 @@ class PDFPageView {this.cssTransform({target: this.canvas,redrawAnnotationLayer: true,+ redrawAnnotationEditorLayer: true,redrawXfaLayer: true,});@@ -383,6 +506,7 @@ class PDFPageView {this.reset({keepZoomLayer: true,keepAnnotationLayer: true,+ keepAnnotationEditorLayer: true,keepXfaLayer: true,});}@@ -391,7 +515,11 @@ class PDFPageView {* PLEASE NOTE: Most likely you want to use the `this.reset()` method,* rather than calling this one directly.*/- cancelRendering({ keepAnnotationLayer = false, keepXfaLayer = false } = {}) {+ cancelRendering({+ keepAnnotationLayer = false,+ keepAnnotationEditorLayer = false,+ keepXfaLayer = false,+ } = {}) {if (this.paintTask) {this.paintTask.cancel();this.paintTask = null;@@ -410,6 +538,13 @@ class PDFPageView {this.annotationLayer = null;this._annotationCanvasMap = null;}+ if (+ this.annotationEditorLayer &&+ (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)+ ) {+ this.annotationEditorLayer.cancel();+ this.annotationEditorLayer = null;+ }if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {this.xfaLayer.cancel();this.xfaLayer = null;@@ -422,22 +557,23 @@ class PDFPageView {}cssTransform({- target,- redrawAnnotationLayer = false,- redrawXfaLayer = false,- }) {+ target,+ redrawAnnotationLayer = false,+ redrawAnnotationEditorLayer = false,+ redrawXfaLayer = false,+ }) {// Scale target (canvas or svg), its wrapper and page container.const width = this.viewport.width;const height = this.viewport.height;const div = this.div;target.style.width =target.parentNode.style.width =- div.style.width =- Math.floor(width) + "px";+ div.style.width =+ Math.floor(width) + "px";target.style.height =target.parentNode.style.height =- div.style.height =- Math.floor(height) + "px";+ div.style.height =+ Math.floor(height) + "px";// The canvas may have been originally rotated; rotate relative to that.const relativeRotation =this.viewport.rotation - this.paintedViewportMap.get(target).rotation;@@ -497,6 +633,9 @@ class PDFPageView {if (redrawAnnotationLayer && this.annotationLayer) {this._renderAnnotationLayer();}+ if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {+ this._renderAnnotationEditorLayer();+ }if (redrawXfaLayer && this.xfaLayer) {this._renderXfaLayer();}@@ -547,34 +686,38 @@ class PDFPageView {canvasWrapper.style.height = div.style.height;canvasWrapper.classList.add("canvasWrapper");- if (this.annotationLayer?.div) {+ const lastDivBeforeTextDiv =+ this.annotationLayer?.div || this.annotationEditorLayer?.div;++ if (lastDivBeforeTextDiv) {// The annotation layer needs to stay on top.- div.insertBefore(canvasWrapper, this.annotationLayer.div);+ lastDivBeforeTextDiv.before(canvasWrapper);} else {- div.appendChild(canvasWrapper);+ div.append(canvasWrapper);}let textLayer = null;if (this.textLayerMode !== TextLayerMode.DISABLE && this.textLayerFactory) {+ this._accessibilityManager ||= new TextAccessibilityManager();const textLayerDiv = document.createElement("div");textLayerDiv.className = "textLayer";textLayerDiv.style.width = canvasWrapper.style.width;textLayerDiv.style.height = canvasWrapper.style.height;- if (this.annotationLayer?.div) {+ if (lastDivBeforeTextDiv) {// The annotation layer needs to stay on top.- div.insertBefore(textLayerDiv, this.annotationLayer.div);+ lastDivBeforeTextDiv.before(textLayerDiv);} else {- div.appendChild(textLayerDiv);+ div.append(textLayerDiv);}- textLayer = this.textLayerFactory.createTextLayerBuilder(+ textLayer = this.textLayerFactory.createTextLayerBuilder({textLayerDiv,- this.id - 1,- this.viewport,- this.textLayerMode === TextLayerMode.ENABLE_ENHANCE,- this.eventBus,- this.textHighlighter- );+ pageIndex: this.id - 1,+ viewport: this.viewport,+ eventBus: this.eventBus,+ highlighter: this.textHighlighter,+ accessibilityManager: this._accessibilityManager,+ });}this.textLayer = textLayer;@@ -584,24 +727,20 @@ class PDFPageView {) {this._annotationCanvasMap ||= new Map();this.annotationLayer ||=- this.annotationLayerFactory.createAnnotationLayerBuilder(- div,+ this.annotationLayerFactory.createAnnotationLayerBuilder({+ pageDiv: div,pdfPage,- /* annotationStorage = */ null,- this.imageResourcesPath,- this.#annotationMode === AnnotationMode.ENABLE_FORMS,- this.l10n,- /* enableScripting = */ null,- /* hasJSActionsPromise = */ null,- /* mouseState = */ null,- /* fieldObjectsPromise = */ null,- /* annotationCanvasMap */ this._annotationCanvasMap- );+ imageResourcesPath: this.imageResourcesPath,+ renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS,+ l10n: this.l10n,+ annotationCanvasMap: this._annotationCanvasMap,+ accessibilityManager: this._accessibilityManager,+ });}if (this.xfaLayer?.div) {// The xfa layer needs to stay on top.- div.appendChild(this.xfaLayer.div);+ div.append(this.xfaLayer.div);}let renderContinueCallback = null;@@ -641,6 +780,10 @@ class PDFPageView {}this._resetZoomLayer(/* removeFromDOM = */ true);+ // Ensure that the thumbnails won't become partially (or fully) blank,+ // for documents that contain interactive form elements.+ this.#useThumbnailCanvas.regularAnnotations = !paintTask.separateAnnots;+this.eventBus.dispatch("pagerendered", {source: this,pageNumber: this.id,@@ -655,6 +798,8 @@ class PDFPageView {};const paintTask =+ (typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")) &&this.renderer === RendererType.SVG? this.paintOnSvg(canvasWrapper): this.paintOnCanvas(canvasWrapper);@@ -673,7 +818,20 @@ class PDFPageView {}if (this.annotationLayer) {- this._renderAnnotationLayer();+ this._renderAnnotationLayer().then(() => {+ if (this.annotationEditorLayerFactory) {+ this.annotationEditorLayer ||=+ this.annotationEditorLayerFactory.createAnnotationEditorLayerBuilder(+ {+ pageDiv: div,+ pdfPage,+ l10n: this.l10n,+ accessibilityManager: this._accessibilityManager,+ }+ );+ this._renderAnnotationEditorLayer();+ }+ });}});},@@ -683,13 +841,10 @@ class PDFPageView {);if (this.xfaLayerFactory) {- if (!this.xfaLayer) {- this.xfaLayer = this.xfaLayerFactory.createXfaLayerBuilder(- div,- pdfPage,- /* annotationStorage = */ null- );- }+ this.xfaLayer ||= this.xfaLayerFactory.createXfaLayerBuilder({+ pageDiv: div,+ pdfPage,+ });this._renderXfaLayer();}@@ -717,12 +872,12 @@ class PDFPageView {}const treeDom = this.structTreeLayer.render(tree);treeDom.classList.add("structTree");- this.canvas.appendChild(treeDom);+ this.canvas.append(treeDom);});};this.eventBus._on("textlayerrendered", this._onTextLayerRendered);this.structTreeLayer =- this.structTreeLayerFactory.createStructTreeLayerBuilder(pdfPage);+ this.structTreeLayerFactory.createStructTreeLayerBuilder({ pdfPage });}div.setAttribute("data-loaded", true);@@ -744,10 +899,14 @@ class PDFPageView {cancel() {renderTask.cancel();},+ get separateAnnots() {+ return renderTask.separateAnnots;+ },};const viewport = this.viewport;const canvas = document.createElement("canvas");+ canvas.setAttribute("role", "presentation");// Keep the canvas hidden until the first draw callback, or until drawing// is complete when `!this.renderingQueue`, to prevent black flickering.@@ -760,16 +919,9 @@ class PDFPageView {}};- canvasWrapper.appendChild(canvas);+ canvasWrapper.append(canvas);this.canvas = canvas;- if (- typeof PDFJSDev === "undefined" ||- PDFJSDev.test("MOZCENTRAL || GENERIC")- ) {- canvas.mozOpaque = true;- }-const ctx = canvas.getContext("2d", { alpha: false });const outputScale = (this.outputScale = new OutputScale());@@ -816,6 +968,7 @@ class PDFPageView {annotationMode: this.#annotationMode,optionalContentConfigPromise: this._optionalContentConfigPromise,annotationCanvasMap: this._annotationCanvasMap,+ pageColors: this.pageColors,};const renderTask = this.pdfPage.render(renderContext);renderTask.onContinue = function (cont) {@@ -842,18 +995,13 @@ class PDFPageView {paintOnSvg(wrapper) {if (- typeof PDFJSDev !== "undefined" &&- PDFJSDev.test("MOZCENTRAL || CHROME")+ !(+ typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")+ )) {- // Return a mock object, to prevent errors such as e.g.- // "TypeError: paintTask.promise is undefined".- return {- promise: Promise.reject(new Error("SVG rendering is not supported.")),- onRenderContinue(cont) {},- cancel() {},- };+ throw new Error("Not implemented: paintOnSvg");}-let cancelled = false;const ensureNotCancelled = () => {if (cancelled) {@@ -869,23 +1017,23 @@ class PDFPageView {scale: PixelsPerInch.PDF_TO_CSS_UNITS,});const promise = pdfPage- .getOperatorList({- annotationMode: this.#annotationMode,- })- .then(opList => {- ensureNotCancelled();- const svgGfx = new SVGGraphics(pdfPage.commonObjs, pdfPage.objs);- return svgGfx.getSVG(opList, actualSizeViewport).then(svg => {+ .getOperatorList({+ annotationMode: this.#annotationMode,+ })+ .then(opList => {ensureNotCancelled();- this.svg = svg;- this.paintedViewportMap.set(svg, actualSizeViewport);-- svg.style.width = wrapper.style.width;- svg.style.height = wrapper.style.height;- this.renderingState = RenderingStates.FINISHED;- wrapper.appendChild(svg);+ const svgGfx = new SVGGraphics(pdfPage.commonObjs, pdfPage.objs);+ return svgGfx.getSVG(opList, actualSizeViewport).then(svg => {+ ensureNotCancelled();+ this.svg = svg;+ this.paintedViewportMap.set(svg, actualSizeViewport);++ svg.style.width = wrapper.style.width;+ svg.style.height = wrapper.style.height;+ this.renderingState = RenderingStates.FINISHED;+ wrapper.append(svg);+ });});- });return {promise,@@ -895,6 +1043,9 @@ class PDFPageView {cancel() {cancelled = true;},+ get separateAnnots() {+ return false;+ },};}@@ -910,6 +1061,16 @@ class PDFPageView {this.div.removeAttribute("data-page-label");}}++ /**+ * For use by the `PDFThumbnailView.setImage`-method.+ * @ignore+ */+ get thumbnailCanvas() {+ const { initialOptionalContent, regularAnnotations } =+ this.#useThumbnailCanvas;+ return initialOptionalContent && regularAnnotations ? this.canvas : null;+ }}export { PDFPageView };diff --git a/app/src/asset/pdf/pdf_presentation_mode.js b/app/src/asset/pdf/pdf_presentation_mode.jsindex f94bea0219..2dc6c75cea 100644--- a/app/src/asset/pdf/pdf_presentation_mode.js+++ b/app/src/asset/pdf/pdf_presentation_mode.js@@ -19,8 +19,8 @@ import {ScrollMode,SpreadMode,} from "./ui_utils.js";+import { AnnotationEditorType } from "./pdfjs";-const DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500; // in msconst DELAY_BEFORE_HIDING_CONTROLS = 3000; // in msconst ACTIVE_SELECTOR = "pdfPresentationMode";const CONTROLS_SELECTOR = "pdfPresentationModeControls";@@ -42,6 +42,10 @@ const SWIPE_ANGLE_THRESHOLD = Math.PI / 6;*/class PDFPresentationMode {+ #state = PresentationModeState.UNKNOWN;++ #args = null;+/*** @param {PDFPresentationModeOptions} options*/@@ -50,8 +54,6 @@ class PDFPresentationMode {this.pdfViewer = pdfViewer;this.eventBus = eventBus;- this.active = false;- this.args = null;this.contextMenuOpen = false;this.mouseScrollTimeStamp = 0;this.mouseScrollDelta = 0;@@ -60,37 +62,63 @@ class PDFPresentationMode {/*** Request the browser to enter fullscreen mode.- * @returns {boolean} Indicating if the request was successful.+ * @returns {Promise<boolean>} Indicating if the request was successful.*/- request() {- if (- this.switchInProgress ||- this.active ||- !this.pdfViewer.pagesCount ||- !this.container.requestFullscreen- ) {+ async request() {+ const { container, pdfViewer } = this;++ if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) {return false;}this.#addFullscreenChangeListeners();- this.#setSwitchInProgress();- this.#notifyStateChange();+ this.#notifyStateChange(PresentationModeState.CHANGING);- this.container.requestFullscreen();+ const promise = container.requestFullscreen();- this.args = {- pageNumber: this.pdfViewer.currentPageNumber,- scaleValue: this.pdfViewer.currentScaleValue,- scrollMode: this.pdfViewer.scrollMode,- spreadMode: this.pdfViewer.spreadMode,+ this.#args = {+ pageNumber: pdfViewer.currentPageNumber,+ scaleValue: pdfViewer.currentScaleValue,+ scrollMode: pdfViewer.scrollMode,+ spreadMode: null,+ annotationEditorMode: null,};- return true;++ if (+ pdfViewer.spreadMode !== SpreadMode.NONE &&+ !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)+ ) {+ console.warn(+ "Ignoring Spread modes when entering PresentationMode, " ++ "since the document may contain varying page sizes."+ );+ this.#args.spreadMode = pdfViewer.spreadMode;+ }+ if (pdfViewer.annotationEditorMode !== AnnotationEditorType.DISABLE) {+ this.#args.annotationEditorMode = pdfViewer.annotationEditorMode;+ }++ try {+ await promise;+ pdfViewer.focus(); // Fixes bug 1787456.+ return true;+ } catch (reason) {+ this.#removeFullscreenChangeListeners();+ this.#notifyStateChange(PresentationModeState.NORMAL);+ }+ return false;+ }++ get active() {+ return (+ this.#state === PresentationModeState.CHANGING ||+ this.#state === PresentationModeState.FULLSCREEN+ );}#mouseWheel(evt) {if (!this.active) {return;}-evt.preventDefault();const delta = normalizeWheelEventDelta(evt);@@ -126,57 +154,29 @@ class PDFPresentationMode {}}- #notifyStateChange() {- let state = PresentationModeState.NORMAL;- if (this.switchInProgress) {- state = PresentationModeState.CHANGING;- } else if (this.active) {- state = PresentationModeState.FULLSCREEN;- }- this.eventBus.dispatch("presentationmodechanged", {- source: this,- state,- });- }-- /**- * Used to initialize a timeout when requesting Presentation Mode,- * i.e. when the browser is requested to enter fullscreen mode.- * This timeout is used to prevent the current page from being scrolled- * partially, or completely, out of view when entering Presentation Mode.- * NOTE: This issue seems limited to certain zoom levels (e.g. page-width).- */- #setSwitchInProgress() {- if (this.switchInProgress) {- clearTimeout(this.switchInProgress);- }- this.switchInProgress = setTimeout(() => {- this.#removeFullscreenChangeListeners();- delete this.switchInProgress;- this.#notifyStateChange();- }, DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS);- }+ #notifyStateChange(state) {+ this.#state = state;- #resetSwitchInProgress() {- if (this.switchInProgress) {- clearTimeout(this.switchInProgress);- delete this.switchInProgress;- }+ this.eventBus.dispatch("presentationmodechanged", { source: this, state });}#enter() {- this.active = true;- this.#resetSwitchInProgress();- this.#notifyStateChange();+ this.#notifyStateChange(PresentationModeState.FULLSCREEN);this.container.classList.add(ACTIVE_SELECTOR);// Ensure that the correct page is scrolled into view when entering// Presentation Mode, by waiting until fullscreen mode in enabled.setTimeout(() => {this.pdfViewer.scrollMode = ScrollMode.PAGE;- this.pdfViewer.spreadMode = SpreadMode.NONE;- this.pdfViewer.currentPageNumber = this.args.pageNumber;+ if (this.#args.spreadMode !== null) {+ this.pdfViewer.spreadMode = SpreadMode.NONE;+ }+ this.pdfViewer.currentPageNumber = this.#args.pageNumber;this.pdfViewer.currentScaleValue = "page-fit";++ if (this.#args.annotationEditorMode !== null) {+ this.pdfViewer.annotationEditorMode = AnnotationEditorType.NONE;+ }}, 0);this.#addWindowListeners();@@ -196,15 +196,20 @@ class PDFPresentationMode {// Ensure that the correct page is scrolled into view when exiting// Presentation Mode, by waiting until fullscreen mode is disabled.setTimeout(() => {- this.active = false;this.#removeFullscreenChangeListeners();- this.#notifyStateChange();+ this.#notifyStateChange(PresentationModeState.NORMAL);- this.pdfViewer.scrollMode = this.args.scrollMode;- this.pdfViewer.spreadMode = this.args.spreadMode;- this.pdfViewer.currentScaleValue = this.args.scaleValue;+ this.pdfViewer.scrollMode = this.#args.scrollMode;+ if (this.#args.spreadMode !== null) {+ this.pdfViewer.spreadMode = this.#args.spreadMode;+ }+ this.pdfViewer.currentScaleValue = this.#args.scaleValue;this.pdfViewer.currentPageNumber = pageNumber;- this.args = null;++ if (this.#args.annotationEditorMode !== null) {+ this.pdfViewer.annotationEditorMode = this.#args.annotationEditorMode;+ }+ this.#args = null;}, 0);this.#removeWindowListeners();diff --git a/app/src/asset/pdf/pdf_rendering_queue.js b/app/src/asset/pdf/pdf_rendering_queue.jsindex 91f4fe5a15..b7530f09fd 100644--- a/app/src/asset/pdf/pdf_rendering_queue.js+++ b/app/src/asset/pdf/pdf_rendering_queue.js@@ -13,6 +13,11 @@* limitations under the License.*/+/** @typedef {import("./interfaces").IRenderableView} IRenderableView */+/** @typedef {import("./pdf_viewer").PDFViewer} PDFViewer */+// eslint-disable-next-line max-len+/** @typedef {import("./pdf_thumbnail_viewer").PDFThumbnailViewer} PDFThumbnailViewer */+import { RenderingCancelledException } from "./pdfjs";import { RenderingStates } from "./ui_utils.js";@@ -189,16 +194,16 @@ class PDFRenderingQueue {case RenderingStates.INITIAL:this.highestPriorityPage = view.renderingId;view- .draw()- .finally(() => {- this.renderHighestPriority();- })- .catch(reason => {- if (reason instanceof RenderingCancelledException) {- return;- }- console.error(`renderView: "${reason}"`);- });+ .draw()+ .finally(() => {+ this.renderHighestPriority();+ })+ .catch(reason => {+ if (reason instanceof RenderingCancelledException) {+ return;+ }+ console.error(`renderView: "${reason}"`);+ });break;}return true;diff --git a/app/src/asset/pdf/pdf_scripting_manager.js b/app/src/asset/pdf/pdf_scripting_manager.jsindex dc53185bef..df1aa3d423 100644--- a/app/src/asset/pdf/pdf_scripting_manager.js+++ b/app/src/asset/pdf/pdf_scripting_manager.js@@ -13,6 +13,8 @@* limitations under the License.*/+/** @typedef {import("./event_utils").EventBus} EventBus */+import { apiPageLayoutToViewerModes, RenderingStates } from "./ui_utils.js";import { createPromiseCapability, shadow } from "./pdfjs";@@ -33,11 +35,11 @@ class PDFScriptingManager {* @param {PDFScriptingManagerOptions} options*/constructor({- eventBus,- sandboxBundleSrc = null,- scriptingFactory = null,- docPropertiesLookup = null,- }) {+ eventBus,+ sandboxBundleSrc = null,+ scriptingFactory = null,+ docPropertiesLookup = null,+ }) {this._pdfDocument = null;this._pdfViewer = null;this._closeCapability = null;@@ -152,7 +154,7 @@ class PDFScriptingManager {this._eventBus._on(name, listener);}for (const [name, listener] of this._domEvents) {- window.addEventListener(name, listener);+ window.addEventListener(name, listener, true);}try {@@ -309,7 +311,7 @@ class PDFScriptingManager {this._pdfViewer.currentScaleValue = value;break;case "SaveAs":- this._eventBus.dispatch("save", { source: this });+ this._eventBus.dispatch("download", { source: this });break;case "FirstPage":this._pdfViewer.currentPageNumber = 1;@@ -349,7 +351,9 @@ class PDFScriptingManager {const ids = siblings ? [id, ...siblings] : [id];for (const elementId of ids) {- const element = document.getElementById(elementId);+ const element = document.querySelector(+ `[data-element-id="${elementId}"]`+ );if (element) {element.dispatchEvent(new CustomEvent("updatefromsandbox", { detail }));} else {@@ -505,7 +509,7 @@ class PDFScriptingManager {this._internalEvents.clear();for (const [name, listener] of this._domEvents) {- window.removeEventListener(name, listener);+ window.removeEventListener(name, listener, true);}this._domEvents.clear();diff --git a/app/src/asset/pdf/pdf_sidebar.js b/app/src/asset/pdf/pdf_sidebar.jsindex 0c082bf5ae..55d1b17fd1 100644--- a/app/src/asset/pdf/pdf_sidebar.js+++ b/app/src/asset/pdf/pdf_sidebar.js@@ -34,8 +34,8 @@ const UI_NOTIFICATION_CLASS = "pdfSidebarNotification";* @typedef {Object} PDFSidebarElements* @property {HTMLDivElement} outerContainer - The outer container* (encasing both the viewer and sidebar elements).- * @property {HTMLDivElement} viewerContainer - The viewer container- * (in which the viewer element is placed).+ * @property {HTMLDivElement} sidebarContainer - The sidebar container+ * (in which the views are placed).* @property {HTMLButtonElement} toggleButton - The button used for* opening/closing the sidebar.* @property {HTMLButtonElement} thumbnailButton - The button used to show@@ -68,6 +68,7 @@ class PDFSidebar {this.isOpen = false;this.active = SidebarView.THUMBS;this.isInitialViewSet = false;+ this.isInitialEventDispatched = false;/*** Callback used when the sidebar has been opened/closed, to ensure that@@ -79,7 +80,7 @@ class PDFSidebar {this.pdfThumbnailViewer = pdfThumbnailViewer;this.outerContainer = elements.outerContainer;- this.viewerContainer = elements.viewerContainer;+ this.sidebarContainer = elements.sidebarContainer;this.toggleButton = elements.toggleButton;this.thumbnailButton = elements.thumbnailButton;@@ -98,13 +99,14 @@ class PDFSidebar {this.eventBus = eventBus;this.l10n = l10n;- this._addEventListeners();+ this.#addEventListeners();}reset() {this.isInitialViewSet = false;+ this.isInitialEventDispatched = false;- this._hideUINotification(/* reset = */ true);+ this.#hideUINotification(/* reset = */ true);this.switchView(SidebarView.THUMBS);this.outlineButton.disabled = false;@@ -120,22 +122,6 @@ class PDFSidebar {return this.isOpen ? this.active : SidebarView.NONE;}- get isThumbnailViewVisible() {- return this.isOpen && this.active === SidebarView.THUMBS;- }-- get isOutlineViewVisible() {- return this.isOpen && this.active === SidebarView.OUTLINE;- }-- get isAttachmentsViewVisible() {- return this.isOpen && this.active === SidebarView.ATTACHMENTS;- }-- get isLayersViewVisible() {- return this.isOpen && this.active === SidebarView.LAYERS;- }-/*** @param {number} view - The sidebar view that should become visible,* must be one of the values in {SidebarView}.@@ -149,13 +135,15 @@ class PDFSidebar {// If the user has already manually opened the sidebar, immediately closing// it would be bad UX; also ignore the "unknown" sidebar view value.if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) {- this._dispatchEvent();+ this.#dispatchEvent();return;}- // Prevent dispatching two back-to-back `sidebarviewchanged` events,- // since `this._switchView` dispatched the event if the view changed.- if (!this._switchView(view, /* forceOpen */ true)) {- this._dispatchEvent();+ this.switchView(view, /* forceOpen = */ true);++ // Prevent dispatching two back-to-back "sidebarviewchanged" events,+ // since `this.switchView` dispatched the event if the view changed.+ if (!this.isInitialEventDispatched) {+ this.#dispatchEvent();}}@@ -166,14 +154,6 @@ class PDFSidebar {* The default value is `false`.*/switchView(view, forceOpen = false) {- this._switchView(view, forceOpen);- }-- /**- * @returns {boolean} Indicating if `this._dispatchEvent` was called.- * @private- */- _switchView(view, forceOpen = false) {const isViewChanged = view !== this.active;let shouldForceRendering = false;@@ -181,9 +161,8 @@ class PDFSidebar {case SidebarView.NONE:if (this.isOpen) {this.close();- return true; // Closing will trigger rendering and dispatch the event.}- return false;+ return; // Closing will trigger rendering and dispatch the event.case SidebarView.THUMBS:if (this.isOpen && isViewChanged) {shouldForceRendering = true;@@ -191,22 +170,22 @@ class PDFSidebar {break;case SidebarView.OUTLINE:if (this.outlineButton.disabled) {- return false;+ return;}break;case SidebarView.ATTACHMENTS:if (this.attachmentsButton.disabled) {- return false;+ return;}break;case SidebarView.LAYERS:if (this.layersButton.disabled) {- return false;+ return;}break;default:- console.error(`PDFSidebar._switchView: "${view}" is not a valid view.`);- return false;+ console.error(`PDFSidebar.switchView: "${view}" is not a valid view.`);+ return;}// Update the active view *after* it has been validated above,// in order to prevent setting it to an invalid state.@@ -223,31 +202,32 @@ class PDFSidebar {this.attachmentsButton.classList.toggle("toggled", isAttachments);this.layersButton.classList.toggle("toggled", isLayers);- this.thumbnailButton.setAttribute("aria-checked", `${isThumbs}`);- this.outlineButton.setAttribute("aria-checked", `${isOutline}`);- this.attachmentsButton.setAttribute("aria-checked", `${isAttachments}`);- this.layersButton.setAttribute("aria-checked", `${isLayers}`);+ this.thumbnailButton.setAttribute("aria-checked", isThumbs);+ this.outlineButton.setAttribute("aria-checked", isOutline);+ this.attachmentsButton.setAttribute("aria-checked", isAttachments);+ this.layersButton.setAttribute("aria-checked", isLayers);// ... and for all views.+ // NOTEthis.thumbnailView.classList.toggle("fn__hidden", !isThumbs);this.outlineView.classList.toggle("fn__hidden", !isOutline);this.attachmentsView.classList.toggle("fn__hidden", !isAttachments);this.layersView.classList.toggle("fn__hidden", !isLayers);// Finally, update view-specific CSS classes.+ // NOTEthis._outlineOptionsContainer.classList.toggle("fn__hidden", !isOutline);if (forceOpen && !this.isOpen) {this.open();- return true; // Opening will trigger rendering and dispatch the event.+ return; // Opening will trigger rendering and dispatch the event.}if (shouldForceRendering) {- this._updateThumbnailViewer();- this._forceRendering();+ this.#updateThumbnailViewer();+ this.#forceRendering();}if (isViewChanged) {- this._dispatchEvent();+ this.#dispatchEvent();}- return isViewChanged;}open() {@@ -261,12 +241,12 @@ class PDFSidebar {this.outerContainer.classList.add("sidebarMoving", "sidebarOpen");if (this.active === SidebarView.THUMBS) {- this._updateThumbnailViewer();+ this.#updateThumbnailViewer();}- this._forceRendering();- this._dispatchEvent();+ this.#forceRendering();+ this.#dispatchEvent();- this._hideUINotification();+ this.#hideUINotification();}close() {@@ -280,8 +260,8 @@ class PDFSidebar {this.outerContainer.classList.add("sidebarMoving");this.outerContainer.classList.remove("sidebarOpen");- this._forceRendering();- this._dispatchEvent();+ this.#forceRendering();+ this.#dispatchEvent();}toggle() {@@ -292,20 +272,18 @@ class PDFSidebar {}}- /**- * @private- */- _dispatchEvent() {+ #dispatchEvent() {+ if (this.isInitialViewSet && !this.isInitialEventDispatched) {+ this.isInitialEventDispatched = true;+ }+this.eventBus.dispatch("sidebarviewchanged", {source: this,view: this.visibleView,});}- /**- * @private- */- _forceRendering() {+ #forceRendering() {if (this.onToggled) {this.onToggled();} else {@@ -315,10 +293,7 @@ class PDFSidebar {}}- /**- * @private- */- _updateThumbnailViewer() {+ #updateThumbnailViewer() {const { pdfViewer, pdfThumbnailViewer } = this;// Use the rendered pages to set the corresponding thumbnail images.@@ -333,10 +308,8 @@ class PDFSidebar {pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);}- /**- * @private- */- _showUINotification() {+ #showUINotification() {+ // NOTEthis.toggleButton.title = window.siyuan.languages.toggleSidebarNotification2Titleif (!this.isOpen) {@@ -346,10 +319,7 @@ class PDFSidebar {}}- /**- * @private- */- _hideUINotification(reset = false) {+ #hideUINotification(reset = false) {if (this.isOpen || reset) {// Only hide the notification on the `toggleButton` if the sidebar is// currently open, or when the current PDF document is being closed.@@ -357,16 +327,14 @@ class PDFSidebar {}if (reset) {+ // NOTEthis.toggleButton.title = window.siyuan.languages.toggleSidebarTitle}}- /**- * @private- */- _addEventListeners() {- this.viewerContainer.addEventListener("transitionend", evt => {- if (evt.target === this.viewerContainer) {+ #addEventListeners() {+ this.sidebarContainer.addEventListener("transitionend", evt => {+ if (evt.target === this.sidebarContainer) {this.outerContainer.classList.remove("sidebarMoving");}});@@ -408,7 +376,7 @@ class PDFSidebar {button.disabled = !count;if (count) {- this._showUINotification();+ this.#showUINotification();} else if (this.active === view) {// If the `view` was opened by the user during document load,// switch away from it if it turns out to be empty.@@ -443,9 +411,9 @@ class PDFSidebar {this.eventBus._on("presentationmodechanged", evt => {if (evt.state === PresentationModeState.NORMAL &&- this.isThumbnailViewVisible+ this.visibleView === SidebarView.THUMBS) {- this._updateThumbnailViewer();+ this.#updateThumbnailViewer();}});}diff --git a/app/src/asset/pdf/pdf_sidebar_resizer.js b/app/src/asset/pdf/pdf_sidebar_resizer.jsindex 169765e073..cef26e7d7b 100644--- a/app/src/asset/pdf/pdf_sidebar_resizer.js+++ b/app/src/asset/pdf/pdf_sidebar_resizer.js@@ -13,6 +13,9 @@* limitations under the License.*/+import { docStyle } from "./ui_utils.js";++// NOTEconst SIDEBAR_WIDTH_VAR = "--b3-pdf-sidebar-width";const SIDEBAR_MIN_WIDTH = 200; // pixelsconst SIDEBAR_RESIZING_CLASS = "sidebarResizing";@@ -34,7 +37,6 @@ class PDFSidebarResizer {constructor(options, eventBus, l10n) {this.isRTL = false;this.sidebarOpen = false;- this.doc = document.documentElement;this._width = null;this._outerContainerWidth = null;this._boundEvents = Object.create(null);@@ -42,6 +44,7 @@ class PDFSidebarResizer {this.outerContainer = options.outerContainer;this.resizer = options.resizer;this.eventBus = eventBus;+ // NOTEthis.isRTL = false;this._addEventListeners();}@@ -72,7 +75,8 @@ class PDFSidebarResizer {return false;}this._width = width;- this.doc.style.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);++ docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`);return true;}diff --git a/app/src/asset/pdf/pdf_thumbnail_view.js b/app/src/asset/pdf/pdf_thumbnail_view.jsindex 1113680ed7..16818ea5ab 100644--- a/app/src/asset/pdf/pdf_thumbnail_view.js+++ b/app/src/asset/pdf/pdf_thumbnail_view.js@@ -13,13 +13,19 @@* limitations under the License.*/-import { OutputScale, RenderingStates } from './ui_utils.js'-import { RenderingCancelledException } from './pdfjs'+/** @typedef {import("./interfaces").IL10n} IL10n */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+/** @typedef {import("./interfaces").IRenderableView} IRenderableView */+// eslint-disable-next-line max-len+/** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */-const DRAW_UPSCALE_FACTOR = 2 // See comment in `PDFThumbnailView.draw` below.-const MAX_NUM_SCALING_STEPS = 3-const THUMBNAIL_CANVAS_BORDER_WIDTH = 1 // px-const THUMBNAIL_WIDTH = 98 // px+import { OutputScale, RenderingStates } from "./ui_utils.js";+import { RenderingCancelledException } from "./pdfjs";++const DRAW_UPSCALE_FACTOR = 2; // See comment in `PDFThumbnailView.draw` below.+const MAX_NUM_SCALING_STEPS = 3;+const THUMBNAIL_CANVAS_BORDER_WIDTH = 1; // px+const THUMBNAIL_WIDTH = 98; // px/*** @typedef {Object} PDFThumbnailViewOptions@@ -31,44 +37,39 @@ const THUMBNAIL_WIDTH = 98 // px* The default value is `null`.* @property {IPDFLinkService} linkService - The navigation/linking service.* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.- * @property {function} checkSetImageDisabled* @property {IL10n} l10n - Localization service.+ * @property {Object} [pageColors] - Overwrites background and foreground colors+ * with user defined ones in order to improve readability in high contrast+ * mode.*/class TempImageFactory {- static #tempCanvas = null+ static #tempCanvas = null;- static getCanvas (width, height) {- const tempCanvas = (this.#tempCanvas ||= document.createElement('canvas'))- tempCanvas.width = width- tempCanvas.height = height+ static getCanvas(width, height) {+ const tempCanvas = (this.#tempCanvas ||= document.createElement("canvas"));+ tempCanvas.width = width;+ tempCanvas.height = height;// Since this is a temporary canvas, we need to fill it with a white// background ourselves. `_getPageDrawContext` uses CSS rules for this.- if (- typeof PDFJSDev === 'undefined' ||- PDFJSDev.test('MOZCENTRAL || GENERIC')- ) {- tempCanvas.mozOpaque = true- }-- const ctx = tempCanvas.getContext('2d', {alpha: false})- ctx.save()- ctx.fillStyle = 'rgb(255, 255, 255)'- ctx.fillRect(0, 0, width, height)- ctx.restore()- return [tempCanvas, tempCanvas.getContext('2d')]+ const ctx = tempCanvas.getContext("2d", { alpha: false });+ ctx.save();+ ctx.fillStyle = "rgb(255, 255, 255)";+ ctx.fillRect(0, 0, width, height);+ ctx.restore();+ return [tempCanvas, tempCanvas.getContext("2d")];}- static destroyCanvas () {- const tempCanvas = this.#tempCanvas+ static destroyCanvas() {+ const tempCanvas = this.#tempCanvas;if (tempCanvas) {// Zeroing the width and height causes Firefox to release graphics// resources immediately, which can greatly reduce memory consumption.- tempCanvas.width = 0- tempCanvas.height = 0+ tempCanvas.width = 0;+ tempCanvas.height = 0;}- this.#tempCanvas = null+ this.#tempCanvas = null;}}@@ -79,303 +80,297 @@ class PDFThumbnailView {/*** @param {PDFThumbnailViewOptions} options*/- constructor ({- container,- id,- defaultViewport,- optionalContentConfigPromise,- linkService,- renderingQueue,- checkSetImageDisabled,- l10n,- }) {- this.id = id- this.renderingId = 'thumbnail' + id- this.pageLabel = null-- this.pdfPage = null- this.rotation = 0- this.viewport = defaultViewport- this.pdfPageRotate = defaultViewport.rotation- this._optionalContentConfigPromise = optionalContentConfigPromise || null-- this.linkService = linkService- this.renderingQueue = renderingQueue-- this.renderTask = null- this.renderingState = RenderingStates.INITIAL- this.resume = null- this._checkSetImageDisabled =- checkSetImageDisabled ||- function () {- return false- }+ constructor({+ container,+ id,+ defaultViewport,+ optionalContentConfigPromise,+ linkService,+ renderingQueue,+ l10n,+ pageColors,+ }) {+ this.id = id;+ this.renderingId = "thumbnail" + id;+ this.pageLabel = null;++ this.pdfPage = null;+ this.rotation = 0;+ this.viewport = defaultViewport;+ this.pdfPageRotate = defaultViewport.rotation;+ this._optionalContentConfigPromise = optionalContentConfigPromise || null;+ this.pageColors = pageColors || null;++ this.linkService = linkService;+ this.renderingQueue = renderingQueue;++ this.renderTask = null;+ this.renderingState = RenderingStates.INITIAL;+ this.resume = null;const pageWidth = this.viewport.width,pageHeight = this.viewport.height,- pageRatio = pageWidth / pageHeight+ pageRatio = pageWidth / pageHeight;- this.canvasWidth = THUMBNAIL_WIDTH- this.canvasHeight = (this.canvasWidth / pageRatio) | 0- this.scale = this.canvasWidth / pageWidth+ this.canvasWidth = THUMBNAIL_WIDTH;+ this.canvasHeight = (this.canvasWidth / pageRatio) | 0;+ this.scale = this.canvasWidth / pageWidth;- this.l10n = l10n+ this.l10n = l10n;- const anchor = document.createElement('a')- anchor.href = linkService.getAnchorUrl('#page=' + id)+ const anchor = document.createElement("a");+ anchor.href = linkService.getAnchorUrl("#page=" + id);+ // NOTEanchor.title = this._thumbPageTitleanchor.onclick = function () {- linkService.goToPage(id)- return false- }- this.anchor = anchor-- const div = document.createElement('div')- div.className = 'thumbnail'- div.setAttribute('data-page-number', this.id)- this.div = div-- const ring = document.createElement('div')- ring.className = 'thumbnailSelectionRing'- const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH- ring.style.width = this.canvasWidth + borderAdjustment + 'px'- ring.style.height = this.canvasHeight + borderAdjustment + 'px'- this.ring = ring-- div.appendChild(ring)- anchor.appendChild(div)- container.appendChild(anchor)+ linkService.goToPage(id);+ return false;+ };+ this.anchor = anchor;++ const div = document.createElement("div");+ div.className = "thumbnail";+ div.setAttribute("data-page-number", this.id);+ this.div = div;++ const ring = document.createElement("div");+ ring.className = "thumbnailSelectionRing";+ const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;+ ring.style.width = this.canvasWidth + borderAdjustment + "px";+ ring.style.height = this.canvasHeight + borderAdjustment + "px";+ this.ring = ring;++ div.append(ring);+ anchor.append(div);+ container.append(anchor);}- setPdfPage (pdfPage) {- this.pdfPage = pdfPage- this.pdfPageRotate = pdfPage.rotate- const totalRotation = (this.rotation + this.pdfPageRotate) % 360- this.viewport = pdfPage.getViewport({scale: 1, rotation: totalRotation})- this.reset()+ setPdfPage(pdfPage) {+ this.pdfPage = pdfPage;+ this.pdfPageRotate = pdfPage.rotate;+ const totalRotation = (this.rotation + this.pdfPageRotate) % 360;+ this.viewport = pdfPage.getViewport({ scale: 1, rotation: totalRotation });+ this.reset();}- reset () {- this.cancelRendering()- this.renderingState = RenderingStates.INITIAL+ reset() {+ this.cancelRendering();+ this.renderingState = RenderingStates.INITIAL;const pageWidth = this.viewport.width,pageHeight = this.viewport.height,- pageRatio = pageWidth / pageHeight+ pageRatio = pageWidth / pageHeight;- this.canvasHeight = (this.canvasWidth / pageRatio) | 0- this.scale = this.canvasWidth / pageWidth+ this.canvasHeight = (this.canvasWidth / pageRatio) | 0;+ this.scale = this.canvasWidth / pageWidth;- this.div.removeAttribute('data-loaded')- const ring = this.ring- ring.textContent = '' // Remove the thumbnail from the DOM.- const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH- ring.style.width = this.canvasWidth + borderAdjustment + 'px'- ring.style.height = this.canvasHeight + borderAdjustment + 'px'+ this.div.removeAttribute("data-loaded");+ const ring = this.ring;+ ring.textContent = ""; // Remove the thumbnail from the DOM.+ const borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;+ ring.style.width = this.canvasWidth + borderAdjustment + "px";+ ring.style.height = this.canvasHeight + borderAdjustment + "px";if (this.canvas) {// Zeroing the width and height causes Firefox to release graphics// resources immediately, which can greatly reduce memory consumption.- this.canvas.width = 0- this.canvas.height = 0- delete this.canvas+ this.canvas.width = 0;+ this.canvas.height = 0;+ delete this.canvas;}if (this.image) {- this.image.removeAttribute('src')- delete this.image+ this.image.removeAttribute("src");+ delete this.image;}}- update ({rotation = null}) {- if (typeof rotation === 'number') {- this.rotation = rotation // The rotation may be zero.+ update({ rotation = null }) {+ if (typeof rotation === "number") {+ this.rotation = rotation; // The rotation may be zero.}- const totalRotation = (this.rotation + this.pdfPageRotate) % 360+ const totalRotation = (this.rotation + this.pdfPageRotate) % 360;this.viewport = this.viewport.clone({scale: 1,rotation: totalRotation,- })- this.reset()+ });+ this.reset();}/*** PLEASE NOTE: Most likely you want to use the `this.reset()` method,* rather than calling this one directly.*/- cancelRendering () {+ cancelRendering() {if (this.renderTask) {- this.renderTask.cancel()- this.renderTask = null+ this.renderTask.cancel();+ this.renderTask = null;}- this.resume = null+ this.resume = null;}/*** @private*/- _getPageDrawContext (upscaleFactor = 1) {+ _getPageDrawContext(upscaleFactor = 1) {// Keep the no-thumbnail outline visible, i.e. `data-loaded === false`,// until rendering/image conversion is complete, to avoid display issues.- const canvas = document.createElement('canvas')-- if (- typeof PDFJSDev === 'undefined' ||- PDFJSDev.test('MOZCENTRAL || GENERIC')- ) {- canvas.mozOpaque = true- }- const ctx = canvas.getContext('2d', {alpha: false})- const outputScale = new OutputScale()+ const canvas = document.createElement("canvas");+ const ctx = canvas.getContext("2d", { alpha: false });+ const outputScale = new OutputScale();- canvas.width = (upscaleFactor * this.canvasWidth * outputScale.sx) | 0- canvas.height = (upscaleFactor * this.canvasHeight * outputScale.sy) | 0+ canvas.width = (upscaleFactor * this.canvasWidth * outputScale.sx) | 0;+ canvas.height = (upscaleFactor * this.canvasHeight * outputScale.sy) | 0;const transform = outputScale.scaled? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]- : null+ : null;- return {ctx, canvas, transform}+ return { ctx, canvas, transform };}/*** @private*/- _convertCanvasToImage (canvas) {+ _convertCanvasToImage(canvas) {if (this.renderingState !== RenderingStates.FINISHED) {- throw new Error('_convertCanvasToImage: Rendering has not finished.')+ throw new Error("_convertCanvasToImage: Rendering has not finished.");}- const reducedCanvas = this._reduceImage(canvas)+ const reducedCanvas = this._reduceImage(canvas);- const image = document.createElement('img')- image.className = 'thumbnailImage'- image.setAttribute('aria-label', this._thumbPageCanvas)- image.style.width = this.canvasWidth + 'px'- image.style.height = this.canvasHeight + 'px'+ const image = document.createElement("img");+ image.className = "thumbnailImage";+ this._thumbPageCanvas.then(msg => {+ image.setAttribute("aria-label", msg);+ });+ image.style.width = this.canvasWidth + "px";+ image.style.height = this.canvasHeight + "px";- image.src = reducedCanvas.toDataURL()- this.image = image+ image.src = reducedCanvas.toDataURL();+ this.image = image;- this.div.setAttribute('data-loaded', true)- this.ring.appendChild(image)+ this.div.setAttribute("data-loaded", true);+ this.ring.append(image);// Zeroing the width and height causes Firefox to release graphics// resources immediately, which can greatly reduce memory consumption.- reducedCanvas.width = 0- reducedCanvas.height = 0+ reducedCanvas.width = 0;+ reducedCanvas.height = 0;}- draw () {+ draw() {if (this.renderingState !== RenderingStates.INITIAL) {- console.error('Must be in new state before drawing')- return Promise.resolve()+ console.error("Must be in new state before drawing");+ return Promise.resolve();}- const {pdfPage} = this+ const { pdfPage } = this;if (!pdfPage) {- this.renderingState = RenderingStates.FINISHED- return Promise.reject(new Error('pdfPage is not loaded'))+ this.renderingState = RenderingStates.FINISHED;+ return Promise.reject(new Error("pdfPage is not loaded"));}- this.renderingState = RenderingStates.RUNNING+ this.renderingState = RenderingStates.RUNNING;const finishRenderTask = async (error = null) => {// The renderTask may have been replaced by a new one, so only remove// the reference to the renderTask if it matches the one that is// triggering this callback.if (renderTask === this.renderTask) {- this.renderTask = null+ this.renderTask = null;}if (error instanceof RenderingCancelledException) {- return+ return;}- this.renderingState = RenderingStates.FINISHED- this._convertCanvasToImage(canvas)+ this.renderingState = RenderingStates.FINISHED;+ this._convertCanvasToImage(canvas);if (error) {- throw error+ throw error;}- }+ };// Render the thumbnail at a larger size and downsize the canvas (similar// to `setImage`), to improve consistency between thumbnails created by// the `draw` and `setImage` methods (fixes issue 8233).// NOTE: To primarily avoid increasing memory usage too much, but also to// reduce downsizing overhead, we purposely limit the up-scaling factor.- const {ctx, canvas, transform} =- this._getPageDrawContext(DRAW_UPSCALE_FACTOR)+ const { ctx, canvas, transform } =+ this._getPageDrawContext(DRAW_UPSCALE_FACTOR);const drawViewport = this.viewport.clone({scale: DRAW_UPSCALE_FACTOR * this.scale,- })+ });const renderContinueCallback = cont => {if (!this.renderingQueue.isHighestPriority(this)) {- this.renderingState = RenderingStates.PAUSED+ this.renderingState = RenderingStates.PAUSED;this.resume = () => {- this.renderingState = RenderingStates.RUNNING- cont()- }- return+ this.renderingState = RenderingStates.RUNNING;+ cont();+ };+ return;}- cont()- }+ cont();+ };const renderContext = {canvasContext: ctx,transform,viewport: drawViewport,optionalContentConfigPromise: this._optionalContentConfigPromise,- }- const renderTask = (this.renderTask = pdfPage.render(renderContext))- renderTask.onContinue = renderContinueCallback+ pageColors: this.pageColors,+ };+ const renderTask = (this.renderTask = pdfPage.render(renderContext));+ renderTask.onContinue = renderContinueCallback;const resultPromise = renderTask.promise.then(function () {- return finishRenderTask(null)+ return finishRenderTask(null);},function (error) {- return finishRenderTask(error)- },- )+ return finishRenderTask(error);+ }+ );resultPromise.finally(() => {// Zeroing the width and height causes Firefox to release graphics// resources immediately, which can greatly reduce memory consumption.- canvas.width = 0- canvas.height = 0+ canvas.width = 0;+ canvas.height = 0;// Only trigger cleanup, once rendering has finished, when the current// pageView is *not* cached on the `BaseViewer`-instance.- const pageCached = this.linkService.isPageCached(this.id)+ const pageCached = this.linkService.isPageCached(this.id);if (!pageCached) {- this.pdfPage?.cleanup()+ this.pdfPage?.cleanup();}- })+ });- return resultPromise+ return resultPromise;}- setImage (pageView) {- if (this._checkSetImageDisabled()) {- return- }+ setImage(pageView) {if (this.renderingState !== RenderingStates.INITIAL) {- return+ return;}- const {canvas, pdfPage} = pageView+ const { thumbnailCanvas: canvas, pdfPage, scale } = pageView;if (!canvas) {- return+ return;}if (!this.pdfPage) {- this.setPdfPage(pdfPage)+ this.setPdfPage(pdfPage);}- this.renderingState = RenderingStates.FINISHED- this._convertCanvasToImage(canvas)+ if (scale < this.scale) {+ // Avoid upscaling the image, since that makes the thumbnail look blurry.+ return;+ }+ this.renderingState = RenderingStates.FINISHED;+ this._convertCanvasToImage(canvas);}/*** @private*/- _reduceImage (img) {- const {ctx, canvas} = this._getPageDrawContext()+ _reduceImage(img) {+ const { ctx, canvas } = this._getPageDrawContext();if (img.width <= 2 * canvas.width) {ctx.drawImage(@@ -387,21 +382,21 @@ class PDFThumbnailView {0,0,canvas.width,- canvas.height,- )- return canvas+ canvas.height+ );+ return canvas;}// drawImage does an awful job of rescaling the image, doing it gradually.- let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS- let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS+ let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS;+ let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS;const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth,- reducedHeight,- )+ reducedHeight+ );while (reducedWidth > img.width || reducedHeight > img.height) {- reducedWidth >>= 1- reducedHeight >>= 1+ reducedWidth >>= 1;+ reducedHeight >>= 1;}reducedImageCtx.drawImage(img,@@ -412,8 +407,8 @@ class PDFThumbnailView {0,0,reducedWidth,- reducedHeight,- )+ reducedHeight+ );while (reducedWidth > 2 * canvas.width) {reducedImageCtx.drawImage(reducedImage,@@ -424,10 +419,10 @@ class PDFThumbnailView {0,0,reducedWidth >> 1,- reducedHeight >> 1,- )- reducedWidth >>= 1- reducedHeight >>= 1+ reducedHeight >> 1+ );+ reducedWidth >>= 1;+ reducedHeight >>= 1;}ctx.drawImage(reducedImage,@@ -438,17 +433,19 @@ class PDFThumbnailView {0,0,canvas.width,- canvas.height,- )- return canvas+ canvas.height+ );+ return canvas;}- get _thumbPageTitle () {+ get _thumbPageTitle() {+ // NOTEreturn window.siyuan.languages.thumbPageTitle.replace('{{page}}',this.pageLabel ?? this.id)}- get _thumbPageCanvas () {+ get _thumbPageCanvas() {+ // NOTEreturn window.siyuan.languages.thumbPage.replace('{{page}}',this.pageLabel ?? this.id)}@@ -456,17 +453,17 @@ class PDFThumbnailView {/*** @param {string|null} label*/- setPageLabel (label) {- this.pageLabel = typeof label === 'string' ? label : null+ setPageLabel(label) {+ this.pageLabel = typeof label === "string" ? label : null;+ // NOTEthis.anchor.title = this._thumbPageTitleif (this.renderingState !== RenderingStates.FINISHED) {- return+ return;}-this.image?.setAttribute('aria-label', this._thumbPageCanvas)}}-export { PDFThumbnailView, TempImageFactory }+export { PDFThumbnailView, TempImageFactory };diff --git a/app/src/asset/pdf/pdf_thumbnail_viewer.js b/app/src/asset/pdf/pdf_thumbnail_viewer.jsindex 44b8494cdc..05a1ee8a59 100644--- a/app/src/asset/pdf/pdf_thumbnail_viewer.js+++ b/app/src/asset/pdf/pdf_thumbnail_viewer.js@@ -13,6 +13,13 @@* limitations under the License.*/+/** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./interfaces").IL10n} IL10n */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+// eslint-disable-next-line max-len+/** @typedef {import("./pdf_rendering_queue").PDFRenderingQueue} PDFRenderingQueue */+import {getVisibleElements,isValidRotation,@@ -33,6 +40,9 @@ const THUMBNAIL_SELECTED_CLASS = "selected";* @property {IPDFLinkService} linkService - The navigation/linking service.* @property {PDFRenderingQueue} renderingQueue - The rendering queue object.* @property {IL10n} l10n - Localization service.+ * @property {Object} [pageColors] - Overwrites background and foreground colors+ * with user defined ones in order to improve readability in high contrast+ * mode.*//**@@ -42,20 +52,39 @@ class PDFThumbnailViewer {/*** @param {PDFThumbnailViewerOptions} options*/- constructor({ container, eventBus, linkService, renderingQueue, l10n }) {+ constructor({+ container,+ eventBus,+ linkService,+ renderingQueue,+ l10n,+ pageColors,+ }) {this.container = container;this.linkService = linkService;this.renderingQueue = renderingQueue;this.l10n = l10n;+ this.pageColors = pageColors || null;++ if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {+ if (+ this.pageColors &&+ !(+ CSS.supports("color", this.pageColors.background) &&+ CSS.supports("color", this.pageColors.foreground)+ )+ ) {+ if (this.pageColors.background || this.pageColors.foreground) {+ console.warn(+ "PDFThumbnailViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."+ );+ }+ this.pageColors = null;+ }+ }this.scroll = watchScroll(this.container, this._scrollUpdated.bind(this));this._resetView();-- eventBus._on("optionalcontentconfigchanged", () => {- // Ensure that the thumbnails always render with the *default* optional- // content configuration.- this._setImageDisabled = true;- });}/**@@ -144,12 +173,9 @@ class PDFThumbnailViewer {}cleanup() {- for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {- if (- this._thumbnails[i] &&- this._thumbnails[i].renderingState !== RenderingStates.FINISHED- ) {- this._thumbnails[i].reset();+ for (const thumbnail of this._thumbnails) {+ if (thumbnail.renderingState !== RenderingStates.FINISHED) {+ thumbnail.reset();}}TempImageFactory.destroyCanvas();@@ -163,8 +189,6 @@ class PDFThumbnailViewer {this._currentPageNumber = 1;this._pageLabels = null;this._pagesRotation = 0;- this._optionalContentConfigPromise = null;- this._setImageDisabled = false;// Remove the thumbnails from the DOM.this.container.textContent = "";@@ -187,53 +211,43 @@ class PDFThumbnailViewer {const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();firstPagePromise- .then(firstPdfPage => {- this._optionalContentConfigPromise = optionalContentConfigPromise;-- const pagesCount = pdfDocument.numPages;- const viewport = firstPdfPage.getViewport({ scale: 1 });- const checkSetImageDisabled = () => {- return this._setImageDisabled;- };-- for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {- const thumbnail = new PDFThumbnailView({- container: this.container,- id: pageNum,- defaultViewport: viewport.clone(),- optionalContentConfigPromise,- linkService: this.linkService,- renderingQueue: this.renderingQueue,- checkSetImageDisabled,- l10n: this.l10n,- });- this._thumbnails.push(thumbnail);- }- // Set the first `pdfPage` immediately, since it's already loaded,- // rather than having to repeat the `PDFDocumentProxy.getPage` call in- // the `this.#ensurePdfPageLoaded` method before rendering can start.- const firstThumbnailView = this._thumbnails[0];- if (firstThumbnailView) {- firstThumbnailView.setPdfPage(firstPdfPage);- }-- // Ensure that the current thumbnail is always highlighted on load.- const thumbnailView = this._thumbnails[this._currentPageNumber - 1];- thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);- })- .catch(reason => {- console.error("Unable to initialize thumbnail viewer", reason);- });+ .then(firstPdfPage => {+ const pagesCount = pdfDocument.numPages;+ const viewport = firstPdfPage.getViewport({ scale: 1 });++ for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {+ const thumbnail = new PDFThumbnailView({+ container: this.container,+ id: pageNum,+ defaultViewport: viewport.clone(),+ optionalContentConfigPromise,+ linkService: this.linkService,+ renderingQueue: this.renderingQueue,+ l10n: this.l10n,+ pageColors: this.pageColors,+ });+ this._thumbnails.push(thumbnail);+ }+ // Set the first `pdfPage` immediately, since it's already loaded,+ // rather than having to repeat the `PDFDocumentProxy.getPage` call in+ // the `this.#ensurePdfPageLoaded` method before rendering can start.+ this._thumbnails[0]?.setPdfPage(firstPdfPage);++ // Ensure that the current thumbnail is always highlighted on load.+ const thumbnailView = this._thumbnails[this._currentPageNumber - 1];+ thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);+ })+ .catch(reason => {+ console.error("Unable to initialize thumbnail viewer", reason);+ });}/*** @private*/_cancelRendering() {- for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {- if (this._thumbnails[i]) {- this._thumbnails[i].cancelRendering();- }+ for (const thumbnail of this._thumbnails) {+ thumbnail.cancelRendering();}}diff --git a/app/src/asset/pdf/pdf_viewer.component.js b/app/src/asset/pdf/pdf_viewer.component.jsindex 51d01d05e4..73a7925489 100644--- a/app/src/asset/pdf/pdf_viewer.component.js+++ b/app/src/asset/pdf/pdf_viewer.component.js@@ -24,17 +24,23 @@ import {PDFLinkService,SimpleLinkService,} from "./pdf_link_service.js";-import { parseQueryString, ProgressBar } from "./ui_utils.js";-import { PDFSinglePageViewer, PDFViewer } from "./pdf_viewer.js";+import {+ parseQueryString,+ ProgressBar,+ RenderingStates,+ ScrollMode,+ SpreadMode,+} from "./ui_utils.js";import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";import { DownloadManager } from "./download_manager.js";import { EventBus } from "./event_utils.js";-import { GenericL10n } from "./genericl10n.js";import { NullL10n } from "./l10n_utils.js";import { PDFFindController } from "./pdf_find_controller.js";import { PDFHistory } from "./pdf_history.js";import { PDFPageView } from "./pdf_page_view.js";import { PDFScriptingManager } from "./pdf_scripting_manager.js";+import { PDFSinglePageViewer } from "./pdf_single_page_viewer.js";+import { PDFViewer } from "./pdf_viewer.js";import { StructTreeLayerBuilder } from "./struct_tree_layer_builder.js";import { TextLayerBuilder } from "./text_layer_builder.js";import { XfaLayerBuilder } from "./xfa_layer_builder.js";@@ -52,7 +58,6 @@ export {DefaultXfaLayerFactory,DownloadManager,EventBus,- GenericL10n,LinkTarget,NullL10n,parseQueryString,@@ -64,7 +69,10 @@ export {PDFSinglePageViewer,PDFViewer,ProgressBar,+ RenderingStates,+ ScrollMode,SimpleLinkService,+ SpreadMode,StructTreeLayerBuilder,TextLayerBuilder,XfaLayerBuilder,diff --git a/app/src/asset/pdf/pdf_viewer.js b/app/src/asset/pdf/pdf_viewer.jsindex 7ca01ec045..e1d3e768f8 100644--- a/app/src/asset/pdf/pdf_viewer.js+++ b/app/src/asset/pdf/pdf_viewer.js@@ -13,27 +13,2238 @@* limitations under the License.*/-import { ScrollMode, SpreadMode } from "./ui_utils.js";-import { BaseViewer } from "./base_viewer.js";+/** @typedef {import("../src/display/api").PDFDocumentProxy} PDFDocumentProxy */+/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/optional_content_config").OptionalContentConfig} OptionalContentConfig */+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */+/** @typedef {import("./interfaces").IL10n} IL10n */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFAnnotationLayerFactory} IPDFAnnotationLayerFactory */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFAnnotationEditorLayerFactory} IPDFAnnotationEditorLayerFactory */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFStructTreeLayerFactory} IPDFStructTreeLayerFactory */+// eslint-disable-next-line max-len+/** @typedef {import("./interfaces").IPDFTextLayerFactory} IPDFTextLayerFactory */+/** @typedef {import("./interfaces").IPDFXfaLayerFactory} IPDFXfaLayerFactory */+// eslint-disable-next-line max-len+/** @typedef {import("./text_accessibility.js").TextAccessibilityManager} TextAccessibilityManager */-class PDFViewer extends BaseViewer {}+import {+ AnnotationEditorType,+ AnnotationEditorUIManager,+ AnnotationMode,+ createPromiseCapability,+ PermissionFlag,+ PixelsPerInch,+ version,+} from "./pdfjs";+import {+ DEFAULT_SCALE,+ DEFAULT_SCALE_DELTA,+ DEFAULT_SCALE_VALUE,+ docStyle,+ getVisibleElements,+ isPortraitOrientation,+ isValidRotation,+ isValidScrollMode,+ isValidSpreadMode,+ MAX_AUTO_SCALE,+ MAX_SCALE,+ MIN_SCALE,+ PresentationModeState,+ RendererType,+ RenderingStates,+ SCROLLBAR_PADDING,+ scrollIntoView,+ ScrollMode,+ SpreadMode,+ TextLayerMode,+ UNKNOWN_SCALE,+ VERTICAL_PADDING,+ watchScroll,+} from "./ui_utils.js";+import { AnnotationEditorLayerBuilder } from "./annotation_editor_layer_builder.js";+import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";+import { NullL10n } from "./l10n_utils.js";+import { PDFPageView } from "./pdf_page_view.js";+import { PDFRenderingQueue } from "./pdf_rendering_queue.js";+import { SimpleLinkService } from "./pdf_link_service.js";+import { StructTreeLayerBuilder } from "./struct_tree_layer_builder.js";+import { TextHighlighter } from "./text_highlighter.js";+import { TextLayerBuilder } from "./text_layer_builder.js";+import { XfaLayerBuilder } from "./xfa_layer_builder.js";++const DEFAULT_CACHE_SIZE = 10;+const ENABLE_PERMISSIONS_CLASS = "enablePermissions";++const PagesCountLimit = {+ FORCE_SCROLL_MODE_PAGE: 15000,+ FORCE_LAZY_PAGE_INIT: 7500,+ PAUSE_EAGER_PAGE_INIT: 250,+};++function isValidAnnotationEditorMode(mode) {+ return (+ Object.values(AnnotationEditorType).includes(mode) &&+ mode !== AnnotationEditorType.DISABLE+ );+}++/**+ * @typedef {Object} PDFViewerOptions+ * @property {HTMLDivElement} container - The container for the viewer element.+ * @property {HTMLDivElement} [viewer] - The viewer element.+ * @property {EventBus} eventBus - The application event bus.+ * @property {IPDFLinkService} linkService - The navigation/linking service.+ * @property {IDownloadManager} [downloadManager] - The download manager+ * component.+ * @property {PDFFindController} [findController] - The find controller+ * component.+ * @property {PDFScriptingManager} [scriptingManager] - The scripting manager+ * component.+ * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.+ * @property {boolean} [removePageBorders] - Removes the border shadow around+ * the pages. The default value is `false`.+ * @property {number} [textLayerMode] - Controls if the text layer used for+ * selection and searching is created. The constants from {TextLayerMode}+ * should be used. The default value is `TextLayerMode.ENABLE`.+ * @property {number} [annotationMode] - Controls if the annotation layer is+ * created, and if interactive form elements or `AnnotationStorage`-data are+ * being rendered. The constants from {@link AnnotationMode} should be used;+ * see also {@link RenderParameters} and {@link GetOperatorListParameters}.+ * The default value is `AnnotationMode.ENABLE_FORMS`.+ * @property {number} [annotationEditorMode] - Enables the creation and editing+ * of new Annotations. The constants from {@link AnnotationEditorType} should+ * be used. The default value is `AnnotationEditorType.NONE`.+ * @property {string} [imageResourcesPath] - Path for image resources, mainly+ * mainly for annotation icons. Include trailing slash.+ * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of+ * landscape pages upon printing. The default is `false`.+ * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default+ * value is `false`.+ * @property {number} [maxCanvasPixels] - The maximum supported canvas size in+ * total pixels, i.e. width * height. Use -1 for no limit. The default value+ * is 4096 * 4096 (16 mega-pixels).+ * @property {IL10n} l10n - Localization service.+ * @property {boolean} [enablePermissions] - Enables PDF document permissions,+ * when they exist. The default value is `false`.+ * @property {Object} [pageColors] - Overwrites background and foreground colors+ * with user defined ones in order to improve readability in high contrast+ * mode.+ */++class PDFPageViewBuffer {+ // Here we rely on the fact that `Set`s preserve the insertion order.+ #buf = new Set();++ #size = 0;++ constructor(size) {+ this.#size = size;+ }++ push(view) {+ const buf = this.#buf;+ if (buf.has(view)) {+ buf.delete(view); // Move the view to the "end" of the buffer.+ }+ buf.add(view);++ if (buf.size > this.#size) {+ this.#destroyFirstView();+ }+ }++ /**+ * After calling resize, the size of the buffer will be `newSize`.+ * The optional parameter `idsToKeep` is, if present, a Set of page-ids to+ * push to the back of the buffer, delaying their destruction. The size of+ * `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`+ * is larger than `newSize`, some of those pages will be destroyed anyway.+ */+ resize(newSize, idsToKeep = null) {+ this.#size = newSize;++ const buf = this.#buf;+ if (idsToKeep) {+ const ii = buf.size;+ let i = 1;+ for (const view of buf) {+ if (idsToKeep.has(view.id)) {+ buf.delete(view); // Move the view to the "end" of the buffer.+ buf.add(view);+ }+ if (++i > ii) {+ break;+ }+ }+ }++ while (buf.size > this.#size) {+ this.#destroyFirstView();+ }+ }++ has(view) {+ return this.#buf.has(view);+ }++ [Symbol.iterator]() {+ return this.#buf.keys();+ }++ #destroyFirstView() {+ const firstView = this.#buf.keys().next().value;++ firstView?.destroy();+ this.#buf.delete(firstView);+ }+}++/**+ * Simple viewer control to display PDF content/pages.+ *+ * @implements {IPDFAnnotationLayerFactory}+ * @implements {IPDFAnnotationEditorLayerFactory}+ * @implements {IPDFStructTreeLayerFactory}+ * @implements {IPDFTextLayerFactory}+ * @implements {IPDFXfaLayerFactory}+ */+class PDFViewer {+ #buffer = null;++ #annotationEditorMode = AnnotationEditorType.NONE;++ #annotationEditorUIManager = null;++ #annotationMode = AnnotationMode.ENABLE_FORMS;++ #enablePermissions = false;++ #previousContainerHeight = 0;++ #scrollModePageState = null;++ #onVisibilityChange = null;++ /**+ * @param {PDFViewerOptions} options+ */+ constructor(options) {+ // NOTE+ // const viewerVersion =+ // typeof PDFJSDev !== "undefined" ? PDFJSDev.eval("BUNDLE_VERSION") : null;+ // if (version !== viewerVersion) {+ // throw new Error(+ // `The API version "${version}" does not match the Viewer version "${viewerVersion}".`+ // );+ // }+ this.container = options.container;+ this.viewer = options.viewer || options.container.firstElementChild;++ if (+ typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")+ ) {+ if (+ !(+ this.container?.tagName.toUpperCase() === "DIV" &&+ this.viewer?.tagName.toUpperCase() === "DIV"+ )+ ) {+ throw new Error("Invalid `container` and/or `viewer` option.");+ }++ if (+ this.container.offsetParent &&+ getComputedStyle(this.container).position !== "absolute"+ ) {+ throw new Error("The `container` must be absolutely positioned.");+ }+ }+ this.eventBus = options.eventBus;+ this.linkService = options.linkService || new SimpleLinkService();+ this.downloadManager = options.downloadManager || null;+ this.findController = options.findController || null;+ this._scriptingManager = options.scriptingManager || null;+ this.removePageBorders = options.removePageBorders || false;+ this.textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;+ this.#annotationMode =+ options.annotationMode ?? AnnotationMode.ENABLE_FORMS;+ this.#annotationEditorMode =+ options.annotationEditorMode ?? AnnotationEditorType.NONE;+ this.imageResourcesPath = options.imageResourcesPath || "";+ this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;+ if (+ typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")+ ) {+ this.renderer = options.renderer || RendererType.CANVAS;+ }+ this.useOnlyCssZoom = options.useOnlyCssZoom || false;+ this.maxCanvasPixels = options.maxCanvasPixels;+ this.l10n = options.l10n || NullL10n;+ this.#enablePermissions = options.enablePermissions || false;+ this.pageColors = options.pageColors || null;++ if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {+ if (+ this.pageColors &&+ !(+ CSS.supports("color", this.pageColors.background) &&+ CSS.supports("color", this.pageColors.foreground)+ )+ ) {+ if (this.pageColors.background || this.pageColors.foreground) {+ console.warn(+ "PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used."+ );+ }+ this.pageColors = null;+ }+ }++ this.defaultRenderingQueue = !options.renderingQueue;+ if (this.defaultRenderingQueue) {+ // Custom rendering queue is not specified, using default one+ this.renderingQueue = new PDFRenderingQueue();+ this.renderingQueue.setViewer(this);+ } else {+ this.renderingQueue = options.renderingQueue;+ }++ this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));+ this.presentationModeState = PresentationModeState.UNKNOWN;+ this._onBeforeDraw = this._onAfterDraw = null;+ this._resetView();++ if (this.removePageBorders) {+ this.viewer.classList.add("removePageBorders");+ }+ this.updateContainerHeightCss();+ }++ get pagesCount() {+ return this._pages.length;+ }++ getPageView(index) {+ return this._pages[index];+ }++ /**+ * @type {boolean} - True if all {PDFPageView} objects are initialized.+ */+ get pageViewsReady() {+ if (!this._pagesCapability.settled) {+ return false;+ }+ // Prevent printing errors when 'disableAutoFetch' is set, by ensuring+ // that *all* pages have in fact been completely loaded.+ return this._pages.every(function (pageView) {+ return pageView?.pdfPage;+ });+ }++ /**+ * @type {boolean}+ */+ get renderForms() {+ return this.#annotationMode === AnnotationMode.ENABLE_FORMS;+ }++ /**+ * @type {boolean}+ */+ get enableScripting() {+ return !!this._scriptingManager;+ }++ /**+ * @type {number}+ */+ get currentPageNumber() {+ return this._currentPageNumber;+ }++ /**+ * @param {number} val - The page number.+ */+ set currentPageNumber(val) {+ if (!Number.isInteger(val)) {+ throw new Error("Invalid page number.");+ }+ if (!this.pdfDocument) {+ return;+ }+ // The intent can be to just reset a scroll position and/or scale.+ if (!this._setCurrentPageNumber(val, /* resetCurrentPageView = */ true)) {+ console.error(`currentPageNumber: "${val}" is not a valid page.`);+ }+ }++ /**+ * @returns {boolean} Whether the pageNumber is valid (within bounds).+ * @private+ */+ _setCurrentPageNumber(val, resetCurrentPageView = false) {+ if (this._currentPageNumber === val) {+ if (resetCurrentPageView) {+ this.#resetCurrentPageView();+ }+ return true;+ }++ if (!(0 < val && val <= this.pagesCount)) {+ return false;+ }+ const previous = this._currentPageNumber;+ this._currentPageNumber = val;++ this.eventBus.dispatch("pagechanging", {+ source: this,+ pageNumber: val,+ pageLabel: this._pageLabels?.[val - 1] ?? null,+ previous,+ });++ if (resetCurrentPageView) {+ this.#resetCurrentPageView();+ }+ return true;+ }++ /**+ * @type {string|null} Returns the current page label, or `null` if no page+ * labels exist.+ */+ get currentPageLabel() {+ return this._pageLabels?.[this._currentPageNumber - 1] ?? null;+ }++ /**+ * @param {string} val - The page label.+ */+ set currentPageLabel(val) {+ if (!this.pdfDocument) {+ return;+ }+ let page = val | 0; // Fallback page number.+ if (this._pageLabels) {+ const i = this._pageLabels.indexOf(val);+ if (i >= 0) {+ page = i + 1;+ }+ }+ // The intent can be to just reset a scroll position and/or scale.+ if (!this._setCurrentPageNumber(page, /* resetCurrentPageView = */ true)) {+ console.error(`currentPageLabel: "${val}" is not a valid page.`);+ }+ }++ /**+ * @type {number}+ */+ get currentScale() {+ return this._currentScale !== UNKNOWN_SCALE+ ? this._currentScale+ : DEFAULT_SCALE;+ }++ /**+ * @param {number} val - Scale of the pages in percents.+ */+ set currentScale(val) {+ if (isNaN(val)) {+ throw new Error("Invalid numeric scale.");+ }+ if (!this.pdfDocument) {+ return;+ }+ this._setScale(val, false);+ }++ /**+ * @type {string}+ */+ get currentScaleValue() {+ return this._currentScaleValue;+ }++ /**+ * @param val - The scale of the pages (in percent or predefined value).+ */+ set currentScaleValue(val) {+ if (!this.pdfDocument) {+ return;+ }+ this._setScale(val, false);+ }++ /**+ * @type {number}+ */+ get pagesRotation() {+ return this._pagesRotation;+ }++ /**+ * @param {number} rotation - The rotation of the pages (0, 90, 180, 270).+ */+ set pagesRotation(rotation) {+ if (!isValidRotation(rotation)) {+ throw new Error("Invalid pages rotation angle.");+ }+ if (!this.pdfDocument) {+ return;+ }+ // Normalize the rotation, by clamping it to the [0, 360) range.+ rotation %= 360;+ if (rotation < 0) {+ rotation += 360;+ }+ if (this._pagesRotation === rotation) {+ return; // The rotation didn't change.+ }+ this._pagesRotation = rotation;++ const pageNumber = this._currentPageNumber;++ const updateArgs = { rotation };+ for (const pageView of this._pages) {+ pageView.update(updateArgs);+ }+ // Prevent errors in case the rotation changes *before* the scale has been+ // set to a non-default value.+ if (this._currentScaleValue) {+ this._setScale(this._currentScaleValue, true);+ }++ this.eventBus.dispatch("rotationchanging", {+ source: this,+ pagesRotation: rotation,+ pageNumber,+ });++ if (this.defaultRenderingQueue) {+ this.update();+ }+ }++ get firstPagePromise() {+ return this.pdfDocument ? this._firstPageCapability.promise : null;+ }++ get onePageRendered() {+ return this.pdfDocument ? this._onePageRenderedCapability.promise : null;+ }++ get pagesPromise() {+ return this.pdfDocument ? this._pagesCapability.promise : null;+ }++ /**+ * Currently only *some* permissions are supported.+ * @returns {Object}+ */+ #initializePermissions(permissions) {+ const params = {+ annotationEditorMode: this.#annotationEditorMode,+ annotationMode: this.#annotationMode,+ textLayerMode: this.textLayerMode,+ };+ if (!permissions) {+ return params;+ }++ if (!permissions.includes(PermissionFlag.COPY)) {+ this.viewer.classList.add(ENABLE_PERMISSIONS_CLASS);+ }++ if (!permissions.includes(PermissionFlag.MODIFY_CONTENTS)) {+ params.annotationEditorMode = AnnotationEditorType.DISABLE;+ }++ if (+ !permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) &&+ !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS) &&+ this.#annotationMode === AnnotationMode.ENABLE_FORMS+ ) {+ params.annotationMode = AnnotationMode.ENABLE;+ }++ return params;+ }++ #onePageRenderedOrForceFetch() {+ // Unless the viewer *and* its pages are visible, rendering won't start and+ // `this._onePageRenderedCapability` thus won't be resolved.+ // To ensure that automatic printing, on document load, still works even in+ // those cases we force-allow fetching of all pages when:+ // - The current window/tab is inactive, which will prevent rendering since+ // `requestAnimationFrame` is being used; fixes bug 1746213.+ // - The viewer is hidden in the DOM, e.g. in a `display: none` <iframe>+ // element; fixes bug 1618621.+ // - The viewer is visible, but none of the pages are (e.g. if the+ // viewer is very small); fixes bug 1618955.+ if (+ document.visibilityState === "hidden" ||+ !this.container.offsetParent ||+ this._getVisiblePages().views.length === 0+ ) {+ return Promise.resolve();+ }++ // Handle the window/tab becoming inactive *after* rendering has started;+ // fixes (another part of) bug 1746213.+ const visibilityChangePromise = new Promise(resolve => {+ this.#onVisibilityChange = () => {+ if (document.visibilityState !== "hidden") {+ return;+ }+ resolve();++ document.removeEventListener(+ "visibilitychange",+ this.#onVisibilityChange+ );+ this.#onVisibilityChange = null;+ };+ document.addEventListener("visibilitychange", this.#onVisibilityChange);+ });++ return Promise.race([+ this._onePageRenderedCapability.promise,+ visibilityChangePromise,+ ]);+ }++ /**+ * @param {PDFDocumentProxy} pdfDocument+ */+ setDocument(pdfDocument) {+ if (this.pdfDocument) {+ this.eventBus.dispatch("pagesdestroy", { source: this });++ this._cancelRendering();+ this._resetView();++ this.findController?.setDocument(null);+ this._scriptingManager?.setDocument(null);++ if (this.#annotationEditorUIManager) {+ this.#annotationEditorUIManager.destroy();+ this.#annotationEditorUIManager = null;+ }+ }++ this.pdfDocument = pdfDocument;+ if (!pdfDocument) {+ return;+ }+ const isPureXfa = pdfDocument.isPureXfa;+ const pagesCount = pdfDocument.numPages;+ const firstPagePromise = pdfDocument.getPage(1);+ // Rendering (potentially) depends on this, hence fetching it immediately.+ const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();+ const permissionsPromise = this.#enablePermissions+ ? pdfDocument.getPermissions()+ : Promise.resolve();++ // Given that browsers don't handle huge amounts of DOM-elements very well,+ // enforce usage of PAGE-scrolling when loading *very* long/large documents.+ if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {+ console.warn(+ "Forcing PAGE-scrolling for performance reasons, given the length of the document."+ );+ const mode = (this._scrollMode = ScrollMode.PAGE);+ this.eventBus.dispatch("scrollmodechanged", { source: this, mode });+ }++ this._pagesCapability.promise.then(+ () => {+ this.eventBus.dispatch("pagesloaded", { source: this, pagesCount });+ },+ () => {+ /* Prevent "Uncaught (in promise)"-messages in the console. */+ }+ );++ this._onBeforeDraw = evt => {+ const pageView = this._pages[evt.pageNumber - 1];+ if (!pageView) {+ return;+ }+ // Add the page to the buffer at the start of drawing. That way it can be+ // evicted from the buffer and destroyed even if we pause its rendering.+ this.#buffer.push(pageView);+ };+ this.eventBus._on("pagerender", this._onBeforeDraw);++ this._onAfterDraw = evt => {+ if (evt.cssTransform || this._onePageRenderedCapability.settled) {+ return;+ }+ this._onePageRenderedCapability.resolve({ timestamp: evt.timestamp });++ this.eventBus._off("pagerendered", this._onAfterDraw);+ this._onAfterDraw = null;++ if (this.#onVisibilityChange) {+ document.removeEventListener(+ "visibilitychange",+ this.#onVisibilityChange+ );+ this.#onVisibilityChange = null;+ }+ };+ this.eventBus._on("pagerendered", this._onAfterDraw);++ // Fetch a single page so we can get a viewport that will be the default+ // viewport for all pages+ Promise.all([firstPagePromise, permissionsPromise])+ .then(([firstPdfPage, permissions]) => {+ if (pdfDocument !== this.pdfDocument) {+ return; // The document was closed while the first page resolved.+ }+ this._firstPageCapability.resolve(firstPdfPage);+ this._optionalContentConfigPromise = optionalContentConfigPromise;++ const { annotationEditorMode, annotationMode, textLayerMode } =+ this.#initializePermissions(permissions);++ if (annotationEditorMode !== AnnotationEditorType.DISABLE) {+ const mode = annotationEditorMode;++ if (isPureXfa) {+ console.warn("Warning: XFA-editing is not implemented.");+ } else if (isValidAnnotationEditorMode(mode)) {+ this.#annotationEditorUIManager = new AnnotationEditorUIManager(+ this.container,+ this.eventBus+ );+ if (mode !== AnnotationEditorType.NONE) {+ this.#annotationEditorUIManager.updateMode(mode);+ }+ } else {+ console.error(`Invalid AnnotationEditor mode: ${mode}`);+ }+ }++ const viewerElement =+ this._scrollMode === ScrollMode.PAGE ? null : this.viewer;+ const scale = this.currentScale;+ const viewport = firstPdfPage.getViewport({+ scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS,+ });+ const textLayerFactory =+ textLayerMode !== TextLayerMode.DISABLE && !isPureXfa ? this : null;+ const annotationLayerFactory =+ annotationMode !== AnnotationMode.DISABLE ? this : null;+ const xfaLayerFactory = isPureXfa ? this : null;+ const annotationEditorLayerFactory = this.#annotationEditorUIManager+ ? this+ : null;++ for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {+ const pageView = new PDFPageView({+ container: viewerElement,+ eventBus: this.eventBus,+ id: pageNum,+ scale,+ defaultViewport: viewport.clone(),+ optionalContentConfigPromise,+ renderingQueue: this.renderingQueue,+ textLayerFactory,+ textLayerMode,+ annotationLayerFactory,+ annotationMode,+ xfaLayerFactory,+ annotationEditorLayerFactory,+ textHighlighterFactory: this,+ structTreeLayerFactory: this,+ imageResourcesPath: this.imageResourcesPath,+ renderer:+ typeof PDFJSDev === "undefined" ||+ PDFJSDev.test("!PRODUCTION || GENERIC")+ ? this.renderer+ : null,+ useOnlyCssZoom: this.useOnlyCssZoom,+ maxCanvasPixels: this.maxCanvasPixels,+ pageColors: this.pageColors,+ l10n: this.l10n,+ });+ this._pages.push(pageView);+ }+ // Set the first `pdfPage` immediately, since it's already loaded,+ // rather than having to repeat the `PDFDocumentProxy.getPage` call in+ // the `this.#ensurePdfPageLoaded` method before rendering can start.+ const firstPageView = this._pages[0];+ if (firstPageView) {+ firstPageView.setPdfPage(firstPdfPage);+ this.linkService.cachePageRef(1, firstPdfPage.ref);+ }++ if (this._scrollMode === ScrollMode.PAGE) {+ // Ensure that the current page becomes visible on document load.+ this.#ensurePageViewVisible();+ } else if (this._spreadMode !== SpreadMode.NONE) {+ this._updateSpreadMode();+ }++ // Fetch all the pages since the viewport is needed before printing+ // starts to create the correct size canvas. Wait until one page is+ // rendered so we don't tie up too many resources early on.+ this.#onePageRenderedOrForceFetch().then(async () => {+ this.findController?.setDocument(pdfDocument); // Enable searching.+ this._scriptingManager?.setDocument(pdfDocument); // Enable scripting.++ if (this.#annotationEditorUIManager) {+ // Ensure that the Editor buttons, in the toolbar, are updated.+ this.eventBus.dispatch("annotationeditormodechanged", {+ source: this,+ mode: this.#annotationEditorMode,+ });+ }++ // In addition to 'disableAutoFetch' being set, also attempt to reduce+ // resource usage when loading *very* long/large documents.+ if (+ pdfDocument.loadingParams.disableAutoFetch ||+ pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT+ ) {+ // XXX: Printing is semi-broken with auto fetch disabled.+ this._pagesCapability.resolve();+ return;+ }+ let getPagesLeft = pagesCount - 1; // The first page was already loaded.++ if (getPagesLeft <= 0) {+ this._pagesCapability.resolve();+ return;+ }+ for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {+ const promise = pdfDocument.getPage(pageNum).then(+ pdfPage => {+ const pageView = this._pages[pageNum - 1];+ if (!pageView.pdfPage) {+ pageView.setPdfPage(pdfPage);+ }+ this.linkService.cachePageRef(pageNum, pdfPage.ref);+ if (--getPagesLeft === 0) {+ this._pagesCapability.resolve();+ }+ },+ reason => {+ console.error(+ `Unable to get page ${pageNum} to initialize viewer`,+ reason+ );+ if (--getPagesLeft === 0) {+ this._pagesCapability.resolve();+ }+ }+ );++ if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {+ await promise;+ }+ }+ });++ this.eventBus.dispatch("pagesinit", { source: this });++ pdfDocument.getMetadata().then(({ info }) => {+ if (pdfDocument !== this.pdfDocument) {+ return; // The document was closed while the metadata resolved.+ }+ if (info.Language) {+ this.viewer.lang = info.Language;+ }+ });++ if (this.defaultRenderingQueue) {+ this.update();+ }+ })+ .catch(reason => {+ console.error("Unable to initialize viewer", reason);++ this._pagesCapability.reject(reason);+ });+ }++ /**+ * @param {Array|null} labels+ */+ setPageLabels(labels) {+ if (!this.pdfDocument) {+ return;+ }+ if (!labels) {+ this._pageLabels = null;+ } else if (+ !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)+ ) {+ this._pageLabels = null;+ console.error(`setPageLabels: Invalid page labels.`);+ } else {+ this._pageLabels = labels;+ }+ // Update all the `PDFPageView` instances.+ for (let i = 0, ii = this._pages.length; i < ii; i++) {+ this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);+ }+ }-class PDFSinglePageViewer extends BaseViewer {_resetView() {- super._resetView();- this._scrollMode = ScrollMode.PAGE;+ this._pages = [];+ this._currentPageNumber = 1;+ this._currentScale = UNKNOWN_SCALE;+ this._currentScaleValue = null;+ this._pageLabels = null;+ this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);+ this._location = null;+ this._pagesRotation = 0;+ this._optionalContentConfigPromise = null;+ this._firstPageCapability = createPromiseCapability();+ this._onePageRenderedCapability = createPromiseCapability();+ this._pagesCapability = createPromiseCapability();+ this._scrollMode = ScrollMode.VERTICAL;+ this._previousScrollMode = ScrollMode.UNKNOWN;this._spreadMode = SpreadMode.NONE;++ this.#scrollModePageState = {+ previousPageNumber: 1,+ scrollDown: true,+ pages: [],+ };++ if (this._onBeforeDraw) {+ this.eventBus._off("pagerender", this._onBeforeDraw);+ this._onBeforeDraw = null;+ }+ if (this._onAfterDraw) {+ this.eventBus._off("pagerendered", this._onAfterDraw);+ this._onAfterDraw = null;+ }+ if (this.#onVisibilityChange) {+ document.removeEventListener(+ "visibilitychange",+ this.#onVisibilityChange+ );+ this.#onVisibilityChange = null;+ }+ // Remove the pages from the DOM...+ this.viewer.textContent = "";+ // ... and reset the Scroll mode CSS class(es) afterwards.+ this._updateScrollMode();++ this.viewer.removeAttribute("lang");+ // Reset all PDF document permissions.+ this.viewer.classList.remove(ENABLE_PERMISSIONS_CLASS);}- // eslint-disable-next-line accessor-pairs- set scrollMode(mode) {}+ #ensurePageViewVisible() {+ if (this._scrollMode !== ScrollMode.PAGE) {+ throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");+ }+ const pageNumber = this._currentPageNumber,+ state = this.#scrollModePageState,+ viewer = this.viewer;++ // Temporarily remove all the pages from the DOM...+ viewer.textContent = "";+ // ... and clear out the active ones.+ state.pages.length = 0;++ if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) {+ // Finally, append the new page to the viewer.+ const pageView = this._pages[pageNumber - 1];+ viewer.append(pageView.div);++ state.pages.push(pageView);+ } else {+ const pageIndexSet = new Set(),+ parity = this._spreadMode - 1;++ // Determine the pageIndices in the new spread.+ if (parity === -1) {+ // PresentationMode is active, with `SpreadMode.NONE` set.+ pageIndexSet.add(pageNumber - 1);+ } else if (pageNumber % 2 !== parity) {+ // Left-hand side page.+ pageIndexSet.add(pageNumber - 1);+ pageIndexSet.add(pageNumber);+ } else {+ // Right-hand side page.+ pageIndexSet.add(pageNumber - 2);+ pageIndexSet.add(pageNumber - 1);+ }++ // Finally, append the new pages to the viewer and apply the spreadMode.+ const spread = document.createElement("div");+ spread.className = "spread";++ if (this.isInPresentationMode) {+ const dummyPage = document.createElement("div");+ dummyPage.className = "dummyPage";+ spread.append(dummyPage);+ }++ for (const i of pageIndexSet) {+ const pageView = this._pages[i];+ if (!pageView) {+ continue;+ }+ spread.append(pageView.div);++ state.pages.push(pageView);+ }+ viewer.append(spread);+ }++ state.scrollDown = pageNumber >= state.previousPageNumber;+ state.previousPageNumber = pageNumber;+ }++ _scrollUpdate() {+ if (this.pagesCount === 0) {+ return;+ }+ this.update();+ }++ #scrollIntoView(pageView, pageSpot = null) {+ const { div, id } = pageView;++ if (this._scrollMode === ScrollMode.PAGE) {+ // Ensure that `this._currentPageNumber` is correct.+ this._setCurrentPageNumber(id);++ this.#ensurePageViewVisible();+ // Ensure that rendering always occurs, to avoid showing a blank page,+ // even if the current position doesn't change when the page is scrolled.+ this.update();+ }++ if (!pageSpot && !this.isInPresentationMode) {+ const left = div.offsetLeft + div.clientLeft,+ right = left + div.clientWidth;+ const { scrollLeft, clientWidth } = this.container;+ if (+ this._scrollMode === ScrollMode.HORIZONTAL ||+ left < scrollLeft ||+ right > scrollLeft + clientWidth+ ) {+ pageSpot = { left: 0, top: 0 };+ }+ }+ scrollIntoView(div, pageSpot);+ }++ /**+ * Prevent unnecessary re-rendering of all pages when the scale changes+ * only because of limited numerical precision.+ */+ #isSameScale(newScale) {+ return (+ newScale === this._currentScale ||+ Math.abs(newScale - this._currentScale) < 1e-15+ );+ }- _updateScrollMode() {}+ _setScaleUpdatePages(newScale, newValue, noScroll = false, preset = false) {+ this._currentScaleValue = newValue.toString();++ if (this.#isSameScale(newScale)) {+ if (preset) {+ this.eventBus.dispatch("scalechanging", {+ source: this,+ scale: newScale,+ presetValue: newValue,+ });+ }+ return;+ }++ docStyle.setProperty(+ "--scale-factor",+ newScale * PixelsPerInch.PDF_TO_CSS_UNITS+ );++ const updateArgs = { scale: newScale };+ for (const pageView of this._pages) {+ pageView.update(updateArgs);+ }+ this._currentScale = newScale;++ if (!noScroll) {+ let page = this._currentPageNumber,+ dest;+ if (+ this._location &&+ !(this.isInPresentationMode || this.isChangingPresentationMode)+ ) {+ page = this._location.pageNumber;+ dest = [+ null,+ { name: "XYZ" },+ this._location.left,+ this._location.top,+ null,+ ];+ }+ this.scrollPageIntoView({+ pageNumber: page,+ destArray: dest,+ allowNegativeOffset: true,+ });+ }++ this.eventBus.dispatch("scalechanging", {+ source: this,+ scale: newScale,+ presetValue: preset ? newValue : undefined,+ });++ if (this.defaultRenderingQueue) {+ this.update();+ }+ this.updateContainerHeightCss();+ }++ /**+ * @private+ */+ get _pageWidthScaleFactor() {+ if (+ this._spreadMode !== SpreadMode.NONE &&+ this._scrollMode !== ScrollMode.HORIZONTAL+ ) {+ return 2;+ }+ return 1;+ }++ _setScale(value, noScroll = false) {+ let scale = parseFloat(value);++ if (scale > 0) {+ this._setScaleUpdatePages(scale, value, noScroll, /* preset = */ false);+ } else {+ const currentPage = this._pages[this._currentPageNumber - 1];+ if (!currentPage) {+ return;+ }+ let hPadding = SCROLLBAR_PADDING,+ vPadding = VERTICAL_PADDING;++ if (this.isInPresentationMode) {+ hPadding = vPadding = 4;+ } else if (this.removePageBorders) {+ hPadding = vPadding = 0;+ } else if (this._scrollMode === ScrollMode.HORIZONTAL) {+ [hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.+ }+ const pageWidthScale =+ (((this.container.clientWidth - hPadding) / currentPage.width) *+ currentPage.scale) /+ this._pageWidthScaleFactor;+ const pageHeightScale =+ ((this.container.clientHeight - vPadding) / currentPage.height) *+ currentPage.scale;+ switch (value) {+ case "page-actual":+ scale = 1;+ break;+ case "page-width":+ scale = pageWidthScale;+ break;+ case "page-height":+ scale = pageHeightScale;+ break;+ case "page-fit":+ scale = Math.min(pageWidthScale, pageHeightScale);+ break;+ case "auto":+ // For pages in landscape mode, fit the page height to the viewer+ // *unless* the page would thus become too wide to fit horizontally.+ const horizontalScale = isPortraitOrientation(currentPage)+ ? pageWidthScale+ : Math.min(pageHeightScale, pageWidthScale);+ scale = Math.min(MAX_AUTO_SCALE, horizontalScale);+ break;+ default:+ console.error(`_setScale: "${value}" is an unknown zoom value.`);+ return;+ }+ this._setScaleUpdatePages(scale, value, noScroll, /* preset = */ true);+ }+ }++ /**+ * Refreshes page view: scrolls to the current page and updates the scale.+ */+ #resetCurrentPageView() {+ const pageView = this._pages[this._currentPageNumber - 1];++ if (this.isInPresentationMode) {+ // Fixes the case when PDF has different page sizes.+ this._setScale(this._currentScaleValue, true);+ }+ this.#scrollIntoView(pageView);+ }++ /**+ * @param {string} label - The page label.+ * @returns {number|null} The page number corresponding to the page label,+ * or `null` when no page labels exist and/or the input is invalid.+ */+ pageLabelToPageNumber(label) {+ if (!this._pageLabels) {+ return null;+ }+ const i = this._pageLabels.indexOf(label);+ if (i < 0) {+ return null;+ }+ return i + 1;+ }++ /**+ * @typedef {Object} ScrollPageIntoViewParameters+ * @property {number} pageNumber - The page number.+ * @property {Array} [destArray] - The original PDF destination array, in the+ * format: <page-ref> </XYZ|/FitXXX> <args..>+ * @property {boolean} [allowNegativeOffset] - Allow negative page offsets.+ * The default value is `false`.+ * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in+ * the destination array. The default value is `false`.+ */++ /**+ * Scrolls page into view.+ * @param {ScrollPageIntoViewParameters} params+ */+ scrollPageIntoView({+ pageNumber,+ destArray = null,+ allowNegativeOffset = false,+ ignoreDestinationZoom = false,+ }) {+ if (!this.pdfDocument) {+ return;+ }+ const pageView =+ Number.isInteger(pageNumber) && this._pages[pageNumber - 1];+ if (!pageView) {+ console.error(+ `scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`+ );+ return;+ }++ if (this.isInPresentationMode || !destArray) {+ this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);+ return;+ }+ let x = 0,+ y = 0;+ let width = 0,+ height = 0,+ widthScale,+ heightScale;+ const changeOrientation = pageView.rotation % 180 !== 0;+ const pageWidth =+ (changeOrientation ? pageView.height : pageView.width) /+ pageView.scale /+ PixelsPerInch.PDF_TO_CSS_UNITS;+ const pageHeight =+ (changeOrientation ? pageView.width : pageView.height) /+ pageView.scale /+ PixelsPerInch.PDF_TO_CSS_UNITS;+ let scale = 0;+ switch (destArray[1].name) {+ case "XYZ":+ x = destArray[2];+ y = destArray[3];+ scale = destArray[4];+ // If x and/or y coordinates are not supplied, default to+ // _top_ left of the page (not the obvious bottom left,+ // since aligning the bottom of the intended page with the+ // top of the window is rarely helpful).+ x = x !== null ? x : 0;+ y = y !== null ? y : pageHeight;+ break;+ case "Fit":+ case "FitB":+ scale = "page-fit";+ break;+ case "FitH":+ case "FitBH":+ y = destArray[2];+ scale = "page-width";+ // According to the PDF spec, section 12.3.2.2, a `null` value in the+ // parameter should maintain the position relative to the new page.+ if (y === null && this._location) {+ x = this._location.left;+ y = this._location.top;+ } else if (typeof y !== "number" || y < 0) {+ // The "top" value isn't optional, according to the spec, however some+ // bad PDF generators will pretend that it is (fixes bug 1663390).+ y = pageHeight;+ }+ break;+ case "FitV":+ case "FitBV":+ x = destArray[2];+ width = pageWidth;+ height = pageHeight;+ scale = "page-height";+ break;+ case "FitR":+ x = destArray[2];+ y = destArray[3];+ width = destArray[4] - x;+ height = destArray[5] - y;+ const hPadding = this.removePageBorders ? 0 : SCROLLBAR_PADDING;+ const vPadding = this.removePageBorders ? 0 : VERTICAL_PADDING;++ widthScale =+ (this.container.clientWidth - hPadding) /+ width /+ PixelsPerInch.PDF_TO_CSS_UNITS;+ heightScale =+ (this.container.clientHeight - vPadding) /+ height /+ PixelsPerInch.PDF_TO_CSS_UNITS;+ scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));+ break;+ default:+ console.error(+ `scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`+ );+ return;+ }++ if (!ignoreDestinationZoom) {+ if (scale && scale !== this._currentScale) {+ this.currentScaleValue = scale;+ } else if (this._currentScale === UNKNOWN_SCALE) {+ this.currentScaleValue = DEFAULT_SCALE_VALUE;+ }+ }++ if (scale === "page-fit" && !destArray[4]) {+ this.#scrollIntoView(pageView);+ return;+ }++ const boundingRect = [+ pageView.viewport.convertToViewportPoint(x, y),+ pageView.viewport.convertToViewportPoint(x + width, y + height),+ ];+ let left = Math.min(boundingRect[0][0], boundingRect[1][0]);+ let top = Math.min(boundingRect[0][1], boundingRect[1][1]);++ if (!allowNegativeOffset) {+ // Some bad PDF generators will create destinations with e.g. top values+ // that exceeds the page height. Ensure that offsets are not negative,+ // to prevent a previous page from becoming visible (fixes bug 874482).+ left = Math.max(left, 0);+ top = Math.max(top, 0);+ }+ this.#scrollIntoView(pageView, /* pageSpot = */ { left, top });+ }++ _updateLocation(firstPage) {+ const currentScale = this._currentScale;+ const currentScaleValue = this._currentScaleValue;+ const normalizedScaleValue =+ parseFloat(currentScaleValue) === currentScale+ ? Math.round(currentScale * 10000) / 100+ : currentScaleValue;++ const pageNumber = firstPage.id;+ const currentPageView = this._pages[pageNumber - 1];+ const container = this.container;+ const topLeft = currentPageView.getPagePoint(+ container.scrollLeft - firstPage.x,+ container.scrollTop - firstPage.y+ );+ const intLeft = Math.round(topLeft[0]);+ const intTop = Math.round(topLeft[1]);++ let pdfOpenParams = `#page=${pageNumber}`;+ if (!this.isInPresentationMode) {+ pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;+ }++ this._location = {+ pageNumber,+ scale: normalizedScaleValue,+ top: intTop,+ left: intLeft,+ rotation: this._pagesRotation,+ pdfOpenParams,+ };+ }++ update() {+ const visible = this._getVisiblePages();+ const visiblePages = visible.views,+ numVisiblePages = visiblePages.length;++ if (numVisiblePages === 0) {+ return;+ }+ const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);+ this.#buffer.resize(newCacheSize, visible.ids);++ this.renderingQueue.renderHighestPriority(visible);++ const isSimpleLayout =+ this._spreadMode === SpreadMode.NONE &&+ (this._scrollMode === ScrollMode.PAGE ||+ this._scrollMode === ScrollMode.VERTICAL);+ const currentId = this._currentPageNumber;+ let stillFullyVisible = false;++ for (const page of visiblePages) {+ if (page.percent < 100) {+ break;+ }+ if (page.id === currentId && isSimpleLayout) {+ stillFullyVisible = true;+ break;+ }+ }+ this._setCurrentPageNumber(+ stillFullyVisible ? currentId : visiblePages[0].id+ );++ this._updateLocation(visible.first);+ this.eventBus.dispatch("updateviewarea", {+ source: this,+ location: this._location,+ });+ }++ containsElement(element) {+ return this.container.contains(element);+ }++ focus() {+ this.container.focus();+ }++ get _isContainerRtl() {+ return getComputedStyle(this.container).direction === "rtl";+ }++ get isInPresentationMode() {+ return this.presentationModeState === PresentationModeState.FULLSCREEN;+ }++ get isChangingPresentationMode() {+ return this.presentationModeState === PresentationModeState.CHANGING;+ }++ get isHorizontalScrollbarEnabled() {+ return this.isInPresentationMode+ ? false+ : this.container.scrollWidth > this.container.clientWidth;+ }++ get isVerticalScrollbarEnabled() {+ return this.isInPresentationMode+ ? false+ : this.container.scrollHeight > this.container.clientHeight;+ }++ _getVisiblePages() {+ const views =+ this._scrollMode === ScrollMode.PAGE+ ? this.#scrollModePageState.pages+ : this._pages,+ horizontal = this._scrollMode === ScrollMode.HORIZONTAL,+ rtl = horizontal && this._isContainerRtl;++ return getVisibleElements({+ scrollEl: this.container,+ views,+ sortByVisibility: true,+ horizontal,+ rtl,+ });+ }++ /**+ * @param {number} pageNumber+ */+ isPageVisible(pageNumber) {+ if (!this.pdfDocument) {+ return false;+ }+ if (+ !(+ Number.isInteger(pageNumber) &&+ pageNumber > 0 &&+ pageNumber <= this.pagesCount+ )+ ) {+ console.error(`isPageVisible: "${pageNumber}" is not a valid page.`);+ return false;+ }+ return this._getVisiblePages().ids.has(pageNumber);+ }++ /**+ * @param {number} pageNumber+ */+ isPageCached(pageNumber) {+ if (!this.pdfDocument) {+ return false;+ }+ if (+ !(+ Number.isInteger(pageNumber) &&+ pageNumber > 0 &&+ pageNumber <= this.pagesCount+ )+ ) {+ console.error(`isPageCached: "${pageNumber}" is not a valid page.`);+ return false;+ }+ const pageView = this._pages[pageNumber - 1];+ return this.#buffer.has(pageView);+ }++ cleanup() {+ for (const pageView of this._pages) {+ if (pageView.renderingState !== RenderingStates.FINISHED) {+ pageView.reset();+ }+ }+ }++ /**+ * @private+ */+ _cancelRendering() {+ for (const pageView of this._pages) {+ pageView.cancelRendering();+ }+ }++ /**+ * @param {PDFPageView} pageView+ * @returns {Promise<PDFPageProxy | null>}+ */+ async #ensurePdfPageLoaded(pageView) {+ if (pageView.pdfPage) {+ return pageView.pdfPage;+ }+ try {+ const pdfPage = await this.pdfDocument.getPage(pageView.id);+ if (!pageView.pdfPage) {+ pageView.setPdfPage(pdfPage);+ }+ if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {+ this.linkService.cachePageRef(pageView.id, pdfPage.ref);+ }+ return pdfPage;+ } catch (reason) {+ console.error("Unable to get page for page view", reason);+ return null; // Page error -- there is nothing that can be done.+ }+ }++ #getScrollAhead(visible) {+ if (visible.first?.id === 1) {+ return true;+ } else if (visible.last?.id === this.pagesCount) {+ return false;+ }+ switch (this._scrollMode) {+ case ScrollMode.PAGE:+ return this.#scrollModePageState.scrollDown;+ case ScrollMode.HORIZONTAL:+ return this.scroll.right;+ }+ return this.scroll.down;+ }++ /**+ * Only show the `loadingIcon`-spinner on visible pages (see issue 14242).+ */+ #toggleLoadingIconSpinner(visibleIds) {+ for (const id of visibleIds) {+ const pageView = this._pages[id - 1];+ pageView?.toggleLoadingIconSpinner(/* viewVisible = */ true);+ }+ for (const pageView of this.#buffer) {+ if (visibleIds.has(pageView.id)) {+ // Handled above, since the "buffer" may not contain all visible pages.+ continue;+ }+ pageView.toggleLoadingIconSpinner(/* viewVisible = */ false);+ }+ }++ forceRendering(currentlyVisiblePages) {+ const visiblePages = currentlyVisiblePages || this._getVisiblePages();+ const scrollAhead = this.#getScrollAhead(visiblePages);+ const preRenderExtra =+ this._spreadMode !== SpreadMode.NONE &&+ this._scrollMode !== ScrollMode.HORIZONTAL;++ const pageView = this.renderingQueue.getHighestPriority(+ visiblePages,+ this._pages,+ scrollAhead,+ preRenderExtra+ );+ this.#toggleLoadingIconSpinner(visiblePages.ids);++ if (pageView) {+ this.#ensurePdfPageLoaded(pageView).then(() => {+ this.renderingQueue.renderView(pageView);+ });+ return true;+ }+ return false;+ }++ /**+ * @typedef {Object} CreateTextLayerBuilderParameters+ * @property {HTMLDivElement} textLayerDiv+ * @property {number} pageIndex+ * @property {PageViewport} viewport+ * @property {EventBus} eventBus+ * @property {TextHighlighter} highlighter+ * @property {TextAccessibilityManager} [accessibilityManager]+ */++ /**+ * @param {CreateTextLayerBuilderParameters}+ * @returns {TextLayerBuilder}+ */+ createTextLayerBuilder({+ textLayerDiv,+ pageIndex,+ viewport,+ eventBus,+ highlighter,+ accessibilityManager = null,+ }) {+ return new TextLayerBuilder({+ textLayerDiv,+ eventBus,+ pageIndex,+ viewport,+ highlighter,+ accessibilityManager,+ });+ }++ /**+ * @typedef {Object} CreateTextHighlighterParameters+ * @property {number} pageIndex+ * @property {EventBus} eventBus+ */++ /**+ * @param {CreateTextHighlighterParameters}+ * @returns {TextHighlighter}+ */+ createTextHighlighter({ pageIndex, eventBus }) {+ return new TextHighlighter({+ eventBus,+ pageIndex,+ findController: this.isInPresentationMode ? null : this.findController,+ });+ }++ /**+ * @typedef {Object} CreateAnnotationLayerBuilderParameters+ * @property {HTMLDivElement} pageDiv+ * @property {PDFPageProxy} pdfPage+ * @property {AnnotationStorage} [annotationStorage] - Storage for annotation+ * data in forms.+ * @property {string} [imageResourcesPath] - Path for image resources, mainly+ * for annotation icons. Include trailing slash.+ * @property {boolean} renderForms+ * @property {IL10n} l10n+ * @property {boolean} [enableScripting]+ * @property {Promise<boolean>} [hasJSActionsPromise]+ * @property {Object} [mouseState]+ * @property {Promise<Object<string, Array<Object>> | null>}+ * [fieldObjectsPromise]+ * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some+ * annotation ids with canvases used to render them.+ * @property {TextAccessibilityManager} [accessibilityManager]+ */++ /**+ * @param {CreateAnnotationLayerBuilderParameters}+ * @returns {AnnotationLayerBuilder}+ */+ createAnnotationLayerBuilder({+ pageDiv,+ pdfPage,+ annotationStorage = this.pdfDocument?.annotationStorage,+ imageResourcesPath = "",+ renderForms = true,+ l10n = NullL10n,+ enableScripting = this.enableScripting,+ hasJSActionsPromise = this.pdfDocument?.hasJSActions(),+ mouseState = this._scriptingManager?.mouseState,+ fieldObjectsPromise = this.pdfDocument?.getFieldObjects(),+ annotationCanvasMap = null,+ accessibilityManager = null,+ }) {+ return new AnnotationLayerBuilder({+ pageDiv,+ pdfPage,+ annotationStorage,+ imageResourcesPath,+ renderForms,+ linkService: this.linkService,+ downloadManager: this.downloadManager,+ l10n,+ enableScripting,+ hasJSActionsPromise,+ mouseState,+ fieldObjectsPromise,+ annotationCanvasMap,+ accessibilityManager,+ });+ }++ /**+ * @typedef {Object} CreateAnnotationEditorLayerBuilderParameters+ * @property {AnnotationEditorUIManager} [uiManager]+ * @property {HTMLDivElement} pageDiv+ * @property {PDFPageProxy} pdfPage+ * @property {IL10n} l10n+ * @property {AnnotationStorage} [annotationStorage] - Storage for annotation+ * @property {TextAccessibilityManager} [accessibilityManager]+ * data in forms.+ */++ /**+ * @param {CreateAnnotationEditorLayerBuilderParameters}+ * @returns {AnnotationEditorLayerBuilder}+ */+ createAnnotationEditorLayerBuilder({+ uiManager = this.#annotationEditorUIManager,+ pageDiv,+ pdfPage,+ accessibilityManager = null,+ l10n,+ annotationStorage = this.pdfDocument?.annotationStorage,+ }) {+ return new AnnotationEditorLayerBuilder({+ uiManager,+ pageDiv,+ pdfPage,+ annotationStorage,+ accessibilityManager,+ l10n,+ });+ }++ /**+ * @typedef {Object} CreateXfaLayerBuilderParameters+ * @property {HTMLDivElement} pageDiv+ * @property {PDFPageProxy} pdfPage+ * @property {AnnotationStorage} [annotationStorage] - Storage for annotation+ * data in forms.+ */++ /**+ * @param {CreateXfaLayerBuilderParameters}+ * @returns {XfaLayerBuilder}+ */+ createXfaLayerBuilder({+ pageDiv,+ pdfPage,+ annotationStorage = this.pdfDocument?.annotationStorage,+ }) {+ return new XfaLayerBuilder({+ pageDiv,+ pdfPage,+ annotationStorage,+ linkService: this.linkService,+ });+ }++ /**+ * @typedef {Object} CreateStructTreeLayerBuilderParameters+ * @property {PDFPageProxy} pdfPage+ */++ /**+ * @param {CreateStructTreeLayerBuilderParameters}+ * @returns {StructTreeLayerBuilder}+ */+ createStructTreeLayerBuilder({ pdfPage }) {+ return new StructTreeLayerBuilder({+ pdfPage,+ });+ }++ /**+ * @type {boolean} Whether all pages of the PDF document have identical+ * widths and heights.+ */+ get hasEqualPageSizes() {+ const firstPageView = this._pages[0];+ for (let i = 1, ii = this._pages.length; i < ii; ++i) {+ const pageView = this._pages[i];+ if (+ pageView.width !== firstPageView.width ||+ pageView.height !== firstPageView.height+ ) {+ return false;+ }+ }+ return true;+ }++ /**+ * Returns sizes of the pages.+ * @returns {Array} Array of objects with width/height/rotation fields.+ */+ getPagesOverview() {+ return this._pages.map(pageView => {+ const viewport = pageView.pdfPage.getViewport({ scale: 1 });++ if (!this.enablePrintAutoRotate || isPortraitOrientation(viewport)) {+ return {+ width: viewport.width,+ height: viewport.height,+ rotation: viewport.rotation,+ };+ }+ // Landscape orientation.+ return {+ width: viewport.height,+ height: viewport.width,+ rotation: (viewport.rotation - 90) % 360,+ };+ });+ }++ /**+ * @type {Promise<OptionalContentConfig | null>}+ */+ get optionalContentConfigPromise() {+ if (!this.pdfDocument) {+ return Promise.resolve(null);+ }+ if (!this._optionalContentConfigPromise) {+ console.error("optionalContentConfigPromise: Not initialized yet.");+ // Prevent issues if the getter is accessed *before* the `onePageRendered`+ // promise has resolved; won't (normally) happen in the default viewer.+ return this.pdfDocument.getOptionalContentConfig();+ }+ return this._optionalContentConfigPromise;+ }++ /**+ * @param {Promise<OptionalContentConfig>} promise - A promise that is+ * resolved with an {@link OptionalContentConfig} instance.+ */+ set optionalContentConfigPromise(promise) {+ if (!(promise instanceof Promise)) {+ throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);+ }+ if (!this.pdfDocument) {+ return;+ }+ if (!this._optionalContentConfigPromise) {+ // Ignore the setter *before* the `onePageRendered` promise has resolved,+ // since it'll be overwritten anyway; won't happen in the default viewer.+ return;+ }+ this._optionalContentConfigPromise = promise;++ const updateArgs = { optionalContentConfigPromise: promise };+ for (const pageView of this._pages) {+ pageView.update(updateArgs);+ }+ this.update();++ this.eventBus.dispatch("optionalcontentconfigchanged", {+ source: this,+ promise,+ });+ }++ /**+ * @type {number} One of the values in {ScrollMode}.+ */+ get scrollMode() {+ return this._scrollMode;+ }++ /**+ * @param {number} mode - The direction in which the document pages should be+ * laid out within the scrolling container.+ * The constants from {ScrollMode} should be used.+ */+ set scrollMode(mode) {+ if (this._scrollMode === mode) {+ return; // The Scroll mode didn't change.+ }+ if (!isValidScrollMode(mode)) {+ throw new Error(`Invalid scroll mode: ${mode}`);+ }+ if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {+ return; // Disabled for performance reasons.+ }+ this._previousScrollMode = this._scrollMode;++ this._scrollMode = mode;+ this.eventBus.dispatch("scrollmodechanged", { source: this, mode });++ this._updateScrollMode(/* pageNumber = */ this._currentPageNumber);+ }++ _updateScrollMode(pageNumber = null) {+ const scrollMode = this._scrollMode,+ viewer = this.viewer;++ viewer.classList.toggle(+ "scrollHorizontal",+ scrollMode === ScrollMode.HORIZONTAL+ );+ viewer.classList.toggle("scrollWrapped", scrollMode === ScrollMode.WRAPPED);++ if (!this.pdfDocument || !pageNumber) {+ return;+ }++ if (scrollMode === ScrollMode.PAGE) {+ this.#ensurePageViewVisible();+ } else if (this._previousScrollMode === ScrollMode.PAGE) {+ // Ensure that the current spreadMode is still applied correctly when+ // the *previous* scrollMode was `ScrollMode.PAGE`.+ this._updateSpreadMode();+ }+ // Non-numeric scale values can be sensitive to the scroll orientation.+ // Call this before re-scrolling to the current page, to ensure that any+ // changes in scale don't move the current page.+ if (this._currentScaleValue && isNaN(this._currentScaleValue)) {+ this._setScale(this._currentScaleValue, true);+ }+ this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);+ this.update();+ }++ /**+ * @type {number} One of the values in {SpreadMode}.+ */+ get spreadMode() {+ return this._spreadMode;+ }++ /**+ * @param {number} mode - Group the pages in spreads, starting with odd- or+ * even-number pages (unless `SpreadMode.NONE` is used).+ * The constants from {SpreadMode} should be used.+ */+ set spreadMode(mode) {+ if (this._spreadMode === mode) {+ return; // The Spread mode didn't change.+ }+ if (!isValidSpreadMode(mode)) {+ throw new Error(`Invalid spread mode: ${mode}`);+ }+ this._spreadMode = mode;+ this.eventBus.dispatch("spreadmodechanged", { source: this, mode });++ this._updateSpreadMode(/* pageNumber = */ this._currentPageNumber);+ }++ _updateSpreadMode(pageNumber = null) {+ if (!this.pdfDocument) {+ return;+ }+ const viewer = this.viewer,+ pages = this._pages;++ if (this._scrollMode === ScrollMode.PAGE) {+ this.#ensurePageViewVisible();+ } else {+ // Temporarily remove all the pages from the DOM.+ viewer.textContent = "";++ if (this._spreadMode === SpreadMode.NONE) {+ for (const pageView of this._pages) {+ viewer.append(pageView.div);+ }+ } else {+ const parity = this._spreadMode - 1;+ let spread = null;+ for (let i = 0, ii = pages.length; i < ii; ++i) {+ if (spread === null) {+ spread = document.createElement("div");+ spread.className = "spread";+ viewer.append(spread);+ } else if (i % 2 === parity) {+ spread = spread.cloneNode(false);+ viewer.append(spread);+ }+ spread.append(pages[i].div);+ }+ }+ }++ if (!pageNumber) {+ return;+ }+ // Non-numeric scale values can be sensitive to the scroll orientation.+ // Call this before re-scrolling to the current page, to ensure that any+ // changes in scale don't move the current page.+ if (this._currentScaleValue && isNaN(this._currentScaleValue)) {+ this._setScale(this._currentScaleValue, true);+ }+ this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);+ this.update();+ }++ /**+ * @private+ */+ _getPageAdvance(currentPageNumber, previous = false) {+ switch (this._scrollMode) {+ case ScrollMode.WRAPPED: {+ const { views } = this._getVisiblePages(),+ pageLayout = new Map();++ // Determine the current (visible) page layout.+ for (const { id, y, percent, widthPercent } of views) {+ if (percent === 0 || widthPercent < 100) {+ continue;+ }+ let yArray = pageLayout.get(y);+ if (!yArray) {+ pageLayout.set(y, (yArray ||= []));+ }+ yArray.push(id);+ }+ // Find the row of the current page.+ for (const yArray of pageLayout.values()) {+ const currentIndex = yArray.indexOf(currentPageNumber);+ if (currentIndex === -1) {+ continue;+ }+ const numPages = yArray.length;+ if (numPages === 1) {+ break;+ }+ // Handle documents with varying page sizes.+ if (previous) {+ for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {+ const currentId = yArray[i],+ expectedId = yArray[i + 1] - 1;+ if (currentId < expectedId) {+ return currentPageNumber - expectedId;+ }+ }+ } else {+ for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {+ const currentId = yArray[i],+ expectedId = yArray[i - 1] + 1;+ if (currentId > expectedId) {+ return expectedId - currentPageNumber;+ }+ }+ }+ // The current row is "complete", advance to the previous/next one.+ if (previous) {+ const firstId = yArray[0];+ if (firstId < currentPageNumber) {+ return currentPageNumber - firstId + 1;+ }+ } else {+ const lastId = yArray[numPages - 1];+ if (lastId > currentPageNumber) {+ return lastId - currentPageNumber + 1;+ }+ }+ break;+ }+ break;+ }+ case ScrollMode.HORIZONTAL: {+ break;+ }+ case ScrollMode.PAGE:+ case ScrollMode.VERTICAL: {+ if (this._spreadMode === SpreadMode.NONE) {+ break; // Normal vertical scrolling.+ }+ const parity = this._spreadMode - 1;++ if (previous && currentPageNumber % 2 !== parity) {+ break; // Left-hand side page.+ } else if (!previous && currentPageNumber % 2 === parity) {+ break; // Right-hand side page.+ }+ const { views } = this._getVisiblePages(),+ expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;++ for (const { id, percent, widthPercent } of views) {+ if (id !== expectedId) {+ continue;+ }+ if (percent > 0 && widthPercent === 100) {+ return 2;+ }+ break;+ }+ break;+ }+ }+ return 1;+ }++ /**+ * Go to the next page, taking scroll/spread-modes into account.+ * @returns {boolean} Whether navigation occured.+ */+ nextPage() {+ const currentPageNumber = this._currentPageNumber,+ pagesCount = this.pagesCount;++ if (currentPageNumber >= pagesCount) {+ return false;+ }+ const advance =+ this._getPageAdvance(currentPageNumber, /* previous = */ false) || 1;++ this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);+ return true;+ }++ /**+ * Go to the previous page, taking scroll/spread-modes into account.+ * @returns {boolean} Whether navigation occured.+ */+ previousPage() {+ const currentPageNumber = this._currentPageNumber;++ if (currentPageNumber <= 1) {+ return false;+ }+ const advance =+ this._getPageAdvance(currentPageNumber, /* previous = */ true) || 1;++ this.currentPageNumber = Math.max(currentPageNumber - advance, 1);+ return true;+ }++ /**+ * Increase the current zoom level one, or more, times.+ * @param {number} [steps] - Defaults to zooming once.+ */+ increaseScale(steps = 1) {+ let newScale = this._currentScale;+ do {+ newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);+ newScale = Math.ceil(newScale * 10) / 10;+ newScale = Math.min(MAX_SCALE, newScale);+ } while (--steps > 0 && newScale < MAX_SCALE);+ this.currentScaleValue = newScale;+ }++ /**+ * Decrease the current zoom level one, or more, times.+ * @param {number} [steps] - Defaults to zooming once.+ */+ decreaseScale(steps = 1) {+ let newScale = this._currentScale;+ do {+ newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);+ newScale = Math.floor(newScale * 10) / 10;+ newScale = Math.max(MIN_SCALE, newScale);+ } while (--steps > 0 && newScale > MIN_SCALE);+ this.currentScaleValue = newScale;+ }++ updateContainerHeightCss() {+ const height = this.container.clientHeight;++ if (height !== this.#previousContainerHeight) {+ this.#previousContainerHeight = height;++ docStyle.setProperty("--viewer-container-height", `${height}px`);+ }+ }++ /**+ * @type {number}+ */+ get annotationEditorMode() {+ return this.#annotationEditorUIManager+ ? this.#annotationEditorMode+ : AnnotationEditorType.DISABLE;+ }++ /**+ * @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)+ */+ set annotationEditorMode(mode) {+ if (!this.#annotationEditorUIManager) {+ throw new Error(`The AnnotationEditor is not enabled.`);+ }+ if (this.#annotationEditorMode === mode) {+ return; // The AnnotationEditor mode didn't change.+ }+ if (!isValidAnnotationEditorMode(mode)) {+ throw new Error(`Invalid AnnotationEditor mode: ${mode}`);+ }+ if (!this.pdfDocument) {+ return;+ }+ this.#annotationEditorMode = mode;+ this.eventBus.dispatch("annotationeditormodechanged", {+ source: this,+ mode,+ });++ this.#annotationEditorUIManager.updateMode(mode);+ }// eslint-disable-next-line accessor-pairs- set spreadMode(mode) {}+ set annotationEditorParams({ type, value }) {+ if (!this.#annotationEditorUIManager) {+ throw new Error(`The AnnotationEditor is not enabled.`);+ }+ this.#annotationEditorUIManager.updateParams(type, value);+ }- _updateSpreadMode() {}+ refresh() {+ if (!this.pdfDocument) {+ return;+ }+ const updateArgs = {};+ for (const pageView of this._pages) {+ pageView.update(updateArgs);+ }+ this.update();+ }}-export { PDFSinglePageViewer, PDFViewer };+export { PagesCountLimit, PDFPageViewBuffer, PDFViewer };diff --git a/app/src/asset/pdf/pdfjs.js b/app/src/asset/pdf/pdfjs.jsindex 4ca22379ae..aa9c3b69e0 100644--- a/app/src/asset/pdf/pdfjs.js+++ b/app/src/asset/pdf/pdfjs.js@@ -18,5 +18,5 @@const {addScriptSync} = require('../../protyle/util/addScript')const {Constants} = require('../../constants')-addScriptSync(`${Constants.PROTYLE_CDN}/js/pdf/pdf.js?v=2.14.102`, 'pdfjsScript')+addScriptSync(`${Constants.PROTYLE_CDN}/js/pdf/pdf.js?v=3.0.150`, 'pdfjsScript')module.exports = window["pdfjs-dist/build/pdf"];diff --git a/app/src/asset/pdf/secondary_toolbar.js b/app/src/asset/pdf/secondary_toolbar.jsindex 640af3ad3e..3c2260341d 100644--- a/app/src/asset/pdf/secondary_toolbar.js+++ b/app/src/asset/pdf/secondary_toolbar.js@@ -13,18 +13,15 @@* limitations under the License.*/-import { SCROLLBAR_PADDING, ScrollMode, SpreadMode } from "./ui_utils.js";+import { ScrollMode, SpreadMode } from "./ui_utils.js";import { CursorTool } from "./pdf_cursor_tools.js";-import { PagesCountLimit } from "./base_viewer.js";+import { PagesCountLimit } from "./pdf_viewer.js";/*** @typedef {Object} SecondaryToolbarOptions* @property {HTMLDivElement} toolbar - Container for the secondary toolbar.* @property {HTMLButtonElement} toggleButton - Button to toggle the visibility* of the secondary toolbar.- * @property {HTMLDivElement} toolbarButtonContainer - Container where all the- * toolbar buttons are placed. The maximum height of the toolbar is controlled- * dynamically by adjusting the 'max-height' CSS property of this DOM element.* @property {HTMLButtonElement} presentationModeButton - Button for entering* presentation mode.* @property {HTMLButtonElement} openFileButton - Button to open a file.@@ -52,24 +49,21 @@ import { PagesCountLimit } from "./base_viewer.js";class SecondaryToolbar {/*** @param {SecondaryToolbarOptions} options- * @param {HTMLDivElement} mainContainer* @param {EventBus} eventBus*/- constructor(options, mainContainer, eventBus) {+ constructor(options, eventBus, externalServices) {this.toolbar = options.toolbar;this.toggleButton = options.toggleButton;- this.toolbarButtonContainer = options.toolbarButtonContainer;this.buttons = [+ {+ element: options.presentationModeButton,+ eventName: "presentationmode",+ close: true,+ },// NOTE- // {- // element: options.presentationModeButton,- // eventName: "presentationmode",- // close: true,- // },- // { element: options.openFileButton, eventName: "openfile", close: true },// { element: options.printButton, eventName: "print", close: true },// { element: options.downloadButton, eventName: "download", close: true },- // { element: options.viewBookmarkButton, eventName: null, close: true },+ { element: options.viewBookmarkButton, eventName: null, close: true },{ element: options.firstPageButton, eventName: "firstpage", close: true },{ element: options.lastPageButton, eventName: "lastpage", close: true },{@@ -142,6 +136,14 @@ class SecondaryToolbar {close: true,},];+ // NOTE+ // if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {+ // this.buttons.push({+ // element: options.openFileButton,+ // eventName: "openfile",+ // close: true,+ // });+ // }this.items = {firstPage: options.firstPageButton,lastPage: options.lastPageButton,@@ -149,14 +151,9 @@ class SecondaryToolbar {pageRotateCcw: options.pageRotateCcwButton,};- this.mainContainer = mainContainer;this.eventBus = eventBus;-+ this.externalServices = externalServices;this.opened = false;- this.containerHeight = null;- this.previousContainerHeight = null;-- this.reset();// Bind the event listeners for click, cursor tool, and scroll/spread mode// actions.@@ -165,8 +162,7 @@ class SecondaryToolbar {this.#bindScrollModeListener(options);this.#bindSpreadModeListener(options);- // Bind the event listener for adjusting the 'max-height' of the toolbar.- this.eventBus._on("resize", this.#setMaxHeight.bind(this));+ this.reset();}/**@@ -219,6 +215,10 @@ class SecondaryToolbar {if (close) {this.close();}+ this.externalServices.reportTelemetry({+ type: "buttons",+ data: { id: element.id },+ });});}}@@ -231,8 +231,8 @@ class SecondaryToolbar {cursorSelectToolButton.classList.toggle("toggled", isSelect);cursorHandToolButton.classList.toggle("toggled", isHand);- cursorSelectToolButton.setAttribute("aria-checked", `${isSelect}`);- cursorHandToolButton.setAttribute("aria-checked", `${isHand}`);+ cursorSelectToolButton.setAttribute("aria-checked", isSelect);+ cursorHandToolButton.setAttribute("aria-checked", isHand);});}@@ -256,10 +256,10 @@ class SecondaryToolbar {scrollHorizontalButton.classList.toggle("toggled", isHorizontal);scrollWrappedButton.classList.toggle("toggled", isWrapped);- scrollPageButton.setAttribute("aria-checked", `${isPage}`);- scrollVerticalButton.setAttribute("aria-checked", `${isVertical}`);- scrollHorizontalButton.setAttribute("aria-checked", `${isHorizontal}`);- scrollWrappedButton.setAttribute("aria-checked", `${isWrapped}`);+ scrollPageButton.setAttribute("aria-checked", isPage);+ scrollVerticalButton.setAttribute("aria-checked", isVertical);+ scrollHorizontalButton.setAttribute("aria-checked", isHorizontal);+ scrollWrappedButton.setAttribute("aria-checked", isWrapped);// Permanently *disable* the Scroll buttons when PAGE-scrolling is being// enforced for *very* long/large documents; please see the `BaseViewer`.@@ -299,9 +299,9 @@ class SecondaryToolbar {spreadOddButton.classList.toggle("toggled", isOdd);spreadEvenButton.classList.toggle("toggled", isEven);- spreadNoneButton.setAttribute("aria-checked", `${isNone}`);- spreadOddButton.setAttribute("aria-checked", `${isOdd}`);- spreadEvenButton.setAttribute("aria-checked", `${isEven}`);+ spreadNoneButton.setAttribute("aria-checked", isNone);+ spreadOddButton.setAttribute("aria-checked", isOdd);+ spreadEvenButton.setAttribute("aria-checked", isEven);}this.eventBus._on("spreadmodechanged", spreadModeChanged);@@ -317,10 +317,9 @@ class SecondaryToolbar {return;}this.opened = true;- this.#setMaxHeight();-this.toggleButton.classList.add("toggled");this.toggleButton.setAttribute("aria-expanded", "true");+ // NOTEthis.toolbar.classList.remove("fn__hidden");}@@ -329,6 +328,7 @@ class SecondaryToolbar {return;}this.opened = false;+ // NOTEthis.toolbar.classList.add("fn__hidden");this.toggleButton.classList.remove("toggled");this.toggleButton.setAttribute("aria-expanded", "false");@@ -341,22 +341,6 @@ class SecondaryToolbar {this.open();}}-- #setMaxHeight() {- if (!this.opened) {- return; // Only adjust the 'max-height' if the toolbar is visible.- }- this.containerHeight = this.mainContainer.clientHeight;-- if (this.containerHeight === this.previousContainerHeight) {- return;- }- this.toolbarButtonContainer.style.maxHeight = `${- this.containerHeight - SCROLLBAR_PADDING- }px`;-- this.previousContainerHeight = this.containerHeight;- }}export { SecondaryToolbar };diff --git a/app/src/asset/pdf/struct_tree_layer_builder.js b/app/src/asset/pdf/struct_tree_layer_builder.jsindex 21ca321c84..41306d1c72 100644--- a/app/src/asset/pdf/struct_tree_layer_builder.js+++ b/app/src/asset/pdf/struct_tree_layer_builder.js@@ -13,6 +13,8 @@* limitations under the License.*/+/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */+const PDF_ROLE_TO_HTML_ROLE = {// Document level structure typesDocument: null, // There's a "document" role, but it doesn't make sense here.@@ -126,7 +128,7 @@ class StructTreeLayerBuilder {this._setAttributes(node.children[0], element);} else {for (const kid of node.children) {- element.appendChild(this._walk(kid));+ element.append(this._walk(kid));}}}diff --git a/app/src/asset/pdf/text_highlighter.js b/app/src/asset/pdf/text_highlighter.jsindex c8a3d729a6..65c3c1217c 100644--- a/app/src/asset/pdf/text_highlighter.js+++ b/app/src/asset/pdf/text_highlighter.js@@ -13,6 +13,10 @@* limitations under the License.*/+/** @typedef {import("./event_utils").EventBus} EventBus */+// eslint-disable-next-line max-len+/** @typedef {import("./pdf_find_controller").PDFFindController} PDFFindController */+/*** @typedef {Object} TextHighlighterOptions* @property {PDFFindController} findController@@ -172,8 +176,8 @@ class TextHighlighter {let div = textDivs[divIdx];if (div.nodeType === Node.TEXT_NODE) {const span = document.createElement("span");- div.parentNode.insertBefore(span, div);- span.appendChild(div);+ div.before(span);+ span.append(div);textDivs[divIdx] = span;div = span;}@@ -185,11 +189,11 @@ class TextHighlighter {if (className) {const span = document.createElement("span");span.className = `${className} appended`;- span.appendChild(node);- div.appendChild(span);+ span.append(node);+ div.append(span);return className.includes("selected") ? span.offsetLeft : 0;}- div.appendChild(node);+ div.append(node);return 0;}diff --git a/app/src/asset/pdf/text_layer_builder.js b/app/src/asset/pdf/text_layer_builder.jsindex b32fe683ef..2698a8a22d 100644--- a/app/src/asset/pdf/text_layer_builder.js+++ b/app/src/asset/pdf/text_layer_builder.js@@ -13,11 +13,16 @@* limitations under the License.*/+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */+/** @typedef {import("./event_utils").EventBus} EventBus */+/** @typedef {import("./text_highlighter").TextHighlighter} TextHighlighter */+// eslint-disable-next-line max-len+/** @typedef {import("./text_accessibility.js").TextAccessibilityManager} TextAccessibilityManager */+import { renderTextLayer } from "./pdfjs";import { getHighlight } from '../anno'-const EXPAND_DIVS_TIMEOUT = 300; // ms-/*** @typedef {Object} TextLayerBuilderOptions* @property {HTMLDivElement} textLayerDiv - The text layer container.@@ -26,8 +31,7 @@ const EXPAND_DIVS_TIMEOUT = 300; // ms* @property {PageViewport} viewport - The viewport of the text layer.* @property {TextHighlighter} highlighter - Optional object that will handle* highlighting text from the find controller.- * @property {boolean} enhanceTextSelection - Option to turn on improved- * text selection.+ * @property {TextAccessibilityManager} [accessibilityManager]*//**@@ -42,7 +46,7 @@ class TextLayerBuilder {pageIndex,viewport,highlighter = null,- enhanceTextSelection = false,+ accessibilityManager = null,}) {this.textLayerDiv = textLayerDiv;this.eventBus = eventBus;@@ -55,22 +59,17 @@ class TextLayerBuilder {this.textDivs = [];this.textLayerRenderTask = null;this.highlighter = highlighter;- this.enhanceTextSelection = enhanceTextSelection;+ this.accessibilityManager = accessibilityManager;- this._bindMouse();+ this.#bindMouse();}- /**- * @private- */- _finishRendering() {+ #finishRendering() {this.renderingDone = true;- if (!this.enhanceTextSelection) {- const endOfContent = document.createElement("div");- endOfContent.className = "endOfContent";- this.textLayerDiv.appendChild(endOfContent);- }+ const endOfContent = document.createElement("div");+ endOfContent.className = "endOfContent";+ this.textLayerDiv.append(endOfContent);this.eventBus.dispatch("textlayerrendered", {source: this,@@ -95,6 +94,7 @@ class TextLayerBuilder {this.textDivs.length = 0;this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);+ this.accessibilityManager?.setTextMapping(this.textDivs);const textLayerFrag = document.createDocumentFragment();this.textLayerRenderTask = renderTextLayer({@@ -105,13 +105,13 @@ class TextLayerBuilder {textDivs: this.textDivs,textContentItemsStr: this.textContentItemsStr,timeout,- enhanceTextSelection: this.enhanceTextSelection,});this.textLayerRenderTask.promise.then(() => {- this.textLayerDiv.appendChild(textLayerFrag);- this._finishRendering();+ this.textLayerDiv.append(textLayerFrag);+ this.#finishRendering();this.highlighter?.enable();+ this.accessibilityManager?.enable();},function (reason) {// Cancelled or failed to render text layer; skipping errors.@@ -128,6 +128,7 @@ class TextLayerBuilder {this.textLayerRenderTask = null;}this.highlighter?.disable();+ this.accessibilityManager?.disable();}setTextContentStream(readableStream) {@@ -144,26 +145,11 @@ class TextLayerBuilder {* Improves text selection by adding an additional div where the mouse was* clicked. This reduces flickering of the content if the mouse is slowly* dragged up or down.- *- * @private*/- _bindMouse() {+ #bindMouse() {const div = this.textLayerDiv;- let expandDivsTimer = null;div.addEventListener("mousedown", evt => {- if (this.enhanceTextSelection && this.textLayerRenderTask) {- this.textLayerRenderTask.expandTextDivs(true);- if (- (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) &&- expandDivsTimer- ) {- clearTimeout(expandDivsTimer);- expandDivsTimer = null;- }- return;- }-const end = div.querySelector(".endOfContent");if (!end) {return;@@ -175,11 +161,9 @@ class TextLayerBuilder {// However it does not work when selection is started on empty space.let adjustTop = evt.target !== div;if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {- adjustTop =- adjustTop &&- window- .getComputedStyle(end)- .getPropertyValue("-moz-user-select") !== "none";+ adjustTop &&=+ getComputedStyle(end).getPropertyValue("-moz-user-select") !==+ "none";}if (adjustTop) {const divBounds = div.getBoundingClientRect();@@ -191,20 +175,6 @@ class TextLayerBuilder {});div.addEventListener("mouseup", () => {- if (this.enhanceTextSelection && this.textLayerRenderTask) {- if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {- expandDivsTimer = setTimeout(() => {- if (this.textLayerRenderTask) {- this.textLayerRenderTask.expandTextDivs(false);- }- expandDivsTimer = null;- }, EXPAND_DIVS_TIMEOUT);- } else {- this.textLayerRenderTask.expandTextDivs(false);- }- return;- }-const end = div.querySelector(".endOfContent");if (!end) {return;diff --git a/app/src/asset/pdf/toolbar.js b/app/src/asset/pdf/toolbar.jsindex 5e36e2d1ce..3c5e491ae2 100644--- a/app/src/asset/pdf/toolbar.js+++ b/app/src/asset/pdf/toolbar.js@@ -17,12 +17,14 @@ import {animationStarted,DEFAULT_SCALE,DEFAULT_SCALE_VALUE,+ docStyle,MAX_SCALE,MIN_SCALE,noContextMenuHandler,-} from './ui_utils.js'+} from "./ui_utils.js";+import { AnnotationEditorType } from "./pdfjs";-const PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading'+const PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";/*** @typedef {Object} ToolbarOptions@@ -40,38 +42,60 @@ const PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading'* @property {HTMLButtonElement} zoomOut - Button to zoom out the pages.* @property {HTMLButtonElement} viewFind - Button to open find bar.* @property {HTMLButtonElement} openFile - Button to open a new document.- * @property {HTMLButtonElement} presentationModeButton - Button to switch to- * presentation mode.+ * @property {HTMLButtonElement} editorFreeTextButton - Button to switch to+ * FreeText editing.* @property {HTMLButtonElement} download - Button to download the document.- * @property {HTMLAnchorElement} viewBookmark - Button to obtain a bookmark link- * to the current location in the document.*/class Toolbar {+ #wasLocalized = false;+/*** @param {ToolbarOptions} options* @param {EventBus} eventBus* @param {IL10n} l10n - Localization service.*/- constructor (options, eventBus, l10n) {- this.toolbar = options.container- this.eventBus = eventBus- this.l10n = l10n+ constructor(options, eventBus, l10n) {+ this.toolbar = options.container;+ this.eventBus = eventBus;+ this.l10n = l10n;this.buttons = [- {element: options.previous, eventName: 'previouspage'},- {element: options.next, eventName: 'nextpage'},- {element: options.zoomIn, eventName: 'zoomin'},- {element: options.zoomOut, eventName: 'zoomout'},+ { element: options.previous, eventName: "previouspage" },+ { element: options.next, eventName: "nextpage" },+ { element: options.zoomIn, eventName: "zoomin" },+ { element: options.zoomOut, eventName: "zoomout" },// NOTE- // {element: options.openFile, eventName: 'openfile'},- // {element: options.print, eventName: 'print'},- {- element: options.presentationModeButton,- eventName: 'presentationmode',- },- // {element: options.download, eventName: 'download'},- {element: options.viewBookmark, eventName: null},- ]+ // { element: options.print, eventName: "print" },+ // { element: options.download, eventName: "download" },+ // {+ // element: options.editorFreeTextButton,+ // eventName: "switchannotationeditormode",+ // eventDetails: {+ // get mode() {+ // const { classList } = options.editorFreeTextButton;+ // return classList.contains("toggled")+ // ? AnnotationEditorType.NONE+ // : AnnotationEditorType.FREETEXT;+ // },+ // },+ // },+ // {+ // element: options.editorInkButton,+ // eventName: "switchannotationeditormode",+ // eventDetails: {+ // get mode() {+ // const { classList } = options.editorInkButton;+ // return classList.contains("toggled")+ // ? AnnotationEditorType.NONE+ // : AnnotationEditorType.INK;+ // },+ // },+ // },+ ];+ // NOTE+ // if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {+ // this.buttons.push({ element: options.openFile, eventName: "openfile" });+ // }this.items = {numPages: options.numPages,pageNumber: options.pageNumber,@@ -81,205 +105,251 @@ class Toolbar {next: options.next,zoomIn: options.zoomIn,zoomOut: options.zoomOut,- }-- this._wasLocalized = false- this.reset()+ };// Bind the event listeners for click and various other actions.- this._bindListeners()+ this.#bindListeners(options);++ this.reset();}- setPageNumber (pageNumber, pageLabel) {- this.pageNumber = pageNumber- this.pageLabel = pageLabel- this._updateUIState(false)+ setPageNumber(pageNumber, pageLabel) {+ this.pageNumber = pageNumber;+ this.pageLabel = pageLabel;+ this.#updateUIState(false);}- setPagesCount (pagesCount, hasPageLabels) {- this.pagesCount = pagesCount- this.hasPageLabels = hasPageLabels- this._updateUIState(true)+ setPagesCount(pagesCount, hasPageLabels) {+ this.pagesCount = pagesCount;+ this.hasPageLabels = hasPageLabels;+ this.#updateUIState(true);}- setPageScale (pageScaleValue, pageScale) {- this.pageScaleValue = (pageScaleValue || pageScale).toString()- this.pageScale = pageScale- this._updateUIState(false)+ setPageScale(pageScaleValue, pageScale) {+ this.pageScaleValue = (pageScaleValue || pageScale).toString();+ this.pageScale = pageScale;+ this.#updateUIState(false);}- reset () {- this.pageNumber = 0- this.pageLabel = null- this.hasPageLabels = false- this.pagesCount = 0- this.pageScaleValue = DEFAULT_SCALE_VALUE- this.pageScale = DEFAULT_SCALE- this._updateUIState(true)- this.updateLoadingIndicatorState()+ reset() {+ this.pageNumber = 0;+ this.pageLabel = null;+ this.hasPageLabels = false;+ this.pagesCount = 0;+ this.pageScaleValue = DEFAULT_SCALE_VALUE;+ this.pageScale = DEFAULT_SCALE;+ this.#updateUIState(true);+ this.updateLoadingIndicatorState();++ // Reset the Editor buttons too, since they're document specific.+ this.eventBus.dispatch("toolbarreset", { source: this });}- _bindListeners () {- const {pageNumber, scaleSelect} = this.items- const self = this+ #bindListeners(options) {+ const { pageNumber, scaleSelect } = this.items;+ const self = this;// The buttons within the toolbar.- for (const {element, eventName} of this.buttons) {- element.addEventListener('click', evt => {+ for (const { element, eventName, eventDetails } of this.buttons) {+ element.addEventListener("click", evt => {if (eventName !== null) {- this.eventBus.dispatch(eventName, {source: this})+ const details = { source: this };+ if (eventDetails) {+ for (const property in eventDetails) {+ details[property] = eventDetails[property];+ }+ }+ this.eventBus.dispatch(eventName, details);}- })+ });}// The non-button elements within the toolbar.- pageNumber.addEventListener('click', function () {- this.select()- })- pageNumber.addEventListener('change', function () {- self.eventBus.dispatch('pagenumberchanged', {+ pageNumber.addEventListener("click", function () {+ this.select();+ });+ pageNumber.addEventListener("change", function () {+ self.eventBus.dispatch("pagenumberchanged", {source: self,value: this.value,- })- })+ });+ });- scaleSelect.addEventListener('change', function () {- if (this.value === 'custom') {- return+ scaleSelect.addEventListener("change", function () {+ if (this.value === "custom") {+ return;}- self.eventBus.dispatch('scalechanged', {+ self.eventBus.dispatch("scalechanged", {source: self,value: this.value,- })- })+ });+ });// Here we depend on browsers dispatching the "click" event *after* the// "change" event, when the <select>-element changes.- scaleSelect.addEventListener('click', function (evt) {- const target = evt.target+ scaleSelect.addEventListener("click", function (evt) {+ const target = evt.target;// Remove focus when an <option>-element was *clicked*, to improve the UX// for mouse users (fixes bug 1300525 and issue 4923).if (this.value === self.pageScaleValue &&- target.tagName.toUpperCase() === 'OPTION'+ target.tagName.toUpperCase() === "OPTION") {- this.blur()+ this.blur();}- })+ });// Suppress context menus for some controls.- scaleSelect.oncontextmenu = noContextMenuHandler+ scaleSelect.oncontextmenu = noContextMenuHandler;++ this.eventBus._on("localized", () => {+ this.#wasLocalized = true;+ this.#adjustScaleWidth();+ this.#updateUIState(true);+ });- this.eventBus._on('localized', () => {- this._wasLocalized = true- this._adjustScaleWidth()- this._updateUIState(true)- })+ // NOTE+ // this.#bindEditorToolsListener(options);+ }++ #bindEditorToolsListener({+ editorFreeTextButton,+ editorFreeTextParamsToolbar,+ editorInkButton,+ editorInkParamsToolbar,+ }) {+ const editorModeChanged = (evt, disableButtons = false) => {+ const editorButtons = [+ {+ mode: AnnotationEditorType.FREETEXT,+ button: editorFreeTextButton,+ toolbar: editorFreeTextParamsToolbar,+ },+ {+ mode: AnnotationEditorType.INK,+ button: editorInkButton,+ toolbar: editorInkParamsToolbar,+ },+ ];++ for (const { mode, button, toolbar } of editorButtons) {+ const checked = mode === evt.mode;+ button.classList.toggle("toggled", checked);+ button.setAttribute("aria-checked", checked);+ button.disabled = disableButtons;+ // NOTE+ toolbar?.classList.toggle("fn__hidden", !checked);+ }+ };+ this.eventBus._on("annotationeditormodechanged", editorModeChanged);++ this.eventBus._on("toolbarreset", evt => {+ if (evt.source === this) {+ editorModeChanged(+ { mode: AnnotationEditorType.NONE },+ /* disableButtons = */ true+ );+ }+ });}- _updateUIState (resetNumPages = false) {- if (!this._wasLocalized) {+ #updateUIState(resetNumPages = false) {+ if (!this.#wasLocalized) {// Don't update the UI state until we localize the toolbar.- return+ return;}- const {pageNumber, pagesCount, pageScaleValue, pageScale, items} = this+ const { pageNumber, pagesCount, pageScaleValue, pageScale, items } = this;if (resetNumPages) {if (this.hasPageLabels) {- items.pageNumber.type = 'text'+ items.pageNumber.type = "text";} else {- items.pageNumber.type = 'number'+ items.pageNumber.type = "number";items.numPages.textContent = "/ " + pagesCount;}- items.pageNumber.max = pagesCount+ items.pageNumber.max = pagesCount;}if (this.hasPageLabels) {- items.pageNumber.value = this.pageLabel+ items.pageNumber.value = this.pageLabel;items.numPages.textContent = `(${pageNumber} / ${pagesCount})`} else {- items.pageNumber.value = pageNumber+ items.pageNumber.value = pageNumber;}- items.previous.disabled = pageNumber <= 1- items.next.disabled = pageNumber >= pagesCount+ items.previous.disabled = pageNumber <= 1;+ items.next.disabled = pageNumber >= pagesCount;- items.zoomOut.disabled = pageScale <= MIN_SCALE- items.zoomIn.disabled = pageScale >= MAX_SCALE+ items.zoomOut.disabled = pageScale <= MIN_SCALE;+ items.zoomIn.disabled = pageScale >= MAX_SCALE;- let predefinedValueFound = false+ // NOTE+ let predefinedValueFound = false;for (const option of items.scaleSelect.options) {if (option.value !== pageScaleValue) {- option.selected = false- continue+ option.selected = false;+ continue;}- option.selected = true- predefinedValueFound = true+ option.selected = true;+ predefinedValueFound = true;}if (!predefinedValueFound) {- items.customScaleOption.textContent = `${Math.round(pageScale * 10000) / 100}%`- items.customScaleOption.selected = true+ items.customScaleOption.textContent = `${Math.round(pageScale * 10000) / 100}%`;+ items.customScaleOption.selected = true;}}- updateLoadingIndicatorState (loading = false) {- const pageNumberInput = this.items.pageNumber+ updateLoadingIndicatorState(loading = false) {+ const { pageNumber } = this.items;- pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading)+ pageNumber.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);}/*** Increase the width of the zoom dropdown DOM element if, and only if, it's* too narrow to fit the *longest* of the localized strings.- * @private*/- async _adjustScaleWidth () {- const {items, l10n} = this+ async #adjustScaleWidth() {+ const { items, l10n } = this;++ // NOTE+ const predefinedValuesPromise = [+ window.siyuan.languages.pageScaleAuto,+ window.siyuan.languages.pageScaleActual,+ window.siyuan.languages.pageScaleFit,+ window.siyuan.languages.pageScaleWidth];++ await animationStarted;const style = getComputedStyle(items.scaleSelect),scaleSelectContainerWidth = parseInt(- style.getPropertyValue('--scale-select-container-width'),- 10,+ style.getPropertyValue("--scale-select-container-width"),+ 10),scaleSelectOverflow = parseInt(- style.getPropertyValue('--scale-select-overflow'),- 10,- )+ style.getPropertyValue("--scale-select-overflow"),+ 10+ );// The temporary canvas is used to measure text length in the DOM.- let canvas = document.createElement('canvas')- if (- typeof PDFJSDev === 'undefined' ||- PDFJSDev.test('MOZCENTRAL || GENERIC')- ) {- canvas.mozOpaque = true- }- let ctx = canvas.getContext('2d', {alpha: false})+ const canvas = document.createElement("canvas");+ const ctx = canvas.getContext("2d", { alpha: false });+ ctx.font = `${style.fontSize} ${style.fontFamily}`;- await animationStarted- ctx.font = `${style.fontSize} ${style.fontFamily}`-- let maxWidth = 0-- for (const predefinedValue of [- window.siyuan.languages.pageScaleAuto,- window.siyuan.languages.pageScaleActual,- window.siyuan.languages.pageScaleFit,- window.siyuan.languages.pageScaleWidth]) {- const {width} = ctx.measureText(predefinedValue)+ let maxWidth = 0;+ for (const predefinedValue of predefinedValuesPromise) {+ const { width } = ctx.measureText(predefinedValue);if (width > maxWidth) {- maxWidth = width+ maxWidth = width;}}- maxWidth += 2 * scaleSelectOverflow+ maxWidth += 2 * scaleSelectOverflow;if (maxWidth > scaleSelectContainerWidth) {- const doc = document.documentElement- doc.style.setProperty('--scale-select-container-width', `${maxWidth}px`)+ docStyle.setProperty("--scale-select-container-width", `${maxWidth}px`);}// Zeroing the width and height cause Firefox to release graphics resources// immediately, which can greatly reduce memory consumption.- canvas.width = 0- canvas.height = 0- canvas = ctx = null+ canvas.width = 0;+ canvas.height = 0;}}-export { Toolbar }+export { Toolbar };diff --git a/app/src/asset/pdf/ui_utils.js b/app/src/asset/pdf/ui_utils.jsindex 879ffa4235..920939da7c 100644--- a/app/src/asset/pdf/ui_utils.js+++ b/app/src/asset/pdf/ui_utils.js@@ -23,8 +23,6 @@ const MAX_AUTO_SCALE = 1.25;const SCROLLBAR_PADDING = 40;const VERTICAL_PADDING = 5;-const LOADINGBAR_END_OFFSET_VAR = "--loadingBar-end-offset";-const RenderingStates = {INITIAL: 0,RUNNING: 1,@@ -48,15 +46,17 @@ const SidebarView = {LAYERS: 4,};-const RendererType = {- CANVAS: "canvas",- SVG: "svg",-};+const RendererType =+ typeof PDFJSDev === "undefined" || PDFJSDev.test("!PRODUCTION || GENERIC")+ ? {+ CANVAS: "canvas",+ SVG: "svg",+ }+ : null;const TextLayerMode = {DISABLE: 0,ENABLE: 1,- ENABLE_ENHANCE: 2,};const ScrollMode = {@@ -129,7 +129,7 @@ function scrollIntoView(element, spot, scrollMatches = false) {(scrollMatches &&(parent.classList.contains("markedContent") ||getComputedStyle(parent).overflow === "hidden"))- ) {+ ) {offsetY += parent.offsetTop;offsetX += parent.offsetLeft;@@ -465,12 +465,12 @@ function backtrackBeforeAllVisibleElements(index, views, top) {* @returns {Object} `{ first, last, views: [{ id, x, y, view, percent }] }`*/function getVisibleElements({- scrollEl,- views,- sortByVisibility = false,- horizontal = false,- rtl = false,- }) {+ scrollEl,+ views,+ sortByVisibility = false,+ horizontal = false,+ rtl = false,+}) {const top = scrollEl.scrollTop,bottom = top + scrollEl.clientHeight;const left = scrollEl.scrollLeft,@@ -590,7 +590,7 @@ function getVisibleElements({}const first = visible[0],- last = visible[visible.length - 1];+ last = visible.at(-1);if (sortByVisibility) {visible.sort(function (a, b) {@@ -679,49 +679,43 @@ const animationStarted = new Promise(function (resolve) {window.requestAnimationFrame(resolve);});+const docStyle =+ typeof PDFJSDev !== "undefined" &&+ PDFJSDev.test("LIB") &&+ typeof document === "undefined"+ ? null+ : document.documentElement.style;+function clamp(v, min, max) {return Math.min(Math.max(v, min), max);}class ProgressBar {- constructor(element, { height, width, units } = {}) {- this.visible = true;+ #classList = null;- // Fetch the sub-elements for later.- this.div = element.querySelector("#loadingBar .progress");- // Get the loading bar element, so it can be resized to fit the viewer.- this.bar = this.div.parentNode;+ #percent = 0;- // Get options, with sensible defaults.- this.height = height || 100;- this.width = width || 100;- this.units = units || "%";+ #visible = true;- // Initialize heights.- this.div.style.height = this.height + this.units;- this.percent = 0;- }-- _updateBar() {- if (this._indeterminate) {- this.div.classList.add("indeterminate");- this.div.style.width = this.width + this.units;- return;- }-- this.div.classList.remove("indeterminate");- const progressSize = (this.width * this._percent) / 100;- this.div.style.width = progressSize + this.units;+ constructor(id) {+ const bar = document.getElementById(id);+ this.#classList = bar.classList;}get percent() {- return this._percent;+ return this.#percent;}set percent(val) {- this._indeterminate = isNaN(val);- this._percent = clamp(val, 0, 100);- this._updateBar();+ this.#percent = clamp(val, 0, 100);++ if (isNaN(val)) {+ this.#classList.add("indeterminate");+ return;+ }+ this.#classList.remove("indeterminate");++ docStyle.setProperty("--progressBar-percent", `${this.#percent}%`);}setWidth(viewer) {@@ -731,25 +725,26 @@ class ProgressBar {const container = viewer.parentNode;const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;if (scrollbarWidth > 0) {- const doc = document.documentElement;- doc.style.setProperty(LOADINGBAR_END_OFFSET_VAR, `${scrollbarWidth}px`);+ docStyle.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`);}}hide() {- if (!this.visible) {+ if (!this.#visible) {return;}- this.visible = false;- this.bar.classList.add("fn__hidden");+ this.#visible = false;+ // NOTE+ this.#classList.add("fn__hidden");}show() {- if (this.visible) {+ if (this.#visible) {return;}- this.visible = true;- this.bar.classList.remove("fn__hidden");+ this.#visible = true;+ // NOTE+ this.#classList.remove("fn__hidden");}}@@ -844,6 +839,7 @@ export {DEFAULT_SCALE,DEFAULT_SCALE_DELTA,DEFAULT_SCALE_VALUE,+ docStyle,getActiveOrFocusedElement,getPageSizeInches,getVisibleElements,diff --git a/app/src/asset/pdf/viewer.js b/app/src/asset/pdf/viewer.jsindex b66648a21b..b070ab2aad 100644--- a/app/src/asset/pdf/viewer.js+++ b/app/src/asset/pdf/viewer.js@@ -13,7 +13,9 @@* limitations under the License.*/+import { RenderingStates, ScrollMode, SpreadMode } from './ui_utils.js'import { AppOptions } from './app_options.js'+import { LinkTarget } from './pdf_link_service.js'import { PDFViewerApplication } from './app.js'import { initAnno } from '../anno'@@ -24,18 +26,22 @@ const pdfjsVersion =const pdfjsBuild =typeof PDFJSDev !== 'undefined' ? PDFJSDev.eval('BUNDLE_BUILD') : void 0+const AppConstants =+ typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')+ ? {LinkTarget, RenderingStates, ScrollMode, SpreadMode}+ : null+window.PDFViewerApplication = PDFViewerApplication+window.PDFViewerApplicationConstants = AppConstantswindow.PDFViewerApplicationOptions = AppOptionsif (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME')) {- var defaultUrl; // eslint-disable-line no-var-(function rewriteUrlClosure () {// Run this code outside DOMContentLoaded to make sure that the URL// is rewritten as soon as possible.const queryString = document.location.search.slice(1)const m = /(^|&)file=([^&]*)/.exec(queryString)- defaultUrl = m ? decodeURIComponent(m[2]) : ''+ const defaultUrl = m ? decodeURIComponent(m[2]) : ''// Example: chrome-extension://.../http://example.com/file.pdfconst humanReadableUrl = '/' + defaultUrl + location.hash@@ -44,27 +50,34 @@ if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME')) {// eslint-disable-next-line no-undefchrome.runtime.sendMessage('showPageAction')}++ AppOptions.set('defaultUrl', defaultUrl)})()}-function getViewerConfiguration (element) {- let errorWrapper = null- if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) {- errorWrapper = {- container: element.querySelector('#errorWrapper'),- errorMessage: element.querySelector('#errorMessage'),- closeButton: element.querySelector('#errorClose'),- errorMoreInfo: element.querySelector('#errorMoreInfo'),- moreInfoButton: element.querySelector('#errorShowMore'),- lessInfoButton: element.querySelector('#errorShowLess'),- }- }+// NOTE+// if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {+// require('./firefoxcom.js')+// require('./firefox_print_service.js')+// }+// if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('GENERIC')) {+// require('./genericcom.js')+// }+// if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME')) {+// require('./chromecom.js')+// }+// if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME || GENERIC')) {+// require('./pdf_print_service.js')+// }+// NOTE+function getViewerConfiguration (element) {return {appContainer: element,mainContainer: element.querySelector('#viewerContainer'),viewerContainer: element.querySelector('#viewer'),toolbar: {+ // NOTErectAnno: element.querySelector('#rectAnno'),container: element.querySelector('#toolbarViewer'),numPages: element.querySelector('#numPages'),@@ -76,23 +89,28 @@ function getViewerConfiguration (element) {zoomIn: element.querySelector('#zoomIn'),zoomOut: element.querySelector('#zoomOut'),viewFind: element.querySelector('#viewFind'),- openFile: element.querySelector('#openFile'),+ openFile:+ typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')+ ? element.querySelector('#openFile')+ : null,print: element.querySelector('#print'),- presentationModeButton: element.querySelector('#presentationMode'),+ editorFreeTextButton: element.querySelector('#editorFreeText'),+ editorFreeTextParamsToolbar: element.querySelector('#editorFreeTextParamsToolbar'),+ editorInkButton: element.querySelector('#editorInk'),+ editorInkParamsToolbar: element.querySelector('#editorInkParamsToolbar'),download: element.querySelector('#download'),- viewBookmark: element.querySelector('#viewBookmark'),},secondaryToolbar: {toolbar: element.querySelector('#secondaryToolbar'),toggleButton: element.querySelector('#secondaryToolbarToggle'),- toolbarButtonContainer: element.querySelector(- '#secondaryToolbarButtonContainer'),- presentationModeButton: element.querySelector(- '#secondaryPresentationMode'),- openFileButton: element.querySelector('#secondaryOpenFile'),+ presentationModeButton: element.querySelector('#presentationMode'),+ openFileButton:+ typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')+ ? element.querySelector('#secondaryOpenFile')+ : null,printButton: element.querySelector('#secondaryPrint'),downloadButton: element.querySelector('#secondaryDownload'),- viewBookmarkButton: element.querySelector('#secondaryViewBookmark'),+ viewBookmarkButton: element.querySelector('#viewBookmark'),firstPageButton: element.querySelector('#firstPage'),lastPageButton: element.querySelector('#lastPage'),pageRotateCwButton: element.querySelector('#pageRotateCw'),@@ -111,7 +129,7 @@ function getViewerConfiguration (element) {sidebar: {// Divs (and sidebar button)outerContainer: element.querySelector('#outerContainer'),- viewerContainer: element.querySelector('#viewerContainer'),+ sidebarContainer: element.querySelector('#sidebarContainer'),toggleButton: element.querySelector('#sidebarToggle'),// ButtonsthumbnailButton: element.querySelector('#viewThumbnail'),@@ -124,8 +142,7 @@ function getViewerConfiguration (element) {attachmentsView: element.querySelector('#attachmentsView'),layersView: element.querySelector('#layersView'),// View-specific options- outlineOptionsContainer: element.querySelector(- '#outlineOptionsContainer'),+ outlineOptionsContainer: element.querySelector('#outlineOptionsContainer'),currentOutlineItemButton: element.querySelector('#currentOutlineItem'),},sidebarResizer: {@@ -146,16 +163,14 @@ function getViewerConfiguration (element) {findNextButton: element.querySelector('#findNext'),},passwordOverlay: {- overlayName: 'passwordOverlay',- container: element.querySelector('#passwordOverlay'),+ dialog: element.querySelector('#passwordDialog'),label: element.querySelector('#passwordText'),input: element.querySelector('#password'),submitButton: element.querySelector('#passwordSubmit'),cancelButton: element.querySelector('#passwordCancel'),},documentProperties: {- overlayName: 'documentPropertiesOverlay',- container: element.querySelector('#documentPropertiesOverlay'),+ dialog: element.querySelector('#documentPropertiesDialog'),closeButton: element.querySelector('#documentPropertiesClose'),fields: {fileName: element.querySelector('#fileNameField'),@@ -174,9 +189,29 @@ function getViewerConfiguration (element) {linearized: element.querySelector('#linearizedField'),},},- errorWrapper,+ annotationEditorParams: {+ editorFreeTextFontSize: element.querySelector('#editorFreeTextFontSize'),+ editorFreeTextColor: element.querySelector('#editorFreeTextColor'),+ editorInkColor: element.querySelector('#editorInkColor'),+ editorInkThickness: element.querySelector('#editorInkThickness'),+ editorInkOpacity: element.querySelector('#editorInkOpacity'),+ },+ errorWrapper:+ typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')+ ? {+ container: element.querySelector('#errorWrapper'),+ errorMessage: element.querySelector('#errorMessage'),+ closeButton: element.querySelector('#errorClose'),+ errorMoreInfo: element.querySelector('#errorMoreInfo'),+ moreInfoButton: element.querySelector('#errorShowMore'),+ lessInfoButton: element.querySelector('#errorShowLess'),+ }+ : null,printContainer: element.querySelector('#printContainer'),- openFileInputName: 'fileInput',+ openFileInput:+ typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')+ ? element.querySelector('#fileInput')+ : null,debuggerScriptPath: './debugger.js',}}@@ -189,10 +224,6 @@ function webViewerLoad (file, element, pdfPage, annoId) {if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {config.file = file} else {- if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('CHROME')) {- AppOptions.set('defaultUrl', defaultUrl)- }-if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('GENERIC')) {// Give custom implementations of the default viewer a simpler way to// set various `AppOptions`, by dispatching an event once all viewer@@ -221,8 +252,20 @@ function webViewerLoad (file, element, pdfPage, annoId) {// Block the "load" event until all pages are loaded, to ensure that printing// works in Firefox; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553-if (document.blockUnblockOnload) {- document.blockUnblockOnload(true)-}-export { PDFViewerApplication, webViewerLoad }+document.blockUnblockOnload?.(true)+// NOTE+// if (+// document.readyState === 'interactive' ||+// document.readyState === 'complete'+// ) {+// webViewerLoad()+// } else {+// document.addEventListener('DOMContentLoaded', webViewerLoad, true)+// }++// NOTE+export {+ PDFViewerApplication,+ webViewerLoad+}diff --git a/app/src/asset/pdf/xfa_layer_builder.js b/app/src/asset/pdf/xfa_layer_builder.jsindex 9462bdd8b6..ea981986fe 100644--- a/app/src/asset/pdf/xfa_layer_builder.js+++ b/app/src/asset/pdf/xfa_layer_builder.js@@ -13,6 +13,11 @@* limitations under the License.*/+/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */+// eslint-disable-next-line max-len+/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */+/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */+import { XfaLayer } from "./pdfjs";/**@@ -65,7 +70,7 @@ class XfaLayerBuilder {// Create an xfa layer div and render the formconst div = document.createElement("div");- this.pageDiv.appendChild(div);+ this.pageDiv.append(div);parameters.div = div;const result = XfaLayer.render(parameters);@@ -94,7 +99,7 @@ class XfaLayerBuilder {}// Create an xfa layer div and render the formthis.div = document.createElement("div");- this.pageDiv.appendChild(this.div);+ this.pageDiv.append(this.div);parameters.div = this.div;return XfaLayer.render(parameters);})diff --git a/app/src/layout/Wnd.ts b/app/src/layout/Wnd.tsindex 1e5eab079f..a1bf969f1d 100644--- a/app/src/layout/Wnd.ts+++ b/app/src/layout/Wnd.ts@@ -544,7 +544,7 @@ export class Wnd {return;}if (model instanceof Asset) {- if (model.pdfObject) {+ if (model.pdfObject && model.pdfObject.pdfLoadingTask) {model.pdfObject.pdfLoadingTask.destroy();}}diff --git a/app/stage/protyle/js/pdf/pdf.js b/app/stage/protyle/js/pdf/pdf.jsindex 72633d5b67..24ae3465da 100644--- a/app/stage/protyle/js/pdf/pdf.js+++ b/app/stage/protyle/js/pdf/pdf.js@@ -1,6 +1,6 @@/*** @licstart The following is the entire license notice for the- * Javascript code in this page+ * JavaScript code in this page** Copyright 2022 Mozilla Foundation*@@ -17,6 +17,6 @@* limitations under the License.** @licend The above is the entire license notice for the- * Javascript code in this page+ * JavaScript code in this page*/-!function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],r):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=r():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=r()}(this,(function(){return(()=>{var __webpack_modules__=[,(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.UNSUPPORTED_FEATURES=r.TextRenderingMode=r.StreamType=r.RenderingIntentFlag=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.IsLittleEndianCached=r.IsEvalSupportedCached=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMode=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var a=0,i=0;i<r;i++)a+=arrayByteLength(t[i]);for(var o=0,l=new Uint8Array(a),c=0;c<r;c++){var u=t[c];u instanceof Uint8Array||(u="string"==typeof u?stringToBytes(u):new Uint8Array(u));var d=u.byteLength;l.set(u,o);o+=d}return l};r.assert=function assert(t,r){t||unreachable(r)};r.bytesToString=function bytesToString(t){"object"===_typeof(t)&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");var r=t.length,a=8192;if(r<a)return String.fromCharCode.apply(null,t);for(var i=[],o=0;o<r;o+=a){var l=Math.min(o+a,r),c=t.subarray(o,l);i.push(String.fromCharCode.apply(null,c))}return i.join("")};r.createPromiseCapability=function createPromiseCapability(){var t=Object.create(null),r=!1;Object.defineProperty(t,"settled",{get:function get(){return r}});t.promise=new Promise((function(a,i){t.resolve=function(t){r=!0;a(t)};t.reject=function(t){r=!0;i(t)}}));return t};r.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(a&&"string"==typeof t){if(a.addDefaultProtocol&&t.startsWith("www.")){var i=t.match(/\./g);i&&i.length>=2&&(t="http://".concat(t))}if(a.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}var o=r?new URL(t,r):new URL(t);if(_isValidProtocol(o))return o}catch(t){}return null};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return o};r.info=function info(t){o>=i.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;for(var a=0,i=t.length;a<i;a++)if(t[a]!==r[a])return!1;return!0};r.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};r.objectFromMap=function objectFromMap(t){var r,a=Object.create(null),i=function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}(t);try{for(i.s();!(r=i.n()).done;){var o=(u=r.value,d=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(u)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(u,d)||_unsupportedIterableToArray(u,d)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=o[0],c=o[1];a[l]=c}}catch(t){i.e(t)}finally{i.f()}var u,d;return a};r.objectSize=function objectSize(t){return Object.keys(t).length};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(o=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){var r;"þ"===t[0]&&"ÿ"===t[1]?r="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?r="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(r="utf-8");if(r)try{var a=new TextDecoder(r,{fatal:!0}),i=stringToBytes(t);return a.decode(i)}catch(t){warn('stringToPDFString: "'.concat(t,'".'))}}for(var o=[],l=0,c=t.length;l<c;l++){var u=A[t.charCodeAt(l)];o.push(u?String.fromCharCode(u):t.charAt(l))}return o.join("")};r.stringToUTF16BEString=function stringToUTF16BEString(t){for(var r=["þÿ"],a=0,i=t.length;a<i;a++){var o=t.charCodeAt(a);r.push(String.fromCharCode(o>>8&255),String.fromCharCode(255&o))}return r.join("")};r.stringToUTF8String=stringToUTF8String;r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;a(2);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}r.IDENTITY_MATRIX=[1,0,0,1,0,0];r.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];r.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};r.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};r.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};r.AnnotationReplyType={GROUP:"Group",REPLY:"R"};r.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.PageActionEventType={O:"PageOpen",C:"PageClose"};r.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};r.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};var i={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=i;r.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};r.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};r.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var o=i.WARNINGS;function warn(t){o>=i.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,r,a){Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!1});return a}var l=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=l;var c=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,a){var i;_classCallCheck(this,PasswordException);(i=r.call(this,t,"PasswordException")).code=a;return i}return _createClass(PasswordException)}(l);r.PasswordException=c;var u=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,a){var i;_classCallCheck(this,UnknownErrorException);(i=r.call(this,t,"UnknownErrorException")).details=a;return i}return _createClass(UnknownErrorException)}(l);r.UnknownErrorException=u;var d=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return r.call(this,t,"InvalidPDFException")}return _createClass(InvalidPDFException)}(l);r.InvalidPDFException=d;var h=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return r.call(this,t,"MissingPDFException")}return _createClass(MissingPDFException)}(l);r.MissingPDFException=h;var p=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,a){var i;_classCallCheck(this,UnexpectedResponseException);(i=r.call(this,t,"UnexpectedResponseException")).status=a;return i}return _createClass(UnexpectedResponseException)}(l);r.UnexpectedResponseException=p;var v=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(t){_classCallCheck(this,FormatError);return r.call(this,t,"FormatError")}return _createClass(FormatError)}(l);r.FormatError=v;var y=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(t){_classCallCheck(this,AbortException);return r.call(this,t,"AbortException")}return _createClass(AbortException)}(l);r.AbortException=y;function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,a=new Uint8Array(r),i=0;i<r;++i)a[i]=255&t.charCodeAt(i);return a}function arrayByteLength(t){if(void 0!==t.length)return t.length;if(void 0!==t.byteLength)return t.byteLength;unreachable("Invalid argument for arrayByteLength")}var g={get value(){return shadow(this,"value",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}};r.IsLittleEndianCached=g;var m={get value(){return shadow(this,"value",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}};r.IsEvalSupportedCached=m;var _=_toConsumableArray(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),b=function(){function Util(){_classCallCheck(this,Util)}_createClass(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,a){return"#".concat(_[t]).concat(_[r]).concat(_[a])}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var a=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/a,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/a]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var a=Util.applyTransform(t,r),i=Util.applyTransform(t.slice(2,4),r),o=Util.applyTransform([t[0],t[3]],r),l=Util.applyTransform([t[2],t[1]],r);return[Math.min(a[0],i[0],o[0],l[0]),Math.min(a[1],i[1],o[1],l[1]),Math.max(a[0],i[0],o[0],l[0]),Math.max(a[1],i[1],o[1],l[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"apply3dTransform",value:function apply3dTransform(t,r){return[t[0]*r[0]+t[1]*r[1]+t[2]*r[2],t[3]*r[0]+t[4]*r[1]+t[5]*r[2],t[6]*r[0]+t[7]*r[1]+t[8]*r[2]]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],a=t[0]*r[0]+t[1]*r[2],i=t[0]*r[1]+t[1]*r[3],o=t[2]*r[0]+t[3]*r[2],l=t[2]*r[1]+t[3]*r[3],c=(a+l)/2,u=Math.sqrt(Math.pow(a+l,2)-4*(a*l-o*i))/2,d=c+u||1,h=c-u||1;return[Math.sqrt(d),Math.sqrt(h)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){function compare(t,r){return t-r}var a=[t[0],t[2],r[0],r[2]].sort(compare),i=[t[1],t[3],r[1],r[3]].sort(compare),o=[];t=Util.normalizeRect(t);r=Util.normalizeRect(r);if(!(a[0]===t[0]&&a[1]===r[0]||a[0]===r[0]&&a[1]===t[0]))return null;o[0]=a[1];o[2]=a[2];if(!(i[0]===t[1]&&i[1]===r[1]||i[0]===r[1]&&i[1]===t[1]))return null;o[1]=i[1];o[3]=i[2];return o}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,a,i,o,l,c,u){for(var d,h,p,v,y,g,m,_,b=[],A=[[],[]],S=0;S<2;++S){if(0===S){h=6*t-12*a+6*o;d=-3*t+9*a-9*o+3*c;p=3*a-3*t}else{h=6*r-12*i+6*l;d=-3*r+9*i-9*l+3*u;p=3*i-3*r}if(Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;0<(v=-p/h)&&v<1&&b.push(v)}else{m=h*h-4*p*d;_=Math.sqrt(m);if(!(m<0)){0<(y=(-h+_)/(2*d))&&y<1&&b.push(y);0<(g=(-h-_)/(2*d))&&g<1&&b.push(g)}}}for(var k,C=b.length,x=C;C--;){k=1-(v=b[C]);A[0][C]=k*k*k*t+3*k*k*v*a+3*k*v*v*o+v*v*v*c;A[1][C]=k*k*k*r+3*k*k*v*i+3*k*v*v*l+v*v*v*u}A[0][x]=t;A[1][x]=r;A[0][x+1]=c;A[1][x+1]=u;A[0].length=A[1].length=x+2;return[Math.min.apply(Math,_toConsumableArray(A[0])),Math.min.apply(Math,_toConsumableArray(A[1])),Math.max.apply(Math,_toConsumableArray(A[0])),Math.max.apply(Math,_toConsumableArray(A[1]))]}}]);return Util}();r.Util=b;var A=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,r,a)=>{"use strict";var i=a(3);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&i.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&i.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&i.isNodeJS&&(globalThis.DOMMatrix=require("dommatrix/dist/dommatrix.js"))}();!function checkPromise(){globalThis.Promise.allSettled||(globalThis.Promise=a(4))}();!function checkReadableStream(){!globalThis.ReadableStream&&i.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}();!function checkStructuredClone(){globalThis.structuredClone||a(128)}()}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var a=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=a},(t,r,a)=>{a(5);a(90);a(96);a(98);a(122);a(123);a(124);a(125);var i=a(127);t.exports=i.Promise},(t,r,a)=>{"use strict";var i=a(6),o=a(7),l=a(26),c=a(68),u=a(70),d=a(56),h=a(72),p=a(45),v=a(14),y=a(76),g=a(77),m=a(78),_=a(87),b=a(35),A=a(89),S=b("toStringTag"),k=o.Error,C=[].push,x=function AggregateError(t,r){var a,i=arguments.length>2?arguments[2]:void 0,o=l(P,this);if(u)a=u(new k,o?c(this):P);else{a=o?this:h(P);p(a,S,"Error")}void 0!==r&&p(a,"message",_(r));A&&p(a,"stack",y(a.stack,1));g(a,i);var d=[];m(t,C,{that:d});p(a,"errors",d);return a};u?u(x,k):d(x,k,{name:!0});var P=x.prototype=h(k.prototype,{constructor:v(1,x),message:v(1,""),name:v(1,"AggregateError")});i({global:!0},{AggregateError:x})},(t,r,a)=>{var i=a(7),o=a(8).f,l=a(45),c=a(49),u=a(39),d=a(56),h=a(67);t.exports=function(t,r){var a,p,v,y,g,m=t.target,_=t.global,b=t.stat;if(a=_?i:b?i[m]||u(m,{}):(i[m]||{}).prototype)for(p in r){y=r[p];v=t.noTargetGet?(g=o(a,p))&&g.value:a[p];if(!h(_?p:m+(b?".":"#")+p,t.forced)&&void 0!==v){if(typeof y==typeof v)continue;d(y,v)}(t.sham||v&&v.sham)&&l(y,"sham",!0);c(a,p,y,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,r,a)=>{var i=a(9),o=a(11),l=a(13),c=a(14),u=a(15),d=a(20),h=a(40),p=a(43),v=Object.getOwnPropertyDescriptor;r.f=i?v:function getOwnPropertyDescriptor(t,r){t=u(t);r=d(r);if(p)try{return v(t,r)}catch(t){}if(h(t,r))return c(!o(l.f,t,r),t[r])}},(t,r,a)=>{var i=a(10);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,r,a)=>{var i=a(12),o=Function.prototype.call;t.exports=i?o.bind(o):function(){return o.apply(o,arguments)}},(t,r,a)=>{var i=a(10);t.exports=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,r)=>{"use strict";var a={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!a.call({1:2},1);r.f=o?function propertyIsEnumerable(t){var r=i(this,t);return!!r&&r.enumerable}:a},t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},(t,r,a)=>{var i=a(16),o=a(19);t.exports=function(t){return i(o(t))}},(t,r,a)=>{var i=a(7),o=a(17),l=a(10),c=a(18),u=i.Object,d=o("".split);t.exports=l((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==c(t)?d(t,""):u(t)}:u},(t,r,a)=>{var i=a(12),o=Function.prototype,l=o.bind,c=o.call,u=i&&l.bind(c,c);t.exports=i?function(t){return t&&u(t)}:function(t){return t&&function(){return c.apply(t,arguments)}}},(t,r,a)=>{var i=a(17),o=i({}.toString),l=i("".slice);t.exports=function(t){return l(o(t),8,-1)}},(t,r,a)=>{var i=a(7).TypeError;t.exports=function(t){if(null==t)throw i("Can't call method on "+t);return t}},(t,r,a)=>{var i=a(21),o=a(24);t.exports=function(t){var r=i(t,"string");return o(r)?r:r+""}},(t,r,a)=>{var i=a(7),o=a(11),l=a(22),c=a(24),u=a(31),d=a(34),h=a(35),p=i.TypeError,v=h("toPrimitive");t.exports=function(t,r){if(!l(t)||c(t))return t;var a,i=u(t,v);if(i){void 0===r&&(r="default");a=o(i,t,r);if(!l(a)||c(a))return a;throw p("Can't convert object to primitive value")}void 0===r&&(r="number");return d(t,r)}},(t,r,a)=>{var i=a(23);t.exports=function(t){return"object"==typeof t?null!==t:i(t)}},t=>{t.exports=function(t){return"function"==typeof t}},(t,r,a)=>{var i=a(7),o=a(25),l=a(23),c=a(26),u=a(27),d=i.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=o("Symbol");return l(r)&&c(r.prototype,d(t))}},(t,r,a)=>{var i=a(7),o=a(23),aFunction=function(t){return o(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?aFunction(i[t]):i[t]&&i[t][r]}},(t,r,a)=>{var i=a(17);t.exports=i({}.isPrototypeOf)},(t,r,a)=>{var i=a(28);t.exports=i&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,r,a)=>{var i=a(29),o=a(10);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&i&&i<41}))},(t,r,a)=>{var i,o,l=a(7),c=a(30),u=l.process,d=l.Deno,h=u&&u.versions||d&&d.version,p=h&&h.v8;p&&(o=(i=p.split("."))[0]>0&&i[0]<4?1:+(i[0]+i[1]));!o&&c&&(!(i=c.match(/Edge\/(\d+)/))||i[1]>=74)&&(i=c.match(/Chrome\/(\d+)/))&&(o=+i[1]);t.exports=o},(t,r,a)=>{var i=a(25);t.exports=i("navigator","userAgent")||""},(t,r,a)=>{var i=a(32);t.exports=function(t,r){var a=t[r];return null==a?void 0:i(a)}},(t,r,a)=>{var i=a(7),o=a(23),l=a(33),c=i.TypeError;t.exports=function(t){if(o(t))return t;throw c(l(t)+" is not a function")}},(t,r,a)=>{var i=a(7).String;t.exports=function(t){try{return i(t)}catch(t){return"Object"}}},(t,r,a)=>{var i=a(7),o=a(11),l=a(23),c=a(22),u=i.TypeError;t.exports=function(t,r){var a,i;if("string"===r&&l(a=t.toString)&&!c(i=o(a,t)))return i;if(l(a=t.valueOf)&&!c(i=o(a,t)))return i;if("string"!==r&&l(a=t.toString)&&!c(i=o(a,t)))return i;throw u("Can't convert object to primitive value")}},(t,r,a)=>{var i=a(7),o=a(36),l=a(40),c=a(42),u=a(28),d=a(27),h=o("wks"),p=i.Symbol,v=p&&p.for,y=d?p:p&&p.withoutSetter||c;t.exports=function(t){if(!l(h,t)||!u&&"string"!=typeof h[t]){var r="Symbol."+t;u&&l(p,t)?h[t]=p[t]:h[t]=d&&v?v(r):y(r)}return h[t]}},(t,r,a)=>{var i=a(37),o=a(38);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.21.1",mode:i?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,r,a)=>{var i=a(7),o=a(39),l="__core-js_shared__",c=i[l]||o(l,{});t.exports=c},(t,r,a)=>{var i=a(7),o=Object.defineProperty;t.exports=function(t,r){try{o(i,t,{value:r,configurable:!0,writable:!0})}catch(a){i[t]=r}return r}},(t,r,a)=>{var i=a(17),o=a(41),l=i({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,r){return l(o(t),r)}},(t,r,a)=>{var i=a(7),o=a(19),l=i.Object;t.exports=function(t){return l(o(t))}},(t,r,a)=>{var i=a(17),o=0,l=Math.random(),c=i(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+c(++o+l,36)}},(t,r,a)=>{var i=a(9),o=a(10),l=a(44);t.exports=!i&&!o((function(){return 7!=Object.defineProperty(l("div"),"a",{get:function(){return 7}}).a}))},(t,r,a)=>{var i=a(7),o=a(22),l=i.document,c=o(l)&&o(l.createElement);t.exports=function(t){return c?l.createElement(t):{}}},(t,r,a)=>{var i=a(9),o=a(46),l=a(14);t.exports=i?function(t,r,a){return o.f(t,r,l(1,a))}:function(t,r,a){t[r]=a;return t}},(t,r,a)=>{var i=a(7),o=a(9),l=a(43),c=a(47),u=a(48),d=a(20),h=i.TypeError,p=Object.defineProperty,v=Object.getOwnPropertyDescriptor,y="enumerable",g="configurable",m="writable";r.f=o?c?function defineProperty(t,r,a){u(t);r=d(r);u(a);if("function"==typeof t&&"prototype"===r&&"value"in a&&m in a&&!a.writable){var i=v(t,r);if(i&&i.writable){t[r]=a.value;a={configurable:g in a?a.configurable:i.configurable,enumerable:y in a?a.enumerable:i.enumerable,writable:!1}}}return p(t,r,a)}:p:function defineProperty(t,r,a){u(t);r=d(r);u(a);if(l)try{return p(t,r,a)}catch(t){}if("get"in a||"set"in a)throw h("Accessors not supported");"value"in a&&(t[r]=a.value);return t}},(t,r,a)=>{var i=a(9),o=a(10);t.exports=i&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,r,a)=>{var i=a(7),o=a(22),l=i.String,c=i.TypeError;t.exports=function(t){if(o(t))return t;throw c(l(t)+" is not an object")}},(t,r,a)=>{var i=a(7),o=a(23),l=a(40),c=a(45),u=a(39),d=a(50),h=a(51),p=a(55).CONFIGURABLE,v=h.get,y=h.enforce,g=String(String).split("String");(t.exports=function(t,r,a,d){var h,v=!!d&&!!d.unsafe,m=!!d&&!!d.enumerable,_=!!d&&!!d.noTargetGet,b=d&&void 0!==d.name?d.name:r;if(o(a)){"Symbol("===String(b).slice(0,7)&&(b="["+String(b).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");(!l(a,"name")||p&&a.name!==b)&&c(a,"name",b);(h=y(a)).source||(h.source=g.join("string"==typeof b?b:""))}if(t!==i){v?!_&&t[r]&&(m=!0):delete t[r];m?t[r]=a:c(t,r,a)}else m?t[r]=a:u(r,a)})(Function.prototype,"toString",(function toString(){return o(this)&&v(this).source||d(this)}))},(t,r,a)=>{var i=a(17),o=a(23),l=a(38),c=i(Function.toString);o(l.inspectSource)||(l.inspectSource=function(t){return c(t)});t.exports=l.inspectSource},(t,r,a)=>{var i,o,l,c=a(52),u=a(7),d=a(17),h=a(22),p=a(45),v=a(40),y=a(38),g=a(53),m=a(54),_="Object already initialized",b=u.TypeError,A=u.WeakMap;if(c||y.state){var S=y.state||(y.state=new A),k=d(S.get),C=d(S.has),x=d(S.set);i=function(t,r){if(C(S,t))throw new b(_);r.facade=t;x(S,t,r);return r};o=function(t){return k(S,t)||{}};l=function(t){return C(S,t)}}else{var P=g("state");m[P]=!0;i=function(t,r){if(v(t,P))throw new b(_);r.facade=t;p(t,P,r);return r};o=function(t){return v(t,P)?t[P]:{}};l=function(t){return v(t,P)}}t.exports={set:i,get:o,has:l,enforce:function(t){return l(t)?o(t):i(t,{})},getterFor:function(t){return function(r){var a;if(!h(r)||(a=o(r)).type!==t)throw b("Incompatible receiver, "+t+" required");return a}}}},(t,r,a)=>{var i=a(7),o=a(23),l=a(50),c=i.WeakMap;t.exports=o(c)&&/native code/.test(l(c))},(t,r,a)=>{var i=a(36),o=a(42),l=i("keys");t.exports=function(t){return l[t]||(l[t]=o(t))}},t=>{t.exports={}},(t,r,a)=>{var i=a(9),o=a(40),l=Function.prototype,c=i&&Object.getOwnPropertyDescriptor,u=o(l,"name"),d=u&&"something"===function something(){}.name,h=u&&(!i||i&&c(l,"name").configurable);t.exports={EXISTS:u,PROPER:d,CONFIGURABLE:h}},(t,r,a)=>{var i=a(40),o=a(57),l=a(8),c=a(46);t.exports=function(t,r,a){for(var u=o(r),d=c.f,h=l.f,p=0;p<u.length;p++){var v=u[p];i(t,v)||a&&i(a,v)||d(t,v,h(r,v))}}},(t,r,a)=>{var i=a(25),o=a(17),l=a(58),c=a(66),u=a(48),d=o([].concat);t.exports=i("Reflect","ownKeys")||function ownKeys(t){var r=l.f(u(t)),a=c.f;return a?d(r,a(t)):r}},(t,r,a)=>{var i=a(59),o=a(65).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return i(t,o)}},(t,r,a)=>{var i=a(17),o=a(40),l=a(15),c=a(60).indexOf,u=a(54),d=i([].push);t.exports=function(t,r){var a,i=l(t),h=0,p=[];for(a in i)!o(u,a)&&o(i,a)&&d(p,a);for(;r.length>h;)o(i,a=r[h++])&&(~c(p,a)||d(p,a));return p}},(t,r,a)=>{var i=a(15),o=a(61),l=a(63),createMethod=function(t){return function(r,a,c){var u,d=i(r),h=l(d),p=o(c,h);if(t&&a!=a){for(;h>p;)if((u=d[p++])!=u)return!0}else for(;h>p;p++)if((t||p in d)&&d[p]===a)return t||p||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,r,a)=>{var i=a(62),o=Math.max,l=Math.min;t.exports=function(t,r){var a=i(t);return a<0?o(a+r,0):l(a,r)}},t=>{var r=Math.ceil,a=Math.floor;t.exports=function(t){var i=+t;return i!=i||0===i?0:(i>0?a:r)(i)}},(t,r,a)=>{var i=a(64);t.exports=function(t){return i(t.length)}},(t,r,a)=>{var i=a(62),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,r)=>{r.f=Object.getOwnPropertySymbols},(t,r,a)=>{var i=a(10),o=a(23),l=/#|\.prototype\./,isForced=function(t,r){var a=u[c(t)];return a==h||a!=d&&(o(r)?i(r):!!r)},c=isForced.normalize=function(t){return String(t).replace(l,".").toLowerCase()},u=isForced.data={},d=isForced.NATIVE="N",h=isForced.POLYFILL="P";t.exports=isForced},(t,r,a)=>{var i=a(7),o=a(40),l=a(23),c=a(41),u=a(53),d=a(69),h=u("IE_PROTO"),p=i.Object,v=p.prototype;t.exports=d?p.getPrototypeOf:function(t){var r=c(t);if(o(r,h))return r[h];var a=r.constructor;return l(a)&&r instanceof a?a.prototype:r instanceof p?v:null}},(t,r,a)=>{var i=a(10);t.exports=!i((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,r,a)=>{var i=a(17),o=a(48),l=a(71);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,a={};try{(t=i(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(a,[]);r=a instanceof Array}catch(t){}return function setPrototypeOf(a,i){o(a);l(i);r?t(a,i):a.__proto__=i;return a}}():void 0)},(t,r,a)=>{var i=a(7),o=a(23),l=i.String,c=i.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw c("Can't set "+l(t)+" as a prototype")}},(t,r,a)=>{var i,o=a(48),l=a(73),c=a(65),u=a(54),d=a(75),h=a(44),p=a(53),v=p("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var r=t.parentWindow.Object;t=null;return r},NullProtoObject=function(){try{i=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&i?NullProtoObjectViaActiveX(i):function(){var t,r=h("iframe");r.style.display="none";d.appendChild(r);r.src=String("javascript:");(t=r.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(i);for(var t=c.length;t--;)delete NullProtoObject.prototype[c[t]];return NullProtoObject()};u[v]=!0;t.exports=Object.create||function create(t,r){var a;if(null!==t){EmptyConstructor.prototype=o(t);a=new EmptyConstructor;EmptyConstructor.prototype=null;a[v]=t}else a=NullProtoObject();return void 0===r?a:l.f(a,r)}},(t,r,a)=>{var i=a(9),o=a(47),l=a(46),c=a(48),u=a(15),d=a(74);r.f=i&&!o?Object.defineProperties:function defineProperties(t,r){c(t);for(var a,i=u(r),o=d(r),h=o.length,p=0;h>p;)l.f(t,a=o[p++],i[a]);return t}},(t,r,a)=>{var i=a(59),o=a(65);t.exports=Object.keys||function keys(t){return i(t,o)}},(t,r,a)=>{var i=a(25);t.exports=i("document","documentElement")},(t,r,a)=>{var i=a(17)("".replace),o=String(Error("zxcasd").stack),l=/\n\s*at [^:]*:[^\n]*/,c=l.test(o);t.exports=function(t,r){if(c&&"string"==typeof t)for(;r--;)t=i(t,l,"");return t}},(t,r,a)=>{var i=a(22),o=a(45);t.exports=function(t,r){i(r)&&"cause"in r&&o(t,"cause",r.cause)}},(t,r,a)=>{var i=a(7),o=a(79),l=a(11),c=a(48),u=a(33),d=a(80),h=a(63),p=a(26),v=a(82),y=a(83),g=a(86),m=i.TypeError,Result=function(t,r){this.stopped=t;this.result=r},_=Result.prototype;t.exports=function(t,r,a){var i,b,A,S,k,C,x,P=a&&a.that,w=!(!a||!a.AS_ENTRIES),T=!(!a||!a.IS_ITERATOR),R=!(!a||!a.INTERRUPTED),E=o(r,P),stop=function(t){i&&g(i,"normal",t);return new Result(!0,t)},callFn=function(t){if(w){c(t);return R?E(t[0],t[1],stop):E(t[0],t[1])}return R?E(t,stop):E(t)};if(T)i=t;else{if(!(b=y(t)))throw m(u(t)+" is not iterable");if(d(b)){for(A=0,S=h(t);S>A;A++)if((k=callFn(t[A]))&&p(_,k))return k;return new Result(!1)}i=v(t,b)}C=i.next;for(;!(x=l(C,i)).done;){try{k=callFn(x.value)}catch(t){g(i,"throw",t)}if("object"==typeof k&&k&&p(_,k))return k}return new Result(!1)}},(t,r,a)=>{var i=a(17),o=a(32),l=a(12),c=i(i.bind);t.exports=function(t,r){o(t);return void 0===r?t:l?c(t,r):function(){return t.apply(r,arguments)}}},(t,r,a)=>{var i=a(35),o=a(81),l=i("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[l]===t)}},t=>{t.exports={}},(t,r,a)=>{var i=a(7),o=a(11),l=a(32),c=a(48),u=a(33),d=a(83),h=i.TypeError;t.exports=function(t,r){var a=arguments.length<2?d(t):r;if(l(a))return c(o(a,t));throw h(u(t)+" is not iterable")}},(t,r,a)=>{var i=a(84),o=a(31),l=a(81),c=a(35)("iterator");t.exports=function(t){if(null!=t)return o(t,c)||o(t,"@@iterator")||l[i(t)]}},(t,r,a)=>{var i=a(7),o=a(85),l=a(23),c=a(18),u=a(35)("toStringTag"),d=i.Object,h="Arguments"==c(function(){return arguments}());t.exports=o?c:function(t){var r,a,i;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,r){try{return t[r]}catch(t){}}(r=d(t),u))?a:h?c(r):"Object"==(i=c(r))&&l(r.callee)?"Arguments":i}},(t,r,a)=>{var i={};i[a(35)("toStringTag")]="z";t.exports="[object z]"===String(i)},(t,r,a)=>{var i=a(11),o=a(48),l=a(31);t.exports=function(t,r,a){var c,u;o(t);try{if(!(c=l(t,"return"))){if("throw"===r)throw a;return a}c=i(c,t)}catch(t){u=!0;c=t}if("throw"===r)throw a;if(u)throw c;o(c);return a}},(t,r,a)=>{var i=a(88);t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:i(t)}},(t,r,a)=>{var i=a(7),o=a(84),l=i.String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return l(t)}},(t,r,a)=>{var i=a(10),o=a(14);t.exports=!i((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",o(1,7));return 7!==t.stack}))},(t,r,a)=>{"use strict";var i=a(15),o=a(91),l=a(81),c=a(51),u=a(46).f,d=a(92),h=a(37),p=a(9),v="Array Iterator",y=c.set,g=c.getterFor(v);t.exports=d(Array,"Array",(function(t,r){y(this,{type:v,target:i(t),index:0,kind:r})}),(function(){var t=g(this),r=t.target,a=t.kind,i=t.index++;if(!r||i>=r.length){t.target=void 0;return{value:void 0,done:!0}}return"keys"==a?{value:i,done:!1}:"values"==a?{value:r[i],done:!1}:{value:[i,r[i]],done:!1}}),"values");var m=l.Arguments=l.Array;o("keys");o("values");o("entries");if(!h&&p&&"values"!==m.name)try{u(m,"name",{value:"values"})}catch(t){}},(t,r,a)=>{var i=a(35),o=a(72),l=a(46),c=i("unscopables"),u=Array.prototype;null==u[c]&&l.f(u,c,{configurable:!0,value:o(null)});t.exports=function(t){u[c][t]=!0}},(t,r,a)=>{"use strict";var i=a(6),o=a(11),l=a(37),c=a(55),u=a(23),d=a(93),h=a(68),p=a(70),v=a(95),y=a(45),g=a(49),m=a(35),_=a(81),b=a(94),A=c.PROPER,S=c.CONFIGURABLE,k=b.IteratorPrototype,C=b.BUGGY_SAFARI_ITERATORS,x=m("iterator"),P="keys",w="values",T="entries",returnThis=function(){return this};t.exports=function(t,r,a,c,m,b,R){d(a,r,c);var E,O,I,getIterationMethod=function(t){if(t===m&&N)return N;if(!C&&t in L)return L[t];switch(t){case P:return function keys(){return new a(this,t)};case w:return function values(){return new a(this,t)};case T:return function entries(){return new a(this,t)}}return function(){return new a(this)}},D=r+" Iterator",M=!1,L=t.prototype,j=L[x]||L["@@iterator"]||m&&L[m],N=!C&&j||getIterationMethod(m),B="Array"==r&&L.entries||j;if(B&&(E=h(B.call(new t)))!==Object.prototype&&E.next){l||h(E)===k||(p?p(E,k):u(E[x])||g(E,x,returnThis));v(E,D,!0,!0);l&&(_[D]=returnThis)}if(A&&m==w&&j&&j.name!==w)if(!l&&S)y(L,"name",w);else{M=!0;N=function values(){return o(j,this)}}if(m){O={values:getIterationMethod(w),keys:b?N:getIterationMethod(P),entries:getIterationMethod(T)};if(R)for(I in O)(C||M||!(I in L))&&g(L,I,O[I]);else i({target:r,proto:!0,forced:C||M},O)}l&&!R||L[x]===N||g(L,x,N,{name:m});_[r]=N;return O}},(t,r,a)=>{"use strict";var i=a(94).IteratorPrototype,o=a(72),l=a(14),c=a(95),u=a(81),returnThis=function(){return this};t.exports=function(t,r,a,d){var h=r+" Iterator";t.prototype=o(i,{next:l(+!d,a)});c(t,h,!1,!0);u[h]=returnThis;return t}},(t,r,a)=>{"use strict";var i,o,l,c=a(10),u=a(23),d=a(72),h=a(68),p=a(49),v=a(35),y=a(37),g=v("iterator"),m=!1;[].keys&&("next"in(l=[].keys())?(o=h(h(l)))!==Object.prototype&&(i=o):m=!0);null==i||c((function(){var t={};return i[g].call(t)!==t}))?i={}:y&&(i=d(i));u(i[g])||p(i,g,(function(){return this}));t.exports={IteratorPrototype:i,BUGGY_SAFARI_ITERATORS:m}},(t,r,a)=>{var i=a(46).f,o=a(40),l=a(35)("toStringTag");t.exports=function(t,r,a){t&&!a&&(t=t.prototype);t&&!o(t,l)&&i(t,l,{configurable:!0,value:r})}},(t,r,a)=>{var i=a(85),o=a(49),l=a(97);i||o(Object.prototype,"toString",l,{unsafe:!0})},(t,r,a)=>{"use strict";var i=a(85),o=a(84);t.exports=i?{}.toString:function toString(){return"[object "+o(this)+"]"}},(t,r,a)=>{"use strict";var i,o,l,c,u=a(6),d=a(37),h=a(7),p=a(25),v=a(11),y=a(99),g=a(49),m=a(100),_=a(70),b=a(95),A=a(101),S=a(32),k=a(23),C=a(22),x=a(102),P=a(50),w=a(78),T=a(103),R=a(104),E=a(107).set,O=a(113),I=a(116),D=a(118),M=a(117),L=a(119),j=a(120),N=a(51),B=a(67),G=a(35),U=a(121),W=a(112),H=a(29),q=G("species"),V="Promise",z=N.getterFor(V),X=N.set,Y=N.getterFor(V),K=y&&y.prototype,J=y,Q=K,$=h.TypeError,Z=h.document,ee=h.process,te=M.f,re=te,ne=!!(Z&&Z.createEvent&&h.dispatchEvent),ae=k(h.PromiseRejectionEvent),ie="unhandledrejection",oe=!1,se=B(V,(function(){var t=P(J),r=t!==String(J);if(!r&&66===H)return!0;if(d&&!Q.finally)return!0;if(H>=51&&/native code/.test(t))return!1;var a=new J((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};(a.constructor={})[q]=FakePromise;return!(oe=a.then((function(){}))instanceof FakePromise)||!r&&U&&!ae})),le=se||!T((function(t){J.all(t).catch((function(){}))})),isThenable=function(t){var r;return!(!C(t)||!k(r=t.then))&&r},callReaction=function(t,r){var a,i,o,l=r.value,c=1==r.state,u=c?t.ok:t.fail,d=t.resolve,h=t.reject,p=t.domain;try{if(u){if(!c){2===r.rejection&&onHandleUnhandled(r);r.rejection=1}if(!0===u)a=l;else{p&&p.enter();a=u(l);if(p){p.exit();o=!0}}a===t.promise?h($("Promise-chain cycle")):(i=isThenable(a))?v(i,a,d,h):d(a)}else h(l)}catch(t){p&&!o&&p.exit();h(t)}},notify=function(t,r){if(!t.notified){t.notified=!0;O((function(){for(var a,i=t.reactions;a=i.get();)callReaction(a,t);t.notified=!1;r&&!t.rejection&&onUnhandled(t)}))}},dispatchEvent=function(t,r,a){var i,o;if(ne){(i=Z.createEvent("Event")).promise=r;i.reason=a;i.initEvent(t,!1,!0);h.dispatchEvent(i)}else i={promise:r,reason:a};!ae&&(o=h["on"+t])?o(i):t===ie&&D("Unhandled promise rejection",a)},onUnhandled=function(t){v(E,h,(function(){var r,a=t.facade,i=t.value;if(isUnhandled(t)){r=L((function(){W?ee.emit("unhandledRejection",i,a):dispatchEvent(ie,a,i)}));t.rejection=W||isUnhandled(t)?2:1;if(r.error)throw r.value}}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){v(E,h,(function(){var r=t.facade;W?ee.emit("rejectionHandled",r):dispatchEvent("rejectionhandled",r,t.value)}))},bind=function(t,r,a){return function(i){t(r,i,a)}},internalReject=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);t.value=r;t.state=2;notify(t,!0)}},internalResolve=function(t,r,a){if(!t.done){t.done=!0;a&&(t=a);try{if(t.facade===r)throw $("Promise can't be resolved itself");var i=isThenable(r);if(i)O((function(){var a={done:!1};try{v(i,r,bind(internalResolve,a,t),bind(internalReject,a,t))}catch(r){internalReject(a,r,t)}}));else{t.value=r;t.state=1;notify(t,!1)}}catch(r){internalReject({done:!1},r,t)}}};if(se){Q=(J=function Promise(t){x(this,Q);S(t);v(i,this);var r=z(this);try{t(bind(internalResolve,r),bind(internalReject,r))}catch(t){internalReject(r,t)}}).prototype;(i=function Promise(t){X(this,{type:V,done:!1,notified:!1,parent:!1,reactions:new j,rejection:!1,state:0,value:void 0})}).prototype=m(Q,{then:function then(t,r){var a=Y(this),i=te(R(this,J));a.parent=!0;i.ok=!k(t)||t;i.fail=k(r)&&r;i.domain=W?ee.domain:void 0;0==a.state?a.reactions.add(i):O((function(){callReaction(i,a)}));return i.promise},catch:function(t){return this.then(void 0,t)}});o=function(){var t=new i,r=z(t);this.promise=t;this.resolve=bind(internalResolve,r);this.reject=bind(internalReject,r)};M.f=te=function(t){return t===J||t===l?new o(t):re(t)};if(!d&&k(y)&&K!==Object.prototype){c=K.then;if(!oe){g(K,"then",(function then(t,r){var a=this;return new J((function(t,r){v(c,a,t,r)})).then(t,r)}),{unsafe:!0});g(K,"catch",Q.catch,{unsafe:!0})}try{delete K.constructor}catch(t){}_&&_(K,Q)}}u({global:!0,wrap:!0,forced:se},{Promise:J});b(J,V,!1,!0);A(V);l=p(V);u({target:V,stat:!0,forced:se},{reject:function reject(t){var r=te(this);v(r.reject,void 0,t);return r.promise}});u({target:V,stat:!0,forced:d||se},{resolve:function resolve(t){return I(d&&this===l?J:this,t)}});u({target:V,stat:!0,forced:le},{all:function all(t){var r=this,a=te(r),i=a.resolve,o=a.reject,l=L((function(){var a=S(r.resolve),l=[],c=0,u=1;w(t,(function(t){var d=c++,h=!1;u++;v(a,r,t).then((function(t){if(!h){h=!0;l[d]=t;--u||i(l)}}),o)}));--u||i(l)}));l.error&&o(l.value);return a.promise},race:function race(t){var r=this,a=te(r),i=a.reject,o=L((function(){var o=S(r.resolve);w(t,(function(t){v(o,r,t).then(a.resolve,i)}))}));o.error&&i(o.value);return a.promise}})},(t,r,a)=>{var i=a(7);t.exports=i.Promise},(t,r,a)=>{var i=a(49);t.exports=function(t,r,a){for(var o in r)i(t,o,r[o],a);return t}},(t,r,a)=>{"use strict";var i=a(25),o=a(46),l=a(35),c=a(9),u=l("species");t.exports=function(t){var r=i(t),a=o.f;c&&r&&!r[u]&&a(r,u,{configurable:!0,get:function(){return this}})}},(t,r,a)=>{var i=a(7),o=a(26),l=i.TypeError;t.exports=function(t,r){if(o(r,t))return t;throw l("Incorrect invocation")}},(t,r,a)=>{var i=a(35)("iterator"),o=!1;try{var l=0,c={next:function(){return{done:!!l++}},return:function(){o=!0}};c[i]=function(){return this};Array.from(c,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!o)return!1;var a=!1;try{var l={};l[i]=function(){return{next:function(){return{done:a=!0}}}};t(l)}catch(t){}return a}},(t,r,a)=>{var i=a(48),o=a(105),l=a(35)("species");t.exports=function(t,r){var a,c=i(t).constructor;return void 0===c||null==(a=i(c)[l])?r:o(a)}},(t,r,a)=>{var i=a(7),o=a(106),l=a(33),c=i.TypeError;t.exports=function(t){if(o(t))return t;throw c(l(t)+" is not a constructor")}},(t,r,a)=>{var i=a(17),o=a(10),l=a(23),c=a(84),u=a(25),d=a(50),noop=function(){},h=[],p=u("Reflect","construct"),v=/^\s*(?:class|function)\b/,y=i(v.exec),g=!v.exec(noop),m=function isConstructor(t){if(!l(t))return!1;try{p(noop,h,t);return!0}catch(t){return!1}},_=function isConstructor(t){if(!l(t))return!1;switch(c(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return g||!!y(v,d(t))}catch(t){return!0}};_.sham=!0;t.exports=!p||o((function(){var t;return m(m.call)||!m(Object)||!m((function(){t=!0}))||t}))?_:m},(t,r,a)=>{var i,o,l,c,u=a(7),d=a(108),h=a(79),p=a(23),v=a(40),y=a(10),g=a(75),m=a(109),_=a(44),b=a(110),A=a(111),S=a(112),k=u.setImmediate,C=u.clearImmediate,x=u.process,P=u.Dispatch,w=u.Function,T=u.MessageChannel,R=u.String,E=0,O={},I="onreadystatechange";try{i=u.location}catch(t){}var run=function(t){if(v(O,t)){var r=O[t];delete O[t];r()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){u.postMessage(R(t),i.protocol+"//"+i.host)};if(!k||!C){k=function setImmediate(t){b(arguments.length,1);var r=p(t)?t:w(t),a=m(arguments,1);O[++E]=function(){d(r,void 0,a)};o(E);return E};C=function clearImmediate(t){delete O[t]};if(S)o=function(t){x.nextTick(runner(t))};else if(P&&P.now)o=function(t){P.now(runner(t))};else if(T&&!A){c=(l=new T).port2;l.port1.onmessage=listener;o=h(c.postMessage,c)}else if(u.addEventListener&&p(u.postMessage)&&!u.importScripts&&i&&"file:"!==i.protocol&&!y(post)){o=post;u.addEventListener("message",listener,!1)}else o=I in _("script")?function(t){g.appendChild(_("script")).onreadystatechange=function(){g.removeChild(this);run(t)}}:function(t){setTimeout(runner(t),0)}}t.exports={set:k,clear:C}},(t,r,a)=>{var i=a(12),o=Function.prototype,l=o.apply,c=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(i?c.bind(l):function(){return c.apply(l,arguments)})},(t,r,a)=>{var i=a(17);t.exports=i([].slice)},(t,r,a)=>{var i=a(7).TypeError;t.exports=function(t,r){if(t<r)throw i("Not enough arguments");return t}},(t,r,a)=>{var i=a(30);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(i)},(t,r,a)=>{var i=a(18),o=a(7);t.exports="process"==i(o.process)},(t,r,a)=>{var i,o,l,c,u,d,h,p,v=a(7),y=a(79),g=a(8).f,m=a(107).set,_=a(111),b=a(114),A=a(115),S=a(112),k=v.MutationObserver||v.WebKitMutationObserver,C=v.document,x=v.process,P=v.Promise,w=g(v,"queueMicrotask"),T=w&&w.value;if(!T){i=function(){var t,r;S&&(t=x.domain)&&t.exit();for(;o;){r=o.fn;o=o.next;try{r()}catch(t){o?c():l=void 0;throw t}}l=void 0;t&&t.enter()};if(_||S||A||!k||!C)if(!b&&P&&P.resolve){(h=P.resolve(void 0)).constructor=P;p=y(h.then,h);c=function(){p(i)}}else if(S)c=function(){x.nextTick(i)};else{m=y(m,v);c=function(){m(i)}}else{u=!0;d=C.createTextNode("");new k(i).observe(d,{characterData:!0});c=function(){d.data=u=!u}}}t.exports=T||function(t){var r={fn:t,next:void 0};l&&(l.next=r);if(!o){o=r;c()}l=r}},(t,r,a)=>{var i=a(30),o=a(7);t.exports=/ipad|iphone|ipod/i.test(i)&&void 0!==o.Pebble},(t,r,a)=>{var i=a(30);t.exports=/web0s(?!.*chrome)/i.test(i)},(t,r,a)=>{var i=a(48),o=a(22),l=a(117);t.exports=function(t,r){i(t);if(o(r)&&r.constructor===t)return r;var a=l.f(t);(0,a.resolve)(r);return a.promise}},(t,r,a)=>{"use strict";var i=a(32),PromiseCapability=function(t){var r,a;this.promise=new t((function(t,i){if(void 0!==r||void 0!==a)throw TypeError("Bad Promise constructor");r=t;a=i}));this.resolve=i(r);this.reject=i(a)};t.exports.f=function(t){return new PromiseCapability(t)}},(t,r,a)=>{var i=a(7);t.exports=function(t,r){var a=i.console;a&&a.error&&(1==arguments.length?a.error(t):a.error(t,r))}},t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},t=>{var Queue=function(){this.head=null;this.tail=null};Queue.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r;this.tail=r},get:function(){var t=this.head;if(t){this.head=t.next;this.tail===t&&(this.tail=null);return t.item}}};t.exports=Queue},t=>{t.exports="object"==typeof window},(t,r,a)=>{"use strict";var i=a(6),o=a(11),l=a(32),c=a(117),u=a(119),d=a(78);i({target:"Promise",stat:!0},{allSettled:function allSettled(t){var r=this,a=c.f(r),i=a.resolve,h=a.reject,p=u((function(){var a=l(r.resolve),c=[],u=0,h=1;d(t,(function(t){var l=u++,d=!1;h++;o(a,r,t).then((function(t){if(!d){d=!0;c[l]={status:"fulfilled",value:t};--h||i(c)}}),(function(t){if(!d){d=!0;c[l]={status:"rejected",reason:t};--h||i(c)}}))}));--h||i(c)}));p.error&&h(p.value);return a.promise}})},(t,r,a)=>{"use strict";var i=a(6),o=a(32),l=a(25),c=a(11),u=a(117),d=a(119),h=a(78),p="No one promise resolved";i({target:"Promise",stat:!0},{any:function any(t){var r=this,a=l("AggregateError"),i=u.f(r),v=i.resolve,y=i.reject,g=d((function(){var i=o(r.resolve),l=[],u=0,d=1,g=!1;h(t,(function(t){var o=u++,h=!1;d++;c(i,r,t).then((function(t){if(!h&&!g){g=!0;v(t)}}),(function(t){if(!h&&!g){h=!0;l[o]=t;--d||y(new a(l,p))}}))}));--d||y(new a(l,p))}));g.error&&y(g.value);return i.promise}})},(t,r,a)=>{"use strict";var i=a(6),o=a(37),l=a(99),c=a(10),u=a(25),d=a(23),h=a(104),p=a(116),v=a(49);i({target:"Promise",proto:!0,real:!0,forced:!!l&&c((function(){l.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=h(this,u("Promise")),a=d(t);return this.then(a?function(a){return p(r,t()).then((function(){return a}))}:t,a?function(a){return p(r,t()).then((function(){throw a}))}:t)}});if(!o&&d(l)){var y=u("Promise").prototype.finally;l.prototype.finally!==y&&v(l.prototype,"finally",y,{unsafe:!0})}},(t,r,a)=>{"use strict";var i=a(126).charAt,o=a(88),l=a(51),c=a(92),u="String Iterator",d=l.set,h=l.getterFor(u);c(String,"String",(function(t){d(this,{type:u,string:o(t),index:0})}),(function next(){var t,r=h(this),a=r.string,o=r.index;if(o>=a.length)return{value:void 0,done:!0};t=i(a,o);r.index+=t.length;return{value:t,done:!1}}))},(t,r,a)=>{var i=a(17),o=a(62),l=a(88),c=a(19),u=i("".charAt),d=i("".charCodeAt),h=i("".slice),createMethod=function(t){return function(r,a){var i,p,v=l(c(r)),y=o(a),g=v.length;return y<0||y>=g?t?"":void 0:(i=d(v,y))<55296||i>56319||y+1===g||(p=d(v,y+1))<56320||p>57343?t?u(v,y):i:t?h(v,y,y+2):p-56320+(i-55296<<10)+65536}};t.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},(t,r,a)=>{var i=a(7);t.exports=i},(t,r,a)=>{a(90);a(96);a(129);a(140);a(141);var i=a(127);t.exports=i.structuredClone},(t,r,a)=>{"use strict";a(130)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),a(139))},(t,r,a)=>{"use strict";var i=a(6),o=a(7),l=a(17),c=a(67),u=a(49),d=a(131),h=a(78),p=a(102),v=a(23),y=a(22),g=a(10),m=a(103),_=a(95),b=a(138);t.exports=function(t,r,a){var A=-1!==t.indexOf("Map"),S=-1!==t.indexOf("Weak"),k=A?"set":"add",C=o[t],x=C&&C.prototype,P=C,w={},fixMethod=function(t){var r=l(x[t]);u(x,t,"add"==t?function add(t){r(this,0===t?0:t);return this}:"delete"==t?function(t){return!(S&&!y(t))&&r(this,0===t?0:t)}:"get"==t?function get(t){return S&&!y(t)?void 0:r(this,0===t?0:t)}:"has"==t?function has(t){return!(S&&!y(t))&&r(this,0===t?0:t)}:function set(t,a){r(this,0===t?0:t,a);return this})};if(c(t,!v(C)||!(S||x.forEach&&!g((function(){(new C).entries().next()}))))){P=a.getConstructor(r,t,A,k);d.enable()}else if(c(t,!0)){var T=new P,R=T[k](S?{}:-0,1)!=T,E=g((function(){T.has(1)})),O=m((function(t){new C(t)})),I=!S&&g((function(){for(var t=new C,r=5;r--;)t[k](r,r);return!t.has(-0)}));if(!O){(P=r((function(t,r){p(t,x);var a=b(new C,t,P);null!=r&&h(r,a[k],{that:a,AS_ENTRIES:A});return a}))).prototype=x;x.constructor=P}if(E||I){fixMethod("delete");fixMethod("has");A&&fixMethod("get")}(I||R)&&fixMethod(k);S&&x.clear&&delete x.clear}w[t]=P;i({global:!0,forced:P!=C},w);_(P,t);S||a.setStrong(P,t,A);return P}},(t,r,a)=>{var i=a(6),o=a(17),l=a(54),c=a(22),u=a(40),d=a(46).f,h=a(58),p=a(132),v=a(135),y=a(42),g=a(137),m=!1,_=y("meta"),b=0,setMetadata=function(t){d(t,_,{value:{objectID:"O"+b++,weakData:{}}})},A=t.exports={enable:function(){A.enable=function(){};m=!0;var t=h.f,r=o([].splice),a={};a[_]=1;if(t(a).length){h.f=function(a){for(var i=t(a),o=0,l=i.length;o<l;o++)if(i[o]===_){r(i,o,1);break}return i};i({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:p.f})}},fastKey:function(t,r){if(!c(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!u(t,_)){if(!v(t))return"F";if(!r)return"E";setMetadata(t)}return t[_].objectID},getWeakData:function(t,r){if(!u(t,_)){if(!v(t))return!0;if(!r)return!1;setMetadata(t)}return t[_].weakData},onFreeze:function(t){g&&m&&v(t)&&!u(t,_)&&setMetadata(t);return t}};l[_]=!0},(t,r,a)=>{var i=a(18),o=a(15),l=a(58).f,c=a(133),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return u&&"Window"==i(t)?function(t){try{return l(t)}catch(t){return c(u)}}(t):l(o(t))}},(t,r,a)=>{var i=a(7),o=a(61),l=a(63),c=a(134),u=i.Array,d=Math.max;t.exports=function(t,r,a){for(var i=l(t),h=o(r,i),p=o(void 0===a?i:a,i),v=u(d(p-h,0)),y=0;h<p;h++,y++)c(v,y,t[h]);v.length=y;return v}},(t,r,a)=>{"use strict";var i=a(20),o=a(46),l=a(14);t.exports=function(t,r,a){var c=i(r);c in t?o.f(t,c,l(0,a)):t[c]=a}},(t,r,a)=>{var i=a(10),o=a(22),l=a(18),c=a(136),u=Object.isExtensible,d=i((function(){u(1)}));t.exports=d||c?function isExtensible(t){return!!o(t)&&((!c||"ArrayBuffer"!=l(t))&&(!u||u(t)))}:u},(t,r,a)=>{var i=a(10);t.exports=i((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,r,a)=>{var i=a(10);t.exports=!i((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,r,a)=>{var i=a(23),o=a(22),l=a(70);t.exports=function(t,r,a){var c,u;l&&i(c=r.constructor)&&c!==a&&o(u=c.prototype)&&u!==a.prototype&&l(t,u);return t}},(t,r,a)=>{"use strict";var i=a(46).f,o=a(72),l=a(100),c=a(79),u=a(102),d=a(78),h=a(92),p=a(101),v=a(9),y=a(131).fastKey,g=a(51),m=g.set,_=g.getterFor;t.exports={getConstructor:function(t,r,a,h){var p=t((function(t,i){u(t,g);m(t,{type:r,index:o(null),first:void 0,last:void 0,size:0});v||(t.size=0);null!=i&&d(i,t[h],{that:t,AS_ENTRIES:a})})),g=p.prototype,b=_(r),define=function(t,r,a){var i,o,l=b(t),c=getEntry(t,r);if(c)c.value=a;else{l.last=c={index:o=y(r,!0),key:r,value:a,previous:i=l.last,next:void 0,removed:!1};l.first||(l.first=c);i&&(i.next=c);v?l.size++:t.size++;"F"!==o&&(l.index[o]=c)}return t},getEntry=function(t,r){var a,i=b(t),o=y(r);if("F"!==o)return i.index[o];for(a=i.first;a;a=a.next)if(a.key==r)return a};l(g,{clear:function clear(){for(var t=b(this),r=t.index,a=t.first;a;){a.removed=!0;a.previous&&(a.previous=a.previous.next=void 0);delete r[a.index];a=a.next}t.first=t.last=void 0;v?t.size=0:this.size=0},delete:function(t){var r=this,a=b(r),i=getEntry(r,t);if(i){var o=i.next,l=i.previous;delete a.index[i.index];i.removed=!0;l&&(l.next=o);o&&(o.previous=l);a.first==i&&(a.first=o);a.last==i&&(a.last=l);v?a.size--:r.size--}return!!i},forEach:function forEach(t){for(var r,a=b(this),i=c(t,arguments.length>1?arguments[1]:void 0);r=r?r.next:a.first;){i(r.value,r.key,this);for(;r&&r.removed;)r=r.previous}},has:function has(t){return!!getEntry(this,t)}});l(g,a?{get:function get(t){var r=getEntry(this,t);return r&&r.value},set:function set(t,r){return define(this,0===t?0:t,r)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});v&&i(g,"size",{get:function(){return b(this).size}});return p},setStrong:function(t,r,a){var i=r+" Iterator",o=_(r),l=_(i);h(t,r,(function(t,r){m(this,{type:i,target:t,state:o(t),kind:r,last:void 0})}),(function(){for(var t=l(this),r=t.kind,a=t.last;a&&a.removed;)a=a.previous;if(!t.target||!(t.last=a=a?a.next:t.state.first)){t.target=void 0;return{value:void 0,done:!0}}return"keys"==r?{value:a.key,done:!1}:"values"==r?{value:a.value,done:!1}:{value:[a.key,a.value],done:!1}}),a?"entries":"values",!a,!0);p(r)}}},(t,r,a)=>{"use strict";a(130)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),a(139))},(t,r,a)=>{var i,o=a(37),l=a(6),c=a(7),u=a(25),d=a(17),h=a(10),p=a(42),v=a(23),y=a(106),g=a(22),m=a(24),_=a(78),b=a(48),A=a(84),S=a(40),k=a(134),C=a(45),x=a(63),P=a(110),w=a(142),T=a(89),R=c.Object,E=c.Date,O=c.Error,I=c.EvalError,D=c.RangeError,M=c.ReferenceError,L=c.SyntaxError,j=c.TypeError,N=c.URIError,B=c.PerformanceMark,G=c.WebAssembly,U=G&&G.CompileError||O,W=G&&G.LinkError||O,H=G&&G.RuntimeError||O,q=u("DOMException"),V=u("Set"),z=u("Map"),X=z.prototype,Y=d(X.has),K=d(X.get),J=d(X.set),Q=d(V.prototype.add),$=u("Object","keys"),Z=d([].push),ee=d((!0).valueOf),te=d(1..valueOf),re=d("".valueOf),ne=d(w),ae=d(E.prototype.getTime),ie=p("structuredClone"),oe="DataCloneError",se="Transferring",checkBasicSemantic=function(t){return!h((function(){var r=new c.Set([7]),a=t(r),i=t(R(7));return a==r||!a.has(7)||"object"!=typeof i||7!=i}))&&t},le=c.structuredClone,ce=o||!(i=le,!h((function(){var t=i(new c.AggregateError([1],ie,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=ie||3!=t.cause}))&&i),ue=!le&&checkBasicSemantic((function(t){return new B(ie,{detail:t}).detail})),de=checkBasicSemantic(le)||ue,throwUncloneable=function(t){throw new q("Uncloneable type: "+t,oe)},throwUnpolyfillable=function(t,r){throw new q((r||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",oe)},structuredCloneInternal=function(t,r){m(t)&&throwUncloneable("Symbol");if(!g(t))return t;if(r){if(Y(r,t))return K(r,t)}else r=new z;var a,i,o,l,d,h,p,_,b,P,w=A(t),B=!1;switch(w){case"Array":o=[];B=!0;break;case"Object":o={};B=!0;break;case"Map":o=new z;B=!0;break;case"Set":o=new V;B=!0;break;case"RegExp":o=new RegExp(t.source,"flags"in t?t.flags:ne(t));break;case"Error":switch(i=t.name){case"AggregateError":o=u("AggregateError")([]);break;case"EvalError":o=I();break;case"RangeError":o=D();break;case"ReferenceError":o=M();break;case"SyntaxError":o=L();break;case"TypeError":o=j();break;case"URIError":o=N();break;case"CompileError":o=U();break;case"LinkError":o=W();break;case"RuntimeError":o=H();break;default:o=O()}B=!0;break;case"DOMException":o=new q(t.message,t.name);B=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":a=c[w];g(a)||throwUnpolyfillable(w);o=new a(structuredCloneInternal(t.buffer,r),t.byteOffset,"DataView"===w?t.byteLength:t.length);break;case"DOMQuad":try{o=new DOMQuad(structuredCloneInternal(t.p1,r),structuredCloneInternal(t.p2,r),structuredCloneInternal(t.p3,r),structuredCloneInternal(t.p4,r))}catch(r){de?o=de(t):throwUnpolyfillable(w)}break;case"FileList":a=c.DataTransfer;if(y(a)){l=new a;for(d=0,h=x(t);d<h;d++)l.items.add(structuredCloneInternal(t[d],r));o=l.files}else de?o=de(t):throwUnpolyfillable(w);break;case"ImageData":try{o=new ImageData(structuredCloneInternal(t.data,r),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){de?o=de(t):throwUnpolyfillable(w)}break;default:if(de)o=de(t);else switch(w){case"BigInt":o=R(t.valueOf());break;case"Boolean":o=R(ee(t));break;case"Number":o=R(te(t));break;case"String":o=R(re(t));break;case"Date":o=new E(ae(t));break;case"ArrayBuffer":(a=c.DataView)||"function"==typeof t.slice||throwUnpolyfillable(w);try{if("function"==typeof t.slice)o=t.slice(0);else{h=t.byteLength;o=new ArrayBuffer(h);b=new a(t);P=new a(o);for(d=0;d<h;d++)P.setUint8(d,b.getUint8(d))}}catch(t){throw new q("ArrayBuffer is detached",oe)}break;case"SharedArrayBuffer":o=t;break;case"Blob":try{o=t.slice(0,t.size,t.type)}catch(t){throwUnpolyfillable(w)}break;case"DOMPoint":case"DOMPointReadOnly":a=c[w];try{o=a.fromPoint?a.fromPoint(t):new a(t.x,t.y,t.z,t.w)}catch(t){throwUnpolyfillable(w)}break;case"DOMRect":case"DOMRectReadOnly":a=c[w];try{o=a.fromRect?a.fromRect(t):new a(t.x,t.y,t.width,t.height)}catch(t){throwUnpolyfillable(w)}break;case"DOMMatrix":case"DOMMatrixReadOnly":a=c[w];try{o=a.fromMatrix?a.fromMatrix(t):new a(t)}catch(t){throwUnpolyfillable(w)}break;case"AudioData":case"VideoFrame":v(t.clone)||throwUnpolyfillable(w);try{o=t.clone()}catch(t){throwUncloneable(w)}break;case"File":try{o=new File([t],t.name,t)}catch(t){throwUnpolyfillable(w)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(w);default:throwUncloneable(w)}}J(r,t,o);if(B)switch(w){case"Array":case"Object":p=$(t);for(d=0,h=x(p);d<h;d++){_=p[d];k(o,_,structuredCloneInternal(t[_],r))}break;case"Map":t.forEach((function(t,a){J(o,structuredCloneInternal(a,r),structuredCloneInternal(t,r))}));break;case"Set":t.forEach((function(t){Q(o,structuredCloneInternal(t,r))}));break;case"Error":C(o,"message",structuredCloneInternal(t.message,r));S(t,"cause")&&C(o,"cause",structuredCloneInternal(t.cause,r));"AggregateError"==i&&(o.errors=structuredCloneInternal(t.errors,r));case"DOMException":T&&C(o,"stack",structuredCloneInternal(t.stack,r))}return o},fe=le&&!h((function(){var t=new ArrayBuffer(8),r=le(t,{transfer:[t]});return 0!=t.byteLength||8!=r.byteLength})),tryToTransfer=function(t,r){if(!g(t))throw j("Transfer option cannot be converted to a sequence");var a=[];_(t,(function(t){Z(a,b(t))}));var i,o,l,u,d,h,p=0,m=x(a);if(fe){u=le(a,{transfer:a});for(;p<m;)J(r,a[p],u[p++])}else for(;p<m;){i=a[p++];if(Y(r,i))throw new q("Duplicate transferable",oe);switch(o=A(i)){case"ImageBitmap":l=c.OffscreenCanvas;y(l)||throwUnpolyfillable(o,se);try{(h=new l(i.width,i.height)).getContext("bitmaprenderer").transferFromImageBitmap(i);d=h.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":v(i.clone)&&v(i.close)||throwUnpolyfillable(o,se);try{d=i.clone();i.close()}catch(t){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(o,se)}if(void 0===d)throw new q("This object cannot be transferred: "+o,oe);J(r,i,d)}};l({global:!0,enumerable:!0,sham:!fe,forced:ce},{structuredClone:function structuredClone(t){var r,a=P(arguments.length,1)>1?b(arguments[1]):void 0,i=a?a.transfer:void 0;if(void 0!==i){r=new z;tryToTransfer(i,r)}return structuredCloneInternal(t,r)}})},(t,r,a)=>{"use strict";var i=a(48);t.exports=function(){var t=i(this),r="";t.global&&(r+="g");t.ignoreCase&&(r+="i");t.multiline&&(r+="m");t.dotAll&&(r+="s");t.unicode&&(r+="u");t.sticky&&(r+="y");return r}},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory;exports.version=void 0;var _regenerator=_interopRequireDefault(__w_pdfjs_require__(144)),_util=__w_pdfjs_require__(1),_display_utils=__w_pdfjs_require__(146),_font_loader=__w_pdfjs_require__(148),_node_utils=__w_pdfjs_require__(149),_annotation_storage=__w_pdfjs_require__(150),_canvas=__w_pdfjs_require__(151),_worker_options=__w_pdfjs_require__(153),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(154),_metadata=__w_pdfjs_require__(155),_optional_content_config=__w_pdfjs_require__(156),_transport_stream=__w_pdfjs_require__(157),_xfa_text=__w_pdfjs_require__(158);function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function _classPrivateMethodInitSpec(t,r){_checkPrivateRedeclaration(t,r);r.add(t)}function _classPrivateMethodGet(t,r,a){if(!r.has(t))throw new TypeError("attempted to get private field on non-instance");return a}function _classPrivateFieldInitSpec(t,r,a){_checkPrivateRedeclaration(t,r);r.set(t,a)}function _checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(t,r,a){_classApplyDescriptorSet(t,_classExtractFieldDescriptor(t,r,"set"),a);return a}function _classPrivateFieldGet(t,r){return _classApplyDescriptorGet(t,_classExtractFieldDescriptor(t,r,"get"))}function _classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classStaticPrivateFieldSpecSet(t,r,a,i){_classCheckPrivateStaticAccess(t,r);_classCheckPrivateStaticFieldDescriptor(a,"set");_classApplyDescriptorSet(t,a,i);return i}function _classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}function _classStaticPrivateFieldSpecGet(t,r,a){_classCheckPrivateStaticAccess(t,r);_classCheckPrivateStaticFieldDescriptor(a,"get");return _classApplyDescriptorGet(t,a)}function _classCheckPrivateStaticFieldDescriptor(t,r){if(void 0===t)throw new TypeError("attempted to "+r+" private static field before its declaration")}function _classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}function _classApplyDescriptorGet(t,r){return r.get?r.get.call(t):r.value}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _slicedToArray(t,r){return _arrayWithHoles(t)||_iterableToArrayLimit(t,r)||_unsupportedIterableToArray(t,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=a){var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DefaultCanvasFactory=_is_node.isNodeJS?_node_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;var DefaultCMapReaderFactory=_is_node.isNodeJS?_node_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;var DefaultStandardFontDataFactory=_is_node.isNodeJS?_node_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){var r,a=new PDFDocumentLoadingTask;if("string"==typeof t||t instanceof URL)r={url:t};else if((0,_util.isArrayBuffer)(t))r={data:t};else if(t instanceof PDFDataRangeTransport)r={range:t};else{if("object"!==_typeof(t))throw new Error("Invalid parameter in getDocument, need either string, URL, Uint8Array, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");r=t}var i=Object.create(null),o=null,l=null;for(var c in r){var u=r[c];switch(c){case"url":if("undefined"!=typeof window)try{i[c]=new URL(u,window.location).href;continue}catch(t){(0,_util.warn)('Cannot create valid URL: "'.concat(t,'".'))}else if("string"==typeof u||u instanceof URL){i[c]=u.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":o=u;continue;case"worker":l=u;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&u instanceof Buffer)i[c]=new Uint8Array(u);else{if(u instanceof Uint8Array)break;if("string"==typeof u)i[c]=(0,_util.stringToBytes)(u);else if("object"!==_typeof(u)||null===u||isNaN(u.length)){if(!(0,_util.isArrayBuffer)(u))throw new Error("Invalid PDF binary data: either typed array, string, or array-like object is expected in the data property.");i[c]=new Uint8Array(u)}else i[c]=new Uint8Array(u)}continue}i[c]=u}i.CMapReaderFactory=i.CMapReaderFactory||DefaultCMapReaderFactory;i.StandardFontDataFactory=i.StandardFontDataFactory||DefaultStandardFontDataFactory;i.ignoreErrors=!0!==i.stopAtErrors;i.fontExtraProperties=!0===i.fontExtraProperties;i.pdfBug=!0===i.pdfBug;i.enableXfa=!0===i.enableXfa;(!Number.isInteger(i.rangeChunkSize)||i.rangeChunkSize<1)&&(i.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE);("string"!=typeof i.docBaseUrl||(0,_display_utils.isDataScheme)(i.docBaseUrl))&&(i.docBaseUrl=null);(!Number.isInteger(i.maxImageSize)||i.maxImageSize<-1)&&(i.maxImageSize=-1);"string"!=typeof i.cMapUrl&&(i.cMapUrl=null);"string"!=typeof i.standardFontDataUrl&&(i.standardFontDataUrl=null);"boolean"!=typeof i.useWorkerFetch&&(i.useWorkerFetch=i.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&i.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory);"boolean"!=typeof i.isEvalSupported&&(i.isEvalSupported=!0);"boolean"!=typeof i.disableFontFace&&(i.disableFontFace=_is_node.isNodeJS);"boolean"!=typeof i.useSystemFonts&&(i.useSystemFonts=!_is_node.isNodeJS&&!i.disableFontFace);"object"===_typeof(i.ownerDocument)&&null!==i.ownerDocument||(i.ownerDocument=globalThis.document);"boolean"!=typeof i.disableRange&&(i.disableRange=!1);"boolean"!=typeof i.disableStream&&(i.disableStream=!1);"boolean"!=typeof i.disableAutoFetch&&(i.disableAutoFetch=!1);(0,_util.setVerbosityLevel)(i.verbosity);if(!l){var d={verbosity:i.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};l=d.port?PDFWorker.fromPort(d):new PDFWorker(d);a._worker=l}var h=a.docId;l.promise.then((function(){if(a.destroyed)throw new Error("Loading aborted");var t=_fetchDocument(l,i,o,h),r=new Promise((function(t){var r;o?r=new _transport_stream.PDFDataTransportStream({length:i.length,initialData:i.initialData,progressiveDone:i.progressiveDone,contentDispositionFilename:i.contentDispositionFilename,disableRange:i.disableRange,disableStream:i.disableStream},o):i.data||(r=createPDFNetworkStream({url:i.url,length:i.length,httpHeaders:i.httpHeaders,withCredentials:i.withCredentials,rangeChunkSize:i.rangeChunkSize,disableRange:i.disableRange,disableStream:i.disableStream}));t(r)}));return Promise.all([t,r]).then((function(t){var r=_slicedToArray(t,2),o=r[0],c=r[1];if(a.destroyed)throw new Error("Loading aborted");var u=new _message_handler.MessageHandler(h,o,l.port),d=new WorkerTransport(u,a,c,i);a._transport=d;u.send("Ready",null)}))})).catch(a._capability.reject);return a}function _fetchDocument(t,r,a,i){return _fetchDocument2.apply(this,arguments)}function _fetchDocument2(){return(_fetchDocument2=_asyncToGenerator(_regenerator.default.mark((function _callee7(t,r,a,i){var o;return _regenerator.default.wrap((function _callee7$(l){for(;;)switch(l.prev=l.next){case 0:if(!t.destroyed){l.next=2;break}throw new Error("Worker was destroyed");case 2:if(a){r.length=a.length;r.initialData=a.initialData;r.progressiveDone=a.progressiveDone;r.contentDispositionFilename=a.contentDispositionFilename}l.next=5;return t.messageHandler.sendWithPromise("GetDocRequest",{docId:i,apiVersion:"2.14.102",source:{data:r.data,url:r.url,password:r.password,disableAutoFetch:r.disableAutoFetch,rangeChunkSize:r.rangeChunkSize,length:r.length},maxImageSize:r.maxImageSize,disableFontFace:r.disableFontFace,docBaseUrl:r.docBaseUrl,ignoreErrors:r.ignoreErrors,isEvalSupported:r.isEvalSupported,fontExtraProperties:r.fontExtraProperties,enableXfa:r.enableXfa,useSystemFonts:r.useSystemFonts,cMapUrl:r.useWorkerFetch?r.cMapUrl:null,standardFontDataUrl:r.useWorkerFetch?r.standardFontDataUrl:null});case 5:o=l.sent;if(!t.destroyed){l.next=8;break}throw new Error("Worker was destroyed");case 8:return l.abrupt("return",o);case 9:case"end":return l.stop()}}),_callee7)})))).apply(this,arguments)}var PDFDocumentLoadingTask=function(){function PDFDocumentLoadingTask(){var t;_classCallCheck(this,PDFDocumentLoadingTask);this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d".concat((_classStaticPrivateFieldSpecSet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId,1+(t=+_classStaticPrivateFieldSpecGet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId))),t));this.destroyed=!1;this.onPassword=null;this.onProgress=null;this.onUnsupportedFeature=null}_createClass(PDFDocumentLoadingTask,[{key:"promise",get:function get(){return this._capability.promise}},{key:"destroy",value:(t=_asyncToGenerator(_regenerator.default.mark((function _callee(){var t;return _regenerator.default.wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:this.destroyed=!0;r.next=3;return null===(t=this._transport)||void 0===t?void 0:t.destroy();case 3:this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}case 5:case"end":return r.stop()}}),_callee,this)}))),function destroy(){return t.apply(this,arguments)})}]);var t;return PDFDocumentLoadingTask}();exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;var _docId={writable:!0,value:0},PDFDataRangeTransport=function(){function PDFDataRangeTransport(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,PDFDataRangeTransport);this.length=t;this.initialData=r;this.progressiveDone=a;this.contentDispositionFilename=i;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}_createClass(PDFDataRangeTransport,[{key:"addRangeListener",value:function addRangeListener(t){this._rangeListeners.push(t)}},{key:"addProgressListener",value:function addProgressListener(t){this._progressListeners.push(t)}},{key:"addProgressiveReadListener",value:function addProgressiveReadListener(t){this._progressiveReadListeners.push(t)}},{key:"addProgressiveDoneListener",value:function addProgressiveDoneListener(t){this._progressiveDoneListeners.push(t)}},{key:"onDataRange",value:function onDataRange(t,r){var a,i=_createForOfIteratorHelper(this._rangeListeners);try{for(i.s();!(a=i.n()).done;){(0,a.value)(t,r)}}catch(t){i.e(t)}finally{i.f()}}},{key:"onDataProgress",value:function onDataProgress(t,r){var a=this;this._readyCapability.promise.then((function(){var i,o=_createForOfIteratorHelper(a._progressListeners);try{for(o.s();!(i=o.n()).done;){(0,i.value)(t,r)}}catch(t){o.e(t)}finally{o.f()}}))}},{key:"onDataProgressiveRead",value:function onDataProgressiveRead(t){var r=this;this._readyCapability.promise.then((function(){var a,i=_createForOfIteratorHelper(r._progressiveReadListeners);try{for(i.s();!(a=i.n()).done;){(0,a.value)(t)}}catch(t){i.e(t)}finally{i.f()}}))}},{key:"onDataProgressiveDone",value:function onDataProgressiveDone(){var t=this;this._readyCapability.promise.then((function(){var r,a=_createForOfIteratorHelper(t._progressiveDoneListeners);try{for(a.s();!(r=a.n()).done;){(0,r.value)()}}catch(t){a.e(t)}finally{a.f()}}))}},{key:"transportReady",value:function transportReady(){this._readyCapability.resolve()}},{key:"requestDataRange",value:function requestDataRange(t,r){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}},{key:"abort",value:function abort(){}}]);return PDFDataRangeTransport}();exports.PDFDataRangeTransport=PDFDataRangeTransport;var PDFDocumentProxy=function(){function PDFDocumentProxy(t,r){var a,i=this;_classCallCheck(this,PDFDocumentProxy);this._pdfInfo=t;this._transport=r;Object.defineProperty(this,"fingerprint",{get:function get(){(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, please use `PDFDocumentProxy.fingerprints` instead.");return this.fingerprints[0]}});Object.defineProperty(this,"getStats",{value:(a=_asyncToGenerator(_regenerator.default.mark((function _callee2(){return _regenerator.default.wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:(0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, please use the `PDFDocumentProxy.stats`-getter instead.");return t.abrupt("return",i.stats||{streamTypes:{},fontTypes:{}});case 2:case"end":return t.stop()}}),_callee2)}))),function value(){return a.apply(this,arguments)})})}_createClass(PDFDocumentProxy,[{key:"annotationStorage",get:function get(){return this._transport.annotationStorage}},{key:"numPages",get:function get(){return this._pdfInfo.numPages}},{key:"fingerprints",get:function get(){return this._pdfInfo.fingerprints}},{key:"stats",get:function get(){return this._transport.stats}},{key:"isPureXfa",get:function get(){return!!this._transport._htmlForXfa}},{key:"allXfaHtml",get:function get(){return this._transport._htmlForXfa}},{key:"getPage",value:function getPage(t){return this._transport.getPage(t)}},{key:"getPageIndex",value:function getPageIndex(t){return this._transport.getPageIndex(t)}},{key:"getDestinations",value:function getDestinations(){return this._transport.getDestinations()}},{key:"getDestination",value:function getDestination(t){return this._transport.getDestination(t)}},{key:"getPageLabels",value:function getPageLabels(){return this._transport.getPageLabels()}},{key:"getPageLayout",value:function getPageLayout(){return this._transport.getPageLayout()}},{key:"getPageMode",value:function getPageMode(){return this._transport.getPageMode()}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this._transport.getViewerPreferences()}},{key:"getOpenAction",value:function getOpenAction(){return this._transport.getOpenAction()}},{key:"getAttachments",value:function getAttachments(){return this._transport.getAttachments()}},{key:"getJavaScript",value:function getJavaScript(){return this._transport.getJavaScript()}},{key:"getJSActions",value:function getJSActions(){return this._transport.getDocJSActions()}},{key:"getOutline",value:function getOutline(){return this._transport.getOutline()}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}},{key:"getPermissions",value:function getPermissions(){return this._transport.getPermissions()}},{key:"getMetadata",value:function getMetadata(){return this._transport.getMetadata()}},{key:"getMarkInfo",value:function getMarkInfo(){return this._transport.getMarkInfo()}},{key:"getData",value:function getData(){return this._transport.getData()}},{key:"getDownloadInfo",value:function getDownloadInfo(){return this._transport.downloadInfoCapability.promise}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._transport.startCleanup(t||this.isPureXfa)}},{key:"destroy",value:function destroy(){return this.loadingTask.destroy()}},{key:"loadingParams",get:function get(){return this._transport.loadingParams}},{key:"loadingTask",get:function get(){return this._transport.loadingTask}},{key:"saveDocument",value:function saveDocument(){this._transport.annotationStorage.size<=0&&(0,_display_utils.deprecated)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this._transport.saveDocument()}},{key:"getFieldObjects",value:function getFieldObjects(){return this._transport.getFieldObjects()}},{key:"hasJSActions",value:function hasJSActions(){return this._transport.hasJSActions()}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}]);return PDFDocumentProxy}();exports.PDFDocumentProxy=PDFDocumentProxy;var PDFPageProxy=function(){function PDFPageProxy(t,r,a,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];_classCallCheck(this,PDFPageProxy);this._pageIndex=t;this._pageInfo=r;this._ownerDocument=i;this._transport=a;this._stats=o?new _display_utils.StatTimer:null;this._pdfBug=o;this.commonObjs=a.commonObjs;this.objs=new PDFObjects;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this._annotationPromises=new Map;this.destroyed=!1}_createClass(PDFPageProxy,[{key:"pageNumber",get:function get(){return this._pageIndex+1}},{key:"rotate",get:function get(){return this._pageInfo.rotate}},{key:"ref",get:function get(){return this._pageInfo.ref}},{key:"userUnit",get:function get(){return this._pageInfo.userUnit}},{key:"view",get:function get(){return this._pageInfo.view}},{key:"getViewport",value:function getViewport(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=t.rotation,i=void 0===a?this.rotate:a,o=t.offsetX,l=void 0===o?0:o,c=t.offsetY,u=void 0===c?0:c,d=t.dontFlip,h=void 0!==d&&d;return new _display_utils.PageViewport({viewBox:this.view,scale:r,rotation:i,offsetX:l,offsetY:u,dontFlip:h})}},{key:"getAnnotations",value:function getAnnotations(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.intent,a=void 0===r?"display":r,i=this._transport.getRenderingIntent(a),o=this._annotationPromises.get(i.cacheKey);if(!o){o=this._transport.getAnnotations(this._pageIndex,i.renderingIntent);this._annotationPromises.set(i.cacheKey,o);o=o.then((function(t){var r,a=_createForOfIteratorHelper(t);try{var i=function _loop(){var t=r.value;void 0!==t.titleObj&&Object.defineProperty(t,"title",{get:function get(){(0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead.");return t.titleObj.str}});void 0!==t.contentsObj&&Object.defineProperty(t,"contents",{get:function get(){(0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead.");return t.contentsObj.str}})};for(a.s();!(r=a.n()).done;)i()}catch(t){a.e(t)}finally{a.f()}return t}))}return o}},{key:"getJSActions",value:function getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}},{key:"getXfa",value:(t=_asyncToGenerator(_regenerator.default.mark((function _callee3(){var t;return _regenerator.default.wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(null===(t=this._transport._htmlForXfa)||void 0===t?void 0:t.children[this._pageIndex])||null);case 1:case"end":return r.stop()}}),_callee3,this)}))),function getXfa(){return t.apply(this,arguments)})},{key:"render",value:function render(t){var r,a,i,o=this,l=t.canvasContext,c=t.viewport,u=t.intent,d=void 0===u?"display":u,h=t.annotationMode,p=void 0===h?_util.AnnotationMode.ENABLE:h,v=t.transform,y=void 0===v?null:v,g=t.imageLayer,m=void 0===g?null:g,_=t.canvasFactory,b=void 0===_?null:_,A=t.background,S=void 0===A?null:A,k=t.optionalContentConfigPromise,C=void 0===k?null:k,x=t.annotationCanvasMap,P=void 0===x?null:x;if(void 0!==(null===(r=arguments[0])||void 0===r?void 0:r.renderInteractiveForms)){(0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, please use the `annotationMode`-option instead.");!0===arguments[0].renderInteractiveForms&&p===_util.AnnotationMode.ENABLE&&(p=_util.AnnotationMode.ENABLE_FORMS)}if(void 0!==(null===(a=arguments[0])||void 0===a?void 0:a.includeAnnotationStorage)){(0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, please use the `annotationMode`-option instead.");!0===arguments[0].includeAnnotationStorage&&p===_util.AnnotationMode.ENABLE&&(p=_util.AnnotationMode.ENABLE_STORAGE)}this._stats&&this._stats.time("Overall");var w=this._transport.getRenderingIntent(d,p);this.pendingCleanup=!1;C||(C=this._transport.getOptionalContentConfig());var T=this._intentStates.get(w.cacheKey);if(!T){T=Object.create(null);this._intentStates.set(w.cacheKey,T)}if(T.streamReaderCancelTimeout){clearTimeout(T.streamReaderCancelTimeout);T.streamReaderCancelTimeout=null}var R=b||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),E=!!(w.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!T.displayReadyCapability){T.displayReadyCapability=(0,_util.createPromiseCapability)();T.operatorList={fnArray:[],argsArray:[],lastChunk:!1};this._stats&&this._stats.time("Page Request");this._pumpOperatorList(w)}var O=function complete(t){T.renderTasks.delete(I);(o.cleanupAfterRender||E)&&(o.pendingCleanup=!0);o._tryCleanup();if(t){I.capability.reject(t);o._abortOperatorList({intentState:T,reason:t instanceof Error?t:new Error(t)})}else I.capability.resolve();if(o._stats){o._stats.timeEnd("Rendering");o._stats.timeEnd("Overall")}},I=new InternalRenderTask({callback:O,params:{canvasContext:l,viewport:c,transform:y,imageLayer:m,background:S},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:P,operatorList:T.operatorList,pageIndex:this._pageIndex,canvasFactory:R,useRequestAnimationFrame:!E,pdfBug:this._pdfBug});((i=T).renderTasks||(i.renderTasks=new Set)).add(I);var D=I.task;Promise.all([T.displayReadyCapability.promise,C]).then((function(t){var r=_slicedToArray(t,2),a=r[0],i=r[1];if(o.pendingCleanup)O();else{o._stats&&o._stats.time("Rendering");I.initializeGraphics({transparency:a,optionalContentConfig:i});I.operatorListChanged()}})).catch(O);return D}},{key:"getOperatorList",value:function getOperatorList(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.intent,a=void 0===r?"display":r,i=t.annotationMode,o=void 0===i?_util.AnnotationMode.ENABLE:i;function operatorListChanged(){if(u.operatorList.lastChunk){u.opListReadCapability.resolve(u.operatorList);u.renderTasks.delete(l)}}var l,c=this._transport.getRenderingIntent(a,o,!0),u=this._intentStates.get(c.cacheKey);if(!u){u=Object.create(null);this._intentStates.set(c.cacheKey,u)}if(!u.opListReadCapability){var d;(l=Object.create(null)).operatorListChanged=operatorListChanged;u.opListReadCapability=(0,_util.createPromiseCapability)();((d=u).renderTasks||(d.renderTasks=new Set)).add(l);u.operatorList={fnArray:[],argsArray:[],lastChunk:!1};this._stats&&this._stats.time("Page Request");this._pumpOperatorList(c)}return u.opListReadCapability.promise}},{key:"streamTextContent",value:function streamTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.disableCombineTextItems,a=void 0!==r&&r,i=t.includeMarkedContent,o=void 0!==i&&i,l=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==a,includeMarkedContent:!0===o},{highWaterMark:l,size:function size(t){return t.items.length}})}},{key:"getTextContent",value:function getTextContent(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._transport._htmlForXfa)return this.getXfa().then((function(t){return _xfa_text.XfaText.textContent(t)}));var r=this.streamTextContent(t);return new Promise((function(t,a){var i=r.getReader(),o={items:[],styles:Object.create(null)};!function pump(){i.read().then((function(r){var a,i=r.value;if(r.done)t(o);else{Object.assign(o.styles,i.styles);(a=o.items).push.apply(a,_toConsumableArray(i.items));pump()}}),a)}()}))}},{key:"getStructTree",value:function getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}},{key:"_destroy",value:function _destroy(){this.destroyed=!0;var t,r=[],a=_createForOfIteratorHelper(this._intentStates.values());try{for(a.s();!(t=a.n()).done;){var i=t.value;this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0});if(!i.opListReadCapability){var o,l=_createForOfIteratorHelper(i.renderTasks);try{for(l.s();!(o=l.n()).done;){var c=o.value;r.push(c.completed);c.cancel()}}catch(t){l.e(t)}finally{l.f()}}}}catch(t){a.e(t)}finally{a.f()}this.objs.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;this.pendingCleanup=!1;return Promise.all(r)}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup=!0;return this._tryCleanup(t)}},{key:"_tryCleanup",value:function _tryCleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;var r,a=_createForOfIteratorHelper(this._intentStates.values());try{for(a.s();!(r=a.n()).done;){var i=r.value,o=i.renderTasks,l=i.operatorList;if(o.size>0||!l.lastChunk)return!1}}catch(t){a.e(t)}finally{a.f()}this._intentStates.clear();this.objs.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;t&&this._stats&&(this._stats=new _display_utils.StatTimer);this.pendingCleanup=!1;return!0}},{key:"_startRenderPage",value:function _startRenderPage(t,r){var a=this._intentStates.get(r);if(a){this._stats&&this._stats.timeEnd("Page Request");a.displayReadyCapability&&a.displayReadyCapability.resolve(t)}}},{key:"_renderPageChunk",value:function _renderPageChunk(t,r){for(var a=0,i=t.length;a<i;a++){r.operatorList.fnArray.push(t.fnArray[a]);r.operatorList.argsArray.push(t.argsArray[a])}r.operatorList.lastChunk=t.lastChunk;var o,l=_createForOfIteratorHelper(r.renderTasks);try{for(l.s();!(o=l.n()).done;){o.value.operatorListChanged()}}catch(t){l.e(t)}finally{l.f()}t.lastChunk&&this._tryCleanup()}},{key:"_pumpOperatorList",value:function _pumpOperatorList(t){var r=this,a=t.renderingIntent,i=t.cacheKey,o=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:a,cacheKey:i,annotationStorage:a&_util.RenderingIntentFlag.ANNOTATIONS_STORAGE?this._transport.annotationStorage.serializable:null}).getReader(),l=this._intentStates.get(i);l.streamReader=o;!function pump(){o.read().then((function(t){var a=t.value;if(t.done)l.streamReader=null;else if(!r._transport.destroyed){r._renderPageChunk(a,l);pump()}}),(function(t){l.streamReader=null;if(!r._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;var a,i=_createForOfIteratorHelper(l.renderTasks);try{for(i.s();!(a=i.n()).done;){a.value.operatorListChanged()}}catch(t){i.e(t)}finally{i.f()}r._tryCleanup()}if(l.displayReadyCapability)l.displayReadyCapability.reject(t);else{if(!l.opListReadCapability)throw t;l.opListReadCapability.reject(t)}}}))}()}},{key:"_abortOperatorList",value:function _abortOperatorList(t){var r=this,a=t.intentState,i=t.reason,o=t.force,l=void 0!==o&&o;if(a.streamReader){if(!l){if(a.renderTasks.size>0)return;if(i instanceof _display_utils.RenderingCancelledException){a.streamReaderCancelTimeout=setTimeout((function(){r._abortOperatorList({intentState:a,reason:i,force:!0});a.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT);return}}a.streamReader.cancel(new _util.AbortException(i.message)).catch((function(){}));a.streamReader=null;if(!this._transport.destroyed){var c,u=_createForOfIteratorHelper(this._intentStates);try{for(u.s();!(c=u.n()).done;){var d=_slicedToArray(c.value,2),h=d[0];if(d[1]===a){this._intentStates.delete(h);break}}}catch(t){u.e(t)}finally{u.f()}this.cleanup()}}}},{key:"stats",get:function get(){return this._stats}}]);var t;return PDFPageProxy}();exports.PDFPageProxy=PDFPageProxy;var LoopbackPort=function(){function LoopbackPort(){_classCallCheck(this,LoopbackPort);this._listeners=[];this._deferred=Promise.resolve()}_createClass(LoopbackPort,[{key:"postMessage",value:function postMessage(t,r){var a=this,i={data:r?structuredClone(t,r):structuredClone(t)};this._deferred.then((function(){var t,r=_createForOfIteratorHelper(a._listeners);try{for(r.s();!(t=r.n()).done;){t.value.call(a,i)}}catch(t){r.e(t)}finally{r.f()}}))}},{key:"addEventListener",value:function addEventListener(t,r){this._listeners.push(r)}},{key:"removeEventListener",value:function removeEventListener(t,r){var a=this._listeners.indexOf(r);this._listeners.splice(a,1)}},{key:"terminate",value:function terminate(){this._listeners.length=0}}]);return LoopbackPort}();exports.LoopbackPort=LoopbackPort;var PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"===("undefined"==typeof document?"undefined":_typeof(document))){var _document,_document$currentScri,pdfjsFilePath=null===(_document=document)||void 0===_document||null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;pdfjsFilePath&&(PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,r){var a;try{if(!(a=new URL(t)).origin||"null"===a.origin)return!1}catch(t){return!1}var i=new URL(r,a);return a.origin===i.origin};PDFWorkerUtil.createCDNWrapper=function(t){var r='importScripts("'.concat(t,'");');return URL.createObjectURL(new Blob([r]))};var PDFWorker=function(){function PDFWorker(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.name,a=void 0===r?null:r,i=t.port,o=void 0===i?null:i,l=t.verbosity,c=void 0===l?(0,_util.getVerbosityLevel)():l;_classCallCheck(this,PDFWorker);if(o&&_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).has(o))throw new Error("Cannot use more than one PDFWorker per port.");this.name=a;this.destroyed=!1;this.verbosity=c;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(o){_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).set(o,this);this._initializeFromPort(o)}else this._initialize()}_createClass(PDFWorker,[{key:"promise",get:function get(){return this._readyCapability.promise}},{key:"port",get:function get(){return this._port}},{key:"messageHandler",get:function get(){return this._messageHandler}},{key:"_initializeFromPort",value:function _initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve()}},{key:"_initialize",value:function _initialize(){var t=this;if("undefined"!=typeof Worker&&!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){var r=PDFWorker.workerSrc;try{PDFWorkerUtil.isSameOrigin(window.location.href,r)||(r=PDFWorkerUtil.createCDNWrapper(new URL(r,window.location).href));var a=new Worker(r),i=new _message_handler.MessageHandler("main","worker",a),o=function terminateEarly(){a.removeEventListener("error",l);i.destroy();a.terminate();t.destroyed?t._readyCapability.reject(new Error("Worker was destroyed")):t._setupFakeWorker()},l=function onWorkerError(){t._webWorker||o()};a.addEventListener("error",l);i.on("test",(function(r){a.removeEventListener("error",l);if(t.destroyed)o();else if(r){t._messageHandler=i;t._port=a;t._webWorker=a;t._readyCapability.resolve();i.send("configure",{verbosity:t.verbosity})}else{t._setupFakeWorker();i.destroy();a.terminate()}}));i.on("ready",(function(r){a.removeEventListener("error",l);if(t.destroyed)o();else try{c()}catch(r){t._setupFakeWorker()}}));var c=function sendTest(){var t=new Uint8Array;i.send("test",t,[t.buffer])};c();return}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}},{key:"_setupFakeWorker",value:function _setupFakeWorker(){var t=this;if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((function(r){if(t.destroyed)t._readyCapability.reject(new Error("Worker was destroyed"));else{var a=new LoopbackPort;t._port=a;var i="fake".concat(PDFWorkerUtil.fakeWorkerId++),o=new _message_handler.MessageHandler(i+"_worker",i,a);r.setup(o,a);var l=new _message_handler.MessageHandler(i,i+"_worker",a);t._messageHandler=l;t._readyCapability.resolve();l.send("configure",{verbosity:t.verbosity})}})).catch((function(r){t._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(r.message,'".')))}))}},{key:"destroy",value:function destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}}],[{key:"fromPort",value:function fromPort(t){if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return _classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).has(t.port)?_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).get(t.port):new PDFWorker(t)}},{key:"workerSrc",get:function get(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}},{key:"_mainThreadWorkerMessageHandler",get:function get(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}}},{key:"_setupFakeWorkerGlobal",get:function get(){var _this11=this,loader=function(){var _ref15=_asyncToGenerator(_regenerator.default.mark((function _callee4(){var mainWorkerMessageHandler,worker;return _regenerator.default.wrap((function _callee4$(_context4){for(;;)switch(_context4.prev=_context4.next){case 0:mainWorkerMessageHandler=_this11._mainThreadWorkerMessageHandler;if(!mainWorkerMessageHandler){_context4.next=3;break}return _context4.abrupt("return",mainWorkerMessageHandler);case 3:if(!_is_node.isNodeJS||"function"!=typeof require){_context4.next=6;break}worker=eval("require")(_this11.workerSrc);return _context4.abrupt("return",worker.WorkerMessageHandler);case 6:_context4.next=8;return(0,_display_utils.loadScript)(_this11.workerSrc);case 8:return _context4.abrupt("return",window.pdfjsWorker.WorkerMessageHandler);case 9:case"end":return _context4.stop()}}),_callee4)})));return function loader(){return _ref15.apply(this,arguments)}}();return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}]);return PDFWorker}();exports.PDFWorker=PDFWorker;var _workerPorts={writable:!0,value:new WeakMap};PDFWorker.getWorkerSrc=function(){(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.");return this.workerSrc};var _docStats=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_metadataPromise=new WeakMap,WorkerTransport=function(){function WorkerTransport(t,r,a,i){_classCallCheck(this,WorkerTransport);_classPrivateFieldInitSpec(this,_docStats,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_metadataPromise,{writable:!0,value:null});this.messageHandler=t;this.loadingTask=r;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({docId:r.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:i.ownerDocument,styleElement:i.styleElement});this._params=i;if(!i.useWorkerFetch){this.CMapReaderFactory=new i.CMapReaderFactory({baseUrl:i.cMapUrl,isCompressed:i.cMapPacked});this.StandardFontDataFactory=new i.StandardFontDataFactory({baseUrl:i.standardFontDataUrl})}this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=a;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}_createClass(WorkerTransport,[{key:"annotationStorage",get:function get(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}},{key:"stats",get:function get(){return _classPrivateFieldGet(this,_docStats)}},{key:"getRenderingIntent",value:function getRenderingIntent(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=_util.RenderingIntentFlag.DISPLAY,o="";switch(t){case"any":i=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":i=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(t))}switch(r){case _util.AnnotationMode.DISABLE:i+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:i+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:i+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;o=this.annotationStorage.lastModified;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(r))}a&&(i+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:i,cacheKey:"".concat(i,"_").concat(o)}}},{key:"destroy",value:function destroy(){var t=this;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));var r,a=[],i=_createForOfIteratorHelper(_classPrivateFieldGet(this,_pageCache).values());try{for(i.s();!(r=i.n()).done;){var o=r.value;a.push(o._destroy())}}catch(t){i.e(t)}finally{i.f()}_classPrivateFieldGet(this,_pageCache).clear();_classPrivateFieldGet(this,_pagePromises).clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();var l=this.messageHandler.sendWithPromise("Terminate",null);a.push(l);Promise.all(a).then((function(){t.commonObjs.clear();t.fontLoader.clear();_classPrivateFieldSet(t,_metadataPromise,null);t._getFieldObjectsPromise=null;t._hasJSActionsPromise=null;t._networkStream&&t._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(t.messageHandler){t.messageHandler.destroy();t.messageHandler=null}t.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}},{key:"setupMessageHandler",value:function setupMessageHandler(){var t=this,r=this.messageHandler,a=this.loadingTask;r.on("GetReader",(function(r,a){(0,_util.assert)(t._networkStream,"GetReader - no `IPDFStream` instance available.");t._fullReader=t._networkStream.getFullReader();t._fullReader.onProgress=function(r){t._lastProgress={loaded:r.loaded,total:r.total}};a.onPull=function(){t._fullReader.read().then((function(t){var r=t.value;if(t.done)a.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){t._fullReader.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}));r.on("ReaderHeadersReady",(function(r){var i=(0,_util.createPromiseCapability)(),o=t._fullReader;o.headersReady.then((function(){if(!o.isStreamingSupported||!o.isRangeSupported){if(t._lastProgress){var r;null===(r=a.onProgress)||void 0===r||r.call(a,t._lastProgress)}o.onProgress=function(t){var r;null===(r=a.onProgress)||void 0===r||r.call(a,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:o.isStreamingSupported,isRangeSupported:o.isRangeSupported,contentLength:o.contentLength})}),i.reject);return i.promise}));r.on("GetRangeReader",(function(r,a){(0,_util.assert)(t._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var i=t._networkStream.getRangeReader(r.begin,r.end);if(i){a.onPull=function(){i.read().then((function(t){var r=t.value;if(t.done)a.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(r),"GetRangeReader - expected an ArrayBuffer.");a.enqueue(new Uint8Array(r),1,[r])}})).catch((function(t){a.error(t)}))};a.onCancel=function(r){i.cancel(r);a.ready.catch((function(r){if(!t.destroyed)throw r}))}}else a.close()}));r.on("GetDoc",(function(r){var i=r.pdfInfo;t._numPages=i.numPages;t._htmlForXfa=i.htmlForXfa;delete i.htmlForXfa;a._capability.resolve(new PDFDocumentProxy(i,t))}));r.on("DocException",(function(t){var r;switch(t.name){case"PasswordException":r=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":r=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":r=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":r=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":r=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}a._capability.reject(r)}));r.on("PasswordRequest",(function(r){t._passwordCapability=(0,_util.createPromiseCapability)();if(a.onPassword){try{a.onPassword((function updatePassword(r){r instanceof Error?t._passwordCapability.reject(r):t._passwordCapability.resolve({password:r})}),r.code)}catch(r){t._passwordCapability.reject(r)}}else t._passwordCapability.reject(new _util.PasswordException(r.message,r.code));return t._passwordCapability.promise}));r.on("DataLoaded",(function(r){var i;null===(i=a.onProgress)||void 0===i||i.call(a,{loaded:r.length,total:r.length});t.downloadInfoCapability.resolve(r)}));r.on("StartRenderPage",(function(r){if(!t.destroyed){_classPrivateFieldGet(t,_pageCache).get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}}));r.on("commonobj",(function(a){var i,o=_slicedToArray(a,3),l=o[0],c=o[1],u=o[2];if(!t.destroyed&&!t.commonObjs.has(l))switch(c){case"Font":var d=t._params;if("error"in u){var h=u.error;(0,_util.warn)("Error during font loading: ".concat(h));t.commonObjs.resolve(l,h);break}var p=null;d.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled&&(p={registerFont:function registerFont(t,r){globalThis.FontInspector.fontAdded(t,r)}});var v=new _font_loader.FontFaceObject(u,{isEvalSupported:d.isEvalSupported,disableFontFace:d.disableFontFace,ignoreErrors:d.ignoreErrors,onUnsupportedFeature:t._onUnsupportedFeature.bind(t),fontRegistry:p});t.fontLoader.bind(v).catch((function(t){return r.sendWithPromise("FontFallback",{id:l})})).finally((function(){!d.fontExtraProperties&&v.data&&(v.data=null);t.commonObjs.resolve(l,v)}));break;case"FontPath":case"Image":t.commonObjs.resolve(l,u);break;default:throw new Error("Got unknown common object type ".concat(c))}}));r.on("obj",(function(r){var a,i=_slicedToArray(r,4),o=i[0],l=i[1],c=i[2],u=i[3];if(!t.destroyed){var d=_classPrivateFieldGet(t,_pageCache).get(l);if(!d.objs.has(o))switch(c){case"Image":d.objs.resolve(o,u);(null==u||null===(a=u.data)||void 0===a?void 0:a.length)>8e6&&(d.cleanupAfterRender=!0);break;case"Pattern":d.objs.resolve(o,u);break;default:throw new Error("Got unknown object type ".concat(c))}}}));r.on("DocProgress",(function(r){var i;t.destroyed||null===(i=a.onProgress)||void 0===i||i.call(a,{loaded:r.loaded,total:r.total})}));r.on("DocStats",(function(r){t.destroyed||_classPrivateFieldSet(t,_docStats,Object.freeze({streamTypes:Object.freeze(r.streamTypes),fontTypes:Object.freeze(r.fontTypes)}))}));r.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));r.on("FetchBuiltInCMap",(function(r){return t.destroyed?Promise.reject(new Error("Worker was destroyed.")):t.CMapReaderFactory?t.CMapReaderFactory.fetch(r):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))}));r.on("FetchStandardFontData",(function(r){return t.destroyed?Promise.reject(new Error("Worker was destroyed.")):t.StandardFontDataFactory?t.StandardFontDataFactory.fetch(r):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))}))}},{key:"_onUnsupportedFeature",value:function _onUnsupportedFeature(t){var r,a,i=t.featureId;this.destroyed||null===(r=(a=this.loadingTask).onUnsupportedFeature)||void 0===r||r.call(a,i)}},{key:"getData",value:function getData(){return this.messageHandler.sendWithPromise("GetData",null)}},{key:"getPage",value:function getPage(t){var r=this;if(!Number.isInteger(t)||t<=0||t>this._numPages)return Promise.reject(new Error("Invalid page request."));var a=t-1,i=_classPrivateFieldGet(this,_pagePromises).get(a);if(i)return i;var o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:a}).then((function(t){if(r.destroyed)throw new Error("Transport destroyed");var i=new PDFPageProxy(a,t,r,r._params.ownerDocument,r._params.pdfBug);_classPrivateFieldGet(r,_pageCache).set(a,i);return i}));_classPrivateFieldGet(this,_pagePromises).set(a,o);return o}},{key:"getPageIndex",value:function getPageIndex(t){return"object"!==_typeof(t)||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}},{key:"getAnnotations",value:function getAnnotations(t,r){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:r})}},{key:"saveDocument",value:function saveDocument(){var t,r,a=this;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:null!==(t=null===(r=this._fullReader)||void 0===r?void 0:r.filename)&&void 0!==t?t:null}).finally((function(){a.annotationStorage.resetModified()}))}},{key:"getFieldObjects",value:function getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}},{key:"hasJSActions",value:function hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}},{key:"getCalculationOrderIds",value:function getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}},{key:"getDestinations",value:function getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}},{key:"getDestination",value:function getDestination(t){return"string"!=typeof t?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:t})}},{key:"getPageLabels",value:function getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}},{key:"getPageLayout",value:function getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}},{key:"getPageMode",value:function getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}},{key:"getViewerPreferences",value:function getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}},{key:"getOpenAction",value:function getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}},{key:"getAttachments",value:function getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}},{key:"getJavaScript",value:function getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}},{key:"getDocJSActions",value:function getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}},{key:"getPageJSActions",value:function getPageJSActions(t){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:t})}},{key:"getStructTree",value:function getStructTree(t){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:t})}},{key:"getOutline",value:function getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}},{key:"getOptionalContentConfig",value:function getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(t){return new _optional_content_config.OptionalContentConfig(t)}))}},{key:"getPermissions",value:function getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}},{key:"getMetadata",value:function getMetadata(){var t=this;return _classPrivateFieldGet(this,_metadataPromise)||_classPrivateFieldSet(this,_metadataPromise,this.messageHandler.sendWithPromise("GetMetadata",null).then((function(r){var a,i,o,l;return{info:r[0],metadata:r[1]?new _metadata.Metadata(r[1]):null,contentDispositionFilename:null!==(a=null===(i=t._fullReader)||void 0===i?void 0:i.filename)&&void 0!==a?a:null,contentLength:null!==(o=null===(l=t._fullReader)||void 0===l?void 0:l.contentLength)&&void 0!==o?o:null}})))}},{key:"getMarkInfo",value:function getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}},{key:"startCleanup",value:(t=_asyncToGenerator(_regenerator.default.mark((function _callee5(){var t,r,a,i,o=arguments;return _regenerator.default.wrap((function _callee5$(l){for(;;)switch(l.prev=l.next){case 0:t=o.length>0&&void 0!==o[0]&&o[0];l.next=3;return this.messageHandler.sendWithPromise("Cleanup",null);case 3:if(!this.destroyed){l.next=5;break}return l.abrupt("return");case 5:r=_createForOfIteratorHelper(_classPrivateFieldGet(this,_pageCache).values());l.prev=6;r.s();case 8:if((a=r.n()).done){l.next=15;break}if((i=a.value).cleanup()){l.next=13;break}throw new Error("startCleanup: Page ".concat(i.pageNumber," is currently rendering."));case 13:l.next=8;break;case 15:l.next=20;break;case 17:l.prev=17;l.t0=l.catch(6);r.e(l.t0);case 20:l.prev=20;r.f();return l.finish(20);case 23:this.commonObjs.clear();t||this.fontLoader.clear();_classPrivateFieldSet(this,_metadataPromise,null);this._getFieldObjectsPromise=null;this._hasJSActionsPromise=null;case 28:case"end":return l.stop()}}),_callee5,this,[[6,17,20,23]])}))),function startCleanup(){return t.apply(this,arguments)})},{key:"loadingParams",get:function get(){var t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}]);var t;return WorkerTransport}(),_objs=new WeakMap,_ensureObj=new WeakSet,PDFObjects=function(){function PDFObjects(){_classCallCheck(this,PDFObjects);_classPrivateMethodInitSpec(this,_ensureObj);_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}_createClass(PDFObjects,[{key:"get",value:function get(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){var a=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);a.capability.promise.then((function(){return r(a.data)}));return null}var i=_classPrivateFieldGet(this,_objs)[t];if(null==i||!i.capability.settled)throw new Error("Requesting object that isn't resolved yet ".concat(t,"."));return i.data}},{key:"has",value:function has(t){var r=_classPrivateFieldGet(this,_objs)[t];return(null==r?void 0:r.capability.settled)||!1}},{key:"resolve",value:function resolve(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);a.data=r;a.capability.resolve()}},{key:"clear",value:function clear(){_classPrivateFieldSet(this,_objs,Object.create(null))}}]);return PDFObjects}();function _ensureObj2(t){var r=_classPrivateFieldGet(this,_objs)[t];return r||(_classPrivateFieldGet(this,_objs)[t]={capability:(0,_util.createPromiseCapability)(),data:null})}var RenderTask=function(){function RenderTask(t){_classCallCheck(this,RenderTask);this._internalRenderTask=t;this.onContinue=null}_createClass(RenderTask,[{key:"promise",get:function get(){return this._internalRenderTask.capability.promise}},{key:"cancel",value:function cancel(){this._internalRenderTask.cancel()}}]);return RenderTask}();exports.RenderTask=RenderTask;var InternalRenderTask=function(){function InternalRenderTask(t){var r=t.callback,a=t.params,i=t.objs,o=t.commonObjs,l=t.annotationCanvasMap,c=t.operatorList,u=t.pageIndex,d=t.canvasFactory,h=t.useRequestAnimationFrame,p=void 0!==h&&h,v=t.pdfBug,y=void 0!==v&&v;_classCallCheck(this,InternalRenderTask);this.callback=r;this.params=a;this.objs=i;this.commonObjs=o;this.annotationCanvasMap=l;this.operatorListIdx=null;this.operatorList=c;this._pageIndex=u;this.canvasFactory=d;this._pdfBug=y;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===p&&"undefined"!=typeof window;this.cancelled=!1;this.capability=(0,_util.createPromiseCapability)();this.task=new RenderTask(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=a.canvasContext.canvas}_createClass(InternalRenderTask,[{key:"completed",get:function get(){return this.capability.promise.catch((function(){}))}},{key:"initializeGraphics",value:function initializeGraphics(t){var r,a=t.transparency,i=void 0!==a&&a,o=t.optionalContentConfig;if(!this.cancelled){if(this._canvas){if(_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).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.");_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).add(this._canvas)}if(this._pdfBug&&null!==(r=globalThis.StepperManager)&&void 0!==r&&r.enabled){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}var l=this.params,c=l.canvasContext,u=l.viewport,d=l.transform,h=l.imageLayer,p=l.background;this.gfx=new _canvas.CanvasGraphics(c,this.commonObjs,this.objs,this.canvasFactory,h,o,this.annotationCanvasMap);this.gfx.beginDrawing({transform:d,viewport:u,transparency:i,background:p});this.operatorListIdx=0;this.graphicsReady=!0;this.graphicsReadyCallback&&this.graphicsReadyCallback()}}},{key:"cancel",value:function cancel(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.running=!1;this.cancelled=!0;this.gfx&&this.gfx.endDrawing();this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas);this.callback(t||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas"))}},{key:"operatorListChanged",value:function operatorListChanged(){if(this.graphicsReady){this.stepper&&this.stepper.updateOperatorList(this.operatorList);this.running||this._continue()}else this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound)}},{key:"_continue",value:function _continue(){this.running=!0;this.cancelled||(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}},{key:"_scheduleNext",value:function _scheduleNext(){var t=this;this._useRequestAnimationFrame?window.requestAnimationFrame((function(){t._nextBound().catch(t._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}},{key:"_next",value:(t=_asyncToGenerator(_regenerator.default.mark((function _callee6(){return _regenerator.default.wrap((function _callee6$(t){for(;;)switch(t.prev=t.next){case 0:if(!this.cancelled){t.next=2;break}return t.abrupt("return");case 2:this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas);this.callback()}}case 4:case"end":return t.stop()}}),_callee6,this)}))),function _next(){return t.apply(this,arguments)})}]);var t;return InternalRenderTask}(),_canvasInUse={writable:!0,value:new WeakSet},version="2.14.102";exports.version=version;var build="db4f3adc5";exports.build=build},(t,r,a)=>{"use strict";t.exports=a(145)},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var i=function(t){var r,a=Object.prototype,i=a.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},l=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function define(t,r,a){Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0});return t[r]}try{define({},"")}catch(t){define=function define(t,r,a){return t[r]=a}}function wrap(t,r,a,i){var o=r&&r.prototype instanceof Generator?r:Generator,l=Object.create(o.prototype),c=new Context(i||[]);l._invoke=function makeInvokeMethod(t,r,a){var i=d;return function invoke(o,l){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===o)throw l;return doneResult()}a.method=o;a.arg=l;for(;;){var c=a.delegate;if(c){var u=maybeInvokeDelegate(c,a);if(u){if(u===y)continue;return u}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(i===d){i=v;throw a.arg}a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);i=p;var g=tryCatch(t,r,a);if("normal"===g.type){i=a.done?v:h;if(g.arg===y)continue;return{value:g.arg,done:a.done}}if("throw"===g.type){i=v;a.method="throw";a.arg=g.arg}}}}(t,a,c);return l}t.wrap=wrap;function tryCatch(t,r,a){try{return{type:"normal",arg:t.call(r,a)}}catch(t){return{type:"throw",arg:t}}}var d="suspendedStart",h="suspendedYield",p="executing",v="completed",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var g={};define(g,l,(function(){return this}));var m=Object.getPrototypeOf,_=m&&m(m(values([])));_&&_!==a&&i.call(_,l)&&(g=_);var b=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(g);GeneratorFunction.prototype=GeneratorFunctionPrototype;define(b,"constructor",GeneratorFunctionPrototype);define(GeneratorFunctionPrototype,"constructor",GeneratorFunction);GeneratorFunction.displayName=define(GeneratorFunctionPrototype,u,"GeneratorFunction");function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))};t.mark=function(t){if(Object.setPrototypeOf)Object.setPrototypeOf(t,GeneratorFunctionPrototype);else{t.__proto__=GeneratorFunctionPrototype;define(t,u,"GeneratorFunction")}t.prototype=Object.create(b);return t};t.awrap=function(t){return{__await:t}};function AsyncIterator(t,r){function invoke(a,o,l,c){var u=tryCatch(t[a],t,o);if("throw"!==u.type){var d=u.arg,h=d.value;return h&&"object"===_typeof(h)&&i.call(h,"__await")?r.resolve(h.__await).then((function(t){invoke("next",t,l,c)}),(function(t){invoke("throw",t,l,c)})):r.resolve(h).then((function(t){d.value=t;l(d)}),(function(t){return invoke("throw",t,l,c)}))}c(u.arg)}var a;this._invoke=function enqueue(t,i){function callInvokeWithMethodAndArg(){return new r((function(r,a){invoke(t,i,r,a)}))}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}defineIteratorMethods(AsyncIterator.prototype);define(AsyncIterator.prototype,c,(function(){return this}));t.AsyncIterator=AsyncIterator;t.async=function(r,a,i,o,l){void 0===l&&(l=Promise);var c=new AsyncIterator(wrap(r,a,i,o),l);return t.isGeneratorFunction(a)?c:c.next().then((function(t){return t.done?t.value:c.next()}))};function maybeInvokeDelegate(t,a){var i=t.iterator[a.method];if(i===r){a.delegate=null;if("throw"===a.method){if(t.iterator.return){a.method="return";a.arg=r;maybeInvokeDelegate(t,a);if("throw"===a.method)return y}a.method="throw";a.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=tryCatch(i,t.iterator,a.arg);if("throw"===o.type){a.method="throw";a.arg=o.arg;a.delegate=null;return y}var l=o.arg;if(!l){a.method="throw";a.arg=new TypeError("iterator result is not an object");a.delegate=null;return y}if(!l.done)return l;a[t.resultName]=l.value;a.next=t.nextLoc;if("return"!==a.method){a.method="next";a.arg=r}a.delegate=null;return y}defineIteratorMethods(b);define(b,u,"Generator");define(b,l,(function(){return this}));define(b,"toString",(function(){return"[object Generator]"}));function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]);if(2 in t){r.finallyLoc=t[2];r.afterLoc=t[3]}this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal";delete r.arg;t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}];t.forEach(pushTryEntry,this);this.reset(!0)}t.keys=function(t){var r=[];for(var a in t)r.push(a);r.reverse();return function next(){for(;r.length;){var a=r.pop();if(a in t){next.value=a;next.done=!1;return next}}next.done=!0;return next}};function values(t){if(t){var a=t[l];if(a)return a.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,c=function next(){for(;++o<t.length;)if(i.call(t,o)){next.value=t[o];next.done=!1;return next}next.value=r;next.done=!0;return next};return c.next=c}}return{next:doneResult}}t.values=values;function doneResult(){return{value:r,done:!0}}Context.prototype={constructor:Context,reset:function reset(t){this.prev=0;this.next=0;this.sent=this._sent=r;this.done=!1;this.delegate=null;this.method="next";this.arg=r;this.tryEntries.forEach(resetTryEntry);if(!t)for(var a in this)"t"===a.charAt(0)&&i.call(this,a)&&!isNaN(+a.slice(1))&&(this[a]=r)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var a=this;function handle(i,o){c.type="throw";c.arg=t;a.next=i;if(o){a.method="next";a.arg=r}return!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o],c=l.completion;if("root"===l.tryLoc)return handle("end");if(l.tryLoc<=this.prev){var u=i.call(l,"catchLoc"),d=i.call(l,"finallyLoc");if(u&&d){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0);if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return handle(l.catchLoc,!0)}else{if(!d)throw new Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return handle(l.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a];if(o.tryLoc<=this.prev&&i.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var l=o;break}}l&&("break"===t||"continue"===t)&&l.tryLoc<=r&&r<=l.finallyLoc&&(l=null);var c=l?l.completion:{};c.type=t;c.arg=r;if(l){this.method="next";this.next=l.finallyLoc;return y}return this.complete(c)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;if("break"===t.type||"continue"===t.type)this.next=t.arg;else if("return"===t.type){this.rval=this.arg=t.arg;this.method="return";this.next="end"}else"normal"===t.type&&r&&(this.next=r);return y},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.finallyLoc===t){this.complete(a.completion,a.afterLoc);resetTryEntry(a);return y}}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc===t){var i=a.completion;if("throw"===i.type){var o=i.arg;resetTryEntry(a)}return o}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,a,i){this.delegate={iterator:values(t),resultName:a,nextLoc:i};"next"===this.method&&(this.arg=r);return y}};return t}("object"===_typeof(t=a.nmd(t))?t.exports:{});try{regeneratorRuntime=i}catch(t){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=i:Function("r","regeneratorRuntime = r")(i)}},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.StatTimer=r.RenderingCancelledException=r.PixelsPerInch=r.PageViewport=r.PDFDateString=r.DOMStandardFontDataFactory=r.DOMSVGFactory=r.DOMCanvasFactory=r.DOMCMapReaderFactory=void 0;r.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};r.getFilenameFromUrl=function getFilenameFromUrl(t){var r=t.indexOf("#"),a=t.indexOf("?"),i=Math.min(r>0?r:t.length,a>0?a:t.length);return t.substring(t.lastIndexOf("/",i)+1,i)};r.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return r;if(isDataScheme(t)){(0,l.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return r}var a=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,i=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,o=a.exec(t),c=i.exec(o[1])||i.exec(o[2])||i.exec(o[3]);if(c&&(c=c[0]).includes("%"))try{c=i.exec(decodeURIComponent(c))[0]}catch(t){}return c||r};r.getXfaPageViewport=function getXfaPageViewport(t,r){var a=r.scale,i=void 0===a?1:a,o=r.rotation,l=void 0===o?0:o,c=t.attributes.style,u=c.width,d=c.height,h=[0,0,parseInt(u),parseInt(d)];return new v({viewBox:h,scale:i,rotation:l})};r.isDataScheme=isDataScheme;r.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};r.isValidFetchUrl=isValidFetchUrl;r.loadScript=function loadScript(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((function(a,i){var o=document.createElement("script");o.src=t;o.onload=function(t){r&&o.remove();a(t)};o.onerror=function(){i(new Error("Cannot load script at: ".concat(o.src)))};(document.head||document.documentElement).appendChild(o)}))};var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(147),l=a(1);function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperty(t,r,a){r in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}var c=_createClass((function PixelsPerInch(){_classCallCheck(this,PixelsPerInch)}));r.PixelsPerInch=c;_defineProperty(c,"CSS",96);_defineProperty(c,"PDF",72);_defineProperty(c,"PDF_TO_CSS_UNITS",c.CSS/c.PDF);var u=function(t){_inherits(DOMCanvasFactory,t);var r=_createSuper(DOMCanvasFactory);function DOMCanvasFactory(){var t,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=a.ownerDocument,o=void 0===i?globalThis.document:i;_classCallCheck(this,DOMCanvasFactory);(t=r.call(this))._document=o;return t}_createClass(DOMCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){var a=this._document.createElement("canvas");a.width=t;a.height=r;return a}}]);return DOMCanvasFactory}(o.BaseCanvasFactory);r.DOMCanvasFactory=u;function fetchData(t){return _fetchData.apply(this,arguments)}function _fetchData(){_fetchData=_asyncToGenerator(i.default.mark((function _callee(t){var r,a,o=arguments;return i.default.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:r=o.length>1&&void 0!==o[1]&&o[1];if(!isValidFetchUrl(t,document.baseURI)){i.next=21;break}i.next=4;return fetch(t);case 4:if((a=i.sent).ok){i.next=7;break}throw new Error(a.statusText);case 7:if(!r){i.next=15;break}i.t1=Uint8Array;i.next=11;return a.arrayBuffer();case 11:i.t2=i.sent;i.t0=new i.t1(i.t2);i.next=20;break;case 15:i.t3=l.stringToBytes;i.next=18;return a.text();case 18:i.t4=i.sent;i.t0=(0,i.t3)(i.t4);case 20:return i.abrupt("return",i.t0);case 21:return i.abrupt("return",new Promise((function(a,i){var o=new XMLHttpRequest;o.open("GET",t,!0);r&&(o.responseType="arraybuffer");o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(200===o.status||0===o.status){var t;r&&o.response?t=new Uint8Array(o.response):!r&&o.responseText&&(t=(0,l.stringToBytes)(o.responseText));if(t){a(t);return}}i(new Error(o.statusText))}};o.send(null)})));case 22:case"end":return i.stop()}}),_callee)})));return _fetchData.apply(this,arguments)}var d=function(t){_inherits(DOMCMapReaderFactory,t);var r=_createSuper(DOMCMapReaderFactory);function DOMCMapReaderFactory(){_classCallCheck(this,DOMCMapReaderFactory);return r.apply(this,arguments)}_createClass(DOMCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return fetchData(t,this.isCompressed).then((function(t){return{cMapData:t,compressionType:r}}))}}]);return DOMCMapReaderFactory}(o.BaseCMapReaderFactory);r.DOMCMapReaderFactory=d;var h=function(t){_inherits(DOMStandardFontDataFactory,t);var r=_createSuper(DOMStandardFontDataFactory);function DOMStandardFontDataFactory(){_classCallCheck(this,DOMStandardFontDataFactory);return r.apply(this,arguments)}_createClass(DOMStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return fetchData(t,!0)}}]);return DOMStandardFontDataFactory}(o.BaseStandardFontDataFactory);r.DOMStandardFontDataFactory=h;var p=function(t){_inherits(DOMSVGFactory,t);var r=_createSuper(DOMSVGFactory);function DOMSVGFactory(){_classCallCheck(this,DOMSVGFactory);return r.apply(this,arguments)}_createClass(DOMSVGFactory,[{key:"_createSVG",value:function _createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}]);return DOMSVGFactory}(o.BaseSVGFactory);r.DOMSVGFactory=p;var v=function(){function PageViewport(t){var r=t.viewBox,a=t.scale,i=t.rotation,o=t.offsetX,l=void 0===o?0:o,c=t.offsetY,u=void 0===c?0:c,d=t.dontFlip,h=void 0!==d&&d;_classCallCheck(this,PageViewport);this.viewBox=r;this.scale=a;this.rotation=i;this.offsetX=l;this.offsetY=u;var p,v,y,g,m,_,b,A,S=(r[2]+r[0])/2,k=(r[3]+r[1])/2;(i%=360)<0&&(i+=360);switch(i){case 180:p=-1;v=0;y=0;g=1;break;case 90:p=0;v=1;y=1;g=0;break;case 270:p=0;v=-1;y=-1;g=0;break;case 0:p=1;v=0;y=0;g=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(h){y=-y;g=-g}if(0===p){m=Math.abs(k-r[1])*a+l;_=Math.abs(S-r[0])*a+u;b=Math.abs(r[3]-r[1])*a;A=Math.abs(r[2]-r[0])*a}else{m=Math.abs(S-r[0])*a+l;_=Math.abs(k-r[1])*a+u;b=Math.abs(r[2]-r[0])*a;A=Math.abs(r[3]-r[1])*a}this.transform=[p*a,v*a,y*a,g*a,m-p*a*S-y*a*k,_-v*a*S-g*a*k];this.width=b;this.height=A}_createClass(PageViewport,[{key:"clone",value:function clone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.scale,a=void 0===r?this.scale:r,i=t.rotation,o=void 0===i?this.rotation:i,l=t.offsetX,c=void 0===l?this.offsetX:l,u=t.offsetY,d=void 0===u?this.offsetY:u,h=t.dontFlip,p=void 0!==h&&h;return new PageViewport({viewBox:this.viewBox.slice(),scale:a,rotation:o,offsetX:c,offsetY:d,dontFlip:p})}},{key:"convertToViewportPoint",value:function convertToViewportPoint(t,r){return l.Util.applyTransform([t,r],this.transform)}},{key:"convertToViewportRectangle",value:function convertToViewportRectangle(t){var r=l.Util.applyTransform([t[0],t[1]],this.transform),a=l.Util.applyTransform([t[2],t[3]],this.transform);return[r[0],r[1],a[0],a[1]]}},{key:"convertToPdfPoint",value:function convertToPdfPoint(t,r){return l.Util.applyInverseTransform([t,r],this.transform)}}]);return PageViewport}();r.PageViewport=v;var y=function(t){_inherits(RenderingCancelledException,t);var r=_createSuper(RenderingCancelledException);function RenderingCancelledException(t,a){var i;_classCallCheck(this,RenderingCancelledException);(i=r.call(this,t,"RenderingCancelledException")).type=a;return i}return _createClass(RenderingCancelledException)}(l.BaseException);r.RenderingCancelledException=y;function isDataScheme(t){for(var r=t.length,a=0;a<r&&""===t[a].trim();)a++;return"data:"===t.substring(a,a+5).toLowerCase()}var g,m=function(){function StatTimer(){_classCallCheck(this,StatTimer);this.started=Object.create(null);this.times=[]}_createClass(StatTimer,[{key:"time",value:function time(t){t in this.started&&(0,l.warn)("Timer is already running for ".concat(t));this.started[t]=Date.now()}},{key:"timeEnd",value:function timeEnd(t){t in this.started||(0,l.warn)("Timer has not been started for ".concat(t));this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}},{key:"toString",value:function toString(){var t,r=[],a=0,i=_createForOfIteratorHelper(this.times);try{for(i.s();!(t=i.n()).done;){var o=t.value.name;o.length>a&&(a=o.length)}}catch(t){i.e(t)}finally{i.f()}var l,c=_createForOfIteratorHelper(this.times);try{for(c.s();!(l=c.n()).done;){var u=l.value,d=u.end-u.start;r.push("".concat(u.name.padEnd(a)," ").concat(d,"ms\n"))}}catch(t){c.e(t)}finally{c.f()}return r.join("")}}]);return StatTimer}();r.StatTimer=m;function isValidFetchUrl(t,r){try{var a=(r?new URL(t,r):new URL(t)).protocol;return"http:"===a||"https:"===a}catch(t){return!1}}var _=function(){function PDFDateString(){_classCallCheck(this,PDFDateString)}_createClass(PDFDateString,null,[{key:"toDateObject",value:function toDateObject(t){if(!t||"string"!=typeof t)return null;g||(g=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));var r=g.exec(t);if(!r)return null;var a=parseInt(r[1],10),i=parseInt(r[2],10);i=i>=1&&i<=12?i-1:0;var o=parseInt(r[3],10);o=o>=1&&o<=31?o:1;var l=parseInt(r[4],10);l=l>=0&&l<=23?l:0;var c=parseInt(r[5],10);c=c>=0&&c<=59?c:0;var u=parseInt(r[6],10);u=u>=0&&u<=59?u:0;var d=r[7]||"Z",h=parseInt(r[8],10);h=h>=0&&h<=23?h:0;var p=parseInt(r[9],10)||0;p=p>=0&&p<=59?p:0;if("-"===d){l+=h;c+=p}else if("+"===d){l-=h;c-=p}return new Date(Date.UTC(a,i,o,l,c,u))}}]);return PDFDateString}();r.PDFDateString=_},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BaseStandardFontDataFactory=r.BaseSVGFactory=r.BaseCanvasFactory=r.BaseCMapReaderFactory=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1);function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var l=function(){function BaseCanvasFactory(){_classCallCheck(this,BaseCanvasFactory);this.constructor===BaseCanvasFactory&&(0,o.unreachable)("Cannot initialize BaseCanvasFactory.")}_createClass(BaseCanvasFactory,[{key:"create",value:function create(t,r){if(t<=0||r<=0)throw new Error("Invalid canvas size");var a=this._createCanvas(t,r);return{canvas:a,context:a.getContext("2d")}}},{key:"reset",value:function reset(t,r,a){if(!t.canvas)throw new Error("Canvas is not specified");if(r<=0||a<=0)throw new Error("Invalid canvas size");t.canvas.width=r;t.canvas.height=a}},{key:"destroy",value:function destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0;t.canvas.height=0;t.canvas=null;t.context=null}},{key:"_createCanvas",value:function _createCanvas(t,r){(0,o.unreachable)("Abstract method `_createCanvas` called.")}}]);return BaseCanvasFactory}();r.BaseCanvasFactory=l;var c=function(){function BaseCMapReaderFactory(t){var r=t.baseUrl,a=void 0===r?null:r,i=t.isCompressed,l=void 0!==i&&i;_classCallCheck(this,BaseCMapReaderFactory);this.constructor===BaseCMapReaderFactory&&(0,o.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=a;this.isCompressed=l}_createClass(BaseCMapReaderFactory,[{key:"fetch",value:(t=_asyncToGenerator(i.default.mark((function _callee(t){var r,a,l,c=this;return i.default.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:r=t.name;if(this.baseUrl){i.next=3;break}throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');case 3:if(r){i.next=5;break}throw new Error("CMap name must be specified.");case 5:a=this.baseUrl+r+(this.isCompressed?".bcmap":"");l=this.isCompressed?o.CMapCompressionType.BINARY:o.CMapCompressionType.NONE;return i.abrupt("return",this._fetchData(a,l).catch((function(t){throw new Error("Unable to load ".concat(c.isCompressed?"binary ":"","CMap at: ").concat(a))})));case 8:case"end":return i.stop()}}),_callee,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t,r){(0,o.unreachable)("Abstract method `_fetchData` called.")}}]);var t;return BaseCMapReaderFactory}();r.BaseCMapReaderFactory=c;var u=function(){function BaseStandardFontDataFactory(t){var r=t.baseUrl,a=void 0===r?null:r;_classCallCheck(this,BaseStandardFontDataFactory);this.constructor===BaseStandardFontDataFactory&&(0,o.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=a}_createClass(BaseStandardFontDataFactory,[{key:"fetch",value:(t=_asyncToGenerator(i.default.mark((function _callee2(t){var r,a;return i.default.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:r=t.filename;if(this.baseUrl){i.next=3;break}throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');case 3:if(r){i.next=5;break}throw new Error("Font filename must be specified.");case 5:a="".concat(this.baseUrl).concat(r);return i.abrupt("return",this._fetchData(a).catch((function(t){throw new Error("Unable to load font data at: ".concat(a))})));case 7:case"end":return i.stop()}}),_callee2,this)}))),function fetch(r){return t.apply(this,arguments)})},{key:"_fetchData",value:function _fetchData(t){(0,o.unreachable)("Abstract method `_fetchData` called.")}}]);var t;return BaseStandardFontDataFactory}();r.BaseStandardFontDataFactory=u;var d=function(){function BaseSVGFactory(){_classCallCheck(this,BaseSVGFactory);this.constructor===BaseSVGFactory&&(0,o.unreachable)("Cannot initialize BaseSVGFactory.")}_createClass(BaseSVGFactory,[{key:"create",value:function create(t,r){if(t<=0||r<=0)throw new Error("Invalid SVG dimensions");var a=this._createSVG("svg:svg");a.setAttribute("version","1.1");a.setAttribute("width","".concat(t,"px"));a.setAttribute("height","".concat(r,"px"));a.setAttribute("preserveAspectRatio","none");a.setAttribute("viewBox","0 0 ".concat(t," ").concat(r));return a}},{key:"createElement",value:function createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}},{key:"_createSVG",value:function _createSVG(t){(0,o.unreachable)("Abstract method `_createSVG` called.")}}]);return BaseSVGFactory}();r.BaseSVGFactory=d},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.FontLoader=r.FontFaceObject=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1);function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var l,c=function(){function BaseFontLoader(t){var r=t.docId,a=t.onUnsupportedFeature,i=t.ownerDocument,l=void 0===i?globalThis.document:i;t.styleElement;_classCallCheck(this,BaseFontLoader);this.constructor===BaseFontLoader&&(0,o.unreachable)("Cannot initialize BaseFontLoader.");this.docId=r;this._onUnsupportedFeature=a;this._document=l;this.nativeFontFaces=[];this.styleElement=null}_createClass(BaseFontLoader,[{key:"addNativeFontFace",value:function addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}},{key:"insertRule",value:function insertRule(t){var r=this.styleElement;if(!r){(r=this.styleElement=this._document.createElement("style")).id="PDFJS_FONT_STYLE_TAG_".concat(this.docId);this._document.documentElement.getElementsByTagName("head")[0].appendChild(r)}var a=r.sheet;a.insertRule(t,a.cssRules.length)}},{key:"clear",value:function clear(){var t,r=_createForOfIteratorHelper(this.nativeFontFaces);try{for(r.s();!(t=r.n()).done;){var a=t.value;this._document.fonts.delete(a)}}catch(t){r.e(t)}finally{r.f()}this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}},{key:"bind",value:(t=function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(i.default.mark((function _callee(t){var r,a,l=this;return i.default.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:if(!t.attached&&!t.missingFile){i.next=2;break}return i.abrupt("return");case 2:t.attached=!0;if(!this.isFontLoadingAPISupported){i.next=19;break}if(!(r=t.createNativeFontFace())){i.next=18;break}this.addNativeFontFace(r);i.prev=7;i.next=10;return r.loaded;case 10:i.next=18;break;case 12:i.prev=12;i.t0=i.catch(7);this._onUnsupportedFeature({featureId:o.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,o.warn)("Failed to load font '".concat(r.family,"': '").concat(i.t0,"'."));t.disableFontFace=!0;throw i.t0;case 18:return i.abrupt("return");case 19:if(!(a=t.createFontFaceRule())){i.next=26;break}this.insertRule(a);if(!this.isSyncFontLoadingSupported){i.next=24;break}return i.abrupt("return");case 24:i.next=26;return new Promise((function(r){var i=l._queueLoadingCallback(r);l._prepareFontLoadEvent([a],[t],i)}));case 26:case"end":return i.stop()}}),_callee,this,[[7,12]])}))),function bind(r){return t.apply(this,arguments)})},{key:"_queueLoadingCallback",value:function _queueLoadingCallback(t){(0,o.unreachable)("Abstract method `_queueLoadingCallback`.")}},{key:"isFontLoadingAPISupported",get:function get(){var t,r=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,o.shadow)(this,"isFontLoadingAPISupported",r)}},{key:"isSyncFontLoadingSupported",get:function get(){(0,o.unreachable)("Abstract method `isSyncFontLoadingSupported`.")}},{key:"_loadTestFont",get:function get(){(0,o.unreachable)("Abstract method `_loadTestFont`.")}},{key:"_prepareFontLoadEvent",value:function _prepareFontLoadEvent(t,r,a){(0,o.unreachable)("Abstract method `_prepareFontLoadEvent`.")}}]);var t;return BaseFontLoader}();r.FontLoader=l;r.FontLoader=l=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(GenericFontLoader,t);var r=_createSuper(GenericFontLoader);function GenericFontLoader(t){var a;_classCallCheck(this,GenericFontLoader);(a=r.call(this,t)).loadingContext={requests:[],nextRequestId:0};a.loadTestFontId=0;return a}_createClass(GenericFontLoader,[{key:"isSyncFontLoadingSupported",get:function get(){var t=!1;if("undefined"==typeof navigator)t=!0;else{var r=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(null==r?void 0:r[1])>=14&&(t=!0)}return(0,o.shadow)(this,"isSyncFontLoadingSupported",t)}},{key:"_queueLoadingCallback",value:function _queueLoadingCallback(t){var r=this.loadingContext,a={id:"pdfjs-font-loading-".concat(r.nextRequestId++),done:!1,complete:function completeRequest(){(0,o.assert)(!a.done,"completeRequest() cannot be called twice.");a.done=!0;for(;r.requests.length>0&&r.requests[0].done;){var t=r.requests.shift();setTimeout(t.callback,0)}},callback:t};r.requests.push(a);return a}},{key:"_loadTestFont",get:function get(){return(0,o.shadow)(this,"_loadTestFont",function getLoadTestFont(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")}())}},{key:"_prepareFontLoadEvent",value:function _prepareFontLoadEvent(t,r,a){function int32(t,r){return t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|255&t.charCodeAt(r+3)}function spliceString(t,r,a,i){return t.substring(0,r)+i+t.substring(r+a)}var i,l,c=this._document.createElement("canvas");c.width=1;c.height=1;var u=c.getContext("2d"),d=0;var h="lt".concat(Date.now()).concat(this.loadTestFontId++),p=this._loadTestFont,v=1482184792,y=int32(p=spliceString(p,976,h.length,h),16);for(i=0,l=h.length-3;i<l;i+=4)y=y-v+int32(h,i)|0;i<h.length&&(y=y-v+int32(h+"XXX",i)|0);p=spliceString(p,16,4,(0,o.string32)(y));var g="url(data:font/opentype;base64,".concat(btoa(p),");"),m='@font-face {font-family:"'.concat(h,'";src:').concat(g,"}");this.insertRule(m);var _,b=[],A=_createForOfIteratorHelper(r);try{for(A.s();!(_=A.n()).done;){var S=_.value;b.push(S.loadedName)}}catch(t){A.e(t)}finally{A.f()}b.push(h);var k=this._document.createElement("div");k.style.visibility="hidden";k.style.width=k.style.height="10px";k.style.position="absolute";k.style.top=k.style.left="0px";for(var C=0,x=b;C<x.length;C++){var P=x[C],w=this._document.createElement("span");w.textContent="Hi";w.style.fontFamily=P;k.appendChild(w)}this._document.body.appendChild(k);!function isFontReady(t,r){if(++d>30){(0,o.warn)("Load test font never loaded.");r()}else{u.font="30px "+t;u.fillText(".",0,20);u.getImageData(0,0,1,1).data[3]>0?r():setTimeout(isFontReady.bind(null,t,r))}}(h,(function(){k.remove();a.complete()}))}}]);return GenericFontLoader}(c);var u=function(){function FontFaceObject(t,r){var a=r.isEvalSupported,i=void 0===a||a,o=r.disableFontFace,l=void 0!==o&&o,c=r.ignoreErrors,u=void 0!==c&&c,d=r.onUnsupportedFeature,h=r.fontRegistry,p=void 0===h?null:h;_classCallCheck(this,FontFaceObject);this.compiledGlyphs=Object.create(null);for(var v in t)this[v]=t[v];this.isEvalSupported=!1!==i;this.disableFontFace=!0===l;this.ignoreErrors=!0===u;this._onUnsupportedFeature=d;this.fontRegistry=p}_createClass(FontFaceObject,[{key:"createNativeFontFace",value:function createNativeFontFace(){if(!this.data||this.disableFontFace)return null;var t;if(this.cssFontInfo){var r={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(r.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg"));t=new FontFace(this.cssFontInfo.fontFamily,this.data,r)}else t=new FontFace(this.loadedName,this.data,{});this.fontRegistry&&this.fontRegistry.registerFont(this);return t}},{key:"createFontFaceRule",value:function createFontFaceRule(){if(!this.data||this.disableFontFace)return null;var t,r=(0,o.bytesToString)(this.data),a="url(data:".concat(this.mimetype,";base64,").concat(btoa(r),");");if(this.cssFontInfo){var i="font-weight: ".concat(this.cssFontInfo.fontWeight,";");this.cssFontInfo.italicAngle&&(i+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;"));t='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(i,"src:").concat(a,"}")}else t='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(a,"}");this.fontRegistry&&this.fontRegistry.registerFont(this,a);return t}},{key:"getPathGenerator",value:function getPathGenerator(t,r){if(void 0!==this.compiledGlyphs[r])return this.compiledGlyphs[r];var a;try{a=t.get(this.loadedName+"_path_"+r)}catch(t){if(!this.ignoreErrors)throw t;this._onUnsupportedFeature({featureId:o.UNSUPPORTED_FEATURES.errorFontGetPath});(0,o.warn)('getPathGenerator - ignoring character: "'.concat(t,'".'));return this.compiledGlyphs[r]=function(t,r){}}if(this.isEvalSupported&&o.IsEvalSupportedCached.value){var i,l=[],c=_createForOfIteratorHelper(a);try{for(c.s();!(i=c.n()).done;){var u=i.value,d=void 0!==u.args?u.args.join(","):"";l.push("c.",u.cmd,"(",d,");\n")}}catch(t){c.e(t)}finally{c.f()}return this.compiledGlyphs[r]=new Function("c","size",l.join(""))}return this.compiledGlyphs[r]=function(t,r){var i,o=_createForOfIteratorHelper(a);try{for(o.s();!(i=o.n()).done;){var l=i.value;"scale"===l.cmd&&(l.args=[r,-r]);t[l.cmd].apply(t,l.args)}}catch(t){o.e(t)}finally{o.f()}}}}]);return FontFaceObject}();r.FontFaceObject=u},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.NodeStandardFontDataFactory=r.NodeCanvasFactory=r.NodeCMapReaderFactory=void 0;var i=a(147),o=a(3),l=a(1);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var c=_createClass((function NodeCanvasFactory(){_classCallCheck(this,NodeCanvasFactory);(0,l.unreachable)("Not implemented: NodeCanvasFactory")}));r.NodeCanvasFactory=c;var u=_createClass((function NodeCMapReaderFactory(){_classCallCheck(this,NodeCMapReaderFactory);(0,l.unreachable)("Not implemented: NodeCMapReaderFactory")}));r.NodeCMapReaderFactory=u;var d=_createClass((function NodeStandardFontDataFactory(){_classCallCheck(this,NodeStandardFontDataFactory);(0,l.unreachable)("Not implemented: NodeStandardFontDataFactory")}));r.NodeStandardFontDataFactory=d;if(o.isNodeJS){var h=function fetchData(t){return new Promise((function(r,a){require("fs").readFile(t,(function(t,i){!t&&i?r(new Uint8Array(i)):a(new Error(t))}))}))};r.NodeCanvasFactory=c=function(t){_inherits(NodeCanvasFactory,t);var r=_createSuper(NodeCanvasFactory);function NodeCanvasFactory(){_classCallCheck(this,NodeCanvasFactory);return r.apply(this,arguments)}_createClass(NodeCanvasFactory,[{key:"_createCanvas",value:function _createCanvas(t,r){return require("canvas").createCanvas(t,r)}}]);return NodeCanvasFactory}(i.BaseCanvasFactory);r.NodeCMapReaderFactory=u=function(t){_inherits(NodeCMapReaderFactory,t);var r=_createSuper(NodeCMapReaderFactory);function NodeCMapReaderFactory(){_classCallCheck(this,NodeCMapReaderFactory);return r.apply(this,arguments)}_createClass(NodeCMapReaderFactory,[{key:"_fetchData",value:function _fetchData(t,r){return h(t).then((function(t){return{cMapData:t,compressionType:r}}))}}]);return NodeCMapReaderFactory}(i.BaseCMapReaderFactory);r.NodeStandardFontDataFactory=d=function(t){_inherits(NodeStandardFontDataFactory,t);var r=_createSuper(NodeStandardFontDataFactory);function NodeStandardFontDataFactory(){_classCallCheck(this,NodeStandardFontDataFactory);return r.apply(this,arguments)}_createClass(NodeStandardFontDataFactory,[{key:"_fetchData",value:function _fetchData(t){return h(t)}}]);return NodeStandardFontDataFactory}(i.BaseStandardFontDataFactory)}},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.AnnotationStorage=void 0;var i=a(1);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}var o=function(){function AnnotationStorage(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AnnotationStorage);this._storage=new Map;this._timeStamp=Date.now();this._modified=!1;this.onSetModified=null;this.onResetModified=null}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(AnnotationStorage,[{key:"getValue",value:function getValue(t,r){var a=this._storage.get(t);return void 0===a?r:Object.assign(r,a)}},{key:"setValue",value:function setValue(t,r){var a=this._storage.get(t),i=!1;if(void 0!==a)for(var o=0,l=Object.entries(r);o<l.length;o++){var c=_slicedToArray(l[o],2),u=c[0],d=c[1];if(a[u]!==d){i=!0;a[u]=d}}else{i=!0;this._storage.set(t,r)}if(i){this._timeStamp=Date.now();this._setModified()}}},{key:"getAll",value:function getAll(){return this._storage.size>0?(0,i.objectFromMap)(this._storage):null}},{key:"size",get:function get(){return this._storage.size}},{key:"_setModified",value:function _setModified(){if(!this._modified){this._modified=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}},{key:"resetModified",value:function resetModified(){if(this._modified){this._modified=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}},{key:"serializable",get:function get(){return this._storage.size>0?this._storage:null}},{key:"lastModified",get:function get(){return this._timeStamp.toString()}}]);return AnnotationStorage}();r.AnnotationStorage=o},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CanvasGraphics=void 0;var i=a(1),o=a(152),l=a(146);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}var c=4096,u=16;function addContextCurrentTransform(t){t._transformStack&&(t._transformStack=[]);if(!t.mozCurrentTransform){t._originalSave=t.save;t._originalRestore=t.restore;t._originalRotate=t.rotate;t._originalScale=t.scale;t._originalTranslate=t.translate;t._originalTransform=t.transform;t._originalSetTransform=t.setTransform;t._originalResetTransform=t.resetTransform;t._transformMatrix=t._transformMatrix||[1,0,0,1,0,0];t._transformStack=[];try{var r=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),"lineWidth");t._setLineWidth=r.set;t._getLineWidth=r.get;Object.defineProperty(t,"lineWidth",{set:function setLineWidth(t){this._setLineWidth(1.000001*t)},get:function getLineWidth(){return this._getLineWidth()}})}catch(t){}Object.defineProperty(t,"mozCurrentTransform",{get:function getCurrentTransform(){return this._transformMatrix}});Object.defineProperty(t,"mozCurrentTransformInverse",{get:function getCurrentTransformInverse(){var t=_slicedToArray(this._transformMatrix,6),r=t[0],a=t[1],i=t[2],o=t[3],l=t[4],c=t[5],u=r*o-a*i,d=a*i-r*o;return[o/u,a/d,i/d,r/u,(o*l-i*c)/d,(a*l-r*c)/u]}});t.save=function ctxSave(){var t=this._transformMatrix;this._transformStack.push(t);this._transformMatrix=t.slice(0,6);this._originalSave()};t.restore=function ctxRestore(){0===this._transformStack.length&&(0,i.warn)("Tried to restore a ctx when the stack was already empty.");var t=this._transformStack.pop();if(t){this._transformMatrix=t;this._originalRestore()}};t.translate=function ctxTranslate(t,r){var a=this._transformMatrix;a[4]=a[0]*t+a[2]*r+a[4];a[5]=a[1]*t+a[3]*r+a[5];this._originalTranslate(t,r)};t.scale=function ctxScale(t,r){var a=this._transformMatrix;a[0]*=t;a[1]*=t;a[2]*=r;a[3]*=r;this._originalScale(t,r)};t.transform=function ctxTransform(r,a,i,o,l,c){var u=this._transformMatrix;this._transformMatrix=[u[0]*r+u[2]*a,u[1]*r+u[3]*a,u[0]*i+u[2]*o,u[1]*i+u[3]*o,u[0]*l+u[2]*c+u[4],u[1]*l+u[3]*c+u[5]];t._originalTransform(r,a,i,o,l,c)};t.setTransform=function ctxSetTransform(r,a,i,o,l,c){this._transformMatrix=[r,a,i,o,l,c];t._originalSetTransform(r,a,i,o,l,c)};t.resetTransform=function ctxResetTransform(){this._transformMatrix=[1,0,0,1,0,0];t._originalResetTransform()};t.rotate=function ctxRotate(t){var r=Math.cos(t),a=Math.sin(t),i=this._transformMatrix;this._transformMatrix=[i[0]*r+i[2]*a,i[1]*r+i[3]*a,i[0]*-a+i[2]*r,i[1]*-a+i[3]*r,i[4],i[5]];this._originalRotate(t)}}}var d=function(){function CachedCanvases(t){_classCallCheck(this,CachedCanvases);this.canvasFactory=t;this.cache=Object.create(null)}_createClass(CachedCanvases,[{key:"getCanvas",value:function getCanvas(t,r,a,i){var o;if(void 0!==this.cache[t]){o=this.cache[t];this.canvasFactory.reset(o,r,a);o.context.setTransform(1,0,0,1,0,0)}else{o=this.canvasFactory.create(r,a);this.cache[t]=o}i&&addContextCurrentTransform(o.context);return o}},{key:"clear",value:function clear(){for(var t in this.cache){var r=this.cache[t];this.canvasFactory.destroy(r);delete this.cache[t]}}}]);return CachedCanvases}();var h=function(){function CanvasExtraState(t,r){_classCallCheck(this,CanvasExtraState);this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=i.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=i.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=i.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,t,r])}_createClass(CanvasExtraState,[{key:"clone",value:function clone(){var clone=Object.create(this);clone.clipBox=this.clipBox.slice();return clone}},{key:"setCurrentPoint",value:function setCurrentPoint(t,r){this.x=t;this.y=r}},{key:"updatePathMinMax",value:function updatePathMinMax(t,r,a){var o=_slicedToArray(i.Util.applyTransform([r,a],t),2);r=o[0];a=o[1];this.minX=Math.min(this.minX,r);this.minY=Math.min(this.minY,a);this.maxX=Math.max(this.maxX,r);this.maxY=Math.max(this.maxY,a)}},{key:"updateCurvePathMinMax",value:function updateCurvePathMinMax(t,r,a,o,l,c,u,d,h){var p=i.Util.bezierBoundingBox(r,a,o,l,c,u,d,h);this.updatePathMinMax(t,p[0],p[1]);this.updatePathMinMax(t,p[2],p[3])}},{key:"getPathBoundingBox",value:function getPathBoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.PathType.FILL,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[this.minX,this.minY,this.maxX,this.maxY];if(t===o.PathType.STROKE){r||(0,i.unreachable)("Stroke bounding box must include transform.");var l=i.Util.singularValueDecompose2dScale(r),c=l[0]*this.lineWidth/2,u=l[1]*this.lineWidth/2;a[0]-=c;a[1]-=u;a[2]+=c;a[3]+=u}return a}},{key:"updateClipFromPath",value:function updateClipFromPath(){var t=i.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}},{key:"startNewPathAndClipBox",value:function startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}},{key:"getClippedPathBoundingBox",value:function getClippedPathBoundingBox(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.PathType.FILL,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return i.Util.intersect(this.clipBox,this.getPathBoundingBox(t,r))}}]);return CanvasExtraState}();function putBinaryImageData(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&r instanceof ImageData)t.putImageData(r,0,0);else{var o,l,c,d,h,p,v,y,g,m=r.height,_=r.width,b=m%u,A=(m-b)/u,S=0===b?A:A+1,k=t.createImageData(_,u),C=0,x=r.data,P=k.data;if(a)switch(a.length){case 1:p=a[0];v=a[0];y=a[0];g=a[0];break;case 4:p=a[0];v=a[1];y=a[2];g=a[3]}if(r.kind===i.ImageKind.GRAYSCALE_1BPP){var w=x.byteLength,T=new Uint32Array(P.buffer,0,P.byteLength>>2),R=T.length,E=_+7>>3,O=4294967295,I=i.IsLittleEndianCached.value?4278190080:255;if(g&&255===g[0]&&0===g[255]){var D=[I,O];O=D[0];I=D[1]}for(l=0;l<S;l++){d=l<A?u:b;o=0;for(c=0;c<d;c++){for(var M=w-C,L=0,j=M>E?_:8*M-7,N=-8&j,B=0,G=0;L<N;L+=8){G=x[C++];T[o++]=128&G?O:I;T[o++]=64&G?O:I;T[o++]=32&G?O:I;T[o++]=16&G?O:I;T[o++]=8&G?O:I;T[o++]=4&G?O:I;T[o++]=2&G?O:I;T[o++]=1&G?O:I}for(;L<j;L++){if(0===B){G=x[C++];B=128}T[o++]=G&B?O:I;B>>=1}}for(;o<R;)T[o++]=0;t.putImageData(k,0,l*u)}}else if(r.kind===i.ImageKind.RGBA_32BPP){var U=!!(p||v||y);c=0;h=_*u*4;for(l=0;l<A;l++){P.set(x.subarray(C,C+h));C+=h;if(U)for(var W=0;W<h;W+=4){p&&(P[W+0]=p[P[W+0]]);v&&(P[W+1]=v[P[W+1]]);y&&(P[W+2]=y[P[W+2]])}t.putImageData(k,0,c);c+=u}if(l<S){h=_*b*4;P.set(x.subarray(C,C+h));if(U)for(var H=0;H<h;H+=4){p&&(P[H+0]=p[P[H+0]]);v&&(P[H+1]=v[P[H+1]]);y&&(P[H+2]=y[P[H+2]])}t.putImageData(k,0,c)}}else{if(r.kind!==i.ImageKind.RGB_24BPP)throw new Error("bad image kind: ".concat(r.kind));var q=!!(p||v||y);h=_*(d=u);for(l=0;l<S;l++){l>=A&&(h=_*(d=b));o=0;for(c=h;c--;){P[o++]=x[C++];P[o++]=x[C++];P[o++]=x[C++];P[o++]=255}if(q)for(var V=0;V<o;V+=4){p&&(P[V+0]=p[P[V+0]]);v&&(P[V+1]=v[P[V+1]]);y&&(P[V+2]=y[P[V+2]])}t.putImageData(k,0,l*u)}}}}function putBinaryImageMask(t,r){for(var a=r.height,i=r.width,o=a%u,l=(a-o)/u,c=0===o?l:l+1,d=t.createImageData(i,u),h=0,p=r.data,v=d.data,y=0;y<c;y++){for(var g=y<l?u:o,m=3,_=0;_<g;_++)for(var b=void 0,A=0,S=0;S<i;S++){if(!A){b=p[h++];A=128}v[m]=b&A?0:255;m+=4;A>>=1}t.putImageData(d,0,y*u)}}function copyCtxState(t,r){for(var a=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"],i=0,o=a.length;i<o;i++){var l=a[i];void 0!==t[l]&&(r[l]=t[l])}if(void 0!==t.setLineDash){r.setLineDash(t.getLineDash());r.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t){t.strokeStyle="#000000";t.fillStyle="#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}}function composeSMaskBackdrop(t,r,a,i){for(var o=t.length,l=3;l<o;l+=4){var c=t[l];if(0===c){t[l-3]=r;t[l-2]=a;t[l-1]=i}else if(c<255){var u=255-c;t[l-3]=t[l-3]*c+r*u>>8;t[l-2]=t[l-2]*c+a*u>>8;t[l-1]=t[l-1]*c+i*u>>8}}}function composeSMaskAlpha(t,r,a){for(var i=t.length,o=3;o<i;o+=4){var l=a?a[t[o]]:t[o];r[o]=r[o]*l*.00392156862745098|0}}function composeSMaskLuminosity(t,r,a){for(var i=t.length,o=3;o<i;o+=4){var l=77*t[o-3]+152*t[o-2]+28*t[o-1];r[o]=a?r[o]*a[l>>8]>>8:r[o]*l>>16}}function composeSMask(t,r,a,i){var o=i[0],l=i[1],c=i[2]-o,u=i[3]-l;if(0!==c&&0!==u){!function genericComposeSMask(t,r,a,i,o,l,c,u,d,h,p){var v,y=!!l,g=y?l[0]:0,m=y?l[1]:0,_=y?l[2]:0;v="Luminosity"===o?composeSMaskLuminosity:composeSMaskAlpha;for(var b=Math.min(i,Math.ceil(1048576/a)),A=0;A<i;A+=b){var S=Math.min(b,i-A),k=t.getImageData(u-h,A+(d-p),a,S),C=r.getImageData(u,A+d,a,S);y&&composeSMaskBackdrop(k.data,g,m,_);v(k.data,C.data,c);r.putImageData(C,u,A+d)}}(r.context,a,c,u,r.subtype,r.backdrop,r.transferMap,o,l,r.offsetX,r.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(a.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,r){var a=i.Util.singularValueDecompose2dScale(t);a[0]=Math.fround(a[0]);a[1]=Math.fround(a[1]);var o=Math.fround((globalThis.devicePixelRatio||1)*l.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==r?r:a[0]<=o||a[1]<=o}var p=["butt","round","square"],v=["miter","round","bevel"],y={},g={},m=function(){function CanvasGraphics(t,r,a,i,o,l,c){_classCallCheck(this,CanvasGraphics);this.ctx=t;this.current=new h(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=r;this.objs=a;this.canvasFactory=i;this.imageLayer=o;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=[];this.optionalContentConfig=l;this.cachedCanvases=new d(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=c;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;t&&addContextCurrentTransform(t);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}_createClass(CanvasGraphics,[{key:"beginDrawing",value:function beginDrawing(t){var r=t.transform,a=t.viewport,i=t.transparency,o=void 0!==i&&i,l=t.background,c=void 0===l?null:l,u=this.ctx.canvas.width,d=this.ctx.canvas.height;this.ctx.save();this.ctx.fillStyle=c||"rgb(255, 255, 255)";this.ctx.fillRect(0,0,u,d);this.ctx.restore();if(o){var h=this.cachedCanvases.getCanvas("transparent",u,d,!0);this.compositeCtx=this.ctx;this.transparentCanvas=h.canvas;this.ctx=h.context;this.ctx.save();this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save();resetCtxToDefault(this.ctx);if(r){this.ctx.transform.apply(this.ctx,r);this.outputScaleX=r[0];this.outputScaleY=r[0]}this.ctx.transform.apply(this.ctx,a.transform);this.viewportScale=a.scale;this.baseTransform=this.ctx.mozCurrentTransform.slice();this.imageLayer&&this.imageLayer.beginLayout()}},{key:"executeOperatorList",value:function executeOperatorList(t,r,a,o){var l=t.argsArray,c=t.fnArray,u=r||0,d=l.length;if(d===u)return u;for(var h,p=d-u>10&&"function"==typeof a,v=p?Date.now()+15:0,y=0,g=this.commonObjs,m=this.objs;;){if(void 0!==o&&u===o.nextBreakPoint){o.breakIt(u,a);return u}if((h=c[u])!==i.OPS.dependency)this[h].apply(this,l[u]);else{var _,b=_createForOfIteratorHelper(l[u]);try{for(b.s();!(_=b.n()).done;){var A=_.value,S=A.startsWith("g_")?g:m;if(!S.has(A)){S.get(A,a);return u}}}catch(t){b.e(t)}finally{b.f()}}if(++u===d)return u;if(p&&++y>10){if(Date.now()>v){a();return u}y=0}}}},{key:"endDrawing",value:function endDrawing(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}this.cachedCanvases.clear();this.cachedPatterns.clear();this.imageLayer&&this.imageLayer.endLayout()}},{key:"_scaleImage",value:function _scaleImage(t,r){for(var a,i,o=t.width,l=t.height,c=Math.max(Math.hypot(r[0],r[1]),1),u=Math.max(Math.hypot(r[2],r[3]),1),d=o,h=l,p="prescale1";c>2&&d>1||u>2&&h>1;){var v=d,y=h;c>2&&d>1&&(c/=d/(v=Math.ceil(d/2)));u>2&&h>1&&(u/=h/(y=Math.ceil(h/2)));(i=(a=this.cachedCanvases.getCanvas(p,v,y)).context).clearRect(0,0,v,y);i.drawImage(t,0,0,d,h,0,0,v,y);t=a.canvas;d=v;h=y;p="prescale1"===p?"prescale2":"prescale1"}return{img:t,paintWidth:d,paintHeight:h}}},{key:"_createMaskCanvas",value:function _createMaskCanvas(t){var r=this.ctx,a=t.width,l=t.height,c=this.current.fillColor,u=this.current.patternFill,d=this.cachedCanvases.getCanvas("maskCanvas",a,l);putBinaryImageMask(d.context,t);var h=r.mozCurrentTransform,p=i.Util.transform(h,[1/a,0,0,-1/l,0,0]);p=i.Util.transform(p,[1,0,0,1,0,-l]);var v=i.Util.applyTransform([0,0],p),y=i.Util.applyTransform([a,l],p),g=i.Util.normalizeRect([v[0],v[1],y[0],y[1]]),m=Math.ceil(g[2]-g[0]),_=Math.ceil(g[3]-g[1]),b=this.cachedCanvases.getCanvas("fillCanvas",m,_,!0),A=b.context,S=Math.min(v[0],y[0]),k=Math.min(v[1],y[1]);A.translate(-S,-k);A.transform.apply(A,p);var C=this._scaleImage(d.canvas,A.mozCurrentTransformInverse);A.imageSmoothingEnabled=getImageSmoothingEnabled(A.mozCurrentTransform,t.interpolate);A.drawImage(C.img,0,0,C.img.width,C.img.height,0,0,a,l);A.globalCompositeOperation="source-in";var x=i.Util.transform(A.mozCurrentTransformInverse,[1,0,0,1,-S,-k]);A.fillStyle=u?c.getPattern(r,this,x,o.PathType.FILL):c;A.fillRect(0,0,a,l);return{canvas:b.canvas,offsetX:Math.round(S),offsetY:Math.round(k)}}},{key:"setLineWidth",value:function setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=t;this.ctx.lineWidth=t}},{key:"setLineCap",value:function setLineCap(t){this.ctx.lineCap=p[t]}},{key:"setLineJoin",value:function setLineJoin(t){this.ctx.lineJoin=v[t]}},{key:"setMiterLimit",value:function setMiterLimit(t){this.ctx.miterLimit=t}},{key:"setDash",value:function setDash(t,r){var a=this.ctx;if(void 0!==a.setLineDash){a.setLineDash(t);a.lineDashOffset=r}}},{key:"setRenderingIntent",value:function setRenderingIntent(t){}},{key:"setFlatness",value:function setFlatness(t){}},{key:"setGState",value:function setGState(t){for(var r=0,a=t.length;r<a;r++){var i=t[r],o=i[0],l=i[1];switch(o){case"LW":this.setLineWidth(l);break;case"LC":this.setLineCap(l);break;case"LJ":this.setLineJoin(l);break;case"ML":this.setMiterLimit(l);break;case"D":this.setDash(l[0],l[1]);break;case"RI":this.setRenderingIntent(l);break;case"FL":this.setFlatness(l);break;case"Font":this.setFont(l[0],l[1]);break;case"CA":this.current.strokeAlpha=i[1];break;case"ca":this.current.fillAlpha=i[1];this.ctx.globalAlpha=i[1];break;case"BM":this.ctx.globalCompositeOperation=l;break;case"SMask":this.current.activeSMask=l?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=l}}}},{key:"inSMaskMode",get:function get(){return!!this.suspendedCtx}},{key:"checkSMaskState",value:function checkSMaskState(){var t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}},{key:"beginSMaskMode",value:function beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");var t=this.ctx.canvas.width,r=this.ctx.canvas.height,a="smaskGroupAt"+this.groupLevel,i=this.cachedCanvases.getCanvas(a,t,r,!0);this.suspendedCtx=this.ctx;this.ctx=i.context;var o=this.ctx;o.setTransform.apply(o,this.suspendedCtx.mozCurrentTransform);copyCtxState(this.suspendedCtx,o);!function mirrorContextOperations(t,r){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save;t.__originalRestore=t.restore;t.__originalRotate=t.rotate;t.__originalScale=t.scale;t.__originalTranslate=t.translate;t.__originalTransform=t.transform;t.__originalSetTransform=t.setTransform;t.__originalResetTransform=t.resetTransform;t.__originalClip=t.clip;t.__originalMoveTo=t.moveTo;t.__originalLineTo=t.lineTo;t.__originalBezierCurveTo=t.bezierCurveTo;t.__originalRect=t.rect;t.__originalClosePath=t.closePath;t.__originalBeginPath=t.beginPath;t._removeMirroring=function(){t.save=t.__originalSave;t.restore=t.__originalRestore;t.rotate=t.__originalRotate;t.scale=t.__originalScale;t.translate=t.__originalTranslate;t.transform=t.__originalTransform;t.setTransform=t.__originalSetTransform;t.resetTransform=t.__originalResetTransform;t.clip=t.__originalClip;t.moveTo=t.__originalMoveTo;t.lineTo=t.__originalLineTo;t.bezierCurveTo=t.__originalBezierCurveTo;t.rect=t.__originalRect;t.closePath=t.__originalClosePath;t.beginPath=t.__originalBeginPath;delete t._removeMirroring};t.save=function ctxSave(){r.save();this.__originalSave()};t.restore=function ctxRestore(){r.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,a){r.translate(t,a);this.__originalTranslate(t,a)};t.scale=function ctxScale(t,a){r.scale(t,a);this.__originalScale(t,a)};t.transform=function ctxTransform(t,a,i,o,l,c){r.transform(t,a,i,o,l,c);this.__originalTransform(t,a,i,o,l,c)};t.setTransform=function ctxSetTransform(t,a,i,o,l,c){r.setTransform(t,a,i,o,l,c);this.__originalSetTransform(t,a,i,o,l,c)};t.resetTransform=function ctxResetTransform(){r.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){r.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){r.clip(t);this.__originalClip(t)};t.moveTo=function(t,a){r.moveTo(t,a);this.__originalMoveTo(t,a)};t.lineTo=function(t,a){r.lineTo(t,a);this.__originalLineTo(t,a)};t.bezierCurveTo=function(t,a,i,o,l,c){r.bezierCurveTo(t,a,i,o,l,c);this.__originalBezierCurveTo(t,a,i,o,l,c)};t.rect=function(t,a,i,o){r.rect(t,a,i,o);this.__originalRect(t,a,i,o)};t.closePath=function(){r.closePath();this.__originalClosePath()};t.beginPath=function(){r.beginPath();this.__originalBeginPath()}}(o,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}},{key:"endSMaskMode",value:function endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}},{key:"compose",value:function compose(t){if(this.current.activeSMask){if(t){t[0]=Math.floor(t[0]);t[1]=Math.floor(t[1]);t[2]=Math.ceil(t[2]);t[3]=Math.ceil(t[3])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];var r=this.current.activeSMask;composeSMask(this.suspendedCtx,r,this.ctx,t);this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()}}},{key:"save",value:function save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();var t=this.current;this.stateStack.push(t);this.current=t.clone()}},{key:"restore",value:function restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}}},{key:"transform",value:function transform(t,r,a,i,o,l){this.ctx.transform(t,r,a,i,o,l);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}},{key:"constructPath",value:function constructPath(t,r){for(var a,o,l=this.ctx,c=this.current,u=c.x,d=c.y,h=0,p=0,v=t.length;h<v;h++)switch(0|t[h]){case i.OPS.rectangle:u=r[p++];d=r[p++];var y=r[p++],g=r[p++],m=u+y,_=d+g;l.moveTo(u,d);if(0===y||0===g)l.lineTo(m,_);else{l.lineTo(m,d);l.lineTo(m,_);l.lineTo(u,_)}c.updatePathMinMax(l.mozCurrentTransform,u,d);c.updatePathMinMax(l.mozCurrentTransform,m,_);l.closePath();break;case i.OPS.moveTo:u=r[p++];d=r[p++];l.moveTo(u,d);c.updatePathMinMax(l.mozCurrentTransform,u,d);break;case i.OPS.lineTo:u=r[p++];d=r[p++];l.lineTo(u,d);c.updatePathMinMax(l.mozCurrentTransform,u,d);break;case i.OPS.curveTo:a=u;o=d;u=r[p+4];d=r[p+5];l.bezierCurveTo(r[p],r[p+1],r[p+2],r[p+3],u,d);c.updateCurvePathMinMax(l.mozCurrentTransform,a,o,r[p],r[p+1],r[p+2],r[p+3],u,d);p+=6;break;case i.OPS.curveTo2:a=u;o=d;l.bezierCurveTo(u,d,r[p],r[p+1],r[p+2],r[p+3]);c.updateCurvePathMinMax(l.mozCurrentTransform,a,o,u,d,r[p],r[p+1],r[p+2],r[p+3]);u=r[p+2];d=r[p+3];p+=4;break;case i.OPS.curveTo3:a=u;o=d;u=r[p+2];d=r[p+3];l.bezierCurveTo(r[p],r[p+1],u,d,u,d);c.updateCurvePathMinMax(l.mozCurrentTransform,a,o,r[p],r[p+1],u,d,u,d);p+=4;break;case i.OPS.closePath:l.closePath()}c.setCurrentPoint(u,d)}},{key:"closePath",value:function closePath(){this.ctx.closePath()}},{key:"stroke",value:function stroke(t){t=void 0===t||t;var r=this.ctx,a=this.current.strokeColor;r.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"===_typeof(a)&&null!=a&&a.getPattern){r.save();r.strokeStyle=a.getPattern(r,this,r.mozCurrentTransformInverse,o.PathType.STROKE);this.rescaleAndStroke(!1);r.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());r.globalAlpha=this.current.fillAlpha}},{key:"closeStroke",value:function closeStroke(){this.closePath();this.stroke()}},{key:"fill",value:function fill(t){t=void 0===t||t;var r=this.ctx,a=this.current.fillColor,i=!1;if(this.current.patternFill){r.save();r.fillStyle=a.getPattern(r,this,r.mozCurrentTransformInverse,o.PathType.FILL);i=!0}var l=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==l)if(this.pendingEOFill){r.fill("evenodd");this.pendingEOFill=!1}else r.fill();i&&r.restore();t&&this.consumePath(l)}},{key:"eoFill",value:function eoFill(){this.pendingEOFill=!0;this.fill()}},{key:"fillStroke",value:function fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}},{key:"eoFillStroke",value:function eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}},{key:"closeFillStroke",value:function closeFillStroke(){this.closePath();this.fillStroke()}},{key:"closeEOFillStroke",value:function closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}},{key:"endPath",value:function endPath(){this.consumePath()}},{key:"clip",value:function clip(){this.pendingClip=y}},{key:"eoClip",value:function eoClip(){this.pendingClip=g}},{key:"beginText",value:function beginText(){this.current.textMatrix=i.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}},{key:"endText",value:function endText(){var t=this.pendingTextPaths,r=this.ctx;if(void 0!==t){r.save();r.beginPath();for(var a=0;a<t.length;a++){var i=t[a];r.setTransform.apply(r,i.transform);r.translate(i.x,i.y);i.addToPath(r,i.fontSize)}r.restore();r.clip();r.beginPath();delete this.pendingTextPaths}else r.beginPath()}},{key:"setCharSpacing",value:function setCharSpacing(t){this.current.charSpacing=t}},{key:"setWordSpacing",value:function setWordSpacing(t){this.current.wordSpacing=t}},{key:"setHScale",value:function setHScale(t){this.current.textHScale=t/100}},{key:"setLeading",value:function setLeading(t){this.current.leading=-t}},{key:"setFont",value:function setFont(t,r){var a=this.commonObjs.get(t),o=this.current;if(!a)throw new Error("Can't find font for ".concat(t));o.fontMatrix=a.fontMatrix||i.FONT_IDENTITY_MATRIX;0!==o.fontMatrix[0]&&0!==o.fontMatrix[3]||(0,i.warn)("Invalid font matrix for font "+t);if(r<0){r=-r;o.fontDirection=-1}else o.fontDirection=1;this.current.font=a;this.current.fontSize=r;if(!a.isType3Font){var l=a.loadedName||"sans-serif",c="normal";a.black?c="900":a.bold&&(c="bold");var u=a.italic?"italic":"normal",d='"'.concat(l,'", ').concat(a.fallbackName),h=r;r<16?h=16:r>100&&(h=100);this.current.fontSizeScale=r/h;this.ctx.font="".concat(u," ").concat(c," ").concat(h,"px ").concat(d)}}},{key:"setTextRenderingMode",value:function setTextRenderingMode(t){this.current.textRenderingMode=t}},{key:"setTextRise",value:function setTextRise(t){this.current.textRise=t}},{key:"moveText",value:function moveText(t,r){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=r}},{key:"setLeadingMoveText",value:function setLeadingMoveText(t,r){this.setLeading(-r);this.moveText(t,r)}},{key:"setTextMatrix",value:function setTextMatrix(t,r,a,i,o,l){this.current.textMatrix=[t,r,a,i,o,l];this.current.textMatrixScale=Math.hypot(t,r);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}},{key:"nextLine",value:function nextLine(){this.moveText(0,this.current.leading)}},{key:"paintChar",value:function paintChar(t,r,a,o){var l,c=this.ctx,u=this.current,d=u.font,h=u.textRenderingMode,p=u.fontSize/u.fontSizeScale,v=h&i.TextRenderingMode.FILL_STROKE_MASK,y=!!(h&i.TextRenderingMode.ADD_TO_PATH_FLAG),g=u.patternFill&&!d.missingFile;(d.disableFontFace||y||g)&&(l=d.getPathGenerator(this.commonObjs,t));if(d.disableFontFace||g){c.save();c.translate(r,a);c.beginPath();l(c,p);o&&c.setTransform.apply(c,o);v!==i.TextRenderingMode.FILL&&v!==i.TextRenderingMode.FILL_STROKE||c.fill();v!==i.TextRenderingMode.STROKE&&v!==i.TextRenderingMode.FILL_STROKE||c.stroke();c.restore()}else{v!==i.TextRenderingMode.FILL&&v!==i.TextRenderingMode.FILL_STROKE||c.fillText(t,r,a);v!==i.TextRenderingMode.STROKE&&v!==i.TextRenderingMode.FILL_STROKE||c.strokeText(t,r,a)}if(y){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:c.mozCurrentTransform,x:r,y:a,fontSize:p,addToPath:l})}}},{key:"isFontSubpixelAAEnabled",get:function get(){var t=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;t.scale(1.5,1);t.fillText("I",0,10);for(var r=t.getImageData(0,0,10,10).data,a=!1,o=3;o<r.length;o+=4)if(r[o]>0&&r[o]<255){a=!0;break}return(0,i.shadow)(this,"isFontSubpixelAAEnabled",a)}},{key:"showText",value:function showText(t){var r=this.current,a=r.font;if(a.isType3Font)return this.showType3Text(t);var l=r.fontSize;if(0!==l){var c,u=this.ctx,d=r.fontSizeScale,h=r.charSpacing,p=r.wordSpacing,v=r.fontDirection,y=r.textHScale*v,g=t.length,m=a.vertical,_=m?1:-1,b=a.defaultVMetrics,A=l*r.fontMatrix[0],S=r.textRenderingMode===i.TextRenderingMode.FILL&&!a.disableFontFace&&!r.patternFill;u.save();u.transform.apply(u,r.textMatrix);u.translate(r.x,r.y+r.textRise);v>0?u.scale(y,-1):u.scale(y,1);if(r.patternFill){u.save();var k=r.fillColor.getPattern(u,this,u.mozCurrentTransformInverse,o.PathType.FILL);c=u.mozCurrentTransform;u.restore();u.fillStyle=k}var C=r.lineWidth,x=r.textMatrixScale;if(0===x||0===C){var P=r.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;P!==i.TextRenderingMode.STROKE&&P!==i.TextRenderingMode.FILL_STROKE||(C=this.getSinglePixelWidth())}else C/=x;if(1!==d){u.scale(d,d);C/=d}u.lineWidth=C;var w,T=0;for(w=0;w<g;++w){var R=t[w];if("number"!=typeof R){var E=!1,O=(R.isSpace?p:0)+h,I=R.fontChar,D=R.accent,M=void 0,L=void 0,j=R.width;if(m){var N=R.vmetric||b,B=-(R.vmetric?N[1]:.5*j)*A,G=N[2]*A;j=N?-N[0]:j;M=B/d;L=(T+G)/d}else{M=T/d;L=0}if(a.remeasure&&j>0){var U=1e3*u.measureText(I).width/l*d;if(j<U&&this.isFontSubpixelAAEnabled){var W=j/U;E=!0;u.save();u.scale(W,1);M/=W}else j!==U&&(M+=(j-U)/2e3*l/d)}if(this.contentVisible&&(R.isInFont||a.missingFile))if(S&&!D)u.fillText(I,M,L);else{this.paintChar(I,M,L,c);if(D){var H=M+l*D.offset.x/d,q=L-l*D.offset.y/d;this.paintChar(D.fontChar,H,q,c)}}T+=m?j*A-O*v:j*A+O*v;E&&u.restore()}else T+=_*R*l/1e3}m?r.y-=T:r.x+=T*y;u.restore();this.compose()}}},{key:"showType3Text",value:function showType3Text(t){var r,a,o,l,c=this.ctx,u=this.current,d=u.font,h=u.fontSize,p=u.fontDirection,v=d.vertical?1:-1,y=u.charSpacing,g=u.wordSpacing,m=u.textHScale*p,_=u.fontMatrix||i.FONT_IDENTITY_MATRIX,b=t.length;if(!(u.textRenderingMode===i.TextRenderingMode.INVISIBLE)&&0!==h){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;c.save();c.transform.apply(c,u.textMatrix);c.translate(u.x,u.y);c.scale(m,p);for(r=0;r<b;++r)if("number"!=typeof(a=t[r])){var A=(a.isSpace?g:0)+y,S=d.charProcOperatorList[a.operatorListId];if(S){if(this.contentVisible){this.processingType3=a;this.save();c.scale(h,h);c.transform.apply(c,_);this.executeOperatorList(S);this.restore()}o=i.Util.applyTransform([a.width,0],_)[0]*h+A;c.translate(o,0);u.x+=o*m}else(0,i.warn)('Type3 character "'.concat(a.operatorListId,'" is not available.'))}else{l=v*a*h/1e3;this.ctx.translate(l,0);u.x+=l*m}c.restore();this.processingType3=null}}},{key:"setCharWidth",value:function setCharWidth(t,r){}},{key:"setCharWidthAndBounds",value:function setCharWidthAndBounds(t,r,a,i,o,l){this.ctx.rect(a,i,o-a,l-i);this.clip();this.endPath()}},{key:"getColorN_Pattern",value:function getColorN_Pattern(t){var r,a=this;if("TilingPattern"===t[0]){var i=t[1],l=this.baseTransform||this.ctx.mozCurrentTransform.slice(),c={createCanvasGraphics:function createCanvasGraphics(t){return new CanvasGraphics(t,a.commonObjs,a.objs,a.canvasFactory)}};r=new o.TilingPattern(t,i,this.ctx,c,l)}else r=this._getPattern(t[1],t[2]);return r}},{key:"setStrokeColorN",value:function setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}},{key:"setFillColorN",value:function setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}},{key:"setStrokeRGBColor",value:function setStrokeRGBColor(t,r,a){var o=i.Util.makeHexColor(t,r,a);this.ctx.strokeStyle=o;this.current.strokeColor=o}},{key:"setFillRGBColor",value:function setFillRGBColor(t,r,a){var o=i.Util.makeHexColor(t,r,a);this.ctx.fillStyle=o;this.current.fillColor=o;this.current.patternFill=!1}},{key:"_getPattern",value:function _getPattern(t){var r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))r=this.cachedPatterns.get(t);else{r=(0,o.getShadingPattern)(this.objs.get(t));this.cachedPatterns.set(t,r)}a&&(r.matrix=a);return r}},{key:"shadingFill",value:function shadingFill(t){if(this.contentVisible){var r=this.ctx;this.save();var a=this._getPattern(t);r.fillStyle=a.getPattern(r,this,r.mozCurrentTransformInverse,o.PathType.SHADING);var l=r.mozCurrentTransformInverse;if(l){var c=r.canvas,u=c.width,d=c.height,h=i.Util.applyTransform([0,0],l),p=i.Util.applyTransform([0,d],l),v=i.Util.applyTransform([u,0],l),y=i.Util.applyTransform([u,d],l),g=Math.min(h[0],p[0],v[0],y[0]),m=Math.min(h[1],p[1],v[1],y[1]),_=Math.max(h[0],p[0],v[0],y[0]),b=Math.max(h[1],p[1],v[1],y[1]);this.ctx.fillRect(g,m,_-g,b-m)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}}},{key:"beginInlineImage",value:function beginInlineImage(){(0,i.unreachable)("Should not call beginInlineImage")}},{key:"beginImageData",value:function beginImageData(){(0,i.unreachable)("Should not call beginImageData")}},{key:"paintFormXObjectBegin",value:function paintFormXObjectBegin(t,r){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform.apply(this,t);this.baseTransform=this.ctx.mozCurrentTransform;if(r){var a=r[2]-r[0],i=r[3]-r[1];this.ctx.rect(r[0],r[1],a,i);this.current.updatePathMinMax(this.ctx.mozCurrentTransform,r[0],r[1]);this.current.updatePathMinMax(this.ctx.mozCurrentTransform,r[2],r[3]);this.clip();this.endPath()}}}},{key:"paintFormXObjectEnd",value:function paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}},{key:"beginGroup",value:function beginGroup(t){if(this.contentVisible){this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}var r=this.ctx;t.isolated||(0,i.info)("TODO: Support non-isolated groups.");t.knockout&&(0,i.warn)("Knockout groups not supported.");var a=r.mozCurrentTransform;t.matrix&&r.transform.apply(r,t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");var o=i.Util.getAxialAlignedBoundingBox(t.bbox,r.mozCurrentTransform),l=[0,0,r.canvas.width,r.canvas.height];o=i.Util.intersect(o,l)||[0,0,0,0];var u=Math.floor(o[0]),d=Math.floor(o[1]),h=Math.max(Math.ceil(o[2])-u,1),p=Math.max(Math.ceil(o[3])-d,1),v=1,y=1;if(h>c){v=h/c;h=c}if(p>c){y=p/c;p=c}this.current.startNewPathAndClipBox([0,0,h,p]);var g="groupAt"+this.groupLevel;t.smask&&(g+="_smask_"+this.smaskCounter++%2);var m=this.cachedCanvases.getCanvas(g,h,p,!0),_=m.context;_.scale(1/v,1/y);_.translate(-u,-d);_.transform.apply(_,a);if(t.smask)this.smaskStack.push({canvas:m.canvas,context:_,offsetX:u,offsetY:d,scaleX:v,scaleY:y,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{r.setTransform(1,0,0,1,0,0);r.translate(u,d);r.scale(v,y);r.save()}copyCtxState(r,_);this.ctx=_;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(r);this.groupLevel++}}},{key:"endGroup",value:function endGroup(t){if(this.contentVisible){this.groupLevel--;var r=this.ctx,a=this.groupStack.pop();this.ctx=a;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();var o=this.ctx.mozCurrentTransform;this.restore();this.ctx.save();this.ctx.setTransform.apply(this.ctx,o);var l=i.Util.getAxialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],o);this.ctx.drawImage(r.canvas,0,0);this.ctx.restore();this.compose(l)}}}},{key:"beginAnnotations",value:function beginAnnotations(){this.save();this.baseTransform&&this.ctx.setTransform.apply(this.ctx,this.baseTransform)}},{key:"endAnnotations",value:function endAnnotations(){this.restore()}},{key:"beginAnnotation",value:function beginAnnotation(t,r,a,o,l){this.save();if(Array.isArray(r)&&4===r.length){var c=r[2]-r[0],u=r[3]-r[1];if(l&&this.annotationCanvasMap){(a=a.slice())[4]-=r[0];a[5]-=r[1];(r=r.slice())[0]=r[1]=0;r[2]=c;r[3]=u;var d=_slicedToArray(i.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),2),p=d[0],v=d[1],y=this.viewportScale,g=Math.ceil(c*this.outputScaleX*y),m=Math.ceil(u*this.outputScaleY*y);this.annotationCanvas=this.canvasFactory.create(g,m);var _=this.annotationCanvas,b=_.canvas,A=_.context;b.style.width="calc(".concat(c,"px * var(--viewport-scale-factor))");b.style.height="calc(".concat(u,"px * var(--viewport-scale-factor))");this.annotationCanvasMap.set(t,b);this.annotationCanvas.savedCtx=this.ctx;this.ctx=A;this.ctx.setTransform(p,0,0,-v,0,u*v);addContextCurrentTransform(this.ctx);resetCtxToDefault(this.ctx)}else{resetCtxToDefault(this.ctx);this.ctx.rect(r[0],r[1],c,u);this.clip();this.endPath()}}this.current=new h(this.ctx.canvas.width,this.ctx.canvas.height);this.transform.apply(this,a);this.transform.apply(this,o)}},{key:"endAnnotation",value:function endAnnotation(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}this.restore()}},{key:"paintImageMaskXObject",value:function paintImageMaskXObject(t){if(this.contentVisible){var r=this.ctx,a=t.width,i=t.height,o=this.processingType3;o&&void 0===o.compiled&&(o.compiled=a<=1e3&&i<=1e3?function compileType3Glyph(t){var r,a,i,o,l=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),c=t.width,u=t.height,d=c+1,h=new Uint8Array(d*(u+1)),p=c+7&-8,v=t.data,y=new Uint8Array(p*u),g=0;for(r=0,a=v.length;r<a;r++)for(var m=v[r],_=128;_>0;){y[g++]=m&_?0:255;_>>=1}var b=0;if(0!==y[g=0]){h[0]=1;++b}for(i=1;i<c;i++){if(y[g]!==y[g+1]){h[i]=y[g]?2:1;++b}g++}if(0!==y[g]){h[i]=2;++b}for(r=1;r<u;r++){o=r*d;if(y[(g=r*p)-p]!==y[g]){h[o]=y[g]?1:8;++b}var A=(y[g]?4:0)+(y[g-p]?8:0);for(i=1;i<c;i++){if(l[A=(A>>2)+(y[g+1]?4:0)+(y[g-p+1]?8:0)]){h[o+i]=l[A];++b}g++}if(y[g-p]!==y[g]){h[o+i]=y[g]?2:4;++b}if(b>1e3)return null}o=r*d;if(0!==y[g=p*(u-1)]){h[o]=8;++b}for(i=1;i<c;i++){if(y[g]!==y[g+1]){h[o+i]=y[g]?4:8;++b}g++}if(0!==y[g]){h[o+i]=4;++b}if(b>1e3)return null;var S=new Int32Array([0,d,-1,0,-d,0,0,0,1]),k=[];for(r=0;b&&r<=u;r++){for(var C=r*d,x=C+c;C<x&&!h[C];)C++;if(C!==x){var P=[C%d,r],w=C,T=h[C];do{var R=S[T];do{C+=R}while(!h[C]);var E=h[C];if(5!==E&&10!==E){T=E;h[C]=0}else{T=E&51*T>>4;h[C]&=T>>2|T<<2}P.push(C%d,C/d|0);h[C]||--b}while(w!==C);k.push(P);--r}}return function drawOutline(t){t.save();t.scale(1/c,-1/u);t.translate(0,-u);t.beginPath();for(var r=0,a=k.length;r<a;r++){var i=k[r];t.moveTo(i[0],i[1]);for(var o=2,l=i.length;o<l;o+=2)t.lineTo(i[o],i[o+1])}t.fill();t.beginPath();t.restore()}}({data:t.data,width:a,height:i}):null);if(null!=o&&o.compiled)o.compiled(r);else{var l=this._createMaskCanvas(t),c=l.canvas;r.save();r.setTransform(1,0,0,1,0,0);r.drawImage(c,l.offsetX,l.offsetY);r.restore();this.compose()}}}},{key:"paintImageMaskXObjectRepeat",value:function paintImageMaskXObjectRepeat(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,l=arguments.length>4?arguments[4]:void 0,c=arguments.length>5?arguments[5]:void 0;if(this.contentVisible){var u=this.ctx;u.save();var d=u.mozCurrentTransform;u.transform(r,a,o,l,0,0);var h=this._createMaskCanvas(t);u.setTransform(1,0,0,1,0,0);for(var p=0,v=c.length;p<v;p+=2){var y=i.Util.transform(d,[r,a,o,l,c[p],c[p+1]]),g=i.Util.applyTransform([0,0],y),m=_slicedToArray(g,2),_=m[0],b=m[1];u.drawImage(h.canvas,_,b)}u.restore();this.compose()}}},{key:"paintImageMaskXObjectGroup",value:function paintImageMaskXObjectGroup(t){if(this.contentVisible){for(var r=this.ctx,a=this.current.fillColor,i=this.current.patternFill,l=0,c=t.length;l<c;l++){var u=t[l],d=u.width,h=u.height,p=this.cachedCanvases.getCanvas("maskCanvas",d,h),v=p.context;v.save();putBinaryImageMask(v,u);v.globalCompositeOperation="source-in";v.fillStyle=i?a.getPattern(v,this,r.mozCurrentTransformInverse,o.PathType.FILL):a;v.fillRect(0,0,d,h);v.restore();r.save();r.transform.apply(r,u.transform);r.scale(1,-1);r.drawImage(p.canvas,0,0,d,h,0,-1,1,1);r.restore()}this.compose()}}},{key:"paintImageXObject",value:function paintImageXObject(t){if(this.contentVisible){var r=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);r?this.paintInlineImageXObject(r):(0,i.warn)("Dependent image isn't ready yet")}}},{key:"paintImageXObjectRepeat",value:function paintImageXObjectRepeat(t,r,a,o){if(this.contentVisible){var l=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);if(l){for(var c=l.width,u=l.height,d=[],h=0,p=o.length;h<p;h+=2)d.push({transform:[r,0,0,a,o[h],o[h+1]],x:0,y:0,w:c,h:u});this.paintInlineImageXObjectGroup(l,d)}else(0,i.warn)("Dependent image isn't ready yet")}}},{key:"paintInlineImageXObject",value:function paintInlineImageXObject(t){if(this.contentVisible){var r,a=t.width,i=t.height,o=this.ctx;this.save();o.scale(1/a,-1/i);if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)r=t;else{var l=this.cachedCanvases.getCanvas("inlineImage",a,i);putBinaryImageData(l.context,t,this.current.transferMaps);r=l.canvas}var c=this._scaleImage(r,o.mozCurrentTransformInverse);o.imageSmoothingEnabled=getImageSmoothingEnabled(o.mozCurrentTransform,t.interpolate);o.drawImage(c.img,0,0,c.paintWidth,c.paintHeight,0,-i,a,i);if(this.imageLayer){var u=this.getCanvasPosition(0,-i);this.imageLayer.appendImage({imgData:t,left:u[0],top:u[1],width:a/o.mozCurrentTransformInverse[0],height:i/o.mozCurrentTransformInverse[3]})}this.compose();this.restore()}}},{key:"paintInlineImageXObjectGroup",value:function paintInlineImageXObjectGroup(t,r){if(this.contentVisible){var a=this.ctx,i=t.width,o=t.height,l=this.cachedCanvases.getCanvas("inlineImage",i,o);putBinaryImageData(l.context,t,this.current.transferMaps);for(var c=0,u=r.length;c<u;c++){var d=r[c];a.save();a.transform.apply(a,d.transform);a.scale(1,-1);a.drawImage(l.canvas,d.x,d.y,d.w,d.h,0,-1,1,1);if(this.imageLayer){var h=this.getCanvasPosition(d.x,d.y);this.imageLayer.appendImage({imgData:t,left:h[0],top:h[1],width:i,height:o})}a.restore()}this.compose()}}},{key:"paintSolidColorImageMask",value:function paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}},{key:"markPoint",value:function markPoint(t){}},{key:"markPointProps",value:function markPointProps(t,r){}},{key:"beginMarkedContent",value:function beginMarkedContent(t){this.markedContentStack.push({visible:!0})}},{key:"beginMarkedContentProps",value:function beginMarkedContentProps(t,r){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}},{key:"endMarkedContent",value:function endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}},{key:"beginCompat",value:function beginCompat(){}},{key:"endCompat",value:function endCompat(){}},{key:"consumePath",value:function consumePath(t){this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);var r=this.ctx;if(this.pendingClip){this.pendingClip===g?r.clip("evenodd"):r.clip();this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);r.beginPath()}},{key:"getSinglePixelWidth",value:function getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){var t=this.ctx.mozCurrentTransform;if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{var r=Math.abs(t[0]*t[3]-t[2]*t[1]),a=Math.hypot(t[0],t[2]),i=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(a,i)/r}}return this._cachedGetSinglePixelWidth}},{key:"getScaleForStroking",value:function getScaleForStroking(){if(!this._cachedScaleForStroking){var t,r,a=this.current.lineWidth,i=this.ctx.mozCurrentTransform;if(0===i[1]&&0===i[2]){var o=Math.abs(i[0]),l=Math.abs(i[3]);if(0===a){t=1/o;r=1/l}else{var c=o*a,u=l*a;t=c<1?1/c:1;r=u<1?1/u:1}}else{var d=Math.abs(i[0]*i[3]-i[2]*i[1]),h=Math.hypot(i[0],i[1]),p=Math.hypot(i[2],i[3]);if(0===a){t=p/d;r=h/d}else{var v=a*d;t=p>v?p/v:1;r=h>v?h/v:1}}this._cachedScaleForStroking=[t,r]}return this._cachedScaleForStroking}},{key:"rescaleAndStroke",value:function rescaleAndStroke(t){var r=this.ctx,a=this.current.lineWidth,i=_slicedToArray(this.getScaleForStroking(),2),o=i[0],l=i[1];r.lineWidth=a||1;if(1!==o||1!==l){var c,u,d;if(t){c=r.mozCurrentTransform.slice();u=r.getLineDash().slice();d=r.lineDashOffset}r.scale(o,l);var h=Math.max(o,l);r.setLineDash(r.getLineDash().map((function(t){return t/h})));r.lineDashOffset/=h;r.stroke();if(t){r.setTransform.apply(r,_toConsumableArray(c));r.setLineDash(u);r.lineDashOffset=d}}else r.stroke()}},{key:"getCanvasPosition",value:function getCanvasPosition(t,r){var a=this.ctx.mozCurrentTransform;return[a[0]*t+a[2]*r+a[4],a[1]*t+a[3]*r+a[5]]}},{key:"isContentVisible",value:function isContentVisible(){for(var t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}]);return CanvasGraphics}();r.CanvasGraphics=m;for(var _ in i.OPS)void 0!==m.prototype[_]&&(m.prototype[i.OPS[_]]=m.prototype[_])},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.TilingPattern=r.PathType=void 0;r.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new c(t);case"Mesh":return new u(t);case"Dummy":return new d}throw new Error("Unknown IR type: ".concat(t[0]))};var i=a(1);function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var o={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};r.PathType=o;function applyBoundingBox(t,r){if(r&&"undefined"!=typeof Path2D){var a=r[2]-r[0],i=r[3]-r[1],o=new Path2D;o.rect(r[0],r[1],a,i);t.clip(o)}}var l=function(){function BaseShadingPattern(){_classCallCheck(this,BaseShadingPattern);this.constructor===BaseShadingPattern&&(0,i.unreachable)("Cannot initialize BaseShadingPattern.")}_createClass(BaseShadingPattern,[{key:"getPattern",value:function getPattern(){(0,i.unreachable)("Abstract method `getPattern` called.")}}]);return BaseShadingPattern}(),c=function(t){_inherits(RadialAxialShadingPattern,t);var r=_createSuper(RadialAxialShadingPattern);function RadialAxialShadingPattern(t){var a;_classCallCheck(this,RadialAxialShadingPattern);(a=r.call(this))._type=t[1];a._bbox=t[2];a._colorStops=t[3];a._p0=t[4];a._p1=t[5];a._r0=t[6];a._r1=t[7];a.matrix=null;return a}_createClass(RadialAxialShadingPattern,[{key:"_createGradient",value:function _createGradient(t){var r;"axial"===this._type?r=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(r=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));var a,i=_createForOfIteratorHelper(this._colorStops);try{for(i.s();!(a=i.n()).done;){var o=a.value;r.addColorStop(o[0],o[1])}}catch(t){i.e(t)}finally{i.f()}return r}},{key:"getPattern",value:function getPattern(t,r,a,l){var c;if(l===o.STROKE||l===o.FILL){var u=r.current.getClippedPathBoundingBox(l,t.mozCurrentTransform)||[0,0,0,0],d=Math.ceil(u[2]-u[0])||1,h=Math.ceil(u[3]-u[1])||1,p=r.cachedCanvases.getCanvas("pattern",d,h,!0),v=p.context;v.clearRect(0,0,v.canvas.width,v.canvas.height);v.beginPath();v.rect(0,0,v.canvas.width,v.canvas.height);v.translate(-u[0],-u[1]);a=i.Util.transform(a,[1,0,0,1,u[0],u[1]]);v.transform.apply(v,r.baseTransform);this.matrix&&v.transform.apply(v,this.matrix);applyBoundingBox(v,this._bbox);v.fillStyle=this._createGradient(v);v.fill();c=t.createPattern(p.canvas,"no-repeat");var y=new DOMMatrix(a);try{c.setTransform(y)}catch(t){(0,i.warn)('RadialAxialShadingPattern.getPattern: "'.concat(null==t?void 0:t.message,'".'))}}else{applyBoundingBox(t,this._bbox);c=this._createGradient(t)}return c}}]);return RadialAxialShadingPattern}(l);function drawTriangle(t,r,a,i,o,l,c,u){var d,h=r.coords,p=r.colors,v=t.data,y=4*t.width;if(h[a+1]>h[i+1]){d=a;a=i;i=d;d=l;l=c;c=d}if(h[i+1]>h[o+1]){d=i;i=o;o=d;d=c;c=u;u=d}if(h[a+1]>h[i+1]){d=a;a=i;i=d;d=l;l=c;c=d}var g=(h[a]+r.offsetX)*r.scaleX,m=(h[a+1]+r.offsetY)*r.scaleY,_=(h[i]+r.offsetX)*r.scaleX,b=(h[i+1]+r.offsetY)*r.scaleY,A=(h[o]+r.offsetX)*r.scaleX,S=(h[o+1]+r.offsetY)*r.scaleY;if(!(m>=S))for(var k,C,x,P,w,T,R,E,O=p[l],I=p[l+1],D=p[l+2],M=p[c],L=p[c+1],j=p[c+2],N=p[u],B=p[u+1],G=p[u+2],U=Math.round(m),W=Math.round(S),H=U;H<=W;H++){if(H<b){var q=void 0;k=g-(g-_)*(q=H<m?0:(m-H)/(m-b));C=O-(O-M)*q;x=I-(I-L)*q;P=D-(D-j)*q}else{var V=void 0;k=_-(_-A)*(V=H>S?1:b===S?0:(b-H)/(b-S));C=M-(M-N)*V;x=L-(L-B)*V;P=j-(j-G)*V}var z=void 0;w=g-(g-A)*(z=H<m?0:H>S?1:(m-H)/(m-S));T=O-(O-N)*z;R=I-(I-B)*z;E=D-(D-G)*z;for(var X=Math.round(Math.min(k,w)),Y=Math.round(Math.max(k,w)),K=y*H+4*X,J=X;J<=Y;J++){(z=(k-J)/(k-w))<0?z=0:z>1&&(z=1);v[K++]=C-(C-T)*z|0;v[K++]=x-(x-R)*z|0;v[K++]=P-(P-E)*z|0;v[K++]=255}}}function drawFigure(t,r,a){var i,o,l=r.coords,c=r.colors;switch(r.type){case"lattice":var u=r.verticesPerRow,d=Math.floor(l.length/u)-1,h=u-1;for(i=0;i<d;i++)for(var p=i*u,v=0;v<h;v++,p++){drawTriangle(t,a,l[p],l[p+1],l[p+u],c[p],c[p+1],c[p+u]);drawTriangle(t,a,l[p+u+1],l[p+1],l[p+u],c[p+u+1],c[p+1],c[p+u])}break;case"triangles":for(i=0,o=l.length;i<o;i+=3)drawTriangle(t,a,l[i],l[i+1],l[i+2],c[i],c[i+1],c[i+2]);break;default:throw new Error("illegal figure")}}var u=function(t){_inherits(MeshShadingPattern,t);var r=_createSuper(MeshShadingPattern);function MeshShadingPattern(t){var a;_classCallCheck(this,MeshShadingPattern);(a=r.call(this))._coords=t[2];a._colors=t[3];a._figures=t[4];a._bounds=t[5];a._bbox=t[7];a._background=t[8];a.matrix=null;return a}_createClass(MeshShadingPattern,[{key:"_createMeshCanvas",value:function _createMeshCanvas(t,r,a){var i=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),l=Math.ceil(this._bounds[2])-i,c=Math.ceil(this._bounds[3])-o,u=Math.min(Math.ceil(Math.abs(l*t[0]*1.1)),3e3),d=Math.min(Math.ceil(Math.abs(c*t[1]*1.1)),3e3),h=l/u,p=c/d,v={coords:this._coords,colors:this._colors,offsetX:-i,offsetY:-o,scaleX:1/h,scaleY:1/p},y=u+4,g=d+4,m=a.getCanvas("mesh",y,g,!1),_=m.context,b=_.createImageData(u,d);if(r)for(var A=b.data,S=0,k=A.length;S<k;S+=4){A[S]=r[0];A[S+1]=r[1];A[S+2]=r[2];A[S+3]=255}var C,x=_createForOfIteratorHelper(this._figures);try{for(x.s();!(C=x.n()).done;){drawFigure(b,C.value,v)}}catch(t){x.e(t)}finally{x.f()}_.putImageData(b,2,2);return{canvas:m.canvas,offsetX:i-2*h,offsetY:o-2*p,scaleX:h,scaleY:p}}},{key:"getPattern",value:function getPattern(t,r,a,l){applyBoundingBox(t,this._bbox);var c;if(l===o.SHADING)c=i.Util.singularValueDecompose2dScale(t.mozCurrentTransform);else{c=i.Util.singularValueDecompose2dScale(r.baseTransform);if(this.matrix){var u=i.Util.singularValueDecompose2dScale(this.matrix);c=[c[0]*u[0],c[1]*u[1]]}}var d=this._createMeshCanvas(c,l===o.SHADING?null:this._background,r.cachedCanvases);if(l!==o.SHADING){t.setTransform.apply(t,r.baseTransform);this.matrix&&t.transform.apply(t,this.matrix)}t.translate(d.offsetX,d.offsetY);t.scale(d.scaleX,d.scaleY);return t.createPattern(d.canvas,"no-repeat")}}]);return MeshShadingPattern}(l),d=function(t){_inherits(DummyShadingPattern,t);var r=_createSuper(DummyShadingPattern);function DummyShadingPattern(){_classCallCheck(this,DummyShadingPattern);return r.apply(this,arguments)}_createClass(DummyShadingPattern,[{key:"getPattern",value:function getPattern(){return"hotpink"}}]);return DummyShadingPattern}(l);var h=1,p=2,v=function(){function TilingPattern(t,r,a,i,o){_classCallCheck(this,TilingPattern);this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=r;this.ctx=a;this.canvasGraphicsFactory=i;this.baseTransform=o}_createClass(TilingPattern,[{key:"createPatternCanvas",value:function createPatternCanvas(t){var r=this.operatorList,a=this.bbox,o=this.xstep,l=this.ystep,c=this.paintType,u=this.tilingType,d=this.color,h=this.canvasGraphicsFactory;(0,i.info)("TilingType: "+u);var p=a[0],v=a[1],y=a[2],g=a[3],m=i.Util.singularValueDecompose2dScale(this.matrix),_=i.Util.singularValueDecompose2dScale(this.baseTransform),b=[m[0]*_[0],m[1]*_[1]],A=this.getSizeAndScale(o,this.ctx.canvas.width,b[0]),S=this.getSizeAndScale(l,this.ctx.canvas.height,b[1]),k=t.cachedCanvases.getCanvas("pattern",A.size,S.size,!0),C=k.context,x=h.createCanvasGraphics(C);x.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(x,c,d);var P=p,w=v,T=y,R=g;if(p<0){P=0;T+=Math.abs(p)}if(v<0){w=0;R+=Math.abs(v)}C.translate(-A.scale*P,-S.scale*w);x.transform(A.scale,0,0,S.scale,0,0);C.save();this.clipBbox(x,P,w,T,R);x.baseTransform=x.ctx.mozCurrentTransform.slice();x.executeOperatorList(r);x.endDrawing();return{canvas:k.canvas,scaleX:A.scale,scaleY:S.scale,offsetX:P,offsetY:w}}},{key:"getSizeAndScale",value:function getSizeAndScale(t,r,a){t=Math.abs(t);var i=Math.max(TilingPattern.MAX_PATTERN_SIZE,r),o=Math.ceil(t*a);o>=i?o=i:a=o/t;return{scale:a,size:o}}},{key:"clipBbox",value:function clipBbox(t,r,a,i,o){var l=i-r,c=o-a;t.ctx.rect(r,a,l,c);t.clip();t.endPath()}},{key:"setFillAndStrokeStyleToContext",value:function setFillAndStrokeStyleToContext(t,r,a){var o=t.ctx,l=t.current;switch(r){case h:var c=this.ctx;o.fillStyle=c.fillStyle;o.strokeStyle=c.strokeStyle;l.fillColor=c.fillStyle;l.strokeColor=c.strokeStyle;break;case p:var u=i.Util.makeHexColor(a[0],a[1],a[2]);o.fillStyle=u;o.strokeStyle=u;l.fillColor=u;l.strokeColor=u;break;default:throw new i.FormatError("Unsupported paint type: ".concat(r))}}},{key:"getPattern",value:function getPattern(t,r,a,l){var c=a;if(l!==o.SHADING){c=i.Util.transform(c,r.baseTransform);this.matrix&&(c=i.Util.transform(c,this.matrix))}var u=this.createPatternCanvas(r),d=new DOMMatrix(c);d=(d=d.translate(u.offsetX,u.offsetY)).scale(1/u.scaleX,1/u.scaleY);var h=t.createPattern(u.canvas,"repeat");try{h.setTransform(d)}catch(t){(0,i.warn)('TilingPattern.getPattern: "'.concat(null==t?void 0:t.message,'".'))}return h}}],[{key:"MAX_PATTERN_SIZE",get:function get(){return(0,i.shadow)(this,"MAX_PATTERN_SIZE",3e3)}}]);return TilingPattern}();r.TilingPattern=v},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.GlobalWorkerOptions=void 0;var a=Object.create(null);r.GlobalWorkerOptions=a;a.workerPort=void 0===a.workerPort?null:a.workerPort;a.workerSrc=void 0===a.workerSrc?"":a.workerSrc},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MessageHandler=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1);function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var l=1,c=2,u=1,d=2,h=3,p=4,v=5,y=6,g=7,m=8;function wrapReason(t){t instanceof Error||"object"===_typeof(t)&&null!==t||(0,o.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new o.AbortException(t.message);case"MissingPDFException":return new o.MissingPDFException(t.message);case"PasswordException":return new o.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new o.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new o.UnknownErrorException(t.message,t.details);default:return new o.UnknownErrorException(t.message,t.toString())}}var _=function(){function MessageHandler(t,r,a){var i=this;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MessageHandler);this.sourceName=t;this.targetName=r;this.comObj=a;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=function(t){var r=t.data;if(r.targetName===i.sourceName)if(r.stream)i._processStreamMessage(r);else if(r.callback){var o=r.callbackId,u=i.callbackCapabilities[o];if(!u)throw new Error("Cannot resolve callback ".concat(o));delete i.callbackCapabilities[o];if(r.callback===l)u.resolve(r.data);else{if(r.callback!==c)throw new Error("Unexpected callback case");u.reject(wrapReason(r.reason))}}else{var d=i.actionHandler[r.action];if(!d)throw new Error("Unknown action from worker: ".concat(r.action));if(r.callbackId){var h=i.sourceName,p=r.sourceName;new Promise((function(t){t(d(r.data))})).then((function(t){a.postMessage({sourceName:h,targetName:p,callback:l,callbackId:r.callbackId,data:t})}),(function(t){a.postMessage({sourceName:h,targetName:p,callback:c,callbackId:r.callbackId,reason:wrapReason(t)})}))}else r.streamId?i._createStreamSink(r):d(r.data)}};a.addEventListener("message",this._onComObjOnMessage)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(MessageHandler,[{key:"on",value:function on(t,r){var a=this.actionHandler;if(a[t])throw new Error('There is already an actionName called "'.concat(t,'"'));a[t]=r}},{key:"send",value:function send(t,r,a){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},a)}},{key:"sendWithPromise",value:function sendWithPromise(t,r,a){var i=this.callbackId++,l=(0,o.createPromiseCapability)();this.callbackCapabilities[i]=l;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:i,data:r},a)}catch(t){l.reject(t)}return l.promise}},{key:"sendWithStream",value:function sendWithStream(t,r,a,i){var l=this,c=this.streamId++,d=this.sourceName,h=this.targetName,p=this.comObj;return new ReadableStream({start:function start(a){var u=(0,o.createPromiseCapability)();l.streamControllers[c]={controller:a,startCall:u,pullCall:null,cancelCall:null,isClosed:!1};p.postMessage({sourceName:d,targetName:h,action:t,streamId:c,data:r,desiredSize:a.desiredSize},i);return u.promise},pull:function pull(t){var r=(0,o.createPromiseCapability)();l.streamControllers[c].pullCall=r;p.postMessage({sourceName:d,targetName:h,stream:y,streamId:c,desiredSize:t.desiredSize});return r.promise},cancel:function cancel(t){(0,o.assert)(t instanceof Error,"cancel must have a valid reason");var r=(0,o.createPromiseCapability)();l.streamControllers[c].cancelCall=r;l.streamControllers[c].isClosed=!0;p.postMessage({sourceName:d,targetName:h,stream:u,streamId:c,reason:wrapReason(t)});return r.promise}},a)}},{key:"_createStreamSink",value:function _createStreamSink(t){var r=t.streamId,a=this.sourceName,i=t.sourceName,l=this.comObj,c=this,u=this.actionHandler[t.action],d={enqueue:function enqueue(t){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var d=this.desiredSize;this.desiredSize-=c;if(d>0&&this.desiredSize<=0){this.sinkCapability=(0,o.createPromiseCapability)();this.ready=this.sinkCapability.promise}l.postMessage({sourceName:a,targetName:i,stream:p,streamId:r,chunk:t},u)}},close:function close(){if(!this.isCancelled){this.isCancelled=!0;l.postMessage({sourceName:a,targetName:i,stream:h,streamId:r});delete c.streamSinks[r]}},error:function error(t){(0,o.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;l.postMessage({sourceName:a,targetName:i,stream:v,streamId:r,reason:wrapReason(t)})}},sinkCapability:(0,o.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};d.sinkCapability.resolve();d.ready=d.sinkCapability.promise;this.streamSinks[r]=d;new Promise((function(r){r(u(t.data,d))})).then((function(){l.postMessage({sourceName:a,targetName:i,stream:m,streamId:r,success:!0})}),(function(t){l.postMessage({sourceName:a,targetName:i,stream:m,streamId:r,reason:wrapReason(t)})}))}},{key:"_processStreamMessage",value:function _processStreamMessage(t){var r=t.streamId,a=this.sourceName,i=t.sourceName,l=this.comObj,c=this.streamControllers[r],_=this.streamSinks[r];switch(t.stream){case m:t.success?c.startCall.resolve():c.startCall.reject(wrapReason(t.reason));break;case g:t.success?c.pullCall.resolve():c.pullCall.reject(wrapReason(t.reason));break;case y:if(!_){l.postMessage({sourceName:a,targetName:i,stream:g,streamId:r,success:!0});break}_.desiredSize<=0&&t.desiredSize>0&&_.sinkCapability.resolve();_.desiredSize=t.desiredSize;new Promise((function(t){t(_.onPull&&_.onPull())})).then((function(){l.postMessage({sourceName:a,targetName:i,stream:g,streamId:r,success:!0})}),(function(t){l.postMessage({sourceName:a,targetName:i,stream:g,streamId:r,reason:wrapReason(t)})}));break;case p:(0,o.assert)(c,"enqueue should have stream controller");if(c.isClosed)break;c.controller.enqueue(t.chunk);break;case h:(0,o.assert)(c,"close should have stream controller");if(c.isClosed)break;c.isClosed=!0;c.controller.close();this._deleteStreamController(c,r);break;case v:(0,o.assert)(c,"error should have stream controller");c.controller.error(wrapReason(t.reason));this._deleteStreamController(c,r);break;case d:t.success?c.cancelCall.resolve():c.cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(c,r);break;case u:if(!_)break;new Promise((function(r){r(_.onCancel&&_.onCancel(wrapReason(t.reason)))})).then((function(){l.postMessage({sourceName:a,targetName:i,stream:d,streamId:r,success:!0})}),(function(t){l.postMessage({sourceName:a,targetName:i,stream:d,streamId:r,reason:wrapReason(t)})}));_.sinkCapability.reject(wrapReason(t.reason));_.isCancelled=!0;delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:(t=function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}(i.default.mark((function _callee(t,r){return i.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:a.next=2;return Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]);case 2:delete this.streamControllers[r];case 3:case"end":return a.stop()}}),_callee,this)}))),function _deleteStreamController(r,a){return t.apply(this,arguments)})},{key:"destroy",value:function destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]);var t;return MessageHandler}();r.MessageHandler=_},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Metadata=void 0;var i=a(1);function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _classPrivateFieldInitSpec(t,r,a){!function _checkPrivateRedeclaration(t,r){if(r.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,r);r.set(t,a)}function _classPrivateFieldGet(t,r){return function _classApplyDescriptorGet(t,r){if(r.get)return r.get.call(t);return r.value}(t,_classExtractFieldDescriptor(t,r,"get"))}function _classPrivateFieldSet(t,r,a){!function _classApplyDescriptorSet(t,r,a){if(r.set)r.set.call(t,a);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=a}}(t,_classExtractFieldDescriptor(t,r,"set"),a);return a}function _classExtractFieldDescriptor(t,r,a){if(!r.has(t))throw new TypeError("attempted to "+a+" private field on non-instance");return r.get(t)}var o=new WeakMap,l=new WeakMap,c=function(){function Metadata(t){var r=t.parsedData,a=t.rawData;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Metadata);_classPrivateFieldInitSpec(this,o,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,l,{writable:!0,value:void 0});_classPrivateFieldSet(this,o,r);_classPrivateFieldSet(this,l,a)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(Metadata,[{key:"getRaw",value:function getRaw(){return _classPrivateFieldGet(this,l)}},{key:"get",value:function get(t){var r;return null!==(r=_classPrivateFieldGet(this,o).get(t))&&void 0!==r?r:null}},{key:"getAll",value:function getAll(){return(0,i.objectFromMap)(_classPrivateFieldGet(this,o))}},{key:"has",value:function has(t){return _classPrivateFieldGet(this,o).has(t)}}]);return Metadata}();r.Metadata=c},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OptionalContentConfig=void 0;var i=a(1);function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var o=_createClass((function OptionalContentGroup(t,r){_classCallCheck(this,OptionalContentGroup);this.visible=!0;this.name=t;this.intent=r})),l=function(){function OptionalContentConfig(t){_classCallCheck(this,OptionalContentConfig);this.name=null;this.creator=null;this._order=null;this._groups=new Map;if(null!==t){this.name=t.name;this.creator=t.creator;this._order=t.order;var r,a=_createForOfIteratorHelper(t.groups);try{for(a.s();!(r=a.n()).done;){var i=r.value;this._groups.set(i.id,new o(i.name,i.intent))}}catch(t){a.e(t)}finally{a.f()}if("OFF"===t.baseState){var l,c=_createForOfIteratorHelper(this._groups);try{for(c.s();!(l=c.n()).done;){l.value.visible=!1}}catch(t){c.e(t)}finally{c.f()}}var u,d=_createForOfIteratorHelper(t.on);try{for(d.s();!(u=d.n()).done;){var h=u.value;this._groups.get(h).visible=!0}}catch(t){d.e(t)}finally{d.f()}var p,v=_createForOfIteratorHelper(t.off);try{for(v.s();!(p=v.n()).done;){var y=p.value;this._groups.get(y).visible=!1}}catch(t){v.e(t)}finally{v.f()}}}_createClass(OptionalContentConfig,[{key:"_evaluateVisibilityExpression",value:function _evaluateVisibilityExpression(t){var r=t.length;if(r<2)return!0;for(var a=t[0],o=1;o<r;o++){var l=t[o],c=void 0;if(Array.isArray(l))c=this._evaluateVisibilityExpression(l);else{if(!this._groups.has(l)){(0,i.warn)("Optional content group not found: ".concat(l));return!0}c=this._groups.get(l).visible}switch(a){case"And":if(!c)return!1;break;case"Or":if(c)return!0;break;case"Not":return!c;default:return!0}}return"And"===a}},{key:"isVisible",value:function isVisible(t){if(0===this._groups.size)return!0;if(!t){(0,i.warn)("Optional content group not defined.");return!0}if("OCG"===t.type){if(!this._groups.has(t.id)){(0,i.warn)("Optional content group not found: ".concat(t.id));return!0}return this._groups.get(t.id).visible}if("OCMD"===t.type){if(t.expression)return this._evaluateVisibilityExpression(t.expression);if(!t.policy||"AnyOn"===t.policy){var r,a=_createForOfIteratorHelper(t.ids);try{for(a.s();!(r=a.n()).done;){var o=r.value;if(!this._groups.has(o)){(0,i.warn)("Optional content group not found: ".concat(o));return!0}if(this._groups.get(o).visible)return!0}}catch(t){a.e(t)}finally{a.f()}return!1}if("AllOn"===t.policy){var l,c=_createForOfIteratorHelper(t.ids);try{for(c.s();!(l=c.n()).done;){var u=l.value;if(!this._groups.has(u)){(0,i.warn)("Optional content group not found: ".concat(u));return!0}if(!this._groups.get(u).visible)return!1}}catch(t){c.e(t)}finally{c.f()}return!0}if("AnyOff"===t.policy){var d,h=_createForOfIteratorHelper(t.ids);try{for(h.s();!(d=h.n()).done;){var p=d.value;if(!this._groups.has(p)){(0,i.warn)("Optional content group not found: ".concat(p));return!0}if(!this._groups.get(p).visible)return!0}}catch(t){h.e(t)}finally{h.f()}return!1}if("AllOff"===t.policy){var v,y=_createForOfIteratorHelper(t.ids);try{for(y.s();!(v=y.n()).done;){var g=v.value;if(!this._groups.has(g)){(0,i.warn)("Optional content group not found: ".concat(g));return!0}if(this._groups.get(g).visible)return!1}}catch(t){y.e(t)}finally{y.f()}return!0}(0,i.warn)("Unknown optional content policy ".concat(t.policy,"."));return!0}(0,i.warn)("Unknown group type ".concat(t.type,"."));return!0}},{key:"setVisibility",value:function setVisibility(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._groups.has(t)?this._groups.get(t).visible=!!r:(0,i.warn)("Optional content group not found: ".concat(t))}},{key:"getOrder",value:function getOrder(){return this._groups.size?this._order?this._order.slice():Array.from(this._groups.keys()):null}},{key:"getGroups",value:function getGroups(){return this._groups.size>0?(0,i.objectFromMap)(this._groups):null}},{key:"getGroup",value:function getGroup(t){return this._groups.get(t)||null}}]);return OptionalContentConfig}();r.OptionalContentConfig=l},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFDataTransportStream=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1),l=a(146);function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var c=function(){function PDFDataTransportStream(t,r){var a=this;_classCallCheck(this,PDFDataTransportStream);(0,o.assert)(r,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=t.progressiveDone||!1;this._contentDispositionFilename=t.contentDispositionFilename||null;var i=t.initialData;if((null==i?void 0:i.length)>0){var l=new Uint8Array(i).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=r;this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._contentLength=t.length;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener((function(t,r){a._onReceiveData({begin:t,chunk:r})}));this._pdfDataRangeTransport.addProgressListener((function(t,r){a._onProgress({loaded:t,total:r})}));this._pdfDataRangeTransport.addProgressiveReadListener((function(t){a._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((function(){a._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_createClass(PDFDataTransportStream,[{key:"_onReceiveData",value:function _onReceiveData(t){var r=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{var a=this._rangeReaders.some((function(a){if(a._begin!==t.begin)return!1;a._enqueue(r);return!0}));(0,o.assert)(a,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}},{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"_onProgress",value:function _onProgress(t){if(void 0===t.total){var r=this._rangeReaders[0];null!=r&&r.onProgress&&r.onProgress({loaded:t.loaded})}else{var a=this._fullRequestReader;null!=a&&a.onProgress&&a.onProgress({loaded:t.loaded,total:t.total})}}},{key:"_onProgressiveDone",value:function _onProgressiveDone(){this._fullRequestReader&&this._fullRequestReader.progressiveDone();this._progressiveDone=!0}},{key:"_removeRangeReader",value:function _removeRangeReader(t){var r=this._rangeReaders.indexOf(t);r>=0&&this._rangeReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var t=this._queuedChunks;this._queuedChunks=null;return new u(this,t,this._progressiveDone,this._contentDispositionFilename)}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new d(this,t,r);this._pdfDataRangeTransport.requestDataRange(t,r);this._rangeReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var r,a=_createForOfIteratorHelper(this._rangeReaders.slice(0));try{for(a.s();!(r=a.n()).done;){r.value.cancel(t)}}catch(t){a.e(t)}finally{a.f()}this._pdfDataRangeTransport.abort()}}]);return PDFDataTransportStream}();r.PDFDataTransportStream=c;var u=function(){function PDFDataTransportStreamReader(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_classCallCheck(this,PDFDataTransportStreamReader);this._stream=t;this._done=a||!1;this._filename=(0,l.isPdfFile)(i)?i:null;this._queuedChunks=r||[];this._loaded=0;var o,c=_createForOfIteratorHelper(this._queuedChunks);try{for(c.s();!(o=c.n()).done;){var u=o.value;this._loaded+=u.byteLength}}catch(t){c.e(t)}finally{c.f()}this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_createClass(PDFDataTransportStreamReader,[{key:"_enqueue",value:function _enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}},{key:"headersReady",get:function get(){return this._headersReady}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._stream._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._stream._isStreamingSupported}},{key:"contentLength",get:function get(){return this._stream._contentLength}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee(){var t,r;return i.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!(this._queuedChunks.length>0)){a.next=3;break}t=this._queuedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 3:if(!this._done){a.next=5;break}return a.abrupt("return",{value:void 0,done:!0});case 5:r=(0,o.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 8:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}},{key:"progressiveDone",value:function progressiveDone(){this._done||(this._done=!0)}}]);var t;return PDFDataTransportStreamReader}(),d=function(){function PDFDataTransportStreamRangeReader(t,r,a){_classCallCheck(this,PDFDataTransportStreamRangeReader);this._stream=t;this._begin=r;this._end=a;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_createClass(PDFDataTransportStreamRangeReader,[{key:"_enqueue",value:function _enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}},{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee2(){var t,r;return i.default.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._queuedChunk){a.next=4;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 4:if(!this._done){a.next=6;break}return a.abrupt("return",{value:void 0,done:!0});case 6:r=(0,o.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 9:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._stream._removeRangeReader(this)}}]);var t;return PDFDataTransportStreamRangeReader}()},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.XfaText=void 0;function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}var a=function(){function XfaText(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XfaText)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(XfaText,null,[{key:"textContent",value:function textContent(t){var r=[],a={items:r,styles:Object.create(null)};!function walk(t){var a;if(t){var i=null,o=t.name;if("#text"===o)i=t.value;else{if(!XfaText.shouldBuildText(o))return;null!=t&&null!==(a=t.attributes)&&void 0!==a&&a.textContent?i=t.attributes.textContent:t.value&&(i=t.value)}null!==i&&r.push({str:i});if(t.children){var l,c=_createForOfIteratorHelper(t.children);try{for(c.s();!(l=c.n()).done;){walk(l.value)}}catch(t){c.e(t)}finally{c.f()}}}}(t);return a}},{key:"shouldBuildText",value:function shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}]);return XfaText}();r.XfaText=a},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.AnnotationLayer=void 0;var i=a(1),o=a(146),l=a(150),c=a(160),u=a(161);function _classStaticPrivateMethodGet(t,r,a){!function _classCheckPrivateStaticAccess(t,r){if(t!==r)throw new TypeError("Private static access of wrong provenance")}(t,r);return a}function _get(){_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,a){var i=_superPropBase(t,r);if(i){var o=Object.getOwnPropertyDescriptor(i,r);return o.get?o.get.call(arguments.length<3?t:a):o.value}};return _get.apply(this,arguments)}function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}function _defineProperty(t,r,a){r in t?Object.defineProperty(t,r,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[r]=a;return t}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var d=1e3,h=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}var p=function(){function AnnotationElementFactory(){_classCallCheck(this,AnnotationElementFactory)}_createClass(AnnotationElementFactory,null,[{key:"create",value:function create(t){switch(t.data.annotationType){case i.AnnotationType.LINK:return new y(t);case i.AnnotationType.TEXT:return new g(t);case i.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new _(t);case"Btn":return t.data.radioButton?new A(t):t.data.checkBox?new b(t):new S(t);case"Ch":return new k(t)}return new m(t);case i.AnnotationType.POPUP:return new C(t);case i.AnnotationType.FREETEXT:return new P(t);case i.AnnotationType.LINE:return new w(t);case i.AnnotationType.SQUARE:return new T(t);case i.AnnotationType.CIRCLE:return new R(t);case i.AnnotationType.POLYLINE:return new E(t);case i.AnnotationType.CARET:return new I(t);case i.AnnotationType.INK:return new D(t);case i.AnnotationType.POLYGON:return new O(t);case i.AnnotationType.HIGHLIGHT:return new M(t);case i.AnnotationType.UNDERLINE:return new L(t);case i.AnnotationType.SQUIGGLY:return new j(t);case i.AnnotationType.STRIKEOUT:return new N(t);case i.AnnotationType.STAMP:return new B(t);case i.AnnotationType.FILEATTACHMENT:return new G(t);default:return new v(t)}}}]);return AnnotationElementFactory}(),v=function(){function AnnotationElement(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.isRenderable,i=void 0!==a&&a,o=r.ignoreBorder,l=void 0!==o&&o,c=r.createQuadrilaterals,u=void 0!==c&&c;_classCallCheck(this,AnnotationElement);this.isRenderable=i;this.data=t.data;this.layer=t.layer;this.page=t.page;this.viewport=t.viewport;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._mouseState=t.mouseState;i&&(this.container=this._createContainer(l));u&&(this.quadrilaterals=this._createQuadrilaterals(l))}_createClass(AnnotationElement,[{key:"_createContainer",value:function _createContainer(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.data,a=this.page,o=this.viewport,l=document.createElement("section"),c=getRectDims(r.rect),u=c.width,d=c.height;l.setAttribute("data-annotation-id",r.id);var h=i.Util.normalizeRect([r.rect[0],a.view[3]-r.rect[1]+a.view[1],r.rect[2],a.view[3]-r.rect[3]+a.view[1]]);if(r.hasOwnCanvas){var p=o.transform.slice(),v=i.Util.singularValueDecompose2dScale(p),y=_slicedToArray(v,2),g=y[0],m=y[1];u=Math.ceil(u*g);d=Math.ceil(d*m);h[0]*=g;h[1]*=m;for(var _=0;_<4;_++)p[_]=Math.sign(p[_]);l.style.transform="matrix(".concat(p.join(","),")")}else l.style.transform="matrix(".concat(o.transform.join(","),")");l.style.transformOrigin="".concat(-h[0],"px ").concat(-h[1],"px");if(!t&&r.borderStyle.width>0){l.style.borderWidth="".concat(r.borderStyle.width,"px");if(r.borderStyle.style!==i.AnnotationBorderStyleType.UNDERLINE){u-=2*r.borderStyle.width;d-=2*r.borderStyle.width}var b=r.borderStyle.horizontalCornerRadius,A=r.borderStyle.verticalCornerRadius;if(b>0||A>0){var S="".concat(b,"px / ").concat(A,"px");l.style.borderRadius=S}switch(r.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:l.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:l.style.borderStyle="dashed";break;case i.AnnotationBorderStyleType.BEVELED:(0,i.warn)("Unimplemented border style: beveled");break;case i.AnnotationBorderStyleType.INSET:(0,i.warn)("Unimplemented border style: inset");break;case i.AnnotationBorderStyleType.UNDERLINE:l.style.borderBottomStyle="solid"}var k=r.borderColor||r.color||null;k?l.style.borderColor=i.Util.makeHexColor(0|r.color[0],0|r.color[1],0|r.color[2]):l.style.borderWidth=0}l.style.left="".concat(h[0],"px");l.style.top="".concat(h[1],"px");if(r.hasOwnCanvas)l.style.width=l.style.height="auto";else{l.style.width="".concat(u,"px");l.style.height="".concat(d,"px")}return l}},{key:"_createQuadrilaterals",value:function _createQuadrilaterals(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;var r,a=[],i=this.data.rect,o=_createForOfIteratorHelper(this.data.quadPoints);try{for(o.s();!(r=o.n()).done;){var l=r.value;this.data.rect=[l[2].x,l[2].y,l[1].x,l[1].y];a.push(this._createContainer(t))}}catch(t){o.e(t)}finally{o.f()}this.data.rect=i;return a}},{key:"_createPopup",value:function _createPopup(t,r){var a=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;a=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).style.height=a.style.height;t.style.width=a.style.width;a.appendChild(t)}var i=new x({container:a,trigger:t,color:r.color,titleObj:r.titleObj,modificationDate:r.modificationDate,contentsObj:r.contentsObj,richText:r.richText,hideWrapper:!0}).render();i.style.left=a.style.width;a.appendChild(i)}},{key:"_renderQuadrilaterals",value:function _renderQuadrilaterals(t){var r,a=_createForOfIteratorHelper(this.quadrilaterals);try{for(a.s();!(r=a.n()).done;){r.value.className=t}}catch(t){a.e(t)}finally{a.f()}return this.quadrilaterals}},{key:"render",value:function render(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")}},{key:"_getElementsByName",value:function _getElementsByName(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=[];if(this._fieldObjects){var o=this._fieldObjects[t];if(o){var l,c=_createForOfIteratorHelper(o);try{for(c.s();!(l=c.n()).done;){var u=l.value,d=u.page,p=u.id,v=u.exportValues;if(-1!==d&&p!==r){var y="string"==typeof v?v:null,g=document.getElementById(p);!g||h.has(g)?a.push({id:p,exportValue:y,domElement:g}):(0,i.warn)("_getElementsByName - element not allowed: ".concat(p))}}}catch(t){c.e(t)}finally{c.f()}}return a}var m,_=_createForOfIteratorHelper(document.getElementsByName(t));try{for(_.s();!(m=_.n()).done;){var b=m.value,A=b.id,S=b.exportValue;A!==r&&(h.has(b)&&a.push({id:A,exportValue:S,domElement:b}))}}catch(t){_.e(t)}finally{_.f()}return a}}],[{key:"platform",get:function get(){var t="undefined"!=typeof navigator?navigator.platform:"";return(0,i.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}]);return AnnotationElement}(),y=function(t){_inherits(LinkAnnotationElement,t);var r=_createSuper(LinkAnnotationElement);function LinkAnnotationElement(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,LinkAnnotationElement);var i=!!(t.data.url||t.data.dest||t.data.action||t.data.isTooltipOnly||t.data.resetForm||t.data.actions&&(t.data.actions.Action||t.data.actions["Mouse Up"]||t.data.actions["Mouse Down"]));return r.call(this,t,{isRenderable:i,ignoreBorder:!(null==a||!a.ignoreBorder),createQuadrilaterals:!0})}_createClass(LinkAnnotationElement,[{key:"render",value:function render(){var t=this.data,r=this.linkService,a=document.createElement("a");if(t.url)r.addLinkAttributes(a,t.url,t.newWindow);else if(t.action)this._bindNamedAction(a,t.action);else if(t.dest)this._bindLink(a,t.dest);else{var i=!1;if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){i=!0;this._bindJSAction(a,t)}t.resetForm?this._bindResetFormAction(a,t.resetForm):i||this._bindLink(a,"")}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map((function(t,r){var i=0===r?a:a.cloneNode();t.appendChild(i);return t}));this.container.className="linkAnnotation";this.container.appendChild(a);return this.container}},{key:"_bindLink",value:function _bindLink(t,r){var a=this;t.href=this.linkService.getDestinationHash(r);t.onclick=function(){r&&a.linkService.goToDestination(r);return!1};(r||""===r)&&(t.className="internalLink")}},{key:"_bindNamedAction",value:function _bindNamedAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");t.onclick=function(){a.linkService.executeNamedAction(r);return!1};t.className="internalLink"}},{key:"_bindJSAction",value:function _bindJSAction(t,r){var a=this;t.href=this.linkService.getAnchorUrl("");for(var i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]),o=function _loop(){var o=c[l],u=i.get(o);if(!u)return"continue";t[u]=function(){var t;null===(t=a.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:a,detail:{id:r.id,name:o}});return!1}},l=0,c=Object.keys(r.actions);l<c.length;l++)o();t.onclick||(t.onclick=function(){return!1});t.className="internalLink"}},{key:"_bindResetFormAction",value:function _bindResetFormAction(t,r){var a=this,o=t.onclick;o||(t.href=this.linkService.getAnchorUrl(""));t.className="internalLink";if(this._fieldObjects)t.onclick=function(){o&&o();var t=r.fields,i=r.refs,l=r.include,c=[];if(0!==t.length||0!==i.length){var u,d=new Set(i),p=_createForOfIteratorHelper(t);try{for(p.s();!(u=p.n()).done;){var v,y=u.value,g=_createForOfIteratorHelper(a._fieldObjects[y]||[]);try{for(g.s();!(v=g.n()).done;){var m=v.value.id;d.add(m)}}catch(t){g.e(t)}finally{g.f()}}}catch(t){p.e(t)}finally{p.f()}for(var _=0,b=Object.values(a._fieldObjects);_<b.length;_++){var A,S=_createForOfIteratorHelper(b[_]);try{for(S.s();!(A=S.n()).done;){var k=A.value;d.has(k.id)===l&&c.push(k)}}catch(t){S.e(t)}finally{S.f()}}}else for(var C=0,x=Object.values(a._fieldObjects);C<x.length;C++){var P=x[C];c.push.apply(c,_toConsumableArray(P))}for(var w=a.annotationStorage,T=[],R=0,E=c;R<E.length;R++){var O=E[R],I=O.id;T.push(I);switch(O.type){case"text":var D=O.defaultValue||"";w.setValue(I,{value:D,valueAsString:D});break;case"checkbox":case"radiobutton":var M=O.defaultValue===O.exportValues;w.setValue(I,{value:M});break;case"combobox":case"listbox":var L=O.defaultValue||"";w.setValue(I,{value:L});break;default:continue}var j=document.getElementById(I);j&&h.has(j)&&j.dispatchEvent(new Event("resetform"))}if(a.enableScripting){var N;null===(N=a.linkService.eventBus)||void 0===N||N.dispatch("dispatcheventinsandbox",{source:a,detail:{id:"app",ids:T,name:"ResetForm"}})}return!1};else{(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');o||(t.onclick=function(){return!1})}}}]);return LinkAnnotationElement}(v),g=function(t){_inherits(TextAnnotationElement,t);var r=_createSuper(TextAnnotationElement);function TextAnnotationElement(t){var a,i,o;_classCallCheck(this,TextAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l})}_createClass(TextAnnotationElement,[{key:"render",value:function render(){this.container.className="textAnnotation";var t=document.createElement("img");t.style.height=this.container.style.height;t.style.width=this.container.style.width;t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.hasPopup||this._createPopup(t,this.data);this.container.appendChild(t);return this.container}}]);return TextAnnotationElement}(v),m=function(t){_inherits(WidgetAnnotationElement,t);var r=_createSuper(WidgetAnnotationElement);function WidgetAnnotationElement(){_classCallCheck(this,WidgetAnnotationElement);return r.apply(this,arguments)}_createClass(WidgetAnnotationElement,[{key:"render",value:function render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}},{key:"_getKeyModifier",value:function _getKeyModifier(t){var r=v.platform,a=r.isWin,i=r.isMac;return a&&t.ctrlKey||i&&t.metaKey}},{key:"_setEventListener",value:function _setEventListener(t,r,a,i){var o=this;r.includes("mouse")?t.addEventListener(r,(function(t){var r;null===(r=o.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:o,detail:{id:o.data.id,name:a,value:i(t),shift:t.shiftKey,modifier:o._getKeyModifier(t)}})})):t.addEventListener(r,(function(t){var r;null===(r=o.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:o,detail:{id:o.data.id,name:a,value:i(t)}})}))}},{key:"_setEventListeners",value:function _setEventListeners(t,r,a){var i,o=_createForOfIteratorHelper(r);try{for(o.s();!(i=o.n()).done;){var l,c=_slicedToArray(i.value,2),u=c[0],d=c[1];("Action"===d||null!==(l=this.data.actions)&&void 0!==l&&l[d])&&this._setEventListener(t,u,d,a)}}catch(t){o.e(t)}finally{o.f()}}},{key:"_setBackgroundColor",value:function _setBackgroundColor(t){var r=this.data.backgroundColor||null;t.style.backgroundColor=null===r?"transparent":i.Util.makeHexColor(r[0],r[1],r[2])}},{key:"_dispatchEventFromSandbox",value:function _dispatchEventFromSandbox(t,r){for(var a=this,i=function setColor(t,r,a){var i=a.detail[t];a.target.style[r]=c.ColorConverters["".concat(i[0],"_HTML")](i.slice(1))},o={display:function display(t){var r=t.detail.display%2==1;t.target.style.visibility=r?"hidden":"visible";a.annotationStorage.setValue(a.data.id,{hidden:r,print:0===t.detail.display||3===t.detail.display})},print:function print(t){a.annotationStorage.setValue(a.data.id,{print:t.detail.print})},hidden:function hidden(t){t.target.style.visibility=t.detail.hidden?"hidden":"visible";a.annotationStorage.setValue(a.data.id,{hidden:t.detail.hidden})},focus:function focus(t){setTimeout((function(){return t.target.focus({preventScroll:!1})}),0)},userName:function userName(t){t.target.title=t.detail.userName},readonly:function readonly(t){t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:function required(t){t.detail.required?t.target.setAttribute("required",""):t.target.removeAttribute("required")},bgColor:function bgColor(t){i("bgColor","backgroundColor",t)},fillColor:function fillColor(t){i("fillColor","backgroundColor",t)},fgColor:function fgColor(t){i("fgColor","color",t)},textColor:function textColor(t){i("textColor","color",t)},borderColor:function borderColor(t){i("borderColor","borderColor",t)},strokeColor:function strokeColor(t){i("strokeColor","borderColor",t)}},l=0,u=Object.keys(r.detail);l<u.length;l++){var d=u[l],h=t[d]||o[d];h&&h(r)}}}]);return WidgetAnnotationElement}(v),_=function(t){_inherits(TextWidgetAnnotationElement,t);var r=_createSuper(TextWidgetAnnotationElement);function TextWidgetAnnotationElement(t){_classCallCheck(this,TextWidgetAnnotationElement);var a=t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue;return r.call(this,t,{isRenderable:a})}_createClass(TextWidgetAnnotationElement,[{key:"setPropertyOnSiblings",value:function setPropertyOnSiblings(t,r,a,i){var o,l=this.annotationStorage,c=_createForOfIteratorHelper(this._getElementsByName(t.name,t.id));try{for(c.s();!(o=c.n()).done;){var u=o.value;u.domElement&&(u.domElement[r]=a);l.setValue(u.id,_defineProperty({},i,a))}}catch(t){c.e(t)}finally{c.f()}}},{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data.id;this.container.className="textWidgetAnnotation";var i=null;if(this.renderForms){var o=r.getValue(a,{value:this.data.fieldValue,valueAsString:this.data.fieldValue}),l=o.valueAsString||o.value||"",c={userValue:null,formattedValue:null};if(this.data.multiLine)(i=document.createElement("textarea")).textContent=l;else{(i=document.createElement("input")).type="text";i.setAttribute("value",l)}h.add(i);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=d;c.userValue=l;i.setAttribute("id",a);i.addEventListener("input",(function(o){r.setValue(a,{value:o.target.value});t.setPropertyOnSiblings(i,"value",o.target.value,"value")}));i.addEventListener("resetform",(function(r){var a=t.data.defaultFieldValue||"";i.value=c.userValue=a;delete c.formattedValue}));var u=function blurListener(t){c.formattedValue&&(t.target.value=c.formattedValue);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var p;i.addEventListener("focus",(function(t){c.userValue&&(t.target.value=c.userValue)}));i.addEventListener("updatefromsandbox",(function(i){var o={value:function value(t){c.userValue=t.detail.value||"";r.setValue(a,{value:c.userValue.toString()});c.formattedValue||(t.target.value=c.userValue)},valueAsString:function valueAsString(t){c.formattedValue=t.detail.valueAsString||"";t.target!==document.activeElement&&(t.target.value=c.formattedValue);r.setValue(a,{formattedValue:c.formattedValue})},selRange:function selRange(t){var r=_slicedToArray(t.detail.selRange,2),a=r[0],i=r[1];a>=0&&i<t.target.value.length&&t.target.setSelectionRange(a,i)}};t._dispatchEventFromSandbox(o,i)}));i.addEventListener("keydown",(function(r){var i,o=-1;"Escape"===r.key?o=0:"Enter"===r.key?o=2:"Tab"===r.key&&(o=3);if(-1!==o){c.userValue=r.target.value;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:r.target.value,willCommit:!0,commitKey:o,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}}));var v=u;u=null;i.addEventListener("blur",(function(r){c.userValue=r.target.value;if(t._mouseState.isDown){var i;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:r.target.value,willCommit:!0,commitKey:1,selStart:r.target.selectionStart,selEnd:r.target.selectionEnd}})}v(r)}));null!==(p=this.data.actions)&&void 0!==p&&p.Keystroke&&i.addEventListener("beforeinput",(function(r){var i;c.formattedValue="";var o=r.data,l=r.target,u=l.value,d=l.selectionStart,h=l.selectionEnd;null===(i=t.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:u,change:o,willCommit:!1,selStart:d,selEnd:h}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.value}))}u&&i.addEventListener("blur",u);null!==this.data.maxLen&&(i.maxLength=this.data.maxLen);if(this.data.comb){var y=(this.data.rect[2]-this.data.rect[0])/this.data.maxLen;i.classList.add("comb");i.style.letterSpacing="calc(".concat(y,"px - 1ch)")}}else{(i=document.createElement("div")).textContent=this.data.fieldValue;i.style.verticalAlign="middle";i.style.display="table-cell"}this._setTextStyle(i);this._setBackgroundColor(i);this.container.appendChild(i);return this.container}},{key:"_setTextStyle",value:function _setTextStyle(t){var r=this.data.defaultAppearanceData,a=r.fontSize,o=r.fontColor,l=t.style;a&&(l.fontSize="".concat(a,"px"));l.color=i.Util.makeHexColor(o[0],o[1],o[2]);null!==this.data.textAlignment&&(l.textAlign=["left","center","right"][this.data.textAlignment])}}]);return TextWidgetAnnotationElement}(m),b=function(t){_inherits(CheckboxWidgetAnnotationElement,t);var r=_createSuper(CheckboxWidgetAnnotationElement);function CheckboxWidgetAnnotationElement(t){_classCallCheck(this,CheckboxWidgetAnnotationElement);return r.call(this,t,{isRenderable:t.renderForms})}_createClass(CheckboxWidgetAnnotationElement,[{key:"render",value:function render(){var t=this,r=this.annotationStorage,a=this.data,i=a.id,o=r.getValue(i,{value:a.exportValue===a.fieldValue}).value;if("string"==typeof o){o="Off"!==o;r.setValue(i,{value:o})}this.container.className="buttonWidgetAnnotation checkBox";var l=document.createElement("input");h.add(l);l.disabled=a.readOnly;l.type="checkbox";l.name=a.fieldName;o&&l.setAttribute("checked",!0);l.setAttribute("id",i);l.setAttribute("exportValue",a.exportValue);l.tabIndex=d;l.addEventListener("change",(function(o){var l,c=o.target,u=c.name,d=c.checked,h=_createForOfIteratorHelper(t._getElementsByName(u,i));try{for(h.s();!(l=h.n()).done;){var p=l.value,v=d&&p.exportValue===a.exportValue;p.domElement&&(p.domElement.checked=v);r.setValue(p.id,{value:v})}}catch(t){h.e(t)}finally{h.f()}r.setValue(i,{value:d})}));l.addEventListener("resetform",(function(t){var r=a.defaultFieldValue||"Off";t.target.checked=r===a.exportValue}));if(this.enableScripting&&this.hasJSActions){l.addEventListener("updatefromsandbox",(function(a){var o={value:function value(t){t.target.checked="Off"!==t.detail.value;r.setValue(i,{value:t.target.checked})}};t._dispatchEventFromSandbox(o,a)}));this._setEventListeners(l,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this._setBackgroundColor(l);this.container.appendChild(l);return this.container}}]);return CheckboxWidgetAnnotationElement}(m),A=function(t){_inherits(RadioButtonWidgetAnnotationElement,t);var r=_createSuper(RadioButtonWidgetAnnotationElement);function RadioButtonWidgetAnnotationElement(t){_classCallCheck(this,RadioButtonWidgetAnnotationElement);return r.call(this,t,{isRenderable:t.renderForms})}_createClass(RadioButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.className="buttonWidgetAnnotation radioButton";var r=this.annotationStorage,a=this.data,i=a.id,o=r.getValue(i,{value:a.fieldValue===a.buttonValue}).value;if("string"==typeof o){o=o!==a.buttonValue;r.setValue(i,{value:o})}var l=document.createElement("input");h.add(l);l.disabled=a.readOnly;l.type="radio";l.name=a.fieldName;o&&l.setAttribute("checked",!0);l.setAttribute("id",i);l.tabIndex=d;l.addEventListener("change",(function(a){var o,l=a.target,c=l.name,u=l.checked,d=_createForOfIteratorHelper(t._getElementsByName(c,i));try{for(d.s();!(o=d.n()).done;){var h=o.value;r.setValue(h.id,{value:!1})}}catch(t){d.e(t)}finally{d.f()}r.setValue(i,{value:u})}));l.addEventListener("resetform",(function(t){var r=a.defaultFieldValue;t.target.checked=null!=r&&r===a.buttonValue}));if(this.enableScripting&&this.hasJSActions){var c=a.buttonValue;l.addEventListener("updatefromsandbox",(function(a){var o={value:function value(a){var o,l=c===a.detail.value,u=_createForOfIteratorHelper(t._getElementsByName(a.target.name));try{for(u.s();!(o=u.n()).done;){var d=o.value,h=l&&d.id===i;d.domElement&&(d.domElement.checked=h);r.setValue(d.id,{value:h})}}catch(t){u.e(t)}finally{u.f()}}};t._dispatchEventFromSandbox(o,a)}));this._setEventListeners(l,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(t){return t.target.checked}))}this._setBackgroundColor(l);this.container.appendChild(l);return this.container}}]);return RadioButtonWidgetAnnotationElement}(m),S=function(t){_inherits(PushButtonWidgetAnnotationElement,t);var r=_createSuper(PushButtonWidgetAnnotationElement);function PushButtonWidgetAnnotationElement(t){_classCallCheck(this,PushButtonWidgetAnnotationElement);return r.call(this,t,{ignoreBorder:t.data.hasAppearance})}_createClass(PushButtonWidgetAnnotationElement,[{key:"render",value:function render(){var t=_get(_getPrototypeOf(PushButtonWidgetAnnotationElement.prototype),"render",this).call(this);t.className="buttonWidgetAnnotation pushButton";this.data.alternativeText&&(t.title=this.data.alternativeText);return t}}]);return PushButtonWidgetAnnotationElement}(y),k=function(t){_inherits(ChoiceWidgetAnnotationElement,t);var r=_createSuper(ChoiceWidgetAnnotationElement);function ChoiceWidgetAnnotationElement(t){_classCallCheck(this,ChoiceWidgetAnnotationElement);return r.call(this,t,{isRenderable:t.renderForms})}_createClass(ChoiceWidgetAnnotationElement,[{key:"render",value:function render(){var t=this;this.container.className="choiceWidgetAnnotation";var r=this.annotationStorage,a=this.data.id;r.getValue(a,{value:this.data.fieldValue.length>0?this.data.fieldValue[0]:void 0});var i=this.data.defaultAppearanceData.fontSize;i||(i=9);var o="calc(".concat(i,"px * var(--zoom-factor))"),l=document.createElement("select");h.add(l);l.disabled=this.data.readOnly;l.name=this.data.fieldName;l.setAttribute("id",a);l.tabIndex=d;l.style.fontSize="".concat(i,"px");if(!this.data.combo){l.size=this.data.options.length;this.data.multiSelect&&(l.multiple=!0)}l.addEventListener("resetform",(function(r){var a,i=t.data.defaultFieldValue,o=_createForOfIteratorHelper(l.options);try{for(o.s();!(a=o.n()).done;){var c=a.value;c.selected=c.value===i}}catch(t){o.e(t)}finally{o.f()}}));var c,u=_createForOfIteratorHelper(this.data.options);try{for(u.s();!(c=u.n()).done;){var p=c.value,v=document.createElement("option");v.textContent=p.displayValue;v.value=p.exportValue;this.data.combo&&(v.style.fontSize=o);this.data.fieldValue.includes(p.exportValue)&&v.setAttribute("selected",!0);l.appendChild(v)}}catch(t){u.e(t)}finally{u.f()}var y=function getValue(t,r){var a=r?"value":"textContent",i=t.target.options;return t.target.multiple?Array.prototype.filter.call(i,(function(t){return t.selected})).map((function(t){return t[a]})):-1===i.selectedIndex?null:i[i.selectedIndex][a]},g=function getItems(t){var r=t.target.options;return Array.prototype.map.call(r,(function(t){return{displayValue:t.textContent,exportValue:t.value}}))};if(this.enableScripting&&this.hasJSActions){l.addEventListener("updatefromsandbox",(function(i){var o={value:function value(t){var i,value=t.detail.value,o=new Set(Array.isArray(value)?value:[value]),c=_createForOfIteratorHelper(l.options);try{for(c.s();!(i=c.n()).done;){var u=i.value;u.selected=o.has(u.value)}}catch(t){c.e(t)}finally{c.f()}r.setValue(a,{value:y(t,!0)})},multipleSelection:function multipleSelection(t){l.multiple=!0},remove:function remove(t){var i=l.options,o=t.detail.remove;i[o].selected=!1;l.remove(o);if(i.length>0){var c=Array.prototype.findIndex.call(i,(function(t){return t.selected}));-1===c&&(i[0].selected=!0)}r.setValue(a,{value:y(t,!0),items:g(t)})},clear:function clear(t){for(;0!==l.length;)l.remove(0);r.setValue(a,{value:null,items:[]})},insert:function insert(t){var i=t.detail.insert,o=i.index,c=i.displayValue,u=i.exportValue,d=document.createElement("option");d.textContent=c;d.value=u;l.insertBefore(d,l.children[o]);r.setValue(a,{value:y(t,!0),items:g(t)})},items:function items(t){for(var items=t.detail.items;0!==l.length;)l.remove(0);var i,o=_createForOfIteratorHelper(items);try{for(o.s();!(i=o.n()).done;){var c=i.value,u=c.displayValue,d=c.exportValue,h=document.createElement("option");h.textContent=u;h.value=d;l.appendChild(h)}}catch(t){o.e(t)}finally{o.f()}l.options.length>0&&(l.options[0].selected=!0);r.setValue(a,{value:y(t,!0),items:g(t)})},indices:function indices(t){var i,indices=new Set(t.detail.indices),o=_createForOfIteratorHelper(t.target.options);try{for(o.s();!(i=o.n()).done;){var l=i.value;l.selected=indices.has(l.index)}}catch(t){o.e(t)}finally{o.f()}r.setValue(a,{value:y(t,!0)})},editable:function editable(t){t.target.disabled=!t.detail.editable}};t._dispatchEventFromSandbox(o,i)}));l.addEventListener("input",(function(i){var o,l=y(i,!0),c=y(i,!1);r.setValue(a,{value:l});null===(o=t.linkService.eventBus)||void 0===o||o.dispatch("dispatcheventinsandbox",{source:t,detail:{id:a,name:"Keystroke",value:c,changeEx:l,willCommit:!0,commitKey:1,keyDown:!1}})}));this._setEventListeners(l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(function(t){return t.target.checked}))}else l.addEventListener("input",(function(t){r.setValue(a,{value:y(t)})}));this._setBackgroundColor(l);this.container.appendChild(l);return this.container}}]);return ChoiceWidgetAnnotationElement}(m),C=function(t){_inherits(PopupAnnotationElement,t);var r=_createSuper(PopupAnnotationElement);function PopupAnnotationElement(t){var a,i,o;_classCallCheck(this,PopupAnnotationElement);var l=!!(null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l})}_createClass(PopupAnnotationElement,[{key:"render",value:function render(){this.container.className="popupAnnotation";if(["Line","Square","Circle","PolyLine","Polygon","Ink"].includes(this.data.parentType))return this.container;var t='[data-annotation-id="'.concat(this.data.parentId,'"]'),r=this.layer.querySelectorAll(t);if(0===r.length)return this.container;var a=new x({container:this.container,trigger:Array.from(r),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),o=this.page,l=i.Util.normalizeRect([this.data.parentRect[0],o.view[3]-this.data.parentRect[1]+o.view[1],this.data.parentRect[2],o.view[3]-this.data.parentRect[3]+o.view[1]]),c=l[0]+this.data.parentRect[2]-this.data.parentRect[0],u=l[1];this.container.style.transformOrigin="".concat(-c,"px ").concat(-u,"px");this.container.style.left="".concat(c,"px");this.container.style.top="".concat(u,"px");this.container.appendChild(a.render());return this.container}}]);return PopupAnnotationElement}(v),x=function(){function PopupElement(t){_classCallCheck(this,PopupElement);this.container=t.container;this.trigger=t.trigger;this.color=t.color;this.titleObj=t.titleObj;this.modificationDate=t.modificationDate;this.contentsObj=t.contentsObj;this.richText=t.richText;this.hideWrapper=t.hideWrapper||!1;this.pinned=!1}_createClass(PopupElement,[{key:"render",value:function render(){var t,r,a=document.createElement("div");a.className="popupWrapper";this.hideElement=this.hideWrapper?a:this.container;this.hideElement.hidden=!0;var l=document.createElement("div");l.className="popup";var c=this.color;if(c){var d=.7*(255-c[0])+c[0],h=.7*(255-c[1])+c[1],p=.7*(255-c[2])+c[2];l.style.backgroundColor=i.Util.makeHexColor(0|d,0|h,0|p)}var v=document.createElement("h1");v.dir=this.titleObj.dir;v.textContent=this.titleObj.str;l.appendChild(v);var y=o.PDFDateString.toDateObject(this.modificationDate);if(y){var g=document.createElement("span");g.className="popupDate";g.textContent="{{date}}, {{time}}";g.dataset.l10nId="annotation_date_string";g.dataset.l10nArgs=JSON.stringify({date:y.toLocaleDateString(),time:y.toLocaleTimeString()});l.appendChild(g)}if(null===(t=this.richText)||void 0===t||!t.str||null!==(r=this.contentsObj)&&void 0!==r&&r.str&&this.contentsObj.str!==this.richText.str){var m=this._formatContents(this.contentsObj);l.appendChild(m)}else{u.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:l});l.lastChild.className="richText popupContent"}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);var _,b=_createForOfIteratorHelper(this.trigger);try{for(b.s();!(_=b.n()).done;){var A=_.value;A.addEventListener("click",this._toggle.bind(this));A.addEventListener("mouseover",this._show.bind(this,!1));A.addEventListener("mouseout",this._hide.bind(this,!1))}}catch(t){b.e(t)}finally{b.f()}l.addEventListener("click",this._hide.bind(this,!0));a.appendChild(l);return a}},{key:"_formatContents",value:function _formatContents(t){var r=t.str,a=t.dir,i=document.createElement("p");i.className="popupContent";i.dir=a;for(var o=r.split(/(?:\r\n?|\n)/),l=0,c=o.length;l<c;++l){var u=o[l];i.appendChild(document.createTextNode(u));l<c-1&&i.appendChild(document.createElement("br"))}return i}},{key:"_toggle",value:function _toggle(){this.pinned?this._hide(!0):this._show(!0)}},{key:"_show",value:function _show(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t&&(this.pinned=!0);if(this.hideElement.hidden){this.hideElement.hidden=!1;this.container.style.zIndex+=1}}},{key:"_hide",value:function _hide(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];t&&(this.pinned=!1);if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=!0;this.container.style.zIndex-=1}}}]);return PopupElement}(),P=function(t){_inherits(FreeTextAnnotationElement,t);var r=_createSuper(FreeTextAnnotationElement);function FreeTextAnnotationElement(t){var a,i,o;_classCallCheck(this,FreeTextAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0})}_createClass(FreeTextAnnotationElement,[{key:"render",value:function render(){this.container.className="freeTextAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}]);return FreeTextAnnotationElement}(v),w=function(t){_inherits(LineAnnotationElement,t);var r=_createSuper(LineAnnotationElement);function LineAnnotationElement(t){var a,i,o;_classCallCheck(this,LineAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0})}_createClass(LineAnnotationElement,[{key:"render",value:function render(){this.container.className="lineAnnotation";var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i),l=this.svgFactory.createElement("svg:line");l.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);l.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);l.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);l.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);l.setAttribute("stroke-width",t.borderStyle.width||1);l.setAttribute("stroke","transparent");l.setAttribute("fill","transparent");o.appendChild(l);this.container.append(o);this._createPopup(l,t);return this.container}}]);return LineAnnotationElement}(v),T=function(t){_inherits(SquareAnnotationElement,t);var r=_createSuper(SquareAnnotationElement);function SquareAnnotationElement(t){var a,i,o;_classCallCheck(this,SquareAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0})}_createClass(SquareAnnotationElement,[{key:"render",value:function render(){this.container.className="squareAnnotation";var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i),l=t.borderStyle.width,c=this.svgFactory.createElement("svg:rect");c.setAttribute("x",l/2);c.setAttribute("y",l/2);c.setAttribute("width",a-l);c.setAttribute("height",i-l);c.setAttribute("stroke-width",l||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");o.appendChild(c);this.container.append(o);this._createPopup(c,t);return this.container}}]);return SquareAnnotationElement}(v),R=function(t){_inherits(CircleAnnotationElement,t);var r=_createSuper(CircleAnnotationElement);function CircleAnnotationElement(t){var a,i,o;_classCallCheck(this,CircleAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0})}_createClass(CircleAnnotationElement,[{key:"render",value:function render(){this.container.className="circleAnnotation";var t=this.data,r=getRectDims(t.rect),a=r.width,i=r.height,o=this.svgFactory.create(a,i),l=t.borderStyle.width,c=this.svgFactory.createElement("svg:ellipse");c.setAttribute("cx",a/2);c.setAttribute("cy",i/2);c.setAttribute("rx",a/2-l/2);c.setAttribute("ry",i/2-l/2);c.setAttribute("stroke-width",l||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");o.appendChild(c);this.container.append(o);this._createPopup(c,t);return this.container}}]);return CircleAnnotationElement}(v),E=function(t){_inherits(PolylineAnnotationElement,t);var r=_createSuper(PolylineAnnotationElement);function PolylineAnnotationElement(t){var a,i,o,l;_classCallCheck(this,PolylineAnnotationElement);var c=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);(l=r.call(this,t,{isRenderable:c,ignoreBorder:!0})).containerClassName="polylineAnnotation";l.svgElementName="svg:polyline";return l}_createClass(PolylineAnnotationElement,[{key:"render",value:function render(){this.container.className=this.containerClassName;var t,r=this.data,a=getRectDims(r.rect),i=a.width,o=a.height,l=this.svgFactory.create(i,o),c=[],u=_createForOfIteratorHelper(r.vertices);try{for(u.s();!(t=u.n()).done;){var d=t.value,h=d.x-r.rect[0],p=r.rect[3]-d.y;c.push(h+","+p)}}catch(t){u.e(t)}finally{u.f()}c=c.join(" ");var v=this.svgFactory.createElement(this.svgElementName);v.setAttribute("points",c);v.setAttribute("stroke-width",r.borderStyle.width||1);v.setAttribute("stroke","transparent");v.setAttribute("fill","transparent");l.appendChild(v);this.container.append(l);this._createPopup(v,r);return this.container}}]);return PolylineAnnotationElement}(v),O=function(t){_inherits(PolygonAnnotationElement,t);var r=_createSuper(PolygonAnnotationElement);function PolygonAnnotationElement(t){var a;_classCallCheck(this,PolygonAnnotationElement);(a=r.call(this,t)).containerClassName="polygonAnnotation";a.svgElementName="svg:polygon";return a}return _createClass(PolygonAnnotationElement)}(E),I=function(t){_inherits(CaretAnnotationElement,t);var r=_createSuper(CaretAnnotationElement);function CaretAnnotationElement(t){var a,i,o;_classCallCheck(this,CaretAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0})}_createClass(CaretAnnotationElement,[{key:"render",value:function render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}]);return CaretAnnotationElement}(v),D=function(t){_inherits(InkAnnotationElement,t);var r=_createSuper(InkAnnotationElement);function InkAnnotationElement(t){var a,i,o,l;_classCallCheck(this,InkAnnotationElement);var c=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);(l=r.call(this,t,{isRenderable:c,ignoreBorder:!0})).containerClassName="inkAnnotation";l.svgElementName="svg:polyline";return l}_createClass(InkAnnotationElement,[{key:"render",value:function render(){this.container.className=this.containerClassName;var t,r=this.data,a=getRectDims(r.rect),i=a.width,o=a.height,l=this.svgFactory.create(i,o),c=_createForOfIteratorHelper(r.inkLists);try{for(c.s();!(t=c.n()).done;){var u,d=t.value,h=[],p=_createForOfIteratorHelper(d);try{for(p.s();!(u=p.n()).done;){var v=u.value,y=v.x-r.rect[0],g=r.rect[3]-v.y;h.push("".concat(y,",").concat(g))}}catch(t){p.e(t)}finally{p.f()}h=h.join(" ");var m=this.svgFactory.createElement(this.svgElementName);m.setAttribute("points",h);m.setAttribute("stroke-width",r.borderStyle.width||1);m.setAttribute("stroke","transparent");m.setAttribute("fill","transparent");this._createPopup(m,r);l.appendChild(m)}}catch(t){c.e(t)}finally{c.f()}this.container.append(l);return this.container}}]);return InkAnnotationElement}(v),M=function(t){_inherits(HighlightAnnotationElement,t);var r=_createSuper(HighlightAnnotationElement);function HighlightAnnotationElement(t){var a,i,o;_classCallCheck(this,HighlightAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(HighlightAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}]);return HighlightAnnotationElement}(v),L=function(t){_inherits(UnderlineAnnotationElement,t);var r=_createSuper(UnderlineAnnotationElement);function UnderlineAnnotationElement(t){var a,i,o;_classCallCheck(this,UnderlineAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(UnderlineAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}]);return UnderlineAnnotationElement}(v),j=function(t){_inherits(SquigglyAnnotationElement,t);var r=_createSuper(SquigglyAnnotationElement);function SquigglyAnnotationElement(t){var a,i,o;_classCallCheck(this,SquigglyAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(SquigglyAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}]);return SquigglyAnnotationElement}(v),N=function(t){_inherits(StrikeOutAnnotationElement,t);var r=_createSuper(StrikeOutAnnotationElement);function StrikeOutAnnotationElement(t){var a,i,o;_classCallCheck(this,StrikeOutAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0,createQuadrilaterals:!0})}_createClass(StrikeOutAnnotationElement,[{key:"render",value:function render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}]);return StrikeOutAnnotationElement}(v),B=function(t){_inherits(StampAnnotationElement,t);var r=_createSuper(StampAnnotationElement);function StampAnnotationElement(t){var a,i,o;_classCallCheck(this,StampAnnotationElement);var l=!!(t.data.hasPopup||null!==(a=t.data.titleObj)&&void 0!==a&&a.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(o=t.data.richText)&&void 0!==o&&o.str);return r.call(this,t,{isRenderable:l,ignoreBorder:!0})}_createClass(StampAnnotationElement,[{key:"render",value:function render(){this.container.className="stampAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}]);return StampAnnotationElement}(v),G=function(t){_inherits(FileAttachmentAnnotationElement,t);var r=_createSuper(FileAttachmentAnnotationElement);function FileAttachmentAnnotationElement(t){var a,l;_classCallCheck(this,FileAttachmentAnnotationElement);var c=(l=r.call(this,t,{isRenderable:!0})).data.file,u=c.filename,d=c.content;l.filename=(0,o.getFilenameFromUrl)(u);l.content=d;null===(a=l.linkService.eventBus)||void 0===a||a.dispatch("fileattachmentannotation",{source:_assertThisInitialized(l),id:(0,i.stringToPDFString)(u),filename:u,content:d});return l}_createClass(FileAttachmentAnnotationElement,[{key:"render",value:function render(){var t,r;this.container.className="fileAttachmentAnnotation";var a=document.createElement("div");a.style.height=this.container.style.height;a.style.width=this.container.style.width;a.addEventListener("dblclick",this._download.bind(this));!this.data.hasPopup&&(null!==(t=this.data.titleObj)&&void 0!==t&&t.str||null!==(r=this.data.contentsObj)&&void 0!==r&&r.str||this.data.richText)&&this._createPopup(a,this.data);this.container.appendChild(a);return this.container}},{key:"_download",value:function _download(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}}]);return FileAttachmentAnnotationElement}(v),U=function(){function AnnotationLayer(){_classCallCheck(this,AnnotationLayer)}_createClass(AnnotationLayer,null,[{key:"render",value:function render(t){var r,a=[],c=[],u=_createForOfIteratorHelper(t.annotations);try{for(u.s();!(r=u.n()).done;){var d=r.value;if(d){var h=getRectDims(d.rect),v=h.width,y=h.height;v<=0||y<=0||(d.annotationType!==i.AnnotationType.POPUP?a.push(d):c.push(d))}}}catch(t){u.e(t)}finally{u.f()}c.length&&a.push.apply(a,c);for(var g=t.div,m=0,_=a;m<_.length;m++){var b=_[m],A=p.create({data:b,layer:g,page:t.page,viewport:t.viewport,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new o.DOMSVGFactory,annotationStorage:t.annotationStorage||new l.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}});if(A.isRenderable){var S=A.render();b.hidden&&(S.style.visibility="hidden");if(Array.isArray(S)){var k,x=_createForOfIteratorHelper(S);try{for(x.s();!(k=x.n()).done;){var P=k.value;g.appendChild(P)}}catch(t){x.e(t)}finally{x.f()}}else A instanceof C?g.prepend(S):g.appendChild(S)}}_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,g,t.annotationCanvasMap)}},{key:"update",value:function update(t){var r,a,o,l=t.page,c=t.viewport,u=t.annotations,d=t.annotationCanvasMap,h=t.div,p=c.transform,v="matrix(".concat(p.join(","),")"),y=_createForOfIteratorHelper(u);try{for(y.s();!(o=y.n()).done;){var g=o.value,m=h.querySelectorAll('[data-annotation-id="'.concat(g.id,'"]'));if(m){var _,b=_createForOfIteratorHelper(m);try{for(b.s();!(_=b.n()).done;){var A=_.value;if(g.hasOwnCanvas){var S=i.Util.normalizeRect([g.rect[0],l.view[3]-g.rect[1]+l.view[1],g.rect[2],l.view[3]-g.rect[3]+l.view[1]]);if(!a){r=Math.abs(p[0]||p[1]);for(var k=p.slice(),C=0;C<4;C++)k[C]=Math.sign(k[C]);a="matrix(".concat(k.join(","),")")}var x=S[0]*r,P=S[1]*r;A.style.left="".concat(x,"px");A.style.top="".concat(P,"px");A.style.transformOrigin="".concat(-x,"px ").concat(-P,"px");A.style.transform=a}else A.style.transform=v}}catch(t){b.e(t)}finally{b.f()}}}}catch(t){y.e(t)}finally{y.f()}_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,h,d);h.hidden=!1}}]);return AnnotationLayer}();r.AnnotationLayer=U;function _setAnnotationCanvasMap(t,r){if(r){var a,i=_createForOfIteratorHelper(r);try{for(i.s();!(a=i.n()).done;){var o=_slicedToArray(a.value,2),l=o[0],c=o[1],u=t.querySelector('[data-annotation-id="'.concat(l,'"]'));if(u){var d=u.firstChild;"CANVAS"===d.nodeName?u.replaceChild(c,d):u.insertBefore(c,d)}}}catch(t){i.e(t)}finally{i.f()}r.clear()}}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ColorConverters=void 0;function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}var a=function(){function ColorConverters(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ColorConverters)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(ColorConverters,null,[{key:"CMYK_G",value:function CMYK_G(t){var r=_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return["G",1-Math.min(1,.3*a+.59*o+.11*i+l)]}},{key:"G_CMYK",value:function G_CMYK(t){return["CMYK",0,0,0,1-_slicedToArray(t,1)[0]]}},{key:"G_RGB",value:function G_RGB(t){var r=_slicedToArray(t,1)[0];return["RGB",r,r,r]}},{key:"G_HTML",value:function G_HTML(t){var r=makeColorComp(_slicedToArray(t,1)[0]);return"#".concat(r).concat(r).concat(r)}},{key:"RGB_G",value:function RGB_G(t){var r=_slicedToArray(t,3);return["G",.3*r[0]+.59*r[1]+.11*r[2]]}},{key:"RGB_HTML",value:function RGB_HTML(t){var r=_slicedToArray(t,3),a=r[0],i=r[1],o=r[2],l=makeColorComp(a),c=makeColorComp(i),u=makeColorComp(o);return"#".concat(l).concat(c).concat(u)}},{key:"T_HTML",value:function T_HTML(){return"#00000000"}},{key:"CMYK_RGB",value:function CMYK_RGB(t){var r=_slicedToArray(t,4),a=r[0],i=r[1],o=r[2],l=r[3];return["RGB",1-Math.min(1,a+l),1-Math.min(1,o+l),1-Math.min(1,i+l)]}},{key:"CMYK_HTML",value:function CMYK_HTML(t){return this.RGB_HTML(this.CMYK_RGB(t))}},{key:"RGB_CMYK",value:function RGB_CMYK(t){var r=_slicedToArray(t,3),a=1-r[0],i=1-r[1],o=1-r[2];return["CMYK",a,i,o,Math.min(a,i,o)]}}]);return ColorConverters}();r.ColorConverters=a},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.XfaLayer=void 0;var i=a(158);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}var o=function(){function XfaLayer(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XfaLayer)}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(XfaLayer,null,[{key:"setupStorage",value:function setupStorage(t,r,a,i,o){var l=i.getValue(r,{value:null});switch(a.name){case"textarea":null!==l.value&&(t.textContent=l.value);if("print"===o)break;t.addEventListener("input",(function(t){i.setValue(r,{value:t.target.value})}));break;case"input":if("radio"===a.attributes.type||"checkbox"===a.attributes.type){l.value===a.attributes.xfaOn?t.setAttribute("checked",!0):l.value===a.attributes.xfaOff&&t.removeAttribute("checked");if("print"===o)break;t.addEventListener("change",(function(t){i.setValue(r,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==l.value&&t.setAttribute("value",l.value);if("print"===o)break;t.addEventListener("input",(function(t){i.setValue(r,{value:t.target.value})}))}break;case"select":if(null!==l.value){var c,u=_createForOfIteratorHelper(a.children);try{for(u.s();!(c=u.n()).done;){var d=c.value;d.attributes.value===l.value&&(d.attributes.selected=!0)}}catch(t){u.e(t)}finally{u.f()}}t.addEventListener("input",(function(t){var a=t.target.options,o=-1===a.selectedIndex?"":a[a.selectedIndex].value;i.setValue(r,{value:o})}))}}},{key:"setAttributes",value:function setAttributes(t){var r=t.html,a=t.element,i=t.storage,o=void 0===i?null:i,l=t.intent,c=t.linkService,u=a.attributes,d=r instanceof HTMLAnchorElement;"radio"===u.type&&(u.name="".concat(u.name,"-").concat(l));for(var h=0,p=Object.entries(u);h<p.length;h++){var v=_slicedToArray(p[h],2),y=v[0],g=v[1];if(null!=g&&"dataId"!==y)if("style"!==y)if("textContent"===y)r.textContent=g;else if("class"===y)g.length&&r.setAttribute(y,g.join(" "));else{if(d&&("href"===y||"newWindow"===y))continue;r.setAttribute(y,g)}else Object.assign(r.style,g)}d&&c.addLinkAttributes(r,u.href,u.newWindow);o&&u.dataId&&this.setupStorage(r,u.dataId,a,o)}},{key:"render",value:function render(t){var r=t.annotationStorage,a=t.linkService,o=t.xfaHtml,l=t.intent||"display",c=document.createElement(o.name);o.attributes&&this.setAttributes({html:c,element:o,intent:l,linkService:a});var u=[[o,-1,c]],d=t.div;d.appendChild(c);if(t.viewport){var h="matrix(".concat(t.viewport.transform.join(","),")");d.style.transform=h}"richText"!==l&&d.setAttribute("class","xfaLayer xfaFont");for(var p=[];u.length>0;){var v,y=_slicedToArray(u[u.length-1],3),g=y[0],m=y[1],_=y[2];if(m+1!==g.children.length){var b=g.children[++u[u.length-1][1]];if(null!==b){var A=b.name;if("#text"!==A){var S=void 0;S=null!=b&&null!==(v=b.attributes)&&void 0!==v&&v.xmlns?document.createElementNS(b.attributes.xmlns,A):document.createElement(A);_.appendChild(S);b.attributes&&this.setAttributes({html:S,element:b,storage:r,intent:l,linkService:a});if(b.children&&b.children.length>0)u.push([b,-1,S]);else if(b.value){var k=document.createTextNode(b.value);i.XfaText.shouldBuildText(A)&&p.push(k);S.appendChild(k)}}else{var C=document.createTextNode(b.value);p.push(C);_.appendChild(C)}}}else u.pop()}var x,P=_createForOfIteratorHelper(d.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"));try{for(P.s();!(x=P.n()).done;){x.value.setAttribute("readOnly",!0)}}catch(t){P.e(t)}finally{P.f()}return{textDivs:p}}},{key:"update",value:function update(t){var r="matrix(".concat(t.viewport.transform.join(","),")");t.div.style.transform=r;t.div.hidden=!1}}]);return XfaLayer}();r.XfaLayer=o},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.renderTextLayer=function renderTextLayer(t){var r=new u({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr,enhanceTextSelection:t.enhanceTextSelection});r._render(t.timeout);return r};var i=a(1);function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}var o=30,l=new Map,c=/^\s+$/g;function appendText(t,r,a,u){var d=document.createElement("span"),h=t._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:""!==r.str,hasEOL:r.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1}:{angle:0,canvasWidth:0,hasText:""!==r.str,hasEOL:r.hasEOL};t._textDivs.push(d);var p=i.Util.transform(t._viewport.transform,r.transform),v=Math.atan2(p[1],p[0]),y=a[r.fontName];y.vertical&&(v+=Math.PI/2);var g,m,_=Math.hypot(p[2],p[3]),b=_*function getAscent(t,r){var a=l.get(t);if(a)return a;r.save();r.font="".concat(o,"px ").concat(t);var i=r.measureText(""),c=i.fontBoundingBoxAscent,u=Math.abs(i.fontBoundingBoxDescent);if(c){r.restore();var d=c/(c+u);l.set(t,d);return d}r.strokeStyle="red";r.clearRect(0,0,o,o);r.strokeText("g",0,0);var h=r.getImageData(0,0,o,o).data;u=0;for(var p=h.length-1-3;p>=0;p-=4)if(h[p]>0){u=Math.ceil(p/4/o);break}r.clearRect(0,0,o,o);r.strokeText("A",0,o);c=0;for(var v=0,y=(h=r.getImageData(0,0,o,o).data).length;v<y;v+=4)if(h[v]>0){c=o-Math.floor(v/4/o);break}r.restore();if(c){var g=c/(c+u);l.set(t,g);return g}l.set(t,.8);return.8}(y.fontFamily,u);if(0===v){g=p[4];m=p[5]-b}else{g=p[4]+b*Math.sin(v);m=p[5]-b*Math.cos(v)}d.style.left="".concat(g,"px");d.style.top="".concat(m,"px");d.style.fontSize="".concat(_,"px");d.style.fontFamily=y.fontFamily;d.setAttribute("role","presentation");d.textContent=r.str;d.dir=r.dir;t._fontInspectorEnabled&&(d.dataset.fontName=r.fontName);0!==v&&(h.angle=v*(180/Math.PI));var A=!1;if(r.str.length>1||t._enhanceTextSelection&&c.test(r.str))A=!0;else if(" "!==r.str&&r.transform[0]!==r.transform[3]){var S=Math.abs(r.transform[0]),k=Math.abs(r.transform[3]);S!==k&&Math.max(S,k)/Math.min(S,k)>1.5&&(A=!0)}A&&(y.vertical?h.canvasWidth=r.height*t._viewport.scale:h.canvasWidth=r.width*t._viewport.scale);t._textDivProperties.set(d,h);t._textContentStream&&t._layoutText(d);if(t._enhanceTextSelection&&h.hasText){var C=1,x=0;if(0!==v){C=Math.cos(v);x=Math.sin(v)}var P,w,T=(y.vertical?r.height:r.width)*t._viewport.scale,R=_;if(0!==v){P=[C,x,-x,C,g,m];w=i.Util.getAxialAlignedBoundingBox([0,0,T,R],P)}else w=[g,m,g+T,m+R];t._bounds.push({left:w[0],top:w[1],right:w[2],bottom:w[3],div:d,size:[T,R],m:P})}}function render(t){if(!t._canceled){var r=t._textDivs,a=t._capability,i=r.length;if(i>1e5){t._renderingDone=!0;a.resolve()}else{if(!t._textContentStream)for(var o=0;o<i;o++)t._layoutText(r[o]);t._renderingDone=!0;a.resolve()}}}function findPositiveMin(t,r,a){for(var i=0,o=0;o<a;o++){var l=t[r++];l>0&&(i=i?Math.min(l,i):l)}return i}function expand(t){for(var r=t._bounds,a=t._viewport,o=function expandBounds(t,r,a){var i=a.map((function(t,r){return{x1:t.left,y1:t.top,x2:t.right,y2:t.bottom,index:r,x1New:void 0,x2New:void 0}}));expandBoundsLTR(t,i);var o,l=new Array(a.length),c=_createForOfIteratorHelper(i);try{for(c.s();!(o=c.n()).done;){var u=o.value,d=u.index;l[d]={left:u.x1New,top:0,right:u.x2New,bottom:0}}}catch(t){c.e(t)}finally{c.f()}a.map((function(r,a){var o=l[a],c=i[a];c.x1=r.top;c.y1=t-o.right;c.x2=r.bottom;c.y2=t-o.left;c.index=a;c.x1New=void 0;c.x2New=void 0}));expandBoundsLTR(r,i);var h,p=_createForOfIteratorHelper(i);try{for(p.s();!(h=p.n()).done;){var v=h.value,y=v.index;l[y].top=v.x1New;l[y].bottom=v.x2New}}catch(t){p.e(t)}finally{p.f()}return l}(a.width,a.height,r),l=0;l<o.length;l++){var c=r[l].div,u=t._textDivProperties.get(c);if(0!==u.angle){for(var d=o[l],h=r[l],p=h.m,v=p[0],y=p[1],g=[[0,0],[0,h.size[1]],[h.size[0],0],h.size],m=new Float64Array(64),_=0,b=g.length;_<b;_++){var A=i.Util.applyTransform(g[_],p);m[_+0]=v&&(d.left-A[0])/v;m[_+4]=y&&(d.top-A[1])/y;m[_+8]=v&&(d.right-A[0])/v;m[_+12]=y&&(d.bottom-A[1])/y;m[_+16]=y&&(d.left-A[0])/-y;m[_+20]=v&&(d.top-A[1])/v;m[_+24]=y&&(d.right-A[0])/-y;m[_+28]=v&&(d.bottom-A[1])/v;m[_+32]=v&&(d.left-A[0])/-v;m[_+36]=y&&(d.top-A[1])/-y;m[_+40]=v&&(d.right-A[0])/-v;m[_+44]=y&&(d.bottom-A[1])/-y;m[_+48]=y&&(d.left-A[0])/y;m[_+52]=v&&(d.top-A[1])/-v;m[_+56]=y&&(d.right-A[0])/y;m[_+60]=v&&(d.bottom-A[1])/-v}var S=1+Math.min(Math.abs(v),Math.abs(y));u.paddingLeft=findPositiveMin(m,32,16)/S;u.paddingTop=findPositiveMin(m,48,16)/S;u.paddingRight=findPositiveMin(m,0,16)/S;u.paddingBottom=findPositiveMin(m,16,16)/S;t._textDivProperties.set(c,u)}else{u.paddingLeft=r[l].left-o[l].left;u.paddingTop=r[l].top-o[l].top;u.paddingRight=o[l].right-r[l].right;u.paddingBottom=o[l].bottom-r[l].bottom;t._textDivProperties.set(c,u)}}}function expandBoundsLTR(t,r){r.sort((function(t,r){return t.x1-r.x1||t.index-r.index}));var a,i=[{start:-1/0,end:1/0,boundary:{x1:-1/0,y1:-1/0,x2:0,y2:1/0,index:-1,x1New:0,x2New:0}}],o=_createForOfIteratorHelper(r);try{for(o.s();!(a=o.n()).done;){for(var l=a.value,c=0;c<i.length&&i[c].end<=l.y1;)c++;for(var u=i.length-1;u>=0&&i[u].start>=l.y2;)u--;var d=void 0,h=void 0,p=void 0,v=void 0,y=-1/0;for(p=c;p<=u;p++){h=(d=i[p]).boundary;var g=void 0;(g=h.x2>l.x1?h.index>l.index?h.x1New:l.x1:void 0===h.x2New?(h.x2+l.x1)/2:h.x2New)>y&&(y=g)}l.x1New=y;for(p=c;p<=u;p++)void 0===(h=(d=i[p]).boundary).x2New?h.x2>l.x1?h.index>l.index&&(h.x2New=h.x2):h.x2New=y:h.x2New>y&&(h.x2New=Math.max(y,h.x2));var m=[],_=null;for(p=c;p<=u;p++){var b=(h=(d=i[p]).boundary).x2>l.x2?h:l;if(_===b)m[m.length-1].end=d.end;else{m.push({start:d.start,end:d.end,boundary:b});_=b}}if(i[c].start<l.y1){m[0].start=l.y1;m.unshift({start:i[c].start,end:l.y1,boundary:i[c].boundary})}if(l.y2<i[u].end){m[m.length-1].end=l.y2;m.push({start:l.y2,end:i[u].end,boundary:i[u].boundary})}for(p=c;p<=u;p++)if(void 0===(h=(d=i[p]).boundary).x2New){var A=!1;for(v=c-1;!A&&v>=0&&i[v].start>=h.y1;v--)A=i[v].boundary===h;for(v=u+1;!A&&v<i.length&&i[v].end<=h.y2;v++)A=i[v].boundary===h;for(v=0;!A&&v<m.length;v++)A=m[v].boundary===h;A||(h.x2New=y)}Array.prototype.splice.apply(i,[c,u-c+1].concat(m))}}catch(t){o.e(t)}finally{o.f()}for(var S=0,k=i;S<k.length;S++){var C=k[S].boundary;void 0===C.x2New&&(C.x2New=Math.max(t,C.x2))}}var u=function(){function TextLayerRenderTask(t){var r,a=this,o=t.textContent,l=t.textContentStream,c=t.container,u=t.viewport,d=t.textDivs,h=t.textContentItemsStr,p=t.enhanceTextSelection;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,TextLayerRenderTask);this._textContent=o;this._textContentStream=l;this._container=c;this._document=c.ownerDocument;this._viewport=u;this._textDivs=d||[];this._textContentItemsStr=h||[];this._enhanceTextSelection=!!p;this._fontInspectorEnabled=!(null===(r=globalThis.FontInspector)||void 0===r||!r.enabled);this._reader=null;this._layoutTextLastFontSize=null;this._layoutTextLastFontFamily=null;this._layoutTextCtx=null;this._textDivProperties=new WeakMap;this._renderingDone=!1;this._canceled=!1;this._capability=(0,i.createPromiseCapability)();this._renderTimer=null;this._bounds=[];this._capability.promise.finally((function(){a._enhanceTextSelection||(a._textDivProperties=null);if(a._layoutTextCtx){a._layoutTextCtx.canvas.width=0;a._layoutTextCtx.canvas.height=0;a._layoutTextCtx=null}})).catch((function(){}))}!function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}(TextLayerRenderTask,[{key:"promise",get:function get(){return this._capability.promise}},{key:"cancel",value:function cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new i.AbortException("TextLayer task cancelled.")).catch((function(){}));this._reader=null}if(null!==this._renderTimer){clearTimeout(this._renderTimer);this._renderTimer=null}this._capability.reject(new Error("TextLayer task cancelled."))}},{key:"_processItems",value:function _processItems(t,r){for(var a=0,i=t.length;a<i;a++)if(void 0!==t[a].str){this._textContentItemsStr.push(t[a].str);appendText(this,t[a],r,this._layoutTextCtx)}else if("beginMarkedContentProps"===t[a].type||"beginMarkedContent"===t[a].type){var o=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==t[a].id&&this._container.setAttribute("id","".concat(t[a].id));o.appendChild(this._container)}else"endMarkedContent"===t[a].type&&(this._container=this._container.parentNode)}},{key:"_layoutText",value:function _layoutText(t){var r=this._textDivProperties.get(t),a="";if(0!==r.canvasWidth&&r.hasText){var i=t.style,o=i.fontSize,l=i.fontFamily;if(o!==this._layoutTextLastFontSize||l!==this._layoutTextLastFontFamily){this._layoutTextCtx.font="".concat(o," ").concat(l);this._layoutTextLastFontSize=o;this._layoutTextLastFontFamily=l}var c=this._layoutTextCtx.measureText(t.textContent).width;if(c>0){var u=r.canvasWidth/c;this._enhanceTextSelection&&(r.scale=u);a="scaleX(".concat(u,")")}}0!==r.angle&&(a="rotate(".concat(r.angle,"deg) ").concat(a));if(a.length>0){this._enhanceTextSelection&&(r.originalTransform=a);t.style.transform=a}r.hasText&&this._container.appendChild(t);if(r.hasEOL){var d=document.createElement("br");d.setAttribute("role","presentation");this._container.appendChild(d)}}},{key:"_render",value:function _render(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,a=(0,i.createPromiseCapability)(),l=Object.create(null),c=this._document.createElement("canvas");c.height=c.width=o;c.mozOpaque=!0;this._layoutTextCtx=c.getContext("2d",{alpha:!1});if(this._textContent){var u=this._textContent.items,d=this._textContent.styles;this._processItems(u,d);a.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');var h=function pump(){t._reader.read().then((function(r){var i=r.value;if(r.done)a.resolve();else{Object.assign(l,i.styles);t._processItems(i.items,l);pump()}}),a.reject)};this._reader=this._textContentStream.getReader();h()}a.promise.then((function(){l=null;r?t._renderTimer=setTimeout((function(){render(t);t._renderTimer=null}),r):render(t)}),this._capability.reject)}},{key:"expandTextDivs",value:function expandTextDivs(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this._enhanceTextSelection&&this._renderingDone){if(null!==this._bounds){expand(this);this._bounds=null}for(var r=[],a=[],i=0,o=this._textDivs.length;i<o;i++){var l=this._textDivs[i],c=this._textDivProperties.get(l);if(c.hasText)if(t){r.length=0;a.length=0;c.originalTransform&&r.push(c.originalTransform);if(c.paddingTop>0){a.push("".concat(c.paddingTop,"px"));r.push("translateY(".concat(-c.paddingTop,"px)"))}else a.push(0);c.paddingRight>0?a.push("".concat(c.paddingRight/c.scale,"px")):a.push(0);c.paddingBottom>0?a.push("".concat(c.paddingBottom,"px")):a.push(0);if(c.paddingLeft>0){a.push("".concat(c.paddingLeft/c.scale,"px"));r.push("translateX(".concat(-c.paddingLeft/c.scale,"px)"))}else a.push(0);l.style.padding=a.join(" ");r.length&&(l.style.transform=r.join(" "))}else{l.style.padding=null;l.style.transform=c.originalTransform}}}}}]);return TextLayerRenderTask}()},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.SVGGraphics=void 0;var i=a(1),o=a(146),l=a(3);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);return"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var c=_createClass((function SVGGraphics(){_classCallCheck(this,SVGGraphics);(0,i.unreachable)("Not implemented: SVGGraphics")}));r.SVGGraphics=c;var u=function pf(t){if(Number.isInteger(t))return t.toString();var r=t.toFixed(10),a=r.length-1;if("0"!==r[a])return r;do{a--}while("0"===r[a]);return r.substring(0,"."===r[a]?a:a+1)},d=function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":"scale(".concat(u(t[0])," ").concat(u(t[3]),")");if(t[0]===t[3]&&t[1]===-t[2]){var r=180*Math.acos(t[0])/Math.PI;return"rotate(".concat(u(r),")")}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return"translate(".concat(u(t[4])," ").concat(u(t[5]),")");return"matrix(".concat(u(t[0])," ").concat(u(t[1])," ").concat(u(t[2])," ").concat(u(t[3])," ").concat(u(t[4])," ")+"".concat(u(t[5]),")")},h={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},p=["butt","round","square"],v=["miter","round","bevel"],y=function createObjectURL(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!a)return URL.createObjectURL(new Blob([t],{type:r}));for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="data:".concat(r,";base64,"),l=0,c=t.length;l<c;l+=3){var u=255&t[l],d=255&t[l+1],h=255&t[l+2],p=u>>2,v=(3&u)<<4|d>>4,y=l+1<c?(15&d)<<2|h>>6:64,g=l+2<c?63&h:64;o+=i[p]+i[v]+i[y]+i[g]}return o},g=function(){for(var t=new Uint8Array([137,80,78,71,13,10,26,10]),r=new Int32Array(256),a=0;a<256;a++){for(var o=a,c=0;c<8;c++)o=1&o?3988292384^o>>1&2147483647:o>>1&2147483647;r[a]=o}function writePngChunk(t,a,i,o){var l=o,c=a.length;i[l]=c>>24&255;i[l+1]=c>>16&255;i[l+2]=c>>8&255;i[l+3]=255&c;i[l+=4]=255&t.charCodeAt(0);i[l+1]=255&t.charCodeAt(1);i[l+2]=255&t.charCodeAt(2);i[l+3]=255&t.charCodeAt(3);l+=4;i.set(a,l);var u=function crc32(t,a,i){for(var o=-1,l=a;l<i;l++){var c=255&(o^t[l]);o=o>>>8^r[c]}return-1^o}(i,o+4,l+=a.length);i[l]=u>>24&255;i[l+1]=u>>16&255;i[l+2]=u>>8&255;i[l+3]=255&u}function deflateSyncUncompressed(t){var r=t.length,a=65535,i=Math.ceil(r/a),o=new Uint8Array(2+r+5*i+4),l=0;o[l++]=120;o[l++]=156;for(var c=0;r>a;){o[l++]=0;o[l++]=255;o[l++]=255;o[l++]=0;o[l++]=0;o.set(t.subarray(c,c+a),l);l+=a;c+=a;r-=a}o[l++]=1;o[l++]=255&r;o[l++]=r>>8&255;o[l++]=255&~r;o[l++]=(65535&~r)>>8&255;o.set(t.subarray(c),l);l+=t.length-c;var u=function adler32(t,r,a){for(var i=1,o=0,l=r;l<a;++l)o=(o+(i=(i+(255&t[l]))%65521))%65521;return o<<16|i}(t,0,t.length);o[l++]=u>>24&255;o[l++]=u>>16&255;o[l++]=u>>8&255;o[l++]=255&u;return o}function encode(r,a,o,c){var u,d,h,p=r.width,v=r.height,g=r.data;switch(a){case i.ImageKind.GRAYSCALE_1BPP:d=0;u=1;h=p+7>>3;break;case i.ImageKind.RGB_24BPP:d=2;u=8;h=3*p;break;case i.ImageKind.RGBA_32BPP:d=6;u=8;h=4*p;break;default:throw new Error("invalid format")}for(var m=new Uint8Array((1+h)*v),_=0,b=0,A=0;A<v;++A){m[_++]=0;m.set(g.subarray(b,b+h),_);b+=h;_+=h}if(a===i.ImageKind.GRAYSCALE_1BPP&&c){_=0;for(var S=0;S<v;S++){_++;for(var k=0;k<h;k++)m[_++]^=255}}var C=new Uint8Array([p>>24&255,p>>16&255,p>>8&255,255&p,v>>24&255,v>>16&255,v>>8&255,255&v,u,d,0,0,0]),x=function deflateSync(t){if(!l.isNodeJS)return deflateSyncUncompressed(t);try{var r;r=parseInt(process.versions.node)>=8?t:Buffer.from(t);var a=require("zlib").deflateSync(r,{level:9});return a instanceof Uint8Array?a:new Uint8Array(a)}catch(t){(0,i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(m),P=t.length+36+C.length+x.length,w=new Uint8Array(P),T=0;w.set(t,T);writePngChunk("IHDR",C,w,T+=t.length);writePngChunk("IDATA",x,w,T+=12+C.length);T+=12+x.length;writePngChunk("IEND",new Uint8Array(0),w,T);return y(w,"image/png",o)}return function convertImgDataToPng(t,r,a){return encode(t,void 0===t.kind?i.ImageKind.GRAYSCALE_1BPP:t.kind,r,a)}}(),m=function(){function SVGExtraState(){_classCallCheck(this,SVGExtraState);this.fontSizeScale=1;this.fontWeight=h.fontWeight;this.fontSize=0;this.textMatrix=i.IDENTITY_MATRIX;this.fontMatrix=i.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=i.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=h.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}_createClass(SVGExtraState,[{key:"clone",value:function clone(){return Object.create(this)}},{key:"setCurrentPoint",value:function setCurrentPoint(t,r){this.x=t;this.y=r}}]);return SVGExtraState}(),_=0,b=0,A=0;r.SVGGraphics=c=function(){function SVGGraphics(t,r){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,SVGGraphics);this.svgFactory=new o.DOMSVGFactory;this.current=new m;this.transformMatrix=i.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=r;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!a;this._operatorIdMapping=[];for(var l in i.OPS)this._operatorIdMapping[i.OPS[l]]=l}_createClass(SVGGraphics,[{key:"save",value:function save(){this.transformStack.push(this.transformMatrix);var t=this.current;this.extraStack.push(t);this.current=t.clone()}},{key:"restore",value:function restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}},{key:"group",value:function group(t){this.save();this.executeOpTree(t);this.restore()}},{key:"loadDependencies",value:function loadDependencies(t){for(var r=this,a=t.fnArray,o=t.argsArray,l=0,c=a.length;l<c;l++)if(a[l]===i.OPS.dependency){var u,d=_createForOfIteratorHelper(o[l]);try{var h=function _loop(){var t=u.value,a=t.startsWith("g_")?r.commonObjs:r.objs,i=new Promise((function(r){a.get(t,r)}));r.current.dependencies.push(i)};for(d.s();!(u=d.n()).done;)h()}catch(t){d.e(t)}finally{d.f()}}return Promise.all(this.current.dependencies)}},{key:"transform",value:function transform(t,r,a,o,l,c){var u=[t,r,a,o,l,c];this.transformMatrix=i.Util.transform(this.transformMatrix,u);this.tgrp=null}},{key:"getSVG",value:function getSVG(t,r){var a=this;this.viewport=r;var o=this._initialize(r);return this.loadDependencies(t).then((function(){a.transformMatrix=i.IDENTITY_MATRIX;a.executeOpTree(a.convertOpList(t));return o}))}},{key:"convertOpList",value:function convertOpList(t){for(var r=this._operatorIdMapping,a=t.argsArray,i=t.fnArray,o=[],l=0,c=i.length;l<c;l++){var u=i[l];o.push({fnId:u,fn:r[u],args:a[l]})}return function opListToTree(t){var r,a=[],i=[],o=_createForOfIteratorHelper(t);try{for(o.s();!(r=o.n()).done;){var l=r.value;if("save"!==l.fn)"restore"===l.fn?a=i.pop():a.push(l);else{a.push({fnId:92,fn:"group",items:[]});i.push(a);a=a[a.length-1].items}}}catch(t){o.e(t)}finally{o.f()}return a}(o)}},{key:"executeOpTree",value:function executeOpTree(t){var r,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var o=r.value,l=o.fn,c=o.fnId,u=o.args;switch(0|c){case i.OPS.beginText:this.beginText();break;case i.OPS.dependency:break;case i.OPS.setLeading:this.setLeading(u);break;case i.OPS.setLeadingMoveText:this.setLeadingMoveText(u[0],u[1]);break;case i.OPS.setFont:this.setFont(u);break;case i.OPS.showText:case i.OPS.showSpacedText:this.showText(u[0]);break;case i.OPS.endText:this.endText();break;case i.OPS.moveText:this.moveText(u[0],u[1]);break;case i.OPS.setCharSpacing:this.setCharSpacing(u[0]);break;case i.OPS.setWordSpacing:this.setWordSpacing(u[0]);break;case i.OPS.setHScale:this.setHScale(u[0]);break;case i.OPS.setTextMatrix:this.setTextMatrix(u[0],u[1],u[2],u[3],u[4],u[5]);break;case i.OPS.setTextRise:this.setTextRise(u[0]);break;case i.OPS.setTextRenderingMode:this.setTextRenderingMode(u[0]);break;case i.OPS.setLineWidth:this.setLineWidth(u[0]);break;case i.OPS.setLineJoin:this.setLineJoin(u[0]);break;case i.OPS.setLineCap:this.setLineCap(u[0]);break;case i.OPS.setMiterLimit:this.setMiterLimit(u[0]);break;case i.OPS.setFillRGBColor:this.setFillRGBColor(u[0],u[1],u[2]);break;case i.OPS.setStrokeRGBColor:this.setStrokeRGBColor(u[0],u[1],u[2]);break;case i.OPS.setStrokeColorN:this.setStrokeColorN(u);break;case i.OPS.setFillColorN:this.setFillColorN(u);break;case i.OPS.shadingFill:this.shadingFill(u[0]);break;case i.OPS.setDash:this.setDash(u[0],u[1]);break;case i.OPS.setRenderingIntent:this.setRenderingIntent(u[0]);break;case i.OPS.setFlatness:this.setFlatness(u[0]);break;case i.OPS.setGState:this.setGState(u[0]);break;case i.OPS.fill:this.fill();break;case i.OPS.eoFill:this.eoFill();break;case i.OPS.stroke:this.stroke();break;case i.OPS.fillStroke:this.fillStroke();break;case i.OPS.eoFillStroke:this.eoFillStroke();break;case i.OPS.clip:this.clip("nonzero");break;case i.OPS.eoClip:this.clip("evenodd");break;case i.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case i.OPS.paintImageXObject:this.paintImageXObject(u[0]);break;case i.OPS.paintInlineImageXObject:this.paintInlineImageXObject(u[0]);break;case i.OPS.paintImageMaskXObject:this.paintImageMaskXObject(u[0]);break;case i.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(u[0],u[1]);break;case i.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case i.OPS.closePath:this.closePath();break;case i.OPS.closeStroke:this.closeStroke();break;case i.OPS.closeFillStroke:this.closeFillStroke();break;case i.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case i.OPS.nextLine:this.nextLine();break;case i.OPS.transform:this.transform(u[0],u[1],u[2],u[3],u[4],u[5]);break;case i.OPS.constructPath:this.constructPath(u[0],u[1]);break;case i.OPS.endPath:this.endPath();break;case 92:this.group(o.items);break;default:(0,i.warn)("Unimplemented operator ".concat(l))}}}catch(t){a.e(t)}finally{a.f()}}},{key:"setWordSpacing",value:function setWordSpacing(t){this.current.wordSpacing=t}},{key:"setCharSpacing",value:function setCharSpacing(t){this.current.charSpacing=t}},{key:"nextLine",value:function nextLine(){this.moveText(0,this.current.leading)}},{key:"setTextMatrix",value:function setTextMatrix(t,r,a,i,o,l){var c=this.current;c.textMatrix=c.lineMatrix=[t,r,a,i,o,l];c.textMatrixScale=Math.hypot(t,r);c.x=c.lineX=0;c.y=c.lineY=0;c.xcoords=[];c.ycoords=[];c.tspan=this.svgFactory.createElement("svg:tspan");c.tspan.setAttributeNS(null,"font-family",c.fontFamily);c.tspan.setAttributeNS(null,"font-size","".concat(u(c.fontSize),"px"));c.tspan.setAttributeNS(null,"y",u(-c.y));c.txtElement=this.svgFactory.createElement("svg:text");c.txtElement.appendChild(c.tspan)}},{key:"beginText",value:function beginText(){var t=this.current;t.x=t.lineX=0;t.y=t.lineY=0;t.textMatrix=i.IDENTITY_MATRIX;t.lineMatrix=i.IDENTITY_MATRIX;t.textMatrixScale=1;t.tspan=this.svgFactory.createElement("svg:tspan");t.txtElement=this.svgFactory.createElement("svg:text");t.txtgrp=this.svgFactory.createElement("svg:g");t.xcoords=[];t.ycoords=[]}},{key:"moveText",value:function moveText(t,r){var a=this.current;a.x=a.lineX+=t;a.y=a.lineY+=r;a.xcoords=[];a.ycoords=[];a.tspan=this.svgFactory.createElement("svg:tspan");a.tspan.setAttributeNS(null,"font-family",a.fontFamily);a.tspan.setAttributeNS(null,"font-size","".concat(u(a.fontSize),"px"));a.tspan.setAttributeNS(null,"y",u(-a.y))}},{key:"showText",value:function showText(t){var r=this.current,a=r.font,o=r.fontSize;if(0!==o){var l,c=r.fontSizeScale,p=r.charSpacing,v=r.wordSpacing,y=r.fontDirection,g=r.textHScale*y,m=a.vertical,_=m?1:-1,b=a.defaultVMetrics,A=o*r.fontMatrix[0],S=0,k=_createForOfIteratorHelper(t);try{for(k.s();!(l=k.n()).done;){var C=l.value;if(null!==C)if("number"!=typeof C){var x=(C.isSpace?v:0)+p,P=C.fontChar,w=void 0,T=void 0,R=C.width;if(m){var E=void 0,O=C.vmetric||b;E=-(E=C.vmetric?O[1]:.5*R)*A;var I=O[2]*A;R=O?-O[0]:R;w=E/c;T=(S+I)/c}else{w=S/c;T=0}if(C.isInFont||a.missingFile){r.xcoords.push(r.x+w);m&&r.ycoords.push(-r.y+T);r.tspan.textContent+=P}S+=m?R*A-x*y:R*A+x*y}else S+=_*C*o/1e3;else S+=y*v}}catch(t){k.e(t)}finally{k.f()}r.tspan.setAttributeNS(null,"x",r.xcoords.map(u).join(" "));m?r.tspan.setAttributeNS(null,"y",r.ycoords.map(u).join(" ")):r.tspan.setAttributeNS(null,"y",u(-r.y));m?r.y-=S:r.x+=S*g;r.tspan.setAttributeNS(null,"font-family",r.fontFamily);r.tspan.setAttributeNS(null,"font-size","".concat(u(r.fontSize),"px"));r.fontStyle!==h.fontStyle&&r.tspan.setAttributeNS(null,"font-style",r.fontStyle);r.fontWeight!==h.fontWeight&&r.tspan.setAttributeNS(null,"font-weight",r.fontWeight);var D=r.textRenderingMode&i.TextRenderingMode.FILL_STROKE_MASK;if(D===i.TextRenderingMode.FILL||D===i.TextRenderingMode.FILL_STROKE){r.fillColor!==h.fillColor&&r.tspan.setAttributeNS(null,"fill",r.fillColor);r.fillAlpha<1&&r.tspan.setAttributeNS(null,"fill-opacity",r.fillAlpha)}else r.textRenderingMode===i.TextRenderingMode.ADD_TO_PATH?r.tspan.setAttributeNS(null,"fill","transparent"):r.tspan.setAttributeNS(null,"fill","none");if(D===i.TextRenderingMode.STROKE||D===i.TextRenderingMode.FILL_STROKE){var M=1/(r.textMatrixScale||1);this._setStrokeAttributes(r.tspan,M)}var L=r.textMatrix;0!==r.textRise&&((L=L.slice())[5]+=r.textRise);r.txtElement.setAttributeNS(null,"transform","".concat(d(L)," scale(").concat(u(g),", -1)"));r.txtElement.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");r.txtElement.appendChild(r.tspan);r.txtgrp.appendChild(r.txtElement);this._ensureTransformGroup().appendChild(r.txtElement)}}},{key:"setLeadingMoveText",value:function setLeadingMoveText(t,r){this.setLeading(-r);this.moveText(t,r)}},{key:"addFontStyle",value:function addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.appendChild(this.cssStyle)}var r=y(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(t.loadedName,'";')+" src: url(".concat(r,"); }\n")}},{key:"setFont",value:function setFont(t){var r=this.current,a=this.commonObjs.get(t[0]),o=t[1];r.font=a;if(this.embedFonts&&!a.missingFile&&!this.embeddedFonts[a.loadedName]){this.addFontStyle(a);this.embeddedFonts[a.loadedName]=a}r.fontMatrix=a.fontMatrix||i.FONT_IDENTITY_MATRIX;var l="normal";a.black?l="900":a.bold&&(l="bold");var c=a.italic?"italic":"normal";if(o<0){o=-o;r.fontDirection=-1}else r.fontDirection=1;r.fontSize=o;r.fontFamily=a.loadedName;r.fontWeight=l;r.fontStyle=c;r.tspan=this.svgFactory.createElement("svg:tspan");r.tspan.setAttributeNS(null,"y",u(-r.y));r.xcoords=[];r.ycoords=[]}},{key:"endText",value:function endText(){var t,r=this.current;if(r.textRenderingMode&i.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=r.txtElement)&&void 0!==t&&t.hasChildNodes()){r.element=r.txtElement;this.clip("nonzero");this.endPath()}}},{key:"setLineWidth",value:function setLineWidth(t){t>0&&(this.current.lineWidth=t)}},{key:"setLineCap",value:function setLineCap(t){this.current.lineCap=p[t]}},{key:"setLineJoin",value:function setLineJoin(t){this.current.lineJoin=v[t]}},{key:"setMiterLimit",value:function setMiterLimit(t){this.current.miterLimit=t}},{key:"setStrokeAlpha",value:function setStrokeAlpha(t){this.current.strokeAlpha=t}},{key:"setStrokeRGBColor",value:function setStrokeRGBColor(t,r,a){this.current.strokeColor=i.Util.makeHexColor(t,r,a)}},{key:"setFillAlpha",value:function setFillAlpha(t){this.current.fillAlpha=t}},{key:"setFillRGBColor",value:function setFillRGBColor(t,r,a){this.current.fillColor=i.Util.makeHexColor(t,r,a);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}},{key:"setStrokeColorN",value:function setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}},{key:"setFillColorN",value:function setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}},{key:"shadingFill",value:function shadingFill(t){var r=this.viewport.width,a=this.viewport.height,o=i.Util.inverseTransform(this.transformMatrix),l=i.Util.applyTransform([0,0],o),c=i.Util.applyTransform([0,a],o),u=i.Util.applyTransform([r,0],o),d=i.Util.applyTransform([r,a],o),h=Math.min(l[0],c[0],u[0],d[0]),p=Math.min(l[1],c[1],u[1],d[1]),v=Math.max(l[0],c[0],u[0],d[0]),y=Math.max(l[1],c[1],u[1],d[1]),g=this.svgFactory.createElement("svg:rect");g.setAttributeNS(null,"x",h);g.setAttributeNS(null,"y",p);g.setAttributeNS(null,"width",v-h);g.setAttributeNS(null,"height",y-p);g.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&g.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().appendChild(g)}},{key:"_makeColorN_Pattern",value:function _makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}},{key:"_makeTilingPattern",value:function _makeTilingPattern(t){var r=t[1],a=t[2],o=t[3]||i.IDENTITY_MATRIX,l=_slicedToArray(t[4],4),c=l[0],u=l[1],d=l[2],h=l[3],p=t[5],v=t[6],y=t[7],g="shading".concat(A++),m=_slicedToArray(i.Util.normalizeRect([].concat(_toConsumableArray(i.Util.applyTransform([c,u],o)),_toConsumableArray(i.Util.applyTransform([d,h],o)))),4),_=m[0],b=m[1],S=m[2],k=m[3],C=_slicedToArray(i.Util.singularValueDecompose2dScale(o),2),x=p*C[0],P=v*C[1],w=this.svgFactory.createElement("svg:pattern");w.setAttributeNS(null,"id",g);w.setAttributeNS(null,"patternUnits","userSpaceOnUse");w.setAttributeNS(null,"width",x);w.setAttributeNS(null,"height",P);w.setAttributeNS(null,"x","".concat(_));w.setAttributeNS(null,"y","".concat(b));var T=this.svg,R=this.transformMatrix,E=this.current.fillColor,O=this.current.strokeColor,I=this.svgFactory.create(S-_,k-b);this.svg=I;this.transformMatrix=o;if(2===y){var D=i.Util.makeHexColor.apply(i.Util,_toConsumableArray(r));this.current.fillColor=D;this.current.strokeColor=D}this.executeOpTree(this.convertOpList(a));this.svg=T;this.transformMatrix=R;this.current.fillColor=E;this.current.strokeColor=O;w.appendChild(I.childNodes[0]);this.defs.appendChild(w);return"url(#".concat(g,")")}},{key:"_makeShadingPattern",value:function _makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":var r,a="shading".concat(A++),o=t[3];switch(t[1]){case"axial":var l=t[4],c=t[5];(r=this.svgFactory.createElement("svg:linearGradient")).setAttributeNS(null,"id",a);r.setAttributeNS(null,"gradientUnits","userSpaceOnUse");r.setAttributeNS(null,"x1",l[0]);r.setAttributeNS(null,"y1",l[1]);r.setAttributeNS(null,"x2",c[0]);r.setAttributeNS(null,"y2",c[1]);break;case"radial":var u=t[4],d=t[5],h=t[6],p=t[7];(r=this.svgFactory.createElement("svg:radialGradient")).setAttributeNS(null,"id",a);r.setAttributeNS(null,"gradientUnits","userSpaceOnUse");r.setAttributeNS(null,"cx",d[0]);r.setAttributeNS(null,"cy",d[1]);r.setAttributeNS(null,"r",p);r.setAttributeNS(null,"fx",u[0]);r.setAttributeNS(null,"fy",u[1]);r.setAttributeNS(null,"fr",h);break;default:throw new Error("Unknown RadialAxial type: ".concat(t[1]))}var v,y=_createForOfIteratorHelper(o);try{for(y.s();!(v=y.n()).done;){var g=v.value,m=this.svgFactory.createElement("svg:stop");m.setAttributeNS(null,"offset",g[0]);m.setAttributeNS(null,"stop-color",g[1]);r.appendChild(m)}}catch(t){y.e(t)}finally{y.f()}this.defs.appendChild(r);return"url(#".concat(a,")");case"Mesh":(0,i.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(t[0]))}}},{key:"setDash",value:function setDash(t,r){this.current.dashArray=t;this.current.dashPhase=r}},{key:"constructPath",value:function constructPath(t,r){var a,o=this.current,l=o.x,c=o.y,d=[],h=0,p=_createForOfIteratorHelper(t);try{for(p.s();!(a=p.n()).done;){switch(0|a.value){case i.OPS.rectangle:l=r[h++];c=r[h++];var v=r[h++],y=r[h++],g=l+v,m=c+y;d.push("M",u(l),u(c),"L",u(g),u(c),"L",u(g),u(m),"L",u(l),u(m),"Z");break;case i.OPS.moveTo:l=r[h++];c=r[h++];d.push("M",u(l),u(c));break;case i.OPS.lineTo:l=r[h++];c=r[h++];d.push("L",u(l),u(c));break;case i.OPS.curveTo:l=r[h+4];c=r[h+5];d.push("C",u(r[h]),u(r[h+1]),u(r[h+2]),u(r[h+3]),u(l),u(c));h+=6;break;case i.OPS.curveTo2:d.push("C",u(l),u(c),u(r[h]),u(r[h+1]),u(r[h+2]),u(r[h+3]));l=r[h+2];c=r[h+3];h+=4;break;case i.OPS.curveTo3:l=r[h+2];c=r[h+3];d.push("C",u(r[h]),u(r[h+1]),u(l),u(c),u(l),u(c));h+=4;break;case i.OPS.closePath:d.push("Z")}}}catch(t){p.e(t)}finally{p.f()}d=d.join(" ");if(o.path&&t.length>0&&t[0]!==i.OPS.rectangle&&t[0]!==i.OPS.moveTo)d=o.path.getAttributeNS(null,"d")+d;else{o.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().appendChild(o.path)}o.path.setAttributeNS(null,"d",d);o.path.setAttributeNS(null,"fill","none");o.element=o.path;o.setCurrentPoint(l,c)}},{key:"endPath",value:function endPath(){var t=this.current;t.path=null;if(this.pendingClip)if(t.element){var r="clippath".concat(_++),a=this.svgFactory.createElement("svg:clipPath");a.setAttributeNS(null,"id",r);a.setAttributeNS(null,"transform",d(this.transformMatrix));var i=t.element.cloneNode(!0);"evenodd"===this.pendingClip?i.setAttributeNS(null,"clip-rule","evenodd"):i.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;a.appendChild(i);this.defs.appendChild(a);if(t.activeClipUrl){t.clipGroup=null;var o,l=_createForOfIteratorHelper(this.extraStack);try{for(l.s();!(o=l.n()).done;){o.value.clipGroup=null}}catch(t){l.e(t)}finally{l.f()}a.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl="url(#".concat(r,")");this.tgrp=null}else this.pendingClip=null}},{key:"clip",value:function clip(t){this.pendingClip=t}},{key:"closePath",value:function closePath(){var t=this.current;if(t.path){var r="".concat(t.path.getAttributeNS(null,"d"),"Z");t.path.setAttributeNS(null,"d",r)}}},{key:"setLeading",value:function setLeading(t){this.current.leading=-t}},{key:"setTextRise",value:function setTextRise(t){this.current.textRise=t}},{key:"setTextRenderingMode",value:function setTextRenderingMode(t){this.current.textRenderingMode=t}},{key:"setHScale",value:function setHScale(t){this.current.textHScale=t/100}},{key:"setRenderingIntent",value:function setRenderingIntent(t){}},{key:"setFlatness",value:function setFlatness(t){}},{key:"setGState",value:function setGState(t){var r,a=_createForOfIteratorHelper(t);try{for(a.s();!(r=a.n()).done;){var o=_slicedToArray(r.value,2),l=o[0],c=o[1];switch(l){case"LW":this.setLineWidth(c);break;case"LC":this.setLineCap(c);break;case"LJ":this.setLineJoin(c);break;case"ML":this.setMiterLimit(c);break;case"D":this.setDash(c[0],c[1]);break;case"RI":this.setRenderingIntent(c);break;case"FL":this.setFlatness(c);break;case"Font":this.setFont(c);break;case"CA":this.setStrokeAlpha(c);break;case"ca":this.setFillAlpha(c);break;default:(0,i.warn)("Unimplemented graphic state operator ".concat(l))}}}catch(t){a.e(t)}finally{a.f()}}},{key:"fill",value:function fill(){var t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}},{key:"stroke",value:function stroke(){var t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}},{key:"_setStrokeAttributes",value:function _setStrokeAttributes(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=this.current,i=a.dashArray;1!==r&&i.length>0&&(i=i.map((function(t){return r*t})));t.setAttributeNS(null,"stroke",a.strokeColor);t.setAttributeNS(null,"stroke-opacity",a.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",u(a.miterLimit));t.setAttributeNS(null,"stroke-linecap",a.lineCap);t.setAttributeNS(null,"stroke-linejoin",a.lineJoin);t.setAttributeNS(null,"stroke-width",u(r*a.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",i.map(u).join(" "));t.setAttributeNS(null,"stroke-dashoffset",u(r*a.dashPhase)+"px")}},{key:"eoFill",value:function eoFill(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd");this.fill()}},{key:"fillStroke",value:function fillStroke(){this.stroke();this.fill()}},{key:"eoFillStroke",value:function eoFillStroke(){this.current.element&&this.current.element.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}},{key:"closeStroke",value:function closeStroke(){this.closePath();this.stroke()}},{key:"closeFillStroke",value:function closeFillStroke(){this.closePath();this.fillStroke()}},{key:"closeEOFillStroke",value:function closeEOFillStroke(){this.closePath();this.eoFillStroke()}},{key:"paintSolidColorImageMask",value:function paintSolidColorImageMask(){var t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().appendChild(t)}},{key:"paintImageXObject",value:function paintImageXObject(t){var r=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);r?this.paintInlineImageXObject(r):(0,i.warn)("Dependent image with object ID ".concat(t," is not ready yet"))}},{key:"paintInlineImageXObject",value:function paintInlineImageXObject(t,r){var a=t.width,i=t.height,o=g(t,this.forceDataSchema,!!r),l=this.svgFactory.createElement("svg:rect");l.setAttributeNS(null,"x","0");l.setAttributeNS(null,"y","0");l.setAttributeNS(null,"width",u(a));l.setAttributeNS(null,"height",u(i));this.current.element=l;this.clip("nonzero");var c=this.svgFactory.createElement("svg:image");c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);c.setAttributeNS(null,"x","0");c.setAttributeNS(null,"y",u(-i));c.setAttributeNS(null,"width",u(a)+"px");c.setAttributeNS(null,"height",u(i)+"px");c.setAttributeNS(null,"transform","scale(".concat(u(1/a)," ").concat(u(-1/i),")"));r?r.appendChild(c):this._ensureTransformGroup().appendChild(c)}},{key:"paintImageMaskXObject",value:function paintImageMaskXObject(t){var r=this.current,a=t.width,i=t.height,o=r.fillColor;r.maskId="mask".concat(b++);var l=this.svgFactory.createElement("svg:mask");l.setAttributeNS(null,"id",r.maskId);var c=this.svgFactory.createElement("svg:rect");c.setAttributeNS(null,"x","0");c.setAttributeNS(null,"y","0");c.setAttributeNS(null,"width",u(a));c.setAttributeNS(null,"height",u(i));c.setAttributeNS(null,"fill",o);c.setAttributeNS(null,"mask","url(#".concat(r.maskId,")"));this.defs.appendChild(l);this._ensureTransformGroup().appendChild(c);this.paintInlineImageXObject(t,l)}},{key:"paintFormXObjectBegin",value:function paintFormXObjectBegin(t,r){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(r){var a=r[2]-r[0],i=r[3]-r[1],o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x",r[0]);o.setAttributeNS(null,"y",r[1]);o.setAttributeNS(null,"width",u(a));o.setAttributeNS(null,"height",u(i));this.current.element=o;this.clip("nonzero");this.endPath()}}},{key:"paintFormXObjectEnd",value:function paintFormXObjectEnd(){}},{key:"_initialize",value:function _initialize(t){var r=this.svgFactory.create(t.width,t.height),a=this.svgFactory.createElement("svg:defs");r.appendChild(a);this.defs=a;var i=this.svgFactory.createElement("svg:g");i.setAttributeNS(null,"transform",d(t.transform));r.appendChild(i);this.svg=i;return r}},{key:"_ensureClipGroup",value:function _ensureClipGroup(){if(!this.current.clipGroup){var t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.appendChild(t);this.current.clipGroup=t}return this.current.clipGroup}},{key:"_ensureTransformGroup",value:function _ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",d(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().appendChild(this.tgrp):this.svg.appendChild(this.tgrp)}return this.tgrp}}]);return SVGGraphics}()},(t,r,a)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.PDFNodeStream=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1),l=a(165);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var a,i=_getPrototypeOf(t);if(r){var o=_getPrototypeOf(this).constructor;a=Reflect.construct(i,arguments,o)}else a=i.apply(this,arguments);return _possibleConstructorReturn(this,a)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var c=require("fs"),u=require("http"),d=require("https"),h=require("url"),p=/^file:\/\/\/[a-zA-Z]:\//;var v=function(){function PDFNodeStream(t){_classCallCheck(this,PDFNodeStream);this.source=t;this.url=function parseUrl(t){var r=h.parse(t);if("file:"===r.protocol||r.host)return r;if(/^[a-z]:[/\\]/i.test(t))return h.parse("file:///".concat(t));r.host||(r.protocol="file:");return r}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFNodeStream,[{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"getFullReader",value:function getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new b(this):new m(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=this.isFsUrl?new A(this,t,r):new _(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var r,a=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(a.s();!(r=a.n()).done;){r.value.cancel(t)}}catch(t){a.e(t)}finally{a.f()}}}]);return PDFNodeStream}();r.PDFNodeStream=v;var y=function(){function BaseFullReader(t){_classCallCheck(this,BaseFullReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;var r=t.source;this._contentLength=r.length;this._loaded=0;this._filename=null;this._disableRange=r.disableRange||!1;this._rangeChunkSize=r.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!r.disableStream;this._isRangeSupported=!r.disableRange;this._readableStream=null;this._readCapability=(0,o.createPromiseCapability)();this._headersCapability=(0,o.createPromiseCapability)()}_createClass(BaseFullReader,[{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee(){var t,r;return i.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:a.next=2;return this._readCapability.promise;case 2:if(!this._done){a.next=4;break}return a.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){a.next=6;break}throw this._storedError;case 6:if(null!==(t=this._readableStream.read())){a.next=10;break}this._readCapability=(0,o.createPromiseCapability)();return a.abrupt("return",this.read());case 10:this._loaded+=t.length;this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});r=new Uint8Array(t).buffer;return a.abrupt("return",{value:r,done:!1});case 14:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new o.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}]);var t;return BaseFullReader}(),g=function(){function BaseRangeReader(t){_classCallCheck(this,BaseRangeReader);this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,o.createPromiseCapability)();var r=t.source;this._isStreamingSupported=!r.disableStream}_createClass(BaseRangeReader,[{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee2(){var t,r;return i.default.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:a.next=2;return this._readCapability.promise;case 2:if(!this._done){a.next=4;break}return a.abrupt("return",{value:void 0,done:!0});case 4:if(!this._storedError){a.next=6;break}throw this._storedError;case 6:if(null!==(t=this._readableStream.read())){a.next=10;break}this._readCapability=(0,o.createPromiseCapability)();return a.abrupt("return",this.read());case 10:this._loaded+=t.length;this.onProgress&&this.onProgress({loaded:this._loaded});r=new Uint8Array(t).buffer;return a.abrupt("return",{value:r,done:!1});case 14:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}},{key:"_error",value:function _error(t){this._storedError=t;this._readCapability.resolve()}},{key:"_setReadableStream",value:function _setReadableStream(t){var r=this;this._readableStream=t;t.on("readable",(function(){r._readCapability.resolve()}));t.on("end",(function(){t.destroy();r._done=!0;r._readCapability.resolve()}));t.on("error",(function(t){r._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}]);var t;return BaseRangeReader}();function createRequestOptions(t,r){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:r}}var m=function(t){_inherits(PDFNodeStreamFullReader,t);var r=_createSuper(PDFNodeStreamFullReader);function PDFNodeStreamFullReader(t){var a;_classCallCheck(this,PDFNodeStreamFullReader);var i=function handleResponse(r){if(404!==r.statusCode){a._headersCapability.resolve();a._setReadableStream(r);var i=function getResponseHeader(t){return a._readableStream.headers[t.toLowerCase()]},c=(0,l.validateRangeRequestCapabilities)({getResponseHeader:i,isHttp:t.isHttp,rangeChunkSize:a._rangeChunkSize,disableRange:a._disableRange}),u=c.allowRangeRequests,d=c.suggestedLength;a._isRangeSupported=u;a._contentLength=d||a._contentLength;a._filename=(0,l.extractFilenameFromHeader)(i)}else{var h=new o.MissingPDFException('Missing PDF "'.concat(a._url,'".'));a._storedError=h;a._headersCapability.reject(h)}};(a=r.call(this,t))._request=null;"http:"===a._url.protocol?a._request=u.request(createRequestOptions(a._url,t.httpHeaders),i):a._request=d.request(createRequestOptions(a._url,t.httpHeaders),i);a._request.on("error",(function(t){a._storedError=t;a._headersCapability.reject(t)}));a._request.end();return a}return _createClass(PDFNodeStreamFullReader)}(y),_=function(t){_inherits(PDFNodeStreamRangeReader,t);var r=_createSuper(PDFNodeStreamRangeReader);function PDFNodeStreamRangeReader(t,a,i){var l;_classCallCheck(this,PDFNodeStreamRangeReader);(l=r.call(this,t))._httpHeaders={};for(var c in t.httpHeaders){var h=t.httpHeaders[c];void 0!==h&&(l._httpHeaders[c]=h)}l._httpHeaders.Range="bytes=".concat(a,"-").concat(i-1);var p=function handleResponse(t){if(404!==t.statusCode)l._setReadableStream(t);else{var r=new o.MissingPDFException('Missing PDF "'.concat(l._url,'".'));l._storedError=r}};l._request=null;"http:"===l._url.protocol?l._request=u.request(createRequestOptions(l._url,l._httpHeaders),p):l._request=d.request(createRequestOptions(l._url,l._httpHeaders),p);l._request.on("error",(function(t){l._storedError=t}));l._request.end();return l}return _createClass(PDFNodeStreamRangeReader)}(g),b=function(t){_inherits(PDFNodeStreamFsFullReader,t);var r=_createSuper(PDFNodeStreamFsFullReader);function PDFNodeStreamFsFullReader(t){var a;_classCallCheck(this,PDFNodeStreamFsFullReader);a=r.call(this,t);var i=decodeURIComponent(a._url.path);p.test(a._url.href)&&(i=i.replace(/^\//,""));c.lstat(i,(function(t,r){if(t){"ENOENT"===t.code&&(t=new o.MissingPDFException('Missing PDF "'.concat(i,'".')));a._storedError=t;a._headersCapability.reject(t)}else{a._contentLength=r.size;a._setReadableStream(c.createReadStream(i));a._headersCapability.resolve()}}));return a}return _createClass(PDFNodeStreamFsFullReader)}(y),A=function(t){_inherits(PDFNodeStreamFsRangeReader,t);var r=_createSuper(PDFNodeStreamFsRangeReader);function PDFNodeStreamFsRangeReader(t,a,i){var o;_classCallCheck(this,PDFNodeStreamFsRangeReader);o=r.call(this,t);var l=decodeURIComponent(o._url.path);p.test(o._url.href)&&(l=l.replace(/^\//,""));o._setReadableStream(c.createReadStream(l,{start:a,end:i-1}));return o}return _createClass(PDFNodeStreamFsRangeReader)}(g)},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.createResponseStatusError=function createResponseStatusError(t,r){if(404===t||0===t&&r.startsWith("file:"))return new i.MissingPDFException('Missing PDF "'+r+'".');return new i.UnexpectedResponseException("Unexpected server response (".concat(t,') while retrieving PDF "').concat(r,'".'),t)};r.extractFilenameFromHeader=function extractFilenameFromHeader(t){var r=t("Content-Disposition");if(r){var a=(0,o.getFilenameFromContentDispositionHeader)(r);if(a.includes("%"))try{a=decodeURIComponent(a)}catch(t){}if((0,l.isPdfFile)(a))return a}return null};r.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){var r=t.getResponseHeader,a=t.isHttp,i=t.rangeChunkSize,o=t.disableRange,l={allowRangeRequests:!1,suggestedLength:void 0},c=parseInt(r("Content-Length"),10);if(!Number.isInteger(c))return l;l.suggestedLength=c;if(c<=2*i)return l;if(o||!a)return l;if("bytes"!==r("Accept-Ranges"))return l;if("identity"!==(r("Content-Encoding")||"identity"))return l;l.allowRangeRequests=!0;return l};r.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var i=a(1),o=a(166),l=a(146)},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){var r=!0,a=toParamRegExp("filename\\*","i").exec(t);if(a){var o=rfc2616unquote(a=a[1]);return fixupEncoding(o=rfc2047decode(o=rfc5987decode(o=unescape(o))))}if(a=function rfc2231getparam(t){var r,a=[],i=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(r=i.exec(t));){var o=_slicedToArray(r,4),l=o[1],c=o[2],u=o[3];if((l=parseInt(l,10))in a){if(0===l)break}else a[l]=[c,u]}for(var d=[],h=0;h<a.length&&h in a;++h){var p=_slicedToArray(a[h],2),v=p[0],y=p[1];y=rfc2616unquote(y);if(v){y=unescape(y);0===h&&(y=rfc5987decode(y))}d.push(y)}return d.join("")}(t)){return fixupEncoding(rfc2047decode(a))}if(a=toParamRegExp("filename","i").exec(t)){var l=rfc2616unquote(a=a[1]);return fixupEncoding(l=rfc2047decode(l))}function toParamRegExp(t,r){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',r)}function textdecode(t,a){if(t){if(!/^[\x00-\xFF]+$/.test(a))return a;try{var o=new TextDecoder(t,{fatal:!0}),l=(0,i.stringToBytes)(a);a=o.decode(l);r=!1}catch(t){}}return a}function fixupEncoding(t){if(r&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);r&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){for(var r=t.slice(1).split('\\"'),a=0;a<r.length;++a){var i=r[a].indexOf('"');if(-1!==i){r[a]=r[a].slice(0,i);r.length=a+1}r[a]=r[a].replace(/\\(.)/g,"$1")}t=r.join('"')}return t}function rfc5987decode(t){var r=t.indexOf("'");return-1===r?t:textdecode(t.slice(0,r),t.slice(r+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,r,a,i){if("q"===a||"Q"===a)return textdecode(r,i=(i=i.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,r){return String.fromCharCode(parseInt(r,16))})));try{i=atob(i)}catch(t){}return textdecode(r,i)}))}return""};var i=a(1);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var a=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==a)return;var i,o,l=[],c=!0,u=!1;try{for(a=a.call(t);!(c=(i=a.next()).done);c=!0){l.push(i.value);if(r&&l.length===r)break}}catch(t){u=!0;o=t}finally{try{c||null==a.return||a.return()}finally{if(u)throw o}}return l}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFNetworkStream=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1),l=a(165);function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}var c=function(){function NetworkManager(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,NetworkManager);this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&r.httpHeaders||Object.create(null);this.withCredentials=r.withCredentials||!1;this.getXhr=r.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}_createClass(NetworkManager,[{key:"requestRange",value:function requestRange(t,r,a){var i={begin:t,end:r};for(var o in a)i[o]=a[o];return this.request(i)}},{key:"requestFull",value:function requestFull(t){return this.request(t)}},{key:"request",value:function request(t){var r=this.getXhr(),a=this.currXhrId++,i=this.pendingRequests[a]={xhr:r};r.open("GET",this.url);r.withCredentials=this.withCredentials;for(var o in this.httpHeaders){var l=this.httpHeaders[o];void 0!==l&&r.setRequestHeader(o,l)}if(this.isHttp&&"begin"in t&&"end"in t){r.setRequestHeader("Range","bytes=".concat(t.begin,"-").concat(t.end-1));i.expectedStatus=206}else i.expectedStatus=200;r.responseType="arraybuffer";t.onError&&(r.onerror=function(a){t.onError(r.status)});r.onreadystatechange=this.onStateChange.bind(this,a);r.onprogress=this.onProgress.bind(this,a);i.onHeadersReceived=t.onHeadersReceived;i.onDone=t.onDone;i.onError=t.onError;i.onProgress=t.onProgress;r.send(null);return a}},{key:"onProgress",value:function onProgress(t,r){var a,i=this.pendingRequests[t];i&&(null===(a=i.onProgress)||void 0===a||a.call(i,r))}},{key:"onStateChange",value:function onStateChange(t,r){var a=this.pendingRequests[t];if(a){var i=a.xhr;if(i.readyState>=2&&a.onHeadersReceived){a.onHeadersReceived();delete a.onHeadersReceived}if(4===i.readyState&&t in this.pendingRequests){delete this.pendingRequests[t];if(0===i.status&&this.isHttp){var l;null===(l=a.onError)||void 0===l||l.call(a,i.status)}else{var c=i.status||200;if(200===c&&206===a.expectedStatus||c===a.expectedStatus){var u=function getArrayBuffer(t){var r=t.response;return"string"!=typeof r?r:(0,o.stringToBytes)(r).buffer}(i);if(206===c){var d=i.getResponseHeader("Content-Range"),h=/bytes (\d+)-(\d+)\/(\d+)/.exec(d);a.onDone({begin:parseInt(h[1],10),chunk:u})}else if(u)a.onDone({begin:0,chunk:u});else{var p;null===(p=a.onError)||void 0===p||p.call(a,i.status)}}else{var v;null===(v=a.onError)||void 0===v||v.call(a,i.status)}}}}}},{key:"getRequestXhr",value:function getRequestXhr(t){return this.pendingRequests[t].xhr}},{key:"isPendingRequest",value:function isPendingRequest(t){return t in this.pendingRequests}},{key:"abortRequest",value:function abortRequest(t){var r=this.pendingRequests[t].xhr;delete this.pendingRequests[t];r.abort()}}]);return NetworkManager}(),u=function(){function PDFNetworkStream(t){_classCallCheck(this,PDFNetworkStream);this._source=t;this._manager=new c(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFNetworkStream,[{key:"_onRangeRequestReaderClosed",value:function _onRangeRequestReaderClosed(t){var r=this._rangeRequestReaders.indexOf(t);r>=0&&this._rangeRequestReaders.splice(r,1)}},{key:"getFullReader",value:function getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new d(this._manager,this._source);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){var a=new h(this._manager,t,r);a.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){var r;null===(r=this._fullRequestReader)||void 0===r||r.cancel(t);var a,i=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(i.s();!(a=i.n()).done;){a.value.cancel(t)}}catch(t){i.e(t)}finally{i.f()}}}]);return PDFNetworkStream}();r.PDFNetworkStream=u;var d=function(){function PDFNetworkStreamFullRequestReader(t,r){_classCallCheck(this,PDFNetworkStreamFullRequestReader);this._manager=t;var a={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=r.url;this._fullRequestId=t.requestFull(a);this._headersReceivedCapability=(0,o.createPromiseCapability)();this._disableRange=r.disableRange||!1;this._contentLength=r.length;this._rangeChunkSize=r.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!1;this._isRangeSupported=!1;this._cachedChunks=[];this._requests=[];this._done=!1;this._storedError=void 0;this._filename=null;this.onProgress=null}_createClass(PDFNetworkStreamFullRequestReader,[{key:"_onHeadersReceived",value:function _onHeadersReceived(){var t=this._fullRequestId,r=this._manager.getRequestXhr(t),a=function getResponseHeader(t){return r.getResponseHeader(t)},i=(0,l.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),o=i.allowRangeRequests,c=i.suggestedLength;o&&(this._isRangeSupported=!0);this._contentLength=c||this._contentLength;this._filename=(0,l.extractFilenameFromHeader)(a);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}},{key:"_onDone",value:function _onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0}}},{key:"_onError",value:function _onError(t){this._storedError=(0,l.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.reject(this._storedError)}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._cachedChunks.length=0}},{key:"_onProgress",value:function _onProgress(t){var r;null===(r=this.onProgress)||void 0===r||r.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}},{key:"filename",get:function get(){return this._filename}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"headersReady",get:function get(){return this._headersReceivedCapability.promise}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee(){var t,r;return i.default.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(!(this._cachedChunks.length>0)){a.next=5;break}t=this._cachedChunks.shift();return a.abrupt("return",{value:t,done:!1});case 5:if(!this._done){a.next=7;break}return a.abrupt("return",{value:void 0,done:!0});case 7:r=(0,o.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 10:case"end":return a.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}]);var t;return PDFNetworkStreamFullRequestReader}(),h=function(){function PDFNetworkStreamRangeRequestReader(t,r,a){_classCallCheck(this,PDFNetworkStreamRangeRequestReader);this._manager=t;var i={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(r,a,i);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_createClass(PDFNetworkStreamRangeRequestReader,[{key:"_close",value:function _close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}},{key:"_onDone",value:function _onDone(t){var r=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:r,done:!1})}else this._queuedChunk=r;this._done=!0;var a,i=_createForOfIteratorHelper(this._requests);try{for(i.s();!(a=i.n()).done;){a.value.resolve({value:void 0,done:!0})}}catch(t){i.e(t)}finally{i.f()}this._requests.length=0;this._close()}},{key:"_onError",value:function _onError(t){this._storedError=(0,l.createResponseStatusError)(t,this._url);var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.reject(this._storedError)}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._queuedChunk=null}},{key:"_onProgress",value:function _onProgress(t){if(!this.isStreamingSupported){var r;null===(r=this.onProgress)||void 0===r||r.call(this,{loaded:t.loaded})}}},{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee2(){var t,r;return i.default.wrap((function _callee2$(a){for(;;)switch(a.prev=a.next){case 0:if(!this._storedError){a.next=2;break}throw this._storedError;case 2:if(null===this._queuedChunk){a.next=6;break}t=this._queuedChunk;this._queuedChunk=null;return a.abrupt("return",{value:t,done:!1});case 6:if(!this._done){a.next=8;break}return a.abrupt("return",{value:void 0,done:!0});case 8:r=(0,o.createPromiseCapability)();this._requests.push(r);return a.abrupt("return",r.promise);case 11:case"end":return a.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._done=!0;var r,a=_createForOfIteratorHelper(this._requests);try{for(a.s();!(r=a.n()).done;){r.value.resolve({value:void 0,done:!0})}}catch(t){a.e(t)}finally{a.f()}this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}]);var t;return PDFNetworkStreamRangeRequestReader}()},(t,r,a)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFFetchStream=void 0;var i=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(a(144)),o=a(1),l=a(165);function asyncGeneratorStep(t,r,a,i,o,l,c){try{var u=t[l](c),d=u.value}catch(t){a(t);return}u.done?r(d):Promise.resolve(d).then(i,o)}function _asyncToGenerator(t){return function(){var r=this,a=arguments;return new Promise((function(i,o){var l=t.apply(r,a);function _next(t){asyncGeneratorStep(l,i,o,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(l,i,o,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){a&&(t=a);var i=0,o=function F(){};return{s:o,n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,u=!1;return{s:function s(){a=a.call(t)},n:function n(){var t=a.next();c=t.done;return t},e:function e(t){u=!0;l=t},f:function f(){try{c||null==a.return||a.return()}finally{if(u)throw l}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var a=0,i=new Array(r);a<r;a++)i[a]=t[a];return i}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var a=0;a<r.length;a++){var i=r[a];i.enumerable=i.enumerable||!1;i.configurable=!0;"value"in i&&(i.writable=!0);Object.defineProperty(t,i.key,i)}}function _createClass(t,r,a){r&&_defineProperties(t.prototype,r);a&&_defineProperties(t,a);Object.defineProperty(t,"prototype",{writable:!1});return t}function createFetchOptions(t,r,a){return{method:"GET",headers:t,signal:null==a?void 0:a.signal,mode:"cors",credentials:r?"include":"same-origin",redirect:"follow"}}function createHeaders(t){var r=new Headers;for(var a in t){var i=t[a];void 0!==i&&r.append(a,i)}return r}var c=function(){function PDFFetchStream(t){_classCallCheck(this,PDFFetchStream);this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFFetchStream,[{key:"_progressiveDataLength",get:function get(){var t,r;return null!==(t=null===(r=this._fullRequestReader)||void 0===r?void 0:r._loaded)&&void 0!==t?t:0}},{key:"getFullReader",value:function getFullReader(){(0,o.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new u(this);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){if(r<=this._progressiveDataLength)return null;var a=new d(this,t,r);this._rangeRequestReaders.push(a);return a}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var r,a=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(a.s();!(r=a.n()).done;){r.value.cancel(t)}}catch(t){a.e(t)}finally{a.f()}}}]);return PDFFetchStream}();r.PDFFetchStream=c;var u=function(){function PDFFetchStreamReader(t){var r=this;_classCallCheck(this,PDFFetchStreamReader);this._stream=t;this._reader=null;this._loaded=0;this._filename=null;var a=t.source;this._withCredentials=a.withCredentials||!1;this._contentLength=a.length;this._headersCapability=(0,o.createPromiseCapability)();this._disableRange=a.disableRange||!1;this._rangeChunkSize=a.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);"undefined"!=typeof AbortController&&(this._abortController=new AbortController);this._isStreamingSupported=!a.disableStream;this._isRangeSupported=!a.disableRange;this._headers=createHeaders(this._stream.httpHeaders);var i=a.url;fetch(i,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!(0,l.validateResponseStatus)(t.status))throw(0,l.createResponseStatusError)(t.status,i);r._reader=t.body.getReader();r._headersCapability.resolve();var a=function getResponseHeader(r){return t.headers.get(r)},c=(0,l.validateRangeRequestCapabilities)({getResponseHeader:a,isHttp:r._stream.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),u=c.allowRangeRequests,d=c.suggestedLength;r._isRangeSupported=u;r._contentLength=d||r._contentLength;r._filename=(0,l.extractFilenameFromHeader)(a);!r._isStreamingSupported&&r._isRangeSupported&&r.cancel(new o.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}_createClass(PDFFetchStreamReader,[{key:"headersReady",get:function get(){return this._headersCapability.promise}},{key:"filename",get:function get(){return this._filename}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee(){var t,r,a,o;return i.default.wrap((function _callee$(i){for(;;)switch(i.prev=i.next){case 0:i.next=2;return this._headersCapability.promise;case 2:i.next=4;return this._reader.read();case 4:t=i.sent;r=t.value;if(!(a=t.done)){i.next=9;break}return i.abrupt("return",{value:r,done:a});case 9:this._loaded+=r.byteLength;this.onProgress&&this.onProgress({loaded:this._loaded,total:this._contentLength});o=new Uint8Array(r).buffer;return i.abrupt("return",{value:o,done:!1});case 13:case"end":return i.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._reader&&this._reader.cancel(t);this._abortController&&this._abortController.abort()}}]);var t;return PDFFetchStreamReader}(),d=function(){function PDFFetchStreamRangeReader(t,r,a){var i=this;_classCallCheck(this,PDFFetchStreamRangeReader);this._stream=t;this._reader=null;this._loaded=0;var c=t.source;this._withCredentials=c.withCredentials||!1;this._readCapability=(0,o.createPromiseCapability)();this._isStreamingSupported=!c.disableStream;"undefined"!=typeof AbortController&&(this._abortController=new AbortController);this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range","bytes=".concat(r,"-").concat(a-1));var u=c.url;fetch(u,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((function(t){if(!(0,l.validateResponseStatus)(t.status))throw(0,l.createResponseStatusError)(t.status,u);i._readCapability.resolve();i._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}_createClass(PDFFetchStreamRangeReader,[{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"read",value:(t=_asyncToGenerator(i.default.mark((function _callee2(){var t,r,a,o;return i.default.wrap((function _callee2$(i){for(;;)switch(i.prev=i.next){case 0:i.next=2;return this._readCapability.promise;case 2:i.next=4;return this._reader.read();case 4:t=i.sent;r=t.value;if(!(a=t.done)){i.next=9;break}return i.abrupt("return",{value:r,done:a});case 9:this._loaded+=r.byteLength;this.onProgress&&this.onProgress({loaded:this._loaded});o=new Uint8Array(r).buffer;return i.abrupt("return",{value:o,done:!1});case 13:case"end":return i.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._reader&&this._reader.cancel(t);this._abortController&&this._abortController.abort()}}]);var t;return PDFFetchStreamRangeReader}()}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var r=__webpack_module_cache__[t];if(void 0!==r)return r.exports;var a=__webpack_module_cache__[t]={id:t,loaded:!1,exports:{}};__webpack_modules__[t](a,a.exports,__w_pdfjs_require__);a.loaded=!0;return a.exports}__w_pdfjs_require__.nmd=t=>{t.paths=[];t.children||(t.children=[]);return t};var __webpack_exports__={};(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function get(){return o.AnnotationLayer}});Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function get(){return r.AnnotationMode}});Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function get(){return r.CMapCompressionType}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function get(){return l.GlobalWorkerOptions}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function get(){return r.InvalidPDFException}});Object.defineProperty(t,"LoopbackPort",{enumerable:!0,get:function get(){return a.LoopbackPort}});Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function get(){return r.MissingPDFException}});Object.defineProperty(t,"OPS",{enumerable:!0,get:function get(){return r.OPS}});Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function get(){return a.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function get(){return i.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function get(){return a.PDFWorker}});Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function get(){return r.PasswordResponses}});Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function get(){return r.PermissionFlag}});Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function get(){return i.PixelsPerInch}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function get(){return i.RenderingCancelledException}});Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function get(){return d.SVGGraphics}});Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function get(){return r.UNSUPPORTED_FEATURES}});Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function get(){return r.UnexpectedResponseException}});Object.defineProperty(t,"Util",{enumerable:!0,get:function get(){return r.Util}});Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function get(){return r.VerbosityLevel}});Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function get(){return h.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function get(){return a.build}});Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function get(){return r.createPromiseCapability}});Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function get(){return r.createValidAbsoluteUrl}});Object.defineProperty(t,"getDocument",{enumerable:!0,get:function get(){return a.getDocument}});Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function get(){return i.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function get(){return i.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function get(){return i.getXfaPageViewport}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function get(){return i.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function get(){return i.loadScript}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function get(){return u.renderTextLayer}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function get(){return r.shadow}});Object.defineProperty(t,"version",{enumerable:!0,get:function get(){return a.version}});var r=__w_pdfjs_require__(1),a=__w_pdfjs_require__(143),i=__w_pdfjs_require__(146),o=__w_pdfjs_require__(159),l=__w_pdfjs_require__(153),c=__w_pdfjs_require__(3),u=__w_pdfjs_require__(162),d=__w_pdfjs_require__(163),h=__w_pdfjs_require__(161);if(c.isNodeJS){var p=__w_pdfjs_require__(164).PDFNodeStream;(0,a.setPDFNetworkStreamFactory)((function(t){return new p(t)}))}else{var v=__w_pdfjs_require__(167).PDFNetworkStream,y=__w_pdfjs_require__(168).PDFFetchStream;(0,a.setPDFNetworkStreamFactory)((function(t){return(0,i.isValidFetchUrl)(t.url)?new y(t):new v(t)}))}})();return __webpack_exports__})()}));\ No newline at end of file+!function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf",[],e):"object"==typeof exports?exports["pdfjs-dist/build/pdf"]=e():t["pdfjs-dist/build/pdf"]=t.pdfjsLib=e()}(globalThis,(()=>(()=>{var __webpack_modules__=[,(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.VerbosityLevel=e.Util=e.UnknownErrorException=e.UnexpectedResponseException=e.UNSUPPORTED_FEATURES=e.TextRenderingMode=e.StreamType=e.RenderingIntentFlag=e.PermissionFlag=e.PasswordResponses=e.PasswordException=e.PageActionEventType=e.OPS=e.MissingPDFException=e.LINE_FACTOR=e.LINE_DESCENT_FACTOR=e.InvalidPDFException=e.ImageKind=e.IDENTITY_MATRIX=e.FormatError=e.FontType=e.FeatureTest=e.FONT_IDENTITY_MATRIX=e.DocumentActionEventType=e.CMapCompressionType=e.BaseException=e.AnnotationType=e.AnnotationStateModelType=e.AnnotationReviewState=e.AnnotationReplyType=e.AnnotationMode=e.AnnotationMarkedState=e.AnnotationFlag=e.AnnotationFieldFlag=e.AnnotationEditorType=e.AnnotationEditorPrefix=e.AnnotationEditorParamsType=e.AnnotationBorderStyleType=e.AnnotationActionEventType=e.AbortException=void 0;e.arrayByteLength=arrayByteLength;e.arraysToBytes=function arraysToBytes(t){const e=t.length;if(1===e&&t[0]instanceof Uint8Array)return t[0];let i=0;for(let r=0;r<e;r++)i+=arrayByteLength(t[r]);let r=0;const s=new Uint8Array(i);for(let i=0;i<e;i++){let e=t[i];e instanceof Uint8Array||(e="string"==typeof e?stringToBytes(e):new Uint8Array(e));const a=e.byteLength;s.set(e,r);r+=a}return s};e.assert=function assert(t,e){t||unreachable(e)};e.bytesToString=function bytesToString(t){"object"==typeof t&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const r=[];for(let s=0;s<e;s+=i){const a=Math.min(s+i,e),n=t.subarray(s,a);r.push(String.fromCharCode.apply(null,n))}return r.join("")};e.createPromiseCapability=function createPromiseCapability(){const t=Object.create(null);let e=!1;Object.defineProperty(t,"settled",{get:()=>e});t.promise=new Promise((function(i,r){t.resolve=function(t){e=!0;i(t)};t.reject=function(t){e=!0;r(t)}}));return t};e.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(i&&"string"==typeof t){if(i.addDefaultProtocol&&t.startsWith("www.")){const e=t.match(/\./g);e&&e.length>=2&&(t=`http://${t}`)}if(i.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}const r=e?new URL(t,e):new URL(t);if(_isValidProtocol(r))return r}catch(t){}return null};e.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(t=>"\n"===t?"\\n":"\r"===t?"\\r":`\\${t}`))};e.getModificationDate=function getModificationDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const e=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return e.join("")};e.getVerbosityLevel=function getVerbosityLevel(){return s};e.info=function info(t){s>=r.INFOS&&console.log(`Info: ${t}`)};e.isArrayBuffer=function isArrayBuffer(t){return"object"==typeof t&&null!==t&&void 0!==t.byteLength};e.isArrayEqual=function isArrayEqual(t,e){if(t.length!==e.length)return!1;for(let i=0,r=t.length;i<r;i++)if(t[i]!==e[i])return!1;return!0};e.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};e.objectFromMap=function objectFromMap(t){const e=Object.create(null);for(const[i,r]of t)e[i]=r;return e};e.objectSize=function objectSize(t){return Object.keys(t).length};e.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(s=t)};e.shadow=shadow;e.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};e.stringToBytes=stringToBytes;e.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){let e;"þ"===t[0]&&"ÿ"===t[1]?e="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?e="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(e="utf-8");if(e)try{const i=new TextDecoder(e,{fatal:!0}),r=stringToBytes(t);return i.decode(r)}catch(t){warn(`stringToPDFString: "${t}".`)}}const e=[];for(let i=0,r=t.length;i<r;i++){const r=o[t.charCodeAt(i)];e.push(r?String.fromCharCode(r):t.charAt(i))}return e.join("")};e.stringToUTF16BEString=function stringToUTF16BEString(t){const e=["þÿ"];for(let i=0,r=t.length;i<r;i++){const r=t.charCodeAt(i);e.push(String.fromCharCode(r>>8&255),String.fromCharCode(255&r))}return e.join("")};e.stringToUTF8String=stringToUTF8String;e.unreachable=unreachable;e.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};e.warn=warn;i(2);e.IDENTITY_MATRIX=[1,0,0,1,0,0];e.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];e.LINE_FACTOR=1.35;e.LINE_DESCENT_FACTOR=.35;e.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};e.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};e.AnnotationEditorPrefix="pdfjs_internal_editor_";e.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};e.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};e.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};e.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};e.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};e.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};e.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};e.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};e.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};e.AnnotationReplyType={GROUP:"Group",REPLY:"R"};e.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};e.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};e.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};e.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};e.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};e.PageActionEventType={O:"PageOpen",C:"PageClose"};e.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};e.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const r={ERRORS:0,WARNINGS:1,INFOS:5};e.VerbosityLevel=r;e.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};e.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};e.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};e.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let s=r.WARNINGS;function warn(t){s>=r.WARNINGS&&console.log(`Warning: ${t}`)}function unreachable(t){throw new Error(t)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,e,i){Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!1});return i}const a=function BaseExceptionClosure(){function BaseException(t,e){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=e}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();e.BaseException=a;e.PasswordException=class PasswordException extends a{constructor(t,e){super(t,"PasswordException");this.code=e}};e.UnknownErrorException=class UnknownErrorException extends a{constructor(t,e){super(t,"UnknownErrorException");this.details=e}};e.InvalidPDFException=class InvalidPDFException extends a{constructor(t){super(t,"InvalidPDFException")}};e.MissingPDFException=class MissingPDFException extends a{constructor(t){super(t,"MissingPDFException")}};e.UnexpectedResponseException=class UnexpectedResponseException extends a{constructor(t,e){super(t,"UnexpectedResponseException");this.status=e}};e.FormatError=class FormatError extends a{constructor(t){super(t,"FormatError")}};e.AbortException=class AbortException extends a{constructor(t){super(t,"AbortException")}};function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=255&t.charCodeAt(r);return i}function arrayByteLength(t){if(void 0!==t.length)return t.length;if(void 0!==t.byteLength)return t.byteLength;unreachable("Invalid argument for arrayByteLength")}e.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}};const n=[...Array(256).keys()].map((t=>t.toString(16).padStart(2,"0")));class Util{static makeHexColor(t,e,i){return`#${n[t]}${n[e]}${n[i]}`}static scaleMinMax(t,e){let i;if(t[0]){if(t[0]<0){i=e[0];e[0]=e[1];e[1]=i}e[0]*=t[0];e[1]*=t[0];if(t[3]<0){i=e[2];e[2]=e[3];e[3]=i}e[2]*=t[3];e[3]*=t[3]}else{i=e[0];e[0]=e[2];e[2]=i;i=e[1];e[1]=e[3];e[3]=i;if(t[1]<0){i=e[2];e[2]=e[3];e[3]=i}e[2]*=t[1];e[3]*=t[1];if(t[2]<0){i=e[0];e[0]=e[1];e[1]=i}e[0]*=t[2];e[1]*=t[2]}e[0]+=t[4];e[1]+=t[4];e[2]+=t[5];e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static applyTransform(t,e){return[t[0]*e[0]+t[1]*e[2]+e[4],t[0]*e[1]+t[1]*e[3]+e[5]]}static applyInverseTransform(t,e){const i=e[0]*e[3]-e[1]*e[2];return[(t[0]*e[3]-t[1]*e[2]+e[2]*e[5]-e[4]*e[3])/i,(-t[0]*e[1]+t[1]*e[0]+e[4]*e[1]-e[5]*e[0])/i]}static getAxialAlignedBoundingBox(t,e){const i=Util.applyTransform(t,e),r=Util.applyTransform(t.slice(2,4),e),s=Util.applyTransform([t[0],t[3]],e),a=Util.applyTransform([t[2],t[1]],e);return[Math.min(i[0],r[0],s[0],a[0]),Math.min(i[1],r[1],s[1],a[1]),Math.max(i[0],r[0],s[0],a[0]),Math.max(i[1],r[1],s[1],a[1])]}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static apply3dTransform(t,e){return[t[0]*e[0]+t[1]*e[1]+t[2]*e[2],t[3]*e[0]+t[4]*e[1]+t[5]*e[2],t[6]*e[0]+t[7]*e[1]+t[8]*e[2]]}static singularValueDecompose2dScale(t){const e=[t[0],t[2],t[1],t[3]],i=t[0]*e[0]+t[1]*e[2],r=t[0]*e[1]+t[1]*e[3],s=t[2]*e[0]+t[3]*e[2],a=t[2]*e[1]+t[3]*e[3],n=(i+a)/2,o=Math.sqrt((i+a)**2-4*(i*a-s*r))/2,l=n+o||1,c=n-o||1;return[Math.sqrt(l),Math.sqrt(c)]}static normalizeRect(t){const e=t.slice(0);if(t[0]>t[2]){e[0]=t[2];e[2]=t[0]}if(t[1]>t[3]){e[1]=t[3];e[3]=t[1]}return e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;const s=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),a=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return s>a?null:[i,s,r,a]}static bezierBoundingBox(t,e,i,r,s,a,n,o){const l=[],c=[[],[]];let d,h,u,p,f,g,m,v;for(let c=0;c<2;++c){if(0===c){h=6*t-12*i+6*s;d=-3*t+9*i-9*s+3*n;u=3*i-3*t}else{h=6*e-12*r+6*a;d=-3*e+9*r-9*a+3*o;u=3*r-3*e}if(Math.abs(d)<1e-12){if(Math.abs(h)<1e-12)continue;p=-u/h;0<p&&p<1&&l.push(p)}else{m=h*h-4*u*d;v=Math.sqrt(m);if(!(m<0)){f=(-h+v)/(2*d);0<f&&f<1&&l.push(f);g=(-h-v)/(2*d);0<g&&g<1&&l.push(g)}}}let _,b=l.length;const y=b;for(;b--;){p=l[b];_=1-p;c[0][b]=_*_*_*t+3*_*_*p*i+3*_*p*p*s+p*p*p*n;c[1][b]=_*_*_*e+3*_*_*p*r+3*_*p*p*a+p*p*p*o}c[0][y]=t;c[1][y]=e;c[0][y+1]=n;c[1][y+1]=o;c[0].length=c[1].length=y+2;return[Math.min(...c[0]),Math.min(...c[1]),Math.max(...c[0]),Math.max(...c[1])]}}e.Util=Util;const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,e,i)=>{"use strict";var r=i(3);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&r.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&r.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&r.isNodeJS&&(globalThis.DOMMatrix=require("dommatrix/dist/dommatrix.js"))}();!function checkReadableStream(){!globalThis.ReadableStream&&r.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}();!function checkArrayAt(){Array.prototype.at||i(4)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||i(78)}();!function checkStructuredClone(){globalThis.structuredClone||i(88)}()}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.isNodeJS=void 0;const i=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);e.isNodeJS=i},(t,e,i)=>{i(5);var r=i(77);t.exports=r("Array","at")},(t,e,i)=>{"use strict";var r=i(6),s=i(43),a=i(67),n=i(65),o=i(72);r({target:"Array",proto:!0},{at:function at(t){var e=s(this),i=a(e),r=n(t),o=r>=0?r:i+r;return o<0||o>=i?void 0:e[o]}});o("at")},(t,e,i)=>{var r=i(7),s=i(8).f,a=i(47),n=i(51),o=i(41),l=i(59),c=i(71);t.exports=function(t,e){var i,d,h,u,p,f=t.target,g=t.global,m=t.stat;if(i=g?r:m?r[f]||o(f,{}):(r[f]||{}).prototype)for(d in e){u=e[d];h=t.dontCallGetSet?(p=s(i,d))&&p.value:i[d];if(!c(g?d:f+(m?".":"#")+d,t.forced)&&void 0!==h){if(typeof u==typeof h)continue;l(u,h)}(t.sham||h&&h.sham)&&a(u,"sham",!0);n(i,d,u,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,e,i)=>{var r=i(9),s=i(11),a=i(13),n=i(14),o=i(15),l=i(21),c=i(42),d=i(45),h=Object.getOwnPropertyDescriptor;e.f=r?h:function getOwnPropertyDescriptor(t,e){t=o(t);e=l(e);if(d)try{return h(t,e)}catch(t){}if(c(t,e))return n(!s(a.f,t,e),t[e])}},(t,e,i)=>{var r=i(10);t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,e,i)=>{var r=i(12),s=Function.prototype.call;t.exports=r?s.bind(s):function(){return s.apply(s,arguments)}},(t,e,i)=>{var r=i(10);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,e)=>{"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!i.call({1:2},1);e.f=s?function propertyIsEnumerable(t){var e=r(this,t);return!!e&&e.enumerable}:i},t=>{t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},(t,e,i)=>{var r=i(16),s=i(19);t.exports=function(t){return r(s(t))}},(t,e,i)=>{var r=i(17),s=i(10),a=i(18),n=Object,o=r("".split);t.exports=s((function(){return!n("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?o(t,""):n(t)}:n},(t,e,i)=>{var r=i(12),s=Function.prototype,a=s.bind,n=s.call,o=r&&a.bind(n,n);t.exports=r?function(t){return t&&o(t)}:function(t){return t&&function(){return n.apply(t,arguments)}}},(t,e,i)=>{var r=i(17),s=r({}.toString),a=r("".slice);t.exports=function(t){return a(s(t),8,-1)}},(t,e,i)=>{var r=i(20),s=TypeError;t.exports=function(t){if(r(t))throw s("Can't call method on "+t);return t}},t=>{t.exports=function(t){return null==t}},(t,e,i)=>{var r=i(22),s=i(26);t.exports=function(t){var e=r(t,"string");return s(e)?e:e+""}},(t,e,i)=>{var r=i(11),s=i(23),a=i(26),n=i(33),o=i(36),l=i(37),c=TypeError,d=l("toPrimitive");t.exports=function(t,e){if(!s(t)||a(t))return t;var i,l=n(t,d);if(l){void 0===e&&(e="default");i=r(l,t,e);if(!s(i)||a(i))return i;throw c("Can't convert object to primitive value")}void 0===e&&(e="number");return o(t,e)}},(t,e,i)=>{var r=i(24),s=i(25),a=s.all;t.exports=s.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:r(t)||t===a}:function(t){return"object"==typeof t?null!==t:r(t)}},(t,e,i)=>{var r=i(25),s=r.all;t.exports=r.IS_HTMLDDA?function(t){return"function"==typeof t||t===s}:function(t){return"function"==typeof t}},t=>{var e="object"==typeof document&&document.all,i=void 0===e&&void 0!==e;t.exports={all:e,IS_HTMLDDA:i}},(t,e,i)=>{var r=i(27),s=i(24),a=i(28),n=i(29),o=Object;t.exports=n?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return s(e)&&a(e.prototype,o(t))}},(t,e,i)=>{var r=i(7),s=i(24),aFunction=function(t){return s(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?aFunction(r[t]):r[t]&&r[t][e]}},(t,e,i)=>{var r=i(17);t.exports=r({}.isPrototypeOf)},(t,e,i)=>{var r=i(30);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,e,i)=>{var r=i(31),s=i(10);t.exports=!!Object.getOwnPropertySymbols&&!s((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},(t,e,i)=>{var r,s,a=i(7),n=i(32),o=a.process,l=a.Deno,c=o&&o.versions||l&&l.version,d=c&&c.v8;d&&(s=(r=d.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1]));!s&&n&&(!(r=n.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=n.match(/Chrome\/(\d+)/))&&(s=+r[1]);t.exports=s},(t,e,i)=>{var r=i(27);t.exports=r("navigator","userAgent")||""},(t,e,i)=>{var r=i(34),s=i(20);t.exports=function(t,e){var i=t[e];return s(i)?void 0:r(i)}},(t,e,i)=>{var r=i(24),s=i(35),a=TypeError;t.exports=function(t){if(r(t))return t;throw a(s(t)+" is not a function")}},t=>{var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},(t,e,i)=>{var r=i(11),s=i(24),a=i(23),n=TypeError;t.exports=function(t,e){var i,o;if("string"===e&&s(i=t.toString)&&!a(o=r(i,t)))return o;if(s(i=t.valueOf)&&!a(o=r(i,t)))return o;if("string"!==e&&s(i=t.toString)&&!a(o=r(i,t)))return o;throw n("Can't convert object to primitive value")}},(t,e,i)=>{var r=i(7),s=i(38),a=i(42),n=i(44),o=i(30),l=i(29),c=s("wks"),d=r.Symbol,h=d&&d.for,u=l?d:d&&d.withoutSetter||n;t.exports=function(t){if(!a(c,t)||!o&&"string"!=typeof c[t]){var e="Symbol."+t;o&&a(d,t)?c[t]=d[t]:c[t]=l&&h?h(e):u(e)}return c[t]}},(t,e,i)=>{var r=i(39),s=i(40);(t.exports=function(t,e){return s[t]||(s[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.25.3",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,e,i)=>{var r=i(7),s=i(41),a="__core-js_shared__",n=r[a]||s(a,{});t.exports=n},(t,e,i)=>{var r=i(7),s=Object.defineProperty;t.exports=function(t,e){try{s(r,t,{value:e,configurable:!0,writable:!0})}catch(i){r[t]=e}return e}},(t,e,i)=>{var r=i(17),s=i(43),a=r({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,e){return a(s(t),e)}},(t,e,i)=>{var r=i(19),s=Object;t.exports=function(t){return s(r(t))}},(t,e,i)=>{var r=i(17),s=0,a=Math.random(),n=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+n(++s+a,36)}},(t,e,i)=>{var r=i(9),s=i(10),a=i(46);t.exports=!r&&!s((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},(t,e,i)=>{var r=i(7),s=i(23),a=r.document,n=s(a)&&s(a.createElement);t.exports=function(t){return n?a.createElement(t):{}}},(t,e,i)=>{var r=i(9),s=i(48),a=i(14);t.exports=r?function(t,e,i){return s.f(t,e,a(1,i))}:function(t,e,i){t[e]=i;return t}},(t,e,i)=>{var r=i(9),s=i(45),a=i(49),n=i(50),o=i(21),l=TypeError,c=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",u="configurable",p="writable";e.f=r?a?function defineProperty(t,e,i){n(t);e=o(e);n(i);if("function"==typeof t&&"prototype"===e&&"value"in i&&p in i&&!i.writable){var r=d(t,e);if(r&&r.writable){t[e]=i.value;i={configurable:u in i?i.configurable:r.configurable,enumerable:h in i?i.enumerable:r.enumerable,writable:!1}}}return c(t,e,i)}:c:function defineProperty(t,e,i){n(t);e=o(e);n(i);if(s)try{return c(t,e,i)}catch(t){}if("get"in i||"set"in i)throw l("Accessors not supported");"value"in i&&(t[e]=i.value);return t}},(t,e,i)=>{var r=i(9),s=i(10);t.exports=r&&s((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,e,i)=>{var r=i(23),s=String,a=TypeError;t.exports=function(t){if(r(t))return t;throw a(s(t)+" is not an object")}},(t,e,i)=>{var r=i(24),s=i(48),a=i(52),n=i(41);t.exports=function(t,e,i,o){o||(o={});var l=o.enumerable,c=void 0!==o.name?o.name:e;r(i)&&a(i,c,o);if(o.global)l?t[e]=i:n(e,i);else{try{o.unsafe?t[e]&&(l=!0):delete t[e]}catch(t){}l?t[e]=i:s.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},(t,e,i)=>{var r=i(10),s=i(24),a=i(42),n=i(9),o=i(53).CONFIGURABLE,l=i(54),c=i(55),d=c.enforce,h=c.get,u=Object.defineProperty,p=n&&!r((function(){return 8!==u((function(){}),"length",{value:8}).length})),f=String(String).split("String"),g=t.exports=function(t,e,i){"Symbol("===String(e).slice(0,7)&&(e="["+String(e).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");i&&i.getter&&(e="get "+e);i&&i.setter&&(e="set "+e);(!a(t,"name")||o&&t.name!==e)&&(n?u(t,"name",{value:e,configurable:!0}):t.name=e);p&&i&&a(i,"arity")&&t.length!==i.arity&&u(t,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?n&&u(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=d(t);a(r,"source")||(r.source=f.join("string"==typeof e?e:""));return t};Function.prototype.toString=g((function toString(){return s(this)&&h(this).source||l(this)}),"toString")},(t,e,i)=>{var r=i(9),s=i(42),a=Function.prototype,n=r&&Object.getOwnPropertyDescriptor,o=s(a,"name"),l=o&&"something"===function something(){}.name,c=o&&(!r||r&&n(a,"name").configurable);t.exports={EXISTS:o,PROPER:l,CONFIGURABLE:c}},(t,e,i)=>{var r=i(17),s=i(24),a=i(40),n=r(Function.toString);s(a.inspectSource)||(a.inspectSource=function(t){return n(t)});t.exports=a.inspectSource},(t,e,i)=>{var r,s,a,n=i(56),o=i(7),l=i(17),c=i(23),d=i(47),h=i(42),u=i(40),p=i(57),f=i(58),g="Object already initialized",m=o.TypeError,v=o.WeakMap;if(n||u.state){var _=u.state||(u.state=new v),b=l(_.get),y=l(_.has),A=l(_.set);r=function(t,e){if(y(_,t))throw m(g);e.facade=t;A(_,t,e);return e};s=function(t){return b(_,t)||{}};a=function(t){return y(_,t)}}else{var P=p("state");f[P]=!0;r=function(t,e){if(h(t,P))throw m(g);e.facade=t;d(t,P,e);return e};s=function(t){return h(t,P)?t[P]:{}};a=function(t){return h(t,P)}}t.exports={set:r,get:s,has:a,enforce:function(t){return a(t)?s(t):r(t,{})},getterFor:function(t){return function(e){var i;if(!c(e)||(i=s(e)).type!==t)throw m("Incompatible receiver, "+t+" required");return i}}}},(t,e,i)=>{var r=i(7),s=i(24),a=r.WeakMap;t.exports=s(a)&&/native code/.test(String(a))},(t,e,i)=>{var r=i(38),s=i(44),a=r("keys");t.exports=function(t){return a[t]||(a[t]=s(t))}},t=>{t.exports={}},(t,e,i)=>{var r=i(42),s=i(60),a=i(8),n=i(48);t.exports=function(t,e,i){for(var o=s(e),l=n.f,c=a.f,d=0;d<o.length;d++){var h=o[d];r(t,h)||i&&r(i,h)||l(t,h,c(e,h))}}},(t,e,i)=>{var r=i(27),s=i(17),a=i(61),n=i(70),o=i(50),l=s([].concat);t.exports=r("Reflect","ownKeys")||function ownKeys(t){var e=a.f(o(t)),i=n.f;return i?l(e,i(t)):e}},(t,e,i)=>{var r=i(62),s=i(69).concat("length","prototype");e.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return r(t,s)}},(t,e,i)=>{var r=i(17),s=i(42),a=i(15),n=i(63).indexOf,o=i(58),l=r([].push);t.exports=function(t,e){var i,r=a(t),c=0,d=[];for(i in r)!s(o,i)&&s(r,i)&&l(d,i);for(;e.length>c;)s(r,i=e[c++])&&(~n(d,i)||l(d,i));return d}},(t,e,i)=>{var r=i(15),s=i(64),a=i(67),createMethod=function(t){return function(e,i,n){var o,l=r(e),c=a(l),d=s(n,c);if(t&&i!=i){for(;c>d;)if((o=l[d++])!=o)return!0}else for(;c>d;d++)if((t||d in l)&&l[d]===i)return t||d||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,e,i)=>{var r=i(65),s=Math.max,a=Math.min;t.exports=function(t,e){var i=r(t);return i<0?s(i+e,0):a(i,e)}},(t,e,i)=>{var r=i(66);t.exports=function(t){var e=+t;return e!=e||0===e?0:r(e)}},t=>{var e=Math.ceil,i=Math.floor;t.exports=Math.trunc||function trunc(t){var r=+t;return(r>0?i:e)(r)}},(t,e,i)=>{var r=i(68);t.exports=function(t){return r(t.length)}},(t,e,i)=>{var r=i(65),s=Math.min;t.exports=function(t){return t>0?s(r(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,e)=>{e.f=Object.getOwnPropertySymbols},(t,e,i)=>{var r=i(10),s=i(24),a=/#|\.prototype\./,isForced=function(t,e){var i=o[n(t)];return i==c||i!=l&&(s(e)?r(e):!!e)},n=isForced.normalize=function(t){return String(t).replace(a,".").toLowerCase()},o=isForced.data={},l=isForced.NATIVE="N",c=isForced.POLYFILL="P";t.exports=isForced},(t,e,i)=>{var r=i(37),s=i(73),a=i(48).f,n=r("unscopables"),o=Array.prototype;null==o[n]&&a(o,n,{configurable:!0,value:s(null)});t.exports=function(t){o[n][t]=!0}},(t,e,i)=>{var r,s=i(50),a=i(74),n=i(69),o=i(58),l=i(76),c=i(46),d=i(57),h=d("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var e=t.parentWindow.Object;t=null;return e},NullProtoObject=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&r?NullProtoObjectViaActiveX(r):function(){var t,e=c("iframe");e.style.display="none";l.appendChild(e);e.src=String("javascript:");(t=e.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(r);for(var t=n.length;t--;)delete NullProtoObject.prototype[n[t]];return NullProtoObject()};o[h]=!0;t.exports=Object.create||function create(t,e){var i;if(null!==t){EmptyConstructor.prototype=s(t);i=new EmptyConstructor;EmptyConstructor.prototype=null;i[h]=t}else i=NullProtoObject();return void 0===e?i:a.f(i,e)}},(t,e,i)=>{var r=i(9),s=i(49),a=i(48),n=i(50),o=i(15),l=i(75);e.f=r&&!s?Object.defineProperties:function defineProperties(t,e){n(t);for(var i,r=o(e),s=l(e),c=s.length,d=0;c>d;)a.f(t,i=s[d++],r[i]);return t}},(t,e,i)=>{var r=i(62),s=i(69);t.exports=Object.keys||function keys(t){return r(t,s)}},(t,e,i)=>{var r=i(27);t.exports=r("document","documentElement")},(t,e,i)=>{var r=i(7),s=i(17);t.exports=function(t,e){return s(r[t].prototype[e])}},(t,e,i)=>{i(79)},(t,e,i)=>{"use strict";var r=i(80),s=i(67),a=i(65),n=r.aTypedArray;(0,r.exportTypedArrayMethod)("at",(function at(t){var e=n(this),i=s(e),r=a(t),o=r>=0?r:i+r;return o<0||o>=i?void 0:e[o]}))},(t,e,i)=>{"use strict";var r,s,a,n=i(81),o=i(9),l=i(7),c=i(24),d=i(23),h=i(42),u=i(82),p=i(35),f=i(47),g=i(51),m=i(48).f,v=i(28),_=i(84),b=i(86),y=i(37),A=i(44),P=i(55),S=P.enforce,x=P.get,w=l.Int8Array,E=w&&w.prototype,C=l.Uint8ClampedArray,k=C&&C.prototype,T=w&&_(w),M=E&&_(E),R=Object.prototype,I=l.TypeError,D=y("toStringTag"),O=A("TYPED_ARRAY_TAG"),L="TypedArrayConstructor",G=n&&!!b&&"Opera"!==u(l.opera),N=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},U={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(t){var e=_(t);if(d(e)){var i=x(e);return i&&h(i,L)?i.TypedArrayConstructor:getTypedArrayConstructor(e)}},isTypedArray=function(t){if(!d(t))return!1;var e=u(t);return h(j,e)||h(U,e)};for(r in j)(a=(s=l[r])&&s.prototype)?S(a).TypedArrayConstructor=s:G=!1;for(r in U)(a=(s=l[r])&&s.prototype)&&(S(a).TypedArrayConstructor=s);if(!G||!c(T)||T===Function.prototype){T=function TypedArray(){throw I("Incorrect invocation")};if(G)for(r in j)l[r]&&b(l[r],T)}if(!G||!M||M===R){M=T.prototype;if(G)for(r in j)l[r]&&b(l[r].prototype,M)}G&&_(k)!==M&&b(k,M);if(o&&!h(M,D)){N=!0;m(M,D,{get:function(){return d(this)?this[O]:void 0}});for(r in j)l[r]&&f(l[r],O,r)}t.exports={NATIVE_ARRAY_BUFFER_VIEWS:G,TYPED_ARRAY_TAG:N&&O,aTypedArray:function(t){if(isTypedArray(t))return t;throw I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!b||v(T,t)))return t;throw I(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,i,r){if(o){if(i)for(var s in j){var a=l[s];if(a&&h(a.prototype,t))try{delete a.prototype[t]}catch(i){try{a.prototype[t]=e}catch(t){}}}M[t]&&!i||g(M,t,i?e:G&&E[t]||e,r)}},exportTypedArrayStaticMethod:function(t,e,i){var r,s;if(o){if(b){if(i)for(r in j)if((s=l[r])&&h(s,t))try{delete s[t]}catch(t){}if(T[t]&&!i)return;try{return g(T,t,i?e:G&&T[t]||e)}catch(t){}}for(r in j)!(s=l[r])||s[t]&&!i||g(s,t,e)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(t){if(!d(t))return!1;var e=u(t);return"DataView"===e||h(j,e)||h(U,e)},isTypedArray:isTypedArray,TypedArray:T,TypedArrayPrototype:M}},t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(t,e,i)=>{var r=i(83),s=i(24),a=i(18),n=i(37)("toStringTag"),o=Object,l="Arguments"==a(function(){return arguments}());t.exports=r?a:function(t){var e,i,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=o(t),n))?i:l?a(e):"Object"==(r=a(e))&&s(e.callee)?"Arguments":r}},(t,e,i)=>{var r={};r[i(37)("toStringTag")]="z";t.exports="[object z]"===String(r)},(t,e,i)=>{var r=i(42),s=i(24),a=i(43),n=i(57),o=i(85),l=n("IE_PROTO"),c=Object,d=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=a(t);if(r(e,l))return e[l];var i=e.constructor;return s(i)&&e instanceof i?i.prototype:e instanceof c?d:null}},(t,e,i)=>{var r=i(10);t.exports=!r((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,e,i)=>{var r=i(17),s=i(50),a=i(87);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]);e=i instanceof Array}catch(t){}return function setPrototypeOf(i,r){s(i);a(r);e?t(i,r):i.__proto__=r;return i}}():void 0)},(t,e,i)=>{var r=i(24),s=String,a=TypeError;t.exports=function(t){if("object"==typeof t||r(t))return t;throw a("Can't set "+s(t)+" as a prototype")}},(t,e,i)=>{i(89);i(96);i(98);i(120);i(122);var r=i(131);t.exports=r.structuredClone},(t,e,i)=>{"use strict";var r=i(15),s=i(72),a=i(90),n=i(55),o=i(48).f,l=i(91),c=i(95),d=i(39),h=i(9),u="Array Iterator",p=n.set,f=n.getterFor(u);t.exports=l(Array,"Array",(function(t,e){p(this,{type:u,target:r(t),index:0,kind:e})}),(function(){var t=f(this),e=t.target,i=t.kind,r=t.index++;if(!e||r>=e.length){t.target=void 0;return c(void 0,!0)}return c("keys"==i?r:"values"==i?e[r]:[r,e[r]],!1)}),"values");var g=a.Arguments=a.Array;s("keys");s("values");s("entries");if(!d&&h&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(t){}},t=>{t.exports={}},(t,e,i)=>{"use strict";var r=i(6),s=i(11),a=i(39),n=i(53),o=i(24),l=i(92),c=i(84),d=i(86),h=i(94),u=i(47),p=i(51),f=i(37),g=i(90),m=i(93),v=n.PROPER,_=n.CONFIGURABLE,b=m.IteratorPrototype,y=m.BUGGY_SAFARI_ITERATORS,A=f("iterator"),P="keys",S="values",x="entries",returnThis=function(){return this};t.exports=function(t,e,i,n,f,m,w){l(i,e,n);var E,C,k,getIterationMethod=function(t){if(t===f&&D)return D;if(!y&&t in R)return R[t];switch(t){case P:return function keys(){return new i(this,t)};case S:return function values(){return new i(this,t)};case x:return function entries(){return new i(this,t)}}return function(){return new i(this)}},T=e+" Iterator",M=!1,R=t.prototype,I=R[A]||R["@@iterator"]||f&&R[f],D=!y&&I||getIterationMethod(f),O="Array"==e&&R.entries||I;if(O&&(E=c(O.call(new t)))!==Object.prototype&&E.next){a||c(E)===b||(d?d(E,b):o(E[A])||p(E,A,returnThis));h(E,T,!0,!0);a&&(g[T]=returnThis)}if(v&&f==S&&I&&I.name!==S)if(!a&&_)u(R,"name",S);else{M=!0;D=function values(){return s(I,this)}}if(f){C={values:getIterationMethod(S),keys:m?D:getIterationMethod(P),entries:getIterationMethod(x)};if(w)for(k in C)(y||M||!(k in R))&&p(R,k,C[k]);else r({target:e,proto:!0,forced:y||M},C)}a&&!w||R[A]===D||p(R,A,D,{name:f});g[e]=D;return C}},(t,e,i)=>{"use strict";var r=i(93).IteratorPrototype,s=i(73),a=i(14),n=i(94),o=i(90),returnThis=function(){return this};t.exports=function(t,e,i,l){var c=e+" Iterator";t.prototype=s(r,{next:a(+!l,i)});n(t,c,!1,!0);o[c]=returnThis;return t}},(t,e,i)=>{"use strict";var r,s,a,n=i(10),o=i(24),l=i(23),c=i(73),d=i(84),h=i(51),u=i(37),p=i(39),f=u("iterator"),g=!1;[].keys&&("next"in(a=[].keys())?(s=d(d(a)))!==Object.prototype&&(r=s):g=!0);!l(r)||n((function(){var t={};return r[f].call(t)!==t}))?r={}:p&&(r=c(r));o(r[f])||h(r,f,(function(){return this}));t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:g}},(t,e,i)=>{var r=i(48).f,s=i(42),a=i(37)("toStringTag");t.exports=function(t,e,i){t&&!i&&(t=t.prototype);t&&!s(t,a)&&r(t,a,{configurable:!0,value:e})}},t=>{t.exports=function(t,e){return{value:t,done:e}}},(t,e,i)=>{var r=i(83),s=i(51),a=i(97);r||s(Object.prototype,"toString",a,{unsafe:!0})},(t,e,i)=>{"use strict";var r=i(83),s=i(82);t.exports=r?{}.toString:function toString(){return"[object "+s(this)+"]"}},(t,e,i)=>{i(99)},(t,e,i)=>{"use strict";i(100)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),i(117))},(t,e,i)=>{"use strict";var r=i(6),s=i(7),a=i(17),n=i(71),o=i(51),l=i(101),c=i(108),d=i(114),h=i(24),u=i(20),p=i(23),f=i(10),g=i(115),m=i(94),v=i(116);t.exports=function(t,e,i){var _=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),y=_?"set":"add",A=s[t],P=A&&A.prototype,S=A,x={},fixMethod=function(t){var e=a(P[t]);o(P,t,"add"==t?function add(t){e(this,0===t?0:t);return this}:"delete"==t?function(t){return!(b&&!p(t))&&e(this,0===t?0:t)}:"get"==t?function get(t){return b&&!p(t)?void 0:e(this,0===t?0:t)}:"has"==t?function has(t){return!(b&&!p(t))&&e(this,0===t?0:t)}:function set(t,i){e(this,0===t?0:t,i);return this})};if(n(t,!h(A)||!(b||P.forEach&&!f((function(){(new A).entries().next()}))))){S=i.getConstructor(e,t,_,y);l.enable()}else if(n(t,!0)){var w=new S,E=w[y](b?{}:-0,1)!=w,C=f((function(){w.has(1)})),k=g((function(t){new A(t)})),T=!b&&f((function(){for(var t=new A,e=5;e--;)t[y](e,e);return!t.has(-0)}));if(!k){(S=e((function(t,e){d(t,P);var i=v(new A,t,S);u(e)||c(e,i[y],{that:i,AS_ENTRIES:_});return i}))).prototype=P;P.constructor=S}if(C||T){fixMethod("delete");fixMethod("has");_&&fixMethod("get")}(T||E)&&fixMethod(y);b&&P.clear&&delete P.clear}x[t]=S;r({global:!0,constructor:!0,forced:S!=A},x);m(S,t);b||i.setStrong(S,t,_);return S}},(t,e,i)=>{var r=i(6),s=i(17),a=i(58),n=i(23),o=i(42),l=i(48).f,c=i(61),d=i(102),h=i(105),u=i(44),p=i(107),f=!1,g=u("meta"),m=0,setMetadata=function(t){l(t,g,{value:{objectID:"O"+m++,weakData:{}}})},v=t.exports={enable:function(){v.enable=function(){};f=!0;var t=c.f,e=s([].splice),i={};i[g]=1;if(t(i).length){c.f=function(i){for(var r=t(i),s=0,a=r.length;s<a;s++)if(r[s]===g){e(r,s,1);break}return r};r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:d.f})}},fastKey:function(t,e){if(!n(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,g)){if(!h(t))return"F";if(!e)return"E";setMetadata(t)}return t[g].objectID},getWeakData:function(t,e){if(!o(t,g)){if(!h(t))return!0;if(!e)return!1;setMetadata(t)}return t[g].weakData},onFreeze:function(t){p&&f&&h(t)&&!o(t,g)&&setMetadata(t);return t}};a[g]=!0},(t,e,i)=>{var r=i(18),s=i(15),a=i(61).f,n=i(103),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return o&&"Window"==r(t)?function(t){try{return a(t)}catch(t){return n(o)}}(t):a(s(t))}},(t,e,i)=>{var r=i(64),s=i(67),a=i(104),n=Array,o=Math.max;t.exports=function(t,e,i){for(var l=s(t),c=r(e,l),d=r(void 0===i?l:i,l),h=n(o(d-c,0)),u=0;c<d;c++,u++)a(h,u,t[c]);h.length=u;return h}},(t,e,i)=>{"use strict";var r=i(21),s=i(48),a=i(14);t.exports=function(t,e,i){var n=r(e);n in t?s.f(t,n,a(0,i)):t[n]=i}},(t,e,i)=>{var r=i(10),s=i(23),a=i(18),n=i(106),o=Object.isExtensible,l=r((function(){o(1)}));t.exports=l||n?function isExtensible(t){return!!s(t)&&((!n||"ArrayBuffer"!=a(t))&&(!o||o(t)))}:o},(t,e,i)=>{var r=i(10);t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,e,i)=>{var r=i(10);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,e,i)=>{var r=i(109),s=i(11),a=i(50),n=i(35),o=i(110),l=i(67),c=i(28),d=i(111),h=i(112),u=i(113),p=TypeError,Result=function(t,e){this.stopped=t;this.result=e},f=Result.prototype;t.exports=function(t,e,i){var g,m,v,_,b,y,A,P=i&&i.that,S=!(!i||!i.AS_ENTRIES),x=!(!i||!i.IS_RECORD),w=!(!i||!i.IS_ITERATOR),E=!(!i||!i.INTERRUPTED),C=r(e,P),stop=function(t){g&&u(g,"normal",t);return new Result(!0,t)},callFn=function(t){if(S){a(t);return E?C(t[0],t[1],stop):C(t[0],t[1])}return E?C(t,stop):C(t)};if(x)g=t.iterator;else if(w)g=t;else{if(!(m=h(t)))throw p(n(t)+" is not iterable");if(o(m)){for(v=0,_=l(t);_>v;v++)if((b=callFn(t[v]))&&c(f,b))return b;return new Result(!1)}g=d(t,m)}y=x?t.next:g.next;for(;!(A=s(y,g)).done;){try{b=callFn(A.value)}catch(t){u(g,"throw",t)}if("object"==typeof b&&b&&c(f,b))return b}return new Result(!1)}},(t,e,i)=>{var r=i(17),s=i(34),a=i(12),n=r(r.bind);t.exports=function(t,e){s(t);return void 0===e?t:a?n(t,e):function(){return t.apply(e,arguments)}}},(t,e,i)=>{var r=i(37),s=i(90),a=r("iterator"),n=Array.prototype;t.exports=function(t){return void 0!==t&&(s.Array===t||n[a]===t)}},(t,e,i)=>{var r=i(11),s=i(34),a=i(50),n=i(35),o=i(112),l=TypeError;t.exports=function(t,e){var i=arguments.length<2?o(t):e;if(s(i))return a(r(i,t));throw l(n(t)+" is not iterable")}},(t,e,i)=>{var r=i(82),s=i(33),a=i(20),n=i(90),o=i(37)("iterator");t.exports=function(t){if(!a(t))return s(t,o)||s(t,"@@iterator")||n[r(t)]}},(t,e,i)=>{var r=i(11),s=i(50),a=i(33);t.exports=function(t,e,i){var n,o;s(t);try{if(!(n=a(t,"return"))){if("throw"===e)throw i;return i}n=r(n,t)}catch(t){o=!0;n=t}if("throw"===e)throw i;if(o)throw n;s(n);return i}},(t,e,i)=>{var r=i(28),s=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw s("Incorrect invocation")}},(t,e,i)=>{var r=i(37)("iterator"),s=!1;try{var a=0,n={next:function(){return{done:!!a++}},return:function(){s=!0}};n[r]=function(){return this};Array.from(n,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!s)return!1;var i=!1;try{var a={};a[r]=function(){return{next:function(){return{done:i=!0}}}};t(a)}catch(t){}return i}},(t,e,i)=>{var r=i(24),s=i(23),a=i(86);t.exports=function(t,e,i){var n,o;a&&r(n=e.constructor)&&n!==i&&s(o=n.prototype)&&o!==i.prototype&&a(t,o);return t}},(t,e,i)=>{"use strict";var r=i(48).f,s=i(73),a=i(118),n=i(109),o=i(114),l=i(20),c=i(108),d=i(91),h=i(95),u=i(119),p=i(9),f=i(101).fastKey,g=i(55),m=g.set,v=g.getterFor;t.exports={getConstructor:function(t,e,i,d){var h=t((function(t,r){o(t,u);m(t,{type:e,index:s(null),first:void 0,last:void 0,size:0});p||(t.size=0);l(r)||c(r,t[d],{that:t,AS_ENTRIES:i})})),u=h.prototype,g=v(e),define=function(t,e,i){var r,s,a=g(t),n=getEntry(t,e);if(n)n.value=i;else{a.last=n={index:s=f(e,!0),key:e,value:i,previous:r=a.last,next:void 0,removed:!1};a.first||(a.first=n);r&&(r.next=n);p?a.size++:t.size++;"F"!==s&&(a.index[s]=n)}return t},getEntry=function(t,e){var i,r=g(t),s=f(e);if("F"!==s)return r.index[s];for(i=r.first;i;i=i.next)if(i.key==e)return i};a(u,{clear:function clear(){for(var t=g(this),e=t.index,i=t.first;i;){i.removed=!0;i.previous&&(i.previous=i.previous.next=void 0);delete e[i.index];i=i.next}t.first=t.last=void 0;p?t.size=0:this.size=0},delete:function(t){var e=this,i=g(e),r=getEntry(e,t);if(r){var s=r.next,a=r.previous;delete i.index[r.index];r.removed=!0;a&&(a.next=s);s&&(s.previous=a);i.first==r&&(i.first=s);i.last==r&&(i.last=a);p?i.size--:e.size--}return!!r},forEach:function forEach(t){for(var e,i=g(this),r=n(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;){r(e.value,e.key,this);for(;e&&e.removed;)e=e.previous}},has:function has(t){return!!getEntry(this,t)}});a(u,i?{get:function get(t){var e=getEntry(this,t);return e&&e.value},set:function set(t,e){return define(this,0===t?0:t,e)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});p&&r(u,"size",{get:function(){return g(this).size}});return h},setStrong:function(t,e,i){var r=e+" Iterator",s=v(e),a=v(r);d(t,e,(function(t,e){m(this,{type:r,target:t,state:s(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;if(!t.target||!(t.last=i=i?i.next:t.state.first)){t.target=void 0;return h(void 0,!0)}return h("keys"==e?i.key:"values"==e?i.value:[i.key,i.value],!1)}),i?"entries":"values",!i,!0);u(e)}}},(t,e,i)=>{var r=i(51);t.exports=function(t,e,i){for(var s in e)r(t,s,e[s],i);return t}},(t,e,i)=>{"use strict";var r=i(27),s=i(48),a=i(37),n=i(9),o=a("species");t.exports=function(t){var e=r(t),i=s.f;n&&e&&!e[o]&&i(e,o,{configurable:!0,get:function(){return this}})}},(t,e,i)=>{i(121)},(t,e,i)=>{"use strict";i(100)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),i(117))},(t,e,i)=>{var r,s=i(39),a=i(6),n=i(7),o=i(27),l=i(17),c=i(10),d=i(44),h=i(24),u=i(123),p=i(20),f=i(23),g=i(26),m=i(108),v=i(50),_=i(82),b=i(42),y=i(104),A=i(47),P=i(67),S=i(124),x=i(125),w=i(127),E=i(31),C=i(128),k=i(129),T=i(130),M=n.Object,R=n.Date,I=n.Error,D=n.EvalError,O=n.RangeError,L=n.ReferenceError,G=n.SyntaxError,N=n.TypeError,j=n.URIError,U=n.PerformanceMark,B=n.WebAssembly,W=B&&B.CompileError||I,q=B&&B.LinkError||I,z=B&&B.RuntimeError||I,H=o("DOMException"),V=o("Set"),X=o("Map"),$=X.prototype,Y=l($.has),K=l($.get),J=l($.set),Q=l(V.prototype.add),Z=o("Object","keys"),tt=l([].push),et=l((!0).valueOf),it=l(1..valueOf),rt=l("".valueOf),st=l(R.prototype.getTime),nt=d("structuredClone"),ot="DataCloneError",lt="Transferring",checkBasicSemantic=function(t){return!c((function(){var e=new n.Set([7]),i=t(e),r=t(M(7));return i==e||!i.has(7)||"object"!=typeof r||7!=r}))&&t},checkErrorsCloning=function(t,e){return!c((function(){var i=new e,r=t({a:i,b:i});return!(r&&r.a===r.b&&r.a instanceof e&&r.a.stack===i.stack)}))},ct=n.structuredClone,dt=s||!checkErrorsCloning(ct,I)||!checkErrorsCloning(ct,H)||!(r=ct,!c((function(){var t=r(new n.AggregateError([1],nt,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=nt||3!=t.cause}))),ht=!ct&&checkBasicSemantic((function(t){return new U(nt,{detail:t}).detail})),ut=checkBasicSemantic(ct)||ht,throwUncloneable=function(t){throw new H("Uncloneable type: "+t,ot)},throwUnpolyfillable=function(t,e){throw new H((e||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",ot)},structuredCloneInternal=function(t,e){g(t)&&throwUncloneable("Symbol");if(!f(t))return t;if(e){if(Y(e,t))return K(e,t)}else e=new X;var i,r,s,a,l,c,d,u,p,m,v=_(t),S=!1;switch(v){case"Array":s=[];S=!0;break;case"Object":s={};S=!0;break;case"Map":s=new X;S=!0;break;case"Set":s=new V;S=!0;break;case"RegExp":s=new RegExp(t.source,x(t));break;case"Error":switch(r=t.name){case"AggregateError":s=o("AggregateError")([]);break;case"EvalError":s=D();break;case"RangeError":s=O();break;case"ReferenceError":s=L();break;case"SyntaxError":s=G();break;case"TypeError":s=N();break;case"URIError":s=j();break;case"CompileError":s=W();break;case"LinkError":s=q();break;case"RuntimeError":s=z();break;default:s=I()}S=!0;break;case"DOMException":s=new H(t.message,t.name);S=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":i=n[v];f(i)||throwUnpolyfillable(v);s=new i(structuredCloneInternal(t.buffer,e),t.byteOffset,"DataView"===v?t.byteLength:t.length);break;case"DOMQuad":try{s=new DOMQuad(structuredCloneInternal(t.p1,e),structuredCloneInternal(t.p2,e),structuredCloneInternal(t.p3,e),structuredCloneInternal(t.p4,e))}catch(e){ut?s=ut(t):throwUnpolyfillable(v)}break;case"FileList":if(a=function(){var t;try{t=new n.DataTransfer}catch(e){try{t=new n.ClipboardEvent("").clipboardData}catch(t){}}return t&&t.items&&t.files?t:null}()){for(l=0,c=P(t);l<c;l++)a.items.add(structuredCloneInternal(t[l],e));s=a.files}else ut?s=ut(t):throwUnpolyfillable(v);break;case"ImageData":try{s=new ImageData(structuredCloneInternal(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(e){ut?s=ut(t):throwUnpolyfillable(v)}break;default:if(ut)s=ut(t);else switch(v){case"BigInt":s=M(t.valueOf());break;case"Boolean":s=M(et(t));break;case"Number":s=M(it(t));break;case"String":s=M(rt(t));break;case"Date":s=new R(st(t));break;case"ArrayBuffer":(i=n.DataView)||"function"==typeof t.slice||throwUnpolyfillable(v);try{if("function"==typeof t.slice)s=t.slice(0);else{c=t.byteLength;s=new ArrayBuffer(c);p=new i(t);m=new i(s);for(l=0;l<c;l++)m.setUint8(l,p.getUint8(l))}}catch(t){throw new H("ArrayBuffer is detached",ot)}break;case"SharedArrayBuffer":s=t;break;case"Blob":try{s=t.slice(0,t.size,t.type)}catch(t){throwUnpolyfillable(v)}break;case"DOMPoint":case"DOMPointReadOnly":i=n[v];try{s=i.fromPoint?i.fromPoint(t):new i(t.x,t.y,t.z,t.w)}catch(t){throwUnpolyfillable(v)}break;case"DOMRect":case"DOMRectReadOnly":i=n[v];try{s=i.fromRect?i.fromRect(t):new i(t.x,t.y,t.width,t.height)}catch(t){throwUnpolyfillable(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":i=n[v];try{s=i.fromMatrix?i.fromMatrix(t):new i(t)}catch(t){throwUnpolyfillable(v)}break;case"AudioData":case"VideoFrame":h(t.clone)||throwUnpolyfillable(v);try{s=t.clone()}catch(t){throwUncloneable(v)}break;case"File":try{s=new File([t],t.name,t)}catch(t){throwUnpolyfillable(v)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(v);default:throwUncloneable(v)}}J(e,t,s);if(S)switch(v){case"Array":case"Object":d=Z(t);for(l=0,c=P(d);l<c;l++){u=d[l];y(s,u,structuredCloneInternal(t[u],e))}break;case"Map":t.forEach((function(t,i){J(s,structuredCloneInternal(i,e),structuredCloneInternal(t,e))}));break;case"Set":t.forEach((function(t){Q(s,structuredCloneInternal(t,e))}));break;case"Error":A(s,"message",structuredCloneInternal(t.message,e));b(t,"cause")&&A(s,"cause",structuredCloneInternal(t.cause,e));"AggregateError"==r&&(s.errors=structuredCloneInternal(t.errors,e));case"DOMException":w&&A(s,"stack",structuredCloneInternal(t.stack,e))}return s},pt=ct&&!c((function(){if(k&&E>92||T&&E>94||C&&E>97)return!1;var t=new ArrayBuffer(8),e=ct(t,{transfer:[t]});return 0!=t.byteLength||8!=e.byteLength})),tryToTransfer=function(t,e){if(!f(t))throw N("Transfer option cannot be converted to a sequence");var i=[];m(t,(function(t){tt(i,v(t))}));var r,s,a,o,l,c,d=0,p=P(i);if(pt){o=ct(i,{transfer:i});for(;d<p;)J(e,i[d],o[d++])}else for(;d<p;){r=i[d++];if(Y(e,r))throw new H("Duplicate transferable",ot);switch(s=_(r)){case"ImageBitmap":a=n.OffscreenCanvas;u(a)||throwUnpolyfillable(s,lt);try{(c=new a(r.width,r.height)).getContext("bitmaprenderer").transferFromImageBitmap(r);l=c.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":h(r.clone)&&h(r.close)||throwUnpolyfillable(s,lt);try{l=r.clone();r.close()}catch(t){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(s,lt)}if(void 0===l)throw new H("This object cannot be transferred: "+s,ot);J(e,r,l)}};a({global:!0,enumerable:!0,sham:!pt,forced:dt},{structuredClone:function structuredClone(t){var e,i=S(arguments.length,1)>1&&!p(arguments[1])?v(arguments[1]):void 0,r=i?i.transfer:void 0;if(void 0!==r){e=new X;tryToTransfer(r,e)}return structuredCloneInternal(t,e)}})},(t,e,i)=>{var r=i(17),s=i(10),a=i(24),n=i(82),o=i(27),l=i(54),noop=function(){},c=[],d=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,u=r(h.exec),p=!h.exec(noop),f=function isConstructor(t){if(!a(t))return!1;try{d(noop,c,t);return!0}catch(t){return!1}},g=function isConstructor(t){if(!a(t))return!1;switch(n(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!u(h,l(t))}catch(t){return!0}};g.sham=!0;t.exports=!d||s((function(){var t;return f(f.call)||!f(Object)||!f((function(){t=!0}))||t}))?g:f},t=>{var e=TypeError;t.exports=function(t,i){if(t<i)throw e("Not enough arguments");return t}},(t,e,i)=>{var r=i(11),s=i(42),a=i(28),n=i(126),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||s(t,"flags")||!a(o,t)?e:r(n,t)}},(t,e,i)=>{"use strict";var r=i(50);t.exports=function(){var t=r(this),e="";t.hasIndices&&(e+="d");t.global&&(e+="g");t.ignoreCase&&(e+="i");t.multiline&&(e+="m");t.dotAll&&(e+="s");t.unicode&&(e+="u");t.unicodeSets&&(e+="v");t.sticky&&(e+="y");return e}},(t,e,i)=>{var r=i(10),s=i(14);t.exports=!r((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",s(1,7));return 7!==t.stack}))},(t,e,i)=>{var r=i(129),s=i(130);t.exports=!r&&!s&&"object"==typeof window&&"object"==typeof document},t=>{t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(t,e,i)=>{var r=i(18),s=i(7);t.exports="process"==r(s.process)},(t,e,i)=>{var r=i(7);t.exports=r},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0;exports.getDocument=getDocument;exports.setPDFNetworkStreamFactory=setPDFNetworkStreamFactory;exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(133),_display_utils=__w_pdfjs_require__(136),_font_loader=__w_pdfjs_require__(139),_canvas=__w_pdfjs_require__(140),_worker_options=__w_pdfjs_require__(143),_is_node=__w_pdfjs_require__(3),_message_handler=__w_pdfjs_require__(144),_metadata=__w_pdfjs_require__(145),_optional_content_config=__w_pdfjs_require__(146),_transport_stream=__w_pdfjs_require__(147),_xfa_text=__w_pdfjs_require__(148);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldSet(t,e,i){_classApplyDescriptorSet(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(t,e){return _classApplyDescriptorGet(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function _classStaticPrivateFieldSpecSet(t,e,i,r){_classCheckPrivateStaticAccess(t,e);_classCheckPrivateStaticFieldDescriptor(i,"set");_classApplyDescriptorSet(t,i,r);return r}function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}function _classStaticPrivateFieldSpecGet(t,e,i){_classCheckPrivateStaticAccess(t,e);_classCheckPrivateStaticFieldDescriptor(i,"get");return _classApplyDescriptorGet(t,i)}function _classCheckPrivateStaticFieldDescriptor(t,e){if(void 0===t)throw new TypeError("attempted to "+e+" private static field before its declaration")}function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100;let DefaultCanvasFactory=_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;let DefaultCMapReaderFactory=_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;let DefaultStandardFontDataFactory=_display_utils.DOMStandardFontDataFactory,createPDFNetworkStream;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;if(_is_node.isNodeJS){const{NodeCanvasFactory:t,NodeCMapReaderFactory:e,NodeStandardFontDataFactory:i}=__w_pdfjs_require__(149);exports.DefaultCanvasFactory=DefaultCanvasFactory=t;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory=e;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory=i}function setPDFNetworkStreamFactory(t){createPDFNetworkStream=t}function getDocument(t){const e=new PDFDocumentLoadingTask;let i;if("string"==typeof t||t instanceof URL)i={url:t};else if((0,_util.isArrayBuffer)(t))i={data:t};else if(t instanceof PDFDataRangeTransport)i={range:t};else{if("object"!=typeof t)throw new Error("Invalid parameter in getDocument, need either string, URL, TypedArray, or parameter object.");if(!t.url&&!t.data&&!t.range)throw new Error("Invalid parameter object: need either .data, .range or .url");i=t}const r=Object.create(null);let s=null,a=null;for(const t in i){const e=i[t];switch(t){case"url":if("undefined"!=typeof window)try{r[t]=new URL(e,window.location).href;continue}catch(t){(0,_util.warn)(`Cannot create valid URL: "${t}".`)}else if("string"==typeof e||e instanceof URL){r[t]=e.toString();continue}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");case"range":s=e;continue;case"worker":a=e;continue;case"data":if(_is_node.isNodeJS&&"undefined"!=typeof Buffer&&e instanceof Buffer)r[t]=new Uint8Array(e);else{if(e instanceof Uint8Array)break;if("string"==typeof e)r[t]=(0,_util.stringToBytes)(e);else if("object"!=typeof e||null===e||isNaN(e.length)){if(!(0,_util.isArrayBuffer)(e))throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");r[t]=new Uint8Array(e)}else r[t]=new Uint8Array(e)}continue}r[t]=e}r.CMapReaderFactory=r.CMapReaderFactory||DefaultCMapReaderFactory;r.StandardFontDataFactory=r.StandardFontDataFactory||DefaultStandardFontDataFactory;r.ignoreErrors=!0!==r.stopAtErrors;r.fontExtraProperties=!0===r.fontExtraProperties;r.pdfBug=!0===r.pdfBug;r.enableXfa=!0===r.enableXfa;(!Number.isInteger(r.rangeChunkSize)||r.rangeChunkSize<1)&&(r.rangeChunkSize=DEFAULT_RANGE_CHUNK_SIZE);("string"!=typeof r.docBaseUrl||(0,_display_utils.isDataScheme)(r.docBaseUrl))&&(r.docBaseUrl=null);(!Number.isInteger(r.maxImageSize)||r.maxImageSize<-1)&&(r.maxImageSize=-1);"string"!=typeof r.cMapUrl&&(r.cMapUrl=null);"string"!=typeof r.standardFontDataUrl&&(r.standardFontDataUrl=null);"boolean"!=typeof r.useWorkerFetch&&(r.useWorkerFetch=r.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&r.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory);"boolean"!=typeof r.isEvalSupported&&(r.isEvalSupported=!0);"boolean"!=typeof r.disableFontFace&&(r.disableFontFace=_is_node.isNodeJS);"boolean"!=typeof r.useSystemFonts&&(r.useSystemFonts=!_is_node.isNodeJS&&!r.disableFontFace);"object"==typeof r.ownerDocument&&null!==r.ownerDocument||(r.ownerDocument=globalThis.document);"boolean"!=typeof r.disableRange&&(r.disableRange=!1);"boolean"!=typeof r.disableStream&&(r.disableStream=!1);"boolean"!=typeof r.disableAutoFetch&&(r.disableAutoFetch=!1);(0,_util.setVerbosityLevel)(r.verbosity);if(!a){const t={verbosity:r.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};a=t.port?PDFWorker.fromPort(t):new PDFWorker(t);e._worker=a}const n=e.docId;a.promise.then((function(){if(e.destroyed)throw new Error("Loading aborted");const t=_fetchDocument(a,r,s,n),i=new Promise((function(t){let e;s?e=new _transport_stream.PDFDataTransportStream({length:r.length,initialData:r.initialData,progressiveDone:r.progressiveDone,contentDispositionFilename:r.contentDispositionFilename,disableRange:r.disableRange,disableStream:r.disableStream},s):r.data||(e=createPDFNetworkStream({url:r.url,length:r.length,httpHeaders:r.httpHeaders,withCredentials:r.withCredentials,rangeChunkSize:r.rangeChunkSize,disableRange:r.disableRange,disableStream:r.disableStream}));t(e)}));return Promise.all([t,i]).then((function(t){let[i,s]=t;if(e.destroyed)throw new Error("Loading aborted");const o=new _message_handler.MessageHandler(n,i,a.port),l=new WorkerTransport(o,e,s,r);e._transport=l;o.send("Ready",null)}))})).catch(e._capability.reject);return e}async function _fetchDocument(t,e,i,r){if(t.destroyed)throw new Error("Worker was destroyed");if(i){e.length=i.length;e.initialData=i.initialData;e.progressiveDone=i.progressiveDone;e.contentDispositionFilename=i.contentDispositionFilename}const s=await t.messageHandler.sendWithPromise("GetDocRequest",{docId:r,apiVersion:"3.0.150",source:{data:e.data,url:e.url,password:e.password,disableAutoFetch:e.disableAutoFetch,rangeChunkSize:e.rangeChunkSize,length:e.length},maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,docBaseUrl:e.docBaseUrl,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties,enableXfa:e.enableXfa,useSystemFonts:e.useSystemFonts,cMapUrl:e.useWorkerFetch?e.cMapUrl:null,standardFontDataUrl:e.useWorkerFetch?e.standardFontDataUrl:null});e.data&&(e.data=null);if(t.destroyed)throw new Error("Worker was destroyed");return s}class PDFDocumentLoadingTask{constructor(){var t,e;this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId=`d${_classStaticPrivateFieldSpecSet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId,(t=_classStaticPrivateFieldSpecGet(PDFDocumentLoadingTask,PDFDocumentLoadingTask,_docId),e=t++,t)),e}`;this.destroyed=!1;this.onPassword=null;this.onProgress=null;this.onUnsupportedFeature=null}get promise(){return this._capability.promise}async destroy(){var t;this.destroyed=!0;await(null===(t=this._transport)||void 0===t?void 0:t.destroy());this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}}}exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;var _docId={writable:!0,value:0};class PDFDataRangeTransport{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.length=t;this.initialData=e;this.progressiveDone=i;this.contentDispositionFilename=r;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}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){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(t,e){this._pdfInfo=t;this._transport=e}get annotationStorage(){return this._transport.annotationStorage}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get stats(){return this._transport.stats}get isPureXfa(){return!!this._transport._htmlForXfa}get allXfaHtml(){return this._transport._htmlForXfa}getPage(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()}getJavaScript(){return this._transport.getJavaScript()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}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()}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()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this._pageIndex=t;this._pageInfo=e;this._ownerDocument=r;this._transport=i;this._stats=s?new _display_utils.StatTimer:null;this._pdfBug=s;this.commonObjs=i.commonObjs;this.objs=new PDFObjects;this._bitmaps=new Set;this.cleanupAfterRender=!1;this.pendingCleanup=!1;this._intentStates=new Map;this._annotationPromises=new Map;this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport(){let{scale:t,rotation:e=this.rotate,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new _display_utils.PageViewport({viewBox:this.view,scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s})}getAnnotations(){let{intent:t="display"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._transport.getRenderingIntent(t);let i=this._annotationPromises.get(e.cacheKey);if(!i){i=this._transport.getAnnotations(this._pageIndex,e.renderingIntent);this._annotationPromises.set(e.cacheKey,i)}return i}getJSActions(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))}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:r,viewport:s,intent:a="display",annotationMode:n=_util.AnnotationMode.ENABLE,transform:o=null,canvasFactory:l=null,background:c=null,optionalContentConfigPromise:d=null,annotationCanvasMap:h=null,pageColors:u=null,printAnnotationStorage:p=null}=t;null===(e=this._stats)||void 0===e||e.time("Overall");const f=this._transport.getRenderingIntent(a,n,p);this.pendingCleanup=!1;d||(d=this._transport.getOptionalContentConfig());let g=this._intentStates.get(f.cacheKey);if(!g){g=Object.create(null);this._intentStates.set(f.cacheKey,g)}if(g.streamReaderCancelTimeout){clearTimeout(g.streamReaderCancelTimeout);g.streamReaderCancelTimeout=null}const m=l||new DefaultCanvasFactory({ownerDocument:this._ownerDocument}),v=!!(f.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!g.displayReadyCapability){var _;g.displayReadyCapability=(0,_util.createPromiseCapability)();g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(_=this._stats)||void 0===_||_.time("Page Request");this._pumpOperatorList(f)}const complete=t=>{var e,i;g.renderTasks.delete(b);(this.cleanupAfterRender||v)&&(this.pendingCleanup=!0);this._tryCleanup();if(t){b.capability.reject(t);this._abortOperatorList({intentState:g,reason:t instanceof Error?t:new Error(t)})}else b.capability.resolve();null===(e=this._stats)||void 0===e||e.timeEnd("Rendering");null===(i=this._stats)||void 0===i||i.timeEnd("Overall")},b=new InternalRenderTask({callback:complete,params:{canvasContext:r,viewport:s,transform:o,background:c},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:h,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:m,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:u});((i=g).renderTasks||(i.renderTasks=new Set)).add(b);const y=b.task;Promise.all([g.displayReadyCapability.promise,d]).then((t=>{var e;let[i,r]=t;if(this.pendingCleanup)complete();else{null===(e=this._stats)||void 0===e||e.time("Rendering");b.initializeGraphics({transparency:i,optionalContentConfig:r});b.operatorListChanged()}})).catch(complete);return y}getOperatorList(){let{intent:t="display",annotationMode:e=_util.AnnotationMode.ENABLE,printAnnotationStorage:i=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=this._transport.getRenderingIntent(t,e,i,!0);let s,a=this._intentStates.get(r.cacheKey);if(!a){a=Object.create(null);this._intentStates.set(r.cacheKey,a)}if(!a.opListReadCapability){var n,o;s=Object.create(null);s.operatorListChanged=function operatorListChanged(){if(a.operatorList.lastChunk){a.opListReadCapability.resolve(a.operatorList);a.renderTasks.delete(s)}};a.opListReadCapability=(0,_util.createPromiseCapability)();((n=a).renderTasks||(n.renderTasks=new Set)).add(s);a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null};null===(o=this._stats)||void 0===o||o.time("Page Request");this._pumpOperatorList(r)}return a.opListReadCapability.promise}streamTextContent(){let{disableCombineTextItems:t=!1,includeMarkedContent:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,combineTextItems:!0!==t,includeMarkedContent:!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=>_xfa_text.XfaText.textContent(t)));const e=this.streamTextContent(t);return new Promise((function(t,i){const r=e.getReader(),s={items:[],styles:Object.create(null)};!function pump(){r.read().then((function(e){let{value:i,done:r}=e;if(r)t(s);else{Object.assign(s.styles,i.styles);s.items.push(...i.items);pump()}}),i)}()}))}getStructTree(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))}_destroy(){this.destroyed=!0;const t=[];for(const e of this._intentStates.values()){this._abortOperatorList({intentState:e,reason:new Error("Page was destroyed."),force:!0});if(!e.opListReadCapability)for(const i of e.renderTasks){t.push(i.completed);i.cancel()}}this.objs.clear();for(const t of this._bitmaps)t.close();this._bitmaps.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;this.pendingCleanup=!1;return Promise.all(t)}cleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.pendingCleanup=!0;return this._tryCleanup(t)}_tryCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.pendingCleanup)return!1;for(const{renderTasks:t,operatorList:e}of this._intentStates.values())if(t.size>0||!e.lastChunk)return!1;this._intentStates.clear();this.objs.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;t&&this._stats&&(this._stats=new _display_utils.StatTimer);for(const t of this._bitmaps)t.close();this._bitmaps.clear();this.pendingCleanup=!1;return!0}_startRenderPage(t,e){var i,r;const s=this._intentStates.get(e);if(s){null===(i=this._stats)||void 0===i||i.timeEnd("Page Request");null===(r=s.displayReadyCapability)||void 0===r||r.resolve(t)}}_renderPageChunk(t,e){for(let i=0,r=t.length;i<r;i++){e.operatorList.fnArray.push(t.fnArray[i]);e.operatorList.argsArray.push(t.argsArray[i])}e.operatorList.lastChunk=t.lastChunk;e.operatorList.separateAnnots=t.separateAnnots;for(const t of e.renderTasks)t.operatorListChanged();t.lastChunk&&this._tryCleanup()}_pumpOperatorList(t){let{renderingIntent:e,cacheKey:i,annotationStorageMap:r}=t;const s=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:r}).getReader(),a=this._intentStates.get(i);a.streamReader=s;const pump=()=>{s.read().then((t=>{let{value:e,done:i}=t;if(i)a.streamReader=null;else if(!this._transport.destroyed){this._renderPageChunk(e,a);pump()}}),(t=>{a.streamReader=null;if(!this._transport.destroyed){if(a.operatorList){a.operatorList.lastChunk=!0;for(const t of a.renderTasks)t.operatorListChanged();this._tryCleanup()}if(a.displayReadyCapability)a.displayReadyCapability.reject(t);else{if(!a.opListReadCapability)throw t;a.opListReadCapability.reject(t)}}}))};pump()}_abortOperatorList(t){let{intentState:e,reason:i,force:r=!1}=t;if(e.streamReader){if(!r){if(e.renderTasks.size>0)return;if(i instanceof _display_utils.RenderingCancelledException){e.streamReaderCancelTimeout=setTimeout((()=>{this._abortOperatorList({intentState:e,reason:i,force:!0});e.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT);return}}e.streamReader.cancel(new _util.AbortException(i.message)).catch((()=>{}));e.streamReader=null;if(!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}}exports.PDFPageProxy=PDFPageProxy;var _listeners=new WeakMap,_deferred=new WeakMap;class LoopbackPort{constructor(){_classPrivateFieldInitSpec(this,_listeners,{writable:!0,value:[]});_classPrivateFieldInitSpec(this,_deferred,{writable:!0,value:Promise.resolve()})}postMessage(t,e){const i={data:structuredClone(t,e)};_classPrivateFieldGet(this,_deferred).then((()=>{for(const t of _classPrivateFieldGet(this,_listeners))t.call(this,i)}))}addEventListener(t,e){_classPrivateFieldGet(this,_listeners).push(e)}removeEventListener(t,e){const i=_classPrivateFieldGet(this,_listeners).indexOf(e);_classPrivateFieldGet(this,_listeners).splice(i,1)}terminate(){_classPrivateFieldGet(this,_listeners).length=0}}exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;if(_is_node.isNodeJS&&"function"==typeof require){PDFWorkerUtil.isWorkerDisabled=!0;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if("object"==typeof document){var _document,_document$currentScri;const t=null===(_document=document)||void 0===_document||null===(_document$currentScri=_document.currentScript)||void 0===_document$currentScri?void 0:_document$currentScri.src;t&&(PDFWorkerUtil.fallbackWorkerSrc=t.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(t,e){let i;try{i=new URL(t);if(!i.origin||"null"===i.origin)return!1}catch(t){return!1}const r=new URL(e,i);return i.origin===r.origin};PDFWorkerUtil.createCDNWrapper=function(t){const e=`importScripts("${t}");`;return URL.createObjectURL(new Blob([e]))};class PDFWorker{constructor(){let{name:t=null,port:e=null,verbosity:i=(0,_util.getVerbosityLevel)()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e&&_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).has(e))throw new Error("Cannot use more than one PDFWorker per port.");this.name=t;this.destroyed=!1;this.verbosity=i;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(e){_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).set(e,this);this._initializeFromPort(e)}else this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(t){this._port=t;this._messageHandler=new _message_handler.MessageHandler("main","worker",t);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve();this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:t}=PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,t)||(t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t),i=new _message_handler.MessageHandler("main","worker",e),terminateEarly=()=>{e.removeEventListener("error",onWorkerError);i.destroy();e.terminate();this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},onWorkerError=()=>{this._webWorker||terminateEarly()};e.addEventListener("error",onWorkerError);i.on("test",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else if(t){this._messageHandler=i;this._port=e;this._webWorker=e;this._readyCapability.resolve();i.send("configure",{verbosity:this.verbosity})}else{this._setupFakeWorker();i.destroy();e.terminate()}}));i.on("ready",(t=>{e.removeEventListener("error",onWorkerError);if(this.destroyed)terminateEarly();else try{sendTest()}catch(t){this._setupFakeWorker()}}));const sendTest=()=>{const t=new Uint8Array;i.send("test",t,[t.buffer])};sendTest();return}catch(t){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=!0}PDFWorker._setupFakeWorkerGlobal.then((t=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const e=new LoopbackPort;this._port=e;const i="fake"+PDFWorkerUtil.fakeWorkerId++,r=new _message_handler.MessageHandler(i+"_worker",i,e);t.setup(r,e);const s=new _message_handler.MessageHandler(i,i+"_worker",e);this._messageHandler=s;this._readyCapability.resolve();s.send("configure",{verbosity:this.verbosity})})).catch((t=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${t.message}".`))}))}destroy(){this.destroyed=!0;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}_classStaticPrivateFieldSpecGet(PDFWorker,PDFWorker,_workerPorts).delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}}static fromPort(t){if(null==t||!t.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return _classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).has(t.port)?_classStaticPrivateFieldSpecGet(this,PDFWorker,_workerPorts).get(t.port):new PDFWorker(t)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(null!==PDFWorkerUtil.fallbackWorkerSrc){_is_node.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.');return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){try{var t;return(null===(t=globalThis.pdfjsWorker)||void 0===t?void 0:t.WorkerMessageHandler)||null}catch(t){return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_is_node.isNodeJS&&"function"==typeof require){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}await(0,_display_utils.loadScript)(this.workerSrc);return window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}}exports.PDFWorker=PDFWorker;var _workerPorts={writable:!0,value:new WeakMap},_docStats=new WeakMap,_pageCache=new WeakMap,_pagePromises=new WeakMap,_metadataPromise=new WeakMap;class WorkerTransport{constructor(t,e,i,r){_classPrivateFieldInitSpec(this,_docStats,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_pageCache,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_pagePromises,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,_metadataPromise,{writable:!0,value:null});this.messageHandler=t;this.loadingTask=e;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({docId:e.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:r.ownerDocument,styleElement:r.styleElement});this._params=r;if(!r.useWorkerFetch){this.CMapReaderFactory=new r.CMapReaderFactory({baseUrl:r.cMapUrl,isCompressed:r.cMapPacked});this.StandardFontDataFactory=new r.StandardFontDataFactory({baseUrl:r.standardFontDataUrl})}this.destroyed=!1;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=i;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}get stats(){return _classPrivateFieldGet(this,_docStats)}getRenderingIntent(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_util.AnnotationMode.ENABLE,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=_util.RenderingIntentFlag.DISPLAY,a=null;switch(t){case"any":s=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":s=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${t}`)}switch(e){case _util.AnnotationMode.DISABLE:s+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:s+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:s+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;a=(s&_util.RenderingIntentFlag.PRINT&&i instanceof _annotation_storage.PrintAnnotationStorage?i:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${e}`)}r&&(s+=_util.RenderingIntentFlag.OPLIST);return{renderingIntent:s,cacheKey:`${s}_${_annotation_storage.AnnotationStorage.getHash(a)}`,annotationStorageMap:a}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0;this.destroyCapability=(0,_util.createPromiseCapability)();this._passwordCapability&&this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"));const t=[];for(const e of _classPrivateFieldGet(this,_pageCache).values())t.push(e._destroy());_classPrivateFieldGet(this,_pageCache).clear();_classPrivateFieldGet(this,_pagePromises).clear();this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const e=this.messageHandler.sendWithPromise("Terminate",null);t.push(e);Promise.all(t).then((()=>{this.commonObjs.clear();this.fontLoader.clear();_classPrivateFieldSet(this,_metadataPromise,null);this._getFieldObjectsPromise=null;this._hasJSActionsPromise=null;this._networkStream&&this._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."));if(this.messageHandler){this.messageHandler.destroy();this.messageHandler=null}this.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:t,loadingTask:e}=this;t.on("GetReader",((t,e)=>{(0,_util.assert)(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:r}=t;if(r)e.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(i),"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=(0,_util.createPromiseCapability)(),r=this._fullReader;r.headersReady.then((()=>{if(!r.isStreamingSupported||!r.isRangeSupported){if(this._lastProgress){var t;null===(t=e.onProgress)||void 0===t||t.call(e,this._lastProgress)}r.onProgress=t=>{var i;null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded,total:t.total})}}i.resolve({isStreamingSupported:r.isStreamingSupported,isRangeSupported:r.isRangeSupported,contentLength:r.contentLength})}),i.reject);return i.promise}));t.on("GetRangeReader",((t,e)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const i=this._networkStream.getRangeReader(t.begin,t.end);if(i){e.onPull=()=>{i.read().then((function(t){let{value:i,done:r}=t;if(r)e.close();else{(0,_util.assert)((0,_util.isArrayBuffer)(i),"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}))}}else 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 PDFDocumentProxy(i,this))}));t.on("DocException",(function(t){let i;switch(t.name){case"PasswordException":i=new _util.PasswordException(t.message,t.code);break;case"InvalidPDFException":i=new _util.InvalidPDFException(t.message);break;case"MissingPDFException":i=new _util.MissingPDFException(t.message);break;case"UnexpectedResponseException":i=new _util.UnexpectedResponseException(t.message,t.status);break;case"UnknownErrorException":i=new _util.UnknownErrorException(t.message,t.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}e._capability.reject(i)}));t.on("PasswordRequest",(t=>{this._passwordCapability=(0,_util.createPromiseCapability)();if(e.onPassword){const updatePassword=t=>{t instanceof Error?this._passwordCapability.reject(t):this._passwordCapability.resolve({password:t})};try{e.onPassword(updatePassword,t.code)}catch(t){this._passwordCapability.reject(t)}}else this._passwordCapability.reject(new _util.PasswordException(t.message,t.code));return this._passwordCapability.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;_classPrivateFieldGet(this,_pageCache).get(t.pageIndex)._startRenderPage(t.transparency,t.cacheKey)}));t.on("commonobj",(e=>{var i;let[r,s,a]=e;if(!this.destroyed&&!this.commonObjs.has(r))switch(s){case"Font":const e=this._params;if("error"in a){const t=a.error;(0,_util.warn)(`Error during font loading: ${t}`);this.commonObjs.resolve(r,t);break}let n=null;e.pdfBug&&null!==(i=globalThis.FontInspector)&&void 0!==i&&i.enabled&&(n={registerFont(t,e){globalThis.FontInspector.fontAdded(t,e)}});const o=new _font_loader.FontFaceObject(a,{isEvalSupported:e.isEvalSupported,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),fontRegistry:n});this.fontLoader.bind(o).catch((e=>t.sendWithPromise("FontFallback",{id:r}))).finally((()=>{!e.fontExtraProperties&&o.data&&(o.data=null);this.commonObjs.resolve(r,o)}));break;case"FontPath":case"Image":this.commonObjs.resolve(r,a);break;default:throw new Error(`Got unknown common object type ${s}`)}}));t.on("obj",(t=>{let[e,i,r,s]=t;if(this.destroyed)return;const a=_classPrivateFieldGet(this,_pageCache).get(i);if(!a.objs.has(e))switch(r){case"Image":a.objs.resolve(e,s);const t=8e6;if(s){let e;if(s.bitmap){const{bitmap:t,width:i,height:r}=s;e=i*r*4;a._bitmaps.add(t)}else{var n;e=(null===(n=s.data)||void 0===n?void 0:n.length)||0}e>t&&(a.cleanupAfterRender=!0)}break;case"Pattern":a.objs.resolve(e,s);break;default:throw new Error(`Got unknown object type ${r}`)}}));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("DocStats",(t=>{this.destroyed||_classPrivateFieldSet(this,_docStats,Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}))}));t.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));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."))))}_onUnsupportedFeature(t){var e,i;let{featureId:r}=t;this.destroyed||null===(e=(i=this.loadingTask).onUnsupportedFeature)||void 0===e||e.call(i,r)}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var t;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(null===(t=this._fullReader)||void 0===t?void 0:t.filename)??null}).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=_classPrivateFieldGet(this,_pagePromises).get(e);if(i)return i;const r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:e}).then((t=>{if(this.destroyed)throw new Error("Transport destroyed");const i=new PDFPageProxy(e,t,this,this._params.ownerDocument,this._params.pdfBug);_classPrivateFieldGet(this,_pageCache).set(e,i);return i}));_classPrivateFieldGet(this,_pagePromises).set(e,r);return r}getPageIndex(t){return"object"!=typeof t||null===t||!Number.isInteger(t.num)||t.num<0||!Number.isInteger(t.gen)||t.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:t.num,gen:t.gen})}getAnnotations(t,e){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:t,intent:e})}getFieldObjects(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))}hasJSActions(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))}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)}getJavaScript(){return this.messageHandler.sendWithPromise("GetJavaScript",null)}getDocJSActions(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)}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(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((t=>new _optional_content_config.OptionalContentConfig(t)))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){return _classPrivateFieldGet(this,_metadataPromise)||_classPrivateFieldSet(this,_metadataPromise,this.messageHandler.sendWithPromise("GetMetadata",null).then((t=>{var e,i;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:(null===(e=this._fullReader)||void 0===e?void 0:e.filename)??null,contentLength:(null===(i=this._fullReader)||void 0===i?void 0:i.contentLength)??null}})))}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];await this.messageHandler.sendWithPromise("Cleanup",null);if(!this.destroyed){for(const t of _classPrivateFieldGet(this,_pageCache).values()){if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`)}this.commonObjs.clear();t||this.fontLoader.clear();_classPrivateFieldSet(this,_metadataPromise,null);this._getFieldObjectsPromise=null;this._hasJSActionsPromise=null}}get loadingParams(){const t=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:t.disableAutoFetch,enableXfa:t.enableXfa})}}var _objs=new WeakMap,_ensureObj=new WeakSet;class PDFObjects{constructor(){_classPrivateMethodInitSpec(this,_ensureObj);_classPrivateFieldInitSpec(this,_objs,{writable:!0,value:Object.create(null)})}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e){const i=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);i.capability.promise.then((()=>e(i.data)));return null}const i=_classPrivateFieldGet(this,_objs)[t];if(null==i||!i.capability.settled)throw new Error(`Requesting object that isn't resolved yet ${t}.`);return i.data}has(t){const e=_classPrivateFieldGet(this,_objs)[t];return(null==e?void 0:e.capability.settled)||!1}resolve(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=_classPrivateMethodGet(this,_ensureObj,_ensureObj2).call(this,t);i.data=e;i.capability.resolve()}clear(){_classPrivateFieldSet(this,_objs,Object.create(null))}}function _ensureObj2(t){const e=_classPrivateFieldGet(this,_objs)[t];return e||(_classPrivateFieldGet(this,_objs)[t]={capability:(0,_util.createPromiseCapability)(),data:null})}var _internalRenderTask=new WeakMap;class RenderTask{constructor(t){_classPrivateFieldInitSpec(this,_internalRenderTask,{writable:!0,value:null});_classPrivateFieldSet(this,_internalRenderTask,t);this.onContinue=null}get promise(){return _classPrivateFieldGet(this,_internalRenderTask).capability.promise}cancel(){_classPrivateFieldGet(this,_internalRenderTask).cancel()}get separateAnnots(){const{separateAnnots:t}=_classPrivateFieldGet(this,_internalRenderTask).operatorList;if(!t)return!1;const{annotationCanvasMap:e}=_classPrivateFieldGet(this,_internalRenderTask);return t.form||t.canvas&&(null==e?void 0:e.size)>0}}exports.RenderTask=RenderTask;class InternalRenderTask{constructor(t){let{callback:e,params:i,objs:r,commonObjs:s,annotationCanvasMap:a,operatorList:n,pageIndex:o,canvasFactory:l,useRequestAnimationFrame:c=!1,pdfBug:d=!1,pageColors:h=null}=t;this.callback=e;this.params=i;this.objs=r;this.commonObjs=s;this.annotationCanvasMap=a;this.operatorListIdx=null;this.operatorList=n;this._pageIndex=o;this.canvasFactory=l;this._pdfBug=d;this.pageColors=h;this.running=!1;this.graphicsReadyCallback=null;this.graphicsReady=!1;this._useRequestAnimationFrame=!0===c&&"undefined"!=typeof window;this.cancelled=!1;this.capability=(0,_util.createPromiseCapability)();this.task=new RenderTask(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:r=!1,optionalContentConfig:s}=t;if(this.cancelled)return;if(this._canvas){if(_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).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.");_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).add(this._canvas)}if(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:n,transform:o,background:l}=this.params;this.gfx=new _canvas.CanvasGraphics(a,this.commonObjs,this.objs,this.canvasFactory,s,this.annotationCanvasMap,this.pageColors);this.gfx.beginDrawing({transform:o,viewport:n,transparency:r,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;this.running=!1;this.cancelled=!0;null===(t=this.gfx)||void 0===t||t.endDrawing();this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas);this.callback(e||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,"canvas"))}operatorListChanged(){var t;if(this.graphicsReady){null===(t=this.stepper)||void 0===t||t.updateOperatorList(this.operatorList);this.running||this._continue()}else 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?window.requestAnimationFrame((()=>{this._nextBound().catch(this._cancelBound)})):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){if(!this.cancelled){this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=!1;if(this.operatorList.lastChunk){this.gfx.endDrawing();this._canvas&&_classStaticPrivateFieldSpecGet(InternalRenderTask,InternalRenderTask,_canvasInUse).delete(this._canvas);this.callback()}}}}}var _canvasInUse={writable:!0,value:new WeakSet};const version="3.0.150";exports.version=version;const build="7b24931f6";exports.build=build},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PrintAnnotationStorage=e.AnnotationStorage=void 0;var r=i(1),s=i(134),a=i(138);function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}var n=new WeakSet;class AnnotationStorage{constructor(){!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,n);this._storage=new Map;this._modified=!1;this.onSetModified=null;this.onResetModified=null;this.onAnnotationEditor=null}getValue(t,e){const i=this._storage.get(t);return void 0===i?e:Object.assign(e,i)}getRawValue(t){return this._storage.get(t)}remove(t){this._storage.delete(t);0===this._storage.size&&this.resetModified();if("function"==typeof this.onAnnotationEditor){for(const t of this._storage.values())if(t instanceof s.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(t,e){const i=this._storage.get(t);let r=!1;if(void 0!==i){for(const[t,s]of Object.entries(e))if(i[t]!==s){r=!0;i[t]=s}}else{r=!0;this._storage.set(t,e)}r&&function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}(this,n,_setModified2).call(this);e instanceof s.AnnotationEditor&&"function"==typeof this.onAnnotationEditor&&this.onAnnotationEditor(e.constructor._type)}has(t){return this._storage.has(t)}getAll(){return this._storage.size>0?(0,r.objectFromMap)(this._storage):null}get size(){return this._storage.size}resetModified(){if(this._modified){this._modified=!1;"function"==typeof this.onResetModified&&this.onResetModified()}}get print(){return new PrintAnnotationStorage(this)}get serializable(){if(0===this._storage.size)return null;const t=new Map;for(const[e,i]of this._storage){const r=i instanceof s.AnnotationEditor?i.serialize():i;r&&t.set(e,r)}return t}static getHash(t){if(!t)return"";const e=new a.MurmurHash3_64;for(const[i,r]of t)e.update(`${i}:${JSON.stringify(r)}`);return e.hexdigest()}}e.AnnotationStorage=AnnotationStorage;function _setModified2(){if(!this._modified){this._modified=!0;"function"==typeof this.onSetModified&&this.onSetModified()}}var o=new WeakMap;class PrintAnnotationStorage extends AnnotationStorage{constructor(t){super();!function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}(this,o,{writable:!0,value:null});_classPrivateFieldSet(this,o,structuredClone(t.serializable))}get print(){(0,r.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){return e.get?e.get.call(t):e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}(this,o)}}e.PrintAnnotationStorage=PrintAnnotationStorage},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditor=void 0;var r=i(135),s=i(1);function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}function _classPrivateFieldInitSpec(t,e,i){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.set(t,i)}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var a=new WeakMap,n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap;class AnnotationEditor{constructor(t){_classPrivateFieldInitSpec(this,a,{writable:!0,value:this.focusin.bind(this)});_classPrivateFieldInitSpec(this,n,{writable:!0,value:this.focusout.bind(this)});_classPrivateFieldInitSpec(this,o,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,l,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,c,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,d,{writable:!0,value:AnnotationEditor._zIndex++});this.constructor===AnnotationEditor&&(0,s.unreachable)("Cannot initialize AnnotationEditor.");this.parent=t.parent;this.id=t.id;this.width=this.height=null;this.pageIndex=t.parent.pageIndex;this.name=t.name;this.div=null;const[e,i]=this.parent.viewportBaseDimensions;this.x=t.x/e;this.y=t.y/i;this.rotation=this.parent.viewport.rotation;this.isAttachedToDOM=!1}static get _defaultLineColor(){return(0,s.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=_classPrivateFieldGet(this,d)}focusin(t){_classPrivateFieldGet(this,o)?_classPrivateFieldSet(this,o,!1):this.parent.setSelected(this)}focusout(t){if(!this.isAttachedToDOM)return;const e=t.relatedTarget;if(null==e||!e.closest(`#${this.id}`)){t.preventDefault();this.parent.isMultipleSelection||this.commitOrRemove()}}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.parent.addToAnnotationStorage(this)}dragstart(t){const e=this.parent.div.getBoundingClientRect();this.startX=t.clientX-e.x;this.startY=t.clientY-e.y;t.dataTransfer.setData("text/plain",this.id);t.dataTransfer.effectAllowed="move"}setAt(t,e,i,r){const[s,a]=this.parent.viewportBaseDimensions;[i,r]=this.screenToPageTranslation(i,r);this.x=(t+i)/s;this.y=(e+r)/a;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}translate(t,e){const[i,r]=this.parent.viewportBaseDimensions;[t,e]=this.screenToPageTranslation(t,e);this.x+=t/i;this.y+=e/r;this.div.style.left=100*this.x+"%";this.div.style.top=100*this.y+"%"}screenToPageTranslation(t,e){const{rotation:i}=this.parent.viewport;switch(i){case 90:return[e,-t];case 180:return[-t,-e];case 270:return[-e,t];default:return[t,e]}}setDims(t,e){const[i,r]=this.parent.viewportBaseDimensions;this.div.style.width=100*t/i+"%";this.div.style.height=100*e/r+"%"}getInitialTranslation(){return[0,0]}render(){this.div=document.createElement("div");this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360);this.div.className=this.name;this.div.setAttribute("id",this.id);this.div.setAttribute("tabIndex",0);this.setInForeground();this.div.addEventListener("focusin",_classPrivateFieldGet(this,a));this.div.addEventListener("focusout",_classPrivateFieldGet(this,n));const[t,e]=this.getInitialTranslation();this.translate(t,e);(0,r.bindEvents)(this,this.div,["dragstart","pointerdown"]);return this.div}pointerdown(t){const e=r.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e)t.preventDefault();else{t.ctrlKey&&!e||t.shiftKey||t.metaKey&&e?this.parent.toggleSelected(this):this.parent.setSelected(this);_classPrivateFieldSet(this,o,!0)}}getRect(t,e){const[i,r]=this.parent.viewportBaseDimensions,[s,a]=this.parent.pageDimensions,n=s*t/i,o=a*e/r,l=this.x*s,c=this.y*a,d=this.width*s,h=this.height*a;switch(this.rotation){case 0:return[l+n,a-c-o-h,l+n+d,a-c-o];case 90:return[l+o,a-c+n,l+o+h,a-c+n+d];case 180:return[l-n-d,a-c+o,l-n,a-c+o+h];case 270:return[l-o-h,a-c-n-d,l-o,a-c-n];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(t,e){const[i,r,s,a]=t,n=s-i,o=a-r;switch(this.rotation){case 0:return[i,e-a,n,o];case 90:return[i,e-r,o,n];case 180:return[s,e-r,n,o];case 270:return[s,e-a,o,n];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){_classPrivateFieldSet(this,c,!0)}disableEditMode(){_classPrivateFieldSet(this,c,!1)}isInEditMode(){return _classPrivateFieldGet(this,c)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var t;null===(t=this.div)||void 0===t||t.addEventListener("focusin",_classPrivateFieldGet(this,a))}serialize(){(0,s.unreachable)("An editor must be serializable")}static deserialize(t,e){const i=new this.prototype.constructor({parent:e,id:e.getNextId()});i.rotation=t.rotation;const[r,s]=e.pageDimensions,[a,n,o,l]=i.getRectInCurrentCoords(t.rect,s);i.x=a/r;i.y=n/s;i.width=o/r;i.height=l/s;return i}remove(){this.div.removeEventListener("focusin",_classPrivateFieldGet(this,a));this.div.removeEventListener("focusout",_classPrivateFieldGet(this,n));this.isEmpty()||this.commit();this.parent.remove(this)}select(){var t;null===(t=this.div)||void 0===t||t.classList.add("selectedEditor")}unselect(){var t;null===(t=this.div)||void 0===t||t.classList.remove("selectedEditor")}updateParams(t,e){}disableEditing(){}enableEditing(){}get propertiesToUpdate(){return{}}get contentDiv(){return this.div}get isEditing(){return _classPrivateFieldGet(this,l)}set isEditing(t){_classPrivateFieldSet(this,l,t);if(t){this.parent.setSelected(this);this.parent.setActiveEditor(this)}else this.parent.setActiveEditor(null)}}e.AnnotationEditor=AnnotationEditor;_defineProperty(AnnotationEditor,"_colorManager",new r.ColorManager);_defineProperty(AnnotationEditor,"_zIndex",1)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.KeyboardManager=e.CommandManager=e.ColorManager=e.AnnotationEditorUIManager=void 0;e.bindEvents=function bindEvents(t,e,i){for(const r of i)e.addEventListener(r,t[r].bind(t))};e.opacityToHex=function opacityToHex(t){return Math.round(Math.min(255,Math.max(1,255*t))).toString(16).padStart(2,"0")};var r=i(1),s=i(136);function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var a=new WeakMap;class IdManager{constructor(){_classPrivateFieldInitSpec(this,a,{writable:!0,value:0})}getId(){var t,e;return`${r.AnnotationEditorPrefix}${_classPrivateFieldSet(this,a,(t=_classPrivateFieldGet(this,a),e=t++,t)),e}`}}var n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap;class CommandManager{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:128;_classPrivateFieldInitSpec(this,n,{writable:!0,value:[]});_classPrivateFieldInitSpec(this,o,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,l,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:-1});_classPrivateFieldSet(this,l,t)}add(t){let{cmd:e,undo:i,mustExec:r,type:s=NaN,overwriteIfSameType:a=!1,keepUndo:d=!1}=t;r&&e();if(_classPrivateFieldGet(this,o))return;const h={cmd:e,undo:i,type:s};if(-1===_classPrivateFieldGet(this,c)){_classPrivateFieldGet(this,n).length>0&&(_classPrivateFieldGet(this,n).length=0);_classPrivateFieldSet(this,c,0);_classPrivateFieldGet(this,n).push(h);return}if(a&&_classPrivateFieldGet(this,n)[_classPrivateFieldGet(this,c)].type===s){d&&(h.undo=_classPrivateFieldGet(this,n)[_classPrivateFieldGet(this,c)].undo);_classPrivateFieldGet(this,n)[_classPrivateFieldGet(this,c)]=h;return}const u=_classPrivateFieldGet(this,c)+1;if(u===_classPrivateFieldGet(this,l))_classPrivateFieldGet(this,n).splice(0,1);else{_classPrivateFieldSet(this,c,u);u<_classPrivateFieldGet(this,n).length&&_classPrivateFieldGet(this,n).splice(u)}_classPrivateFieldGet(this,n).push(h)}undo(){if(-1!==_classPrivateFieldGet(this,c)){_classPrivateFieldSet(this,o,!0);_classPrivateFieldGet(this,n)[_classPrivateFieldGet(this,c)].undo();_classPrivateFieldSet(this,o,!1);_classPrivateFieldSet(this,c,_classPrivateFieldGet(this,c)-1)}}redo(){if(_classPrivateFieldGet(this,c)<_classPrivateFieldGet(this,n).length-1){_classPrivateFieldSet(this,c,_classPrivateFieldGet(this,c)+1);_classPrivateFieldSet(this,o,!0);_classPrivateFieldGet(this,n)[_classPrivateFieldGet(this,c)].cmd();_classPrivateFieldSet(this,o,!1)}}hasSomethingToUndo(){return-1!==_classPrivateFieldGet(this,c)}hasSomethingToRedo(){return _classPrivateFieldGet(this,c)<_classPrivateFieldGet(this,n).length-1}destroy(){_classPrivateFieldSet(this,n,null)}}e.CommandManager=CommandManager;var d=new WeakSet;class KeyboardManager{constructor(t){_classPrivateMethodInitSpec(this,d);this.buffer=[];this.callbacks=new Map;this.allKeys=new Set;const e=KeyboardManager.platform.isMac;for(const[i,r]of t)for(const t of i){const i=t.startsWith("mac+");if(e&&i){this.callbacks.set(t.slice(4),r);this.allKeys.add(t.split("+").at(-1))}else if(!e&&!i){this.callbacks.set(t,r);this.allKeys.add(t.split("+").at(-1))}}}static get platform(){const t="undefined"!=typeof navigator?navigator.platform:"";return(0,r.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}exec(t,e){if(!this.allKeys.has(e.key))return;const i=this.callbacks.get(_classPrivateMethodGet(this,d,_serialize2).call(this,e));if(i){i.bind(t)();e.stopPropagation();e.preventDefault()}}}e.KeyboardManager=KeyboardManager;function _serialize2(t){t.altKey&&this.buffer.push("alt");t.ctrlKey&&this.buffer.push("ctrl");t.metaKey&&this.buffer.push("meta");t.shiftKey&&this.buffer.push("shift");this.buffer.push(t.key);const e=this.buffer.join("+");this.buffer.length=0;return e}class ColorManager{get _colors(){const t=new Map([["CanvasText",null],["Canvas",null]]);(0,s.getColorValues)(t);return(0,r.shadow)(this,"_colors",t)}convert(t){const e=(0,s.getRGB)(t);if(!window.matchMedia("(forced-colors: active)").matches)return e;for(const[t,i]of this._colors)if(i.every(((t,i)=>t===e[i])))return ColorManager._colorsMapping.get(t);return e}getHexCode(t){const e=this._colors.get(t);return e?r.Util.makeHexColor(...e):t}}e.ColorManager=ColorManager;_defineProperty(ColorManager,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));var h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,_=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,P=new WeakMap,S=new WeakMap,x=new WeakMap,w=new WeakMap,E=new WeakMap,C=new WeakMap,k=new WeakMap,T=new WeakMap,M=new WeakSet,R=new WeakSet,I=new WeakSet,D=new WeakSet,O=new WeakSet,L=new WeakSet,G=new WeakSet,N=new WeakSet,j=new WeakSet,U=new WeakSet,B=new WeakSet;class AnnotationEditorUIManager{constructor(t,e){_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,U);_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,M);_classPrivateFieldInitSpec(this,h,{writable:!0,value:null});_classPrivateFieldInitSpec(this,u,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,p,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,f,{writable:!0,value:new CommandManager});_classPrivateFieldInitSpec(this,g,{writable:!0,value:0});_classPrivateFieldInitSpec(this,m,{writable:!0,value:null});_classPrivateFieldInitSpec(this,v,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_,{writable:!0,value:new IdManager});_classPrivateFieldInitSpec(this,b,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,y,{writable:!0,value:r.AnnotationEditorType.NONE});_classPrivateFieldInitSpec(this,A,{writable:!0,value:new Set});_classPrivateFieldInitSpec(this,P,{writable:!0,value:this.copy.bind(this)});_classPrivateFieldInitSpec(this,S,{writable:!0,value:this.cut.bind(this)});_classPrivateFieldInitSpec(this,x,{writable:!0,value:this.paste.bind(this)});_classPrivateFieldInitSpec(this,w,{writable:!0,value:this.keydown.bind(this)});_classPrivateFieldInitSpec(this,E,{writable:!0,value:this.onEditingAction.bind(this)});_classPrivateFieldInitSpec(this,C,{writable:!0,value:this.onPageChanging.bind(this)});_classPrivateFieldInitSpec(this,k,{writable:!0,value:{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1}});_classPrivateFieldInitSpec(this,T,{writable:!0,value:null});_classPrivateFieldSet(this,T,t);_classPrivateFieldSet(this,v,e);_classPrivateFieldGet(this,v)._on("editingaction",_classPrivateFieldGet(this,E));_classPrivateFieldGet(this,v)._on("pagechanging",_classPrivateFieldGet(this,C))}destroy(){_classPrivateMethodGet(this,R,_removeKeyboardManager2).call(this);_classPrivateFieldGet(this,v)._off("editingaction",_classPrivateFieldGet(this,E));_classPrivateFieldGet(this,v)._off("pagechanging",_classPrivateFieldGet(this,C));for(const t of _classPrivateFieldGet(this,p).values())t.destroy();_classPrivateFieldGet(this,p).clear();_classPrivateFieldGet(this,u).clear();_classPrivateFieldSet(this,h,null);_classPrivateFieldGet(this,A).clear();_classPrivateFieldGet(this,f).destroy()}onPageChanging(t){let{pageNumber:e}=t;_classPrivateFieldSet(this,g,e-1)}focusMainContainer(){_classPrivateFieldGet(this,T).focus()}copy(t){t.preventDefault();_classPrivateFieldGet(this,h)&&_classPrivateFieldGet(this,h).commitOrRemove();if(!this.hasSelection)return;const e=[];for(const t of _classPrivateFieldGet(this,A))t.isEmpty()||e.push(t.serialize());0!==e.length&&t.clipboardData.setData("application/pdfjs",JSON.stringify(e))}cut(t){this.copy(t);this.delete()}paste(t){t.preventDefault();let e=t.clipboardData.getData("application/pdfjs");if(!e)return;try{e=JSON.parse(e)}catch(t){(0,r.warn)(`paste: "${t.message}".`);return}if(!Array.isArray(e))return;this.unselectAll();const i=_classPrivateFieldGet(this,p).get(_classPrivateFieldGet(this,g));try{const t=[];for(const r of e){const e=i.deserialize(r);if(!e)return;t.push(e)}const cmd=()=>{for(const e of t)_classPrivateMethodGet(this,j,_addEditorToLayer2).call(this,e);_classPrivateMethodGet(this,B,_selectEditors2).call(this,t)},undo=()=>{for(const e of t)e.remove()};this.addCommands({cmd:cmd,undo:undo,mustExec:!0})}catch(t){(0,r.warn)(`paste: "${t.message}".`)}}keydown(t){var e;null!==(e=this.getActive())&&void 0!==e&&e.shouldGetKeyboardEvents()||AnnotationEditorUIManager._keyboardManager.exec(this,t)}onEditingAction(t){["undo","redo","delete","selectAll"].includes(t.name)&&this[t.name]()}setEditingState(t){if(t){_classPrivateMethodGet(this,M,_addKeyboardManager2).call(this);_classPrivateMethodGet(this,I,_addCopyPasteListeners2).call(this);_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{isEditing:_classPrivateFieldGet(this,y)!==r.AnnotationEditorType.NONE,isEmpty:_classPrivateMethodGet(this,U,_isEmpty2).call(this),hasSomethingToUndo:_classPrivateFieldGet(this,f).hasSomethingToUndo(),hasSomethingToRedo:_classPrivateFieldGet(this,f).hasSomethingToRedo(),hasSelectedEditor:!1})}else{_classPrivateMethodGet(this,R,_removeKeyboardManager2).call(this);_classPrivateMethodGet(this,D,_removeCopyPasteListeners2).call(this);_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{isEditing:!1})}}registerEditorTypes(t){_classPrivateFieldSet(this,m,t);for(const t of _classPrivateFieldGet(this,m))_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,t.defaultPropertiesToUpdate)}getId(){return _classPrivateFieldGet(this,_).getId()}addLayer(t){_classPrivateFieldGet(this,p).set(t.pageIndex,t);_classPrivateFieldGet(this,b)?t.enable():t.disable()}removeLayer(t){_classPrivateFieldGet(this,p).delete(t.pageIndex)}updateMode(t){_classPrivateFieldSet(this,y,t);if(t===r.AnnotationEditorType.NONE){this.setEditingState(!1);_classPrivateMethodGet(this,N,_disableAll2).call(this)}else{this.setEditingState(!0);_classPrivateMethodGet(this,G,_enableAll2).call(this);for(const e of _classPrivateFieldGet(this,p).values())e.updateMode(t)}}updateToolbar(t){t!==_classPrivateFieldGet(this,y)&&_classPrivateFieldGet(this,v).dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,e){if(_classPrivateFieldGet(this,m)){for(const i of _classPrivateFieldGet(this,A))i.updateParams(t,e);for(const i of _classPrivateFieldGet(this,m))i.updateDefaultParams(t,e)}}getEditors(t){const e=[];for(const i of _classPrivateFieldGet(this,u).values())i.pageIndex===t&&e.push(i);return e}getEditor(t){return _classPrivateFieldGet(this,u).get(t)}addEditor(t){_classPrivateFieldGet(this,u).set(t.id,t)}removeEditor(t){_classPrivateFieldGet(this,u).delete(t.id);this.unselect(t)}setActiveEditor(t){if(_classPrivateFieldGet(this,h)!==t){_classPrivateFieldSet(this,h,t);t&&_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,t.propertiesToUpdate)}}toggleSelected(t){if(_classPrivateFieldGet(this,A).has(t)){_classPrivateFieldGet(this,A).delete(t);t.unselect();_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}else{_classPrivateFieldGet(this,A).add(t);t.select();_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}}setSelected(t){for(const e of _classPrivateFieldGet(this,A))e!==t&&e.unselect();_classPrivateFieldGet(this,A).clear();_classPrivateFieldGet(this,A).add(t);t.select();_classPrivateMethodGet(this,L,_dispatchUpdateUI2).call(this,t.propertiesToUpdate);_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}isSelected(t){return _classPrivateFieldGet(this,A).has(t)}unselect(t){t.unselect();_classPrivateFieldGet(this,A).delete(t);_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return 0!==_classPrivateFieldGet(this,A).size}undo(){_classPrivateFieldGet(this,f).undo();_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:_classPrivateFieldGet(this,f).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_classPrivateMethodGet(this,U,_isEmpty2).call(this)})}redo(){_classPrivateFieldGet(this,f).redo();_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:_classPrivateFieldGet(this,f).hasSomethingToRedo(),isEmpty:_classPrivateMethodGet(this,U,_isEmpty2).call(this)})}addCommands(t){_classPrivateFieldGet(this,f).add(t);_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_classPrivateMethodGet(this,U,_isEmpty2).call(this)})}delete(){_classPrivateFieldGet(this,h)&&_classPrivateFieldGet(this,h).commitOrRemove();if(!this.hasSelection)return;const t=[..._classPrivateFieldGet(this,A)];this.addCommands({cmd:()=>{for(const e of t)e.remove()},undo:()=>{for(const e of t)_classPrivateMethodGet(this,j,_addEditorToLayer2).call(this,e)},mustExec:!0})}selectAll(){for(const t of _classPrivateFieldGet(this,A))t.commit();_classPrivateMethodGet(this,B,_selectEditors2).call(this,_classPrivateFieldGet(this,u).values())}unselectAll(){if(_classPrivateFieldGet(this,h))_classPrivateFieldGet(this,h).commitOrRemove();else if(0!==_classPrivateFieldGet(this,A).size){for(const t of _classPrivateFieldGet(this,A))t.unselect();_classPrivateFieldGet(this,A).clear();_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!1})}}isActive(t){return _classPrivateFieldGet(this,h)===t}getActive(){return _classPrivateFieldGet(this,h)}getMode(){return _classPrivateFieldGet(this,y)}}e.AnnotationEditorUIManager=AnnotationEditorUIManager;function _addKeyboardManager2(){_classPrivateFieldGet(this,T).addEventListener("keydown",_classPrivateFieldGet(this,w))}function _removeKeyboardManager2(){_classPrivateFieldGet(this,T).removeEventListener("keydown",_classPrivateFieldGet(this,w))}function _addCopyPasteListeners2(){document.addEventListener("copy",_classPrivateFieldGet(this,P));document.addEventListener("cut",_classPrivateFieldGet(this,S));document.addEventListener("paste",_classPrivateFieldGet(this,x))}function _removeCopyPasteListeners2(){document.removeEventListener("copy",_classPrivateFieldGet(this,P));document.removeEventListener("cut",_classPrivateFieldGet(this,S));document.removeEventListener("paste",_classPrivateFieldGet(this,x))}function _dispatchUpdateStates2(t){Object.entries(t).some((t=>{let[e,i]=t;return _classPrivateFieldGet(this,k)[e]!==i}))&&_classPrivateFieldGet(this,v).dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(_classPrivateFieldGet(this,k),t)})}function _dispatchUpdateUI2(t){_classPrivateFieldGet(this,v).dispatch("annotationeditorparamschanged",{source:this,details:t})}function _enableAll2(){if(!_classPrivateFieldGet(this,b)){_classPrivateFieldSet(this,b,!0);for(const t of _classPrivateFieldGet(this,p).values())t.enable()}}function _disableAll2(){this.unselectAll();if(_classPrivateFieldGet(this,b)){_classPrivateFieldSet(this,b,!1);for(const t of _classPrivateFieldGet(this,p).values())t.disable()}}function _addEditorToLayer2(t){const e=_classPrivateFieldGet(this,p).get(t.pageIndex);e?e.addOrRebuild(t):this.addEditor(t)}function _isEmpty2(){if(0===_classPrivateFieldGet(this,u).size)return!0;if(1===_classPrivateFieldGet(this,u).size)for(const t of _classPrivateFieldGet(this,u).values())return t.isEmpty();return!1}function _selectEditors2(t){_classPrivateFieldGet(this,A).clear();for(const e of t)if(!e.isEmpty()){_classPrivateFieldGet(this,A).add(e);e.select()}_classPrivateMethodGet(this,O,_dispatchUpdateStates2).call(this,{hasSelectedEditor:!0})}_defineProperty(AnnotationEditorUIManager,"_keyboardManager",new KeyboardManager([[["ctrl+a","mac+meta+a"],AnnotationEditorUIManager.prototype.selectAll],[["ctrl+z","mac+meta+z"],AnnotationEditorUIManager.prototype.undo],[["ctrl+y","ctrl+shift+Z","mac+meta+shift+Z"],AnnotationEditorUIManager.prototype.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete"],AnnotationEditorUIManager.prototype.delete],[["Escape","mac+Escape"],AnnotationEditorUIManager.prototype.unselectAll]]))},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.StatTimer=e.RenderingCancelledException=e.PixelsPerInch=e.PageViewport=e.PDFDateString=e.DOMStandardFontDataFactory=e.DOMSVGFactory=e.DOMCanvasFactory=e.DOMCMapReaderFactory=e.AnnotationPrefix=void 0;e.deprecated=function deprecated(t){console.log("Deprecated API usage: "+t)};e.getColorValues=function getColorValues(t){const e=document.createElement("span");e.style.visibility="hidden";document.body.append(e);for(const i of t.keys()){e.style.color=i;const r=window.getComputedStyle(e).color;t.set(i,getRGB(r))}e.remove()};e.getCurrentTransform=function getCurrentTransform(t){const{a:e,b:i,c:r,d:s,e:a,f:n}=t.getTransform();return[e,i,r,s,a,n]};e.getCurrentTransformInverse=function getCurrentTransformInverse(t){const{a:e,b:i,c:r,d:s,e:a,f:n}=t.getTransform().invertSelf();return[e,i,r,s,a,n]};e.getFilenameFromUrl=function getFilenameFromUrl(t){const e=t.indexOf("#"),i=t.indexOf("?"),r=Math.min(e>0?e:t.length,i>0?i:t.length);return t.substring(t.lastIndexOf("/",r)+1,r)};e.getPdfFilenameFromUrl=function getPdfFilenameFromUrl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"document.pdf";if("string"!=typeof t)return e;if(isDataScheme(t)){(0,s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return e}const i=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/,r=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i,a=i.exec(t);let n=r.exec(a[1])||r.exec(a[2])||r.exec(a[3]);if(n){n=n[0];if(n.includes("%"))try{n=r.exec(decodeURIComponent(n))[0]}catch(t){}}return n||e};e.getRGB=getRGB;e.getXfaPageViewport=function getXfaPageViewport(t,e){let{scale:i=1,rotation:r=0}=e;const{width:s,height:a}=t.attributes.style,n=[0,0,parseInt(s),parseInt(a)];return new PageViewport({viewBox:n,scale:i,rotation:r})};e.isDataScheme=isDataScheme;e.isPdfFile=function isPdfFile(t){return"string"==typeof t&&/\.pdf$/i.test(t)};e.isValidFetchUrl=isValidFetchUrl;e.loadScript=function loadScript(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(((i,r)=>{const s=document.createElement("script");s.src=t;s.onload=function(t){e&&s.remove();i(t)};s.onerror=function(){r(new Error(`Cannot load script at: ${s.src}`))};(document.head||document.documentElement).append(s)}))};var r=i(137),s=i(1);function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}e.AnnotationPrefix="pdfjs_internal_id_";class PixelsPerInch{}e.PixelsPerInch=PixelsPerInch;_defineProperty(PixelsPerInch,"CSS",96);_defineProperty(PixelsPerInch,"PDF",72);_defineProperty(PixelsPerInch,"PDF_TO_CSS_UNITS",PixelsPerInch.CSS/PixelsPerInch.PDF);class DOMCanvasFactory extends r.BaseCanvasFactory{constructor(){let{ownerDocument:t=globalThis.document}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();this._document=t}_createCanvas(t,e){const i=this._document.createElement("canvas");i.width=t;i.height=e;return i}}e.DOMCanvasFactory=DOMCanvasFactory;async function fetchData(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(isValidFetchUrl(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);return e?new Uint8Array(await i.arrayBuffer()):(0,s.stringToBytes)(await i.text())}return new Promise(((i,r)=>{const a=new XMLHttpRequest;a.open("GET",t,!0);e&&(a.responseType="arraybuffer");a.onreadystatechange=()=>{if(a.readyState===XMLHttpRequest.DONE){if(200===a.status||0===a.status){let t;e&&a.response?t=new Uint8Array(a.response):!e&&a.responseText&&(t=(0,s.stringToBytes)(a.responseText));if(t){i(t);return}}r(new Error(a.statusText))}};a.send(null)}))}class DOMCMapReaderFactory extends r.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t,this.isCompressed).then((t=>({cMapData:t,compressionType:e})))}}e.DOMCMapReaderFactory=DOMCMapReaderFactory;class DOMStandardFontDataFactory extends r.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t,!0)}}e.DOMStandardFontDataFactory=DOMStandardFontDataFactory;class DOMSVGFactory extends r.BaseSVGFactory{_createSVG(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}e.DOMSVGFactory=DOMSVGFactory;class PageViewport{constructor(t){let{viewBox:e,scale:i,rotation:r,offsetX:s=0,offsetY:a=0,dontFlip:n=!1}=t;this.viewBox=e;this.scale=i;this.rotation=r;this.offsetX=s;this.offsetY=a;const o=(e[2]+e[0])/2,l=(e[3]+e[1])/2;let c,d,h,u,p,f,g,m;r%=360;r<0&&(r+=360);switch(r){case 180:c=-1;d=0;h=0;u=1;break;case 90:c=0;d=1;h=1;u=0;break;case 270:c=0;d=-1;h=-1;u=0;break;case 0:c=1;d=0;h=0;u=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(n){h=-h;u=-u}if(0===c){p=Math.abs(l-e[1])*i+s;f=Math.abs(o-e[0])*i+a;g=Math.abs(e[3]-e[1])*i;m=Math.abs(e[2]-e[0])*i}else{p=Math.abs(o-e[0])*i+s;f=Math.abs(l-e[1])*i+a;g=Math.abs(e[2]-e[0])*i;m=Math.abs(e[3]-e[1])*i}this.transform=[c*i,d*i,h*i,u*i,p-c*i*o-h*i*l,f-d*i*o-u*i*l];this.width=g;this.height=m}clone(){let{scale:t=this.scale,rotation:e=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new PageViewport({viewBox:this.viewBox.slice(),scale:t,rotation:e,offsetX:i,offsetY:r,dontFlip:s})}convertToViewportPoint(t,e){return s.Util.applyTransform([t,e],this.transform)}convertToViewportRectangle(t){const e=s.Util.applyTransform([t[0],t[1]],this.transform),i=s.Util.applyTransform([t[2],t[3]],this.transform);return[e[0],e[1],i[0],i[1]]}convertToPdfPoint(t,e){return s.Util.applyInverseTransform([t,e],this.transform)}}e.PageViewport=PageViewport;class RenderingCancelledException extends s.BaseException{constructor(t,e){super(t,"RenderingCancelledException");this.type=e}}e.RenderingCancelledException=RenderingCancelledException;function isDataScheme(t){const e=t.length;let i=0;for(;i<e&&""===t[i].trim();)i++;return"data:"===t.substring(i,i+5).toLowerCase()}e.StatTimer=class StatTimer{constructor(){this.started=Object.create(null);this.times=[]}time(t){t in this.started&&(0,s.warn)(`Timer is already running for ${t}`);this.started[t]=Date.now()}timeEnd(t){t in this.started||(0,s.warn)(`Timer has not been started for ${t}`);this.times.push({name:t,start:this.started[t],end:Date.now()});delete this.started[t]}toString(){const t=[];let e=0;for(const t of this.times){const i=t.name;i.length>e&&(e=i.length)}for(const i of this.times){const r=i.end-i.start;t.push(`${i.name.padEnd(e)} ${r}ms\n`)}return t.join("")}};function isValidFetchUrl(t,e){try{const{protocol:i}=e?new URL(t,e):new URL(t);return"http:"===i||"https:"===i}catch(t){return!1}}let a;e.PDFDateString=class PDFDateString{static toDateObject(t){if(!t||"string"!=typeof t)return null;a||(a=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const e=a.exec(t);if(!e)return null;const i=parseInt(e[1],10);let r=parseInt(e[2],10);r=r>=1&&r<=12?r-1:0;let s=parseInt(e[3],10);s=s>=1&&s<=31?s:1;let n=parseInt(e[4],10);n=n>=0&&n<=23?n:0;let o=parseInt(e[5],10);o=o>=0&&o<=59?o:0;let l=parseInt(e[6],10);l=l>=0&&l<=59?l:0;const c=e[7]||"Z";let d=parseInt(e[8],10);d=d>=0&&d<=23?d:0;let h=parseInt(e[9],10)||0;h=h>=0&&h<=59?h:0;if("-"===c){n+=d;o+=h}else if("+"===c){n-=d;o-=h}return new Date(Date.UTC(i,r,s,n,o,l))}};function getRGB(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(16711680&e)>>16,(65280&e)>>8,255&e]}if(t.startsWith("rgb("))return t.slice(4,-1).split(",").map((t=>parseInt(t)));if(t.startsWith("rgba("))return t.slice(5,-1).split(",").map((t=>parseInt(t))).slice(0,3);(0,s.warn)(`Not a valid color format: "${t}"`);return[0,0,0]}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BaseStandardFontDataFactory=e.BaseSVGFactory=e.BaseCanvasFactory=e.BaseCMapReaderFactory=void 0;var r=i(1);class BaseCanvasFactory{constructor(){this.constructor===BaseCanvasFactory&&(0,r.unreachable)("Cannot initialize BaseCanvasFactory.")}create(t,e){if(t<=0||e<=0)throw new Error("Invalid canvas size");const i=this._createCanvas(t,e);return{canvas:i,context:i.getContext("2d")}}reset(t,e,i){if(!t.canvas)throw new Error("Canvas is not specified");if(e<=0||i<=0)throw new Error("Invalid canvas size");t.canvas.width=e;t.canvas.height=i}destroy(t){if(!t.canvas)throw new Error("Canvas is not specified");t.canvas.width=0;t.canvas.height=0;t.canvas=null;t.context=null}_createCanvas(t,e){(0,r.unreachable)("Abstract method `_createCanvas` called.")}}e.BaseCanvasFactory=BaseCanvasFactory;class BaseCMapReaderFactory{constructor(t){let{baseUrl:e=null,isCompressed:i=!1}=t;this.constructor===BaseCMapReaderFactory&&(0,r.unreachable)("Cannot initialize BaseCMapReaderFactory.");this.baseUrl=e;this.isCompressed=i}async fetch(t){let{name:e}=t;if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":""),s=this.isCompressed?r.CMapCompressionType.BINARY:r.CMapCompressionType.NONE;return this._fetchData(i,s).catch((t=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)}))}_fetchData(t,e){(0,r.unreachable)("Abstract method `_fetchData` called.")}}e.BaseCMapReaderFactory=BaseCMapReaderFactory;class BaseStandardFontDataFactory{constructor(t){let{baseUrl:e=null}=t;this.constructor===BaseStandardFontDataFactory&&(0,r.unreachable)("Cannot initialize BaseStandardFontDataFactory.");this.baseUrl=e}async fetch(t){let{filename:e}=t;if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetchData(i).catch((t=>{throw new Error(`Unable to load font data at: ${i}`)}))}_fetchData(t){(0,r.unreachable)("Abstract method `_fetchData` called.")}}e.BaseStandardFontDataFactory=BaseStandardFontDataFactory;class BaseSVGFactory{constructor(){this.constructor===BaseSVGFactory&&(0,r.unreachable)("Cannot initialize BaseSVGFactory.")}create(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t<=0||e<=0)throw new Error("Invalid SVG dimensions");const r=this._createSVG("svg:svg");r.setAttribute("version","1.1");if(!i){r.setAttribute("width",`${t}px`);r.setAttribute("height",`${e}px`)}r.setAttribute("preserveAspectRatio","none");r.setAttribute("viewBox",`0 0 ${t} ${e}`);return r}createElement(t){if("string"!=typeof t)throw new Error("Invalid SVG element type");return this._createSVG(t)}_createSVG(t){(0,r.unreachable)("Abstract method `_createSVG` called.")}}e.BaseSVGFactory=BaseSVGFactory},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MurmurHash3_64=void 0;var r=i(1);const s=3285377520,a=4294901760,n=65535;e.MurmurHash3_64=class MurmurHash3_64{constructor(t){this.h1=t?4294967295&t:s;this.h2=t?4294967295&t:s}update(t){let e,i;if("string"==typeof t){e=new Uint8Array(2*t.length);i=0;for(let r=0,s=t.length;r<s;r++){const s=t.charCodeAt(r);if(s<=255)e[i++]=s;else{e[i++]=s>>>8;e[i++]=255&s}}}else{if(!(0,r.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");e=t.slice();i=e.byteLength}const s=i>>2,o=i-4*s,l=new Uint32Array(e.buffer,0,s);let c=0,d=0,h=this.h1,u=this.h2;const p=3432918353,f=461845907,g=11601,m=13715;for(let t=0;t<s;t++)if(1&t){c=l[t];c=c*p&a|c*g&n;c=c<<15|c>>>17;c=c*f&a|c*m&n;h^=c;h=h<<13|h>>>19;h=5*h+3864292196}else{d=l[t];d=d*p&a|d*g&n;d=d<<15|d>>>17;d=d*f&a|d*m&n;u^=d;u=u<<13|u>>>19;u=5*u+3864292196}c=0;switch(o){case 3:c^=e[4*s+2]<<16;case 2:c^=e[4*s+1]<<8;case 1:c^=e[4*s];c=c*p&a|c*g&n;c=c<<15|c>>>17;c=c*f&a|c*m&n;1&s?h^=c:u^=c}this.h1=h;this.h2=u}hexdigest(){let t=this.h1,e=this.h2;t^=e>>>1;t=3981806797*t&a|36045*t&n;e=4283543511*e&a|(2950163797*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;t=444984403*t&a|60499*t&n;e=3301882366*e&a|(3120437893*(e<<16|t>>>16)&a)>>>16;t^=e>>>1;const i=(t>>>0).toString(16),r=(e>>>0).toString(16);return i.padStart(8,"0")+r.padStart(8,"0")}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FontLoader=e.FontFaceObject=void 0;var r=i(1);e.FontLoader=class FontLoader{constructor(t){let{docId:e,onUnsupportedFeature:i,ownerDocument:r=globalThis.document,styleElement:s=null}=t;this.docId=e;this._onUnsupportedFeature=i;this._document=r;this.nativeFontFaces=[];this.styleElement=null;this.loadingRequests=[];this.loadTestFontId=0}addNativeFontFace(t){this.nativeFontFaces.push(t);this._document.fonts.add(t)}insertRule(t){let e=this.styleElement;if(!e){e=this.styleElement=this._document.createElement("style");e.id=`PDFJS_FONT_STYLE_TAG_${this.docId}`;this._document.documentElement.getElementsByTagName("head")[0].append(e)}const i=e.sheet;i.insertRule(t,i.cssRules.length)}clear(){for(const t of this.nativeFontFaces)this._document.fonts.delete(t);this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}}async bind(t){if(t.attached||t.missingFile)return;t.attached=!0;if(this.isFontLoadingAPISupported){const e=t.createNativeFontFace();if(e){this.addNativeFontFace(e);try{await e.loaded}catch(i){this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,r.warn)(`Failed to load font '${e.family}': '${i}'.`);t.disableFontFace=!0;throw i}}return}const e=t.createFontFaceRule();if(e){this.insertRule(e);if(this.isSyncFontLoadingSupported)return;await new Promise((i=>{const r=this._queueLoadingCallback(i);this._prepareFontLoadEvent([e],[t],r)}))}}get isFontLoadingAPISupported(){var t;const e=!(null===(t=this._document)||void 0===t||!t.fonts);return(0,r.shadow)(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let t=!1;if("undefined"==typeof navigator)t=!0;else{const e=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);(null==e?void 0:e[1])>=14&&(t=!0)}return(0,r.shadow)(this,"isSyncFontLoadingSupported",t)}_queueLoadingCallback(t){const{loadingRequests:e}=this,i={done:!1,complete:function completeRequest(){(0,r.assert)(!i.done,"completeRequest() cannot be called twice.");i.done=!0;for(;e.length>0&&e[0].done;){const t=e.shift();setTimeout(t.callback,0)}},callback:t};e.push(i);return i}get _loadTestFont(){const t=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return(0,r.shadow)(this,"_loadTestFont",t)}_prepareFontLoadEvent(t,e,i){function int32(t,e){return t.charCodeAt(e)<<24|t.charCodeAt(e+1)<<16|t.charCodeAt(e+2)<<8|255&t.charCodeAt(e+3)}function spliceString(t,e,i,r){return t.substring(0,e)+r+t.substring(e+i)}let s,a;const n=this._document.createElement("canvas");n.width=1;n.height=1;const o=n.getContext("2d");let l=0;const c=`lt${Date.now()}${this.loadTestFontId++}`;let d=this._loadTestFont;d=spliceString(d,976,c.length,c);const h=1482184792;let u=int32(d,16);for(s=0,a=c.length-3;s<a;s+=4)u=u-h+int32(c,s)|0;s<c.length&&(u=u-h+int32(c+"XXX",s)|0);d=spliceString(d,16,4,(0,r.string32)(u));const p=`@font-face {font-family:"${c}";src:${`url(data:font/opentype;base64,${btoa(d)});`}}`;this.insertRule(p);const f=[];for(const t of e)f.push(t.loadedName);f.push(c);const g=this._document.createElement("div");g.style.visibility="hidden";g.style.width=g.style.height="10px";g.style.position="absolute";g.style.top=g.style.left="0px";for(const t of f){const e=this._document.createElement("span");e.textContent="Hi";e.style.fontFamily=t;g.append(e)}this._document.body.append(g);!function isFontReady(t,e){l++;if(l>30){(0,r.warn)("Load test font never loaded.");e();return}o.font="30px "+t;o.fillText(".",0,20);o.getImageData(0,0,1,1).data[3]>0?e():setTimeout(isFontReady.bind(null,t,e))}(c,(()=>{g.remove();i.complete()}))}};e.FontFaceObject=class FontFaceObject{constructor(t,e){let{isEvalSupported:i=!0,disableFontFace:r=!1,ignoreErrors:s=!1,onUnsupportedFeature:a,fontRegistry:n=null}=e;this.compiledGlyphs=Object.create(null);for(const e in t)this[e]=t[e];this.isEvalSupported=!1!==i;this.disableFontFace=!0===r;this.ignoreErrors=!0===s;this._onUnsupportedFeature=a;this.fontRegistry=n}createNativeFontFace(){var t;if(!this.data||this.disableFontFace)return null;let e;if(this.cssFontInfo){const t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`);e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}else e=new FontFace(this.loadedName,this.data,{});null===(t=this.fontRegistry)||void 0===t||t.registerFont(this);return e}createFontFaceRule(){var t;if(!this.data||this.disableFontFace)return null;const e=(0,r.bytesToString)(this.data),i=`url(data:${this.mimetype};base64,${btoa(e)});`;let s;if(this.cssFontInfo){let t=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(t+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`);s=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${t}src:${i}}`}else s=`@font-face {font-family:"${this.loadedName}";src:${i}}`;null===(t=this.fontRegistry)||void 0===t||t.registerFont(this,i);return s}getPathGenerator(t,e){if(void 0!==this.compiledGlyphs[e])return this.compiledGlyphs[e];let i;try{i=t.get(this.loadedName+"_path_"+e)}catch(t){if(!this.ignoreErrors)throw t;this._onUnsupportedFeature({featureId:r.UNSUPPORTED_FEATURES.errorFontGetPath});(0,r.warn)(`getPathGenerator - ignoring character: "${t}".`);return this.compiledGlyphs[e]=function(t,e){}}if(this.isEvalSupported&&r.FeatureTest.isEvalSupported){const t=[];for(const e of i){const i=void 0!==e.args?e.args.join(","):"";t.push("c.",e.cmd,"(",i,");\n")}return this.compiledGlyphs[e]=new Function("c","size",t.join(""))}return this.compiledGlyphs[e]=function(t,e){for(const r of i){"scale"===r.cmd&&(r.args=[e,-e]);t[r.cmd].apply(t,r.args)}}}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CanvasGraphics=void 0;var r=i(1),s=i(136),a=i(141),n=i(142),o=i(3);function _classPrivateMethodInitSpec(t,e){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.add(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}const l=4096,c=o.isNodeJS&&"undefined"==typeof Path2D?-1:1e3,d=16;class CachedCanvases{constructor(t){this.canvasFactory=t;this.cache=Object.create(null)}getCanvas(t,e,i){let r;if(void 0!==this.cache[t]){r=this.cache[t];this.canvasFactory.reset(r,e,i)}else{r=this.canvasFactory.create(e,i);this.cache[t]=r}return r}delete(t){delete this.cache[t]}clear(){for(const t in this.cache){const e=this.cache[t];this.canvasFactory.destroy(e);delete this.cache[t]}}}function drawImageAtIntegerCoords(t,e,i,r,a,n,o,l,c,d){const[h,u,p,f,g,m]=(0,s.getCurrentTransform)(t);if(0===u&&0===p){const s=o*h+g,v=Math.round(s),_=l*f+m,b=Math.round(_),y=(o+c)*h+g,A=Math.abs(Math.round(y)-v)||1,P=(l+d)*f+m,S=Math.abs(Math.round(P)-b)||1;t.setTransform(Math.sign(h),0,0,Math.sign(f),v,b);t.drawImage(e,i,r,a,n,0,0,A,S);t.setTransform(h,u,p,f,g,m);return[A,S]}if(0===h&&0===f){const s=l*p+g,v=Math.round(s),_=o*u+m,b=Math.round(_),y=(l+d)*p+g,A=Math.abs(Math.round(y)-v)||1,P=(o+c)*u+m,S=Math.abs(Math.round(P)-b)||1;t.setTransform(0,Math.sign(u),Math.sign(p),0,v,b);t.drawImage(e,i,r,a,n,0,0,S,A);t.setTransform(h,u,p,f,g,m);return[S,A]}t.drawImage(e,i,r,a,n,o,l,c,d);return[Math.hypot(h,u)*c,Math.hypot(p,f)*d]}class CanvasExtraState{constructor(t,e){this.alphaIsShape=!1;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=r.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=r.FONT_IDENTITY_MATRIX;this.leading=0;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRenderingMode=r.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=!1;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,t,e])}clone(){const t=Object.create(this);t.clipBox=this.clipBox.slice();return t}setCurrentPoint(t,e){this.x=t;this.y=e}updatePathMinMax(t,e,i){[e,i]=r.Util.applyTransform([e,i],t);this.minX=Math.min(this.minX,e);this.minY=Math.min(this.minY,i);this.maxX=Math.max(this.maxX,e);this.maxY=Math.max(this.maxY,i)}updateRectMinMax(t,e){const i=r.Util.applyTransform(e,t),s=r.Util.applyTransform(e.slice(2),t);this.minX=Math.min(this.minX,i[0],s[0]);this.minY=Math.min(this.minY,i[1],s[1]);this.maxX=Math.max(this.maxX,i[0],s[0]);this.maxY=Math.max(this.maxY,i[1],s[1])}updateScalingPathMinMax(t,e){r.Util.scaleMinMax(t,e);this.minX=Math.min(this.minX,e[0]);this.maxX=Math.max(this.maxX,e[1]);this.minY=Math.min(this.minY,e[2]);this.maxY=Math.max(this.maxY,e[3])}updateCurvePathMinMax(t,e,i,s,a,n,o,l,c,d){const h=r.Util.bezierBoundingBox(e,i,s,a,n,o,l,c);if(d){d[0]=Math.min(d[0],h[0],h[2]);d[1]=Math.max(d[1],h[0],h[2]);d[2]=Math.min(d[2],h[1],h[3]);d[3]=Math.max(d[3],h[1],h[3])}else this.updateRectMinMax(t,h)}getPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const i=[this.minX,this.minY,this.maxX,this.maxY];if(t===a.PathType.STROKE){e||(0,r.unreachable)("Stroke bounding box must include transform.");const t=r.Util.singularValueDecompose2dScale(e),s=t[0]*this.lineWidth/2,a=t[1]*this.lineWidth/2;i[0]-=s;i[1]-=a;i[2]+=s;i[3]+=a}return i}updateClipFromPath(){const t=r.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(t||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(t){this.clipBox=t;this.minX=1/0;this.minY=1/0;this.maxX=0;this.maxY=0}getClippedPathBoundingBox(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.PathType.FILL,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.Util.intersect(this.clipBox,this.getPathBoundingBox(t,e))}}function putBinaryImageData(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("undefined"!=typeof ImageData&&e instanceof ImageData){t.putImageData(e,0,0);return}const s=e.height,a=e.width,n=s%d,o=(s-n)/d,l=0===n?o:o+1,c=t.createImageData(a,d);let h,u=0;const p=e.data,f=c.data;let g,m,v,_,b,y,A,P;if(i)switch(i.length){case 1:b=i[0];y=i[0];A=i[0];P=i[0];break;case 4:b=i[0];y=i[1];A=i[2];P=i[3]}if(e.kind===r.ImageKind.GRAYSCALE_1BPP){const e=p.byteLength,i=new Uint32Array(f.buffer,0,f.byteLength>>2),s=i.length,_=a+7>>3;let b=4294967295,y=r.FeatureTest.isLittleEndian?4278190080:255;P&&255===P[0]&&0===P[255]&&([b,y]=[y,b]);for(g=0;g<l;g++){v=g<o?d:n;h=0;for(m=0;m<v;m++){const t=e-u;let r=0;const s=t>_?a:8*t-7,n=-8&s;let o=0,l=0;for(;r<n;r+=8){l=p[u++];i[h++]=128&l?b:y;i[h++]=64&l?b:y;i[h++]=32&l?b:y;i[h++]=16&l?b:y;i[h++]=8&l?b:y;i[h++]=4&l?b:y;i[h++]=2&l?b:y;i[h++]=1&l?b:y}for(;r<s;r++){if(0===o){l=p[u++];o=128}i[h++]=l&o?b:y;o>>=1}}for(;h<s;)i[h++]=0;t.putImageData(c,0,g*d)}}else if(e.kind===r.ImageKind.RGBA_32BPP){const e=!!(b||y||A);m=0;_=a*d*4;for(g=0;g<o;g++){f.set(p.subarray(u,u+_));u+=_;if(e)for(let t=0;t<_;t+=4){b&&(f[t+0]=b[f[t+0]]);y&&(f[t+1]=y[f[t+1]]);A&&(f[t+2]=A[f[t+2]])}t.putImageData(c,0,m);m+=d}if(g<l){_=a*n*4;f.set(p.subarray(u,u+_));if(e)for(let t=0;t<_;t+=4){b&&(f[t+0]=b[f[t+0]]);y&&(f[t+1]=y[f[t+1]]);A&&(f[t+2]=A[f[t+2]])}t.putImageData(c,0,m)}}else{if(e.kind!==r.ImageKind.RGB_24BPP)throw new Error(`bad image kind: ${e.kind}`);{const e=!!(b||y||A);v=d;_=a*v;for(g=0;g<l;g++){if(g>=o){v=n;_=a*v}h=0;for(m=_;m--;){f[h++]=p[u++];f[h++]=p[u++];f[h++]=p[u++];f[h++]=255}if(e)for(let t=0;t<h;t+=4){b&&(f[t+0]=b[f[t+0]]);y&&(f[t+1]=y[f[t+1]]);A&&(f[t+2]=A[f[t+2]])}t.putImageData(c,0,g*d)}}}}function putBinaryImageMask(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,r=e.width,s=i%d,a=(i-s)/d,o=0===s?a:a+1,l=t.createImageData(r,d);let c=0;const h=e.data,u=l.data;for(let e=0;e<o;e++){const i=e<a?d:s;({srcPos:c}=(0,n.applyMaskImageData)({src:h,srcPos:c,dest:u,width:r,height:i}));t.putImageData(l,0,e*d)}}function copyCtxState(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(let r=0,s=i.length;r<s;r++){const s=i[r];void 0!==t[s]&&(e[s]=t[s])}if(void 0!==t.setLineDash){e.setLineDash(t.getLineDash());e.lineDashOffset=t.lineDashOffset}}function resetCtxToDefault(t,e){t.strokeStyle=t.fillStyle=e||"#000000";t.fillRule="nonzero";t.globalAlpha=1;t.lineWidth=1;t.lineCap="butt";t.lineJoin="miter";t.miterLimit=10;t.globalCompositeOperation="source-over";t.font="10px sans-serif";if(void 0!==t.setLineDash){t.setLineDash([]);t.lineDashOffset=0}}function composeSMaskBackdrop(t,e,i,r){const s=t.length;for(let a=3;a<s;a+=4){const s=t[a];if(0===s){t[a-3]=e;t[a-2]=i;t[a-1]=r}else if(s<255){const n=255-s;t[a-3]=t[a-3]*s+e*n>>8;t[a-2]=t[a-2]*s+i*n>>8;t[a-1]=t[a-1]*s+r*n>>8}}}function composeSMaskAlpha(t,e,i){const r=t.length;for(let s=3;s<r;s+=4){const r=i?i[t[s]]:t[s];e[s]=e[s]*r*.00392156862745098|0}}function composeSMaskLuminosity(t,e,i){const r=t.length;for(let s=3;s<r;s+=4){const r=77*t[s-3]+152*t[s-2]+28*t[s-1];e[s]=i?e[s]*i[r>>8]>>8:e[s]*r>>16}}function composeSMask(t,e,i,r){const s=r[0],a=r[1],n=r[2]-s,o=r[3]-a;if(0!==n&&0!==o){!function genericComposeSMask(t,e,i,r,s,a,n,o,l,c,d){const h=!!a,u=h?a[0]:0,p=h?a[1]:0,f=h?a[2]:0;let g;g="Luminosity"===s?composeSMaskLuminosity:composeSMaskAlpha;const m=Math.min(r,Math.ceil(1048576/i));for(let s=0;s<r;s+=m){const a=Math.min(m,r-s),v=t.getImageData(o-c,s+(l-d),i,a),_=e.getImageData(o,s+l,i,a);h&&composeSMaskBackdrop(v.data,u,p,f);g(v.data,_.data,n);e.putImageData(_,o,s+l)}}(e.context,i,n,o,e.subtype,e.backdrop,e.transferMap,s,a,e.offsetX,e.offsetY);t.save();t.globalAlpha=1;t.globalCompositeOperation="source-over";t.setTransform(1,0,0,1,0,0);t.drawImage(i.canvas,0,0);t.restore()}}function getImageSmoothingEnabled(t,e){const i=r.Util.singularValueDecompose2dScale(t);i[0]=Math.fround(i[0]);i[1]=Math.fround(i[1]);const a=Math.fround((globalThis.devicePixelRatio||1)*s.PixelsPerInch.PDF_TO_CSS_UNITS);return void 0!==e?e:i[0]<=a||i[1]<=a}const h=["butt","round","square"],u=["miter","round","bevel"],p={},f={};var g=new WeakSet;class CanvasGraphics{constructor(t,e,i,r,s,a,n){_classPrivateMethodInitSpec(this,g);this.ctx=t;this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=!1;this.res=null;this.xobjs=null;this.commonObjs=e;this.objs=i;this.canvasFactory=r;this.groupStack=[];this.processingType3=null;this.baseTransform=null;this.baseTransformStack=[];this.groupLevel=0;this.smaskStack=[];this.smaskCounter=0;this.tempSMask=null;this.suspendedCtx=null;this.contentVisible=!0;this.markedContentStack=[];this.optionalContentConfig=s;this.cachedCanvases=new CachedCanvases(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=a;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;this.backgroundColor=(null==n?void 0:n.background)||null;this.foregroundColor=(null==n?void 0:n.foreground)||null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;this._cachedBitmapsMap=new Map}getObject(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return"string"==typeof t?t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t):e}beginDrawing(t){let{transform:e,viewport:i,transparency:r=!1,background:a=null}=t;const n=this.ctx.canvas.width,o=this.ctx.canvas.height,l=a||"#ffffff";this.ctx.save();if(this.foregroundColor&&this.backgroundColor){this.ctx.fillStyle=this.foregroundColor;const t=this.foregroundColor=this.ctx.fillStyle;this.ctx.fillStyle=this.backgroundColor;const e=this.backgroundColor=this.ctx.fillStyle;let i=!0,r=l;this.ctx.fillStyle=l;r=this.ctx.fillStyle;i="string"==typeof r&&/^#[0-9A-Fa-f]{6}$/.test(r);if("#000000"===t&&"#ffffff"===e||t===e||!i)this.foregroundColor=this.backgroundColor=null;else{const[i,a,n]=(0,s.getRGB)(r),newComp=t=>(t/=255)<=.03928?t/12.92:((t+.055)/1.055)**2.4,o=Math.round(.2126*newComp(i)+.7152*newComp(a)+.0722*newComp(n));this.selectColor=(i,r,s)=>{const a=.2126*newComp(i)+.7152*newComp(r)+.0722*newComp(s);return Math.round(a)===o?e:t}}}this.ctx.fillStyle=this.backgroundColor||l;this.ctx.fillRect(0,0,n,o);this.ctx.restore();if(r){const t=this.cachedCanvases.getCanvas("transparent",n,o);this.compositeCtx=this.ctx;this.transparentCanvas=t.canvas;this.ctx=t.context;this.ctx.save();this.ctx.transform(...(0,s.getCurrentTransform)(this.compositeCtx))}this.ctx.save();resetCtxToDefault(this.ctx,this.foregroundColor);if(e){this.ctx.transform(...e);this.outputScaleX=e[0];this.outputScaleY=e[0]}this.ctx.transform(...i.transform);this.viewportScale=i.scale;this.baseTransform=(0,s.getCurrentTransform)(this.ctx)}executeOperatorList(t,e,i,s){const a=t.argsArray,n=t.fnArray;let o=e||0;const l=a.length;if(l===o)return o;const c=l-o>10&&"function"==typeof i,d=c?Date.now()+15:0;let h=0;const u=this.commonObjs,p=this.objs;let f;for(;;){if(void 0!==s&&o===s.nextBreakPoint){s.breakIt(o,i);return o}f=n[o];if(f!==r.OPS.dependency)this[f].apply(this,a[o]);else for(const t of a[o]){const e=t.startsWith("g_")?u:p;if(!e.has(t)){e.get(t,i);return o}}o++;if(o===l)return o;if(c&&++h>10){if(Date.now()>d){i();return o}h=0}}}endDrawing(){_classPrivateMethodGet(this,g,_restoreInitialState2).call(this);this.cachedCanvases.clear();this.cachedPatterns.clear();for(const t of this._cachedBitmapsMap.values()){for(const e of t.values())"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement&&(e.width=e.height=0);t.clear()}this._cachedBitmapsMap.clear()}_scaleImage(t,e){const i=t.width,r=t.height;let s,a,n=Math.max(Math.hypot(e[0],e[1]),1),o=Math.max(Math.hypot(e[2],e[3]),1),l=i,c=r,d="prescale1";for(;n>2&&l>1||o>2&&c>1;){let e=l,i=c;if(n>2&&l>1){e=Math.ceil(l/2);n/=l/e}if(o>2&&c>1){i=Math.ceil(c/2);o/=c/i}s=this.cachedCanvases.getCanvas(d,e,i);a=s.context;a.clearRect(0,0,e,i);a.drawImage(t,0,0,l,c,0,0,e,i);t=s.canvas;l=e;c=i;d="prescale1"===d?"prescale2":"prescale1"}return{img:t,paintWidth:l,paintHeight:c}}_createMaskCanvas(t){const e=this.ctx,{width:i,height:n}=t,o=this.current.fillColor,l=this.current.patternFill,c=(0,s.getCurrentTransform)(e);let d,h,u,p;if((t.bitmap||t.data)&&t.count>1){const e=t.bitmap||t.data.buffer,i=c.slice(0,4);h=JSON.stringify(l?i:[i,o]);d=this._cachedBitmapsMap.get(e);if(!d){d=new Map;this._cachedBitmapsMap.set(e,d)}const r=d.get(h);if(r&&!l){return{canvas:r,offsetX:Math.round(Math.min(c[0],c[2])+c[4]),offsetY:Math.round(Math.min(c[1],c[3])+c[5])}}u=r}if(!u){p=this.cachedCanvases.getCanvas("maskCanvas",i,n);putBinaryImageMask(p.context,t)}let f=r.Util.transform(c,[1/i,0,0,-1/n,0,0]);f=r.Util.transform(f,[1,0,0,1,0,-n]);const g=r.Util.applyTransform([0,0],f),m=r.Util.applyTransform([i,n],f),v=r.Util.normalizeRect([g[0],g[1],m[0],m[1]]),_=Math.round(v[2]-v[0])||1,b=Math.round(v[3]-v[1])||1,y=this.cachedCanvases.getCanvas("fillCanvas",_,b),A=y.context,P=Math.min(g[0],m[0]),S=Math.min(g[1],m[1]);A.translate(-P,-S);A.transform(...f);if(!u){u=this._scaleImage(p.canvas,(0,s.getCurrentTransformInverse)(A));u=u.img;d&&l&&d.set(h,u)}A.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(A),t.interpolate);drawImageAtIntegerCoords(A,u,0,0,u.width,u.height,0,0,i,n);A.globalCompositeOperation="source-in";const x=r.Util.transform((0,s.getCurrentTransformInverse)(A),[1,0,0,1,-P,-S]);A.fillStyle=l?o.getPattern(e,this,x,a.PathType.FILL):o;A.fillRect(0,0,i,n);if(d&&!l){this.cachedCanvases.delete("fillCanvas");d.set(h,y.canvas)}return{canvas:y.canvas,offsetX:Math.round(P),offsetY:Math.round(S)}}setLineWidth(t){t!==this.current.lineWidth&&(this._cachedScaleForStroking=null);this.current.lineWidth=t;this.ctx.lineWidth=t}setLineCap(t){this.ctx.lineCap=h[t]}setLineJoin(t){this.ctx.lineJoin=u[t]}setMiterLimit(t){this.ctx.miterLimit=t}setDash(t,e){const i=this.ctx;if(void 0!==i.setLineDash){i.setLineDash(t);i.lineDashOffset=e}}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i[0],s=i[1];switch(r){case"LW":this.setLineWidth(s);break;case"LC":this.setLineCap(s);break;case"LJ":this.setLineJoin(s);break;case"ML":this.setMiterLimit(s);break;case"D":this.setDash(s[0],s[1]);break;case"RI":this.setRenderingIntent(s);break;case"FL":this.setFlatness(s);break;case"Font":this.setFont(s[0],s[1]);break;case"CA":this.current.strokeAlpha=i[1];break;case"ca":this.current.fillAlpha=i[1];this.ctx.globalAlpha=i[1];break;case"BM":this.ctx.globalCompositeOperation=s;break;case"SMask":this.current.activeSMask=s?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=s}}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode():!this.current.activeSMask&&t&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const t=this.ctx.canvas.width,e=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,t,e);this.suspendedCtx=this.ctx;this.ctx=r.context;const a=this.ctx;a.setTransform(...(0,s.getCurrentTransform)(this.suspendedCtx));copyCtxState(this.suspendedCtx,a);!function mirrorContextOperations(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save;t.__originalRestore=t.restore;t.__originalRotate=t.rotate;t.__originalScale=t.scale;t.__originalTranslate=t.translate;t.__originalTransform=t.transform;t.__originalSetTransform=t.setTransform;t.__originalResetTransform=t.resetTransform;t.__originalClip=t.clip;t.__originalMoveTo=t.moveTo;t.__originalLineTo=t.lineTo;t.__originalBezierCurveTo=t.bezierCurveTo;t.__originalRect=t.rect;t.__originalClosePath=t.closePath;t.__originalBeginPath=t.beginPath;t._removeMirroring=()=>{t.save=t.__originalSave;t.restore=t.__originalRestore;t.rotate=t.__originalRotate;t.scale=t.__originalScale;t.translate=t.__originalTranslate;t.transform=t.__originalTransform;t.setTransform=t.__originalSetTransform;t.resetTransform=t.__originalResetTransform;t.clip=t.__originalClip;t.moveTo=t.__originalMoveTo;t.lineTo=t.__originalLineTo;t.bezierCurveTo=t.__originalBezierCurveTo;t.rect=t.__originalRect;t.closePath=t.__originalClosePath;t.beginPath=t.__originalBeginPath;delete t._removeMirroring};t.save=function ctxSave(){e.save();this.__originalSave()};t.restore=function ctxRestore(){e.restore();this.__originalRestore()};t.translate=function ctxTranslate(t,i){e.translate(t,i);this.__originalTranslate(t,i)};t.scale=function ctxScale(t,i){e.scale(t,i);this.__originalScale(t,i)};t.transform=function ctxTransform(t,i,r,s,a,n){e.transform(t,i,r,s,a,n);this.__originalTransform(t,i,r,s,a,n)};t.setTransform=function ctxSetTransform(t,i,r,s,a,n){e.setTransform(t,i,r,s,a,n);this.__originalSetTransform(t,i,r,s,a,n)};t.resetTransform=function ctxResetTransform(){e.resetTransform();this.__originalResetTransform()};t.rotate=function ctxRotate(t){e.rotate(t);this.__originalRotate(t)};t.clip=function ctxRotate(t){e.clip(t);this.__originalClip(t)};t.moveTo=function(t,i){e.moveTo(t,i);this.__originalMoveTo(t,i)};t.lineTo=function(t,i){e.lineTo(t,i);this.__originalLineTo(t,i)};t.bezierCurveTo=function(t,i,r,s,a,n){e.bezierCurveTo(t,i,r,s,a,n);this.__originalBezierCurveTo(t,i,r,s,a,n)};t.rect=function(t,i,r,s){e.rect(t,i,r,s);this.__originalRect(t,i,r,s)};t.closePath=function(){e.closePath();this.__originalClosePath()};t.beginPath=function(){e.beginPath();this.__originalBeginPath()}}(a,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring();copyCtxState(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.suspendedCtx=null}compose(t){if(!this.current.activeSMask)return;if(t){t[0]=Math.floor(t[0]);t[1]=Math.floor(t[1]);t[2]=Math.ceil(t[2]);t[3]=Math.ceil(t[3])}else t=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const e=this.current.activeSMask;composeSMask(this.suspendedCtx,e,this.ctx,t);this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height);this.ctx.restore()}save(){if(this.inSMaskMode){copyCtxState(this.ctx,this.suspendedCtx);this.suspendedCtx.save()}else this.ctx.save();const t=this.current;this.stateStack.push(t);this.current=t.clone()}restore(){0===this.stateStack.length&&this.inSMaskMode&&this.endSMaskMode();if(0!==this.stateStack.length){this.current=this.stateStack.pop();if(this.inSMaskMode){this.suspendedCtx.restore();copyCtxState(this.suspendedCtx,this.ctx)}else this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}}transform(t,e,i,r,s,a){this.ctx.transform(t,e,i,r,s,a);this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null}constructPath(t,e,i){const a=this.ctx,n=this.current;let o,l,c=n.x,d=n.y;const h=(0,s.getCurrentTransform)(a),u=0===h[0]&&0===h[3]||0===h[1]&&0===h[2],p=u?i.slice(0):null;for(let i=0,s=0,f=t.length;i<f;i++)switch(0|t[i]){case r.OPS.rectangle:c=e[s++];d=e[s++];const t=e[s++],i=e[s++],f=c+t,g=d+i;a.moveTo(c,d);if(0===t||0===i)a.lineTo(f,g);else{a.lineTo(f,d);a.lineTo(f,g);a.lineTo(c,g)}u||n.updateRectMinMax(h,[c,d,f,g]);a.closePath();break;case r.OPS.moveTo:c=e[s++];d=e[s++];a.moveTo(c,d);u||n.updatePathMinMax(h,c,d);break;case r.OPS.lineTo:c=e[s++];d=e[s++];a.lineTo(c,d);u||n.updatePathMinMax(h,c,d);break;case r.OPS.curveTo:o=c;l=d;c=e[s+4];d=e[s+5];a.bezierCurveTo(e[s],e[s+1],e[s+2],e[s+3],c,d);n.updateCurvePathMinMax(h,o,l,e[s],e[s+1],e[s+2],e[s+3],c,d,p);s+=6;break;case r.OPS.curveTo2:o=c;l=d;a.bezierCurveTo(c,d,e[s],e[s+1],e[s+2],e[s+3]);n.updateCurvePathMinMax(h,o,l,c,d,e[s],e[s+1],e[s+2],e[s+3],p);c=e[s+2];d=e[s+3];s+=4;break;case r.OPS.curveTo3:o=c;l=d;c=e[s+2];d=e[s+3];a.bezierCurveTo(e[s],e[s+1],c,d,c,d);n.updateCurvePathMinMax(h,o,l,e[s],e[s+1],c,d,c,d,p);s+=4;break;case r.OPS.closePath:a.closePath()}u&&n.updateScalingPathMinMax(h,p);n.setCurrentPoint(c,d)}closePath(){this.ctx.closePath()}stroke(t){t=void 0===t||t;const e=this.ctx,i=this.current.strokeColor;e.globalAlpha=this.current.strokeAlpha;if(this.contentVisible)if("object"==typeof i&&null!=i&&i.getPattern){e.save();e.strokeStyle=i.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),a.PathType.STROKE);this.rescaleAndStroke(!1);e.restore()}else this.rescaleAndStroke(!0);t&&this.consumePath(this.current.getClippedPathBoundingBox());e.globalAlpha=this.current.fillAlpha}closeStroke(){this.closePath();this.stroke()}fill(t){t=void 0===t||t;const e=this.ctx,i=this.current.fillColor;let r=!1;if(this.current.patternFill){e.save();e.fillStyle=i.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),a.PathType.FILL);r=!0}const n=this.current.getClippedPathBoundingBox();if(this.contentVisible&&null!==n)if(this.pendingEOFill){e.fill("evenodd");this.pendingEOFill=!1}else e.fill();r&&e.restore();t&&this.consumePath(n)}eoFill(){this.pendingEOFill=!0;this.fill()}fillStroke(){this.fill(!1);this.stroke(!1);this.consumePath()}eoFillStroke(){this.pendingEOFill=!0;this.fillStroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.pendingEOFill=!0;this.closePath();this.fillStroke()}endPath(){this.consumePath()}clip(){this.pendingClip=p}eoClip(){this.pendingClip=f}beginText(){this.current.textMatrix=r.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}endText(){const t=this.pendingTextPaths,e=this.ctx;if(void 0!==t){e.save();e.beginPath();for(const i of t){e.setTransform(...i.transform);e.translate(i.x,i.y);i.addToPath(e,i.fontSize)}e.restore();e.clip();e.beginPath();delete this.pendingTextPaths}else e.beginPath()}setCharSpacing(t){this.current.charSpacing=t}setWordSpacing(t){this.current.wordSpacing=t}setHScale(t){this.current.textHScale=t/100}setLeading(t){this.current.leading=-t}setFont(t,e){const i=this.commonObjs.get(t),s=this.current;if(!i)throw new Error(`Can't find font for ${t}`);s.fontMatrix=i.fontMatrix||r.FONT_IDENTITY_MATRIX;0!==s.fontMatrix[0]&&0!==s.fontMatrix[3]||(0,r.warn)("Invalid font matrix for font "+t);if(e<0){e=-e;s.fontDirection=-1}else s.fontDirection=1;this.current.font=i;this.current.fontSize=e;if(i.isType3Font)return;const a=i.loadedName||"sans-serif";let n="normal";i.black?n="900":i.bold&&(n="bold");const o=i.italic?"italic":"normal",l=`"${a}", ${i.fallbackName}`;let c=e;e<16?c=16:e>100&&(c=100);this.current.fontSizeScale=e/c;this.ctx.font=`${o} ${n} ${c}px ${l}`}setTextRenderingMode(t){this.current.textRenderingMode=t}setTextRise(t){this.current.textRise=t}moveText(t,e){this.current.x=this.current.lineX+=t;this.current.y=this.current.lineY+=e}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}setTextMatrix(t,e,i,r,s,a){this.current.textMatrix=[t,e,i,r,s,a];this.current.textMatrixScale=Math.hypot(t,e);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(t,e,i,a){const n=this.ctx,o=this.current,l=o.font,c=o.textRenderingMode,d=o.fontSize/o.fontSizeScale,h=c&r.TextRenderingMode.FILL_STROKE_MASK,u=!!(c&r.TextRenderingMode.ADD_TO_PATH_FLAG),p=o.patternFill&&!l.missingFile;let f;(l.disableFontFace||u||p)&&(f=l.getPathGenerator(this.commonObjs,t));if(l.disableFontFace||p){n.save();n.translate(e,i);n.beginPath();f(n,d);a&&n.setTransform(...a);h!==r.TextRenderingMode.FILL&&h!==r.TextRenderingMode.FILL_STROKE||n.fill();h!==r.TextRenderingMode.STROKE&&h!==r.TextRenderingMode.FILL_STROKE||n.stroke();n.restore()}else{h!==r.TextRenderingMode.FILL&&h!==r.TextRenderingMode.FILL_STROKE||n.fillText(t,e,i);h!==r.TextRenderingMode.STROKE&&h!==r.TextRenderingMode.FILL_STROKE||n.strokeText(t,e,i)}if(u){(this.pendingTextPaths||(this.pendingTextPaths=[])).push({transform:(0,s.getCurrentTransform)(n),x:e,y:i,fontSize:d,addToPath:f})}}get isFontSubpixelAAEnabled(){const{context:t}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);t.scale(1.5,1);t.fillText("I",0,10);const e=t.getImageData(0,0,10,10).data;let i=!1;for(let t=3;t<e.length;t+=4)if(e[t]>0&&e[t]<255){i=!0;break}return(0,r.shadow)(this,"isFontSubpixelAAEnabled",i)}showText(t){const e=this.current,i=e.font;if(i.isType3Font)return this.showType3Text(t);const n=e.fontSize;if(0===n)return;const o=this.ctx,l=e.fontSizeScale,c=e.charSpacing,d=e.wordSpacing,h=e.fontDirection,u=e.textHScale*h,p=t.length,f=i.vertical,g=f?1:-1,m=i.defaultVMetrics,v=n*e.fontMatrix[0],_=e.textRenderingMode===r.TextRenderingMode.FILL&&!i.disableFontFace&&!e.patternFill;o.save();o.transform(...e.textMatrix);o.translate(e.x,e.y+e.textRise);h>0?o.scale(u,-1):o.scale(u,1);let b;if(e.patternFill){o.save();const t=e.fillColor.getPattern(o,this,(0,s.getCurrentTransformInverse)(o),a.PathType.FILL);b=(0,s.getCurrentTransform)(o);o.restore();o.fillStyle=t}let y=e.lineWidth;const A=e.textMatrixScale;if(0===A||0===y){const t=e.textRenderingMode&r.TextRenderingMode.FILL_STROKE_MASK;t!==r.TextRenderingMode.STROKE&&t!==r.TextRenderingMode.FILL_STROKE||(y=this.getSinglePixelWidth())}else y/=A;if(1!==l){o.scale(l,l);y/=l}o.lineWidth=y;let P,S=0;for(P=0;P<p;++P){const e=t[P];if("number"==typeof e){S+=g*e*n/1e3;continue}let r=!1;const s=(e.isSpace?d:0)+c,a=e.fontChar,u=e.accent;let p,y,A,x=e.width;if(f){const t=e.vmetric||m,i=-(e.vmetric?t[1]:.5*x)*v,r=t[2]*v;x=t?-t[0]:x;p=i/l;y=(S+r)/l}else{p=S/l;y=0}if(i.remeasure&&x>0){const t=1e3*o.measureText(a).width/n*l;if(x<t&&this.isFontSubpixelAAEnabled){const e=x/t;r=!0;o.save();o.scale(e,1);p/=e}else x!==t&&(p+=(x-t)/2e3*n/l)}if(this.contentVisible&&(e.isInFont||i.missingFile))if(_&&!u)o.fillText(a,p,y);else{this.paintChar(a,p,y,b);if(u){const t=p+n*u.offset.x/l,e=y-n*u.offset.y/l;this.paintChar(u.fontChar,t,e,b)}}A=f?x*v-s*h:x*v+s*h;S+=A;r&&o.restore()}f?e.y-=S:e.x+=S*u;o.restore();this.compose()}showType3Text(t){const e=this.ctx,i=this.current,s=i.font,a=i.fontSize,n=i.fontDirection,o=s.vertical?1:-1,l=i.charSpacing,c=i.wordSpacing,d=i.textHScale*n,h=i.fontMatrix||r.FONT_IDENTITY_MATRIX,u=t.length;let p,f,g,m;if(!(i.textRenderingMode===r.TextRenderingMode.INVISIBLE)&&0!==a){this._cachedScaleForStroking=null;this._cachedGetSinglePixelWidth=null;e.save();e.transform(...i.textMatrix);e.translate(i.x,i.y);e.scale(d,n);for(p=0;p<u;++p){f=t[p];if("number"==typeof f){m=o*f*a/1e3;this.ctx.translate(m,0);i.x+=m*d;continue}const n=(f.isSpace?c:0)+l,u=s.charProcOperatorList[f.operatorListId];if(!u){(0,r.warn)(`Type3 character "${f.operatorListId}" is not available.`);continue}if(this.contentVisible){this.processingType3=f;this.save();e.scale(a,a);e.transform(...h);this.executeOperatorList(u);this.restore()}g=r.Util.applyTransform([f.width,0],h)[0]*a+n;e.translate(g,0);i.x+=g*d}e.restore();this.processingType3=null}}setCharWidth(t,e){}setCharWidthAndBounds(t,e,i,r,s,a){this.ctx.rect(i,r,s-i,a-r);this.ctx.clip();this.endPath()}getColorN_Pattern(t){let e;if("TilingPattern"===t[0]){const i=t[1],r=this.baseTransform||(0,s.getCurrentTransform)(this.ctx),n={createCanvasGraphics:t=>new CanvasGraphics(t,this.commonObjs,this.objs,this.canvasFactory)};e=new a.TilingPattern(t,i,this.ctx,n,r)}else e=this._getPattern(t[1],t[2]);return e}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=!0}setStrokeRGBColor(t,e,i){var s;const a=(null===(s=this.selectColor)||void 0===s?void 0:s.call(this,t,e,i))||r.Util.makeHexColor(t,e,i);this.ctx.strokeStyle=a;this.current.strokeColor=a}setFillRGBColor(t,e,i){var s;const a=(null===(s=this.selectColor)||void 0===s?void 0:s.call(this,t,e,i))||r.Util.makeHexColor(t,e,i);this.ctx.fillStyle=a;this.current.fillColor=a;this.current.patternFill=!1}_getPattern(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.cachedPatterns.has(t))e=this.cachedPatterns.get(t);else{e=(0,a.getShadingPattern)(this.objs.get(t));this.cachedPatterns.set(t,e)}i&&(e.matrix=i);return e}shadingFill(t){if(!this.contentVisible)return;const e=this.ctx;this.save();const i=this._getPattern(t);e.fillStyle=i.getPattern(e,this,(0,s.getCurrentTransformInverse)(e),a.PathType.SHADING);const n=(0,s.getCurrentTransformInverse)(e);if(n){const t=e.canvas,i=t.width,s=t.height,a=r.Util.applyTransform([0,0],n),o=r.Util.applyTransform([0,s],n),l=r.Util.applyTransform([i,0],n),c=r.Util.applyTransform([i,s],n),d=Math.min(a[0],o[0],l[0],c[0]),h=Math.min(a[1],o[1],l[1],c[1]),u=Math.max(a[0],o[0],l[0],c[0]),p=Math.max(a[1],o[1],l[1],c[1]);this.ctx.fillRect(d,h,u-d,p-h)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox());this.restore()}beginInlineImage(){(0,r.unreachable)("Should not call beginInlineImage")}beginImageData(){(0,r.unreachable)("Should not call beginImageData")}paintFormXObjectBegin(t,e){if(this.contentVisible){this.save();this.baseTransformStack.push(this.baseTransform);Array.isArray(t)&&6===t.length&&this.transform(...t);this.baseTransform=(0,s.getCurrentTransform)(this.ctx);if(e){const t=e[2]-e[0],i=e[3]-e[1];this.ctx.rect(e[0],e[1],t,i);this.current.updateRectMinMax((0,s.getCurrentTransform)(this.ctx),e);this.clip();this.endPath()}}}paintFormXObjectEnd(){if(this.contentVisible){this.restore();this.baseTransform=this.baseTransformStack.pop()}}beginGroup(t){if(!this.contentVisible)return;this.save();if(this.inSMaskMode){this.endSMaskMode();this.current.activeSMask=null}const e=this.ctx;t.isolated||(0,r.info)("TODO: Support non-isolated groups.");t.knockout&&(0,r.warn)("Knockout groups not supported.");const i=(0,s.getCurrentTransform)(e);t.matrix&&e.transform(...t.matrix);if(!t.bbox)throw new Error("Bounding box is required.");let a=r.Util.getAxialAlignedBoundingBox(t.bbox,(0,s.getCurrentTransform)(e));const n=[0,0,e.canvas.width,e.canvas.height];a=r.Util.intersect(a,n)||[0,0,0,0];const o=Math.floor(a[0]),c=Math.floor(a[1]);let d=Math.max(Math.ceil(a[2])-o,1),h=Math.max(Math.ceil(a[3])-c,1),u=1,p=1;if(d>l){u=d/l;d=l}if(h>l){p=h/l;h=l}this.current.startNewPathAndClipBox([0,0,d,h]);let f="groupAt"+this.groupLevel;t.smask&&(f+="_smask_"+this.smaskCounter++%2);const g=this.cachedCanvases.getCanvas(f,d,h),m=g.context;m.scale(1/u,1/p);m.translate(-o,-c);m.transform(...i);if(t.smask)this.smaskStack.push({canvas:g.canvas,context:m,offsetX:o,offsetY:c,scaleX:u,scaleY:p,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null,startTransformInverse:null});else{e.setTransform(1,0,0,1,0,0);e.translate(o,c);e.scale(u,p);e.save()}copyCtxState(e,m);this.ctx=m;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push(e);this.groupLevel++}endGroup(t){if(!this.contentVisible)return;this.groupLevel--;const e=this.ctx,i=this.groupStack.pop();this.ctx=i;this.ctx.imageSmoothingEnabled=!1;if(t.smask){this.tempSMask=this.smaskStack.pop();this.restore()}else{this.ctx.restore();const t=(0,s.getCurrentTransform)(this.ctx);this.restore();this.ctx.save();this.ctx.setTransform(...t);const i=r.Util.getAxialAlignedBoundingBox([0,0,e.canvas.width,e.canvas.height],t);this.ctx.drawImage(e.canvas,0,0);this.ctx.restore();this.compose(i)}}beginAnnotation(t,e,i,a,n){_classPrivateMethodGet(this,g,_restoreInitialState2).call(this);resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.save();this.save();this.baseTransform&&this.ctx.setTransform(...this.baseTransform);if(Array.isArray(e)&&4===e.length){const a=e[2]-e[0],o=e[3]-e[1];if(n&&this.annotationCanvasMap){(i=i.slice())[4]-=e[0];i[5]-=e[1];(e=e.slice())[0]=e[1]=0;e[2]=a;e[3]=o;const[n,l]=r.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(this.ctx)),{viewportScale:c}=this,d=Math.ceil(a*this.outputScaleX*c),h=Math.ceil(o*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,h);const{canvas:u,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(t,u);this.annotationCanvas.savedCtx=this.ctx;this.ctx=p;this.ctx.setTransform(n,0,0,-l,0,o*l);resetCtxToDefault(this.ctx,this.foregroundColor)}else{resetCtxToDefault(this.ctx,this.foregroundColor);this.ctx.rect(e[0],e[1],a,o);this.ctx.clip();this.endPath()}}this.current=new CanvasExtraState(this.ctx.canvas.width,this.ctx.canvas.height);this.transform(...i);this.transform(...a)}endAnnotation(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}}paintImageMaskXObject(t){if(!this.contentVisible)return;const e=t.count;(t=this.getObject(t.data,t)).count=e;const i=this.ctx,r=this.processingType3;if(r){void 0===r.compiled&&(r.compiled=function compileType3Glyph(t){const{width:e,height:i}=t;if(e>c||i>c)return null;const r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1;let a,n,o,l=new Uint8Array(s*(i+1));const d=e+7&-8;let h=new Uint8Array(d*i),u=0;for(const e of t.data){let t=128;for(;t>0;){h[u++]=e&t?0:255;t>>=1}}let p=0;u=0;if(0!==h[u]){l[0]=1;++p}for(n=1;n<e;n++){if(h[u]!==h[u+1]){l[n]=h[u]?2:1;++p}u++}if(0!==h[u]){l[n]=2;++p}for(a=1;a<i;a++){u=a*d;o=a*s;if(h[u-d]!==h[u]){l[o]=h[u]?1:8;++p}let t=(h[u]?4:0)+(h[u-d]?8:0);for(n=1;n<e;n++){t=(t>>2)+(h[u+1]?4:0)+(h[u-d+1]?8:0);if(r[t]){l[o+n]=r[t];++p}u++}if(h[u-d]!==h[u]){l[o+n]=h[u]?2:4;++p}if(p>1e3)return null}u=d*(i-1);o=a*s;if(0!==h[u]){l[o]=8;++p}for(n=1;n<e;n++){if(h[u]!==h[u+1]){l[o+n]=h[u]?4:8;++p}u++}if(0!==h[u]){l[o+n]=4;++p}if(p>1e3)return null;const f=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(a=0;p&&a<=i;a++){let t=a*s;const i=t+e;for(;t<i&&!l[t];)t++;if(t===i)continue;g.moveTo(t%s,a);const r=t;let n=l[t];do{const e=f[n];do{t+=e}while(!l[t]);const i=l[t];if(5!==i&&10!==i){n=i;l[t]=0}else{n=i&51*n>>4;l[t]&=n>>2|n<<2}g.lineTo(t%s,t/s|0);l[t]||--p}while(r!==t);--a}h=null;l=null;return function(t){t.save();t.scale(1/e,-1/i);t.translate(0,-i);t.fill(g);t.beginPath();t.restore()}}(t));if(r.compiled){r.compiled(i);return}}const s=this._createMaskCanvas(t),a=s.canvas;i.save();i.setTransform(1,0,0,1,0,0);i.drawImage(a,s.offsetX,s.offsetY);i.restore();this.compose()}paintImageMaskXObjectRepeat(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;if(!this.contentVisible)return;t=this.getObject(t.data,t);const l=this.ctx;l.save();const c=(0,s.getCurrentTransform)(l);l.transform(e,i,a,n,0,0);const d=this._createMaskCanvas(t);l.setTransform(1,0,0,1,0,0);for(let t=0,s=o.length;t<s;t+=2){const s=r.Util.transform(c,[e,i,a,n,o[t],o[t+1]]),[h,u]=r.Util.applyTransform([0,0],s);l.drawImage(d.canvas,h,u)}l.restore();this.compose()}paintImageMaskXObjectGroup(t){if(!this.contentVisible)return;const e=this.ctx,i=this.current.fillColor,r=this.current.patternFill;for(const n of t){const{data:t,width:o,height:l,transform:c}=n,d=this.cachedCanvases.getCanvas("maskCanvas",o,l),h=d.context;h.save();putBinaryImageMask(h,this.getObject(t,n));h.globalCompositeOperation="source-in";h.fillStyle=r?i.getPattern(h,this,(0,s.getCurrentTransformInverse)(e),a.PathType.FILL):i;h.fillRect(0,0,o,l);h.restore();e.save();e.transform(...c);e.scale(1,-1);drawImageAtIntegerCoords(e,d.canvas,0,0,o,l,0,-1,1,1);e.restore()}this.compose()}paintImageXObject(t){if(!this.contentVisible)return;const e=this.getObject(t);e?this.paintInlineImageXObject(e):(0,r.warn)("Dependent image isn't ready yet")}paintImageXObjectRepeat(t,e,i,s){if(!this.contentVisible)return;const a=this.getObject(t);if(!a){(0,r.warn)("Dependent image isn't ready yet");return}const n=a.width,o=a.height,l=[];for(let t=0,r=s.length;t<r;t+=2)l.push({transform:[e,0,0,i,s[t],s[t+1]],x:0,y:0,w:n,h:o});this.paintInlineImageXObjectGroup(a,l)}paintInlineImageXObject(t){if(!this.contentVisible)return;const e=t.width,i=t.height,r=this.ctx;this.save();r.scale(1/e,-1/i);let a;if("function"==typeof HTMLElement&&t instanceof HTMLElement||!t.data)a=t;else{const r=this.cachedCanvases.getCanvas("inlineImage",e,i);putBinaryImageData(r.context,t,this.current.transferMaps);a=r.canvas}const n=this._scaleImage(a,(0,s.getCurrentTransformInverse)(r));r.imageSmoothingEnabled=getImageSmoothingEnabled((0,s.getCurrentTransform)(r),t.interpolate);drawImageAtIntegerCoords(r,n.img,0,0,n.paintWidth,n.paintHeight,0,-i,e,i);this.compose();this.restore()}paintInlineImageXObjectGroup(t,e){if(!this.contentVisible)return;const i=this.ctx,r=t.width,s=t.height,a=this.cachedCanvases.getCanvas("inlineImage",r,s);putBinaryImageData(a.context,t,this.current.transferMaps);for(const t of e){i.save();i.transform(...t.transform);i.scale(1,-1);drawImageAtIntegerCoords(i,a.canvas,t.x,t.y,t.w,t.h,0,-1,1,1);i.restore()}this.compose()}paintSolidColorImageMask(){if(this.contentVisible){this.ctx.fillRect(0,0,1,1);this.compose()}}markPoint(t){}markPointProps(t,e){}beginMarkedContent(t){this.markedContentStack.push({visible:!0})}beginMarkedContentProps(t,e){"OC"===t?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(e)}):this.markedContentStack.push({visible:!0});this.contentVisible=this.isContentVisible()}endMarkedContent(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()}beginCompat(){}endCompat(){}consumePath(t){const e=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath();this.pendingClip||this.compose(t);const i=this.ctx;if(this.pendingClip){e||(this.pendingClip===f?i.clip("evenodd"):i.clip());this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);i.beginPath()}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const t=(0,s.getCurrentTransform)(this.ctx);if(0===t[1]&&0===t[2])this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(t[0]),Math.abs(t[3]));else{const e=Math.abs(t[0]*t[3]-t[2]*t[1]),i=Math.hypot(t[0],t[2]),r=Math.hypot(t[1],t[3]);this._cachedGetSinglePixelWidth=Math.max(i,r)/e}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(!this._cachedScaleForStroking){const{lineWidth:t}=this.current,e=(0,s.getCurrentTransform)(this.ctx);let i,r;if(0===e[1]&&0===e[2]){const s=Math.abs(e[0]),a=Math.abs(e[3]);if(0===t){i=1/s;r=1/a}else{const e=s*t,n=a*t;i=e<1?1/e:1;r=n<1?1/n:1}}else{const s=Math.abs(e[0]*e[3]-e[2]*e[1]),a=Math.hypot(e[0],e[1]),n=Math.hypot(e[2],e[3]);if(0===t){i=n/s;r=a/s}else{const e=t*s;i=n>e?n/e:1;r=a>e?a/e:1}}this._cachedScaleForStroking=[i,r]}return this._cachedScaleForStroking}rescaleAndStroke(t){const{ctx:e}=this,{lineWidth:i}=this.current,[r,a]=this.getScaleForStroking();e.lineWidth=i||1;if(1===r&&1===a){e.stroke();return}let n,o,l;if(t){n=(0,s.getCurrentTransform)(e);o=e.getLineDash().slice();l=e.lineDashOffset}e.scale(r,a);const c=Math.max(r,a);e.setLineDash(e.getLineDash().map((t=>t/c)));e.lineDashOffset/=c;e.stroke();if(t){e.setTransform(...n);e.setLineDash(o);e.lineDashOffset=l}}isContentVisible(){for(let t=this.markedContentStack.length-1;t>=0;t--)if(!this.markedContentStack[t].visible)return!1;return!0}}e.CanvasGraphics=CanvasGraphics;function _restoreInitialState2(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.ctx.restore();if(this.transparentCanvas){this.ctx=this.compositeCtx;this.ctx.save();this.ctx.setTransform(1,0,0,1,0,0);this.ctx.drawImage(this.transparentCanvas,0,0);this.ctx.restore();this.transparentCanvas=null}}for(const t in r.OPS)void 0!==CanvasGraphics.prototype[t]&&(CanvasGraphics.prototype[r.OPS[t]]=CanvasGraphics.prototype[t])},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TilingPattern=e.PathType=void 0;e.getShadingPattern=function getShadingPattern(t){switch(t[0]){case"RadialAxial":return new RadialAxialShadingPattern(t);case"Mesh":return new MeshShadingPattern(t);case"Dummy":return new DummyShadingPattern}throw new Error(`Unknown IR type: ${t[0]}`)};var r=i(1),s=i(136),a=i(3);const n={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};e.PathType=n;function applyBoundingBox(t,e){if(!e||a.isNodeJS)return;const i=e[2]-e[0],r=e[3]-e[1],s=new Path2D;s.rect(e[0],e[1],i,r);t.clip(s)}class BaseShadingPattern{constructor(){this.constructor===BaseShadingPattern&&(0,r.unreachable)("Cannot initialize BaseShadingPattern.")}getPattern(){(0,r.unreachable)("Abstract method `getPattern` called.")}}class RadialAxialShadingPattern extends BaseShadingPattern{constructor(t){super();this._type=t[1];this._bbox=t[2];this._colorStops=t[3];this._p0=t[4];this._p1=t[5];this._r0=t[6];this._r1=t[7];this.matrix=null}_createGradient(t){let e;"axial"===this._type?e=t.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):"radial"===this._type&&(e=t.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const t of this._colorStops)e.addColorStop(t[0],t[1]);return e}getPattern(t,e,i,a){let o;if(a===n.STROKE||a===n.FILL){const n=e.current.getClippedPathBoundingBox(a,(0,s.getCurrentTransform)(t))||[0,0,0,0],l=Math.ceil(n[2]-n[0])||1,c=Math.ceil(n[3]-n[1])||1,d=e.cachedCanvases.getCanvas("pattern",l,c,!0),h=d.context;h.clearRect(0,0,h.canvas.width,h.canvas.height);h.beginPath();h.rect(0,0,h.canvas.width,h.canvas.height);h.translate(-n[0],-n[1]);i=r.Util.transform(i,[1,0,0,1,n[0],n[1]]);h.transform(...e.baseTransform);this.matrix&&h.transform(...this.matrix);applyBoundingBox(h,this._bbox);h.fillStyle=this._createGradient(h);h.fill();o=t.createPattern(d.canvas,"no-repeat");const u=new DOMMatrix(i);try{o.setTransform(u)}catch(t){(0,r.warn)(`RadialAxialShadingPattern.getPattern: "${null==t?void 0:t.message}".`)}}else{applyBoundingBox(t,this._bbox);o=this._createGradient(t)}return o}}function drawTriangle(t,e,i,r,s,a,n,o){const l=e.coords,c=e.colors,d=t.data,h=4*t.width;let u;if(l[i+1]>l[r+1]){u=i;i=r;r=u;u=a;a=n;n=u}if(l[r+1]>l[s+1]){u=r;r=s;s=u;u=n;n=o;o=u}if(l[i+1]>l[r+1]){u=i;i=r;r=u;u=a;a=n;n=u}const p=(l[i]+e.offsetX)*e.scaleX,f=(l[i+1]+e.offsetY)*e.scaleY,g=(l[r]+e.offsetX)*e.scaleX,m=(l[r+1]+e.offsetY)*e.scaleY,v=(l[s]+e.offsetX)*e.scaleX,_=(l[s+1]+e.offsetY)*e.scaleY;if(f>=_)return;const b=c[a],y=c[a+1],A=c[a+2],P=c[n],S=c[n+1],x=c[n+2],w=c[o],E=c[o+1],C=c[o+2],k=Math.round(f),T=Math.round(_);let M,R,I,D,O,L,G,N;for(let t=k;t<=T;t++){if(t<m){let e;e=t<f?0:(f-t)/(f-m);M=p-(p-g)*e;R=b-(b-P)*e;I=y-(y-S)*e;D=A-(A-x)*e}else{let e;e=t>_?1:m===_?0:(m-t)/(m-_);M=g-(g-v)*e;R=P-(P-w)*e;I=S-(S-E)*e;D=x-(x-C)*e}let e;e=t<f?0:t>_?1:(f-t)/(f-_);O=p-(p-v)*e;L=b-(b-w)*e;G=y-(y-E)*e;N=A-(A-C)*e;const i=Math.round(Math.min(M,O)),r=Math.round(Math.max(M,O));let s=h*t+4*i;for(let t=i;t<=r;t++){e=(M-t)/(M-O);e<0?e=0:e>1&&(e=1);d[s++]=R-(R-L)*e|0;d[s++]=I-(I-G)*e|0;d[s++]=D-(D-N)*e|0;d[s++]=255}}}function drawFigure(t,e,i){const r=e.coords,s=e.colors;let a,n;switch(e.type){case"lattice":const o=e.verticesPerRow,l=Math.floor(r.length/o)-1,c=o-1;for(a=0;a<l;a++){let e=a*o;for(let a=0;a<c;a++,e++){drawTriangle(t,i,r[e],r[e+1],r[e+o],s[e],s[e+1],s[e+o]);drawTriangle(t,i,r[e+o+1],r[e+1],r[e+o],s[e+o+1],s[e+1],s[e+o])}}break;case"triangles":for(a=0,n=r.length;a<n;a+=3)drawTriangle(t,i,r[a],r[a+1],r[a+2],s[a],s[a+1],s[a+2]);break;default:throw new Error("illegal figure")}}class MeshShadingPattern extends BaseShadingPattern{constructor(t){super();this._coords=t[2];this._colors=t[3];this._figures=t[4];this._bounds=t[5];this._bbox=t[7];this._background=t[8];this.matrix=null}_createMeshCanvas(t,e,i){const r=Math.floor(this._bounds[0]),s=Math.floor(this._bounds[1]),a=Math.ceil(this._bounds[2])-r,n=Math.ceil(this._bounds[3])-s,o=Math.min(Math.ceil(Math.abs(a*t[0]*1.1)),3e3),l=Math.min(Math.ceil(Math.abs(n*t[1]*1.1)),3e3),c=a/o,d=n/l,h={coords:this._coords,colors:this._colors,offsetX:-r,offsetY:-s,scaleX:1/c,scaleY:1/d},u=o+4,p=l+4,f=i.getCanvas("mesh",u,p,!1),g=f.context,m=g.createImageData(o,l);if(e){const t=m.data;for(let i=0,r=t.length;i<r;i+=4){t[i]=e[0];t[i+1]=e[1];t[i+2]=e[2];t[i+3]=255}}for(const t of this._figures)drawFigure(m,t,h);g.putImageData(m,2,2);return{canvas:f.canvas,offsetX:r-2*c,offsetY:s-2*d,scaleX:c,scaleY:d}}getPattern(t,e,i,a){applyBoundingBox(t,this._bbox);let o;if(a===n.SHADING)o=r.Util.singularValueDecompose2dScale((0,s.getCurrentTransform)(t));else{o=r.Util.singularValueDecompose2dScale(e.baseTransform);if(this.matrix){const t=r.Util.singularValueDecompose2dScale(this.matrix);o=[o[0]*t[0],o[1]*t[1]]}}const l=this._createMeshCanvas(o,a===n.SHADING?null:this._background,e.cachedCanvases);if(a!==n.SHADING){t.setTransform(...e.baseTransform);this.matrix&&t.transform(...this.matrix)}t.translate(l.offsetX,l.offsetY);t.scale(l.scaleX,l.scaleY);return t.createPattern(l.canvas,"no-repeat")}}class DummyShadingPattern extends BaseShadingPattern{getPattern(){return"hotpink"}}const o=1,l=2;class TilingPattern{static get MAX_PATTERN_SIZE(){return(0,r.shadow)(this,"MAX_PATTERN_SIZE",3e3)}constructor(t,e,i,r,s){this.operatorList=t[2];this.matrix=t[3]||[1,0,0,1,0,0];this.bbox=t[4];this.xstep=t[5];this.ystep=t[6];this.paintType=t[7];this.tilingType=t[8];this.color=e;this.ctx=i;this.canvasGraphicsFactory=r;this.baseTransform=s}createPatternCanvas(t){const e=this.operatorList,i=this.bbox,a=this.xstep,n=this.ystep,o=this.paintType,l=this.tilingType,c=this.color,d=this.canvasGraphicsFactory;(0,r.info)("TilingType: "+l);const h=i[0],u=i[1],p=i[2],f=i[3],g=r.Util.singularValueDecompose2dScale(this.matrix),m=r.Util.singularValueDecompose2dScale(this.baseTransform),v=[g[0]*m[0],g[1]*m[1]],_=this.getSizeAndScale(a,this.ctx.canvas.width,v[0]),b=this.getSizeAndScale(n,this.ctx.canvas.height,v[1]),y=t.cachedCanvases.getCanvas("pattern",_.size,b.size,!0),A=y.context,P=d.createCanvasGraphics(A);P.groupLevel=t.groupLevel;this.setFillAndStrokeStyleToContext(P,o,c);let S=h,x=u,w=p,E=f;if(h<0){S=0;w+=Math.abs(h)}if(u<0){x=0;E+=Math.abs(u)}A.translate(-_.scale*S,-b.scale*x);P.transform(_.scale,0,0,b.scale,0,0);A.save();this.clipBbox(P,S,x,w,E);P.baseTransform=(0,s.getCurrentTransform)(P.ctx);P.executeOperatorList(e);P.endDrawing();return{canvas:y.canvas,scaleX:_.scale,scaleY:b.scale,offsetX:S,offsetY:x}}getSizeAndScale(t,e,i){t=Math.abs(t);const r=Math.max(TilingPattern.MAX_PATTERN_SIZE,e);let s=Math.ceil(t*i);s>=r?s=r:i=s/t;return{scale:i,size:s}}clipBbox(t,e,i,r,a){const n=r-e,o=a-i;t.ctx.rect(e,i,n,o);t.current.updateRectMinMax((0,s.getCurrentTransform)(t.ctx),[e,i,r,a]);t.clip();t.endPath()}setFillAndStrokeStyleToContext(t,e,i){const s=t.ctx,a=t.current;switch(e){case o:const t=this.ctx;s.fillStyle=t.fillStyle;s.strokeStyle=t.strokeStyle;a.fillColor=t.fillStyle;a.strokeColor=t.strokeStyle;break;case l:const n=r.Util.makeHexColor(i[0],i[1],i[2]);s.fillStyle=n;s.strokeStyle=n;a.fillColor=n;a.strokeColor=n;break;default:throw new r.FormatError(`Unsupported paint type: ${e}`)}}getPattern(t,e,i,s){let a=i;if(s!==n.SHADING){a=r.Util.transform(a,e.baseTransform);this.matrix&&(a=r.Util.transform(a,this.matrix))}const o=this.createPatternCanvas(e);let l=new DOMMatrix(a);l=l.translate(o.offsetX,o.offsetY);l=l.scale(1/o.scaleX,1/o.scaleY);const c=t.createPattern(o.canvas,"repeat");try{c.setTransform(l)}catch(t){(0,r.warn)(`TilingPattern.getPattern: "${null==t?void 0:t.message}".`)}return c}}e.TilingPattern=TilingPattern},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.applyMaskImageData=function applyMaskImageData(t){let{src:e,srcPos:i=0,dest:s,destPos:a=0,width:n,height:o,inverseDecode:l=!1}=t;const c=r.FeatureTest.isLittleEndian?4278190080:255,[d,h]=l?[0,c]:[c,0],u=n>>3,p=7&n,f=e.length;s=new Uint32Array(s.buffer);for(let t=0;t<o;t++){for(const t=i+u;i<t;i++){const t=i<f?e[i]:255;s[a++]=128&t?h:d;s[a++]=64&t?h:d;s[a++]=32&t?h:d;s[a++]=16&t?h:d;s[a++]=8&t?h:d;s[a++]=4&t?h:d;s[a++]=2&t?h:d;s[a++]=1&t?h:d}if(0===p)continue;const t=i<f?e[i++]:255;for(let e=0;e<p;e++)s[a++]=t&1<<7-e?h:d}return{srcPos:i,destPos:a}};var r=i(1)},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.GlobalWorkerOptions=void 0;const i=Object.create(null);e.GlobalWorkerOptions=i;i.workerPort=void 0===i.workerPort?null:i.workerPort;i.workerSrc=void 0===i.workerSrc?"":i.workerSrc},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.MessageHandler=void 0;var r=i(1);const s=1,a=2,n=1,o=2,l=3,c=4,d=5,h=6,u=7,p=8;function wrapReason(t){t instanceof Error||"object"==typeof t&&null!==t||(0,r.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new r.AbortException(t.message);case"MissingPDFException":return new r.MissingPDFException(t.message);case"PasswordException":return new r.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new r.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new r.UnknownErrorException(t.message,t.details);default:return new r.UnknownErrorException(t.message,t.toString())}}e.MessageHandler=class MessageHandler{constructor(t,e,i){this.sourceName=t;this.targetName=e;this.comObj=i;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=t=>{const e=t.data;if(e.targetName!==this.sourceName)return;if(e.stream){this._processStreamMessage(e);return}if(e.callback){const t=e.callbackId,i=this.callbackCapabilities[t];if(!i)throw new Error(`Cannot resolve callback ${t}`);delete this.callbackCapabilities[t];if(e.callback===s)i.resolve(e.data);else{if(e.callback!==a)throw new Error("Unexpected callback case");i.reject(wrapReason(e.reason))}return}const r=this.actionHandler[e.action];if(!r)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){const t=this.sourceName,n=e.sourceName;new Promise((function(t){t(r(e.data))})).then((function(r){i.postMessage({sourceName:t,targetName:n,callback:s,callbackId:e.callbackId,data:r})}),(function(r){i.postMessage({sourceName:t,targetName:n,callback:a,callbackId:e.callbackId,reason:wrapReason(r)})}))}else e.streamId?this._createStreamSink(e):r(e.data)};i.addEventListener("message",this._onComObjOnMessage)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const s=this.callbackId++,a=(0,r.createPromiseCapability)();this.callbackCapabilities[s]=a;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:s,data:e},i)}catch(t){a.reject(t)}return a.promise}sendWithStream(t,e,i,s){const a=this.streamId++,o=this.sourceName,l=this.targetName,c=this.comObj;return new ReadableStream({start:i=>{const n=(0,r.createPromiseCapability)();this.streamControllers[a]={controller:i,startCall:n,pullCall:null,cancelCall:null,isClosed:!1};c.postMessage({sourceName:o,targetName:l,action:t,streamId:a,data:e,desiredSize:i.desiredSize},s);return n.promise},pull:t=>{const e=(0,r.createPromiseCapability)();this.streamControllers[a].pullCall=e;c.postMessage({sourceName:o,targetName:l,stream:h,streamId:a,desiredSize:t.desiredSize});return e.promise},cancel:t=>{(0,r.assert)(t instanceof Error,"cancel must have a valid reason");const e=(0,r.createPromiseCapability)();this.streamControllers[a].cancelCall=e;this.streamControllers[a].isClosed=!0;c.postMessage({sourceName:o,targetName:l,stream:n,streamId:a,reason:wrapReason(t)});return e.promise}},i)}_createStreamSink(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,a=this.comObj,n=this,o=this.actionHandler[t.action],h={enqueue(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const l=this.desiredSize;this.desiredSize-=n;if(l>0&&this.desiredSize<=0){this.sinkCapability=(0,r.createPromiseCapability)();this.ready=this.sinkCapability.promise}a.postMessage({sourceName:i,targetName:s,stream:c,streamId:e,chunk:t},o)},close(){if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:i,targetName:s,stream:l,streamId:e});delete n.streamSinks[e]}},error(t){(0,r.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;a.postMessage({sourceName:i,targetName:s,stream:d,streamId:e,reason:wrapReason(t)})}},sinkCapability:(0,r.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};h.sinkCapability.resolve();h.ready=h.sinkCapability.promise;this.streamSinks[e]=h;new Promise((function(e){e(o(t.data,h))})).then((function(){a.postMessage({sourceName:i,targetName:s,stream:p,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:i,targetName:s,stream:p,streamId:e,reason:wrapReason(t)})}))}_processStreamMessage(t){const e=t.streamId,i=this.sourceName,s=t.sourceName,a=this.comObj,f=this.streamControllers[e],g=this.streamSinks[e];switch(t.stream){case p:t.success?f.startCall.resolve():f.startCall.reject(wrapReason(t.reason));break;case u:t.success?f.pullCall.resolve():f.pullCall.reject(wrapReason(t.reason));break;case h:if(!g){a.postMessage({sourceName:i,targetName:s,stream:u,streamId:e,success:!0});break}g.desiredSize<=0&&t.desiredSize>0&&g.sinkCapability.resolve();g.desiredSize=t.desiredSize;new Promise((function(t){t(g.onPull&&g.onPull())})).then((function(){a.postMessage({sourceName:i,targetName:s,stream:u,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:i,targetName:s,stream:u,streamId:e,reason:wrapReason(t)})}));break;case c:(0,r.assert)(f,"enqueue should have stream controller");if(f.isClosed)break;f.controller.enqueue(t.chunk);break;case l:(0,r.assert)(f,"close should have stream controller");if(f.isClosed)break;f.isClosed=!0;f.controller.close();this._deleteStreamController(f,e);break;case d:(0,r.assert)(f,"error should have stream controller");f.controller.error(wrapReason(t.reason));this._deleteStreamController(f,e);break;case o:t.success?f.cancelCall.resolve():f.cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(f,e);break;case n:if(!g)break;new Promise((function(e){e(g.onCancel&&g.onCancel(wrapReason(t.reason)))})).then((function(){a.postMessage({sourceName:i,targetName:s,stream:o,streamId:e,success:!0})}),(function(t){a.postMessage({sourceName:i,targetName:s,stream:o,streamId:e,reason:wrapReason(t)})}));g.sinkCapability.reject(wrapReason(t.reason));g.isCancelled=!0;delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(t,e){await Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]);delete this.streamControllers[e]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.Metadata=void 0;var r=i(1);function _classPrivateFieldInitSpec(t,e,i){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.set(t,i)}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var s=new WeakMap,a=new WeakMap;e.Metadata=class Metadata{constructor(t){let{parsedData:e,rawData:i}=t;_classPrivateFieldInitSpec(this,s,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,a,{writable:!0,value:void 0});_classPrivateFieldSet(this,s,e);_classPrivateFieldSet(this,a,i)}getRaw(){return _classPrivateFieldGet(this,a)}get(t){return _classPrivateFieldGet(this,s).get(t)??null}getAll(){return(0,r.objectFromMap)(_classPrivateFieldGet(this,s))}has(t){return _classPrivateFieldGet(this,s).has(t)}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.OptionalContentConfig=void 0;var r=i(1),s=i(138);function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}const a=Symbol("INTERNAL");var n=new WeakMap;class OptionalContentGroup{constructor(t,e){_classPrivateFieldInitSpec(this,n,{writable:!0,value:!0});this.name=t;this.intent=e}get visible(){return _classPrivateFieldGet(this,n)}_setVisible(t,e){t!==a&&(0,r.unreachable)("Internal method `_setVisible` called.");_classPrivateFieldSet(this,n,e)}}var o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakSet;e.OptionalContentConfig=class OptionalContentConfig{constructor(t){!function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}(this,h);_classPrivateFieldInitSpec(this,o,{writable:!0,value:null});_classPrivateFieldInitSpec(this,l,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,c,{writable:!0,value:null});_classPrivateFieldInitSpec(this,d,{writable:!0,value:null});this.name=null;this.creator=null;if(null!==t){this.name=t.name;this.creator=t.creator;_classPrivateFieldSet(this,d,t.order);for(const e of t.groups)_classPrivateFieldGet(this,l).set(e.id,new OptionalContentGroup(e.name,e.intent));if("OFF"===t.baseState)for(const t of _classPrivateFieldGet(this,l).values())t._setVisible(a,!1);for(const e of t.on)_classPrivateFieldGet(this,l).get(e)._setVisible(a,!0);for(const e of t.off)_classPrivateFieldGet(this,l).get(e)._setVisible(a,!1);_classPrivateFieldSet(this,c,this.getHash())}}isVisible(t){if(0===_classPrivateFieldGet(this,l).size)return!0;if(!t){(0,r.warn)("Optional content group not defined.");return!0}if("OCG"===t.type){if(!_classPrivateFieldGet(this,l).has(t.id)){(0,r.warn)(`Optional content group not found: ${t.id}`);return!0}return _classPrivateFieldGet(this,l).get(t.id).visible}if("OCMD"===t.type){if(t.expression)return _classPrivateMethodGet(this,h,_evaluateVisibilityExpression2).call(this,t.expression);if(!t.policy||"AnyOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,l).has(e)){(0,r.warn)(`Optional content group not found: ${e}`);return!0}if(_classPrivateFieldGet(this,l).get(e).visible)return!0}return!1}if("AllOn"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,l).has(e)){(0,r.warn)(`Optional content group not found: ${e}`);return!0}if(!_classPrivateFieldGet(this,l).get(e).visible)return!1}return!0}if("AnyOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,l).has(e)){(0,r.warn)(`Optional content group not found: ${e}`);return!0}if(!_classPrivateFieldGet(this,l).get(e).visible)return!0}return!1}if("AllOff"===t.policy){for(const e of t.ids){if(!_classPrivateFieldGet(this,l).has(e)){(0,r.warn)(`Optional content group not found: ${e}`);return!0}if(_classPrivateFieldGet(this,l).get(e).visible)return!1}return!0}(0,r.warn)(`Unknown optional content policy ${t.policy}.`);return!0}(0,r.warn)(`Unknown group type ${t.type}.`);return!0}setVisibility(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(_classPrivateFieldGet(this,l).has(t)){_classPrivateFieldGet(this,l).get(t)._setVisible(a,!!e);_classPrivateFieldSet(this,o,null)}else(0,r.warn)(`Optional content group not found: ${t}`)}get hasInitialVisibility(){return this.getHash()===_classPrivateFieldGet(this,c)}getOrder(){return _classPrivateFieldGet(this,l).size?_classPrivateFieldGet(this,d)?_classPrivateFieldGet(this,d).slice():[..._classPrivateFieldGet(this,l).keys()]:null}getGroups(){return _classPrivateFieldGet(this,l).size>0?(0,r.objectFromMap)(_classPrivateFieldGet(this,l)):null}getGroup(t){return _classPrivateFieldGet(this,l).get(t)||null}getHash(){if(null!==_classPrivateFieldGet(this,o))return _classPrivateFieldGet(this,o);const t=new s.MurmurHash3_64;for(const[e,i]of _classPrivateFieldGet(this,l))t.update(`${e}:${i.visible}`);return _classPrivateFieldSet(this,o,t.hexdigest())}};function _evaluateVisibilityExpression2(t){const e=t.length;if(e<2)return!0;const i=t[0];for(let s=1;s<e;s++){const e=t[s];let a;if(Array.isArray(e))a=_classPrivateMethodGet(this,h,_evaluateVisibilityExpression2).call(this,e);else{if(!_classPrivateFieldGet(this,l).has(e)){(0,r.warn)(`Optional content group not found: ${e}`);return!0}a=_classPrivateFieldGet(this,l).get(e).visible}switch(i){case"And":if(!a)return!1;break;case"Or":if(a)return!0;break;case"Not":return!a;default:return!0}}return"And"===i}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFDataTransportStream=void 0;var r=i(1),s=i(136);e.PDFDataTransportStream=class PDFDataTransportStream{constructor(t,e){(0,r.assert)(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=t.progressiveDone||!1;this._contentDispositionFilename=t.contentDispositionFilename||null;const i=t.initialData;if((null==i?void 0:i.length)>0){const t=new Uint8Array(i).buffer;this._queuedChunks.push(t)}this._pdfDataRangeTransport=e;this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._contentLength=t.length;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener(((t,e)=>{this._onReceiveData({begin:t,chunk:e})}));this._pdfDataRangeTransport.addProgressListener(((t,e)=>{this._onProgress({loaded:t,total:e})}));this._pdfDataRangeTransport.addProgressiveReadListener((t=>{this._onReceiveData({chunk:t})}));this._pdfDataRangeTransport.addProgressiveDoneListener((()=>{this._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}_onReceiveData(t){const e=new Uint8Array(t.chunk).buffer;if(void 0===t.begin)this._fullRequestReader?this._fullRequestReader._enqueue(e):this._queuedChunks.push(e);else{const i=this._rangeReaders.some((function(i){if(i._begin!==t.begin)return!1;i._enqueue(e);return!0}));(0,r.assert)(i,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}_onProgress(t){if(void 0===t.total){var e,i;null===(e=this._rangeReaders[0])||void 0===e||null===(i=e.onProgress)||void 0===i||i.call(e,{loaded:t.loaded})}else{var r,s;null===(r=this._fullRequestReader)||void 0===r||null===(s=r.onProgress)||void 0===s||s.call(r,{loaded:t.loaded,total:t.total})}}_onProgressiveDone(){var t;null===(t=this._fullRequestReader)||void 0===t||t.progressiveDone();this._progressiveDone=!0}_removeRangeReader(t){const e=this._rangeReaders.indexOf(t);e>=0&&this._rangeReaders.splice(e,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const t=this._queuedChunks;this._queuedChunks=null;return new PDFDataTransportStreamReader(this,t,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new PDFDataTransportStreamRangeReader(this,t,e);this._pdfDataRangeTransport.requestDataRange(t,e);this._rangeReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeReaders.slice(0))e.cancel(t);this._pdfDataRangeTransport.abort()}};class PDFDataTransportStreamReader{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this._stream=t;this._done=i||!1;this._filename=(0,s.isPdfFile)(r)?r:null;this._queuedChunks=e||[];this._loaded=0;for(const t of this._queuedChunks)this._loaded+=t.byteLength;this._requests=[];this._headersReady=Promise.resolve();t._fullRequestReader=this;this.onProgress=null}_enqueue(t){if(!this._done){if(this._requests.length>0){this._requests.shift().resolve({value:t,done:!1})}else this._queuedChunks.push(t);this._loaded+=t.byteLength}}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0){return{value:this._queuedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,r.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class PDFDataTransportStreamRangeReader{constructor(t,e,i){this._stream=t;this._begin=e;this._end=i;this._queuedChunk=null;this._requests=[];this._done=!1;this.onProgress=null}_enqueue(t){if(!this._done){if(0===this._requests.length)this._queuedChunk=t;else{this._requests.shift().resolve({value:t,done:!1});for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0;this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,r.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._stream._removeRangeReader(this)}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaText=void 0;class XfaText{static textContent(t){const e=[],i={items:e,styles:Object.create(null)};!function walk(t){var i;if(!t)return;let r=null;const s=t.name;if("#text"===s)r=t.value;else{if(!XfaText.shouldBuildText(s))return;null!=t&&null!==(i=t.attributes)&&void 0!==i&&i.textContent?r=t.attributes.textContent:t.value&&(r=t.value)}null!==r&&e.push({str:r});if(t.children)for(const e of t.children)walk(e)}(t);return i}static shouldBuildText(t){return!("textarea"===t||"input"===t||"option"===t||"select"===t)}}e.XfaText=XfaText},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.NodeStandardFontDataFactory=e.NodeCanvasFactory=e.NodeCMapReaderFactory=void 0;var r=i(137);const fetchData=function(t){return new Promise(((e,i)=>{require("fs").readFile(t,((t,r)=>{!t&&r?e(new Uint8Array(r)):i(new Error(t))}))}))};class NodeCanvasFactory extends r.BaseCanvasFactory{_createCanvas(t,e){return require("canvas").createCanvas(t,e)}}e.NodeCanvasFactory=NodeCanvasFactory;class NodeCMapReaderFactory extends r.BaseCMapReaderFactory{_fetchData(t,e){return fetchData(t).then((t=>({cMapData:t,compressionType:e})))}}e.NodeCMapReaderFactory=NodeCMapReaderFactory;class NodeStandardFontDataFactory extends r.BaseStandardFontDataFactory{_fetchData(t){return fetchData(t)}}e.NodeStandardFontDataFactory=NodeStandardFontDataFactory},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationEditorLayer=void 0;var r=i(135),s=i(1),a=i(151),n=i(152);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakSet,m=new WeakSet,v=new WeakSet,_=new WeakSet;class AnnotationEditorLayer{constructor(t){_classPrivateMethodInitSpec(this,_);_classPrivateMethodInitSpec(this,v);_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,g);_classPrivateFieldInitSpec(this,o,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,l,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,c,{writable:!0,value:this.pointerup.bind(this)});_classPrivateFieldInitSpec(this,d,{writable:!0,value:this.pointerdown.bind(this)});_classPrivateFieldInitSpec(this,h,{writable:!0,value:new Map});_classPrivateFieldInitSpec(this,u,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,p,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,f,{writable:!0,value:void 0});if(!AnnotationEditorLayer._initialized){AnnotationEditorLayer._initialized=!0;a.FreeTextEditor.initialize(t.l10n);n.InkEditor.initialize(t.l10n);t.uiManager.registerEditorTypes([a.FreeTextEditor,n.InkEditor])}_classPrivateFieldSet(this,f,t.uiManager);this.annotationStorage=t.annotationStorage;this.pageIndex=t.pageIndex;this.div=t.div;_classPrivateFieldSet(this,o,t.accessibilityManager);_classPrivateFieldGet(this,f).addLayer(this)}updateToolbar(t){_classPrivateFieldGet(this,f).updateToolbar(t)}updateMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_classPrivateFieldGet(this,f).getMode();_classPrivateMethodGet(this,_,_cleanup2).call(this);if(t===s.AnnotationEditorType.INK){this.addInkEditorIfNeeded(!1);this.disableClick()}else this.enableClick();_classPrivateFieldGet(this,f).unselectAll();this.div.classList.toggle("freeTextEditing",t===s.AnnotationEditorType.FREETEXT);this.div.classList.toggle("inkEditing",t===s.AnnotationEditorType.INK)}addInkEditorIfNeeded(t){if(!t&&_classPrivateFieldGet(this,f).getMode()!==s.AnnotationEditorType.INK)return;if(!t)for(const t of _classPrivateFieldGet(this,h).values())if(t.isEmpty()){t.setInBackground();return}_classPrivateMethodGet(this,v,_createAndAddNewEditor2).call(this,{offsetX:0,offsetY:0}).setInBackground()}setEditingState(t){_classPrivateFieldGet(this,f).setEditingState(t)}addCommands(t){_classPrivateFieldGet(this,f).addCommands(t)}enable(){this.div.style.pointerEvents="auto";for(const t of _classPrivateFieldGet(this,h).values())t.enableEditing()}disable(){this.div.style.pointerEvents="none";for(const t of _classPrivateFieldGet(this,h).values())t.disableEditing()}setActiveEditor(t){_classPrivateFieldGet(this,f).getActive()!==t&&_classPrivateFieldGet(this,f).setActiveEditor(t)}enableClick(){this.div.addEventListener("pointerdown",_classPrivateFieldGet(this,d));this.div.addEventListener("pointerup",_classPrivateFieldGet(this,c))}disableClick(){this.div.removeEventListener("pointerdown",_classPrivateFieldGet(this,d));this.div.removeEventListener("pointerup",_classPrivateFieldGet(this,c))}attach(t){_classPrivateFieldGet(this,h).set(t.id,t)}detach(t){var e;_classPrivateFieldGet(this,h).delete(t.id);null===(e=_classPrivateFieldGet(this,o))||void 0===e||e.removePointerInTextLayer(t.contentDiv)}remove(t){_classPrivateFieldGet(this,f).removeEditor(t);this.detach(t);this.annotationStorage.remove(t.id);t.div.style.display="none";setTimeout((()=>{t.div.style.display="";t.div.remove();t.isAttachedToDOM=!1;document.activeElement===document.body&&_classPrivateFieldGet(this,f).focusMainContainer()}),0);_classPrivateFieldGet(this,p)||this.addInkEditorIfNeeded(!1)}add(t){_classPrivateMethodGet(this,g,_changeParent2).call(this,t);_classPrivateFieldGet(this,f).addEditor(t);this.attach(t);if(!t.isAttachedToDOM){const e=t.render();this.div.append(e);t.isAttachedToDOM=!0}this.moveEditorInDOM(t);t.onceAdded();this.addToAnnotationStorage(t)}moveEditorInDOM(t){var e;null===(e=_classPrivateFieldGet(this,o))||void 0===e||e.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addToAnnotationStorage(t){t.isEmpty()||this.annotationStorage.has(t.id)||this.annotationStorage.setValue(t.id,t)}addOrRebuild(t){t.needsToBeRebuilt()?t.rebuild():this.add(t)}addANewEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!0})}addUndoableEditor(t){this.addCommands({cmd:()=>{this.addOrRebuild(t)},undo:()=>{t.remove()},mustExec:!1})}getNextId(){return _classPrivateFieldGet(this,f).getId()}deserialize(t){switch(t.annotationType){case s.AnnotationEditorType.FREETEXT:return a.FreeTextEditor.deserialize(t,this);case s.AnnotationEditorType.INK:return n.InkEditor.deserialize(t,this)}return null}setSelected(t){_classPrivateFieldGet(this,f).setSelected(t)}toggleSelected(t){_classPrivateFieldGet(this,f).toggleSelected(t)}isSelected(t){return _classPrivateFieldGet(this,f).isSelected(t)}unselect(t){_classPrivateFieldGet(this,f).unselect(t)}pointerup(t){const e=r.KeyboardManager.platform.isMac;if(!(0!==t.button||t.ctrlKey&&e)&&t.target===this.div&&_classPrivateFieldGet(this,u)){_classPrivateFieldSet(this,u,!1);_classPrivateFieldGet(this,l)?_classPrivateMethodGet(this,v,_createAndAddNewEditor2).call(this,t):_classPrivateFieldSet(this,l,!0)}}pointerdown(t){const e=r.KeyboardManager.platform.isMac;if(0!==t.button||t.ctrlKey&&e)return;if(t.target!==this.div)return;_classPrivateFieldSet(this,u,!0);const i=_classPrivateFieldGet(this,f).getActive();_classPrivateFieldSet(this,l,!i||i.isEmpty())}drop(t){const e=t.dataTransfer.getData("text/plain"),i=_classPrivateFieldGet(this,f).getEditor(e);if(!i)return;t.preventDefault();t.dataTransfer.dropEffect="move";_classPrivateMethodGet(this,g,_changeParent2).call(this,i);const r=this.div.getBoundingClientRect(),s=t.clientX-r.x,a=t.clientY-r.y;i.translate(s-i.startX,a-i.startY);this.moveEditorInDOM(i);i.div.focus()}dragover(t){t.preventDefault()}destroy(){var t;(null===(t=_classPrivateFieldGet(this,f).getActive())||void 0===t?void 0:t.parent)===this&&_classPrivateFieldGet(this,f).setActiveEditor(null);for(const t of _classPrivateFieldGet(this,h).values()){var e;null===(e=_classPrivateFieldGet(this,o))||void 0===e||e.removePointerInTextLayer(t.contentDiv);t.isAttachedToDOM=!1;t.div.remove();t.parent=null}this.div=null;_classPrivateFieldGet(this,h).clear();_classPrivateFieldGet(this,f).removeLayer(this)}render(t){this.viewport=t.viewport;(0,r.bindEvents)(this,this.div,["dragover","drop"]);this.setDimensions();for(const t of _classPrivateFieldGet(this,f).getEditors(this.pageIndex))this.add(t);this.updateMode()}update(t){this.viewport=t.viewport;this.setDimensions();this.updateMode()}get scaleFactor(){return this.viewport.scale}get pageDimensions(){const[t,e,i,r]=this.viewport.viewBox;return[i-t,r-e]}get viewportBaseDimensions(){const{width:t,height:e,rotation:i}=this.viewport;return i%180==0?[t,e]:[e,t]}setDimensions(){const{width:t,height:e,rotation:i}=this.viewport,r=i%180!=0,s=Math.floor(t)+"px",a=Math.floor(e)+"px";this.div.style.width=r?a:s;this.div.style.height=r?s:a;this.div.setAttribute("data-main-rotation",i)}}e.AnnotationEditorLayer=AnnotationEditorLayer;function _changeParent2(t){var e;if(t.parent!==this){this.attach(t);t.pageIndex=this.pageIndex;null===(e=t.parent)||void 0===e||e.detach(t);t.parent=this;if(t.div&&t.isAttachedToDOM){t.div.remove();this.div.append(t.div)}}}function _createNewEditor2(t){switch(_classPrivateFieldGet(this,f).getMode()){case s.AnnotationEditorType.FREETEXT:return new a.FreeTextEditor(t);case s.AnnotationEditorType.INK:return new n.InkEditor(t)}return null}function _createAndAddNewEditor2(t){const e=this.getNextId(),i=_classPrivateMethodGet(this,m,_createNewEditor2).call(this,{parent:this,id:e,x:t.offsetX,y:t.offsetY});i&&this.add(i);return i}function _cleanup2(){_classPrivateFieldSet(this,p,!0);for(const t of _classPrivateFieldGet(this,h).values())t.isEmpty()&&t.remove();_classPrivateFieldSet(this,p,!1)}!function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}(AnnotationEditorLayer,"_initialized",!1)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.FreeTextEditor=void 0;var r=i(1),s=i(135),a=i(134);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}var n=new WeakMap,o=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakSet,f=new WeakSet,g=new WeakSet,m=new WeakSet;class FreeTextEditor extends a.AnnotationEditor{constructor(t){super({...t,name:"freeTextEditor"});_classPrivateMethodInitSpec(this,m);_classPrivateMethodInitSpec(this,g);_classPrivateMethodInitSpec(this,f);_classPrivateMethodInitSpec(this,p);_classPrivateFieldInitSpec(this,n,{writable:!0,value:this.editorDivBlur.bind(this)});_classPrivateFieldInitSpec(this,o,{writable:!0,value:this.editorDivFocus.bind(this)});_classPrivateFieldInitSpec(this,l,{writable:!0,value:this.editorDivKeydown.bind(this)});_classPrivateFieldInitSpec(this,c,{writable:!0,value:void 0});_classPrivateFieldInitSpec(this,d,{writable:!0,value:""});_classPrivateFieldInitSpec(this,h,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,u,{writable:!0,value:void 0});_classPrivateFieldSet(this,c,t.color||FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor);_classPrivateFieldSet(this,u,t.fontSize||FreeTextEditor._defaultFontSize)}static initialize(t){this._l10nPromise=new Map(["free_text2_default_content","editor_free_text2_aria_label"].map((e=>[e,t.get(e)])));const e=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(e.getPropertyValue("--freetext-padding"))}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:FreeTextEditor._defaultFontSize=e;break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:FreeTextEditor._defaultColor=e}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.FREETEXT_SIZE:_classPrivateMethodGet(this,p,_updateFontSize2).call(this,e);break;case r.AnnotationEditorParamsType.FREETEXT_COLOR:_classPrivateMethodGet(this,f,_updateColor2).call(this,e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,FreeTextEditor._defaultFontSize],[r.AnnotationEditorParamsType.FREETEXT_COLOR,FreeTextEditor._defaultColor||a.AnnotationEditor._defaultLineColor]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.FREETEXT_SIZE,_classPrivateFieldGet(this,u)],[r.AnnotationEditorParamsType.FREETEXT_COLOR,_classPrivateFieldGet(this,c)]]}getInitialTranslation(){return[-FreeTextEditor._internalPadding*this.parent.scaleFactor,-(FreeTextEditor._internalPadding+_classPrivateFieldGet(this,u))*this.parent.scaleFactor]}rebuild(){super.rebuild();null!==this.div&&(this.isAttachedToDOM||this.parent.add(this))}enableEditMode(){if(!this.isInEditMode()){this.parent.setEditingState(!1);this.parent.updateToolbar(r.AnnotationEditorType.FREETEXT);super.enableEditMode();this.enableEditing();this.overlayDiv.classList.remove("enabled");this.editorDiv.contentEditable=!0;this.div.draggable=!1;this.editorDiv.addEventListener("keydown",_classPrivateFieldGet(this,l));this.editorDiv.addEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.addEventListener("blur",_classPrivateFieldGet(this,n));this.parent.div.classList.remove("freeTextEditing")}}disableEditMode(){if(this.isInEditMode()){this.parent.setEditingState(!0);super.disableEditMode();this.disableEditing();this.overlayDiv.classList.add("enabled");this.editorDiv.contentEditable=!1;this.div.draggable=!0;this.editorDiv.removeEventListener("keydown",_classPrivateFieldGet(this,l));this.editorDiv.removeEventListener("focus",_classPrivateFieldGet(this,o));this.editorDiv.removeEventListener("blur",_classPrivateFieldGet(this,n));this.div.focus();this.isEditing=!1;this.parent.div.classList.add("freeTextEditing")}}focusin(t){super.focusin(t);t.target!==this.editorDiv&&this.editorDiv.focus()}onceAdded(){if(!this.width){this.enableEditMode();this.editorDiv.focus()}}isEmpty(){return!this.editorDiv||""===this.editorDiv.innerText.trim()}remove(){this.isEditing=!1;this.parent.setEditingState(!0);this.parent.div.classList.add("freeTextEditing");super.remove()}commit(){super.commit();if(!_classPrivateFieldGet(this,h)){_classPrivateFieldSet(this,h,!0);this.parent.addUndoableEditor(this)}this.disableEditMode();_classPrivateFieldSet(this,d,_classPrivateMethodGet(this,g,_extractText2).call(this).trimEnd());_classPrivateMethodGet(this,m,_setEditorDimensions2).call(this)}shouldGetKeyboardEvents(){return this.isInEditMode()}dblclick(t){this.enableEditMode();this.editorDiv.focus()}keydown(t){if(t.target===this.div&&"Enter"===t.key){this.enableEditMode();this.editorDiv.focus()}}editorDivKeydown(t){FreeTextEditor._keyboardManager.exec(this,t)}editorDivFocus(t){this.isEditing=!0}editorDivBlur(t){this.isEditing=!1}disableEditing(){this.editorDiv.setAttribute("role","comment");this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox");this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();this.editorDiv=document.createElement("div");this.editorDiv.className="internal";this.editorDiv.setAttribute("id",`${this.id}-editor`);this.enableEditing();FreeTextEditor._l10nPromise.get("editor_free_text2_aria_label").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("aria-label",t)}));FreeTextEditor._l10nPromise.get("free_text2_default_content").then((t=>{var e;return null===(e=this.editorDiv)||void 0===e?void 0:e.setAttribute("default-content",t)}));this.editorDiv.contentEditable=!0;const{style:i}=this.editorDiv;i.fontSize=`calc(${_classPrivateFieldGet(this,u)}px * var(--scale-factor))`;i.color=_classPrivateFieldGet(this,c);this.div.append(this.editorDiv);this.overlayDiv=document.createElement("div");this.overlayDiv.classList.add("overlay","enabled");this.div.append(this.overlayDiv);(0,s.bindEvents)(this,this.div,["dblclick","keydown"]);if(this.width){const[i,r]=this.parent.viewportBaseDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r);for(const t of _classPrivateFieldGet(this,d).split("\n")){const e=document.createElement("div");e.append(t?document.createTextNode(t):document.createElement("br"));this.editorDiv.append(e)}this.div.draggable=!0;this.editorDiv.contentEditable=!1}else{this.div.draggable=!1;this.editorDiv.contentEditable=!0}return this.div}get contentDiv(){return this.editorDiv}static deserialize(t,e){const i=super.deserialize(t,e);_classPrivateFieldSet(i,u,t.fontSize);_classPrivateFieldSet(i,c,r.Util.makeHexColor(...t.color));_classPrivateFieldSet(i,d,t.value);return i}serialize(){if(this.isEmpty())return null;const t=FreeTextEditor._internalPadding*this.parent.scaleFactor,e=this.getRect(t,t),i=a.AnnotationEditor._colorManager.convert(getComputedStyle(this.editorDiv).color);return{annotationType:r.AnnotationEditorType.FREETEXT,color:i,fontSize:_classPrivateFieldGet(this,u),value:_classPrivateFieldGet(this,d),pageIndex:this.parent.pageIndex,rect:e,rotation:this.rotation}}}e.FreeTextEditor=FreeTextEditor;function _updateFontSize2(t){const setFontsize=t=>{this.editorDiv.style.fontSize=`calc(${t}px * var(--scale-factor))`;this.translate(0,-(t-_classPrivateFieldGet(this,u))*this.parent.scaleFactor);_classPrivateFieldSet(this,u,t);_classPrivateMethodGet(this,m,_setEditorDimensions2).call(this)},e=_classPrivateFieldGet(this,u);this.parent.addCommands({cmd:()=>{setFontsize(t)},undo:()=>{setFontsize(e)},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){const e=_classPrivateFieldGet(this,c);this.parent.addCommands({cmd:()=>{_classPrivateFieldSet(this,c,t);this.editorDiv.style.color=t},undo:()=>{_classPrivateFieldSet(this,c,e);this.editorDiv.style.color=e},mustExec:!0,type:r.AnnotationEditorParamsType.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _extractText2(){const t=this.editorDiv.getElementsByTagName("div");if(0===t.length)return this.editorDiv.innerText;const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i].firstChild;"#text"===(null==r?void 0:r.nodeName)?e.push(r.data):e.push("")}return e.join("\n")}function _setEditorDimensions2(){const[t,e]=this.parent.viewportBaseDimensions,i=this.div.getBoundingClientRect();this.width=i.width/t;this.height=i.height/e}_defineProperty(FreeTextEditor,"_freeTextDefaultContent","");_defineProperty(FreeTextEditor,"_l10nPromise",void 0);_defineProperty(FreeTextEditor,"_internalPadding",0);_defineProperty(FreeTextEditor,"_defaultColor",null);_defineProperty(FreeTextEditor,"_defaultFontSize",10);_defineProperty(FreeTextEditor,"_keyboardManager",new s.KeyboardManager([[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],FreeTextEditor.prototype.commitOrRemove]]));_defineProperty(FreeTextEditor,"_type","freetext")},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.InkEditor=void 0;Object.defineProperty(e,"fitCurve",{enumerable:!0,get:function(){return a.fitCurve}});var r=i(1),s=i(134),a=i(153),n=i(135);function _classPrivateMethodInitSpec(t,e){_checkPrivateRedeclaration(t,e);e.add(t)}function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}function _classPrivateFieldInitSpec(t,e,i){_checkPrivateRedeclaration(t,e);e.set(t,i)}function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classStaticPrivateMethodGet(t,e,i){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return i}function _classPrivateFieldSet(t,e,i){!function _classApplyDescriptorSet(t,e,i){if(e.set)e.set.call(t,i);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=i}}(t,_classExtractFieldDescriptor(t,e,"set"),i);return i}function _classPrivateFieldGet(t,e){return function _classApplyDescriptorGet(t,e){if(e.get)return e.get.call(t);return e.value}(t,_classExtractFieldDescriptor(t,e,"get"))}function _classExtractFieldDescriptor(t,e,i){if(!e.has(t))throw new TypeError("attempted to "+i+" private field on non-instance");return e.get(t)}function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i}const o=16;var l=new WeakMap,c=new WeakMap,d=new WeakMap,h=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,g=new WeakMap,m=new WeakMap,v=new WeakMap,_=new WeakMap,b=new WeakMap,y=new WeakMap,A=new WeakMap,P=new WeakSet,S=new WeakSet,x=new WeakSet,w=new WeakSet,E=new WeakSet,C=new WeakSet,k=new WeakSet,T=new WeakSet,M=new WeakSet,R=new WeakSet,I=new WeakSet,D=new WeakSet,O=new WeakSet,L=new WeakSet,G=new WeakSet,N=new WeakSet,j=new WeakSet,U=new WeakSet,B=new WeakSet,W=new WeakSet,q=new WeakSet,z=new WeakSet;class InkEditor extends s.AnnotationEditor{constructor(t){super({...t,name:"inkEditor"});_classPrivateMethodInitSpec(this,z);_classPrivateMethodInitSpec(this,q);_classPrivateMethodInitSpec(this,W);_classPrivateMethodInitSpec(this,B);_classPrivateMethodInitSpec(this,U);_classPrivateMethodInitSpec(this,j);_classPrivateMethodInitSpec(this,N);_classPrivateMethodInitSpec(this,G);_classPrivateMethodInitSpec(this,L);_classPrivateMethodInitSpec(this,O);_classPrivateMethodInitSpec(this,D);_classPrivateMethodInitSpec(this,I);_classPrivateMethodInitSpec(this,R);_classPrivateMethodInitSpec(this,M);_classPrivateMethodInitSpec(this,T);_classPrivateMethodInitSpec(this,k);_classPrivateMethodInitSpec(this,C);_classPrivateMethodInitSpec(this,E);_classPrivateMethodInitSpec(this,w);_classPrivateMethodInitSpec(this,x);_classPrivateMethodInitSpec(this,S);_classPrivateMethodInitSpec(this,P);_classPrivateFieldInitSpec(this,l,{writable:!0,value:0});_classPrivateFieldInitSpec(this,c,{writable:!0,value:0});_classPrivateFieldInitSpec(this,d,{writable:!0,value:0});_classPrivateFieldInitSpec(this,h,{writable:!0,value:this.canvasPointermove.bind(this)});_classPrivateFieldInitSpec(this,u,{writable:!0,value:this.canvasPointerleave.bind(this)});_classPrivateFieldInitSpec(this,p,{writable:!0,value:this.canvasPointerup.bind(this)});_classPrivateFieldInitSpec(this,f,{writable:!0,value:this.canvasPointerdown.bind(this)});_classPrivateFieldInitSpec(this,g,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,m,{writable:!0,value:!1});_classPrivateFieldInitSpec(this,v,{writable:!0,value:null});_classPrivateFieldInitSpec(this,_,{writable:!0,value:null});_classPrivateFieldInitSpec(this,b,{writable:!0,value:0});_classPrivateFieldInitSpec(this,y,{writable:!0,value:0});_classPrivateFieldInitSpec(this,A,{writable:!0,value:null});this.color=t.color||null;this.thickness=t.thickness||null;this.opacity=t.opacity||null;this.paths=[];this.bezierPath2D=[];this.currentPath=[];this.scaleFactor=1;this.translationX=this.translationY=0;this.x=0;this.y=0}static initialize(t){this._l10nPromise=new Map(["editor_ink_canvas_aria_label","editor_ink2_aria_label"].map((e=>[e,t.get(e)])))}static updateDefaultParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:InkEditor._defaultThickness=e;break;case r.AnnotationEditorParamsType.INK_COLOR:InkEditor._defaultColor=e;break;case r.AnnotationEditorParamsType.INK_OPACITY:InkEditor._defaultOpacity=e/100}}updateParams(t,e){switch(t){case r.AnnotationEditorParamsType.INK_THICKNESS:_classPrivateMethodGet(this,P,_updateThickness2).call(this,e);break;case r.AnnotationEditorParamsType.INK_COLOR:_classPrivateMethodGet(this,S,_updateColor2).call(this,e);break;case r.AnnotationEditorParamsType.INK_OPACITY:_classPrivateMethodGet(this,x,_updateOpacity2).call(this,e)}}static get defaultPropertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,InkEditor._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*InkEditor._defaultOpacity)]]}get propertiesToUpdate(){return[[r.AnnotationEditorParamsType.INK_THICKNESS,this.thickness||InkEditor._defaultThickness],[r.AnnotationEditorParamsType.INK_COLOR,this.color||InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor],[r.AnnotationEditorParamsType.INK_OPACITY,Math.round(100*(this.opacity??InkEditor._defaultOpacity))]]}rebuild(){super.rebuild();if(null!==this.div){if(!this.canvas){_classPrivateMethodGet(this,I,_createCanvas2).call(this);_classPrivateMethodGet(this,D,_createObserver2).call(this)}if(!this.isAttachedToDOM){this.parent.add(this);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this)}_classPrivateMethodGet(this,q,_fitToContent2).call(this)}}remove(){if(null!==this.canvas){this.isEmpty()||this.commit();this.canvas.width=this.canvas.height=0;this.canvas.remove();this.canvas=null;_classPrivateFieldGet(this,_).disconnect();_classPrivateFieldSet(this,_,null);super.remove()}}enableEditMode(){if(!_classPrivateFieldGet(this,g)&&null!==this.canvas){super.enableEditMode();this.div.draggable=!1;this.canvas.addEventListener("pointerdown",_classPrivateFieldGet(this,f));this.canvas.addEventListener("pointerup",_classPrivateFieldGet(this,p))}}disableEditMode(){if(this.isInEditMode()&&null!==this.canvas){super.disableEditMode();this.div.draggable=!this.isEmpty();this.div.classList.remove("editing");this.canvas.removeEventListener("pointerdown",_classPrivateFieldGet(this,f));this.canvas.removeEventListener("pointerup",_classPrivateFieldGet(this,p))}}onceAdded(){this.div.draggable=!this.isEmpty()}isEmpty(){return 0===this.paths.length||1===this.paths.length&&0===this.paths[0].length}commit(){if(!_classPrivateFieldGet(this,g)){super.commit();this.isEditing=!1;this.disableEditMode();this.setInForeground();_classPrivateFieldSet(this,g,!0);this.div.classList.add("disabled");_classPrivateMethodGet(this,q,_fitToContent2).call(this,!0);this.parent.addInkEditorIfNeeded(!0);this.parent.moveEditorInDOM(this);this.div.focus()}}focusin(t){super.focusin(t);this.enableEditMode()}canvasPointerdown(t){if(0===t.button&&this.isInEditMode()&&!_classPrivateFieldGet(this,g)){this.setInForeground();"mouse"!==t.type&&this.div.focus();t.stopPropagation();this.canvas.addEventListener("pointerleave",_classPrivateFieldGet(this,u));this.canvas.addEventListener("pointermove",_classPrivateFieldGet(this,h));_classPrivateMethodGet(this,C,_startDrawing2).call(this,t.offsetX,t.offsetY)}}canvasPointermove(t){t.stopPropagation();_classPrivateMethodGet(this,k,_draw2).call(this,t.offsetX,t.offsetY)}canvasPointerup(t){if(0===t.button&&this.isInEditMode()&&0!==this.currentPath.length){t.stopPropagation();_classPrivateMethodGet(this,R,_endDrawing2).call(this,t);this.setInBackground()}}canvasPointerleave(t){_classPrivateMethodGet(this,R,_endDrawing2).call(this,t);this.setInBackground()}render(){if(this.div)return this.div;let t,e;if(this.width){t=this.x;e=this.y}super.render();InkEditor._l10nPromise.get("editor_ink2_aria_label").then((t=>{var e;return null===(e=this.div)||void 0===e?void 0:e.setAttribute("aria-label",t)}));const[i,r,s,a]=_classPrivateMethodGet(this,w,_getInitialBBox2).call(this);this.setAt(i,r,0,0);this.setDims(s,a);_classPrivateMethodGet(this,I,_createCanvas2).call(this);if(this.width){const[i,r]=this.parent.viewportBaseDimensions;this.setAt(t*i,e*r,this.width*i,this.height*r);_classPrivateFieldSet(this,m,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.setDims(this.width*i,this.height*r);_classPrivateMethodGet(this,M,_redraw2).call(this);_classPrivateMethodGet(this,z,_setMinDims2).call(this);this.div.classList.add("disabled")}else{this.div.classList.add("editing");this.enableEditMode()}_classPrivateMethodGet(this,D,_createObserver2).call(this);return this.div}setDimensions(t,e){const i=Math.round(t),r=Math.round(e);if(_classPrivateFieldGet(this,b)===i&&_classPrivateFieldGet(this,y)===r)return;_classPrivateFieldSet(this,b,i);_classPrivateFieldSet(this,y,r);this.canvas.style.visibility="hidden";if(_classPrivateFieldGet(this,l)&&Math.abs(_classPrivateFieldGet(this,l)-t/e)>.01){e=Math.ceil(t/_classPrivateFieldGet(this,l));this.setDims(t,e)}const[s,a]=this.parent.viewportBaseDimensions;this.width=t/s;this.height=e/a;_classPrivateFieldGet(this,g)&&_classPrivateMethodGet(this,L,_setScaleFactor2).call(this,t,e);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,M,_redraw2).call(this);this.canvas.style.visibility="visible"}static deserialize(t,e){const i=super.deserialize(t,e);i.thickness=t.thickness;i.color=r.Util.makeHexColor(...t.color);i.opacity=t.opacity;const[s,a]=e.pageDimensions,n=i.width*s,h=i.height*a,u=e.scaleFactor,p=t.thickness/2;_classPrivateFieldSet(i,l,n/h);_classPrivateFieldSet(i,g,!0);_classPrivateFieldSet(i,b,Math.round(n));_classPrivateFieldSet(i,y,Math.round(h));for(const{bezier:e}of t.paths){const t=[];i.paths.push(t);let r=u*(e[0]-p),s=u*(h-e[1]-p);for(let i=2,a=e.length;i<a;i+=6){const a=u*(e[i]-p),n=u*(h-e[i+1]-p),o=u*(e[i+2]-p),l=u*(h-e[i+3]-p),c=u*(e[i+4]-p),d=u*(h-e[i+5]-p);t.push([[r,s],[a,n],[o,l],[c,d]]);r=c;s=d}const a=_classStaticPrivateMethodGet(this,InkEditor,_buildPath2D).call(this,t);i.bezierPath2D.push(a)}const f=_classPrivateMethodGet(i,B,_getBbox2).call(i);_classPrivateFieldSet(i,d,Math.max(o,f[2]-f[0]));_classPrivateFieldSet(i,c,Math.max(o,f[3]-f[1]));_classPrivateMethodGet(i,L,_setScaleFactor2).call(i,n,h);return i}serialize(){if(this.isEmpty())return null;const t=this.getRect(0,0),e=this.rotation%180==0?t[3]-t[1]:t[2]-t[0],i=s.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);return{annotationType:r.AnnotationEditorType.INK,color:i,thickness:this.thickness,opacity:this.opacity,paths:_classPrivateMethodGet(this,N,_serializePaths2).call(this,this.scaleFactor/this.parent.scaleFactor,this.translationX,this.translationY,e),pageIndex:this.parent.pageIndex,rect:t,rotation:this.rotation}}}e.InkEditor=InkEditor;function _updateThickness2(t){const e=this.thickness;this.parent.addCommands({cmd:()=>{this.thickness=t;_classPrivateMethodGet(this,q,_fitToContent2).call(this)},undo:()=>{this.thickness=e;_classPrivateMethodGet(this,q,_fitToContent2).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}function _updateColor2(t){const e=this.color;this.parent.addCommands({cmd:()=>{this.color=t;_classPrivateMethodGet(this,M,_redraw2).call(this)},undo:()=>{this.color=e;_classPrivateMethodGet(this,M,_redraw2).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}function _updateOpacity2(t){t/=100;const e=this.opacity;this.parent.addCommands({cmd:()=>{this.opacity=t;_classPrivateMethodGet(this,M,_redraw2).call(this)},undo:()=>{this.opacity=e;_classPrivateMethodGet(this,M,_redraw2).call(this)},mustExec:!0,type:r.AnnotationEditorParamsType.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}function _getInitialBBox2(){const{width:t,height:e,rotation:i}=this.parent.viewport;switch(i){case 90:return[0,t,t,e];case 180:return[t,e,t,e];case 270:return[e,0,t,e];default:return[0,0,t,e]}}function _setStroke2(){this.ctx.lineWidth=this.thickness*this.parent.scaleFactor/this.scaleFactor;this.ctx.lineCap="round";this.ctx.lineJoin="round";this.ctx.miterLimit=10;this.ctx.strokeStyle=`${this.color}${(0,n.opacityToHex)(this.opacity)}`}function _startDrawing2(t,e){this.isEditing=!0;if(!_classPrivateFieldGet(this,m)){_classPrivateFieldSet(this,m,!0);_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);this.thickness||(this.thickness=InkEditor._defaultThickness);this.color||(this.color=InkEditor._defaultColor||s.AnnotationEditor._defaultLineColor);this.opacity??(this.opacity=InkEditor._defaultOpacity)}this.currentPath.push([t,e]);_classPrivateFieldSet(this,v,null);_classPrivateMethodGet(this,E,_setStroke2).call(this);this.ctx.beginPath();this.ctx.moveTo(t,e);_classPrivateFieldSet(this,A,(()=>{if(_classPrivateFieldGet(this,A)){if(_classPrivateFieldGet(this,v)){if(this.isEmpty()){this.ctx.setTransform(1,0,0,1,0,0);this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}else _classPrivateMethodGet(this,M,_redraw2).call(this);this.ctx.lineTo(..._classPrivateFieldGet(this,v));_classPrivateFieldSet(this,v,null);this.ctx.stroke()}window.requestAnimationFrame(_classPrivateFieldGet(this,A))}}));window.requestAnimationFrame(_classPrivateFieldGet(this,A))}function _draw2(t,e){const[i,r]=this.currentPath.at(-1);if(t!==i||e!==r){this.currentPath.push([t,e]);_classPrivateFieldSet(this,v,[t,e])}}function _stopDrawing2(t,e){this.ctx.closePath();_classPrivateFieldSet(this,A,null);t=Math.min(Math.max(t,0),this.canvas.width);e=Math.min(Math.max(e,0),this.canvas.height);const[i,r]=this.currentPath.at(-1);t===i&&e===r||this.currentPath.push([t,e]);let s;if(1!==this.currentPath.length)s=(0,a.fitCurve)(this.currentPath,30,null);else{const i=[t,e];s=[[i,i.slice(),i.slice(),i]]}const n=_classStaticPrivateMethodGet(InkEditor,InkEditor,_buildPath2D).call(InkEditor,s);this.currentPath.length=0;this.parent.addCommands({cmd:()=>{this.paths.push(s);this.bezierPath2D.push(n);this.rebuild()},undo:()=>{this.paths.pop();this.bezierPath2D.pop();if(0===this.paths.length)this.remove();else{if(!this.canvas){_classPrivateMethodGet(this,I,_createCanvas2).call(this);_classPrivateMethodGet(this,D,_createObserver2).call(this)}_classPrivateMethodGet(this,q,_fitToContent2).call(this)}},mustExec:!0})}function _redraw2(){if(this.isEmpty()){_classPrivateMethodGet(this,G,_updateTransform2).call(this);return}_classPrivateMethodGet(this,E,_setStroke2).call(this);const{canvas:t,ctx:e}=this;e.setTransform(1,0,0,1,0,0);e.clearRect(0,0,t.width,t.height);_classPrivateMethodGet(this,G,_updateTransform2).call(this);for(const t of this.bezierPath2D)e.stroke(t)}function _endDrawing2(t){_classPrivateMethodGet(this,T,_stopDrawing2).call(this,t.offsetX,t.offsetY);this.canvas.removeEventListener("pointerleave",_classPrivateFieldGet(this,u));this.canvas.removeEventListener("pointermove",_classPrivateFieldGet(this,h));this.parent.addToAnnotationStorage(this)}function _createCanvas2(){this.canvas=document.createElement("canvas");this.canvas.width=this.canvas.height=0;this.canvas.className="inkEditorCanvas";InkEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((t=>{var e;return null===(e=this.canvas)||void 0===e?void 0:e.setAttribute("aria-label",t)}));this.div.append(this.canvas);this.ctx=this.canvas.getContext("2d")}function _createObserver2(){_classPrivateFieldSet(this,_,new ResizeObserver((t=>{const e=t[0].contentRect;e.width&&e.height&&this.setDimensions(e.width,e.height)})));_classPrivateFieldGet(this,_).observe(this.div)}function _setCanvasDims2(){if(!_classPrivateFieldGet(this,m))return;const[t,e]=this.parent.viewportBaseDimensions;this.canvas.width=Math.ceil(this.width*t);this.canvas.height=Math.ceil(this.height*e);_classPrivateMethodGet(this,G,_updateTransform2).call(this)}function _setScaleFactor2(t,e){const i=_classPrivateMethodGet(this,W,_getPadding2).call(this),r=(t-i)/_classPrivateFieldGet(this,d),s=(e-i)/_classPrivateFieldGet(this,c);this.scaleFactor=Math.min(r,s)}function _updateTransform2(){const t=_classPrivateMethodGet(this,W,_getPadding2).call(this)/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+t,this.translationY*this.scaleFactor+t)}function _buildPath2D(t){const e=new Path2D;for(let i=0,r=t.length;i<r;i++){const[r,s,a,n]=t[i];0===i&&e.moveTo(...r);e.bezierCurveTo(s[0],s[1],a[0],a[1],n[0],n[1])}return e}function _serializePaths2(t,e,i,r){const s=[],a=this.thickness/2;let n,o;for(const l of this.paths){n=[];o=[];for(let s=0,c=l.length;s<c;s++){const[c,d,h,u]=l[s],p=t*(c[0]+e)+a,f=r-t*(c[1]+i)-a,g=t*(d[0]+e)+a,m=r-t*(d[1]+i)-a,v=t*(h[0]+e)+a,_=r-t*(h[1]+i)-a,b=t*(u[0]+e)+a,y=r-t*(u[1]+i)-a;if(0===s){n.push(p,f);o.push(p,f)}n.push(g,m,v,_,b,y);_classPrivateMethodGet(this,j,_extractPointsOnBezier2).call(this,p,f,g,m,v,_,b,y,4,o)}s.push({bezier:n,points:o})}return s}function _extractPointsOnBezier2(t,e,i,r,s,a,n,o,l,c){if(_classPrivateMethodGet(this,U,_isAlmostFlat2).call(this,t,e,i,r,s,a,n,o))c.push(n,o);else{for(let d=1;d<l-1;d++){const h=d/l,u=1-h;let p=h*t+u*i,f=h*e+u*r,g=h*i+u*s,m=h*r+u*a;p=h*p+u*g;f=h*f+u*m;g=h*g+u*(h*s+u*n);m=h*m+u*(h*a+u*o);p=h*p+u*g;f=h*f+u*m;c.push(p,f)}c.push(n,o)}}function _isAlmostFlat2(t,e,i,r,s,a,n,o){const l=(3*i-2*t-n)**2,c=(3*r-2*e-o)**2,d=(3*s-t-2*n)**2,h=(3*a-e-2*o)**2;return Math.max(l,d)+Math.max(c,h)<=10}function _getBbox2(){let t=1/0,e=-1/0,i=1/0,s=-1/0;for(const a of this.paths)for(const[n,o,l,c]of a){const a=r.Util.bezierBoundingBox(...n,...o,...l,...c);t=Math.min(t,a[0]);i=Math.min(i,a[1]);e=Math.max(e,a[2]);s=Math.max(s,a[3])}return[t,i,e,s]}function _getPadding2(){return _classPrivateFieldGet(this,g)?Math.ceil(this.thickness*this.parent.scaleFactor):0}function _fitToContent2(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.isEmpty())return;if(!_classPrivateFieldGet(this,g)){_classPrivateMethodGet(this,M,_redraw2).call(this);return}const e=_classPrivateMethodGet(this,B,_getBbox2).call(this),i=_classPrivateMethodGet(this,W,_getPadding2).call(this);_classPrivateFieldSet(this,d,Math.max(o,e[2]-e[0]));_classPrivateFieldSet(this,c,Math.max(o,e[3]-e[1]));const r=Math.ceil(i+_classPrivateFieldGet(this,d)*this.scaleFactor),s=Math.ceil(i+_classPrivateFieldGet(this,c)*this.scaleFactor),[a,n]=this.parent.viewportBaseDimensions;this.width=r/a;this.height=s/n;_classPrivateFieldSet(this,l,r/s);_classPrivateMethodGet(this,z,_setMinDims2).call(this);const h=this.translationX,u=this.translationY;this.translationX=-e[0];this.translationY=-e[1];_classPrivateMethodGet(this,O,_setCanvasDims2).call(this);_classPrivateMethodGet(this,M,_redraw2).call(this);_classPrivateFieldSet(this,b,r);_classPrivateFieldSet(this,y,s);this.setDims(r,s);const p=t?i/this.scaleFactor/2:0;this.translate(h-this.translationX-p,u-this.translationY-p)}function _setMinDims2(){const{style:t}=this.div;if(_classPrivateFieldGet(this,l)>=1){t.minHeight="16px";t.minWidth=`${Math.round(_classPrivateFieldGet(this,l)*o)}px`}else{t.minWidth="16px";t.minHeight=`${Math.round(o/_classPrivateFieldGet(this,l))}px`}}_defineProperty(InkEditor,"_defaultColor",null);_defineProperty(InkEditor,"_defaultOpacity",1);_defineProperty(InkEditor,"_defaultThickness",1);_defineProperty(InkEditor,"_l10nPromise",void 0);_defineProperty(InkEditor,"_type","ink")},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.fitCurve=void 0;const r=i(154);e.fitCurve=r},t=>{"use strict";function fitCubic(t,e,i,r,s){var a,n,o,l,c,d,h,u,p,f,g,m,v;if(2===t.length){m=maths.vectorLen(maths.subtract(t[0],t[1]))/3;return[a=[t[0],maths.addArrays(t[0],maths.mulItems(e,m)),maths.addArrays(t[1],maths.mulItems(i,m)),t[1]]]}n=function chordLengthParameterize(t){var e,i,r,s=[];t.forEach(((t,a)=>{e=a?i+maths.vectorLen(maths.subtract(t,r)):0;s.push(e);i=e;r=t}));return s=s.map((t=>t/i))}(t);[a,l,d]=generateAndReport(t,n,n,e,i,s);if(0===l||l<r)return[a];if(l<r*r){o=n;c=l;h=d;for(v=0;v<20;v++){o=reparameterize(a,t,o);[a,l,d]=generateAndReport(t,n,o,e,i,s);if(l<r)return[a];if(d===h){let t=l/c;if(t>.9999&&t<1.0001)break}c=l;h=d}}g=[];if((u=maths.subtract(t[d-1],t[d+1])).every((t=>0===t))){u=maths.subtract(t[d-1],t[d]);[u[0],u[1]]=[-u[1],u[0]]}p=maths.normalize(u);f=maths.mulItems(p,-1);return g=(g=g.concat(fitCubic(t.slice(0,d+1),e,p,r,s))).concat(fitCubic(t.slice(d),f,i,r,s))}function generateAndReport(t,e,i,r,s,a){var n,o,l;n=function generateBezier(t,e,i,r){var s,a,n,o,l,c,d,h,u,p,f,g,m,v,_,b,y,A=t[0],P=t[t.length-1];s=[A,null,null,P];a=maths.zeros_Xx2x2(e.length);for(m=0,v=e.length;m<v;m++){y=1-(b=e[m]);(n=a[m])[0]=maths.mulItems(i,3*b*(y*y));n[1]=maths.mulItems(r,3*y*(b*b))}o=[[0,0],[0,0]];l=[0,0];for(m=0,v=t.length;m<v;m++){b=e[m];n=a[m];o[0][0]+=maths.dot(n[0],n[0]);o[0][1]+=maths.dot(n[0],n[1]);o[1][0]+=maths.dot(n[0],n[1]);o[1][1]+=maths.dot(n[1],n[1]);_=maths.subtract(t[m],bezier.q([A,A,P,P],b));l[0]+=maths.dot(n[0],_);l[1]+=maths.dot(n[1],_)}c=o[0][0]*o[1][1]-o[1][0]*o[0][1];d=o[0][0]*l[1]-o[1][0]*l[0];h=l[0]*o[1][1]-l[1]*o[0][1];u=0===c?0:h/c;p=0===c?0:d/c;g=maths.vectorLen(maths.subtract(A,P));if(u<(f=1e-6*g)||p<f){s[1]=maths.addArrays(A,maths.mulItems(i,g/3));s[2]=maths.addArrays(P,maths.mulItems(r,g/3))}else{s[1]=maths.addArrays(A,maths.mulItems(i,u));s[2]=maths.addArrays(P,maths.mulItems(r,p))}return s}(t,i,r,s);[o,l]=function computeMaxError(t,e,i){var r,s,a,n,o,l,c,d;s=0;a=Math.floor(t.length/2);const h=mapTtoRelativeDistances(e,10);for(o=0,l=t.length;o<l;o++){c=t[o];d=find_t(e,i[o],h,10);if((r=(n=maths.subtract(bezier.q(e,d),c))[0]*n[0]+n[1]*n[1])>s){s=r;a=o}}return[s,a]}(t,n,e);a&&a({bez:n,points:t,params:e,maxErr:o,maxPoint:l});return[n,o,l]}function reparameterize(t,e,i){return i.map(((i,r)=>newtonRaphsonRootFind(t,e[r],i)))}function newtonRaphsonRootFind(t,e,i){var r=maths.subtract(bezier.q(t,i),e),s=bezier.qprime(t,i),a=maths.mulMatrix(r,s),n=maths.sum(maths.squareItems(s))+2*maths.mulMatrix(r,bezier.qprimeprime(t,i));return 0===n?i:i-a/n}var mapTtoRelativeDistances=function(t,e){for(var i,r=[0],s=t[0],a=0,n=1;n<=e;n++){i=bezier.q(t,n/e);a+=maths.vectorLen(maths.subtract(i,s));r.push(a);s=i}return r=r.map((t=>t/a))};function find_t(t,e,i,r){if(e<0)return 0;if(e>1)return 1;for(var s,a,n,o,l=1;l<=r;l++)if(e<=i[l]){n=(l-1)/r;a=l/r;o=(e-(s=i[l-1]))/(i[l]-s)*(a-n)+n;break}return o}function createTangent(t,e){return maths.normalize(maths.subtract(t,e))}class maths{static zeros_Xx2x2(t){for(var e=[];t--;)e.push([0,0]);return e}static mulItems(t,e){return t.map((t=>t*e))}static mulMatrix(t,e){return t.reduce(((t,i,r)=>t+i*e[r]),0)}static subtract(t,e){return t.map(((t,i)=>t-e[i]))}static addArrays(t,e){return t.map(((t,i)=>t+e[i]))}static addItems(t,e){return t.map((t=>t+e))}static sum(t){return t.reduce(((t,e)=>t+e))}static dot(t,e){return maths.mulMatrix(t,e)}static vectorLen(t){return Math.hypot(...t)}static divItems(t,e){return t.map((t=>t/e))}static squareItems(t){return t.map((t=>t*t))}static normalize(t){return this.divItems(t,this.vectorLen(t))}}class bezier{static q(t,e){var i=1-e,r=maths.mulItems(t[0],i*i*i),s=maths.mulItems(t[1],3*i*i*e),a=maths.mulItems(t[2],3*i*e*e),n=maths.mulItems(t[3],e*e*e);return maths.addArrays(maths.addArrays(r,s),maths.addArrays(a,n))}static qprime(t,e){var i=1-e,r=maths.mulItems(maths.subtract(t[1],t[0]),3*i*i),s=maths.mulItems(maths.subtract(t[2],t[1]),6*i*e),a=maths.mulItems(maths.subtract(t[3],t[2]),3*e*e);return maths.addArrays(maths.addArrays(r,s),a)}static qprimeprime(t,e){return maths.addArrays(maths.mulItems(maths.addArrays(maths.subtract(t[2],maths.mulItems(t[1],2)),t[0]),6*(1-e)),maths.mulItems(maths.addArrays(maths.subtract(t[3],maths.mulItems(t[2],2)),t[1]),6*e))}}t.exports=function fitCurve(t,e,i){if(!Array.isArray(t))throw new TypeError("First argument should be an array");t.forEach((e=>{if(!Array.isArray(e)||e.some((t=>"number"!=typeof t))||e.length!==t[0].length)throw Error("Each point should be an array of numbers. Each point should have the same amount of numbers.")}));if((t=t.filter(((e,i)=>0===i||!e.every(((e,r)=>e===t[i-1][r]))))).length<2)return[];const r=t.length,s=createTangent(t[1],t[0]),a=createTangent(t[r-2],t[r-1]);return fitCubic(t,s,a,e,i)};t.exports.fitCubic=fitCubic;t.exports.createTangent=createTangent},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AnnotationLayer=void 0;var r=i(1),s=i(136),a=i(133),n=i(156),o=i(157);function _classStaticPrivateMethodGet(t,e,i){!function _classCheckPrivateStaticAccess(t,e){if(t!==e)throw new TypeError("Private static access of wrong provenance")}(t,e);return i}function _classPrivateMethodInitSpec(t,e){!function _checkPrivateRedeclaration(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e);e.add(t)}const l=1e3,c=new WeakSet;function getRectDims(t){return{width:t[2]-t[0],height:t[3]-t[1]}}class AnnotationElementFactory{static create(t){switch(t.data.annotationType){case r.AnnotationType.LINK:return new LinkAnnotationElement(t);case r.AnnotationType.TEXT:return new TextAnnotationElement(t);case r.AnnotationType.WIDGET:switch(t.data.fieldType){case"Tx":return new TextWidgetAnnotationElement(t);case"Btn":return t.data.radioButton?new RadioButtonWidgetAnnotationElement(t):t.data.checkBox?new CheckboxWidgetAnnotationElement(t):new PushButtonWidgetAnnotationElement(t);case"Ch":return new ChoiceWidgetAnnotationElement(t)}return new WidgetAnnotationElement(t);case r.AnnotationType.POPUP:return new PopupAnnotationElement(t);case r.AnnotationType.FREETEXT:return new FreeTextAnnotationElement(t);case r.AnnotationType.LINE:return new LineAnnotationElement(t);case r.AnnotationType.SQUARE:return new SquareAnnotationElement(t);case r.AnnotationType.CIRCLE:return new CircleAnnotationElement(t);case r.AnnotationType.POLYLINE:return new PolylineAnnotationElement(t);case r.AnnotationType.CARET:return new CaretAnnotationElement(t);case r.AnnotationType.INK:return new InkAnnotationElement(t);case r.AnnotationType.POLYGON:return new PolygonAnnotationElement(t);case r.AnnotationType.HIGHLIGHT:return new HighlightAnnotationElement(t);case r.AnnotationType.UNDERLINE:return new UnderlineAnnotationElement(t);case r.AnnotationType.SQUIGGLY:return new SquigglyAnnotationElement(t);case r.AnnotationType.STRIKEOUT:return new StrikeOutAnnotationElement(t);case r.AnnotationType.STAMP:return new StampAnnotationElement(t);case r.AnnotationType.FILEATTACHMENT:return new FileAttachmentAnnotationElement(t);default:return new AnnotationElement(t)}}}class AnnotationElement{constructor(t){let{isRenderable:e=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.isRenderable=e;this.data=t.data;this.layer=t.layer;this.page=t.page;this.viewport=t.viewport;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._mouseState=t.mouseState;e&&(this.container=this._createContainer(i));r&&(this.quadrilaterals=this._createQuadrilaterals(i))}_createContainer(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this.data,i=this.page,s=this.viewport,a=document.createElement("section"),{width:n,height:o}=getRectDims(e.rect),[l,c,d,h]=s.viewBox,u=d-l,p=h-c;a.setAttribute("data-annotation-id",e.id);const f=r.Util.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]]);if(!t&&e.borderStyle.width>0){a.style.borderWidth=`${e.borderStyle.width}px`;const t=e.borderStyle.horizontalCornerRadius,i=e.borderStyle.verticalCornerRadius;if(t>0||i>0){const e=`calc(${t}px * var(--scale-factor)) / calc(${i}px * var(--scale-factor))`;a.style.borderRadius=e}else if(this instanceof RadioButtonWidgetAnnotationElement){const t=`calc(${n}px * var(--scale-factor)) / calc(${o}px * var(--scale-factor))`;a.style.borderRadius=t}switch(e.borderStyle.style){case r.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case r.AnnotationBorderStyleType.DASHED:a.style.borderStyle="dashed";break;case r.AnnotationBorderStyleType.BEVELED:(0,r.warn)("Unimplemented border style: beveled");break;case r.AnnotationBorderStyleType.INSET:(0,r.warn)("Unimplemented border style: inset");break;case r.AnnotationBorderStyleType.UNDERLINE:a.style.borderBottomStyle="solid"}const s=e.borderColor||null;s?a.style.borderColor=r.Util.makeHexColor(0|s[0],0|s[1],0|s[2]):a.style.borderWidth=0}a.style.left=100*(f[0]-l)/u+"%";a.style.top=100*(f[1]-c)/p+"%";const{rotation:g}=e;if(e.hasOwnCanvas||0===g){a.style.width=100*n/u+"%";a.style.height=100*o/p+"%"}else this.setRotation(g,a);return a}setRotation(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.container;const[i,r,s,a]=this.viewport.viewBox,n=s-i,o=a-r,{width:l,height:c}=getRectDims(this.data.rect);let d,h;if(t%180==0){d=100*l/n;h=100*c/o}else{d=100*c/n;h=100*l/o}e.style.width=`${d}%`;e.style.height=`${h}%`;e.setAttribute("data-main-rotation",(360-t)%360)}get _commonActions(){const setColor=(t,e,i)=>{const r=i.detail[t];i.target.style[e]=n.ColorConverters[`${r[0]}_HTML`](r.slice(1))};return(0,r.shadow)(this,"_commonActions",{display:t=>{const e=t.detail.display%2==1;this.container.style.visibility=e?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:e,print:0===t.detail.display||3===t.detail.display})},print:t=>{this.annotationStorage.setValue(this.data.id,{print:t.detail.print})},hidden:t=>{this.container.style.visibility=t.detail.hidden?"hidden":"visible";this.annotationStorage.setValue(this.data.id,{hidden:t.detail.hidden})},focus:t=>{setTimeout((()=>t.target.focus({preventScroll:!1})),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.detail.readonly?t.target.setAttribute("readonly",""):t.target.removeAttribute("readonly")},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{setColor("bgColor","backgroundColor",t)},fillColor:t=>{setColor("fillColor","backgroundColor",t)},fgColor:t=>{setColor("fgColor","color",t)},textColor:t=>{setColor("textColor","color",t)},borderColor:t=>{setColor("borderColor","borderColor",t)},strokeColor:t=>{setColor("strokeColor","borderColor",t)},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 r of Object.keys(e.detail)){const s=t[r]||i[r];null==s||s(e)}}_setDefaultPropertiesFromJS(t){if(!this.enableScripting)return;const e=this.annotationStorage.getRawValue(this.data.id);if(!e)return;const i=this._commonActions;for(const[r,s]of Object.entries(e)){const a=i[r];if(a){a({detail:{[r]:s},target:t});delete e[r]}}}_createQuadrilaterals(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.data.quadPoints)return null;const e=[],i=this.data.rect;for(const i of this.data.quadPoints){this.data.rect=[i[2].x,i[2].y,i[1].x,i[1].y];e.push(this._createContainer(t))}this.data.rect=i;return e}_createPopup(t,e){let i=this.container;if(this.quadrilaterals){t=t||this.quadrilaterals;i=this.quadrilaterals[0]}if(!t){(t=document.createElement("div")).className="popupTriggerArea";i.append(t)}const r=new PopupElement({container:i,trigger:t,color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,hideWrapper:!0}).render();r.style.left="100%";i.append(r)}_renderQuadrilaterals(t){for(const e of this.quadrilaterals)e.className=t;return this.quadrilaterals}render(){(0,r.unreachable)("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:a,exportValues:n}of s){if(-1===t)continue;if(a===e)continue;const s="string"==typeof n?n:null,o=document.querySelector(`[data-element-id="${a}"]`);!o||c.has(o)?i.push({id:a,exportValue:s,domElement:o}):(0,r.warn)(`_getElementsByName - element not allowed: ${a}`)}return i}for(const r of document.getElementsByName(t)){const{id:t,exportValue:s}=r;t!==e&&(c.has(r)&&i.push({id:t,exportValue:s,domElement:r}))}return i}static get platform(){const t="undefined"!=typeof navigator?navigator.platform:"";return(0,r.shadow)(this,"platform",{isWin:t.includes("Win"),isMac:t.includes("Mac")})}}var d=new WeakSet;class LinkAnnotationElement extends AnnotationElement{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;super(t,{isRenderable:!0,ignoreBorder:!(null==e||!e.ignoreBorder),createQuadrilaterals:!0});_classPrivateMethodInitSpec(this,d);this.isTooltipOnly=t.data.isTooltipOnly}render(){const{data:t,linkService:e}=this,i=document.createElement("a");i.setAttribute("data-element-id",t.id);let r=!1;if(t.url){e.addLinkAttributes(i,t.url,t.newWindow);r=!0}else if(t.action){this._bindNamedAction(i,t.action);r=!0}else if(t.setOCGState){(function _classPrivateMethodGet(t,e,i){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return i})(this,d,_bindSetOCGState2).call(this,i,t.setOCGState);r=!0}else if(t.dest){this._bindLink(i,t.dest);r=!0}else{if(t.actions&&(t.actions.Action||t.actions["Mouse Up"]||t.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){this._bindJSAction(i,t);r=!0}if(t.resetForm){this._bindResetFormAction(i,t.resetForm);r=!0}else if(this.isTooltipOnly&&!r){this._bindLink(i,"");r=!0}}if(this.quadrilaterals)return this._renderQuadrilaterals("linkAnnotation").map(((t,e)=>{const r=0===e?i:i.cloneNode();t.append(r);return t}));this.container.className="linkAnnotation";r&&this.container.append(i);return this.container}_bindLink(t,e){t.href=this.linkService.getDestinationHash(e);t.onclick=()=>{e&&this.linkService.goToDestination(e);return!1};(e||""===e)&&(t.className="internalLink")}_bindNamedAction(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeNamedAction(e);return!1};t.className="internalLink"}_bindJSAction(t,e){t.href=this.linkService.getAnchorUrl("");const i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const r of Object.keys(e.actions)){const s=i.get(r);s&&(t[s]=()=>{var t;null===(t=this.linkService.eventBus)||void 0===t||t.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e.id,name:r}});return!1})}t.onclick||(t.onclick=()=>!1);t.className="internalLink"}_bindResetFormAction(t,e){const i=t.onclick;i||(t.href=this.linkService.getAnchorUrl(""));t.className="internalLink";if(this._fieldObjects)t.onclick=()=>{null==i||i();const{fields:t,refs:s,include:a}=e,n=[];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)===a&&n.push(i)}else for(const t of Object.values(this._fieldObjects))n.push(...t);const o=this.annotationStorage,l=[];for(const t of n){const{id:e}=t;l.push(e);switch(t.type){case"text":{const i=t.defaultValue||"";o.setValue(e,{value:i});break}case"checkbox":case"radiobutton":{const i=t.defaultValue===t.exportValues;o.setValue(e,{value:i});break}case"combobox":case"listbox":{const i=t.defaultValue||"";o.setValue(e,{value:i});break}default:continue}const i=document.querySelector(`[data-element-id="${e}"]`);i&&(c.has(i)?i.dispatchEvent(new Event("resetform")):(0,r.warn)(`_bindResetFormAction - element not allowed: ${e}`))}if(this.enableScripting){var d;null===(d=this.linkService.eventBus)||void 0===d||d.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:l,name:"ResetForm"}})}return!1};else{(0,r.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.');i||(t.onclick=()=>!1)}}}function _bindSetOCGState2(t,e){t.href=this.linkService.getAnchorUrl("");t.onclick=()=>{this.linkService.executeSetOCGState(e);return!1};t.className="internalLink"}class TextAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str)})}render(){this.container.className="textAnnotation";const t=document.createElement("img");t.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";t.alt="[{{type}} Annotation]";t.dataset.l10nId="text_annotation_type";t.dataset.l10nArgs=JSON.stringify({type:this.data.name});this.data.hasPopup||this._createPopup(t,this.data);this.container.append(t);return this.container}}class WidgetAnnotationElement extends AnnotationElement{render(){this.data.alternativeText&&(this.container.title=this.data.alternativeText);return this.container}_getKeyModifier(t){const{isWin:e,isMac:i}=AnnotationElement.platform;return e&&t.ctrlKey||i&&t.metaKey}_setEventListener(t,e,i,r){e.includes("mouse")?t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(t),shift:t.shiftKey,modifier:this._getKeyModifier(t)}})})):t.addEventListener(e,(t=>{var e;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:i,value:r(t)}})}))}_setEventListeners(t,e,i){for(const[s,a]of e){var r;("Action"===a||null!==(r=this.data.actions)&&void 0!==r&&r[a])&&this._setEventListener(t,s,a,i)}}_setBackgroundColor(t){const e=this.data.backgroundColor||null;t.style.backgroundColor=null===e?"transparent":r.Util.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,a=t.style;let n;if(this.data.multiLine){const t=Math.abs(this.data.rect[3]-this.data.rect[1]),e=t/(Math.round(t/(r.LINE_FACTOR*s))||1);n=Math.min(s,Math.round(e/r.LINE_FACTOR))}else{const t=Math.abs(this.data.rect[3]-this.data.rect[1]);n=Math.min(s,Math.round(t/r.LINE_FACTOR))}a.fontSize=`calc(${n}px * var(--scale-factor))`;a.color=r.Util.makeHexColor(i[0],i[1],i[2]);null!==this.data.textAlignment&&(a.textAlign=e[this.data.textAlignment])}_setRequired(t,e){e?t.setAttribute("required",!0):t.removeAttribute("required");t.setAttribute("aria-required",e)}}class TextWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue})}setPropertyOnSiblings(t,e,i,r){const s=this.annotationStorage;for(const a of this._getElementsByName(t.name,t.id)){a.domElement&&(a.domElement[e]=i);s.setValue(a.id,{[r]:i})}}render(){const t=this.annotationStorage,e=this.data.id;this.container.className="textWidgetAnnotation";let i=null;if(this.renderForms){const s=t.getValue(e,{value:this.data.fieldValue});let a=s.formattedValue||s.value||"";const n=t.getValue(e,{charLimit:this.data.maxLen}).charLimit;n&&a.length>n&&(a=a.slice(0,n));const o={userValue:a,formattedValue:null,valueOnFocus:""};if(this.data.multiLine){i=document.createElement("textarea");i.textContent=a;this.data.doNotScroll&&(i.style.overflowY="hidden")}else{i=document.createElement("input");i.type="text";i.setAttribute("value",a);this.data.doNotScroll&&(i.style.overflowX="hidden")}c.add(i);i.setAttribute("data-element-id",e);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.tabIndex=l;this._setRequired(i,this.data.required);n&&(i.maxLength=n);i.addEventListener("input",(r=>{t.setValue(e,{value:r.target.value});this.setPropertyOnSiblings(i,"value",r.target.value,"value")}));i.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue??"";i.value=o.userValue=e;o.formattedValue=null}));let blurListener=t=>{const{formattedValue:e}=o;null!=e&&(t.target.value=e);t.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){var r;i.addEventListener("focus",(t=>{o.userValue&&(t.target.value=o.userValue);o.valueOnFocus=t.target.value}));i.addEventListener("updatefromsandbox",(i=>{const r={value(i){o.userValue=i.detail.value??"";t.setValue(e,{value:o.userValue.toString()});i.target.value=o.userValue},formattedValue(i){const{formattedValue:r}=i.detail;o.formattedValue=r;null!=r&&i.target!==document.activeElement&&(i.target.value=r);t.setValue(e,{formattedValue:r})},selRange(t){t.target.setSelectionRange(...t.detail.selRange)},charLimit:i=>{var r;const{charLimit:s}=i.detail,{target:a}=i;if(0===s){a.removeAttribute("maxLength");return}a.setAttribute("maxLength",s);let n=o.userValue;if(n&&!(n.length<=s)){n=n.slice(0,s);a.value=o.userValue=n;t.setValue(e,{value:n});null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:n,willCommit:!0,commitKey:1,selStart:a.selectionStart,selEnd:a.selectionEnd}})}}};this._dispatchEventFromSandbox(r,i)}));i.addEventListener("keydown",(t=>{var i;let r=-1;"Escape"===t.key?r=0:"Enter"===t.key?r=2:"Tab"===t.key&&(r=3);if(-1===r)return;const{value:s}=t.target;if(o.valueOnFocus!==s){o.userValue=s;null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:s,willCommit:!0,commitKey:r,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}}));const s=blurListener;blurListener=null;i.addEventListener("blur",(t=>{const{value:i}=t.target;o.userValue=i;if(this._mouseState.isDown&&o.valueOnFocus!==i){var r;null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:i,willCommit:!0,commitKey:1,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;const{data:r,target:s}=t,{value:a,selectionStart:n,selectionEnd:o}=s;let l=n,c=o;switch(t.inputType){case"deleteWordBackward":{const t=a.substring(0,n).match(/\w*[^\w]*$/);t&&(l-=t[0].length);break}case"deleteWordForward":{const t=a.substring(n).match(/^[^\w]*\w*/);t&&(c+=t[0].length);break}case"deleteContentBackward":n===o&&(l-=1);break;case"deleteContentForward":n===o&&(c+=1)}t.preventDefault();null===(i=this.linkService.eventBus)||void 0===i||i.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,change:r||"",willCommit:!1,selStart:l,selEnd:c}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(t=>t.target.value))}blurListener&&i.addEventListener("blur",blurListener);if(this.data.comb){const t=(this.data.rect[2]-this.data.rect[0])/n;i.classList.add("comb");i.style.letterSpacing=`calc(${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._setTextStyle(i);this._setBackgroundColor(i);this._setDefaultPropertiesFromJS(i);this.container.append(i);return this.container}}class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){const t=this.annotationStorage,e=this.data,i=e.id;let r=t.getValue(i,{value:e.exportValue===e.fieldValue}).value;if("string"==typeof r){r="Off"!==r;t.setValue(i,{value:r})}this.container.className="buttonWidgetAnnotation checkBox";const s=document.createElement("input");c.add(s);s.setAttribute("data-element-id",i);s.disabled=e.readOnly;this._setRequired(s,this.data.required);s.type="checkbox";s.name=e.fieldName;r&&s.setAttribute("checked",!0);s.setAttribute("exportValue",e.exportValue);s.tabIndex=l;s.addEventListener("change",(r=>{const{name:s,checked:a}=r.target;for(const r of this._getElementsByName(s,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})}));s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue||"Off";t.target.checked=i===e.exportValue}));if(this.enableScripting&&this.hasJSActions){s.addEventListener("updatefromsandbox",(e=>{const r={value(e){e.target.checked="Off"!==e.detail.value;t.setValue(i,{value:e.target.checked})}};this._dispatchEventFromSandbox(r,e)}));this._setEventListeners(s,[["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(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="buttonWidgetAnnotation radioButton";const t=this.annotationStorage,e=this.data,i=e.id;let r=t.getValue(i,{value:e.fieldValue===e.buttonValue}).value;if("string"==typeof r){r=r!==e.buttonValue;t.setValue(i,{value:r})}const s=document.createElement("input");c.add(s);s.setAttribute("data-element-id",i);s.disabled=e.readOnly;this._setRequired(s,this.data.required);s.type="radio";s.name=e.fieldName;r&&s.setAttribute("checked",!0);s.tabIndex=l;s.addEventListener("change",(e=>{const{name:r,checked:s}=e.target;for(const e of this._getElementsByName(r,i))t.setValue(e.id,{value:!1});t.setValue(i,{value:s})}));s.addEventListener("resetform",(t=>{const i=e.defaultFieldValue;t.target.checked=null!=i&&i===e.buttonValue}));if(this.enableScripting&&this.hasJSActions){const r=e.buttonValue;s.addEventListener("updatefromsandbox",(e=>{const s={value:e=>{const s=r===e.detail.value;for(const r of this._getElementsByName(e.target.name)){const e=s&&r.id===i;r.domElement&&(r.domElement.checked=e);t.setValue(r.id,{value:e})}}};this._dispatchEventFromSandbox(s,e)}));this._setEventListeners(s,[["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(s);this._setDefaultPropertiesFromJS(s);this.container.append(s);return this.container}}class PushButtonWidgetAnnotationElement extends LinkAnnotationElement{constructor(t){super(t,{ignoreBorder:t.data.hasAppearance})}render(){const t=super.render();t.className="buttonWidgetAnnotation pushButton";this.data.alternativeText&&(t.title=this.data.alternativeText);const e=t.lastChild;if(this.enableScripting&&this.hasJSActions&&e){this._setDefaultPropertiesFromJS(e);e.addEventListener("updatefromsandbox",(t=>{this._dispatchEventFromSandbox({},t)}))}return t}}class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement{constructor(t){super(t,{isRenderable:t.renderForms})}render(){this.container.className="choiceWidgetAnnotation";const t=this.annotationStorage,e=this.data.id,i=t.getValue(e,{value:this.data.fieldValue}),r=document.createElement("select");c.add(r);r.setAttribute("data-element-id",e);r.disabled=this.data.readOnly;this._setRequired(r,this.data.required);r.name=this.data.fieldName;r.tabIndex=l;let s=this.data.combo&&this.data.options.length>0;if(!this.data.combo){r.size=this.data.options.length;this.data.multiSelect&&(r.multiple=!0)}r.addEventListener("resetform",(t=>{const e=this.data.defaultFieldValue;for(const t of r.options)t.selected=t.value===e}));for(const t of this.data.options){const e=document.createElement("option");e.textContent=t.displayValue;e.value=t.exportValue;if(i.value.includes(t.exportValue)){e.setAttribute("selected",!0);s=!1}r.append(e)}let a=null;if(s){const t=document.createElement("option");t.value=" ";t.setAttribute("hidden",!0);t.setAttribute("selected",!0);r.prepend(t);a=()=>{t.remove();r.removeEventListener("input",a);a=null};r.addEventListener("input",a)}const getValue=(t,e)=>{const i=e?"value":"textContent",r=t.target.options;return t.target.multiple?Array.prototype.filter.call(r,(t=>t.selected)).map((t=>t[i])):-1===r.selectedIndex?null:r[r.selectedIndex][i]},getItems=t=>{const e=t.target.options;return Array.prototype.map.call(e,(t=>({displayValue:t.textContent,exportValue:t.value})))};if(this.enableScripting&&this.hasJSActions){r.addEventListener("updatefromsandbox",(i=>{const s={value(i){var s;null===(s=a)||void 0===s||s();const n=i.detail.value,o=new Set(Array.isArray(n)?n:[n]);for(const t of r.options)t.selected=o.has(t.value);t.setValue(e,{value:getValue(i,!0)})},multipleSelection(t){r.multiple=!0},remove(i){const s=r.options,a=i.detail.remove;s[a].selected=!1;r.remove(a);if(s.length>0){-1===Array.prototype.findIndex.call(s,(t=>t.selected))&&(s[0].selected=!0)}t.setValue(e,{value:getValue(i,!0),items:getItems(i)})},clear(i){for(;0!==r.length;)r.remove(0);t.setValue(e,{value:null,items:[]})},insert(i){const{index:s,displayValue:a,exportValue:n}=i.detail.insert,o=r.children[s],l=document.createElement("option");l.textContent=a;l.value=n;o?o.before(l):r.append(l);t.setValue(e,{value:getValue(i,!0),items:getItems(i)})},items(i){const{items:s}=i.detail;for(;0!==r.length;)r.remove(0);for(const t of s){const{displayValue:e,exportValue:i}=t,s=document.createElement("option");s.textContent=e;s.value=i;r.append(s)}r.options.length>0&&(r.options[0].selected=!0);t.setValue(e,{value:getValue(i,!0),items:getItems(i)})},indices(i){const r=new Set(i.detail.indices);for(const t of i.target.options)t.selected=r.has(t.index);t.setValue(e,{value:getValue(i,!0)})},editable(t){t.target.disabled=!t.detail.editable}};this._dispatchEventFromSandbox(s,i)}));r.addEventListener("input",(i=>{var r;const s=getValue(i,!0),a=getValue(i,!1);t.setValue(e,{value:s});null===(r=this.linkService.eventBus)||void 0===r||r.dispatch("dispatcheventinsandbox",{source:this,detail:{id:e,name:"Keystroke",value:a,changeEx:s,willCommit:!0,commitKey:1,keyDown:!1}})}));this._setEventListeners(r,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(t=>t.target.checked))}else r.addEventListener("input",(function(i){t.setValue(e,{value:getValue(i,!0)})}));this.data.combo&&this._setTextStyle(r);this._setBackgroundColor(r);this._setDefaultPropertiesFromJS(r);this.container.append(r);return this.container}}class PopupAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;const{data:s}=t;super(t,{isRenderable:!PopupAnnotationElement.IGNORE_TYPES.has(s.parentType)&&!!(null!==(e=s.titleObj)&&void 0!==e&&e.str||null!==(i=s.contentsObj)&&void 0!==i&&i.str||null!==(r=s.richText)&&void 0!==r&&r.str)})}render(){this.container.className="popupAnnotation";const t=this.layer.querySelectorAll(`[data-annotation-id="${this.data.parentId}"]`);if(0===t.length)return this.container;const e=new PopupElement({container:this.container,trigger:Array.from(t),color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText}),i=this.page,s=r.Util.normalizeRect([this.data.parentRect[0],i.view[3]-this.data.parentRect[1]+i.view[1],this.data.parentRect[2],i.view[3]-this.data.parentRect[3]+i.view[1]]),a=s[0]+this.data.parentRect[2]-this.data.parentRect[0],n=s[1],[o,l,c,d]=this.viewport.viewBox,h=c-o,u=d-l;this.container.style.left=100*(a-o)/h+"%";this.container.style.top=100*(n-l)/u+"%";this.container.append(e.render());return this.container}}!function _defineProperty(t,e,i){e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i;return t}(PopupAnnotationElement,"IGNORE_TYPES",new Set(["Line","Square","Circle","PolyLine","Polygon","Ink"]));class PopupElement{constructor(t){this.container=t.container;this.trigger=t.trigger;this.color=t.color;this.titleObj=t.titleObj;this.modificationDate=t.modificationDate;this.contentsObj=t.contentsObj;this.richText=t.richText;this.hideWrapper=t.hideWrapper||!1;this.pinned=!1}render(){var t,e;const i=document.createElement("div");i.className="popupWrapper";this.hideElement=this.hideWrapper?i:this.container;this.hideElement.hidden=!0;const a=document.createElement("div");a.className="popup";const n=this.color;if(n){const t=.7*(255-n[0])+n[0],e=.7*(255-n[1])+n[1],i=.7*(255-n[2])+n[2];a.style.backgroundColor=r.Util.makeHexColor(0|t,0|e,0|i)}const l=document.createElement("h1");l.dir=this.titleObj.dir;l.textContent=this.titleObj.str;a.append(l);const c=s.PDFDateString.toDateObject(this.modificationDate);if(c){const t=document.createElement("span");t.className="popupDate";t.textContent="{{date}}, {{time}}";t.dataset.l10nId="annotation_date_string";t.dataset.l10nArgs=JSON.stringify({date:c.toLocaleDateString(),time:c.toLocaleTimeString()});a.append(t)}if(null===(t=this.richText)||void 0===t||!t.str||null!==(e=this.contentsObj)&&void 0!==e&&e.str&&this.contentsObj.str!==this.richText.str){const t=this._formatContents(this.contentsObj);a.append(t)}else{o.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:a});a.lastChild.className="richText popupContent"}Array.isArray(this.trigger)||(this.trigger=[this.trigger]);for(const t of this.trigger){t.addEventListener("click",this._toggle.bind(this));t.addEventListener("mouseover",this._show.bind(this,!1));t.addEventListener("mouseout",this._hide.bind(this,!1))}a.addEventListener("click",this._hide.bind(this,!0));i.append(a);return i}_formatContents(t){let{str:e,dir:i}=t;const r=document.createElement("p");r.className="popupContent";r.dir=i;const s=e.split(/(?:\r\n?|\n)/);for(let t=0,e=s.length;t<e;++t){const i=s[t];r.append(document.createTextNode(i));t<e-1&&r.append(document.createElement("br"))}return r}_toggle(){this.pinned?this._hide(!0):this._show(!0)}_show(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(this.pinned=!0);if(this.hideElement.hidden){this.hideElement.hidden=!1;this.container.style.zIndex=parseInt(this.container.style.zIndex)+1e3}}_hide(){(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&(this.pinned=!1);if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=!0;this.container.style.zIndex=parseInt(this.container.style.zIndex)-1e3}}}class FreeTextAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0});this.textContent=t.data.textContent}render(){this.container.className="freeTextAnnotation";if(this.textContent){const t=document.createElement("div");t.className="annotationTextContent";t.setAttribute("role","comment");for(const e of this.textContent){const i=document.createElement("span");i.textContent=e;t.append(i)}this.container.append(t)}this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class LineAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.className="lineAnnotation";const t=this.data,{width:e,height:i}=getRectDims(t.rect),r=this.svgFactory.create(e,i,!0),s=this.svgFactory.createElement("svg:line");s.setAttribute("x1",t.rect[2]-t.lineCoordinates[0]);s.setAttribute("y1",t.rect[3]-t.lineCoordinates[1]);s.setAttribute("x2",t.rect[2]-t.lineCoordinates[2]);s.setAttribute("y2",t.rect[3]-t.lineCoordinates[3]);s.setAttribute("stroke-width",t.borderStyle.width||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");r.append(s);this.container.append(r);this._createPopup(s,t);return this.container}}class SquareAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.className="squareAnnotation";const t=this.data,{width:e,height:i}=getRectDims(t.rect),r=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=this.svgFactory.createElement("svg:rect");a.setAttribute("x",s/2);a.setAttribute("y",s/2);a.setAttribute("width",e-s);a.setAttribute("height",i-s);a.setAttribute("stroke-width",s||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");r.append(a);this.container.append(r);this._createPopup(a,t);return this.container}}class CircleAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.className="circleAnnotation";const t=this.data,{width:e,height:i}=getRectDims(t.rect),r=this.svgFactory.create(e,i,!0),s=t.borderStyle.width,a=this.svgFactory.createElement("svg:ellipse");a.setAttribute("cx",e/2);a.setAttribute("cy",i/2);a.setAttribute("rx",e/2-s/2);a.setAttribute("ry",i/2-s/2);a.setAttribute("stroke-width",s||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");r.append(a);this.container.append(r);this._createPopup(a,t);return this.container}}class PolylineAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0});this.containerClassName="polylineAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:i}=getRectDims(t.rect),r=this.svgFactory.create(e,i,!0);let s=[];for(const e of t.vertices){const i=e.x-t.rect[0],r=t.rect[3]-e.y;s.push(i+","+r)}s=s.join(" ");const a=this.svgFactory.createElement(this.svgElementName);a.setAttribute("points",s);a.setAttribute("stroke-width",t.borderStyle.width||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");r.append(a);this.container.append(r);this._createPopup(a,t);return this.container}}class PolygonAnnotationElement extends PolylineAnnotationElement{constructor(t){super(t);this.containerClassName="polygonAnnotation";this.svgElementName="svg:polygon"}}class CaretAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.className="caretAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class InkAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0});this.containerClassName="inkAnnotation";this.svgElementName="svg:polyline"}render(){this.container.className=this.containerClassName;const t=this.data,{width:e,height:i}=getRectDims(t.rect),r=this.svgFactory.create(e,i,!0);for(const e of t.inkLists){let i=[];for(const r of e){const e=r.x-t.rect[0],s=t.rect[3]-r.y;i.push(`${e},${s}`)}i=i.join(" ");const s=this.svgFactory.createElement(this.svgElementName);s.setAttribute("points",i);s.setAttribute("stroke-width",t.borderStyle.width||1);s.setAttribute("stroke","transparent");s.setAttribute("fill","transparent");this._createPopup(s,t);r.append(s)}this.container.append(r);return this.container}}class HighlightAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("highlightAnnotation");this.container.className="highlightAnnotation";return this.container}}class UnderlineAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("underlineAnnotation");this.container.className="underlineAnnotation";return this.container}}class SquigglyAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("squigglyAnnotation");this.container.className="squigglyAnnotation";return this.container}}class StrikeOutAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0,createQuadrilaterals:!0})}render(){this.data.hasPopup||this._createPopup(null,this.data);if(this.quadrilaterals)return this._renderQuadrilaterals("strikeoutAnnotation");this.container.className="strikeoutAnnotation";return this.container}}class StampAnnotationElement extends AnnotationElement{constructor(t){var e,i,r;super(t,{isRenderable:!!(t.data.hasPopup||null!==(e=t.data.titleObj)&&void 0!==e&&e.str||null!==(i=t.data.contentsObj)&&void 0!==i&&i.str||null!==(r=t.data.richText)&&void 0!==r&&r.str),ignoreBorder:!0})}render(){this.container.className="stampAnnotation";this.data.hasPopup||this._createPopup(null,this.data);return this.container}}class FileAttachmentAnnotationElement extends AnnotationElement{constructor(t){var e;super(t,{isRenderable:!0});const{filename:i,content:r}=this.data.file;this.filename=(0,s.getFilenameFromUrl)(i);this.content=r;null===(e=this.linkService.eventBus)||void 0===e||e.dispatch("fileattachmentannotation",{source:this,filename:i,content:r})}render(){var t,e;this.container.className="fileAttachmentAnnotation";const i=document.createElement("div");i.className="popupTriggerArea";i.addEventListener("dblclick",this._download.bind(this));!this.data.hasPopup&&(null!==(t=this.data.titleObj)&&void 0!==t&&t.str||null!==(e=this.data.contentsObj)&&void 0!==e&&e.str||this.data.richText)&&this._createPopup(i,this.data);this.container.append(i);return this.container}_download(){var t;null===(t=this.downloadManager)||void 0===t||t.openOrDownloadData(this.container,this.content,this.filename)}}class AnnotationLayer{static render(t){const{annotations:e,div:i,viewport:n,accessibilityManager:o}=t;_classStaticPrivateMethodGet(this,AnnotationLayer,_setDimensions).call(this,i,n);let l=0;for(const c of e){if(c.annotationType!==r.AnnotationType.POPUP){const{width:t,height:e}=getRectDims(c.rect);if(t<=0||e<=0)continue}const e=AnnotationElementFactory.create({data:c,layer:i,page:t.page,viewport:n,linkService:t.linkService,downloadManager:t.downloadManager,imageResourcesPath:t.imageResourcesPath||"",renderForms:!1!==t.renderForms,svgFactory:new s.DOMSVGFactory,annotationStorage:t.annotationStorage||new a.AnnotationStorage,enableScripting:t.enableScripting,hasJSActions:t.hasJSActions,fieldObjects:t.fieldObjects,mouseState:t.mouseState||{isDown:!1}});if(e.isRenderable){const t=e.render();c.hidden&&(t.style.visibility="hidden");if(Array.isArray(t))for(const e of t){e.style.zIndex=l++;_classStaticPrivateMethodGet(AnnotationLayer,AnnotationLayer,_appendElement).call(AnnotationLayer,e,c.id,i,o)}else{t.style.zIndex=l++;e instanceof PopupAnnotationElement?i.prepend(t):_classStaticPrivateMethodGet(AnnotationLayer,AnnotationLayer,_appendElement).call(AnnotationLayer,t,c.id,i,o)}}}_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,i,t.annotationCanvasMap)}static update(t){const{annotationCanvasMap:e,div:i,viewport:r}=t;_classStaticPrivateMethodGet(this,AnnotationLayer,_setDimensions).call(this,i,r);_classStaticPrivateMethodGet(this,AnnotationLayer,_setAnnotationCanvasMap).call(this,i,e);i.hidden=!1}}e.AnnotationLayer=AnnotationLayer;function _appendElement(t,e,i,r){const a=t.firstChild||t;a.id=`${s.AnnotationPrefix}${e}`;i.append(t);null==r||r.moveElementInDOM(i,t,a,!1)}function _setDimensions(t,e){let{width:i,height:r,rotation:s}=e;const{style:a}=t,n=s%180!=0,o=Math.floor(i)+"px",l=Math.floor(r)+"px";a.width=n?l:o;a.height=n?o:l;t.setAttribute("data-main-rotation",s)}function _setAnnotationCanvasMap(t,e){if(e){for(const[i,r]of e){const e=t.querySelector(`[data-annotation-id="${i}"]`);if(!e)continue;const{firstChild:s}=e;s?"CANVAS"===s.nodeName?s.replaceWith(r):s.before(r):e.append(r)}e.clear()}}},(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.ColorConverters=void 0;function makeColorComp(t){return Math.floor(255*Math.max(0,Math.min(1,t))).toString(16).padStart(2,"0")}e.ColorConverters=class ColorConverters{static CMYK_G(t){let[e,i,r,s]=t;return["G",1-Math.min(1,.3*e+.59*r+.11*i+s)]}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_HTML(t){let[e]=t;const i=makeColorComp(e);return`#${i}${i}${i}`}static RGB_G(t){let[e,i,r]=t;return["G",.3*e+.59*i+.11*r]}static RGB_HTML(t){let[e,i,r]=t;return`#${makeColorComp(e)}${makeColorComp(i)}${makeColorComp(r)}`}static T_HTML(){return"#00000000"}static CMYK_RGB(t){let[e,i,r,s]=t;return["RGB",1-Math.min(1,e+s),1-Math.min(1,r+s),1-Math.min(1,i+s)]}static CMYK_HTML(t){const e=this.CMYK_RGB(t).slice(1);return this.RGB_HTML(e)}static RGB_CMYK(t){let[e,i,r]=t;const s=1-e,a=1-i,n=1-r;return["CMYK",s,a,n,Math.min(s,a,n)]}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.XfaLayer=void 0;var r=i(148);e.XfaLayer=class XfaLayer{static setupStorage(t,e,i,r,s){const a=r.getValue(e,{value:null});switch(i.name){case"textarea":null!==a.value&&(t.textContent=a.value);if("print"===s)break;t.addEventListener("input",(t=>{r.setValue(e,{value:t.target.value})}));break;case"input":if("radio"===i.attributes.type||"checkbox"===i.attributes.type){a.value===i.attributes.xfaOn?t.setAttribute("checked",!0):a.value===i.attributes.xfaOff&&t.removeAttribute("checked");if("print"===s)break;t.addEventListener("change",(t=>{r.setValue(e,{value:t.target.checked?t.target.getAttribute("xfaOn"):t.target.getAttribute("xfaOff")})}))}else{null!==a.value&&t.setAttribute("value",a.value);if("print"===s)break;t.addEventListener("input",(t=>{r.setValue(e,{value:t.target.value})}))}break;case"select":if(null!==a.value)for(const t of i.children)t.attributes.value===a.value&&(t.attributes.selected=!0);t.addEventListener("input",(t=>{const i=t.target.options,s=-1===i.selectedIndex?"":i[i.selectedIndex].value;r.setValue(e,{value:s})}))}}static setAttributes(t){let{html:e,element:i,storage:r=null,intent:s,linkService:a}=t;const{attributes:n}=i,o=e instanceof HTMLAnchorElement;"radio"===n.type&&(n.name=`${n.name}-${s}`);for(const[t,i]of Object.entries(n))if(null!=i)switch(t){case"class":i.length&&e.setAttribute(t,i.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",i);break;case"style":Object.assign(e.style,i);break;case"textContent":e.textContent=i;break;default:(!o||"href"!==t&&"newWindow"!==t)&&e.setAttribute(t,i)}o&&a.addLinkAttributes(e,n.href,n.newWindow);r&&n.dataId&&this.setupStorage(e,n.dataId,i,r)}static render(t){const e=t.annotationStorage,i=t.linkService,s=t.xfaHtml,a=t.intent||"display",n=document.createElement(s.name);s.attributes&&this.setAttributes({html:n,element:s,intent:a,linkService:i});const o=[[s,-1,n]],l=t.div;l.append(n);if(t.viewport){const e=`matrix(${t.viewport.transform.join(",")})`;l.style.transform=e}"richText"!==a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];for(;o.length>0;){var d;const[t,s,n]=o.at(-1);if(s+1===t.children.length){o.pop();continue}const l=t.children[++o.at(-1)[1]];if(null===l)continue;const{name:h}=l;if("#text"===h){const t=document.createTextNode(l.value);c.push(t);n.append(t);continue}let u;u=null!=l&&null!==(d=l.attributes)&&void 0!==d&&d.xmlns?document.createElementNS(l.attributes.xmlns,h):document.createElement(h);n.append(u);l.attributes&&this.setAttributes({html:u,element:l,storage:e,intent:a,linkService:i});if(l.children&&l.children.length>0)o.push([l,-1,u]);else if(l.value){const t=document.createTextNode(l.value);r.XfaText.shouldBuildText(h)&&c.push(t);u.append(t)}}for(const t of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))t.setAttribute("readOnly",!0);return{textDivs:c}}static update(t){const e=`matrix(${t.viewport.transform.join(",")})`;t.div.style.transform=e;t.div.hidden=!1}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.TextLayerRenderTask=void 0;e.renderTextLayer=function renderTextLayer(t){const e=new TextLayerRenderTask({textContent:t.textContent,textContentStream:t.textContentStream,container:t.container,viewport:t.viewport,textDivs:t.textDivs,textContentItemsStr:t.textContentItemsStr});e._render(t.timeout);return e};var r=i(1);const s=30,a=new Map;function appendText(t,e,i,n){const o=document.createElement("span"),l={angle:0,canvasWidth:0,hasText:""!==e.str,hasEOL:e.hasEOL,fontSize:0};t._textDivs.push(o);const c=r.Util.transform(t._viewport.transform,e.transform);let d=Math.atan2(c[1],c[0]);const h=i[e.fontName];h.vertical&&(d+=Math.PI/2);const u=Math.hypot(c[2],c[3]),p=u*function getAscent(t,e){const i=a.get(t);if(i)return i;e.save();e.font=`30px ${t}`;const r=e.measureText("");let n=r.fontBoundingBoxAscent,o=Math.abs(r.fontBoundingBoxDescent);if(n){e.restore();const i=n/(n+o);a.set(t,i);return i}e.strokeStyle="red";e.clearRect(0,0,s,s);e.strokeText("g",0,0);let l=e.getImageData(0,0,s,s).data;o=0;for(let t=l.length-1-3;t>=0;t-=4)if(l[t]>0){o=Math.ceil(t/4/s);break}e.clearRect(0,0,s,s);e.strokeText("A",0,s);l=e.getImageData(0,0,s,s).data;n=0;for(let t=0,e=l.length;t<e;t+=4)if(l[t]>0){n=s-Math.floor(t/4/s);break}e.restore();if(n){const e=n/(n+o);a.set(t,e);return e}a.set(t,.8);return.8}(h.fontFamily,n);let f,g;if(0===d){f=c[4];g=c[5]-p}else{f=c[4]+p*Math.sin(d);g=c[5]-p*Math.cos(d)}o.style.left=`${f}px`;o.style.top=`${g}px`;o.style.fontSize=`${u}px`;o.style.fontFamily=h.fontFamily;l.fontSize=u;o.setAttribute("role","presentation");o.textContent=e.str;o.dir=e.dir;t._fontInspectorEnabled&&(o.dataset.fontName=e.fontName);0!==d&&(l.angle=d*(180/Math.PI));let m=!1;if(e.str.length>1)m=!0;else if(" "!==e.str&&e.transform[0]!==e.transform[3]){const t=Math.abs(e.transform[0]),i=Math.abs(e.transform[3]);t!==i&&Math.max(t,i)/Math.min(t,i)>1.5&&(m=!0)}m&&(h.vertical?l.canvasWidth=e.height*t._viewport.scale:l.canvasWidth=e.width*t._viewport.scale);t._textDivProperties.set(o,l);t._textContentStream&&t._layoutText(o)}function render(t){if(t._canceled)return;const e=t._textDivs,i=t._capability,r=e.length;if(r>1e5){t._renderingDone=!0;i.resolve()}else{if(!t._textContentStream)for(let i=0;i<r;i++)t._layoutText(e[i]);t._renderingDone=!0;i.resolve()}}class TextLayerRenderTask{constructor(t){var e;let{textContent:i,textContentStream:s,container:a,viewport:n,textDivs:o,textContentItemsStr:l}=t;this._textContent=i;this._textContentStream=s;this._container=a;this._document=a.ownerDocument;this._viewport=n;this._textDivs=o||[];this._textContentItemsStr=l||[];this._fontInspectorEnabled=!(null===(e=globalThis.FontInspector)||void 0===e||!e.enabled);this._reader=null;this._layoutTextLastFontSize=null;this._layoutTextLastFontFamily=null;this._layoutTextCtx=null;this._textDivProperties=new WeakMap;this._renderingDone=!1;this._canceled=!1;this._capability=(0,r.createPromiseCapability)();this._renderTimer=null;this._bounds=[];this._devicePixelRatio=globalThis.devicePixelRatio||1;this._capability.promise.finally((()=>{this._textDivProperties=null;if(this._layoutTextCtx){this._layoutTextCtx.canvas.width=0;this._layoutTextCtx.canvas.height=0;this._layoutTextCtx=null}})).catch((()=>{}))}get promise(){return this._capability.promise}cancel(){this._canceled=!0;if(this._reader){this._reader.cancel(new r.AbortException("TextLayer task cancelled.")).catch((()=>{}));this._reader=null}if(null!==this._renderTimer){clearTimeout(this._renderTimer);this._renderTimer=null}this._capability.reject(new Error("TextLayer task cancelled."))}_processItems(t,e){for(let i=0,r=t.length;i<r;i++)if(void 0!==t[i].str){this._textContentItemsStr.push(t[i].str);appendText(this,t[i],e,this._layoutTextCtx)}else if("beginMarkedContentProps"===t[i].type||"beginMarkedContent"===t[i].type){const e=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");null!==t[i].id&&this._container.setAttribute("id",`${t[i].id}`);e.append(this._container)}else"endMarkedContent"===t[i].type&&(this._container=this._container.parentNode)}_layoutText(t){const e=this._textDivProperties.get(t);let i="";if(0!==e.canvasWidth&&e.hasText){const{fontFamily:r}=t.style,{fontSize:s}=e;if(s!==this._layoutTextLastFontSize||r!==this._layoutTextLastFontFamily){this._layoutTextCtx.font=`${s*this._devicePixelRatio}px ${r}`;this._layoutTextLastFontSize=s;this._layoutTextLastFontFamily=r}const{width:a}=this._layoutTextCtx.measureText(t.textContent);a>0&&(i=`scaleX(${this._devicePixelRatio*e.canvasWidth/a})`)}0!==e.angle&&(i=`rotate(${e.angle}deg) ${i}`);i.length>0&&(t.style.transform=i);e.hasText&&this._container.append(t);if(e.hasEOL){const t=document.createElement("br");t.setAttribute("role","presentation");this._container.append(t)}}_render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const e=(0,r.createPromiseCapability)();let i=Object.create(null);const a=this._document.createElement("canvas");a.height=a.width=s;this._layoutTextCtx=a.getContext("2d",{alpha:!1});if(this._textContent){const t=this._textContent.items,i=this._textContent.styles;this._processItems(t,i);e.resolve()}else{if(!this._textContentStream)throw new Error('Neither "textContent" nor "textContentStream" parameters specified.');{const pump=()=>{this._reader.read().then((t=>{let{value:r,done:s}=t;if(s)e.resolve();else{Object.assign(i,r.styles);this._processItems(r.items,i);pump()}}),e.reject)};this._reader=this._textContentStream.getReader();pump()}}e.promise.then((()=>{i=null;t?this._renderTimer=setTimeout((()=>{render(this);this._renderTimer=null}),t):render(this)}),this._capability.reject)}}e.TextLayerRenderTask=TextLayerRenderTask},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.SVGGraphics=void 0;var r=i(136),s=i(1),a=i(3);let n=class{constructor(){(0,s.unreachable)("Not implemented: SVGGraphics")}};e.SVGGraphics=n;{const o={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"},l="http://www.w3.org/XML/1998/namespace",c="http://www.w3.org/1999/xlink",d=["butt","round","square"],h=["miter","round","bevel"],createObjectURL=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(URL.createObjectURL&&"undefined"!=typeof Blob&&!i)return URL.createObjectURL(new Blob([t],{type:e}));const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s=`data:${e};base64,`;for(let e=0,i=t.length;e<i;e+=3){const a=255&t[e],n=255&t[e+1],o=255&t[e+2],l=(3&a)<<4|n>>4,c=e+1<i?(15&n)<<2|o>>6:64,d=e+2<i?63&o:64;s+=r[a>>2]+r[l]+r[c]+r[d]}return s},u=function(){const t=new Uint8Array([137,80,78,71,13,10,26,10]),e=new Int32Array(256);for(let t=0;t<256;t++){let i=t;for(let t=0;t<8;t++)i=1&i?3988292384^i>>1&2147483647:i>>1&2147483647;e[t]=i}function writePngChunk(t,i,r,s){let a=s;const n=i.length;r[a]=n>>24&255;r[a+1]=n>>16&255;r[a+2]=n>>8&255;r[a+3]=255&n;a+=4;r[a]=255&t.charCodeAt(0);r[a+1]=255&t.charCodeAt(1);r[a+2]=255&t.charCodeAt(2);r[a+3]=255&t.charCodeAt(3);a+=4;r.set(i,a);a+=i.length;const o=function crc32(t,i,r){let s=-1;for(let a=i;a<r;a++){const i=255&(s^t[a]);s=s>>>8^e[i]}return-1^s}(r,s+4,a);r[a]=o>>24&255;r[a+1]=o>>16&255;r[a+2]=o>>8&255;r[a+3]=255&o}function deflateSyncUncompressed(t){let e=t.length;const i=65535,r=Math.ceil(e/i),s=new Uint8Array(2+e+5*r+4);let a=0;s[a++]=120;s[a++]=156;let n=0;for(;e>i;){s[a++]=0;s[a++]=255;s[a++]=255;s[a++]=0;s[a++]=0;s.set(t.subarray(n,n+i),a);a+=i;n+=i;e-=i}s[a++]=1;s[a++]=255&e;s[a++]=e>>8&255;s[a++]=255&~e;s[a++]=(65535&~e)>>8&255;s.set(t.subarray(n),a);a+=t.length-n;const o=function adler32(t,e,i){let r=1,s=0;for(let a=e;a<i;++a){r=(r+(255&t[a]))%65521;s=(s+r)%65521}return s<<16|r}(t,0,t.length);s[a++]=o>>24&255;s[a++]=o>>16&255;s[a++]=o>>8&255;s[a++]=255&o;return s}function encode(e,i,r,n){const o=e.width,l=e.height;let c,d,h;const u=e.data;switch(i){case s.ImageKind.GRAYSCALE_1BPP:d=0;c=1;h=o+7>>3;break;case s.ImageKind.RGB_24BPP:d=2;c=8;h=3*o;break;case s.ImageKind.RGBA_32BPP:d=6;c=8;h=4*o;break;default:throw new Error("invalid format")}const p=new Uint8Array((1+h)*l);let f=0,g=0;for(let t=0;t<l;++t){p[f++]=0;p.set(u.subarray(g,g+h),f);g+=h;f+=h}if(i===s.ImageKind.GRAYSCALE_1BPP&&n){f=0;for(let t=0;t<l;t++){f++;for(let t=0;t<h;t++)p[f++]^=255}}const m=new Uint8Array([o>>24&255,o>>16&255,o>>8&255,255&o,l>>24&255,l>>16&255,l>>8&255,255&l,c,d,0,0,0]),v=function deflateSync(t){if(!a.isNodeJS)return deflateSyncUncompressed(t);try{let e;e=parseInt(process.versions.node)>=8?t:Buffer.from(t);const i=require("zlib").deflateSync(e,{level:9});return i instanceof Uint8Array?i:new Uint8Array(i)}catch(t){(0,s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+t)}return deflateSyncUncompressed(t)}(p),_=t.length+36+m.length+v.length,b=new Uint8Array(_);let y=0;b.set(t,y);y+=t.length;writePngChunk("IHDR",m,b,y);y+=12+m.length;writePngChunk("IDATA",v,b,y);y+=12+v.length;writePngChunk("IEND",new Uint8Array(0),b,y);return createObjectURL(b,"image/png",r)}return function convertImgDataToPng(t,e,i){return encode(t,void 0===t.kind?s.ImageKind.GRAYSCALE_1BPP:t.kind,e,i)}}();class SVGExtraState{constructor(){this.fontSizeScale=1;this.fontWeight=o.fontWeight;this.fontSize=0;this.textMatrix=s.IDENTITY_MATRIX;this.fontMatrix=s.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=s.TextRenderingMode.FILL;this.textMatrixScale=1;this.x=0;this.y=0;this.lineX=0;this.lineY=0;this.charSpacing=0;this.wordSpacing=0;this.textHScale=1;this.textRise=0;this.fillColor=o.fillColor;this.strokeColor="#000000";this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.lineJoin="";this.lineCap="";this.miterLimit=0;this.dashArray=[];this.dashPhase=0;this.dependencies=[];this.activeClipUrl=null;this.clipGroup=null;this.maskId=""}clone(){return Object.create(this)}setCurrentPoint(t,e){this.x=t;this.y=e}}function opListToTree(t){let e=[];const i=[];for(const r of t)if("save"!==r.fn)"restore"===r.fn?e=i.pop():e.push(r);else{e.push({fnId:92,fn:"group",items:[]});i.push(e);e=e.at(-1).items}return e}function pf(t){if(Number.isInteger(t))return t.toString();const e=t.toFixed(10);let i=e.length-1;if("0"!==e[i])return e;do{i--}while("0"===e[i]);return e.substring(0,"."===e[i]?i:i+1)}function pm(t){if(0===t[4]&&0===t[5]){if(0===t[1]&&0===t[2])return 1===t[0]&&1===t[3]?"":`scale(${pf(t[0])} ${pf(t[3])})`;if(t[0]===t[3]&&t[1]===-t[2]){return`rotate(${pf(180*Math.acos(t[0])/Math.PI)})`}}else if(1===t[0]&&0===t[1]&&0===t[2]&&1===t[3])return`translate(${pf(t[4])} ${pf(t[5])})`;return`matrix(${pf(t[0])} ${pf(t[1])} ${pf(t[2])} ${pf(t[3])} ${pf(t[4])} ${pf(t[5])})`}let p=0,f=0,g=0;e.SVGGraphics=n=class{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];(0,r.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future.");this.svgFactory=new r.DOMSVGFactory;this.current=new SVGExtraState;this.transformMatrix=s.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=t;this.objs=e;this.pendingClip=null;this.pendingEOFill=!1;this.embedFonts=!1;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!i;this._operatorIdMapping=[];for(const t in s.OPS)this._operatorIdMapping[s.OPS[t]]=t}save(){this.transformStack.push(this.transformMatrix);const t=this.current;this.extraStack.push(t);this.current=t.clone()}restore(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null}group(t){this.save();this.executeOpTree(t);this.restore()}loadDependencies(t){const e=t.fnArray,i=t.argsArray;for(let t=0,r=e.length;t<r;t++)if(e[t]===s.OPS.dependency)for(const e of i[t]){const t=e.startsWith("g_")?this.commonObjs:this.objs,i=new Promise((i=>{t.get(e,i)}));this.current.dependencies.push(i)}return Promise.all(this.current.dependencies)}transform(t,e,i,r,a,n){const o=[t,e,i,r,a,n];this.transformMatrix=s.Util.transform(this.transformMatrix,o);this.tgrp=null}getSVG(t,e){this.viewport=e;const i=this._initialize(e);return this.loadDependencies(t).then((()=>{this.transformMatrix=s.IDENTITY_MATRIX;this.executeOpTree(this.convertOpList(t));return i}))}convertOpList(t){const e=this._operatorIdMapping,i=t.argsArray,r=t.fnArray,s=[];for(let t=0,a=r.length;t<a;t++){const a=r[t];s.push({fnId:a,fn:e[a],args:i[t]})}return opListToTree(s)}executeOpTree(t){for(const e of t){const t=e.fn,i=e.fnId,r=e.args;switch(0|i){case s.OPS.beginText:this.beginText();break;case s.OPS.dependency:break;case s.OPS.setLeading:this.setLeading(r);break;case s.OPS.setLeadingMoveText:this.setLeadingMoveText(r[0],r[1]);break;case s.OPS.setFont:this.setFont(r);break;case s.OPS.showText:case s.OPS.showSpacedText:this.showText(r[0]);break;case s.OPS.endText:this.endText();break;case s.OPS.moveText:this.moveText(r[0],r[1]);break;case s.OPS.setCharSpacing:this.setCharSpacing(r[0]);break;case s.OPS.setWordSpacing:this.setWordSpacing(r[0]);break;case s.OPS.setHScale:this.setHScale(r[0]);break;case s.OPS.setTextMatrix:this.setTextMatrix(r[0],r[1],r[2],r[3],r[4],r[5]);break;case s.OPS.setTextRise:this.setTextRise(r[0]);break;case s.OPS.setTextRenderingMode:this.setTextRenderingMode(r[0]);break;case s.OPS.setLineWidth:this.setLineWidth(r[0]);break;case s.OPS.setLineJoin:this.setLineJoin(r[0]);break;case s.OPS.setLineCap:this.setLineCap(r[0]);break;case s.OPS.setMiterLimit:this.setMiterLimit(r[0]);break;case s.OPS.setFillRGBColor:this.setFillRGBColor(r[0],r[1],r[2]);break;case s.OPS.setStrokeRGBColor:this.setStrokeRGBColor(r[0],r[1],r[2]);break;case s.OPS.setStrokeColorN:this.setStrokeColorN(r);break;case s.OPS.setFillColorN:this.setFillColorN(r);break;case s.OPS.shadingFill:this.shadingFill(r[0]);break;case s.OPS.setDash:this.setDash(r[0],r[1]);break;case s.OPS.setRenderingIntent:this.setRenderingIntent(r[0]);break;case s.OPS.setFlatness:this.setFlatness(r[0]);break;case s.OPS.setGState:this.setGState(r[0]);break;case s.OPS.fill:this.fill();break;case s.OPS.eoFill:this.eoFill();break;case s.OPS.stroke:this.stroke();break;case s.OPS.fillStroke:this.fillStroke();break;case s.OPS.eoFillStroke:this.eoFillStroke();break;case s.OPS.clip:this.clip("nonzero");break;case s.OPS.eoClip:this.clip("evenodd");break;case s.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case s.OPS.paintImageXObject:this.paintImageXObject(r[0]);break;case s.OPS.paintInlineImageXObject:this.paintInlineImageXObject(r[0]);break;case s.OPS.paintImageMaskXObject:this.paintImageMaskXObject(r[0]);break;case s.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(r[0],r[1]);break;case s.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case s.OPS.closePath:this.closePath();break;case s.OPS.closeStroke:this.closeStroke();break;case s.OPS.closeFillStroke:this.closeFillStroke();break;case s.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case s.OPS.nextLine:this.nextLine();break;case s.OPS.transform:this.transform(r[0],r[1],r[2],r[3],r[4],r[5]);break;case s.OPS.constructPath:this.constructPath(r[0],r[1]);break;case s.OPS.endPath:this.endPath();break;case 92:this.group(e.items);break;default:(0,s.warn)(`Unimplemented operator ${t}`)}}}setWordSpacing(t){this.current.wordSpacing=t}setCharSpacing(t){this.current.charSpacing=t}nextLine(){this.moveText(0,this.current.leading)}setTextMatrix(t,e,i,r,s,a){const n=this.current;n.textMatrix=n.lineMatrix=[t,e,i,r,s,a];n.textMatrixScale=Math.hypot(t,e);n.x=n.lineX=0;n.y=n.lineY=0;n.xcoords=[];n.ycoords=[];n.tspan=this.svgFactory.createElement("svg:tspan");n.tspan.setAttributeNS(null,"font-family",n.fontFamily);n.tspan.setAttributeNS(null,"font-size",`${pf(n.fontSize)}px`);n.tspan.setAttributeNS(null,"y",pf(-n.y));n.txtElement=this.svgFactory.createElement("svg:text");n.txtElement.append(n.tspan)}beginText(){const t=this.current;t.x=t.lineX=0;t.y=t.lineY=0;t.textMatrix=s.IDENTITY_MATRIX;t.lineMatrix=s.IDENTITY_MATRIX;t.textMatrixScale=1;t.tspan=this.svgFactory.createElement("svg:tspan");t.txtElement=this.svgFactory.createElement("svg:text");t.txtgrp=this.svgFactory.createElement("svg:g");t.xcoords=[];t.ycoords=[]}moveText(t,e){const i=this.current;i.x=i.lineX+=t;i.y=i.lineY+=e;i.xcoords=[];i.ycoords=[];i.tspan=this.svgFactory.createElement("svg:tspan");i.tspan.setAttributeNS(null,"font-family",i.fontFamily);i.tspan.setAttributeNS(null,"font-size",`${pf(i.fontSize)}px`);i.tspan.setAttributeNS(null,"y",pf(-i.y))}showText(t){const e=this.current,i=e.font,r=e.fontSize;if(0===r)return;const a=e.fontSizeScale,n=e.charSpacing,c=e.wordSpacing,d=e.fontDirection,h=e.textHScale*d,u=i.vertical,p=u?1:-1,f=i.defaultVMetrics,g=r*e.fontMatrix[0];let m=0;for(const s of t){if(null===s){m+=d*c;continue}if("number"==typeof s){m+=p*s*r/1e3;continue}const t=(s.isSpace?c:0)+n,o=s.fontChar;let l,h,v,_=s.width;if(u){let t;const e=s.vmetric||f;t=s.vmetric?e[1]:.5*_;t=-t*g;const i=e[2]*g;_=e?-e[0]:_;l=t/a;h=(m+i)/a}else{l=m/a;h=0}if(s.isInFont||i.missingFile){e.xcoords.push(e.x+l);u&&e.ycoords.push(-e.y+h);e.tspan.textContent+=o}v=u?_*g-t*d:_*g+t*d;m+=v}e.tspan.setAttributeNS(null,"x",e.xcoords.map(pf).join(" "));u?e.tspan.setAttributeNS(null,"y",e.ycoords.map(pf).join(" ")):e.tspan.setAttributeNS(null,"y",pf(-e.y));u?e.y-=m:e.x+=m*h;e.tspan.setAttributeNS(null,"font-family",e.fontFamily);e.tspan.setAttributeNS(null,"font-size",`${pf(e.fontSize)}px`);e.fontStyle!==o.fontStyle&&e.tspan.setAttributeNS(null,"font-style",e.fontStyle);e.fontWeight!==o.fontWeight&&e.tspan.setAttributeNS(null,"font-weight",e.fontWeight);const v=e.textRenderingMode&s.TextRenderingMode.FILL_STROKE_MASK;if(v===s.TextRenderingMode.FILL||v===s.TextRenderingMode.FILL_STROKE){e.fillColor!==o.fillColor&&e.tspan.setAttributeNS(null,"fill",e.fillColor);e.fillAlpha<1&&e.tspan.setAttributeNS(null,"fill-opacity",e.fillAlpha)}else e.textRenderingMode===s.TextRenderingMode.ADD_TO_PATH?e.tspan.setAttributeNS(null,"fill","transparent"):e.tspan.setAttributeNS(null,"fill","none");if(v===s.TextRenderingMode.STROKE||v===s.TextRenderingMode.FILL_STROKE){const t=1/(e.textMatrixScale||1);this._setStrokeAttributes(e.tspan,t)}let _=e.textMatrix;if(0!==e.textRise){_=_.slice();_[5]+=e.textRise}e.txtElement.setAttributeNS(null,"transform",`${pm(_)} scale(${pf(h)}, -1)`);e.txtElement.setAttributeNS(l,"xml:space","preserve");e.txtElement.append(e.tspan);e.txtgrp.append(e.txtElement);this._ensureTransformGroup().append(e.txtElement)}setLeadingMoveText(t,e){this.setLeading(-e);this.moveText(t,e)}addFontStyle(t){if(!t.data)throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');if(!this.cssStyle){this.cssStyle=this.svgFactory.createElement("svg:style");this.cssStyle.setAttributeNS(null,"type","text/css");this.defs.append(this.cssStyle)}const e=createObjectURL(t.data,t.mimetype,this.forceDataSchema);this.cssStyle.textContent+=`@font-face { font-family: "${t.loadedName}"; src: url(${e}); }\n`}setFont(t){const e=this.current,i=this.commonObjs.get(t[0]);let r=t[1];e.font=i;if(this.embedFonts&&!i.missingFile&&!this.embeddedFonts[i.loadedName]){this.addFontStyle(i);this.embeddedFonts[i.loadedName]=i}e.fontMatrix=i.fontMatrix||s.FONT_IDENTITY_MATRIX;let a="normal";i.black?a="900":i.bold&&(a="bold");const n=i.italic?"italic":"normal";if(r<0){r=-r;e.fontDirection=-1}else e.fontDirection=1;e.fontSize=r;e.fontFamily=i.loadedName;e.fontWeight=a;e.fontStyle=n;e.tspan=this.svgFactory.createElement("svg:tspan");e.tspan.setAttributeNS(null,"y",pf(-e.y));e.xcoords=[];e.ycoords=[]}endText(){var t;const e=this.current;if(e.textRenderingMode&s.TextRenderingMode.ADD_TO_PATH_FLAG&&null!==(t=e.txtElement)&&void 0!==t&&t.hasChildNodes()){e.element=e.txtElement;this.clip("nonzero");this.endPath()}}setLineWidth(t){t>0&&(this.current.lineWidth=t)}setLineCap(t){this.current.lineCap=d[t]}setLineJoin(t){this.current.lineJoin=h[t]}setMiterLimit(t){this.current.miterLimit=t}setStrokeAlpha(t){this.current.strokeAlpha=t}setStrokeRGBColor(t,e,i){this.current.strokeColor=s.Util.makeHexColor(t,e,i)}setFillAlpha(t){this.current.fillAlpha=t}setFillRGBColor(t,e,i){this.current.fillColor=s.Util.makeHexColor(t,e,i);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]}setStrokeColorN(t){this.current.strokeColor=this._makeColorN_Pattern(t)}setFillColorN(t){this.current.fillColor=this._makeColorN_Pattern(t)}shadingFill(t){const e=this.viewport.width,i=this.viewport.height,r=s.Util.inverseTransform(this.transformMatrix),a=s.Util.applyTransform([0,0],r),n=s.Util.applyTransform([0,i],r),o=s.Util.applyTransform([e,0],r),l=s.Util.applyTransform([e,i],r),c=Math.min(a[0],n[0],o[0],l[0]),d=Math.min(a[1],n[1],o[1],l[1]),h=Math.max(a[0],n[0],o[0],l[0]),u=Math.max(a[1],n[1],o[1],l[1]),p=this.svgFactory.createElement("svg:rect");p.setAttributeNS(null,"x",c);p.setAttributeNS(null,"y",d);p.setAttributeNS(null,"width",h-c);p.setAttributeNS(null,"height",u-d);p.setAttributeNS(null,"fill",this._makeShadingPattern(t));this.current.fillAlpha<1&&p.setAttributeNS(null,"fill-opacity",this.current.fillAlpha);this._ensureTransformGroup().append(p)}_makeColorN_Pattern(t){return"TilingPattern"===t[0]?this._makeTilingPattern(t):this._makeShadingPattern(t)}_makeTilingPattern(t){const e=t[1],i=t[2],r=t[3]||s.IDENTITY_MATRIX,[a,n,o,l]=t[4],c=t[5],d=t[6],h=t[7],u="shading"+g++,[p,f,m,v]=s.Util.normalizeRect([...s.Util.applyTransform([a,n],r),...s.Util.applyTransform([o,l],r)]),[_,b]=s.Util.singularValueDecompose2dScale(r),y=c*_,A=d*b,P=this.svgFactory.createElement("svg:pattern");P.setAttributeNS(null,"id",u);P.setAttributeNS(null,"patternUnits","userSpaceOnUse");P.setAttributeNS(null,"width",y);P.setAttributeNS(null,"height",A);P.setAttributeNS(null,"x",`${p}`);P.setAttributeNS(null,"y",`${f}`);const S=this.svg,x=this.transformMatrix,w=this.current.fillColor,E=this.current.strokeColor,C=this.svgFactory.create(m-p,v-f);this.svg=C;this.transformMatrix=r;if(2===h){const t=s.Util.makeHexColor(...e);this.current.fillColor=t;this.current.strokeColor=t}this.executeOpTree(this.convertOpList(i));this.svg=S;this.transformMatrix=x;this.current.fillColor=w;this.current.strokeColor=E;P.append(C.childNodes[0]);this.defs.append(P);return`url(#${u})`}_makeShadingPattern(t){"string"==typeof t&&(t=this.objs.get(t));switch(t[0]){case"RadialAxial":const e="shading"+g++,i=t[3];let r;switch(t[1]){case"axial":const i=t[4],s=t[5];r=this.svgFactory.createElement("svg:linearGradient");r.setAttributeNS(null,"id",e);r.setAttributeNS(null,"gradientUnits","userSpaceOnUse");r.setAttributeNS(null,"x1",i[0]);r.setAttributeNS(null,"y1",i[1]);r.setAttributeNS(null,"x2",s[0]);r.setAttributeNS(null,"y2",s[1]);break;case"radial":const a=t[4],n=t[5],o=t[6],l=t[7];r=this.svgFactory.createElement("svg:radialGradient");r.setAttributeNS(null,"id",e);r.setAttributeNS(null,"gradientUnits","userSpaceOnUse");r.setAttributeNS(null,"cx",n[0]);r.setAttributeNS(null,"cy",n[1]);r.setAttributeNS(null,"r",l);r.setAttributeNS(null,"fx",a[0]);r.setAttributeNS(null,"fy",a[1]);r.setAttributeNS(null,"fr",o);break;default:throw new Error(`Unknown RadialAxial type: ${t[1]}`)}for(const t of i){const e=this.svgFactory.createElement("svg:stop");e.setAttributeNS(null,"offset",t[0]);e.setAttributeNS(null,"stop-color",t[1]);r.append(e)}this.defs.append(r);return`url(#${e})`;case"Mesh":(0,s.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error(`Unknown IR type: ${t[0]}`)}}setDash(t,e){this.current.dashArray=t;this.current.dashPhase=e}constructPath(t,e){const i=this.current;let r=i.x,a=i.y,n=[],o=0;for(const i of t)switch(0|i){case s.OPS.rectangle:r=e[o++];a=e[o++];const t=r+e[o++],i=a+e[o++];n.push("M",pf(r),pf(a),"L",pf(t),pf(a),"L",pf(t),pf(i),"L",pf(r),pf(i),"Z");break;case s.OPS.moveTo:r=e[o++];a=e[o++];n.push("M",pf(r),pf(a));break;case s.OPS.lineTo:r=e[o++];a=e[o++];n.push("L",pf(r),pf(a));break;case s.OPS.curveTo:r=e[o+4];a=e[o+5];n.push("C",pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]),pf(r),pf(a));o+=6;break;case s.OPS.curveTo2:n.push("C",pf(r),pf(a),pf(e[o]),pf(e[o+1]),pf(e[o+2]),pf(e[o+3]));r=e[o+2];a=e[o+3];o+=4;break;case s.OPS.curveTo3:r=e[o+2];a=e[o+3];n.push("C",pf(e[o]),pf(e[o+1]),pf(r),pf(a),pf(r),pf(a));o+=4;break;case s.OPS.closePath:n.push("Z")}n=n.join(" ");if(i.path&&t.length>0&&t[0]!==s.OPS.rectangle&&t[0]!==s.OPS.moveTo)n=i.path.getAttributeNS(null,"d")+n;else{i.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().append(i.path)}i.path.setAttributeNS(null,"d",n);i.path.setAttributeNS(null,"fill","none");i.element=i.path;i.setCurrentPoint(r,a)}endPath(){const t=this.current;t.path=null;if(!this.pendingClip)return;if(!t.element){this.pendingClip=null;return}const e="clippath"+p++,i=this.svgFactory.createElement("svg:clipPath");i.setAttributeNS(null,"id",e);i.setAttributeNS(null,"transform",pm(this.transformMatrix));const r=t.element.cloneNode(!0);"evenodd"===this.pendingClip?r.setAttributeNS(null,"clip-rule","evenodd"):r.setAttributeNS(null,"clip-rule","nonzero");this.pendingClip=null;i.append(r);this.defs.append(i);if(t.activeClipUrl){t.clipGroup=null;for(const t of this.extraStack)t.clipGroup=null;i.setAttributeNS(null,"clip-path",t.activeClipUrl)}t.activeClipUrl=`url(#${e})`;this.tgrp=null}clip(t){this.pendingClip=t}closePath(){const t=this.current;if(t.path){const e=`${t.path.getAttributeNS(null,"d")}Z`;t.path.setAttributeNS(null,"d",e)}}setLeading(t){this.current.leading=-t}setTextRise(t){this.current.textRise=t}setTextRenderingMode(t){this.current.textRenderingMode=t}setHScale(t){this.current.textHScale=t/100}setRenderingIntent(t){}setFlatness(t){}setGState(t){for(const[e,i]of t)switch(e){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i);break;case"CA":this.setStrokeAlpha(i);break;case"ca":this.setFillAlpha(i);break;default:(0,s.warn)(`Unimplemented graphic state operator ${e}`)}}fill(){const t=this.current;if(t.element){t.element.setAttributeNS(null,"fill",t.fillColor);t.element.setAttributeNS(null,"fill-opacity",t.fillAlpha);this.endPath()}}stroke(){const t=this.current;if(t.element){this._setStrokeAttributes(t.element);t.element.setAttributeNS(null,"fill","none");this.endPath()}}_setStrokeAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=this.current;let r=i.dashArray;1!==e&&r.length>0&&(r=r.map((function(t){return e*t})));t.setAttributeNS(null,"stroke",i.strokeColor);t.setAttributeNS(null,"stroke-opacity",i.strokeAlpha);t.setAttributeNS(null,"stroke-miterlimit",pf(i.miterLimit));t.setAttributeNS(null,"stroke-linecap",i.lineCap);t.setAttributeNS(null,"stroke-linejoin",i.lineJoin);t.setAttributeNS(null,"stroke-width",pf(e*i.lineWidth)+"px");t.setAttributeNS(null,"stroke-dasharray",r.map(pf).join(" "));t.setAttributeNS(null,"stroke-dashoffset",pf(e*i.dashPhase)+"px")}eoFill(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd");this.fill()}fillStroke(){this.stroke();this.fill()}eoFillStroke(){var t;null===(t=this.current.element)||void 0===t||t.setAttributeNS(null,"fill-rule","evenodd");this.fillStroke()}closeStroke(){this.closePath();this.stroke()}closeFillStroke(){this.closePath();this.fillStroke()}closeEOFillStroke(){this.closePath();this.eoFillStroke()}paintSolidColorImageMask(){const t=this.svgFactory.createElement("svg:rect");t.setAttributeNS(null,"x","0");t.setAttributeNS(null,"y","0");t.setAttributeNS(null,"width","1px");t.setAttributeNS(null,"height","1px");t.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().append(t)}paintImageXObject(t){const e=t.startsWith("g_")?this.commonObjs.get(t):this.objs.get(t);e?this.paintInlineImageXObject(e):(0,s.warn)(`Dependent image with object ID ${t} is not ready yet`)}paintInlineImageXObject(t,e){const i=t.width,r=t.height,s=u(t,this.forceDataSchema,!!e),a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x","0");a.setAttributeNS(null,"y","0");a.setAttributeNS(null,"width",pf(i));a.setAttributeNS(null,"height",pf(r));this.current.element=a;this.clip("nonzero");const n=this.svgFactory.createElement("svg:image");n.setAttributeNS(c,"xlink:href",s);n.setAttributeNS(null,"x","0");n.setAttributeNS(null,"y",pf(-r));n.setAttributeNS(null,"width",pf(i)+"px");n.setAttributeNS(null,"height",pf(r)+"px");n.setAttributeNS(null,"transform",`scale(${pf(1/i)} ${pf(-1/r)})`);e?e.append(n):this._ensureTransformGroup().append(n)}paintImageMaskXObject(t){const e=this.current,i=t.width,r=t.height,s=e.fillColor;e.maskId="mask"+f++;const a=this.svgFactory.createElement("svg:mask");a.setAttributeNS(null,"id",e.maskId);const n=this.svgFactory.createElement("svg:rect");n.setAttributeNS(null,"x","0");n.setAttributeNS(null,"y","0");n.setAttributeNS(null,"width",pf(i));n.setAttributeNS(null,"height",pf(r));n.setAttributeNS(null,"fill",s);n.setAttributeNS(null,"mask",`url(#${e.maskId})`);this.defs.append(a);this._ensureTransformGroup().append(n);this.paintInlineImageXObject(t,a)}paintFormXObjectBegin(t,e){Array.isArray(t)&&6===t.length&&this.transform(t[0],t[1],t[2],t[3],t[4],t[5]);if(e){const t=e[2]-e[0],i=e[3]-e[1],r=this.svgFactory.createElement("svg:rect");r.setAttributeNS(null,"x",e[0]);r.setAttributeNS(null,"y",e[1]);r.setAttributeNS(null,"width",pf(t));r.setAttributeNS(null,"height",pf(i));this.current.element=r;this.clip("nonzero");this.endPath()}}paintFormXObjectEnd(){}_initialize(t){const e=this.svgFactory.create(t.width,t.height),i=this.svgFactory.createElement("svg:defs");e.append(i);this.defs=i;const r=this.svgFactory.createElement("svg:g");r.setAttributeNS(null,"transform",pm(t.transform));e.append(r);this.svg=r;return e}_ensureClipGroup(){if(!this.current.clipGroup){const t=this.svgFactory.createElement("svg:g");t.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.append(t);this.current.clipGroup=t}return this.current.clipGroup}_ensureTransformGroup(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",pm(this.transformMatrix));this.current.activeClipUrl?this._ensureClipGroup().append(this.tgrp):this.svg.append(this.tgrp)}return this.tgrp}}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNodeStream=void 0;var r=i(1),s=i(161);const a=require("fs"),n=require("http"),o=require("https"),l=require("url"),c=/^file:\/\/\/[a-zA-Z]:\//;e.PDFNodeStream=class PDFNodeStream{constructor(t){this.source=t;this.url=function parseUrl(t){const e=l.parse(t);if("file:"===e.protocol||e.host)return e;if(/^[a-z]:[/\\]/i.test(t))return l.parse(`file:///${t}`);e.host||(e.protocol="file:");return e}(t.url);this.isHttp="http:"===this.url.protocol||"https:"===this.url.protocol;this.isFsUrl="file:"===this.url.protocol;this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new PDFNodeStreamFsFullReader(this):new PDFNodeStreamFullReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=this.isFsUrl?new PDFNodeStreamFsRangeReader(this,t,e):new PDFNodeStreamRangeReader(this,t,e);this._rangeRequestReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class BaseFullReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;const e=t.source;this._contentLength=e.length;this._loaded=0;this._filename=null;this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._readableStream=null;this._readCapability=(0,r.createPromiseCapability)();this._headersCapability=(0,r.createPromiseCapability)()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e){this._readCapability=(0,r.createPromiseCapability)();return this.read()}this._loaded+=e.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t;this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t;t.on("readable",(()=>{this._readCapability.resolve()}));t.on("end",(()=>{t.destroy();this._done=!0;this._readCapability.resolve()}));t.on("error",(t=>{this._error(t)}));!this._isStreamingSupported&&this._isRangeSupported&&this._error(new r.AbortException("streaming is disabled"));this._storedError&&this._readableStream.destroy(this._storedError)}}class BaseRangeReader{constructor(t){this._url=t.url;this._done=!1;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,r.createPromiseCapability)();const e=t.source;this._isStreamingSupported=!e.disableStream}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;if(this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();if(null===e){this._readCapability=(0,r.createPromiseCapability)();return this.read()}this._loaded+=e.length;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){this._readableStream?this._readableStream.destroy(t):this._error(t)}_error(t){this._storedError=t;this._readCapability.resolve()}_setReadableStream(t){this._readableStream=t;t.on("readable",(()=>{this._readCapability.resolve()}));t.on("end",(()=>{t.destroy();this._done=!0;this._readCapability.resolve()}));t.on("error",(t=>{this._error(t)}));this._storedError&&this._readableStream.destroy(this._storedError)}}function createRequestOptions(t,e){return{protocol:t.protocol,auth:t.auth,host:t.hostname,port:t.port,path:t.path,method:"GET",headers:e}}class PDFNodeStreamFullReader extends BaseFullReader{constructor(t){super(t);const handleResponse=e=>{if(404===e.statusCode){const t=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t;this._headersCapability.reject(t);return}this._headersCapability.resolve();this._setReadableStream(e);const getResponseHeader=t=>this._readableStream.headers[t.toLowerCase()],{allowRangeRequests:i,suggestedLength:a}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:t.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=i;this._contentLength=a||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader)};this._request=null;"http:"===this._url.protocol?this._request=n.request(createRequestOptions(this._url,t.httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,t.httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t;this._headersCapability.reject(t)}));this._request.end()}}class PDFNodeStreamRangeReader extends BaseRangeReader{constructor(t,e,i){super(t);this._httpHeaders={};for(const e in t.httpHeaders){const i=t.httpHeaders[e];void 0!==i&&(this._httpHeaders[e]=i)}this._httpHeaders.Range=`bytes=${e}-${i-1}`;const handleResponse=t=>{if(404!==t.statusCode)this._setReadableStream(t);else{const t=new r.MissingPDFException(`Missing PDF "${this._url}".`);this._storedError=t}};this._request=null;"http:"===this._url.protocol?this._request=n.request(createRequestOptions(this._url,this._httpHeaders),handleResponse):this._request=o.request(createRequestOptions(this._url,this._httpHeaders),handleResponse);this._request.on("error",(t=>{this._storedError=t}));this._request.end()}}class PDFNodeStreamFsFullReader extends BaseFullReader{constructor(t){super(t);let e=decodeURIComponent(this._url.path);c.test(this._url.href)&&(e=e.replace(/^\//,""));a.lstat(e,((t,i)=>{if(t){"ENOENT"===t.code&&(t=new r.MissingPDFException(`Missing PDF "${e}".`));this._storedError=t;this._headersCapability.reject(t)}else{this._contentLength=i.size;this._setReadableStream(a.createReadStream(e));this._headersCapability.resolve()}}))}}class PDFNodeStreamFsRangeReader extends BaseRangeReader{constructor(t,e,i){super(t);let r=decodeURIComponent(this._url.path);c.test(this._url.href)&&(r=r.replace(/^\//,""));this._setReadableStream(a.createReadStream(r,{start:e,end:i-1}))}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.createResponseStatusError=function createResponseStatusError(t,e){if(404===t||0===t&&e.startsWith("file:"))return new r.MissingPDFException('Missing PDF "'+e+'".');return new r.UnexpectedResponseException(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t)};e.extractFilenameFromHeader=function extractFilenameFromHeader(t){const e=t("Content-Disposition");if(e){let t=(0,s.getFilenameFromContentDispositionHeader)(e);if(t.includes("%"))try{t=decodeURIComponent(t)}catch(t){}if((0,a.isPdfFile)(t))return t}return null};e.validateRangeRequestCapabilities=function validateRangeRequestCapabilities(t){let{getResponseHeader:e,isHttp:i,rangeChunkSize:r,disableRange:s}=t;const a={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(e("Content-Length"),10);if(!Number.isInteger(n))return a;a.suggestedLength=n;if(n<=2*r)return a;if(s||!i)return a;if("bytes"!==e("Accept-Ranges"))return a;if("identity"!==(e("Content-Encoding")||"identity"))return a;a.allowRangeRequests=!0;return a};e.validateResponseStatus=function validateResponseStatus(t){return 200===t||206===t};var r=i(1),s=i(162),a=i(136)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.getFilenameFromContentDispositionHeader=function getFilenameFromContentDispositionHeader(t){let e=!0,i=toParamRegExp("filename\\*","i").exec(t);if(i){i=i[1];let t=rfc2616unquote(i);t=unescape(t);t=rfc5987decode(t);t=rfc2047decode(t);return fixupEncoding(t)}i=function rfc2231getparam(t){const e=[];let i;const r=toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;null!==(i=r.exec(t));){let[,t,r,s]=i;t=parseInt(t,10);if(t in e){if(0===t)break}else e[t]=[r,s]}const s=[];for(let t=0;t<e.length&&t in e;++t){let[i,r]=e[t];r=rfc2616unquote(r);if(i){r=unescape(r);0===t&&(r=rfc5987decode(r))}s.push(r)}return s.join("")}(t);if(i){return fixupEncoding(rfc2047decode(i))}i=toParamRegExp("filename","i").exec(t);if(i){i=i[1];let t=rfc2616unquote(i);t=rfc2047decode(t);return fixupEncoding(t)}function toParamRegExp(t,e){return new RegExp("(?:^|;)\\s*"+t+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',e)}function textdecode(t,i){if(t){if(!/^[\x00-\xFF]+$/.test(i))return i;try{const s=new TextDecoder(t,{fatal:!0}),a=(0,r.stringToBytes)(i);i=s.decode(a);e=!1}catch(t){}}return i}function fixupEncoding(t){if(e&&/[\x80-\xff]/.test(t)){t=textdecode("utf-8",t);e&&(t=textdecode("iso-8859-1",t))}return t}function rfc2616unquote(t){if(t.startsWith('"')){const e=t.slice(1).split('\\"');for(let t=0;t<e.length;++t){const i=e[t].indexOf('"');if(-1!==i){e[t]=e[t].slice(0,i);e.length=t+1}e[t]=e[t].replace(/\\(.)/g,"$1")}t=e.join('"')}return t}function rfc5987decode(t){const e=t.indexOf("'");if(-1===e)return t;return textdecode(t.slice(0,e),t.slice(e+1).replace(/^[^']*'/,""))}function rfc2047decode(t){return!t.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(t)?t:t.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(t,e,i,r){if("q"===i||"Q"===i)return textdecode(e,r=(r=r.replace(/_/g," ")).replace(/=([0-9a-fA-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt(e,16))})));try{r=atob(r)}catch(t){}return textdecode(e,r)}))}return""};var r=i(1)},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFNetworkStream=void 0;var r=i(1),s=i(161);class NetworkManager{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.url=t;this.isHttp=/^https?:/i.test(t);this.httpHeaders=this.isHttp&&e.httpHeaders||Object.create(null);this.withCredentials=e.withCredentials||!1;this.getXhr=e.getXhr||function NetworkManager_getXhr(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}requestRange(t,e,i){const r={begin:t,end:e};for(const t in i)r[t]=i[t];return this.request(r)}requestFull(t){return this.request(t)}request(t){const e=this.getXhr(),i=this.currXhrId++,r=this.pendingRequests[i]={xhr:e};e.open("GET",this.url);e.withCredentials=this.withCredentials;for(const t in this.httpHeaders){const i=this.httpHeaders[t];void 0!==i&&e.setRequestHeader(t,i)}if(this.isHttp&&"begin"in t&&"end"in t){e.setRequestHeader("Range",`bytes=${t.begin}-${t.end-1}`);r.expectedStatus=206}else r.expectedStatus=200;e.responseType="arraybuffer";t.onError&&(e.onerror=function(i){t.onError(e.status)});e.onreadystatechange=this.onStateChange.bind(this,i);e.onprogress=this.onProgress.bind(this,i);r.onHeadersReceived=t.onHeadersReceived;r.onDone=t.onDone;r.onError=t.onError;r.onProgress=t.onProgress;e.send(null);return i}onProgress(t,e){var i;const r=this.pendingRequests[t];r&&(null===(i=r.onProgress)||void 0===i||i.call(r,e))}onStateChange(t,e){const i=this.pendingRequests[t];if(!i)return;const s=i.xhr;if(s.readyState>=2&&i.onHeadersReceived){i.onHeadersReceived();delete i.onHeadersReceived}if(4!==s.readyState)return;if(!(t in this.pendingRequests))return;delete this.pendingRequests[t];if(0===s.status&&this.isHttp){var a;null===(a=i.onError)||void 0===a||a.call(i,s.status);return}const n=s.status||200;if(!(200===n&&206===i.expectedStatus)&&n!==i.expectedStatus){var o;null===(o=i.onError)||void 0===o||o.call(i,s.status);return}const l=function getArrayBuffer(t){const e=t.response;return"string"!=typeof e?e:(0,r.stringToBytes)(e).buffer}(s);if(206===n){const t=s.getResponseHeader("Content-Range"),e=/bytes (\d+)-(\d+)\/(\d+)/.exec(t);i.onDone({begin:parseInt(e[1],10),chunk:l})}else if(l)i.onDone({begin:0,chunk:l});else{var c;null===(c=i.onError)||void 0===c||c.call(i,s.status)}}getRequestXhr(t){return this.pendingRequests[t].xhr}isPendingRequest(t){return t in this.pendingRequests}abortRequest(t){const e=this.pendingRequests[t].xhr;delete this.pendingRequests[t];e.abort()}}e.PDFNetworkStream=class PDFNetworkStream{constructor(t){this._source=t;this._manager=new NetworkManager(t.url,{httpHeaders:t.httpHeaders,withCredentials:t.withCredentials});this._rangeChunkSize=t.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(t){const e=this._rangeRequestReaders.indexOf(t);e>=0&&this._rangeRequestReaders.splice(e,1)}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new PDFNetworkStreamFullRequestReader(this._manager,this._source);return this._fullRequestReader}getRangeReader(t,e){const i=new PDFNetworkStreamRangeRequestReader(this._manager,t,e);i.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFNetworkStreamFullRequestReader{constructor(t,e){this._manager=t;const i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url;this._fullRequestId=t.requestFull(i);this._headersReceivedCapability=(0,r.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._contentLength=e.length;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._isStreamingSupported=!1;this._isRangeSupported=!1;this._cachedChunks=[];this._requests=[];this._done=!1;this._storedError=void 0;this._filename=null;this.onProgress=null}_onHeadersReceived(){const t=this._fullRequestId,e=this._manager.getRequestXhr(t),getResponseHeader=t=>e.getResponseHeader(t),{allowRangeRequests:i,suggestedLength:r}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});i&&(this._isRangeSupported=!0);this._contentLength=r||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader);this._isRangeSupported&&this._manager.abortRequest(t);this._headersReceivedCapability.resolve()}_onDone(t){if(t)if(this._requests.length>0){this._requests.shift().resolve({value:t.chunk,done:!1})}else this._cachedChunks.push(t.chunk);this._done=!0;if(!(this._cachedChunks.length>0)){for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(t){this._storedError=(0,s.createResponseStatusError)(t,this._url);this._headersReceivedCapability.reject(this._storedError);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._cachedChunks.length=0}_onProgress(t){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded,total:t.lengthComputable?t.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersReceivedCapability.promise}async read(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0){return{value:this._cachedChunks.shift(),done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,r.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;this._headersReceivedCapability.reject(t);for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId);this._fullRequestReader=null}}class PDFNetworkStreamRangeRequestReader{constructor(t,e,i){this._manager=t;const r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._requestId=t.requestRange(e,i,r);this._requests=[];this._queuedChunk=null;this._done=!1;this._storedError=void 0;this.onProgress=null;this.onClosed=null}_close(){var t;null===(t=this.onClosed)||void 0===t||t.call(this,this)}_onDone(t){const e=t.chunk;if(this._requests.length>0){this._requests.shift().resolve({value:e,done:!1})}else this._queuedChunk=e;this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._close()}_onError(t){this._storedError=(0,s.createResponseStatusError)(t,this._url);for(const t of this._requests)t.reject(this._storedError);this._requests.length=0;this._queuedChunk=null}_onProgress(t){if(!this.isStreamingSupported){var e;null===(e=this.onProgress)||void 0===e||e.call(this,{loaded:t.loaded})}}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(null!==this._queuedChunk){const t=this._queuedChunk;this._queuedChunk=null;return{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};const t=(0,r.createPromiseCapability)();this._requests.push(t);return t.promise}cancel(t){this._done=!0;for(const t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0;this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId);this._close()}}},(t,e,i)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.PDFFetchStream=void 0;var r=i(1),s=i(161);function createFetchOptions(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function createHeaders(t){const e=new Headers;for(const i in t){const r=t[i];void 0!==r&&e.append(i,r)}return e}e.PDFFetchStream=class PDFFetchStream{constructor(t){this.source=t;this.isHttp=/^https?:/i.test(t.url);this.httpHeaders=this.isHttp&&t.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}get _progressiveDataLength(){var t;return(null===(t=this._fullRequestReader)||void 0===t?void 0:t._loaded)??0}getFullReader(){(0,r.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new PDFFetchStreamReader(this);return this._fullRequestReader}getRangeReader(t,e){if(e<=this._progressiveDataLength)return null;const i=new PDFFetchStreamRangeReader(this,t,e);this._rangeRequestReaders.push(i);return i}cancelAllRequests(t){var e;null===(e=this._fullRequestReader)||void 0===e||e.cancel(t);for(const e of this._rangeRequestReaders.slice(0))e.cancel(t)}};class PDFFetchStreamReader{constructor(t){this._stream=t;this._reader=null;this._loaded=0;this._filename=null;const e=t.source;this._withCredentials=e.withCredentials||!1;this._contentLength=e.length;this._headersCapability=(0,r.createPromiseCapability)();this._disableRange=e.disableRange||!1;this._rangeChunkSize=e.rangeChunkSize;this._rangeChunkSize||this._disableRange||(this._disableRange=!0);this._abortController=new AbortController;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._headers=createHeaders(this._stream.httpHeaders);const i=e.url;fetch(i,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,i);this._reader=t.body.getReader();this._headersCapability.resolve();const getResponseHeader=e=>t.headers.get(e),{allowRangeRequests:e,suggestedLength:a}=(0,s.validateRangeRequestCapabilities)({getResponseHeader:getResponseHeader,isHttp:this._stream.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=e;this._contentLength=a||this._contentLength;this._filename=(0,s.extractFilenameFromHeader)(getResponseHeader);!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new r.AbortException("Streaming is disabled."))})).catch(this._headersCapability.reject);this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();if(i)return{value:e,done:i};this._loaded+=e.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded,total:this._contentLength});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t);this._abortController.abort()}}class PDFFetchStreamRangeReader{constructor(t,e,i){this._stream=t;this._reader=null;this._loaded=0;const a=t.source;this._withCredentials=a.withCredentials||!1;this._readCapability=(0,r.createPromiseCapability)();this._isStreamingSupported=!a.disableStream;this._abortController=new AbortController;this._headers=createHeaders(this._stream.httpHeaders);this._headers.append("Range",`bytes=${e}-${i-1}`);const n=a.url;fetch(n,createFetchOptions(this._headers,this._withCredentials,this._abortController)).then((t=>{if(!(0,s.validateResponseStatus)(t.status))throw(0,s.createResponseStatusError)(t.status,n);this._readCapability.resolve();this._reader=t.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){var t;await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();if(i)return{value:e,done:i};this._loaded+=e.byteLength;null===(t=this.onProgress)||void 0===t||t.call(this,{loaded:this._loaded});return{value:new Uint8Array(e).buffer,done:!1}}cancel(t){var e;null===(e=this._reader)||void 0===e||e.cancel(t);this._abortController.abort()}}}],__webpack_module_cache__={};function __w_pdfjs_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};__webpack_modules__[t](i,i.exports,__w_pdfjs_require__);return i.exports}var __webpack_exports__={};(()=>{"use strict";var t=__webpack_exports__;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"AnnotationEditorLayer",{enumerable:!0,get:function(){return s.AnnotationEditorLayer}});Object.defineProperty(t,"AnnotationEditorParamsType",{enumerable:!0,get:function(){return e.AnnotationEditorParamsType}});Object.defineProperty(t,"AnnotationEditorType",{enumerable:!0,get:function(){return e.AnnotationEditorType}});Object.defineProperty(t,"AnnotationEditorUIManager",{enumerable:!0,get:function(){return a.AnnotationEditorUIManager}});Object.defineProperty(t,"AnnotationLayer",{enumerable:!0,get:function(){return n.AnnotationLayer}});Object.defineProperty(t,"AnnotationMode",{enumerable:!0,get:function(){return e.AnnotationMode}});Object.defineProperty(t,"CMapCompressionType",{enumerable:!0,get:function(){return e.CMapCompressionType}});Object.defineProperty(t,"GlobalWorkerOptions",{enumerable:!0,get:function(){return o.GlobalWorkerOptions}});Object.defineProperty(t,"InvalidPDFException",{enumerable:!0,get:function(){return e.InvalidPDFException}});Object.defineProperty(t,"MissingPDFException",{enumerable:!0,get:function(){return e.MissingPDFException}});Object.defineProperty(t,"OPS",{enumerable:!0,get:function(){return e.OPS}});Object.defineProperty(t,"PDFDataRangeTransport",{enumerable:!0,get:function(){return i.PDFDataRangeTransport}});Object.defineProperty(t,"PDFDateString",{enumerable:!0,get:function(){return r.PDFDateString}});Object.defineProperty(t,"PDFWorker",{enumerable:!0,get:function(){return i.PDFWorker}});Object.defineProperty(t,"PasswordResponses",{enumerable:!0,get:function(){return e.PasswordResponses}});Object.defineProperty(t,"PermissionFlag",{enumerable:!0,get:function(){return e.PermissionFlag}});Object.defineProperty(t,"PixelsPerInch",{enumerable:!0,get:function(){return r.PixelsPerInch}});Object.defineProperty(t,"RenderingCancelledException",{enumerable:!0,get:function(){return r.RenderingCancelledException}});Object.defineProperty(t,"SVGGraphics",{enumerable:!0,get:function(){return d.SVGGraphics}});Object.defineProperty(t,"UNSUPPORTED_FEATURES",{enumerable:!0,get:function(){return e.UNSUPPORTED_FEATURES}});Object.defineProperty(t,"UnexpectedResponseException",{enumerable:!0,get:function(){return e.UnexpectedResponseException}});Object.defineProperty(t,"Util",{enumerable:!0,get:function(){return e.Util}});Object.defineProperty(t,"VerbosityLevel",{enumerable:!0,get:function(){return e.VerbosityLevel}});Object.defineProperty(t,"XfaLayer",{enumerable:!0,get:function(){return h.XfaLayer}});Object.defineProperty(t,"build",{enumerable:!0,get:function(){return i.build}});Object.defineProperty(t,"createPromiseCapability",{enumerable:!0,get:function(){return e.createPromiseCapability}});Object.defineProperty(t,"createValidAbsoluteUrl",{enumerable:!0,get:function(){return e.createValidAbsoluteUrl}});Object.defineProperty(t,"getDocument",{enumerable:!0,get:function(){return i.getDocument}});Object.defineProperty(t,"getFilenameFromUrl",{enumerable:!0,get:function(){return r.getFilenameFromUrl}});Object.defineProperty(t,"getPdfFilenameFromUrl",{enumerable:!0,get:function(){return r.getPdfFilenameFromUrl}});Object.defineProperty(t,"getXfaPageViewport",{enumerable:!0,get:function(){return r.getXfaPageViewport}});Object.defineProperty(t,"isPdfFile",{enumerable:!0,get:function(){return r.isPdfFile}});Object.defineProperty(t,"loadScript",{enumerable:!0,get:function(){return r.loadScript}});Object.defineProperty(t,"renderTextLayer",{enumerable:!0,get:function(){return c.renderTextLayer}});Object.defineProperty(t,"shadow",{enumerable:!0,get:function(){return e.shadow}});Object.defineProperty(t,"version",{enumerable:!0,get:function(){return i.version}});var e=__w_pdfjs_require__(1),i=__w_pdfjs_require__(132),r=__w_pdfjs_require__(136),s=__w_pdfjs_require__(150),a=__w_pdfjs_require__(135),n=__w_pdfjs_require__(155),o=__w_pdfjs_require__(143),l=__w_pdfjs_require__(3),c=__w_pdfjs_require__(158),d=__w_pdfjs_require__(159),h=__w_pdfjs_require__(157);if(l.isNodeJS){const{PDFNodeStream:t}=__w_pdfjs_require__(160);(0,i.setPDFNetworkStreamFactory)((e=>new t(e)))}else{const{PDFNetworkStream:t}=__w_pdfjs_require__(163),{PDFFetchStream:e}=__w_pdfjs_require__(164);(0,i.setPDFNetworkStreamFactory)((i=>(0,r.isValidFetchUrl)(i.url)?new e(i):new t(i)))}})();return __webpack_exports__})()));\ No newline at end of filediff --git a/app/stage/protyle/js/pdf/pdf.worker.js b/app/stage/protyle/js/pdf/pdf.worker.jsindex 6c35d06ec9..1aa6ce8639 100644--- a/app/stage/protyle/js/pdf/pdf.worker.js+++ b/app/stage/protyle/js/pdf/pdf.worker.js@@ -1,6 +1,6 @@/*** @licstart The following is the entire license notice for the- * Javascript code in this page+ * JavaScript code in this page** Copyright 2022 Mozilla Foundation*@@ -17,6 +17,6 @@* limitations under the License.** @licend The above is the entire license notice for the- * Javascript code in this page+ * JavaScript code in this page*/-!function webpackUniversalModuleDefinition(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf.worker",[],r):"object"==typeof exports?exports["pdfjs-dist/build/pdf.worker"]=r():t["pdfjs-dist/build/pdf.worker"]=t.pdfjsWorker=r()}(this,(function(){return(()=>{var t=[,(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.WorkerTask=r.WorkerMessageHandler=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(146),h=o(147),d=o(207),g=o(213),m=o(6),y=o(241),v=o(242),k=o(149);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _toArray(t){return _arrayWithHoles(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||_nonIterableRest()}function _slicedToArray(t,r){return _arrayWithHoles(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _arrayWithHoles(t){if(Array.isArray(t))return t}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var _=function(){function WorkerTask(t){_classCallCheck(this,WorkerTask);this.name=t;this.terminated=!1;this._capability=(0,l.createPromiseCapability)()}_createClass(WorkerTask,[{key:"finished",get:function get(){return this._capability.promise}},{key:"finish",value:function finish(){this._capability.resolve()}},{key:"terminate",value:function terminate(){this.terminated=!0}},{key:"ensureNotTerminated",value:function ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}]);return WorkerTask}();r.WorkerTask=_;var w=function(){function WorkerMessageHandler(){_classCallCheck(this,WorkerMessageHandler)}_createClass(WorkerMessageHandler,null,[{key:"setup",value:function setup(t,r){var o=!1;t.on("test",(function wphSetupTest(r){if(!o){o=!0;t.send("test",r instanceof Uint8Array)}}));t.on("configure",(function wphConfigure(t){(0,l.setVerbosityLevel)(t.verbosity)}));t.on("GetDocRequest",(function wphSetupDoc(t){return WorkerMessageHandler.createDocumentHandler(t,r)}))}},{key:"createDocumentHandler",value:function createDocumentHandler(t,r){var o,w=!1,S=null,C=[],x=(0,l.getVerbosityLevel)(),O=t.apiVersion,T="2.14.102";if(O!==T)throw new Error('The API version "'.concat(O,'" does not match ')+'the Worker version "'.concat(T,'".'));var E=[];for(var M in[])E.push(M);if(E.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+E.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if("undefined"==typeof ReadableStream){var R="The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream`); ";if(m.isNodeJS)throw new Error(R+"please use a `legacy`-build instead.");throw new Error(R+"please update to a supported browser.")}var j=t.docId,D=t.docBaseUrl,L=t.docId+"_worker",N=new y.MessageHandler(L,j,r);function ensureNotTerminated(){if(w)throw new Error("Worker was terminated")}function startWorkerTask(t){C.push(t)}function finishWorkerTask(t){t.finish();var r=C.indexOf(t);C.splice(r,1)}function loadDocument(t){return _loadDocument.apply(this,arguments)}function _loadDocument(){return(_loadDocument=_asyncToGenerator(c.default.mark((function _callee(t){var r,l,u,h,d,g,m;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:c.next=2;return o.ensureDoc("checkHeader");case 2:c.next=4;return o.ensureDoc("parseStartXRef");case 4:c.next=6;return o.ensureDoc("parse",[t]);case 6:c.next=8;return o.ensureDoc("checkFirstPage",[t]);case 8:c.next=10;return o.ensureDoc("checkLastPage",[t]);case 10:c.next=12;return o.ensureDoc("isPureXfa");case 12:if(!(r=c.sent)){c.next=18;break}startWorkerTask(l=new _("loadXfaFonts"));c.next=18;return Promise.all([o.loadXfaFonts(N,l).catch((function(t){})).then((function(){return finishWorkerTask(l)})),o.loadXfaImages()]);case 18:c.next=20;return Promise.all([o.ensureDoc("numPages"),o.ensureDoc("fingerprints")]);case 20:u=c.sent;h=_slicedToArray(u,2);d=h[0];g=h[1];if(!r){c.next=30;break}c.next=27;return o.ensureDoc("htmlForXfa");case 27:c.t0=c.sent;c.next=31;break;case 30:c.t0=null;case 31:m=c.t0;return c.abrupt("return",{numPages:d,fingerprints:g,htmlForXfa:m});case 33:case"end":return c.stop()}}),_callee)})))).apply(this,arguments)}function getPdfManager(t,r,o){var c,u=(0,l.createPromiseCapability)(),d=t.source;if(d.data){try{c=new h.LocalPdfManager(j,d.data,d.password,N,r,o,D);u.resolve(c)}catch(t){u.reject(t)}return u.promise}var g,m=[];try{g=new v.PDFWorkerStream(N)}catch(t){u.reject(t);return u.promise}var y=g.getFullReader();y.headersReady.then((function(){if(y.isRangeSupported){var t=d.disableAutoFetch||y.isStreamingSupported;c=new h.NetworkPdfManager(j,g,{msgHandler:N,password:d.password,length:y.contentLength,disableAutoFetch:t,rangeChunkSize:d.rangeChunkSize},r,o,D);for(var l=0;l<m.length;l++)c.sendProgressiveData(m[l]);m=[];u.resolve(c);S=null}})).catch((function(t){u.reject(t);S=null}));var k=0;new Promise((function(t,g){y.read().then((function readChunk(t){var v=t.value,_=t.done;try{ensureNotTerminated();if(_){c||function flushChunks(){var t=(0,l.arraysToBytes)(m);d.length&&t.length!==d.length&&(0,l.warn)("reported HTTP length is different from actual");try{c=new h.LocalPdfManager(j,t,d.password,N,r,o,D);u.resolve(c)}catch(t){u.reject(t)}m=[]}();S=null;return}k+=(0,l.arrayByteLength)(v);y.isStreamingSupported||N.send("DocProgress",{loaded:k,total:Math.max(k,y.contentLength||0)});c?c.sendProgressiveData(v):m.push(v);y.read().then(readChunk,g)}catch(t){g(t)}}),g)})).catch((function(t){u.reject(t);S=null}));S=function cancelXHRs(t){g.cancelAllRequests(t)};return u.promise}N.on("GetPage",(function wphSetupGetPage(t){return o.getPage(t.pageIndex).then((function(t){return Promise.all([o.ensure(t,"rotate"),o.ensure(t,"ref"),o.ensure(t,"userUnit"),o.ensure(t,"view")]).then((function(t){var r=_slicedToArray(t,4);return{rotate:r[0],ref:r[1],userUnit:r[2],view:r[3]}}))}))}));N.on("GetPageIndex",(function wphSetupGetPageIndex(t){var r=u.Ref.get(t.num,t.gen);return o.ensureCatalog("getPageIndex",[r])}));N.on("GetDestinations",(function wphSetupGetDestinations(t){return o.ensureCatalog("destinations")}));N.on("GetDestination",(function wphSetupGetDestination(t){return o.ensureCatalog("getDestination",[t.id])}));N.on("GetPageLabels",(function wphSetupGetPageLabels(t){return o.ensureCatalog("pageLabels")}));N.on("GetPageLayout",(function wphSetupGetPageLayout(t){return o.ensureCatalog("pageLayout")}));N.on("GetPageMode",(function wphSetupGetPageMode(t){return o.ensureCatalog("pageMode")}));N.on("GetViewerPreferences",(function(t){return o.ensureCatalog("viewerPreferences")}));N.on("GetOpenAction",(function(t){return o.ensureCatalog("openAction")}));N.on("GetAttachments",(function wphSetupGetAttachments(t){return o.ensureCatalog("attachments")}));N.on("GetJavaScript",(function wphSetupGetJavaScript(t){return o.ensureCatalog("javaScript")}));N.on("GetDocJSActions",(function wphSetupGetDocJSActions(t){return o.ensureCatalog("jsActions")}));N.on("GetPageJSActions",(function(t){var r=t.pageIndex;return o.getPage(r).then((function(t){return o.ensure(t,"jsActions")}))}));N.on("GetOutline",(function wphSetupGetOutline(t){return o.ensureCatalog("documentOutline")}));N.on("GetOptionalContentConfig",(function(t){return o.ensureCatalog("optionalContentConfig")}));N.on("GetPermissions",(function(t){return o.ensureCatalog("permissions")}));N.on("GetMetadata",(function wphSetupGetMetadata(t){return Promise.all([o.ensureDoc("documentInfo"),o.ensureCatalog("metadata")])}));N.on("GetMarkInfo",(function wphSetupGetMarkInfo(t){return o.ensureCatalog("markInfo")}));N.on("GetData",(function wphSetupGetData(t){o.requestLoadedStream();return o.onLoadedStream().then((function(t){return t.bytes}))}));N.on("GetAnnotations",(function(t){var r=t.pageIndex,c=t.intent;return o.getPage(r).then((function(t){return t.getAnnotationsData(c)}))}));N.on("GetFieldObjects",(function(t){return o.ensureDoc("fieldObjects")}));N.on("HasJSActions",(function(t){return o.ensureDoc("hasJSActions")}));N.on("GetCalculationOrderIds",(function(t){return o.ensureDoc("calculationOrderIds")}));N.on("SaveDocument",(function(t){var r=t.isPureXfa,c=t.numPages,h=t.annotationStorage,d=t.filename;o.requestLoadedStream();var m=[o.onLoadedStream(),o.ensureCatalog("acroForm"),o.ensureCatalog("acroFormRef"),o.ensureDoc("xref"),o.ensureDoc("startXRef")];if(r)m.push(o.serializeXfaData(h));else for(var y=function _loop(t){m.push(o.getPage(t).then((function(r){var o=new _("Save: page ".concat(t));return r.save(N,o,h).finally((function(){finishWorkerTask(o)}))})))},v=0;v<c;v++)y(v);return Promise.all(m).then((function(t){var o=_toArray(t),c=o[0],h=o[1],m=o[2],y=o[3],v=o[4],k=o.slice(5),_=[],w=null;if(r){if(!(w=k[0]))return c.bytes}else{var S,C=_createForOfIteratorHelper(k);try{for(C.s();!(S=C.n()).done;){_=S.value.filter((function(t){return null!==t})).reduce((function(t,r){return t.concat(r)}),_)}}catch(t){C.e(t)}finally{C.f()}if(0===_.length)return c.bytes}var x=h instanceof u.Dict&&h.get("XFA")||null,O=null,T=!1;if(Array.isArray(x)){for(var E=0,M=x.length;E<M;E+=2)if("datasets"===x[E]){O=x[E+1];m=null;T=!0}null===O&&(O=y.getNewRef())}else if(x){m=null;(0,l.warn)("Unsupported XFA type.")}var R=Object.create(null);if(y.trailer){var j=Object.create(null),D=y.trailer.get("Info")||null;D instanceof u.Dict&&D.forEach((function(t,r){"string"==typeof r&&(j[t]=(0,l.stringToPDFString)(r))}));R={rootRef:y.trailer.getRaw("Root")||null,encryptRef:y.trailer.getRaw("Encrypt")||null,newRef:y.getNewRef(),infoRef:y.trailer.getRaw("Info")||null,info:j,fileIds:y.trailer.get("ID")||null,startXRef:v,filename:d}}y.resetNewRef();return(0,g.incrementalUpdate)({originalData:c.bytes,xrefInfo:R,newRefs:_,xref:y,hasXfa:!!x,xfaDatasetsRef:O,hasXfaDatasetsEntry:T,acroFormRef:m,acroForm:h,xfaData:w})}))}));N.on("GetOperatorList",(function wphSetupRenderPage(t,r){var c=t.pageIndex;o.getPage(c).then((function(o){var u=new _("GetOperatorList: page ".concat(c));startWorkerTask(u);var h=x>=l.VerbosityLevel.INFOS?Date.now():0;o.getOperatorList({handler:N,sink:r,task:u,intent:t.intent,cacheKey:t.cacheKey,annotationStorage:t.annotationStorage}).then((function(t){finishWorkerTask(u);h&&(0,l.info)("page=".concat(c+1," - getOperatorList: time=")+"".concat(Date.now()-h,"ms, len=").concat(t.length));r.close()}),(function(t){finishWorkerTask(u);if(!u.terminated){N.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorOperatorList});r.error(t)}}))}))}));N.on("GetTextContent",(function wphExtractText(t,r){var c=t.pageIndex;o.getPage(c).then((function(o){var u=new _("GetTextContent: page "+c);startWorkerTask(u);var h=x>=l.VerbosityLevel.INFOS?Date.now():0;o.extractTextContent({handler:N,task:u,sink:r,includeMarkedContent:t.includeMarkedContent,combineTextItems:t.combineTextItems}).then((function(){finishWorkerTask(u);h&&(0,l.info)("page=".concat(c+1," - getTextContent: time=")+"".concat(Date.now()-h,"ms"));r.close()}),(function(t){finishWorkerTask(u);u.terminated||r.error(t)}))}))}));N.on("GetStructTree",(function wphGetStructTree(t){return o.getPage(t.pageIndex).then((function(t){return o.ensure(t,"getStructTree")}))}));N.on("FontFallback",(function(t){return o.fontFallback(t.id,N)}));N.on("Cleanup",(function wphCleanup(t){return o.cleanup(!0)}));N.on("Terminate",(function wphTerminate(t){w=!0;var r=[];if(o){o.terminate(new l.AbortException("Worker was terminated."));var c=o.cleanup();r.push(c);o=null}else(0,d.clearGlobalCaches)();S&&S(new l.AbortException("Worker was terminated."));var u,h=_createForOfIteratorHelper(C);try{for(h.s();!(u=h.n()).done;){var g=u.value;r.push(g.finished);g.terminate()}}catch(t){h.e(t)}finally{h.f()}return Promise.all(r).then((function(){N.destroy();N=null}))}));N.on("Ready",(function wphReady(r){!function setupDoc(t){function onSuccess(t){ensureNotTerminated();N.send("GetDoc",{pdfInfo:t})}function onFailure(t){ensureNotTerminated();if(t instanceof l.PasswordException){var r=new _("PasswordException: response ".concat(t.code));startWorkerTask(r);N.sendWithPromise("PasswordRequest",t).then((function(t){var c=t.password;finishWorkerTask(r);o.updatePassword(c);pdfManagerReady()})).catch((function(){finishWorkerTask(r);N.send("DocException",t)}))}else t instanceof l.InvalidPDFException||t instanceof l.MissingPDFException||t instanceof l.UnexpectedResponseException||t instanceof l.UnknownErrorException?N.send("DocException",t):N.send("DocException",new l.UnknownErrorException(t.message,t.toString()))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(t){ensureNotTerminated();if(t instanceof k.XRefParseException){o.requestLoadedStream();o.onLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)}))}else onFailure(t)}))}ensureNotTerminated();getPdfManager(t,{maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties,useSystemFonts:t.useSystemFonts,cMapUrl:t.cMapUrl,standardFontDataUrl:t.standardFontDataUrl},t.enableXfa).then((function(t){if(w){t.terminate(new l.AbortException("Worker was terminated."));throw new Error("Worker was terminated")}(o=t).onLoadedStream().then((function(t){N.send("DataLoaded",{length:t.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}(t);t=null}));return L}},{key:"initializeFromPort",value:function initializeFromPort(t){var r=new y.MessageHandler("worker","main",t);WorkerMessageHandler.setup(r,t);r.send("ready",null)}}]);return WorkerMessageHandler}();r.WorkerMessageHandler=w;"undefined"==typeof window&&!m.isNodeJS&&"undefined"!=typeof self&&function isMessagePort(t){return"function"==typeof t.postMessage&&"onmessage"in t}(self)&&w.initializeFromPort(self)},(t,r,o)=>{"use strict";t.exports=o(3)},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var c=function(t){var r,o=Object.prototype,c=o.hasOwnProperty,l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",h=l.asyncIterator||"@@asyncIterator",d=l.toStringTag||"@@toStringTag";function define(t,r,o){Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0});return t[r]}try{define({},"")}catch(t){define=function define(t,r,o){return t[r]=o}}function wrap(t,r,o,c){var l=r&&r.prototype instanceof Generator?r:Generator,u=Object.create(l.prototype),h=new Context(c||[]);u._invoke=function makeInvokeMethod(t,r,o){var c=g;return function invoke(l,u){if(c===y)throw new Error("Generator is already running");if(c===v){if("throw"===l)throw u;return doneResult()}o.method=l;o.arg=u;for(;;){var h=o.delegate;if(h){var d=maybeInvokeDelegate(h,o);if(d){if(d===k)continue;return d}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(c===g){c=v;throw o.arg}o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);c=y;var _=tryCatch(t,r,o);if("normal"===_.type){c=o.done?v:m;if(_.arg===k)continue;return{value:_.arg,done:o.done}}if("throw"===_.type){c=v;o.method="throw";o.arg=_.arg}}}}(t,o,h);return u}t.wrap=wrap;function tryCatch(t,r,o){try{return{type:"normal",arg:t.call(r,o)}}catch(t){return{type:"throw",arg:t}}}var g="suspendedStart",m="suspendedYield",y="executing",v="completed",k={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var _={};define(_,u,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(values([])));S&&S!==o&&c.call(S,u)&&(_=S);var C=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(_);GeneratorFunction.prototype=GeneratorFunctionPrototype;define(C,"constructor",GeneratorFunctionPrototype);define(GeneratorFunctionPrototype,"constructor",GeneratorFunction);GeneratorFunction.displayName=define(GeneratorFunctionPrototype,d,"GeneratorFunction");function defineIteratorMethods(t){["next","throw","return"].forEach((function(r){define(t,r,(function(t){return this._invoke(r,t)}))}))}t.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===GeneratorFunction||"GeneratorFunction"===(r.displayName||r.name))};t.mark=function(t){if(Object.setPrototypeOf)Object.setPrototypeOf(t,GeneratorFunctionPrototype);else{t.__proto__=GeneratorFunctionPrototype;define(t,d,"GeneratorFunction")}t.prototype=Object.create(C);return t};t.awrap=function(t){return{__await:t}};function AsyncIterator(t,r){function invoke(o,l,u,h){var d=tryCatch(t[o],t,l);if("throw"!==d.type){var g=d.arg,m=g.value;return m&&"object"===_typeof(m)&&c.call(m,"__await")?r.resolve(m.__await).then((function(t){invoke("next",t,u,h)}),(function(t){invoke("throw",t,u,h)})):r.resolve(m).then((function(t){g.value=t;u(g)}),(function(t){return invoke("throw",t,u,h)}))}h(d.arg)}var o;this._invoke=function enqueue(t,c){function callInvokeWithMethodAndArg(){return new r((function(r,o){invoke(t,c,r,o)}))}return o=o?o.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}defineIteratorMethods(AsyncIterator.prototype);define(AsyncIterator.prototype,h,(function(){return this}));t.AsyncIterator=AsyncIterator;t.async=function(r,o,c,l,u){void 0===u&&(u=Promise);var h=new AsyncIterator(wrap(r,o,c,l),u);return t.isGeneratorFunction(o)?h:h.next().then((function(t){return t.done?t.value:h.next()}))};function maybeInvokeDelegate(t,o){var c=t.iterator[o.method];if(c===r){o.delegate=null;if("throw"===o.method){if(t.iterator.return){o.method="return";o.arg=r;maybeInvokeDelegate(t,o);if("throw"===o.method)return k}o.method="throw";o.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}var l=tryCatch(c,t.iterator,o.arg);if("throw"===l.type){o.method="throw";o.arg=l.arg;o.delegate=null;return k}var u=l.arg;if(!u){o.method="throw";o.arg=new TypeError("iterator result is not an object");o.delegate=null;return k}if(!u.done)return u;o[t.resultName]=u.value;o.next=t.nextLoc;if("return"!==o.method){o.method="next";o.arg=r}o.delegate=null;return k}defineIteratorMethods(C);define(C,d,"Generator");define(C,u,(function(){return this}));define(C,"toString",(function(){return"[object Generator]"}));function pushTryEntry(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]);if(2 in t){r.finallyLoc=t[2];r.afterLoc=t[3]}this.tryEntries.push(r)}function resetTryEntry(t){var r=t.completion||{};r.type="normal";delete r.arg;t.completion=r}function Context(t){this.tryEntries=[{tryLoc:"root"}];t.forEach(pushTryEntry,this);this.reset(!0)}t.keys=function(t){var r=[];for(var o in t)r.push(o);r.reverse();return function next(){for(;r.length;){var o=r.pop();if(o in t){next.value=o;next.done=!1;return next}}next.done=!0;return next}};function values(t){if(t){var o=t[u];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var l=-1,h=function next(){for(;++l<t.length;)if(c.call(t,l)){next.value=t[l];next.done=!1;return next}next.value=r;next.done=!0;return next};return h.next=h}}return{next:doneResult}}t.values=values;function doneResult(){return{value:r,done:!0}}Context.prototype={constructor:Context,reset:function reset(t){this.prev=0;this.next=0;this.sent=this._sent=r;this.done=!1;this.delegate=null;this.method="next";this.arg=r;this.tryEntries.forEach(resetTryEntry);if(!t)for(var o in this)"t"===o.charAt(0)&&c.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=r)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var o=this;function handle(c,l){h.type="throw";h.arg=t;o.next=c;if(l){o.method="next";o.arg=r}return!!l}for(var l=this.tryEntries.length-1;l>=0;--l){var u=this.tryEntries[l],h=u.completion;if("root"===u.tryLoc)return handle("end");if(u.tryLoc<=this.prev){var d=c.call(u,"catchLoc"),g=c.call(u,"finallyLoc");if(d&&g){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0);if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}else if(d){if(this.prev<u.catchLoc)return handle(u.catchLoc,!0)}else{if(!g)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return handle(u.finallyLoc)}}}},abrupt:function abrupt(t,r){for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o];if(l.tryLoc<=this.prev&&c.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var u=l;break}}u&&("break"===t||"continue"===t)&&u.tryLoc<=r&&r<=u.finallyLoc&&(u=null);var h=u?u.completion:{};h.type=t;h.arg=r;if(u){this.method="next";this.next=u.finallyLoc;return k}return this.complete(h)},complete:function complete(t,r){if("throw"===t.type)throw t.arg;if("break"===t.type||"continue"===t.type)this.next=t.arg;else if("return"===t.type){this.rval=this.arg=t.arg;this.method="return";this.next="end"}else"normal"===t.type&&r&&(this.next=r);return k},finish:function finish(t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.finallyLoc===t){this.complete(o.completion,o.afterLoc);resetTryEntry(o);return k}}},catch:function _catch(t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc===t){var c=o.completion;if("throw"===c.type){var l=c.arg;resetTryEntry(o)}return l}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,o,c){this.delegate={iterator:values(t),resultName:o,nextLoc:c};"next"===this.method&&(this.arg=r);return k}};return t}("object"===_typeof(t=o.nmd(t))?t.exports:{});try{regeneratorRuntime=c}catch(t){"object"===("undefined"==typeof globalThis?"undefined":_typeof(globalThis))?globalThis.regeneratorRuntime=c:Function("r","regeneratorRuntime = r")(c)}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.VerbosityLevel=r.Util=r.UnknownErrorException=r.UnexpectedResponseException=r.UNSUPPORTED_FEATURES=r.TextRenderingMode=r.StreamType=r.RenderingIntentFlag=r.PermissionFlag=r.PasswordResponses=r.PasswordException=r.PageActionEventType=r.OPS=r.MissingPDFException=r.IsLittleEndianCached=r.IsEvalSupportedCached=r.InvalidPDFException=r.ImageKind=r.IDENTITY_MATRIX=r.FormatError=r.FontType=r.FONT_IDENTITY_MATRIX=r.DocumentActionEventType=r.CMapCompressionType=r.BaseException=r.AnnotationType=r.AnnotationStateModelType=r.AnnotationReviewState=r.AnnotationReplyType=r.AnnotationMode=r.AnnotationMarkedState=r.AnnotationFlag=r.AnnotationFieldFlag=r.AnnotationBorderStyleType=r.AnnotationActionEventType=r.AbortException=void 0;r.arrayByteLength=arrayByteLength;r.arraysToBytes=function arraysToBytes(t){var r=t.length;if(1===r&&t[0]instanceof Uint8Array)return t[0];for(var o=0,c=0;c<r;c++)o+=arrayByteLength(t[c]);for(var l=0,u=new Uint8Array(o),h=0;h<r;h++){var d=t[h];d instanceof Uint8Array||(d="string"==typeof d?stringToBytes(d):new Uint8Array(d));var g=d.byteLength;u.set(d,l);l+=g}return u};r.assert=function assert(t,r){t||unreachable(r)};r.bytesToString=function bytesToString(t){"object"===_typeof(t)&&null!==t&&void 0!==t.length||unreachable("Invalid argument for bytesToString");var r=t.length,o=8192;if(r<o)return String.fromCharCode.apply(null,t);for(var c=[],l=0;l<r;l+=o){var u=Math.min(l+o,r),h=t.subarray(l,u);c.push(String.fromCharCode.apply(null,h))}return c.join("")};r.createPromiseCapability=function createPromiseCapability(){var t=Object.create(null),r=!1;Object.defineProperty(t,"settled",{get:function get(){return r}});t.promise=new Promise((function(o,c){t.resolve=function(t){r=!0;o(t)};t.reject=function(t){r=!0;c(t)}}));return t};r.createValidAbsoluteUrl=function createValidAbsoluteUrl(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return null;try{if(o&&"string"==typeof t){if(o.addDefaultProtocol&&t.startsWith("www.")){var c=t.match(/\./g);c&&c.length>=2&&(t="http://".concat(t))}if(o.tryConvertEncoding)try{t=stringToUTF8String(t)}catch(t){}}var l=r?new URL(t,r):new URL(t);if(_isValidProtocol(l))return l}catch(t){}return null};r.escapeString=function escapeString(t){return t.replace(/([()\\\n\r])/g,(function(t){return"\n"===t?"\\n":"\r"===t?"\\r":"\\".concat(t)}))};r.getModificationDate=function getModificationDate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,r=[t.getUTCFullYear().toString(),(t.getUTCMonth()+1).toString().padStart(2,"0"),t.getUTCDate().toString().padStart(2,"0"),t.getUTCHours().toString().padStart(2,"0"),t.getUTCMinutes().toString().padStart(2,"0"),t.getUTCSeconds().toString().padStart(2,"0")];return r.join("")};r.getVerbosityLevel=function getVerbosityLevel(){return l};r.info=function info(t){l>=c.INFOS&&console.log("Info: ".concat(t))};r.isArrayBuffer=function isArrayBuffer(t){return"object"===_typeof(t)&&null!==t&&void 0!==t.byteLength};r.isArrayEqual=function isArrayEqual(t,r){if(t.length!==r.length)return!1;for(var o=0,c=t.length;o<c;o++)if(t[o]!==r[o])return!1;return!0};r.isAscii=function isAscii(t){return/^[\x00-\x7F]*$/.test(t)};r.objectFromMap=function objectFromMap(t){var r,o=Object.create(null),c=function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}(t);try{for(c.s();!(r=c.n()).done;){var l=(d=r.value,g=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(d)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(d,g)||_unsupportedIterableToArray(d,g)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),u=l[0],h=l[1];o[u]=h}}catch(t){c.e(t)}finally{c.f()}var d,g;return o};r.objectSize=function objectSize(t){return Object.keys(t).length};r.setVerbosityLevel=function setVerbosityLevel(t){Number.isInteger(t)&&(l=t)};r.shadow=shadow;r.string32=function string32(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,255&t)};r.stringToBytes=stringToBytes;r.stringToPDFString=function stringToPDFString(t){if(t[0]>="ï"){var r;"þ"===t[0]&&"ÿ"===t[1]?r="utf-16be":"ÿ"===t[0]&&"þ"===t[1]?r="utf-16le":"ï"===t[0]&&"»"===t[1]&&"¿"===t[2]&&(r="utf-8");if(r)try{var o=new TextDecoder(r,{fatal:!0}),c=stringToBytes(t);return o.decode(c)}catch(t){warn('stringToPDFString: "'.concat(t,'".'))}}for(var l=[],u=0,h=t.length;u<h;u++){var d=x[t.charCodeAt(u)];l.push(d?String.fromCharCode(d):t.charAt(u))}return l.join("")};r.stringToUTF16BEString=function stringToUTF16BEString(t){for(var r=["þÿ"],o=0,c=t.length;o<c;o++){var l=t.charCodeAt(o);r.push(String.fromCharCode(l>>8&255),String.fromCharCode(255&l))}return r.join("")};r.stringToUTF8String=stringToUTF8String;r.unreachable=unreachable;r.utf8StringToString=function utf8StringToString(t){return unescape(encodeURIComponent(t))};r.warn=warn;o(5);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}r.IDENTITY_MATRIX=[1,0,0,1,0,0];r.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];r.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};r.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};r.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};r.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};r.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};r.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};r.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};r.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};r.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};r.AnnotationReplyType={GROUP:"Group",REPLY:"R"};r.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};r.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};r.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};r.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};r.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};r.PageActionEventType={O:"PageOpen",C:"PageClose"};r.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};r.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};var c={ERRORS:0,WARNINGS:1,INFOS:5};r.VerbosityLevel=c;r.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};r.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};r.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};r.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};var l=c.WARNINGS;function warn(t){l>=c.WARNINGS&&console.log("Warning: ".concat(t))}function unreachable(t){throw new Error(t)}function _isValidProtocol(t){if(!t)return!1;switch(t.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(t,r,o){Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!1});return o}var u=function BaseExceptionClosure(){function BaseException(t,r){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=t;this.name=r}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();r.BaseException=u;var h=function(t){_inherits(PasswordException,t);var r=_createSuper(PasswordException);function PasswordException(t,o){var c;_classCallCheck(this,PasswordException);(c=r.call(this,t,"PasswordException")).code=o;return c}return _createClass(PasswordException)}(u);r.PasswordException=h;var d=function(t){_inherits(UnknownErrorException,t);var r=_createSuper(UnknownErrorException);function UnknownErrorException(t,o){var c;_classCallCheck(this,UnknownErrorException);(c=r.call(this,t,"UnknownErrorException")).details=o;return c}return _createClass(UnknownErrorException)}(u);r.UnknownErrorException=d;var g=function(t){_inherits(InvalidPDFException,t);var r=_createSuper(InvalidPDFException);function InvalidPDFException(t){_classCallCheck(this,InvalidPDFException);return r.call(this,t,"InvalidPDFException")}return _createClass(InvalidPDFException)}(u);r.InvalidPDFException=g;var m=function(t){_inherits(MissingPDFException,t);var r=_createSuper(MissingPDFException);function MissingPDFException(t){_classCallCheck(this,MissingPDFException);return r.call(this,t,"MissingPDFException")}return _createClass(MissingPDFException)}(u);r.MissingPDFException=m;var y=function(t){_inherits(UnexpectedResponseException,t);var r=_createSuper(UnexpectedResponseException);function UnexpectedResponseException(t,o){var c;_classCallCheck(this,UnexpectedResponseException);(c=r.call(this,t,"UnexpectedResponseException")).status=o;return c}return _createClass(UnexpectedResponseException)}(u);r.UnexpectedResponseException=y;var v=function(t){_inherits(FormatError,t);var r=_createSuper(FormatError);function FormatError(t){_classCallCheck(this,FormatError);return r.call(this,t,"FormatError")}return _createClass(FormatError)}(u);r.FormatError=v;var k=function(t){_inherits(AbortException,t);var r=_createSuper(AbortException);function AbortException(t){_classCallCheck(this,AbortException);return r.call(this,t,"AbortException")}return _createClass(AbortException)}(u);r.AbortException=k;function stringToBytes(t){"string"!=typeof t&&unreachable("Invalid argument for stringToBytes");for(var r=t.length,o=new Uint8Array(r),c=0;c<r;++c)o[c]=255&t.charCodeAt(c);return o}function arrayByteLength(t){if(void 0!==t.length)return t.length;if(void 0!==t.byteLength)return t.byteLength;unreachable("Invalid argument for arrayByteLength")}var _={get value(){return shadow(this,"value",function isLittleEndian(){var t=new Uint8Array(4);t[0]=1;return 1===new Uint32Array(t.buffer,0,1)[0]}())}};r.IsLittleEndianCached=_;var w={get value(){return shadow(this,"value",function isEvalSupported(){try{new Function("");return!0}catch(t){return!1}}())}};r.IsEvalSupportedCached=w;var S=_toConsumableArray(Array(256).keys()).map((function(t){return t.toString(16).padStart(2,"0")})),C=function(){function Util(){_classCallCheck(this,Util)}_createClass(Util,null,[{key:"makeHexColor",value:function makeHexColor(t,r,o){return"#".concat(S[t]).concat(S[r]).concat(S[o])}},{key:"transform",value:function transform(t,r){return[t[0]*r[0]+t[2]*r[1],t[1]*r[0]+t[3]*r[1],t[0]*r[2]+t[2]*r[3],t[1]*r[2]+t[3]*r[3],t[0]*r[4]+t[2]*r[5]+t[4],t[1]*r[4]+t[3]*r[5]+t[5]]}},{key:"applyTransform",value:function applyTransform(t,r){return[t[0]*r[0]+t[1]*r[2]+r[4],t[0]*r[1]+t[1]*r[3]+r[5]]}},{key:"applyInverseTransform",value:function applyInverseTransform(t,r){var o=r[0]*r[3]-r[1]*r[2];return[(t[0]*r[3]-t[1]*r[2]+r[2]*r[5]-r[4]*r[3])/o,(-t[0]*r[1]+t[1]*r[0]+r[4]*r[1]-r[5]*r[0])/o]}},{key:"getAxialAlignedBoundingBox",value:function getAxialAlignedBoundingBox(t,r){var o=Util.applyTransform(t,r),c=Util.applyTransform(t.slice(2,4),r),l=Util.applyTransform([t[0],t[3]],r),u=Util.applyTransform([t[2],t[1]],r);return[Math.min(o[0],c[0],l[0],u[0]),Math.min(o[1],c[1],l[1],u[1]),Math.max(o[0],c[0],l[0],u[0]),Math.max(o[1],c[1],l[1],u[1])]}},{key:"inverseTransform",value:function inverseTransform(t){var r=t[0]*t[3]-t[1]*t[2];return[t[3]/r,-t[1]/r,-t[2]/r,t[0]/r,(t[2]*t[5]-t[4]*t[3])/r,(t[4]*t[1]-t[5]*t[0])/r]}},{key:"apply3dTransform",value:function apply3dTransform(t,r){return[t[0]*r[0]+t[1]*r[1]+t[2]*r[2],t[3]*r[0]+t[4]*r[1]+t[5]*r[2],t[6]*r[0]+t[7]*r[1]+t[8]*r[2]]}},{key:"singularValueDecompose2dScale",value:function singularValueDecompose2dScale(t){var r=[t[0],t[2],t[1],t[3]],o=t[0]*r[0]+t[1]*r[2],c=t[0]*r[1]+t[1]*r[3],l=t[2]*r[0]+t[3]*r[2],u=t[2]*r[1]+t[3]*r[3],h=(o+u)/2,d=Math.sqrt(Math.pow(o+u,2)-4*(o*u-l*c))/2,g=h+d||1,m=h-d||1;return[Math.sqrt(g),Math.sqrt(m)]}},{key:"normalizeRect",value:function normalizeRect(t){var r=t.slice(0);if(t[0]>t[2]){r[0]=t[2];r[2]=t[0]}if(t[1]>t[3]){r[1]=t[3];r[3]=t[1]}return r}},{key:"intersect",value:function intersect(t,r){function compare(t,r){return t-r}var o=[t[0],t[2],r[0],r[2]].sort(compare),c=[t[1],t[3],r[1],r[3]].sort(compare),l=[];t=Util.normalizeRect(t);r=Util.normalizeRect(r);if(!(o[0]===t[0]&&o[1]===r[0]||o[0]===r[0]&&o[1]===t[0]))return null;l[0]=o[1];l[2]=o[2];if(!(c[0]===t[1]&&c[1]===r[1]||c[0]===r[1]&&c[1]===t[1]))return null;l[1]=c[1];l[3]=c[2];return l}},{key:"bezierBoundingBox",value:function bezierBoundingBox(t,r,o,c,l,u,h,d){for(var g,m,y,v,k,_,w,S,C=[],x=[[],[]],O=0;O<2;++O){if(0===O){m=6*t-12*o+6*l;g=-3*t+9*o-9*l+3*h;y=3*o-3*t}else{m=6*r-12*c+6*u;g=-3*r+9*c-9*u+3*d;y=3*c-3*r}if(Math.abs(g)<1e-12){if(Math.abs(m)<1e-12)continue;0<(v=-y/m)&&v<1&&C.push(v)}else{w=m*m-4*y*g;S=Math.sqrt(w);if(!(w<0)){0<(k=(-m+S)/(2*g))&&k<1&&C.push(k);0<(_=(-m-S)/(2*g))&&_<1&&C.push(_)}}}for(var T,E=C.length,M=E;E--;){T=1-(v=C[E]);x[0][E]=T*T*T*t+3*T*T*v*o+3*T*v*v*l+v*v*v*h;x[1][E]=T*T*T*r+3*T*T*v*c+3*T*v*v*u+v*v*v*d}x[0][M]=t;x[1][M]=r;x[0][M+1]=h;x[1][M+1]=d;x[0].length=x[1].length=M+2;return[Math.min.apply(Math,_toConsumableArray(x[0])),Math.min.apply(Math,_toConsumableArray(x[1])),Math.max.apply(Math,_toConsumableArray(x[0])),Math.max.apply(Math,_toConsumableArray(x[1]))]}}]);return Util}();r.Util=C;var x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(t){return decodeURIComponent(escape(t))}},(t,r,o)=>{"use strict";var c=o(6);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&c.isNodeJS&&(globalThis.btoa=function(t){return Buffer.from(t,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&c.isNodeJS&&(globalThis.atob=function(t){return Buffer.from(t,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&c.isNodeJS&&(globalThis.DOMMatrix=require("dommatrix/dist/dommatrix.js"))}();!function checkPromise(){globalThis.Promise.allSettled||(globalThis.Promise=o(7))}();!function checkReadableStream(){!globalThis.ReadableStream&&c.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}();!function checkStructuredClone(){globalThis.structuredClone||o(131)}()}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.isNodeJS=void 0;function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var o=!("object"!==("undefined"==typeof process?"undefined":_typeof(process))||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);r.isNodeJS=o},(t,r,o)=>{o(8);o(93);o(99);o(101);o(125);o(126);o(127);o(128);var c=o(130);t.exports=c.Promise},(t,r,o)=>{"use strict";var c=o(9),l=o(10),u=o(29),h=o(71),d=o(73),g=o(59),m=o(75),y=o(48),v=o(17),k=o(79),_=o(80),w=o(81),S=o(90),C=o(38),x=o(92),O=C("toStringTag"),T=l.Error,E=[].push,M=function AggregateError(t,r){var o,c=arguments.length>2?arguments[2]:void 0,l=u(R,this);if(d)o=d(new T,l?h(this):R);else{o=l?this:m(R);y(o,O,"Error")}void 0!==r&&y(o,"message",S(r));x&&y(o,"stack",k(o.stack,1));_(o,c);var g=[];w(t,E,{that:g});y(o,"errors",g);return o};d?d(M,T):g(M,T,{name:!0});var R=M.prototype=m(T.prototype,{constructor:v(1,M),message:v(1,""),name:v(1,"AggregateError")});c({global:!0},{AggregateError:M})},(t,r,o)=>{var c=o(10),l=o(11).f,u=o(48),h=o(52),d=o(42),g=o(59),m=o(70);t.exports=function(t,r){var o,y,v,k,_,w=t.target,S=t.global,C=t.stat;if(o=S?c:C?c[w]||d(w,{}):(c[w]||{}).prototype)for(y in r){k=r[y];v=t.noTargetGet?(_=l(o,y))&&_.value:o[y];if(!m(S?y:w+(C?".":"#")+y,t.forced)&&void 0!==v){if(typeof k==typeof v)continue;g(k,v)}(t.sham||v&&v.sham)&&u(k,"sham",!0);h(o,y,k,t)}}},t=>{var check=function(t){return t&&t.Math==Math&&t};t.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(t,r,o)=>{var c=o(12),l=o(14),u=o(16),h=o(17),d=o(18),g=o(23),m=o(43),y=o(46),v=Object.getOwnPropertyDescriptor;r.f=c?v:function getOwnPropertyDescriptor(t,r){t=d(t);r=g(r);if(y)try{return v(t,r)}catch(t){}if(m(t,r))return h(!l(u.f,t,r),t[r])}},(t,r,o)=>{var c=o(13);t.exports=!c((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},(t,r,o)=>{var c=o(15),l=Function.prototype.call;t.exports=c?l.bind(l):function(){return l.apply(l,arguments)}},(t,r,o)=>{var c=o(13);t.exports=!c((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},(t,r)=>{"use strict";var o={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,l=c&&!o.call({1:2},1);r.f=l?function propertyIsEnumerable(t){var r=c(this,t);return!!r&&r.enumerable}:o},t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},(t,r,o)=>{var c=o(19),l=o(22);t.exports=function(t){return c(l(t))}},(t,r,o)=>{var c=o(10),l=o(20),u=o(13),h=o(21),d=c.Object,g=l("".split);t.exports=u((function(){return!d("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?g(t,""):d(t)}:d},(t,r,o)=>{var c=o(15),l=Function.prototype,u=l.bind,h=l.call,d=c&&u.bind(h,h);t.exports=c?function(t){return t&&d(t)}:function(t){return t&&function(){return h.apply(t,arguments)}}},(t,r,o)=>{var c=o(20),l=c({}.toString),u=c("".slice);t.exports=function(t){return u(l(t),8,-1)}},(t,r,o)=>{var c=o(10).TypeError;t.exports=function(t){if(null==t)throw c("Can't call method on "+t);return t}},(t,r,o)=>{var c=o(24),l=o(27);t.exports=function(t){var r=c(t,"string");return l(r)?r:r+""}},(t,r,o)=>{var c=o(10),l=o(14),u=o(25),h=o(27),d=o(34),g=o(37),m=o(38),y=c.TypeError,v=m("toPrimitive");t.exports=function(t,r){if(!u(t)||h(t))return t;var o,c=d(t,v);if(c){void 0===r&&(r="default");o=l(c,t,r);if(!u(o)||h(o))return o;throw y("Can't convert object to primitive value")}void 0===r&&(r="number");return g(t,r)}},(t,r,o)=>{var c=o(26);t.exports=function(t){return"object"==typeof t?null!==t:c(t)}},t=>{t.exports=function(t){return"function"==typeof t}},(t,r,o)=>{var c=o(10),l=o(28),u=o(26),h=o(29),d=o(30),g=c.Object;t.exports=d?function(t){return"symbol"==typeof t}:function(t){var r=l("Symbol");return u(r)&&h(r.prototype,g(t))}},(t,r,o)=>{var c=o(10),l=o(26),aFunction=function(t){return l(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?aFunction(c[t]):c[t]&&c[t][r]}},(t,r,o)=>{var c=o(20);t.exports=c({}.isPrototypeOf)},(t,r,o)=>{var c=o(31);t.exports=c&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(t,r,o)=>{var c=o(32),l=o(13);t.exports=!!Object.getOwnPropertySymbols&&!l((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&c&&c<41}))},(t,r,o)=>{var c,l,u=o(10),h=o(33),d=u.process,g=u.Deno,m=d&&d.versions||g&&g.version,y=m&&m.v8;y&&(l=(c=y.split("."))[0]>0&&c[0]<4?1:+(c[0]+c[1]));!l&&h&&(!(c=h.match(/Edge\/(\d+)/))||c[1]>=74)&&(c=h.match(/Chrome\/(\d+)/))&&(l=+c[1]);t.exports=l},(t,r,o)=>{var c=o(28);t.exports=c("navigator","userAgent")||""},(t,r,o)=>{var c=o(35);t.exports=function(t,r){var o=t[r];return null==o?void 0:c(o)}},(t,r,o)=>{var c=o(10),l=o(26),u=o(36),h=c.TypeError;t.exports=function(t){if(l(t))return t;throw h(u(t)+" is not a function")}},(t,r,o)=>{var c=o(10).String;t.exports=function(t){try{return c(t)}catch(t){return"Object"}}},(t,r,o)=>{var c=o(10),l=o(14),u=o(26),h=o(25),d=c.TypeError;t.exports=function(t,r){var o,c;if("string"===r&&u(o=t.toString)&&!h(c=l(o,t)))return c;if(u(o=t.valueOf)&&!h(c=l(o,t)))return c;if("string"!==r&&u(o=t.toString)&&!h(c=l(o,t)))return c;throw d("Can't convert object to primitive value")}},(t,r,o)=>{var c=o(10),l=o(39),u=o(43),h=o(45),d=o(31),g=o(30),m=l("wks"),y=c.Symbol,v=y&&y.for,k=g?y:y&&y.withoutSetter||h;t.exports=function(t){if(!u(m,t)||!d&&"string"!=typeof m[t]){var r="Symbol."+t;d&&u(y,t)?m[t]=y[t]:m[t]=g&&v?v(r):k(r)}return m[t]}},(t,r,o)=>{var c=o(40),l=o(41);(t.exports=function(t,r){return l[t]||(l[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.21.1",mode:c?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},t=>{t.exports=!1},(t,r,o)=>{var c=o(10),l=o(42),u="__core-js_shared__",h=c[u]||l(u,{});t.exports=h},(t,r,o)=>{var c=o(10),l=Object.defineProperty;t.exports=function(t,r){try{l(c,t,{value:r,configurable:!0,writable:!0})}catch(o){c[t]=r}return r}},(t,r,o)=>{var c=o(20),l=o(44),u=c({}.hasOwnProperty);t.exports=Object.hasOwn||function hasOwn(t,r){return u(l(t),r)}},(t,r,o)=>{var c=o(10),l=o(22),u=c.Object;t.exports=function(t){return u(l(t))}},(t,r,o)=>{var c=o(20),l=0,u=Math.random(),h=c(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+h(++l+u,36)}},(t,r,o)=>{var c=o(12),l=o(13),u=o(47);t.exports=!c&&!l((function(){return 7!=Object.defineProperty(u("div"),"a",{get:function(){return 7}}).a}))},(t,r,o)=>{var c=o(10),l=o(25),u=c.document,h=l(u)&&l(u.createElement);t.exports=function(t){return h?u.createElement(t):{}}},(t,r,o)=>{var c=o(12),l=o(49),u=o(17);t.exports=c?function(t,r,o){return l.f(t,r,u(1,o))}:function(t,r,o){t[r]=o;return t}},(t,r,o)=>{var c=o(10),l=o(12),u=o(46),h=o(50),d=o(51),g=o(23),m=c.TypeError,y=Object.defineProperty,v=Object.getOwnPropertyDescriptor,k="enumerable",_="configurable",w="writable";r.f=l?h?function defineProperty(t,r,o){d(t);r=g(r);d(o);if("function"==typeof t&&"prototype"===r&&"value"in o&&w in o&&!o.writable){var c=v(t,r);if(c&&c.writable){t[r]=o.value;o={configurable:_ in o?o.configurable:c.configurable,enumerable:k in o?o.enumerable:c.enumerable,writable:!1}}}return y(t,r,o)}:y:function defineProperty(t,r,o){d(t);r=g(r);d(o);if(u)try{return y(t,r,o)}catch(t){}if("get"in o||"set"in o)throw m("Accessors not supported");"value"in o&&(t[r]=o.value);return t}},(t,r,o)=>{var c=o(12),l=o(13);t.exports=c&&l((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(t,r,o)=>{var c=o(10),l=o(25),u=c.String,h=c.TypeError;t.exports=function(t){if(l(t))return t;throw h(u(t)+" is not an object")}},(t,r,o)=>{var c=o(10),l=o(26),u=o(43),h=o(48),d=o(42),g=o(53),m=o(54),y=o(58).CONFIGURABLE,v=m.get,k=m.enforce,_=String(String).split("String");(t.exports=function(t,r,o,g){var m,v=!!g&&!!g.unsafe,w=!!g&&!!g.enumerable,S=!!g&&!!g.noTargetGet,C=g&&void 0!==g.name?g.name:r;if(l(o)){"Symbol("===String(C).slice(0,7)&&(C="["+String(C).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");(!u(o,"name")||y&&o.name!==C)&&h(o,"name",C);(m=k(o)).source||(m.source=_.join("string"==typeof C?C:""))}if(t!==c){v?!S&&t[r]&&(w=!0):delete t[r];w?t[r]=o:h(t,r,o)}else w?t[r]=o:d(r,o)})(Function.prototype,"toString",(function toString(){return l(this)&&v(this).source||g(this)}))},(t,r,o)=>{var c=o(20),l=o(26),u=o(41),h=c(Function.toString);l(u.inspectSource)||(u.inspectSource=function(t){return h(t)});t.exports=u.inspectSource},(t,r,o)=>{var c,l,u,h=o(55),d=o(10),g=o(20),m=o(25),y=o(48),v=o(43),k=o(41),_=o(56),w=o(57),S="Object already initialized",C=d.TypeError,x=d.WeakMap;if(h||k.state){var O=k.state||(k.state=new x),T=g(O.get),E=g(O.has),M=g(O.set);c=function(t,r){if(E(O,t))throw new C(S);r.facade=t;M(O,t,r);return r};l=function(t){return T(O,t)||{}};u=function(t){return E(O,t)}}else{var R=_("state");w[R]=!0;c=function(t,r){if(v(t,R))throw new C(S);r.facade=t;y(t,R,r);return r};l=function(t){return v(t,R)?t[R]:{}};u=function(t){return v(t,R)}}t.exports={set:c,get:l,has:u,enforce:function(t){return u(t)?l(t):c(t,{})},getterFor:function(t){return function(r){var o;if(!m(r)||(o=l(r)).type!==t)throw C("Incompatible receiver, "+t+" required");return o}}}},(t,r,o)=>{var c=o(10),l=o(26),u=o(53),h=c.WeakMap;t.exports=l(h)&&/native code/.test(u(h))},(t,r,o)=>{var c=o(39),l=o(45),u=c("keys");t.exports=function(t){return u[t]||(u[t]=l(t))}},t=>{t.exports={}},(t,r,o)=>{var c=o(12),l=o(43),u=Function.prototype,h=c&&Object.getOwnPropertyDescriptor,d=l(u,"name"),g=d&&"something"===function something(){}.name,m=d&&(!c||c&&h(u,"name").configurable);t.exports={EXISTS:d,PROPER:g,CONFIGURABLE:m}},(t,r,o)=>{var c=o(43),l=o(60),u=o(11),h=o(49);t.exports=function(t,r,o){for(var d=l(r),g=h.f,m=u.f,y=0;y<d.length;y++){var v=d[y];c(t,v)||o&&c(o,v)||g(t,v,m(r,v))}}},(t,r,o)=>{var c=o(28),l=o(20),u=o(61),h=o(69),d=o(51),g=l([].concat);t.exports=c("Reflect","ownKeys")||function ownKeys(t){var r=u.f(d(t)),o=h.f;return o?g(r,o(t)):r}},(t,r,o)=>{var c=o(62),l=o(68).concat("length","prototype");r.f=Object.getOwnPropertyNames||function getOwnPropertyNames(t){return c(t,l)}},(t,r,o)=>{var c=o(20),l=o(43),u=o(18),h=o(63).indexOf,d=o(57),g=c([].push);t.exports=function(t,r){var o,c=u(t),m=0,y=[];for(o in c)!l(d,o)&&l(c,o)&&g(y,o);for(;r.length>m;)l(c,o=r[m++])&&(~h(y,o)||g(y,o));return y}},(t,r,o)=>{var c=o(18),l=o(64),u=o(66),createMethod=function(t){return function(r,o,h){var d,g=c(r),m=u(g),y=l(h,m);if(t&&o!=o){for(;m>y;)if((d=g[y++])!=d)return!0}else for(;m>y;y++)if((t||y in g)&&g[y]===o)return t||y||0;return!t&&-1}};t.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(t,r,o)=>{var c=o(65),l=Math.max,u=Math.min;t.exports=function(t,r){var o=c(t);return o<0?l(o+r,0):u(o,r)}},t=>{var r=Math.ceil,o=Math.floor;t.exports=function(t){var c=+t;return c!=c||0===c?0:(c>0?o:r)(c)}},(t,r,o)=>{var c=o(67);t.exports=function(t){return c(t.length)}},(t,r,o)=>{var c=o(65),l=Math.min;t.exports=function(t){return t>0?l(c(t),9007199254740991):0}},t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(t,r)=>{r.f=Object.getOwnPropertySymbols},(t,r,o)=>{var c=o(13),l=o(26),u=/#|\.prototype\./,isForced=function(t,r){var o=d[h(t)];return o==m||o!=g&&(l(r)?c(r):!!r)},h=isForced.normalize=function(t){return String(t).replace(u,".").toLowerCase()},d=isForced.data={},g=isForced.NATIVE="N",m=isForced.POLYFILL="P";t.exports=isForced},(t,r,o)=>{var c=o(10),l=o(43),u=o(26),h=o(44),d=o(56),g=o(72),m=d("IE_PROTO"),y=c.Object,v=y.prototype;t.exports=g?y.getPrototypeOf:function(t){var r=h(t);if(l(r,m))return r[m];var o=r.constructor;return u(o)&&r instanceof o?o.prototype:r instanceof y?v:null}},(t,r,o)=>{var c=o(13);t.exports=!c((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(t,r,o)=>{var c=o(20),l=o(51),u=o(74);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,o={};try{(t=c(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(o,[]);r=o instanceof Array}catch(t){}return function setPrototypeOf(o,c){l(o);u(c);r?t(o,c):o.__proto__=c;return o}}():void 0)},(t,r,o)=>{var c=o(10),l=o(26),u=c.String,h=c.TypeError;t.exports=function(t){if("object"==typeof t||l(t))return t;throw h("Can't set "+u(t)+" as a prototype")}},(t,r,o)=>{var c,l=o(51),u=o(76),h=o(68),d=o(57),g=o(78),m=o(47),y=o(56),v=y("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag(""));t.close();var r=t.parentWindow.Object;t=null;return r},NullProtoObject=function(){try{c=new ActiveXObject("htmlfile")}catch(t){}NullProtoObject="undefined"!=typeof document?document.domain&&c?NullProtoObjectViaActiveX(c):function(){var t,r=m("iframe");r.style.display="none";g.appendChild(r);r.src=String("javascript:");(t=r.contentWindow.document).open();t.write(scriptTag("document.F=Object"));t.close();return t.F}():NullProtoObjectViaActiveX(c);for(var t=h.length;t--;)delete NullProtoObject.prototype[h[t]];return NullProtoObject()};d[v]=!0;t.exports=Object.create||function create(t,r){var o;if(null!==t){EmptyConstructor.prototype=l(t);o=new EmptyConstructor;EmptyConstructor.prototype=null;o[v]=t}else o=NullProtoObject();return void 0===r?o:u.f(o,r)}},(t,r,o)=>{var c=o(12),l=o(50),u=o(49),h=o(51),d=o(18),g=o(77);r.f=c&&!l?Object.defineProperties:function defineProperties(t,r){h(t);for(var o,c=d(r),l=g(r),m=l.length,y=0;m>y;)u.f(t,o=l[y++],c[o]);return t}},(t,r,o)=>{var c=o(62),l=o(68);t.exports=Object.keys||function keys(t){return c(t,l)}},(t,r,o)=>{var c=o(28);t.exports=c("document","documentElement")},(t,r,o)=>{var c=o(20)("".replace),l=String(Error("zxcasd").stack),u=/\n\s*at [^:]*:[^\n]*/,h=u.test(l);t.exports=function(t,r){if(h&&"string"==typeof t)for(;r--;)t=c(t,u,"");return t}},(t,r,o)=>{var c=o(25),l=o(48);t.exports=function(t,r){c(r)&&"cause"in r&&l(t,"cause",r.cause)}},(t,r,o)=>{var c=o(10),l=o(82),u=o(14),h=o(51),d=o(36),g=o(83),m=o(66),y=o(29),v=o(85),k=o(86),_=o(89),w=c.TypeError,Result=function(t,r){this.stopped=t;this.result=r},S=Result.prototype;t.exports=function(t,r,o){var c,C,x,O,T,E,M,R=o&&o.that,j=!(!o||!o.AS_ENTRIES),D=!(!o||!o.IS_ITERATOR),L=!(!o||!o.INTERRUPTED),N=l(r,R),stop=function(t){c&&_(c,"normal",t);return new Result(!0,t)},callFn=function(t){if(j){h(t);return L?N(t[0],t[1],stop):N(t[0],t[1])}return L?N(t,stop):N(t)};if(D)c=t;else{if(!(C=k(t)))throw w(d(t)+" is not iterable");if(g(C)){for(x=0,O=m(t);O>x;x++)if((T=callFn(t[x]))&&y(S,T))return T;return new Result(!1)}c=v(t,C)}E=c.next;for(;!(M=u(E,c)).done;){try{T=callFn(M.value)}catch(t){_(c,"throw",t)}if("object"==typeof T&&T&&y(S,T))return T}return new Result(!1)}},(t,r,o)=>{var c=o(20),l=o(35),u=o(15),h=c(c.bind);t.exports=function(t,r){l(t);return void 0===r?t:u?h(t,r):function(){return t.apply(r,arguments)}}},(t,r,o)=>{var c=o(38),l=o(84),u=c("iterator"),h=Array.prototype;t.exports=function(t){return void 0!==t&&(l.Array===t||h[u]===t)}},t=>{t.exports={}},(t,r,o)=>{var c=o(10),l=o(14),u=o(35),h=o(51),d=o(36),g=o(86),m=c.TypeError;t.exports=function(t,r){var o=arguments.length<2?g(t):r;if(u(o))return h(l(o,t));throw m(d(t)+" is not iterable")}},(t,r,o)=>{var c=o(87),l=o(34),u=o(84),h=o(38)("iterator");t.exports=function(t){if(null!=t)return l(t,h)||l(t,"@@iterator")||u[c(t)]}},(t,r,o)=>{var c=o(10),l=o(88),u=o(26),h=o(21),d=o(38)("toStringTag"),g=c.Object,m="Arguments"==h(function(){return arguments}());t.exports=l?h:function(t){var r,o,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(o=function(t,r){try{return t[r]}catch(t){}}(r=g(t),d))?o:m?h(r):"Object"==(c=h(r))&&u(r.callee)?"Arguments":c}},(t,r,o)=>{var c={};c[o(38)("toStringTag")]="z";t.exports="[object z]"===String(c)},(t,r,o)=>{var c=o(14),l=o(51),u=o(34);t.exports=function(t,r,o){var h,d;l(t);try{if(!(h=u(t,"return"))){if("throw"===r)throw o;return o}h=c(h,t)}catch(t){d=!0;h=t}if("throw"===r)throw o;if(d)throw h;l(h);return o}},(t,r,o)=>{var c=o(91);t.exports=function(t,r){return void 0===t?arguments.length<2?"":r:c(t)}},(t,r,o)=>{var c=o(10),l=o(87),u=c.String;t.exports=function(t){if("Symbol"===l(t))throw TypeError("Cannot convert a Symbol value to a string");return u(t)}},(t,r,o)=>{var c=o(13),l=o(17);t.exports=!c((function(){var t=Error("a");if(!("stack"in t))return!0;Object.defineProperty(t,"stack",l(1,7));return 7!==t.stack}))},(t,r,o)=>{"use strict";var c=o(18),l=o(94),u=o(84),h=o(54),d=o(49).f,g=o(95),m=o(40),y=o(12),v="Array Iterator",k=h.set,_=h.getterFor(v);t.exports=g(Array,"Array",(function(t,r){k(this,{type:v,target:c(t),index:0,kind:r})}),(function(){var t=_(this),r=t.target,o=t.kind,c=t.index++;if(!r||c>=r.length){t.target=void 0;return{value:void 0,done:!0}}return"keys"==o?{value:c,done:!1}:"values"==o?{value:r[c],done:!1}:{value:[c,r[c]],done:!1}}),"values");var w=u.Arguments=u.Array;l("keys");l("values");l("entries");if(!m&&y&&"values"!==w.name)try{d(w,"name",{value:"values"})}catch(t){}},(t,r,o)=>{var c=o(38),l=o(75),u=o(49),h=c("unscopables"),d=Array.prototype;null==d[h]&&u.f(d,h,{configurable:!0,value:l(null)});t.exports=function(t){d[h][t]=!0}},(t,r,o)=>{"use strict";var c=o(9),l=o(14),u=o(40),h=o(58),d=o(26),g=o(96),m=o(71),y=o(73),v=o(98),k=o(48),_=o(52),w=o(38),S=o(84),C=o(97),x=h.PROPER,O=h.CONFIGURABLE,T=C.IteratorPrototype,E=C.BUGGY_SAFARI_ITERATORS,M=w("iterator"),R="keys",j="values",D="entries",returnThis=function(){return this};t.exports=function(t,r,o,h,w,C,L){g(o,r,h);var N,U,H,getIterationMethod=function(t){if(t===w&&z)return z;if(!E&&t in q)return q[t];switch(t){case R:return function keys(){return new o(this,t)};case j:return function values(){return new o(this,t)};case D:return function entries(){return new o(this,t)}}return function(){return new o(this)}},$=r+" Iterator",X=!1,q=t.prototype,G=q[M]||q["@@iterator"]||w&&q[w],z=!E&&G||getIterationMethod(w),W="Array"==r&&q.entries||G;if(W&&(N=m(W.call(new t)))!==Object.prototype&&N.next){u||m(N)===T||(y?y(N,T):d(N[M])||_(N,M,returnThis));v(N,$,!0,!0);u&&(S[$]=returnThis)}if(x&&w==j&&G&&G.name!==j)if(!u&&O)k(q,"name",j);else{X=!0;z=function values(){return l(G,this)}}if(w){U={values:getIterationMethod(j),keys:C?z:getIterationMethod(R),entries:getIterationMethod(D)};if(L)for(H in U)(E||X||!(H in q))&&_(q,H,U[H]);else c({target:r,proto:!0,forced:E||X},U)}u&&!L||q[M]===z||_(q,M,z,{name:w});S[r]=z;return U}},(t,r,o)=>{"use strict";var c=o(97).IteratorPrototype,l=o(75),u=o(17),h=o(98),d=o(84),returnThis=function(){return this};t.exports=function(t,r,o,g){var m=r+" Iterator";t.prototype=l(c,{next:u(+!g,o)});h(t,m,!1,!0);d[m]=returnThis;return t}},(t,r,o)=>{"use strict";var c,l,u,h=o(13),d=o(26),g=o(75),m=o(71),y=o(52),v=o(38),k=o(40),_=v("iterator"),w=!1;[].keys&&("next"in(u=[].keys())?(l=m(m(u)))!==Object.prototype&&(c=l):w=!0);null==c||h((function(){var t={};return c[_].call(t)!==t}))?c={}:k&&(c=g(c));d(c[_])||y(c,_,(function(){return this}));t.exports={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:w}},(t,r,o)=>{var c=o(49).f,l=o(43),u=o(38)("toStringTag");t.exports=function(t,r,o){t&&!o&&(t=t.prototype);t&&!l(t,u)&&c(t,u,{configurable:!0,value:r})}},(t,r,o)=>{var c=o(88),l=o(52),u=o(100);c||l(Object.prototype,"toString",u,{unsafe:!0})},(t,r,o)=>{"use strict";var c=o(88),l=o(87);t.exports=c?{}.toString:function toString(){return"[object "+l(this)+"]"}},(t,r,o)=>{"use strict";var c,l,u,h,d=o(9),g=o(40),m=o(10),y=o(28),v=o(14),k=o(102),_=o(52),w=o(103),S=o(73),C=o(98),x=o(104),O=o(35),T=o(26),E=o(25),M=o(105),R=o(53),j=o(81),D=o(106),L=o(107),N=o(110).set,U=o(116),H=o(119),$=o(121),X=o(120),q=o(122),G=o(123),z=o(54),W=o(70),V=o(38),K=o(124),Y=o(115),J=o(32),Z=V("species"),Q="Promise",ee=z.getterFor(Q),te=z.set,re=z.getterFor(Q),ae=k&&k.prototype,ne=k,ie=ae,oe=m.TypeError,se=m.document,ce=m.process,le=X.f,ue=le,fe=!!(se&&se.createEvent&&m.dispatchEvent),he=T(m.PromiseRejectionEvent),de="unhandledrejection",pe=!1,ge=W(Q,(function(){var t=R(ne),r=t!==String(ne);if(!r&&66===J)return!0;if(g&&!ie.finally)return!0;if(J>=51&&/native code/.test(t))return!1;var o=new ne((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};(o.constructor={})[Z]=FakePromise;return!(pe=o.then((function(){}))instanceof FakePromise)||!r&&K&&!he})),me=ge||!D((function(t){ne.all(t).catch((function(){}))})),isThenable=function(t){var r;return!(!E(t)||!T(r=t.then))&&r},callReaction=function(t,r){var o,c,l,u=r.value,h=1==r.state,d=h?t.ok:t.fail,g=t.resolve,m=t.reject,y=t.domain;try{if(d){if(!h){2===r.rejection&&onHandleUnhandled(r);r.rejection=1}if(!0===d)o=u;else{y&&y.enter();o=d(u);if(y){y.exit();l=!0}}o===t.promise?m(oe("Promise-chain cycle")):(c=isThenable(o))?v(c,o,g,m):g(o)}else m(u)}catch(t){y&&!l&&y.exit();m(t)}},notify=function(t,r){if(!t.notified){t.notified=!0;U((function(){for(var o,c=t.reactions;o=c.get();)callReaction(o,t);t.notified=!1;r&&!t.rejection&&onUnhandled(t)}))}},dispatchEvent=function(t,r,o){var c,l;if(fe){(c=se.createEvent("Event")).promise=r;c.reason=o;c.initEvent(t,!1,!0);m.dispatchEvent(c)}else c={promise:r,reason:o};!he&&(l=m["on"+t])?l(c):t===de&&$("Unhandled promise rejection",o)},onUnhandled=function(t){v(N,m,(function(){var r,o=t.facade,c=t.value;if(isUnhandled(t)){r=q((function(){Y?ce.emit("unhandledRejection",c,o):dispatchEvent(de,o,c)}));t.rejection=Y||isUnhandled(t)?2:1;if(r.error)throw r.value}}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){v(N,m,(function(){var r=t.facade;Y?ce.emit("rejectionHandled",r):dispatchEvent("rejectionhandled",r,t.value)}))},bind=function(t,r,o){return function(c){t(r,c,o)}},internalReject=function(t,r,o){if(!t.done){t.done=!0;o&&(t=o);t.value=r;t.state=2;notify(t,!0)}},internalResolve=function(t,r,o){if(!t.done){t.done=!0;o&&(t=o);try{if(t.facade===r)throw oe("Promise can't be resolved itself");var c=isThenable(r);if(c)U((function(){var o={done:!1};try{v(c,r,bind(internalResolve,o,t),bind(internalReject,o,t))}catch(r){internalReject(o,r,t)}}));else{t.value=r;t.state=1;notify(t,!1)}}catch(r){internalReject({done:!1},r,t)}}};if(ge){ie=(ne=function Promise(t){M(this,ie);O(t);v(c,this);var r=ee(this);try{t(bind(internalResolve,r),bind(internalReject,r))}catch(t){internalReject(r,t)}}).prototype;(c=function Promise(t){te(this,{type:Q,done:!1,notified:!1,parent:!1,reactions:new G,rejection:!1,state:0,value:void 0})}).prototype=w(ie,{then:function then(t,r){var o=re(this),c=le(L(this,ne));o.parent=!0;c.ok=!T(t)||t;c.fail=T(r)&&r;c.domain=Y?ce.domain:void 0;0==o.state?o.reactions.add(c):U((function(){callReaction(c,o)}));return c.promise},catch:function(t){return this.then(void 0,t)}});l=function(){var t=new c,r=ee(t);this.promise=t;this.resolve=bind(internalResolve,r);this.reject=bind(internalReject,r)};X.f=le=function(t){return t===ne||t===u?new l(t):ue(t)};if(!g&&T(k)&&ae!==Object.prototype){h=ae.then;if(!pe){_(ae,"then",(function then(t,r){var o=this;return new ne((function(t,r){v(h,o,t,r)})).then(t,r)}),{unsafe:!0});_(ae,"catch",ie.catch,{unsafe:!0})}try{delete ae.constructor}catch(t){}S&&S(ae,ie)}}d({global:!0,wrap:!0,forced:ge},{Promise:ne});C(ne,Q,!1,!0);x(Q);u=y(Q);d({target:Q,stat:!0,forced:ge},{reject:function reject(t){var r=le(this);v(r.reject,void 0,t);return r.promise}});d({target:Q,stat:!0,forced:g||ge},{resolve:function resolve(t){return H(g&&this===u?ne:this,t)}});d({target:Q,stat:!0,forced:me},{all:function all(t){var r=this,o=le(r),c=o.resolve,l=o.reject,u=q((function(){var o=O(r.resolve),u=[],h=0,d=1;j(t,(function(t){var g=h++,m=!1;d++;v(o,r,t).then((function(t){if(!m){m=!0;u[g]=t;--d||c(u)}}),l)}));--d||c(u)}));u.error&&l(u.value);return o.promise},race:function race(t){var r=this,o=le(r),c=o.reject,l=q((function(){var l=O(r.resolve);j(t,(function(t){v(l,r,t).then(o.resolve,c)}))}));l.error&&c(l.value);return o.promise}})},(t,r,o)=>{var c=o(10);t.exports=c.Promise},(t,r,o)=>{var c=o(52);t.exports=function(t,r,o){for(var l in r)c(t,l,r[l],o);return t}},(t,r,o)=>{"use strict";var c=o(28),l=o(49),u=o(38),h=o(12),d=u("species");t.exports=function(t){var r=c(t),o=l.f;h&&r&&!r[d]&&o(r,d,{configurable:!0,get:function(){return this}})}},(t,r,o)=>{var c=o(10),l=o(29),u=c.TypeError;t.exports=function(t,r){if(l(r,t))return t;throw u("Incorrect invocation")}},(t,r,o)=>{var c=o(38)("iterator"),l=!1;try{var u=0,h={next:function(){return{done:!!u++}},return:function(){l=!0}};h[c]=function(){return this};Array.from(h,(function(){throw 2}))}catch(t){}t.exports=function(t,r){if(!r&&!l)return!1;var o=!1;try{var u={};u[c]=function(){return{next:function(){return{done:o=!0}}}};t(u)}catch(t){}return o}},(t,r,o)=>{var c=o(51),l=o(108),u=o(38)("species");t.exports=function(t,r){var o,h=c(t).constructor;return void 0===h||null==(o=c(h)[u])?r:l(o)}},(t,r,o)=>{var c=o(10),l=o(109),u=o(36),h=c.TypeError;t.exports=function(t){if(l(t))return t;throw h(u(t)+" is not a constructor")}},(t,r,o)=>{var c=o(20),l=o(13),u=o(26),h=o(87),d=o(28),g=o(53),noop=function(){},m=[],y=d("Reflect","construct"),v=/^\s*(?:class|function)\b/,k=c(v.exec),_=!v.exec(noop),w=function isConstructor(t){if(!u(t))return!1;try{y(noop,m,t);return!0}catch(t){return!1}},S=function isConstructor(t){if(!u(t))return!1;switch(h(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _||!!k(v,g(t))}catch(t){return!0}};S.sham=!0;t.exports=!y||l((function(){var t;return w(w.call)||!w(Object)||!w((function(){t=!0}))||t}))?S:w},(t,r,o)=>{var c,l,u,h,d=o(10),g=o(111),m=o(82),y=o(26),v=o(43),k=o(13),_=o(78),w=o(112),S=o(47),C=o(113),x=o(114),O=o(115),T=d.setImmediate,E=d.clearImmediate,M=d.process,R=d.Dispatch,j=d.Function,D=d.MessageChannel,L=d.String,N=0,U={},H="onreadystatechange";try{c=d.location}catch(t){}var run=function(t){if(v(U,t)){var r=U[t];delete U[t];r()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){d.postMessage(L(t),c.protocol+"//"+c.host)};if(!T||!E){T=function setImmediate(t){C(arguments.length,1);var r=y(t)?t:j(t),o=w(arguments,1);U[++N]=function(){g(r,void 0,o)};l(N);return N};E=function clearImmediate(t){delete U[t]};if(O)l=function(t){M.nextTick(runner(t))};else if(R&&R.now)l=function(t){R.now(runner(t))};else if(D&&!x){h=(u=new D).port2;u.port1.onmessage=listener;l=m(h.postMessage,h)}else if(d.addEventListener&&y(d.postMessage)&&!d.importScripts&&c&&"file:"!==c.protocol&&!k(post)){l=post;d.addEventListener("message",listener,!1)}else l=H in S("script")?function(t){_.appendChild(S("script")).onreadystatechange=function(){_.removeChild(this);run(t)}}:function(t){setTimeout(runner(t),0)}}t.exports={set:T,clear:E}},(t,r,o)=>{var c=o(15),l=Function.prototype,u=l.apply,h=l.call;t.exports="object"==typeof Reflect&&Reflect.apply||(c?h.bind(u):function(){return h.apply(u,arguments)})},(t,r,o)=>{var c=o(20);t.exports=c([].slice)},(t,r,o)=>{var c=o(10).TypeError;t.exports=function(t,r){if(t<r)throw c("Not enough arguments");return t}},(t,r,o)=>{var c=o(33);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(c)},(t,r,o)=>{var c=o(21),l=o(10);t.exports="process"==c(l.process)},(t,r,o)=>{var c,l,u,h,d,g,m,y,v=o(10),k=o(82),_=o(11).f,w=o(110).set,S=o(114),C=o(117),x=o(118),O=o(115),T=v.MutationObserver||v.WebKitMutationObserver,E=v.document,M=v.process,R=v.Promise,j=_(v,"queueMicrotask"),D=j&&j.value;if(!D){c=function(){var t,r;O&&(t=M.domain)&&t.exit();for(;l;){r=l.fn;l=l.next;try{r()}catch(t){l?h():u=void 0;throw t}}u=void 0;t&&t.enter()};if(S||O||x||!T||!E)if(!C&&R&&R.resolve){(m=R.resolve(void 0)).constructor=R;y=k(m.then,m);h=function(){y(c)}}else if(O)h=function(){M.nextTick(c)};else{w=k(w,v);h=function(){w(c)}}else{d=!0;g=E.createTextNode("");new T(c).observe(g,{characterData:!0});h=function(){g.data=d=!d}}}t.exports=D||function(t){var r={fn:t,next:void 0};u&&(u.next=r);if(!l){l=r;h()}u=r}},(t,r,o)=>{var c=o(33),l=o(10);t.exports=/ipad|iphone|ipod/i.test(c)&&void 0!==l.Pebble},(t,r,o)=>{var c=o(33);t.exports=/web0s(?!.*chrome)/i.test(c)},(t,r,o)=>{var c=o(51),l=o(25),u=o(120);t.exports=function(t,r){c(t);if(l(r)&&r.constructor===t)return r;var o=u.f(t);(0,o.resolve)(r);return o.promise}},(t,r,o)=>{"use strict";var c=o(35),PromiseCapability=function(t){var r,o;this.promise=new t((function(t,c){if(void 0!==r||void 0!==o)throw TypeError("Bad Promise constructor");r=t;o=c}));this.resolve=c(r);this.reject=c(o)};t.exports.f=function(t){return new PromiseCapability(t)}},(t,r,o)=>{var c=o(10);t.exports=function(t,r){var o=c.console;o&&o.error&&(1==arguments.length?o.error(t):o.error(t,r))}},t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}}},t=>{var Queue=function(){this.head=null;this.tail=null};Queue.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r;this.tail=r},get:function(){var t=this.head;if(t){this.head=t.next;this.tail===t&&(this.tail=null);return t.item}}};t.exports=Queue},t=>{t.exports="object"==typeof window},(t,r,o)=>{"use strict";var c=o(9),l=o(14),u=o(35),h=o(120),d=o(122),g=o(81);c({target:"Promise",stat:!0},{allSettled:function allSettled(t){var r=this,o=h.f(r),c=o.resolve,m=o.reject,y=d((function(){var o=u(r.resolve),h=[],d=0,m=1;g(t,(function(t){var u=d++,g=!1;m++;l(o,r,t).then((function(t){if(!g){g=!0;h[u]={status:"fulfilled",value:t};--m||c(h)}}),(function(t){if(!g){g=!0;h[u]={status:"rejected",reason:t};--m||c(h)}}))}));--m||c(h)}));y.error&&m(y.value);return o.promise}})},(t,r,o)=>{"use strict";var c=o(9),l=o(35),u=o(28),h=o(14),d=o(120),g=o(122),m=o(81),y="No one promise resolved";c({target:"Promise",stat:!0},{any:function any(t){var r=this,o=u("AggregateError"),c=d.f(r),v=c.resolve,k=c.reject,_=g((function(){var c=l(r.resolve),u=[],d=0,g=1,_=!1;m(t,(function(t){var l=d++,m=!1;g++;h(c,r,t).then((function(t){if(!m&&!_){_=!0;v(t)}}),(function(t){if(!m&&!_){m=!0;u[l]=t;--g||k(new o(u,y))}}))}));--g||k(new o(u,y))}));_.error&&k(_.value);return c.promise}})},(t,r,o)=>{"use strict";var c=o(9),l=o(40),u=o(102),h=o(13),d=o(28),g=o(26),m=o(107),y=o(119),v=o(52);c({target:"Promise",proto:!0,real:!0,forced:!!u&&h((function(){u.prototype.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=m(this,d("Promise")),o=g(t);return this.then(o?function(o){return y(r,t()).then((function(){return o}))}:t,o?function(o){return y(r,t()).then((function(){throw o}))}:t)}});if(!l&&g(u)){var k=d("Promise").prototype.finally;u.prototype.finally!==k&&v(u.prototype,"finally",k,{unsafe:!0})}},(t,r,o)=>{"use strict";var c=o(129).charAt,l=o(91),u=o(54),h=o(95),d="String Iterator",g=u.set,m=u.getterFor(d);h(String,"String",(function(t){g(this,{type:d,string:l(t),index:0})}),(function next(){var t,r=m(this),o=r.string,l=r.index;if(l>=o.length)return{value:void 0,done:!0};t=c(o,l);r.index+=t.length;return{value:t,done:!1}}))},(t,r,o)=>{var c=o(20),l=o(65),u=o(91),h=o(22),d=c("".charAt),g=c("".charCodeAt),m=c("".slice),createMethod=function(t){return function(r,o){var c,y,v=u(h(r)),k=l(o),_=v.length;return k<0||k>=_?t?"":void 0:(c=g(v,k))<55296||c>56319||k+1===_||(y=g(v,k+1))<56320||y>57343?t?d(v,k):c:t?m(v,k,k+2):y-56320+(c-55296<<10)+65536}};t.exports={codeAt:createMethod(!1),charAt:createMethod(!0)}},(t,r,o)=>{var c=o(10);t.exports=c},(t,r,o)=>{o(93);o(99);o(132);o(143);o(144);var c=o(130);t.exports=c.structuredClone},(t,r,o)=>{"use strict";o(133)("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),o(142))},(t,r,o)=>{"use strict";var c=o(9),l=o(10),u=o(20),h=o(70),d=o(52),g=o(134),m=o(81),y=o(105),v=o(26),k=o(25),_=o(13),w=o(106),S=o(98),C=o(141);t.exports=function(t,r,o){var x=-1!==t.indexOf("Map"),O=-1!==t.indexOf("Weak"),T=x?"set":"add",E=l[t],M=E&&E.prototype,R=E,j={},fixMethod=function(t){var r=u(M[t]);d(M,t,"add"==t?function add(t){r(this,0===t?0:t);return this}:"delete"==t?function(t){return!(O&&!k(t))&&r(this,0===t?0:t)}:"get"==t?function get(t){return O&&!k(t)?void 0:r(this,0===t?0:t)}:"has"==t?function has(t){return!(O&&!k(t))&&r(this,0===t?0:t)}:function set(t,o){r(this,0===t?0:t,o);return this})};if(h(t,!v(E)||!(O||M.forEach&&!_((function(){(new E).entries().next()}))))){R=o.getConstructor(r,t,x,T);g.enable()}else if(h(t,!0)){var D=new R,L=D[T](O?{}:-0,1)!=D,N=_((function(){D.has(1)})),U=w((function(t){new E(t)})),H=!O&&_((function(){for(var t=new E,r=5;r--;)t[T](r,r);return!t.has(-0)}));if(!U){(R=r((function(t,r){y(t,M);var o=C(new E,t,R);null!=r&&m(r,o[T],{that:o,AS_ENTRIES:x});return o}))).prototype=M;M.constructor=R}if(N||H){fixMethod("delete");fixMethod("has");x&&fixMethod("get")}(H||L)&&fixMethod(T);O&&M.clear&&delete M.clear}j[t]=R;c({global:!0,forced:R!=E},j);S(R,t);O||o.setStrong(R,t,x);return R}},(t,r,o)=>{var c=o(9),l=o(20),u=o(57),h=o(25),d=o(43),g=o(49).f,m=o(61),y=o(135),v=o(138),k=o(45),_=o(140),w=!1,S=k("meta"),C=0,setMetadata=function(t){g(t,S,{value:{objectID:"O"+C++,weakData:{}}})},x=t.exports={enable:function(){x.enable=function(){};w=!0;var t=m.f,r=l([].splice),o={};o[S]=1;if(t(o).length){m.f=function(o){for(var c=t(o),l=0,u=c.length;l<u;l++)if(c[l]===S){r(c,l,1);break}return c};c({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:y.f})}},fastKey:function(t,r){if(!h(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!d(t,S)){if(!v(t))return"F";if(!r)return"E";setMetadata(t)}return t[S].objectID},getWeakData:function(t,r){if(!d(t,S)){if(!v(t))return!0;if(!r)return!1;setMetadata(t)}return t[S].weakData},onFreeze:function(t){_&&w&&v(t)&&!d(t,S)&&setMetadata(t);return t}};u[S]=!0},(t,r,o)=>{var c=o(21),l=o(18),u=o(61).f,h=o(136),d="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function getOwnPropertyNames(t){return d&&"Window"==c(t)?function(t){try{return u(t)}catch(t){return h(d)}}(t):u(l(t))}},(t,r,o)=>{var c=o(10),l=o(64),u=o(66),h=o(137),d=c.Array,g=Math.max;t.exports=function(t,r,o){for(var c=u(t),m=l(r,c),y=l(void 0===o?c:o,c),v=d(g(y-m,0)),k=0;m<y;m++,k++)h(v,k,t[m]);v.length=k;return v}},(t,r,o)=>{"use strict";var c=o(23),l=o(49),u=o(17);t.exports=function(t,r,o){var h=c(r);h in t?l.f(t,h,u(0,o)):t[h]=o}},(t,r,o)=>{var c=o(13),l=o(25),u=o(21),h=o(139),d=Object.isExtensible,g=c((function(){d(1)}));t.exports=g||h?function isExtensible(t){return!!l(t)&&((!h||"ArrayBuffer"!=u(t))&&(!d||d(t)))}:d},(t,r,o)=>{var c=o(13);t.exports=c((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},(t,r,o)=>{var c=o(13);t.exports=!c((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(t,r,o)=>{var c=o(26),l=o(25),u=o(73);t.exports=function(t,r,o){var h,d;u&&c(h=r.constructor)&&h!==o&&l(d=h.prototype)&&d!==o.prototype&&u(t,d);return t}},(t,r,o)=>{"use strict";var c=o(49).f,l=o(75),u=o(103),h=o(82),d=o(105),g=o(81),m=o(95),y=o(104),v=o(12),k=o(134).fastKey,_=o(54),w=_.set,S=_.getterFor;t.exports={getConstructor:function(t,r,o,m){var y=t((function(t,c){d(t,_);w(t,{type:r,index:l(null),first:void 0,last:void 0,size:0});v||(t.size=0);null!=c&&g(c,t[m],{that:t,AS_ENTRIES:o})})),_=y.prototype,C=S(r),define=function(t,r,o){var c,l,u=C(t),h=getEntry(t,r);if(h)h.value=o;else{u.last=h={index:l=k(r,!0),key:r,value:o,previous:c=u.last,next:void 0,removed:!1};u.first||(u.first=h);c&&(c.next=h);v?u.size++:t.size++;"F"!==l&&(u.index[l]=h)}return t},getEntry=function(t,r){var o,c=C(t),l=k(r);if("F"!==l)return c.index[l];for(o=c.first;o;o=o.next)if(o.key==r)return o};u(_,{clear:function clear(){for(var t=C(this),r=t.index,o=t.first;o;){o.removed=!0;o.previous&&(o.previous=o.previous.next=void 0);delete r[o.index];o=o.next}t.first=t.last=void 0;v?t.size=0:this.size=0},delete:function(t){var r=this,o=C(r),c=getEntry(r,t);if(c){var l=c.next,u=c.previous;delete o.index[c.index];c.removed=!0;u&&(u.next=l);l&&(l.previous=u);o.first==c&&(o.first=l);o.last==c&&(o.last=u);v?o.size--:r.size--}return!!c},forEach:function forEach(t){for(var r,o=C(this),c=h(t,arguments.length>1?arguments[1]:void 0);r=r?r.next:o.first;){c(r.value,r.key,this);for(;r&&r.removed;)r=r.previous}},has:function has(t){return!!getEntry(this,t)}});u(_,o?{get:function get(t){var r=getEntry(this,t);return r&&r.value},set:function set(t,r){return define(this,0===t?0:t,r)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}});v&&c(_,"size",{get:function(){return C(this).size}});return y},setStrong:function(t,r,o){var c=r+" Iterator",l=S(r),u=S(c);m(t,r,(function(t,r){w(this,{type:c,target:t,state:l(t),kind:r,last:void 0})}),(function(){for(var t=u(this),r=t.kind,o=t.last;o&&o.removed;)o=o.previous;if(!t.target||!(t.last=o=o?o.next:t.state.first)){t.target=void 0;return{value:void 0,done:!0}}return"keys"==r?{value:o.key,done:!1}:"values"==r?{value:o.value,done:!1}:{value:[o.key,o.value],done:!1}}),o?"entries":"values",!o,!0);y(r)}}},(t,r,o)=>{"use strict";o(133)("Set",(function(t){return function Set(){return t(this,arguments.length?arguments[0]:void 0)}}),o(142))},(t,r,o)=>{var c,l=o(40),u=o(9),h=o(10),d=o(28),g=o(20),m=o(13),y=o(45),v=o(26),k=o(109),_=o(25),w=o(27),S=o(81),C=o(51),x=o(87),O=o(43),T=o(137),E=o(48),M=o(66),R=o(113),j=o(145),D=o(92),L=h.Object,N=h.Date,U=h.Error,H=h.EvalError,$=h.RangeError,X=h.ReferenceError,q=h.SyntaxError,G=h.TypeError,z=h.URIError,W=h.PerformanceMark,V=h.WebAssembly,K=V&&V.CompileError||U,Y=V&&V.LinkError||U,J=V&&V.RuntimeError||U,Z=d("DOMException"),Q=d("Set"),ee=d("Map"),te=ee.prototype,re=g(te.has),ae=g(te.get),ne=g(te.set),ie=g(Q.prototype.add),oe=d("Object","keys"),se=g([].push),ce=g((!0).valueOf),le=g(1..valueOf),ue=g("".valueOf),fe=g(j),he=g(N.prototype.getTime),de=y("structuredClone"),pe="DataCloneError",ge="Transferring",checkBasicSemantic=function(t){return!m((function(){var r=new h.Set([7]),o=t(r),c=t(L(7));return o==r||!o.has(7)||"object"!=typeof c||7!=c}))&&t},me=h.structuredClone,ye=l||!(c=me,!m((function(){var t=c(new h.AggregateError([1],de,{cause:3}));return"AggregateError"!=t.name||1!=t.errors[0]||t.message!=de||3!=t.cause}))&&c),ve=!me&&checkBasicSemantic((function(t){return new W(de,{detail:t}).detail})),be=checkBasicSemantic(me)||ve,throwUncloneable=function(t){throw new Z("Uncloneable type: "+t,pe)},throwUnpolyfillable=function(t,r){throw new Z((r||"Cloning")+" of "+t+" cannot be properly polyfilled in this engine",pe)},structuredCloneInternal=function(t,r){w(t)&&throwUncloneable("Symbol");if(!_(t))return t;if(r){if(re(r,t))return ae(r,t)}else r=new ee;var o,c,l,u,g,m,y,S,C,R,j=x(t),W=!1;switch(j){case"Array":l=[];W=!0;break;case"Object":l={};W=!0;break;case"Map":l=new ee;W=!0;break;case"Set":l=new Q;W=!0;break;case"RegExp":l=new RegExp(t.source,"flags"in t?t.flags:fe(t));break;case"Error":switch(c=t.name){case"AggregateError":l=d("AggregateError")([]);break;case"EvalError":l=H();break;case"RangeError":l=$();break;case"ReferenceError":l=X();break;case"SyntaxError":l=q();break;case"TypeError":l=G();break;case"URIError":l=z();break;case"CompileError":l=K();break;case"LinkError":l=Y();break;case"RuntimeError":l=J();break;default:l=U()}W=!0;break;case"DOMException":l=new Z(t.message,t.name);W=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":o=h[j];_(o)||throwUnpolyfillable(j);l=new o(structuredCloneInternal(t.buffer,r),t.byteOffset,"DataView"===j?t.byteLength:t.length);break;case"DOMQuad":try{l=new DOMQuad(structuredCloneInternal(t.p1,r),structuredCloneInternal(t.p2,r),structuredCloneInternal(t.p3,r),structuredCloneInternal(t.p4,r))}catch(r){be?l=be(t):throwUnpolyfillable(j)}break;case"FileList":o=h.DataTransfer;if(k(o)){u=new o;for(g=0,m=M(t);g<m;g++)u.items.add(structuredCloneInternal(t[g],r));l=u.files}else be?l=be(t):throwUnpolyfillable(j);break;case"ImageData":try{l=new ImageData(structuredCloneInternal(t.data,r),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){be?l=be(t):throwUnpolyfillable(j)}break;default:if(be)l=be(t);else switch(j){case"BigInt":l=L(t.valueOf());break;case"Boolean":l=L(ce(t));break;case"Number":l=L(le(t));break;case"String":l=L(ue(t));break;case"Date":l=new N(he(t));break;case"ArrayBuffer":(o=h.DataView)||"function"==typeof t.slice||throwUnpolyfillable(j);try{if("function"==typeof t.slice)l=t.slice(0);else{m=t.byteLength;l=new ArrayBuffer(m);C=new o(t);R=new o(l);for(g=0;g<m;g++)R.setUint8(g,C.getUint8(g))}}catch(t){throw new Z("ArrayBuffer is detached",pe)}break;case"SharedArrayBuffer":l=t;break;case"Blob":try{l=t.slice(0,t.size,t.type)}catch(t){throwUnpolyfillable(j)}break;case"DOMPoint":case"DOMPointReadOnly":o=h[j];try{l=o.fromPoint?o.fromPoint(t):new o(t.x,t.y,t.z,t.w)}catch(t){throwUnpolyfillable(j)}break;case"DOMRect":case"DOMRectReadOnly":o=h[j];try{l=o.fromRect?o.fromRect(t):new o(t.x,t.y,t.width,t.height)}catch(t){throwUnpolyfillable(j)}break;case"DOMMatrix":case"DOMMatrixReadOnly":o=h[j];try{l=o.fromMatrix?o.fromMatrix(t):new o(t)}catch(t){throwUnpolyfillable(j)}break;case"AudioData":case"VideoFrame":v(t.clone)||throwUnpolyfillable(j);try{l=t.clone()}catch(t){throwUncloneable(j)}break;case"File":try{l=new File([t],t.name,t)}catch(t){throwUnpolyfillable(j)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(j);default:throwUncloneable(j)}}ne(r,t,l);if(W)switch(j){case"Array":case"Object":y=oe(t);for(g=0,m=M(y);g<m;g++){S=y[g];T(l,S,structuredCloneInternal(t[S],r))}break;case"Map":t.forEach((function(t,o){ne(l,structuredCloneInternal(o,r),structuredCloneInternal(t,r))}));break;case"Set":t.forEach((function(t){ie(l,structuredCloneInternal(t,r))}));break;case"Error":E(l,"message",structuredCloneInternal(t.message,r));O(t,"cause")&&E(l,"cause",structuredCloneInternal(t.cause,r));"AggregateError"==c&&(l.errors=structuredCloneInternal(t.errors,r));case"DOMException":D&&E(l,"stack",structuredCloneInternal(t.stack,r))}return l},ke=me&&!m((function(){var t=new ArrayBuffer(8),r=me(t,{transfer:[t]});return 0!=t.byteLength||8!=r.byteLength})),tryToTransfer=function(t,r){if(!_(t))throw G("Transfer option cannot be converted to a sequence");var o=[];S(t,(function(t){se(o,C(t))}));var c,l,u,d,g,m,y=0,w=M(o);if(ke){d=me(o,{transfer:o});for(;y<w;)ne(r,o[y],d[y++])}else for(;y<w;){c=o[y++];if(re(r,c))throw new Z("Duplicate transferable",pe);switch(l=x(c)){case"ImageBitmap":u=h.OffscreenCanvas;k(u)||throwUnpolyfillable(l,ge);try{(m=new u(c.width,c.height)).getContext("bitmaprenderer").transferFromImageBitmap(c);g=m.transferToImageBitmap()}catch(t){}break;case"AudioData":case"VideoFrame":v(c.clone)&&v(c.close)||throwUnpolyfillable(l,ge);try{g=c.clone();c.close()}catch(t){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(l,ge)}if(void 0===g)throw new Z("This object cannot be transferred: "+l,pe);ne(r,c,g)}};u({global:!0,enumerable:!0,sham:!ke,forced:ye},{structuredClone:function structuredClone(t){var r,o=R(arguments.length,1)>1?C(arguments[1]):void 0,c=o?o.transfer:void 0;if(void 0!==c){r=new ee;tryToTransfer(c,r)}return structuredCloneInternal(t,r)}})},(t,r,o)=>{"use strict";var c=o(51);t.exports=function(){var t=c(this),r="";t.global&&(r+="g");t.ignoreCase&&(r+="i");t.multiline&&(r+="m");t.dotAll&&(r+="s");t.unicode&&(r+="u");t.sticky&&(r+="y");return r}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.RefSetCache=r.RefSet=r.Ref=r.Name=r.EOF=r.Dict=r.Cmd=r.CIRCULAR_REF=void 0;r.clearPrimitiveCaches=function clearPrimitiveCaches(){g._clearCache();d._clearCache();v._clearCache()};r.isCmd=function isCmd(t,r){return t instanceof g&&(void 0===r||t.cmd===r)};r.isDict=function isDict(t,r){return t instanceof y&&(void 0===r||isName(t.get("Type"),r))};r.isName=isName;r.isRefsEqual=function isRefsEqual(t,r){return t.num===r.num&&t.gen===r.gen};var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var u=Symbol("CIRCULAR_REF");r.CIRCULAR_REF=u;var h=Symbol("EOF");r.EOF=h;var d=function NameClosure(){var t=Object.create(null);return function(){function Name(t){_classCallCheck(this,Name);this.name=t}_createClass(Name,null,[{key:"get",value:function get(r){var o=t[r];return o||(t[r]=new Name(r))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Name}()}();r.Name=d;var g=function CmdClosure(){var t=Object.create(null);return function(){function Cmd(t){_classCallCheck(this,Cmd);this.cmd=t}_createClass(Cmd,null,[{key:"get",value:function get(r){var o=t[r];return o||(t[r]=new Cmd(r))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Cmd}()}();r.Cmd=g;var m=function nonSerializableClosure(){return m},y=function(){function Dict(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,Dict);this._map=Object.create(null);this.xref=t;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=m}_createClass(Dict,[{key:"assignXref",value:function assignXref(t){this.xref=t}},{key:"size",get:function get(){return Object.keys(this._map).length}},{key:"get",value:function get(t,r,o){var c=this._map[t];void 0===c&&void 0!==r&&void 0===(c=this._map[r])&&void 0!==o&&(c=this._map[o]);return c instanceof v&&this.xref?this.xref.fetch(c,this.suppressEncryption):c}},{key:"getAsync",value:(t=function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}(c.default.mark((function _callee(t,r,o){var l;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:void 0===(l=this._map[t])&&void 0!==r&&void 0===(l=this._map[r])&&void 0!==o&&(l=this._map[o]);if(!(l instanceof v&&this.xref)){c.next=4;break}return c.abrupt("return",this.xref.fetchAsync(l,this.suppressEncryption));case 4:return c.abrupt("return",l);case 5:case"end":return c.stop()}}),_callee,this)}))),function getAsync(r,o,c){return t.apply(this,arguments)})},{key:"getArray",value:function getArray(t,r,o){var c=this._map[t];void 0===c&&void 0!==r&&void 0===(c=this._map[r])&&void 0!==o&&(c=this._map[o]);c instanceof v&&this.xref&&(c=this.xref.fetch(c,this.suppressEncryption));if(Array.isArray(c))for(var l=0,u=(c=c.slice()).length;l<u;l++)c[l]instanceof v&&this.xref&&(c[l]=this.xref.fetch(c[l],this.suppressEncryption));return c}},{key:"getRaw",value:function getRaw(t){return this._map[t]}},{key:"getKeys",value:function getKeys(){return Object.keys(this._map)}},{key:"getRawValues",value:function getRawValues(){return Object.values(this._map)}},{key:"set",value:function set(t,r){this._map[t]=r}},{key:"has",value:function has(t){return void 0!==this._map[t]}},{key:"forEach",value:function forEach(t){for(var r in this._map)t(r,this.get(r))}}],[{key:"empty",get:function get(){var t=new Dict(null);t.set=function(t,r){(0,l.unreachable)("Should not call `set` on the empty dictionary.")};return(0,l.shadow)(this,"empty",t)}},{key:"merge",value:function merge(t){var r,o=t.xref,c=t.dictArray,l=t.mergeSubDicts,u=void 0!==l&&l,h=new Dict(o),d=new Map,g=_createForOfIteratorHelper(c);try{for(g.s();!(r=g.n()).done;){var m=r.value;if(m instanceof Dict)for(var y=0,v=Object.entries(m._map);y<v.length;y++){var k=_slicedToArray(v[y],2),_=k[0],w=k[1],S=d.get(_);if(void 0===S){S=[];d.set(_,S)}else if(!(u&&w instanceof Dict))continue;S.push(w)}}}catch(t){g.e(t)}finally{g.f()}var C,x=_createForOfIteratorHelper(d);try{for(x.s();!(C=x.n()).done;){var O=_slicedToArray(C.value,2),T=O[0],E=O[1];if(1!==E.length&&E[0]instanceof Dict){var M,R=new Dict(o),j=_createForOfIteratorHelper(E);try{for(j.s();!(M=j.n()).done;)for(var D=M.value,L=0,N=Object.entries(D._map);L<N.length;L++){var U=_slicedToArray(N[L],2),H=U[0],$=U[1];void 0===R._map[H]&&(R._map[H]=$)}}catch(t){j.e(t)}finally{j.f()}R.size>0&&(h._map[T]=R)}else h._map[T]=E[0]}}catch(t){x.e(t)}finally{x.f()}d.clear();return h.size>0?h:Dict.empty}}]);var t;return Dict}();r.Dict=y;var v=function RefClosure(){var t=Object.create(null);return function(){function Ref(t,r){_classCallCheck(this,Ref);this.num=t;this.gen=r}_createClass(Ref,[{key:"toString",value:function toString(){return 0===this.gen?"".concat(this.num,"R"):"".concat(this.num,"R").concat(this.gen)}}],[{key:"get",value:function get(r,o){var c=0===o?"".concat(r,"R"):"".concat(r,"R").concat(o),l=t[c];return l||(t[c]=new Ref(r,o))}},{key:"_clearCache",value:function _clearCache(){t=Object.create(null)}}]);return Ref}()}();r.Ref=v;var k=function(t){function RefSet(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,RefSet);this._set=new Set(t&&t._set)}_createClass(RefSet,[{key:"has",value:function has(t){return this._set.has(t.toString())}},{key:"put",value:function put(t){this._set.add(t.toString())}},{key:"remove",value:function remove(t){this._set.delete(t.toString())}},{key:Symbol.iterator,value:function value(){return this._set.values()}},{key:"clear",value:function clear(){this._set.clear()}}]);return RefSet}();r.RefSet=k;var _=function(t){function RefSetCache(){_classCallCheck(this,RefSetCache);this._map=new Map}_createClass(RefSetCache,[{key:"size",get:function get(){return this._map.size}},{key:"get",value:function get(t){return this._map.get(t.toString())}},{key:"has",value:function has(t){return this._map.has(t.toString())}},{key:"put",value:function put(t,r){this._map.set(t.toString(),r)}},{key:"putAlias",value:function putAlias(t,r){this._map.set(t.toString(),this.get(r))}},{key:Symbol.iterator,value:function value(){return this._map.values()}},{key:"clear",value:function clear(){this._map.clear()}}]);return RefSetCache}();r.RefSetCache=_;function isName(t,r){return t instanceof d&&(void 0===r||t.name===r)}},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.NetworkPdfManager=r.LocalPdfManager=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(148),h=o(149),d=o(152),g=o(151);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function parseDocBaseUrl(t){if(t){var r=(0,l.createValidAbsoluteUrl)(t);if(r)return r.href;(0,l.warn)('Invalid absolute docBaseUrl: "'.concat(t,'".'))}return null}var m=function(){function BasePdfManager(){_classCallCheck(this,BasePdfManager);this.constructor===BasePdfManager&&(0,l.unreachable)("Cannot initialize BasePdfManager.")}_createClass(BasePdfManager,[{key:"docId",get:function get(){return this._docId}},{key:"password",get:function get(){return this._password}},{key:"docBaseUrl",get:function get(){return this._docBaseUrl}},{key:"onLoadedStream",value:function onLoadedStream(){(0,l.unreachable)("Abstract method `onLoadedStream` called")}},{key:"ensureDoc",value:function ensureDoc(t,r){return this.ensure(this.pdfDocument,t,r)}},{key:"ensureXRef",value:function ensureXRef(t,r){return this.ensure(this.pdfDocument.xref,t,r)}},{key:"ensureCatalog",value:function ensureCatalog(t,r){return this.ensure(this.pdfDocument.catalog,t,r)}},{key:"getPage",value:function getPage(t){return this.pdfDocument.getPage(t)}},{key:"fontFallback",value:function fontFallback(t,r){return this.pdfDocument.fontFallback(t,r)}},{key:"loadXfaFonts",value:function loadXfaFonts(t,r){return this.pdfDocument.loadXfaFonts(t,r)}},{key:"loadXfaImages",value:function loadXfaImages(){return this.pdfDocument.loadXfaImages()}},{key:"serializeXfaData",value:function serializeXfaData(t){return this.pdfDocument.serializeXfaData(t)}},{key:"cleanup",value:function cleanup(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.pdfDocument.cleanup(t)}},{key:"ensure",value:(t=_asyncToGenerator(c.default.mark((function _callee(t,r,o){return c.default.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:(0,l.unreachable)("Abstract method `ensure` called");case 1:case"end":return t.stop()}}),_callee)}))),function ensure(r,o,c){return t.apply(this,arguments)})},{key:"requestRange",value:function requestRange(t,r){(0,l.unreachable)("Abstract method `requestRange` called")}},{key:"requestLoadedStream",value:function requestLoadedStream(){(0,l.unreachable)("Abstract method `requestLoadedStream` called")}},{key:"sendProgressiveData",value:function sendProgressiveData(t){(0,l.unreachable)("Abstract method `sendProgressiveData` called")}},{key:"updatePassword",value:function updatePassword(t){this._password=t}},{key:"terminate",value:function terminate(t){(0,l.unreachable)("Abstract method `terminate` called")}}]);var t;return BasePdfManager}(),y=function(t){_inherits(LocalPdfManager,t);var r,o=_createSuper(LocalPdfManager);function LocalPdfManager(t,r,c,l,u,h,m){var y;_classCallCheck(this,LocalPdfManager);(y=o.call(this))._docId=t;y._password=c;y._docBaseUrl=parseDocBaseUrl(m);y.msgHandler=l;y.evaluatorOptions=u;y.enableXfa=h;var v=new g.Stream(r);y.pdfDocument=new d.PDFDocument(_assertThisInitialized(y),v);y._loadedStreamPromise=Promise.resolve(v);return y}_createClass(LocalPdfManager,[{key:"ensure",value:(r=_asyncToGenerator(c.default.mark((function _callee2(t,r,o){var l;return c.default.wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:if("function"!=typeof(l=t[r])){c.next=3;break}return c.abrupt("return",l.apply(t,o));case 3:return c.abrupt("return",l);case 4:case"end":return c.stop()}}),_callee2)}))),function ensure(t,o,c){return r.apply(this,arguments)})},{key:"requestRange",value:function requestRange(t,r){return Promise.resolve()}},{key:"requestLoadedStream",value:function requestLoadedStream(){}},{key:"onLoadedStream",value:function onLoadedStream(){return this._loadedStreamPromise}},{key:"terminate",value:function terminate(t){}}]);return LocalPdfManager}(m);r.LocalPdfManager=y;var v=function(t){_inherits(NetworkPdfManager,t);var r,o=_createSuper(NetworkPdfManager);function NetworkPdfManager(t,r,c,l,h,g){var m;_classCallCheck(this,NetworkPdfManager);(m=o.call(this))._docId=t;m._password=c.password;m._docBaseUrl=parseDocBaseUrl(g);m.msgHandler=c.msgHandler;m.evaluatorOptions=l;m.enableXfa=h;m.streamManager=new u.ChunkedStreamManager(r,{msgHandler:c.msgHandler,length:c.length,disableAutoFetch:c.disableAutoFetch,rangeChunkSize:c.rangeChunkSize});m.pdfDocument=new d.PDFDocument(_assertThisInitialized(m),m.streamManager.getStream());return m}_createClass(NetworkPdfManager,[{key:"ensure",value:(r=_asyncToGenerator(c.default.mark((function _callee3(t,r,o){var l;return c.default.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:c.prev=0;if("function"!=typeof(l=t[r])){c.next=4;break}return c.abrupt("return",l.apply(t,o));case 4:return c.abrupt("return",l);case 7:c.prev=7;c.t0=c.catch(0);if(c.t0 instanceof h.MissingDataException){c.next=11;break}throw c.t0;case 11:c.next=13;return this.requestRange(c.t0.begin,c.t0.end);case 13:return c.abrupt("return",this.ensure(t,r,o));case 14:case"end":return c.stop()}}),_callee3,this,[[0,7]])}))),function ensure(t,o,c){return r.apply(this,arguments)})},{key:"requestRange",value:function requestRange(t,r){return this.streamManager.requestRange(t,r)}},{key:"requestLoadedStream",value:function requestLoadedStream(){this.streamManager.requestAllChunks()}},{key:"sendProgressiveData",value:function sendProgressiveData(t){this.streamManager.onReceiveData({chunk:t})}},{key:"onLoadedStream",value:function onLoadedStream(){return this.streamManager.onLoadedStream()}},{key:"terminate",value:function terminate(t){this.streamManager.abort(t)}}]);return NetworkPdfManager}(m);r.NetworkPdfManager=v},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.ChunkedStreamManager=r.ChunkedStream=void 0;var c=o(4),l=o(149);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(ChunkedStream,t);var r=_createSuper(ChunkedStream);function ChunkedStream(t,o,c){var l;_classCallCheck(this,ChunkedStream);(l=r.call(this,new Uint8Array(t),0,t,null)).chunkSize=o;l._loadedChunks=new Set;l.numChunks=Math.ceil(t/o);l.manager=c;l.progressiveDataLength=0;l.lastSuccessfulEnsureByteChunk=-1;return l}_createClass(ChunkedStream,[{key:"getMissingChunks",value:function getMissingChunks(){for(var t=[],r=0,o=this.numChunks;r<o;++r)this._loadedChunks.has(r)||t.push(r);return t}},{key:"numChunksLoaded",get:function get(){return this._loadedChunks.size}},{key:"isDataLoaded",get:function get(){return this.numChunksLoaded===this.numChunks}},{key:"onReceiveData",value:function onReceiveData(t,r){var o=this.chunkSize;if(t%o!=0)throw new Error("Bad begin offset: ".concat(t));var c=t+r.byteLength;if(c%o!=0&&c!==this.bytes.length)throw new Error("Bad end offset: ".concat(c));this.bytes.set(new Uint8Array(r),t);for(var l=Math.floor(t/o),u=Math.floor((c-1)/o)+1,h=l;h<u;++h)this._loadedChunks.add(h)}},{key:"onReceiveProgressiveData",value:function onReceiveProgressiveData(t){var r=this.progressiveDataLength,o=Math.floor(r/this.chunkSize);this.bytes.set(new Uint8Array(t),r);r+=t.byteLength;this.progressiveDataLength=r;for(var c=r>=this.end?this.numChunks:Math.floor(r/this.chunkSize),l=o;l<c;++l)this._loadedChunks.add(l)}},{key:"ensureByte",value:function ensureByte(t){if(!(t<this.progressiveDataLength)){var r=Math.floor(t/this.chunkSize);if(!(r>this.numChunks)&&r!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(r))throw new l.MissingDataException(t,t+1);this.lastSuccessfulEnsureByteChunk=r}}}},{key:"ensureRange",value:function ensureRange(t,r){if(!(t>=r||r<=this.progressiveDataLength)){var o=Math.floor(t/this.chunkSize);if(!(o>this.numChunks))for(var c=Math.min(Math.floor((r-1)/this.chunkSize)+1,this.numChunks),u=o;u<c;++u)if(!this._loadedChunks.has(u))throw new l.MissingDataException(t,r)}}},{key:"nextEmptyChunk",value:function nextEmptyChunk(t){for(var r=this.numChunks,o=0;o<r;++o){var c=(t+o)%r;if(!this._loadedChunks.has(c))return c}return null}},{key:"hasChunk",value:function hasChunk(t){return this._loadedChunks.has(t)}},{key:"getByte",value:function getByte(){var t=this.pos;if(t>=this.end)return-1;t>=this.progressiveDataLength&&this.ensureByte(t);return this.bytes[this.pos++]}},{key:"getBytes",value:function getBytes(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.bytes,c=this.pos,l=this.end;if(!t){l>this.progressiveDataLength&&this.ensureRange(c,l);var u=o.subarray(c,l);return r?new Uint8ClampedArray(u):u}var h=c+t;h>l&&(h=l);h>this.progressiveDataLength&&this.ensureRange(c,h);this.pos=h;var d=o.subarray(c,h);return r?new Uint8ClampedArray(d):d}},{key:"getByteRange",value:function getByteRange(t,r){t<0&&(t=0);r>this.end&&(r=this.end);r>this.progressiveDataLength&&this.ensureRange(t,r);return this.bytes.subarray(t,r)}},{key:"makeSubStream",value:function makeSubStream(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;r?t+r>this.progressiveDataLength&&this.ensureRange(t,t+r):t>=this.progressiveDataLength&&this.ensureByte(t);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){for(var t=this.chunkSize,r=Math.floor(this.start/t),o=Math.floor((this.end-1)/t)+1,c=[],l=r;l<o;++l)this._loadedChunks.has(l)||c.push(l);return c};Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get:function get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});var c=new ChunkedStreamSubstream;c.pos=c.start=t;c.end=t+r||this.end;c.dict=o;return c}},{key:"getBaseStreams",value:function getBaseStreams(){return[this]}}]);return ChunkedStream}(o(151).Stream);r.ChunkedStream=u;var h=function(){function ChunkedStreamManager(t,r){_classCallCheck(this,ChunkedStreamManager);this.length=r.length;this.chunkSize=r.rangeChunkSize;this.stream=new u(this.length,this.chunkSize,this);this.pdfNetworkStream=t;this.disableAutoFetch=r.disableAutoFetch;this.msgHandler=r.msgHandler;this.currRequestId=0;this._chunksNeededByRequest=new Map;this._requestsByChunk=new Map;this._promisesByRequest=new Map;this.progressiveDataLength=0;this.aborted=!1;this._loadedStreamCapability=(0,c.createPromiseCapability)()}_createClass(ChunkedStreamManager,[{key:"onLoadedStream",value:function onLoadedStream(){return this._loadedStreamCapability.promise}},{key:"sendRequest",value:function sendRequest(t,r){var o=this,l=this.pdfNetworkStream.getRangeReader(t,r);l.isStreamingSupported||(l.onProgress=this.onProgress.bind(this));var u=[],h=0;return new Promise((function(t,r){l.read().then((function readChunk(d){try{if(!d.done){var g=d.value;u.push(g);h+=(0,c.arrayByteLength)(g);l.isStreamingSupported&&o.onProgress({loaded:h});l.read().then(readChunk,r);return}var m=(0,c.arraysToBytes)(u);u=null;t(m)}catch(t){r(t)}}),r)})).then((function(r){o.aborted||o.onReceiveData({chunk:r,begin:t})}))}},{key:"requestAllChunks",value:function requestAllChunks(){var t=this.stream.getMissingChunks();this._requestChunks(t);return this._loadedStreamCapability.promise}},{key:"_requestChunks",value:function _requestChunks(t){var r=this,o=this.currRequestId++,l=new Set;this._chunksNeededByRequest.set(o,l);var u,h=_createForOfIteratorHelper(t);try{for(h.s();!(u=h.n()).done;){var d=u.value;this.stream.hasChunk(d)||l.add(d)}}catch(t){h.e(t)}finally{h.f()}if(0===l.size)return Promise.resolve();var g=(0,c.createPromiseCapability)();this._promisesByRequest.set(o,g);var m,y=[],v=_createForOfIteratorHelper(l);try{for(v.s();!(m=v.n()).done;){var k=m.value,_=this._requestsByChunk.get(k);if(!_){_=[];this._requestsByChunk.set(k,_);y.push(k)}_.push(o)}}catch(t){v.e(t)}finally{v.f()}if(y.length>0){var w,S=_createForOfIteratorHelper(this.groupChunks(y));try{for(S.s();!(w=S.n()).done;){var C=w.value,x=C.beginChunk*this.chunkSize,O=Math.min(C.endChunk*this.chunkSize,this.length);this.sendRequest(x,O).catch(g.reject)}}catch(t){S.e(t)}finally{S.f()}}return g.promise.catch((function(t){if(!r.aborted)throw t}))}},{key:"getStream",value:function getStream(){return this.stream}},{key:"requestRange",value:function requestRange(t,r){r=Math.min(r,this.length);for(var o=this.getBeginChunk(t),c=this.getEndChunk(r),l=[],u=o;u<c;++u)l.push(u);return this._requestChunks(l)}},{key:"requestRanges",value:function requestRanges(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=[],c=_createForOfIteratorHelper(r);try{for(c.s();!(t=c.n()).done;)for(var l=t.value,u=this.getBeginChunk(l.begin),h=this.getEndChunk(l.end),d=u;d<h;++d)o.includes(d)||o.push(d)}catch(t){c.e(t)}finally{c.f()}o.sort((function(t,r){return t-r}));return this._requestChunks(o)}},{key:"groupChunks",value:function groupChunks(t){for(var r=[],o=-1,c=-1,l=0,u=t.length;l<u;++l){var h=t[l];o<0&&(o=h);if(c>=0&&c+1!==h){r.push({beginChunk:o,endChunk:c+1});o=h}l+1===t.length&&r.push({beginChunk:o,endChunk:h+1});c=h}return r}},{key:"onProgress",value:function onProgress(t){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+t.loaded,total:this.length})}},{key:"onReceiveData",value:function onReceiveData(t){var r=t.chunk,o=void 0===t.begin,c=o?this.progressiveDataLength:t.begin,l=c+r.byteLength,u=Math.floor(c/this.chunkSize),h=l<this.length?Math.floor(l/this.chunkSize):Math.ceil(l/this.chunkSize);if(o){this.stream.onReceiveProgressiveData(r);this.progressiveDataLength=l}else this.stream.onReceiveData(c,r);this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);for(var d=[],g=u;g<h;++g){var m=this._requestsByChunk.get(g);if(m){this._requestsByChunk.delete(g);var y,v=_createForOfIteratorHelper(m);try{for(v.s();!(y=v.n()).done;){var k=y.value,_=this._chunksNeededByRequest.get(k);_.has(g)&&_.delete(g);_.size>0||d.push(k)}}catch(t){v.e(t)}finally{v.f()}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){var w;if(1===this.stream.numChunksLoaded){var S=this.stream.numChunks-1;this.stream.hasChunk(S)||(w=S)}else w=this.stream.nextEmptyChunk(h);Number.isInteger(w)&&this._requestChunks([w])}for(var C=0,x=d;C<x.length;C++){var O=x[C],T=this._promisesByRequest.get(O);this._promisesByRequest.delete(O);T.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}},{key:"onError",value:function onError(t){this._loadedStreamCapability.reject(t)}},{key:"getBeginChunk",value:function getBeginChunk(t){return Math.floor(t/this.chunkSize)}},{key:"getEndChunk",value:function getEndChunk(t){return Math.floor((t-1)/this.chunkSize)+1}},{key:"abort",value:function abort(t){this.aborted=!0;this.pdfNetworkStream&&this.pdfNetworkStream.cancelAllRequests(t);var r,o=_createForOfIteratorHelper(this._promisesByRequest.values());try{for(o.s();!(r=o.n()).done;){r.value.reject(t)}}catch(t){o.e(t)}finally{o.f()}}}]);return ChunkedStreamManager}();r.ChunkedStreamManager=h},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XRefParseException=r.XRefEntryException=r.ParserEOFException=r.MissingDataException=r.DocStats=void 0;r.collectActions=function collectActions(t,r,o){var u=Object.create(null),h=getInheritableProperty({dict:r,key:"AA",stopWhenFound:!1});if(h)for(var d=h.length-1;d>=0;d--){var g=h[d];if(g instanceof l.Dict){var m,y=_createForOfIteratorHelper(g.getKeys());try{for(y.s();!(m=y.n()).done;){var v=m.value,k=o[v];if(k){var _=g.getRaw(v),w=new l.RefSet,S=[];_collectJS(_,t,S,w);S.length>0&&(u[k]=S)}}}catch(t){y.e(t)}finally{y.f()}}}if(r.has("A")){var C=r.get("A"),x=new l.RefSet,O=[];_collectJS(C,t,O,x);O.length>0&&(u.Action=O)}return(0,c.objectSize)(u)>0?u:null};r.encodeToXmlString=function encodeToXmlString(t){for(var r=[],o=0,c=0,l=t.length;c<l;c++){var u=t.codePointAt(c);if(32<=u&&u<=126){var h=k[u];if(h){o<c&&r.push(t.substring(o,c));r.push(h);o=c+1}}else{o<c&&r.push(t.substring(o,c));r.push("&#x".concat(u.toString(16).toUpperCase(),";"));u>55295&&(u<57344||u>65533)&&c++;o=c+1}}if(0===r.length)return t;o<t.length&&r.push(t.substring(o,t.length));return r.join("")};r.escapePDFName=function escapePDFName(t){for(var r=[],o=0,c=0,l=t.length;c<l;c++){var u=t.charCodeAt(c);if(u<33||u>126||35===u||40===u||41===u||60===u||62===u||91===u||93===u||123===u||125===u||47===u||37===u){o<c&&r.push(t.substring(o,c));r.push("#".concat(u.toString(16)));o=c+1}}if(0===r.length)return t;o<t.length&&r.push(t.substring(o,t.length));return r.join("")};r.getArrayLookupTableFactory=function getArrayLookupTableFactory(t){var r;return function(){if(t){var o=t();t=null;r=Object.create(null);for(var c=0,l=o.length;c<l;c+=2)r[o[c]]=o[c+1];o=null}return r}};r.getInheritableProperty=getInheritableProperty;r.getLookupTableFactory=function getLookupTableFactory(t){var r;return function(){if(t){r=Object.create(null);t(r);t=null}return r}};r.isWhiteSpace=function isWhiteSpace(t){return 32===t||9===t||13===t||10===t};r.log2=function log2(t){if(t<=0)return 0;return Math.ceil(Math.log2(t))};r.parseXFAPath=function parseXFAPath(t){var r=/(.+)\[(\d+)\]$/;return t.split(".").map((function(t){var o=t.match(r);return o?{name:o[1],pos:parseInt(o[2],10)}:{name:t,pos:0}}))};r.readInt8=function readInt8(t,r){return t[r]<<24>>24};r.readUint16=function readUint16(t,r){return t[r]<<8|t[r+1]};r.readUint32=function readUint32(t,r){return(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0};r.recoverJsURL=function recoverJsURL(t){var r=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(t);if(r&&r[2]){var o=r[2],c=!1;"true"===r[3]&&"app.launchURL"===r[1]&&(c=!0);return{url:o,newWindow:c}}return null};r.toRomanNumerals=function toRomanNumerals(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,c.assert)(Number.isInteger(t)&&t>0,"The number should be a positive integer.");var o,l=[];for(;t>=1e3;){t-=1e3;l.push("M")}o=t/100|0;t%=100;l.push(v[o]);o=t/10|0;t%=10;l.push(v[10+o]);l.push(v[20+t]);var u=l.join("");return r?u.toLowerCase():u};r.validateCSSFont=function validateCSSFont(t){var r=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),o=t.fontFamily,l=t.fontWeight,u=t.italicAngle;if(/^".*"$/.test(o)){if(/[^\\]"/.test(o.slice(1,o.length-1))){(0,c.warn)('XFA - FontFamily contains some unescaped ": '.concat(o,"."));return!1}}else if(/^'.*'$/.test(o)){if(/[^\\]'/.test(o.slice(1,o.length-1))){(0,c.warn)("XFA - FontFamily contains some unescaped ': ".concat(o,"."));return!1}}else{var h,d=_createForOfIteratorHelper(o.split(/[ \t]+/));try{for(d.s();!(h=d.n()).done;){var g=h.value;if(/^(\d|(-(\d|-)))/.test(g)||!/^[\w-\\]+$/.test(g)){(0,c.warn)("XFA - FontFamily contains some invalid <custom-ident>: ".concat(o,"."));return!1}}}catch(t){d.e(t)}finally{d.f()}}var m=l?l.toString():"";t.fontWeight=r.has(m)?m:"400";var y=parseFloat(u);t.italicAngle=isNaN(y)||y<-90||y>90?"14":u.toString();return!0};var c=o(4),l=o(146),u=o(150);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var h=function(t){_inherits(MissingDataException,t);var r=_createSuper(MissingDataException);function MissingDataException(t,o){var c;_classCallCheck(this,MissingDataException);(c=r.call(this,"Missing data [".concat(t,", ").concat(o,")"),"MissingDataException")).begin=t;c.end=o;return c}return _createClass(MissingDataException)}(c.BaseException);r.MissingDataException=h;var d=function(t){_inherits(ParserEOFException,t);var r=_createSuper(ParserEOFException);function ParserEOFException(t){_classCallCheck(this,ParserEOFException);return r.call(this,t,"ParserEOFException")}return _createClass(ParserEOFException)}(c.BaseException);r.ParserEOFException=d;var g=function(t){_inherits(XRefEntryException,t);var r=_createSuper(XRefEntryException);function XRefEntryException(t){_classCallCheck(this,XRefEntryException);return r.call(this,t,"XRefEntryException")}return _createClass(XRefEntryException)}(c.BaseException);r.XRefEntryException=g;var m=function(t){_inherits(XRefParseException,t);var r=_createSuper(XRefParseException);function XRefParseException(t){_classCallCheck(this,XRefParseException);return r.call(this,t,"XRefParseException")}return _createClass(XRefParseException)}(c.BaseException);r.XRefParseException=m;var y=function(){function DocStats(t){_classCallCheck(this,DocStats);this._handler=t;this._streamTypes=new Set;this._fontTypes=new Set}_createClass(DocStats,[{key:"_send",value:function _send(){var t,r=Object.create(null),o=Object.create(null),c=_createForOfIteratorHelper(this._streamTypes);try{for(c.s();!(t=c.n()).done;){r[t.value]=!0}}catch(t){c.e(t)}finally{c.f()}var l,u=_createForOfIteratorHelper(this._fontTypes);try{for(u.s();!(l=u.n()).done;){o[l.value]=!0}}catch(t){u.e(t)}finally{u.f()}this._handler.send("DocStats",{streamTypes:r,fontTypes:o})}},{key:"addStreamType",value:function addStreamType(t){if(!this._streamTypes.has(t)){this._streamTypes.add(t);this._send()}}},{key:"addFontType",value:function addFontType(t){if(!this._fontTypes.has(t)){this._fontTypes.add(t);this._send()}}}]);return DocStats}();r.DocStats=y;function getInheritableProperty(t){for(var r,o=t.dict,c=t.key,u=t.getArray,h=void 0!==u&&u,d=t.stopWhenFound,g=void 0===d||d,m=new l.RefSet;o instanceof l.Dict&&(!o.objId||!m.has(o.objId));){o.objId&&m.put(o.objId);var y=h?o.getArray(c):o.get(c);if(void 0!==y){if(g)return y;r||(r=[]);r.push(y)}o=o.get("Parent")}return r}var v=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function _collectJS(t,r,o,h){if(t){var d=null;if(t instanceof l.Ref){if(h.has(t))return;d=t;h.put(d);t=r.fetch(t)}if(Array.isArray(t)){var g,m=_createForOfIteratorHelper(t);try{for(m.s();!(g=m.n()).done;){_collectJS(g.value,r,o,h)}}catch(t){m.e(t)}finally{m.f()}}else if(t instanceof l.Dict){if((0,l.isName)(t.get("S"),"JavaScript")){var y,v=t.get("JS");v instanceof u.BaseStream?y=v.getString():"string"==typeof v&&(y=v);(y=y&&(0,c.stringToPDFString)(y))&&o.push(y)}_collectJS(t.getRaw("Next"),r,o,h)}d&&h.remove(d)}}var k={60:"<",62:">",38:"&",34:""",39:"'"}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BaseStream=void 0;var c=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var l=function(){function BaseStream(){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,BaseStream);this.constructor===BaseStream&&(0,c.unreachable)("Cannot initialize BaseStream.")}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(BaseStream,[{key:"length",get:function get(){(0,c.unreachable)("Abstract getter `length` accessed")}},{key:"isEmpty",get:function get(){(0,c.unreachable)("Abstract getter `isEmpty` accessed")}},{key:"isDataLoaded",get:function get(){return(0,c.shadow)(this,"isDataLoaded",!0)}},{key:"getByte",value:function getByte(){(0,c.unreachable)("Abstract method `getByte` called")}},{key:"getBytes",value:function getBytes(t){(0,c.unreachable)("Abstract method `getBytes` called")}},{key:"peekByte",value:function peekByte(){var t=this.getByte();-1!==t&&this.pos--;return t}},{key:"peekBytes",value:function peekBytes(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.getBytes(t,r);this.pos-=o.length;return o}},{key:"getUint16",value:function getUint16(){var t=this.getByte(),r=this.getByte();return-1===t||-1===r?-1:(t<<8)+r}},{key:"getInt32",value:function getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}},{key:"getByteRange",value:function getByteRange(t,r){(0,c.unreachable)("Abstract method `getByteRange` called")}},{key:"getString",value:function getString(t){return(0,c.bytesToString)(this.getBytes(t,!1))}},{key:"skip",value:function skip(t){this.pos+=t||1}},{key:"reset",value:function reset(){(0,c.unreachable)("Abstract method `reset` called")}},{key:"moveStart",value:function moveStart(){(0,c.unreachable)("Abstract method `moveStart` called")}},{key:"makeSubStream",value:function makeSubStream(t,r){(0,c.unreachable)("Abstract method `makeSubStream` called")}},{key:"getBaseStreams",value:function getBaseStreams(){return null}}]);return BaseStream}();r.BaseStream=l},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.StringStream=r.Stream=r.NullStream=void 0;var c=o(150),l=o(4);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=function(t){_inherits(Stream,t);var r=_createSuper(Stream);function Stream(t,o,c,l){var u;_classCallCheck(this,Stream);(u=r.call(this)).bytes=t instanceof Uint8Array?t:new Uint8Array(t);u.start=o||0;u.pos=u.start;u.end=o+c||u.bytes.length;u.dict=l;return u}_createClass(Stream,[{key:"length",get:function get(){return this.end-this.start}},{key:"isEmpty",get:function get(){return 0===this.length}},{key:"getByte",value:function getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}},{key:"getBytes",value:function getBytes(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.bytes,c=this.pos,l=this.end;if(!t){var u=o.subarray(c,l);return r?new Uint8ClampedArray(u):u}var h=c+t;h>l&&(h=l);this.pos=h;var d=o.subarray(c,h);return r?new Uint8ClampedArray(d):d}},{key:"getByteRange",value:function getByteRange(t,r){t<0&&(t=0);r>this.end&&(r=this.end);return this.bytes.subarray(t,r)}},{key:"reset",value:function reset(){this.pos=this.start}},{key:"moveStart",value:function moveStart(){this.start=this.pos}},{key:"makeSubStream",value:function makeSubStream(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Stream(this.bytes.buffer,t,r,o)}}]);return Stream}(c.BaseStream);r.Stream=u;var h=function(t){_inherits(StringStream,t);var r=_createSuper(StringStream);function StringStream(t){_classCallCheck(this,StringStream);return r.call(this,(0,l.stringToBytes)(t))}return _createClass(StringStream)}(u);r.StringStream=h;var d=function(t){_inherits(NullStream,t);var r=_createSuper(NullStream);function NullStream(){_classCallCheck(this,NullStream);return r.call(this,new Uint8Array(0))}return _createClass(NullStream)}(u);r.NullStream=d},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Page=r.PDFDocument=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(149),h=o(146),d=o(153),g=o(163),m=o(150),y=o(214),v=o(205),k=o(207),_=o(168),w=o(151),S=o(212),C=o(203),x=o(166),O=o(170),T=o(211),E=o(216),M=o(240);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var R=[0,0,612,792],j=function(){function Page(t){var r=t.pdfManager,o=t.xref,c=t.pageIndex,l=t.pageDict,u=t.ref,h=t.globalIdFactory,d=t.fontCache,g=t.builtInCMapCache,m=t.standardFontDataCache,y=t.globalImageCache,v=t.nonBlendModesSet,k=t.xfaFactory;_classCallCheck(this,Page);this.pdfManager=r;this.pageIndex=c;this.pageDict=l;this.xref=o;this.ref=u;this.fontCache=d;this.builtInCMapCache=g;this.standardFontDataCache=m;this.globalImageCache=y;this.nonBlendModesSet=v;this.evaluatorOptions=r.evaluatorOptions;this.resourcesPromise=null;this.xfaFactory=k;var _={obj:0};this._localIdFactory=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(_class,t);var r=_createSuper(_class);function _class(){_classCallCheck(this,_class);return r.apply(this,arguments)}_createClass(_class,null,[{key:"createObjId",value:function createObjId(){return"p".concat(c,"_").concat(++_.obj)}},{key:"getPageObjId",value:function getPageObjId(){return"page".concat(u.toString())}}]);return _class}(h)}_createClass(Page,[{key:"_getInheritableProperty",value:function _getInheritableProperty(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=(0,u.getInheritableProperty)({dict:this.pageDict,key:t,getArray:r,stopWhenFound:!1});return Array.isArray(o)?1!==o.length&&o[0]instanceof h.Dict?h.Dict.merge({xref:this.xref,dictArray:o}):o[0]:o}},{key:"content",get:function get(){return this.pageDict.getArray("Contents")}},{key:"resources",get:function get(){return(0,l.shadow)(this,"resources",this._getInheritableProperty("Resources")||h.Dict.empty)}},{key:"_getBoundingBox",value:function _getBoundingBox(t){if(this.xfaData)return this.xfaData.bbox;var r=this._getInheritableProperty(t,!0);if(Array.isArray(r)&&4===r.length){if(r[2]-r[0]!=0&&r[3]-r[1]!=0)return r;(0,l.warn)("Empty /".concat(t," entry."))}return null}},{key:"mediaBox",get:function get(){return(0,l.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||R)}},{key:"cropBox",get:function get(){return(0,l.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}},{key:"userUnit",get:function get(){var t=this.pageDict.get("UserUnit");("number"!=typeof t||t<=0)&&(t=1);return(0,l.shadow)(this,"userUnit",t)}},{key:"view",get:function get(){var t,r=this.cropBox,o=this.mediaBox;if(r===o||(0,l.isArrayEqual)(r,o))t=o;else{var c=l.Util.intersect(r,o);c&&c[2]-c[0]!=0&&c[3]-c[1]!=0?t=c:(0,l.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,l.shadow)(this,"view",t||o)}},{key:"rotate",get:function get(){var t=this._getInheritableProperty("Rotate")||0;t%90!=0?t=0:t>=360?t%=360:t<0&&(t=(t%360+360)%360);return(0,l.shadow)(this,"rotate",t)}},{key:"_onSubStreamError",value:function _onSubStreamError(t,r,o){if(!this.evaluatorOptions.ignoreErrors)throw r;t.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorContentSubStream});(0,l.warn)("getContentStream - ignoring sub-stream (".concat(o,'): "').concat(r,'".'))}},{key:"getContentStream",value:function getContentStream(t){var r=this;return this.pdfManager.ensure(this,"content").then((function(o){return o instanceof m.BaseStream?o:Array.isArray(o)?new O.StreamsSequenceStream(o,r._onSubStreamError.bind(r,t)):new w.NullStream}))}},{key:"xfaData",get:function get(){return(0,l.shadow)(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}},{key:"save",value:function save(t,r,o){var c=new x.PartialEvaluator({xref:this.xref,handler:t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions});return this._parsedAnnotations.then((function(t){var u,h=[],d=_createForOfIteratorHelper(t);try{for(d.s();!(u=d.n()).done;){var g=u.value;g.mustBePrinted(o)&&h.push(g.save(c,r,o).catch((function(t){(0,l.warn)("save - ignoring annotation data during "+'"'.concat(r.name,'" task: "').concat(t,'".'));return null})))}}catch(t){d.e(t)}finally{d.f()}return Promise.all(h)}))}},{key:"loadResources",value:function loadResources(t){var r=this;this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources"));return this.resourcesPromise.then((function(){return new S.ObjectLoader(r.resources,t,r.xref).load()}))}},{key:"getOperatorList",value:function getOperatorList(t){var r=this,o=t.handler,c=t.sink,u=t.task,h=t.intent,d=t.cacheKey,g=t.annotationStorage,m=void 0===g?null:g,y=this.getContentStream(o),v=this.loadResources(["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"]),k=new x.PartialEvaluator({xref:this.xref,handler:o,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),_=Promise.all([y,v]).then((function(t){var l=_slicedToArray(t,1)[0],g=new C.OperatorList(h,c);o.send("StartRenderPage",{transparency:k.hasBlendModes(r.resources,r.nonBlendModesSet),pageIndex:r.pageIndex,cacheKey:d});return k.getOperatorList({stream:l,task:u,resources:r.resources,operatorList:g}).then((function(){return g}))}));return Promise.all([_,this._parsedAnnotations]).then((function(t){var r=_slicedToArray(t,2),o=r[0],c=r[1];if(0===c.length||h&l.RenderingIntentFlag.ANNOTATIONS_DISABLE){o.flush(!0);return{length:o.totalLength}}var d,g=!!(h&l.RenderingIntentFlag.ANNOTATIONS_FORMS),y=!!(h&l.RenderingIntentFlag.ANY),v=!!(h&l.RenderingIntentFlag.DISPLAY),_=!!(h&l.RenderingIntentFlag.PRINT),w=[],S=_createForOfIteratorHelper(c);try{for(S.s();!(d=S.n()).done;){var C=d.value;(y||v&&C.mustBeViewed(m)||_&&C.mustBePrinted(m))&&w.push(C.getOperatorList(k,u,h,g,m).catch((function(t){(0,l.warn)("getOperatorList - ignoring annotation data during "+'"'.concat(u.name,'" task: "').concat(t,'".'));return null})))}}catch(t){S.e(t)}finally{S.f()}return Promise.all(w).then((function(t){o.addOp(l.OPS.beginAnnotations,[]);var r,c=_createForOfIteratorHelper(t);try{for(c.s();!(r=c.n()).done;){var u=r.value;o.addOpList(u)}}catch(t){c.e(t)}finally{c.f()}o.addOp(l.OPS.endAnnotations,[]);o.flush(!0);return{length:o.totalLength}}))}))}},{key:"extractTextContent",value:function extractTextContent(t){var r=this,o=t.handler,c=t.task,l=t.includeMarkedContent,u=t.sink,h=t.combineTextItems,d=this.getContentStream(o),g=this.loadResources(["ExtGState","Font","Properties","XObject"]);return Promise.all([d,g]).then((function(t){var d=_slicedToArray(t,1)[0];return new x.PartialEvaluator({xref:r.xref,handler:o,pageIndex:r.pageIndex,idFactory:r._localIdFactory,fontCache:r.fontCache,builtInCMapCache:r.builtInCMapCache,standardFontDataCache:r.standardFontDataCache,globalImageCache:r.globalImageCache,options:r.evaluatorOptions}).getTextContent({stream:d,task:c,resources:r.resources,includeMarkedContent:l,combineTextItems:h,sink:u,viewBox:r.view})}))}},{key:"getStructTree",value:(t=_asyncToGenerator(c.default.mark((function _callee(){var t,r;return c.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this.pdfManager.ensureCatalog("structTreeRoot");case 2:if(t=o.sent){o.next=5;break}return o.abrupt("return",null);case 5:o.next=7;return this.pdfManager.ensure(this,"_parseStructTree",[t]);case 7:r=o.sent;return o.abrupt("return",r.serializable);case 9:case"end":return o.stop()}}),_callee,this)}))),function getStructTree(){return t.apply(this,arguments)})},{key:"_parseStructTree",value:function _parseStructTree(t){var r=new T.StructTreePage(t,this.pageDict);r.parse();return r}},{key:"getAnnotationsData",value:function getAnnotationsData(t){return this._parsedAnnotations.then((function(r){var o=[];if(0===r.length)return o;var c,u=!!(t&l.RenderingIntentFlag.ANY),h=!!(t&l.RenderingIntentFlag.DISPLAY),d=!!(t&l.RenderingIntentFlag.PRINT),g=_createForOfIteratorHelper(r);try{for(g.s();!(c=g.n()).done;){var m=c.value;(u||h&&m.viewable||d&&m.printable)&&o.push(m.data)}}catch(t){g.e(t)}finally{g.f()}return o}))}},{key:"annotations",get:function get(){var t=this._getInheritableProperty("Annots");return(0,l.shadow)(this,"annotations",Array.isArray(t)?t:[])}},{key:"_parsedAnnotations",get:function get(){var t=this,r=this.pdfManager.ensure(this,"annotations").then((function(){var r,o=[],c=_createForOfIteratorHelper(t.annotations);try{for(c.s();!(r=c.n()).done;){var u=r.value;o.push(g.AnnotationFactory.create(t.xref,u,t.pdfManager,t._localIdFactory,!1).catch((function(t){(0,l.warn)('_parsedAnnotations: "'.concat(t,'".'));return null})))}}catch(t){c.e(t)}finally{c.f()}return Promise.all(o).then((function(t){return t.filter((function(t){return!!t}))}))}));return(0,l.shadow)(this,"_parsedAnnotations",r)}},{key:"jsActions",get:function get(){var t=(0,u.collectActions)(this.xref,this.pageDict,l.PageActionEventType);return(0,l.shadow)(this,"jsActions",t)}}]);var t;return Page}();r.Page=j;var D=new Uint8Array([37,80,68,70,45]),L=new Uint8Array([115,116,97,114,116,120,114,101,102]),N=new Uint8Array([101,110,100,111,98,106]),U=/^[1-9]\.\d$/;function find(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1024,c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=r.length,u=t.peekBytes(o),h=u.length-l;if(h<=0)return!1;if(c)for(var d=l-1,g=u.length-1;g>=d;){for(var m=0;m<l&&u[g-m]===r[d-m];)m++;if(m>=l){t.pos+=g-d;return!0}g--}else for(var y=0;y<=h;){for(var v=0;v<l&&u[y+v]===r[v];)v++;if(v>=l){t.pos+=y;return!0}y++}return!1}var H=function(){function PDFDocument(t,r){_classCallCheck(this,PDFDocument);if(r.length<=0)throw new l.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=t;this.stream=r;this.xref=new M.XRef(r,t);this._pagePromises=new Map;this._version=null;var o={font:0};this._globalIdFactory=function(){function _class2(){_classCallCheck(this,_class2)}_createClass(_class2,null,[{key:"getDocId",value:function getDocId(){return"g_".concat(t.docId)}},{key:"createFontId",value:function createFontId(){return"f".concat(++o.font)}},{key:"createObjId",value:function createObjId(){(0,l.unreachable)("Abstract method `createObjId` called.")}},{key:"getPageObjId",value:function getPageObjId(){(0,l.unreachable)("Abstract method `getPageObjId` called.")}}]);return _class2}()}_createClass(PDFDocument,[{key:"parse",value:function parse(t){this.xref.parse(t);this.catalog=new v.Catalog(this.pdfManager,this.xref);this.catalog.version&&(this._version=this.catalog.version)}},{key:"linearization",get:function get(){var t=null;try{t=_.Linearization.create(this.stream)}catch(t){if(t instanceof u.MissingDataException)throw t;(0,l.info)(t)}return(0,l.shadow)(this,"linearization",t)}},{key:"startXRef",get:function get(){var t=this.stream,r=0;if(this.linearization){t.reset();find(t,N)&&(r=t.pos+6-t.start)}else{for(var o=L.length,c=!1,h=t.end;!c&&h>0;){(h-=1024-o)<0&&(h=0);t.pos=h;c=find(t,L,1024,!0)}if(c){t.skip(9);var d;do{d=t.getByte()}while((0,u.isWhiteSpace)(d));for(var g="";d>=32&&d<=57;){g+=String.fromCharCode(d);d=t.getByte()}r=parseInt(g,10);isNaN(r)&&(r=0)}}return(0,l.shadow)(this,"startXRef",r)}},{key:"checkHeader",value:function checkHeader(){var t=this.stream;t.reset();if(find(t,D)){t.moveStart();for(var r,o="";(r=t.getByte())>32&&!(o.length>=12);)o+=String.fromCharCode(r);this._version||(this._version=o.substring(5))}}},{key:"parseStartXRef",value:function parseStartXRef(){this.xref.setStartXRef(this.startXRef)}},{key:"numPages",get:function get(){var t=0;t=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages;return(0,l.shadow)(this,"numPages",t)}},{key:"_hasOnlyDocumentSignatures",value:function _hasOnlyDocumentSignatures(t){var r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=10;return!!Array.isArray(t)&&t.every((function(t){if(!((t=r.xref.fetchIfRef(t))instanceof h.Dict))return!1;if(t.has("Kids")){if(++o>c){(0,l.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached");return!1}return r._hasOnlyDocumentSignatures(t.get("Kids"),o)}var u=(0,h.isName)(t.get("FT"),"Sig"),d=t.get("Rect"),g=Array.isArray(d)&&d.every((function(t){return 0===t}));return u&&g}))}},{key:"xfaData",get:function get(){var t=this.catalog.acroForm;if(!t)return null;var r=t.get("XFA"),o={"xdp:xdp":"",template:"",datasets:"",config:"",connectionSet:"",localeSet:"",stylesheet:"","/xdp:xdp":""};if(r instanceof m.BaseStream&&!r.isEmpty)try{o["xdp:xdp"]=(0,l.stringToUTF8String)(r.getString());return o}catch(t){(0,l.warn)("XFA - Invalid utf-8 string.");return null}if(!Array.isArray(r)||0===r.length)return null;for(var c=0,u=r.length;c<u;c+=2){var h=void 0;h=0===c?"xdp:xdp":c===u-2?"/xdp:xdp":r[c];if(o.hasOwnProperty(h)){var d=this.xref.fetchIfRef(r[c+1]);if(d instanceof m.BaseStream&&!d.isEmpty)try{o[h]=(0,l.stringToUTF8String)(d.getString())}catch(t){(0,l.warn)("XFA - Invalid utf-8 string.");return null}}}return o}},{key:"xfaFactory",get:function get(){var t;this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(t=this.xfaData);return(0,l.shadow)(this,"xfaFactory",t?new E.XFAFactory(t):null)}},{key:"isPureXfa",get:function get(){return!!this.xfaFactory&&this.xfaFactory.isValid()}},{key:"htmlForXfa",get:function get(){return this.xfaFactory?this.xfaFactory.getPages():null}},{key:"loadXfaImages",value:(H=_asyncToGenerator(c.default.mark((function _callee2(){var t,r,o,l,u,h,d,g;return c.default.wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:c.next=2;return this.pdfManager.ensureCatalog("xfaImages");case 2:if(t=c.sent){c.next=5;break}return c.abrupt("return");case 5:r=t.getKeys();o=new S.ObjectLoader(t,r,this.xref);c.next=9;return o.load();case 9:l=new Map;u=_createForOfIteratorHelper(r);try{for(u.s();!(h=u.n()).done;){d=h.value;(g=t.get(d))instanceof m.BaseStream&&l.set(d,g.getBytes())}}catch(t){u.e(t)}finally{u.f()}this.xfaFactory.setImages(l);case 13:case"end":return c.stop()}}),_callee2,this)}))),function loadXfaImages(){return H.apply(this,arguments)})},{key:"loadXfaFonts",value:(R=_asyncToGenerator(c.default.mark((function _callee3(t,r){var o,g,m,y,v,k,_,w,O,T,E,M,R,j,D,L,N,U,H,$,X,q,G,z,W,V,K,Y,J,Z,Q,ee,te,re;return c.default.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:c.next=2;return this.pdfManager.ensureCatalog("acroForm");case 2:if(o=c.sent){c.next=5;break}return c.abrupt("return");case 5:c.next=7;return o.getAsync("DR");case 7:if((g=c.sent)instanceof h.Dict){c.next=10;break}return c.abrupt("return");case 10:m=new S.ObjectLoader(g,["Font"],this.xref);c.next=13;return m.load();case 13:if((y=g.get("Font"))instanceof h.Dict){c.next=16;break}return c.abrupt("return");case 16:(v=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions)).useSystemFonts=!1;k=new x.PartialEvaluator({xref:this.xref,handler:t,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:this.catalog.fontCache,builtInCMapCache:this.catalog.builtInCMapCache,standardFontDataCache:this.catalog.standardFontDataCache,options:v});_=new C.OperatorList;w=[];c.t0=function clone(){return this};O={get font(){return w[w.length-1]},set font(t){w.push(t)},clone:c.t0};T=new Map;y.forEach((function(t,r){T.set(t,r)}));E=[];M=_createForOfIteratorHelper(T);c.prev=27;M.s();case 29:if((R=M.n()).done){c.next=44;break}j=_slicedToArray(R.value,2),D=j[0],L=j[1];if((N=L.get("FontDescriptor"))instanceof h.Dict){c.next=34;break}return c.abrupt("continue",42);case 34:U=(U=N.get("FontFamily")).replace(/[ ]+(\d)/g,"$1");H=N.get("FontWeight");$=-N.get("ItalicAngle");X={fontFamily:U,fontWeight:H,italicAngle:$};if((0,u.validateCSSFont)(X)){c.next=41;break}return c.abrupt("continue",42);case 41:E.push(k.handleSetFont(g,[h.Name.get(D),1],null,_,r,O,null,X).catch((function(t){(0,l.warn)('loadXfaFonts: "'.concat(t,'".'));return null})));case 42:c.next=29;break;case 44:c.next=49;break;case 46:c.prev=46;c.t1=c.catch(27);M.e(c.t1);case 49:c.prev=49;M.f();return c.finish(49);case 52:c.next=54;return Promise.all(E);case 54:if(q=this.xfaFactory.setFonts(w)){c.next=57;break}return c.abrupt("return");case 57:v.ignoreErrors=!0;E.length=0;w.length=0;G=new Set;z=_createForOfIteratorHelper(q);try{for(z.s();!(W=z.n()).done;){V=W.value;(0,d.getXfaFontName)("".concat(V,"-Regular"))||G.add(V)}}catch(t){z.e(t)}finally{z.f()}G.size&&q.push("PdfJS-Fallback");K=_createForOfIteratorHelper(q);c.prev=65;K.s();case 67:if((Y=K.n()).done){c.next=74;break}J=Y.value;if(!G.has(J)){c.next=71;break}return c.abrupt("continue",72);case 71:for(Z=0,Q=[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}];Z<Q.length;Z++){ee=Q[Z];te="".concat(J,"-").concat(ee.name);re=(0,d.getXfaFontDict)(te);E.push(k.handleSetFont(g,[h.Name.get(te),1],null,_,r,O,re,{fontFamily:J,fontWeight:ee.fontWeight,italicAngle:ee.italicAngle}).catch((function(t){(0,l.warn)('loadXfaFonts: "'.concat(t,'".'));return null})))}case 72:c.next=67;break;case 74:c.next=79;break;case 76:c.prev=76;c.t2=c.catch(65);K.e(c.t2);case 79:c.prev=79;K.f();return c.finish(79);case 82:c.next=84;return Promise.all(E);case 84:this.xfaFactory.appendFonts(w,G);case 85:case"end":return c.stop()}}),_callee3,this,[[27,46,49,52],[65,76,79,82]])}))),function loadXfaFonts(t,r){return R.apply(this,arguments)})},{key:"serializeXfaData",value:(T=_asyncToGenerator(c.default.mark((function _callee4(t){return c.default.wrap((function _callee4$(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.xfaFactory?this.xfaFactory.serializeData(t):null);case 1:case"end":return r.stop()}}),_callee4,this)}))),function serializeXfaData(t){return T.apply(this,arguments)})},{key:"formInfo",get:function get(){var t={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},r=this.catalog.acroForm;if(!r)return(0,l.shadow)(this,"formInfo",t);try{var o=r.get("Fields"),c=Array.isArray(o)&&o.length>0;t.hasFields=c;var h=r.get("XFA");t.hasXfa=Array.isArray(h)&&h.length>0||h instanceof m.BaseStream&&!h.isEmpty;var d=!!(1&r.get("SigFlags")),g=d&&this._hasOnlyDocumentSignatures(o);t.hasAcroForm=c&&!g;t.hasSignatures=d}catch(t){if(t instanceof u.MissingDataException)throw t;(0,l.warn)('Cannot fetch form information: "'.concat(t,'".'))}return(0,l.shadow)(this,"formInfo",t)}},{key:"documentInfo",get:function get(){var t=this._version;if("string"!=typeof t||!U.test(t)){(0,l.warn)("Invalid PDF header version number: ".concat(t));t=null}var r,o={PDFFormatVersion:t,Language:this.catalog.lang,EncryptFilterName:this.xref.encrypt?this.xref.encrypt.filterName:null,IsLinearized:!!this.linearization,IsAcroFormPresent:this.formInfo.hasAcroForm,IsXFAPresent:this.formInfo.hasXfa,IsCollectionPresent:!!this.catalog.collection,IsSignaturesPresent:this.formInfo.hasSignatures};try{r=this.xref.trailer.get("Info")}catch(t){if(t instanceof u.MissingDataException)throw t;(0,l.info)("The document information dictionary is invalid.")}if(!(r instanceof h.Dict))return(0,l.shadow)(this,"documentInfo",o);var c,d=_createForOfIteratorHelper(r.getKeys());try{for(d.s();!(c=d.n()).done;){var g=c.value,m=r.get(g);switch(g){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof m){o[g]=(0,l.stringToPDFString)(m);continue}break;case"Trapped":if(m instanceof h.Name){o[g]=m;continue}break;default:var y=void 0;switch(_typeof(m)){case"string":y=(0,l.stringToPDFString)(m);break;case"number":case"boolean":y=m;break;default:m instanceof h.Name&&(y=m)}if(void 0===y){(0,l.warn)('Bad value, for custom key "'.concat(g,'", in Info: ').concat(m,"."));continue}o.Custom||(o.Custom=Object.create(null));o.Custom[g]=y;continue}(0,l.warn)('Bad value, for key "'.concat(g,'", in Info: ').concat(m,"."))}}catch(t){d.e(t)}finally{d.f()}return(0,l.shadow)(this,"documentInfo",o)}},{key:"fingerprints",get:function get(){function validate(t){return"string"==typeof t&&t.length>0&&"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"!==t}function hexString(t){for(var r=[],o=0,c=t.length;o<c;o++){var l=t[o].toString(16);r.push(l.padStart(2,"0"))}return r.join("")}var t,r,o=this.xref.trailer.get("ID");if(Array.isArray(o)&&validate(o[0])){t=(0,l.stringToBytes)(o[0]);o[1]!==o[0]&&validate(o[1])&&(r=(0,l.stringToBytes)(o[1]))}else t=(0,y.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);return(0,l.shadow)(this,"fingerprints",[hexString(t),r?hexString(r):null])}},{key:"_getLinearizationPage",value:(O=_asyncToGenerator(c.default.mark((function _callee5(t){var r,o,u,d,g,m;return c.default.wrap((function _callee5$(c){for(;;)switch(c.prev=c.next){case 0:r=this.catalog,o=this.linearization,u=this.xref;d=h.Ref.get(o.objectNumberFirst,0);c.prev=2;c.next=5;return u.fetchAsync(d);case 5:if(!((g=c.sent)instanceof h.Dict)){c.next=16;break}if(!((m=g.getRaw("Type"))instanceof h.Ref)){c.next=12;break}c.next=11;return u.fetchAsync(m);case 11:m=c.sent;case 12:if(!(0,h.isName)(m,"Page")&&(g.has("Type")||g.has("Kids"))){c.next=16;break}r.pageKidsCountCache.has(d)||r.pageKidsCountCache.put(d,1);r.pageIndexCache.has(d)||r.pageIndexCache.put(d,0);return c.abrupt("return",[g,d]);case 16:throw new l.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.");case 19:c.prev=19;c.t0=c.catch(2);(0,l.warn)('_getLinearizationPage: "'.concat(c.t0.message,'".'));return c.abrupt("return",r.getPageDict(t));case 23:case"end":return c.stop()}}),_callee5,this,[[2,19]])}))),function _getLinearizationPage(t){return O.apply(this,arguments)})},{key:"getPage",value:function getPage(t){var r=this,o=this._pagePromises.get(t);if(o)return o;var c,l=this.catalog,u=this.linearization,d=this.xfaFactory;c=(c=d?Promise.resolve([h.Dict.empty,null]):u&&u.pageFirst===t?this._getLinearizationPage(t):l.getPageDict(t)).then((function(o){var c=_slicedToArray(o,2),u=c[0],h=c[1];return new j({pdfManager:r.pdfManager,xref:r.xref,pageIndex:t,pageDict:u,ref:h,globalIdFactory:r._globalIdFactory,fontCache:l.fontCache,builtInCMapCache:l.builtInCMapCache,standardFontDataCache:l.standardFontDataCache,globalImageCache:l.globalImageCache,nonBlendModesSet:l.nonBlendModesSet,xfaFactory:d})}));this._pagePromises.set(t,c);return c}},{key:"checkFirstPage",value:(w=_asyncToGenerator(c.default.mark((function _callee6(){var t=arguments;return c.default.wrap((function _callee6$(r){for(;;)switch(r.prev=r.next){case 0:if(!(t.length>0&&void 0!==t[0]&&t[0])){r.next=3;break}return r.abrupt("return");case 3:r.prev=3;r.next=6;return this.getPage(0);case 6:r.next=15;break;case 8:r.prev=8;r.t0=r.catch(3);if(!(r.t0 instanceof u.XRefEntryException)){r.next=15;break}this._pagePromises.delete(0);r.next=14;return this.cleanup();case 14:throw new u.XRefParseException;case 15:case"end":return r.stop()}}),_callee6,this,[[3,8]])}))),function checkFirstPage(){return w.apply(this,arguments)})},{key:"checkLastPage",value:(o=_asyncToGenerator(c.default.mark((function _callee7(){var t,r,o,h,d,g,m,y,v,k,_,w,S,C=arguments;return c.default.wrap((function _callee7$(c){for(;;)switch(c.prev=c.next){case 0:t=C.length>0&&void 0!==C[0]&&C[0];r=this.catalog,o=this.pdfManager;r.setActualNumPages();c.prev=3;c.next=6;return Promise.all([o.ensureDoc("xfaFactory"),o.ensureDoc("linearization"),o.ensureCatalog("numPages")]);case 6:if(!this.xfaFactory){c.next=10;break}return c.abrupt("return");case 10:h=this.linearization?this.linearization.numPages:r.numPages;case 11:if(Number.isInteger(h)){c.next=15;break}throw new l.FormatError("Page count is not an integer.");case 15:if(!(h<=1)){c.next=17;break}return c.abrupt("return");case 17:c.next=19;return this.getPage(h-1);case 19:c.next=44;break;case 21:c.prev=21;c.t0=c.catch(3);this._pagePromises.delete(h-1);c.next=26;return this.cleanup();case 26:if(!(c.t0 instanceof u.XRefEntryException)||t){c.next=28;break}throw new u.XRefParseException;case 28:(0,l.warn)("checkLastPage - invalid /Pages tree /Count: ".concat(h,"."));c.prev=29;c.next=32;return r.getAllPageDicts(t);case 32:d=c.sent;c.next=41;break;case 35:c.prev=35;c.t1=c.catch(29);if(!(c.t1 instanceof u.XRefEntryException)||t){c.next=39;break}throw new u.XRefParseException;case 39:r.setActualNumPages(1);return c.abrupt("return");case 41:g=_createForOfIteratorHelper(d);try{for(g.s();!(m=g.n()).done;){y=_slicedToArray(m.value,2),v=y[0],k=_slicedToArray(y[1],2),_=k[0],w=k[1];S=void 0;_ instanceof Error?(S=Promise.reject(_)).catch((function(){})):S=Promise.resolve(new j({pdfManager:o,xref:this.xref,pageIndex:v,pageDict:_,ref:w,globalIdFactory:this._globalIdFactory,fontCache:r.fontCache,builtInCMapCache:r.builtInCMapCache,standardFontDataCache:r.standardFontDataCache,globalImageCache:r.globalImageCache,nonBlendModesSet:r.nonBlendModesSet,xfaFactory:null}));this._pagePromises.set(v,S)}}catch(t){g.e(t)}finally{g.f()}r.setActualNumPages(d.size);case 44:case"end":return c.stop()}}),_callee7,this,[[3,21],[29,35]])}))),function checkLastPage(){return o.apply(this,arguments)})},{key:"fontFallback",value:function fontFallback(t,r){return this.catalog.fontFallback(t,r)}},{key:"cleanup",value:(r=_asyncToGenerator(c.default.mark((function _callee8(){var t,r=arguments;return c.default.wrap((function _callee8$(o){for(;;)switch(o.prev=o.next){case 0:t=r.length>0&&void 0!==r[0]&&r[0];return o.abrupt("return",this.catalog?this.catalog.cleanup(t):(0,k.clearGlobalCaches)());case 2:case"end":return o.stop()}}),_callee8,this)}))),function cleanup(){return r.apply(this,arguments)})},{key:"_collectFieldObjects",value:function _collectFieldObjects(t,r,o){var c=this.xref.fetchIfRef(r);if(c.has("T")){var u=(0,l.stringToPDFString)(c.get("T"));t=""===t?u:"".concat(t,".").concat(u)}o.has(t)||o.set(t,[]);o.get(t).push(g.AnnotationFactory.create(this.xref,r,this.pdfManager,this._localIdFactory,!0).then((function(t){return t&&t.getFieldObject()})).catch((function(t){(0,l.warn)('_collectFieldObjects: "'.concat(t,'".'));return null})));if(c.has("Kids")){var h,d=_createForOfIteratorHelper(c.get("Kids"));try{for(d.s();!(h=d.n()).done;){var m=h.value;this._collectFieldObjects(t,m,o)}}catch(t){d.e(t)}finally{d.f()}}}},{key:"fieldObjects",get:function get(){if(!this.formInfo.hasFields)return(0,l.shadow)(this,"fieldObjects",Promise.resolve(null));var t,r=Object.create(null),o=new Map,c=_createForOfIteratorHelper(this.catalog.acroForm.get("Fields"));try{for(c.s();!(t=c.n()).done;){var u=t.value;this._collectFieldObjects("",u,o)}}catch(t){c.e(t)}finally{c.f()}var h,d=[],g=_createForOfIteratorHelper(o);try{var m=function _loop(){var t=_slicedToArray(h.value,2),o=t[0],c=t[1];d.push(Promise.all(c).then((function(t){(t=t.filter((function(t){return!!t}))).length>0&&(r[o]=t)})))};for(g.s();!(h=g.n()).done;)m()}catch(t){g.e(t)}finally{g.f()}return(0,l.shadow)(this,"fieldObjects",Promise.all(d).then((function(){return r})))}},{key:"hasJSActions",get:function get(){var t=this.pdfManager.ensureDoc("_parseHasJSActions");return(0,l.shadow)(this,"hasJSActions",t)}},{key:"_parseHasJSActions",value:(t=_asyncToGenerator(c.default.mark((function _callee9(){var t,r,o,l;return c.default.wrap((function _callee9$(c){for(;;)switch(c.prev=c.next){case 0:c.next=2;return Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);case 2:t=c.sent;r=_slicedToArray(t,2);o=r[0];l=r[1];if(!o){c.next=8;break}return c.abrupt("return",!0);case 8:if(!l){c.next=10;break}return c.abrupt("return",Object.values(l).some((function(t){return t.some((function(t){return null!==t.actions}))})));case 10:return c.abrupt("return",!1);case 11:case"end":return c.stop()}}),_callee9,this)}))),function _parseHasJSActions(){return t.apply(this,arguments)})},{key:"calculationOrderIds",get:function get(){var t=this.catalog.acroForm;if(!t||!t.has("CO"))return(0,l.shadow)(this,"calculationOrderIds",null);var r=t.get("CO");if(!Array.isArray(r)||0===r.length)return(0,l.shadow)(this,"calculationOrderIds",null);var o,c=[],u=_createForOfIteratorHelper(r);try{for(u.s();!(o=u.n()).done;){var d=o.value;d instanceof h.Ref&&c.push(d.toString())}}catch(t){u.e(t)}finally{u.f()}return 0===c.length?(0,l.shadow)(this,"calculationOrderIds",null):(0,l.shadow)(this,"calculationOrderIds",c)}}]);var t,r,o,w,O,T,R,H;return PDFDocument}();r.PDFDocument=H},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.getXfaFontDict=function getXfaFontDict(t){var r=function getXfaFontWidths(t){var r=getXfaFontName(t);if(!r)return null;var o,c=r.baseWidths,l=r.baseMapping,u=r.factors;o=u?c.map((function(t,r){return t*u[r]})):c;var h,d,g=-2,m=[],y=function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}(l.map((function(t,r){return[t,r]})).sort((function(t,r){return _slicedToArray(t,1)[0]-_slicedToArray(r,1)[0]})));try{for(y.s();!(d=y.n()).done;){var v=_slicedToArray(d.value,2),k=v[0],_=v[1];if(-1!==k)if(k===g+1){h.push(o[_]);g+=1}else{g=k;h=[o[_]];m.push(k,h)}}}catch(t){y.e(t)}finally{y.f()}return m}(t),o=new l.Dict(null);o.set("BaseFont",l.Name.get(t));o.set("Type",l.Name.get("Font"));o.set("Subtype",l.Name.get("CIDFontType2"));o.set("Encoding",l.Name.get("Identity-H"));o.set("CIDToGIDMap",l.Name.get("Identity"));o.set("W",r);o.set("FirstChar",r[0]);o.set("LastChar",r[r.length-2]+r[r.length-1].length-1);var c=new l.Dict(null);o.set("FontDescriptor",c);var u=new l.Dict(null);u.set("Ordering","Identity");u.set("Registry","Adobe");u.set("Supplement",0);o.set("CIDSystemInfo",u);return o};r.getXfaFontName=getXfaFontName;var c=o(154),l=o(146),u=o(155),h=o(156),d=o(157),g=o(158),m=o(149),y=o(159);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}var v=(0,m.getLookupTableFactory)((function(t){t["MyriadPro-Regular"]=t["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:d.MyriadProRegularFactors,baseWidths:h.LiberationSansRegularWidths,baseMapping:h.LiberationSansRegularMapping,metrics:d.MyriadProRegularMetrics};t["MyriadPro-Bold"]=t["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:d.MyriadProBoldFactors,baseWidths:h.LiberationSansBoldWidths,baseMapping:h.LiberationSansBoldMapping,metrics:d.MyriadProBoldMetrics};t["MyriadPro-It"]=t["MyriadPro-Italic"]=t["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:d.MyriadProItalicFactors,baseWidths:h.LiberationSansItalicWidths,baseMapping:h.LiberationSansItalicMapping,metrics:d.MyriadProItalicMetrics};t["MyriadPro-BoldIt"]=t["MyriadPro-BoldItalic"]=t["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:d.MyriadProBoldItalicFactors,baseWidths:h.LiberationSansBoldItalicWidths,baseMapping:h.LiberationSansBoldItalicMapping,metrics:d.MyriadProBoldItalicMetrics};t.ArialMT=t.Arial=t["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:h.LiberationSansRegularWidths,baseMapping:h.LiberationSansRegularMapping};t["Arial-BoldMT"]=t["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:h.LiberationSansBoldWidths,baseMapping:h.LiberationSansBoldMapping};t["Arial-ItalicMT"]=t["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:h.LiberationSansItalicWidths,baseMapping:h.LiberationSansItalicMapping};t["Arial-BoldItalicMT"]=t["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:h.LiberationSansBoldItalicWidths,baseMapping:h.LiberationSansBoldItalicMapping};t["Calibri-Regular"]={name:"LiberationSans-Regular",factors:c.CalibriRegularFactors,baseWidths:h.LiberationSansRegularWidths,baseMapping:h.LiberationSansRegularMapping,metrics:c.CalibriRegularMetrics};t["Calibri-Bold"]={name:"LiberationSans-Bold",factors:c.CalibriBoldFactors,baseWidths:h.LiberationSansBoldWidths,baseMapping:h.LiberationSansBoldMapping,metrics:c.CalibriBoldMetrics};t["Calibri-Italic"]={name:"LiberationSans-Italic",factors:c.CalibriItalicFactors,baseWidths:h.LiberationSansItalicWidths,baseMapping:h.LiberationSansItalicMapping,metrics:c.CalibriItalicMetrics};t["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:c.CalibriBoldItalicFactors,baseWidths:h.LiberationSansBoldItalicWidths,baseMapping:h.LiberationSansBoldItalicMapping,metrics:c.CalibriBoldItalicMetrics};t["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:g.SegoeuiRegularFactors,baseWidths:h.LiberationSansRegularWidths,baseMapping:h.LiberationSansRegularMapping,metrics:g.SegoeuiRegularMetrics};t["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:g.SegoeuiBoldFactors,baseWidths:h.LiberationSansBoldWidths,baseMapping:h.LiberationSansBoldMapping,metrics:g.SegoeuiBoldMetrics};t["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:g.SegoeuiItalicFactors,baseWidths:h.LiberationSansItalicWidths,baseMapping:h.LiberationSansItalicMapping,metrics:g.SegoeuiItalicMetrics};t["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:g.SegoeuiBoldItalicFactors,baseWidths:h.LiberationSansBoldItalicWidths,baseMapping:h.LiberationSansBoldItalicMapping,metrics:g.SegoeuiBoldItalicMetrics};t["Helvetica-Regular"]=t.Helvetica={name:"LiberationSans-Regular",factors:u.HelveticaRegularFactors,baseWidths:h.LiberationSansRegularWidths,baseMapping:h.LiberationSansRegularMapping,metrics:u.HelveticaRegularMetrics};t["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:u.HelveticaBoldFactors,baseWidths:h.LiberationSansBoldWidths,baseMapping:h.LiberationSansBoldMapping,metrics:u.HelveticaBoldMetrics};t["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:u.HelveticaItalicFactors,baseWidths:h.LiberationSansItalicWidths,baseMapping:h.LiberationSansItalicMapping,metrics:u.HelveticaItalicMetrics};t["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:u.HelveticaBoldItalicFactors,baseWidths:h.LiberationSansBoldItalicWidths,baseMapping:h.LiberationSansBoldItalicMapping,metrics:u.HelveticaBoldItalicMetrics}}));function getXfaFontName(t){var r=(0,y.normalizeFontName)(t);return v()[r]}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CalibriRegularMetrics=r.CalibriRegularFactors=r.CalibriItalicMetrics=r.CalibriItalicFactors=r.CalibriBoldMetrics=r.CalibriBoldItalicMetrics=r.CalibriBoldItalicFactors=r.CalibriBoldFactors=void 0;r.CalibriBoldFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.CalibriBoldMetrics={lineHeight:1.2207,lineGap:.2207};r.CalibriBoldItalicFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.CalibriBoldItalicMetrics={lineHeight:1.2207,lineGap:.2207};r.CalibriItalicFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.CalibriItalicMetrics={lineHeight:1.2207,lineGap:.2207};r.CalibriRegularFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1];r.CalibriRegularMetrics={lineHeight:1.2207,lineGap:.2207}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.HelveticaRegularMetrics=r.HelveticaRegularFactors=r.HelveticaItalicMetrics=r.HelveticaItalicFactors=r.HelveticaBoldMetrics=r.HelveticaBoldItalicMetrics=r.HelveticaBoldItalicFactors=r.HelveticaBoldFactors=void 0;r.HelveticaBoldFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];r.HelveticaBoldMetrics={lineHeight:1.2,lineGap:.2};r.HelveticaBoldItalicFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];r.HelveticaBoldItalicMetrics={lineHeight:1.35,lineGap:.2};r.HelveticaItalicFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];r.HelveticaItalicMetrics={lineHeight:1.35,lineGap:.2};r.HelveticaRegularFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.HelveticaRegularMetrics={lineHeight:1.2,lineGap:.2}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.LiberationSansRegularWidths=r.LiberationSansRegularMapping=r.LiberationSansItalicWidths=r.LiberationSansItalicMapping=r.LiberationSansBoldWidths=r.LiberationSansBoldMapping=r.LiberationSansBoldItalicWidths=r.LiberationSansBoldItalicMapping=void 0;r.LiberationSansBoldWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];r.LiberationSansBoldMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];r.LiberationSansBoldItalicWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];r.LiberationSansBoldItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];r.LiberationSansItalicWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];r.LiberationSansItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];r.LiberationSansRegularWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];r.LiberationSansRegularMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MyriadProRegularMetrics=r.MyriadProRegularFactors=r.MyriadProItalicMetrics=r.MyriadProItalicFactors=r.MyriadProBoldMetrics=r.MyriadProBoldItalicMetrics=r.MyriadProBoldItalicFactors=r.MyriadProBoldFactors=void 0;r.MyriadProBoldFactors=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.MyriadProBoldMetrics={lineHeight:1.2,lineGap:.2};r.MyriadProBoldItalicFactors=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.MyriadProBoldItalicMetrics={lineHeight:1.2,lineGap:.2};r.MyriadProItalicFactors=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.MyriadProItalicMetrics={lineHeight:1.2,lineGap:.2};r.MyriadProRegularFactors=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.MyriadProRegularMetrics={lineHeight:1.2,lineGap:.2}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.SegoeuiRegularMetrics=r.SegoeuiRegularFactors=r.SegoeuiItalicMetrics=r.SegoeuiItalicFactors=r.SegoeuiBoldMetrics=r.SegoeuiBoldItalicMetrics=r.SegoeuiBoldItalicFactors=r.SegoeuiBoldFactors=void 0;r.SegoeuiBoldFactors=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.SegoeuiBoldMetrics={lineHeight:1.33008,lineGap:0};r.SegoeuiBoldItalicFactors=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.SegoeuiBoldItalicMetrics={lineHeight:1.33008,lineGap:0};r.SegoeuiItalicFactors=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];r.SegoeuiItalicMetrics={lineHeight:1.33008,lineGap:0};r.SegoeuiRegularFactors=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1];r.SegoeuiRegularMetrics={lineHeight:1.33008,lineGap:0}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.SEAC_ANALYSIS_ENABLED=r.MacStandardGlyphOrdering=r.FontFlags=void 0;r.getFontType=function getFontType(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(t){case"Type1":return o?c.FontType.TYPE1STANDARD:"Type1C"===r?c.FontType.TYPE1C:c.FontType.TYPE1;case"CIDFontType0":return"CIDFontType0C"===r?c.FontType.CIDFONTTYPE0C:c.FontType.CIDFONTTYPE0;case"OpenType":return c.FontType.OPENTYPE;case"TrueType":return c.FontType.TRUETYPE;case"CIDFontType2":return c.FontType.CIDFONTTYPE2;case"MMType1":return c.FontType.MMTYPE1;case"Type0":return c.FontType.TYPE0;default:return c.FontType.UNKNOWN}};r.normalizeFontName=function normalizeFontName(t){return t.replace(/[,_]/g,"-").replace(/\s/g,"")};r.recoverGlyphName=recoverGlyphName;r.type1FontGlyphMapping=function type1FontGlyphMapping(t,r,o){var c,h,g,m=Object.create(null),y=!!(t.flags&d.Symbolic);if(t.isInternalFont){g=r;for(h=0;h<g.length;h++){c=o.indexOf(g[h]);m[h]=c>=0?c:0}}else if(t.baseEncodingName){g=(0,l.getEncoding)(t.baseEncodingName);for(h=0;h<g.length;h++){c=o.indexOf(g[h]);m[h]=c>=0?c:0}}else if(y)for(h in r)m[h]=r[h];else{g=l.StandardEncoding;for(h=0;h<g.length;h++){c=o.indexOf(g[h]);m[h]=c>=0?c:0}}var v,k=t.differences;if(k)for(h in k){var _=k[h];if(-1===(c=o.indexOf(_))){v||(v=(0,u.getGlyphsUnicode)());var w=recoverGlyphName(_,v);w!==_&&(c=o.indexOf(w))}m[h]=c>=0?c:0}return m};var c=o(4),l=o(160),u=o(161),h=o(162);r.SEAC_ANALYSIS_ENABLED=!0;var d={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};r.FontFlags=d;r.MacStandardGlyphOrdering=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(t,r){if(void 0!==r[t])return t;var o=(0,h.getUnicodeForGlyph)(t,r);if(-1!==o)for(var l in r)if(r[l]===o)return l;(0,c.info)("Unable to recover a standard glyph name for: "+t);return t}},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ZapfDingbatsEncoding=r.WinAnsiEncoding=r.SymbolSetEncoding=r.StandardEncoding=r.MacRomanEncoding=r.ExpertEncoding=void 0;r.getEncoding=function getEncoding(t){switch(t){case"WinAnsiEncoding":return h;case"StandardEncoding":return u;case"MacRomanEncoding":return l;case"SymbolSetEncoding":return d;case"ZapfDingbatsEncoding":return g;case"ExpertEncoding":return o;case"MacExpertEncoding":return c;default:return null}};var o=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];r.ExpertEncoding=o;var c=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],l=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"];r.MacRomanEncoding=l;var u=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""];r.StandardEncoding=u;var h=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"];r.WinAnsiEncoding=h;var d=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""];r.SymbolSetEncoding=d;var g=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];r.ZapfDingbatsEncoding=g},(t,r,o)=>{"use strict";o.r(r);o.d(r,{getDingbatsGlyphsUnicode:()=>u,getGlyphsUnicode:()=>l});var c=o(149);const l=(0,c.getArrayLookupTableFactory)((function(){return["A",65,"AE",198,"AEacute",508,"AEmacron",482,"AEsmall",63462,"Aacute",193,"Aacutesmall",63457,"Abreve",258,"Abreveacute",7854,"Abrevecyrillic",1232,"Abrevedotbelow",7862,"Abrevegrave",7856,"Abrevehookabove",7858,"Abrevetilde",7860,"Acaron",461,"Acircle",9398,"Acircumflex",194,"Acircumflexacute",7844,"Acircumflexdotbelow",7852,"Acircumflexgrave",7846,"Acircumflexhookabove",7848,"Acircumflexsmall",63458,"Acircumflextilde",7850,"Acute",63177,"Acutesmall",63412,"Acyrillic",1040,"Adblgrave",512,"Adieresis",196,"Adieresiscyrillic",1234,"Adieresismacron",478,"Adieresissmall",63460,"Adotbelow",7840,"Adotmacron",480,"Agrave",192,"Agravesmall",63456,"Ahookabove",7842,"Aiecyrillic",1236,"Ainvertedbreve",514,"Alpha",913,"Alphatonos",902,"Amacron",256,"Amonospace",65313,"Aogonek",260,"Aring",197,"Aringacute",506,"Aringbelow",7680,"Aringsmall",63461,"Asmall",63329,"Atilde",195,"Atildesmall",63459,"Aybarmenian",1329,"B",66,"Bcircle",9399,"Bdotaccent",7682,"Bdotbelow",7684,"Becyrillic",1041,"Benarmenian",1330,"Beta",914,"Bhook",385,"Blinebelow",7686,"Bmonospace",65314,"Brevesmall",63220,"Bsmall",63330,"Btopbar",386,"C",67,"Caarmenian",1342,"Cacute",262,"Caron",63178,"Caronsmall",63221,"Ccaron",268,"Ccedilla",199,"Ccedillaacute",7688,"Ccedillasmall",63463,"Ccircle",9400,"Ccircumflex",264,"Cdot",266,"Cdotaccent",266,"Cedillasmall",63416,"Chaarmenian",1353,"Cheabkhasiancyrillic",1212,"Checyrillic",1063,"Chedescenderabkhasiancyrillic",1214,"Chedescendercyrillic",1206,"Chedieresiscyrillic",1268,"Cheharmenian",1347,"Chekhakassiancyrillic",1227,"Cheverticalstrokecyrillic",1208,"Chi",935,"Chook",391,"Circumflexsmall",63222,"Cmonospace",65315,"Coarmenian",1361,"Csmall",63331,"D",68,"DZ",497,"DZcaron",452,"Daarmenian",1332,"Dafrican",393,"Dcaron",270,"Dcedilla",7696,"Dcircle",9401,"Dcircumflexbelow",7698,"Dcroat",272,"Ddotaccent",7690,"Ddotbelow",7692,"Decyrillic",1044,"Deicoptic",1006,"Delta",8710,"Deltagreek",916,"Dhook",394,"Dieresis",63179,"DieresisAcute",63180,"DieresisGrave",63181,"Dieresissmall",63400,"Digammagreek",988,"Djecyrillic",1026,"Dlinebelow",7694,"Dmonospace",65316,"Dotaccentsmall",63223,"Dslash",272,"Dsmall",63332,"Dtopbar",395,"Dz",498,"Dzcaron",453,"Dzeabkhasiancyrillic",1248,"Dzecyrillic",1029,"Dzhecyrillic",1039,"E",69,"Eacute",201,"Eacutesmall",63465,"Ebreve",276,"Ecaron",282,"Ecedillabreve",7708,"Echarmenian",1333,"Ecircle",9402,"Ecircumflex",202,"Ecircumflexacute",7870,"Ecircumflexbelow",7704,"Ecircumflexdotbelow",7878,"Ecircumflexgrave",7872,"Ecircumflexhookabove",7874,"Ecircumflexsmall",63466,"Ecircumflextilde",7876,"Ecyrillic",1028,"Edblgrave",516,"Edieresis",203,"Edieresissmall",63467,"Edot",278,"Edotaccent",278,"Edotbelow",7864,"Efcyrillic",1060,"Egrave",200,"Egravesmall",63464,"Eharmenian",1335,"Ehookabove",7866,"Eightroman",8551,"Einvertedbreve",518,"Eiotifiedcyrillic",1124,"Elcyrillic",1051,"Elevenroman",8554,"Emacron",274,"Emacronacute",7702,"Emacrongrave",7700,"Emcyrillic",1052,"Emonospace",65317,"Encyrillic",1053,"Endescendercyrillic",1186,"Eng",330,"Enghecyrillic",1188,"Enhookcyrillic",1223,"Eogonek",280,"Eopen",400,"Epsilon",917,"Epsilontonos",904,"Ercyrillic",1056,"Ereversed",398,"Ereversedcyrillic",1069,"Escyrillic",1057,"Esdescendercyrillic",1194,"Esh",425,"Esmall",63333,"Eta",919,"Etarmenian",1336,"Etatonos",905,"Eth",208,"Ethsmall",63472,"Etilde",7868,"Etildebelow",7706,"Euro",8364,"Ezh",439,"Ezhcaron",494,"Ezhreversed",440,"F",70,"Fcircle",9403,"Fdotaccent",7710,"Feharmenian",1366,"Feicoptic",996,"Fhook",401,"Fitacyrillic",1138,"Fiveroman",8548,"Fmonospace",65318,"Fourroman",8547,"Fsmall",63334,"G",71,"GBsquare",13191,"Gacute",500,"Gamma",915,"Gammaafrican",404,"Gangiacoptic",1002,"Gbreve",286,"Gcaron",486,"Gcedilla",290,"Gcircle",9404,"Gcircumflex",284,"Gcommaaccent",290,"Gdot",288,"Gdotaccent",288,"Gecyrillic",1043,"Ghadarmenian",1346,"Ghemiddlehookcyrillic",1172,"Ghestrokecyrillic",1170,"Gheupturncyrillic",1168,"Ghook",403,"Gimarmenian",1331,"Gjecyrillic",1027,"Gmacron",7712,"Gmonospace",65319,"Grave",63182,"Gravesmall",63328,"Gsmall",63335,"Gsmallhook",667,"Gstroke",484,"H",72,"H18533",9679,"H18543",9642,"H18551",9643,"H22073",9633,"HPsquare",13259,"Haabkhasiancyrillic",1192,"Hadescendercyrillic",1202,"Hardsigncyrillic",1066,"Hbar",294,"Hbrevebelow",7722,"Hcedilla",7720,"Hcircle",9405,"Hcircumflex",292,"Hdieresis",7718,"Hdotaccent",7714,"Hdotbelow",7716,"Hmonospace",65320,"Hoarmenian",1344,"Horicoptic",1e3,"Hsmall",63336,"Hungarumlaut",63183,"Hungarumlautsmall",63224,"Hzsquare",13200,"I",73,"IAcyrillic",1071,"IJ",306,"IUcyrillic",1070,"Iacute",205,"Iacutesmall",63469,"Ibreve",300,"Icaron",463,"Icircle",9406,"Icircumflex",206,"Icircumflexsmall",63470,"Icyrillic",1030,"Idblgrave",520,"Idieresis",207,"Idieresisacute",7726,"Idieresiscyrillic",1252,"Idieresissmall",63471,"Idot",304,"Idotaccent",304,"Idotbelow",7882,"Iebrevecyrillic",1238,"Iecyrillic",1045,"Ifraktur",8465,"Igrave",204,"Igravesmall",63468,"Ihookabove",7880,"Iicyrillic",1048,"Iinvertedbreve",522,"Iishortcyrillic",1049,"Imacron",298,"Imacroncyrillic",1250,"Imonospace",65321,"Iniarmenian",1339,"Iocyrillic",1025,"Iogonek",302,"Iota",921,"Iotaafrican",406,"Iotadieresis",938,"Iotatonos",906,"Ismall",63337,"Istroke",407,"Itilde",296,"Itildebelow",7724,"Izhitsacyrillic",1140,"Izhitsadblgravecyrillic",1142,"J",74,"Jaarmenian",1345,"Jcircle",9407,"Jcircumflex",308,"Jecyrillic",1032,"Jheharmenian",1355,"Jmonospace",65322,"Jsmall",63338,"K",75,"KBsquare",13189,"KKsquare",13261,"Kabashkircyrillic",1184,"Kacute",7728,"Kacyrillic",1050,"Kadescendercyrillic",1178,"Kahookcyrillic",1219,"Kappa",922,"Kastrokecyrillic",1182,"Kaverticalstrokecyrillic",1180,"Kcaron",488,"Kcedilla",310,"Kcircle",9408,"Kcommaaccent",310,"Kdotbelow",7730,"Keharmenian",1364,"Kenarmenian",1343,"Khacyrillic",1061,"Kheicoptic",998,"Khook",408,"Kjecyrillic",1036,"Klinebelow",7732,"Kmonospace",65323,"Koppacyrillic",1152,"Koppagreek",990,"Ksicyrillic",1134,"Ksmall",63339,"L",76,"LJ",455,"LL",63167,"Lacute",313,"Lambda",923,"Lcaron",317,"Lcedilla",315,"Lcircle",9409,"Lcircumflexbelow",7740,"Lcommaaccent",315,"Ldot",319,"Ldotaccent",319,"Ldotbelow",7734,"Ldotbelowmacron",7736,"Liwnarmenian",1340,"Lj",456,"Ljecyrillic",1033,"Llinebelow",7738,"Lmonospace",65324,"Lslash",321,"Lslashsmall",63225,"Lsmall",63340,"M",77,"MBsquare",13190,"Macron",63184,"Macronsmall",63407,"Macute",7742,"Mcircle",9410,"Mdotaccent",7744,"Mdotbelow",7746,"Menarmenian",1348,"Mmonospace",65325,"Msmall",63341,"Mturned",412,"Mu",924,"N",78,"NJ",458,"Nacute",323,"Ncaron",327,"Ncedilla",325,"Ncircle",9411,"Ncircumflexbelow",7754,"Ncommaaccent",325,"Ndotaccent",7748,"Ndotbelow",7750,"Nhookleft",413,"Nineroman",8552,"Nj",459,"Njecyrillic",1034,"Nlinebelow",7752,"Nmonospace",65326,"Nowarmenian",1350,"Nsmall",63342,"Ntilde",209,"Ntildesmall",63473,"Nu",925,"O",79,"OE",338,"OEsmall",63226,"Oacute",211,"Oacutesmall",63475,"Obarredcyrillic",1256,"Obarreddieresiscyrillic",1258,"Obreve",334,"Ocaron",465,"Ocenteredtilde",415,"Ocircle",9412,"Ocircumflex",212,"Ocircumflexacute",7888,"Ocircumflexdotbelow",7896,"Ocircumflexgrave",7890,"Ocircumflexhookabove",7892,"Ocircumflexsmall",63476,"Ocircumflextilde",7894,"Ocyrillic",1054,"Odblacute",336,"Odblgrave",524,"Odieresis",214,"Odieresiscyrillic",1254,"Odieresissmall",63478,"Odotbelow",7884,"Ogoneksmall",63227,"Ograve",210,"Ogravesmall",63474,"Oharmenian",1365,"Ohm",8486,"Ohookabove",7886,"Ohorn",416,"Ohornacute",7898,"Ohorndotbelow",7906,"Ohorngrave",7900,"Ohornhookabove",7902,"Ohorntilde",7904,"Ohungarumlaut",336,"Oi",418,"Oinvertedbreve",526,"Omacron",332,"Omacronacute",7762,"Omacrongrave",7760,"Omega",8486,"Omegacyrillic",1120,"Omegagreek",937,"Omegaroundcyrillic",1146,"Omegatitlocyrillic",1148,"Omegatonos",911,"Omicron",927,"Omicrontonos",908,"Omonospace",65327,"Oneroman",8544,"Oogonek",490,"Oogonekmacron",492,"Oopen",390,"Oslash",216,"Oslashacute",510,"Oslashsmall",63480,"Osmall",63343,"Ostrokeacute",510,"Otcyrillic",1150,"Otilde",213,"Otildeacute",7756,"Otildedieresis",7758,"Otildesmall",63477,"P",80,"Pacute",7764,"Pcircle",9413,"Pdotaccent",7766,"Pecyrillic",1055,"Peharmenian",1354,"Pemiddlehookcyrillic",1190,"Phi",934,"Phook",420,"Pi",928,"Piwrarmenian",1363,"Pmonospace",65328,"Psi",936,"Psicyrillic",1136,"Psmall",63344,"Q",81,"Qcircle",9414,"Qmonospace",65329,"Qsmall",63345,"R",82,"Raarmenian",1356,"Racute",340,"Rcaron",344,"Rcedilla",342,"Rcircle",9415,"Rcommaaccent",342,"Rdblgrave",528,"Rdotaccent",7768,"Rdotbelow",7770,"Rdotbelowmacron",7772,"Reharmenian",1360,"Rfraktur",8476,"Rho",929,"Ringsmall",63228,"Rinvertedbreve",530,"Rlinebelow",7774,"Rmonospace",65330,"Rsmall",63346,"Rsmallinverted",641,"Rsmallinvertedsuperior",694,"S",83,"SF010000",9484,"SF020000",9492,"SF030000",9488,"SF040000",9496,"SF050000",9532,"SF060000",9516,"SF070000",9524,"SF080000",9500,"SF090000",9508,"SF100000",9472,"SF110000",9474,"SF190000",9569,"SF200000",9570,"SF210000",9558,"SF220000",9557,"SF230000",9571,"SF240000",9553,"SF250000",9559,"SF260000",9565,"SF270000",9564,"SF280000",9563,"SF360000",9566,"SF370000",9567,"SF380000",9562,"SF390000",9556,"SF400000",9577,"SF410000",9574,"SF420000",9568,"SF430000",9552,"SF440000",9580,"SF450000",9575,"SF460000",9576,"SF470000",9572,"SF480000",9573,"SF490000",9561,"SF500000",9560,"SF510000",9554,"SF520000",9555,"SF530000",9579,"SF540000",9578,"Sacute",346,"Sacutedotaccent",7780,"Sampigreek",992,"Scaron",352,"Scarondotaccent",7782,"Scaronsmall",63229,"Scedilla",350,"Schwa",399,"Schwacyrillic",1240,"Schwadieresiscyrillic",1242,"Scircle",9416,"Scircumflex",348,"Scommaaccent",536,"Sdotaccent",7776,"Sdotbelow",7778,"Sdotbelowdotaccent",7784,"Seharmenian",1357,"Sevenroman",8550,"Shaarmenian",1351,"Shacyrillic",1064,"Shchacyrillic",1065,"Sheicoptic",994,"Shhacyrillic",1210,"Shimacoptic",1004,"Sigma",931,"Sixroman",8549,"Smonospace",65331,"Softsigncyrillic",1068,"Ssmall",63347,"Stigmagreek",986,"T",84,"Tau",932,"Tbar",358,"Tcaron",356,"Tcedilla",354,"Tcircle",9417,"Tcircumflexbelow",7792,"Tcommaaccent",354,"Tdotaccent",7786,"Tdotbelow",7788,"Tecyrillic",1058,"Tedescendercyrillic",1196,"Tenroman",8553,"Tetsecyrillic",1204,"Theta",920,"Thook",428,"Thorn",222,"Thornsmall",63486,"Threeroman",8546,"Tildesmall",63230,"Tiwnarmenian",1359,"Tlinebelow",7790,"Tmonospace",65332,"Toarmenian",1337,"Tonefive",444,"Tonesix",388,"Tonetwo",423,"Tretroflexhook",430,"Tsecyrillic",1062,"Tshecyrillic",1035,"Tsmall",63348,"Twelveroman",8555,"Tworoman",8545,"U",85,"Uacute",218,"Uacutesmall",63482,"Ubreve",364,"Ucaron",467,"Ucircle",9418,"Ucircumflex",219,"Ucircumflexbelow",7798,"Ucircumflexsmall",63483,"Ucyrillic",1059,"Udblacute",368,"Udblgrave",532,"Udieresis",220,"Udieresisacute",471,"Udieresisbelow",7794,"Udieresiscaron",473,"Udieresiscyrillic",1264,"Udieresisgrave",475,"Udieresismacron",469,"Udieresissmall",63484,"Udotbelow",7908,"Ugrave",217,"Ugravesmall",63481,"Uhookabove",7910,"Uhorn",431,"Uhornacute",7912,"Uhorndotbelow",7920,"Uhorngrave",7914,"Uhornhookabove",7916,"Uhorntilde",7918,"Uhungarumlaut",368,"Uhungarumlautcyrillic",1266,"Uinvertedbreve",534,"Ukcyrillic",1144,"Umacron",362,"Umacroncyrillic",1262,"Umacrondieresis",7802,"Umonospace",65333,"Uogonek",370,"Upsilon",933,"Upsilon1",978,"Upsilonacutehooksymbolgreek",979,"Upsilonafrican",433,"Upsilondieresis",939,"Upsilondieresishooksymbolgreek",980,"Upsilonhooksymbol",978,"Upsilontonos",910,"Uring",366,"Ushortcyrillic",1038,"Usmall",63349,"Ustraightcyrillic",1198,"Ustraightstrokecyrillic",1200,"Utilde",360,"Utildeacute",7800,"Utildebelow",7796,"V",86,"Vcircle",9419,"Vdotbelow",7806,"Vecyrillic",1042,"Vewarmenian",1358,"Vhook",434,"Vmonospace",65334,"Voarmenian",1352,"Vsmall",63350,"Vtilde",7804,"W",87,"Wacute",7810,"Wcircle",9420,"Wcircumflex",372,"Wdieresis",7812,"Wdotaccent",7814,"Wdotbelow",7816,"Wgrave",7808,"Wmonospace",65335,"Wsmall",63351,"X",88,"Xcircle",9421,"Xdieresis",7820,"Xdotaccent",7818,"Xeharmenian",1341,"Xi",926,"Xmonospace",65336,"Xsmall",63352,"Y",89,"Yacute",221,"Yacutesmall",63485,"Yatcyrillic",1122,"Ycircle",9422,"Ycircumflex",374,"Ydieresis",376,"Ydieresissmall",63487,"Ydotaccent",7822,"Ydotbelow",7924,"Yericyrillic",1067,"Yerudieresiscyrillic",1272,"Ygrave",7922,"Yhook",435,"Yhookabove",7926,"Yiarmenian",1349,"Yicyrillic",1031,"Yiwnarmenian",1362,"Ymonospace",65337,"Ysmall",63353,"Ytilde",7928,"Yusbigcyrillic",1130,"Yusbigiotifiedcyrillic",1132,"Yuslittlecyrillic",1126,"Yuslittleiotifiedcyrillic",1128,"Z",90,"Zaarmenian",1334,"Zacute",377,"Zcaron",381,"Zcaronsmall",63231,"Zcircle",9423,"Zcircumflex",7824,"Zdot",379,"Zdotaccent",379,"Zdotbelow",7826,"Zecyrillic",1047,"Zedescendercyrillic",1176,"Zedieresiscyrillic",1246,"Zeta",918,"Zhearmenian",1338,"Zhebrevecyrillic",1217,"Zhecyrillic",1046,"Zhedescendercyrillic",1174,"Zhedieresiscyrillic",1244,"Zlinebelow",7828,"Zmonospace",65338,"Zsmall",63354,"Zstroke",437,"a",97,"aabengali",2438,"aacute",225,"aadeva",2310,"aagujarati",2694,"aagurmukhi",2566,"aamatragurmukhi",2622,"aarusquare",13059,"aavowelsignbengali",2494,"aavowelsigndeva",2366,"aavowelsigngujarati",2750,"abbreviationmarkarmenian",1375,"abbreviationsigndeva",2416,"abengali",2437,"abopomofo",12570,"abreve",259,"abreveacute",7855,"abrevecyrillic",1233,"abrevedotbelow",7863,"abrevegrave",7857,"abrevehookabove",7859,"abrevetilde",7861,"acaron",462,"acircle",9424,"acircumflex",226,"acircumflexacute",7845,"acircumflexdotbelow",7853,"acircumflexgrave",7847,"acircumflexhookabove",7849,"acircumflextilde",7851,"acute",180,"acutebelowcmb",791,"acutecmb",769,"acutecomb",769,"acutedeva",2388,"acutelowmod",719,"acutetonecmb",833,"acyrillic",1072,"adblgrave",513,"addakgurmukhi",2673,"adeva",2309,"adieresis",228,"adieresiscyrillic",1235,"adieresismacron",479,"adotbelow",7841,"adotmacron",481,"ae",230,"aeacute",509,"aekorean",12624,"aemacron",483,"afii00208",8213,"afii08941",8356,"afii10017",1040,"afii10018",1041,"afii10019",1042,"afii10020",1043,"afii10021",1044,"afii10022",1045,"afii10023",1025,"afii10024",1046,"afii10025",1047,"afii10026",1048,"afii10027",1049,"afii10028",1050,"afii10029",1051,"afii10030",1052,"afii10031",1053,"afii10032",1054,"afii10033",1055,"afii10034",1056,"afii10035",1057,"afii10036",1058,"afii10037",1059,"afii10038",1060,"afii10039",1061,"afii10040",1062,"afii10041",1063,"afii10042",1064,"afii10043",1065,"afii10044",1066,"afii10045",1067,"afii10046",1068,"afii10047",1069,"afii10048",1070,"afii10049",1071,"afii10050",1168,"afii10051",1026,"afii10052",1027,"afii10053",1028,"afii10054",1029,"afii10055",1030,"afii10056",1031,"afii10057",1032,"afii10058",1033,"afii10059",1034,"afii10060",1035,"afii10061",1036,"afii10062",1038,"afii10063",63172,"afii10064",63173,"afii10065",1072,"afii10066",1073,"afii10067",1074,"afii10068",1075,"afii10069",1076,"afii10070",1077,"afii10071",1105,"afii10072",1078,"afii10073",1079,"afii10074",1080,"afii10075",1081,"afii10076",1082,"afii10077",1083,"afii10078",1084,"afii10079",1085,"afii10080",1086,"afii10081",1087,"afii10082",1088,"afii10083",1089,"afii10084",1090,"afii10085",1091,"afii10086",1092,"afii10087",1093,"afii10088",1094,"afii10089",1095,"afii10090",1096,"afii10091",1097,"afii10092",1098,"afii10093",1099,"afii10094",1100,"afii10095",1101,"afii10096",1102,"afii10097",1103,"afii10098",1169,"afii10099",1106,"afii10100",1107,"afii10101",1108,"afii10102",1109,"afii10103",1110,"afii10104",1111,"afii10105",1112,"afii10106",1113,"afii10107",1114,"afii10108",1115,"afii10109",1116,"afii10110",1118,"afii10145",1039,"afii10146",1122,"afii10147",1138,"afii10148",1140,"afii10192",63174,"afii10193",1119,"afii10194",1123,"afii10195",1139,"afii10196",1141,"afii10831",63175,"afii10832",63176,"afii10846",1241,"afii299",8206,"afii300",8207,"afii301",8205,"afii57381",1642,"afii57388",1548,"afii57392",1632,"afii57393",1633,"afii57394",1634,"afii57395",1635,"afii57396",1636,"afii57397",1637,"afii57398",1638,"afii57399",1639,"afii57400",1640,"afii57401",1641,"afii57403",1563,"afii57407",1567,"afii57409",1569,"afii57410",1570,"afii57411",1571,"afii57412",1572,"afii57413",1573,"afii57414",1574,"afii57415",1575,"afii57416",1576,"afii57417",1577,"afii57418",1578,"afii57419",1579,"afii57420",1580,"afii57421",1581,"afii57422",1582,"afii57423",1583,"afii57424",1584,"afii57425",1585,"afii57426",1586,"afii57427",1587,"afii57428",1588,"afii57429",1589,"afii57430",1590,"afii57431",1591,"afii57432",1592,"afii57433",1593,"afii57434",1594,"afii57440",1600,"afii57441",1601,"afii57442",1602,"afii57443",1603,"afii57444",1604,"afii57445",1605,"afii57446",1606,"afii57448",1608,"afii57449",1609,"afii57450",1610,"afii57451",1611,"afii57452",1612,"afii57453",1613,"afii57454",1614,"afii57455",1615,"afii57456",1616,"afii57457",1617,"afii57458",1618,"afii57470",1607,"afii57505",1700,"afii57506",1662,"afii57507",1670,"afii57508",1688,"afii57509",1711,"afii57511",1657,"afii57512",1672,"afii57513",1681,"afii57514",1722,"afii57519",1746,"afii57534",1749,"afii57636",8362,"afii57645",1470,"afii57658",1475,"afii57664",1488,"afii57665",1489,"afii57666",1490,"afii57667",1491,"afii57668",1492,"afii57669",1493,"afii57670",1494,"afii57671",1495,"afii57672",1496,"afii57673",1497,"afii57674",1498,"afii57675",1499,"afii57676",1500,"afii57677",1501,"afii57678",1502,"afii57679",1503,"afii57680",1504,"afii57681",1505,"afii57682",1506,"afii57683",1507,"afii57684",1508,"afii57685",1509,"afii57686",1510,"afii57687",1511,"afii57688",1512,"afii57689",1513,"afii57690",1514,"afii57694",64298,"afii57695",64299,"afii57700",64331,"afii57705",64287,"afii57716",1520,"afii57717",1521,"afii57718",1522,"afii57723",64309,"afii57793",1460,"afii57794",1461,"afii57795",1462,"afii57796",1467,"afii57797",1464,"afii57798",1463,"afii57799",1456,"afii57800",1458,"afii57801",1457,"afii57802",1459,"afii57803",1474,"afii57804",1473,"afii57806",1465,"afii57807",1468,"afii57839",1469,"afii57841",1471,"afii57842",1472,"afii57929",700,"afii61248",8453,"afii61289",8467,"afii61352",8470,"afii61573",8236,"afii61574",8237,"afii61575",8238,"afii61664",8204,"afii63167",1645,"afii64937",701,"agrave",224,"agujarati",2693,"agurmukhi",2565,"ahiragana",12354,"ahookabove",7843,"aibengali",2448,"aibopomofo",12574,"aideva",2320,"aiecyrillic",1237,"aigujarati",2704,"aigurmukhi",2576,"aimatragurmukhi",2632,"ainarabic",1593,"ainfinalarabic",65226,"aininitialarabic",65227,"ainmedialarabic",65228,"ainvertedbreve",515,"aivowelsignbengali",2504,"aivowelsigndeva",2376,"aivowelsigngujarati",2760,"akatakana",12450,"akatakanahalfwidth",65393,"akorean",12623,"alef",1488,"alefarabic",1575,"alefdageshhebrew",64304,"aleffinalarabic",65166,"alefhamzaabovearabic",1571,"alefhamzaabovefinalarabic",65156,"alefhamzabelowarabic",1573,"alefhamzabelowfinalarabic",65160,"alefhebrew",1488,"aleflamedhebrew",64335,"alefmaddaabovearabic",1570,"alefmaddaabovefinalarabic",65154,"alefmaksuraarabic",1609,"alefmaksurafinalarabic",65264,"alefmaksurainitialarabic",65267,"alefmaksuramedialarabic",65268,"alefpatahhebrew",64302,"alefqamatshebrew",64303,"aleph",8501,"allequal",8780,"alpha",945,"alphatonos",940,"amacron",257,"amonospace",65345,"ampersand",38,"ampersandmonospace",65286,"ampersandsmall",63270,"amsquare",13250,"anbopomofo",12578,"angbopomofo",12580,"angbracketleft",12296,"angbracketright",12297,"angkhankhuthai",3674,"angle",8736,"anglebracketleft",12296,"anglebracketleftvertical",65087,"anglebracketright",12297,"anglebracketrightvertical",65088,"angleleft",9001,"angleright",9002,"angstrom",8491,"anoteleia",903,"anudattadeva",2386,"anusvarabengali",2434,"anusvaradeva",2306,"anusvaragujarati",2690,"aogonek",261,"apaatosquare",13056,"aparen",9372,"apostrophearmenian",1370,"apostrophemod",700,"apple",63743,"approaches",8784,"approxequal",8776,"approxequalorimage",8786,"approximatelyequal",8773,"araeaekorean",12686,"araeakorean",12685,"arc",8978,"arighthalfring",7834,"aring",229,"aringacute",507,"aringbelow",7681,"arrowboth",8596,"arrowdashdown",8675,"arrowdashleft",8672,"arrowdashright",8674,"arrowdashup",8673,"arrowdblboth",8660,"arrowdbldown",8659,"arrowdblleft",8656,"arrowdblright",8658,"arrowdblup",8657,"arrowdown",8595,"arrowdownleft",8601,"arrowdownright",8600,"arrowdownwhite",8681,"arrowheaddownmod",709,"arrowheadleftmod",706,"arrowheadrightmod",707,"arrowheadupmod",708,"arrowhorizex",63719,"arrowleft",8592,"arrowleftdbl",8656,"arrowleftdblstroke",8653,"arrowleftoverright",8646,"arrowleftwhite",8678,"arrowright",8594,"arrowrightdblstroke",8655,"arrowrightheavy",10142,"arrowrightoverleft",8644,"arrowrightwhite",8680,"arrowtableft",8676,"arrowtabright",8677,"arrowup",8593,"arrowupdn",8597,"arrowupdnbse",8616,"arrowupdownbase",8616,"arrowupleft",8598,"arrowupleftofdown",8645,"arrowupright",8599,"arrowupwhite",8679,"arrowvertex",63718,"asciicircum",94,"asciicircummonospace",65342,"asciitilde",126,"asciitildemonospace",65374,"ascript",593,"ascriptturned",594,"asmallhiragana",12353,"asmallkatakana",12449,"asmallkatakanahalfwidth",65383,"asterisk",42,"asteriskaltonearabic",1645,"asteriskarabic",1645,"asteriskmath",8727,"asteriskmonospace",65290,"asterisksmall",65121,"asterism",8258,"asuperior",63209,"asymptoticallyequal",8771,"at",64,"atilde",227,"atmonospace",65312,"atsmall",65131,"aturned",592,"aubengali",2452,"aubopomofo",12576,"audeva",2324,"augujarati",2708,"augurmukhi",2580,"aulengthmarkbengali",2519,"aumatragurmukhi",2636,"auvowelsignbengali",2508,"auvowelsigndeva",2380,"auvowelsigngujarati",2764,"avagrahadeva",2365,"aybarmenian",1377,"ayin",1506,"ayinaltonehebrew",64288,"ayinhebrew",1506,"b",98,"babengali",2476,"backslash",92,"backslashmonospace",65340,"badeva",2348,"bagujarati",2732,"bagurmukhi",2604,"bahiragana",12400,"bahtthai",3647,"bakatakana",12496,"bar",124,"barmonospace",65372,"bbopomofo",12549,"bcircle",9425,"bdotaccent",7683,"bdotbelow",7685,"beamedsixteenthnotes",9836,"because",8757,"becyrillic",1073,"beharabic",1576,"behfinalarabic",65168,"behinitialarabic",65169,"behiragana",12409,"behmedialarabic",65170,"behmeeminitialarabic",64671,"behmeemisolatedarabic",64520,"behnoonfinalarabic",64621,"bekatakana",12505,"benarmenian",1378,"bet",1489,"beta",946,"betasymbolgreek",976,"betdagesh",64305,"betdageshhebrew",64305,"bethebrew",1489,"betrafehebrew",64332,"bhabengali",2477,"bhadeva",2349,"bhagujarati",2733,"bhagurmukhi",2605,"bhook",595,"bihiragana",12403,"bikatakana",12499,"bilabialclick",664,"bindigurmukhi",2562,"birusquare",13105,"blackcircle",9679,"blackdiamond",9670,"blackdownpointingtriangle",9660,"blackleftpointingpointer",9668,"blackleftpointingtriangle",9664,"blacklenticularbracketleft",12304,"blacklenticularbracketleftvertical",65083,"blacklenticularbracketright",12305,"blacklenticularbracketrightvertical",65084,"blacklowerlefttriangle",9699,"blacklowerrighttriangle",9698,"blackrectangle",9644,"blackrightpointingpointer",9658,"blackrightpointingtriangle",9654,"blacksmallsquare",9642,"blacksmilingface",9787,"blacksquare",9632,"blackstar",9733,"blackupperlefttriangle",9700,"blackupperrighttriangle",9701,"blackuppointingsmalltriangle",9652,"blackuppointingtriangle",9650,"blank",9251,"blinebelow",7687,"block",9608,"bmonospace",65346,"bobaimaithai",3610,"bohiragana",12412,"bokatakana",12508,"bparen",9373,"bqsquare",13251,"braceex",63732,"braceleft",123,"braceleftbt",63731,"braceleftmid",63730,"braceleftmonospace",65371,"braceleftsmall",65115,"bracelefttp",63729,"braceleftvertical",65079,"braceright",125,"bracerightbt",63742,"bracerightmid",63741,"bracerightmonospace",65373,"bracerightsmall",65116,"bracerighttp",63740,"bracerightvertical",65080,"bracketleft",91,"bracketleftbt",63728,"bracketleftex",63727,"bracketleftmonospace",65339,"bracketlefttp",63726,"bracketright",93,"bracketrightbt",63739,"bracketrightex",63738,"bracketrightmonospace",65341,"bracketrighttp",63737,"breve",728,"brevebelowcmb",814,"brevecmb",774,"breveinvertedbelowcmb",815,"breveinvertedcmb",785,"breveinverteddoublecmb",865,"bridgebelowcmb",810,"bridgeinvertedbelowcmb",826,"brokenbar",166,"bstroke",384,"bsuperior",63210,"btopbar",387,"buhiragana",12406,"bukatakana",12502,"bullet",8226,"bulletinverse",9688,"bulletoperator",8729,"bullseye",9678,"c",99,"caarmenian",1390,"cabengali",2458,"cacute",263,"cadeva",2330,"cagujarati",2714,"cagurmukhi",2586,"calsquare",13192,"candrabindubengali",2433,"candrabinducmb",784,"candrabindudeva",2305,"candrabindugujarati",2689,"capslock",8682,"careof",8453,"caron",711,"caronbelowcmb",812,"caroncmb",780,"carriagereturn",8629,"cbopomofo",12568,"ccaron",269,"ccedilla",231,"ccedillaacute",7689,"ccircle",9426,"ccircumflex",265,"ccurl",597,"cdot",267,"cdotaccent",267,"cdsquare",13253,"cedilla",184,"cedillacmb",807,"cent",162,"centigrade",8451,"centinferior",63199,"centmonospace",65504,"centoldstyle",63394,"centsuperior",63200,"chaarmenian",1401,"chabengali",2459,"chadeva",2331,"chagujarati",2715,"chagurmukhi",2587,"chbopomofo",12564,"cheabkhasiancyrillic",1213,"checkmark",10003,"checyrillic",1095,"chedescenderabkhasiancyrillic",1215,"chedescendercyrillic",1207,"chedieresiscyrillic",1269,"cheharmenian",1395,"chekhakassiancyrillic",1228,"cheverticalstrokecyrillic",1209,"chi",967,"chieuchacirclekorean",12919,"chieuchaparenkorean",12823,"chieuchcirclekorean",12905,"chieuchkorean",12618,"chieuchparenkorean",12809,"chochangthai",3594,"chochanthai",3592,"chochingthai",3593,"chochoethai",3596,"chook",392,"cieucacirclekorean",12918,"cieucaparenkorean",12822,"cieuccirclekorean",12904,"cieuckorean",12616,"cieucparenkorean",12808,"cieucuparenkorean",12828,"circle",9675,"circlecopyrt",169,"circlemultiply",8855,"circleot",8857,"circleplus",8853,"circlepostalmark",12342,"circlewithlefthalfblack",9680,"circlewithrighthalfblack",9681,"circumflex",710,"circumflexbelowcmb",813,"circumflexcmb",770,"clear",8999,"clickalveolar",450,"clickdental",448,"clicklateral",449,"clickretroflex",451,"club",9827,"clubsuitblack",9827,"clubsuitwhite",9831,"cmcubedsquare",13220,"cmonospace",65347,"cmsquaredsquare",13216,"coarmenian",1409,"colon",58,"colonmonetary",8353,"colonmonospace",65306,"colonsign",8353,"colonsmall",65109,"colontriangularhalfmod",721,"colontriangularmod",720,"comma",44,"commaabovecmb",787,"commaaboverightcmb",789,"commaaccent",63171,"commaarabic",1548,"commaarmenian",1373,"commainferior",63201,"commamonospace",65292,"commareversedabovecmb",788,"commareversedmod",701,"commasmall",65104,"commasuperior",63202,"commaturnedabovecmb",786,"commaturnedmod",699,"compass",9788,"congruent",8773,"contourintegral",8750,"control",8963,"controlACK",6,"controlBEL",7,"controlBS",8,"controlCAN",24,"controlCR",13,"controlDC1",17,"controlDC2",18,"controlDC3",19,"controlDC4",20,"controlDEL",127,"controlDLE",16,"controlEM",25,"controlENQ",5,"controlEOT",4,"controlESC",27,"controlETB",23,"controlETX",3,"controlFF",12,"controlFS",28,"controlGS",29,"controlHT",9,"controlLF",10,"controlNAK",21,"controlNULL",0,"controlRS",30,"controlSI",15,"controlSO",14,"controlSOT",2,"controlSTX",1,"controlSUB",26,"controlSYN",22,"controlUS",31,"controlVT",11,"copyright",169,"copyrightsans",63721,"copyrightserif",63193,"cornerbracketleft",12300,"cornerbracketlefthalfwidth",65378,"cornerbracketleftvertical",65089,"cornerbracketright",12301,"cornerbracketrighthalfwidth",65379,"cornerbracketrightvertical",65090,"corporationsquare",13183,"cosquare",13255,"coverkgsquare",13254,"cparen",9374,"cruzeiro",8354,"cstretched",663,"curlyand",8911,"curlyor",8910,"currency",164,"cyrBreve",63185,"cyrFlex",63186,"cyrbreve",63188,"cyrflex",63189,"d",100,"daarmenian",1380,"dabengali",2470,"dadarabic",1590,"dadeva",2342,"dadfinalarabic",65214,"dadinitialarabic",65215,"dadmedialarabic",65216,"dagesh",1468,"dageshhebrew",1468,"dagger",8224,"daggerdbl",8225,"dagujarati",2726,"dagurmukhi",2598,"dahiragana",12384,"dakatakana",12480,"dalarabic",1583,"dalet",1491,"daletdagesh",64307,"daletdageshhebrew",64307,"dalethebrew",1491,"dalfinalarabic",65194,"dammaarabic",1615,"dammalowarabic",1615,"dammatanaltonearabic",1612,"dammatanarabic",1612,"danda",2404,"dargahebrew",1447,"dargalefthebrew",1447,"dasiapneumatacyrilliccmb",1157,"dblGrave",63187,"dblanglebracketleft",12298,"dblanglebracketleftvertical",65085,"dblanglebracketright",12299,"dblanglebracketrightvertical",65086,"dblarchinvertedbelowcmb",811,"dblarrowleft",8660,"dblarrowright",8658,"dbldanda",2405,"dblgrave",63190,"dblgravecmb",783,"dblintegral",8748,"dbllowline",8215,"dbllowlinecmb",819,"dbloverlinecmb",831,"dblprimemod",698,"dblverticalbar",8214,"dblverticallineabovecmb",782,"dbopomofo",12553,"dbsquare",13256,"dcaron",271,"dcedilla",7697,"dcircle",9427,"dcircumflexbelow",7699,"dcroat",273,"ddabengali",2465,"ddadeva",2337,"ddagujarati",2721,"ddagurmukhi",2593,"ddalarabic",1672,"ddalfinalarabic",64393,"dddhadeva",2396,"ddhabengali",2466,"ddhadeva",2338,"ddhagujarati",2722,"ddhagurmukhi",2594,"ddotaccent",7691,"ddotbelow",7693,"decimalseparatorarabic",1643,"decimalseparatorpersian",1643,"decyrillic",1076,"degree",176,"dehihebrew",1453,"dehiragana",12391,"deicoptic",1007,"dekatakana",12487,"deleteleft",9003,"deleteright",8998,"delta",948,"deltaturned",397,"denominatorminusonenumeratorbengali",2552,"dezh",676,"dhabengali",2471,"dhadeva",2343,"dhagujarati",2727,"dhagurmukhi",2599,"dhook",599,"dialytikatonos",901,"dialytikatonoscmb",836,"diamond",9830,"diamondsuitwhite",9826,"dieresis",168,"dieresisacute",63191,"dieresisbelowcmb",804,"dieresiscmb",776,"dieresisgrave",63192,"dieresistonos",901,"dihiragana",12386,"dikatakana",12482,"dittomark",12291,"divide",247,"divides",8739,"divisionslash",8725,"djecyrillic",1106,"dkshade",9619,"dlinebelow",7695,"dlsquare",13207,"dmacron",273,"dmonospace",65348,"dnblock",9604,"dochadathai",3598,"dodekthai",3604,"dohiragana",12393,"dokatakana",12489,"dollar",36,"dollarinferior",63203,"dollarmonospace",65284,"dollaroldstyle",63268,"dollarsmall",65129,"dollarsuperior",63204,"dong",8363,"dorusquare",13094,"dotaccent",729,"dotaccentcmb",775,"dotbelowcmb",803,"dotbelowcomb",803,"dotkatakana",12539,"dotlessi",305,"dotlessj",63166,"dotlessjstrokehook",644,"dotmath",8901,"dottedcircle",9676,"doubleyodpatah",64287,"doubleyodpatahhebrew",64287,"downtackbelowcmb",798,"downtackmod",725,"dparen",9375,"dsuperior",63211,"dtail",598,"dtopbar",396,"duhiragana",12389,"dukatakana",12485,"dz",499,"dzaltone",675,"dzcaron",454,"dzcurl",677,"dzeabkhasiancyrillic",1249,"dzecyrillic",1109,"dzhecyrillic",1119,"e",101,"eacute",233,"earth",9793,"ebengali",2447,"ebopomofo",12572,"ebreve",277,"ecandradeva",2317,"ecandragujarati",2701,"ecandravowelsigndeva",2373,"ecandravowelsigngujarati",2757,"ecaron",283,"ecedillabreve",7709,"echarmenian",1381,"echyiwnarmenian",1415,"ecircle",9428,"ecircumflex",234,"ecircumflexacute",7871,"ecircumflexbelow",7705,"ecircumflexdotbelow",7879,"ecircumflexgrave",7873,"ecircumflexhookabove",7875,"ecircumflextilde",7877,"ecyrillic",1108,"edblgrave",517,"edeva",2319,"edieresis",235,"edot",279,"edotaccent",279,"edotbelow",7865,"eegurmukhi",2575,"eematragurmukhi",2631,"efcyrillic",1092,"egrave",232,"egujarati",2703,"eharmenian",1383,"ehbopomofo",12573,"ehiragana",12360,"ehookabove",7867,"eibopomofo",12575,"eight",56,"eightarabic",1640,"eightbengali",2542,"eightcircle",9319,"eightcircleinversesansserif",10129,"eightdeva",2414,"eighteencircle",9329,"eighteenparen",9349,"eighteenperiod",9369,"eightgujarati",2798,"eightgurmukhi",2670,"eighthackarabic",1640,"eighthangzhou",12328,"eighthnotebeamed",9835,"eightideographicparen",12839,"eightinferior",8328,"eightmonospace",65304,"eightoldstyle",63288,"eightparen",9339,"eightperiod",9359,"eightpersian",1784,"eightroman",8567,"eightsuperior",8312,"eightthai",3672,"einvertedbreve",519,"eiotifiedcyrillic",1125,"ekatakana",12456,"ekatakanahalfwidth",65396,"ekonkargurmukhi",2676,"ekorean",12628,"elcyrillic",1083,"element",8712,"elevencircle",9322,"elevenparen",9342,"elevenperiod",9362,"elevenroman",8570,"ellipsis",8230,"ellipsisvertical",8942,"emacron",275,"emacronacute",7703,"emacrongrave",7701,"emcyrillic",1084,"emdash",8212,"emdashvertical",65073,"emonospace",65349,"emphasismarkarmenian",1371,"emptyset",8709,"enbopomofo",12579,"encyrillic",1085,"endash",8211,"endashvertical",65074,"endescendercyrillic",1187,"eng",331,"engbopomofo",12581,"enghecyrillic",1189,"enhookcyrillic",1224,"enspace",8194,"eogonek",281,"eokorean",12627,"eopen",603,"eopenclosed",666,"eopenreversed",604,"eopenreversedclosed",606,"eopenreversedhook",605,"eparen",9376,"epsilon",949,"epsilontonos",941,"equal",61,"equalmonospace",65309,"equalsmall",65126,"equalsuperior",8316,"equivalence",8801,"erbopomofo",12582,"ercyrillic",1088,"ereversed",600,"ereversedcyrillic",1101,"escyrillic",1089,"esdescendercyrillic",1195,"esh",643,"eshcurl",646,"eshortdeva",2318,"eshortvowelsigndeva",2374,"eshreversedloop",426,"eshsquatreversed",645,"esmallhiragana",12359,"esmallkatakana",12455,"esmallkatakanahalfwidth",65386,"estimated",8494,"esuperior",63212,"eta",951,"etarmenian",1384,"etatonos",942,"eth",240,"etilde",7869,"etildebelow",7707,"etnahtafoukhhebrew",1425,"etnahtafoukhlefthebrew",1425,"etnahtahebrew",1425,"etnahtalefthebrew",1425,"eturned",477,"eukorean",12641,"euro",8364,"evowelsignbengali",2503,"evowelsigndeva",2375,"evowelsigngujarati",2759,"exclam",33,"exclamarmenian",1372,"exclamdbl",8252,"exclamdown",161,"exclamdownsmall",63393,"exclammonospace",65281,"exclamsmall",63265,"existential",8707,"ezh",658,"ezhcaron",495,"ezhcurl",659,"ezhreversed",441,"ezhtail",442,"f",102,"fadeva",2398,"fagurmukhi",2654,"fahrenheit",8457,"fathaarabic",1614,"fathalowarabic",1614,"fathatanarabic",1611,"fbopomofo",12552,"fcircle",9429,"fdotaccent",7711,"feharabic",1601,"feharmenian",1414,"fehfinalarabic",65234,"fehinitialarabic",65235,"fehmedialarabic",65236,"feicoptic",997,"female",9792,"ff",64256,"f_f",64256,"ffi",64259,"ffl",64260,"fi",64257,"fifteencircle",9326,"fifteenparen",9346,"fifteenperiod",9366,"figuredash",8210,"filledbox",9632,"filledrect",9644,"finalkaf",1498,"finalkafdagesh",64314,"finalkafdageshhebrew",64314,"finalkafhebrew",1498,"finalmem",1501,"finalmemhebrew",1501,"finalnun",1503,"finalnunhebrew",1503,"finalpe",1507,"finalpehebrew",1507,"finaltsadi",1509,"finaltsadihebrew",1509,"firsttonechinese",713,"fisheye",9673,"fitacyrillic",1139,"five",53,"fivearabic",1637,"fivebengali",2539,"fivecircle",9316,"fivecircleinversesansserif",10126,"fivedeva",2411,"fiveeighths",8541,"fivegujarati",2795,"fivegurmukhi",2667,"fivehackarabic",1637,"fivehangzhou",12325,"fiveideographicparen",12836,"fiveinferior",8325,"fivemonospace",65301,"fiveoldstyle",63285,"fiveparen",9336,"fiveperiod",9356,"fivepersian",1781,"fiveroman",8564,"fivesuperior",8309,"fivethai",3669,"fl",64258,"florin",402,"fmonospace",65350,"fmsquare",13209,"fofanthai",3615,"fofathai",3613,"fongmanthai",3663,"forall",8704,"four",52,"fourarabic",1636,"fourbengali",2538,"fourcircle",9315,"fourcircleinversesansserif",10125,"fourdeva",2410,"fourgujarati",2794,"fourgurmukhi",2666,"fourhackarabic",1636,"fourhangzhou",12324,"fourideographicparen",12835,"fourinferior",8324,"fourmonospace",65300,"fournumeratorbengali",2551,"fouroldstyle",63284,"fourparen",9335,"fourperiod",9355,"fourpersian",1780,"fourroman",8563,"foursuperior",8308,"fourteencircle",9325,"fourteenparen",9345,"fourteenperiod",9365,"fourthai",3668,"fourthtonechinese",715,"fparen",9377,"fraction",8260,"franc",8355,"g",103,"gabengali",2455,"gacute",501,"gadeva",2327,"gafarabic",1711,"gaffinalarabic",64403,"gafinitialarabic",64404,"gafmedialarabic",64405,"gagujarati",2711,"gagurmukhi",2583,"gahiragana",12364,"gakatakana",12460,"gamma",947,"gammalatinsmall",611,"gammasuperior",736,"gangiacoptic",1003,"gbopomofo",12557,"gbreve",287,"gcaron",487,"gcedilla",291,"gcircle",9430,"gcircumflex",285,"gcommaaccent",291,"gdot",289,"gdotaccent",289,"gecyrillic",1075,"gehiragana",12370,"gekatakana",12466,"geometricallyequal",8785,"gereshaccenthebrew",1436,"gereshhebrew",1523,"gereshmuqdamhebrew",1437,"germandbls",223,"gershayimaccenthebrew",1438,"gershayimhebrew",1524,"getamark",12307,"ghabengali",2456,"ghadarmenian",1394,"ghadeva",2328,"ghagujarati",2712,"ghagurmukhi",2584,"ghainarabic",1594,"ghainfinalarabic",65230,"ghaininitialarabic",65231,"ghainmedialarabic",65232,"ghemiddlehookcyrillic",1173,"ghestrokecyrillic",1171,"gheupturncyrillic",1169,"ghhadeva",2394,"ghhagurmukhi",2650,"ghook",608,"ghzsquare",13203,"gihiragana",12366,"gikatakana",12462,"gimarmenian",1379,"gimel",1490,"gimeldagesh",64306,"gimeldageshhebrew",64306,"gimelhebrew",1490,"gjecyrillic",1107,"glottalinvertedstroke",446,"glottalstop",660,"glottalstopinverted",662,"glottalstopmod",704,"glottalstopreversed",661,"glottalstopreversedmod",705,"glottalstopreversedsuperior",740,"glottalstopstroke",673,"glottalstopstrokereversed",674,"gmacron",7713,"gmonospace",65351,"gohiragana",12372,"gokatakana",12468,"gparen",9378,"gpasquare",13228,"gradient",8711,"grave",96,"gravebelowcmb",790,"gravecmb",768,"gravecomb",768,"gravedeva",2387,"gravelowmod",718,"gravemonospace",65344,"gravetonecmb",832,"greater",62,"greaterequal",8805,"greaterequalorless",8923,"greatermonospace",65310,"greaterorequivalent",8819,"greaterorless",8823,"greateroverequal",8807,"greatersmall",65125,"gscript",609,"gstroke",485,"guhiragana",12368,"guillemotleft",171,"guillemotright",187,"guilsinglleft",8249,"guilsinglright",8250,"gukatakana",12464,"guramusquare",13080,"gysquare",13257,"h",104,"haabkhasiancyrillic",1193,"haaltonearabic",1729,"habengali",2489,"hadescendercyrillic",1203,"hadeva",2361,"hagujarati",2745,"hagurmukhi",2617,"haharabic",1581,"hahfinalarabic",65186,"hahinitialarabic",65187,"hahiragana",12399,"hahmedialarabic",65188,"haitusquare",13098,"hakatakana",12495,"hakatakanahalfwidth",65418,"halantgurmukhi",2637,"hamzaarabic",1569,"hamzalowarabic",1569,"hangulfiller",12644,"hardsigncyrillic",1098,"harpoonleftbarbup",8636,"harpoonrightbarbup",8640,"hasquare",13258,"hatafpatah",1458,"hatafpatah16",1458,"hatafpatah23",1458,"hatafpatah2f",1458,"hatafpatahhebrew",1458,"hatafpatahnarrowhebrew",1458,"hatafpatahquarterhebrew",1458,"hatafpatahwidehebrew",1458,"hatafqamats",1459,"hatafqamats1b",1459,"hatafqamats28",1459,"hatafqamats34",1459,"hatafqamatshebrew",1459,"hatafqamatsnarrowhebrew",1459,"hatafqamatsquarterhebrew",1459,"hatafqamatswidehebrew",1459,"hatafsegol",1457,"hatafsegol17",1457,"hatafsegol24",1457,"hatafsegol30",1457,"hatafsegolhebrew",1457,"hatafsegolnarrowhebrew",1457,"hatafsegolquarterhebrew",1457,"hatafsegolwidehebrew",1457,"hbar",295,"hbopomofo",12559,"hbrevebelow",7723,"hcedilla",7721,"hcircle",9431,"hcircumflex",293,"hdieresis",7719,"hdotaccent",7715,"hdotbelow",7717,"he",1492,"heart",9829,"heartsuitblack",9829,"heartsuitwhite",9825,"hedagesh",64308,"hedageshhebrew",64308,"hehaltonearabic",1729,"heharabic",1607,"hehebrew",1492,"hehfinalaltonearabic",64423,"hehfinalalttwoarabic",65258,"hehfinalarabic",65258,"hehhamzaabovefinalarabic",64421,"hehhamzaaboveisolatedarabic",64420,"hehinitialaltonearabic",64424,"hehinitialarabic",65259,"hehiragana",12408,"hehmedialaltonearabic",64425,"hehmedialarabic",65260,"heiseierasquare",13179,"hekatakana",12504,"hekatakanahalfwidth",65421,"hekutaarusquare",13110,"henghook",615,"herutusquare",13113,"het",1495,"hethebrew",1495,"hhook",614,"hhooksuperior",689,"hieuhacirclekorean",12923,"hieuhaparenkorean",12827,"hieuhcirclekorean",12909,"hieuhkorean",12622,"hieuhparenkorean",12813,"hihiragana",12402,"hikatakana",12498,"hikatakanahalfwidth",65419,"hiriq",1460,"hiriq14",1460,"hiriq21",1460,"hiriq2d",1460,"hiriqhebrew",1460,"hiriqnarrowhebrew",1460,"hiriqquarterhebrew",1460,"hiriqwidehebrew",1460,"hlinebelow",7830,"hmonospace",65352,"hoarmenian",1392,"hohipthai",3627,"hohiragana",12411,"hokatakana",12507,"hokatakanahalfwidth",65422,"holam",1465,"holam19",1465,"holam26",1465,"holam32",1465,"holamhebrew",1465,"holamnarrowhebrew",1465,"holamquarterhebrew",1465,"holamwidehebrew",1465,"honokhukthai",3630,"hookabovecomb",777,"hookcmb",777,"hookpalatalizedbelowcmb",801,"hookretroflexbelowcmb",802,"hoonsquare",13122,"horicoptic",1001,"horizontalbar",8213,"horncmb",795,"hotsprings",9832,"house",8962,"hparen",9379,"hsuperior",688,"hturned",613,"huhiragana",12405,"huiitosquare",13107,"hukatakana",12501,"hukatakanahalfwidth",65420,"hungarumlaut",733,"hungarumlautcmb",779,"hv",405,"hyphen",45,"hypheninferior",63205,"hyphenmonospace",65293,"hyphensmall",65123,"hyphensuperior",63206,"hyphentwo",8208,"i",105,"iacute",237,"iacyrillic",1103,"ibengali",2439,"ibopomofo",12583,"ibreve",301,"icaron",464,"icircle",9432,"icircumflex",238,"icyrillic",1110,"idblgrave",521,"ideographearthcircle",12943,"ideographfirecircle",12939,"ideographicallianceparen",12863,"ideographiccallparen",12858,"ideographiccentrecircle",12965,"ideographicclose",12294,"ideographiccomma",12289,"ideographiccommaleft",65380,"ideographiccongratulationparen",12855,"ideographiccorrectcircle",12963,"ideographicearthparen",12847,"ideographicenterpriseparen",12861,"ideographicexcellentcircle",12957,"ideographicfestivalparen",12864,"ideographicfinancialcircle",12950,"ideographicfinancialparen",12854,"ideographicfireparen",12843,"ideographichaveparen",12850,"ideographichighcircle",12964,"ideographiciterationmark",12293,"ideographiclaborcircle",12952,"ideographiclaborparen",12856,"ideographicleftcircle",12967,"ideographiclowcircle",12966,"ideographicmedicinecircle",12969,"ideographicmetalparen",12846,"ideographicmoonparen",12842,"ideographicnameparen",12852,"ideographicperiod",12290,"ideographicprintcircle",12958,"ideographicreachparen",12867,"ideographicrepresentparen",12857,"ideographicresourceparen",12862,"ideographicrightcircle",12968,"ideographicsecretcircle",12953,"ideographicselfparen",12866,"ideographicsocietyparen",12851,"ideographicspace",12288,"ideographicspecialparen",12853,"ideographicstockparen",12849,"ideographicstudyparen",12859,"ideographicsunparen",12848,"ideographicsuperviseparen",12860,"ideographicwaterparen",12844,"ideographicwoodparen",12845,"ideographiczero",12295,"ideographmetalcircle",12942,"ideographmooncircle",12938,"ideographnamecircle",12948,"ideographsuncircle",12944,"ideographwatercircle",12940,"ideographwoodcircle",12941,"ideva",2311,"idieresis",239,"idieresisacute",7727,"idieresiscyrillic",1253,"idotbelow",7883,"iebrevecyrillic",1239,"iecyrillic",1077,"ieungacirclekorean",12917,"ieungaparenkorean",12821,"ieungcirclekorean",12903,"ieungkorean",12615,"ieungparenkorean",12807,"igrave",236,"igujarati",2695,"igurmukhi",2567,"ihiragana",12356,"ihookabove",7881,"iibengali",2440,"iicyrillic",1080,"iideva",2312,"iigujarati",2696,"iigurmukhi",2568,"iimatragurmukhi",2624,"iinvertedbreve",523,"iishortcyrillic",1081,"iivowelsignbengali",2496,"iivowelsigndeva",2368,"iivowelsigngujarati",2752,"ij",307,"ikatakana",12452,"ikatakanahalfwidth",65394,"ikorean",12643,"ilde",732,"iluyhebrew",1452,"imacron",299,"imacroncyrillic",1251,"imageorapproximatelyequal",8787,"imatragurmukhi",2623,"imonospace",65353,"increment",8710,"infinity",8734,"iniarmenian",1387,"integral",8747,"integralbottom",8993,"integralbt",8993,"integralex",63733,"integraltop",8992,"integraltp",8992,"intersection",8745,"intisquare",13061,"invbullet",9688,"invcircle",9689,"invsmileface",9787,"iocyrillic",1105,"iogonek",303,"iota",953,"iotadieresis",970,"iotadieresistonos",912,"iotalatin",617,"iotatonos",943,"iparen",9380,"irigurmukhi",2674,"ismallhiragana",12355,"ismallkatakana",12451,"ismallkatakanahalfwidth",65384,"issharbengali",2554,"istroke",616,"isuperior",63213,"iterationhiragana",12445,"iterationkatakana",12541,"itilde",297,"itildebelow",7725,"iubopomofo",12585,"iucyrillic",1102,"ivowelsignbengali",2495,"ivowelsigndeva",2367,"ivowelsigngujarati",2751,"izhitsacyrillic",1141,"izhitsadblgravecyrillic",1143,"j",106,"jaarmenian",1393,"jabengali",2460,"jadeva",2332,"jagujarati",2716,"jagurmukhi",2588,"jbopomofo",12560,"jcaron",496,"jcircle",9433,"jcircumflex",309,"jcrossedtail",669,"jdotlessstroke",607,"jecyrillic",1112,"jeemarabic",1580,"jeemfinalarabic",65182,"jeeminitialarabic",65183,"jeemmedialarabic",65184,"jeharabic",1688,"jehfinalarabic",64395,"jhabengali",2461,"jhadeva",2333,"jhagujarati",2717,"jhagurmukhi",2589,"jheharmenian",1403,"jis",12292,"jmonospace",65354,"jparen",9381,"jsuperior",690,"k",107,"kabashkircyrillic",1185,"kabengali",2453,"kacute",7729,"kacyrillic",1082,"kadescendercyrillic",1179,"kadeva",2325,"kaf",1499,"kafarabic",1603,"kafdagesh",64315,"kafdageshhebrew",64315,"kaffinalarabic",65242,"kafhebrew",1499,"kafinitialarabic",65243,"kafmedialarabic",65244,"kafrafehebrew",64333,"kagujarati",2709,"kagurmukhi",2581,"kahiragana",12363,"kahookcyrillic",1220,"kakatakana",12459,"kakatakanahalfwidth",65398,"kappa",954,"kappasymbolgreek",1008,"kapyeounmieumkorean",12657,"kapyeounphieuphkorean",12676,"kapyeounpieupkorean",12664,"kapyeounssangpieupkorean",12665,"karoriisquare",13069,"kashidaautoarabic",1600,"kashidaautonosidebearingarabic",1600,"kasmallkatakana",12533,"kasquare",13188,"kasraarabic",1616,"kasratanarabic",1613,"kastrokecyrillic",1183,"katahiraprolongmarkhalfwidth",65392,"kaverticalstrokecyrillic",1181,"kbopomofo",12558,"kcalsquare",13193,"kcaron",489,"kcedilla",311,"kcircle",9434,"kcommaaccent",311,"kdotbelow",7731,"keharmenian",1412,"kehiragana",12369,"kekatakana",12465,"kekatakanahalfwidth",65401,"kenarmenian",1391,"kesmallkatakana",12534,"kgreenlandic",312,"khabengali",2454,"khacyrillic",1093,"khadeva",2326,"khagujarati",2710,"khagurmukhi",2582,"khaharabic",1582,"khahfinalarabic",65190,"khahinitialarabic",65191,"khahmedialarabic",65192,"kheicoptic",999,"khhadeva",2393,"khhagurmukhi",2649,"khieukhacirclekorean",12920,"khieukhaparenkorean",12824,"khieukhcirclekorean",12906,"khieukhkorean",12619,"khieukhparenkorean",12810,"khokhaithai",3586,"khokhonthai",3589,"khokhuatthai",3587,"khokhwaithai",3588,"khomutthai",3675,"khook",409,"khorakhangthai",3590,"khzsquare",13201,"kihiragana",12365,"kikatakana",12461,"kikatakanahalfwidth",65399,"kiroguramusquare",13077,"kiromeetorusquare",13078,"kirosquare",13076,"kiyeokacirclekorean",12910,"kiyeokaparenkorean",12814,"kiyeokcirclekorean",12896,"kiyeokkorean",12593,"kiyeokparenkorean",12800,"kiyeoksioskorean",12595,"kjecyrillic",1116,"klinebelow",7733,"klsquare",13208,"kmcubedsquare",13222,"kmonospace",65355,"kmsquaredsquare",13218,"kohiragana",12371,"kohmsquare",13248,"kokaithai",3585,"kokatakana",12467,"kokatakanahalfwidth",65402,"kooposquare",13086,"koppacyrillic",1153,"koreanstandardsymbol",12927,"koroniscmb",835,"kparen",9382,"kpasquare",13226,"ksicyrillic",1135,"ktsquare",13263,"kturned",670,"kuhiragana",12367,"kukatakana",12463,"kukatakanahalfwidth",65400,"kvsquare",13240,"kwsquare",13246,"l",108,"labengali",2482,"lacute",314,"ladeva",2354,"lagujarati",2738,"lagurmukhi",2610,"lakkhangyaothai",3653,"lamaleffinalarabic",65276,"lamalefhamzaabovefinalarabic",65272,"lamalefhamzaaboveisolatedarabic",65271,"lamalefhamzabelowfinalarabic",65274,"lamalefhamzabelowisolatedarabic",65273,"lamalefisolatedarabic",65275,"lamalefmaddaabovefinalarabic",65270,"lamalefmaddaaboveisolatedarabic",65269,"lamarabic",1604,"lambda",955,"lambdastroke",411,"lamed",1500,"lameddagesh",64316,"lameddageshhebrew",64316,"lamedhebrew",1500,"lamfinalarabic",65246,"lamhahinitialarabic",64714,"laminitialarabic",65247,"lamjeeminitialarabic",64713,"lamkhahinitialarabic",64715,"lamlamhehisolatedarabic",65010,"lammedialarabic",65248,"lammeemhahinitialarabic",64904,"lammeeminitialarabic",64716,"largecircle",9711,"lbar",410,"lbelt",620,"lbopomofo",12556,"lcaron",318,"lcedilla",316,"lcircle",9435,"lcircumflexbelow",7741,"lcommaaccent",316,"ldot",320,"ldotaccent",320,"ldotbelow",7735,"ldotbelowmacron",7737,"leftangleabovecmb",794,"lefttackbelowcmb",792,"less",60,"lessequal",8804,"lessequalorgreater",8922,"lessmonospace",65308,"lessorequivalent",8818,"lessorgreater",8822,"lessoverequal",8806,"lesssmall",65124,"lezh",622,"lfblock",9612,"lhookretroflex",621,"lira",8356,"liwnarmenian",1388,"lj",457,"ljecyrillic",1113,"ll",63168,"lladeva",2355,"llagujarati",2739,"llinebelow",7739,"llladeva",2356,"llvocalicbengali",2529,"llvocalicdeva",2401,"llvocalicvowelsignbengali",2531,"llvocalicvowelsigndeva",2403,"lmiddletilde",619,"lmonospace",65356,"lmsquare",13264,"lochulathai",3628,"logicaland",8743,"logicalnot",172,"logicalnotreversed",8976,"logicalor",8744,"lolingthai",3621,"longs",383,"lowlinecenterline",65102,"lowlinecmb",818,"lowlinedashed",65101,"lozenge",9674,"lparen",9383,"lslash",322,"lsquare",8467,"lsuperior",63214,"ltshade",9617,"luthai",3622,"lvocalicbengali",2444,"lvocalicdeva",2316,"lvocalicvowelsignbengali",2530,"lvocalicvowelsigndeva",2402,"lxsquare",13267,"m",109,"mabengali",2478,"macron",175,"macronbelowcmb",817,"macroncmb",772,"macronlowmod",717,"macronmonospace",65507,"macute",7743,"madeva",2350,"magujarati",2734,"magurmukhi",2606,"mahapakhhebrew",1444,"mahapakhlefthebrew",1444,"mahiragana",12414,"maichattawalowleftthai",63637,"maichattawalowrightthai",63636,"maichattawathai",3659,"maichattawaupperleftthai",63635,"maieklowleftthai",63628,"maieklowrightthai",63627,"maiekthai",3656,"maiekupperleftthai",63626,"maihanakatleftthai",63620,"maihanakatthai",3633,"maitaikhuleftthai",63625,"maitaikhuthai",3655,"maitholowleftthai",63631,"maitholowrightthai",63630,"maithothai",3657,"maithoupperleftthai",63629,"maitrilowleftthai",63634,"maitrilowrightthai",63633,"maitrithai",3658,"maitriupperleftthai",63632,"maiyamokthai",3654,"makatakana",12510,"makatakanahalfwidth",65423,"male",9794,"mansyonsquare",13127,"maqafhebrew",1470,"mars",9794,"masoracirclehebrew",1455,"masquare",13187,"mbopomofo",12551,"mbsquare",13268,"mcircle",9436,"mcubedsquare",13221,"mdotaccent",7745,"mdotbelow",7747,"meemarabic",1605,"meemfinalarabic",65250,"meeminitialarabic",65251,"meemmedialarabic",65252,"meemmeeminitialarabic",64721,"meemmeemisolatedarabic",64584,"meetorusquare",13133,"mehiragana",12417,"meizierasquare",13182,"mekatakana",12513,"mekatakanahalfwidth",65426,"mem",1502,"memdagesh",64318,"memdageshhebrew",64318,"memhebrew",1502,"menarmenian",1396,"merkhahebrew",1445,"merkhakefulahebrew",1446,"merkhakefulalefthebrew",1446,"merkhalefthebrew",1445,"mhook",625,"mhzsquare",13202,"middledotkatakanahalfwidth",65381,"middot",183,"mieumacirclekorean",12914,"mieumaparenkorean",12818,"mieumcirclekorean",12900,"mieumkorean",12609,"mieumpansioskorean",12656,"mieumparenkorean",12804,"mieumpieupkorean",12654,"mieumsioskorean",12655,"mihiragana",12415,"mikatakana",12511,"mikatakanahalfwidth",65424,"minus",8722,"minusbelowcmb",800,"minuscircle",8854,"minusmod",727,"minusplus",8723,"minute",8242,"miribaarusquare",13130,"mirisquare",13129,"mlonglegturned",624,"mlsquare",13206,"mmcubedsquare",13219,"mmonospace",65357,"mmsquaredsquare",13215,"mohiragana",12418,"mohmsquare",13249,"mokatakana",12514,"mokatakanahalfwidth",65427,"molsquare",13270,"momathai",3617,"moverssquare",13223,"moverssquaredsquare",13224,"mparen",9384,"mpasquare",13227,"mssquare",13235,"msuperior",63215,"mturned",623,"mu",181,"mu1",181,"muasquare",13186,"muchgreater",8811,"muchless",8810,"mufsquare",13196,"mugreek",956,"mugsquare",13197,"muhiragana",12416,"mukatakana",12512,"mukatakanahalfwidth",65425,"mulsquare",13205,"multiply",215,"mumsquare",13211,"munahhebrew",1443,"munahlefthebrew",1443,"musicalnote",9834,"musicalnotedbl",9835,"musicflatsign",9837,"musicsharpsign",9839,"mussquare",13234,"muvsquare",13238,"muwsquare",13244,"mvmegasquare",13241,"mvsquare",13239,"mwmegasquare",13247,"mwsquare",13245,"n",110,"nabengali",2472,"nabla",8711,"nacute",324,"nadeva",2344,"nagujarati",2728,"nagurmukhi",2600,"nahiragana",12394,"nakatakana",12490,"nakatakanahalfwidth",65413,"napostrophe",329,"nasquare",13185,"nbopomofo",12555,"nbspace",160,"ncaron",328,"ncedilla",326,"ncircle",9437,"ncircumflexbelow",7755,"ncommaaccent",326,"ndotaccent",7749,"ndotbelow",7751,"nehiragana",12397,"nekatakana",12493,"nekatakanahalfwidth",65416,"newsheqelsign",8362,"nfsquare",13195,"ngabengali",2457,"ngadeva",2329,"ngagujarati",2713,"ngagurmukhi",2585,"ngonguthai",3591,"nhiragana",12435,"nhookleft",626,"nhookretroflex",627,"nieunacirclekorean",12911,"nieunaparenkorean",12815,"nieuncieuckorean",12597,"nieuncirclekorean",12897,"nieunhieuhkorean",12598,"nieunkorean",12596,"nieunpansioskorean",12648,"nieunparenkorean",12801,"nieunsioskorean",12647,"nieuntikeutkorean",12646,"nihiragana",12395,"nikatakana",12491,"nikatakanahalfwidth",65414,"nikhahitleftthai",63641,"nikhahitthai",3661,"nine",57,"ninearabic",1641,"ninebengali",2543,"ninecircle",9320,"ninecircleinversesansserif",10130,"ninedeva",2415,"ninegujarati",2799,"ninegurmukhi",2671,"ninehackarabic",1641,"ninehangzhou",12329,"nineideographicparen",12840,"nineinferior",8329,"ninemonospace",65305,"nineoldstyle",63289,"nineparen",9340,"nineperiod",9360,"ninepersian",1785,"nineroman",8568,"ninesuperior",8313,"nineteencircle",9330,"nineteenparen",9350,"nineteenperiod",9370,"ninethai",3673,"nj",460,"njecyrillic",1114,"nkatakana",12531,"nkatakanahalfwidth",65437,"nlegrightlong",414,"nlinebelow",7753,"nmonospace",65358,"nmsquare",13210,"nnabengali",2467,"nnadeva",2339,"nnagujarati",2723,"nnagurmukhi",2595,"nnnadeva",2345,"nohiragana",12398,"nokatakana",12494,"nokatakanahalfwidth",65417,"nonbreakingspace",160,"nonenthai",3603,"nonuthai",3609,"noonarabic",1606,"noonfinalarabic",65254,"noonghunnaarabic",1722,"noonghunnafinalarabic",64415,"nooninitialarabic",65255,"noonjeeminitialarabic",64722,"noonjeemisolatedarabic",64587,"noonmedialarabic",65256,"noonmeeminitialarabic",64725,"noonmeemisolatedarabic",64590,"noonnoonfinalarabic",64653,"notcontains",8716,"notelement",8713,"notelementof",8713,"notequal",8800,"notgreater",8815,"notgreaternorequal",8817,"notgreaternorless",8825,"notidentical",8802,"notless",8814,"notlessnorequal",8816,"notparallel",8742,"notprecedes",8832,"notsubset",8836,"notsucceeds",8833,"notsuperset",8837,"nowarmenian",1398,"nparen",9385,"nssquare",13233,"nsuperior",8319,"ntilde",241,"nu",957,"nuhiragana",12396,"nukatakana",12492,"nukatakanahalfwidth",65415,"nuktabengali",2492,"nuktadeva",2364,"nuktagujarati",2748,"nuktagurmukhi",2620,"numbersign",35,"numbersignmonospace",65283,"numbersignsmall",65119,"numeralsigngreek",884,"numeralsignlowergreek",885,"numero",8470,"nun",1504,"nundagesh",64320,"nundageshhebrew",64320,"nunhebrew",1504,"nvsquare",13237,"nwsquare",13243,"nyabengali",2462,"nyadeva",2334,"nyagujarati",2718,"nyagurmukhi",2590,"o",111,"oacute",243,"oangthai",3629,"obarred",629,"obarredcyrillic",1257,"obarreddieresiscyrillic",1259,"obengali",2451,"obopomofo",12571,"obreve",335,"ocandradeva",2321,"ocandragujarati",2705,"ocandravowelsigndeva",2377,"ocandravowelsigngujarati",2761,"ocaron",466,"ocircle",9438,"ocircumflex",244,"ocircumflexacute",7889,"ocircumflexdotbelow",7897,"ocircumflexgrave",7891,"ocircumflexhookabove",7893,"ocircumflextilde",7895,"ocyrillic",1086,"odblacute",337,"odblgrave",525,"odeva",2323,"odieresis",246,"odieresiscyrillic",1255,"odotbelow",7885,"oe",339,"oekorean",12634,"ogonek",731,"ogonekcmb",808,"ograve",242,"ogujarati",2707,"oharmenian",1413,"ohiragana",12362,"ohookabove",7887,"ohorn",417,"ohornacute",7899,"ohorndotbelow",7907,"ohorngrave",7901,"ohornhookabove",7903,"ohorntilde",7905,"ohungarumlaut",337,"oi",419,"oinvertedbreve",527,"okatakana",12458,"okatakanahalfwidth",65397,"okorean",12631,"olehebrew",1451,"omacron",333,"omacronacute",7763,"omacrongrave",7761,"omdeva",2384,"omega",969,"omega1",982,"omegacyrillic",1121,"omegalatinclosed",631,"omegaroundcyrillic",1147,"omegatitlocyrillic",1149,"omegatonos",974,"omgujarati",2768,"omicron",959,"omicrontonos",972,"omonospace",65359,"one",49,"onearabic",1633,"onebengali",2535,"onecircle",9312,"onecircleinversesansserif",10122,"onedeva",2407,"onedotenleader",8228,"oneeighth",8539,"onefitted",63196,"onegujarati",2791,"onegurmukhi",2663,"onehackarabic",1633,"onehalf",189,"onehangzhou",12321,"oneideographicparen",12832,"oneinferior",8321,"onemonospace",65297,"onenumeratorbengali",2548,"oneoldstyle",63281,"oneparen",9332,"oneperiod",9352,"onepersian",1777,"onequarter",188,"oneroman",8560,"onesuperior",185,"onethai",3665,"onethird",8531,"oogonek",491,"oogonekmacron",493,"oogurmukhi",2579,"oomatragurmukhi",2635,"oopen",596,"oparen",9386,"openbullet",9702,"option",8997,"ordfeminine",170,"ordmasculine",186,"orthogonal",8735,"oshortdeva",2322,"oshortvowelsigndeva",2378,"oslash",248,"oslashacute",511,"osmallhiragana",12361,"osmallkatakana",12457,"osmallkatakanahalfwidth",65387,"ostrokeacute",511,"osuperior",63216,"otcyrillic",1151,"otilde",245,"otildeacute",7757,"otildedieresis",7759,"oubopomofo",12577,"overline",8254,"overlinecenterline",65098,"overlinecmb",773,"overlinedashed",65097,"overlinedblwavy",65100,"overlinewavy",65099,"overscore",175,"ovowelsignbengali",2507,"ovowelsigndeva",2379,"ovowelsigngujarati",2763,"p",112,"paampssquare",13184,"paasentosquare",13099,"pabengali",2474,"pacute",7765,"padeva",2346,"pagedown",8671,"pageup",8670,"pagujarati",2730,"pagurmukhi",2602,"pahiragana",12401,"paiyannoithai",3631,"pakatakana",12497,"palatalizationcyrilliccmb",1156,"palochkacyrillic",1216,"pansioskorean",12671,"paragraph",182,"parallel",8741,"parenleft",40,"parenleftaltonearabic",64830,"parenleftbt",63725,"parenleftex",63724,"parenleftinferior",8333,"parenleftmonospace",65288,"parenleftsmall",65113,"parenleftsuperior",8317,"parenlefttp",63723,"parenleftvertical",65077,"parenright",41,"parenrightaltonearabic",64831,"parenrightbt",63736,"parenrightex",63735,"parenrightinferior",8334,"parenrightmonospace",65289,"parenrightsmall",65114,"parenrightsuperior",8318,"parenrighttp",63734,"parenrightvertical",65078,"partialdiff",8706,"paseqhebrew",1472,"pashtahebrew",1433,"pasquare",13225,"patah",1463,"patah11",1463,"patah1d",1463,"patah2a",1463,"patahhebrew",1463,"patahnarrowhebrew",1463,"patahquarterhebrew",1463,"patahwidehebrew",1463,"pazerhebrew",1441,"pbopomofo",12550,"pcircle",9439,"pdotaccent",7767,"pe",1508,"pecyrillic",1087,"pedagesh",64324,"pedageshhebrew",64324,"peezisquare",13115,"pefinaldageshhebrew",64323,"peharabic",1662,"peharmenian",1402,"pehebrew",1508,"pehfinalarabic",64343,"pehinitialarabic",64344,"pehiragana",12410,"pehmedialarabic",64345,"pekatakana",12506,"pemiddlehookcyrillic",1191,"perafehebrew",64334,"percent",37,"percentarabic",1642,"percentmonospace",65285,"percentsmall",65130,"period",46,"periodarmenian",1417,"periodcentered",183,"periodhalfwidth",65377,"periodinferior",63207,"periodmonospace",65294,"periodsmall",65106,"periodsuperior",63208,"perispomenigreekcmb",834,"perpendicular",8869,"perthousand",8240,"peseta",8359,"pfsquare",13194,"phabengali",2475,"phadeva",2347,"phagujarati",2731,"phagurmukhi",2603,"phi",966,"phi1",981,"phieuphacirclekorean",12922,"phieuphaparenkorean",12826,"phieuphcirclekorean",12908,"phieuphkorean",12621,"phieuphparenkorean",12812,"philatin",632,"phinthuthai",3642,"phisymbolgreek",981,"phook",421,"phophanthai",3614,"phophungthai",3612,"phosamphaothai",3616,"pi",960,"pieupacirclekorean",12915,"pieupaparenkorean",12819,"pieupcieuckorean",12662,"pieupcirclekorean",12901,"pieupkiyeokkorean",12658,"pieupkorean",12610,"pieupparenkorean",12805,"pieupsioskiyeokkorean",12660,"pieupsioskorean",12612,"pieupsiostikeutkorean",12661,"pieupthieuthkorean",12663,"pieuptikeutkorean",12659,"pihiragana",12404,"pikatakana",12500,"pisymbolgreek",982,"piwrarmenian",1411,"plus",43,"plusbelowcmb",799,"pluscircle",8853,"plusminus",177,"plusmod",726,"plusmonospace",65291,"plussmall",65122,"plussuperior",8314,"pmonospace",65360,"pmsquare",13272,"pohiragana",12413,"pointingindexdownwhite",9759,"pointingindexleftwhite",9756,"pointingindexrightwhite",9758,"pointingindexupwhite",9757,"pokatakana",12509,"poplathai",3611,"postalmark",12306,"postalmarkface",12320,"pparen",9387,"precedes",8826,"prescription",8478,"primemod",697,"primereversed",8245,"product",8719,"projective",8965,"prolongedkana",12540,"propellor",8984,"propersubset",8834,"propersuperset",8835,"proportion",8759,"proportional",8733,"psi",968,"psicyrillic",1137,"psilipneumatacyrilliccmb",1158,"pssquare",13232,"puhiragana",12407,"pukatakana",12503,"pvsquare",13236,"pwsquare",13242,"q",113,"qadeva",2392,"qadmahebrew",1448,"qafarabic",1602,"qaffinalarabic",65238,"qafinitialarabic",65239,"qafmedialarabic",65240,"qamats",1464,"qamats10",1464,"qamats1a",1464,"qamats1c",1464,"qamats27",1464,"qamats29",1464,"qamats33",1464,"qamatsde",1464,"qamatshebrew",1464,"qamatsnarrowhebrew",1464,"qamatsqatanhebrew",1464,"qamatsqatannarrowhebrew",1464,"qamatsqatanquarterhebrew",1464,"qamatsqatanwidehebrew",1464,"qamatsquarterhebrew",1464,"qamatswidehebrew",1464,"qarneyparahebrew",1439,"qbopomofo",12561,"qcircle",9440,"qhook",672,"qmonospace",65361,"qof",1511,"qofdagesh",64327,"qofdageshhebrew",64327,"qofhebrew",1511,"qparen",9388,"quarternote",9833,"qubuts",1467,"qubuts18",1467,"qubuts25",1467,"qubuts31",1467,"qubutshebrew",1467,"qubutsnarrowhebrew",1467,"qubutsquarterhebrew",1467,"qubutswidehebrew",1467,"question",63,"questionarabic",1567,"questionarmenian",1374,"questiondown",191,"questiondownsmall",63423,"questiongreek",894,"questionmonospace",65311,"questionsmall",63295,"quotedbl",34,"quotedblbase",8222,"quotedblleft",8220,"quotedblmonospace",65282,"quotedblprime",12318,"quotedblprimereversed",12317,"quotedblright",8221,"quoteleft",8216,"quoteleftreversed",8219,"quotereversed",8219,"quoteright",8217,"quoterightn",329,"quotesinglbase",8218,"quotesingle",39,"quotesinglemonospace",65287,"r",114,"raarmenian",1404,"rabengali",2480,"racute",341,"radeva",2352,"radical",8730,"radicalex",63717,"radoverssquare",13230,"radoverssquaredsquare",13231,"radsquare",13229,"rafe",1471,"rafehebrew",1471,"ragujarati",2736,"ragurmukhi",2608,"rahiragana",12425,"rakatakana",12521,"rakatakanahalfwidth",65431,"ralowerdiagonalbengali",2545,"ramiddlediagonalbengali",2544,"ramshorn",612,"ratio",8758,"rbopomofo",12566,"rcaron",345,"rcedilla",343,"rcircle",9441,"rcommaaccent",343,"rdblgrave",529,"rdotaccent",7769,"rdotbelow",7771,"rdotbelowmacron",7773,"referencemark",8251,"reflexsubset",8838,"reflexsuperset",8839,"registered",174,"registersans",63720,"registerserif",63194,"reharabic",1585,"reharmenian",1408,"rehfinalarabic",65198,"rehiragana",12428,"rekatakana",12524,"rekatakanahalfwidth",65434,"resh",1512,"reshdageshhebrew",64328,"reshhebrew",1512,"reversedtilde",8765,"reviahebrew",1431,"reviamugrashhebrew",1431,"revlogicalnot",8976,"rfishhook",638,"rfishhookreversed",639,"rhabengali",2525,"rhadeva",2397,"rho",961,"rhook",637,"rhookturned",635,"rhookturnedsuperior",693,"rhosymbolgreek",1009,"rhotichookmod",734,"rieulacirclekorean",12913,"rieulaparenkorean",12817,"rieulcirclekorean",12899,"rieulhieuhkorean",12608,"rieulkiyeokkorean",12602,"rieulkiyeoksioskorean",12649,"rieulkorean",12601,"rieulmieumkorean",12603,"rieulpansioskorean",12652,"rieulparenkorean",12803,"rieulphieuphkorean",12607,"rieulpieupkorean",12604,"rieulpieupsioskorean",12651,"rieulsioskorean",12605,"rieulthieuthkorean",12606,"rieultikeutkorean",12650,"rieulyeorinhieuhkorean",12653,"rightangle",8735,"righttackbelowcmb",793,"righttriangle",8895,"rihiragana",12426,"rikatakana",12522,"rikatakanahalfwidth",65432,"ring",730,"ringbelowcmb",805,"ringcmb",778,"ringhalfleft",703,"ringhalfleftarmenian",1369,"ringhalfleftbelowcmb",796,"ringhalfleftcentered",723,"ringhalfright",702,"ringhalfrightbelowcmb",825,"ringhalfrightcentered",722,"rinvertedbreve",531,"rittorusquare",13137,"rlinebelow",7775,"rlongleg",636,"rlonglegturned",634,"rmonospace",65362,"rohiragana",12429,"rokatakana",12525,"rokatakanahalfwidth",65435,"roruathai",3619,"rparen",9389,"rrabengali",2524,"rradeva",2353,"rragurmukhi",2652,"rreharabic",1681,"rrehfinalarabic",64397,"rrvocalicbengali",2528,"rrvocalicdeva",2400,"rrvocalicgujarati",2784,"rrvocalicvowelsignbengali",2500,"rrvocalicvowelsigndeva",2372,"rrvocalicvowelsigngujarati",2756,"rsuperior",63217,"rtblock",9616,"rturned",633,"rturnedsuperior",692,"ruhiragana",12427,"rukatakana",12523,"rukatakanahalfwidth",65433,"rupeemarkbengali",2546,"rupeesignbengali",2547,"rupiah",63197,"ruthai",3620,"rvocalicbengali",2443,"rvocalicdeva",2315,"rvocalicgujarati",2699,"rvocalicvowelsignbengali",2499,"rvocalicvowelsigndeva",2371,"rvocalicvowelsigngujarati",2755,"s",115,"sabengali",2488,"sacute",347,"sacutedotaccent",7781,"sadarabic",1589,"sadeva",2360,"sadfinalarabic",65210,"sadinitialarabic",65211,"sadmedialarabic",65212,"sagujarati",2744,"sagurmukhi",2616,"sahiragana",12373,"sakatakana",12469,"sakatakanahalfwidth",65403,"sallallahoualayhewasallamarabic",65018,"samekh",1505,"samekhdagesh",64321,"samekhdageshhebrew",64321,"samekhhebrew",1505,"saraaathai",3634,"saraaethai",3649,"saraaimaimalaithai",3652,"saraaimaimuanthai",3651,"saraamthai",3635,"saraathai",3632,"saraethai",3648,"saraiileftthai",63622,"saraiithai",3637,"saraileftthai",63621,"saraithai",3636,"saraothai",3650,"saraueeleftthai",63624,"saraueethai",3639,"saraueleftthai",63623,"sarauethai",3638,"sarauthai",3640,"sarauuthai",3641,"sbopomofo",12569,"scaron",353,"scarondotaccent",7783,"scedilla",351,"schwa",601,"schwacyrillic",1241,"schwadieresiscyrillic",1243,"schwahook",602,"scircle",9442,"scircumflex",349,"scommaaccent",537,"sdotaccent",7777,"sdotbelow",7779,"sdotbelowdotaccent",7785,"seagullbelowcmb",828,"second",8243,"secondtonechinese",714,"section",167,"seenarabic",1587,"seenfinalarabic",65202,"seeninitialarabic",65203,"seenmedialarabic",65204,"segol",1462,"segol13",1462,"segol1f",1462,"segol2c",1462,"segolhebrew",1462,"segolnarrowhebrew",1462,"segolquarterhebrew",1462,"segoltahebrew",1426,"segolwidehebrew",1462,"seharmenian",1405,"sehiragana",12379,"sekatakana",12475,"sekatakanahalfwidth",65406,"semicolon",59,"semicolonarabic",1563,"semicolonmonospace",65307,"semicolonsmall",65108,"semivoicedmarkkana",12444,"semivoicedmarkkanahalfwidth",65439,"sentisquare",13090,"sentosquare",13091,"seven",55,"sevenarabic",1639,"sevenbengali",2541,"sevencircle",9318,"sevencircleinversesansserif",10128,"sevendeva",2413,"seveneighths",8542,"sevengujarati",2797,"sevengurmukhi",2669,"sevenhackarabic",1639,"sevenhangzhou",12327,"sevenideographicparen",12838,"seveninferior",8327,"sevenmonospace",65303,"sevenoldstyle",63287,"sevenparen",9338,"sevenperiod",9358,"sevenpersian",1783,"sevenroman",8566,"sevensuperior",8311,"seventeencircle",9328,"seventeenparen",9348,"seventeenperiod",9368,"seventhai",3671,"sfthyphen",173,"shaarmenian",1399,"shabengali",2486,"shacyrillic",1096,"shaddaarabic",1617,"shaddadammaarabic",64609,"shaddadammatanarabic",64606,"shaddafathaarabic",64608,"shaddakasraarabic",64610,"shaddakasratanarabic",64607,"shade",9618,"shadedark",9619,"shadelight",9617,"shademedium",9618,"shadeva",2358,"shagujarati",2742,"shagurmukhi",2614,"shalshelethebrew",1427,"shbopomofo",12565,"shchacyrillic",1097,"sheenarabic",1588,"sheenfinalarabic",65206,"sheeninitialarabic",65207,"sheenmedialarabic",65208,"sheicoptic",995,"sheqel",8362,"sheqelhebrew",8362,"sheva",1456,"sheva115",1456,"sheva15",1456,"sheva22",1456,"sheva2e",1456,"shevahebrew",1456,"shevanarrowhebrew",1456,"shevaquarterhebrew",1456,"shevawidehebrew",1456,"shhacyrillic",1211,"shimacoptic",1005,"shin",1513,"shindagesh",64329,"shindageshhebrew",64329,"shindageshshindot",64300,"shindageshshindothebrew",64300,"shindageshsindot",64301,"shindageshsindothebrew",64301,"shindothebrew",1473,"shinhebrew",1513,"shinshindot",64298,"shinshindothebrew",64298,"shinsindot",64299,"shinsindothebrew",64299,"shook",642,"sigma",963,"sigma1",962,"sigmafinal",962,"sigmalunatesymbolgreek",1010,"sihiragana",12375,"sikatakana",12471,"sikatakanahalfwidth",65404,"siluqhebrew",1469,"siluqlefthebrew",1469,"similar",8764,"sindothebrew",1474,"siosacirclekorean",12916,"siosaparenkorean",12820,"sioscieuckorean",12670,"sioscirclekorean",12902,"sioskiyeokkorean",12666,"sioskorean",12613,"siosnieunkorean",12667,"siosparenkorean",12806,"siospieupkorean",12669,"siostikeutkorean",12668,"six",54,"sixarabic",1638,"sixbengali",2540,"sixcircle",9317,"sixcircleinversesansserif",10127,"sixdeva",2412,"sixgujarati",2796,"sixgurmukhi",2668,"sixhackarabic",1638,"sixhangzhou",12326,"sixideographicparen",12837,"sixinferior",8326,"sixmonospace",65302,"sixoldstyle",63286,"sixparen",9337,"sixperiod",9357,"sixpersian",1782,"sixroman",8565,"sixsuperior",8310,"sixteencircle",9327,"sixteencurrencydenominatorbengali",2553,"sixteenparen",9347,"sixteenperiod",9367,"sixthai",3670,"slash",47,"slashmonospace",65295,"slong",383,"slongdotaccent",7835,"smileface",9786,"smonospace",65363,"sofpasuqhebrew",1475,"softhyphen",173,"softsigncyrillic",1100,"sohiragana",12381,"sokatakana",12477,"sokatakanahalfwidth",65407,"soliduslongoverlaycmb",824,"solidusshortoverlaycmb",823,"sorusithai",3625,"sosalathai",3624,"sosothai",3595,"sosuathai",3626,"space",32,"spacehackarabic",32,"spade",9824,"spadesuitblack",9824,"spadesuitwhite",9828,"sparen",9390,"squarebelowcmb",827,"squarecc",13252,"squarecm",13213,"squarediagonalcrosshatchfill",9641,"squarehorizontalfill",9636,"squarekg",13199,"squarekm",13214,"squarekmcapital",13262,"squareln",13265,"squarelog",13266,"squaremg",13198,"squaremil",13269,"squaremm",13212,"squaremsquared",13217,"squareorthogonalcrosshatchfill",9638,"squareupperlefttolowerrightfill",9639,"squareupperrighttolowerleftfill",9640,"squareverticalfill",9637,"squarewhitewithsmallblack",9635,"srsquare",13275,"ssabengali",2487,"ssadeva",2359,"ssagujarati",2743,"ssangcieuckorean",12617,"ssanghieuhkorean",12677,"ssangieungkorean",12672,"ssangkiyeokkorean",12594,"ssangnieunkorean",12645,"ssangpieupkorean",12611,"ssangsioskorean",12614,"ssangtikeutkorean",12600,"ssuperior",63218,"sterling",163,"sterlingmonospace",65505,"strokelongoverlaycmb",822,"strokeshortoverlaycmb",821,"subset",8834,"subsetnotequal",8842,"subsetorequal",8838,"succeeds",8827,"suchthat",8715,"suhiragana",12377,"sukatakana",12473,"sukatakanahalfwidth",65405,"sukunarabic",1618,"summation",8721,"sun",9788,"superset",8835,"supersetnotequal",8843,"supersetorequal",8839,"svsquare",13276,"syouwaerasquare",13180,"t",116,"tabengali",2468,"tackdown",8868,"tackleft",8867,"tadeva",2340,"tagujarati",2724,"tagurmukhi",2596,"taharabic",1591,"tahfinalarabic",65218,"tahinitialarabic",65219,"tahiragana",12383,"tahmedialarabic",65220,"taisyouerasquare",13181,"takatakana",12479,"takatakanahalfwidth",65408,"tatweelarabic",1600,"tau",964,"tav",1514,"tavdages",64330,"tavdagesh",64330,"tavdageshhebrew",64330,"tavhebrew",1514,"tbar",359,"tbopomofo",12554,"tcaron",357,"tccurl",680,"tcedilla",355,"tcheharabic",1670,"tchehfinalarabic",64379,"tchehinitialarabic",64380,"tchehmedialarabic",64381,"tcircle",9443,"tcircumflexbelow",7793,"tcommaaccent",355,"tdieresis",7831,"tdotaccent",7787,"tdotbelow",7789,"tecyrillic",1090,"tedescendercyrillic",1197,"teharabic",1578,"tehfinalarabic",65174,"tehhahinitialarabic",64674,"tehhahisolatedarabic",64524,"tehinitialarabic",65175,"tehiragana",12390,"tehjeeminitialarabic",64673,"tehjeemisolatedarabic",64523,"tehmarbutaarabic",1577,"tehmarbutafinalarabic",65172,"tehmedialarabic",65176,"tehmeeminitialarabic",64676,"tehmeemisolatedarabic",64526,"tehnoonfinalarabic",64627,"tekatakana",12486,"tekatakanahalfwidth",65411,"telephone",8481,"telephoneblack",9742,"telishagedolahebrew",1440,"telishaqetanahebrew",1449,"tencircle",9321,"tenideographicparen",12841,"tenparen",9341,"tenperiod",9361,"tenroman",8569,"tesh",679,"tet",1496,"tetdagesh",64312,"tetdageshhebrew",64312,"tethebrew",1496,"tetsecyrillic",1205,"tevirhebrew",1435,"tevirlefthebrew",1435,"thabengali",2469,"thadeva",2341,"thagujarati",2725,"thagurmukhi",2597,"thalarabic",1584,"thalfinalarabic",65196,"thanthakhatlowleftthai",63640,"thanthakhatlowrightthai",63639,"thanthakhatthai",3660,"thanthakhatupperleftthai",63638,"theharabic",1579,"thehfinalarabic",65178,"thehinitialarabic",65179,"thehmedialarabic",65180,"thereexists",8707,"therefore",8756,"theta",952,"theta1",977,"thetasymbolgreek",977,"thieuthacirclekorean",12921,"thieuthaparenkorean",12825,"thieuthcirclekorean",12907,"thieuthkorean",12620,"thieuthparenkorean",12811,"thirteencircle",9324,"thirteenparen",9344,"thirteenperiod",9364,"thonangmonthothai",3601,"thook",429,"thophuthaothai",3602,"thorn",254,"thothahanthai",3607,"thothanthai",3600,"thothongthai",3608,"thothungthai",3606,"thousandcyrillic",1154,"thousandsseparatorarabic",1644,"thousandsseparatorpersian",1644,"three",51,"threearabic",1635,"threebengali",2537,"threecircle",9314,"threecircleinversesansserif",10124,"threedeva",2409,"threeeighths",8540,"threegujarati",2793,"threegurmukhi",2665,"threehackarabic",1635,"threehangzhou",12323,"threeideographicparen",12834,"threeinferior",8323,"threemonospace",65299,"threenumeratorbengali",2550,"threeoldstyle",63283,"threeparen",9334,"threeperiod",9354,"threepersian",1779,"threequarters",190,"threequartersemdash",63198,"threeroman",8562,"threesuperior",179,"threethai",3667,"thzsquare",13204,"tihiragana",12385,"tikatakana",12481,"tikatakanahalfwidth",65409,"tikeutacirclekorean",12912,"tikeutaparenkorean",12816,"tikeutcirclekorean",12898,"tikeutkorean",12599,"tikeutparenkorean",12802,"tilde",732,"tildebelowcmb",816,"tildecmb",771,"tildecomb",771,"tildedoublecmb",864,"tildeoperator",8764,"tildeoverlaycmb",820,"tildeverticalcmb",830,"timescircle",8855,"tipehahebrew",1430,"tipehalefthebrew",1430,"tippigurmukhi",2672,"titlocyrilliccmb",1155,"tiwnarmenian",1407,"tlinebelow",7791,"tmonospace",65364,"toarmenian",1385,"tohiragana",12392,"tokatakana",12488,"tokatakanahalfwidth",65412,"tonebarextrahighmod",741,"tonebarextralowmod",745,"tonebarhighmod",742,"tonebarlowmod",744,"tonebarmidmod",743,"tonefive",445,"tonesix",389,"tonetwo",424,"tonos",900,"tonsquare",13095,"topatakthai",3599,"tortoiseshellbracketleft",12308,"tortoiseshellbracketleftsmall",65117,"tortoiseshellbracketleftvertical",65081,"tortoiseshellbracketright",12309,"tortoiseshellbracketrightsmall",65118,"tortoiseshellbracketrightvertical",65082,"totaothai",3605,"tpalatalhook",427,"tparen",9391,"trademark",8482,"trademarksans",63722,"trademarkserif",63195,"tretroflexhook",648,"triagdn",9660,"triaglf",9668,"triagrt",9658,"triagup",9650,"ts",678,"tsadi",1510,"tsadidagesh",64326,"tsadidageshhebrew",64326,"tsadihebrew",1510,"tsecyrillic",1094,"tsere",1461,"tsere12",1461,"tsere1e",1461,"tsere2b",1461,"tserehebrew",1461,"tserenarrowhebrew",1461,"tserequarterhebrew",1461,"tserewidehebrew",1461,"tshecyrillic",1115,"tsuperior",63219,"ttabengali",2463,"ttadeva",2335,"ttagujarati",2719,"ttagurmukhi",2591,"tteharabic",1657,"ttehfinalarabic",64359,"ttehinitialarabic",64360,"ttehmedialarabic",64361,"tthabengali",2464,"tthadeva",2336,"tthagujarati",2720,"tthagurmukhi",2592,"tturned",647,"tuhiragana",12388,"tukatakana",12484,"tukatakanahalfwidth",65410,"tusmallhiragana",12387,"tusmallkatakana",12483,"tusmallkatakanahalfwidth",65391,"twelvecircle",9323,"twelveparen",9343,"twelveperiod",9363,"twelveroman",8571,"twentycircle",9331,"twentyhangzhou",21316,"twentyparen",9351,"twentyperiod",9371,"two",50,"twoarabic",1634,"twobengali",2536,"twocircle",9313,"twocircleinversesansserif",10123,"twodeva",2408,"twodotenleader",8229,"twodotleader",8229,"twodotleadervertical",65072,"twogujarati",2792,"twogurmukhi",2664,"twohackarabic",1634,"twohangzhou",12322,"twoideographicparen",12833,"twoinferior",8322,"twomonospace",65298,"twonumeratorbengali",2549,"twooldstyle",63282,"twoparen",9333,"twoperiod",9353,"twopersian",1778,"tworoman",8561,"twostroke",443,"twosuperior",178,"twothai",3666,"twothirds",8532,"u",117,"uacute",250,"ubar",649,"ubengali",2441,"ubopomofo",12584,"ubreve",365,"ucaron",468,"ucircle",9444,"ucircumflex",251,"ucircumflexbelow",7799,"ucyrillic",1091,"udattadeva",2385,"udblacute",369,"udblgrave",533,"udeva",2313,"udieresis",252,"udieresisacute",472,"udieresisbelow",7795,"udieresiscaron",474,"udieresiscyrillic",1265,"udieresisgrave",476,"udieresismacron",470,"udotbelow",7909,"ugrave",249,"ugujarati",2697,"ugurmukhi",2569,"uhiragana",12358,"uhookabove",7911,"uhorn",432,"uhornacute",7913,"uhorndotbelow",7921,"uhorngrave",7915,"uhornhookabove",7917,"uhorntilde",7919,"uhungarumlaut",369,"uhungarumlautcyrillic",1267,"uinvertedbreve",535,"ukatakana",12454,"ukatakanahalfwidth",65395,"ukcyrillic",1145,"ukorean",12636,"umacron",363,"umacroncyrillic",1263,"umacrondieresis",7803,"umatragurmukhi",2625,"umonospace",65365,"underscore",95,"underscoredbl",8215,"underscoremonospace",65343,"underscorevertical",65075,"underscorewavy",65103,"union",8746,"universal",8704,"uogonek",371,"uparen",9392,"upblock",9600,"upperdothebrew",1476,"upsilon",965,"upsilondieresis",971,"upsilondieresistonos",944,"upsilonlatin",650,"upsilontonos",973,"uptackbelowcmb",797,"uptackmod",724,"uragurmukhi",2675,"uring",367,"ushortcyrillic",1118,"usmallhiragana",12357,"usmallkatakana",12453,"usmallkatakanahalfwidth",65385,"ustraightcyrillic",1199,"ustraightstrokecyrillic",1201,"utilde",361,"utildeacute",7801,"utildebelow",7797,"uubengali",2442,"uudeva",2314,"uugujarati",2698,"uugurmukhi",2570,"uumatragurmukhi",2626,"uuvowelsignbengali",2498,"uuvowelsigndeva",2370,"uuvowelsigngujarati",2754,"uvowelsignbengali",2497,"uvowelsigndeva",2369,"uvowelsigngujarati",2753,"v",118,"vadeva",2357,"vagujarati",2741,"vagurmukhi",2613,"vakatakana",12535,"vav",1493,"vavdagesh",64309,"vavdagesh65",64309,"vavdageshhebrew",64309,"vavhebrew",1493,"vavholam",64331,"vavholamhebrew",64331,"vavvavhebrew",1520,"vavyodhebrew",1521,"vcircle",9445,"vdotbelow",7807,"vecyrillic",1074,"veharabic",1700,"vehfinalarabic",64363,"vehinitialarabic",64364,"vehmedialarabic",64365,"vekatakana",12537,"venus",9792,"verticalbar",124,"verticallineabovecmb",781,"verticallinebelowcmb",809,"verticallinelowmod",716,"verticallinemod",712,"vewarmenian",1406,"vhook",651,"vikatakana",12536,"viramabengali",2509,"viramadeva",2381,"viramagujarati",2765,"visargabengali",2435,"visargadeva",2307,"visargagujarati",2691,"vmonospace",65366,"voarmenian",1400,"voicediterationhiragana",12446,"voicediterationkatakana",12542,"voicedmarkkana",12443,"voicedmarkkanahalfwidth",65438,"vokatakana",12538,"vparen",9393,"vtilde",7805,"vturned",652,"vuhiragana",12436,"vukatakana",12532,"w",119,"wacute",7811,"waekorean",12633,"wahiragana",12431,"wakatakana",12527,"wakatakanahalfwidth",65436,"wakorean",12632,"wasmallhiragana",12430,"wasmallkatakana",12526,"wattosquare",13143,"wavedash",12316,"wavyunderscorevertical",65076,"wawarabic",1608,"wawfinalarabic",65262,"wawhamzaabovearabic",1572,"wawhamzaabovefinalarabic",65158,"wbsquare",13277,"wcircle",9446,"wcircumflex",373,"wdieresis",7813,"wdotaccent",7815,"wdotbelow",7817,"wehiragana",12433,"weierstrass",8472,"wekatakana",12529,"wekorean",12638,"weokorean",12637,"wgrave",7809,"whitebullet",9702,"whitecircle",9675,"whitecircleinverse",9689,"whitecornerbracketleft",12302,"whitecornerbracketleftvertical",65091,"whitecornerbracketright",12303,"whitecornerbracketrightvertical",65092,"whitediamond",9671,"whitediamondcontainingblacksmalldiamond",9672,"whitedownpointingsmalltriangle",9663,"whitedownpointingtriangle",9661,"whiteleftpointingsmalltriangle",9667,"whiteleftpointingtriangle",9665,"whitelenticularbracketleft",12310,"whitelenticularbracketright",12311,"whiterightpointingsmalltriangle",9657,"whiterightpointingtriangle",9655,"whitesmallsquare",9643,"whitesmilingface",9786,"whitesquare",9633,"whitestar",9734,"whitetelephone",9743,"whitetortoiseshellbracketleft",12312,"whitetortoiseshellbracketright",12313,"whiteuppointingsmalltriangle",9653,"whiteuppointingtriangle",9651,"wihiragana",12432,"wikatakana",12528,"wikorean",12639,"wmonospace",65367,"wohiragana",12434,"wokatakana",12530,"wokatakanahalfwidth",65382,"won",8361,"wonmonospace",65510,"wowaenthai",3623,"wparen",9394,"wring",7832,"wsuperior",695,"wturned",653,"wynn",447,"x",120,"xabovecmb",829,"xbopomofo",12562,"xcircle",9447,"xdieresis",7821,"xdotaccent",7819,"xeharmenian",1389,"xi",958,"xmonospace",65368,"xparen",9395,"xsuperior",739,"y",121,"yaadosquare",13134,"yabengali",2479,"yacute",253,"yadeva",2351,"yaekorean",12626,"yagujarati",2735,"yagurmukhi",2607,"yahiragana",12420,"yakatakana",12516,"yakatakanahalfwidth",65428,"yakorean",12625,"yamakkanthai",3662,"yasmallhiragana",12419,"yasmallkatakana",12515,"yasmallkatakanahalfwidth",65388,"yatcyrillic",1123,"ycircle",9448,"ycircumflex",375,"ydieresis",255,"ydotaccent",7823,"ydotbelow",7925,"yeharabic",1610,"yehbarreearabic",1746,"yehbarreefinalarabic",64431,"yehfinalarabic",65266,"yehhamzaabovearabic",1574,"yehhamzaabovefinalarabic",65162,"yehhamzaaboveinitialarabic",65163,"yehhamzaabovemedialarabic",65164,"yehinitialarabic",65267,"yehmedialarabic",65268,"yehmeeminitialarabic",64733,"yehmeemisolatedarabic",64600,"yehnoonfinalarabic",64660,"yehthreedotsbelowarabic",1745,"yekorean",12630,"yen",165,"yenmonospace",65509,"yeokorean",12629,"yeorinhieuhkorean",12678,"yerahbenyomohebrew",1450,"yerahbenyomolefthebrew",1450,"yericyrillic",1099,"yerudieresiscyrillic",1273,"yesieungkorean",12673,"yesieungpansioskorean",12675,"yesieungsioskorean",12674,"yetivhebrew",1434,"ygrave",7923,"yhook",436,"yhookabove",7927,"yiarmenian",1397,"yicyrillic",1111,"yikorean",12642,"yinyang",9775,"yiwnarmenian",1410,"ymonospace",65369,"yod",1497,"yoddagesh",64313,"yoddageshhebrew",64313,"yodhebrew",1497,"yodyodhebrew",1522,"yodyodpatahhebrew",64287,"yohiragana",12424,"yoikorean",12681,"yokatakana",12520,"yokatakanahalfwidth",65430,"yokorean",12635,"yosmallhiragana",12423,"yosmallkatakana",12519,"yosmallkatakanahalfwidth",65390,"yotgreek",1011,"yoyaekorean",12680,"yoyakorean",12679,"yoyakthai",3618,"yoyingthai",3597,"yparen",9396,"ypogegrammeni",890,"ypogegrammenigreekcmb",837,"yr",422,"yring",7833,"ysuperior",696,"ytilde",7929,"yturned",654,"yuhiragana",12422,"yuikorean",12684,"yukatakana",12518,"yukatakanahalfwidth",65429,"yukorean",12640,"yusbigcyrillic",1131,"yusbigiotifiedcyrillic",1133,"yuslittlecyrillic",1127,"yuslittleiotifiedcyrillic",1129,"yusmallhiragana",12421,"yusmallkatakana",12517,"yusmallkatakanahalfwidth",65389,"yuyekorean",12683,"yuyeokorean",12682,"yyabengali",2527,"yyadeva",2399,"z",122,"zaarmenian",1382,"zacute",378,"zadeva",2395,"zagurmukhi",2651,"zaharabic",1592,"zahfinalarabic",65222,"zahinitialarabic",65223,"zahiragana",12374,"zahmedialarabic",65224,"zainarabic",1586,"zainfinalarabic",65200,"zakatakana",12470,"zaqefgadolhebrew",1429,"zaqefqatanhebrew",1428,"zarqahebrew",1432,"zayin",1494,"zayindagesh",64310,"zayindageshhebrew",64310,"zayinhebrew",1494,"zbopomofo",12567,"zcaron",382,"zcircle",9449,"zcircumflex",7825,"zcurl",657,"zdot",380,"zdotaccent",380,"zdotbelow",7827,"zecyrillic",1079,"zedescendercyrillic",1177,"zedieresiscyrillic",1247,"zehiragana",12380,"zekatakana",12476,"zero",48,"zeroarabic",1632,"zerobengali",2534,"zerodeva",2406,"zerogujarati",2790,"zerogurmukhi",2662,"zerohackarabic",1632,"zeroinferior",8320,"zeromonospace",65296,"zerooldstyle",63280,"zeropersian",1776,"zerosuperior",8304,"zerothai",3664,"zerowidthjoiner",65279,"zerowidthnonjoiner",8204,"zerowidthspace",8203,"zeta",950,"zhbopomofo",12563,"zhearmenian",1386,"zhebrevecyrillic",1218,"zhecyrillic",1078,"zhedescendercyrillic",1175,"zhedieresiscyrillic",1245,"zihiragana",12376,"zikatakana",12472,"zinorhebrew",1454,"zlinebelow",7829,"zmonospace",65370,"zohiragana",12382,"zokatakana",12478,"zparen",9397,"zretroflexhook",656,"zstroke",438,"zuhiragana",12378,"zukatakana",12474,".notdef",0,"angbracketleftbig",9001,"angbracketleftBig",9001,"angbracketleftbigg",9001,"angbracketleftBigg",9001,"angbracketrightBig",9002,"angbracketrightbig",9002,"angbracketrightBigg",9002,"angbracketrightbigg",9002,"arrowhookleft",8618,"arrowhookright",8617,"arrowlefttophalf",8636,"arrowleftbothalf",8637,"arrownortheast",8599,"arrownorthwest",8598,"arrowrighttophalf",8640,"arrowrightbothalf",8641,"arrowsoutheast",8600,"arrowsouthwest",8601,"backslashbig",8726,"backslashBig",8726,"backslashBigg",8726,"backslashbigg",8726,"bardbl",8214,"bracehtipdownleft",65079,"bracehtipdownright",65079,"bracehtipupleft",65080,"bracehtipupright",65080,"braceleftBig",123,"braceleftbig",123,"braceleftbigg",123,"braceleftBigg",123,"bracerightBig",125,"bracerightbig",125,"bracerightbigg",125,"bracerightBigg",125,"bracketleftbig",91,"bracketleftBig",91,"bracketleftbigg",91,"bracketleftBigg",91,"bracketrightBig",93,"bracketrightbig",93,"bracketrightbigg",93,"bracketrightBigg",93,"ceilingleftbig",8968,"ceilingleftBig",8968,"ceilingleftBigg",8968,"ceilingleftbigg",8968,"ceilingrightbig",8969,"ceilingrightBig",8969,"ceilingrightbigg",8969,"ceilingrightBigg",8969,"circledotdisplay",8857,"circledottext",8857,"circlemultiplydisplay",8855,"circlemultiplytext",8855,"circleplusdisplay",8853,"circleplustext",8853,"contintegraldisplay",8750,"contintegraltext",8750,"coproductdisplay",8720,"coproducttext",8720,"floorleftBig",8970,"floorleftbig",8970,"floorleftbigg",8970,"floorleftBigg",8970,"floorrightbig",8971,"floorrightBig",8971,"floorrightBigg",8971,"floorrightbigg",8971,"hatwide",770,"hatwider",770,"hatwidest",770,"intercal",7488,"integraldisplay",8747,"integraltext",8747,"intersectiondisplay",8898,"intersectiontext",8898,"logicalanddisplay",8743,"logicalandtext",8743,"logicalordisplay",8744,"logicalortext",8744,"parenleftBig",40,"parenleftbig",40,"parenleftBigg",40,"parenleftbigg",40,"parenrightBig",41,"parenrightbig",41,"parenrightBigg",41,"parenrightbigg",41,"prime",8242,"productdisplay",8719,"producttext",8719,"radicalbig",8730,"radicalBig",8730,"radicalBigg",8730,"radicalbigg",8730,"radicalbt",8730,"radicaltp",8730,"radicalvertex",8730,"slashbig",47,"slashBig",47,"slashBigg",47,"slashbigg",47,"summationdisplay",8721,"summationtext",8721,"tildewide",732,"tildewider",732,"tildewidest",732,"uniondisplay",8899,"unionmultidisplay",8846,"unionmultitext",8846,"unionsqdisplay",8852,"unionsqtext",8852,"uniontext",8899,"vextenddouble",8741,"vextendsingle",8739]})),u=(0,c.getArrayLookupTableFactory)((function(){return["space",32,"a1",9985,"a2",9986,"a202",9987,"a3",9988,"a4",9742,"a5",9990,"a119",9991,"a118",9992,"a117",9993,"a11",9755,"a12",9758,"a13",9996,"a14",9997,"a15",9998,"a16",9999,"a105",1e4,"a17",10001,"a18",10002,"a19",10003,"a20",10004,"a21",10005,"a22",10006,"a23",10007,"a24",10008,"a25",10009,"a26",10010,"a27",10011,"a28",10012,"a6",10013,"a7",10014,"a8",10015,"a9",10016,"a10",10017,"a29",10018,"a30",10019,"a31",10020,"a32",10021,"a33",10022,"a34",10023,"a35",9733,"a36",10025,"a37",10026,"a38",10027,"a39",10028,"a40",10029,"a41",10030,"a42",10031,"a43",10032,"a44",10033,"a45",10034,"a46",10035,"a47",10036,"a48",10037,"a49",10038,"a50",10039,"a51",10040,"a52",10041,"a53",10042,"a54",10043,"a55",10044,"a56",10045,"a57",10046,"a58",10047,"a59",10048,"a60",10049,"a61",10050,"a62",10051,"a63",10052,"a64",10053,"a65",10054,"a66",10055,"a67",10056,"a68",10057,"a69",10058,"a70",10059,"a71",9679,"a72",10061,"a73",9632,"a74",10063,"a203",10064,"a75",10065,"a204",10066,"a76",9650,"a77",9660,"a78",9670,"a79",10070,"a81",9687,"a82",10072,"a83",10073,"a84",10074,"a97",10075,"a98",10076,"a99",10077,"a100",10078,"a101",10081,"a102",10082,"a103",10083,"a104",10084,"a106",10085,"a107",10086,"a108",10087,"a112",9827,"a111",9830,"a110",9829,"a109",9824,"a120",9312,"a121",9313,"a122",9314,"a123",9315,"a124",9316,"a125",9317,"a126",9318,"a127",9319,"a128",9320,"a129",9321,"a130",10102,"a131",10103,"a132",10104,"a133",10105,"a134",10106,"a135",10107,"a136",10108,"a137",10109,"a138",10110,"a139",10111,"a140",10112,"a141",10113,"a142",10114,"a143",10115,"a144",10116,"a145",10117,"a146",10118,"a147",10119,"a148",10120,"a149",10121,"a150",10122,"a151",10123,"a152",10124,"a153",10125,"a154",10126,"a155",10127,"a156",10128,"a157",10129,"a158",10130,"a159",10131,"a160",10132,"a161",8594,"a163",8596,"a164",8597,"a196",10136,"a165",10137,"a192",10138,"a166",10139,"a167",10140,"a168",10141,"a169",10142,"a170",10143,"a171",10144,"a172",10145,"a173",10146,"a162",10147,"a174",10148,"a175",10149,"a176",10150,"a177",10151,"a178",10152,"a179",10153,"a193",10154,"a180",10155,"a199",10156,"a181",10157,"a200",10158,"a182",10159,"a201",10161,"a183",10162,"a184",10163,"a197",10164,"a185",10165,"a194",10166,"a198",10167,"a186",10168,"a195",10169,"a187",10170,"a188",10171,"a189",10172,"a190",10173,"a191",10174,"a89",10088,"a90",10089,"a93",10090,"a94",10091,"a91",10092,"a92",10093,"a205",10094,"a85",10095,"a206",10096,"a86",10097,"a87",10098,"a88",10099,"a95",10100,"a96",10101,".notdef",0]}))},(t,r,o)=>{"use strict";o.r(r);o.d(r,{clearUnicodeCaches:()=>clearUnicodeCaches,getCharUnicodeCategory:()=>getCharUnicodeCategory,getNormalizedUnicodes:()=>h,getUnicodeForGlyph:()=>getUnicodeForGlyph,getUnicodeRangeFor:()=>getUnicodeRangeFor,mapSpecialUnicodeValues:()=>mapSpecialUnicodeValues,reverseIfRtl:()=>reverseIfRtl});var c=o(149);const l=(0,c.getLookupTableFactory)((function(t){t[63721]=169;t[63193]=169;t[63720]=174;t[63194]=174;t[63722]=8482;t[63195]=8482;t[63729]=9127;t[63730]=9128;t[63731]=9129;t[63740]=9131;t[63741]=9132;t[63742]=9133;t[63726]=9121;t[63727]=9122;t[63728]=9123;t[63737]=9124;t[63738]=9125;t[63739]=9126;t[63723]=9115;t[63724]=9116;t[63725]=9117;t[63734]=9118;t[63735]=9119;t[63736]=9120}));function mapSpecialUnicodeValues(t){return t>=65520&&t<=65535?0:t>=62976&&t<=63743?l()[t]||t:173===t?45:t}function getUnicodeForGlyph(t,r){let o=r[t];if(void 0!==o)return o;if(!t)return-1;if("u"===t[0]){const r=t.length;let c;if(7===r&&"n"===t[1]&&"i"===t[2])c=t.substring(3);else{if(!(r>=5&&r<=7))return-1;c=t.substring(1)}if(c===c.toUpperCase()){o=parseInt(c,16);if(o>=0)return o}}return-1}const u=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function getUnicodeRangeFor(t){for(let r=0,o=u.length;r<o;r++){const o=u[r];if(t>=o.begin&&t<o.end)return r}return-1}const h=(0,c.getArrayLookupTableFactory)((function(){return["¨"," ̈","¯"," ̄","´"," ́","µ","μ","¸"," ̧","IJ","IJ","ij","ij","Ŀ","L·","ŀ","l·","ʼn","ʼn","ſ","s","DŽ","DŽ","Dž","Dž","dž","dž","LJ","LJ","Lj","Lj","lj","lj","NJ","NJ","Nj","Nj","nj","nj","DZ","DZ","Dz","Dz","dz","dz","˘"," ̆","˙"," ̇","˚"," ̊","˛"," ̨","˜"," ̃","˝"," ̋","ͺ"," ͅ","΄"," ́","ϐ","β","ϑ","θ","ϒ","Υ","ϕ","φ","ϖ","π","ϰ","κ","ϱ","ρ","ϲ","ς","ϴ","Θ","ϵ","ε","Ϲ","Σ","և","եւ","ٵ","اٴ","ٶ","وٴ","ٷ","ۇٴ","ٸ","يٴ","ำ","ํา","ຳ","ໍາ","ໜ","ຫນ","ໝ","ຫມ","ཷ","ྲཱྀ","ཹ","ླཱྀ","ẚ","aʾ","᾽"," ̓","᾿"," ̓","῀"," ͂","῾"," ̔"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","‗"," ̳","․",".","‥","..","…","...","″","′′","‴","′′′","‶","‵‵","‷","‵‵‵","‼","!!","‾"," ̅","⁇","??","⁈","?!","⁉","!?","⁗","′′′′"," "," ","₨","Rs","℀","a/c","℁","a/s","℃","°C","℅","c/o","℆","c/u","ℇ","Ɛ","℉","°F","№","No","℡","TEL","ℵ","א","ℶ","ב","ℷ","ג","ℸ","ד","℻","FAX","Ⅰ","I","Ⅱ","II","Ⅲ","III","Ⅳ","IV","Ⅴ","V","Ⅵ","VI","Ⅶ","VII","Ⅷ","VIII","Ⅸ","IX","Ⅹ","X","Ⅺ","XI","Ⅻ","XII","Ⅼ","L","Ⅽ","C","Ⅾ","D","Ⅿ","M","ⅰ","i","ⅱ","ii","ⅲ","iii","ⅳ","iv","ⅴ","v","ⅵ","vi","ⅶ","vii","ⅷ","viii","ⅸ","ix","ⅹ","x","ⅺ","xi","ⅻ","xii","ⅼ","l","ⅽ","c","ⅾ","d","ⅿ","m","∬","∫∫","∭","∫∫∫","∯","∮∮","∰","∮∮∮","⑴","(1)","⑵","(2)","⑶","(3)","⑷","(4)","⑸","(5)","⑹","(6)","⑺","(7)","⑻","(8)","⑼","(9)","⑽","(10)","⑾","(11)","⑿","(12)","⒀","(13)","⒁","(14)","⒂","(15)","⒃","(16)","⒄","(17)","⒅","(18)","⒆","(19)","⒇","(20)","⒈","1.","⒉","2.","⒊","3.","⒋","4.","⒌","5.","⒍","6.","⒎","7.","⒏","8.","⒐","9.","⒑","10.","⒒","11.","⒓","12.","⒔","13.","⒕","14.","⒖","15.","⒗","16.","⒘","17.","⒙","18.","⒚","19.","⒛","20.","⒜","(a)","⒝","(b)","⒞","(c)","⒟","(d)","⒠","(e)","⒡","(f)","⒢","(g)","⒣","(h)","⒤","(i)","⒥","(j)","⒦","(k)","⒧","(l)","⒨","(m)","⒩","(n)","⒪","(o)","⒫","(p)","⒬","(q)","⒭","(r)","⒮","(s)","⒯","(t)","⒰","(u)","⒱","(v)","⒲","(w)","⒳","(x)","⒴","(y)","⒵","(z)","⨌","∫∫∫∫","⩴","::=","⩵","==","⩶","===","⺟","母","⻳","龟","⼀","一","⼁","丨","⼂","丶","⼃","丿","⼄","乙","⼅","亅","⼆","二","⼇","亠","⼈","人","⼉","儿","⼊","入","⼋","八","⼌","冂","⼍","冖","⼎","冫","⼏","几","⼐","凵","⼑","刀","⼒","力","⼓","勹","⼔","匕","⼕","匚","⼖","匸","⼗","十","⼘","卜","⼙","卩","⼚","厂","⼛","厶","⼜","又","⼝","口","⼞","囗","⼟","土","⼠","士","⼡","夂","⼢","夊","⼣","夕","⼤","大","⼥","女","⼦","子","⼧","宀","⼨","寸","⼩","小","⼪","尢","⼫","尸","⼬","屮","⼭","山","⼮","巛","⼯","工","⼰","己","⼱","巾","⼲","干","⼳","幺","⼴","广","⼵","廴","⼶","廾","⼷","弋","⼸","弓","⼹","彐","⼺","彡","⼻","彳","⼼","心","⼽","戈","⼾","戶","⼿","手","⽀","支","⽁","攴","⽂","文","⽃","斗","⽄","斤","⽅","方","⽆","无","⽇","日","⽈","曰","⽉","月","⽊","木","⽋","欠","⽌","止","⽍","歹","⽎","殳","⽏","毋","⽐","比","⽑","毛","⽒","氏","⽓","气","⽔","水","⽕","火","⽖","爪","⽗","父","⽘","爻","⽙","爿","⽚","片","⽛","牙","⽜","牛","⽝","犬","⽞","玄","⽟","玉","⽠","瓜","⽡","瓦","⽢","甘","⽣","生","⽤","用","⽥","田","⽦","疋","⽧","疒","⽨","癶","⽩","白","⽪","皮","⽫","皿","⽬","目","⽭","矛","⽮","矢","⽯","石","⽰","示","⽱","禸","⽲","禾","⽳","穴","⽴","立","⽵","竹","⽶","米","⽷","糸","⽸","缶","⽹","网","⽺","羊","⽻","羽","⽼","老","⽽","而","⽾","耒","⽿","耳","⾀","聿","⾁","肉","⾂","臣","⾃","自","⾄","至","⾅","臼","⾆","舌","⾇","舛","⾈","舟","⾉","艮","⾊","色","⾋","艸","⾌","虍","⾍","虫","⾎","血","⾏","行","⾐","衣","⾑","襾","⾒","見","⾓","角","⾔","言","⾕","谷","⾖","豆","⾗","豕","⾘","豸","⾙","貝","⾚","赤","⾛","走","⾜","足","⾝","身","⾞","車","⾟","辛","⾠","辰","⾡","辵","⾢","邑","⾣","酉","⾤","釆","⾥","里","⾦","金","⾧","長","⾨","門","⾩","阜","⾪","隶","⾫","隹","⾬","雨","⾭","靑","⾮","非","⾯","面","⾰","革","⾱","韋","⾲","韭","⾳","音","⾴","頁","⾵","風","⾶","飛","⾷","食","⾸","首","⾹","香","⾺","馬","⾻","骨","⾼","高","⾽","髟","⾾","鬥","⾿","鬯","⿀","鬲","⿁","鬼","⿂","魚","⿃","鳥","⿄","鹵","⿅","鹿","⿆","麥","⿇","麻","⿈","黃","⿉","黍","⿊","黑","⿋","黹","⿌","黽","⿍","鼎","⿎","鼓","⿏","鼠","⿐","鼻","⿑","齊","⿒","齒","⿓","龍","⿔","龜","⿕","龠","〶","〒","〸","十","〹","卄","〺","卅","゛"," ゙","゜"," ゚","ㄱ","ᄀ","ㄲ","ᄁ","ㄳ","ᆪ","ㄴ","ᄂ","ㄵ","ᆬ","ㄶ","ᆭ","ㄷ","ᄃ","ㄸ","ᄄ","ㄹ","ᄅ","ㄺ","ᆰ","ㄻ","ᆱ","ㄼ","ᆲ","ㄽ","ᆳ","ㄾ","ᆴ","ㄿ","ᆵ","ㅀ","ᄚ","ㅁ","ᄆ","ㅂ","ᄇ","ㅃ","ᄈ","ㅄ","ᄡ","ㅅ","ᄉ","ㅆ","ᄊ","ㅇ","ᄋ","ㅈ","ᄌ","ㅉ","ᄍ","ㅊ","ᄎ","ㅋ","ᄏ","ㅌ","ᄐ","ㅍ","ᄑ","ㅎ","ᄒ","ㅏ","ᅡ","ㅐ","ᅢ","ㅑ","ᅣ","ㅒ","ᅤ","ㅓ","ᅥ","ㅔ","ᅦ","ㅕ","ᅧ","ㅖ","ᅨ","ㅗ","ᅩ","ㅘ","ᅪ","ㅙ","ᅫ","ㅚ","ᅬ","ㅛ","ᅭ","ㅜ","ᅮ","ㅝ","ᅯ","ㅞ","ᅰ","ㅟ","ᅱ","ㅠ","ᅲ","ㅡ","ᅳ","ㅢ","ᅴ","ㅣ","ᅵ","ㅤ","ᅠ","ㅥ","ᄔ","ㅦ","ᄕ","ㅧ","ᇇ","ㅨ","ᇈ","ㅩ","ᇌ","ㅪ","ᇎ","ㅫ","ᇓ","ㅬ","ᇗ","ㅭ","ᇙ","ㅮ","ᄜ","ㅯ","ᇝ","ㅰ","ᇟ","ㅱ","ᄝ","ㅲ","ᄞ","ㅳ","ᄠ","ㅴ","ᄢ","ㅵ","ᄣ","ㅶ","ᄧ","ㅷ","ᄩ","ㅸ","ᄫ","ㅹ","ᄬ","ㅺ","ᄭ","ㅻ","ᄮ","ㅼ","ᄯ","ㅽ","ᄲ","ㅾ","ᄶ","ㅿ","ᅀ","ㆀ","ᅇ","ㆁ","ᅌ","ㆂ","ᇱ","ㆃ","ᇲ","ㆄ","ᅗ","ㆅ","ᅘ","ㆆ","ᅙ","ㆇ","ᆄ","ㆈ","ᆅ","ㆉ","ᆈ","ㆊ","ᆑ","ㆋ","ᆒ","ㆌ","ᆔ","ㆍ","ᆞ","ㆎ","ᆡ","㈀","(ᄀ)","㈁","(ᄂ)","㈂","(ᄃ)","㈃","(ᄅ)","㈄","(ᄆ)","㈅","(ᄇ)","㈆","(ᄉ)","㈇","(ᄋ)","㈈","(ᄌ)","㈉","(ᄎ)","㈊","(ᄏ)","㈋","(ᄐ)","㈌","(ᄑ)","㈍","(ᄒ)","㈎","(가)","㈏","(나)","㈐","(다)","㈑","(라)","㈒","(마)","㈓","(바)","㈔","(사)","㈕","(아)","㈖","(자)","㈗","(차)","㈘","(카)","㈙","(타)","㈚","(파)","㈛","(하)","㈜","(주)","㈝","(오전)","㈞","(오후)","㈠","(一)","㈡","(二)","㈢","(三)","㈣","(四)","㈤","(五)","㈥","(六)","㈦","(七)","㈧","(八)","㈨","(九)","㈩","(十)","㈪","(月)","㈫","(火)","㈬","(水)","㈭","(木)","㈮","(金)","㈯","(土)","㈰","(日)","㈱","(株)","㈲","(有)","㈳","(社)","㈴","(名)","㈵","(特)","㈶","(財)","㈷","(祝)","㈸","(労)","㈹","(代)","㈺","(呼)","㈻","(学)","㈼","(監)","㈽","(企)","㈾","(資)","㈿","(協)","㉀","(祭)","㉁","(休)","㉂","(自)","㉃","(至)","㋀","1月","㋁","2月","㋂","3月","㋃","4月","㋄","5月","㋅","6月","㋆","7月","㋇","8月","㋈","9月","㋉","10月","㋊","11月","㋋","12月","㍘","0点","㍙","1点","㍚","2点","㍛","3点","㍜","4点","㍝","5点","㍞","6点","㍟","7点","㍠","8点","㍡","9点","㍢","10点","㍣","11点","㍤","12点","㍥","13点","㍦","14点","㍧","15点","㍨","16点","㍩","17点","㍪","18点","㍫","19点","㍬","20点","㍭","21点","㍮","22点","㍯","23点","㍰","24点","㏠","1日","㏡","2日","㏢","3日","㏣","4日","㏤","5日","㏥","6日","㏦","7日","㏧","8日","㏨","9日","㏩","10日","㏪","11日","㏫","12日","㏬","13日","㏭","14日","㏮","15日","㏯","16日","㏰","17日","㏱","18日","㏲","19日","㏳","20日","㏴","21日","㏵","22日","㏶","23日","㏷","24日","㏸","25日","㏹","26日","㏺","27日","㏻","28日","㏼","29日","㏽","30日","㏾","31日","ff","ff","fi","fi","fl","fl","ffi","ffi","ffl","ffl","ſt","ſt","st","st","ﬓ","մն","ﬔ","մե","ﬕ","մի","ﬖ","վն","ﬗ","մխ","ﭏ","אל","ﭐ","ٱ","ﭑ","ٱ","ﭒ","ٻ","ﭓ","ٻ","ﭔ","ٻ","ﭕ","ٻ","ﭖ","پ","ﭗ","پ","ﭘ","پ","ﭙ","پ","ﭚ","ڀ","ﭛ","ڀ","ﭜ","ڀ","ﭝ","ڀ","ﭞ","ٺ","ﭟ","ٺ","ﭠ","ٺ","ﭡ","ٺ","ﭢ","ٿ","ﭣ","ٿ","ﭤ","ٿ","ﭥ","ٿ","ﭦ","ٹ","ﭧ","ٹ","ﭨ","ٹ","ﭩ","ٹ","ﭪ","ڤ","ﭫ","ڤ","ﭬ","ڤ","ﭭ","ڤ","ﭮ","ڦ","ﭯ","ڦ","ﭰ","ڦ","ﭱ","ڦ","ﭲ","ڄ","ﭳ","ڄ","ﭴ","ڄ","ﭵ","ڄ","ﭶ","ڃ","ﭷ","ڃ","ﭸ","ڃ","ﭹ","ڃ","ﭺ","چ","ﭻ","چ","ﭼ","چ","ﭽ","چ","ﭾ","ڇ","ﭿ","ڇ","ﮀ","ڇ","ﮁ","ڇ","ﮂ","ڍ","ﮃ","ڍ","ﮄ","ڌ","ﮅ","ڌ","ﮆ","ڎ","ﮇ","ڎ","ﮈ","ڈ","ﮉ","ڈ","ﮊ","ژ","ﮋ","ژ","ﮌ","ڑ","ﮍ","ڑ","ﮎ","ک","ﮏ","ک","ﮐ","ک","ﮑ","ک","ﮒ","گ","ﮓ","گ","ﮔ","گ","ﮕ","گ","ﮖ","ڳ","ﮗ","ڳ","ﮘ","ڳ","ﮙ","ڳ","ﮚ","ڱ","ﮛ","ڱ","ﮜ","ڱ","ﮝ","ڱ","ﮞ","ں","ﮟ","ں","ﮠ","ڻ","ﮡ","ڻ","ﮢ","ڻ","ﮣ","ڻ","ﮤ","ۀ","ﮥ","ۀ","ﮦ","ہ","ﮧ","ہ","ﮨ","ہ","ﮩ","ہ","ﮪ","ھ","ﮫ","ھ","ﮬ","ھ","ﮭ","ھ","ﮮ","ے","ﮯ","ے","ﮰ","ۓ","ﮱ","ۓ","ﯓ","ڭ","ﯔ","ڭ","ﯕ","ڭ","ﯖ","ڭ","ﯗ","ۇ","ﯘ","ۇ","ﯙ","ۆ","ﯚ","ۆ","ﯛ","ۈ","ﯜ","ۈ","ﯝ","ٷ","ﯞ","ۋ","ﯟ","ۋ","ﯠ","ۅ","ﯡ","ۅ","ﯢ","ۉ","ﯣ","ۉ","ﯤ","ې","ﯥ","ې","ﯦ","ې","ﯧ","ې","ﯨ","ى","ﯩ","ى","ﯪ","ئا","ﯫ","ئا","ﯬ","ئە","ﯭ","ئە","ﯮ","ئو","ﯯ","ئو","ﯰ","ئۇ","ﯱ","ئۇ","ﯲ","ئۆ","ﯳ","ئۆ","ﯴ","ئۈ","ﯵ","ئۈ","ﯶ","ئې","ﯷ","ئې","ﯸ","ئې","ﯹ","ئى","ﯺ","ئى","ﯻ","ئى","ﯼ","ی","ﯽ","ی","ﯾ","ی","ﯿ","ی","ﰀ","ئج","ﰁ","ئح","ﰂ","ئم","ﰃ","ئى","ﰄ","ئي","ﰅ","بج","ﰆ","بح","ﰇ","بخ","ﰈ","بم","ﰉ","بى","ﰊ","بي","ﰋ","تج","ﰌ","تح","ﰍ","تخ","ﰎ","تم","ﰏ","تى","ﰐ","تي","ﰑ","ثج","ﰒ","ثم","ﰓ","ثى","ﰔ","ثي","ﰕ","جح","ﰖ","جم","ﰗ","حج","ﰘ","حم","ﰙ","خج","ﰚ","خح","ﰛ","خم","ﰜ","سج","ﰝ","سح","ﰞ","سخ","ﰟ","سم","ﰠ","صح","ﰡ","صم","ﰢ","ضج","ﰣ","ضح","ﰤ","ضخ","ﰥ","ضم","ﰦ","طح","ﰧ","طم","ﰨ","ظم","ﰩ","عج","ﰪ","عم","ﰫ","غج","ﰬ","غم","ﰭ","فج","ﰮ","فح","ﰯ","فخ","ﰰ","فم","ﰱ","فى","ﰲ","في","ﰳ","قح","ﰴ","قم","ﰵ","قى","ﰶ","قي","ﰷ","كا","ﰸ","كج","ﰹ","كح","ﰺ","كخ","ﰻ","كل","ﰼ","كم","ﰽ","كى","ﰾ","كي","ﰿ","لج","ﱀ","لح","ﱁ","لخ","ﱂ","لم","ﱃ","لى","ﱄ","لي","ﱅ","مج","ﱆ","مح","ﱇ","مخ","ﱈ","مم","ﱉ","مى","ﱊ","مي","ﱋ","نج","ﱌ","نح","ﱍ","نخ","ﱎ","نم","ﱏ","نى","ﱐ","ني","ﱑ","هج","ﱒ","هم","ﱓ","هى","ﱔ","هي","ﱕ","يج","ﱖ","يح","ﱗ","يخ","ﱘ","يم","ﱙ","يى","ﱚ","يي","ﱛ","ذٰ","ﱜ","رٰ","ﱝ","ىٰ","ﱞ"," ٌّ","ﱟ"," ٍّ","ﱠ"," َّ","ﱡ"," ُّ","ﱢ"," ِّ","ﱣ"," ّٰ","ﱤ","ئر","ﱥ","ئز","ﱦ","ئم","ﱧ","ئن","ﱨ","ئى","ﱩ","ئي","ﱪ","بر","ﱫ","بز","ﱬ","بم","ﱭ","بن","ﱮ","بى","ﱯ","بي","ﱰ","تر","ﱱ","تز","ﱲ","تم","ﱳ","تن","ﱴ","تى","ﱵ","تي","ﱶ","ثر","ﱷ","ثز","ﱸ","ثم","ﱹ","ثن","ﱺ","ثى","ﱻ","ثي","ﱼ","فى","ﱽ","في","ﱾ","قى","ﱿ","قي","ﲀ","كا","ﲁ","كل","ﲂ","كم","ﲃ","كى","ﲄ","كي","ﲅ","لم","ﲆ","لى","ﲇ","لي","ﲈ","ما","ﲉ","مم","ﲊ","نر","ﲋ","نز","ﲌ","نم","ﲍ","نن","ﲎ","نى","ﲏ","ني","ﲐ","ىٰ","ﲑ","ير","ﲒ","يز","ﲓ","يم","ﲔ","ين","ﲕ","يى","ﲖ","يي","ﲗ","ئج","ﲘ","ئح","ﲙ","ئخ","ﲚ","ئم","ﲛ","ئه","ﲜ","بج","ﲝ","بح","ﲞ","بخ","ﲟ","بم","ﲠ","به","ﲡ","تج","ﲢ","تح","ﲣ","تخ","ﲤ","تم","ﲥ","ته","ﲦ","ثم","ﲧ","جح","ﲨ","جم","ﲩ","حج","ﲪ","حم","ﲫ","خج","ﲬ","خم","ﲭ","سج","ﲮ","سح","ﲯ","سخ","ﲰ","سم","ﲱ","صح","ﲲ","صخ","ﲳ","صم","ﲴ","ضج","ﲵ","ضح","ﲶ","ضخ","ﲷ","ضم","ﲸ","طح","ﲹ","ظم","ﲺ","عج","ﲻ","عم","ﲼ","غج","ﲽ","غم","ﲾ","فج","ﲿ","فح","ﳀ","فخ","ﳁ","فم","ﳂ","قح","ﳃ","قم","ﳄ","كج","ﳅ","كح","ﳆ","كخ","ﳇ","كل","ﳈ","كم","ﳉ","لج","ﳊ","لح","ﳋ","لخ","ﳌ","لم","ﳍ","له","ﳎ","مج","ﳏ","مح","ﳐ","مخ","ﳑ","مم","ﳒ","نج","ﳓ","نح","ﳔ","نخ","ﳕ","نم","ﳖ","نه","ﳗ","هج","ﳘ","هم","ﳙ","هٰ","ﳚ","يج","ﳛ","يح","ﳜ","يخ","ﳝ","يم","ﳞ","يه","ﳟ","ئم","ﳠ","ئه","ﳡ","بم","ﳢ","به","ﳣ","تم","ﳤ","ته","ﳥ","ثم","ﳦ","ثه","ﳧ","سم","ﳨ","سه","ﳩ","شم","ﳪ","شه","ﳫ","كل","ﳬ","كم","ﳭ","لم","ﳮ","نم","ﳯ","نه","ﳰ","يم","ﳱ","يه","ﳲ","ـَّ","ﳳ","ـُّ","ﳴ","ـِّ","ﳵ","طى","ﳶ","طي","ﳷ","عى","ﳸ","عي","ﳹ","غى","ﳺ","غي","ﳻ","سى","ﳼ","سي","ﳽ","شى","ﳾ","شي","ﳿ","حى","ﴀ","حي","ﴁ","جى","ﴂ","جي","ﴃ","خى","ﴄ","خي","ﴅ","صى","ﴆ","صي","ﴇ","ضى","ﴈ","ضي","ﴉ","شج","ﴊ","شح","ﴋ","شخ","ﴌ","شم","ﴍ","شر","ﴎ","سر","ﴏ","صر","ﴐ","ضر","ﴑ","طى","ﴒ","طي","ﴓ","عى","ﴔ","عي","ﴕ","غى","ﴖ","غي","ﴗ","سى","ﴘ","سي","ﴙ","شى","ﴚ","شي","ﴛ","حى","ﴜ","حي","ﴝ","جى","ﴞ","جي","ﴟ","خى","ﴠ","خي","ﴡ","صى","ﴢ","صي","ﴣ","ضى","ﴤ","ضي","ﴥ","شج","ﴦ","شح","ﴧ","شخ","ﴨ","شم","ﴩ","شر","ﴪ","سر","ﴫ","صر","ﴬ","ضر","ﴭ","شج","ﴮ","شح","ﴯ","شخ","ﴰ","شم","ﴱ","سه","ﴲ","شه","ﴳ","طم","ﴴ","سج","ﴵ","سح","ﴶ","سخ","ﴷ","شج","ﴸ","شح","ﴹ","شخ","ﴺ","طم","ﴻ","ظم","ﴼ","اً","ﴽ","اً","ﵐ","تجم","ﵑ","تحج","ﵒ","تحج","ﵓ","تحم","ﵔ","تخم","ﵕ","تمج","ﵖ","تمح","ﵗ","تمخ","ﵘ","جمح","ﵙ","جمح","ﵚ","حمي","ﵛ","حمى","ﵜ","سحج","ﵝ","سجح","ﵞ","سجى","ﵟ","سمح","ﵠ","سمح","ﵡ","سمج","ﵢ","سمم","ﵣ","سمم","ﵤ","صحح","ﵥ","صحح","ﵦ","صمم","ﵧ","شحم","ﵨ","شحم","ﵩ","شجي","ﵪ","شمخ","ﵫ","شمخ","ﵬ","شمم","ﵭ","شمم","ﵮ","ضحى","ﵯ","ضخم","ﵰ","ضخم","ﵱ","طمح","ﵲ","طمح","ﵳ","طمم","ﵴ","طمي","ﵵ","عجم","ﵶ","عمم","ﵷ","عمم","ﵸ","عمى","ﵹ","غمم","ﵺ","غمي","ﵻ","غمى","ﵼ","فخم","ﵽ","فخم","ﵾ","قمح","ﵿ","قمم","ﶀ","لحم","ﶁ","لحي","ﶂ","لحى","ﶃ","لجج","ﶄ","لجج","ﶅ","لخم","ﶆ","لخم","ﶇ","لمح","ﶈ","لمح","ﶉ","محج","ﶊ","محم","ﶋ","محي","ﶌ","مجح","ﶍ","مجم","ﶎ","مخج","ﶏ","مخم","ﶒ","مجخ","ﶓ","همج","ﶔ","همم","ﶕ","نحم","ﶖ","نحى","ﶗ","نجم","ﶘ","نجم","ﶙ","نجى","ﶚ","نمي","ﶛ","نمى","ﶜ","يمم","ﶝ","يمم","ﶞ","بخي","ﶟ","تجي","ﶠ","تجى","ﶡ","تخي","ﶢ","تخى","ﶣ","تمي","ﶤ","تمى","ﶥ","جمي","ﶦ","جحى","ﶧ","جمى","ﶨ","سخى","ﶩ","صحي","ﶪ","شحي","ﶫ","ضحي","ﶬ","لجي","ﶭ","لمي","ﶮ","يحي","ﶯ","يجي","ﶰ","يمي","ﶱ","ممي","ﶲ","قمي","ﶳ","نحي","ﶴ","قمح","ﶵ","لحم","ﶶ","عمي","ﶷ","كمي","ﶸ","نجح","ﶹ","مخي","ﶺ","لجم","ﶻ","كمم","ﶼ","لجم","ﶽ","نجح","ﶾ","جحي","ﶿ","حجي","ﷀ","مجي","ﷁ","فمي","ﷂ","بحي","ﷃ","كمم","ﷄ","عجم","ﷅ","صمم","ﷆ","سخي","ﷇ","نجي","﹉","‾","﹊","‾","﹋","‾","﹌","‾","﹍","_","﹎","_","﹏","_","ﺀ","ء","ﺁ","آ","ﺂ","آ","ﺃ","أ","ﺄ","أ","ﺅ","ؤ","ﺆ","ؤ","ﺇ","إ","ﺈ","إ","ﺉ","ئ","ﺊ","ئ","ﺋ","ئ","ﺌ","ئ","ﺍ","ا","ﺎ","ا","ﺏ","ب","ﺐ","ب","ﺑ","ب","ﺒ","ب","ﺓ","ة","ﺔ","ة","ﺕ","ت","ﺖ","ت","ﺗ","ت","ﺘ","ت","ﺙ","ث","ﺚ","ث","ﺛ","ث","ﺜ","ث","ﺝ","ج","ﺞ","ج","ﺟ","ج","ﺠ","ج","ﺡ","ح","ﺢ","ح","ﺣ","ح","ﺤ","ح","ﺥ","خ","ﺦ","خ","ﺧ","خ","ﺨ","خ","ﺩ","د","ﺪ","د","ﺫ","ذ","ﺬ","ذ","ﺭ","ر","ﺮ","ر","ﺯ","ز","ﺰ","ز","ﺱ","س","ﺲ","س","ﺳ","س","ﺴ","س","ﺵ","ش","ﺶ","ش","ﺷ","ش","ﺸ","ش","ﺹ","ص","ﺺ","ص","ﺻ","ص","ﺼ","ص","ﺽ","ض","ﺾ","ض","ﺿ","ض","ﻀ","ض","ﻁ","ط","ﻂ","ط","ﻃ","ط","ﻄ","ط","ﻅ","ظ","ﻆ","ظ","ﻇ","ظ","ﻈ","ظ","ﻉ","ع","ﻊ","ع","ﻋ","ع","ﻌ","ع","ﻍ","غ","ﻎ","غ","ﻏ","غ","ﻐ","غ","ﻑ","ف","ﻒ","ف","ﻓ","ف","ﻔ","ف","ﻕ","ق","ﻖ","ق","ﻗ","ق","ﻘ","ق","ﻙ","ك","ﻚ","ك","ﻛ","ك","ﻜ","ك","ﻝ","ل","ﻞ","ل","ﻟ","ل","ﻠ","ل","ﻡ","م","ﻢ","م","ﻣ","م","ﻤ","م","ﻥ","ن","ﻦ","ن","ﻧ","ن","ﻨ","ن","ﻩ","ه","ﻪ","ه","ﻫ","ه","ﻬ","ه","ﻭ","و","ﻮ","و","ﻯ","ى","ﻰ","ى","ﻱ","ي","ﻲ","ي","ﻳ","ي","ﻴ","ي","ﻵ","لآ","ﻶ","لآ","ﻷ","لأ","ﻸ","لأ","ﻹ","لإ","ﻺ","لإ","ﻻ","لا","ﻼ","لا"]}));function reverseIfRtl(t){const r=t.length;if(r<=1||!function isRTLRangeFor(t){let r=u[13];if(t>=r.begin&&t<r.end)return!0;r=u[11];return t>=r.begin&&t<r.end}(t.charCodeAt(0)))return t;const o=[];for(let c=r-1;c>=0;c--)o.push(t[c]);return o.join("")}const d=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),g=new Map;function getCharUnicodeCategory(t){const r=g.get(t);if(r)return r;const o=t.match(d),c={isWhitespace:!(!o||!o[1]),isZeroWidthDiacritic:!(!o||!o[2]),isInvisibleFormatMark:!(!o||!o[3])};g.set(t,c);return c}function clearUnicodeCaches(){g.clear()}},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.MarkupAnnotation=r.AnnotationFactory=r.AnnotationBorderStyle=r.Annotation=void 0;r.getQuadPoints=getQuadPoints;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(149),h=o(164),d=o(146),g=o(150),m=o(201),y=o(205),v=o(165),k=o(208),_=o(212),w=o(203),S=o(151),C=o(213),x=o(216);function _get(){_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,o){var c=_superPropBase(t,r);if(c){var l=Object.getOwnPropertyDescriptor(c,r);return l.get?l.get.call(arguments.length<3?t:o):l.value}};return _get.apply(this,arguments)}function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var O=function(){function AnnotationFactory(){_classCallCheck(this,AnnotationFactory)}_createClass(AnnotationFactory,null,[{key:"create",value:function create(t,r,o,c,l){var u=this;return Promise.all([o.ensureCatalog("acroForm"),l?this._getPageIndex(t,r,o):-1]).then((function(h){var d=_slicedToArray(h,2),g=d[0],m=d[1];return o.ensure(u,"_create",[t,r,o,c,g,l,m])}))}},{key:"_create",value:function _create(t,r,o,c,h,g){var m=arguments.length>6&&void 0!==arguments[6]?arguments[6]:-1,y=t.fetchIfRef(r);if(y instanceof d.Dict){var v=r instanceof d.Ref?r.toString():"annot_".concat(c.createObjId()),k=y.get("Subtype"),_={xref:t,ref:r,dict:y,subtype:k=k instanceof d.Name?k.name:null,id:v,pdfManager:o,acroForm:h instanceof d.Dict?h:d.Dict.empty,collectFields:g,pageIndex:m};switch(k){case"Link":return new H(_);case"Text":return new U(_);case"Widget":var w=(0,u.getInheritableProperty)({dict:y,key:"FT"});switch(w=w instanceof d.Name?w.name:null){case"Tx":return new j(_);case"Btn":return new D(_);case"Ch":return new L(_);case"Sig":return new N(_)}(0,l.warn)('Unimplemented widget field type "'.concat(w,'", ')+"falling back to base field type.");return new R(_);case"Popup":return new $(_);case"FreeText":return new X(_);case"Line":return new q(_);case"Square":return new G(_);case"Circle":return new z(_);case"PolyLine":return new W(_);case"Polygon":return new V(_);case"Caret":return new K(_);case"Ink":return new Y(_);case"Highlight":return new J(_);case"Underline":return new Z(_);case"Squiggly":return new Q(_);case"StrikeOut":return new ee(_);case"Stamp":return new te(_);case"FileAttachment":return new re(_);default:g||(k?(0,l.warn)('Unimplemented annotation type "'.concat(k,'", ')+"falling back to base annotation."):(0,l.warn)("Annotation is missing the required /Subtype."));return new T(_)}}}},{key:"_getPageIndex",value:(t=_asyncToGenerator(c.default.mark((function _callee(t,r,o){var u,h,g;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:c.prev=0;c.next=3;return t.fetchIfRefAsync(r);case 3:if((u=c.sent)instanceof d.Dict){c.next=6;break}return c.abrupt("return",-1);case 6:if((h=u.getRaw("P"))instanceof d.Ref){c.next=9;break}return c.abrupt("return",-1);case 9:c.next=11;return o.ensureCatalog("getPageIndex",[h]);case 11:g=c.sent;return c.abrupt("return",g);case 15:c.prev=15;c.t0=c.catch(0);(0,l.warn)('_getPageIndex: "'.concat(c.t0,'".'));return c.abrupt("return",-1);case 19:case"end":return c.stop()}}),_callee,null,[[0,15]])}))),function _getPageIndex(r,o,c){return t.apply(this,arguments)})}]);var t;return AnnotationFactory}();r.AnnotationFactory=O;function getRgbColor(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint8ClampedArray(3);if(!Array.isArray(t))return r;var o=r||new Uint8ClampedArray(3);switch(t.length){case 0:return null;case 1:v.ColorSpace.singletons.gray.getRgbItem(t,0,o,0);return o;case 3:v.ColorSpace.singletons.rgb.getRgbItem(t,0,o,0);return o;case 4:v.ColorSpace.singletons.cmyk.getRgbItem(t,0,o,0);return o;default:return r}}function getQuadPoints(t,r){if(!t.has("QuadPoints"))return null;var o=t.getArray("QuadPoints");if(!Array.isArray(o)||0===o.length||o.length%8>0)return null;for(var c=[],l=0,u=o.length/8;l<u;l++){c.push([]);for(var h=8*l,d=8*l+8;h<d;h+=2){var g=o[h],m=o[h+1];if(null!==r&&(g<r[0]||g>r[2]||m<r[1]||m>r[3]))return null;c[l].push({x:g,y:m})}}return c.map((function(t){var r=t.reduce((function(t,r){var o=_slicedToArray(t,4),c=o[0],l=o[1],u=o[2],h=o[3];return[Math.min(c,r.x),Math.max(l,r.x),Math.min(u,r.y),Math.max(h,r.y)]}),[Number.MAX_VALUE,Number.MIN_VALUE,Number.MAX_VALUE,Number.MIN_VALUE]),o=_slicedToArray(r,4),c=o[0],l=o[1],u=o[2],h=o[3];return[{x:c,y:h},{x:l,y:h},{x:c,y:u},{x:l,y:u}]}))}function getTransformMatrix(t,r,o){var c=_slicedToArray(l.Util.getAxialAlignedBoundingBox(r,o),4),u=c[0],h=c[1],d=c[2],g=c[3];if(u===d||h===g)return[1,0,0,1,t[0],t[1]];var m=(t[2]-t[0])/(d-u),y=(t[3]-t[1])/(g-h);return[m,0,0,y,t[0]-u*m,t[1]-h*y]}var T=function(){function Annotation(t){_classCallCheck(this,Annotation);var r=t.dict;this.setTitle(r.get("T"));this.setContents(r.get("Contents"));this.setModificationDate(r.get("M"));this.setFlags(r.get("F"));this.setRectangle(r.getArray("Rect"));this.setColor(r.getArray("C"));this.setBorderStyle(r);this.setAppearance(r);this.setBorderAndBackgroundColors(r.get("MK"));this._streams=[];this.appearance&&this._streams.push(this.appearance);this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,contentsObj:this._contents,hasAppearance:!!this.appearance,id:t.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:t.subtype,hasOwnCanvas:!1};if(t.collectFields){var o=r.get("Kids");if(Array.isArray(o)){var c,h=[],g=_createForOfIteratorHelper(o);try{for(g.s();!(c=g.n()).done;){var m=c.value;m instanceof d.Ref&&h.push(m.toString())}}catch(t){g.e(t)}finally{g.f()}0!==h.length&&(this.data.kidIds=h)}this.data.actions=(0,u.collectActions)(t.xref,r,l.AnnotationActionEventType);this.data.fieldName=this._constructFieldName(r);this.data.pageIndex=t.pageIndex}this._fallbackFontDict=null}_createClass(Annotation,[{key:"_hasFlag",value:function _hasFlag(t,r){return!!(t&r)}},{key:"_isViewable",value:function _isViewable(t){return!this._hasFlag(t,l.AnnotationFlag.INVISIBLE)&&!this._hasFlag(t,l.AnnotationFlag.NOVIEW)}},{key:"_isPrintable",value:function _isPrintable(t){return this._hasFlag(t,l.AnnotationFlag.PRINT)&&!this._hasFlag(t,l.AnnotationFlag.INVISIBLE)}},{key:"mustBeViewed",value:function mustBeViewed(t){var r=t&&t.get(this.data.id);return r&&void 0!==r.hidden?!r.hidden:this.viewable&&!this._hasFlag(this.flags,l.AnnotationFlag.HIDDEN)}},{key:"mustBePrinted",value:function mustBePrinted(t){var r=t&&t.get(this.data.id);return r&&void 0!==r.print?r.print:this.printable}},{key:"viewable",get:function get(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}},{key:"printable",get:function get(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}},{key:"_parseStringHelper",value:function _parseStringHelper(t){var r="string"==typeof t?(0,l.stringToPDFString)(t):"";return{str:r,dir:r&&"rtl"===(0,m.bidi)(r).dir?"rtl":"ltr"}}},{key:"setTitle",value:function setTitle(t){this._title=this._parseStringHelper(t)}},{key:"setContents",value:function setContents(t){this._contents=this._parseStringHelper(t)}},{key:"setModificationDate",value:function setModificationDate(t){this.modificationDate="string"==typeof t?t:null}},{key:"setFlags",value:function setFlags(t){this.flags=Number.isInteger(t)&&t>0?t:0}},{key:"hasFlag",value:function hasFlag(t){return this._hasFlag(this.flags,t)}},{key:"setRectangle",value:function setRectangle(t){Array.isArray(t)&&4===t.length?this.rectangle=l.Util.normalizeRect(t):this.rectangle=[0,0,0,0]}},{key:"setColor",value:function setColor(t){this.color=getRgbColor(t)}},{key:"setBorderAndBackgroundColors",value:function setBorderAndBackgroundColors(t){if(t instanceof d.Dict){this.borderColor=getRgbColor(t.getArray("BC"),null);this.backgroundColor=getRgbColor(t.getArray("BG"),null)}else this.borderColor=this.backgroundColor=null}},{key:"setBorderStyle",value:function setBorderStyle(t){this.borderStyle=new E;if(t instanceof d.Dict)if(t.has("BS")){var r=t.get("BS"),o=r.get("Type");if(!o||(0,d.isName)(o,"Border")){this.borderStyle.setWidth(r.get("W"),this.rectangle);this.borderStyle.setStyle(r.get("S"));this.borderStyle.setDashArray(r.getArray("D"))}}else if(t.has("Border")){var c=t.getArray("Border");if(Array.isArray(c)&&c.length>=3){this.borderStyle.setHorizontalCornerRadius(c[0]);this.borderStyle.setVerticalCornerRadius(c[1]);this.borderStyle.setWidth(c[2],this.rectangle);4===c.length&&this.borderStyle.setDashArray(c[3],!0)}}else this.borderStyle.setWidth(0)}},{key:"setAppearance",value:function setAppearance(t){this.appearance=null;var r=t.get("AP");if(r instanceof d.Dict){var o=r.get("N");if(o instanceof g.BaseStream)this.appearance=o;else if(o instanceof d.Dict){var c=t.get("AS");c instanceof d.Name&&o.has(c.name)&&(this.appearance=o.get(c.name))}}}},{key:"loadResources",value:function loadResources(t,r){return r.dict.getAsync("Resources").then((function(r){if(r){return new _.ObjectLoader(r,t,r.xref).load().then((function(){return r}))}}))}},{key:"getOperatorList",value:function getOperatorList(t,r,o,c,u){var h=this,g=this.data,m=this.appearance,y=g.hasOwnCanvas&&o&l.RenderingIntentFlag.DISPLAY;if(!m){if(!y)return Promise.resolve(new w.OperatorList);(m=new S.StringStream("")).dict=new d.Dict}var v=m.dict,k=this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"],m),_=v.getArray("BBox")||[0,0,1,1],C=v.getArray("Matrix")||[1,0,0,1,0,0],x=getTransformMatrix(g.rect,_,C);return k.then((function(o){var c=new w.OperatorList;c.addOp(l.OPS.beginAnnotation,[g.id,g.rect,x,C,y]);return t.getOperatorList({stream:m,task:r,resources:o,operatorList:c,fallbackFontDict:h._fallbackFontDict}).then((function(){c.addOp(l.OPS.endAnnotation,[]);h.reset();return c}))}))}},{key:"save",value:(t=_asyncToGenerator(c.default.mark((function _callee2(t,r,o){return c.default.wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",null);case 1:case"end":return t.stop()}}),_callee2)}))),function save(r,o,c){return t.apply(this,arguments)})},{key:"getFieldObject",value:function getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex}:null}},{key:"reset",value:function reset(){var t,r=_createForOfIteratorHelper(this._streams);try{for(r.s();!(t=r.n()).done;){t.value.reset()}}catch(t){r.e(t)}finally{r.f()}}},{key:"_constructFieldName",value:function _constructFieldName(t){if(!t.has("T")&&!t.has("Parent")){(0,l.warn)("Unknown field name, falling back to empty field name.");return""}if(!t.has("Parent"))return(0,l.stringToPDFString)(t.get("T"));var r=[];t.has("T")&&r.unshift((0,l.stringToPDFString)(t.get("T")));var o=t,c=new d.RefSet;t.objId&&c.put(t.objId);for(;o.has("Parent")&&(o=o.get("Parent"))instanceof d.Dict&&(!o.objId||!c.has(o.objId));){o.objId&&c.put(o.objId);o.has("T")&&r.unshift((0,l.stringToPDFString)(o.get("T")))}return r.join(".")}}]);var t;return Annotation}();r.Annotation=T;var E=function(){function AnnotationBorderStyle(){_classCallCheck(this,AnnotationBorderStyle);this.width=1;this.style=l.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.horizontalCornerRadius=0;this.verticalCornerRadius=0}_createClass(AnnotationBorderStyle,[{key:"setWidth",value:function setWidth(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if(t instanceof d.Name)this.width=0;else if("number"==typeof t){if(t>0){var o=(r[2]-r[0])/2,c=(r[3]-r[1])/2;if(o>0&&c>0&&(t>o||t>c)){(0,l.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(t));t=1}}this.width=t}}},{key:"setStyle",value:function setStyle(t){if(t instanceof d.Name)switch(t.name){case"S":this.style=l.AnnotationBorderStyleType.SOLID;break;case"D":this.style=l.AnnotationBorderStyleType.DASHED;break;case"B":this.style=l.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=l.AnnotationBorderStyleType.INSET;break;case"U":this.style=l.AnnotationBorderStyleType.UNDERLINE}}},{key:"setDashArray",value:function setDashArray(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(t)&&t.length>0){var o,c=!0,l=!0,u=_createForOfIteratorHelper(t);try{for(u.s();!(o=u.n()).done;){var h=o.value,g=+h>=0;if(!g){c=!1;break}h>0&&(l=!1)}}catch(t){u.e(t)}finally{u.f()}if(c&&!l){this.dashArray=t;r&&this.setStyle(d.Name.get("D"))}else this.width=0}else t&&(this.width=0)}},{key:"setHorizontalCornerRadius",value:function setHorizontalCornerRadius(t){Number.isInteger(t)&&(this.horizontalCornerRadius=t)}},{key:"setVerticalCornerRadius",value:function setVerticalCornerRadius(t){Number.isInteger(t)&&(this.verticalCornerRadius=t)}}]);return AnnotationBorderStyle}();r.AnnotationBorderStyle=E;var M=function(t){_inherits(MarkupAnnotation,t);var r=_createSuper(MarkupAnnotation);function MarkupAnnotation(t){var o;_classCallCheck(this,MarkupAnnotation);o=r.call(this,t);var c=t.dict;if(c.has("IRT")){var u=c.getRaw("IRT");o.data.inReplyTo=u instanceof d.Ref?u.toString():null;var h=c.get("RT");o.data.replyType=h instanceof d.Name?h.name:l.AnnotationReplyType.REPLY}if(o.data.replyType===l.AnnotationReplyType.GROUP){var g=c.get("IRT");o.setTitle(g.get("T"));o.data.titleObj=o._title;o.setContents(g.get("Contents"));o.data.contentsObj=o._contents;if(g.has("CreationDate")){o.setCreationDate(g.get("CreationDate"));o.data.creationDate=o.creationDate}else o.data.creationDate=null;if(g.has("M")){o.setModificationDate(g.get("M"));o.data.modificationDate=o.modificationDate}else o.data.modificationDate=null;o.data.hasPopup=g.has("Popup");if(g.has("C")){o.setColor(g.getArray("C"));o.data.color=o.color}else o.data.color=null}else{o.data.titleObj=o._title;o.setCreationDate(c.get("CreationDate"));o.data.creationDate=o.creationDate;o.data.hasPopup=c.has("Popup");c.has("C")||(o.data.color=null)}c.has("RC")&&(o.data.richText=x.XFAFactory.getRichTextAsHtml(c.get("RC")));return o}_createClass(MarkupAnnotation,[{key:"setCreationDate",value:function setCreationDate(t){this.creationDate="string"==typeof t?t:null}},{key:"_setDefaultAppearance",value:function _setDefaultAppearance(t){var r=t.xref,o=t.extra,c=t.strokeColor,l=t.fillColor,u=t.blendMode,h=t.strokeAlpha,g=t.fillAlpha,m=t.pointsCallback,y=Number.MAX_VALUE,v=Number.MAX_VALUE,k=Number.MIN_VALUE,_=Number.MIN_VALUE,w=["q"];o&&w.push(o);c&&w.push("".concat(c[0]," ").concat(c[1]," ").concat(c[2]," RG"));l&&w.push("".concat(l[0]," ").concat(l[1]," ").concat(l[2]," rg"));var C=this.data.quadPoints;C||(C=[[{x:this.rectangle[0],y:this.rectangle[3]},{x:this.rectangle[2],y:this.rectangle[3]},{x:this.rectangle[0],y:this.rectangle[1]},{x:this.rectangle[2],y:this.rectangle[1]}]]);var x,O=_createForOfIteratorHelper(C);try{for(O.s();!(x=O.n()).done;){var T=_slicedToArray(m(w,x.value),4),E=T[0],M=T[1],R=T[2],j=T[3];y=Math.min(y,E);k=Math.max(k,M);v=Math.min(v,R);_=Math.max(_,j)}}catch(t){O.e(t)}finally{O.f()}w.push("Q");var D=new d.Dict(r),L=new d.Dict(r);L.set("Subtype",d.Name.get("Form"));var N=new S.StringStream(w.join(" "));N.dict=L;D.set("Fm0",N);var U=new d.Dict(r);u&&U.set("BM",d.Name.get(u));"number"==typeof h&&U.set("CA",h);"number"==typeof g&&U.set("ca",g);var H=new d.Dict(r);H.set("GS0",U);var $=new d.Dict(r);$.set("ExtGState",H);$.set("XObject",D);var X=new d.Dict(r);X.set("Resources",$);var q=this.data.rect=[y,v,k,_];X.set("BBox",q);this.appearance=new S.StringStream("/GS0 gs /Fm0 Do");this.appearance.dict=X;this._streams.push(this.appearance,N)}}]);return MarkupAnnotation}(T);r.MarkupAnnotation=M;var R=function(t){_inherits(WidgetAnnotation,t);var r,o,g,m=_createSuper(WidgetAnnotation);function WidgetAnnotation(t){var r;_classCallCheck(this,WidgetAnnotation);r=m.call(this,t);var o=t.dict,c=r.data;r.ref=t.ref;c.annotationType=l.AnnotationType.WIDGET;void 0===c.fieldName&&(c.fieldName=r._constructFieldName(o));void 0===c.actions&&(c.actions=(0,u.collectActions)(t.xref,o,l.AnnotationActionEventType));var g=(0,u.getInheritableProperty)({dict:o,key:"V",getArray:!0});c.fieldValue=r._decodeFormValue(g);var y=(0,u.getInheritableProperty)({dict:o,key:"DV",getArray:!0});c.defaultFieldValue=r._decodeFormValue(y);void 0===g&&null!==c.defaultFieldValue&&(c.fieldValue=c.defaultFieldValue);c.alternativeText=(0,l.stringToPDFString)(o.get("TU")||"");var v=(0,u.getInheritableProperty)({dict:o,key:"DA"})||t.acroForm.get("DA");r._defaultAppearance="string"==typeof v?v:"";c.defaultAppearanceData=(0,h.parseDefaultAppearance)(r._defaultAppearance);var k=(0,u.getInheritableProperty)({dict:o,key:"FT"});c.fieldType=k instanceof d.Name?k.name:null;var _=(0,u.getInheritableProperty)({dict:o,key:"DR"}),w=t.acroForm.get("DR"),S=r.appearance&&r.appearance.dict.get("Resources");r._fieldResources={localResources:_,acroFormResources:w,appearanceResources:S,mergedResources:d.Dict.merge({xref:t.xref,dictArray:[_,S,w],mergeSubDicts:!0})};c.fieldFlags=(0,u.getInheritableProperty)({dict:o,key:"Ff"});(!Number.isInteger(c.fieldFlags)||c.fieldFlags<0)&&(c.fieldFlags=0);c.readOnly=r.hasFieldFlag(l.AnnotationFieldFlag.READONLY);c.hidden=r._hasFlag(c.annotationFlags,l.AnnotationFlag.HIDDEN);return r}_createClass(WidgetAnnotation,[{key:"_decodeFormValue",value:function _decodeFormValue(t){return Array.isArray(t)?t.filter((function(t){return"string"==typeof t})).map((function(t){return(0,l.stringToPDFString)(t)})):t instanceof d.Name?(0,l.stringToPDFString)(t.name):"string"==typeof t?(0,l.stringToPDFString)(t):null}},{key:"hasFieldFlag",value:function hasFieldFlag(t){return!!(this.data.fieldFlags&t)}},{key:"getOperatorList",value:function getOperatorList(t,r,o,c,u){var h=this;return!c||this instanceof N?this._hasText?this._getAppearance(t,r,u).then((function(d){if(h.appearance&&null===d)return _get(_getPrototypeOf(WidgetAnnotation.prototype),"getOperatorList",h).call(h,t,r,o,c,u);var g=new w.OperatorList;if(!h._defaultAppearance||null===d)return g;var m=[1,0,0,1,0,0],y=[0,0,h.data.rect[2]-h.data.rect[0],h.data.rect[3]-h.data.rect[1]],v=getTransformMatrix(h.data.rect,y,m);g.addOp(l.OPS.beginAnnotation,[h.data.id,h.data.rect,v,m]);var k=new S.StringStream(d);return t.getOperatorList({stream:k,task:r,resources:h._fieldResources.mergedResources,operatorList:g}).then((function(){g.addOp(l.OPS.endAnnotation,[]);return g}))})):_get(_getPrototypeOf(WidgetAnnotation.prototype),"getOperatorList",this).call(this,t,r,o,c,u):Promise.resolve(new w.OperatorList)}},{key:"save",value:(g=_asyncToGenerator(c.default.mark((function _callee3(t,r,o){var u,h,g,m,y,v,k,_,w,S,x,O,T,E,M;return c.default.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:if(o){c.next=2;break}return c.abrupt("return",null);case 2:u=o.get(this.data.id);if((h=u&&u.value)!==this.data.fieldValue&&void 0!==h){c.next=6;break}return c.abrupt("return",null);case 6:c.next=8;return this._getAppearance(t,r,o);case 8:if(null!==(g=c.sent)){c.next=11;break}return c.abrupt("return",null);case 11:m=t.xref;if((y=m.fetchIfRef(this.ref))instanceof d.Dict){c.next=15;break}return c.abrupt("return",null);case 15:v=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]];k={path:(0,l.stringToPDFString)(y.get("T")||""),value:h};_=m.getNewRef();(w=new d.Dict(m)).set("N",_);S=m.encrypt;x=null;O=null;if(S){x=S.createCipherTransform(this.ref.num,this.ref.gen);O=S.createCipherTransform(_.num,_.gen);g=O.encryptString(g)}y.set("V",(0,l.isAscii)(h)?h:(0,l.stringToUTF16BEString)(h));y.set("AP",w);y.set("M","D:".concat((0,l.getModificationDate)()));(T=new d.Dict(m)).set("Length",g.length);T.set("Subtype",d.Name.get("Form"));T.set("Resources",this._getSaveFieldResources(m));T.set("BBox",v);E=["".concat(this.ref.num," ").concat(this.ref.gen," obj\n")];(0,C.writeDict)(y,E,x);E.push("\nendobj\n");M=["".concat(_.num," ").concat(_.gen," obj\n")];(0,C.writeDict)(T,M,O);M.push(" stream\n",g,"\nendstream\nendobj\n");return c.abrupt("return",[{ref:this.ref,data:E.join(""),xfa:k},{ref:_,data:M.join(""),xfa:null}]);case 39:case"end":return c.stop()}}),_callee3,this)}))),function save(t,r,o){return g.apply(this,arguments)})},{key:"_getAppearance",value:(o=_asyncToGenerator(c.default.mark((function _callee4(t,r,o){var u,d,g,m,y,v,k,_,w,S,C,x,O,T,E,M,R,j;return c.default.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:u=this.hasFieldFlag(l.AnnotationFieldFlag.PASSWORD);if(o&&!u){c.next=3;break}return c.abrupt("return",null);case 3:d=o.get(this.data.id);if(void 0!==(g=d&&d.value)){c.next=7;break}return c.abrupt("return",null);case 7:if(""!==(g=g.trim())){c.next=10;break}return c.abrupt("return","");case 10:m=-1;this.data.multiLine&&(m=g.split(/\r\n|\r|\n/).length);v=y=2;k=this.data.rect[3]-this.data.rect[1];_=this.data.rect[2]-this.data.rect[0];this._defaultAppearance||(this.data.defaultAppearanceData=(0,h.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));c.next=19;return this._getFontData(t,r);case 19:w=c.sent;S=this._computeFontSize(k-y,_-2*v,g,w,m),C=_slicedToArray(S,2),x=C[0],O=C[1];T=w.descent;isNaN(T)&&(T=0);E=y+Math.abs(T)*O;M=this.data.textAlignment;if(!this.data.multiLine){c.next=27;break}return c.abrupt("return",this._getMultilineAppearance(x,g,w,O,_,k,M,v,E));case 27:R=w.encodeString(g).join("");if(!this.data.comb){c.next=30;break}return c.abrupt("return",this._getCombAppearance(x,w,R,_,v,E));case 30:if(!(0===M||M>2)){c.next=32;break}return c.abrupt("return","/Tx BMC q BT "+x+" 1 0 0 1 ".concat(v," ").concat(E," Tm (").concat((0,l.escapeString)(R),") Tj")+" ET Q EMC");case 32:j=this._renderText(R,w,O,_,M,v,E);return c.abrupt("return","/Tx BMC q BT "+x+" 1 0 0 1 0 0 Tm ".concat(j)+" ET Q EMC");case 34:case"end":return c.stop()}}),_callee4,this)}))),function _getAppearance(t,r,c){return o.apply(this,arguments)})},{key:"_getFontData",value:(r=_asyncToGenerator(c.default.mark((function _callee5(t,r){var o,l,u,h,g;return c.default.wrap((function _callee5$(c){for(;;)switch(c.prev=c.next){case 0:o=new w.OperatorList;l={font:null,clone:function clone(){return this}};u=this.data.defaultAppearanceData,h=u.fontName,g=u.fontSize;c.next=5;return t.handleSetFont(this._fieldResources.mergedResources,[h&&d.Name.get(h),g],null,o,r,l,null);case 5:return c.abrupt("return",l.font);case 6:case"end":return c.stop()}}),_callee5,this)}))),function _getFontData(t,o){return r.apply(this,arguments)})},{key:"_getTextWidth",value:function _getTextWidth(t,r){return r.charsToGlyphs(t).reduce((function(t,r){return t+r.width}),0)/1e3}},{key:"_computeFontSize",value:function _computeFontSize(t,r,o,c,l){var u=this,d=this.data.defaultAppearanceData.fontSize;if(!d){var g=function roundWithTwoDigits(t){return Math.floor(100*t)/100},m=1.35;if(-1===l){var y=this._getTextWidth(o,c);d=g(Math.min(t/m,r/y))}else{var v,k=o.split(/\r\n?|\n/),_=[],w=_createForOfIteratorHelper(k);try{for(w.s();!(v=w.n()).done;){var S=v.value,C=c.encodeString(S).join(""),x=c.charsToGlyphs(C),O=c.getCharPositions(C);_.push({line:C,glyphs:x,positions:O})}}catch(t){w.e(t)}finally{w.f()}var T=function isTooBig(o){var l,h=0,d=_createForOfIteratorHelper(_);try{for(d.s();!(l=d.n()).done;){var g=l.value;if((h+=u._splitLine(null,c,o,r,g).length*o)>t)return!0}}catch(t){d.e(t)}finally{d.f()}return!1},E=(d=12)*m,M=Math.round(t/E);M=Math.max(M,l);for(;T(d=g((E=t/M)/m));)M++}var R=this.data.defaultAppearanceData,j=R.fontName,D=R.fontColor;this._defaultAppearance=(0,h.createDefaultAppearance)({fontSize:d,fontName:j,fontColor:D})}return[this._defaultAppearance,d]}},{key:"_renderText",value:function _renderText(t,r,o,c,u,h,d){var g,m=this._getTextWidth(t,r)*o;g=(g=1===u?(c-m)/2:2===u?c-m-h:h).toFixed(2);d=d.toFixed(2);return"".concat(g," ").concat(d," Td (").concat((0,l.escapeString)(t),") Tj")}},{key:"_getSaveFieldResources",value:function _getSaveFieldResources(t){var r=this._fieldResources,o=r.localResources,c=r.appearanceResources,l=r.acroFormResources,u=this.data.defaultAppearanceData&&this.data.defaultAppearanceData.fontName;if(!u)return o||d.Dict.empty;for(var h=0,g=[o,c];h<g.length;h++){var m=g[h];if(m instanceof d.Dict){var y=m.get("Font");if(y instanceof d.Dict&&y.has(u))return m}}if(l instanceof d.Dict){var v=l.get("Font");if(v instanceof d.Dict&&v.has(u)){var k=new d.Dict(t);k.set(u,v.getRaw(u));var _=new d.Dict(t);_.set("Font",k);return d.Dict.merge({xref:t,dictArray:[_,o],mergeSubDicts:!0})}}return o||d.Dict.empty}},{key:"getFieldObject",value:function getFieldObject(){return null}}]);return WidgetAnnotation}(T),j=function(t){_inherits(TextWidgetAnnotation,t);var r=_createSuper(TextWidgetAnnotation);function TextWidgetAnnotation(t){var o;_classCallCheck(this,TextWidgetAnnotation);(o=r.call(this,t))._hasText=!0;var c=t.dict;"string"!=typeof o.data.fieldValue&&(o.data.fieldValue="");var h=(0,u.getInheritableProperty)({dict:c,key:"Q"});(!Number.isInteger(h)||h<0||h>2)&&(h=null);o.data.textAlignment=h;var d=(0,u.getInheritableProperty)({dict:c,key:"MaxLen"});(!Number.isInteger(d)||d<0)&&(d=null);o.data.maxLen=d;o.data.multiLine=o.hasFieldFlag(l.AnnotationFieldFlag.MULTILINE);o.data.comb=o.hasFieldFlag(l.AnnotationFieldFlag.COMB)&&!o.hasFieldFlag(l.AnnotationFieldFlag.MULTILINE)&&!o.hasFieldFlag(l.AnnotationFieldFlag.PASSWORD)&&!o.hasFieldFlag(l.AnnotationFieldFlag.FILESELECT)&&null!==o.data.maxLen;return o}_createClass(TextWidgetAnnotation,[{key:"_getCombAppearance",value:function _getCombAppearance(t,r,o,c,u,h){var d,g=(c/this.data.maxLen).toFixed(2),m=[],y=_createForOfIteratorHelper(r.getCharPositions(o));try{for(y.s();!(d=y.n()).done;){var v=_slicedToArray(d.value,2),k=v[0],_=v[1];m.push("(".concat((0,l.escapeString)(o.substring(k,_)),") Tj"))}}catch(t){y.e(t)}finally{y.f()}var w=m.join(" ".concat(g," 0 Td "));return"/Tx BMC q BT "+t+" 1 0 0 1 ".concat(u," ").concat(h," Tm ").concat(w)+" ET Q EMC"}},{key:"_getMultilineAppearance",value:function _getMultilineAppearance(t,r,o,c,l,u,h,d,g){var m,y=[],v=l-2*d,k=_createForOfIteratorHelper(r.split(/\r\n?|\n/));try{for(k.s();!(m=k.n()).done;){var _,w=m.value,S=_createForOfIteratorHelper(this._splitLine(w,o,c,v));try{for(S.s();!(_=S.n()).done;){var C=_.value,x=0===y.length?d:0;y.push(this._renderText(C,o,c,l,h,x,-c))}}catch(t){S.e(t)}finally{S.f()}}}catch(t){k.e(t)}finally{k.f()}var O=y.join("\n");return"/Tx BMC q BT "+t+" 1 0 0 1 0 ".concat(u," Tm ").concat(O)+" ET Q EMC"}},{key:"_splitLine",value:function _splitLine(t,r,o,c){var l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t=l.line||r.encodeString(t).join("");var u=l.glyphs||r.charsToGlyphs(t);if(u.length<=1)return[t];for(var h=l.positions||r.getCharPositions(t),d=o/1e3,g=[],m=-1,y=-1,v=-1,k=0,_=0,w=0,S=u.length;w<S;w++){var C=_slicedToArray(h[w],2),x=C[0],O=C[1],T=u[w],E=T.width*d;if(" "===T.unicode)if(_+E>c){g.push(t.substring(k,x));k=x;_=E;m=-1;v=-1}else{_+=E;m=x;y=O;v=w}else if(_+E>c)if(-1!==m){g.push(t.substring(k,y));k=y;w=v+1;m=-1;_=0}else{g.push(t.substring(k,x));k=x;_=E}else _+=E}k<t.length&&g.push(t.substring(k,t.length));return g}},{key:"getFieldObject",value:function getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue,multiline:this.data.multiLine,password:this.hasFieldFlag(l.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"text"}}}]);return TextWidgetAnnotation}(R),D=function(t){_inherits(ButtonWidgetAnnotation,t);var r,o,u,h,g=_createSuper(ButtonWidgetAnnotation);function ButtonWidgetAnnotation(t){var r;_classCallCheck(this,ButtonWidgetAnnotation);(r=g.call(this,t)).checkedAppearance=null;r.uncheckedAppearance=null;r.data.checkBox=!r.hasFieldFlag(l.AnnotationFieldFlag.RADIO)&&!r.hasFieldFlag(l.AnnotationFieldFlag.PUSHBUTTON);r.data.radioButton=r.hasFieldFlag(l.AnnotationFieldFlag.RADIO)&&!r.hasFieldFlag(l.AnnotationFieldFlag.PUSHBUTTON);r.data.pushButton=r.hasFieldFlag(l.AnnotationFieldFlag.PUSHBUTTON);r.data.isTooltipOnly=!1;if(r.data.checkBox)r._processCheckBox(t);else if(r.data.radioButton)r._processRadioButton(t);else if(r.data.pushButton){r.data.hasOwnCanvas=!0;r._processPushButton(t)}else(0,l.warn)("Invalid field flags for button widget annotation");return r}_createClass(ButtonWidgetAnnotation,[{key:"getOperatorList",value:(h=_asyncToGenerator(c.default.mark((function _callee6(t,r,o,l,u){var h,d,g,m,y;return c.default.wrap((function _callee6$(c){for(;;)switch(c.prev=c.next){case 0:if(!this.data.pushButton){c.next=2;break}return c.abrupt("return",_get(_getPrototypeOf(ButtonWidgetAnnotation.prototype),"getOperatorList",this).call(this,t,r,o,!1,u));case 2:h=null;if(u){d=u.get(this.data.id);h=d?d.value:null}if(null!==h){c.next=8;break}if(!this.appearance){c.next=7;break}return c.abrupt("return",_get(_getPrototypeOf(ButtonWidgetAnnotation.prototype),"getOperatorList",this).call(this,t,r,o,l,u));case 7:h=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue;case 8:if(!(g=h?this.checkedAppearance:this.uncheckedAppearance)){c.next=15;break}m=this.appearance;this.appearance=g;y=_get(_getPrototypeOf(ButtonWidgetAnnotation.prototype),"getOperatorList",this).call(this,t,r,o,l,u);this.appearance=m;return c.abrupt("return",y);case 15:return c.abrupt("return",new w.OperatorList);case 16:case"end":return c.stop()}}),_callee6,this)}))),function getOperatorList(t,r,o,c,l){return h.apply(this,arguments)})},{key:"save",value:(u=_asyncToGenerator(c.default.mark((function _callee7(t,r,o){return c.default.wrap((function _callee7$(c){for(;;)switch(c.prev=c.next){case 0:if(!this.data.checkBox){c.next=2;break}return c.abrupt("return",this._saveCheckbox(t,r,o));case 2:if(!this.data.radioButton){c.next=4;break}return c.abrupt("return",this._saveRadioButton(t,r,o));case 4:return c.abrupt("return",null);case 5:case"end":return c.stop()}}),_callee7,this)}))),function save(t,r,o){return u.apply(this,arguments)})},{key:"_saveCheckbox",value:(o=_asyncToGenerator(c.default.mark((function _callee8(t,r,o){var u,h,g,m,y,v,k,_;return c.default.wrap((function _callee8$(r){for(;;)switch(r.prev=r.next){case 0:if(o){r.next=2;break}return r.abrupt("return",null);case 2:u=o.get(this.data.id);if(void 0!==(h=u&&u.value)){r.next=6;break}return r.abrupt("return",null);case 6:if(this.data.fieldValue===this.data.exportValue!==h){r.next=9;break}return r.abrupt("return",null);case 9:if((g=t.xref.fetchIfRef(this.ref))instanceof d.Dict){r.next=12;break}return r.abrupt("return",null);case 12:m={path:(0,l.stringToPDFString)(g.get("T")||""),value:h?this.data.exportValue:""};y=d.Name.get(h?this.data.exportValue:"Off");g.set("V",y);g.set("AS",y);g.set("M","D:".concat((0,l.getModificationDate)()));v=t.xref.encrypt;k=null;v&&(k=v.createCipherTransform(this.ref.num,this.ref.gen));_=["".concat(this.ref.num," ").concat(this.ref.gen," obj\n")];(0,C.writeDict)(g,_,k);_.push("\nendobj\n");return r.abrupt("return",[{ref:this.ref,data:_.join(""),xfa:m}]);case 24:case"end":return r.stop()}}),_callee8,this)}))),function _saveCheckbox(t,r,c){return o.apply(this,arguments)})},{key:"_saveRadioButton",value:(r=_asyncToGenerator(c.default.mark((function _callee9(t,r,o){var u,h,g,m,y,v,k,_,w,S,x,O;return c.default.wrap((function _callee9$(r){for(;;)switch(r.prev=r.next){case 0:if(o){r.next=2;break}return r.abrupt("return",null);case 2:u=o.get(this.data.id);if(void 0!==(h=u&&u.value)){r.next=6;break}return r.abrupt("return",null);case 6:if(this.data.fieldValue===this.data.buttonValue!==h){r.next=9;break}return r.abrupt("return",null);case 9:if((g=t.xref.fetchIfRef(this.ref))instanceof d.Dict){r.next=12;break}return r.abrupt("return",null);case 12:m={path:(0,l.stringToPDFString)(g.get("T")||""),value:h?this.data.buttonValue:""};y=d.Name.get(h?this.data.buttonValue:"Off");v=null;k=t.xref.encrypt;if(h)if(this.parent instanceof d.Ref){_=t.xref.fetch(this.parent);w=null;k&&(w=k.createCipherTransform(this.parent.num,this.parent.gen));_.set("V",y);v=["".concat(this.parent.num," ").concat(this.parent.gen," obj\n")];(0,C.writeDict)(_,v,w);v.push("\nendobj\n")}else this.parent instanceof d.Dict&&this.parent.set("V",y);g.set("AS",y);g.set("M","D:".concat((0,l.getModificationDate)()));S=null;k&&(S=k.createCipherTransform(this.ref.num,this.ref.gen));x=["".concat(this.ref.num," ").concat(this.ref.gen," obj\n")];(0,C.writeDict)(g,x,S);x.push("\nendobj\n");O=[{ref:this.ref,data:x.join(""),xfa:m}];null!==v&&O.push({ref:this.parent,data:v.join(""),xfa:null});return r.abrupt("return",O);case 27:case"end":return r.stop()}}),_callee9,this)}))),function _saveRadioButton(t,o,c){return r.apply(this,arguments)})},{key:"_getDefaultCheckedAppearance",value:function _getDefaultCheckedAppearance(t,r){var o,c,u=this.data.rect[2]-this.data.rect[0],h=this.data.rect[3]-this.data.rect[1],g=[0,0,u,h],m=.8*Math.min(u,h);if("check"===r){o={width:.755*m,height:.705*m};c="3"}else if("disc"===r){o={width:.791*m,height:.705*m};c="l"}else(0,l.unreachable)("_getDefaultCheckedAppearance - unsupported type: ".concat(r));var y=(u-o.width)/2,v=(h-o.height)/2,k="q BT /PdfJsZaDb ".concat(m," Tf 0 g ").concat(y," ").concat(v," Td (").concat(c,") Tj ET Q"),_=new d.Dict(t.xref);_.set("FormType",1);_.set("Subtype",d.Name.get("Form"));_.set("Type",d.Name.get("XObject"));_.set("BBox",g);_.set("Matrix",[1,0,0,1,0,0]);_.set("Length",k.length);var w=new d.Dict(t.xref),C=new d.Dict(t.xref);C.set("PdfJsZaDb",this.fallbackFontDict);w.set("Font",C);_.set("Resources",w);this.checkedAppearance=new S.StringStream(k);this.checkedAppearance.dict=_;this._streams.push(this.checkedAppearance)}},{key:"_processCheckBox",value:function _processCheckBox(t){var r=t.dict.get("AP");if(r instanceof d.Dict){var o=r.get("N");if(o instanceof d.Dict){var c=this._decodeFormValue(t.dict.get("AS"));"string"==typeof c&&(this.data.fieldValue=c);var l=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",u=o.getKeys();if(0===u.length)u.push("Off",l);else if(1===u.length)"Off"===u[0]?u.push(l):u.unshift("Off");else if(u.includes(l)){u.length=0;u.push("Off",l)}else{var h=u.find((function(t){return"Off"!==t}));u.length=0;u.push("Off",h)}u.includes(this.data.fieldValue)||(this.data.fieldValue="Off");this.data.exportValue=u[1];this.checkedAppearance=o.get(this.data.exportValue)||null;this.uncheckedAppearance=o.get("Off")||null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(t,"check");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}}}},{key:"_processRadioButton",value:function _processRadioButton(t){this.data.fieldValue=this.data.buttonValue=null;var r=t.dict.get("Parent");if(r instanceof d.Dict){this.parent=t.dict.getRaw("Parent");var o=r.get("V");o instanceof d.Name&&(this.data.fieldValue=this._decodeFormValue(o))}var c=t.dict.get("AP");if(c instanceof d.Dict){var l=c.get("N");if(l instanceof d.Dict){var u,h=_createForOfIteratorHelper(l.getKeys());try{for(h.s();!(u=h.n()).done;){var g=u.value;if("Off"!==g){this.data.buttonValue=this._decodeFormValue(g);break}}}catch(t){h.e(t)}finally{h.f()}this.checkedAppearance=l.get(this.data.buttonValue)||null;this.uncheckedAppearance=l.get("Off")||null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(t,"disc");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}}}},{key:"_processPushButton",value:function _processPushButton(t){if(t.dict.has("A")||t.dict.has("AA")||this.data.alternativeText){this.data.isTooltipOnly=!t.dict.has("A")&&!t.dict.has("AA");y.Catalog.parseDestDictionary({destDict:t.dict,resultObj:this.data,docBaseUrl:t.pdfManager.docBaseUrl})}else(0,l.warn)("Push buttons without action dictionaries are not supported")}},{key:"getFieldObject",value:function getFieldObject(){var t,r="button";if(this.data.checkBox){r="checkbox";t=this.data.exportValue}else if(this.data.radioButton){r="radiobutton";t=this.data.buttonValue}return{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:t,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:r}}},{key:"fallbackFontDict",get:function get(){var t=new d.Dict;t.set("BaseFont",d.Name.get("ZapfDingbats"));t.set("Type",d.Name.get("FallbackType"));t.set("Subtype",d.Name.get("FallbackType"));t.set("Encoding",d.Name.get("ZapfDingbatsEncoding"));return(0,l.shadow)(this,"fallbackFontDict",t)}}]);return ButtonWidgetAnnotation}(R),L=function(t){_inherits(ChoiceWidgetAnnotation,t);var r=_createSuper(ChoiceWidgetAnnotation);function ChoiceWidgetAnnotation(t){var o;_classCallCheck(this,ChoiceWidgetAnnotation);(o=r.call(this,t)).data.options=[];var c=(0,u.getInheritableProperty)({dict:t.dict,key:"Opt"});if(Array.isArray(c))for(var h=t.xref,d=0,g=c.length;d<g;d++){var m=h.fetchIfRef(c[d]),y=Array.isArray(m);o.data.options[d]={exportValue:o._decodeFormValue(y?h.fetchIfRef(m[0]):m),displayValue:o._decodeFormValue(y?h.fetchIfRef(m[1]):m)}}"string"==typeof o.data.fieldValue?o.data.fieldValue=[o.data.fieldValue]:o.data.fieldValue||(o.data.fieldValue=[]);o.data.combo=o.hasFieldFlag(l.AnnotationFieldFlag.COMBO);o.data.multiSelect=o.hasFieldFlag(l.AnnotationFieldFlag.MULTISELECT);o._hasText=!0;return o}_createClass(ChoiceWidgetAnnotation,[{key:"getFieldObject",value:function getFieldObject(){var t=this.data.combo?"combobox":"listbox",r=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:r,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:t}}}]);return ChoiceWidgetAnnotation}(R),N=function(t){_inherits(SignatureWidgetAnnotation,t);var r=_createSuper(SignatureWidgetAnnotation);function SignatureWidgetAnnotation(t){var o;_classCallCheck(this,SignatureWidgetAnnotation);(o=r.call(this,t)).data.fieldValue=null;return o}_createClass(SignatureWidgetAnnotation,[{key:"getFieldObject",value:function getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}]);return SignatureWidgetAnnotation}(R),U=function(t){_inherits(TextAnnotation,t);var r=_createSuper(TextAnnotation);function TextAnnotation(t){var o;_classCallCheck(this,TextAnnotation);o=r.call(this,t);var c=t.dict;o.data.annotationType=l.AnnotationType.TEXT;if(o.data.hasAppearance)o.data.name="NoIcon";else{o.data.rect[1]=o.data.rect[3]-22;o.data.rect[2]=o.data.rect[0]+22;o.data.name=c.has("Name")?c.get("Name").name:"Note"}if(c.has("State")){o.data.state=c.get("State")||null;o.data.stateModel=c.get("StateModel")||null}else{o.data.state=null;o.data.stateModel=null}return o}return _createClass(TextAnnotation)}(M),H=function(t){_inherits(LinkAnnotation,t);var r=_createSuper(LinkAnnotation);function LinkAnnotation(t){var o;_classCallCheck(this,LinkAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.LINK;var c=getQuadPoints(t.dict,o.rectangle);c&&(o.data.quadPoints=c);y.Catalog.parseDestDictionary({destDict:t.dict,resultObj:o.data,docBaseUrl:t.pdfManager.docBaseUrl});return o}return _createClass(LinkAnnotation)}(T),$=function(t){_inherits(PopupAnnotation,t);var r=_createSuper(PopupAnnotation);function PopupAnnotation(t){var o;_classCallCheck(this,PopupAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.POPUP;var c=t.dict.get("Parent");if(!c){(0,l.warn)("Popup annotation has a missing or invalid parent annotation.");return _possibleConstructorReturn(o)}var u=c.get("Subtype");o.data.parentType=u instanceof d.Name?u.name:null;var h=t.dict.getRaw("Parent");o.data.parentId=h instanceof d.Ref?h.toString():null;var g=c.getArray("Rect");Array.isArray(g)&&4===g.length?o.data.parentRect=l.Util.normalizeRect(g):o.data.parentRect=[0,0,0,0];var m=c.get("RT");(0,d.isName)(m,l.AnnotationReplyType.GROUP)&&(c=c.get("IRT"));if(c.has("M")){o.setModificationDate(c.get("M"));o.data.modificationDate=o.modificationDate}else o.data.modificationDate=null;if(c.has("C")){o.setColor(c.getArray("C"));o.data.color=o.color}else o.data.color=null;if(!o.viewable){var y=c.get("F");o._isViewable(y)&&o.setFlags(y)}o.setTitle(c.get("T"));o.data.titleObj=o._title;o.setContents(c.get("Contents"));o.data.contentsObj=o._contents;c.has("RC")&&(o.data.richText=x.XFAFactory.getRichTextAsHtml(c.get("RC")));return o}return _createClass(PopupAnnotation)}(T),X=function(t){_inherits(FreeTextAnnotation,t);var r=_createSuper(FreeTextAnnotation);function FreeTextAnnotation(t){var o;_classCallCheck(this,FreeTextAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.FREETEXT;return o}return _createClass(FreeTextAnnotation)}(M),q=function(t){_inherits(LineAnnotation,t);var r=_createSuper(LineAnnotation);function LineAnnotation(t){var o;_classCallCheck(this,LineAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.LINE;var c=t.dict.getArray("L");o.data.lineCoordinates=l.Util.normalizeRect(c);if(!o.appearance){var u=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],h=t.dict.get("CA"),d=null,g=t.dict.getArray("IC");g&&(d=(g=getRgbColor(g,null))?Array.from(g).map((function(t){return t/255})):null);var m=d?h:null,y=o.borderStyle.width||1,v=2*y,k=[o.data.lineCoordinates[0]-v,o.data.lineCoordinates[1]-v,o.data.lineCoordinates[2]+v,o.data.lineCoordinates[3]+v];l.Util.intersect(o.rectangle,k)||(o.rectangle=k);o._setDefaultAppearance({xref:t.xref,extra:"".concat(y," w"),strokeColor:u,fillColor:d,strokeAlpha:h,fillAlpha:m,pointsCallback:function pointsCallback(t,r){t.push("".concat(c[0]," ").concat(c[1]," m"),"".concat(c[2]," ").concat(c[3]," l"),"S");return[r[0].x-y,r[1].x+y,r[3].y-y,r[1].y+y]}})}return o}return _createClass(LineAnnotation)}(M),G=function(t){_inherits(SquareAnnotation,t);var r=_createSuper(SquareAnnotation);function SquareAnnotation(t){var o;_classCallCheck(this,SquareAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.SQUARE;if(!o.appearance){var c=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],u=t.dict.get("CA"),h=null,d=t.dict.getArray("IC");if(d){d=getRgbColor(d,null);h=d?Array.from(d).map((function(t){return t/255})):null}var g=h?u:null;if(0===o.borderStyle.width&&!h)return _possibleConstructorReturn(o);o._setDefaultAppearance({xref:t.xref,extra:"".concat(o.borderStyle.width," w"),strokeColor:c,fillColor:h,strokeAlpha:u,fillAlpha:g,pointsCallback:function pointsCallback(t,r){var c=r[2].x+o.borderStyle.width/2,l=r[2].y+o.borderStyle.width/2,u=r[3].x-r[2].x-o.borderStyle.width,d=r[1].y-r[3].y-o.borderStyle.width;t.push("".concat(c," ").concat(l," ").concat(u," ").concat(d," re"));h?t.push("B"):t.push("S");return[r[0].x,r[1].x,r[3].y,r[1].y]}})}return o}return _createClass(SquareAnnotation)}(M),z=function(t){_inherits(CircleAnnotation,t);var r=_createSuper(CircleAnnotation);function CircleAnnotation(t){var o;_classCallCheck(this,CircleAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.CIRCLE;if(!o.appearance){var c=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],u=t.dict.get("CA"),h=null,d=t.dict.getArray("IC");if(d){d=getRgbColor(d,null);h=d?Array.from(d).map((function(t){return t/255})):null}var g=h?u:null;if(0===o.borderStyle.width&&!h)return _possibleConstructorReturn(o);var m=4/3*Math.tan(Math.PI/8);o._setDefaultAppearance({xref:t.xref,extra:"".concat(o.borderStyle.width," w"),strokeColor:c,fillColor:h,strokeAlpha:u,fillAlpha:g,pointsCallback:function pointsCallback(t,r){var c=r[0].x+o.borderStyle.width/2,l=r[0].y-o.borderStyle.width/2,u=r[3].x-o.borderStyle.width/2,d=r[3].y+o.borderStyle.width/2,g=c+(u-c)/2,y=l+(d-l)/2,v=(u-c)/2*m,k=(d-l)/2*m;t.push("".concat(g," ").concat(d," m"),"".concat(g+v," ").concat(d," ").concat(u," ").concat(y+k," ").concat(u," ").concat(y," c"),"".concat(u," ").concat(y-k," ").concat(g+v," ").concat(l," ").concat(g," ").concat(l," c"),"".concat(g-v," ").concat(l," ").concat(c," ").concat(y-k," ").concat(c," ").concat(y," c"),"".concat(c," ").concat(y+k," ").concat(g-v," ").concat(d," ").concat(g," ").concat(d," c"),"h");h?t.push("B"):t.push("S");return[r[0].x,r[1].x,r[3].y,r[1].y]}})}return o}return _createClass(CircleAnnotation)}(M),W=function(t){_inherits(PolylineAnnotation,t);var r=_createSuper(PolylineAnnotation);function PolylineAnnotation(t){var o;_classCallCheck(this,PolylineAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.POLYLINE;o.data.vertices=[];var c=t.dict.getArray("Vertices");if(!Array.isArray(c))return _possibleConstructorReturn(o);for(var u=0,h=c.length;u<h;u+=2)o.data.vertices.push({x:c[u],y:c[u+1]});if(!o.appearance){var d,g=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],m=t.dict.get("CA"),y=o.borderStyle.width||1,v=2*y,k=[1/0,1/0,-1/0,-1/0],_=_createForOfIteratorHelper(o.data.vertices);try{for(_.s();!(d=_.n()).done;){var w=d.value;k[0]=Math.min(k[0],w.x-v);k[1]=Math.min(k[1],w.y-v);k[2]=Math.max(k[2],w.x+v);k[3]=Math.max(k[3],w.y+v)}}catch(t){_.e(t)}finally{_.f()}l.Util.intersect(o.rectangle,k)||(o.rectangle=k);o._setDefaultAppearance({xref:t.xref,extra:"".concat(y," w"),strokeColor:g,strokeAlpha:m,pointsCallback:function pointsCallback(t,r){for(var c=o.data.vertices,l=0,u=c.length;l<u;l++)t.push("".concat(c[l].x," ").concat(c[l].y," ").concat(0===l?"m":"l"));t.push("S");return[r[0].x,r[1].x,r[3].y,r[1].y]}})}return o}return _createClass(PolylineAnnotation)}(M),V=function(t){_inherits(PolygonAnnotation,t);var r=_createSuper(PolygonAnnotation);function PolygonAnnotation(t){var o;_classCallCheck(this,PolygonAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.POLYGON;return o}return _createClass(PolygonAnnotation)}(W),K=function(t){_inherits(CaretAnnotation,t);var r=_createSuper(CaretAnnotation);function CaretAnnotation(t){var o;_classCallCheck(this,CaretAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.CARET;return o}return _createClass(CaretAnnotation)}(M),Y=function(t){_inherits(InkAnnotation,t);var r=_createSuper(InkAnnotation);function InkAnnotation(t){var o;_classCallCheck(this,InkAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.INK;o.data.inkLists=[];var c=t.dict.getArray("InkList");if(!Array.isArray(c))return _possibleConstructorReturn(o);for(var u=t.xref,h=0,d=c.length;h<d;++h){o.data.inkLists.push([]);for(var g=0,m=c[h].length;g<m;g+=2)o.data.inkLists[h].push({x:u.fetchIfRef(c[h][g]),y:u.fetchIfRef(c[h][g+1])})}if(!o.appearance){var y,v=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],k=t.dict.get("CA"),_=o.borderStyle.width||1,w=2*_,S=[1/0,1/0,-1/0,-1/0],C=_createForOfIteratorHelper(o.data.inkLists);try{for(C.s();!(y=C.n()).done;){var x,O=_createForOfIteratorHelper(y.value);try{for(O.s();!(x=O.n()).done;){var T=x.value;S[0]=Math.min(S[0],T.x-w);S[1]=Math.min(S[1],T.y-w);S[2]=Math.max(S[2],T.x+w);S[3]=Math.max(S[3],T.y+w)}}catch(t){O.e(t)}finally{O.f()}}}catch(t){C.e(t)}finally{C.f()}l.Util.intersect(o.rectangle,S)||(o.rectangle=S);o._setDefaultAppearance({xref:t.xref,extra:"".concat(_," w"),strokeColor:v,strokeAlpha:k,pointsCallback:function pointsCallback(t,r){var c,l=_createForOfIteratorHelper(o.data.inkLists);try{for(l.s();!(c=l.n()).done;){for(var u=c.value,h=0,d=u.length;h<d;h++)t.push("".concat(u[h].x," ").concat(u[h].y," ").concat(0===h?"m":"l"));t.push("S")}}catch(t){l.e(t)}finally{l.f()}return[r[0].x,r[1].x,r[3].y,r[1].y]}})}return o}return _createClass(InkAnnotation)}(M),J=function(t){_inherits(HighlightAnnotation,t);var r=_createSuper(HighlightAnnotation);function HighlightAnnotation(t){var o;_classCallCheck(this,HighlightAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.HIGHLIGHT;if(o.data.quadPoints=getQuadPoints(t.dict,null)){var c=o.appearance&&o.appearance.dict.get("Resources");if(!o.appearance||!c||!c.has("ExtGState")){o.appearance&&(0,l.warn)("HighlightAnnotation - ignoring built-in appearance stream.");var u=o.color?Array.from(o.color).map((function(t){return t/255})):[1,1,0],h=t.dict.get("CA");o._setDefaultAppearance({xref:t.xref,fillColor:u,blendMode:"Multiply",fillAlpha:h,pointsCallback:function pointsCallback(t,r){t.push("".concat(r[0].x," ").concat(r[0].y," m"),"".concat(r[1].x," ").concat(r[1].y," l"),"".concat(r[3].x," ").concat(r[3].y," l"),"".concat(r[2].x," ").concat(r[2].y," l"),"f");return[r[0].x,r[1].x,r[3].y,r[1].y]}})}}else o.data.hasPopup=!1;return o}return _createClass(HighlightAnnotation)}(M),Z=function(t){_inherits(UnderlineAnnotation,t);var r=_createSuper(UnderlineAnnotation);function UnderlineAnnotation(t){var o;_classCallCheck(this,UnderlineAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.UNDERLINE;if(o.data.quadPoints=getQuadPoints(t.dict,null)){if(!o.appearance){var c=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],u=t.dict.get("CA");o._setDefaultAppearance({xref:t.xref,extra:"[] 0 d 1 w",strokeColor:c,strokeAlpha:u,pointsCallback:function pointsCallback(t,r){t.push("".concat(r[2].x," ").concat(r[2].y," m"),"".concat(r[3].x," ").concat(r[3].y," l"),"S");return[r[0].x,r[1].x,r[3].y,r[1].y]}})}}else o.data.hasPopup=!1;return o}return _createClass(UnderlineAnnotation)}(M),Q=function(t){_inherits(SquigglyAnnotation,t);var r=_createSuper(SquigglyAnnotation);function SquigglyAnnotation(t){var o;_classCallCheck(this,SquigglyAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.SQUIGGLY;if(o.data.quadPoints=getQuadPoints(t.dict,null)){if(!o.appearance){var c=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],u=t.dict.get("CA");o._setDefaultAppearance({xref:t.xref,extra:"[] 0 d 1 w",strokeColor:c,strokeAlpha:u,pointsCallback:function pointsCallback(t,r){var o=(r[0].y-r[2].y)/6,c=o,l=r[2].x,u=r[2].y,h=r[3].x;t.push("".concat(l," ").concat(u+c," m"));do{l+=2;c=0===c?o:0;t.push("".concat(l," ").concat(u+c," l"))}while(l<h);t.push("S");return[r[2].x,h,u-2*o,u+2*o]}})}}else o.data.hasPopup=!1;return o}return _createClass(SquigglyAnnotation)}(M),ee=function(t){_inherits(StrikeOutAnnotation,t);var r=_createSuper(StrikeOutAnnotation);function StrikeOutAnnotation(t){var o;_classCallCheck(this,StrikeOutAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.STRIKEOUT;if(o.data.quadPoints=getQuadPoints(t.dict,null)){if(!o.appearance){var c=o.color?Array.from(o.color).map((function(t){return t/255})):[0,0,0],u=t.dict.get("CA");o._setDefaultAppearance({xref:t.xref,extra:"[] 0 d 1 w",strokeColor:c,strokeAlpha:u,pointsCallback:function pointsCallback(t,r){t.push("".concat((r[0].x+r[2].x)/2," ")+"".concat((r[0].y+r[2].y)/2," m"),"".concat((r[1].x+r[3].x)/2," ")+"".concat((r[1].y+r[3].y)/2," l"),"S");return[r[0].x,r[1].x,r[3].y,r[1].y]}})}}else o.data.hasPopup=!1;return o}return _createClass(StrikeOutAnnotation)}(M),te=function(t){_inherits(StampAnnotation,t);var r=_createSuper(StampAnnotation);function StampAnnotation(t){var o;_classCallCheck(this,StampAnnotation);(o=r.call(this,t)).data.annotationType=l.AnnotationType.STAMP;return o}return _createClass(StampAnnotation)}(M),re=function(t){_inherits(FileAttachmentAnnotation,t);var r=_createSuper(FileAttachmentAnnotation);function FileAttachmentAnnotation(t){var o;_classCallCheck(this,FileAttachmentAnnotation);o=r.call(this,t);var c=new k.FileSpec(t.dict.get("FS"),t.xref);o.data.annotationType=l.AnnotationType.FILEATTACHMENT;o.data.file=c.serializable;return o}return _createClass(FileAttachmentAnnotation)}(M)},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.createDefaultAppearance=function createDefaultAppearance(t){var r,o=t.fontSize,c=t.fontName,l=t.fontColor;r=l.every((function(t){return 0===t}))?"0 g":Array.from(l).map((function(t){return(t/255).toFixed(2)})).join(" ")+" rg";return"/".concat((0,u.escapePDFName)(c)," ").concat(o," Tf ").concat(r)};r.parseDefaultAppearance=function parseDefaultAppearance(t){return new m(t).parse()};var c=o(4),l=o(165),u=o(149),h=o(166),d=o(146),g=o(151);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var m=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(DefaultAppearanceEvaluator,t);var r=_createSuper(DefaultAppearanceEvaluator);function DefaultAppearanceEvaluator(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,DefaultAppearanceEvaluator);return r.call(this,new g.StringStream(t))}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(DefaultAppearanceEvaluator,[{key:"parse",value:function parse(){var t={fn:0,args:[]},r={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){t.args.length=0;if(!this.read(t))break;if(0===this.savedStatesDepth){var o=t.fn,u=t.args;switch(0|o){case c.OPS.setFont:var h=_slicedToArray(u,2),g=h[0],m=h[1];g instanceof d.Name&&(r.fontName=g.name);"number"==typeof m&&m>0&&(r.fontSize=m);break;case c.OPS.setFillRGBColor:l.ColorSpace.singletons.rgb.getRgbItem(u,0,r.fontColor,0);break;case c.OPS.setFillGray:l.ColorSpace.singletons.gray.getRgbItem(u,0,r.fontColor,0);break;case c.OPS.setFillColorSpace:l.ColorSpace.singletons.cmyk.getRgbItem(u,0,r.fontColor,0)}}}}catch(t){(0,c.warn)('parseDefaultAppearance - ignoring errors: "'.concat(t,'".'))}return r}}]);return DefaultAppearanceEvaluator}(h.EvaluatorPreprocessor)},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.ColorSpace=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(146),h=o(150),d=o(149);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var g=function(){function ColorSpace(t,r){_classCallCheck(this,ColorSpace);this.constructor===ColorSpace&&(0,l.unreachable)("Cannot initialize ColorSpace.");this.name=t;this.numComps=r}_createClass(ColorSpace,[{key:"getRgb",value:function getRgb(t,r){var o=new Uint8ClampedArray(3);this.getRgbItem(t,r,o,0);return o}},{key:"getRgbItem",value:function getRgbItem(t,r,o,c){(0,l.unreachable)("Should not call ColorSpace.getRgbItem")}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,u,h,d){(0,l.unreachable)("Should not call ColorSpace.getRgbBuffer")}},{key:"getOutputLength",value:function getOutputLength(t,r){(0,l.unreachable)("Should not call ColorSpace.getOutputLength")}},{key:"isPassthrough",value:function isPassthrough(t){return!1}},{key:"isDefaultDecode",value:function isDefaultDecode(t,r){return ColorSpace.isDefaultDecode(t,this.numComps)}},{key:"fillRgb",value:function fillRgb(t,r,o,c,l,u,h,d,g){var m=r*o,y=null,v=1<<h,k=o!==l||r!==c;if(this.isPassthrough(h))y=d;else if(1===this.numComps&&m>v&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){for(var _=h<=8?new Uint8Array(v):new Uint16Array(v),w=0;w<v;w++)_[w]=w;var S=new Uint8ClampedArray(3*v);this.getRgbBuffer(_,0,v,S,0,h,0);if(k){y=new Uint8Array(3*m);for(var C=0,x=0;x<m;++x){var O=3*d[x];y[C++]=S[O];y[C++]=S[O+1];y[C++]=S[O+2]}}else for(var T=0,E=0;E<m;++E){var M=3*d[E];t[T++]=S[M];t[T++]=S[M+1];t[T++]=S[M+2];T+=g}}else if(k){y=new Uint8ClampedArray(3*m);this.getRgbBuffer(d,0,m,y,0,h,0)}else this.getRgbBuffer(d,0,c*u,t,0,h,g);if(y)if(k)!function resizeRgbImage(t,r,o,c,l,u,h){h=1!==h?0:h;for(var d,g=o/l,m=c/u,y=0,v=new Uint16Array(l),k=3*o,_=0;_<l;_++)v[_]=3*Math.floor(_*g);for(var w=0;w<u;w++)for(var S=Math.floor(w*m)*k,C=0;C<l;C++){d=S+v[C];r[y++]=t[d++];r[y++]=t[d++];r[y++]=t[d++];y+=h}}(y,t,r,o,c,l,g);else for(var R=0,j=0,D=0,L=c*u;D<L;D++){t[R++]=y[j++];t[R++]=y[j++];t[R++]=y[j++];R+=g}}},{key:"usesZeroToOneRange",get:function get(){return(0,l.shadow)(this,"usesZeroToOneRange",!0)}}],[{key:"_cache",value:function _cache(t,r,o,c){if(!o)throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');if(!c)throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');var l,h;if(t instanceof u.Ref){h=t;t=r.fetch(t)}t instanceof u.Name&&(l=t.name);(l||h)&&o.set(l,h,c)}},{key:"getCached",value:function getCached(t,r,o){if(!o)throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');if(t instanceof u.Ref){var c=o.getByRef(t);if(c)return c;try{t=r.fetch(t)}catch(t){if(t instanceof d.MissingDataException)throw t}}if(t instanceof u.Name){var l=o.getByName(t.name);if(l)return l}return null}},{key:"parseAsync",value:(t=function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}(c.default.mark((function _callee(t){var r,o,l,u,h,d,g;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:r=t.cs,o=t.xref,l=t.resources,u=void 0===l?null:l,h=t.pdfFunctionFactory,d=t.localColorSpaceCache;g=this._parse(r,o,u,h);this._cache(r,o,d,g);return c.abrupt("return",g);case 4:case"end":return c.stop()}}),_callee,this)}))),function parseAsync(r){return t.apply(this,arguments)})},{key:"parse",value:function parse(t){var r=t.cs,o=t.xref,c=t.resources,l=void 0===c?null:c,u=t.pdfFunctionFactory,h=t.localColorSpaceCache,d=this.getCached(r,o,h);if(d)return d;var g=this._parse(r,o,l,u);this._cache(r,o,h,g);return g}},{key:"_parse",value:function _parse(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,c=arguments.length>3?arguments[3]:void 0;if((t=r.fetchIfRef(t))instanceof u.Name)switch(t.name){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"Pattern":return new y(null);default:if(o instanceof u.Dict){var h=o.get("ColorSpace");if(h instanceof u.Dict){var d=h.get(t.name);if(d){if(d instanceof u.Name)return this._parse(d,r,o,c);t=d;break}}}throw new l.FormatError("Unrecognized ColorSpace: ".concat(t.name))}if(Array.isArray(t)){var g,k,_,w,O,T,E=r.fetchIfRef(t[0]).name;switch(E){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"CalGray":w=(g=r.fetchIfRef(t[1])).getArray("WhitePoint");O=g.getArray("BlackPoint");T=g.get("Gamma");return new S(w,O,T);case"CalRGB":w=(g=r.fetchIfRef(t[1])).getArray("WhitePoint");O=g.getArray("BlackPoint");T=g.getArray("Gamma");var M=g.getArray("Matrix");return new C(w,O,T,M);case"ICCBased":var R=r.fetchIfRef(t[1]),j=R.dict;k=j.get("N");var D=j.get("Alternate");if(D){var L=this._parse(D,r,o,c);if(L.numComps===k)return L;(0,l.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===k)return this.singletons.gray;if(3===k)return this.singletons.rgb;if(4===k)return this.singletons.cmyk;break;case"Pattern":(_=t[1]||null)&&(_=this._parse(_,r,o,c));return new y(_);case"I":case"Indexed":_=this._parse(t[1],r,o,c);var N=r.fetchIfRef(t[2])+1,U=r.fetchIfRef(t[3]);return new v(_,N,U);case"Separation":case"DeviceN":var H=r.fetchIfRef(t[1]);k=Array.isArray(H)?H.length:1;_=this._parse(t[2],r,o,c);var $=c.create(t[3]);return new m(k,_,$);case"Lab":w=(g=r.fetchIfRef(t[1])).getArray("WhitePoint");O=g.getArray("BlackPoint");var X=g.getArray("Range");return new x(w,O,X);default:throw new l.FormatError("Unimplemented ColorSpace object: ".concat(E))}}throw new l.FormatError("Unrecognized ColorSpace object: ".concat(t))}},{key:"isDefaultDecode",value:function isDefaultDecode(t,r){if(!Array.isArray(t))return!0;if(2*r!==t.length){(0,l.warn)("The decode map is not the correct length");return!0}for(var o=0,c=t.length;o<c;o+=2)if(0!==t[o]||1!==t[o+1])return!1;return!0}},{key:"singletons",get:function get(){return(0,l.shadow)(this,"singletons",{get gray(){return(0,l.shadow)(this,"gray",new k)},get rgb(){return(0,l.shadow)(this,"rgb",new _)},get cmyk(){return(0,l.shadow)(this,"cmyk",new w)}})}}]);var t;return ColorSpace}();r.ColorSpace=g;var m=function(t){_inherits(AlternateCS,t);var r=_createSuper(AlternateCS);function AlternateCS(t,o,c){var l;_classCallCheck(this,AlternateCS);(l=r.call(this,"Alternate",t)).base=o;l.tintFn=c;l.tmpBuf=new Float32Array(o.numComps);return l}_createClass(AlternateCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){var l=this.tmpBuf;this.tintFn(t,r,l,0);this.base.getRgbItem(l,0,o,c)}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){var d,g,m=this.tintFn,y=this.base,v=1/((1<<u)-1),k=y.numComps,_=y.usesZeroToOneRange,w=(y.isPassthrough(8)||!_)&&0===h,S=w?l:0,C=w?c:new Uint8ClampedArray(k*o),x=this.numComps,O=new Float32Array(x),T=new Float32Array(k);for(d=0;d<o;d++){for(g=0;g<x;g++)O[g]=t[r++]*v;m(O,0,T,0);if(_)for(g=0;g<k;g++)C[S++]=255*T[g];else{y.getRgbItem(T,0,C,S);S+=k}}w||y.getRgbBuffer(C,0,o,c,l,8,h)}},{key:"getOutputLength",value:function getOutputLength(t,r){return this.base.getOutputLength(t*this.base.numComps/this.numComps,r)}}]);return AlternateCS}(g),y=function(t){_inherits(PatternCS,t);var r=_createSuper(PatternCS);function PatternCS(t){var o;_classCallCheck(this,PatternCS);(o=r.call(this,"Pattern",null)).base=t;return o}_createClass(PatternCS,[{key:"isDefaultDecode",value:function isDefaultDecode(t,r){(0,l.unreachable)("Should not call PatternCS.isDefaultDecode")}}]);return PatternCS}(g),v=function(t){_inherits(IndexedCS,t);var r=_createSuper(IndexedCS);function IndexedCS(t,o,c){var u;_classCallCheck(this,IndexedCS);(u=r.call(this,"Indexed",1)).base=t;u.highVal=o;var d=t.numComps*o;u.lookup=new Uint8Array(d);if(c instanceof h.BaseStream){var g=c.getBytes(d);u.lookup.set(g)}else{if("string"!=typeof c)throw new l.FormatError("IndexedCS - unrecognized lookup table: ".concat(c));for(var m=0;m<d;++m)u.lookup[m]=255&c.charCodeAt(m)}return u}_createClass(IndexedCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){var l=this.base.numComps,u=t[r]*l;this.base.getRgbBuffer(this.lookup,u,1,o,c,8,0)}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){for(var d=this.base,g=d.numComps,m=d.getOutputLength(g,h),y=this.lookup,v=0;v<o;++v){var k=t[r++]*g;d.getRgbBuffer(y,k,1,c,l,8,h);l+=m}}},{key:"getOutputLength",value:function getOutputLength(t,r){return this.base.getOutputLength(t*this.base.numComps,r)}},{key:"isDefaultDecode",value:function isDefaultDecode(t,r){if(!Array.isArray(t))return!0;if(2!==t.length){(0,l.warn)("Decode map length is not correct");return!0}if(!Number.isInteger(r)||r<1){(0,l.warn)("Bits per component is not correct");return!0}return 0===t[0]&&t[1]===(1<<r)-1}}]);return IndexedCS}(g),k=function(t){_inherits(DeviceGrayCS,t);var r=_createSuper(DeviceGrayCS);function DeviceGrayCS(){_classCallCheck(this,DeviceGrayCS);return r.call(this,"DeviceGray",1)}_createClass(DeviceGrayCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){var l=255*t[r];o[c]=o[c+1]=o[c+2]=l}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){for(var d=255/((1<<u)-1),g=r,m=l,y=0;y<o;++y){var v=d*t[g++];c[m++]=v;c[m++]=v;c[m++]=v;m+=h}}},{key:"getOutputLength",value:function getOutputLength(t,r){return t*(3+r)}}]);return DeviceGrayCS}(g),_=function(t){_inherits(DeviceRgbCS,t);var r=_createSuper(DeviceRgbCS);function DeviceRgbCS(){_classCallCheck(this,DeviceRgbCS);return r.call(this,"DeviceRGB",3)}_createClass(DeviceRgbCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){o[c]=255*t[r];o[c+1]=255*t[r+1];o[c+2]=255*t[r+2]}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){if(8!==u||0!==h)for(var d=255/((1<<u)-1),g=r,m=l,y=0;y<o;++y){c[m++]=d*t[g++];c[m++]=d*t[g++];c[m++]=d*t[g++];m+=h}else c.set(t.subarray(r,r+3*o),l)}},{key:"getOutputLength",value:function getOutputLength(t,r){return t*(3+r)/3|0}},{key:"isPassthrough",value:function isPassthrough(t){return 8===t}}]);return DeviceRgbCS}(g),w=function DeviceCmykCSClosure(){function convertToRgb(t,r,o,c,l){var u=t[r]*o,h=t[r+1]*o,d=t[r+2]*o,g=t[r+3]*o;c[l]=255+u*(-4.387332384609988*u+54.48615194189176*h+18.82290502165302*d+212.25662451639585*g-285.2331026137004)+h*(1.7149763477362134*h-5.6096736904047315*d+-17.873870861415444*g-5.497006427196366)+d*(-2.5217340131683033*d-21.248923337353073*g+17.5119270841813)+g*(-21.86122147463605*g-189.48180835922747);c[l+1]=255+u*(8.841041422036149*u+60.118027045597366*h+6.871425592049007*d+31.159100130055922*g-79.2970844816548)+h*(-15.310361306967817*h+17.575251261109482*d+131.35250912493976*g-190.9453302588951)+d*(4.444339102852739*d+9.8632861493405*g-24.86741582555878)+g*(-20.737325471181034*g-187.80453709719578);c[l+2]=255+u*(.8842522430003296*u+8.078677503112928*h+30.89978309703729*d-.23883238689178934*g-14.183576799673286)+h*(10.49593273432072*h+63.02378494754052*d+50.606957656360734*g-112.23884253719248)+d*(.03296041114873217*d+115.60384449646641*g-193.58209356861505)+g*(-22.33816807309886*g-180.12613974708367)}return function(t){_inherits(DeviceCmykCS,t);var r=_createSuper(DeviceCmykCS);function DeviceCmykCS(){_classCallCheck(this,DeviceCmykCS);return r.call(this,"DeviceCMYK",4)}_createClass(DeviceCmykCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){convertToRgb(t,r,1,o,c)}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){for(var d=1/((1<<u)-1),g=0;g<o;g++){convertToRgb(t,r,d,c,l);r+=4;l+=3+h}}},{key:"getOutputLength",value:function getOutputLength(t,r){return t/4*(3+r)|0}}]);return DeviceCmykCS}(g)}(),S=function CalGrayCSClosure(){function convertToRgb(t,r,o,c,l,u){var h=r[o]*u,d=Math.pow(h,t.G),g=t.YW*d,m=Math.max(295.8*Math.pow(g,.3333333333333333)-40.8,0);c[l]=m;c[l+1]=m;c[l+2]=m}return function(t){_inherits(CalGrayCS,t);var r=_createSuper(CalGrayCS);function CalGrayCS(t,o,c){var u;_classCallCheck(this,CalGrayCS);u=r.call(this,"CalGray",1);if(!t)throw new l.FormatError("WhitePoint missing - required for color space CalGray");o=o||[0,0,0];c=c||1;u.XW=t[0];u.YW=t[1];u.ZW=t[2];u.XB=o[0];u.YB=o[1];u.ZB=o[2];u.G=c;if(u.XW<0||u.ZW<0||1!==u.YW)throw new l.FormatError("Invalid WhitePoint components for ".concat(u.name)+", no fallback available");if(u.XB<0||u.YB<0||u.ZB<0){(0,l.info)("Invalid BlackPoint for ".concat(u.name,", falling back to default."));u.XB=u.YB=u.ZB=0}0===u.XB&&0===u.YB&&0===u.ZB||(0,l.warn)("".concat(u.name,", BlackPoint: XB: ").concat(u.XB,", YB: ").concat(u.YB,", ")+"ZB: ".concat(u.ZB,", only default values are supported."));if(u.G<1){(0,l.info)("Invalid Gamma: ".concat(u.G," for ").concat(u.name,", ")+"falling back to default.");u.G=1}return u}_createClass(CalGrayCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){convertToRgb(this,t,r,o,c,1)}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){for(var d=1/((1<<u)-1),g=0;g<o;++g){convertToRgb(this,t,r,c,l,d);r+=1;l+=3+h}}},{key:"getOutputLength",value:function getOutputLength(t,r){return t*(3+r)}}]);return CalGrayCS}(g)}(),C=function CalRGBCSClosure(){var t=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]),r=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]),o=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]),c=new Float32Array([1,1,1]),u=new Float32Array(3),h=new Float32Array(3),d=new Float32Array(3),m=Math.pow(24/116,3)/8;function matrixProduct(t,r,o){o[0]=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];o[1]=t[3]*r[0]+t[4]*r[1]+t[5]*r[2];o[2]=t[6]*r[0]+t[7]*r[1]+t[8]*r[2]}function sRGBTransferFunction(t){return t<=.0031308?adjustToRange(0,1,12.92*t):t>=.99554525?1:adjustToRange(0,1,1.055*Math.pow(t,1/2.4)-.055)}function adjustToRange(t,r,o){return Math.max(t,Math.min(r,o))}function decodeL(t){return t<0?-decodeL(-t):t>8?Math.pow((t+16)/116,3):t*m}function convertToRgb(l,g,m,y,v,k){var _=adjustToRange(0,1,g[m]*k),w=adjustToRange(0,1,g[m+1]*k),S=adjustToRange(0,1,g[m+2]*k),C=1===_?1:Math.pow(_,l.GR),x=1===w?1:Math.pow(w,l.GG),O=1===S?1:Math.pow(S,l.GB),T=l.MXA*C+l.MXB*x+l.MXC*O,E=l.MYA*C+l.MYB*x+l.MYC*O,M=l.MZA*C+l.MZB*x+l.MZC*O,R=h;R[0]=T;R[1]=E;R[2]=M;var j=d;!function normalizeWhitePointToFlat(o,c,l){if(1!==o[0]||1!==o[2]){var h=l;matrixProduct(t,c,h);var d=u;!function convertToFlat(t,r,o){o[0]=1*r[0]/t[0];o[1]=1*r[1]/t[1];o[2]=1*r[2]/t[2]}(o,h,d);matrixProduct(r,d,l)}else{l[0]=c[0];l[1]=c[1];l[2]=c[2]}}(l.whitePoint,R,j);var D=h;!function compensateBlackPoint(t,r,o){if(0!==t[0]||0!==t[1]||0!==t[2]){var c=decodeL(0),l=(1-c)/(1-decodeL(t[0])),u=1-l,h=(1-c)/(1-decodeL(t[1])),d=1-h,g=(1-c)/(1-decodeL(t[2])),m=1-g;o[0]=r[0]*l+u;o[1]=r[1]*h+d;o[2]=r[2]*g+m}else{o[0]=r[0];o[1]=r[1];o[2]=r[2]}}(l.blackPoint,j,D);var L=d;!function normalizeWhitePointToD65(o,c,l){var h=l;matrixProduct(t,c,h);var d=u;!function convertToD65(t,r,o){o[0]=.95047*r[0]/t[0];o[1]=1*r[1]/t[1];o[2]=1.08883*r[2]/t[2]}(o,h,d);matrixProduct(r,d,l)}(c,D,L);var N=h;matrixProduct(o,L,N);y[v]=255*sRGBTransferFunction(N[0]);y[v+1]=255*sRGBTransferFunction(N[1]);y[v+2]=255*sRGBTransferFunction(N[2])}return function(t){_inherits(CalRGBCS,t);var r=_createSuper(CalRGBCS);function CalRGBCS(t,o,c,u){var h;_classCallCheck(this,CalRGBCS);h=r.call(this,"CalRGB",3);if(!t)throw new l.FormatError("WhitePoint missing - required for color space CalRGB");o=o||new Float32Array(3);c=c||new Float32Array([1,1,1]);u=u||new Float32Array([1,0,0,0,1,0,0,0,1]);var d=t[0],g=t[1],m=t[2];h.whitePoint=t;var y=o[0],v=o[1],k=o[2];h.blackPoint=o;h.GR=c[0];h.GG=c[1];h.GB=c[2];h.MXA=u[0];h.MYA=u[1];h.MZA=u[2];h.MXB=u[3];h.MYB=u[4];h.MZB=u[5];h.MXC=u[6];h.MYC=u[7];h.MZC=u[8];if(d<0||m<0||1!==g)throw new l.FormatError("Invalid WhitePoint components for ".concat(h.name)+", no fallback available");if(y<0||v<0||k<0){(0,l.info)("Invalid BlackPoint for ".concat(h.name," [").concat(y,", ").concat(v,", ").concat(k,"], ")+"falling back to default.");h.blackPoint=new Float32Array(3)}if(h.GR<0||h.GG<0||h.GB<0){(0,l.info)("Invalid Gamma [".concat(h.GR,", ").concat(h.GG,", ").concat(h.GB,"] for ")+"".concat(h.name,", falling back to default."));h.GR=h.GG=h.GB=1}return h}_createClass(CalRGBCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){convertToRgb(this,t,r,o,c,1)}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){for(var d=1/((1<<u)-1),g=0;g<o;++g){convertToRgb(this,t,r,c,l,d);r+=3;l+=3+h}}},{key:"getOutputLength",value:function getOutputLength(t,r){return t*(3+r)/3|0}}]);return CalRGBCS}(g)}(),x=function LabCSClosure(){function fn_g(t){return t>=6/29?Math.pow(t,3):108/841*(t-4/29)}function decode(t,r,o,c){return o+t*(c-o)/r}function convertToRgb(t,r,o,c,l,u){var h=r[o],d=r[o+1],g=r[o+2];if(!1!==c){h=decode(h,c,0,100);d=decode(d,c,t.amin,t.amax);g=decode(g,c,t.bmin,t.bmax)}d>t.amax?d=t.amax:d<t.amin&&(d=t.amin);g>t.bmax?g=t.bmax:g<t.bmin&&(g=t.bmin);var m,y,v,k=(h+16)/116,_=k+d/500,w=k-g/200,S=t.XW*fn_g(_),C=t.YW*fn_g(k),x=t.ZW*fn_g(w);if(t.ZW<1){m=3.1339*S+-1.617*C+-.4906*x;y=-.9785*S+1.916*C+.0333*x;v=.072*S+-.229*C+1.4057*x}else{m=3.2406*S+-1.5372*C+-.4986*x;y=-.9689*S+1.8758*C+.0415*x;v=.0557*S+-.204*C+1.057*x}l[u]=255*Math.sqrt(m);l[u+1]=255*Math.sqrt(y);l[u+2]=255*Math.sqrt(v)}return function(t){_inherits(LabCS,t);var r=_createSuper(LabCS);function LabCS(t,o,c){var u;_classCallCheck(this,LabCS);u=r.call(this,"Lab",3);if(!t)throw new l.FormatError("WhitePoint missing - required for color space Lab");o=o||[0,0,0];c=c||[-100,100,-100,100];u.XW=t[0];u.YW=t[1];u.ZW=t[2];u.amin=c[0];u.amax=c[1];u.bmin=c[2];u.bmax=c[3];u.XB=o[0];u.YB=o[1];u.ZB=o[2];if(u.XW<0||u.ZW<0||1!==u.YW)throw new l.FormatError("Invalid WhitePoint components, no fallback available");if(u.XB<0||u.YB<0||u.ZB<0){(0,l.info)("Invalid BlackPoint, falling back to default");u.XB=u.YB=u.ZB=0}if(u.amin>u.amax||u.bmin>u.bmax){(0,l.info)("Invalid Range, falling back to defaults");u.amin=-100;u.amax=100;u.bmin=-100;u.bmax=100}return u}_createClass(LabCS,[{key:"getRgbItem",value:function getRgbItem(t,r,o,c){convertToRgb(this,t,r,!1,o,c)}},{key:"getRgbBuffer",value:function getRgbBuffer(t,r,o,c,l,u,h){for(var d=(1<<u)-1,g=0;g<o;g++){convertToRgb(this,t,r,d,c,l);r+=3;l+=3+h}}},{key:"getOutputLength",value:function getOutputLength(t,r){return t*(3+r)/3|0}},{key:"isDefaultDecode",value:function isDefaultDecode(t,r){return!0}},{key:"usesZeroToOneRange",get:function get(){return(0,l.shadow)(this,"usesZeroToOneRange",!1)}}]);return LabCS}(g)}()},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PartialEvaluator=r.EvaluatorPreprocessor=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(167),h=o(146),d=o(185),g=o(159),m=o(160),y=o(188),v=o(162),k=o(197),_=o(153),w=o(189),S=o(198),C=o(168),x=o(200),O=o(151),T=o(150),E=o(201),M=o(165),R=o(170),j=o(161),D=o(149),L=o(192),N=o(202),U=o(203),H=o(204);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var $=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,fontExtraProperties:!1,useSystemFonts:!0,cMapUrl:null,standardFontDataUrl:null}),X=1,q=2,G=Promise.resolve();function normalizeBlendMode(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(t)){for(var o=0,c=t.length;o<c;o++){var u=normalizeBlendMode(t[o],!0);if(u)return u}(0,l.warn)("Unsupported blend mode Array: ".concat(t));return"source-over"}if(!(t instanceof h.Name))return r?null:"source-over";switch(t.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}if(r)return null;(0,l.warn)("Unsupported blend mode: ".concat(t.name));return"source-over"}var z=function(){function TimeSlotManager(){_classCallCheck(this,TimeSlotManager);this.reset()}_createClass(TimeSlotManager,[{key:"check",value:function check(){if(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)return!1;this.checked=0;return this.endTime<=Date.now()}},{key:"reset",value:function reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS;this.checked=0}}],[{key:"TIME_SLOT_DURATION_MS",get:function get(){return(0,l.shadow)(this,"TIME_SLOT_DURATION_MS",20)}},{key:"CHECK_TIME_EVERY",get:function get(){return(0,l.shadow)(this,"CHECK_TIME_EVERY",100)}}]);return TimeSlotManager}(),W=function(){function PartialEvaluator(t){var r=t.xref,o=t.handler,c=t.pageIndex,l=t.idFactory,u=t.fontCache,h=t.builtInCMapCache,d=t.standardFontDataCache,g=t.globalImageCache,m=t.options,y=void 0===m?null:m;_classCallCheck(this,PartialEvaluator);this.xref=r;this.handler=o;this.pageIndex=c;this.idFactory=l;this.fontCache=u;this.builtInCMapCache=h;this.standardFontDataCache=d;this.globalImageCache=g;this.options=y||$;this.parsingType3Font=!1;this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}_createClass(PartialEvaluator,[{key:"_pdfFunctionFactory",get:function get(){var t=new S.PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported});return(0,l.shadow)(this,"_pdfFunctionFactory",t)}},{key:"clone",value:function clone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=Object.create(this);r.options=Object.assign(Object.create(null),this.options,t);return r}},{key:"hasBlendModes",value:function hasBlendModes(t,r){if(!(t instanceof h.Dict))return!1;if(t.objId&&r.has(t.objId))return!1;var o=new h.RefSet(r);t.objId&&o.put(t.objId);for(var c=[t],u=this.xref;c.length;){var d=c.shift(),g=d.get("ExtGState");if(g instanceof h.Dict){var m,y=_createForOfIteratorHelper(g.getRawValues());try{for(y.s();!(m=y.n()).done;){var v=m.value;if(v instanceof h.Ref){if(o.has(v))continue;try{v=u.fetch(v)}catch(t){o.put(v);(0,l.info)('hasBlendModes - ignoring ExtGState: "'.concat(t,'".'));continue}}if(v instanceof h.Dict){v.objId&&o.put(v.objId);var k=v.get("BM");if(k instanceof h.Name){if("Normal"!==k.name)return!0}else if(void 0!==k&&Array.isArray(k)){var _,w=_createForOfIteratorHelper(k);try{for(w.s();!(_=w.n()).done;){var S=_.value;if(S instanceof h.Name&&"Normal"!==S.name)return!0}}catch(t){w.e(t)}finally{w.f()}}}}}catch(t){y.e(t)}finally{y.f()}}var C=d.get("XObject");if(C instanceof h.Dict){var x,O=_createForOfIteratorHelper(C.getRawValues());try{for(O.s();!(x=O.n()).done;){var E=x.value;if(E instanceof h.Ref){if(o.has(E))continue;try{E=u.fetch(E)}catch(t){o.put(E);(0,l.info)('hasBlendModes - ignoring XObject: "'.concat(t,'".'));continue}}if(E instanceof T.BaseStream){E.dict.objId&&o.put(E.dict.objId);var M=E.dict.get("Resources");if(M instanceof h.Dict&&(!M.objId||!o.has(M.objId))){c.push(M);M.objId&&o.put(M.objId)}}}}catch(t){O.e(t)}finally{O.f()}}}var R,j=_createForOfIteratorHelper(o);try{for(j.s();!(R=j.n()).done;){var D=R.value;r.put(D)}}catch(t){j.e(t)}finally{j.f()}return!1}},{key:"fetchBuiltInCMap",value:(ee=_asyncToGenerator(c.default.mark((function _callee(t){var r,o,u,h;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:if(!(r=this.builtInCMapCache.get(t))){c.next=3;break}return c.abrupt("return",r);case 3:if(null===this.options.cMapUrl){c.next=19;break}u="".concat(this.options.cMapUrl).concat(t,".bcmap");c.next=7;return fetch(u);case 7:if((h=c.sent).ok){c.next=10;break}throw new Error('fetchBuiltInCMap: failed to fetch file "'.concat(u,'" with "').concat(h.statusText,'".'));case 10:c.t0=Uint8Array;c.next=13;return h.arrayBuffer();case 13:c.t1=c.sent;c.t2=new c.t0(c.t1);c.t3=l.CMapCompressionType.BINARY;o={cMapData:c.t2,compressionType:c.t3};c.next=22;break;case 19:c.next=21;return this.handler.sendWithPromise("FetchBuiltInCMap",{name:t});case 21:o=c.sent;case 22:o.compressionType!==l.CMapCompressionType.NONE&&this.builtInCMapCache.set(t,o);return c.abrupt("return",o);case 24:case"end":return c.stop()}}),_callee,this)}))),function fetchBuiltInCMap(t){return ee.apply(this,arguments)})},{key:"fetchStandardFontData",value:(Q=_asyncToGenerator(c.default.mark((function _callee2(t){var r,o,u,h,d,g;return c.default.wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:if(!(r=this.standardFontDataCache.get(t))){c.next=3;break}return c.abrupt("return",new O.Stream(r));case 3:if(!this.options.useSystemFonts||"Symbol"===t||"ZapfDingbats"===t){c.next=5;break}return c.abrupt("return",null);case 5:o=(0,y.getFontNameToFileMap)(),u=o[t];if(null===this.options.standardFontDataUrl){c.next=20;break}d="".concat(this.options.standardFontDataUrl).concat(u);c.next=10;return fetch(d);case 10:if((g=c.sent).ok){c.next=15;break}(0,l.warn)('fetchStandardFontData: failed to fetch file "'.concat(d,'" with "').concat(g.statusText,'".'));c.next=18;break;case 15:c.next=17;return g.arrayBuffer();case 17:h=c.sent;case 18:c.next=29;break;case 20:c.prev=20;c.next=23;return this.handler.sendWithPromise("FetchStandardFontData",{filename:u});case 23:h=c.sent;c.next=29;break;case 26:c.prev=26;c.t0=c.catch(20);(0,l.warn)('fetchStandardFontData: failed to fetch file "'.concat(u,'" with "').concat(c.t0,'".'));case 29:if(h){c.next=31;break}return c.abrupt("return",null);case 31:this.standardFontDataCache.set(t,h);return c.abrupt("return",new O.Stream(h));case 33:case"end":return c.stop()}}),_callee2,this,[[20,26]])}))),function fetchStandardFontData(t){return Q.apply(this,arguments)})},{key:"buildFormXObject",value:(W=_asyncToGenerator(c.default.mark((function _callee3(t,r,o,u,d,g,m){var y,v,k,_,w,S,C,x,O,T,E;return c.default.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:y=r.dict;v=y.getArray("Matrix");k=y.getArray("BBox");k=Array.isArray(k)&&4===k.length?l.Util.normalizeRect(k):null;if(!y.has("OC")){c.next=8;break}c.next=7;return this.parseMarkedContentProps(y.get("OC"),t);case 7:_=c.sent;case 8:void 0!==_&&u.addOp(l.OPS.beginMarkedContentProps,["OC",_]);if(!(S=y.get("Group"))){c.next=29;break}w={matrix:v,bbox:k,smask:o,isolated:!1,knockout:!1};C=S.get("S");x=null;if(!(0,h.isName)(C,"Transparency")){c.next=27;break}w.isolated=S.get("I")||!1;w.knockout=S.get("K")||!1;if(!S.has("CS")){c.next=27;break}O=S.getRaw("CS");if(!(T=M.ColorSpace.getCached(O,this.xref,m))){c.next=24;break}x=T;c.next=27;break;case 24:c.next=26;return this.parseColorSpace({cs:O,resources:t,localColorSpaceCache:m});case 26:x=c.sent;case 27:if(o&&o.backdrop){x=x||M.ColorSpace.singletons.rgb;o.backdrop=x.getRgb(o.backdrop,0)}u.addOp(l.OPS.beginGroup,[w]);case 29:E=S?[v,null]:[v,k];u.addOp(l.OPS.paintFormXObjectBegin,E);return c.abrupt("return",this.getOperatorList({stream:r,task:d,resources:y.get("Resources")||t,operatorList:u,initialState:g}).then((function(){u.addOp(l.OPS.paintFormXObjectEnd,[]);S&&u.addOp(l.OPS.endGroup,[w]);void 0!==_&&u.addOp(l.OPS.endMarkedContent,[])})));case 32:case"end":return c.stop()}}),_callee3,this)}))),function buildFormXObject(t,r,o,c,l,u,h){return W.apply(this,arguments)})},{key:"_sendImgData",value:function _sendImgData(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=r?[r.data.buffer]:null;return this.parsingType3Font||o?this.handler.send("commonobj",[t,"Image",r],c):this.handler.send("obj",[t,this.pageIndex,"Image",r],c)}},{key:"buildPaintImageXObject",value:(D=_asyncToGenerator(c.default.mark((function _callee4(t){var r,o,u,h,d,g,m,y,v,k,_,w,S,C,x,O,T,E,M,j,D,L,N,U,$,X,q,G=this;return c.default.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:r=t.resources,o=t.image,u=t.isInline,h=void 0!==u&&u,d=t.operatorList,g=t.cacheKey,m=t.localImageCache,y=t.localColorSpaceCache;v=o.dict;k=v.objId;_=v.get("W","Width");w=v.get("H","Height");if(_&&"number"==typeof _&&w&&"number"==typeof w){c.next=8;break}(0,l.warn)("Image dimensions are missing, or not numbers.");return c.abrupt("return");case 8:if(!(-1!==(S=this.options.maxImageSize)&&_*w>S)){c.next=15;break}C="Image exceeded maximum allowed size and was removed.";if(!this.options.ignoreErrors){c.next=14;break}(0,l.warn)(C);return c.abrupt("return");case 14:throw new Error(C);case 15:if(!v.has("OC")){c.next=19;break}c.next=18;return this.parseMarkedContentProps(v.get("OC"),r);case 18:x=c.sent;case 19:void 0!==x&&d.addOp(l.OPS.beginMarkedContentProps,["OC",x]);O=v.get("IM","ImageMask")||!1;T=v.get("I","Interpolate");if(!O){c.next=33;break}j=_+7>>3;D=o.getBytes(j*w,!0);L=v.getArray("D","Decode");(E=H.PDFImage.createMask({imgArray:D,width:_,height:w,imageIsFromDecodeStream:o instanceof R.DecodeStream,inverseDecode:!!L&&L[0]>0,interpolate:T})).cached=!!g;M=[E];d.addOp(l.OPS.paintImageMaskXObject,M);g&&m.set(g,k,{fn:l.OPS.paintImageMaskXObject,args:M});void 0!==x&&d.addOp(l.OPS.endMarkedContent,[]);return c.abrupt("return");case 33:N=v.get("SM","SMask")||!1;U=v.get("Mask")||!1;if(!h||N||U||!(_+w<200)){c.next=42;break}$=new H.PDFImage({xref:this.xref,res:r,image:o,isInline:h,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:y});E=$.createImageData(!0);d.addOp(l.OPS.paintInlineImageXObject,[E]);void 0!==x&&d.addOp(l.OPS.endMarkedContent,[]);return c.abrupt("return");case 42:X="img_".concat(this.idFactory.createObjId()),q=!1;this.parsingType3Font?X="".concat(this.idFactory.getDocId(),"_type3_").concat(X):k&&(q=this.globalImageCache.shouldCache(k,this.pageIndex))&&(X="".concat(this.idFactory.getDocId(),"_").concat(X));d.addDependency(X);M=[X,_,w];H.PDFImage.buildImage({xref:this.xref,res:r,image:o,isInline:h,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:y}).then((function(t){E=t.createImageData(!1);g&&k&&q&&G.globalImageCache.addByteSize(k,E.data.length);return G._sendImgData(X,E,q)})).catch((function(t){(0,l.warn)('Unable to decode image "'.concat(X,'": "').concat(t,'".'));return G._sendImgData(X,null,q)}));d.addOp(l.OPS.paintImageXObject,M);if(g){m.set(g,k,{fn:l.OPS.paintImageXObject,args:M});if(k){(0,l.assert)(!h,"Cannot cache an inline image globally.");this.globalImageCache.addPageIndex(k,this.pageIndex);q&&this.globalImageCache.setData(k,{objId:X,fn:l.OPS.paintImageXObject,args:M,byteSize:0})}}void 0!==x&&d.addOp(l.OPS.endMarkedContent,[]);case 50:case"end":return c.stop()}}),_callee4,this)}))),function buildPaintImageXObject(t){return D.apply(this,arguments)})},{key:"handleSMask",value:function handleSMask(t,r,o,c,l,u){var h=t.get("G"),d={subtype:t.get("S").name,backdrop:t.get("BC")},g=t.get("TR");if((0,S.isPDFFunction)(g)){for(var m=this._pdfFunctionFactory.create(g),y=new Uint8Array(256),v=new Float32Array(1),k=0;k<256;k++){v[0]=k/255;m(v,0,v,0);y[k]=255*v[0]|0}d.transferMap=y}return this.buildFormXObject(r,h,d,o,c,l.state.clone(),u)}},{key:"handleTransferFunction",value:function handleTransferFunction(t){var r;if(Array.isArray(t))r=t;else{if(!(0,S.isPDFFunction)(t))return null;r=[t]}var o,c=[],l=0,u=0,d=_createForOfIteratorHelper(r);try{for(d.s();!(o=d.n()).done;){var g=o.value,m=this.xref.fetchIfRef(g);l++;if((0,h.isName)(m,"Identity"))c.push(null);else{if(!(0,S.isPDFFunction)(m))return null;for(var y=this._pdfFunctionFactory.create(m),v=new Uint8Array(256),k=new Float32Array(1),_=0;_<256;_++){k[0]=_/255;y(k,0,k,0);v[_]=255*k[0]|0}c.push(v);u++}}}catch(t){d.e(t)}finally{d.f()}return 1!==l&&4!==l||0===u?null:c}},{key:"handleTilingType",value:function handleTilingType(t,r,o,c,u,d,g,m){var y=this,v=new U.OperatorList,_=h.Dict.merge({xref:this.xref,dictArray:[u.get("Resources"),o]});return this.getOperatorList({stream:c,task:g,resources:_,operatorList:v}).then((function(){var o=v.getIR(),c=(0,k.getTilingPatternIR)(o,u,r);d.addDependencies(v.dependencies);d.addOp(t,c);u.objId&&m.set(null,u.objId,{operatorListIR:o,dict:u})})).catch((function(t){if(!(t instanceof l.AbortException)){if(!y.options.ignoreErrors)throw t;y.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorTilingPattern});(0,l.warn)('handleTilingType - ignoring pattern: "'.concat(t,'".'))}}))}},{key:"handleSetFont",value:function handleSetFont(t,r,o,c,u,g){var m=this,y=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,v=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,k=r&&r[0]instanceof h.Name?r[0].name:null;return this.loadFont(k,o,t,y,v).then((function(r){return r.font.isType3Font?r.loadType3Data(m,t,u).then((function(){c.addDependencies(r.type3Dependencies);return r})).catch((function(t){m.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorFontLoadType3});return new V({loadedName:"g_font_error",font:new d.ErrorFont("Type3 font load error: ".concat(t)),dict:r.font,evaluatorOptions:m.options})})):r})).then((function(t){g.font=t.font;t.send(m.handler);return t.loadedName}))}},{key:"handleText",value:function handleText(t,r){var o=r.font,c=o.charsToGlyphs(t);if(o.data){(!!(r.textRenderingMode&l.TextRenderingMode.ADD_TO_PATH_FLAG)||"Pattern"===r.fillColorSpace.name||o.disableFontFace||this.options.disableFontFace)&&PartialEvaluator.buildFontPaths(o,c,this.handler,this.options)}return c}},{key:"ensureStateFont",value:function ensureStateFont(t){if(!t.font){var r=new l.FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw r;this.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorFontState});(0,l.warn)('ensureStateFont: "'.concat(r,'".'))}}},{key:"setGState",value:(C=_asyncToGenerator(c.default.mark((function _callee5(t){var r,o,u,d,g,m,y,v,k,_,w,S,C,x,O,T,E=this;return c.default.wrap((function _callee5$(c){for(;;)switch(c.prev=c.next){case 0:r=t.resources,o=t.gState,u=t.operatorList,d=t.cacheKey,g=t.task,m=t.stateManager,y=t.localGStateCache,v=t.localColorSpaceCache;k=o.objId;_=!0;w=[];S=o.getKeys();C=Promise.resolve();x=function _loop(t,c){var d=S[t],y=o.get(d);switch(d){case"Type":break;case"LW":case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":w.push([d,y]);break;case"Font":_=!1;C=C.then((function(){return E.handleSetFont(r,null,y[0],u,g,m.state).then((function(t){u.addDependency(t);w.push([d,[t,y[1]]])}))}));break;case"BM":w.push([d,normalizeBlendMode(y)]);break;case"SMask":if((0,h.isName)(y,"None")){w.push([d,!1]);break}if(y instanceof h.Dict){_=!1;C=C.then((function(){return E.handleSMask(y,r,u,g,m,v)}));w.push([d,!0])}else(0,l.warn)("Unsupported SMask type");break;case"TR":var k=E.handleTransferFunction(y);w.push([d,k]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":(0,l.info)("graphic state operator "+d);break;default:(0,l.info)("Unknown graphic state operator "+d)}};for(O=0,T=S.length;O<T;O++)x(O);return c.abrupt("return",C.then((function(){w.length>0&&u.addOp(l.OPS.setGState,[w]);_&&y.set(d,k,w)})));case 9:case"end":return c.stop()}}),_callee5)}))),function setGState(t){return C.apply(this,arguments)})},{key:"loadFont",value:function loadFont(t,r,o){var u,m=this,y=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,v=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,k=function(){var o=_asyncToGenerator(c.default.mark((function _callee6(){return c.default.wrap((function _callee6$(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",new V({loadedName:"g_font_error",font:new d.ErrorFont('Font "'.concat(t,'" is not available.')),dict:r,evaluatorOptions:m.options}));case 1:case"end":return o.stop()}}),_callee6)})));return function errorFont(){return o.apply(this,arguments)}}(),_=this.xref;if(r){if(!(r instanceof h.Ref))throw new l.FormatError('The "font" object should be a reference.');u=r}else{var w=o.get("Font");w&&(u=w.getRaw(t))}if(!u){var S='Font "'.concat(t||r&&r.toString(),'" is not available');if(!this.options.ignoreErrors&&!this.parsingType3Font){(0,l.warn)("".concat(S,"."));return k()}this.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorFontMissing});(0,l.warn)("".concat(S," -- attempting to fallback to a default font."));u=y||PartialEvaluator.fallbackFontDict}if(this.parsingType3Font&&this.type3FontRefs.has(u))return k();if(this.fontCache.has(u))return this.fontCache.get(u);if(!((r=_.fetchIfRef(u))instanceof h.Dict))return k();if(r.cacheKey&&this.fontCache.has(r.cacheKey))return this.fontCache.get(r.cacheKey);var C,x=(0,l.createPromiseCapability)();try{(C=this.preEvaluateFont(r)).cssFontInfo=v}catch(t){(0,l.warn)('loadFont - preEvaluateFont failed: "'.concat(t,'".'));return k()}var O,T=C,E=T.descriptor,M=T.hash,R=u instanceof h.Ref;R&&(O="f".concat(u.toString()));if(M&&E instanceof h.Dict){E.fontAliases||(E.fontAliases=Object.create(null));var j=E.fontAliases;if(j[M]){var D=j[M].aliasRef;if(R&&D&&this.fontCache.has(D)){this.fontCache.putAlias(u,D);return this.fontCache.get(u)}}else j[M]={fontID:this.idFactory.createFontId()};R&&(j[M].aliasRef=u);O=j[M].fontID}if(R)this.fontCache.put(u,x.promise);else{O||(O=this.idFactory.createFontId());r.cacheKey="cacheKey_".concat(O);this.fontCache.put(r.cacheKey,x.promise)}(0,l.assert)(O&&O.startsWith("f"),'The "fontID" must be (correctly) defined.');r.loadedName="".concat(this.idFactory.getDocId(),"_").concat(O);this.translateFont(C).then((function(t){void 0!==t.fontType&&_.stats.addFontType(t.fontType);x.resolve(new V({loadedName:r.loadedName,font:t,dict:r,evaluatorOptions:m.options}))})).catch((function(t){m.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorFontTranslate});(0,l.warn)('loadFont - translateFont failed: "'.concat(t,'".'));try{var o=E&&E.get("FontFile3"),c=o&&o.get("Subtype"),u=(0,g.getFontType)(C.type,c&&c.name);void 0!==u&&_.stats.addFontType(u)}catch(t){}x.resolve(new V({loadedName:r.loadedName,font:new d.ErrorFont(t instanceof Error?t.message:t),dict:r,evaluatorOptions:m.options}))}));return x.promise}},{key:"buildPath",value:function buildPath(t,r,o){var c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=t.length-1;o||(o=[]);if(u<0||t.fnArray[u]!==l.OPS.constructPath){if(c){(0,l.warn)('Encountered path operator "'.concat(r,'" inside of a text object.'));t.addOp(l.OPS.save,null)}t.addOp(l.OPS.constructPath,[[r],o]);c&&t.addOp(l.OPS.restore,null)}else{var h=t.argsArray[u];h[0].push(r);Array.prototype.push.apply(h[1],o)}}},{key:"parseColorSpace",value:function parseColorSpace(t){var r=this,o=t.cs,c=t.resources,u=t.localColorSpaceCache;return M.ColorSpace.parseAsync({cs:o,xref:this.xref,resources:c,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:u}).catch((function(t){if(t instanceof l.AbortException)return null;if(r.options.ignoreErrors){r.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorColorSpace});(0,l.warn)('parseColorSpace - ignoring ColorSpace: "'.concat(t,'".'));return null}throw t}))}},{key:"parseShading",value:function parseShading(t){var r=t.shading,o=t.resources,c=t.localColorSpaceCache,l=t.localShadingPatternCache,u=l.get(r);if(!u){var h=k.Pattern.parseShading(r,this.xref,o,this.handler,this._pdfFunctionFactory,c).getIR();u="pattern_".concat(this.idFactory.createObjId());l.set(r,u);this.handler.send("obj",[u,this.pageIndex,"Pattern",h])}return u}},{key:"handleColorN",value:function handleColorN(t,r,o,c,u,d,g,m,y,v){var _=o.pop();if(_ instanceof h.Name){var w=u.getRaw(_.name),S=w instanceof h.Ref&&y.getByRef(w);if(S)try{var C=c.base?c.base.getRgb(o,0):null,x=(0,k.getTilingPatternIR)(S.operatorListIR,S.dict,C);t.addOp(r,x);return}catch(t){}var O=this.xref.fetchIfRef(w);if(O){var E=O instanceof T.BaseStream?O.dict:O,M=E.get("PatternType");if(M===X){var R=c.base?c.base.getRgb(o,0):null;return this.handleTilingType(r,R,d,O,E,t,g,y)}if(M===q){var j=E.get("Shading"),D=E.getArray("Matrix"),L=this.parseShading({shading:j,resources:d,localColorSpaceCache:m,localShadingPatternCache:v});t.addOp(r,["Shading",L,D]);return}throw new l.FormatError("Unknown PatternType: ".concat(M))}}throw new l.FormatError("Unknown PatternName: ".concat(_))}},{key:"_parseVisibilityExpression",value:function _parseVisibilityExpression(t,r,o){if(++r>10)(0,l.warn)("Visibility expression is too deeply nested");else{var c=t.length,u=this.xref.fetchIfRef(t[0]);if(!(c<2)&&u instanceof h.Name){switch(u.name){case"And":case"Or":case"Not":o.push(u.name);break;default:(0,l.warn)("Invalid operator ".concat(u.name," in visibility expression"));return}for(var d=1;d<c;d++){var g=t[d],m=this.xref.fetchIfRef(g);if(Array.isArray(m)){var y=[];o.push(y);this._parseVisibilityExpression(m,r,y)}else g instanceof h.Ref&&o.push(g.toString())}}else(0,l.warn)("Invalid visibility expression")}}},{key:"parseMarkedContentProps",value:(o=_asyncToGenerator(c.default.mark((function _callee7(t,r){var o,u,d,g,m,y,v,k,_,w;return c.default.wrap((function _callee7$(c){for(;;)switch(c.prev=c.next){case 0:if(!(t instanceof h.Name)){c.next=5;break}u=r.get("Properties");o=u.get(t.name);c.next=10;break;case 5:if(!(t instanceof h.Dict)){c.next=9;break}o=t;c.next=10;break;case 9:throw new l.FormatError("Optional content properties malformed.");case 10:if("OCG"!==(d=o.get("Type").name)){c.next=15;break}return c.abrupt("return",{type:d,id:o.objId});case 15:if("OCMD"!==d){c.next=31;break}g=o.get("VE");if(!Array.isArray(g)){c.next=22;break}m=[];this._parseVisibilityExpression(g,0,m);if(!(m.length>0)){c.next=22;break}return c.abrupt("return",{type:"OCMD",expression:m});case 22:y=o.get("OCGs");if(!(Array.isArray(y)||y instanceof h.Dict)){c.next=29;break}v=[];if(Array.isArray(y)){k=_createForOfIteratorHelper(y);try{for(k.s();!(_=k.n()).done;){w=_.value;v.push(w.toString())}}catch(t){k.e(t)}finally{k.f()}}else v.push(y.objId);return c.abrupt("return",{type:d,ids:v,policy:o.get("P")instanceof h.Name?o.get("P").name:null,expression:null});case 29:if(!(y instanceof h.Ref)){c.next=31;break}return c.abrupt("return",{type:d,id:y.toString()});case 31:return c.abrupt("return",null);case 32:case"end":return c.stop()}}),_callee7,this)}))),function parseMarkedContentProps(t,r){return o.apply(this,arguments)})},{key:"getOperatorList",value:function getOperatorList(t){var r=this,o=t.stream,c=t.task,u=t.resources,d=t.operatorList,g=t.initialState,m=void 0===g?null:g,y=t.fallbackFontDict,v=void 0===y?null:y;u=u||h.Dict.empty;m=m||new J;if(!d)throw new Error('getOperatorList: missing "operatorList" parameter');var k=this,_=this.xref,w=!1,S=new x.LocalImageCache,C=new x.LocalColorSpaceCache,O=new x.LocalGStateCache,E=new x.LocalTilingPatternCache,R=new Map,j=u.get("XObject")||h.Dict.empty,D=u.get("Pattern")||h.Dict.empty,L=new K(m),N=new Z(o,_,L),U=new z;function closePendingRestoreOPS(t){for(var r=0,o=N.savedStatesDepth;r<o;r++)d.addOp(l.OPS.restore,[])}return new Promise((function promiseBody(t,r){var o=function next(o){Promise.all([o,d.ready]).then((function(){try{promiseBody(t,r)}catch(t){r(t)}}),r)};c.ensureNotTerminated();U.reset();for(var g,m,y,x,H,$,X={};!(g=U.check());){X.args=null;if(!N.read(X))break;var q=X.args,z=X.fn;switch(0|z){case l.OPS.paintXObject:$=q[0]instanceof h.Name;H=q[0].name;if($){var W=S.getByName(H);if(W){d.addOp(W.fn,W.args);q=null;continue}}o(new Promise((function(t,r){if(!$)throw new l.FormatError("XObject must be referred to by name.");var o=j.getRaw(H);if(o instanceof h.Ref){var g=S.getByRef(o);if(g){d.addOp(g.fn,g.args);t();return}var m=k.globalImageCache.getData(o,k.pageIndex);if(m){d.addDependency(m.objId);d.addOp(m.fn,m.args);t();return}o=_.fetch(o)}if(!(o instanceof T.BaseStream))throw new l.FormatError("XObject should be a stream");var y=o.dict.get("Subtype");if(!(y instanceof h.Name))throw new l.FormatError("XObject should have a Name subtype");if("Form"!==y.name)if("Image"!==y.name){if("PS"!==y.name)throw new l.FormatError("Unhandled XObject subtype ".concat(y.name));(0,l.info)("Ignored XObject subtype PS");t()}else k.buildPaintImageXObject({resources:u,image:o,operatorList:d,cacheKey:H,localImageCache:S,localColorSpaceCache:C}).then(t,r);else{L.save();k.buildFormXObject(u,o,null,d,c,L.state.clone(),C).then((function(){L.restore();t()}),r)}})).catch((function(t){if(!(t instanceof l.AbortException)){if(!k.options.ignoreErrors)throw t;k.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorXObject});(0,l.warn)('getOperatorList - ignoring XObject: "'.concat(t,'".'))}})));return;case l.OPS.setFont:var V=q[1];o(k.handleSetFont(u,q,null,d,c,L.state,v).then((function(t){d.addDependency(t);d.addOp(l.OPS.setFont,[t,V])})));return;case l.OPS.beginText:w=!0;break;case l.OPS.endText:w=!1;break;case l.OPS.endInlineImage:var K=q[0].cacheKey;if(K){var Y=S.getByName(K);if(Y){d.addOp(Y.fn,Y.args);q=null;continue}}o(k.buildPaintImageXObject({resources:u,image:q[0],isInline:!0,operatorList:d,cacheKey:K,localImageCache:S,localColorSpaceCache:C}));return;case l.OPS.showText:if(!L.state.font){k.ensureStateFont(L.state);continue}q[0]=k.handleText(q[0],L.state);break;case l.OPS.showSpacedText:if(!L.state.font){k.ensureStateFont(L.state);continue}var J=q[0],Z=[],Q=J.length,ee=L.state;for(m=0;m<Q;++m){var te=J[m];"string"==typeof te?Array.prototype.push.apply(Z,k.handleText(te,ee)):"number"==typeof te&&Z.push(te)}q[0]=Z;z=l.OPS.showText;break;case l.OPS.nextLineShowText:if(!L.state.font){k.ensureStateFont(L.state);continue}d.addOp(l.OPS.nextLine);q[0]=k.handleText(q[0],L.state);z=l.OPS.showText;break;case l.OPS.nextLineSetSpacingShowText:if(!L.state.font){k.ensureStateFont(L.state);continue}d.addOp(l.OPS.nextLine);d.addOp(l.OPS.setWordSpacing,[q.shift()]);d.addOp(l.OPS.setCharSpacing,[q.shift()]);q[0]=k.handleText(q[0],L.state);z=l.OPS.showText;break;case l.OPS.setTextRenderingMode:L.state.textRenderingMode=q[0];break;case l.OPS.setFillColorSpace:var re=M.ColorSpace.getCached(q[0],_,C);if(re){L.state.fillColorSpace=re;continue}o(k.parseColorSpace({cs:q[0],resources:u,localColorSpaceCache:C}).then((function(t){t&&(L.state.fillColorSpace=t)})));return;case l.OPS.setStrokeColorSpace:var ae=M.ColorSpace.getCached(q[0],_,C);if(ae){L.state.strokeColorSpace=ae;continue}o(k.parseColorSpace({cs:q[0],resources:u,localColorSpaceCache:C}).then((function(t){t&&(L.state.strokeColorSpace=t)})));return;case l.OPS.setFillColor:q=(x=L.state.fillColorSpace).getRgb(q,0);z=l.OPS.setFillRGBColor;break;case l.OPS.setStrokeColor:q=(x=L.state.strokeColorSpace).getRgb(q,0);z=l.OPS.setStrokeRGBColor;break;case l.OPS.setFillGray:L.state.fillColorSpace=M.ColorSpace.singletons.gray;q=M.ColorSpace.singletons.gray.getRgb(q,0);z=l.OPS.setFillRGBColor;break;case l.OPS.setStrokeGray:L.state.strokeColorSpace=M.ColorSpace.singletons.gray;q=M.ColorSpace.singletons.gray.getRgb(q,0);z=l.OPS.setStrokeRGBColor;break;case l.OPS.setFillCMYKColor:L.state.fillColorSpace=M.ColorSpace.singletons.cmyk;q=M.ColorSpace.singletons.cmyk.getRgb(q,0);z=l.OPS.setFillRGBColor;break;case l.OPS.setStrokeCMYKColor:L.state.strokeColorSpace=M.ColorSpace.singletons.cmyk;q=M.ColorSpace.singletons.cmyk.getRgb(q,0);z=l.OPS.setStrokeRGBColor;break;case l.OPS.setFillRGBColor:L.state.fillColorSpace=M.ColorSpace.singletons.rgb;q=M.ColorSpace.singletons.rgb.getRgb(q,0);break;case l.OPS.setStrokeRGBColor:L.state.strokeColorSpace=M.ColorSpace.singletons.rgb;q=M.ColorSpace.singletons.rgb.getRgb(q,0);break;case l.OPS.setFillColorN:if("Pattern"===(x=L.state.fillColorSpace).name){o(k.handleColorN(d,l.OPS.setFillColorN,q,x,D,u,c,C,E,R));return}q=x.getRgb(q,0);z=l.OPS.setFillRGBColor;break;case l.OPS.setStrokeColorN:if("Pattern"===(x=L.state.strokeColorSpace).name){o(k.handleColorN(d,l.OPS.setStrokeColorN,q,x,D,u,c,C,E,R));return}q=x.getRgb(q,0);z=l.OPS.setStrokeRGBColor;break;case l.OPS.shadingFill:var ne=u.get("Shading");if(!ne)throw new l.FormatError("No shading resource found");var ie=ne.get(q[0].name);if(!ie)throw new l.FormatError("No shading object found");q=[k.parseShading({shading:ie,resources:u,localColorSpaceCache:C,localShadingPatternCache:R})];z=l.OPS.shadingFill;break;case l.OPS.setGState:$=q[0]instanceof h.Name;H=q[0].name;if($){var oe=O.getByName(H);if(oe){oe.length>0&&d.addOp(l.OPS.setGState,[oe]);q=null;continue}}o(new Promise((function(t,r){if(!$)throw new l.FormatError("GState must be referred to by name.");var o=u.get("ExtGState");if(!(o instanceof h.Dict))throw new l.FormatError("ExtGState should be a dictionary.");var g=o.get(H);if(!(g instanceof h.Dict))throw new l.FormatError("GState should be a dictionary.");k.setGState({resources:u,gState:g,operatorList:d,cacheKey:H,task:c,stateManager:L,localGStateCache:O,localColorSpaceCache:C}).then(t,r)})).catch((function(t){if(!(t instanceof l.AbortException)){if(!k.options.ignoreErrors)throw t;k.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorExtGState});(0,l.warn)('getOperatorList - ignoring ExtGState: "'.concat(t,'".'))}})));return;case l.OPS.moveTo:case l.OPS.lineTo:case l.OPS.curveTo:case l.OPS.curveTo2:case l.OPS.curveTo3:case l.OPS.closePath:case l.OPS.rectangle:k.buildPath(d,z,q,w);continue;case l.OPS.markPoint:case l.OPS.markPointProps:case l.OPS.beginCompat:case l.OPS.endCompat:continue;case l.OPS.beginMarkedContentProps:if(!(q[0]instanceof h.Name)){(0,l.warn)("Expected name for beginMarkedContentProps arg0=".concat(q[0]));continue}if("OC"===q[0].name){o(k.parseMarkedContentProps(q[1],u).then((function(t){d.addOp(l.OPS.beginMarkedContentProps,["OC",t])})).catch((function(t){if(!(t instanceof l.AbortException)){if(!k.options.ignoreErrors)throw t;k.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorMarkedContent});(0,l.warn)('getOperatorList - ignoring beginMarkedContentProps: "'.concat(t,'".'))}})));return}q=[q[0].name,q[1]instanceof h.Dict?q[1].get("MCID"):null];break;case l.OPS.beginMarkedContent:case l.OPS.endMarkedContent:default:if(null!==q){for(m=0,y=q.length;m<y&&!(q[m]instanceof h.Dict);m++);if(m<y){(0,l.warn)("getOperatorList - ignoring operator: "+z);continue}}}d.addOp(z,q)}if(g)o(G);else{closePendingRestoreOPS();t()}})).catch((function(t){if(!(t instanceof l.AbortException)){if(!r.options.ignoreErrors)throw t;r.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorOperatorList});(0,l.warn)('getOperatorList - ignoring errors during "'.concat(c.name,'" ')+'task: "'.concat(t,'".'));closePendingRestoreOPS()}}))}},{key:"getTextContent",value:function getTextContent(t){var r=this,o=t.stream,c=t.task,u=t.resources,d=t.stateManager,g=void 0===d?null:d,m=t.combineTextItems,y=void 0!==m&&m,k=t.includeMarkedContent,_=void 0!==k&&k,w=t.sink,S=t.seenStyles,C=void 0===S?new Set:S,O=t.viewBox;u=u||h.Dict.empty;g=g||new K(new Y);var M,R=(0,v.getNormalizedUnicodes)(),j={items:[],styles:Object.create(null)},D={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,transform:null,fontName:null,hasEOL:!1},L=this,N=this.xref,U=[],H=null,$=new x.LocalImageCache,X=new x.LocalGStateCache,q=new Z(o,N,g);function getCurrentTextTransform(){var t=M.font,r=[M.fontSize*M.textHScale,0,0,M.fontSize,0,M.textRise];if(t.isType3Font&&(M.fontSize<=1||t.isCharBBox)&&!(0,l.isArrayEqual)(M.fontMatrix,l.FONT_IDENTITY_MATRIX)){var o=t.bbox[3]-t.bbox[1];o>0&&(r[3]*=o*M.fontMatrix[3])}return l.Util.transform(M.ctm,l.Util.transform(M.textMatrix,r))}function ensureTextContentItem(){if(D.initialized)return D;var t=M.font,r=t.loadedName;if(!C.has(r)){C.add(r);j.styles[r]={fontFamily:t.fallbackName,ascent:t.ascent,descent:t.descent,vertical:t.vertical}}D.fontName=r;var o=D.transform=getCurrentTextTransform();if(t.vertical){D.width=D.totalWidth=Math.hypot(o[0],o[1]);D.height=D.totalHeight=0;D.vertical=!0}else{D.width=D.totalWidth=0;D.height=D.totalHeight=Math.hypot(o[2],o[3]);D.vertical=!1}var c=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),l=Math.hypot(M.ctm[0],M.ctm[1]);D.textAdvanceScale=l*c;D.trackingSpaceMin=.1*M.fontSize;D.negativeSpaceMax=-.2*M.fontSize;D.spaceInFlowMin=.1*M.fontSize;D.spaceInFlowMax=.6*M.fontSize;D.hasEOL=!1;D.initialized=!0;return D}function updateAdvanceScale(){if(D.initialized){var t=Math.hypot(M.textLineMatrix[0],M.textLineMatrix[1]),r=Math.hypot(M.ctm[0],M.ctm[1])*t;if(r!==D.textAdvanceScale){if(D.vertical){D.totalHeight+=D.height*D.textAdvanceScale;D.height=0}else{D.totalWidth+=D.width*D.textAdvanceScale;D.width=0}D.textAdvanceScale=r}}}function handleSetFont(t,r){return L.loadFont(t,r,u).then((function(t){return t.font.isType3Font?t.loadType3Data(L,u,c).catch((function(){})).then((function(){return t})):t})).then((function(t){M.font=t.font;M.fontMatrix=t.font.fontMatrix||l.FONT_IDENTITY_MATRIX}))}function applyInverseRotation(t,r,o){var c=Math.hypot(o[0],o[1]);return[(o[0]*t+o[1]*r)/c,(o[2]*t+o[3]*r)/c]}function compareWithLastPosition(){var t=getCurrentTextTransform(),r=t[4],o=t[5],c=r-O[0],l=o-O[1];if(c<0||c>O[2]||l<0||l>O[3])return!1;if(!y||!M.font||!D.prevTransform)return!0;var u=D.prevTransform[4],h=D.prevTransform[5];if(u===r&&h===o)return!0;var d=-1;t[0]&&0===t[1]&&0===t[2]?d=t[0]>0?0:180:t[1]&&0===t[0]&&0===t[3]&&(d=t[1]>0?90:270);switch(d){case 0:break;case 90:var g=[o,r];r=g[0];o=g[1];var m=[h,u];u=m[0];h=m[1];break;case 180:var v=[-r,-o,-u,-h];r=v[0];o=v[1];u=v[2];h=v[3];break;case 270:var k=[-o,-r];r=k[0];o=k[1];var _=[-h,-u];u=_[0];h=_[1];break;default:var w=_slicedToArray(applyInverseRotation(r,o,t),2);r=w[0];o=w[1];var S=_slicedToArray(applyInverseRotation(u,h,D.prevTransform),2);u=S[0];h=S[1]}if(M.font.vertical){var C=(h-o)/D.textAdvanceScale,x=r-u,T=Math.sign(D.height);if(C<T*D.negativeSpaceMax){if(Math.abs(x)>.5*D.width){appendEOL();return!0}flushTextContentItem();return!0}if(Math.abs(x)>D.width){appendEOL();return!0}C<=T*D.trackingSpaceMin?D.height+=C:addFakeSpaces(C,D.prevTransform,T)||(0===D.str.length?j.items.push({str:" ",dir:"ltr",width:0,height:Math.abs(C),transform:D.prevTransform,fontName:D.fontName,hasEOL:!1}):D.height+=C);return!0}var E=(r-u)/D.textAdvanceScale,R=o-h,L=Math.sign(D.width);if(E<L*D.negativeSpaceMax){if(Math.abs(R)>.5*D.height){appendEOL();return!0}flushTextContentItem();return!0}if(Math.abs(R)>D.height){appendEOL();return!0}E<=L*D.trackingSpaceMin?D.width+=E:addFakeSpaces(E,D.prevTransform,L)||(0===D.str.length?j.items.push({str:" ",dir:"ltr",width:Math.abs(E),height:0,transform:D.prevTransform,fontName:D.fontName,hasEOL:!1}):D.width+=E);return!0}function buildTextContentItem(t){var r=t.chars,o=t.extraSpacing,c=M.font;if(r)for(var l=c.charsToGlyphs(r),u=M.fontMatrix[0]*M.fontSize,h=0,d=l.length;h<d;h++){var g=l[h];if(!g.isInvisibleFormatMark){var m=M.charSpacing+(h+1===d?o:0),y=g.width;c.vertical&&(y=g.vmetric?g.vmetric[0]:-y);var k=y*u;if(g.isWhitespace&&(0===h||h+1===d||l[h-1].isWhitespace||l[h+1].isWhitespace||o))if(c.vertical){m+=-k+M.wordSpacing;M.translateTextMatrix(0,-m)}else{m+=k+M.wordSpacing;M.translateTextMatrix(m*M.textHScale,0)}else if(compareWithLastPosition()){var _=ensureTextContentItem();g.isZeroWidthDiacritic&&(k=0);if(c.vertical){M.translateTextMatrix(0,k);k=Math.abs(k);_.height+=k}else{k*=M.textHScale;M.translateTextMatrix(k,0);_.width+=k}k&&(_.prevTransform=getCurrentTextTransform());if(g.isWhitespace)_.str.push(" ");else{var w=g.unicode;w=R[w]||w;w=(0,v.reverseIfRtl)(w);_.str.push(w)}m&&(c.vertical?M.translateTextMatrix(0,-m):M.translateTextMatrix(m*M.textHScale,0))}}}else{var S=M.charSpacing+o;S&&(c.vertical?M.translateTextMatrix(0,-S):M.translateTextMatrix(S*M.textHScale,0))}}function appendEOL(){if(D.initialized){D.hasEOL=!0;flushTextContentItem()}else j.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:M.font.loadedName,hasEOL:!0})}function addFakeSpaces(t,r,o){if(o*D.spaceInFlowMin<=t&&t<=o*D.spaceInFlowMax){D.initialized&&D.str.push(" ");return!1}var c=D.fontName,l=0;if(D.vertical){l=t;t=0}flushTextContentItem();j.items.push({str:" ",dir:"ltr",width:Math.abs(t),height:Math.abs(l),transform:r||getCurrentTextTransform(),fontName:c,hasEOL:!1});return!0}function flushTextContentItem(){if(D.initialized&&D.str){D.vertical?D.totalHeight+=D.height*D.textAdvanceScale:D.totalWidth+=D.width*D.textAdvanceScale;j.items.push(function runBidiTransform(t){var r=t.str.join(""),o=(0,E.bidi)(r,-1,t.vertical);return{str:o.str,dir:o.dir,width:Math.abs(t.totalWidth),height:Math.abs(t.totalHeight),transform:t.transform,fontName:t.fontName,hasEOL:t.hasEOL}}(D));D.initialized=!1;D.str.length=0}}function enqueueChunk(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=j.items.length;if(0!==r&&!(t&&r<10)){w.enqueue(j,r);j.items=[];j.styles=Object.create(null)}}var W=new z;return new Promise((function promiseBody(t,r){var o=function next(o){enqueueChunk(!0);Promise.all([o,w.ready]).then((function(){try{promiseBody(t,r)}catch(t){r(t)}}),r)};c.ensureNotTerminated();W.reset();for(var d,m={},v=[];!(d=W.check());){v.length=0;m.args=v;if(!q.read(m))break;M=g.state;var k=m.fn;v=m.args;switch(0|k){case l.OPS.setFont:var S=v[0].name,x=v[1];if(M.font&&S===M.fontName&&x===M.fontSize)break;flushTextContentItem();M.fontName=S;M.fontSize=x;o(handleSetFont(S,null));return;case l.OPS.setTextRise:M.textRise=v[0];break;case l.OPS.setHScale:M.textHScale=v[0]/100;break;case l.OPS.setLeading:M.leading=v[0];break;case l.OPS.moveText:M.translateTextLineMatrix(v[0],v[1]);M.textMatrix=M.textLineMatrix.slice();break;case l.OPS.setLeadingMoveText:M.leading=-v[1];M.translateTextLineMatrix(v[0],v[1]);M.textMatrix=M.textLineMatrix.slice();break;case l.OPS.nextLine:M.carriageReturn();break;case l.OPS.setTextMatrix:M.setTextMatrix(v[0],v[1],v[2],v[3],v[4],v[5]);M.setTextLineMatrix(v[0],v[1],v[2],v[3],v[4],v[5]);updateAdvanceScale();break;case l.OPS.setCharSpacing:M.charSpacing=v[0];break;case l.OPS.setWordSpacing:M.wordSpacing=v[0];break;case l.OPS.beginText:M.textMatrix=l.IDENTITY_MATRIX.slice();M.textLineMatrix=l.IDENTITY_MATRIX.slice();break;case l.OPS.showSpacedText:if(!g.state.font){L.ensureStateFont(g.state);continue}for(var E=(M.font.vertical?1:-1)*M.fontSize/1e3,R=v[0],D=0,z=R.length;D<z-1;D++){var V=R[D];if("string"==typeof V)U.push(V);else if("number"==typeof V&&0!==V){var Y=U.join("");U.length=0;buildTextContentItem({chars:Y,extraSpacing:V*E})}}var J=R[R.length-1];"string"==typeof J&&U.push(J);if(U.length>0){var Z=U.join("");U.length=0;buildTextContentItem({chars:Z,extraSpacing:0})}break;case l.OPS.showText:if(!g.state.font){L.ensureStateFont(g.state);continue}buildTextContentItem({chars:v[0],extraSpacing:0});break;case l.OPS.nextLineShowText:if(!g.state.font){L.ensureStateFont(g.state);continue}M.carriageReturn();buildTextContentItem({chars:v[0],extraSpacing:0});break;case l.OPS.nextLineSetSpacingShowText:if(!g.state.font){L.ensureStateFont(g.state);continue}M.wordSpacing=v[0];M.charSpacing=v[1];M.carriageReturn();buildTextContentItem({chars:v[2],extraSpacing:0});break;case l.OPS.paintXObject:flushTextContentItem();H||(H=u.get("XObject")||h.Dict.empty);var Q=v[0]instanceof h.Name,ee=v[0].name;if(Q&&$.getByName(ee))break;o(new Promise((function(t,r){if(!Q)throw new l.FormatError("XObject must be referred to by name.");var o=H.getRaw(ee);if(o instanceof h.Ref){if($.getByRef(o)){t();return}if(L.globalImageCache.getData(o,L.pageIndex)){t();return}o=N.fetch(o)}if(!(o instanceof T.BaseStream))throw new l.FormatError("XObject should be a stream");var d=o.dict.get("Subtype");if(!(d instanceof h.Name))throw new l.FormatError("XObject should have a Name subtype");if("Form"===d.name){var m=g.state.clone(),v=new K(m),k=o.dict.getArray("Matrix");Array.isArray(k)&&6===k.length&&v.transform(k);enqueueChunk();var S={enqueueInvoked:!1,enqueue:function enqueue(t,r){this.enqueueInvoked=!0;w.enqueue(t,r)},get desiredSize(){return w.desiredSize},get ready(){return w.ready}};L.getTextContent({stream:o,task:c,resources:o.dict.get("Resources")||u,stateManager:v,combineTextItems:y,includeMarkedContent:_,sink:S,seenStyles:C,viewBox:O}).then((function(){S.enqueueInvoked||$.set(ee,o.dict.objId,!0);t()}),r)}else{$.set(ee,o.dict.objId,!0);t()}})).catch((function(t){if(!(t instanceof l.AbortException)){if(!L.options.ignoreErrors)throw t;(0,l.warn)('getTextContent - ignoring XObject: "'.concat(t,'".'))}})));return;case l.OPS.setGState:Q=v[0]instanceof h.Name;ee=v[0].name;if(Q&&X.getByName(ee))break;o(new Promise((function(t,r){if(!Q)throw new l.FormatError("GState must be referred to by name.");var o=u.get("ExtGState");if(!(o instanceof h.Dict))throw new l.FormatError("ExtGState should be a dictionary.");var c=o.get(ee);if(!(c instanceof h.Dict))throw new l.FormatError("GState should be a dictionary.");var d=c.get("Font");if(d){flushTextContentItem();M.fontName=null;M.fontSize=d[1];handleSetFont(null,d[0]).then(t,r)}else{X.set(ee,c.objId,!0);t()}})).catch((function(t){if(!(t instanceof l.AbortException)){if(!L.options.ignoreErrors)throw t;(0,l.warn)('getTextContent - ignoring ExtGState: "'.concat(t,'".'))}})));return;case l.OPS.beginMarkedContent:_&&j.items.push({type:"beginMarkedContent",tag:v[0]instanceof h.Name?v[0].name:null});break;case l.OPS.beginMarkedContentProps:if(_){flushTextContentItem();var te=null;v[1]instanceof h.Dict&&(te=v[1].get("MCID"));j.items.push({type:"beginMarkedContentProps",id:Number.isInteger(te)?"".concat(L.idFactory.getPageObjId(),"_mcid").concat(te):null,tag:v[0]instanceof h.Name?v[0].name:null})}break;case l.OPS.endMarkedContent:if(_){flushTextContentItem();j.items.push({type:"endMarkedContent"})}}if(j.items.length>=w.desiredSize){d=!0;break}}if(d)o(G);else{flushTextContentItem();enqueueChunk();t()}})).catch((function(t){if(!(t instanceof l.AbortException)){if(!r.options.ignoreErrors)throw t;(0,l.warn)('getTextContent - ignoring errors during "'.concat(c.name,'" ')+'task: "'.concat(t,'".'));flushTextContentItem();enqueueChunk()}}))}},{key:"extractDataStructures",value:function extractDataStructures(t,r,o){var c,u=this,d=this.xref,y=this.readToUnicode(o.toUnicode||t.get("ToUnicode")||r.get("ToUnicode"));if(o.composite){var v=t.get("CIDSystemInfo");v instanceof h.Dict&&(o.cidSystemInfo={registry:(0,l.stringToPDFString)(v.get("Registry")),ordering:(0,l.stringToPDFString)(v.get("Ordering")),supplement:v.get("Supplement")});var k=t.get("CIDToGIDMap");k instanceof T.BaseStream&&(c=k.getBytes())}var _,w=[],S=null;if(t.has("Encoding")){if((_=t.get("Encoding"))instanceof h.Dict){S=(S=_.get("BaseEncoding"))instanceof h.Name?S.name:null;if(_.has("Differences"))for(var C=_.get("Differences"),x=0,O=0,E=C.length;O<E;O++){var M=d.fetchIfRef(C[O]);if("number"==typeof M)x=M;else{if(!(M instanceof h.Name))throw new l.FormatError("Invalid entry in 'Differences' array: ".concat(M));w[x++]=M.name}}}else{if(!(_ instanceof h.Name))throw new l.FormatError("Encoding is not a Name nor a Dict");S=_.name}"MacRomanEncoding"!==S&&"MacExpertEncoding"!==S&&"WinAnsiEncoding"!==S&&(S=null)}if(S)o.defaultEncoding=(0,m.getEncoding)(S);else{var R=!!(o.flags&g.FontFlags.Symbolic),j=!!(o.flags&g.FontFlags.Nonsymbolic);_=m.StandardEncoding;"TrueType"!==o.type||j||(_=m.WinAnsiEncoding);if(R){_=m.MacRomanEncoding;o.file&&!o.isInternalFont||(/Symbol/i.test(o.name)?_=m.SymbolSetEncoding:/Dingbats|Wingdings/i.test(o.name)&&(_=m.ZapfDingbatsEncoding))}o.defaultEncoding=_}o.differences=w;o.baseEncodingName=S;o.hasEncoding=!!S||w.length>0;o.dict=t;return y.then((function(t){o.toUnicode=t;return u.buildToUnicode(o)})).then((function(t){o.toUnicode=t;c&&(o.cidToGidMap=u.readCidToGidMap(c,t));return o}))}},{key:"_simpleFontToUnicode",value:function _simpleFontToUnicode(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,l.assert)(!t.composite,"Must be a simple font.");var o=[],c=t.defaultEncoding.slice(),u=t.baseEncodingName,h=t.differences;for(var d in h){var g=h[d];".notdef"!==g&&(c[d]=g)}var y=(0,j.getGlyphsUnicode)();for(var k in c){var _=c[k];if(""!==_)if(void 0!==y[_])o[k]=String.fromCharCode(y[_]);else{var w=0;switch(_[0]){case"G":3===_.length&&(w=parseInt(_.substring(1),16));break;case"g":5===_.length&&(w=parseInt(_.substring(1),16));break;case"C":case"c":if(_.length>=3&&_.length<=4){var S=_.substring(1);if(r){w=parseInt(S,16);break}w=+S;if(Number.isNaN(w)&&Number.isInteger(parseInt(S,16)))return this._simpleFontToUnicode(t,!0)}break;default:var C=(0,v.getUnicodeForGlyph)(_,y);-1!==C&&(w=C)}if(w>0&&w<=1114111&&Number.isInteger(w)){if(u&&w===+k){var x=(0,m.getEncoding)(u);if(x&&(_=x[k])){o[k]=String.fromCharCode(y[_]);continue}}o[k]=String.fromCodePoint(w)}}}return o}},{key:"buildToUnicode",value:(r=_asyncToGenerator(c.default.mark((function _callee8(t){var r,o,d,g,m,y;return c.default.wrap((function _callee8$(c){for(;;)switch(c.prev=c.next){case 0:t.hasIncludedToUnicodeMap=!!t.toUnicode&&t.toUnicode.length>0;if(!t.hasIncludedToUnicodeMap){c.next=4;break}!t.composite&&t.hasEncoding&&(t.fallbackToUnicode=this._simpleFontToUnicode(t));return c.abrupt("return",t.toUnicode);case 4:if(t.composite){c.next=6;break}return c.abrupt("return",new w.ToUnicodeMap(this._simpleFontToUnicode(t)));case 6:if(!t.composite||(!t.cMap.builtInCMap||t.cMap instanceof u.IdentityCMap)&&("Adobe"!==t.cidSystemInfo.registry||"GB1"!==t.cidSystemInfo.ordering&&"CNS1"!==t.cidSystemInfo.ordering&&"Japan1"!==t.cidSystemInfo.ordering&&"Korea1"!==t.cidSystemInfo.ordering)){c.next=15;break}r=t.cidSystemInfo,o=r.registry,d=r.ordering;g=h.Name.get("".concat(o,"-").concat(d,"-UCS2"));c.next=11;return u.CMapFactory.create({encoding:g,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});case 11:m=c.sent;y=[];t.cMap.forEach((function(t,r){if(r>65535)throw new l.FormatError("Max size of CID is 65,535");var o=m.lookup(r);o&&(y[t]=String.fromCharCode((o.charCodeAt(0)<<8)+o.charCodeAt(1)))}));return c.abrupt("return",new w.ToUnicodeMap(y));case 15:return c.abrupt("return",new w.IdentityToUnicodeMap(t.firstChar,t.lastChar));case 16:case"end":return c.stop()}}),_callee8,this)}))),function buildToUnicode(t){return r.apply(this,arguments)})},{key:"readToUnicode",value:function readToUnicode(t){var r=this;return t?t instanceof h.Name?u.CMapFactory.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(t){return t instanceof u.IdentityCMap?new w.IdentityToUnicodeMap(0,65535):new w.ToUnicodeMap(t.getMap())})):t instanceof T.BaseStream?u.CMapFactory.create({encoding:t,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(t){if(t instanceof u.IdentityCMap)return new w.IdentityToUnicodeMap(0,65535);var r=new Array(t.length);t.forEach((function(t,o){if("number"!=typeof o){for(var c=[],l=0;l<o.length;l+=2){var u=o.charCodeAt(l)<<8|o.charCodeAt(l+1);if(55296==(63488&u)){l+=2;var h=o.charCodeAt(l)<<8|o.charCodeAt(l+1);c.push(((1023&u)<<10)+(1023&h)+65536)}else c.push(u)}r[t]=String.fromCodePoint.apply(String,c)}else r[t]=String.fromCodePoint(o)}));return new w.ToUnicodeMap(r)}),(function(t){if(t instanceof l.AbortException)return null;if(r.options.ignoreErrors){r.handler.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorFontToUnicode});(0,l.warn)('readToUnicode - ignoring ToUnicode data: "'.concat(t,'".'));return null}throw t})):Promise.resolve(null):Promise.resolve(null)}},{key:"readCidToGidMap",value:function readCidToGidMap(t,r){for(var o=[],c=0,l=t.length;c<l;c++){var u=t[c++]<<8|t[c],h=c>>1;(0!==u||r.has(h))&&(o[h]=u)}return o}},{key:"extractWidths",value:function extractWidths(t,r,o){var c,l,u,d,m,y,v,k,_=this.xref,w=[],S=0,C=[];if(o.composite){S=t.has("DW")?t.get("DW"):1e3;if(k=t.get("W"))for(l=0,u=k.length;l<u;l++){y=_.fetchIfRef(k[l++]);v=_.fetchIfRef(k[l]);if(Array.isArray(v))for(d=0,m=v.length;d<m;d++)w[y++]=_.fetchIfRef(v[d]);else{var x=_.fetchIfRef(k[++l]);for(d=y;d<=v;d++)w[d]=x}}if(o.vertical){var O=t.getArray("DW2")||[880,-1e3];c=[O[1],.5*S,O[0]];if(O=t.get("W2"))for(l=0,u=O.length;l<u;l++){y=_.fetchIfRef(O[l++]);v=_.fetchIfRef(O[l]);if(Array.isArray(v))for(d=0,m=v.length;d<m;d++)C[y++]=[_.fetchIfRef(v[d++]),_.fetchIfRef(v[d++]),_.fetchIfRef(v[d])];else{var T=[_.fetchIfRef(O[++l]),_.fetchIfRef(O[++l]),_.fetchIfRef(O[++l])];for(d=y;d<=v;d++)C[d]=T}}}}else{var E=o.firstChar;if(k=t.get("Widths")){d=E;for(l=0,u=k.length;l<u;l++)w[d++]=_.fetchIfRef(k[l]);S=parseFloat(r.get("MissingWidth"))||0}else{var M=t.get("BaseFont");if(M instanceof h.Name){var R=this.getBaseFontMetrics(M.name);w=this.buildCharCodeToWidth(R.widths,o);S=R.defaultWidth}}}var j=!0,D=S;for(var L in w){var N=w[L];if(N)if(D){if(D!==N){j=!1;break}}else D=N}j&&(o.flags|=g.FontFlags.FixedPitch);o.defaultWidth=S;o.widths=w;o.defaultVMetrics=c;o.vmetrics=C}},{key:"isSerifFont",value:function isSerifFont(t){var r=t.split("-")[0];return r in(0,y.getSerifFonts)()||-1!==r.search(/serif/gi)}},{key:"getBaseFontMetrics",value:function getBaseFontMetrics(t){var r=0,o=Object.create(null),c=!1,l=(0,y.getStdFontMap)()[t]||t,u=(0,L.getMetrics)();l in u||(l=this.isSerifFont(t)?"Times-Roman":"Helvetica");var h=u[l];if("number"==typeof h){r=h;c=!0}else o=h();return{defaultWidth:r,monospace:c,widths:o}}},{key:"buildCharCodeToWidth",value:function buildCharCodeToWidth(t,r){for(var o=Object.create(null),c=r.differences,l=r.defaultEncoding,u=0;u<256;u++)u in c&&t[c[u]]?o[u]=t[c[u]]:u in l&&t[l[u]]&&(o[u]=t[l[u]]);return o}},{key:"preEvaluateFont",value:function preEvaluateFont(t){var r=t,o=t.get("Subtype");if(!(o instanceof h.Name))throw new l.FormatError("invalid font Subtype");var c,u,d=!1;if("Type0"===o.name){var g=t.get("DescendantFonts");if(!g)throw new l.FormatError("Descendant fonts are not specified");if(!((t=Array.isArray(g)?this.xref.fetchIfRef(g[0]):g)instanceof h.Dict))throw new l.FormatError("Descendant font is not a dictionary.");if(!((o=t.get("Subtype"))instanceof h.Name))throw new l.FormatError("invalid font Subtype");d=!0}var m=t.get("FirstChar")||0,y=t.get("LastChar")||(d?65535:255),v=t.get("FontDescriptor");if(v){c=new N.MurmurHash3_64;var k=r.getRaw("Encoding");if(k instanceof h.Name)c.update(k.name);else if(k instanceof h.Ref)c.update(k.toString());else if(k instanceof h.Dict){var _,w=_createForOfIteratorHelper(k.getRawValues());try{for(w.s();!(_=w.n()).done;){var S=_.value;if(S instanceof h.Name)c.update(S.name);else if(S instanceof h.Ref)c.update(S.toString());else if(Array.isArray(S)){for(var C=S.length,x=new Array(C),O=0;O<C;O++){var E=S[O];E instanceof h.Name?x[O]=E.name:("number"==typeof E||E instanceof h.Ref)&&(x[O]=E.toString())}c.update(x.join())}}}catch(t){w.e(t)}finally{w.f()}}c.update("".concat(m,"-").concat(y));if((u=t.get("ToUnicode")||r.get("ToUnicode"))instanceof T.BaseStream){var M=u.str||u,R=M.buffer?new Uint8Array(M.buffer.buffer,0,M.bufferLength):new Uint8Array(M.bytes.buffer,M.start,M.end-M.start);c.update(R)}else u instanceof h.Name&&c.update(u.name);var j=t.get("Widths")||r.get("Widths");if(Array.isArray(j)){var D,L=[],U=_createForOfIteratorHelper(j);try{for(U.s();!(D=U.n()).done;){var H=D.value;("number"==typeof H||H instanceof h.Ref)&&L.push(H.toString())}}catch(t){U.e(t)}finally{U.f()}c.update(L.join())}if(d){c.update("compositeFont");var $=t.get("W")||r.get("W");if(Array.isArray($)){var X,q=[],G=_createForOfIteratorHelper($);try{for(G.s();!(X=G.n()).done;){var z=X.value;if("number"==typeof z||z instanceof h.Ref)q.push(z.toString());else if(Array.isArray(z)){var W,V=[],K=_createForOfIteratorHelper(z);try{for(K.s();!(W=K.n()).done;){var Y=W.value;("number"==typeof Y||Y instanceof h.Ref)&&V.push(Y.toString())}}catch(t){K.e(t)}finally{K.f()}q.push("[".concat(V.join(),"]"))}}}catch(t){G.e(t)}finally{G.f()}c.update(q.join())}var J=t.getRaw("CIDToGIDMap")||r.getRaw("CIDToGIDMap");J instanceof h.Name?c.update(J.name):J instanceof h.Ref?c.update(J.toString()):J instanceof T.BaseStream&&c.update(J.peekBytes())}}return{descriptor:v,dict:t,baseDict:r,composite:d,type:o.name,firstChar:m,lastChar:y,toUnicode:u,hash:c?c.hexdigest():""}}},{key:"translateFont",value:(t=_asyncToGenerator(c.default.mark((function _callee9(t){var r,o,m,v,k,w,S,C,x,T,E,M,R,j,D,L,N,U,H,$,X,q,G,z,W,V,K,Y,J,Z,Q,ee,te,re,ae,ne=this;return c.default.wrap((function _callee9$(c){for(;;)switch(c.prev=c.next){case 0:r=t.descriptor,o=t.dict,m=t.baseDict,v=t.composite,k=t.type,w=t.firstChar,S=t.lastChar,C=t.toUnicode,x=t.cssFontInfo;T="Type3"===k;if(r){c.next=27;break}if(!T){c.next=9;break}(r=new h.Dict(null)).set("FontName",h.Name.get(k));r.set("FontBBox",o.getArray("FontBBox")||[0,0,0,0]);c.next=27;break;case 9:if((M=o.get("BaseFont"))instanceof h.Name){c.next=12;break}throw new l.FormatError("Base font is not specified");case 12:M=M.name.replace(/[,_]/g,"-");R=this.getBaseFontMetrics(M);j=M.split("-")[0];D=(this.isSerifFont(j)?g.FontFlags.Serif:0)|(R.monospace?g.FontFlags.FixedPitch:0)|((0,y.getSymbolsFonts)()[j]?g.FontFlags.Symbolic:g.FontFlags.Nonsymbolic);E={type:k,name:M,loadedName:m.loadedName,widths:R.widths,defaultWidth:R.defaultWidth,isSimulatedFlags:!0,flags:D,firstChar:w,lastChar:S,toUnicode:C,xHeight:0,capHeight:0,italicAngle:0,isType3Font:T};L=o.get("Widths");N=(0,y.getStandardFontName)(M);U=null;if(!N){c.next=26;break}E.isStandardFont=!0;c.next=24;return this.fetchStandardFontData(N);case 24:U=c.sent;E.isInternalFont=!!U;case 26:return c.abrupt("return",this.extractDataStructures(o,o,E).then((function(t){if(L){for(var r=[],o=w,c=0,l=L.length;c<l;c++)r[o++]=ne.xref.fetchIfRef(L[c]);t.widths=r}else t.widths=ne.buildCharCodeToWidth(R.widths,t);return new d.Font(M,U,t)})));case 27:H=r.get("FontName");$=o.get("BaseFont");"string"==typeof H&&(H=h.Name.get(H));"string"==typeof $&&($=h.Name.get($));if(!T){X=H&&H.name;q=$&&$.name;if(X!==q){(0,l.info)("The FontDescriptor's FontName is \"".concat(X,'" but ')+"should be the same as the Font's BaseFont \"".concat(q,'".'));X&&q&&q.startsWith(X)&&(H=$)}}if((H=H||$)instanceof h.Name){c.next=35;break}throw new l.FormatError("invalid font name");case 35:c.prev=35;G=r.get("FontFile","FontFile2","FontFile3");c.next=45;break;case 39:c.prev=39;c.t0=c.catch(35);if(this.options.ignoreErrors){c.next=43;break}throw c.t0;case 43:(0,l.warn)('translateFont - fetching "'.concat(H.name,'" font file: "').concat(c.t0,'".'));G=new O.NullStream;case 45:Y=!1;J=!1;Z=null;if(!G){c.next=52;break}if(G.dict){(Q=G.dict.get("Subtype"))instanceof h.Name&&(z=Q.name);W=G.dict.get("Length1");V=G.dict.get("Length2");K=G.dict.get("Length3")}c.next=74;break;case 52:if(!x){c.next=66;break}if(!(ee=(0,_.getXfaFontName)(H.name))){c.next=64;break}x.fontFamily="".concat(x.fontFamily,"-PdfJS-XFA");x.metrics=ee.metrics||null;Z=ee.factors||null;c.next=60;return this.fetchStandardFontData(ee.name);case 60:G=c.sent;J=!!G;m=o=(0,_.getXfaFontDict)(H.name);v=!0;case 64:c.next=74;break;case 66:if(T){c.next=74;break}if(!(te=(0,y.getStandardFontName)(H.name))){c.next=74;break}Y=!0;c.next=72;return this.fetchStandardFontData(te);case 72:G=c.sent;J=!!G;case 74:E={type:k,name:H.name,subtype:z,file:G,length1:W,length2:V,length3:K,isStandardFont:Y,isInternalFont:J,loadedName:m.loadedName,composite:v,fixedPitch:!1,fontMatrix:o.getArray("FontMatrix")||l.FONT_IDENTITY_MATRIX,firstChar:w,lastChar:S,toUnicode:C,bbox:r.getArray("FontBBox")||o.getArray("FontBBox"),ascent:r.get("Ascent"),descent:r.get("Descent"),xHeight:r.get("XHeight")||0,capHeight:r.get("CapHeight")||0,flags:r.get("Flags"),italicAngle:r.get("ItalicAngle")||0,isType3Font:T,cssFontInfo:x,scaleFactors:Z};if(!v){c.next=83;break}(re=m.get("Encoding"))instanceof h.Name&&(E.cidEncoding=re.name);c.next=80;return u.CMapFactory.create({encoding:re,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});case 80:ae=c.sent;E.cMap=ae;E.vertical=E.cMap.vertical;case 83:return c.abrupt("return",this.extractDataStructures(o,m,E).then((function(t){ne.extractWidths(o,r,t);return new d.Font(H.name,G,t)})));case 84:case"end":return c.stop()}}),_callee9,this,[[35,39]])}))),function translateFont(r){return t.apply(this,arguments)})}],[{key:"buildFontPaths",value:function buildFontPaths(t,r,o,c){function buildPath(r){var u="".concat(t.loadedName,"_path_").concat(r);try{if(t.renderer.hasBuiltPath(r))return;o.send("commonobj",[u,"FontPath",t.renderer.getPathJs(r)])}catch(t){if(c.ignoreErrors){o.send("UnsupportedFeature",{featureId:l.UNSUPPORTED_FEATURES.errorFontBuildPath});(0,l.warn)("buildFontPaths - ignoring ".concat(u,' glyph: "').concat(t,'".'));return}throw t}}var u,h=_createForOfIteratorHelper(r);try{for(h.s();!(u=h.n()).done;){var d=u.value;buildPath(d.fontChar);var g=d.accent;g&&g.fontChar&&buildPath(g.fontChar)}}catch(t){h.e(t)}finally{h.f()}}},{key:"fallbackFontDict",get:function get(){var t=new h.Dict;t.set("BaseFont",h.Name.get("PDFJS-FallbackFont"));t.set("Type",h.Name.get("FallbackType"));t.set("Subtype",h.Name.get("FallbackType"));t.set("Encoding",h.Name.get("WinAnsiEncoding"));return(0,l.shadow)(this,"fallbackFontDict",t)}}]);var t,r,o,C,D,W,Q,ee;return PartialEvaluator}();r.PartialEvaluator=W;var V=function(){function TranslatedFont(t){var r=t.loadedName,o=t.font,c=t.dict,l=t.evaluatorOptions;_classCallCheck(this,TranslatedFont);this.loadedName=r;this.font=o;this.dict=c;this._evaluatorOptions=l||$;this.type3Loaded=null;this.type3Dependencies=o.isType3Font?new Set:null;this.sent=!1}_createClass(TranslatedFont,[{key:"send",value:function send(t){if(!this.sent){this.sent=!0;t.send("commonobj",[this.loadedName,"Font",this.font.exportData(this._evaluatorOptions.fontExtraProperties)])}}},{key:"fallback",value:function fallback(t){if(this.font.data){this.font.disableFontFace=!0;W.buildFontPaths(this.font,this.font.glyphCacheValues,t,this._evaluatorOptions)}}},{key:"loadType3Data",value:function loadType3Data(t,r,o){var c=this;if(this.type3Loaded)return this.type3Loaded;if(!this.font.isType3Font)throw new Error("Must be a Type3 font.");var u=t.clone({ignoreErrors:!1});u.parsingType3Font=!0;var d=new h.RefSet(t.type3FontRefs);this.dict.objId&&!d.has(this.dict.objId)&&d.put(this.dict.objId);u.type3FontRefs=d;var g,m=this.font,y=this.type3Dependencies,v=Promise.resolve(),k=this.dict.get("CharProcs"),_=this.dict.get("Resources")||r,w=Object.create(null),S=!m.bbox||(0,l.isArrayEqual)(m.bbox,[0,0,0,0]),C=_createForOfIteratorHelper(k.getKeys());try{var x=function _loop2(){var t=g.value;v=v.then((function(){var r=k.get(t),h=new U.OperatorList;return u.getOperatorList({stream:r,task:o,resources:_,operatorList:h}).then((function(){h.fnArray[0]===l.OPS.setCharWidthAndBounds&&c._removeType3ColorOperators(h,S);w[t]=h.getIR();var r,o=_createForOfIteratorHelper(h.dependencies);try{for(o.s();!(r=o.n()).done;){var u=r.value;y.add(u)}}catch(t){o.e(t)}finally{o.f()}})).catch((function(r){(0,l.warn)('Type3 font resource "'.concat(t,'" is not available.'));var o=new U.OperatorList;w[t]=o.getIR()}))}))};for(C.s();!(g=C.n()).done;)x()}catch(t){C.e(t)}finally{C.f()}this.type3Loaded=v.then((function(){m.charProcOperatorList=w;if(c._bbox){m.isCharBBox=!0;m.bbox=c._bbox}}));return this.type3Loaded}},{key:"_removeType3ColorOperators",value:function _removeType3ColorOperators(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r){this._bbox||(this._bbox=[1/0,1/0,-1/0,-1/0]);var o=l.Util.normalizeRect(t.argsArray[0].slice(2));this._bbox[0]=Math.min(this._bbox[0],o[0]);this._bbox[1]=Math.min(this._bbox[1],o[1]);this._bbox[2]=Math.max(this._bbox[2],o[2]);this._bbox[3]=Math.max(this._bbox[3],o[3])}for(var c=1,u=t.length;c<u;){switch(t.fnArray[c]){case l.OPS.setStrokeColorSpace:case l.OPS.setFillColorSpace:case l.OPS.setStrokeColor:case l.OPS.setStrokeColorN:case l.OPS.setFillColor:case l.OPS.setFillColorN:case l.OPS.setStrokeGray:case l.OPS.setFillGray:case l.OPS.setStrokeRGBColor:case l.OPS.setFillRGBColor:case l.OPS.setStrokeCMYKColor:case l.OPS.setFillCMYKColor:case l.OPS.shadingFill:case l.OPS.setRenderingIntent:t.fnArray.splice(c,1);t.argsArray.splice(c,1);u--;continue;case l.OPS.setGState:for(var h=_slicedToArray(t.argsArray[c],1),d=h[0],g=0,m=d.length;g<m;){var y=_slicedToArray(d[g],1),v=y[0];switch(v){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":d.splice(g,1);m--;continue}g++}}c++}}}]);return TranslatedFont}(),K=function(){function StateManager(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new J;_classCallCheck(this,StateManager);this.state=t;this.stateStack=[]}_createClass(StateManager,[{key:"save",value:function save(){var t=this.state;this.stateStack.push(this.state);this.state=t.clone()}},{key:"restore",value:function restore(){var t=this.stateStack.pop();t&&(this.state=t)}},{key:"transform",value:function transform(t){this.state.ctm=l.Util.transform(this.state.ctm,t)}}]);return StateManager}(),Y=function(){function TextState(){_classCallCheck(this,TextState);this.ctm=new Float32Array(l.IDENTITY_MATRIX);this.fontName=null;this.fontSize=0;this.font=null;this.fontMatrix=l.FONT_IDENTITY_MATRIX;this.textMatrix=l.IDENTITY_MATRIX.slice();this.textLineMatrix=l.IDENTITY_MATRIX.slice();this.charSpacing=0;this.wordSpacing=0;this.leading=0;this.textHScale=1;this.textRise=0}_createClass(TextState,[{key:"setTextMatrix",value:function setTextMatrix(t,r,o,c,l,u){var h=this.textMatrix;h[0]=t;h[1]=r;h[2]=o;h[3]=c;h[4]=l;h[5]=u}},{key:"setTextLineMatrix",value:function setTextLineMatrix(t,r,o,c,l,u){var h=this.textLineMatrix;h[0]=t;h[1]=r;h[2]=o;h[3]=c;h[4]=l;h[5]=u}},{key:"translateTextMatrix",value:function translateTextMatrix(t,r){var o=this.textMatrix;o[4]=o[0]*t+o[2]*r+o[4];o[5]=o[1]*t+o[3]*r+o[5]}},{key:"translateTextLineMatrix",value:function translateTextLineMatrix(t,r){var o=this.textLineMatrix;o[4]=o[0]*t+o[2]*r+o[4];o[5]=o[1]*t+o[3]*r+o[5]}},{key:"carriageReturn",value:function carriageReturn(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()}},{key:"clone",value:function clone(){var clone=Object.create(this);clone.textMatrix=this.textMatrix.slice();clone.textLineMatrix=this.textLineMatrix.slice();clone.fontMatrix=this.fontMatrix.slice();return clone}}]);return TextState}(),J=function(){function EvalState(){_classCallCheck(this,EvalState);this.ctm=new Float32Array(l.IDENTITY_MATRIX);this.font=null;this.textRenderingMode=l.TextRenderingMode.FILL;this.fillColorSpace=M.ColorSpace.singletons.gray;this.strokeColorSpace=M.ColorSpace.singletons.gray}_createClass(EvalState,[{key:"clone",value:function clone(){return Object.create(this)}}]);return EvalState}(),Z=function(){function EvaluatorPreprocessor(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new K;_classCallCheck(this,EvaluatorPreprocessor);this.parser=new C.Parser({lexer:new C.Lexer(t,EvaluatorPreprocessor.opMap),xref:r});this.stateManager=o;this.nonProcessedArgs=[];this._numInvalidPathOPS=0}_createClass(EvaluatorPreprocessor,[{key:"savedStatesDepth",get:function get(){return this.stateManager.stateStack.length}},{key:"read",value:function read(t){for(var r=t.args;;){var o=this.parser.getObj();if(o instanceof h.Cmd){var c=o.cmd,u=EvaluatorPreprocessor.opMap[c];if(!u){(0,l.warn)('Unknown command "'.concat(c,'".'));continue}var d=u.id,g=u.numArgs,m=null!==r?r.length:0;if(u.variableArgs)m>g&&(0,l.info)("Command ".concat(c,": expected [0, ").concat(g,"] args, ")+"but received ".concat(m," args."));else{if(m!==g){for(var y=this.nonProcessedArgs;m>g;){y.push(r.shift());m--}for(;m<g&&0!==y.length;){null===r&&(r=[]);r.unshift(y.pop());m++}}if(m<g){var v="command ".concat(c,": expected ").concat(g," args, ")+"but received ".concat(m," args.");if(d>=l.OPS.moveTo&&d<=l.OPS.endPath&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new l.FormatError("Invalid ".concat(v));(0,l.warn)("Skipping ".concat(v));null!==r&&(r.length=0);continue}}this.preprocessCommand(d,r);t.fn=d;t.args=r;return!0}if(o===h.EOF)return!1;if(null!==o){null===r&&(r=[]);r.push(o);if(r.length>33)throw new l.FormatError("Too many arguments")}}}},{key:"preprocessCommand",value:function preprocessCommand(t,r){switch(0|t){case l.OPS.save:this.stateManager.save();break;case l.OPS.restore:this.stateManager.restore();break;case l.OPS.transform:this.stateManager.transform(r)}}}],[{key:"opMap",get:function get(){var t=(0,D.getLookupTableFactory)((function(t){t.w={id:l.OPS.setLineWidth,numArgs:1,variableArgs:!1};t.J={id:l.OPS.setLineCap,numArgs:1,variableArgs:!1};t.j={id:l.OPS.setLineJoin,numArgs:1,variableArgs:!1};t.M={id:l.OPS.setMiterLimit,numArgs:1,variableArgs:!1};t.d={id:l.OPS.setDash,numArgs:2,variableArgs:!1};t.ri={id:l.OPS.setRenderingIntent,numArgs:1,variableArgs:!1};t.i={id:l.OPS.setFlatness,numArgs:1,variableArgs:!1};t.gs={id:l.OPS.setGState,numArgs:1,variableArgs:!1};t.q={id:l.OPS.save,numArgs:0,variableArgs:!1};t.Q={id:l.OPS.restore,numArgs:0,variableArgs:!1};t.cm={id:l.OPS.transform,numArgs:6,variableArgs:!1};t.m={id:l.OPS.moveTo,numArgs:2,variableArgs:!1};t.l={id:l.OPS.lineTo,numArgs:2,variableArgs:!1};t.c={id:l.OPS.curveTo,numArgs:6,variableArgs:!1};t.v={id:l.OPS.curveTo2,numArgs:4,variableArgs:!1};t.y={id:l.OPS.curveTo3,numArgs:4,variableArgs:!1};t.h={id:l.OPS.closePath,numArgs:0,variableArgs:!1};t.re={id:l.OPS.rectangle,numArgs:4,variableArgs:!1};t.S={id:l.OPS.stroke,numArgs:0,variableArgs:!1};t.s={id:l.OPS.closeStroke,numArgs:0,variableArgs:!1};t.f={id:l.OPS.fill,numArgs:0,variableArgs:!1};t.F={id:l.OPS.fill,numArgs:0,variableArgs:!1};t["f*"]={id:l.OPS.eoFill,numArgs:0,variableArgs:!1};t.B={id:l.OPS.fillStroke,numArgs:0,variableArgs:!1};t["B*"]={id:l.OPS.eoFillStroke,numArgs:0,variableArgs:!1};t.b={id:l.OPS.closeFillStroke,numArgs:0,variableArgs:!1};t["b*"]={id:l.OPS.closeEOFillStroke,numArgs:0,variableArgs:!1};t.n={id:l.OPS.endPath,numArgs:0,variableArgs:!1};t.W={id:l.OPS.clip,numArgs:0,variableArgs:!1};t["W*"]={id:l.OPS.eoClip,numArgs:0,variableArgs:!1};t.BT={id:l.OPS.beginText,numArgs:0,variableArgs:!1};t.ET={id:l.OPS.endText,numArgs:0,variableArgs:!1};t.Tc={id:l.OPS.setCharSpacing,numArgs:1,variableArgs:!1};t.Tw={id:l.OPS.setWordSpacing,numArgs:1,variableArgs:!1};t.Tz={id:l.OPS.setHScale,numArgs:1,variableArgs:!1};t.TL={id:l.OPS.setLeading,numArgs:1,variableArgs:!1};t.Tf={id:l.OPS.setFont,numArgs:2,variableArgs:!1};t.Tr={id:l.OPS.setTextRenderingMode,numArgs:1,variableArgs:!1};t.Ts={id:l.OPS.setTextRise,numArgs:1,variableArgs:!1};t.Td={id:l.OPS.moveText,numArgs:2,variableArgs:!1};t.TD={id:l.OPS.setLeadingMoveText,numArgs:2,variableArgs:!1};t.Tm={id:l.OPS.setTextMatrix,numArgs:6,variableArgs:!1};t["T*"]={id:l.OPS.nextLine,numArgs:0,variableArgs:!1};t.Tj={id:l.OPS.showText,numArgs:1,variableArgs:!1};t.TJ={id:l.OPS.showSpacedText,numArgs:1,variableArgs:!1};t["'"]={id:l.OPS.nextLineShowText,numArgs:1,variableArgs:!1};t['"']={id:l.OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1};t.d0={id:l.OPS.setCharWidth,numArgs:2,variableArgs:!1};t.d1={id:l.OPS.setCharWidthAndBounds,numArgs:6,variableArgs:!1};t.CS={id:l.OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1};t.cs={id:l.OPS.setFillColorSpace,numArgs:1,variableArgs:!1};t.SC={id:l.OPS.setStrokeColor,numArgs:4,variableArgs:!0};t.SCN={id:l.OPS.setStrokeColorN,numArgs:33,variableArgs:!0};t.sc={id:l.OPS.setFillColor,numArgs:4,variableArgs:!0};t.scn={id:l.OPS.setFillColorN,numArgs:33,variableArgs:!0};t.G={id:l.OPS.setStrokeGray,numArgs:1,variableArgs:!1};t.g={id:l.OPS.setFillGray,numArgs:1,variableArgs:!1};t.RG={id:l.OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1};t.rg={id:l.OPS.setFillRGBColor,numArgs:3,variableArgs:!1};t.K={id:l.OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1};t.k={id:l.OPS.setFillCMYKColor,numArgs:4,variableArgs:!1};t.sh={id:l.OPS.shadingFill,numArgs:1,variableArgs:!1};t.BI={id:l.OPS.beginInlineImage,numArgs:0,variableArgs:!1};t.ID={id:l.OPS.beginImageData,numArgs:0,variableArgs:!1};t.EI={id:l.OPS.endInlineImage,numArgs:1,variableArgs:!1};t.Do={id:l.OPS.paintXObject,numArgs:1,variableArgs:!1};t.MP={id:l.OPS.markPoint,numArgs:1,variableArgs:!1};t.DP={id:l.OPS.markPointProps,numArgs:2,variableArgs:!1};t.BMC={id:l.OPS.beginMarkedContent,numArgs:1,variableArgs:!1};t.BDC={id:l.OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1};t.EMC={id:l.OPS.endMarkedContent,numArgs:0,variableArgs:!1};t.BX={id:l.OPS.beginCompat,numArgs:0,variableArgs:!1};t.EX={id:l.OPS.endCompat,numArgs:0,variableArgs:!1};t.BM=null;t.BD=null;t.true=null;t.fa=null;t.fal=null;t.fals=null;t.false=null;t.nu=null;t.nul=null;t.null=null}));return(0,l.shadow)(this,"opMap",t())}},{key:"MAX_INVALID_PATH_OPS",get:function get(){return(0,l.shadow)(this,"MAX_INVALID_PATH_OPS",10)}}]);return EvaluatorPreprocessor}();r.EvaluatorPreprocessor=Z},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.IdentityCMap=r.CMapFactory=r.CMap=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(146),h=o(150),d=o(168),g=o(149),m=o(151);function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var y=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],v=Math.pow(2,24)-1,k=function(){function CMap(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];_classCallCheck(this,CMap);this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=t}_createClass(CMap,[{key:"addCodespaceRange",value:function addCodespaceRange(t,r,o){this.codespaceRanges[t-1].push(r,o);this.numCodespaceRanges++}},{key:"mapCidRange",value:function mapCidRange(t,r,o){if(r-t>v)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;t<=r;)this._map[t++]=o++}},{key:"mapBfRange",value:function mapBfRange(t,r,o){if(r-t>v)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");for(var c=o.length-1;t<=r;){this._map[t++]=o;var l=o.charCodeAt(c)+1;l>255?o=o.substring(0,c-1)+String.fromCharCode(o.charCodeAt(c-1)+1)+"\0":o=o.substring(0,c)+String.fromCharCode(l)}}},{key:"mapBfRangeToArray",value:function mapBfRangeToArray(t,r,o){if(r-t>v)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");for(var c=o.length,l=0;t<=r&&l<c;){this._map[t]=o[l++];++t}}},{key:"mapOne",value:function mapOne(t,r){this._map[t]=r}},{key:"lookup",value:function lookup(t){return this._map[t]}},{key:"contains",value:function contains(t){return void 0!==this._map[t]}},{key:"forEach",value:function forEach(t){var r=this._map,o=r.length;if(o<=65536)for(var c=0;c<o;c++)void 0!==r[c]&&t(c,r[c]);else for(var l in r)t(l,r[l])}},{key:"charCodeOf",value:function charCodeOf(t){var r=this._map;if(r.length<=65536)return r.indexOf(t);for(var o in r)if(r[o]===t)return 0|o;return-1}},{key:"getMap",value:function getMap(){return this._map}},{key:"readCharCode",value:function readCharCode(t,r,o){for(var c=0,l=this.codespaceRanges,u=0,h=l.length;u<h;u++){c=(c<<8|t.charCodeAt(r+u))>>>0;for(var d=l[u],g=0,m=d.length;g<m;){var y=d[g++],v=d[g++];if(c>=y&&c<=v){o.charcode=c;o.length=u+1;return}}}o.charcode=0;o.length=1}},{key:"getCharCodeLength",value:function getCharCodeLength(t){for(var r=this.codespaceRanges,o=0,c=r.length;o<c;o++)for(var l=r[o],u=0,h=l.length;u<h;){var d=l[u++],g=l[u++];if(t>=d&&t<=g)return o+1}return 1}},{key:"length",get:function get(){return this._map.length}},{key:"isIdentityCMap",get:function get(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(var t=0;t<65536;t++)if(this._map[t]!==t)return!1;return!0}}]);return CMap}();r.CMap=k;var _=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(IdentityCMap,t);var r=_createSuper(IdentityCMap);function IdentityCMap(t,o){var c;_classCallCheck(this,IdentityCMap);(c=r.call(this)).vertical=t;c.addCodespaceRange(o,0,65535);return c}_createClass(IdentityCMap,[{key:"mapCidRange",value:function mapCidRange(t,r,o){(0,l.unreachable)("should not call mapCidRange")}},{key:"mapBfRange",value:function mapBfRange(t,r,o){(0,l.unreachable)("should not call mapBfRange")}},{key:"mapBfRangeToArray",value:function mapBfRangeToArray(t,r,o){(0,l.unreachable)("should not call mapBfRangeToArray")}},{key:"mapOne",value:function mapOne(t,r){(0,l.unreachable)("should not call mapCidOne")}},{key:"lookup",value:function lookup(t){return Number.isInteger(t)&&t<=65535?t:void 0}},{key:"contains",value:function contains(t){return Number.isInteger(t)&&t<=65535}},{key:"forEach",value:function forEach(t){for(var r=0;r<=65535;r++)t(r,r)}},{key:"charCodeOf",value:function charCodeOf(t){return Number.isInteger(t)&&t<=65535?t:-1}},{key:"getMap",value:function getMap(){for(var t=new Array(65536),r=0;r<=65535;r++)t[r]=r;return t}},{key:"length",get:function get(){return 65536}},{key:"isIdentityCMap",get:function get(){(0,l.unreachable)("should not access .isIdentityCMap")}}]);return IdentityCMap}(k);r.IdentityCMap=_;var w=function BinaryCMapReaderClosure(){function hexToInt(t,r){for(var o=0,c=0;c<=r;c++)o=o<<8|t[c];return o>>>0}function hexToStr(t,r){return 1===r?String.fromCharCode(t[0],t[1]):3===r?String.fromCharCode(t[0],t[1],t[2],t[3]):String.fromCharCode.apply(null,t.subarray(0,r+1))}function addHex(t,r,o){for(var c=0,l=o;l>=0;l--){c+=t[l]+r[l];t[l]=255&c;c>>=8}}function incHex(t,r){for(var o=1,c=r;c>=0&&o>0;c--){o+=t[c];t[c]=255&o;o>>=8}}var t=16,r=function(){function BinaryCMapStream(t){_classCallCheck(this,BinaryCMapStream);this.buffer=t;this.pos=0;this.end=t.length;this.tmpBuf=new Uint8Array(19)}_createClass(BinaryCMapStream,[{key:"readByte",value:function readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}},{key:"readNumber",value:function readNumber(){var t,r=0;do{var o=this.readByte();if(o<0)throw new l.FormatError("unexpected EOF in bcmap");t=!(128&o);r=r<<7|127&o}while(!t);return r}},{key:"readSigned",value:function readSigned(){var t=this.readNumber();return 1&t?~(t>>>1):t>>>1}},{key:"readHex",value:function readHex(t,r){t.set(this.buffer.subarray(this.pos,this.pos+r+1));this.pos+=r+1}},{key:"readHexNumber",value:function readHexNumber(t,r){var o,c=this.tmpBuf,u=0;do{var h=this.readByte();if(h<0)throw new l.FormatError("unexpected EOF in bcmap");o=!(128&h);c[u++]=127&h}while(!o);for(var d=r,g=0,m=0;d>=0;){for(;m<8&&c.length>0;){g|=c[--u]<<m;m+=7}t[d]=255&g;d--;g>>=8;m-=8}}},{key:"readHexSigned",value:function readHexSigned(t,r){this.readHexNumber(t,r);for(var o=1&t[r]?255:0,c=0,l=0;l<=r;l++){c=(1&c)<<8|t[l];t[l]=c>>1^o}}},{key:"readString",value:function readString(){for(var t=this.readNumber(),r="",o=0;o<t;o++)r+=String.fromCharCode(this.readNumber());return r}}]);return BinaryCMapStream}(),o=function(){function BinaryCMapReader(){_classCallCheck(this,BinaryCMapReader)}_createClass(BinaryCMapReader,[{key:"process",value:(o=_asyncToGenerator(c.default.mark((function _callee(o,l,u){var h,d,g,m,y,v,k,_,w,S,C,x,O,T,E,M,R,j,D,L,N;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:h=new r(o);d=h.readByte();l.vertical=!!(1&d);g=null;m=new Uint8Array(t);y=new Uint8Array(t);v=new Uint8Array(t);k=new Uint8Array(t);_=new Uint8Array(t);case 9:if(!((S=h.readByte())>=0)){c.next=68;break}if(7!=(C=S>>5)){c.next=20;break}c.t0=31&S;c.next=0===c.t0?15:1===c.t0?17:19;break;case 15:h.readString();return c.abrupt("break",19);case 17:g=h.readString();return c.abrupt("break",19);case 19:return c.abrupt("continue",9);case 20:x=!!(16&S);if(!(1+(O=15&S)>t)){c.next=24;break}throw new Error("BinaryCMapReader.process: Invalid dataSize.");case 24:T=1;E=h.readNumber();c.t1=C;c.next=0===c.t1?29:1===c.t1?35:2===c.t1?41:3===c.t1?46:4===c.t1?53:5===c.t1?58:65;break;case 29:h.readHex(m,O);h.readHexNumber(y,O);addHex(y,m,O);l.addCodespaceRange(O+1,hexToInt(m,O),hexToInt(y,O));for(M=1;M<E;M++){incHex(y,O);h.readHexNumber(m,O);addHex(m,y,O);h.readHexNumber(y,O);addHex(y,m,O);l.addCodespaceRange(O+1,hexToInt(m,O),hexToInt(y,O))}return c.abrupt("break",66);case 35:h.readHex(m,O);h.readHexNumber(y,O);addHex(y,m,O);h.readNumber();for(R=1;R<E;R++){incHex(y,O);h.readHexNumber(m,O);addHex(m,y,O);h.readHexNumber(y,O);addHex(y,m,O);h.readNumber()}return c.abrupt("break",66);case 41:h.readHex(v,O);w=h.readNumber();l.mapOne(hexToInt(v,O),w);for(j=1;j<E;j++){incHex(v,O);if(!x){h.readHexNumber(_,O);addHex(v,_,O)}w=h.readSigned()+(w+1);l.mapOne(hexToInt(v,O),w)}return c.abrupt("break",66);case 46:h.readHex(m,O);h.readHexNumber(y,O);addHex(y,m,O);w=h.readNumber();l.mapCidRange(hexToInt(m,O),hexToInt(y,O),w);for(D=1;D<E;D++){incHex(y,O);if(x)m.set(y);else{h.readHexNumber(m,O);addHex(m,y,O)}h.readHexNumber(y,O);addHex(y,m,O);w=h.readNumber();l.mapCidRange(hexToInt(m,O),hexToInt(y,O),w)}return c.abrupt("break",66);case 53:h.readHex(v,T);h.readHex(k,O);l.mapOne(hexToInt(v,T),hexToStr(k,O));for(L=1;L<E;L++){incHex(v,T);if(!x){h.readHexNumber(_,T);addHex(v,_,T)}incHex(k,O);h.readHexSigned(_,O);addHex(k,_,O);l.mapOne(hexToInt(v,T),hexToStr(k,O))}return c.abrupt("break",66);case 58:h.readHex(m,T);h.readHexNumber(y,T);addHex(y,m,T);h.readHex(k,O);l.mapBfRange(hexToInt(m,T),hexToInt(y,T),hexToStr(k,O));for(N=1;N<E;N++){incHex(y,T);if(x)m.set(y);else{h.readHexNumber(m,T);addHex(m,y,T)}h.readHexNumber(y,T);addHex(y,m,T);h.readHex(k,O);l.mapBfRange(hexToInt(m,T),hexToInt(y,T),hexToStr(k,O))}return c.abrupt("break",66);case 65:throw new Error("BinaryCMapReader.process - unknown type: ".concat(C));case 66:c.next=9;break;case 68:if(!g){c.next=70;break}return c.abrupt("return",u(g));case 70:return c.abrupt("return",l);case 71:case"end":return c.stop()}}),_callee)}))),function process(t,r,c){return o.apply(this,arguments)})}]);var o;return BinaryCMapReader}();return o}(),S=function CMapFactoryClosure(){function strToInt(t){for(var r=0,o=0;o<t.length;o++)r=r<<8|t.charCodeAt(o);return r>>>0}function expectString(t){if("string"!=typeof t)throw new l.FormatError("Malformed CMap: expected string.")}function expectInt(t){if(!Number.isInteger(t))throw new l.FormatError("Malformed CMap: expected int.")}function parseBfChar(t,r){for(;;){var o=r.getObj();if(o===u.EOF)break;if((0,u.isCmd)(o,"endbfchar"))return;expectString(o);var c=strToInt(o);expectString(o=r.getObj());var l=o;t.mapOne(c,l)}}function parseBfRange(t,r){for(;;){var o=r.getObj();if(o===u.EOF)break;if((0,u.isCmd)(o,"endbfrange"))return;expectString(o);var c=strToInt(o);expectString(o=r.getObj());var h=strToInt(o);o=r.getObj();if(Number.isInteger(o)||"string"==typeof o){var d=Number.isInteger(o)?String.fromCharCode(o):o;t.mapBfRange(c,h,d)}else{if(!(0,u.isCmd)(o,"["))break;o=r.getObj();for(var g=[];!(0,u.isCmd)(o,"]")&&o!==u.EOF;){g.push(o);o=r.getObj()}t.mapBfRangeToArray(c,h,g)}}throw new l.FormatError("Invalid bf range.")}function parseCidChar(t,r){for(;;){var o=r.getObj();if(o===u.EOF)break;if((0,u.isCmd)(o,"endcidchar"))return;expectString(o);var c=strToInt(o);expectInt(o=r.getObj());var l=o;t.mapOne(c,l)}}function parseCidRange(t,r){for(;;){var o=r.getObj();if(o===u.EOF)break;if((0,u.isCmd)(o,"endcidrange"))return;expectString(o);var c=strToInt(o);expectString(o=r.getObj());var l=strToInt(o);expectInt(o=r.getObj());var h=o;t.mapCidRange(c,l,h)}}function parseCodespaceRange(t,r){for(;;){var o=r.getObj();if(o===u.EOF)break;if((0,u.isCmd)(o,"endcodespacerange"))return;if("string"!=typeof o)break;var c=strToInt(o);if("string"!=typeof(o=r.getObj()))break;var h=strToInt(o);t.addCodespaceRange(o.length,c,h)}throw new l.FormatError("Invalid codespace range.")}function parseWMode(t,r){var o=r.getObj();Number.isInteger(o)&&(t.vertical=!!o)}function parseCMapName(t,r){var o=r.getObj();o instanceof u.Name&&(t.name=o.name)}function parseCMap(t,r,o,c){return _parseCMap.apply(this,arguments)}function _parseCMap(){return(_parseCMap=_asyncToGenerator(c.default.mark((function _callee3(t,r,o,h){var d,m,y;return c.default.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:0;c.prev=1;if((y=r.getObj())!==u.EOF){c.next=7;break}return c.abrupt("break",39);case 7:if(!(y instanceof u.Name)){c.next=12;break}"WMode"===y.name?parseWMode(t,r):"CMapName"===y.name&&parseCMapName(t,r);d=y;c.next=29;break;case 12:if(!(y instanceof u.Cmd)){c.next=29;break}c.t0=y.cmd;c.next="endcmap"===c.t0?16:"usecmap"===c.t0?17:"begincodespacerange"===c.t0?19:"beginbfchar"===c.t0?21:"begincidchar"===c.t0?23:"beginbfrange"===c.t0?25:"begincidrange"===c.t0?27:29;break;case 16:return c.abrupt("break",39);case 17:d instanceof u.Name&&(m=d.name);return c.abrupt("break",29);case 19:parseCodespaceRange(t,r);return c.abrupt("break",29);case 21:parseBfChar(t,r);return c.abrupt("break",29);case 23:parseCidChar(t,r);return c.abrupt("break",29);case 25:parseBfRange(t,r);return c.abrupt("break",29);case 27:parseCidRange(t,r);return c.abrupt("break",29);case 29:c.next=37;break;case 31:c.prev=31;c.t1=c.catch(1);if(!(c.t1 instanceof g.MissingDataException)){c.next=35;break}throw c.t1;case 35:(0,l.warn)("Invalid cMap data: "+c.t1);return c.abrupt("continue",0);case 37:c.next=0;break;case 39:!h&&m&&(h=m);if(!h){c.next=42;break}return c.abrupt("return",extendCMap(t,o,h));case 42:return c.abrupt("return",t);case 43:case"end":return c.stop()}}),_callee3,null,[[1,31]])})))).apply(this,arguments)}function extendCMap(t,r,o){return _extendCMap.apply(this,arguments)}function _extendCMap(){return(_extendCMap=_asyncToGenerator(c.default.mark((function _callee4(t,r,o){var l,u;return c.default.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:c.next=2;return createBuiltInCMap(o,r);case 2:t.useCMap=c.sent;if(0===t.numCodespaceRanges){l=t.useCMap.codespaceRanges;for(u=0;u<l.length;u++)t.codespaceRanges[u]=l[u].slice();t.numCodespaceRanges=t.useCMap.numCodespaceRanges}t.useCMap.forEach((function(r,o){t.contains(r)||t.mapOne(r,t.useCMap.lookup(r))}));return c.abrupt("return",t);case 6:case"end":return c.stop()}}),_callee4)})))).apply(this,arguments)}function createBuiltInCMap(t,r){return _createBuiltInCMap.apply(this,arguments)}function _createBuiltInCMap(){return(_createBuiltInCMap=_asyncToGenerator(c.default.mark((function _callee5(t,r){var o,u,h,g,v;return c.default.wrap((function _callee5$(c){for(;;)switch(c.prev=c.next){case 0:if("Identity-H"!==t){c.next=4;break}return c.abrupt("return",new _(!1,2));case 4:if("Identity-V"!==t){c.next=6;break}return c.abrupt("return",new _(!0,2));case 6:if(y.includes(t)){c.next=8;break}throw new Error("Unknown CMap name: "+t);case 8:if(r){c.next=10;break}throw new Error("Built-in CMap parameters are not provided.");case 10:c.next=12;return r(t);case 12:o=c.sent;u=o.cMapData;h=o.compressionType;g=new k(!0);if(h!==l.CMapCompressionType.BINARY){c.next=18;break}return c.abrupt("return",(new w).process(u,g,(function(t){return extendCMap(g,r,t)})));case 18:if(h!==l.CMapCompressionType.NONE){c.next=21;break}v=new d.Lexer(new m.Stream(u));return c.abrupt("return",parseCMap(g,v,r,null));case 21:throw new Error("TODO: Only BINARY/NONE CMap compression is currently supported.");case 22:case"end":return c.stop()}}),_callee5)})))).apply(this,arguments)}return{create:function create(t){return _asyncToGenerator(c.default.mark((function _callee2(){var r,o,l,g;return c.default.wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:r=t.encoding;o=t.fetchBuiltInCMap;l=t.useCMap;if(!(r instanceof u.Name)){c.next=7;break}return c.abrupt("return",createBuiltInCMap(r.name,o));case 7:if(!(r instanceof h.BaseStream)){c.next=14;break}c.next=10;return parseCMap(new k,new d.Lexer(r),o,l);case 10:if(!(g=c.sent).isIdentityCMap){c.next=13;break}return c.abrupt("return",createBuiltInCMap(g.name,o));case 13:return c.abrupt("return",g);case 14:throw new Error("Encoding required.");case 15:case"end":return c.stop()}}),_callee2)})))()}}}();r.CMapFactory=S},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Parser=r.Linearization=r.Lexer=void 0;var c=o(4),l=o(146),u=o(149),h=o(169),d=o(171),g=o(172),m=o(174),y=o(175),v=o(178),k=o(180),_=o(182),w=o(151),S=o(183),C=o(184);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function computeAdler32(t){for(var r=t.length,o=1,c=0,l=0;l<r;++l)c+=o+=255&t[l];return c%65521<<16|o%65521}var x=function(){function Parser(t){var r=t.lexer,o=t.xref,c=t.allowStreams,l=void 0!==c&&c,u=t.recoveryMode,h=void 0!==u&&u;_classCallCheck(this,Parser);this.lexer=r;this.xref=o;this.allowStreams=l;this.recoveryMode=h;this.imageCache=Object.create(null);this.refill()}_createClass(Parser,[{key:"refill",value:function refill(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}},{key:"shift",value:function shift(){if(this.buf2 instanceof l.Cmd&&"ID"===this.buf2.cmd){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}}},{key:"tryShift",value:function tryShift(){try{this.shift();return!0}catch(t){if(t instanceof u.MissingDataException)throw t;return!1}}},{key:"getObj",value:function getObj(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=this.buf1;this.shift();if(r instanceof l.Cmd)switch(r.cmd){case"BI":return this.makeInlineImage(t);case"[":for(var o=[];!(0,l.isCmd)(this.buf1,"]")&&this.buf1!==l.EOF;)o.push(this.getObj(t));if(this.buf1===l.EOF){if(this.recoveryMode)return o;throw new u.ParserEOFException("End of file inside array.")}this.shift();return o;case"<<":for(var h=new l.Dict(this.xref);!(0,l.isCmd)(this.buf1,">>")&&this.buf1!==l.EOF;)if(this.buf1 instanceof l.Name){var d=this.buf1.name;this.shift();if(this.buf1===l.EOF)break;h.set(d,this.getObj(t))}else{(0,c.info)("Malformed dictionary: key must be a name object");this.shift()}if(this.buf1===l.EOF){if(this.recoveryMode)return h;throw new u.ParserEOFException("End of file inside dictionary.")}if((0,l.isCmd)(this.buf2,"stream"))return this.allowStreams?this.makeStream(h,t):h;this.shift();return h;default:return r}if(Number.isInteger(r)){if(Number.isInteger(this.buf1)&&(0,l.isCmd)(this.buf2,"R")){var g=l.Ref.get(r,this.buf1);this.shift();this.shift();return g}return r}return"string"==typeof r&&t?t.decryptString(r):r}},{key:"findDefaultInlineStreamEnd",value:function findDefaultInlineStreamEnd(t){for(var r,o,h=this.lexer,d=t.pos,g=0;-1!==(r=t.getByte());)if(0===g)g=69===r?1:0;else if(1===g)g=73===r?2:0;else{(0,c.assert)(2===g,"findDefaultInlineStreamEnd - invalid state.");if(32===r||10===r||13===r){o=t.pos;for(var m=t.peekBytes(10),y=0,v=m.length;y<v;y++)if((0!==(r=m[y])||0===m[y+1])&&10!==r&&13!==r&&(r<32||r>127)){g=0;break}if(2!==g)continue;if(h.knownCommands){var k=h.peekObj();k instanceof l.Cmd&&!h.knownCommands[k.cmd]&&(g=0)}else(0,c.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");if(2===g)break}else g=0}if(-1===r){(0,c.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(o){(0,c.warn)('... trying to recover by using the last "EI" occurrence.');t.skip(-(t.pos-o))}}var _=4;t.skip(-_);r=t.peekByte();t.skip(_);(0,u.isWhiteSpace)(r)||_--;return t.pos-_-d}},{key:"findDCTDecodeInlineStreamEnd",value:function findDCTDecodeInlineStreamEnd(t){for(var r,o,l=t.pos,u=!1;-1!==(r=t.getByte());)if(255===r){switch(t.getByte()){case 0:break;case 255:t.skip(-1);break;case 217:u=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:(o=t.getUint16())>2?t.skip(o-2):t.skip(-2)}if(u)break}var h=t.pos-l;if(-1===r){(0,c.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");t.skip(-h);return this.findDefaultInlineStreamEnd(t)}this.inlineStreamSkipEI(t);return h}},{key:"findASCII85DecodeInlineStreamEnd",value:function findASCII85DecodeInlineStreamEnd(t){for(var r,o=t.pos;-1!==(r=t.getByte());)if(126===r){var l=t.pos;r=t.peekByte();for(;(0,u.isWhiteSpace)(r);){t.skip();r=t.peekByte()}if(62===r){t.skip();break}if(t.pos>l){var h=t.peekBytes(2);if(69===h[0]&&73===h[1])break}}var d=t.pos-o;if(-1===r){(0,c.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");t.skip(-d);return this.findDefaultInlineStreamEnd(t)}this.inlineStreamSkipEI(t);return d}},{key:"findASCIIHexDecodeInlineStreamEnd",value:function findASCIIHexDecodeInlineStreamEnd(t){for(var r,o=t.pos;-1!==(r=t.getByte())&&62!==r;);var l=t.pos-o;if(-1===r){(0,c.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");t.skip(-l);return this.findDefaultInlineStreamEnd(t)}this.inlineStreamSkipEI(t);return l}},{key:"inlineStreamSkipEI",value:function inlineStreamSkipEI(t){for(var r,o=0;-1!==(r=t.getByte());)if(0===o)o=69===r?1:0;else if(1===o)o=73===r?2:0;else if(2===o)break}},{key:"makeInlineImage",value:function makeInlineImage(t){for(var r,o=this.lexer,u=o.stream,h=new l.Dict(this.xref);!(0,l.isCmd)(this.buf1,"ID")&&this.buf1!==l.EOF;){if(!(this.buf1 instanceof l.Name))throw new c.FormatError("Dictionary key must be a name object");var d=this.buf1.name;this.shift();if(this.buf1===l.EOF)break;h.set(d,this.getObj(t))}-1!==o.beginInlineImagePos&&(r=u.pos-o.beginInlineImagePos);var g,m=h.get("F","Filter");if(m instanceof l.Name)g=m.name;else if(Array.isArray(m)){var y=this.xref.fetchIfRef(m[0]);y instanceof l.Name&&(g=y.name)}var v,k=u.pos;switch(g){case"DCT":case"DCTDecode":v=this.findDCTDecodeInlineStreamEnd(u);break;case"A85":case"ASCII85Decode":v=this.findASCII85DecodeInlineStreamEnd(u);break;case"AHx":case"ASCIIHexDecode":v=this.findASCIIHexDecodeInlineStreamEnd(u);break;default:v=this.findDefaultInlineStreamEnd(u)}var _,w=u.makeSubStream(k,v,h);if(v<1e3&&r<5552){var S=w.getBytes();w.reset();var C=u.pos;u.pos=o.beginInlineImagePos;var x=u.getBytes(r);u.pos=C;_=computeAdler32(S)+"_"+computeAdler32(x);var O=this.imageCache[_];if(void 0!==O){this.buf2=l.Cmd.get("EI");this.shift();O.reset();return O}}t&&(w=t.createStream(w,v));(w=this.filter(w,h,v)).dict=h;if(void 0!==_){w.cacheKey="inline_".concat(v,"_").concat(_);this.imageCache[_]=w}this.buf2=l.Cmd.get("EI");this.shift();return w}},{key:"_findStreamLength",value:function _findStreamLength(t,r){var o=this.lexer.stream;o.pos=t;for(var c=r.length;o.pos<o.end;){var l=o.peekBytes(2048),u=l.length-c;if(u<=0)break;for(var h=0;h<u;){for(var d=0;d<c&&l[h+d]===r[d];)d++;if(d>=c){o.pos+=h;return o.pos-t}h++}o.pos+=u}return-1}},{key:"makeStream",value:function makeStream(t,r){var o=this.lexer,h=o.stream;o.skipToNextLine();var d=h.pos-1,g=t.get("Length");if(!Number.isInteger(g)){(0,c.info)('Bad length "'.concat(g&&g.toString(),'" in stream.'));g=0}h.pos=d+g;o.nextChar();if(this.tryShift()&&(0,l.isCmd)(this.buf2,"endstream"))this.shift();else{var m=new Uint8Array([101,110,100,115,116,114,101,97,109]),y=this._findStreamLength(d,m);if(y<0){for(var v=1;v<=1;v++){var k=m.length-v,_=m.slice(0,k),w=this._findStreamLength(d,_);if(w>=0){var S=h.peekBytes(k+1)[k];if(!(0,u.isWhiteSpace)(S))break;(0,c.info)('Found "'.concat((0,c.bytesToString)(_),'" when ')+"searching for endstream command.");y=w;break}}if(y<0)throw new c.FormatError("Missing endstream command.")}g=y;o.nextChar();this.shift();this.shift()}this.shift();h=h.makeSubStream(d,g,t);r&&(h=r.createStream(h,g));(h=this.filter(h,t,g)).dict=t;return h}},{key:"filter",value:function filter(t,r,o){var filter=r.get("F","Filter"),u=r.get("DP","DecodeParms");if(filter instanceof l.Name){Array.isArray(u)&&(0,c.warn)("/DecodeParms should not be an Array, when /Filter is a Name.");return this.makeFilter(t,filter.name,o,u)}var h=o;if(Array.isArray(filter))for(var d=filter,g=u,m=0,y=d.length;m<y;++m){filter=this.xref.fetchIfRef(d[m]);if(!(filter instanceof l.Name))throw new c.FormatError('Bad filter name "'.concat(filter,'"'));u=null;Array.isArray(g)&&m in g&&(u=this.xref.fetchIfRef(g[m]));t=this.makeFilter(t,filter.name,h,u);h=null}return t}},{key:"makeFilter",value:function makeFilter(t,r,o,l){if(0===o){(0,c.warn)('Empty "'.concat(r,'" stream.'));return new w.NullStream}var x=this.xref.stats;try{switch(r){case"Fl":case"FlateDecode":x.addStreamType(c.StreamType.FLATE);return l?new S.PredictorStream(new m.FlateStream(t,o),o,l):new m.FlateStream(t,o);case"LZW":case"LZWDecode":x.addStreamType(c.StreamType.LZW);var O=1;if(l){l.has("EarlyChange")&&(O=l.get("EarlyChange"));return new S.PredictorStream(new _.LZWStream(t,o,O),o,l)}return new _.LZWStream(t,o,O);case"DCT":case"DCTDecode":x.addStreamType(c.StreamType.DCT);return new v.JpegStream(t,o,l);case"JPX":case"JPXDecode":x.addStreamType(c.StreamType.JPX);return new k.JpxStream(t,o,l);case"A85":case"ASCII85Decode":x.addStreamType(c.StreamType.A85);return new h.Ascii85Stream(t,o);case"AHx":case"ASCIIHexDecode":x.addStreamType(c.StreamType.AHX);return new d.AsciiHexStream(t,o);case"CCF":case"CCITTFaxDecode":x.addStreamType(c.StreamType.CCF);return new g.CCITTFaxStream(t,o,l);case"RL":case"RunLengthDecode":x.addStreamType(c.StreamType.RLX);return new C.RunLengthStream(t,o);case"JBIG2Decode":x.addStreamType(c.StreamType.JBIG);return new y.Jbig2Stream(t,o,l)}(0,c.warn)('Filter "'.concat(r,'" is not supported.'));return t}catch(t){if(t instanceof u.MissingDataException)throw t;(0,c.warn)('Invalid stream: "'.concat(t,'"'));return new w.NullStream}}}]);return Parser}();r.Parser=x;var O=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(t){return t>=48&&t<=57?15&t:t>=65&&t<=70||t>=97&&t<=102?9+(15&t):-1}var T=function(){function Lexer(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,Lexer);this.stream=t;this.nextChar();this.strBuf=[];this.knownCommands=r;this._hexStringNumWarn=0;this.beginInlineImagePos=-1}_createClass(Lexer,[{key:"nextChar",value:function nextChar(){return this.currentChar=this.stream.getByte()}},{key:"peekChar",value:function peekChar(){return this.stream.peekByte()}},{key:"getNumber",value:function getNumber(){var t=this.currentChar,r=!1,o=0,l=0;if(45===t){l=-1;45===(t=this.nextChar())&&(t=this.nextChar())}else if(43===t){l=1;t=this.nextChar()}if(10===t||13===t)do{t=this.nextChar()}while(10===t||13===t);if(46===t){o=10;t=this.nextChar()}if(t<48||t>57){if((0,u.isWhiteSpace)(t)||-1===t){if(10===o&&0===l){(0,c.warn)("Lexer.getNumber - treating a single decimal point as zero.");return 0}if(0===o&&-1===l){(0,c.warn)("Lexer.getNumber - treating a single minus sign as zero.");return 0}}throw new c.FormatError("Invalid number: ".concat(String.fromCharCode(t)," (charCode ").concat(t,")"))}l=l||1;for(var h=t-48,d=0,g=1;(t=this.nextChar())>=0;)if(t>=48&&t<=57){var m=t-48;if(r)d=10*d+m;else{0!==o&&(o*=10);h=10*h+m}}else if(46===t){if(0!==o)break;o=1}else if(45===t)(0,c.warn)("Badly formatted number: minus sign in the middle");else{if(69!==t&&101!==t)break;if(43===(t=this.peekChar())||45===t){g=45===t?-1:1;this.nextChar()}else if(t<48||t>57)break;r=!0}0!==o&&(h/=o);r&&(h*=Math.pow(10,g*d));return l*h}},{key:"getString",value:function getString(){var t=1,r=!1,o=this.strBuf;o.length=0;for(var l=this.nextChar();;){var u=!1;switch(0|l){case-1:(0,c.warn)("Unterminated string");r=!0;break;case 40:++t;o.push("(");break;case 41:if(0==--t){this.nextChar();r=!0}else o.push(")");break;case 92:switch(l=this.nextChar()){case-1:(0,c.warn)("Unterminated string");r=!0;break;case 110:o.push("\n");break;case 114:o.push("\r");break;case 116:o.push("\t");break;case 98:o.push("\b");break;case 102:o.push("\f");break;case 92:case 40:case 41:o.push(String.fromCharCode(l));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:var h=15&l;u=!0;if((l=this.nextChar())>=48&&l<=55){h=(h<<3)+(15&l);if((l=this.nextChar())>=48&&l<=55){u=!1;h=(h<<3)+(15&l)}}o.push(String.fromCharCode(h));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:o.push(String.fromCharCode(l))}break;default:o.push(String.fromCharCode(l))}if(r)break;u||(l=this.nextChar())}return o.join("")}},{key:"getName",value:function getName(){var t,r,o=this.strBuf;o.length=0;for(;(t=this.nextChar())>=0&&!O[t];)if(35===t){t=this.nextChar();if(O[t]){(0,c.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.");o.push("#");break}var u=toHexDigit(t);if(-1!==u){r=t;var h=toHexDigit(t=this.nextChar());if(-1===h){(0,c.warn)("Lexer_getName: Illegal digit (".concat(String.fromCharCode(t),") ")+"in hexadecimal number.");o.push("#",String.fromCharCode(r));if(O[t])break;o.push(String.fromCharCode(t));continue}o.push(String.fromCharCode(u<<4|h))}else o.push("#",String.fromCharCode(t))}else o.push(String.fromCharCode(t));o.length>127&&(0,c.warn)("Name token is longer than allowed by the spec: ".concat(o.length));return l.Name.get(o.join(""))}},{key:"_hexStringWarn",value:function _hexStringWarn(t){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||(0,c.warn)("getHexString - ignoring invalid character: ".concat(t)):(0,c.warn)("getHexString - ignoring additional invalid characters.")}},{key:"getHexString",value:function getHexString(){var t=this.strBuf;t.length=0;var r,o,l=this.currentChar,u=!0;this._hexStringNumWarn=0;for(;;){if(l<0){(0,c.warn)("Unterminated hex string");break}if(62===l){this.nextChar();break}if(1!==O[l]){if(u){if(-1===(r=toHexDigit(l))){this._hexStringWarn(l);l=this.nextChar();continue}}else{if(-1===(o=toHexDigit(l))){this._hexStringWarn(l);l=this.nextChar();continue}t.push(String.fromCharCode(r<<4|o))}u=!u;l=this.nextChar()}else l=this.nextChar()}return t.join("")}},{key:"getObj",value:function getObj(){for(var t=!1,r=this.currentChar;;){if(r<0)return l.EOF;if(t)10!==r&&13!==r||(t=!1);else if(37===r)t=!0;else if(1!==O[r])break;r=this.nextChar()}switch(0|r){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return l.Cmd.get("[");case 93:this.nextChar();return l.Cmd.get("]");case 60:if(60===(r=this.nextChar())){this.nextChar();return l.Cmd.get("<<")}return this.getHexString();case 62:if(62===(r=this.nextChar())){this.nextChar();return l.Cmd.get(">>")}return l.Cmd.get(">");case 123:this.nextChar();return l.Cmd.get("{");case 125:this.nextChar();return l.Cmd.get("}");case 41:this.nextChar();throw new c.FormatError("Illegal character: ".concat(r))}var o=String.fromCharCode(r);if(r<32||r>127){var u=this.peekChar();if(u>=32&&u<=127){this.nextChar();return l.Cmd.get(o)}}for(var h=this.knownCommands,d=h&&void 0!==h[o];(r=this.nextChar())>=0&&!O[r];){var g=o+String.fromCharCode(r);if(d&&void 0===h[g])break;if(128===o.length)throw new c.FormatError("Command token too long: ".concat(o.length));o=g;d=h&&void 0!==h[o]}if("true"===o)return!0;if("false"===o)return!1;if("null"===o)return null;"BI"===o&&(this.beginInlineImagePos=this.stream.pos);return l.Cmd.get(o)}},{key:"peekObj",value:function peekObj(){var t,r=this.stream.pos,o=this.currentChar,l=this.beginInlineImagePos;try{t=this.getObj()}catch(t){if(t instanceof u.MissingDataException)throw t;(0,c.warn)("peekObj: ".concat(t))}this.stream.pos=r;this.currentChar=o;this.beginInlineImagePos=l;return t}},{key:"skipToNextLine",value:function skipToNextLine(){for(var t=this.currentChar;t>=0;){if(13===t){10===(t=this.nextChar())&&this.nextChar();break}if(10===t){this.nextChar();break}t=this.nextChar()}}}]);return Lexer}();r.Lexer=T;var E=function(){function Linearization(){_classCallCheck(this,Linearization)}_createClass(Linearization,null,[{key:"create",value:function create(t){function getInt(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=t.get(r);if(Number.isInteger(c)&&(o?c>=0:c>0))return c;throw new Error('The "'.concat(r,'" parameter in the linearization ')+"dictionary is invalid.")}var r,o,c=new x({lexer:new T(t),xref:null}),u=c.getObj(),h=c.getObj(),d=c.getObj(),g=c.getObj();if(!(Number.isInteger(u)&&Number.isInteger(h)&&(0,l.isCmd)(d,"obj")&&g instanceof l.Dict&&"number"==typeof(r=g.get("Linearized"))&&r>0))return null;if((o=getInt(g,"L"))!==t.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:o,hints:function getHints(t){var r,o=t.get("H");if(Array.isArray(o)&&(2===(r=o.length)||4===r)){for(var c=0;c<r;c++){var l=o[c];if(!(Number.isInteger(l)&&l>0))throw new Error("Hint (".concat(c,") in the linearization dictionary is invalid."))}return o}throw new Error("Hint array in the linearization dictionary is invalid.")}(g),objectNumberFirst:getInt(g,"O"),endFirst:getInt(g,"E"),numPages:getInt(g,"N"),mainXRefEntriesOffset:getInt(g,"T"),pageFirst:g.has("P")?getInt(g,"P",!0):0}}}]);return Linearization}();r.Linearization=E},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Ascii85Stream=void 0;var c=o(170),l=o(149);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Ascii85Stream,t);var r=_createSuper(Ascii85Stream);function Ascii85Stream(t,o){var c;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Ascii85Stream);o&&(o*=.8);(c=r.call(this,o)).str=t;c.dict=t.dict;c.input=new Uint8Array(5);return c}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(Ascii85Stream,[{key:"readBlock",value:function readBlock(){for(var t=this.str,r=t.getByte();(0,l.isWhiteSpace)(r);)r=t.getByte();if(-1!==r&&126!==r){var o,c,u=this.bufferLength;if(122===r){o=this.ensureBuffer(u+4);for(c=0;c<4;++c)o[u+c]=0;this.bufferLength+=4}else{var h=this.input;h[0]=r;for(c=1;c<5;++c){r=t.getByte();for(;(0,l.isWhiteSpace)(r);)r=t.getByte();h[c]=r;if(-1===r||126===r)break}o=this.ensureBuffer(u+c-1);this.bufferLength+=c-1;if(c<5){for(;c<5;++c)h[c]=117;this.eof=!0}var d=0;for(c=0;c<5;++c)d=85*d+(h[c]-33);for(c=3;c>=0;--c){o[u+c]=255&d;d>>=8}}}else this.eof=!0}}]);return Ascii85Stream}(c.DecodeStream);r.Ascii85Stream=u},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.StreamsSequenceStream=r.DecodeStream=void 0;var c=o(150),l=o(151);function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=new Uint8Array(0),h=function(t){_inherits(DecodeStream,t);var r=_createSuper(DecodeStream);function DecodeStream(t){var o;_classCallCheck(this,DecodeStream);(o=r.call(this))._rawMinBufferLength=t||0;o.pos=0;o.bufferLength=0;o.eof=!1;o.buffer=u;o.minBufferLength=512;if(t)for(;o.minBufferLength<t;)o.minBufferLength*=2;return o}_createClass(DecodeStream,[{key:"isEmpty",get:function get(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}},{key:"ensureBuffer",value:function ensureBuffer(t){var r=this.buffer;if(t<=r.byteLength)return r;for(var o=this.minBufferLength;o<t;)o*=2;var c=new Uint8Array(o);c.set(r);return this.buffer=c}},{key:"getByte",value:function getByte(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}},{key:"getBytes",value:function getBytes(t){var r,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=this.pos;if(t){this.ensureBuffer(c+t);r=c+t;for(;!this.eof&&this.bufferLength<r;)this.readBlock();var l=this.bufferLength;r>l&&(r=l)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}this.pos=r;var u=this.buffer.subarray(c,r);return!o||u instanceof Uint8ClampedArray?u:new Uint8ClampedArray(u)}},{key:"reset",value:function reset(){this.pos=0}},{key:"makeSubStream",value:function makeSubStream(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===r)for(;!this.eof;)this.readBlock();else for(var c=t+r;this.bufferLength<=c&&!this.eof;)this.readBlock();return new l.Stream(this.buffer,t,r,o)}},{key:"getBaseStreams",value:function getBaseStreams(){return this.str?this.str.getBaseStreams():null}}]);return DecodeStream}(c.BaseStream);r.DecodeStream=h;var d=function(t){_inherits(StreamsSequenceStream,t);var r=_createSuper(StreamsSequenceStream);function StreamsSequenceStream(t){var o,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;_classCallCheck(this,StreamsSequenceStream);var l,u=0,d=_createForOfIteratorHelper(t);try{for(d.s();!(l=d.n()).done;){var g=l.value;u+=g instanceof h?g._rawMinBufferLength:g.length}}catch(t){d.e(t)}finally{d.f()}(o=r.call(this,u)).streams=t;o._onError=c;return o}_createClass(StreamsSequenceStream,[{key:"readBlock",value:function readBlock(){var t=this.streams;if(0!==t.length){var r,o=t.shift();try{r=o.getBytes()}catch(t){if(this._onError){this._onError(t,o.dict&&o.dict.objId);return}throw t}var c=this.bufferLength,l=c+r.length;this.ensureBuffer(l).set(r,c);this.bufferLength=l}else this.eof=!0}},{key:"getBaseStreams",value:function getBaseStreams(){var t,r=[],o=_createForOfIteratorHelper(this.streams);try{for(o.s();!(t=o.n()).done;){var c=t.value.getBaseStreams();c&&r.push.apply(r,_toConsumableArray(c))}}catch(t){o.e(t)}finally{o.f()}return r.length>0?r:null}}]);return StreamsSequenceStream}(h);r.StreamsSequenceStream=d},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.AsciiHexStream=void 0;function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var c=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(AsciiHexStream,t);var r=_createSuper(AsciiHexStream);function AsciiHexStream(t,o){var c;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,AsciiHexStream);o&&(o*=.5);(c=r.call(this,o)).str=t;c.dict=t.dict;c.firstDigit=-1;return c}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(AsciiHexStream,[{key:"readBlock",value:function readBlock(){var t=this.str.getBytes(8e3);if(t.length){var r,o=t.length+1>>1,c=this.ensureBuffer(this.bufferLength+o),l=this.bufferLength,u=this.firstDigit,h=_createForOfIteratorHelper(t);try{for(h.s();!(r=h.n()).done;){var d=r.value,g=void 0;if(d>=48&&d<=57)g=15&d;else{if(!(d>=65&&d<=70||d>=97&&d<=102)){if(62===d){this.eof=!0;break}continue}g=9+(15&d)}if(u<0)u=g;else{c[l++]=u<<4|g;u=-1}}}catch(t){h.e(t)}finally{h.f()}if(u>=0&&this.eof){c[l++]=u<<4;u=-1}this.firstDigit=u;this.bufferLength=l}else this.eof=!0}}]);return AsciiHexStream}(o(170).DecodeStream);r.AsciiHexStream=c},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.CCITTFaxStream=void 0;var c=o(173),l=o(170),u=o(146);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(CCITTFaxStream,t);var r=_createSuper(CCITTFaxStream);function CCITTFaxStream(t,o,l){var h;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,CCITTFaxStream);(h=r.call(this,o)).str=t;h.dict=t.dict;l instanceof u.Dict||(l=u.Dict.empty);var d={next:function next(){return t.getByte()}};h.ccittFaxDecoder=new c.CCITTFaxDecoder(d,{K:l.get("K"),EndOfLine:l.get("EndOfLine"),EncodedByteAlign:l.get("EncodedByteAlign"),Columns:l.get("Columns"),Rows:l.get("Rows"),EndOfBlock:l.get("EndOfBlock"),BlackIs1:l.get("BlackIs1")});return h}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(CCITTFaxStream,[{key:"readBlock",value:function readBlock(){for(;!this.eof;){var t=this.ccittFaxDecoder.readNextChar();if(-1===t){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=t}}}]);return CCITTFaxStream}(l.DecodeStream);r.CCITTFaxStream=h},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CCITTFaxDecoder=void 0;var c=o(4);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var l=-1,u=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],h=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],d=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],g=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],m=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],y=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]],v=function(){function CCITTFaxDecoder(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,CCITTFaxDecoder);if(!t||"function"!=typeof t.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=t;this.eof=!1;this.encoding=r.K||0;this.eoline=r.EndOfLine||!1;this.byteAlign=r.EncodedByteAlign||!1;this.columns=r.Columns||1728;this.rows=r.Rows||0;var o,c=r.EndOfBlock;null==c&&(c=!0);this.eoblock=c;this.black=r.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;for(;0===(o=this._lookBits(12));)this._eatBits(1);1===o&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(CCITTFaxDecoder,[{key:"readNextChar",value:function readNextChar(){if(this.eof)return-1;var t,r,o,u,h,d=this.refLine,g=this.codingLine,m=this.columns;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;var y,v,k;if(this.nextLine2D){for(u=0;g[u]<m;++u)d[u]=g[u];d[u++]=m;d[u]=m;g[0]=0;this.codingPos=0;t=0;r=0;for(;g[this.codingPos]<m;)switch(y=this._getTwoDimCode()){case 0:this._addPixels(d[t+1],r);d[t+1]<m&&(t+=2);break;case 1:y=v=0;if(r){do{y+=k=this._getBlackCode()}while(k>=64);do{v+=k=this._getWhiteCode()}while(k>=64)}else{do{y+=k=this._getWhiteCode()}while(k>=64);do{v+=k=this._getBlackCode()}while(k>=64)}this._addPixels(g[this.codingPos]+y,r);g[this.codingPos]<m&&this._addPixels(g[this.codingPos]+v,1^r);for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2;break;case 7:this._addPixels(d[t]+3,r);r^=1;if(g[this.codingPos]<m){++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case 5:this._addPixels(d[t]+2,r);r^=1;if(g[this.codingPos]<m){++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case 3:this._addPixels(d[t]+1,r);r^=1;if(g[this.codingPos]<m){++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case 2:this._addPixels(d[t],r);r^=1;if(g[this.codingPos]<m){++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case 8:this._addPixelsNeg(d[t]-3,r);r^=1;if(g[this.codingPos]<m){t>0?--t:++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case 6:this._addPixelsNeg(d[t]-2,r);r^=1;if(g[this.codingPos]<m){t>0?--t:++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case 4:this._addPixelsNeg(d[t]-1,r);r^=1;if(g[this.codingPos]<m){t>0?--t:++t;for(;d[t]<=g[this.codingPos]&&d[t]<m;)t+=2}break;case l:this._addPixels(m,0);this.eof=!0;break;default:(0,c.info)("bad 2d code");this._addPixels(m,0);this.err=!0}}else{g[0]=0;this.codingPos=0;r=0;for(;g[this.codingPos]<m;){y=0;if(r)do{y+=k=this._getBlackCode()}while(k>=64);else do{y+=k=this._getWhiteCode()}while(k>=64);this._addPixels(g[this.codingPos]+y,r);r^=1}}var _=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){y=this._lookBits(12);if(this.eoline)for(;y!==l&&1!==y;){this._eatBits(1);y=this._lookBits(12)}else for(;0===y;){this._eatBits(1);y=this._lookBits(12)}if(1===y){this._eatBits(12);_=!0}else y===l&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&_&&this.byteAlign){if(1===(y=this._lookBits(12))){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(u=0;u<4;++u){1!==(y=this._lookBits(12))&&(0,c.info)("bad rtc code: "+y);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){if((y=this._lookBits(13))===l){this.eof=!0;return-1}if(y>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&y)}}g[0]>0?this.outputBits=g[this.codingPos=0]:this.outputBits=g[this.codingPos=1];this.row++}if(this.outputBits>=8){h=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&g[this.codingPos]<m){this.codingPos++;this.outputBits=g[this.codingPos]-g[this.codingPos-1]}}else{o=8;h=0;do{if("number"!=typeof this.outputBits)throw new c.FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');if(this.outputBits>o){h<<=o;1&this.codingPos||(h|=255>>8-o);this.outputBits-=o;o=0}else{h<<=this.outputBits;1&this.codingPos||(h|=255>>8-this.outputBits);o-=this.outputBits;this.outputBits=0;if(g[this.codingPos]<m){this.codingPos++;this.outputBits=g[this.codingPos]-g[this.codingPos-1]}else if(o>0){h<<=o;o=0}}}while(o)}this.black&&(h^=255);return h}},{key:"_addPixels",value:function _addPixels(t,r){var o=this.codingLine,l=this.codingPos;if(t>o[l]){if(t>this.columns){(0,c.info)("row is wrong length");this.err=!0;t=this.columns}1&l^r&&++l;o[l]=t}this.codingPos=l}},{key:"_addPixelsNeg",value:function _addPixelsNeg(t,r){var o=this.codingLine,l=this.codingPos;if(t>o[l]){if(t>this.columns){(0,c.info)("row is wrong length");this.err=!0;t=this.columns}1&l^r&&++l;o[l]=t}else if(t<o[l]){if(t<0){(0,c.info)("invalid code");this.err=!0;t=0}for(;l>0&&t<o[l-1];)--l;o[l]=t}this.codingPos=l}},{key:"_findTableCode",value:function _findTableCode(t,r,o,c){for(var u=c||0,h=t;h<=r;++h){var d=this._lookBits(h);if(d===l)return[!0,1,!1];h<r&&(d<<=r-h);if(!u||d>=u){var g=o[d-u];if(g[0]===h){this._eatBits(h);return[!0,g[1],!0]}}}return[!1,0,!1]}},{key:"_getTwoDimCode",value:function _getTwoDimCode(){var t,r=0;if(this.eoblock){r=this._lookBits(7);if((t=u[r])&&t[0]>0){this._eatBits(t[0]);return t[1]}}else{var o=this._findTableCode(1,7,u);if(o[0]&&o[2])return o[1]}(0,c.info)("Bad two dim code");return l}},{key:"_getWhiteCode",value:function _getWhiteCode(){var t,r=0;if(this.eoblock){if((r=this._lookBits(12))===l)return 1;if((t=r>>5==0?h[r]:d[r>>3])[0]>0){this._eatBits(t[0]);return t[1]}}else{var o=this._findTableCode(1,9,d);if(o[0])return o[1];if((o=this._findTableCode(11,12,h))[0])return o[1]}(0,c.info)("bad white code");this._eatBits(1);return 1}},{key:"_getBlackCode",value:function _getBlackCode(){var t,r;if(this.eoblock){if((t=this._lookBits(13))===l)return 1;if((r=t>>7==0?g[t]:t>>9==0&&t>>7!=0?m[(t>>1)-64]:y[t>>7])[0]>0){this._eatBits(r[0]);return r[1]}}else{var o=this._findTableCode(2,6,y);if(o[0])return o[1];if((o=this._findTableCode(7,12,m,64))[0])return o[1];if((o=this._findTableCode(10,13,g))[0])return o[1]}(0,c.info)("bad black code");this._eatBits(1);return 1}},{key:"_lookBits",value:function _lookBits(t){for(var r;this.inputBits<t;){if(-1===(r=this.source.next()))return 0===this.inputBits?l:this.inputBuf<<t-this.inputBits&65535>>16-t;this.inputBuf=this.inputBuf<<8|r;this.inputBits+=8}return this.inputBuf>>this.inputBits-t&65535>>16-t}},{key:"_eatBits",value:function _eatBits(t){(this.inputBits-=t)<0&&(this.inputBits=0)}}]);return CCITTFaxDecoder}();r.CCITTFaxDecoder=v},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.FlateStream=void 0;var c=o(170),l=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),h=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),d=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),g=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],m=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],y=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(FlateStream,t);var r=_createSuper(FlateStream);function FlateStream(t,o){var c;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,FlateStream);(c=r.call(this,o)).str=t;c.dict=t.dict;var u=t.getByte(),h=t.getByte();if(-1===u||-1===h)throw new l.FormatError("Invalid header in flate stream: ".concat(u,", ").concat(h));if(8!=(15&u))throw new l.FormatError("Unknown compression method in flate stream: ".concat(u,", ").concat(h));if(((u<<8)+h)%31!=0)throw new l.FormatError("Bad FCHECK in flate stream: ".concat(u,", ").concat(h));if(32&h)throw new l.FormatError("FDICT bit set in flate stream: ".concat(u,", ").concat(h));c.codeSize=0;c.codeBuf=0;return c}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(FlateStream,[{key:"getBits",value:function getBits(t){for(var r,o=this.str,c=this.codeSize,u=this.codeBuf;c<t;){if(-1===(r=o.getByte()))throw new l.FormatError("Bad encoding in flate stream");u|=r<<c;c+=8}r=u&(1<<t)-1;this.codeBuf=u>>t;this.codeSize=c-=t;return r}},{key:"getCode",value:function getCode(t){for(var r,o=this.str,c=t[0],u=t[1],h=this.codeSize,d=this.codeBuf;h<u&&-1!==(r=o.getByte());){d|=r<<h;h+=8}var g=c[d&(1<<u)-1],m=g>>16,y=65535&g;if(m<1||h<m)throw new l.FormatError("Bad encoding in flate stream");this.codeBuf=d>>m;this.codeSize=h-m;return y}},{key:"generateHuffmanTable",value:function generateHuffmanTable(t){var r,o=t.length,c=0;for(r=0;r<o;++r)t[r]>c&&(c=t[r]);for(var l=1<<c,u=new Int32Array(l),h=1,d=0,g=2;h<=c;++h,d<<=1,g<<=1)for(var m=0;m<o;++m)if(t[m]===h){var y=0,v=d;for(r=0;r<h;++r){y=y<<1|1&v;v>>=1}for(r=y;r<l;r+=g)u[r]=h<<16|m;++d}return[u,c]}},{key:"readBlock",value:function readBlock(){var t,r,o=this.str,c=this.getBits(3);1&c&&(this.eof=!0);if(0!==(c>>=1)){var y,v;if(1===c){y=g;v=m}else{if(2!==c)throw new l.FormatError("Unknown block type in flate stream");var k,_=this.getBits(5)+257,w=this.getBits(5)+1,S=this.getBits(4)+4,C=new Uint8Array(u.length);for(k=0;k<S;++k)C[u[k]]=this.getBits(3);var x=this.generateHuffmanTable(C);r=0;k=0;for(var O,T,E,M=_+w,R=new Uint8Array(M);k<M;){var j=this.getCode(x);if(16===j){O=2;T=3;E=r}else if(17===j){O=3;T=3;E=r=0}else{if(18!==j){R[k++]=r=j;continue}O=7;T=11;E=r=0}for(var D=this.getBits(O)+T;D-- >0;)R[k++]=E}y=this.generateHuffmanTable(R.subarray(0,_));v=this.generateHuffmanTable(R.subarray(_,M))}for(var L=(t=this.buffer)?t.length:0,N=this.bufferLength;;){var U=this.getCode(y);if(U<256){N+1>=L&&(L=(t=this.ensureBuffer(N+1)).length);t[N++]=U}else{if(256===U){this.bufferLength=N;return}var H=(U=h[U-=257])>>16;H>0&&(H=this.getBits(H));r=(65535&U)+H;U=this.getCode(v);(H=(U=d[U])>>16)>0&&(H=this.getBits(H));var $=(65535&U)+H;N+r>=L&&(L=(t=this.ensureBuffer(N+r)).length);for(var X=0;X<r;++X,++N)t[N]=t[N-$]}}}else{var q;if(-1===(q=o.getByte()))throw new l.FormatError("Bad block header in flate stream");var G=q;if(-1===(q=o.getByte()))throw new l.FormatError("Bad block header in flate stream");G|=q<<8;if(-1===(q=o.getByte()))throw new l.FormatError("Bad block header in flate stream");var z=q;if(-1===(q=o.getByte()))throw new l.FormatError("Bad block header in flate stream");if((z|=q<<8)!==(65535&~G)&&(0!==G||0!==z))throw new l.FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0;this.codeSize=0;var W=this.bufferLength,V=W+G;t=this.ensureBuffer(V);this.bufferLength=V;if(0===G)-1===o.peekByte()&&(this.eof=!0);else{var K=o.getBytes(G);t.set(K,W);K.length<G&&(this.eof=!0)}}}}]);return FlateStream}(c.DecodeStream);r.FlateStream=y},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Jbig2Stream=void 0;var c=o(150),l=o(170),u=o(146),h=o(176),d=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var g=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Jbig2Stream,t);var r=_createSuper(Jbig2Stream);function Jbig2Stream(t,o,c){var l;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Jbig2Stream);(l=r.call(this,o)).stream=t;l.dict=t.dict;l.maybeLength=o;l.params=c;return l}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(Jbig2Stream,[{key:"bytes",get:function get(){return(0,d.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}},{key:"ensureBuffer",value:function ensureBuffer(t){}},{key:"readBlock",value:function readBlock(){if(!this.eof){var t=new h.Jbig2Image,r=[];if(this.params instanceof u.Dict){var o=this.params.get("JBIG2Globals");if(o instanceof c.BaseStream){var l=o.getBytes();r.push({data:l,start:0,end:l.length})}}r.push({data:this.bytes,start:0,end:this.bytes.length});for(var d=t.parseChunks(r),g=d.length,m=0;m<g;m++)d[m]^=255;this.buffer=d;this.bufferLength=g;this.eof=!0}}}]);return Jbig2Stream}(l.DecodeStream);r.Jbig2Stream=g},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Jbig2Image=void 0;var c=o(4),l=o(149),u=o(177),h=o(173);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var d=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Jbig2Error,t);var r=_createSuper(Jbig2Error);function Jbig2Error(t){_classCallCheck(this,Jbig2Error);return r.call(this,"JBIG2 error: ".concat(t),"Jbig2Error")}return _createClass(Jbig2Error)}(c.BaseException),g=function(){function ContextCache(){_classCallCheck(this,ContextCache)}_createClass(ContextCache,[{key:"getContexts",value:function getContexts(t){return t in this?this[t]:this[t]=new Int8Array(65536)}}]);return ContextCache}(),m=function(){function DecodingContext(t,r,o){_classCallCheck(this,DecodingContext);this.data=t;this.start=r;this.end=o}_createClass(DecodingContext,[{key:"decoder",get:function get(){var t=new u.ArithmeticDecoder(this.data,this.start,this.end);return(0,c.shadow)(this,"decoder",t)}},{key:"contextCache",get:function get(){var t=new g;return(0,c.shadow)(this,"contextCache",t)}}]);return DecodingContext}();function decodeInteger(t,r,o){var c=t.getContexts(r),l=1;function readBits(t){for(var r=0,u=0;u<t;u++){var h=o.readBit(c,l);l=l<256?l<<1|h:511&(l<<1|h)|256;r=r<<1|h}return r>>>0}var u=readBits(1),h=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);return 0===u?h:h>0?-h:null}function decodeIAID(t,r,o){for(var c=t.getContexts("IAID"),l=1,u=0;u<o;u++){l=l<<1|r.readBit(c,l)}return o<31?l&(1<<o)-1:2147483647&l}var y=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],v=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],k=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],_=[39717,1941,229,405],w=[32,8];function decodeBitmap(t,r,o,c,l,u,h,d){if(t){return decodeMMRBitmap(new M(d.data,d.start,d.end),r,o,!1)}if(0===c&&!u&&!l&&4===h.length&&3===h[0].x&&-1===h[0].y&&-3===h[1].x&&-1===h[1].y&&2===h[2].x&&-2===h[2].y&&-2===h[3].x&&-2===h[3].y)return function decodeBitmapTemplate0(t,r,o){var c,l,u,h,d,g,m,y=o.decoder,v=o.contextCache.getContexts("GB"),k=[];for(l=0;l<r;l++){d=k[l]=new Uint8Array(t);g=l<1?d:k[l-1];c=(m=l<2?d:k[l-2])[0]<<13|m[1]<<12|m[2]<<11|g[0]<<7|g[1]<<6|g[2]<<5|g[3]<<4;for(u=0;u<t;u++){d[u]=h=y.readBit(v,c);c=(31735&c)<<1|(u+3<t?m[u+3]<<11:0)|(u+4<t?g[u+4]<<4:0)|h}}return k}(r,o,d);var g=!!u,m=v[c].concat(h);m.sort((function(t,r){return t.y-r.y||t.x-r.x}));var y,k,w=m.length,S=new Int8Array(w),C=new Int8Array(w),x=[],O=0,T=0,E=0,R=0;for(k=0;k<w;k++){S[k]=m[k].x;C[k]=m[k].y;T=Math.min(T,m[k].x);E=Math.max(E,m[k].x);R=Math.min(R,m[k].y);k<w-1&&m[k].y===m[k+1].y&&m[k].x===m[k+1].x-1?O|=1<<w-1-k:x.push(k)}var j=x.length,D=new Int8Array(j),L=new Int8Array(j),N=new Uint16Array(j);for(y=0;y<j;y++){k=x[y];D[y]=m[k].x;L[y]=m[k].y;N[y]=1<<w-1-k}for(var U,H,$,X,q,G=-T,z=-R,W=r-E,V=_[c],K=new Uint8Array(r),Y=[],J=d.decoder,Z=d.contextCache.getContexts("GB"),Q=0,ee=0,te=0;te<o;te++){if(l){if(Q^=J.readBit(Z,V)){Y.push(K);continue}}K=new Uint8Array(K);Y.push(K);for(U=0;U<r;U++)if(g&&u[te][U])K[U]=0;else{if(U>=G&&U<W&&te>=z){ee=ee<<1&O;for(k=0;k<j;k++){H=te+L[k];$=U+D[k];(X=Y[H][$])&&(ee|=X=N[k])}}else{ee=0;q=w-1;for(k=0;k<w;k++,q--)($=U+S[k])>=0&&$<r&&(H=te+C[k])>=0&&(X=Y[H][$])&&(ee|=X<<q)}var re=J.readBit(Z,ee);K[U]=re}}return Y}function decodeRefinement(t,r,o,c,l,u,h,g,m){var y=k[o].coding;0===o&&(y=y.concat([g[0]]));var v,_=y.length,S=new Int32Array(_),C=new Int32Array(_);for(v=0;v<_;v++){S[v]=y[v].x;C[v]=y[v].y}var x=k[o].reference;0===o&&(x=x.concat([g[1]]));var O=x.length,T=new Int32Array(O),E=new Int32Array(O);for(v=0;v<O;v++){T[v]=x[v].x;E[v]=x[v].y}for(var M=c[0].length,R=c.length,j=w[o],D=[],L=m.decoder,N=m.contextCache.getContexts("GR"),U=0,H=0;H<r;H++){if(h){if(U^=L.readBit(N,j))throw new d("prediction is not supported")}var $=new Uint8Array(t);D.push($);for(var X=0;X<t;X++){var q=void 0,G=void 0,z=0;for(v=0;v<_;v++){q=H+C[v];G=X+S[v];q<0||G<0||G>=t?z<<=1:z=z<<1|D[q][G]}for(v=0;v<O;v++){q=H+E[v]-u;G=X+T[v]-l;q<0||q>=R||G<0||G>=M?z<<=1:z=z<<1|c[q][G]}var W=L.readBit(N,z);$[X]=W}}return D}function decodeTextRegion(t,r,o,c,l,u,h,g,m,y,v,k,_,w,S,C,x,O,T){if(t&&r)throw new d("refinement with Huffman is not supported");var E,M,R=[];for(E=0;E<c;E++){M=new Uint8Array(o);if(l)for(var j=0;j<o;j++)M[j]=l;R.push(M)}var D=x.decoder,L=x.contextCache,N=t?-w.tableDeltaT.decode(T):-decodeInteger(L,"IADT",D),U=0;E=0;for(;E<u;){N+=t?w.tableDeltaT.decode(T):decodeInteger(L,"IADT",D);for(var H=U+=t?w.tableFirstS.decode(T):decodeInteger(L,"IAFS",D);;){var $=0;h>1&&($=t?T.readBits(O):decodeInteger(L,"IAIT",D));var X=h*N+$,q=t?w.symbolIDTable.decode(T):decodeIAID(L,D,m),G=r&&(t?T.readBit():decodeInteger(L,"IARI",D)),z=g[q],W=z[0].length,V=z.length;if(G){var K=decodeInteger(L,"IARDW",D),Y=decodeInteger(L,"IARDH",D);z=decodeRefinement(W+=K,V+=Y,S,z,(K>>1)+decodeInteger(L,"IARDX",D),(Y>>1)+decodeInteger(L,"IARDY",D),!1,C,x)}var J=X-(1&k?0:V-1),Z=H-(2&k?W-1:0),Q=void 0,ee=void 0,te=void 0;if(y){for(Q=0;Q<V;Q++)if(M=R[Z+Q]){te=z[Q];var re=Math.min(o-J,W);switch(_){case 0:for(ee=0;ee<re;ee++)M[J+ee]|=te[ee];break;case 2:for(ee=0;ee<re;ee++)M[J+ee]^=te[ee];break;default:throw new d("operator ".concat(_," is not supported"))}}H+=V-1}else{for(ee=0;ee<V;ee++)if(M=R[J+ee]){te=z[ee];switch(_){case 0:for(Q=0;Q<W;Q++)M[Z+Q]|=te[Q];break;case 2:for(Q=0;Q<W;Q++)M[Z+Q]^=te[Q];break;default:throw new d("operator ".concat(_," is not supported"))}}H+=W-1}E++;var ae=t?w.tableDeltaS.decode(T):decodeInteger(L,"IADS",D);if(null===ae)break;H+=ae+v}}return R}function readSegmentHeader(t,r){var o={};o.number=(0,l.readUint32)(t,r);var c=t[r+4],u=63&c;if(!y[u])throw new d("invalid segment type: "+u);o.type=u;o.typeName=y[u];o.deferredNonRetain=!!(128&c);var h=!!(64&c),g=t[r+5],m=g>>5&7,v=[31&g],k=r+6;if(7===g){m=536870911&(0,l.readUint32)(t,k-1);k+=3;var _=m+7>>3;v[0]=t[k++];for(;--_>0;)v.push(t[k++])}else if(5===g||6===g)throw new d("invalid referred-to flags");o.retainBits=v;var w=4;o.number<=256?w=1:o.number<=65536&&(w=2);var C,x,O=[];for(C=0;C<m;C++){var T=void 0;T=1===w?t[k]:2===w?(0,l.readUint16)(t,k):(0,l.readUint32)(t,k);O.push(T);k+=w}o.referredTo=O;if(h){o.pageAssociation=(0,l.readUint32)(t,k);k+=4}else o.pageAssociation=t[k++];o.length=(0,l.readUint32)(t,k);k+=4;if(4294967295===o.length){if(38!==u)throw new d("invalid unknown segment length");var E=readRegionSegmentInformation(t,k),M=!!(1&t[k+S]),R=new Uint8Array(6);if(!M){R[0]=255;R[1]=172}R[2]=E.height>>>24&255;R[3]=E.height>>16&255;R[4]=E.height>>8&255;R[5]=255&E.height;for(C=k,x=t.length;C<x;C++){for(var j=0;j<6&&R[j]===t[C+j];)j++;if(6===j){o.length=C+6;break}}if(4294967295===o.length)throw new d("segment end was not found")}o.headerEnd=k;return o}function readSegments(t,r,o,c){for(var l=[],u=o;u<c;){var h=readSegmentHeader(r,u);u=h.headerEnd;var d={header:h,data:r};if(!t.randomAccess){d.start=u;u+=h.length;d.end=u}l.push(d);if(51===h.type)break}if(t.randomAccess)for(var g=0,m=l.length;g<m;g++){l[g].start=u;u+=l[g].header.length;l[g].end=u}return l}function readRegionSegmentInformation(t,r){return{width:(0,l.readUint32)(t,r),height:(0,l.readUint32)(t,r+4),x:(0,l.readUint32)(t,r+8),y:(0,l.readUint32)(t,r+12),combinationOperator:7&t[r+16]}}var S=17;function processSegment(t,r){var o,c,u,h,g=t.header,m=t.data,y=t.end,v=t.start;switch(g.type){case 0:var k={},_=(0,l.readUint16)(m,v);k.huffman=!!(1&_);k.refinement=!!(2&_);k.huffmanDHSelector=_>>2&3;k.huffmanDWSelector=_>>4&3;k.bitmapSizeSelector=_>>6&1;k.aggregationInstancesSelector=_>>7&1;k.bitmapCodingContextUsed=!!(256&_);k.bitmapCodingContextRetained=!!(512&_);k.template=_>>10&3;k.refinementTemplate=_>>12&1;v+=2;if(!k.huffman){h=0===k.template?4:1;c=[];for(u=0;u<h;u++){c.push({x:(0,l.readInt8)(m,v),y:(0,l.readInt8)(m,v+1)});v+=2}k.at=c}if(k.refinement&&!k.refinementTemplate){c=[];for(u=0;u<2;u++){c.push({x:(0,l.readInt8)(m,v),y:(0,l.readInt8)(m,v+1)});v+=2}k.refinementAt=c}k.numberOfExportedSymbols=(0,l.readUint32)(m,v);v+=4;k.numberOfNewSymbols=(0,l.readUint32)(m,v);v+=4;o=[k,g.number,g.referredTo,m,v,y];break;case 6:case 7:var w={};w.info=readRegionSegmentInformation(m,v);v+=S;var C=(0,l.readUint16)(m,v);v+=2;w.huffman=!!(1&C);w.refinement=!!(2&C);w.logStripSize=C>>2&3;w.stripSize=1<<w.logStripSize;w.referenceCorner=C>>4&3;w.transposed=!!(64&C);w.combinationOperator=C>>7&3;w.defaultPixelValue=C>>9&1;w.dsOffset=C<<17>>27;w.refinementTemplate=C>>15&1;if(w.huffman){var x=(0,l.readUint16)(m,v);v+=2;w.huffmanFS=3&x;w.huffmanDS=x>>2&3;w.huffmanDT=x>>4&3;w.huffmanRefinementDW=x>>6&3;w.huffmanRefinementDH=x>>8&3;w.huffmanRefinementDX=x>>10&3;w.huffmanRefinementDY=x>>12&3;w.huffmanRefinementSizeSelector=!!(16384&x)}if(w.refinement&&!w.refinementTemplate){c=[];for(u=0;u<2;u++){c.push({x:(0,l.readInt8)(m,v),y:(0,l.readInt8)(m,v+1)});v+=2}w.refinementAt=c}w.numberOfSymbolInstances=(0,l.readUint32)(m,v);v+=4;o=[w,g.referredTo,m,v,y];break;case 16:var O={},T=m[v++];O.mmr=!!(1&T);O.template=T>>1&3;O.patternWidth=m[v++];O.patternHeight=m[v++];O.maxPatternIndex=(0,l.readUint32)(m,v);v+=4;o=[O,g.number,m,v,y];break;case 22:case 23:var E={};E.info=readRegionSegmentInformation(m,v);v+=S;var M=m[v++];E.mmr=!!(1&M);E.template=M>>1&3;E.enableSkip=!!(8&M);E.combinationOperator=M>>4&7;E.defaultPixelValue=M>>7&1;E.gridWidth=(0,l.readUint32)(m,v);v+=4;E.gridHeight=(0,l.readUint32)(m,v);v+=4;E.gridOffsetX=4294967295&(0,l.readUint32)(m,v);v+=4;E.gridOffsetY=4294967295&(0,l.readUint32)(m,v);v+=4;E.gridVectorX=(0,l.readUint16)(m,v);v+=2;E.gridVectorY=(0,l.readUint16)(m,v);v+=2;o=[E,g.referredTo,m,v,y];break;case 38:case 39:var R={};R.info=readRegionSegmentInformation(m,v);v+=S;var j=m[v++];R.mmr=!!(1&j);R.template=j>>1&3;R.prediction=!!(8&j);if(!R.mmr){h=0===R.template?4:1;c=[];for(u=0;u<h;u++){c.push({x:(0,l.readInt8)(m,v),y:(0,l.readInt8)(m,v+1)});v+=2}R.at=c}o=[R,m,v,y];break;case 48:var D={width:(0,l.readUint32)(m,v),height:(0,l.readUint32)(m,v+4),resolutionX:(0,l.readUint32)(m,v+8),resolutionY:(0,l.readUint32)(m,v+12)};4294967295===D.height&&delete D.height;var L=m[v+16];(0,l.readUint16)(m,v+17);D.lossless=!!(1&L);D.refinement=!!(2&L);D.defaultPixelValue=L>>2&1;D.combinationOperator=L>>3&3;D.requiresBuffer=!!(32&L);D.combinationOperatorOverride=!!(64&L);o=[D];break;case 49:case 50:case 51:case 62:break;case 53:o=[g.number,m,v,y];break;default:throw new d("segment type ".concat(g.typeName,"(").concat(g.type,")")+" is not implemented")}var N="on"+g.typeName;N in r&&r[N].apply(r,o)}function processSegments(t,r){for(var o=0,c=t.length;o<c;o++)processSegment(t[o],r)}var C=function(){function SimpleSegmentVisitor(){_classCallCheck(this,SimpleSegmentVisitor)}_createClass(SimpleSegmentVisitor,[{key:"onPageInformation",value:function onPageInformation(t){this.currentPageInfo=t;var r=t.width+7>>3,o=new Uint8ClampedArray(r*t.height);if(t.defaultPixelValue)for(var c=0,l=o.length;c<l;c++)o[c]=255;this.buffer=o}},{key:"drawBitmap",value:function drawBitmap(t,r){var o,c,l,u,h=this.currentPageInfo,g=t.width,m=t.height,y=h.width+7>>3,v=h.combinationOperatorOverride?t.combinationOperator:h.combinationOperator,k=this.buffer,_=128>>(7&t.x),w=t.y*y+(t.x>>3);switch(v){case 0:for(o=0;o<m;o++){l=_;u=w;for(c=0;c<g;c++){r[o][c]&&(k[u]|=l);if(!(l>>=1)){l=128;u++}}w+=y}break;case 2:for(o=0;o<m;o++){l=_;u=w;for(c=0;c<g;c++){r[o][c]&&(k[u]^=l);if(!(l>>=1)){l=128;u++}}w+=y}break;default:throw new d("operator ".concat(v," is not supported"))}}},{key:"onImmediateGenericRegion",value:function onImmediateGenericRegion(t,r,o,c){var l=t.info,u=new m(r,o,c),h=decodeBitmap(t.mmr,l.width,l.height,t.template,t.prediction,null,t.at,u);this.drawBitmap(l,h)}},{key:"onImmediateLosslessGenericRegion",value:function onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion.apply(this,arguments)}},{key:"onSymbolDictionary",value:function onSymbolDictionary(t,r,o,c,u,h){var g,y;if(t.huffman){g=function getSymbolDictionaryHuffmanTables(t,r,o){var c,l,u,h,g=0;switch(t.huffmanDHSelector){case 0:case 1:c=getStandardTable(t.huffmanDHSelector+4);break;case 3:c=getCustomHuffmanTable(g,r,o);g++;break;default:throw new d("invalid Huffman DH selector")}switch(t.huffmanDWSelector){case 0:case 1:l=getStandardTable(t.huffmanDWSelector+2);break;case 3:l=getCustomHuffmanTable(g,r,o);g++;break;default:throw new d("invalid Huffman DW selector")}if(t.bitmapSizeSelector){u=getCustomHuffmanTable(g,r,o);g++}else u=getStandardTable(1);h=t.aggregationInstancesSelector?getCustomHuffmanTable(g,r,o):getStandardTable(1);return{tableDeltaHeight:c,tableDeltaWidth:l,tableBitmapSize:u,tableAggregateInstances:h}}(t,o,this.customTables);y=new M(c,u,h)}var v=this.symbols;v||(this.symbols=v={});for(var k=[],_=0,w=o.length;_<w;_++){var S=v[o[_]];S&&(k=k.concat(S))}var C=new m(c,u,h);v[r]=function decodeSymbolDictionary(t,r,o,c,u,h,g,m,y,v,k,_){if(t&&r)throw new d("symbol refinement with Huffman is not supported");var w,S,C=[],x=0,O=(0,l.log2)(o.length+c),T=k.decoder,E=k.contextCache;if(t){w=getStandardTable(1);S=[];O=Math.max(O,1)}for(;C.length<c;){x+=t?h.tableDeltaHeight.decode(_):decodeInteger(E,"IADH",T);for(var M=0,R=0,j=t?S.length:0;;){var D=t?h.tableDeltaWidth.decode(_):decodeInteger(E,"IADW",T);if(null===D)break;R+=M+=D;var L=void 0;if(r){var N=decodeInteger(E,"IAAI",T);if(N>1)L=decodeTextRegion(t,r,M,x,0,N,1,o.concat(C),O,0,0,1,0,h,y,v,k,0,_);else{var U=decodeIAID(E,T,O),H=decodeInteger(E,"IARDX",T),$=decodeInteger(E,"IARDY",T);L=decodeRefinement(M,x,y,U<o.length?o[U]:C[U-o.length],H,$,!1,v,k)}C.push(L)}else if(t)S.push(M);else{L=decodeBitmap(!1,M,x,g,!1,null,m,k);C.push(L)}}if(t&&!r){var X=h.tableBitmapSize.decode(_);_.byteAlign();var q=void 0;if(0===X)q=readUncompressedBitmap(_,R,x);else{var G=_.end,z=_.position+X;_.end=z;q=decodeMMRBitmap(_,R,x,!1);_.end=G;_.position=z}var W=S.length;if(j===W-1)C.push(q);else{var V=void 0,K=void 0,Y=0,J=void 0,Z=void 0;for(V=j;V<W;V++){J=Y+S[V];Z=[];for(K=0;K<x;K++)Z.push(q[K].subarray(Y,J));C.push(Z);Y=J}}}}for(var Q,ee,te=[],re=[],ae=!1,ne=o.length+c;re.length<ne;){for(var ie=t?w.decode(_):decodeInteger(E,"IAEX",T);ie--;)re.push(ae);ae=!ae}for(Q=0,ee=o.length;Q<ee;Q++)re[Q]&&te.push(o[Q]);for(var oe=0;oe<c;Q++,oe++)re[Q]&&te.push(C[oe]);return te}(t.huffman,t.refinement,k,t.numberOfNewSymbols,t.numberOfExportedSymbols,g,t.template,t.at,t.refinementTemplate,t.refinementAt,C,y)}},{key:"onImmediateTextRegion",value:function onImmediateTextRegion(t,r,o,c,u){for(var h,g,y=t.info,v=this.symbols,k=[],_=0,w=r.length;_<w;_++){var S=v[r[_]];S&&(k=k.concat(S))}var C=(0,l.log2)(k.length);if(t.huffman){g=new M(o,c,u);h=function getTextRegionHuffmanTables(t,r,o,c,l){for(var u=[],h=0;h<=34;h++){var g=l.readBits(4);u.push(new x([h,g,0,0]))}var m=new T(u,!1);u.length=0;for(var y=0;y<c;){var v=m.decode(l);if(v>=32){var k=void 0,_=void 0,w=void 0;switch(v){case 32:if(0===y)throw new d("no previous value in symbol ID table");_=l.readBits(2)+3;k=u[y-1].prefixLength;break;case 33:_=l.readBits(3)+3;k=0;break;case 34:_=l.readBits(7)+11;k=0;break;default:throw new d("invalid code length in symbol ID table")}for(w=0;w<_;w++){u.push(new x([y,k,0,0]));y++}}else{u.push(new x([y,v,0,0]));y++}}l.byteAlign();var S,C,O,E=new T(u,!1),M=0;switch(t.huffmanFS){case 0:case 1:S=getStandardTable(t.huffmanFS+6);break;case 3:S=getCustomHuffmanTable(M,r,o);M++;break;default:throw new d("invalid Huffman FS selector")}switch(t.huffmanDS){case 0:case 1:case 2:C=getStandardTable(t.huffmanDS+8);break;case 3:C=getCustomHuffmanTable(M,r,o);M++;break;default:throw new d("invalid Huffman DS selector")}switch(t.huffmanDT){case 0:case 1:case 2:O=getStandardTable(t.huffmanDT+11);break;case 3:O=getCustomHuffmanTable(M,r,o);M++;break;default:throw new d("invalid Huffman DT selector")}if(t.refinement)throw new d("refinement with Huffman is not supported");return{symbolIDTable:E,tableFirstS:S,tableDeltaS:C,tableDeltaT:O}}(t,r,this.customTables,k.length,g)}var O=new m(o,c,u),E=decodeTextRegion(t.huffman,t.refinement,y.width,y.height,t.defaultPixelValue,t.numberOfSymbolInstances,t.stripSize,k,C,t.transposed,t.dsOffset,t.referenceCorner,t.combinationOperator,h,t.refinementTemplate,t.refinementAt,O,t.logStripSize,g);this.drawBitmap(y,E)}},{key:"onImmediateLosslessTextRegion",value:function onImmediateLosslessTextRegion(){this.onImmediateTextRegion.apply(this,arguments)}},{key:"onPatternDictionary",value:function onPatternDictionary(t,r,o,c,l){var u=this.patterns;u||(this.patterns=u={});var h=new m(o,c,l);u[r]=function decodePatternDictionary(t,r,o,c,l,u){var h=[];if(!t){h.push({x:-r,y:0});0===l&&h.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}for(var d=decodeBitmap(t,(c+1)*r,o,l,!1,null,h,u),g=[],m=0;m<=c;m++){for(var y=[],v=r*m,k=v+r,_=0;_<o;_++)y.push(d[_].subarray(v,k));g.push(y)}return g}(t.mmr,t.patternWidth,t.patternHeight,t.maxPatternIndex,t.template,h)}},{key:"onImmediateHalftoneRegion",value:function onImmediateHalftoneRegion(t,r,o,c,u){var h=this.patterns[r[0]],g=t.info,y=new m(o,c,u),v=function decodeHalftoneRegion(t,r,o,c,u,h,g,m,y,v,k,_,w,S,C){if(g)throw new d("skip is not supported");if(0!==m)throw new d('operator "'.concat(m,'" is not supported in halftone region'));var x,O,T,E=[];for(x=0;x<u;x++){T=new Uint8Array(c);if(h)for(O=0;O<c;O++)T[O]=h;E.push(T)}var R=r.length,j=r[0],D=j[0].length,L=j.length,N=(0,l.log2)(R),U=[];if(!t){U.push({x:o<=1?3:2,y:-1});0===o&&U.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}var H,$,X,q,G,z,W,V,K,Y,J,Z=[];t&&(H=new M(C.data,C.start,C.end));for(x=N-1;x>=0;x--){$=t?decodeMMRBitmap(H,y,v,!0):decodeBitmap(!1,y,v,o,!1,null,U,C);Z[x]=$}for(X=0;X<v;X++)for(q=0;q<y;q++){G=0;z=0;for(O=N-1;O>=0;O--)z|=(G^=Z[O][X][q])<<O;W=r[z];K=_+X*w-q*S>>8;if((V=k+X*S+q*w>>8)>=0&&V+D<=c&&K>=0&&K+L<=u)for(x=0;x<L;x++){J=E[K+x];Y=W[x];for(O=0;O<D;O++)J[V+O]|=Y[O]}else{var Q=void 0,ee=void 0;for(x=0;x<L;x++)if(!((ee=K+x)<0||ee>=u)){J=E[ee];Y=W[x];for(O=0;O<D;O++)(Q=V+O)>=0&&Q<c&&(J[Q]|=Y[O])}}}return E}(t.mmr,h,t.template,g.width,g.height,t.defaultPixelValue,t.enableSkip,t.combinationOperator,t.gridWidth,t.gridHeight,t.gridOffsetX,t.gridOffsetY,t.gridVectorX,t.gridVectorY,y);this.drawBitmap(g,v)}},{key:"onImmediateLosslessHalftoneRegion",value:function onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion.apply(this,arguments)}},{key:"onTables",value:function onTables(t,r,o,c){var u=this.customTables;u||(this.customTables=u={});u[t]=function decodeTablesSegment(t,r,o){var c,u,h=t[r],d=4294967295&(0,l.readUint32)(t,r+1),g=4294967295&(0,l.readUint32)(t,r+5),m=new M(t,r+9,o),y=1+(h>>1&7),v=1+(h>>4&7),k=[],_=d;do{c=m.readBits(y);u=m.readBits(v);k.push(new x([_,c,u,0]));_+=1<<u}while(_<g);c=m.readBits(y);k.push(new x([d-1,c,32,0,"lower"]));c=m.readBits(y);k.push(new x([g,c,32,0]));if(1&h){c=m.readBits(y);k.push(new x([c,0]))}return new T(k,!1)}(r,o,c)}}]);return SimpleSegmentVisitor}(),x=_createClass((function HuffmanLine(t){_classCallCheck(this,HuffmanLine);if(2===t.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=t[0];this.rangeLength=0;this.prefixCode=t[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=t[0];this.prefixLength=t[1];this.rangeLength=t[2];this.prefixCode=t[3];this.isLowerRange="lower"===t[4]}})),O=function(){function HuffmanTreeNode(t){_classCallCheck(this,HuffmanTreeNode);this.children=[];if(t){this.isLeaf=!0;this.rangeLength=t.rangeLength;this.rangeLow=t.rangeLow;this.isLowerRange=t.isLowerRange;this.isOOB=t.isOOB}else this.isLeaf=!1}_createClass(HuffmanTreeNode,[{key:"buildTree",value:function buildTree(t,r){var o=t.prefixCode>>r&1;if(r<=0)this.children[o]=new HuffmanTreeNode(t);else{var c=this.children[o];c||(this.children[o]=c=new HuffmanTreeNode(null));c.buildTree(t,r-1)}}},{key:"decodeNode",value:function decodeNode(t){if(this.isLeaf){if(this.isOOB)return null;var r=t.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-r:r)}var o=this.children[t.readBit()];if(!o)throw new d("invalid Huffman data");return o.decodeNode(t)}}]);return HuffmanTreeNode}(),T=function(){function HuffmanTable(t,r){_classCallCheck(this,HuffmanTable);r||this.assignPrefixCodes(t);this.rootNode=new O(null);for(var o=0,c=t.length;o<c;o++){var l=t[o];l.prefixLength>0&&this.rootNode.buildTree(l,l.prefixLength-1)}}_createClass(HuffmanTable,[{key:"decode",value:function decode(t){return this.rootNode.decodeNode(t)}},{key:"assignPrefixCodes",value:function assignPrefixCodes(t){for(var r=t.length,o=0,c=0;c<r;c++)o=Math.max(o,t[c].prefixLength);for(var l=new Uint32Array(o+1),u=0;u<r;u++)l[t[u].prefixLength]++;var h,d,g,m=1,y=0;l[0]=0;for(;m<=o;){h=y=y+l[m-1]<<1;d=0;for(;d<r;){if((g=t[d]).prefixLength===m){g.prefixCode=h;h++}d++}m++}}}]);return HuffmanTable}();var E={};function getStandardTable(t){var r,o=E[t];if(o)return o;switch(t){case 1:r=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:r=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:r=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:r=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:r=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:r=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:r=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:r=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:r=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:r=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:r=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:r=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:r=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:r=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:r=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new d("standard table B.".concat(t," does not exist"))}for(var c=0,l=r.length;c<l;c++)r[c]=new x(r[c]);o=new T(r,!0);E[t]=o;return o}var M=function(){function Reader(t,r,o){_classCallCheck(this,Reader);this.data=t;this.start=r;this.end=o;this.position=r;this.shift=-1;this.currentByte=0}_createClass(Reader,[{key:"readBit",value:function readBit(){if(this.shift<0){if(this.position>=this.end)throw new d("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}var t=this.currentByte>>this.shift&1;this.shift--;return t}},{key:"readBits",value:function readBits(t){var r,o=0;for(r=t-1;r>=0;r--)o|=this.readBit()<<r;return o}},{key:"byteAlign",value:function byteAlign(){this.shift=-1}},{key:"next",value:function next(){return this.position>=this.end?-1:this.data[this.position++]}}]);return Reader}();function getCustomHuffmanTable(t,r,o){for(var c=0,l=0,u=r.length;l<u;l++){var h=o[r[l]];if(h){if(t===c)return h;c++}}throw new d("can't find custom Huffman table")}function readUncompressedBitmap(t,r,o){for(var c=[],l=0;l<o;l++){var u=new Uint8Array(r);c.push(u);for(var h=0;h<r;h++)u[h]=t.readBit();t.byteAlign()}return c}function decodeMMRBitmap(t,r,o,c){for(var l,u={K:-1,Columns:r,Rows:o,BlackIs1:!0,EndOfBlock:c},d=new h.CCITTFaxDecoder(t,u),g=[],m=!1,y=0;y<o;y++){var v=new Uint8Array(r);g.push(v);for(var k=-1,_=0;_<r;_++){if(k<0){if(-1===(l=d.readNextChar())){l=0;m=!0}k=7}v[_]=l>>k&1;k--}}if(c&&!m)for(var w=0;w<5&&-1!==d.readNextChar();w++);return g}var R=function(){function Jbig2Image(){_classCallCheck(this,Jbig2Image)}_createClass(Jbig2Image,[{key:"parseChunks",value:function parseChunks(t){return function parseJbig2Chunks(t){for(var r=new C,o=0,c=t.length;o<c;o++){var l=t[o];processSegments(readSegments({},l.data,l.start,l.end),r)}return r.buffer}(t)}},{key:"parse",value:function parse(t){var r=function parseJbig2(t){var r=t.length,o=0;if(151!==t[o]||74!==t[o+1]||66!==t[o+2]||50!==t[o+3]||13!==t[o+4]||10!==t[o+5]||26!==t[o+6]||10!==t[o+7])throw new d("parseJbig2 - invalid header.");var c=Object.create(null);o+=8;var u=t[o++];c.randomAccess=!(1&u);if(!(2&u)){c.numberOfPages=(0,l.readUint32)(t,o);o+=4}var h=readSegments(c,t,o,r),g=new C;processSegments(h,g);for(var m=g.currentPageInfo,y=m.width,v=m.height,k=g.buffer,_=new Uint8ClampedArray(y*v),w=0,S=0,x=0;x<v;x++)for(var O=0,T=void 0,E=0;E<y;E++){if(!O){O=128;T=k[S++]}_[w++]=T&O?0:255;O>>=1}return{imgData:_,width:y,height:v}}(t),o=r.imgData,c=r.width,u=r.height;this.width=c;this.height=u;return o}}]);return Jbig2Image}();r.Jbig2Image=R},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ArithmeticDecoder=void 0;function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var o=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}],c=function(){function ArithmeticDecoder(t,r,o){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ArithmeticDecoder);this.data=t;this.bp=r;this.dataEnd=o;this.chigh=t[r];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(ArithmeticDecoder,[{key:"byteIn",value:function byteIn(){var t=this.data,r=this.bp;if(255===t[r])if(t[r+1]>143){this.clow+=65280;this.ct=8}else{r++;this.clow+=t[r]<<9;this.ct=7;this.bp=r}else{r++;this.clow+=r<this.dataEnd?t[r]<<8:65280;this.ct=8;this.bp=r}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}},{key:"readBit",value:function readBit(t,r){var c,l=t[r]>>1,u=1&t[r],h=o[l],d=h.qe,g=this.a-d;if(this.chigh<d)if(g<d){g=d;c=u;l=h.nmps}else{g=d;c=1^u;1===h.switchFlag&&(u=c);l=h.nlps}else{this.chigh-=d;if(0!=(32768&g)){this.a=g;return u}if(g<d){c=1^u;1===h.switchFlag&&(u=c);l=h.nlps}else{c=u;l=h.nmps}}do{0===this.ct&&this.byteIn();g<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&g));this.a=g;t[r]=l<<1|u;return c}}]);return ArithmeticDecoder}();r.ArithmeticDecoder=c},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.JpegStream=void 0;var c=o(170),l=o(146),u=o(179),h=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var d=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(JpegStream,t);var r=_createSuper(JpegStream);function JpegStream(t,o,c){var l,u;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,JpegStream);for(;-1!==(u=t.getByte());)if(255===u){t.skip(-1);break}(l=r.call(this,o)).stream=t;l.dict=t.dict;l.maybeLength=o;l.params=c;return l}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(JpegStream,[{key:"bytes",get:function get(){return(0,h.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}},{key:"ensureBuffer",value:function ensureBuffer(t){}},{key:"readBlock",value:function readBlock(){if(!this.eof){var t={decodeTransform:void 0,colorTransform:void 0},r=this.dict.getArray("D","Decode");if(this.forceRGB&&Array.isArray(r)){for(var o=this.dict.get("BPC","BitsPerComponent")||8,c=r.length,h=new Int32Array(c),d=!1,g=(1<<o)-1,m=0;m<c;m+=2){h[m]=256*(r[m+1]-r[m])|0;h[m+1]=r[m]*g|0;256===h[m]&&0===h[m+1]||(d=!0)}d&&(t.decodeTransform=h)}if(this.params instanceof l.Dict){var y=this.params.get("ColorTransform");Number.isInteger(y)&&(t.colorTransform=y)}var v=new u.JpegImage(t);v.parse(this.bytes);var k=v.getData({width:this.drawWidth,height:this.drawHeight,forceRGB:this.forceRGB,isSourcePDF:!0});this.buffer=k;this.bufferLength=k.length;this.eof=!0}}}]);return JpegStream}(c.DecodeStream);r.JpegStream=d},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.JpegImage=void 0;var c=o(4),l=o(149);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=function(t){_inherits(JpegError,t);var r=_createSuper(JpegError);function JpegError(t){_classCallCheck(this,JpegError);return r.call(this,"JPEG error: ".concat(t),"JpegError")}return _createClass(JpegError)}(c.BaseException),h=function(t){_inherits(DNLMarkerError,t);var r=_createSuper(DNLMarkerError);function DNLMarkerError(t,o){var c;_classCallCheck(this,DNLMarkerError);(c=r.call(this,t,"DNLMarkerError")).scanLines=o;return c}return _createClass(DNLMarkerError)}(c.BaseException),d=function(t){_inherits(EOIMarkerError,t);var r=_createSuper(EOIMarkerError);function EOIMarkerError(t){_classCallCheck(this,EOIMarkerError);return r.call(this,t,"EOIMarkerError")}return _createClass(EOIMarkerError)}(c.BaseException),g=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),m=4017,y=799,v=3406,k=2276,_=1567,w=3784,S=5793,C=2896;function buildHuffmanTable(t,r){for(var o,c,l=0,u=16;u>0&&!t[u-1];)u--;var h,d=[{children:[],index:0}],g=d[0];for(o=0;o<u;o++){for(c=0;c<t[o];c++){(g=d.pop()).children[g.index]=r[l];for(;g.index>0;)g=d.pop();g.index++;d.push(g);for(;d.length<=o;){d.push(h={children:[],index:0});g.children[g.index]=h.children;g=h}l++}if(o+1<u){d.push(h={children:[],index:0});g.children[g.index]=h.children;g=h}}return d[0].children}function getBlockBufferOffset(t,r,o){return 64*((t.blocksPerLine+1)*r+o)}function decodeScan(t,r,o,m,y,v,k,_,w){var S=arguments.length>9&&void 0!==arguments[9]&&arguments[9],C=o.mcusPerLine,x=o.progressive,O=r,T=0,E=0;function readBit(){if(E>0){E--;return T>>E&1}if(255===(T=t[r++])){var c=t[r++];if(c){if(220===c&&S){r+=2;var g=(0,l.readUint16)(t,r);r+=2;if(g>0&&g!==o.scanLines)throw new h("Found DNL marker (0xFFDC) while parsing scan data",g)}else if(217===c){if(S){var m=D*(8===o.precision?8:0);if(m>0&&Math.round(o.scanLines/m)>=10)throw new h("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",m)}throw new d("Found EOI marker (0xFFD9) while parsing scan data")}throw new u("unexpected marker ".concat((T<<8|c).toString(16)))}}E=7;return T>>>7}function decodeHuffman(t){for(var r=t;;){switch(_typeof(r=r[readBit()])){case"number":return r;case"object":continue}throw new u("invalid huffman sequence")}}function receive(t){for(var r=0;t>0;){r=r<<1|readBit();t--}return r}function receiveAndExtend(t){if(1===t)return 1===readBit()?1:-1;var r=receive(t);return r>=1<<t-1?r:r+(-1<<t)+1}function decodeBaseline(t,r){var o=decodeHuffman(t.huffmanTableDC),c=0===o?0:receiveAndExtend(o);t.blockData[r]=t.pred+=c;for(var l=1;l<64;){var u=decodeHuffman(t.huffmanTableAC),h=15&u,d=u>>4;if(0!==h){var m=g[l+=d];t.blockData[r+m]=receiveAndExtend(h);l++}else{if(d<15)break;l+=16}}}function decodeDCFirst(t,r){var o=decodeHuffman(t.huffmanTableDC),c=0===o?0:receiveAndExtend(o)<<w;t.blockData[r]=t.pred+=c}function decodeDCSuccessive(t,r){t.blockData[r]|=readBit()<<w}var M=0;function decodeACFirst(t,r){if(M>0)M--;else for(var o=v,c=k;o<=c;){var l=decodeHuffman(t.huffmanTableAC),u=15&l,h=l>>4;if(0!==u){var d=g[o+=h];t.blockData[r+d]=receiveAndExtend(u)*(1<<w);o++}else{if(h<15){M=receive(h)+(1<<h)-1;break}o+=16}}}var R,j=0;function decodeACSuccessive(t,r){for(var o,c,l=v,h=k,d=0;l<=h;){var m=r+g[l],y=t.blockData[m]<0?-1:1;switch(j){case 0:d=(c=decodeHuffman(t.huffmanTableAC))>>4;if(0===(o=15&c))if(d<15){M=receive(d)+(1<<d);j=4}else{d=16;j=1}else{if(1!==o)throw new u("invalid ACn encoding");R=receiveAndExtend(o);j=d?2:3}continue;case 1:case 2:t.blockData[m]?t.blockData[m]+=y*(readBit()<<w):0===--d&&(j=2===j?3:0);break;case 3:if(t.blockData[m])t.blockData[m]+=y*(readBit()<<w);else{t.blockData[m]=R<<w;j=0}break;case 4:t.blockData[m]&&(t.blockData[m]+=y*(readBit()<<w))}l++}4===j&&0===--M&&(j=0)}var D=0;function decodeMcu(t,r,o,c,l){var u=o%C;D=(o/C|0)*t.v+c;var h=u*t.h+l;r(t,getBlockBufferOffset(t,D,h))}function decodeBlock(t,r,o){D=o/t.blocksPerLine|0;var c=o%t.blocksPerLine;r(t,getBlockBufferOffset(t,D,c))}var L,N,U,H,$,X,q=m.length;X=x?0===v?0===_?decodeDCFirst:decodeDCSuccessive:0===_?decodeACFirst:decodeACSuccessive:decodeBaseline;var G,z,W,V,K=0;z=1===q?m[0].blocksPerLine*m[0].blocksPerColumn:C*o.mcusPerColumn;for(;K<=z;){var Y=y?Math.min(z-K,y):z;if(Y>0){for(N=0;N<q;N++)m[N].pred=0;M=0;if(1===q){L=m[0];for($=0;$<Y;$++){decodeBlock(L,X,K);K++}}else for($=0;$<Y;$++){for(N=0;N<q;N++){W=(L=m[N]).h;V=L.v;for(U=0;U<V;U++)for(H=0;H<W;H++)decodeMcu(L,X,K,U,H)}K++}}E=0;if(!(G=findNextFileMarker(t,r)))break;if(G.invalid){var J=Y>0?"unexpected":"excessive";(0,c.warn)("decodeScan - ".concat(J," MCU data, current marker is: ").concat(G.invalid));r=G.offset}if(!(G.marker>=65488&&G.marker<=65495))break;r+=2}return r-O}function quantizeAndInverse(t,r,o){var c,l,h,d,g,x,O,T,E,M,R,j,D,L,N,U,H,$=t.quantizationTable,X=t.blockData;if(!$)throw new u("missing required Quantization Table.");for(var q=0;q<64;q+=8){E=X[r+q];M=X[r+q+1];R=X[r+q+2];j=X[r+q+3];D=X[r+q+4];L=X[r+q+5];N=X[r+q+6];U=X[r+q+7];E*=$[q];if(0!=(M|R|j|D|L|N|U)){M*=$[q+1];R*=$[q+2];j*=$[q+3];D*=$[q+4];L*=$[q+5];N*=$[q+6];U*=$[q+7];l=(c=(c=S*E+128>>8)+(l=S*D+128>>8)+1>>1)-l;H=(h=R)*w+(d=N)*_+128>>8;h=h*_-d*w+128>>8;O=(g=(g=C*(M-U)+128>>8)+(O=L<<4)+1>>1)-O;x=(T=(T=C*(M+U)+128>>8)+(x=j<<4)+1>>1)-x;d=(c=c+(d=H)+1>>1)-d;h=(l=l+h+1>>1)-h;H=g*k+T*v+2048>>12;g=g*v-T*k+2048>>12;T=H;H=x*y+O*m+2048>>12;x=x*m-O*y+2048>>12;O=H;o[q]=c+T;o[q+7]=c-T;o[q+1]=l+O;o[q+6]=l-O;o[q+2]=h+x;o[q+5]=h-x;o[q+3]=d+g;o[q+4]=d-g}else{H=S*E+512>>10;o[q]=H;o[q+1]=H;o[q+2]=H;o[q+3]=H;o[q+4]=H;o[q+5]=H;o[q+6]=H;o[q+7]=H}}for(var G=0;G<8;++G){E=o[G];if(0!=((M=o[G+8])|(R=o[G+16])|(j=o[G+24])|(D=o[G+32])|(L=o[G+40])|(N=o[G+48])|(U=o[G+56]))){l=(c=4112+((c=S*E+2048>>12)+(l=S*D+2048>>12)+1>>1))-l;H=(h=R)*w+(d=N)*_+2048>>12;h=h*_-d*w+2048>>12;d=H;O=(g=(g=C*(M-U)+2048>>12)+(O=L)+1>>1)-O;x=(T=(T=C*(M+U)+2048>>12)+(x=j)+1>>1)-x;H=g*k+T*v+2048>>12;g=g*v-T*k+2048>>12;T=H;H=x*y+O*m+2048>>12;x=x*m-O*y+2048>>12;(E=(c=c+d+1>>1)+T)<16?E=0:E>=4080?E=255:E>>=4;(M=(l=l+h+1>>1)+(O=H))<16?M=0:M>=4080?M=255:M>>=4;(R=(h=l-h)+x)<16?R=0:R>=4080?R=255:R>>=4;(j=(d=c-d)+g)<16?j=0:j>=4080?j=255:j>>=4;(D=d-g)<16?D=0:D>=4080?D=255:D>>=4;(L=h-x)<16?L=0:L>=4080?L=255:L>>=4;(N=l-O)<16?N=0:N>=4080?N=255:N>>=4;(U=c-T)<16?U=0:U>=4080?U=255:U>>=4;X[r+G]=E;X[r+G+8]=M;X[r+G+16]=R;X[r+G+24]=j;X[r+G+32]=D;X[r+G+40]=L;X[r+G+48]=N;X[r+G+56]=U}else{H=(H=S*E+8192>>14)<-2040?0:H>=2024?255:H+2056>>4;X[r+G]=H;X[r+G+8]=H;X[r+G+16]=H;X[r+G+24]=H;X[r+G+32]=H;X[r+G+40]=H;X[r+G+48]=H;X[r+G+56]=H}}}function buildComponentData(t,r){for(var o=r.blocksPerLine,c=r.blocksPerColumn,l=new Int16Array(64),u=0;u<c;u++)for(var h=0;h<o;h++){quantizeAndInverse(r,getBlockBufferOffset(r,u,h),l)}return r.blockData}function findNextFileMarker(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,c=t.length-1,u=o<r?o:r;if(r>=c)return null;var h=(0,l.readUint16)(t,r);if(h>=65472&&h<=65534)return{invalid:null,marker:h,offset:r};for(var d=(0,l.readUint16)(t,u);!(d>=65472&&d<=65534);){if(++u>=c)return null;d=(0,l.readUint16)(t,u)}return{invalid:h.toString(16),marker:d,offset:u}}var x=function(){function JpegImage(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.decodeTransform,o=void 0===r?null:r,c=t.colorTransform,l=void 0===c?-1:c;_classCallCheck(this,JpegImage);this._decodeTransform=o;this._colorTransform=l}_createClass(JpegImage,[{key:"parse",value:function parse(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.dnlScanLines,m=void 0===o?null:o;function readDataBlock(){var r=(0,l.readUint16)(t,k),o=(k+=2)+r-2,u=findNextFileMarker(t,o,k);if(u&&u.invalid){(0,c.warn)("readDataBlock - incorrect length, current marker is: "+u.invalid);o=u.offset}var h=t.subarray(k,o);k+=h.length;return h}function prepareComponents(t){for(var r=Math.ceil(t.samplesPerLine/8/t.maxH),o=Math.ceil(t.scanLines/8/t.maxV),c=0,l=t.components.length;c<l;c++){var u=t.components[c],h=Math.ceil(Math.ceil(t.samplesPerLine/8)*u.h/t.maxH),d=Math.ceil(Math.ceil(t.scanLines/8)*u.v/t.maxV),g=r*u.h,m=64*(o*u.v)*(g+1);u.blockData=new Int16Array(m);u.blocksPerLine=h;u.blocksPerColumn=d}t.mcusPerLine=r;t.mcusPerColumn=o}var y,v,k=0,_=null,w=null,S=0,C=[],x=[],O=[],T=(0,l.readUint16)(t,k);k+=2;if(65496!==T)throw new u("SOI not found");T=(0,l.readUint16)(t,k);k+=2;e:for(;65497!==T;){var E=void 0,M=void 0,R=void 0;switch(T){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var j=readDataBlock();65504===T&&74===j[0]&&70===j[1]&&73===j[2]&&70===j[3]&&0===j[4]&&(_={version:{major:j[5],minor:j[6]},densityUnits:j[7],xDensity:j[8]<<8|j[9],yDensity:j[10]<<8|j[11],thumbWidth:j[12],thumbHeight:j[13],thumbData:j.subarray(14,14+3*j[12]*j[13])});65518===T&&65===j[0]&&100===j[1]&&111===j[2]&&98===j[3]&&101===j[4]&&(w={version:j[5]<<8|j[6],flags0:j[7]<<8|j[8],flags1:j[9]<<8|j[10],transformCode:j[11]});break;case 65499:for(var D=(0,l.readUint16)(t,k),L=D+(k+=2)-2;k<L;){var N=t[k++],U=new Uint16Array(64);if(N>>4==0)for(M=0;M<64;M++)U[g[M]]=t[k++];else{if(N>>4!=1)throw new u("DQT - invalid table spec");for(M=0;M<64;M++){U[g[M]]=(0,l.readUint16)(t,k);k+=2}}C[15&N]=U}break;case 65472:case 65473:case 65474:if(y)throw new u("Only single frame JPEGs supported");k+=2;(y={}).extended=65473===T;y.progressive=65474===T;y.precision=t[k++];var H=(0,l.readUint16)(t,k);k+=2;y.scanLines=m||H;y.samplesPerLine=(0,l.readUint16)(t,k);k+=2;y.components=[];y.componentIds={};var $=t[k++],X=0,q=0;for(E=0;E<$;E++){var G=t[k],z=t[k+1]>>4,W=15&t[k+1];X<z&&(X=z);q<W&&(q=W);var V=t[k+2];R=y.components.push({h:z,v:W,quantizationId:V,quantizationTable:null});y.componentIds[G]=R-1;k+=3}y.maxH=X;y.maxV=q;prepareComponents(y);break;case 65476:var K=(0,l.readUint16)(t,k);k+=2;for(E=2;E<K;){var Y=t[k++],J=new Uint8Array(16),Z=0;for(M=0;M<16;M++,k++)Z+=J[M]=t[k];var Q=new Uint8Array(Z);for(M=0;M<Z;M++,k++)Q[M]=t[k];E+=17+Z;(Y>>4==0?O:x)[15&Y]=buildHuffmanTable(J,Q)}break;case 65501:k+=2;v=(0,l.readUint16)(t,k);k+=2;break;case 65498:var ee=1==++S&&!m;k+=2;var te=t[k++],re=[];for(E=0;E<te;E++){var ae=t[k++],ne=y.componentIds[ae],ie=y.components[ne];ie.index=ae;var oe=t[k++];ie.huffmanTableDC=O[oe>>4];ie.huffmanTableAC=x[15&oe];re.push(ie)}var se=t[k++],ce=t[k++],le=t[k++];try{var ue=decodeScan(t,k,y,re,v,se,ce,le>>4,15&le,ee);k+=ue}catch(r){if(r instanceof h){(0,c.warn)("".concat(r.message," -- attempting to re-parse the JPEG image."));return this.parse(t,{dnlScanLines:r.scanLines})}if(r instanceof d){(0,c.warn)("".concat(r.message," -- ignoring the rest of the image data."));break e}throw r}break;case 65500:k+=4;break;case 65535:255!==t[k]&&k--;break;default:var fe=findNextFileMarker(t,k-2,k-3);if(fe&&fe.invalid){(0,c.warn)("JpegImage.parse - unexpected data, current marker is: "+fe.invalid);k=fe.offset;break}if(!fe||k>=t.length-1){(0,c.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new u("JpegImage.parse - unknown marker: "+T.toString(16))}T=(0,l.readUint16)(t,k);k+=2}this.width=y.samplesPerLine;this.height=y.scanLines;this.jfif=_;this.adobe=w;this.components=[];for(var he=0,de=y.components.length;he<de;he++){var pe=y.components[he],ge=C[pe.quantizationId];ge&&(pe.quantizationTable=ge);this.components.push({index:pe.index,output:buildComponentData(0,pe),scaleX:pe.h/y.maxH,scaleY:pe.v/y.maxV,blocksPerLine:pe.blocksPerLine,blocksPerColumn:pe.blocksPerColumn})}this.numComponents=this.components.length}},{key:"_getLinearizedBlockData",value:function _getLinearizedBlockData(t,r){var o,c,l,u,h,d,g,m,y,v,k,_,w=arguments.length>2&&void 0!==arguments[2]&&arguments[2],S=this.width/t,C=this.height/r,x=0,O=this.components.length,T=t*r*O,E=new Uint8ClampedArray(T),M=new Uint32Array(t),R=4294967288;for(g=0;g<O;g++){c=(o=this.components[g]).scaleX*S;l=o.scaleY*C;x=g;k=o.output;u=o.blocksPerLine+1<<3;if(c!==_){for(h=0;h<t;h++){m=0|h*c;M[h]=(m&R)<<3|7&m}_=c}for(d=0;d<r;d++){v=u*((m=0|d*l)&R)|(7&m)<<3;for(h=0;h<t;h++){E[x]=k[v+M[h]];x+=O}}}var j=this._decodeTransform;w||4!==O||j||(j=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(j)for(g=0;g<T;)for(m=0,y=0;m<O;m++,g++,y+=2)E[g]=(E[g]*j[y]>>8)+j[y+1];return E}},{key:"_isColorConversionNeeded",get:function get(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}},{key:"_convertYccToRgb",value:function _convertYccToRgb(t){for(var r,o,c,l=0,u=t.length;l<u;l+=3){r=t[l];o=t[l+1];c=t[l+2];t[l]=r-179.456+1.402*c;t[l+1]=r+135.459-.344*o-.714*c;t[l+2]=r-226.816+1.772*o}return t}},{key:"_convertYcckToRgb",value:function _convertYcckToRgb(t){for(var r,o,c,l,u=0,h=0,d=t.length;h<d;h+=4){r=t[h];o=t[h+1];c=t[h+2];l=t[h+3];t[u++]=o*(-660635669420364e-19*o+.000437130475926232*c-54080610064599e-18*r+.00048449797120281*l-.154362151871126)-122.67195406894+c*(-.000957964378445773*c+.000817076911346625*r-.00477271405408747*l+1.53380253221734)+r*(.000961250184130688*r-.00266257332283933*l+.48357088451265)+l*(-.000336197177618394*l+.484791561490776);t[u++]=107.268039397724+o*(219927104525741e-19*o-.000640992018297945*c+.000659397001245577*r+.000426105652938837*l-.176491792462875)+c*(-.000778269941513683*c+.00130872261408275*r+.000770482631801132*l-.151051492775562)+r*(.00126935368114843*r-.00265090189010898*l+.25802910206845)+l*(-.000318913117588328*l-.213742400323665);t[u++]=o*(-.000570115196973677*o-263409051004589e-19*c+.0020741088115012*r-.00288260236853442*l+.814272968359295)-20.810012546947+c*(-153496057440975e-19*c-.000132689043961446*r+.000560833691242812*l-.195152027534049)+r*(.00174418132927582*r-.00255243321439347*l+.116935020465145)+l*(-.000343531996510555*l+.24165260232407)}return t.subarray(0,u)}},{key:"_convertYcckToCmyk",value:function _convertYcckToCmyk(t){for(var r,o,c,l=0,u=t.length;l<u;l+=4){r=t[l];o=t[l+1];c=t[l+2];t[l]=434.456-r-1.402*c;t[l+1]=119.541-r+.344*o+.714*c;t[l+2]=481.816-r-1.772*o}return t}},{key:"_convertCmykToRgb",value:function _convertCmykToRgb(t){for(var r,o,c,l,u=0,h=0,d=t.length;h<d;h+=4){r=t[h];o=t[h+1];c=t[h+2];l=t[h+3];t[u++]=255+r*(-6747147073602441e-20*r+.0008379262121013727*o+.0002894718188643294*c+.003264231057537806*l-1.1185611867203937)+o*(26374107616089405e-21*o-8626949158638572e-20*c-.0002748769067499491*l-.02155688794978967)+c*(-3878099212869363e-20*c-.0003267808279485286*l+.0686742238595345)-l*(.0003361971776183937*l+.7430659151342254);t[u++]=255+r*(.00013596372813588848*r+.000924537132573585*o+.00010567359618683593*c+.0004791864687436512*l-.3109689587515875)+o*(-.00023545346108370344*o+.0002702845253534714*c+.0020200308977307156*l-.7488052167015494)+c*(6834815998235662e-20*c+.00015168452363460973*l-.09751927774728933)-l*(.0003189131175883281*l+.7364883807733168);t[u++]=255+r*(13598650411385307e-21*r+.00012423956175490851*o+.0004751985097583589*c-36729317476630422e-22*l-.05562186980264034)+o*(.00016141380598724676*o+.0009692239130725186*c+.0007782692450036253*l-.44015232367526463)+c*(5.068882914068769e-7*c+.0017778369011375071*l-.7591454649749609)-l*(.0003435319965105553*l+.7063770186160144)}return t.subarray(0,u)}},{key:"getData",value:function getData(t){var r=t.width,o=t.height,c=t.forceRGB,l=void 0!==c&&c,h=t.isSourcePDF,d=void 0!==h&&h;if(this.numComponents>4)throw new u("Unsupported color mode");var g=this._getLinearizedBlockData(r,o,d);if(1===this.numComponents&&l){for(var m=g.length,y=new Uint8ClampedArray(3*m),v=0,k=0;k<m;k++){var _=g[k];y[v++]=_;y[v++]=_;y[v++]=_}return y}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(g);if(4===this.numComponents){if(this._isColorConversionNeeded)return l?this._convertYcckToRgb(g):this._convertYcckToCmyk(g);if(l)return this._convertCmykToRgb(g)}return g}}]);return JpegImage}();r.JpegImage=x},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.JpxStream=void 0;var c=o(170),l=o(181),u=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(JpxStream,t);var r=_createSuper(JpxStream);function JpxStream(t,o,c){var l;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,JpxStream);(l=r.call(this,o)).stream=t;l.dict=t.dict;l.maybeLength=o;l.params=c;return l}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(JpxStream,[{key:"bytes",get:function get(){return(0,u.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}},{key:"ensureBuffer",value:function ensureBuffer(t){}},{key:"readBlock",value:function readBlock(){if(!this.eof){var t=new l.JpxImage;t.parse(this.bytes);var r=t.width,o=t.height,c=t.componentsCount,u=t.tiles.length;if(1===u)this.buffer=t.tiles[0].items;else{for(var h=new Uint8ClampedArray(r*o*c),d=0;d<u;d++)for(var g=t.tiles[d],m=g.width,y=g.height,v=g.left,k=g.top,_=g.items,w=0,S=(r*k+v)*c,C=r*c,x=m*c,O=0;O<y;O++){var T=_.subarray(w,w+x);h.set(T,S);w+=x;S+=C}this.buffer=h}this.bufferLength=this.buffer.length;this.eof=!0}}}]);return JpxStream}(c.DecodeStream);r.JpxStream=h},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.JpxImage=void 0;var c=o(4),l=o(149),u=o(177);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var h=function(t){_inherits(JpxError,t);var r=_createSuper(JpxError);function JpxError(t){_classCallCheck(this,JpxError);return r.call(this,"JPX error: ".concat(t),"JpxError")}return _createClass(JpxError)}(c.BaseException),d={LL:0,LH:1,HL:1,HH:2},g=function(){function JpxImage(){_classCallCheck(this,JpxImage);this.failOnCorruptedImage=!1}_createClass(JpxImage,[{key:"parse",value:function parse(t){if(65359!==(0,l.readUint16)(t,0))for(var r=t.length,o=0;o<r;){var u=8,d=(0,l.readUint32)(t,o),g=(0,l.readUint32)(t,o+4);o+=u;if(1===d){d=4294967296*(0,l.readUint32)(t,o)+(0,l.readUint32)(t,o+4);o+=8;u+=8}0===d&&(d=r-o+u);if(d<u)throw new h("Invalid box field size");var m=d-u,y=!0;switch(g){case 1785737832:y=!1;break;case 1668246642:var v=t[o];if(1===v){var k=(0,l.readUint32)(t,o+3);switch(k){case 16:case 17:case 18:break;default:(0,c.warn)("Unknown colorspace "+k)}}else 2===v&&(0,c.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(t,o,o+m);break;case 1783636e3:218793738!==(0,l.readUint32)(t,o)&&(0,c.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:var _=String.fromCharCode(g>>24&255,g>>16&255,g>>8&255,255&g);(0,c.warn)("Unsupported header type ".concat(g," (").concat(_,")."))}y&&(o+=m)}else this.parseCodestream(t,0,t.length)}},{key:"parseImageProperties",value:function parseImageProperties(t){for(var r=t.getByte();r>=0;){if(65361===(r<<8|(r=t.getByte()))){t.skip(4);var o=t.getInt32()>>>0,c=t.getInt32()>>>0,l=t.getInt32()>>>0,u=t.getInt32()>>>0;t.skip(16);var d=t.getUint16();this.width=o-l;this.height=c-u;this.componentsCount=d;this.bitsPerComponent=8;return}}throw new h("No size marker found in JPX stream")}},{key:"parseCodestream",value:function parseCodestream(t,r,o){var u={},d=!1;try{for(var g=r;g+1<o;){var m=(0,l.readUint16)(t,g);g+=2;var y=0,v=void 0,k=void 0,_=void 0,w=void 0,S=void 0,C=void 0;switch(m){case 65359:u.mainHeader=!0;break;case 65497:break;case 65361:y=(0,l.readUint16)(t,g);var x={};x.Xsiz=(0,l.readUint32)(t,g+4);x.Ysiz=(0,l.readUint32)(t,g+8);x.XOsiz=(0,l.readUint32)(t,g+12);x.YOsiz=(0,l.readUint32)(t,g+16);x.XTsiz=(0,l.readUint32)(t,g+20);x.YTsiz=(0,l.readUint32)(t,g+24);x.XTOsiz=(0,l.readUint32)(t,g+28);x.YTOsiz=(0,l.readUint32)(t,g+32);var O=(0,l.readUint16)(t,g+36);x.Csiz=O;var T=[];v=g+38;for(var E=0;E<O;E++){var M={precision:1+(127&t[v]),isSigned:!!(128&t[v]),XRsiz:t[v+1],YRsiz:t[v+2]};v+=3;calculateComponentDimensions(M,x);T.push(M)}u.SIZ=x;u.components=T;calculateTileGrids(u,T);u.QCC=[];u.COC=[];break;case 65372:y=(0,l.readUint16)(t,g);var R={};v=g+2;switch(31&(k=t[v++])){case 0:w=8;S=!0;break;case 1:w=16;S=!1;break;case 2:w=16;S=!0;break;default:throw new Error("Invalid SQcd value "+k)}R.noQuantization=8===w;R.scalarExpounded=S;R.guardBits=k>>5;_=[];for(;v<y+g;){var j={};if(8===w){j.epsilon=t[v++]>>3;j.mu=0}else{j.epsilon=t[v]>>3;j.mu=(7&t[v])<<8|t[v+1];v+=2}_.push(j)}R.SPqcds=_;if(u.mainHeader)u.QCD=R;else{u.currentTile.QCD=R;u.currentTile.QCC=[]}break;case 65373:y=(0,l.readUint16)(t,g);var D={};v=g+2;var L=void 0;if(u.SIZ.Csiz<257)L=t[v++];else{L=(0,l.readUint16)(t,v);v+=2}switch(31&(k=t[v++])){case 0:w=8;S=!0;break;case 1:w=16;S=!1;break;case 2:w=16;S=!0;break;default:throw new Error("Invalid SQcd value "+k)}D.noQuantization=8===w;D.scalarExpounded=S;D.guardBits=k>>5;_=[];for(;v<y+g;){var N={};if(8===w){N.epsilon=t[v++]>>3;N.mu=0}else{N.epsilon=t[v]>>3;N.mu=(7&t[v])<<8|t[v+1];v+=2}_.push(N)}D.SPqcds=_;u.mainHeader?u.QCC[L]=D:u.currentTile.QCC[L]=D;break;case 65362:y=(0,l.readUint16)(t,g);var U={};v=g+2;var H=t[v++];U.entropyCoderWithCustomPrecincts=!!(1&H);U.sopMarkerUsed=!!(2&H);U.ephMarkerUsed=!!(4&H);U.progressionOrder=t[v++];U.layersCount=(0,l.readUint16)(t,v);v+=2;U.multipleComponentTransform=t[v++];U.decompositionLevelsCount=t[v++];U.xcb=2+(15&t[v++]);U.ycb=2+(15&t[v++]);var $=t[v++];U.selectiveArithmeticCodingBypass=!!(1&$);U.resetContextProbabilities=!!(2&$);U.terminationOnEachCodingPass=!!(4&$);U.verticallyStripe=!!(8&$);U.predictableTermination=!!(16&$);U.segmentationSymbolUsed=!!(32&$);U.reversibleTransformation=t[v++];if(U.entropyCoderWithCustomPrecincts){for(var X=[];v<y+g;){var q=t[v++];X.push({PPx:15&q,PPy:q>>4})}U.precinctsSizes=X}var G=[];U.selectiveArithmeticCodingBypass&&G.push("selectiveArithmeticCodingBypass");U.terminationOnEachCodingPass&&G.push("terminationOnEachCodingPass");U.verticallyStripe&&G.push("verticallyStripe");U.predictableTermination&&G.push("predictableTermination");if(G.length>0){d=!0;(0,c.warn)("JPX: Unsupported COD options (".concat(G.join(", "),")."))}if(u.mainHeader)u.COD=U;else{u.currentTile.COD=U;u.currentTile.COC=[]}break;case 65424:y=(0,l.readUint16)(t,g);(C={}).index=(0,l.readUint16)(t,g+2);C.length=(0,l.readUint32)(t,g+4);C.dataEnd=C.length+g-2;C.partIndex=t[g+8];C.partsCount=t[g+9];u.mainHeader=!1;if(0===C.partIndex){C.COD=u.COD;C.COC=u.COC.slice(0);C.QCD=u.QCD;C.QCC=u.QCC.slice(0)}u.currentTile=C;break;case 65427:if(0===(C=u.currentTile).partIndex){initializeTile(u,C.index);buildPackets(u)}parseTilePackets(u,t,g,y=C.dataEnd-g);break;case 65363:(0,c.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");case 65365:case 65367:case 65368:case 65380:y=(0,l.readUint16)(t,g);break;default:throw new Error("Unknown codestream code: "+m.toString(16))}g+=y}}catch(t){if(d||this.failOnCorruptedImage)throw new h(t.message);(0,c.warn)('JPX: Trying to recover from: "'.concat(t.message,'".'))}this.tiles=function transformComponents(t){for(var r=t.SIZ,o=t.components,c=r.Csiz,l=[],u=0,h=t.tiles.length;u<h;u++){for(var d=t.tiles[u],g=[],m=0;m<c;m++)g[m]=transformTile(t,d,m);var y=g[0],v=new Uint8ClampedArray(y.items.length*c),k={left:y.left,top:y.top,width:y.width,height:y.height,items:v},_=void 0,w=void 0,S=0,C=void 0,x=void 0,O=void 0,T=void 0,E=void 0;if(d.codingStyleDefaultParameters.multipleComponentTransform){var M=4===c,R=g[0].items,j=g[1].items,D=g[2].items,L=M?g[3].items:null;w=.5+(128<<(_=o[0].precision-8));var N=d.components[0],U=c-3;x=R.length;if(N.codingStyleParameters.reversibleTransformation)for(C=0;C<x;C++,S+=U){O=R[C]+w;T=j[C];var H=O-((E=D[C])+T>>2);v[S++]=H+E>>_;v[S++]=H>>_;v[S++]=H+T>>_}else for(C=0;C<x;C++,S+=U){O=R[C]+w;T=j[C];E=D[C];v[S++]=O+1.402*E>>_;v[S++]=O-.34413*T-.71414*E>>_;v[S++]=O+1.772*T>>_}if(M)for(C=0,S=3;C<x;C++,S+=4)v[S]=L[C]+w>>_}else for(var $=0;$<c;$++){var X=g[$].items;w=.5+(128<<(_=o[$].precision-8));for(S=$,C=0,x=X.length;C<x;C++){v[S]=X[C]+w>>_;S+=c}}l.push(k)}return l}(u);this.width=u.SIZ.Xsiz-u.SIZ.XOsiz;this.height=u.SIZ.Ysiz-u.SIZ.YOsiz;this.componentsCount=u.SIZ.Csiz}}]);return JpxImage}();r.JpxImage=g;function calculateComponentDimensions(t,r){t.x0=Math.ceil(r.XOsiz/t.XRsiz);t.x1=Math.ceil(r.Xsiz/t.XRsiz);t.y0=Math.ceil(r.YOsiz/t.YRsiz);t.y1=Math.ceil(r.Ysiz/t.YRsiz);t.width=t.x1-t.x0;t.height=t.y1-t.y0}function calculateTileGrids(t,r){for(var o,c=t.SIZ,l=[],u=Math.ceil((c.Xsiz-c.XTOsiz)/c.XTsiz),h=Math.ceil((c.Ysiz-c.YTOsiz)/c.YTsiz),d=0;d<h;d++)for(var g=0;g<u;g++){(o={}).tx0=Math.max(c.XTOsiz+g*c.XTsiz,c.XOsiz);o.ty0=Math.max(c.YTOsiz+d*c.YTsiz,c.YOsiz);o.tx1=Math.min(c.XTOsiz+(g+1)*c.XTsiz,c.Xsiz);o.ty1=Math.min(c.YTOsiz+(d+1)*c.YTsiz,c.Ysiz);o.width=o.tx1-o.tx0;o.height=o.ty1-o.ty0;o.components=[];l.push(o)}t.tiles=l;for(var m=0,y=c.Csiz;m<y;m++)for(var v=r[m],k=0,_=l.length;k<_;k++){var w={};o=l[k];w.tcx0=Math.ceil(o.tx0/v.XRsiz);w.tcy0=Math.ceil(o.ty0/v.YRsiz);w.tcx1=Math.ceil(o.tx1/v.XRsiz);w.tcy1=Math.ceil(o.ty1/v.YRsiz);w.width=w.tcx1-w.tcx0;w.height=w.tcy1-w.tcy0;o.components[m]=w}}function getBlocksDimensions(t,r,o){var c=r.codingStyleParameters,l={};if(c.entropyCoderWithCustomPrecincts){l.PPx=c.precinctsSizes[o].PPx;l.PPy=c.precinctsSizes[o].PPy}else{l.PPx=15;l.PPy=15}l.xcb_=o>0?Math.min(c.xcb,l.PPx-1):Math.min(c.xcb,l.PPx);l.ycb_=o>0?Math.min(c.ycb,l.PPy-1):Math.min(c.ycb,l.PPy);return l}function buildPrecincts(t,r,o){var c=1<<o.PPx,l=1<<o.PPy,u=0===r.resLevel,h=1<<o.PPx+(u?0:-1),d=1<<o.PPy+(u?0:-1),g=r.trx1>r.trx0?Math.ceil(r.trx1/c)-Math.floor(r.trx0/c):0,m=r.try1>r.try0?Math.ceil(r.try1/l)-Math.floor(r.try0/l):0,y=g*m;r.precinctParameters={precinctWidth:c,precinctHeight:l,numprecinctswide:g,numprecinctshigh:m,numprecincts:y,precinctWidthInSubband:h,precinctHeightInSubband:d}}function buildCodeblocks(t,r,o){var c,l,u,h,d=o.xcb_,g=o.ycb_,m=1<<d,y=1<<g,v=r.tbx0>>d,k=r.tby0>>g,_=r.tbx1+m-1>>d,w=r.tby1+y-1>>g,S=r.resolution.precinctParameters,C=[],x=[];for(l=k;l<w;l++)for(c=v;c<_;c++){(u={cbx:c,cby:l,tbx0:m*c,tby0:y*l,tbx1:m*(c+1),tby1:y*(l+1)}).tbx0_=Math.max(r.tbx0,u.tbx0);u.tby0_=Math.max(r.tby0,u.tby0);u.tbx1_=Math.min(r.tbx1,u.tbx1);u.tby1_=Math.min(r.tby1,u.tby1);h=Math.floor((u.tbx0_-r.tbx0)/S.precinctWidthInSubband)+Math.floor((u.tby0_-r.tby0)/S.precinctHeightInSubband)*S.numprecinctswide;u.precinctNumber=h;u.subbandType=r.type;u.Lblock=3;if(!(u.tbx1_<=u.tbx0_||u.tby1_<=u.tby0_)){C.push(u);var O=x[h];if(void 0!==O){c<O.cbxMin?O.cbxMin=c:c>O.cbxMax&&(O.cbxMax=c);l<O.cbyMin?O.cbxMin=l:l>O.cbyMax&&(O.cbyMax=l)}else x[h]=O={cbxMin:c,cbyMin:l,cbxMax:c,cbyMax:l};u.precinct=O}}r.codeblockParameters={codeblockWidth:d,codeblockHeight:g,numcodeblockwide:_-v+1,numcodeblockhigh:w-k+1};r.codeblocks=C;r.precincts=x}function createPacket(t,r,o){for(var c=[],l=t.subbands,u=0,h=l.length;u<h;u++)for(var d=l[u].codeblocks,g=0,m=d.length;g<m;g++){var y=d[g];y.precinctNumber===r&&c.push(y)}return{layerNumber:o,codeblocks:c}}function LayerResolutionComponentPositionIterator(t){for(var r=t.SIZ,o=t.currentTile.index,c=t.tiles[o],l=c.codingStyleDefaultParameters.layersCount,u=r.Csiz,d=0,g=0;g<u;g++)d=Math.max(d,c.components[g].codingStyleParameters.decompositionLevelsCount);var m=0,y=0,v=0,k=0;this.nextPacket=function JpxImage_nextPacket(){for(;m<l;m++){for(;y<=d;y++){for(;v<u;v++){var t=c.components[v];if(!(y>t.codingStyleParameters.decompositionLevelsCount)){for(var r=t.resolutions[y],o=r.precinctParameters.numprecincts;k<o;){var g=createPacket(r,k,m);k++;return g}k=0}}v=0}y=0}throw new h("Out of packets")}}function ResolutionLayerComponentPositionIterator(t){for(var r=t.SIZ,o=t.currentTile.index,c=t.tiles[o],l=c.codingStyleDefaultParameters.layersCount,u=r.Csiz,d=0,g=0;g<u;g++)d=Math.max(d,c.components[g].codingStyleParameters.decompositionLevelsCount);var m=0,y=0,v=0,k=0;this.nextPacket=function JpxImage_nextPacket(){for(;m<=d;m++){for(;y<l;y++){for(;v<u;v++){var t=c.components[v];if(!(m>t.codingStyleParameters.decompositionLevelsCount)){for(var r=t.resolutions[m],o=r.precinctParameters.numprecincts;k<o;){var g=createPacket(r,k,y);k++;return g}k=0}}v=0}y=0}throw new h("Out of packets")}}function ResolutionPositionComponentLayerIterator(t){var r,o,c,l,u=t.SIZ,d=t.currentTile.index,g=t.tiles[d],m=g.codingStyleDefaultParameters.layersCount,y=u.Csiz,v=0;for(c=0;c<y;c++){var k=g.components[c];v=Math.max(v,k.codingStyleParameters.decompositionLevelsCount)}var _=new Int32Array(v+1);for(o=0;o<=v;++o){var w=0;for(c=0;c<y;++c){var S=g.components[c].resolutions;o<S.length&&(w=Math.max(w,S[o].precinctParameters.numprecincts))}_[o]=w}r=0;o=0;c=0;l=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=v;o++){for(;l<_[o];l++){for(;c<y;c++){var t=g.components[c];if(!(o>t.codingStyleParameters.decompositionLevelsCount)){var u=t.resolutions[o],d=u.precinctParameters.numprecincts;if(!(l>=d)){for(;r<m;){var k=createPacket(u,l,r);r++;return k}r=0}}}c=0}l=0}throw new h("Out of packets")}}function PositionComponentResolutionLayerIterator(t){var r=t.SIZ,o=t.currentTile.index,c=t.tiles[o],l=c.codingStyleDefaultParameters.layersCount,u=r.Csiz,d=getPrecinctSizesInImageScale(c),g=d,m=0,y=0,v=0,k=0,_=0;this.nextPacket=function JpxImage_nextPacket(){for(;_<g.maxNumHigh;_++){for(;k<g.maxNumWide;k++){for(;v<u;v++){for(var t=c.components[v],r=t.codingStyleParameters.decompositionLevelsCount;y<=r;y++){var o=t.resolutions[y],w=d.components[v].resolutions[y],S=getPrecinctIndexIfExist(k,_,w,g,o);if(null!==S){for(;m<l;){var C=createPacket(o,S,m);m++;return C}m=0}}y=0}v=0}k=0}throw new h("Out of packets")}}function ComponentPositionResolutionLayerIterator(t){var r=t.SIZ,o=t.currentTile.index,c=t.tiles[o],l=c.codingStyleDefaultParameters.layersCount,u=r.Csiz,d=getPrecinctSizesInImageScale(c),g=0,m=0,y=0,v=0,k=0;this.nextPacket=function JpxImage_nextPacket(){for(;y<u;++y){for(var t=c.components[y],r=d.components[y],o=t.codingStyleParameters.decompositionLevelsCount;k<r.maxNumHigh;k++){for(;v<r.maxNumWide;v++){for(;m<=o;m++){var _=t.resolutions[m],w=r.resolutions[m],S=getPrecinctIndexIfExist(v,k,w,r,_);if(null!==S){for(;g<l;){var C=createPacket(_,S,g);g++;return C}g=0}}m=0}v=0}k=0}throw new h("Out of packets")}}function getPrecinctIndexIfExist(t,r,o,c,l){var u=t*c.minWidth,h=r*c.minHeight;if(u%o.width!=0||h%o.height!=0)return null;var d=h/o.width*l.precinctParameters.numprecinctswide;return u/o.height+d}function getPrecinctSizesInImageScale(t){for(var r=t.components.length,o=Number.MAX_VALUE,c=Number.MAX_VALUE,l=0,u=0,h=new Array(r),d=0;d<r;d++){for(var g=t.components[d],m=g.codingStyleParameters.decompositionLevelsCount,y=new Array(m+1),v=Number.MAX_VALUE,k=Number.MAX_VALUE,_=0,w=0,S=1,C=m;C>=0;--C){var x=g.resolutions[C],O=S*x.precinctParameters.precinctWidth,T=S*x.precinctParameters.precinctHeight;v=Math.min(v,O);k=Math.min(k,T);_=Math.max(_,x.precinctParameters.numprecinctswide);w=Math.max(w,x.precinctParameters.numprecinctshigh);y[C]={width:O,height:T};S<<=1}o=Math.min(o,v);c=Math.min(c,k);l=Math.max(l,_);u=Math.max(u,w);h[d]={resolutions:y,minWidth:v,minHeight:k,maxNumWide:_,maxNumHigh:w}}return{components:h,minWidth:o,minHeight:c,maxNumWide:l,maxNumHigh:u}}function buildPackets(t){for(var r=t.SIZ,o=t.currentTile.index,c=t.tiles[o],l=r.Csiz,u=0;u<l;u++){for(var d=c.components[u],g=d.codingStyleParameters.decompositionLevelsCount,m=[],y=[],v=0;v<=g;v++){var k=getBlocksDimensions(0,d,v),_={},w=1<<g-v;_.trx0=Math.ceil(d.tcx0/w);_.try0=Math.ceil(d.tcy0/w);_.trx1=Math.ceil(d.tcx1/w);_.try1=Math.ceil(d.tcy1/w);_.resLevel=v;buildPrecincts(0,_,k);m.push(_);var S=void 0;if(0===v){(S={}).type="LL";S.tbx0=Math.ceil(d.tcx0/w);S.tby0=Math.ceil(d.tcy0/w);S.tbx1=Math.ceil(d.tcx1/w);S.tby1=Math.ceil(d.tcy1/w);S.resolution=_;buildCodeblocks(0,S,k);y.push(S);_.subbands=[S]}else{var C=1<<g-v+1,x=[];(S={}).type="HL";S.tbx0=Math.ceil(d.tcx0/C-.5);S.tby0=Math.ceil(d.tcy0/C);S.tbx1=Math.ceil(d.tcx1/C-.5);S.tby1=Math.ceil(d.tcy1/C);S.resolution=_;buildCodeblocks(0,S,k);y.push(S);x.push(S);(S={}).type="LH";S.tbx0=Math.ceil(d.tcx0/C);S.tby0=Math.ceil(d.tcy0/C-.5);S.tbx1=Math.ceil(d.tcx1/C);S.tby1=Math.ceil(d.tcy1/C-.5);S.resolution=_;buildCodeblocks(0,S,k);y.push(S);x.push(S);(S={}).type="HH";S.tbx0=Math.ceil(d.tcx0/C-.5);S.tby0=Math.ceil(d.tcy0/C-.5);S.tbx1=Math.ceil(d.tcx1/C-.5);S.tby1=Math.ceil(d.tcy1/C-.5);S.resolution=_;buildCodeblocks(0,S,k);y.push(S);x.push(S);_.subbands=x}}d.resolutions=m;d.subbands=y}var O=c.codingStyleDefaultParameters.progressionOrder;switch(O){case 0:c.packetsIterator=new LayerResolutionComponentPositionIterator(t);break;case 1:c.packetsIterator=new ResolutionLayerComponentPositionIterator(t);break;case 2:c.packetsIterator=new ResolutionPositionComponentLayerIterator(t);break;case 3:c.packetsIterator=new PositionComponentResolutionLayerIterator(t);break;case 4:c.packetsIterator=new ComponentPositionResolutionLayerIterator(t);break;default:throw new h("Unsupported progression order ".concat(O))}}function parseTilePackets(t,r,o,c){var u,d=0,g=0,v=!1;function readBits(t){for(;g<t;){var c=r[o+d];d++;if(v){u=u<<7|c;g+=7;v=!1}else{u=u<<8|c;g+=8}255===c&&(v=!0)}return u>>>(g-=t)&(1<<t)-1}function skipMarkerIfEqual(t){if(255===r[o+d-1]&&r[o+d]===t){skipBytes(1);return!0}if(255===r[o+d]&&r[o+d+1]===t){skipBytes(2);return!0}return!1}function skipBytes(t){d+=t}function alignToByte(){g=0;if(v){d++;v=!1}}function readCodingpasses(){if(0===readBits(1))return 1;if(0===readBits(1))return 2;var t=readBits(2);return t<3?t+3:(t=readBits(5))<31?t+6:(t=readBits(7))+37}for(var k=t.currentTile.index,_=t.tiles[k],w=t.COD.sopMarkerUsed,S=t.COD.ephMarkerUsed,C=_.packetsIterator;d<c;){alignToByte();w&&skipMarkerIfEqual(145)&&skipBytes(4);var x=C.nextPacket();if(readBits(1)){for(var O=x.layerNumber,T=[],E=void 0,M=0,R=x.codeblocks.length;M<R;M++){var j=(E=x.codeblocks[M]).precinct,D=E.cbx-j.cbxMin,L=E.cby-j.cbyMin,N=!1,U=!1,H=void 0;if(void 0!==E.included)N=!!readBits(1);else{var $=void 0;if(void 0!==(j=E.precinct).inclusionTree)$=j.inclusionTree;else{var X=j.cbxMax-j.cbxMin+1,q=j.cbyMax-j.cbyMin+1;$=new y(X,q,O);H=new m(X,q);j.inclusionTree=$;j.zeroBitPlanesTree=H;for(var G=0;G<O;G++)if(0!==readBits(1))throw new h("Invalid tag tree")}if($.reset(D,L,O))for(;;){if(!readBits(1)){$.incrementValue(O);break}if(!$.nextLevel()){E.included=!0;N=U=!0;break}}}if(N){if(U){(H=j.zeroBitPlanesTree).reset(D,L);for(;;)if(readBits(1)){if(!H.nextLevel())break}else H.incrementValue();E.zeroBitPlanes=H.value}for(var z=readCodingpasses();readBits(1);)E.Lblock++;var W=(0,l.log2)(z),V=readBits((z<1<<W?W-1:W)+E.Lblock);T.push({codeblock:E,codingpasses:z,dataLength:V})}}alignToByte();S&&skipMarkerIfEqual(146);for(;T.length>0;){var K=T.shift();void 0===(E=K.codeblock).data&&(E.data=[]);E.data.push({data:r,start:o+d,end:o+d+K.dataLength,codingpasses:K.codingpasses});d+=K.dataLength}}}return d}function copyCoefficients(t,r,o,c,l,h,d,g,m){for(var y=c.tbx0,k=c.tby0,_=c.tbx1-c.tbx0,w=c.codeblocks,S="H"===c.type.charAt(0)?1:0,C="H"===c.type.charAt(1)?r:0,x=0,O=w.length;x<O;++x){var T=w[x],E=T.tbx1_-T.tbx0_,M=T.tby1_-T.tby0_;if(0!==E&&0!==M&&void 0!==T.data){var R=new v(E,M,T.subbandType,T.zeroBitPlanes,h),j=2,D=T.data,L=0,N=0,U=void 0,H=void 0,$=void 0;for(U=0,H=D.length;U<H;U++){L+=($=D[U]).end-$.start;N+=$.codingpasses}var X=new Uint8Array(L),q=0;for(U=0,H=D.length;U<H;U++){var G=($=D[U]).data.subarray($.start,$.end);X.set(G,q);q+=G.length}var z=new u.ArithmeticDecoder(X,0,L);R.setDecoder(z);for(U=0;U<N;U++){switch(j){case 0:R.runSignificancePropagationPass();break;case 1:R.runMagnitudeRefinementPass();break;case 2:R.runCleanupPass();g&&R.checkSegmentationSymbol()}m&&R.reset();j=(j+1)%3}var W=T.tbx0_-y+(T.tby0_-k)*_,V=R.coefficentsSign,K=R.coefficentsMagnitude,Y=R.bitsDecoded,J=d?0:.5,Z=void 0,Q=void 0,ee=void 0;q=0;var te="LL"!==c.type;for(U=0;U<M;U++){var re=2*(W/_|0)*(r-_)+S+C;for(Z=0;Z<E;Z++){if(0!==(Q=K[q])){Q=(Q+J)*l;0!==V[q]&&(Q=-Q);ee=Y[q];var ae=te?re+(W<<1):W;t[ae]=d&&ee>=h?Q:Q*(1<<h-ee)}W++;q++}W+=_-E}}}}function transformTile(t,r,o){for(var c=r.components[o],l=c.codingStyleParameters,u=c.quantizationParameters,h=l.decompositionLevelsCount,g=u.SPqcds,m=u.scalarExpounded,y=u.guardBits,v=l.segmentationSymbolUsed,k=l.resetContextProbabilities,S=t.components[o].precision,C=l.reversibleTransformation,x=C?new w:new _,O=[],T=0,E=0;E<=h;E++){for(var M=c.resolutions[E],R=M.trx1-M.trx0,j=M.try1-M.try0,D=new Float32Array(R*j),L=0,N=M.subbands.length;L<N;L++){var U=void 0,H=void 0;if(m){U=g[T].mu;H=g[T].epsilon;T++}else{U=g[0].mu;H=g[0].epsilon+(E>0?1-E:0)}var $=M.subbands[L],X=d[$.type];copyCoefficients(D,R,0,$,C?1:Math.pow(2,S+X-H)*(1+U/2048),y+H-1,C,v,k)}O.push({width:R,height:j,items:D})}var q=x.calculate(O,c.tcx0,c.tcy0);return{left:c.tcx0,top:c.tcy0,width:q.width,height:q.height,items:q.items}}function initializeTile(t,r){for(var o=t.SIZ.Csiz,c=t.tiles[r],l=0;l<o;l++){var u=c.components[l],h=void 0!==t.currentTile.QCC[l]?t.currentTile.QCC[l]:t.currentTile.QCD;u.quantizationParameters=h;var d=void 0!==t.currentTile.COC[l]?t.currentTile.COC[l]:t.currentTile.COD;u.codingStyleParameters=d}c.codingStyleDefaultParameters=t.currentTile.COD}var m=function(){function TagTree(t,r){_classCallCheck(this,TagTree);var o=(0,l.log2)(Math.max(t,r))+1;this.levels=[];for(var c=0;c<o;c++){var u={width:t,height:r,items:[]};this.levels.push(u);t=Math.ceil(t/2);r=Math.ceil(r/2)}}_createClass(TagTree,[{key:"reset",value:function reset(t,r){for(var o,c=0,l=0;c<this.levels.length;){var u=t+r*(o=this.levels[c]).width;if(void 0!==o.items[u]){l=o.items[u];break}o.index=u;t>>=1;r>>=1;c++}c--;(o=this.levels[c]).items[o.index]=l;this.currentLevel=c;delete this.value}},{key:"incrementValue",value:function incrementValue(){var t=this.levels[this.currentLevel];t.items[t.index]++}},{key:"nextLevel",value:function nextLevel(){var t=this.currentLevel,r=this.levels[t],o=r.items[r.index];if(--t<0){this.value=o;return!1}this.currentLevel=t;(r=this.levels[t]).items[r.index]=o;return!0}}]);return TagTree}(),y=function(){function InclusionTree(t,r,o){_classCallCheck(this,InclusionTree);var c=(0,l.log2)(Math.max(t,r))+1;this.levels=[];for(var u=0;u<c;u++){for(var h=new Uint8Array(t*r),d=0,g=h.length;d<g;d++)h[d]=o;var m={width:t,height:r,items:h};this.levels.push(m);t=Math.ceil(t/2);r=Math.ceil(r/2)}}_createClass(InclusionTree,[{key:"reset",value:function reset(t,r,o){for(var c=0;c<this.levels.length;){var l=this.levels[c],u=t+r*l.width;l.index=u;var h=l.items[u];if(255===h)break;if(h>o){this.currentLevel=c;this.propagateValues();return!1}t>>=1;r>>=1;c++}this.currentLevel=c-1;return!0}},{key:"incrementValue",value:function incrementValue(t){var r=this.levels[this.currentLevel];r.items[r.index]=t+1;this.propagateValues()}},{key:"propagateValues",value:function propagateValues(){for(var t=this.currentLevel,r=this.levels[t],o=r.items[r.index];--t>=0;)(r=this.levels[t]).items[r.index]=o}},{key:"nextLevel",value:function nextLevel(){var t=this.currentLevel,r=this.levels[t],o=r.items[r.index];r.items[r.index]=255;if(--t<0)return!1;this.currentLevel=t;(r=this.levels[t]).items[r.index]=o;return!0}}]);return InclusionTree}(),v=function BitModelClosure(){var t=17,r=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),o=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),c=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);return function(){function BitModel(t,l,u,h,d){_classCallCheck(this,BitModel);this.width=t;this.height=l;var g;g="HH"===u?c:"HL"===u?o:r;this.contextLabelTable=g;var m,y=t*l;this.neighborsSignificance=new Uint8Array(y);this.coefficentsSign=new Uint8Array(y);m=d>14?new Uint32Array(y):d>6?new Uint16Array(y):new Uint8Array(y);this.coefficentsMagnitude=m;this.processingFlags=new Uint8Array(y);var v=new Uint8Array(y);if(0!==h)for(var k=0;k<y;k++)v[k]=h;this.bitsDecoded=v;this.reset()}_createClass(BitModel,[{key:"setDecoder",value:function setDecoder(t){this.decoder=t}},{key:"reset",value:function reset(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6}},{key:"setNeighborsSignificance",value:function setNeighborsSignificance(t,r,o){var c,l=this.neighborsSignificance,u=this.width,h=this.height,d=r>0,g=r+1<u;if(t>0){c=o-u;d&&(l[c-1]+=16);g&&(l[c+1]+=16);l[c]+=4}if(t+1<h){c=o+u;d&&(l[c-1]+=16);g&&(l[c+1]+=16);l[c]+=4}d&&(l[o-1]+=1);g&&(l[o+1]+=1);l[o]|=128}},{key:"runSignificancePropagationPass",value:function runSignificancePropagationPass(){for(var t=this.decoder,r=this.width,o=this.height,c=this.coefficentsMagnitude,l=this.coefficentsSign,u=this.neighborsSignificance,h=this.processingFlags,d=this.contexts,g=this.contextLabelTable,m=this.bitsDecoded,y=0;y<o;y+=4)for(var v=0;v<r;v++)for(var k=y*r+v,_=0;_<4;_++,k+=r){var w=y+_;if(w>=o)break;h[k]&=-2;if(!c[k]&&u[k]){var S=g[u[k]];if(t.readBit(d,S)){var C=this.decodeSignBit(w,v,k);l[k]=C;c[k]=1;this.setNeighborsSignificance(w,v,k);h[k]|=2}m[k]++;h[k]|=1}}}},{key:"decodeSignBit",value:function decodeSignBit(t,r,o){var c,l,u,h,d,g,m=this.width,y=this.height,v=this.coefficentsMagnitude,k=this.coefficentsSign;h=r>0&&0!==v[o-1];if(r+1<m&&0!==v[o+1]){u=k[o+1];c=h?1-u-(l=k[o-1]):1-u-u}else c=h?1-(l=k[o-1])-l:0;var _=3*c;h=t>0&&0!==v[o-m];if(t+1<y&&0!==v[o+m]){u=k[o+m];c=h?1-u-(l=k[o-m])+_:1-u-u+_}else c=h?1-(l=k[o-m])-l+_:_;if(c>=0){d=9+c;g=this.decoder.readBit(this.contexts,d)}else{d=9-c;g=1^this.decoder.readBit(this.contexts,d)}return g}},{key:"runMagnitudeRefinementPass",value:function runMagnitudeRefinementPass(){for(var t,r=this.decoder,o=this.width,c=this.height,l=this.coefficentsMagnitude,u=this.neighborsSignificance,h=this.contexts,d=this.bitsDecoded,g=this.processingFlags,m=o*c,y=4*o,v=0;v<m;v=t){t=Math.min(m,v+y);for(var k=0;k<o;k++)for(var _=v+k;_<t;_+=o)if(l[_]&&0==(1&g[_])){var w=16;if(0!=(2&g[_])){g[_]^=2;w=0===(127&u[_])?15:14}var S=r.readBit(h,w);l[_]=l[_]<<1|S;d[_]++;g[_]|=1}}}},{key:"runCleanupPass",value:function runCleanupPass(){for(var r,o=this.decoder,c=this.width,l=this.height,u=this.neighborsSignificance,h=this.coefficentsMagnitude,d=this.coefficentsSign,g=this.contexts,m=this.contextLabelTable,y=this.bitsDecoded,v=this.processingFlags,k=c,_=2*c,w=3*c,S=0;S<l;S=r){r=Math.min(S+4,l);for(var C=S*c,x=S+3<l,O=0;O<c;O++){var T=C+O,E=0,M=T,R=S,j=void 0;if(x&&0===v[T]&&0===v[T+k]&&0===v[T+_]&&0===v[T+w]&&0===u[T]&&0===u[T+k]&&0===u[T+_]&&0===u[T+w]){if(!o.readBit(g,18)){y[T]++;y[T+k]++;y[T+_]++;y[T+w]++;continue}if(0!==(E=o.readBit(g,t)<<1|o.readBit(g,t))){R=S+E;M+=E*c}j=this.decodeSignBit(R,O,M);d[M]=j;h[M]=1;this.setNeighborsSignificance(R,O,M);v[M]|=2;M=T;for(var D=S;D<=R;D++,M+=c)y[M]++;E++}for(R=S+E;R<r;R++,M+=c)if(!h[M]&&0==(1&v[M])){var L=m[u[M]];if(1===o.readBit(g,L)){j=this.decodeSignBit(R,O,M);d[M]=j;h[M]=1;this.setNeighborsSignificance(R,O,M);v[M]|=2}y[M]++}}}}},{key:"checkSegmentationSymbol",value:function checkSegmentationSymbol(){var r=this.decoder,o=this.contexts;if(10!==(r.readBit(o,t)<<3|r.readBit(o,t)<<2|r.readBit(o,t)<<1|r.readBit(o,t)))throw new h("Invalid segmentation symbol")}}]);return BitModel}()}(),k=function(){function Transform(){_classCallCheck(this,Transform);this.constructor===Transform&&(0,c.unreachable)("Cannot initialize Transform.")}_createClass(Transform,[{key:"calculate",value:function calculate(t,r,o){for(var c=t[0],l=1,u=t.length;l<u;l++)c=this.iterate(c,t[l],r,o);return c}},{key:"extend",value:function extend(t,r,o){var c=r-1,l=r+1,u=r+o-2,h=r+o;t[c--]=t[l++];t[h++]=t[u--];t[c--]=t[l++];t[h++]=t[u--];t[c--]=t[l++];t[h++]=t[u--];t[c]=t[l];t[h]=t[u]}},{key:"filter",value:function filter(t,r,o){(0,c.unreachable)("Abstract method `filter` called")}},{key:"iterate",value:function iterate(t,r,o,c){var l,u,h,d,g,m,y=t.width,v=t.height,k=t.items,_=r.width,w=r.height,S=r.items;for(h=0,l=0;l<v;l++){d=2*l*_;for(u=0;u<y;u++,h++,d+=2)S[d]=k[h]}k=t.items=null;var C=new Float32Array(_+8);if(1===_){if(0!=(1&o))for(m=0,h=0;m<w;m++,h+=_)S[h]*=.5}else for(m=0,h=0;m<w;m++,h+=_){C.set(S.subarray(h,h+_),4);this.extend(C,4,_);this.filter(C,4,_);S.set(C.subarray(4,4+_),h)}var x=16,O=[];for(l=0;l<x;l++)O.push(new Float32Array(w+8));var T,E=0;t=4+w;if(1===w){if(0!=(1&c))for(g=0;g<_;g++)S[g]*=.5}else for(g=0;g<_;g++){if(0===E){x=Math.min(_-g,x);for(h=g,d=4;d<t;h+=_,d++)for(T=0;T<x;T++)O[T][d]=S[h+T];E=x}var M=O[--E];this.extend(M,4,w);this.filter(M,4,w);if(0===E){h=g-x+1;for(d=4;d<t;h+=_,d++)for(T=0;T<x;T++)S[h+T]=O[T][d]}}return{width:_,height:w,items:S}}}]);return Transform}(),_=function(t){_inherits(IrreversibleTransform,t);var r=_createSuper(IrreversibleTransform);function IrreversibleTransform(){_classCallCheck(this,IrreversibleTransform);return r.apply(this,arguments)}_createClass(IrreversibleTransform,[{key:"filter",value:function filter(t,r,o){var c,l,u,h,d=o>>1,g=-1.586134342059924,m=-.052980118572961,y=.882911075530934,v=.443506852043971,k=1.230174104914001;c=(r|=0)-3;for(l=d+4;l--;c+=2)t[c]*=.8128930661159609;u=v*t[(c=r-2)-1];for(l=d+3;l--;c+=2){h=v*t[c+1];t[c]=k*t[c]-u-h;if(!l--)break;u=v*t[(c+=2)+1];t[c]=k*t[c]-u-h}u=y*t[(c=r-1)-1];for(l=d+2;l--;c+=2){h=y*t[c+1];t[c]-=u+h;if(!l--)break;u=y*t[(c+=2)+1];t[c]-=u+h}u=m*t[(c=r)-1];for(l=d+1;l--;c+=2){h=m*t[c+1];t[c]-=u+h;if(!l--)break;u=m*t[(c+=2)+1];t[c]-=u+h}if(0!==d){u=g*t[(c=r+1)-1];for(l=d;l--;c+=2){h=g*t[c+1];t[c]-=u+h;if(!l--)break;u=g*t[(c+=2)+1];t[c]-=u+h}}}}]);return IrreversibleTransform}(k),w=function(t){_inherits(ReversibleTransform,t);var r=_createSuper(ReversibleTransform);function ReversibleTransform(){_classCallCheck(this,ReversibleTransform);return r.apply(this,arguments)}_createClass(ReversibleTransform,[{key:"filter",value:function filter(t,r,o){var c,l,u=o>>1;for(c=r|=0,l=u+1;l--;c+=2)t[c]-=t[c-1]+t[c+1]+2>>2;for(c=r+1,l=u;l--;c+=2)t[c]+=t[c-1]+t[c+1]>>1}}]);return ReversibleTransform}(k)},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.LZWStream=void 0;function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var c=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(LZWStream,t);var r=_createSuper(LZWStream);function LZWStream(t,o,c){var l;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,LZWStream);(l=r.call(this,o)).str=t;l.dict=t.dict;l.cachedData=0;l.bitsCached=0;for(var u=4096,h={earlyChange:c,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(u),dictionaryLengths:new Uint16Array(u),dictionaryPrevCodes:new Uint16Array(u),currentSequence:new Uint8Array(u),currentSequenceLength:0},d=0;d<256;++d){h.dictionaryValues[d]=d;h.dictionaryLengths[d]=1}l.lzwState=h;return l}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(LZWStream,[{key:"readBits",value:function readBits(t){for(var r=this.bitsCached,o=this.cachedData;r<t;){var c=this.str.getByte();if(-1===c){this.eof=!0;return null}o=o<<8|c;r+=8}this.bitsCached=r-=t;this.cachedData=o;this.lastCode=null;return o>>>r&(1<<t)-1}},{key:"readBlock",value:function readBlock(){var t,r,o,c=1024,l=this.lzwState;if(l){var u=l.earlyChange,h=l.nextCode,d=l.dictionaryValues,g=l.dictionaryLengths,m=l.dictionaryPrevCodes,y=l.codeLength,v=l.prevCode,k=l.currentSequence,_=l.currentSequenceLength,w=0,S=this.bufferLength,C=this.ensureBuffer(this.bufferLength+c);for(t=0;t<512;t++){var x=this.readBits(y),O=_>0;if(x<256){k[0]=x;_=1}else{if(!(x>=258)){if(256===x){y=9;h=258;_=0;continue}this.eof=!0;delete this.lzwState;break}if(x<h)for(r=(_=g[x])-1,o=x;r>=0;r--){k[r]=d[o];o=m[o]}else k[_++]=k[0]}if(O){m[h]=v;g[h]=g[v]+1;d[h]=k[0];y=++h+u&h+u-1?y:0|Math.min(Math.log(h+u)/.6931471805599453+1,12)}v=x;if(c<(w+=_)){do{c+=512}while(c<w);C=this.ensureBuffer(this.bufferLength+c)}for(r=0;r<_;r++)C[S++]=k[r]}l.nextCode=h;l.codeLength=y;l.prevCode=v;l.currentSequenceLength=_;this.bufferLength=S}}}]);return LZWStream}(o(170).DecodeStream);r.LZWStream=c},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.PredictorStream=void 0;var c=o(170),l=o(146),u=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(PredictorStream,t);var r=_createSuper(PredictorStream);function PredictorStream(t,o,c){var h;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,PredictorStream);h=r.call(this,o);if(!(c instanceof l.Dict))return _possibleConstructorReturn(h,t);var d=h.predictor=c.get("Predictor")||1;if(d<=1)return _possibleConstructorReturn(h,t);if(2!==d&&(d<10||d>15))throw new u.FormatError("Unsupported predictor: ".concat(d));h.readBlock=2===d?h.readBlockTiff:h.readBlockPng;h.str=t;h.dict=t.dict;var g=h.colors=c.get("Colors")||1,m=h.bits=c.get("BPC","BitsPerComponent")||8,y=h.columns=c.get("Columns")||1;h.pixBytes=g*m+7>>3;h.rowBytes=y*g*m+7>>3;return _possibleConstructorReturn(h,_assertThisInitialized(h))}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(PredictorStream,[{key:"readBlockTiff",value:function readBlockTiff(){var t=this.rowBytes,r=this.bufferLength,o=this.ensureBuffer(r+t),c=this.bits,l=this.colors,u=this.str.getBytes(t);this.eof=!u.length;if(!this.eof){var h,d=0,g=0,m=0,y=0,v=r;if(1===c&&1===l)for(h=0;h<t;++h){var k=u[h]^d;k^=k>>1;k^=k>>2;d=(1&(k^=k>>4))<<7;o[v++]=k}else if(8===c){for(h=0;h<l;++h)o[v++]=u[h];for(;h<t;++h){o[v]=o[v-l]+u[h];v++}}else if(16===c){var _=2*l;for(h=0;h<_;++h)o[v++]=u[h];for(;h<t;h+=2){var w=((255&u[h])<<8)+(255&u[h+1])+((255&o[v-_])<<8)+(255&o[v-_+1]);o[v++]=w>>8&255;o[v++]=255&w}}else{var S=new Uint8Array(l+1),C=(1<<c)-1,x=0,O=r,T=this.columns;for(h=0;h<T;++h)for(var E=0;E<l;++E){if(m<c){d=d<<8|255&u[x++];m+=8}S[E]=S[E]+(d>>m-c)&C;m-=c;g=g<<c|S[E];if((y+=c)>=8){o[O++]=g>>y-8&255;y-=8}}y>0&&(o[O++]=(g<<8-y)+(d&(1<<8-y)-1))}this.bufferLength+=t}}},{key:"readBlockPng",value:function readBlockPng(){var t=this.rowBytes,r=this.pixBytes,o=this.str.getByte(),c=this.str.getBytes(t);this.eof=!c.length;if(!this.eof){var l=this.bufferLength,h=this.ensureBuffer(l+t),d=h.subarray(l-t,l);0===d.length&&(d=new Uint8Array(t));var g,m,y,v=l;switch(o){case 0:for(g=0;g<t;++g)h[v++]=c[g];break;case 1:for(g=0;g<r;++g)h[v++]=c[g];for(;g<t;++g){h[v]=h[v-r]+c[g]&255;v++}break;case 2:for(g=0;g<t;++g)h[v++]=d[g]+c[g]&255;break;case 3:for(g=0;g<r;++g)h[v++]=(d[g]>>1)+c[g];for(;g<t;++g){h[v]=(d[g]+h[v-r]>>1)+c[g]&255;v++}break;case 4:for(g=0;g<r;++g){m=d[g];y=c[g];h[v++]=m+y}for(;g<t;++g){m=d[g];var k=d[g-r],_=h[v-r],w=_+m-k,S=w-_;S<0&&(S=-S);var C=w-m;C<0&&(C=-C);var x=w-k;x<0&&(x=-x);y=c[g];h[v++]=S<=C&&S<=x?_+y:C<=x?m+y:k+y}break;default:throw new u.FormatError("Unsupported predictor: ".concat(o))}this.bufferLength+=t}}}]);return PredictorStream}(c.DecodeStream);r.PredictorStream=h},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.RunLengthStream=void 0;function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var c=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(RunLengthStream,t);var r=_createSuper(RunLengthStream);function RunLengthStream(t,o){var c;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,RunLengthStream);(c=r.call(this,o)).str=t;c.dict=t.dict;return c}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(RunLengthStream,[{key:"readBlock",value:function readBlock(){var t=this.str.getBytes(2);if(!t||t.length<2||128===t[0])this.eof=!0;else{var r,o=this.bufferLength,c=t[0];if(c<128){(r=this.ensureBuffer(o+c+1))[o++]=t[1];if(c>0){var l=this.str.getBytes(c);r.set(l,o);o+=c}}else{c=257-c;var u=t[1];r=this.ensureBuffer(o+c+1);for(var h=0;h<c;h++)r[o++]=u}this.bufferLength=o}}}]);return RunLengthStream}(o(170).DecodeStream);r.RunLengthStream=c},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Font=r.ErrorFont=void 0;var c=o(4),l=o(186),u=o(159),h=o(162),d=o(161),g=o(160),m=o(188),y=o(189),v=o(190),k=o(191),_=o(192),w=o(193),S=o(167),C=o(194),x=o(149),O=o(151),T=o(195);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var E=[[57344,63743],[1048576,1114109]],M=1e3,R=["ascent","bbox","black","bold","charProcOperatorList","composite","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","fallbackName","fontMatrix","fontType","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","subtype","type","vertical"],j=["cMap","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","toFontChar","toUnicode","vmetrics","widths"];function adjustWidths(t){if(t.fontMatrix&&t.fontMatrix[0]!==c.FONT_IDENTITY_MATRIX[0]){var r=.001/t.fontMatrix[0],o=t.widths;for(var l in o)o[l]*=r;t.defaultWidth*=r}}function amendFallbackToUnicode(t){if(t.fallbackToUnicode&&!(t.toUnicode instanceof y.IdentityToUnicodeMap)){var r=[];for(var o in t.fallbackToUnicode)t.toUnicode.has(o)||(r[o]=t.fallbackToUnicode[o]);r.length>0&&t.toUnicode.amend(r)}}var D=function(){function Glyph(t,r,o,c,l,u,d,g,m){_classCallCheck(this,Glyph);this.originalCharCode=t;this.fontChar=r;this.unicode=o;this.accent=c;this.width=l;this.vmetric=u;this.operatorListId=d;this.isSpace=g;this.isInFont=m;var y=(0,h.getCharUnicodeCategory)(o);this.isWhitespace=y.isWhitespace;this.isZeroWidthDiacritic=y.isZeroWidthDiacritic;this.isInvisibleFormatMark=y.isInvisibleFormatMark}_createClass(Glyph,[{key:"matchesForCache",value:function matchesForCache(t,r,o,c,l,u,h,d,g){return this.originalCharCode===t&&this.fontChar===r&&this.unicode===o&&this.accent===c&&this.width===l&&this.vmetric===u&&this.operatorListId===h&&this.isSpace===d&&this.isInFont===g}}]);return Glyph}();function int16(t,r){return(t<<8)+r}function writeSignedInt16(t,r,o){t[r+1]=o;t[r]=o>>>8}function signedInt16(t,r){var o=(t<<8)+r;return 32768&o?o-65536:o}function string16(t){return String.fromCharCode(t>>8&255,255&t)}function safeString16(t){t>32767?t=32767:t<-32768&&(t=-32768);return String.fromCharCode(t>>8&255,255&t)}function isTrueTypeCollectionFile(t){var r=t.peekBytes(4);return"ttcf"===(0,c.bytesToString)(r)}function getFontFileType(t,r){var o,l,u=r.type,h=r.subtype,d=r.composite;if(function isTrueTypeFile(t){var r=t.peekBytes(4);return 65536===(0,x.readUint32)(r,0)||"true"===(0,c.bytesToString)(r)}(t)||isTrueTypeCollectionFile(t))o=d?"CIDFontType2":"TrueType";else if(function isOpenTypeFile(t){var r=t.peekBytes(4);return"OTTO"===(0,c.bytesToString)(r)}(t))o=d?"CIDFontType2":"OpenType";else if(function isType1File(t){var r=t.peekBytes(2);return 37===r[0]&&33===r[1]||128===r[0]&&1===r[1]}(t))o=d?"CIDFontType0":"MMType1"===u?"MMType1":"Type1";else if(function isCFFFile(t){var r=t.peekBytes(4);return r[0]>=1&&r[3]>=1&&r[3]<=4}(t))if(d){o="CIDFontType0";l="CIDFontType0C"}else{o="MMType1"===u?"MMType1":"Type1";l="Type1C"}else{(0,c.warn)("getFontFileType: Unable to detect correct font file Type/Subtype.");o=u;l=h}return[o,l]}function applyStandardFontGlyphMap(t,r){for(var o in r)t[+o]=r[o]}function buildToFontChar(t,r,o){for(var c,l=[],u=0,d=t.length;u<d;u++)-1!==(c=(0,h.getUnicodeForGlyph)(t[u],r))&&(l[u]=c);for(var g in o)-1!==(c=(0,h.getUnicodeForGlyph)(o[g],r))&&(l[+g]=c);return l}function convertCidString(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(r.length){case 1:return r.charCodeAt(0);case 2:return r.charCodeAt(0)<<8|r.charCodeAt(1)}var l="Unsupported CID string (charCode ".concat(t,'): "').concat(r,'".');if(o)throw new c.FormatError(l);(0,c.warn)(l);return r}function adjustMapping(t,r,o){var l=Object.create(null),u=[],h=0,d=E[h][0],g=E[h][1];for(var m in t){var y=t[m|=0];if(r(y)){if(d>g){if(++h>=E.length){(0,c.warn)("Ran out of space in font private use area.");break}d=E[h][0];g=E[h][1]}var v=d++;0===y&&(y=o);l[v]=y;u[m]=v}}return{toFontChar:u,charCodeToGlyphId:l,nextAvailableFontCharCode:d}}function createCmapTable(t,r){var o,l,u,h,d=function getRanges(t,r){var o=[];for(var c in t)t[c]>=r||o.push({fontCharCode:0|c,glyphId:t[c]});0===o.length&&o.push({fontCharCode:0,glyphId:0});o.sort((function fontGetRangesSort(t,r){return t.fontCharCode-r.fontCharCode}));for(var l=[],u=o.length,h=0;h<u;){var d=o[h].fontCharCode,g=[o[h].glyphId];++h;for(var m=d;h<u&&m+1===o[h].fontCharCode;){g.push(o[h].glyphId);++h;if(65535==++m)break}l.push([d,m,g])}return l}(t,r),g=d[d.length-1][1]>65535?2:1,m="\0\0"+string16(g)+"\0\0"+(0,c.string32)(4+8*g);for(o=d.length-1;o>=0&&!(d[o][0]<=65535);--o);var y=o+1;d[o][0]<65535&&65535===d[o][1]&&(d[o][1]=65534);var v,k,_,w,S=d[o][1]<65535?1:0,x=y+S,O=C.OpenTypeFileBuilder.getSearchParams(x,2),T="",E="",M="",R="",j="",D=0;for(o=0,l=y;o<l;o++){k=(v=d[o])[0];_=v[1];T+=string16(k);E+=string16(_);var L=!0;for(u=1,h=(w=v[2]).length;u<h;++u)if(w[u]!==w[u-1]+1){L=!1;break}if(L){M+=string16(w[0]-k&65535);R+=string16(0)}else{var N=2*(x-o)+2*D;D+=_-k+1;M+=string16(0);R+=string16(N);for(u=0,h=w.length;u<h;++u)j+=string16(w[u])}}if(S>0){E+="ÿÿ";T+="ÿÿ";M+="\0";R+="\0\0"}var U="\0\0"+string16(2*x)+string16(O.range)+string16(O.entry)+string16(O.rangeShift)+E+"\0\0"+T+M+R+j,H="",$="";if(g>1){m+="\0\0\n"+(0,c.string32)(4+8*g+4+U.length);H="";for(o=0,l=d.length;o<l;o++){k=(v=d[o])[0];var X=(w=v[2])[0];for(u=1,h=w.length;u<h;++u)if(w[u]!==w[u-1]+1){_=v[0]+u-1;H+=(0,c.string32)(k)+(0,c.string32)(_)+(0,c.string32)(X);k=_+1;X=w[u]}H+=(0,c.string32)(k)+(0,c.string32)(v[1])+(0,c.string32)(X)}$="\0\f\0\0"+(0,c.string32)(H.length+16)+"\0\0\0\0"+(0,c.string32)(H.length/12)}return m+"\0"+string16(U.length+4)+U+$+H}function createOS2Table(t,r,o){o=o||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};var l=0,u=0,d=0,g=0,m=null,y=0;if(r){for(var v in r){(m>(v|=0)||!m)&&(m=v);y<v&&(y=v);var k=(0,h.getUnicodeRangeFor)(v);if(k<32)l|=1<<k;else if(k<64)u|=1<<k-32;else if(k<96)d|=1<<k-64;else{if(!(k<123))throw new c.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");g|=1<<k-96}}y>65535&&(y=65535)}else{m=0;y=255}var _=t.bbox||[0,0,0,0],w=o.unitsPerEm||1/(t.fontMatrix||c.FONT_IDENTITY_MATRIX)[0],S=t.ascentScaled?1:w/M,C=o.ascent||Math.round(S*(t.ascent||_[3])),x=o.descent||Math.round(S*(t.descent||_[1]));x>0&&t.descent>0&&_[1]<0&&(x=-x);var O=o.yMax||C,T=-o.yMin||-x;return"\0$ô\0\0\0»\0\0\0»\0\0ß\x001\0\0\0\0"+String.fromCharCode(t.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,c.string32)(l)+(0,c.string32)(u)+(0,c.string32)(d)+(0,c.string32)(g)+"*21*"+string16(t.italicAngle?1:0)+string16(m||t.firstChar)+string16(y||t.lastChar)+string16(C)+string16(x)+"\0d"+string16(O)+string16(T)+"\0\0\0\0\0\0\0\0"+string16(t.xHeight)+string16(t.capHeight)+string16(0)+string16(m||t.firstChar)+"\0"}function createPostTable(t){var r=Math.floor(t.italicAngle*Math.pow(2,16));return"\0\0\0"+(0,c.string32)(r)+"\0\0\0\0"+(0,c.string32)(t.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(t){return t.replace(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(t,r){r||(r=[[],[]]);var o,c,l,u,h,d=[r[0][0]||"Original licence",r[0][1]||t,r[0][2]||"Unknown",r[0][3]||"uniqueID",r[0][4]||t,r[0][5]||"Version 0.11",r[0][6]||createPostscriptName(t),r[0][7]||"Unknown",r[0][8]||"Unknown",r[0][9]||"Unknown"],g=[];for(o=0,c=d.length;o<c;o++){var m=[];for(l=0,u=(h=r[1][o]||d[o]).length;l<u;l++)m.push(string16(h.charCodeAt(l)));g.push(m.join(""))}var y=[d,g],v=["\0","\0"],k=["\0\0","\0"],_=["\0\0","\t"],w=d.length*v.length,S="\0\0"+string16(w)+string16(12*w+6),C=0;for(o=0,c=v.length;o<c;o++){var x=y[o];for(l=0,u=x.length;l<u;l++){h=x[l];S+=v[o]+k[o]+_[o]+string16(l)+string16(h.length)+string16(C);C+=h.length}}return S+=d.join("")+g.join("")}var L=function(){function Font(t,r,o){_classCallCheck(this,Font);this.name=t;this.psName=null;this.mimetype=null;this.disableFontFace=!1;this.loadedName=o.loadedName;this.isType3Font=o.isType3Font;this.missingFile=!1;this.cssFontInfo=o.cssFontInfo;this._charsCache=Object.create(null);this._glyphCache=Object.create(null);var l=!!(o.flags&u.FontFlags.Serif);if(!l&&!o.isSimulatedFlags){var h,d=t.replace(/[,_]/g,"-").split("-")[0],g=(0,m.getSerifFonts)(),y=_createForOfIteratorHelper(d.split("+"));try{for(y.s();!(h=y.n()).done;){if(g[h.value]){l=!0;break}}}catch(t){y.e(t)}finally{y.f()}}this.isSerifFont=l;this.isSymbolicFont=!!(o.flags&u.FontFlags.Symbolic);this.isMonospace=!!(o.flags&u.FontFlags.FixedPitch);var k=o.type,_=o.subtype;this.type=k;this.subtype=_;var w="sans-serif";this.isMonospace?w="monospace":this.isSerifFont&&(w="serif");this.fallbackName=w;this.differences=o.differences;this.widths=o.widths;this.defaultWidth=o.defaultWidth;this.composite=o.composite;this.cMap=o.cMap;this.capHeight=o.capHeight/M;this.ascent=o.ascent/M;this.descent=o.descent/M;this.lineHeight=this.ascent-this.descent;this.fontMatrix=o.fontMatrix;this.bbox=o.bbox;this.defaultEncoding=o.defaultEncoding;this.toUnicode=o.toUnicode;this.toFontChar=[];if("Type3"!==o.type){this.cidEncoding=o.cidEncoding||"";this.vertical=!!o.vertical;if(this.vertical){this.vmetrics=o.vmetrics;this.defaultVMetrics=o.defaultVMetrics}if(r&&!r.isEmpty){var S,C=_slicedToArray(getFontFileType(r,o),2);k=C[0];_=C[1];k===this.type&&_===this.subtype||(0,c.info)("Inconsistent font file Type/SubType, expected: "+"".concat(this.type,"/").concat(this.subtype," but found: ").concat(k,"/").concat(_,"."));try{switch(k){case"MMType1":(0,c.info)("MMType1 font ("+t+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";var x="Type1C"===_||"CIDFontType0C"===_?new v.CFFFont(r,o):new T.Type1Font(t,r,o);adjustWidths(o);S=this.convert(t,x,o);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";S=this.checkAndRepair(t,r,o);if(this.isOpenType){adjustWidths(o);k="OpenType"}break;default:throw new c.FormatError("Font ".concat(k," is not supported"))}}catch(t){(0,c.warn)(t);this.fallbackToSystemFont(o);return}amendFallbackToUnicode(o);this.data=S;this.fontType=(0,u.getFontType)(k,_,o.isStandardFont);this.fontMatrix=o.fontMatrix;this.widths=o.widths;this.defaultWidth=o.defaultWidth;this.toUnicode=o.toUnicode;this.seacMap=o.seacMap}else{r&&(0,c.warn)('Font file is empty in "'+t+'" ('+this.loadedName+")");this.fallbackToSystemFont(o)}}else{for(var O=0;O<256;O++)this.toFontChar[O]=this.differences[O]||o.defaultEncoding[O];this.fontType=c.FontType.TYPE3}}_createClass(Font,[{key:"renderer",get:function get(){var t=k.FontRendererFactory.create(this,u.SEAC_ANALYSIS_ENABLED);return(0,c.shadow)(this,"renderer",t)}},{key:"exportData",value:function exportData(){var t,r,o,c=arguments.length>0&&void 0!==arguments[0]&&arguments[0],l=c?[].concat(R,j):R,u=Object.create(null),h=_createForOfIteratorHelper(l);try{for(h.s();!(o=h.n()).done;)void 0!==(r=this[t=o.value])&&(u[t]=r)}catch(t){h.e(t)}finally{h.f()}return u}},{key:"fallbackToSystemFont",value:function fallbackToSystemFont(t){var r=this;this.missingFile=!0;var o=this.name,l=this.type,v=this.subtype,k=(0,u.normalizeFontName)(o),w=(0,m.getStdFontMap)(),S=(0,m.getNonStdFontMap)(),C=!!w[k],x=!(!S[k]||!w[S[k]]);k=w[k]||S[k]||k;var O=(0,_.getFontBasicMetrics)()[k];if(O){isNaN(this.ascent)&&(this.ascent=O.ascent/M);isNaN(this.descent)&&(this.descent=O.descent/M);isNaN(this.capHeight)&&(this.capHeight=O.capHeight/M)}this.bold=-1!==k.search(/bold/gi);this.italic=-1!==k.search(/oblique/gi)||-1!==k.search(/italic/gi);this.black=-1!==o.search(/Black/g);var T=-1!==o.search(/Narrow/g);this.remeasure=(!C||T)&&Object.keys(this.widths).length>0;if((C||x)&&"CIDFontType2"===l&&this.cidEncoding.startsWith("Identity-")){var E=t.cidToGidMap,R=[];applyStandardFontGlyphMap(R,(0,m.getGlyphMapForStandardFonts)());/Arial-?Black/i.test(o)?applyStandardFontGlyphMap(R,(0,m.getSupplementalGlyphMapForArialBlack)()):/Calibri/i.test(o)&&applyStandardFontGlyphMap(R,(0,m.getSupplementalGlyphMapForCalibri)());if(E){for(var j in R){var D=R[j];void 0!==E[D]&&(R[+j]=E[D])}E.length!==this.toUnicode.length&&t.hasIncludedToUnicodeMap&&this.toUnicode instanceof y.IdentityToUnicodeMap&&this.toUnicode.forEach((function(t,r){var o=R[t];void 0===E[o]&&(R[+t]=r)}))}this.toUnicode instanceof y.IdentityToUnicodeMap||this.toUnicode.forEach((function(t,r){R[+t]=r}));this.toFontChar=R;this.toUnicode=new y.ToUnicodeMap(R)}else if(/Symbol/i.test(k))this.toFontChar=buildToFontChar(g.SymbolSetEncoding,(0,d.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(k)){/Wingdings/i.test(o)&&(0,c.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats.");this.toFontChar=buildToFontChar(g.ZapfDingbatsEncoding,(0,d.getDingbatsGlyphsUnicode)(),this.differences)}else if(C){var L=buildToFontChar(this.defaultEncoding,(0,d.getGlyphsUnicode)(),this.differences);"CIDFontType2"!==l||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof y.IdentityToUnicodeMap||this.toUnicode.forEach((function(t,r){L[+t]=r}));this.toFontChar=L}else{var N=(0,d.getGlyphsUnicode)(),U=[];this.toUnicode.forEach((function(t,o){if(!r.composite){var c=r.differences[t]||r.defaultEncoding[t],l=(0,h.getUnicodeForGlyph)(c,N);-1!==l&&(o=l)}U[+t]=o}));this.composite&&this.toUnicode instanceof y.IdentityToUnicodeMap&&/Verdana/i.test(o)&&applyStandardFontGlyphMap(U,(0,m.getGlyphMapForStandardFonts)());this.toFontChar=U}amendFallbackToUnicode(t);this.loadedName=k.split("-")[0];this.fontType=(0,u.getFontType)(l,v,t.isStandardFont)}},{key:"checkAndRepair",value:function checkAndRepair(t,r,o){var h=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(t,r){var o=Object.create(null);o["OS/2"]=null;o.cmap=null;o.head=null;o.hhea=null;o.hmtx=null;o.maxp=null;o.name=null;o.post=null;for(var c=0;c<r;c++){var l=readTableEntry(t);h.includes(l.tag)&&(0!==l.length&&(o[l.tag]=l))}return o}function readTableEntry(t){var r=t.getString(4),o=t.getInt32()>>>0,c=t.getInt32()>>>0,l=t.getInt32()>>>0,u=t.pos;t.pos=t.start?t.start:0;t.skip(c);var h=t.getBytes(l);t.pos=u;if("head"===r){h[8]=h[9]=h[10]=h[11]=0;h[17]|=32}return{tag:r,checksum:o,length:l,offset:c,data:h}}function readOpenTypeHeader(t){return{version:t.getString(4),numTables:t.getUint16(),searchRange:t.getUint16(),entrySelector:t.getUint16(),rangeShift:t.getUint16()}}function sanitizeGlyph(t,r,o,c,l,u){var h={length:0,sizeOfInstructions:0};if(o-r<=12)return h;var d=t.subarray(r,o),g=signedInt16(d[0],d[1]);if(g<0){writeSignedInt16(d,0,g=-1);c.set(d,l);h.length=d.length;return h}var m,y=10,v=0;for(m=0;m<g;m++){v=(d[y]<<8|d[y+1])+1;y+=2}var k=y,_=d[y]<<8|d[y+1];h.sizeOfInstructions=_;var w=y+=2+_,S=0;for(m=0;m<v;m++){var C=d[y++];192&C&&(d[y-1]=63&C);var x=2;2&C?x=1:16&C&&(x=0);var O=2;4&C?O=1:32&C&&(O=0);var T=x+O;S+=T;if(8&C){var E=d[y++];m+=E;S+=E*T}}if(0===S)return h;var M=y+S;if(M>d.length)return h;if(!u&&_>0){c.set(d.subarray(0,k),l);c.set([0,0],l+k);c.set(d.subarray(w,M),l+k+2);M-=_;d.length-M>3&&(M=M+3&-4);h.length=M;return h}if(d.length-M>3){M=M+3&-4;c.set(d.subarray(0,M),l);h.length=M;return h}c.set(d,l);h.length=d.length;return h}function readNameTable(t){var o=(r.start?r.start:0)+t.offset;r.pos=o;var c=[[],[]],l=t.length,u=o+l;if(0!==r.getUint16()||l<6)return c;var h,d,g=r.getUint16(),m=r.getUint16(),y=[];for(h=0;h<g&&r.pos+12<=u;h++){var v={platform:r.getUint16(),encoding:r.getUint16(),language:r.getUint16(),name:r.getUint16(),length:r.getUint16(),offset:r.getUint16()};(1===v.platform&&0===v.encoding&&0===v.language||3===v.platform&&1===v.encoding&&1033===v.language)&&y.push(v)}for(h=0,d=y.length;h<d;h++){var k=y[h];if(!(k.length<=0)){var _=o+m+k.offset;if(!(_+k.length>u)){r.pos=_;var w=k.name;if(k.encoding){for(var S="",C=0,x=k.length;C<x;C+=2)S+=String.fromCharCode(r.getUint16());c[1][w]=S}else c[0][w]=r.getString(k.length)}}}return c}var m,k,_,x,T=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(t,r){for(var o,l,u,h,d,g=t.data,m=0,y=0,v=0,k=[],_=[],w=[],S=r.tooComplexToFollowFunctions,C=!1,x=0,O=0,E=g.length;m<E;){var M=g[m++];if(64===M){l=g[m++];if(C||O)m+=l;else for(o=0;o<l;o++)k.push(g[m++])}else if(65===M){l=g[m++];if(C||O)m+=2*l;else for(o=0;o<l;o++){u=g[m++];k.push(u<<8|g[m++])}}else if(176==(248&M)){l=M-176+1;if(C||O)m+=l;else for(o=0;o<l;o++)k.push(g[m++])}else if(184==(248&M)){l=M-184+1;if(C||O)m+=2*l;else for(o=0;o<l;o++){u=g[m++];k.push(u<<8|g[m++])}}else if(43!==M||S)if(44!==M||S){if(45===M)if(C){C=!1;y=m}else{if(!(d=_.pop())){(0,c.warn)("TT: ENDF bad stack");r.hintsValid=!1;return}h=w.pop();g=d.data;m=d.i;r.functionsStackDeltas[h]=k.length-d.stackTop}else if(137===M){if(C||O){(0,c.warn)("TT: nested IDEFs not allowed");S=!0}C=!0;v=m}else if(88===M)++x;else if(27===M)O=x;else if(89===M){O===x&&(O=0);--x}else if(28===M&&!C&&!O){var R=k[k.length-1];R>0&&(m+=R-1)}}else{if(C||O){(0,c.warn)("TT: nested FDEFs not allowed");S=!0}C=!0;v=m;h=k.pop();r.functionsDefined[h]={data:g,i:m}}else if(!C&&!O){h=k[k.length-1];if(isNaN(h))(0,c.info)("TT: CALL empty stack (or invalid entry).");else{r.functionsUsed[h]=!0;if(h in r.functionsStackDeltas){var j=k.length+r.functionsStackDeltas[h];if(j<0){(0,c.warn)("TT: CALL invalid functions stack delta.");r.hintsValid=!1;return}k.length=j}else if(h in r.functionsDefined&&!w.includes(h)){_.push({data:g,i:m,stackTop:k.length-1});w.push(h);if(!(d=r.functionsDefined[h])){(0,c.warn)("TT: CALL non-existent function");r.hintsValid=!1;return}g=d.data;m=d.i}}}if(!C&&!O){var D=0;M<=142?D=T[M]:M>=192&&M<=223?D=-1:M>=224&&(D=-2);if(M>=113&&M<=117){l=k.pop();isNaN(l)||(D=2*-l)}for(;D<0&&k.length>0;){k.pop();D++}for(;D>0;){k.push(NaN);D--}}}r.tooComplexToFollowFunctions=S;var L=[g];m>g.length&&L.push(new Uint8Array(m-g.length));if(v>y){(0,c.warn)("TT: complementing a missing function tail");L.push(new Uint8Array([34,45]))}!function foldTTTable(t,r){if(r.length>1){var o,c,l=0;for(o=0,c=r.length;o<c;o++)l+=r[o].length;l=l+3&-4;var u=new Uint8Array(l),h=0;for(o=0,c=r.length;o<c;o++){u.set(r[o],h);h+=r[o].length}t.data=u;t.length=l}}(t,L)}if(isTrueTypeCollectionFile(r=new O.Stream(new Uint8Array(r.getBytes())))){var E=function readTrueTypeCollectionData(t,r){for(var o,l=function readTrueTypeCollectionHeader(t){var r=t.getString(4);(0,c.assert)("ttcf"===r,"Must be a TrueType Collection font.");for(var o=t.getUint16(),l=t.getUint16(),u=t.getInt32()>>>0,h=[],d=0;d<u;d++)h.push(t.getInt32()>>>0);var g={ttcTag:r,majorVersion:o,minorVersion:l,numFonts:u,offsetTable:h};switch(o){case 1:return g;case 2:g.dsigTag=t.getInt32()>>>0;g.dsigLength=t.getInt32()>>>0;g.dsigOffset=t.getInt32()>>>0;return g}throw new c.FormatError("Invalid TrueType Collection majorVersion: ".concat(o,"."))}(t),u=l.numFonts,h=l.offsetTable,d=r.split("+"),g=0;g<u;g++){t.pos=(t.start||0)+h[g];var m=readOpenTypeHeader(t),y=readTables(t,m.numTables);if(!y.name)throw new c.FormatError('TrueType Collection font must contain a "name" table.');for(var v=readNameTable(y.name),k=0,_=v.length;k<_;k++)for(var w=0,S=v[k].length;w<S;w++){var C=v[k][w]&&v[k][w].replace(/\s/g,"");if(C){if(C===r)return{header:m,tables:y};if(!(d.length<2)){var x,O=_createForOfIteratorHelper(d);try{for(O.s();!(x=O.n()).done;){var T=x.value;C===T&&(o={name:T,header:m,tables:y})}}catch(t){O.e(t)}finally{O.f()}}}}}if(o){(0,c.warn)('TrueType Collection does not contain "'.concat(r,'" font, ')+'falling back to "'.concat(o.name,'" font instead.'));return{header:o.header,tables:o.tables}}throw new c.FormatError('TrueType Collection does not contain "'.concat(r,'" font.'))}(r,this.name);m=E.header;k=E.tables}else{m=readOpenTypeHeader(r);k=readTables(r,m.numTables)}var M=!k["CFF "];if(M){if(!k.loca)throw new c.FormatError('Required "loca" table is not found');if(!k.glyf){(0,c.warn)('Required "glyf" table is not found -- trying to recover.');k.glyf={tag:"glyf",data:new Uint8Array(0)}}this.isOpenType=!1}else{var R=o.composite&&((o.cidToGidMap||[]).length>0||!(o.cMap instanceof S.IdentityCMap));if("OTTO"===m.version&&!R||!k.head||!k.hhea||!k.maxp||!k.post){x=new O.Stream(k["CFF "].data);_=new v.CFFFont(x,o);adjustWidths(o);return this.convert(t,_,o)}delete k.glyf;delete k.loca;delete k.fpgm;delete k.prep;delete k["cvt "];this.isOpenType=!0}if(!k.maxp)throw new c.FormatError('Required "maxp" table is not found');r.pos=(r.start||0)+k.maxp.offset;var j=r.getInt32(),D=r.getUint16();if(o.scaleFactors&&o.scaleFactors.length===D&&M){var L=o.scaleFactors,N=int16(k.head.data[50],k.head.data[51]),U=new w.GlyfTable({glyfTable:k.glyf.data,isGlyphLocationsLong:N,locaTable:k.loca.data,numGlyphs:D});U.scale(L);var H=U.write(),$=H.glyf,X=H.loca,q=H.isLocationLong;k.glyf.data=$;k.loca.data=X;if(q!==!!N){k.head.data[50]=0;k.head.data[51]=q?1:0}for(var G=k.hmtx.data,z=0;z<D;z++){var W=4*z,V=Math.round(L[z]*int16(G[W],G[W+1]));G[W]=V>>8&255;G[W+1]=255&V;writeSignedInt16(G,W+2,Math.round(L[z]*signedInt16(G[W+2],G[W+3])))}}var K=D+1,Y=!0;if(K>65535){Y=!1;K=D;(0,c.warn)("Not enough space in glyfs to duplicate first glyph.")}var J=0,Z=0;if(j>=65536&&k.maxp.length>=22){r.pos+=8;if(r.getUint16()>2){k.maxp.data[14]=0;k.maxp.data[15]=2}r.pos+=4;J=r.getUint16();r.pos+=4;Z=r.getUint16()}k.maxp.data[4]=K>>8;k.maxp.data[5]=255&K;var Q=function sanitizeTTPrograms(t,r,o,l){var u={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};t&&sanitizeTTProgram(t,u);r&&sanitizeTTProgram(r,u);t&&function checkInvalidFunctions(t,r){if(!t.tooComplexToFollowFunctions)if(t.functionsDefined.length>r){(0,c.warn)("TT: more functions defined than expected");t.hintsValid=!1}else for(var o=0,l=t.functionsUsed.length;o<l;o++){if(o>r){(0,c.warn)("TT: invalid function id: "+o);t.hintsValid=!1;return}if(t.functionsUsed[o]&&!t.functionsDefined[o]){(0,c.warn)("TT: undefined function: "+o);t.hintsValid=!1;return}}}(u,l);if(o&&1&o.length){var h=new Uint8Array(o.length+1);h.set(o.data);o.data=h}return u.hintsValid}(k.fpgm,k.prep,k["cvt "],J);if(!Q){delete k.fpgm;delete k.prep;delete k["cvt "]}!function sanitizeMetrics(t,r,o,l,u,h){if(r){t.pos=(t.start?t.start:0)+r.offset;t.pos+=4;t.pos+=2;t.pos+=2;t.pos+=2;t.pos+=2;t.pos+=2;t.pos+=2;t.pos+=2;t.pos+=2;t.pos+=2;var d=t.getUint16();t.pos+=8;t.pos+=2;var g=t.getUint16();if(0!==d){if(!(2&int16(l.data[44],l.data[45]))){r.data[22]=0;r.data[23]=0}}if(g>u){(0,c.info)("The numOfMetrics (".concat(g,") should not be ")+"greater than the numGlyphs (".concat(u,")."));g=u;r.data[34]=(65280&g)>>8;r.data[35]=255&g}var m=u-g-(o.length-4*g>>1);if(m>0){var y=new Uint8Array(o.length+2*m);y.set(o.data);if(h){y[o.length]=o.data[2];y[o.length+1]=o.data[3]}o.data=y}}else o&&(o.data=null)}(r,k.hhea,k.hmtx,k.head,K,Y);if(!k.head)throw new c.FormatError('Required "head" table is not found');!function sanitizeHead(t,r,o){var l=t.data,u=function int32(t,r,o,c){return(t<<24)+(r<<16)+(o<<8)+c}(l[0],l[1],l[2],l[3]);if(u>>16!=1){(0,c.info)("Attempting to fix invalid version in head table: "+u);l[0]=0;l[1]=1;l[2]=0;l[3]=0}var h=int16(l[50],l[51]);if(h<0||h>1){(0,c.info)("Attempting to fix invalid indexToLocFormat in head table: "+h);var d=r+1;if(o===d<<1){l[50]=0;l[51]=0}else{if(o!==d<<2)throw new c.FormatError("Could not fix indexToLocFormat: "+h);l[50]=0;l[51]=1}}}(k.head,D,M?k.loca.length:0);var ee=Object.create(null);if(M){var te=int16(k.head.data[50],k.head.data[51]),re=function sanitizeGlyphLocations(t,r,o,c,l,u,h){var d,g,m;if(c){d=4;g=function fontItemDecodeLong(t,r){return t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3]};m=function fontItemEncodeLong(t,r,o){t[r]=o>>>24&255;t[r+1]=o>>16&255;t[r+2]=o>>8&255;t[r+3]=255&o}}else{d=2;g=function fontItemDecode(t,r){return t[r]<<9|t[r+1]<<1};m=function fontItemEncode(t,r,o){t[r]=o>>9&255;t[r+1]=o>>1&255}}var y=u?o+1:o,v=d*(1+y),k=new Uint8Array(v);k.set(t.data.subarray(0,v));t.data=k;var _,w,S=r.data,C=S.length,x=new Uint8Array(C),O=[];for(_=0,w=0;_<o+1;_++,w+=d){var T=g(k,w);T>C&&(T=C);O.push({index:_,offset:T,endOffset:0})}O.sort((function(t,r){return t.offset-r.offset}));for(_=0;_<o;_++)O[_].endOffset=O[_+1].offset;O.sort((function(t,r){return t.index-r.index}));for(_=0;_<o;_++){var E=O[_],M=E.offset,R=E.endOffset;if(0!==M||0!==R)break;var j=O[_+1].offset;if(0!==j){O[_].endOffset=j;break}}var D=Object.create(null),L=0;m(k,0,L);for(_=0,w=d;_<o;_++,w+=d){var N=sanitizeGlyph(S,O[_].offset,O[_].endOffset,x,L,l),U=N.length;0===U&&(D[_]=!0);N.sizeOfInstructions>h&&(h=N.sizeOfInstructions);m(k,w,L+=U)}if(0===L){var H=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(_=0,w=d;_<y;_++,w+=d)m(k,w,H.length);r.data=H}else if(u){var $=g(k,d);if(x.length>$+L)r.data=x.subarray(0,$+L);else{r.data=new Uint8Array($+L);r.data.set(x.subarray(0,L))}r.data.set(x.subarray(0,$),L);m(t.data,k.length-d,L+$)}else r.data=x.subarray(0,L);return{missingGlyphs:D,maxSizeOfInstructions:h}}(k.loca,k.glyf,D,te,Q,Y,Z);ee=re.missingGlyphs;if(j>=65536&&k.maxp.length>=22){k.maxp.data[26]=re.maxSizeOfInstructions>>8;k.maxp.data[27]=255&re.maxSizeOfInstructions}}if(!k.hhea)throw new c.FormatError('Required "hhea" table is not found');if(0===k.hhea.data[10]&&0===k.hhea.data[11]){k.hhea.data[10]=255;k.hhea.data[11]=255}var ae={unitsPerEm:int16(k.head.data[18],k.head.data[19]),yMax:int16(k.head.data[42],k.head.data[43]),yMin:signedInt16(k.head.data[38],k.head.data[39]),ascent:signedInt16(k.hhea.data[4],k.hhea.data[5]),descent:signedInt16(k.hhea.data[6],k.hhea.data[7]),lineGap:signedInt16(k.hhea.data[8],k.hhea.data[9])};this.ascent=ae.ascent/ae.unitsPerEm;this.descent=ae.descent/ae.unitsPerEm;this.lineGap=ae.lineGap/ae.unitsPerEm;if(this.cssFontInfo&&this.cssFontInfo.lineHeight){this.lineHeight=this.cssFontInfo.metrics.lineHeight;this.lineGap=this.cssFontInfo.metrics.lineGap}else this.lineHeight=this.ascent-this.descent+this.lineGap;k.post&&function readPostScriptTable(t,o,l){var h=(r.start?r.start:0)+t.offset;r.pos=h;var d,g=h+t.length,m=r.getInt32();r.skip(28);var y,v=!0;switch(m){case 65536:d=u.MacStandardGlyphOrdering;break;case 131072:var k=r.getUint16();if(k!==l){v=!1;break}var _=[];for(y=0;y<k;++y){var w=r.getUint16();if(w>=32768){v=!1;break}_.push(w)}if(!v)break;for(var S=[],C=[];r.pos<g;){var x=r.getByte();C.length=x;for(y=0;y<x;++y)C[y]=String.fromCharCode(r.getByte());S.push(C.join(""))}d=[];for(y=0;y<k;++y){var O=_[y];O<258?d.push(u.MacStandardGlyphOrdering[O]):d.push(S[O-258])}break;case 196608:break;default:(0,c.warn)("Unknown/unsupported post table version "+m);v=!1;o.defaultEncoding&&(d=o.defaultEncoding)}o.glyphNames=d;return v}(k.post,o,D);k.post={tag:"post",data:createPostTable(o)};var ne=[];function hasGlyph(t){return!ee[t]}if(o.composite){var ie=o.cidToGidMap||[],oe=0===ie.length;o.cMap.forEach((function(t,r){"string"==typeof r&&(r=convertCidString(t,r,!0));if(r>65535)throw new c.FormatError("Max size of CID is 65,535");var o=-1;oe?o=r:void 0!==ie[r]&&(o=ie[r]);o>=0&&o<D&&hasGlyph(o)&&(ne[t]=o)}))}else{var se=function readCmapTable(t,r,o,l){if(!t){(0,c.warn)("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}var u,h=(r.start?r.start:0)+t.offset;r.pos=h;r.skip(2);for(var d,g=r.getUint16(),m=!1,y=0;y<g;y++){var v=r.getUint16(),k=r.getUint16(),_=r.getInt32()>>>0,w=!1;if(!d||d.platformId!==v||d.encodingId!==k){if(0!==v||0!==k&&1!==k&&3!==k)if(1===v&&0===k)w=!0;else if(3!==v||1!==k||!l&&d){if(o&&3===v&&0===k){w=!0;var S=!0;if(y<g-1){var C=r.peekBytes(2);int16(C[0],C[1])<v&&(S=!1)}S&&(m=!0)}}else{w=!0;o||(m=!0)}else w=!0;w&&(d={platformId:v,encodingId:k,offset:_});if(m)break}}d&&(r.pos=h+d.offset);if(!d||-1===r.peekByte()){(0,c.warn)("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}var x=r.getUint16();r.skip(4);var O,T,E=!1,M=[];if(0===x){for(O=0;O<256;O++){var R=r.getByte();R&&M.push({charCode:O,glyphId:R})}E=!0}else if(2===x){for(var j=[],D=0,L=0;L<256;L++){var N=r.getUint16()>>3;j.push(N);D=Math.max(N,D)}for(var U=[],H=0;H<=D;H++)U.push({firstCode:r.getUint16(),entryCount:r.getUint16(),idDelta:signedInt16(r.getByte(),r.getByte()),idRangePos:r.pos+r.getUint16()});for(var $=0;$<256;$++)if(0===j[$]){r.pos=U[0].idRangePos+2*$;T=r.getUint16();M.push({charCode:$,glyphId:T})}else{var X=U[j[$]];for(O=0;O<X.entryCount;O++){var q=($<<8)+O+X.firstCode;r.pos=X.idRangePos+2*O;0!==(T=r.getUint16())&&(T=(T+X.idDelta)%65536);M.push({charCode:q,glyphId:T})}}}else if(4===x){var G=r.getUint16()>>1;r.skip(6);var z,W=[];for(z=0;z<G;z++)W.push({end:r.getUint16()});r.skip(2);for(z=0;z<G;z++)W[z].start=r.getUint16();for(z=0;z<G;z++)W[z].delta=r.getUint16();var V,K=0;for(z=0;z<G;z++){u=W[z];var Y=r.getUint16();if(Y){V=(Y>>1)-(G-z);u.offsetIndex=V;K=Math.max(K,V+u.end-u.start+1)}else u.offsetIndex=-1}var J=[];for(O=0;O<K;O++)J.push(r.getUint16());for(z=0;z<G;z++){h=(u=W[z]).start;var Z=u.end,Q=u.delta;V=u.offsetIndex;for(O=h;O<=Z;O++)if(65535!==O){T=(T=V<0?O:J[V+O-h])+Q&65535;M.push({charCode:O,glyphId:T})}}}else{if(6!==x){(0,c.warn)("cmap table has unsupported format: "+x);return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}var ee=r.getUint16(),te=r.getUint16();for(O=0;O<te;O++){T=r.getUint16();var re=ee+O;M.push({charCode:re,glyphId:T})}}M.sort((function(t,r){return t.charCode-r.charCode}));for(var ae=1;ae<M.length;ae++)if(M[ae-1].charCode===M[ae].charCode){M.splice(ae,1);ae--}return{platformId:d.platformId,encodingId:d.encodingId,mappings:M,hasShortCmap:E}}(k.cmap,r,this.isSymbolicFont,o.hasEncoding),ce=se.platformId,le=se.encodingId,ue=se.mappings,fe=ue.length,he=[],de=!1;!o.hasEncoding||"MacRomanEncoding"!==o.baseEncodingName&&"WinAnsiEncoding"!==o.baseEncodingName||(he=(0,g.getEncoding)(o.baseEncodingName));if(o.hasEncoding&&!this.isSymbolicFont&&(3===ce&&1===le||1===ce&&0===le))for(var pe=(0,d.getGlyphsUnicode)(),ge=0;ge<256;ge++){var me=void 0;if(me=void 0!==this.differences[ge]?this.differences[ge]:he.length&&""!==he[ge]?he[ge]:g.StandardEncoding[ge]){var ye=(0,u.recoverGlyphName)(me,pe),ve=void 0;3===ce&&1===le?ve=pe[ye]:1===ce&&0===le&&(ve=g.MacRomanEncoding.indexOf(ye));if(void 0===ve){if(!o.glyphNames&&o.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof y.IdentityToUnicodeMap)){var be=this.toUnicode.get(ge);be&&(ve=be.codePointAt(0))}if(void 0===ve)continue}for(var ke=0;ke<fe;++ke)if(ue[ke].charCode===ve){ne[ge]=ue[ke].glyphId;break}}}else if(0===ce){for(var _e=0;_e<fe;++_e)ne[ue[_e].charCode]=ue[_e].glyphId;de=!0}else for(var we=0;we<fe;++we){var Se=ue[we].charCode;3===ce&&Se>=61440&&Se<=61695&&(Se&=255);ne[Se]=ue[we].glyphId}if(o.glyphNames&&(he.length||this.differences.length))for(var Ce=0;Ce<256;++Ce)if(de||void 0===ne[Ce]){var xe=this.differences[Ce]||he[Ce];if(xe){var Oe=o.glyphNames.indexOf(xe);Oe>0&&hasGlyph(Oe)&&(ne[Ce]=Oe)}}}0===ne.length&&(ne[0]=0);var Ae=K-1;Y||(Ae=0);if(!o.cssFontInfo){var Pe=adjustMapping(ne,hasGlyph,Ae);this.toFontChar=Pe.toFontChar;k.cmap={tag:"cmap",data:createCmapTable(Pe.charCodeToGlyphId,K)};k["OS/2"]&&function validateOS2Table(t,r){r.pos=(r.start||0)+t.offset;var o=r.getUint16();r.skip(60);var c=r.getUint16();if(o<4&&768&c)return!1;if(r.getUint16()>r.getUint16())return!1;r.skip(6);if(0===r.getUint16())return!1;t.data[8]=t.data[9]=0;return!0}(k["OS/2"],r)||(k["OS/2"]={tag:"OS/2",data:createOS2Table(o,Pe.charCodeToGlyphId,ae)})}if(!M)try{x=new O.Stream(k["CFF "].data);(_=new l.CFFParser(x,o,u.SEAC_ANALYSIS_ENABLED).parse()).duplicateFirstGlyph();var Te=new l.CFFCompiler(_);k["CFF "].data=Te.compile()}catch(t){(0,c.warn)("Failed to compile font "+o.loadedName)}if(k.name){var Fe=readNameTable(k.name);k.name.data=createNameTable(t,Fe);this.psName=Fe[0][6]||null}else k.name={tag:"name",data:createNameTable(this.name)};var Ie=new C.OpenTypeFileBuilder(m.version);for(var Ee in k)Ie.addTable(Ee,k[Ee].data);return Ie.toArray()}},{key:"convert",value:function convert(t,r,o){o.fixedPitch=!1;o.builtInEncoding&&function adjustToUnicode(t,r){if(!(t.isInternalFont||r===t.defaultEncoding||t.toUnicode instanceof y.IdentityToUnicodeMap)){var o=[],c=(0,d.getGlyphsUnicode)();for(var l in r){if(t.hasIncludedToUnicodeMap){if(t.toUnicode.has(l))continue}else if(t.hasEncoding&&(0===t.differences.length||void 0!==t.differences[l]))continue;var u=r[l],g=(0,h.getUnicodeForGlyph)(u,c);-1!==g&&(o[l]=String.fromCharCode(g))}o.length>0&&t.toUnicode.amend(o)}}(o,o.builtInEncoding);var l=1;r instanceof v.CFFFont&&(l=r.numGlyphs-1);var m=r.getGlyphMapping(o),k=null,_=m;if(!o.cssFontInfo){k=adjustMapping(m,r.hasGlyphId.bind(r),l);this.toFontChar=k.toFontChar;_=k.charCodeToGlyphId}var w=r.numGlyphs;function getCharCodes(t,r){var o=null;for(var c in t)if(r===t[c]){o||(o=[]);o.push(0|c)}return o}function createCharCode(t,r){for(var o in t)if(r===t[o])return 0|o;k.charCodeToGlyphId[k.nextAvailableFontCharCode]=r;return k.nextAvailableFontCharCode++}var S=r.seacs;if(k&&u.SEAC_ANALYSIS_ENABLED&&S&&S.length){var x=o.fontMatrix||c.FONT_IDENTITY_MATRIX,O=r.getCharset(),T=Object.create(null);for(var E in S){var M=S[E|=0],R=g.StandardEncoding[M[2]],j=g.StandardEncoding[M[3]],D=O.indexOf(R),L=O.indexOf(j);if(!(D<0||L<0)){var N={x:M[0]*x[0]+M[1]*x[2]+x[4],y:M[0]*x[1]+M[1]*x[3]+x[5]},U=getCharCodes(m,E);if(U)for(var H=0,$=U.length;H<$;H++){var X=U[H],q=k.charCodeToGlyphId,G=createCharCode(q,D),z=createCharCode(q,L);T[X]={baseFontCharCode:G,accentFontCharCode:z,accentOffset:N}}}}o.seacMap=T}var W=1/(o.fontMatrix||c.FONT_IDENTITY_MATRIX)[0],V=new C.OpenTypeFileBuilder("OTTO");V.addTable("CFF ",r.data);V.addTable("OS/2",createOS2Table(o,_));V.addTable("cmap",createCmapTable(_,w));V.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(W)+"\0\0\0\0\v~'\0\0\0\0\v~'\0\0"+safeString16(o.descent)+"ÿ"+safeString16(o.ascent)+string16(o.italicAngle?2:0)+"\0\0\0\0\0\0\0");V.addTable("hhea","\0\0\0"+safeString16(o.ascent)+safeString16(o.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(o.capHeight)+safeString16(Math.tan(o.italicAngle)*o.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(w));V.addTable("hmtx",function fontFieldsHmtx(){for(var t=r.charstrings,o=r.cff?r.cff.widths:null,c="\0\0\0\0",l=1,u=w;l<u;l++){var h=0;if(t){var d=t[l-1];h="width"in d?d.width:0}else o&&(h=Math.ceil(o[l]||0));c+=string16(h)+string16(0)}return c}());V.addTable("maxp","\0\0P\0"+string16(w));V.addTable("name",createNameTable(t));V.addTable("post",createPostTable(o));return V.toArray()}},{key:"spaceWidth",get:function get(){for(var t,r=["space","minus","one","i","I"],o=0,l=r.length;o<l;o++){var u=r[o];if(u in this.widths){t=this.widths[u];break}var h=(0,d.getGlyphsUnicode)()[u],g=0;this.composite&&this.cMap.contains(h)&&"string"==typeof(g=this.cMap.lookup(h))&&(g=convertCidString(h,g));!g&&this.toUnicode&&(g=this.toUnicode.charCodeOf(h));g<=0&&(g=h);if(t=this.widths[g])break}t=t||this.defaultWidth;return(0,c.shadow)(this,"spaceWidth",t)}},{key:"_charToGlyph",value:function _charToGlyph(t){var r,o,l,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=t;this.cMap&&this.cMap.contains(t)&&"string"==typeof(d=this.cMap.lookup(t))&&(d=convertCidString(t,d));"number"!=typeof(o=this.widths[d])&&(o=this.defaultWidth);var g=this.vmetrics&&this.vmetrics[d],m=this.toUnicode.get(t)||t;"number"==typeof m&&(m=String.fromCharCode(m));var y=void 0!==this.toFontChar[t];r=this.toFontChar[t]||t;if(this.missingFile){var v=this.differences[t]||this.defaultEncoding[t];".notdef"!==v&&""!==v||"Type1"!==this.type||(r=32);r=(0,h.mapSpecialUnicodeValues)(r)}this.isType3Font&&(l=r);var k=null;if(this.seacMap&&this.seacMap[t]){y=!0;var _=this.seacMap[t];r=_.baseFontCharCode;k={fontChar:String.fromCodePoint(_.accentFontCharCode),offset:_.accentOffset}}var w="";"number"==typeof r&&(r<=1114111?w=String.fromCodePoint(r):(0,c.warn)("charToGlyph - invalid fontCharCode: ".concat(r)));var S=this._glyphCache[t];if(!S||!S.matchesForCache(t,w,m,k,o,g,l,u,y)){S=new D(t,w,m,k,o,g,l,u,y);this._glyphCache[t]=S}return S}},{key:"charsToGlyphs",value:function charsToGlyphs(t){var r=this._charsCache[t];if(r)return r;r=[];if(this.cMap)for(var o=Object.create(null),c=t.length,l=0;l<c;){this.cMap.readCharCode(t,l,o);var u=o.charcode,h=o.length;l+=h;var d=this._charToGlyph(u,1===h&&32===t.charCodeAt(l-1));r.push(d)}else for(var g=0,m=t.length;g<m;++g){var y=t.charCodeAt(g),v=this._charToGlyph(y,32===y);r.push(v)}return this._charsCache[t]=r}},{key:"getCharPositions",value:function getCharPositions(t){var r=[];if(this.cMap)for(var o=Object.create(null),c=0;c<t.length;){this.cMap.readCharCode(t,c,o);var l=o.length;r.push([c,c+l]);c+=l}else for(var u=0,h=t.length;u<h;++u)r.push([u,u+1]);return r}},{key:"glyphCacheValues",get:function get(){return Object.values(this._glyphCache)}},{key:"encodeString",value:function encodeString(t){for(var r=this,o=[],c=[],l=function hasCurrentBufErrors(){return o.length%2==1},u=this.toUnicode instanceof y.IdentityToUnicodeMap?function(t){return r.toUnicode.charCodeOf(t)}:function(t){return r.toUnicode.charCodeOf(String.fromCodePoint(t))},h=0,d=t.length;h<d;h++){var g=t.codePointAt(h);g>55295&&(g<57344||g>65533)&&h++;if(this.toUnicode){var m=u(g);if(-1!==m){if(l()){o.push(c.join(""));c.length=0}for(var v=(this.cMap?this.cMap.getCharCodeLength(m):1)-1;v>=0;v--)c.push(String.fromCharCode(m>>8*v&255));continue}}if(!l()){o.push(c.join(""));c.length=0}c.push(String.fromCodePoint(g))}o.push(c.join(""));return o}}]);return Font}();r.Font=L;var N=function(){function ErrorFont(t){_classCallCheck(this,ErrorFont);this.error=t;this.loadedName="g_font_error";this.missingFile=!0}_createClass(ErrorFont,[{key:"charsToGlyphs",value:function charsToGlyphs(){return[]}},{key:"encodeString",value:function encodeString(t){return[t]}},{key:"exportData",value:function exportData(){return{error:this.error}}}]);return ErrorFont}();r.ErrorFont=N},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.CFFTopDict=r.CFFStrings=r.CFFStandardStrings=r.CFFPrivateDict=r.CFFParser=r.CFFIndex=r.CFFHeader=r.CFFFDSelect=r.CFFCompiler=r.CFFCharset=r.CFF=void 0;var c=o(4),l=o(187),u=o(160);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var h=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"];r.CFFStandardStrings=h;var d=391,g=function CFFParserClosure(){var t=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],r=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn:function stack_div(t,r){t[r-2]=t[r-2]+t[r-1]}},{id:"sub",min:2,stackDelta:-1,stackFn:function stack_div(t,r){t[r-2]=t[r-2]-t[r-1]}},{id:"div",min:2,stackDelta:-1,stackFn:function stack_div(t,r){t[r-2]=t[r-2]/t[r-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn:function stack_div(t,r){t[r-1]=-t[r-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn:function stack_div(t,r){t[r-2]=t[r-2]*t[r-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];return function(){function CFFParser(t,r,o){_classCallCheck(this,CFFParser);this.bytes=t.getBytes();this.properties=r;this.seacAnalysisEnabled=!!o}_createClass(CFFParser,[{key:"parse",value:function parse(){var t=this.properties,r=new m;this.cff=r;var o=this.parseHeader(),c=this.parseIndex(o.endPos),l=this.parseIndex(c.endPos),u=this.parseIndex(l.endPos),h=this.parseIndex(u.endPos),d=this.parseDict(l.obj.get(0)),g=this.createDict(w,d,r.strings);r.header=o.obj;r.names=this.parseNameIndex(c.obj);r.strings=this.parseStringIndex(u.obj);r.topDict=g;r.globalSubrIndex=h.obj;this.parsePrivateDict(r.topDict);r.isCIDFont=g.hasName("ROS");var y=g.getByName("CharStrings"),v=this.parseIndex(y).obj,k=g.getByName("FontMatrix");k&&(t.fontMatrix=k);var _,S,C=g.getByName("FontBBox");if(C){t.ascent=Math.max(C[3],C[1]);t.descent=Math.min(C[1],C[3]);t.ascentScaled=!0}if(r.isCIDFont){for(var x=this.parseIndex(g.getByName("FDArray")).obj,O=0,T=x.count;O<T;++O){var E=x.get(O),M=this.createDict(w,this.parseDict(E),r.strings);this.parsePrivateDict(M);r.fdArray.push(M)}S=null;_=this.parseCharsets(g.getByName("charset"),v.count,r.strings,!0);r.fdSelect=this.parseFDSelect(g.getByName("FDSelect"),v.count)}else{_=this.parseCharsets(g.getByName("charset"),v.count,r.strings,!1);S=this.parseEncoding(g.getByName("Encoding"),t,r.strings,_.charset)}r.charset=_;r.encoding=S;var R=this.parseCharStrings({charStrings:v,localSubrIndex:g.privateDict.subrsIndex,globalSubrIndex:h.obj,fdSelect:r.fdSelect,fdArray:r.fdArray,privateDict:g.privateDict});r.charStrings=R.charStrings;r.seacs=R.seacs;r.widths=R.widths;return r}},{key:"parseHeader",value:function parseHeader(){for(var t=this.bytes,r=t.length,o=0;o<r&&1!==t[o];)++o;if(o>=r)throw new c.FormatError("Invalid CFF header");if(0!==o){(0,c.info)("cff data is shifted");t=t.subarray(o);this.bytes=t}var l=t[0],u=t[1],h=t[2],d=t[3];return{obj:new y(l,u,h,d),endPos:h}}},{key:"parseDict",value:function parseDict(t){var r=0;function parseOperand(){var o=t[r++];if(30===o)return function parseFloatOperand(){var o="",c=15,l=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],u=t.length;for(;r<u;){var h=t[r++],d=h>>4,g=15&h;if(d===c)break;o+=l[d];if(g===c)break;o+=l[g]}return parseFloat(o)}();if(28===o)return o=((o=t[r++])<<24|t[r++]<<16)>>16;if(29===o)return o=(o=(o=(o=t[r++])<<8|t[r++])<<8|t[r++])<<8|t[r++];if(o>=32&&o<=246)return o-139;if(o>=247&&o<=250)return 256*(o-247)+t[r++]+108;if(o>=251&&o<=254)return-256*(o-251)-t[r++]-108;(0,c.warn)('CFFParser_parseDict: "'+o+'" is a reserved command.');return NaN}var o=[],l=[];r=0;for(var u=t.length;r<u;){var h=t[r];if(h<=21){12===h&&(h=h<<8|t[++r]);l.push([h,o]);o=[];++r}else o.push(parseOperand())}return l}},{key:"parseIndex",value:function parseIndex(t){var r,o,c=new k,l=this.bytes,u=l[t++]<<8|l[t++],h=[],d=t;if(0!==u){var g=l[t++],m=t+(u+1)*g-1;for(r=0,o=u+1;r<o;++r){for(var y=0,v=0;v<g;++v){y<<=8;y+=l[t++]}h.push(m+y)}d=h[u]}for(r=0,o=h.length-1;r<o;++r){var _=h[r],w=h[r+1];c.add(l.subarray(_,w))}return{obj:c,endPos:d}}},{key:"parseNameIndex",value:function parseNameIndex(t){for(var r=[],o=0,l=t.count;o<l;++o){var u=t.get(o);r.push((0,c.bytesToString)(u))}return r}},{key:"parseStringIndex",value:function parseStringIndex(t){for(var r=new v,o=0,l=t.count;o<l;++o){var u=t.get(o);r.add((0,c.bytesToString)(u))}return r}},{key:"createDict",value:function createDict(t,r,o){for(var c=new t(o),l=0,u=r.length;l<u;++l){var h=r[l],d=h[0],g=h[1];c.setByKey(d,g)}return c}},{key:"parseCharString",value:function parseCharString(o,l,u,h){if(!l||o.callDepth>10)return!1;for(var d=o.stackSize,g=o.stack,m=l.length,y=0;y<m;){var v=l[y++],k=null;if(12===v){var _=l[y++];if(0===_){l[y-2]=139;l[y-1]=22;d=0}else k=r[_]}else if(28===v){g[d]=(l[y]<<24|l[y+1]<<16)>>16;y+=2;d++}else if(14===v){if(d>=4){d-=4;if(this.seacAnalysisEnabled){o.seac=g.slice(d,d+4);return!1}}k=t[v]}else if(v>=32&&v<=246){g[d]=v-139;d++}else if(v>=247&&v<=254){g[d]=v<251?(v-247<<8)+l[y]+108:-(v-251<<8)-l[y]-108;y++;d++}else if(255===v){g[d]=(l[y]<<24|l[y+1]<<16|l[y+2]<<8|l[y+3])/65536;y+=4;d++}else if(19===v||20===v){o.hints+=d>>1;y+=o.hints+7>>3;d%=2;k=t[v]}else{if(10===v||29===v){var w=void 0;if(!(w=10===v?u:h)){k=t[v];(0,c.warn)("Missing subrsIndex for "+k.id);return!1}var S=32768;w.count<1240?S=107:w.count<33900&&(S=1131);var C=g[--d]+S;if(C<0||C>=w.count||isNaN(C)){k=t[v];(0,c.warn)("Out of bounds subrIndex for "+k.id);return!1}o.stackSize=d;o.callDepth++;if(!this.parseCharString(o,w.get(C),u,h))return!1;o.callDepth--;d=o.stackSize;continue}if(11===v){o.stackSize=d;return!0}if(0===v&&y===l.length){l[y-1]=14;k=t[14]}else k=t[v]}if(k){if(k.stem){o.hints+=d>>1;if(3===v||23===v)o.hasVStems=!0;else if(o.hasVStems&&(1===v||18===v)){(0,c.warn)("CFF stem hints are in wrong order");l[y-1]=1===v?3:23}}if("min"in k&&!o.undefStack&&d<k.min){(0,c.warn)("Not enough parameters for "+k.id+"; actual: "+d+", expected: "+k.min);if(0===d){l[y-1]=14;return!0}return!1}if(o.firstStackClearing&&k.stackClearing){o.firstStackClearing=!1;(d-=k.min)>=2&&k.stem?d%=2:d>1&&(0,c.warn)("Found too many parameters for stack-clearing command");d>0&&(o.width=g[d-1])}if("stackDelta"in k){"stackFn"in k&&k.stackFn(g,d);d+=k.stackDelta}else if(k.stackClearing)d=0;else if(k.resetStack){d=0;o.undefStack=!1}else if(k.undefStack){d=0;o.undefStack=!0;o.firstStackClearing=!1}}}o.stackSize=d;return!0}},{key:"parseCharStrings",value:function parseCharStrings(t){for(var r=t.charStrings,o=t.localSubrIndex,l=t.globalSubrIndex,u=t.fdSelect,h=t.fdArray,d=t.privateDict,g=[],m=[],y=r.count,v=0;v<y;v++){var k=r.get(v),_={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1},w=!0,S=null,C=d;if(u&&h.length){var x=u.getFDIndex(v);if(-1===x){(0,c.warn)("Glyph index is not in fd select.");w=!1}if(x>=h.length){(0,c.warn)("Invalid fd index for glyph index.");w=!1}w&&(S=(C=h[x].privateDict).subrsIndex)}else o&&(S=o);w&&(w=this.parseCharString(_,k,S,l));if(null!==_.width){var O=C.getByName("nominalWidthX");m[v]=O+_.width}else{var T=C.getByName("defaultWidthX");m[v]=T}null!==_.seac&&(g[v]=_.seac);w||r.set(v,new Uint8Array([14]))}return{charStrings:r,seacs:g,widths:m}}},{key:"emptyPrivateDictionary",value:function emptyPrivateDictionary(t){var r=this.createDict(S,[],t.strings);t.setByKey(18,[0,0]);t.privateDict=r}},{key:"parsePrivateDict",value:function parsePrivateDict(t){if(t.hasName("Private")){var r=t.getByName("Private");if(Array.isArray(r)&&2===r.length){var o=r[0],c=r[1];if(0===o||c>=this.bytes.length)this.emptyPrivateDictionary(t);else{var l=c+o,u=this.bytes.subarray(c,l),h=this.parseDict(u),d=this.createDict(S,h,t.strings);t.privateDict=d;if(d.getByName("Subrs")){var g=d.getByName("Subrs"),m=c+g;if(0===g||m>=this.bytes.length)this.emptyPrivateDictionary(t);else{var y=this.parseIndex(m);d.subrsIndex=y.obj}}}}else t.removeByName("Private")}else this.emptyPrivateDictionary(t)}},{key:"parseCharsets",value:function parseCharsets(t,r,o,u){if(0===t)return new x(!0,C.ISO_ADOBE,l.ISOAdobeCharset);if(1===t)return new x(!0,C.EXPERT,l.ExpertCharset);if(2===t)return new x(!0,C.EXPERT_SUBSET,l.ExpertSubsetCharset);var h,d,g,m=this.bytes,y=t,v=m[t++],k=[u?0:".notdef"];r-=1;switch(v){case 0:for(g=0;g<r;g++){h=m[t++]<<8|m[t++];k.push(u?h:o.get(h))}break;case 1:for(;k.length<=r;){h=m[t++]<<8|m[t++];d=m[t++];for(g=0;g<=d;g++)k.push(u?h++:o.get(h++))}break;case 2:for(;k.length<=r;){h=m[t++]<<8|m[t++];d=m[t++]<<8|m[t++];for(g=0;g<=d;g++)k.push(u?h++:o.get(h++))}break;default:throw new c.FormatError("Unknown charset format")}var _=t,w=m.subarray(y,_);return new x(!1,v,k,w)}},{key:"parseEncoding",value:function parseEncoding(t,r,o,l){var h,d,g,m=Object.create(null),y=this.bytes,v=!1,k=null;if(0===t||1===t){v=!0;h=t;var _=t?u.ExpertEncoding:u.StandardEncoding;for(d=0,g=l.length;d<g;d++){var w=_.indexOf(l[d]);-1!==w&&(m[w]=d)}}else{var S=t;switch(127&(h=y[t++])){case 0:var C=y[t++];for(d=1;d<=C;d++)m[y[t++]]=d;break;case 1:var x=y[t++],T=1;for(d=0;d<x;d++)for(var E=y[t++],M=y[t++],R=E;R<=E+M;R++)m[R]=T++;break;default:throw new c.FormatError("Unknown encoding format: ".concat(h," in CFF"))}var j=t;if(128&h){y[S]&=127;!function readSupplement(){var r=y[t++];for(d=0;d<r;d++){var c=y[t++],u=(y[t++]<<8)+(255&y[t++]);m[c]=l.indexOf(o.get(u))}}()}k=y.subarray(S,j)}return new O(v,h&=127,m,k)}},{key:"parseFDSelect",value:function parseFDSelect(t,r){var o,l=this.bytes,u=l[t++],h=[];switch(u){case 0:for(o=0;o<r;++o){var d=l[t++];h.push(d)}break;case 3:var g=l[t++]<<8|l[t++];for(o=0;o<g;++o){var m=l[t++]<<8|l[t++];if(0===o&&0!==m){(0,c.warn)("parseFDSelect: The first range must have a first GID of 0 -- trying to recover.");m=0}for(var y=l[t++],v=l[t]<<8|l[t+1],k=m;k<v;++k)h.push(y)}t+=2;break;default:throw new c.FormatError('parseFDSelect: Unknown format "'.concat(u,'".'))}if(h.length!==r)throw new c.FormatError("parseFDSelect: Invalid font data.");return new T(u,h)}}]);return CFFParser}()}();r.CFFParser=g;var m=function(){function CFF(){_classCallCheck(this,CFF);this.header=null;this.names=[];this.topDict=null;this.strings=new v;this.globalSubrIndex=null;this.encoding=null;this.charset=null;this.charStrings=null;this.fdArray=[];this.fdSelect=null;this.isCIDFont=!1}_createClass(CFF,[{key:"duplicateFirstGlyph",value:function duplicateFirstGlyph(){if(this.charStrings.count>=65535)(0,c.warn)("Not enough space in charstrings to duplicate first glyph.");else{var t=this.charStrings.get(0);this.charStrings.add(t);this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}}},{key:"hasGlyphId",value:function hasGlyphId(t){return!(t<0||t>=this.charStrings.count)&&this.charStrings.get(t).length>0}}]);return CFF}();r.CFF=m;var y=_createClass((function CFFHeader(t,r,o,c){_classCallCheck(this,CFFHeader);this.major=t;this.minor=r;this.hdrSize=o;this.offSize=c}));r.CFFHeader=y;var v=function(){function CFFStrings(){_classCallCheck(this,CFFStrings);this.strings=[]}_createClass(CFFStrings,[{key:"get",value:function get(t){return t>=0&&t<=390?h[t]:t-d<=this.strings.length?this.strings[t-d]:h[0]}},{key:"getSID",value:function getSID(t){var r=h.indexOf(t);return-1!==r?r:-1!==(r=this.strings.indexOf(t))?r+d:-1}},{key:"add",value:function add(t){this.strings.push(t)}},{key:"count",get:function get(){return this.strings.length}}]);return CFFStrings}();r.CFFStrings=v;var k=function(){function CFFIndex(){_classCallCheck(this,CFFIndex);this.objects=[];this.length=0}_createClass(CFFIndex,[{key:"add",value:function add(t){this.length+=t.length;this.objects.push(t)}},{key:"set",value:function set(t,r){this.length+=r.length-this.objects[t].length;this.objects[t]=r}},{key:"get",value:function get(t){return this.objects[t]}},{key:"count",get:function get(){return this.objects.length}}]);return CFFIndex}();r.CFFIndex=k;var _=function(){function CFFDict(t,r){_classCallCheck(this,CFFDict);this.keyToNameMap=t.keyToNameMap;this.nameToKeyMap=t.nameToKeyMap;this.defaults=t.defaults;this.types=t.types;this.opcodes=t.opcodes;this.order=t.order;this.strings=r;this.values=Object.create(null)}_createClass(CFFDict,[{key:"setByKey",value:function setByKey(t,r){if(!(t in this.keyToNameMap))return!1;var o=r.length;if(0===o)return!0;for(var l=0;l<o;l++)if(isNaN(r[l])){(0,c.warn)('Invalid CFFDict value: "'+r+'" for key "'+t+'".');return!0}var u=this.types[t];"num"!==u&&"sid"!==u&&"offset"!==u||(r=r[0]);this.values[t]=r;return!0}},{key:"setByName",value:function setByName(t,r){if(!(t in this.nameToKeyMap))throw new c.FormatError('Invalid dictionary name "'.concat(t,'"'));this.values[this.nameToKeyMap[t]]=r}},{key:"hasName",value:function hasName(t){return this.nameToKeyMap[t]in this.values}},{key:"getByName",value:function getByName(t){if(!(t in this.nameToKeyMap))throw new c.FormatError("Invalid dictionary name ".concat(t,'"'));var r=this.nameToKeyMap[t];return r in this.values?this.values[r]:this.defaults[r]}},{key:"removeByName",value:function removeByName(t){delete this.values[this.nameToKeyMap[t]]}}],[{key:"createTables",value:function createTables(t){for(var r={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]},o=0,c=t.length;o<c;++o){var l=t[o],u=Array.isArray(l[0])?(l[0][0]<<8)+l[0][1]:l[0];r.keyToNameMap[u]=l[1];r.nameToKeyMap[l[1]]=u;r.types[u]=l[2];r.defaults[u]=l[3];r.opcodes[u]=Array.isArray(l[0])?l[0]:[l[0]];r.order.push(u)}return r}}]);return CFFDict}(),w=function CFFTopDictClosure(){var t=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]],r=null;return function(o){_inherits(CFFTopDict,o);var c=_createSuper(CFFTopDict);function CFFTopDict(o){var l;_classCallCheck(this,CFFTopDict);null===r&&(r=_.createTables(t));(l=c.call(this,r,o)).privateDict=null;return l}return _createClass(CFFTopDict)}(_)}();r.CFFTopDict=w;var S=function CFFPrivateDictClosure(){var t=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]],r=null;return function(o){_inherits(CFFPrivateDict,o);var c=_createSuper(CFFPrivateDict);function CFFPrivateDict(o){var l;_classCallCheck(this,CFFPrivateDict);null===r&&(r=_.createTables(t));(l=c.call(this,r,o)).subrsIndex=null;return l}return _createClass(CFFPrivateDict)}(_)}();r.CFFPrivateDict=S;var C={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2},x=_createClass((function CFFCharset(t,r,o,c){_classCallCheck(this,CFFCharset);this.predefined=t;this.format=r;this.charset=o;this.raw=c}));r.CFFCharset=x;var O=_createClass((function CFFEncoding(t,r,o,c){_classCallCheck(this,CFFEncoding);this.predefined=t;this.format=r;this.encoding=o;this.raw=c})),T=function(){function CFFFDSelect(t,r){_classCallCheck(this,CFFFDSelect);this.format=t;this.fdSelect=r}_createClass(CFFFDSelect,[{key:"getFDIndex",value:function getFDIndex(t){return t<0||t>=this.fdSelect.length?-1:this.fdSelect[t]}}]);return CFFFDSelect}();r.CFFFDSelect=T;var E=function(){function CFFOffsetTracker(){_classCallCheck(this,CFFOffsetTracker);this.offsets=Object.create(null)}_createClass(CFFOffsetTracker,[{key:"isTracking",value:function isTracking(t){return t in this.offsets}},{key:"track",value:function track(t,r){if(t in this.offsets)throw new c.FormatError("Already tracking location of ".concat(t));this.offsets[t]=r}},{key:"offset",value:function offset(t){for(var r in this.offsets)this.offsets[r]+=t}},{key:"setEntryLocation",value:function setEntryLocation(t,r,o){if(!(t in this.offsets))throw new c.FormatError("Not tracking location of ".concat(t));for(var l=o.data,u=this.offsets[t],h=0,d=r.length;h<d;++h){var g=5*h+u,m=g+1,y=g+2,v=g+3,k=g+4;if(29!==l[g]||0!==l[m]||0!==l[y]||0!==l[v]||0!==l[k])throw new c.FormatError("writing to an offset that is not empty");var _=r[h];l[g]=29;l[m]=_>>24&255;l[y]=_>>16&255;l[v]=_>>8&255;l[k]=255&_}}}]);return CFFOffsetTracker}(),M=function(){function CFFCompiler(t){_classCallCheck(this,CFFCompiler);this.cff=t}_createClass(CFFCompiler,[{key:"compile",value:function compile(){var t=this.cff,r={data:[],length:0,add:function CFFCompiler_add(t){this.data=this.data.concat(t);this.length=this.data.length}},o=this.compileHeader(t.header);r.add(o);var l=this.compileNameIndex(t.names);r.add(l);if(t.isCIDFont&&t.topDict.hasName("FontMatrix")){var u=t.topDict.getByName("FontMatrix");t.topDict.removeByName("FontMatrix");for(var h=0,d=t.fdArray.length;h<d;h++){var g=t.fdArray[h],m=u.slice(0);g.hasName("FontMatrix")&&(m=c.Util.transform(m,g.getByName("FontMatrix")));g.setByName("FontMatrix",m)}}var y=t.topDict.getByName("XUID");y&&y.length>16&&t.topDict.removeByName("XUID");t.topDict.setByName("charset",0);var v=this.compileTopDicts([t.topDict],r.length,t.isCIDFont);r.add(v.output);var k=v.trackers[0],_=this.compileStringIndex(t.strings.strings);r.add(_);var w=this.compileIndex(t.globalSubrIndex);r.add(w);if(t.encoding&&t.topDict.hasName("Encoding"))if(t.encoding.predefined)k.setEntryLocation("Encoding",[t.encoding.format],r);else{var S=this.compileEncoding(t.encoding);k.setEntryLocation("Encoding",[r.length],r);r.add(S)}var C=this.compileCharset(t.charset,t.charStrings.count,t.strings,t.isCIDFont);k.setEntryLocation("charset",[r.length],r);r.add(C);var x=this.compileCharStrings(t.charStrings);k.setEntryLocation("CharStrings",[r.length],r);r.add(x);if(t.isCIDFont){k.setEntryLocation("FDSelect",[r.length],r);var O=this.compileFDSelect(t.fdSelect);r.add(O);v=this.compileTopDicts(t.fdArray,r.length,!0);k.setEntryLocation("FDArray",[r.length],r);r.add(v.output);var T=v.trackers;this.compilePrivateDicts(t.fdArray,T,r)}this.compilePrivateDicts([t.topDict],[k],r);r.add([0]);return r.data}},{key:"encodeNumber",value:function encodeNumber(t){return Number.isInteger(t)?this.encodeInteger(t):this.encodeFloat(t)}},{key:"encodeFloat",value:function encodeFloat(t){var r=t.toString(),o=CFFCompiler.EncodeFloatRegExp.exec(r);if(o){var c=parseFloat("1e"+((o[2]?+o[2]:0)+o[1].length));r=(Math.round(t*c)/c).toString()}var l,u,h="";for(l=0,u=r.length;l<u;++l){var d=r[l];h+="e"===d?"-"===r[++l]?"c":"b":"."===d?"a":"-"===d?"e":d}var g=[30];for(l=0,u=(h+=1&h.length?"f":"ff").length;l<u;l+=2)g.push(parseInt(h.substring(l,l+2),16));return g}},{key:"encodeInteger",value:function encodeInteger(t){return t>=-107&&t<=107?[t+139]:t>=108&&t<=1131?[247+((t-=108)>>8),255&t]:t>=-1131&&t<=-108?[251+((t=-t-108)>>8),255&t]:t>=-32768&&t<=32767?[28,t>>8&255,255&t]:[29,t>>24&255,t>>16&255,t>>8&255,255&t]}},{key:"compileHeader",value:function compileHeader(t){return[t.major,t.minor,4,t.offSize]}},{key:"compileNameIndex",value:function compileNameIndex(t){for(var r=new k,o=0,l=t.length;o<l;++o){for(var u=t[o],h=Math.min(u.length,127),d=new Array(h),g=0;g<h;g++){var m=u[g];(m<"!"||m>"~"||"["===m||"]"===m||"("===m||")"===m||"{"===m||"}"===m||"<"===m||">"===m||"/"===m||"%"===m)&&(m="_");d[g]=m}""===(d=d.join(""))&&(d="Bad_Font_Name");r.add((0,c.stringToBytes)(d))}return this.compileIndex(r)}},{key:"compileTopDicts",value:function compileTopDicts(t,r,o){for(var c=[],l=new k,u=0,h=t.length;u<h;++u){var d=t[u];if(o){d.removeByName("CIDFontVersion");d.removeByName("CIDFontRevision");d.removeByName("CIDFontType");d.removeByName("CIDCount");d.removeByName("UIDBase")}var g=new E,m=this.compileDict(d,g);c.push(g);l.add(m);g.offset(r)}return{trackers:c,output:l=this.compileIndex(l,c)}}},{key:"compilePrivateDicts",value:function compilePrivateDicts(t,r,o){for(var l=0,u=t.length;l<u;++l){var h=t[l],d=h.privateDict;if(!d||!h.hasName("Private"))throw new c.FormatError("There must be a private dictionary.");var g=new E,m=this.compileDict(d,g),y=o.length;g.offset(y);m.length||(y=0);r[l].setEntryLocation("Private",[m.length,y],o);o.add(m);if(d.subrsIndex&&d.hasName("Subrs")){var v=this.compileIndex(d.subrsIndex);g.setEntryLocation("Subrs",[m.length],o);o.add(v)}}}},{key:"compileDict",value:function compileDict(t,r){for(var o=[],l=t.order,u=0;u<l.length;++u){var h=l[u];if(h in t.values){var d=t.values[h],g=t.types[h];Array.isArray(g)||(g=[g]);Array.isArray(d)||(d=[d]);if(0!==d.length){for(var m=0,y=g.length;m<y;++m){var v=g[m],k=d[m];switch(v){case"num":case"sid":o=o.concat(this.encodeNumber(k));break;case"offset":var _=t.keyToNameMap[h];r.isTracking(_)||r.track(_,o.length);o=o.concat([29,0,0,0,0]);break;case"array":case"delta":o=o.concat(this.encodeNumber(k));for(var w=1,S=d.length;w<S;++w)o=o.concat(this.encodeNumber(d[w]));break;default:throw new c.FormatError("Unknown data type of ".concat(v))}}o=o.concat(t.opcodes[h])}}}return o}},{key:"compileStringIndex",value:function compileStringIndex(t){for(var r=new k,o=0,l=t.length;o<l;++o)r.add((0,c.stringToBytes)(t[o]));return this.compileIndex(r)}},{key:"compileGlobalSubrIndex",value:function compileGlobalSubrIndex(){var t=this.cff.globalSubrIndex;this.out.writeByteArray(this.compileIndex(t))}},{key:"compileCharStrings",value:function compileCharStrings(t){for(var r=new k,o=0;o<t.count;o++){var c=t.get(o);0!==c.length?r.add(c):r.add(new Uint8Array([139,14]))}return this.compileIndex(r)}},{key:"compileCharset",value:function compileCharset(t,r,o,l){var u,h=r-1;if(l)u=new Uint8Array([2,0,0,h>>8&255,255&h]);else{(u=new Uint8Array(1+2*h))[0]=0;for(var d=0,g=t.charset.length,m=!1,y=1;y<u.length;y+=2){var v=0;if(d<g){var k=t.charset[d++];if(-1===(v=o.getSID(k))){v=0;if(!m){m=!0;(0,c.warn)("Couldn't find ".concat(k," in CFF strings"))}}}u[y]=v>>8&255;u[y+1]=255&v}}return this.compileTypedArray(u)}},{key:"compileEncoding",value:function compileEncoding(t){return this.compileTypedArray(t.raw)}},{key:"compileFDSelect",value:function compileFDSelect(t){var r,o,c=t.format;switch(c){case 0:(r=new Uint8Array(1+t.fdSelect.length))[0]=c;for(o=0;o<t.fdSelect.length;o++)r[o+1]=t.fdSelect[o];break;case 3:var l=t.fdSelect[0],u=[c,0,0,0,0,l];for(o=1;o<t.fdSelect.length;o++){var h=t.fdSelect[o];if(h!==l){u.push(o>>8&255,255&o,h);l=h}}var d=(u.length-3)/3;u[1]=d>>8&255;u[2]=255&d;u.push(o>>8&255,255&o);r=new Uint8Array(u)}return this.compileTypedArray(r)}},{key:"compileTypedArray",value:function compileTypedArray(t){for(var r=[],o=0,c=t.length;o<c;++o)r[o]=t[o];return r}},{key:"compileIndex",value:function compileIndex(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=t.objects,c=o.length;if(0===c)return[0,0,0];var l,u,h=[c>>8&255,255&c],d=1;for(l=0;l<c;++l)d+=o[l].length;u=d<256?1:d<65536?2:d<16777216?3:4;h.push(u);var g=1;for(l=0;l<c+1;l++){1===u?h.push(255&g):2===u?h.push(g>>8&255,255&g):3===u?h.push(g>>16&255,g>>8&255,255&g):h.push(g>>>24&255,g>>16&255,g>>8&255,255&g);o[l]&&(g+=o[l].length)}for(l=0;l<c;l++){r[l]&&r[l].offset(h.length);for(var m=0,y=o[l].length;m<y;m++)h.push(o[l][m])}return h}}],[{key:"EncodeFloatRegExp",get:function get(){return(0,c.shadow)(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}}]);return CFFCompiler}();r.CFFCompiler=M},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ISOAdobeCharset=r.ExpertSubsetCharset=r.ExpertCharset=void 0;r.ISOAdobeCharset=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"];r.ExpertCharset=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];r.ExpertSubsetCharset=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"]},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.getSerifFonts=r.getNonStdFontMap=r.getGlyphMapForStandardFonts=r.getFontNameToFileMap=void 0;r.getStandardFontName=function getStandardFontName(t){var r=(0,l.normalizeFontName)(t);return u()[r]};r.getSymbolsFonts=r.getSupplementalGlyphMapForCalibri=r.getSupplementalGlyphMapForArialBlack=r.getStdFontMap=void 0;var c=o(149),l=o(159),u=(0,c.getLookupTableFactory)((function(t){t["Times-Roman"]="Times-Roman";t.Helvetica="Helvetica";t.Courier="Courier";t.Symbol="Symbol";t["Times-Bold"]="Times-Bold";t["Helvetica-Bold"]="Helvetica-Bold";t["Courier-Bold"]="Courier-Bold";t.ZapfDingbats="ZapfDingbats";t["Times-Italic"]="Times-Italic";t["Helvetica-Oblique"]="Helvetica-Oblique";t["Courier-Oblique"]="Courier-Oblique";t["Times-BoldItalic"]="Times-BoldItalic";t["Helvetica-BoldOblique"]="Helvetica-BoldOblique";t["Courier-BoldOblique"]="Courier-BoldOblique";t.ArialNarrow="Helvetica";t["ArialNarrow-Bold"]="Helvetica-Bold";t["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique";t["ArialNarrow-Italic"]="Helvetica-Oblique";t.ArialBlack="Helvetica";t["ArialBlack-Bold"]="Helvetica-Bold";t["ArialBlack-BoldItalic"]="Helvetica-BoldOblique";t["ArialBlack-Italic"]="Helvetica-Oblique";t["Arial-Black"]="Helvetica";t["Arial-Black-Bold"]="Helvetica-Bold";t["Arial-Black-BoldItalic"]="Helvetica-BoldOblique";t["Arial-Black-Italic"]="Helvetica-Oblique";t.Arial="Helvetica";t["Arial-Bold"]="Helvetica-Bold";t["Arial-BoldItalic"]="Helvetica-BoldOblique";t["Arial-Italic"]="Helvetica-Oblique";t["Arial-BoldItalicMT"]="Helvetica-BoldOblique";t["Arial-BoldMT"]="Helvetica-Bold";t["Arial-ItalicMT"]="Helvetica-Oblique";t.ArialMT="Helvetica";t["Courier-BoldItalic"]="Courier-BoldOblique";t["Courier-Italic"]="Courier-Oblique";t.CourierNew="Courier";t["CourierNew-Bold"]="Courier-Bold";t["CourierNew-BoldItalic"]="Courier-BoldOblique";t["CourierNew-Italic"]="Courier-Oblique";t["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique";t["CourierNewPS-BoldMT"]="Courier-Bold";t["CourierNewPS-ItalicMT"]="Courier-Oblique";t.CourierNewPSMT="Courier";t["Helvetica-BoldItalic"]="Helvetica-BoldOblique";t["Helvetica-Italic"]="Helvetica-Oblique";t["Symbol-Bold"]="Symbol";t["Symbol-BoldItalic"]="Symbol";t["Symbol-Italic"]="Symbol";t.TimesNewRoman="Times-Roman";t["TimesNewRoman-Bold"]="Times-Bold";t["TimesNewRoman-BoldItalic"]="Times-BoldItalic";t["TimesNewRoman-Italic"]="Times-Italic";t.TimesNewRomanPS="Times-Roman";t["TimesNewRomanPS-Bold"]="Times-Bold";t["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic";t["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic";t["TimesNewRomanPS-BoldMT"]="Times-Bold";t["TimesNewRomanPS-Italic"]="Times-Italic";t["TimesNewRomanPS-ItalicMT"]="Times-Italic";t.TimesNewRomanPSMT="Times-Roman";t["TimesNewRomanPSMT-Bold"]="Times-Bold";t["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic";t["TimesNewRomanPSMT-Italic"]="Times-Italic"}));r.getStdFontMap=u;var h=(0,c.getLookupTableFactory)((function(t){t.Courier="FoxitFixed.pfb";t["Courier-Bold"]="FoxitFixedBold.pfb";t["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb";t["Courier-Oblique"]="FoxitFixedItalic.pfb";t.Helvetica="FoxitSans.pfb";t["Helvetica-Bold"]="FoxitSansBold.pfb";t["Helvetica-BoldOblique"]="FoxitSansBoldItalic.pfb";t["Helvetica-Oblique"]="FoxitSansItalic.pfb";t["Times-Roman"]="FoxitSerif.pfb";t["Times-Bold"]="FoxitSerifBold.pfb";t["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb";t["Times-Italic"]="FoxitSerifItalic.pfb";t.Symbol="FoxitSymbol.pfb";t.ZapfDingbats="FoxitDingbats.pfb";t["LiberationSans-Regular"]="LiberationSans-Regular.ttf";t["LiberationSans-Bold"]="LiberationSans-Bold.ttf";t["LiberationSans-Italic"]="LiberationSans-Italic.ttf";t["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}));r.getFontNameToFileMap=h;var d=(0,c.getLookupTableFactory)((function(t){t.Calibri="Helvetica";t["Calibri-Bold"]="Helvetica-Bold";t["Calibri-BoldItalic"]="Helvetica-BoldOblique";t["Calibri-Italic"]="Helvetica-Oblique";t.CenturyGothic="Helvetica";t["CenturyGothic-Bold"]="Helvetica-Bold";t["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique";t["CenturyGothic-Italic"]="Helvetica-Oblique";t.ComicSansMS="Comic Sans MS";t["ComicSansMS-Bold"]="Comic Sans MS-Bold";t["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic";t["ComicSansMS-Italic"]="Comic Sans MS-Italic";t["ItcSymbol-Bold"]="Helvetica-Bold";t["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique";t["ItcSymbol-Book"]="Helvetica";t["ItcSymbol-BookItalic"]="Helvetica-Oblique";t["ItcSymbol-Medium"]="Helvetica";t["ItcSymbol-MediumItalic"]="Helvetica-Oblique";t.LucidaConsole="Courier";t["LucidaConsole-Bold"]="Courier-Bold";t["LucidaConsole-BoldItalic"]="Courier-BoldOblique";t["LucidaConsole-Italic"]="Courier-Oblique";t["LucidaSans-Demi"]="Helvetica-Bold";t["MS-Gothic"]="MS Gothic";t["MS-Gothic-Bold"]="MS Gothic-Bold";t["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic";t["MS-Gothic-Italic"]="MS Gothic-Italic";t["MS-Mincho"]="MS Mincho";t["MS-Mincho-Bold"]="MS Mincho-Bold";t["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic";t["MS-Mincho-Italic"]="MS Mincho-Italic";t["MS-PGothic"]="MS PGothic";t["MS-PGothic-Bold"]="MS PGothic-Bold";t["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic";t["MS-PGothic-Italic"]="MS PGothic-Italic";t["MS-PMincho"]="MS PMincho";t["MS-PMincho-Bold"]="MS PMincho-Bold";t["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic";t["MS-PMincho-Italic"]="MS PMincho-Italic";t.NuptialScript="Times-Italic";t.SegoeUISymbol="Helvetica";t.Wingdings="ZapfDingbats";t["Wingdings-Regular"]="ZapfDingbats"}));r.getNonStdFontMap=d;var g=(0,c.getLookupTableFactory)((function(t){t["Adobe Jenson"]=!0;t["Adobe Text"]=!0;t.Albertus=!0;t.Aldus=!0;t.Alexandria=!0;t.Algerian=!0;t["American Typewriter"]=!0;t.Antiqua=!0;t.Apex=!0;t.Arno=!0;t.Aster=!0;t.Aurora=!0;t.Baskerville=!0;t.Bell=!0;t.Bembo=!0;t["Bembo Schoolbook"]=!0;t.Benguiat=!0;t["Berkeley Old Style"]=!0;t["Bernhard Modern"]=!0;t["Berthold City"]=!0;t.Bodoni=!0;t["Bauer Bodoni"]=!0;t["Book Antiqua"]=!0;t.Bookman=!0;t["Bordeaux Roman"]=!0;t["Californian FB"]=!0;t.Calisto=!0;t.Calvert=!0;t.Capitals=!0;t.Cambria=!0;t.Cartier=!0;t.Caslon=!0;t.Catull=!0;t.Centaur=!0;t["Century Old Style"]=!0;t["Century Schoolbook"]=!0;t.Chaparral=!0;t["Charis SIL"]=!0;t.Cheltenham=!0;t["Cholla Slab"]=!0;t.Clarendon=!0;t.Clearface=!0;t.Cochin=!0;t.Colonna=!0;t["Computer Modern"]=!0;t["Concrete Roman"]=!0;t.Constantia=!0;t["Cooper Black"]=!0;t.Corona=!0;t.Ecotype=!0;t.Egyptienne=!0;t.Elephant=!0;t.Excelsior=!0;t.Fairfield=!0;t["FF Scala"]=!0;t.Folkard=!0;t.Footlight=!0;t.FreeSerif=!0;t["Friz Quadrata"]=!0;t.Garamond=!0;t.Gentium=!0;t.Georgia=!0;t.Gloucester=!0;t["Goudy Old Style"]=!0;t["Goudy Schoolbook"]=!0;t["Goudy Pro Font"]=!0;t.Granjon=!0;t["Guardian Egyptian"]=!0;t.Heather=!0;t.Hercules=!0;t["High Tower Text"]=!0;t.Hiroshige=!0;t["Hoefler Text"]=!0;t["Humana Serif"]=!0;t.Imprint=!0;t["Ionic No. 5"]=!0;t.Janson=!0;t.Joanna=!0;t.Korinna=!0;t.Lexicon=!0;t.LiberationSerif=!0;t["Liberation Serif"]=!0;t["Linux Libertine"]=!0;t.Literaturnaya=!0;t.Lucida=!0;t["Lucida Bright"]=!0;t.Melior=!0;t.Memphis=!0;t.Miller=!0;t.Minion=!0;t.Modern=!0;t["Mona Lisa"]=!0;t["Mrs Eaves"]=!0;t["MS Serif"]=!0;t["Museo Slab"]=!0;t["New York"]=!0;t["Nimbus Roman"]=!0;t["NPS Rawlinson Roadway"]=!0;t.NuptialScript=!0;t.Palatino=!0;t.Perpetua=!0;t.Plantin=!0;t["Plantin Schoolbook"]=!0;t.Playbill=!0;t["Poor Richard"]=!0;t["Rawlinson Roadway"]=!0;t.Renault=!0;t.Requiem=!0;t.Rockwell=!0;t.Roman=!0;t["Rotis Serif"]=!0;t.Sabon=!0;t.Scala=!0;t.Seagull=!0;t.Sistina=!0;t.Souvenir=!0;t.STIX=!0;t["Stone Informal"]=!0;t["Stone Serif"]=!0;t.Sylfaen=!0;t.Times=!0;t.Trajan=!0;t["Trinité"]=!0;t["Trump Mediaeval"]=!0;t.Utopia=!0;t["Vale Type"]=!0;t["Bitstream Vera"]=!0;t["Vera Serif"]=!0;t.Versailles=!0;t.Wanted=!0;t.Weiss=!0;t["Wide Latin"]=!0;t.Windsor=!0;t.XITS=!0}));r.getSerifFonts=g;var m=(0,c.getLookupTableFactory)((function(t){t.Dingbats=!0;t.Symbol=!0;t.ZapfDingbats=!0}));r.getSymbolsFonts=m;var y=(0,c.getLookupTableFactory)((function(t){t[2]=10;t[3]=32;t[4]=33;t[5]=34;t[6]=35;t[7]=36;t[8]=37;t[9]=38;t[10]=39;t[11]=40;t[12]=41;t[13]=42;t[14]=43;t[15]=44;t[16]=45;t[17]=46;t[18]=47;t[19]=48;t[20]=49;t[21]=50;t[22]=51;t[23]=52;t[24]=53;t[25]=54;t[26]=55;t[27]=56;t[28]=57;t[29]=58;t[30]=894;t[31]=60;t[32]=61;t[33]=62;t[34]=63;t[35]=64;t[36]=65;t[37]=66;t[38]=67;t[39]=68;t[40]=69;t[41]=70;t[42]=71;t[43]=72;t[44]=73;t[45]=74;t[46]=75;t[47]=76;t[48]=77;t[49]=78;t[50]=79;t[51]=80;t[52]=81;t[53]=82;t[54]=83;t[55]=84;t[56]=85;t[57]=86;t[58]=87;t[59]=88;t[60]=89;t[61]=90;t[62]=91;t[63]=92;t[64]=93;t[65]=94;t[66]=95;t[67]=96;t[68]=97;t[69]=98;t[70]=99;t[71]=100;t[72]=101;t[73]=102;t[74]=103;t[75]=104;t[76]=105;t[77]=106;t[78]=107;t[79]=108;t[80]=109;t[81]=110;t[82]=111;t[83]=112;t[84]=113;t[85]=114;t[86]=115;t[87]=116;t[88]=117;t[89]=118;t[90]=119;t[91]=120;t[92]=121;t[93]=122;t[94]=123;t[95]=124;t[96]=125;t[97]=126;t[98]=196;t[99]=197;t[100]=199;t[101]=201;t[102]=209;t[103]=214;t[104]=220;t[105]=225;t[106]=224;t[107]=226;t[108]=228;t[109]=227;t[110]=229;t[111]=231;t[112]=233;t[113]=232;t[114]=234;t[115]=235;t[116]=237;t[117]=236;t[118]=238;t[119]=239;t[120]=241;t[121]=243;t[122]=242;t[123]=244;t[124]=246;t[125]=245;t[126]=250;t[127]=249;t[128]=251;t[129]=252;t[130]=8224;t[131]=176;t[132]=162;t[133]=163;t[134]=167;t[135]=8226;t[136]=182;t[137]=223;t[138]=174;t[139]=169;t[140]=8482;t[141]=180;t[142]=168;t[143]=8800;t[144]=198;t[145]=216;t[146]=8734;t[147]=177;t[148]=8804;t[149]=8805;t[150]=165;t[151]=181;t[152]=8706;t[153]=8721;t[154]=8719;t[156]=8747;t[157]=170;t[158]=186;t[159]=8486;t[160]=230;t[161]=248;t[162]=191;t[163]=161;t[164]=172;t[165]=8730;t[166]=402;t[167]=8776;t[168]=8710;t[169]=171;t[170]=187;t[171]=8230;t[200]=193;t[203]=205;t[210]=218;t[223]=711;t[224]=321;t[225]=322;t[226]=352;t[227]=353;t[228]=381;t[229]=382;t[233]=221;t[234]=253;t[252]=263;t[253]=268;t[254]=269;t[258]=258;t[260]=260;t[261]=261;t[265]=280;t[266]=281;t[267]=282;t[268]=283;t[269]=313;t[275]=323;t[276]=324;t[278]=328;t[283]=344;t[284]=345;t[285]=346;t[286]=347;t[292]=367;t[295]=377;t[296]=378;t[298]=380;t[305]=963;t[306]=964;t[307]=966;t[308]=8215;t[309]=8252;t[310]=8319;t[311]=8359;t[312]=8592;t[313]=8593;t[337]=9552;t[493]=1039;t[494]=1040;t[705]=1524;t[706]=8362;t[710]=64288;t[711]=64298;t[759]=1617;t[761]=1776;t[763]=1778;t[775]=1652;t[777]=1764;t[778]=1780;t[779]=1781;t[780]=1782;t[782]=771;t[783]=64726;t[786]=8363;t[788]=8532;t[790]=768;t[791]=769;t[792]=768;t[795]=803;t[797]=64336;t[798]=64337;t[799]=64342;t[800]=64343;t[801]=64344;t[802]=64345;t[803]=64362;t[804]=64363;t[805]=64364;t[2424]=7821;t[2425]=7822;t[2426]=7823;t[2427]=7824;t[2428]=7825;t[2429]=7826;t[2430]=7827;t[2433]=7682;t[2678]=8045;t[2679]=8046;t[2830]=1552;t[2838]=686;t[2840]=751;t[2842]=753;t[2843]=754;t[2844]=755;t[2846]=757;t[2856]=767;t[2857]=848;t[2858]=849;t[2862]=853;t[2863]=854;t[2864]=855;t[2865]=861;t[2866]=862;t[2906]=7460;t[2908]=7462;t[2909]=7463;t[2910]=7464;t[2912]=7466;t[2913]=7467;t[2914]=7468;t[2916]=7470;t[2917]=7471;t[2918]=7472;t[2920]=7474;t[2921]=7475;t[2922]=7476;t[2924]=7478;t[2925]=7479;t[2926]=7480;t[2928]=7482;t[2929]=7483;t[2930]=7484;t[2932]=7486;t[2933]=7487;t[2934]=7488;t[2936]=7490;t[2937]=7491;t[2938]=7492;t[2940]=7494;t[2941]=7495;t[2942]=7496;t[2944]=7498;t[2946]=7500;t[2948]=7502;t[2950]=7504;t[2951]=7505;t[2952]=7506;t[2954]=7508;t[2955]=7509;t[2956]=7510;t[2958]=7512;t[2959]=7513;t[2960]=7514;t[2962]=7516;t[2963]=7517;t[2964]=7518;t[2966]=7520;t[2967]=7521;t[2968]=7522;t[2970]=7524;t[2971]=7525;t[2972]=7526;t[2974]=7528;t[2975]=7529;t[2976]=7530;t[2978]=1537;t[2979]=1538;t[2980]=1539;t[2982]=1549;t[2983]=1551;t[2984]=1552;t[2986]=1554;t[2987]=1555;t[2988]=1556;t[2990]=1623;t[2991]=1624;t[2995]=1775;t[2999]=1791;t[3002]=64290;t[3003]=64291;t[3004]=64292;t[3006]=64294;t[3007]=64295;t[3008]=64296;t[3011]=1900;t[3014]=8223;t[3015]=8244;t[3017]=7532;t[3018]=7533;t[3019]=7534;t[3075]=7590;t[3076]=7591;t[3079]=7594;t[3080]=7595;t[3083]=7598;t[3084]=7599;t[3087]=7602;t[3088]=7603;t[3091]=7606;t[3092]=7607;t[3095]=7610;t[3096]=7611;t[3099]=7614;t[3100]=7615;t[3103]=7618;t[3104]=7619;t[3107]=8337;t[3108]=8338;t[3116]=1884;t[3119]=1885;t[3120]=1885;t[3123]=1886;t[3124]=1886;t[3127]=1887;t[3128]=1887;t[3131]=1888;t[3132]=1888;t[3135]=1889;t[3136]=1889;t[3139]=1890;t[3140]=1890;t[3143]=1891;t[3144]=1891;t[3147]=1892;t[3148]=1892;t[3153]=580;t[3154]=581;t[3157]=584;t[3158]=585;t[3161]=588;t[3162]=589;t[3165]=891;t[3166]=892;t[3169]=1274;t[3170]=1275;t[3173]=1278;t[3174]=1279;t[3181]=7622;t[3182]=7623;t[3282]=11799;t[3316]=578;t[3379]=42785;t[3393]=1159;t[3416]=8377}));r.getGlyphMapForStandardFonts=y;var v=(0,c.getLookupTableFactory)((function(t){t[227]=322;t[264]=261;t[291]=346}));r.getSupplementalGlyphMapForArialBlack=v;var k=(0,c.getLookupTableFactory)((function(t){t[1]=32;t[4]=65;t[6]=193;t[17]=66;t[18]=67;t[21]=268;t[24]=68;t[28]=69;t[30]=201;t[32]=282;t[38]=70;t[39]=71;t[44]=72;t[47]=73;t[49]=205;t[58]=74;t[60]=75;t[62]=76;t[68]=77;t[69]=78;t[75]=79;t[87]=80;t[89]=81;t[90]=82;t[92]=344;t[94]=83;t[97]=352;t[100]=84;t[104]=85;t[115]=86;t[116]=87;t[121]=88;t[122]=89;t[124]=221;t[127]=90;t[129]=381;t[258]=97;t[260]=225;t[268]=261;t[271]=98;t[272]=99;t[273]=263;t[275]=269;t[282]=100;t[286]=101;t[288]=233;t[290]=283;t[295]=281;t[296]=102;t[336]=103;t[346]=104;t[349]=105;t[351]=237;t[361]=106;t[364]=107;t[367]=108;t[371]=322;t[373]=109;t[374]=110;t[381]=111;t[383]=243;t[393]=112;t[395]=113;t[396]=114;t[398]=345;t[400]=115;t[401]=347;t[403]=353;t[410]=116;t[437]=117;t[448]=118;t[449]=119;t[454]=120;t[455]=121;t[457]=253;t[460]=122;t[462]=382;t[463]=380;t[853]=44;t[855]=58;t[856]=46;t[876]=47;t[878]=45;t[882]=45;t[894]=40;t[895]=41;t[896]=91;t[897]=93;t[923]=64;t[1004]=48;t[1005]=49;t[1006]=50;t[1007]=51;t[1008]=52;t[1009]=53;t[1010]=54;t[1011]=55;t[1012]=56;t[1013]=57;t[1081]=37;t[1085]=43;t[1086]=45}));r.getSupplementalGlyphMapForCalibri=k},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ToUnicodeMap=r.IdentityToUnicodeMap=void 0;var c=o(4);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var l=function(){function ToUnicodeMap(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];_classCallCheck(this,ToUnicodeMap);this._map=t}_createClass(ToUnicodeMap,[{key:"length",get:function get(){return this._map.length}},{key:"forEach",value:function forEach(t){for(var r in this._map)t(r,this._map[r].charCodeAt(0))}},{key:"has",value:function has(t){return void 0!==this._map[t]}},{key:"get",value:function get(t){return this._map[t]}},{key:"charCodeOf",value:function charCodeOf(t){var r=this._map;if(r.length<=65536)return r.indexOf(t);for(var o in r)if(r[o]===t)return 0|o;return-1}},{key:"amend",value:function amend(t){for(var r in t)this._map[r]=t[r]}}]);return ToUnicodeMap}();r.ToUnicodeMap=l;var u=function(){function IdentityToUnicodeMap(t,r){_classCallCheck(this,IdentityToUnicodeMap);this.firstChar=t;this.lastChar=r}_createClass(IdentityToUnicodeMap,[{key:"length",get:function get(){return this.lastChar+1-this.firstChar}},{key:"forEach",value:function forEach(t){for(var r=this.firstChar,o=this.lastChar;r<=o;r++)t(r,r)}},{key:"has",value:function has(t){return this.firstChar<=t&&t<=this.lastChar}},{key:"get",value:function get(t){if(this.firstChar<=t&&t<=this.lastChar)return String.fromCharCode(t)}},{key:"charCodeOf",value:function charCodeOf(t){return Number.isInteger(t)&&t>=this.firstChar&&t<=this.lastChar?t:-1}},{key:"amend",value:function amend(t){(0,c.unreachable)("Should not call amend()")}}]);return IdentityToUnicodeMap}();r.IdentityToUnicodeMap=u},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CFFFont=void 0;var c=o(186),l=o(159),u=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var h=function(){function CFFFont(t,r){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,CFFFont);this.properties=r;var o=new c.CFFParser(t,r,l.SEAC_ANALYSIS_ENABLED);this.cff=o.parse();this.cff.duplicateFirstGlyph();var h=new c.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=h.compile()}catch(o){(0,u.warn)("Failed to compile font "+r.loadedName);this.data=t}this._createBuiltInEncoding()}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(CFFFont,[{key:"numGlyphs",get:function get(){return this.cff.charStrings.count}},{key:"getCharset",value:function getCharset(){return this.cff.charset.charset}},{key:"getGlyphMapping",value:function getGlyphMapping(){var t,r,o=this.cff,c=this.properties,u=o.charset.charset;if(c.composite){t=Object.create(null);if(o.isCIDFont)for(r=0;r<u.length;r++){var h=u[r];t[c.cMap.charCodeOf(h)]=r}else for(r=0;r<o.charStrings.count;r++)t[c.cMap.charCodeOf(r)]=r;return t}var d=o.encoding?o.encoding.encoding:null;c.isInternalFont&&(d=c.defaultEncoding);return t=(0,l.type1FontGlyphMapping)(c,d,u)}},{key:"hasGlyphId",value:function hasGlyphId(t){return this.cff.hasGlyphId(t)}},{key:"_createBuiltInEncoding",value:function _createBuiltInEncoding(){var t=this.cff,r=t.charset,o=t.encoding;if(r&&o){var c=r.charset,l=o.encoding,u=[];for(var h in l){var d=l[h];if(d>=0){var g=c[d];g&&(u[h]=g)}}u.length>0&&(this.properties.builtInEncoding=u)}}}]);return CFFFont}();r.CFFFont=h},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.FontRendererFactory=void 0;var c=o(4),l=o(186),u=o(161),h=o(160),d=o(151);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function getUint32(t,r){return(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}function getUint16(t,r){return t[r]<<8|t[r+1]}function getInt16(t,r){return(t[r]<<24|t[r+1]<<16)>>16}function getInt8(t,r){return t[r]<<24>>24}function getFloat214(t,r){return getInt16(t,r)/16384}function getSubroutineBias(t){var r=t.length,o=32768;r<1240?o=107:r<33900&&(o=1131);return o}function parseCmap(t,r,o){var l,u,h,d=1===getUint16(t,r+2)?getUint32(t,r+8):getUint32(t,r+16),g=getUint16(t,r+d);if(4===g){getUint16(t,r+d+2);var m=getUint16(t,r+d+6)>>1;u=r+d+14;l=[];for(h=0;h<m;h++,u+=2)l[h]={end:getUint16(t,u)};u+=2;for(h=0;h<m;h++,u+=2)l[h].start=getUint16(t,u);for(h=0;h<m;h++,u+=2)l[h].idDelta=getUint16(t,u);for(h=0;h<m;h++,u+=2){var y=getUint16(t,u);if(0!==y){l[h].ids=[];for(var v=0,k=l[h].end-l[h].start+1;v<k;v++){l[h].ids[v]=getUint16(t,u+y);y+=2}}}return l}if(12===g){var _=getUint32(t,r+d+12);u=r+d+16;l=[];for(h=0;h<_;h++){r=getUint32(t,u);l.push({start:r,end:getUint32(t,u+4),idDelta:getUint32(t,u+8)-r});u+=12}return l}throw new c.FormatError("unsupported cmap: ".concat(g))}function parseCff(t,r,o,c){var u=new l.CFFParser(new d.Stream(t,r,o-r),{},c).parse();return{glyphs:u.charStrings.objects,subrs:u.topDict.privateDict&&u.topDict.privateDict.subrsIndex&&u.topDict.privateDict.subrsIndex.objects,gsubrs:u.globalSubrIndex&&u.globalSubrIndex.objects,isCFFCIDFont:u.isCIDFont,fdSelect:u.fdSelect,fdArray:u.fdArray}}function lookupCmap(t,r){for(var o=r.codePointAt(0),c=0,l=0,u=t.length-1;l<u;){var h=l+u+1>>1;o<t[h].start?u=h-1:l=h}t[l].start<=o&&o<=t[l].end&&(c=t[l].idDelta+(t[l].ids?t[l].ids[o-t[l].start]:o)&65535);return{charCode:o,glyphId:c}}function compileGlyf(t,r,o){function moveTo(t,o){r.push({cmd:"moveTo",args:[t,o]})}function lineTo(t,o){r.push({cmd:"lineTo",args:[t,o]})}function quadraticCurveTo(t,o,c,l){r.push({cmd:"quadraticCurveTo",args:[t,o,c,l]})}var c,l=0,u=getInt16(t,l),h=0,d=0;l+=10;if(u<0)do{c=getUint16(t,l);var g=getUint16(t,l+2);l+=4;var m=void 0,y=void 0;if(1&c){if(2&c){m=getInt16(t,l);y=getInt16(t,l+2)}else{m=getUint16(t,l);y=getUint16(t,l+2)}l+=4}else if(2&c){m=getInt8(t,l++);y=getInt8(t,l++)}else{m=t[l++];y=t[l++]}if(2&c){h=m;d=y}else{h=0;d=0}var v=1,k=1,_=0,w=0;if(8&c){v=k=getFloat214(t,l);l+=2}else if(64&c){v=getFloat214(t,l);k=getFloat214(t,l+2);l+=4}else if(128&c){v=getFloat214(t,l);_=getFloat214(t,l+2);w=getFloat214(t,l+4);k=getFloat214(t,l+6);l+=8}var S=o.glyphs[g];if(S){r.push({cmd:"save"},{cmd:"transform",args:[v,_,w,k,h,d]});compileGlyf(S,r,o);r.push({cmd:"restore"})}}while(32&c);else{var C,x,O=[];for(C=0;C<u;C++){O.push(getUint16(t,l));l+=2}l+=2+getUint16(t,l);for(var T=O[O.length-1]+1,E=[];E.length<T;){var M=1;8&(c=t[l++])&&(M+=t[l++]);for(;M-- >0;)E.push({flags:c})}for(C=0;C<T;C++){switch(18&E[C].flags){case 0:h+=getInt16(t,l);l+=2;break;case 2:h-=t[l++];break;case 18:h+=t[l++]}E[C].x=h}for(C=0;C<T;C++){switch(36&E[C].flags){case 0:d+=getInt16(t,l);l+=2;break;case 4:d-=t[l++];break;case 36:d+=t[l++]}E[C].y=d}var R=0;for(l=0;l<u;l++){var j=O[l],D=E.slice(R,j+1);if(1&D[0].flags)D.push(D[0]);else if(1&D[D.length-1].flags)D.unshift(D[D.length-1]);else{var L={flags:1,x:(D[0].x+D[D.length-1].x)/2,y:(D[0].y+D[D.length-1].y)/2};D.unshift(L);D.push(L)}moveTo(D[0].x,D[0].y);for(C=1,x=D.length;C<x;C++)if(1&D[C].flags)lineTo(D[C].x,D[C].y);else if(1&D[C+1].flags){quadraticCurveTo(D[C].x,D[C].y,D[C+1].x,D[C+1].y);C++}else quadraticCurveTo(D[C].x,D[C].y,(D[C].x+D[C+1].x)/2,(D[C].y+D[C+1].y)/2);R=j+1}}}function compileCharString(t,r,o,l){function moveTo(t,o){r.push({cmd:"moveTo",args:[t,o]})}function lineTo(t,o){r.push({cmd:"lineTo",args:[t,o]})}function bezierCurveTo(t,o,c,l,u,h){r.push({cmd:"bezierCurveTo",args:[t,o,c,l,u,h]})}var u=[],d=0,g=0,m=0;!function parse(t){for(var y=0;y<t.length;){var v=!1,k=t[y++],_=void 0,w=void 0,S=void 0,C=void 0,x=void 0,O=void 0,T=void 0,E=void 0;switch(k){case 1:case 3:case 18:case 23:m+=u.length>>1;v=!0;break;case 4:g+=u.pop();moveTo(d,g);v=!0;break;case 5:for(;u.length>0;){d+=u.shift();g+=u.shift();lineTo(d,g)}break;case 6:for(;u.length>0;){lineTo(d+=u.shift(),g);if(0===u.length)break;g+=u.shift();lineTo(d,g)}break;case 7:for(;u.length>0;){g+=u.shift();lineTo(d,g);if(0===u.length)break;lineTo(d+=u.shift(),g)}break;case 8:for(;u.length>0;){_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d,g)}break;case 10:T=u.pop();E=null;if(o.isCFFCIDFont){var M=o.fdSelect.getFDIndex(l);if(M>=0&&M<o.fdArray.length){var R=o.fdArray[M],j=void 0;R.privateDict&&R.privateDict.subrsIndex&&(j=R.privateDict.subrsIndex.objects);j&&(E=j[T+=getSubroutineBias(j)])}else(0,c.warn)("Invalid fd index for glyph index.")}else E=o.subrs[T+o.subrsBias];E&&parse(E);break;case 11:return;case 12:switch(k=t[y++]){case 34:w=(_=d+u.shift())+u.shift();x=g+u.shift();d=w+u.shift();bezierCurveTo(_,g,w,x,d,x);w=(_=d+u.shift())+u.shift();d=w+u.shift();bezierCurveTo(_,x,w,g,d,g);break;case 35:_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d,g);_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d,g);u.pop();break;case 36:bezierCurveTo(_=d+u.shift(),x=g+u.shift(),w=_+u.shift(),O=x+u.shift(),d=w+u.shift(),O);bezierCurveTo(_=d+u.shift(),O,w=_+u.shift(),O+u.shift(),d=w+u.shift(),g);break;case 37:var D=d,L=g;_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d,g);_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w;g=C;Math.abs(d-D)>Math.abs(g-L)?d+=u.shift():g+=u.shift();bezierCurveTo(_,S,w,C,d,g);break;default:throw new c.FormatError("unknown operator: 12 ".concat(k))}break;case 14:if(u.length>=4){var N=u.pop(),U=u.pop();g=u.pop();d=u.pop();r.push({cmd:"save"},{cmd:"translate",args:[d,g]});var H=lookupCmap(o.cmap,String.fromCharCode(o.glyphNameMap[h.StandardEncoding[N]]));compileCharString(o.glyphs[H.glyphId],r,o,H.glyphId);r.push({cmd:"restore"});H=lookupCmap(o.cmap,String.fromCharCode(o.glyphNameMap[h.StandardEncoding[U]]));compileCharString(o.glyphs[H.glyphId],r,o,H.glyphId)}return;case 19:case 20:y+=(m+=u.length>>1)+7>>3;v=!0;break;case 21:g+=u.pop();moveTo(d+=u.pop(),g);v=!0;break;case 22:moveTo(d+=u.pop(),g);v=!0;break;case 24:for(;u.length>2;){_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d,g)}d+=u.shift();g+=u.shift();lineTo(d,g);break;case 25:for(;u.length>6;){d+=u.shift();g+=u.shift();lineTo(d,g)}_=d+u.shift();S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d,g);break;case 26:u.length%2&&(d+=u.shift());for(;u.length>0;){_=d;S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w;g=C+u.shift();bezierCurveTo(_,S,w,C,d,g)}break;case 27:u.length%2&&(g+=u.shift());for(;u.length>0;)bezierCurveTo(_=d+u.shift(),S=g,w=_+u.shift(),C=S+u.shift(),d=w+u.shift(),g=C);break;case 28:u.push((t[y]<<24|t[y+1]<<16)>>16);y+=2;break;case 29:T=u.pop()+o.gsubrsBias;(E=o.gsubrs[T])&&parse(E);break;case 30:for(;u.length>0;){_=d;S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+(1===u.length?u.shift():0);bezierCurveTo(_,S,w,C,d,g);if(0===u.length)break;_=d+u.shift();S=g;w=_+u.shift();C=S+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d=w+(1===u.length?u.shift():0),g)}break;case 31:for(;u.length>0;){_=d+u.shift();S=g;w=_+u.shift();C=S+u.shift();g=C+u.shift();bezierCurveTo(_,S,w,C,d=w+(1===u.length?u.shift():0),g);if(0===u.length)break;_=d;S=g+u.shift();w=_+u.shift();C=S+u.shift();d=w+u.shift();g=C+(1===u.length?u.shift():0);bezierCurveTo(_,S,w,C,d,g)}break;default:if(k<32)throw new c.FormatError("unknown operator: ".concat(k));if(k<247)u.push(k-139);else if(k<251)u.push(256*(k-247)+t[y++]+108);else if(k<255)u.push(256*-(k-251)-t[y++]-108);else{u.push((t[y]<<24|t[y+1]<<16|t[y+2]<<8|t[y+3])/65536);y+=4}}v&&(u.length=0)}}(t)}var g=[],m=function(){function CompiledFont(t){_classCallCheck(this,CompiledFont);this.constructor===CompiledFont&&(0,c.unreachable)("Cannot initialize CompiledFont.");this.fontMatrix=t;this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null)}_createClass(CompiledFont,[{key:"getPathJs",value:function getPathJs(t){var r=lookupCmap(this.cmap,t),o=r.charCode,c=r.glyphId,l=this.compiledGlyphs[c];if(!l)try{l=this.compileGlyph(this.glyphs[c],c);this.compiledGlyphs[c]=l}catch(t){this.compiledGlyphs[c]=g;void 0===this.compiledCharCodeToGlyphId[o]&&(this.compiledCharCodeToGlyphId[o]=c);throw t}void 0===this.compiledCharCodeToGlyphId[o]&&(this.compiledCharCodeToGlyphId[o]=c);return l}},{key:"compileGlyph",value:function compileGlyph(t,r){if(!t||0===t.length||14===t[0])return g;var o=this.fontMatrix;if(this.isCFFCIDFont){var l=this.fdSelect.getFDIndex(r);if(l>=0&&l<this.fdArray.length){o=this.fdArray[l].getByName("FontMatrix")||c.FONT_IDENTITY_MATRIX}else(0,c.warn)("Invalid fd index for glyph index.")}var u=[{cmd:"save"},{cmd:"transform",args:o.slice()},{cmd:"scale",args:["size","-size"]}];this.compileGlyphImpl(t,u,r);u.push({cmd:"restore"});return u}},{key:"compileGlyphImpl",value:function compileGlyphImpl(){(0,c.unreachable)("Children classes should implement this.")}},{key:"hasBuiltPath",value:function hasBuiltPath(t){var r=lookupCmap(this.cmap,t),o=r.charCode,c=r.glyphId;return void 0!==this.compiledGlyphs[c]&&void 0!==this.compiledCharCodeToGlyphId[o]}}]);return CompiledFont}(),y=function(t){_inherits(TrueTypeCompiled,t);var r=_createSuper(TrueTypeCompiled);function TrueTypeCompiled(t,o,c){var l;_classCallCheck(this,TrueTypeCompiled);(l=r.call(this,c||[488e-6,0,0,488e-6,0,0])).glyphs=t;l.cmap=o;return l}_createClass(TrueTypeCompiled,[{key:"compileGlyphImpl",value:function compileGlyphImpl(t,r){compileGlyf(t,r,this)}}]);return TrueTypeCompiled}(m),v=function(t){_inherits(Type2Compiled,t);var r=_createSuper(Type2Compiled);function Type2Compiled(t,o,c,l){var h;_classCallCheck(this,Type2Compiled);(h=r.call(this,c||[.001,0,0,.001,0,0])).glyphs=t.glyphs;h.gsubrs=t.gsubrs||[];h.subrs=t.subrs||[];h.cmap=o;h.glyphNameMap=l||(0,u.getGlyphsUnicode)();h.gsubrsBias=getSubroutineBias(h.gsubrs);h.subrsBias=getSubroutineBias(h.subrs);h.isCFFCIDFont=t.isCFFCIDFont;h.fdSelect=t.fdSelect;h.fdArray=t.fdArray;return h}_createClass(Type2Compiled,[{key:"compileGlyphImpl",value:function compileGlyphImpl(t,r,o){compileCharString(t,r,this,o)}}]);return Type2Compiled}(m),k=function(){function FontRendererFactory(){_classCallCheck(this,FontRendererFactory)}_createClass(FontRendererFactory,null,[{key:"create",value:function create(t,r){for(var o,l,u,h,d,g,m=new Uint8Array(t.data),k=getUint16(m,4),_=0,w=12;_<k;_++,w+=16){var S=(0,c.bytesToString)(m.subarray(w,w+4)),C=getUint32(m,w+8),x=getUint32(m,w+12);switch(S){case"cmap":o=parseCmap(m,C);break;case"glyf":l=m.subarray(C,C+x);break;case"loca":u=m.subarray(C,C+x);break;case"head":g=getUint16(m,C+18);d=getUint16(m,C+50);break;case"CFF ":h=parseCff(m,C,C+x,r)}}if(l){var O=g?[1/g,0,0,1/g,0,0]:t.fontMatrix;return new y(function parseGlyfTable(t,r,o){var c,l;if(o){c=4;l=getUint32}else{c=2;l=function itemDecode(t,r){return 2*getUint16(t,r)}}for(var u=[],h=l(r,0),d=c;d<r.length;d+=c){var g=l(r,d);u.push(t.subarray(h,g));h=g}return u}(l,u,d),o,O)}return new v(h,o,t.fontMatrix,t.glyphNameMap)}}]);return FontRendererFactory}();r.FontRendererFactory=k},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.getMetrics=r.getFontBasicMetrics=void 0;var c=o(149),l=(0,c.getLookupTableFactory)((function(t){t.Courier=600;t["Courier-Bold"]=600;t["Courier-BoldOblique"]=600;t["Courier-Oblique"]=600;t.Helvetica=(0,c.getLookupTableFactory)((function(t){t.space=278;t.exclam=278;t.quotedbl=355;t.numbersign=556;t.dollar=556;t.percent=889;t.ampersand=667;t.quoteright=222;t.parenleft=333;t.parenright=333;t.asterisk=389;t.plus=584;t.comma=278;t.hyphen=333;t.period=278;t.slash=278;t.zero=556;t.one=556;t.two=556;t.three=556;t.four=556;t.five=556;t.six=556;t.seven=556;t.eight=556;t.nine=556;t.colon=278;t.semicolon=278;t.less=584;t.equal=584;t.greater=584;t.question=556;t.at=1015;t.A=667;t.B=667;t.C=722;t.D=722;t.E=667;t.F=611;t.G=778;t.H=722;t.I=278;t.J=500;t.K=667;t.L=556;t.M=833;t.N=722;t.O=778;t.P=667;t.Q=778;t.R=722;t.S=667;t.T=611;t.U=722;t.V=667;t.W=944;t.X=667;t.Y=667;t.Z=611;t.bracketleft=278;t.backslash=278;t.bracketright=278;t.asciicircum=469;t.underscore=556;t.quoteleft=222;t.a=556;t.b=556;t.c=500;t.d=556;t.e=556;t.f=278;t.g=556;t.h=556;t.i=222;t.j=222;t.k=500;t.l=222;t.m=833;t.n=556;t.o=556;t.p=556;t.q=556;t.r=333;t.s=500;t.t=278;t.u=556;t.v=500;t.w=722;t.x=500;t.y=500;t.z=500;t.braceleft=334;t.bar=260;t.braceright=334;t.asciitilde=584;t.exclamdown=333;t.cent=556;t.sterling=556;t.fraction=167;t.yen=556;t.florin=556;t.section=556;t.currency=556;t.quotesingle=191;t.quotedblleft=333;t.guillemotleft=556;t.guilsinglleft=333;t.guilsinglright=333;t.fi=500;t.fl=500;t.endash=556;t.dagger=556;t.daggerdbl=556;t.periodcentered=278;t.paragraph=537;t.bullet=350;t.quotesinglbase=222;t.quotedblbase=333;t.quotedblright=333;t.guillemotright=556;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=611;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=1e3;t.ordfeminine=370;t.Lslash=556;t.Oslash=778;t.OE=1e3;t.ordmasculine=365;t.ae=889;t.dotlessi=278;t.lslash=222;t.oslash=611;t.oe=944;t.germandbls=611;t.Idieresis=278;t.eacute=556;t.abreve=556;t.uhungarumlaut=556;t.ecaron=556;t.Ydieresis=667;t.divide=584;t.Yacute=667;t.Acircumflex=667;t.aacute=556;t.Ucircumflex=722;t.yacute=500;t.scommaaccent=500;t.ecircumflex=556;t.Uring=722;t.Udieresis=722;t.aogonek=556;t.Uacute=722;t.uogonek=556;t.Edieresis=667;t.Dcroat=722;t.commaaccent=250;t.copyright=737;t.Emacron=667;t.ccaron=500;t.aring=556;t.Ncommaaccent=722;t.lacute=222;t.agrave=556;t.Tcommaaccent=611;t.Cacute=722;t.atilde=556;t.Edotaccent=667;t.scaron=500;t.scedilla=500;t.iacute=278;t.lozenge=471;t.Rcaron=722;t.Gcommaaccent=778;t.ucircumflex=556;t.acircumflex=556;t.Amacron=667;t.rcaron=333;t.ccedilla=500;t.Zdotaccent=611;t.Thorn=667;t.Omacron=778;t.Racute=722;t.Sacute=667;t.dcaron=643;t.Umacron=722;t.uring=556;t.threesuperior=333;t.Ograve=778;t.Agrave=667;t.Abreve=667;t.multiply=584;t.uacute=556;t.Tcaron=611;t.partialdiff=476;t.ydieresis=500;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=667;t.adieresis=556;t.edieresis=556;t.cacute=500;t.nacute=556;t.umacron=556;t.Ncaron=722;t.Iacute=278;t.plusminus=584;t.brokenbar=260;t.registered=737;t.Gbreve=778;t.Idotaccent=278;t.summation=600;t.Egrave=667;t.racute=333;t.omacron=556;t.Zacute=611;t.Zcaron=611;t.greaterequal=549;t.Eth=722;t.Ccedilla=722;t.lcommaaccent=222;t.tcaron=317;t.eogonek=556;t.Uogonek=722;t.Aacute=667;t.Adieresis=667;t.egrave=556;t.zacute=500;t.iogonek=222;t.Oacute=778;t.oacute=556;t.amacron=556;t.sacute=500;t.idieresis=278;t.Ocircumflex=778;t.Ugrave=722;t.Delta=612;t.thorn=556;t.twosuperior=333;t.Odieresis=778;t.mu=556;t.igrave=278;t.ohungarumlaut=556;t.Eogonek=667;t.dcroat=556;t.threequarters=834;t.Scedilla=667;t.lcaron=299;t.Kcommaaccent=667;t.Lacute=556;t.trademark=1e3;t.edotaccent=556;t.Igrave=278;t.Imacron=278;t.Lcaron=556;t.onehalf=834;t.lessequal=549;t.ocircumflex=556;t.ntilde=556;t.Uhungarumlaut=722;t.Eacute=667;t.emacron=556;t.gbreve=556;t.onequarter=834;t.Scaron=667;t.Scommaaccent=667;t.Ohungarumlaut=778;t.degree=400;t.ograve=556;t.Ccaron=722;t.ugrave=556;t.radical=453;t.Dcaron=722;t.rcommaaccent=333;t.Ntilde=722;t.otilde=556;t.Rcommaaccent=722;t.Lcommaaccent=556;t.Atilde=667;t.Aogonek=667;t.Aring=667;t.Otilde=778;t.zdotaccent=500;t.Ecaron=667;t.Iogonek=278;t.kcommaaccent=500;t.minus=584;t.Icircumflex=278;t.ncaron=556;t.tcommaaccent=278;t.logicalnot=584;t.odieresis=556;t.udieresis=556;t.notequal=549;t.gcommaaccent=556;t.eth=556;t.zcaron=500;t.ncommaaccent=556;t.onesuperior=333;t.imacron=278;t.Euro=556}));t["Helvetica-Bold"]=(0,c.getLookupTableFactory)((function(t){t.space=278;t.exclam=333;t.quotedbl=474;t.numbersign=556;t.dollar=556;t.percent=889;t.ampersand=722;t.quoteright=278;t.parenleft=333;t.parenright=333;t.asterisk=389;t.plus=584;t.comma=278;t.hyphen=333;t.period=278;t.slash=278;t.zero=556;t.one=556;t.two=556;t.three=556;t.four=556;t.five=556;t.six=556;t.seven=556;t.eight=556;t.nine=556;t.colon=333;t.semicolon=333;t.less=584;t.equal=584;t.greater=584;t.question=611;t.at=975;t.A=722;t.B=722;t.C=722;t.D=722;t.E=667;t.F=611;t.G=778;t.H=722;t.I=278;t.J=556;t.K=722;t.L=611;t.M=833;t.N=722;t.O=778;t.P=667;t.Q=778;t.R=722;t.S=667;t.T=611;t.U=722;t.V=667;t.W=944;t.X=667;t.Y=667;t.Z=611;t.bracketleft=333;t.backslash=278;t.bracketright=333;t.asciicircum=584;t.underscore=556;t.quoteleft=278;t.a=556;t.b=611;t.c=556;t.d=611;t.e=556;t.f=333;t.g=611;t.h=611;t.i=278;t.j=278;t.k=556;t.l=278;t.m=889;t.n=611;t.o=611;t.p=611;t.q=611;t.r=389;t.s=556;t.t=333;t.u=611;t.v=556;t.w=778;t.x=556;t.y=556;t.z=500;t.braceleft=389;t.bar=280;t.braceright=389;t.asciitilde=584;t.exclamdown=333;t.cent=556;t.sterling=556;t.fraction=167;t.yen=556;t.florin=556;t.section=556;t.currency=556;t.quotesingle=238;t.quotedblleft=500;t.guillemotleft=556;t.guilsinglleft=333;t.guilsinglright=333;t.fi=611;t.fl=611;t.endash=556;t.dagger=556;t.daggerdbl=556;t.periodcentered=278;t.paragraph=556;t.bullet=350;t.quotesinglbase=278;t.quotedblbase=500;t.quotedblright=500;t.guillemotright=556;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=611;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=1e3;t.ordfeminine=370;t.Lslash=611;t.Oslash=778;t.OE=1e3;t.ordmasculine=365;t.ae=889;t.dotlessi=278;t.lslash=278;t.oslash=611;t.oe=944;t.germandbls=611;t.Idieresis=278;t.eacute=556;t.abreve=556;t.uhungarumlaut=611;t.ecaron=556;t.Ydieresis=667;t.divide=584;t.Yacute=667;t.Acircumflex=722;t.aacute=556;t.Ucircumflex=722;t.yacute=556;t.scommaaccent=556;t.ecircumflex=556;t.Uring=722;t.Udieresis=722;t.aogonek=556;t.Uacute=722;t.uogonek=611;t.Edieresis=667;t.Dcroat=722;t.commaaccent=250;t.copyright=737;t.Emacron=667;t.ccaron=556;t.aring=556;t.Ncommaaccent=722;t.lacute=278;t.agrave=556;t.Tcommaaccent=611;t.Cacute=722;t.atilde=556;t.Edotaccent=667;t.scaron=556;t.scedilla=556;t.iacute=278;t.lozenge=494;t.Rcaron=722;t.Gcommaaccent=778;t.ucircumflex=611;t.acircumflex=556;t.Amacron=722;t.rcaron=389;t.ccedilla=556;t.Zdotaccent=611;t.Thorn=667;t.Omacron=778;t.Racute=722;t.Sacute=667;t.dcaron=743;t.Umacron=722;t.uring=611;t.threesuperior=333;t.Ograve=778;t.Agrave=722;t.Abreve=722;t.multiply=584;t.uacute=611;t.Tcaron=611;t.partialdiff=494;t.ydieresis=556;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=667;t.adieresis=556;t.edieresis=556;t.cacute=556;t.nacute=611;t.umacron=611;t.Ncaron=722;t.Iacute=278;t.plusminus=584;t.brokenbar=280;t.registered=737;t.Gbreve=778;t.Idotaccent=278;t.summation=600;t.Egrave=667;t.racute=389;t.omacron=611;t.Zacute=611;t.Zcaron=611;t.greaterequal=549;t.Eth=722;t.Ccedilla=722;t.lcommaaccent=278;t.tcaron=389;t.eogonek=556;t.Uogonek=722;t.Aacute=722;t.Adieresis=722;t.egrave=556;t.zacute=500;t.iogonek=278;t.Oacute=778;t.oacute=611;t.amacron=556;t.sacute=556;t.idieresis=278;t.Ocircumflex=778;t.Ugrave=722;t.Delta=612;t.thorn=611;t.twosuperior=333;t.Odieresis=778;t.mu=611;t.igrave=278;t.ohungarumlaut=611;t.Eogonek=667;t.dcroat=611;t.threequarters=834;t.Scedilla=667;t.lcaron=400;t.Kcommaaccent=722;t.Lacute=611;t.trademark=1e3;t.edotaccent=556;t.Igrave=278;t.Imacron=278;t.Lcaron=611;t.onehalf=834;t.lessequal=549;t.ocircumflex=611;t.ntilde=611;t.Uhungarumlaut=722;t.Eacute=667;t.emacron=556;t.gbreve=611;t.onequarter=834;t.Scaron=667;t.Scommaaccent=667;t.Ohungarumlaut=778;t.degree=400;t.ograve=611;t.Ccaron=722;t.ugrave=611;t.radical=549;t.Dcaron=722;t.rcommaaccent=389;t.Ntilde=722;t.otilde=611;t.Rcommaaccent=722;t.Lcommaaccent=611;t.Atilde=722;t.Aogonek=722;t.Aring=722;t.Otilde=778;t.zdotaccent=500;t.Ecaron=667;t.Iogonek=278;t.kcommaaccent=556;t.minus=584;t.Icircumflex=278;t.ncaron=611;t.tcommaaccent=333;t.logicalnot=584;t.odieresis=611;t.udieresis=611;t.notequal=549;t.gcommaaccent=611;t.eth=611;t.zcaron=500;t.ncommaaccent=611;t.onesuperior=333;t.imacron=278;t.Euro=556}));t["Helvetica-BoldOblique"]=(0,c.getLookupTableFactory)((function(t){t.space=278;t.exclam=333;t.quotedbl=474;t.numbersign=556;t.dollar=556;t.percent=889;t.ampersand=722;t.quoteright=278;t.parenleft=333;t.parenright=333;t.asterisk=389;t.plus=584;t.comma=278;t.hyphen=333;t.period=278;t.slash=278;t.zero=556;t.one=556;t.two=556;t.three=556;t.four=556;t.five=556;t.six=556;t.seven=556;t.eight=556;t.nine=556;t.colon=333;t.semicolon=333;t.less=584;t.equal=584;t.greater=584;t.question=611;t.at=975;t.A=722;t.B=722;t.C=722;t.D=722;t.E=667;t.F=611;t.G=778;t.H=722;t.I=278;t.J=556;t.K=722;t.L=611;t.M=833;t.N=722;t.O=778;t.P=667;t.Q=778;t.R=722;t.S=667;t.T=611;t.U=722;t.V=667;t.W=944;t.X=667;t.Y=667;t.Z=611;t.bracketleft=333;t.backslash=278;t.bracketright=333;t.asciicircum=584;t.underscore=556;t.quoteleft=278;t.a=556;t.b=611;t.c=556;t.d=611;t.e=556;t.f=333;t.g=611;t.h=611;t.i=278;t.j=278;t.k=556;t.l=278;t.m=889;t.n=611;t.o=611;t.p=611;t.q=611;t.r=389;t.s=556;t.t=333;t.u=611;t.v=556;t.w=778;t.x=556;t.y=556;t.z=500;t.braceleft=389;t.bar=280;t.braceright=389;t.asciitilde=584;t.exclamdown=333;t.cent=556;t.sterling=556;t.fraction=167;t.yen=556;t.florin=556;t.section=556;t.currency=556;t.quotesingle=238;t.quotedblleft=500;t.guillemotleft=556;t.guilsinglleft=333;t.guilsinglright=333;t.fi=611;t.fl=611;t.endash=556;t.dagger=556;t.daggerdbl=556;t.periodcentered=278;t.paragraph=556;t.bullet=350;t.quotesinglbase=278;t.quotedblbase=500;t.quotedblright=500;t.guillemotright=556;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=611;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=1e3;t.ordfeminine=370;t.Lslash=611;t.Oslash=778;t.OE=1e3;t.ordmasculine=365;t.ae=889;t.dotlessi=278;t.lslash=278;t.oslash=611;t.oe=944;t.germandbls=611;t.Idieresis=278;t.eacute=556;t.abreve=556;t.uhungarumlaut=611;t.ecaron=556;t.Ydieresis=667;t.divide=584;t.Yacute=667;t.Acircumflex=722;t.aacute=556;t.Ucircumflex=722;t.yacute=556;t.scommaaccent=556;t.ecircumflex=556;t.Uring=722;t.Udieresis=722;t.aogonek=556;t.Uacute=722;t.uogonek=611;t.Edieresis=667;t.Dcroat=722;t.commaaccent=250;t.copyright=737;t.Emacron=667;t.ccaron=556;t.aring=556;t.Ncommaaccent=722;t.lacute=278;t.agrave=556;t.Tcommaaccent=611;t.Cacute=722;t.atilde=556;t.Edotaccent=667;t.scaron=556;t.scedilla=556;t.iacute=278;t.lozenge=494;t.Rcaron=722;t.Gcommaaccent=778;t.ucircumflex=611;t.acircumflex=556;t.Amacron=722;t.rcaron=389;t.ccedilla=556;t.Zdotaccent=611;t.Thorn=667;t.Omacron=778;t.Racute=722;t.Sacute=667;t.dcaron=743;t.Umacron=722;t.uring=611;t.threesuperior=333;t.Ograve=778;t.Agrave=722;t.Abreve=722;t.multiply=584;t.uacute=611;t.Tcaron=611;t.partialdiff=494;t.ydieresis=556;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=667;t.adieresis=556;t.edieresis=556;t.cacute=556;t.nacute=611;t.umacron=611;t.Ncaron=722;t.Iacute=278;t.plusminus=584;t.brokenbar=280;t.registered=737;t.Gbreve=778;t.Idotaccent=278;t.summation=600;t.Egrave=667;t.racute=389;t.omacron=611;t.Zacute=611;t.Zcaron=611;t.greaterequal=549;t.Eth=722;t.Ccedilla=722;t.lcommaaccent=278;t.tcaron=389;t.eogonek=556;t.Uogonek=722;t.Aacute=722;t.Adieresis=722;t.egrave=556;t.zacute=500;t.iogonek=278;t.Oacute=778;t.oacute=611;t.amacron=556;t.sacute=556;t.idieresis=278;t.Ocircumflex=778;t.Ugrave=722;t.Delta=612;t.thorn=611;t.twosuperior=333;t.Odieresis=778;t.mu=611;t.igrave=278;t.ohungarumlaut=611;t.Eogonek=667;t.dcroat=611;t.threequarters=834;t.Scedilla=667;t.lcaron=400;t.Kcommaaccent=722;t.Lacute=611;t.trademark=1e3;t.edotaccent=556;t.Igrave=278;t.Imacron=278;t.Lcaron=611;t.onehalf=834;t.lessequal=549;t.ocircumflex=611;t.ntilde=611;t.Uhungarumlaut=722;t.Eacute=667;t.emacron=556;t.gbreve=611;t.onequarter=834;t.Scaron=667;t.Scommaaccent=667;t.Ohungarumlaut=778;t.degree=400;t.ograve=611;t.Ccaron=722;t.ugrave=611;t.radical=549;t.Dcaron=722;t.rcommaaccent=389;t.Ntilde=722;t.otilde=611;t.Rcommaaccent=722;t.Lcommaaccent=611;t.Atilde=722;t.Aogonek=722;t.Aring=722;t.Otilde=778;t.zdotaccent=500;t.Ecaron=667;t.Iogonek=278;t.kcommaaccent=556;t.minus=584;t.Icircumflex=278;t.ncaron=611;t.tcommaaccent=333;t.logicalnot=584;t.odieresis=611;t.udieresis=611;t.notequal=549;t.gcommaaccent=611;t.eth=611;t.zcaron=500;t.ncommaaccent=611;t.onesuperior=333;t.imacron=278;t.Euro=556}));t["Helvetica-Oblique"]=(0,c.getLookupTableFactory)((function(t){t.space=278;t.exclam=278;t.quotedbl=355;t.numbersign=556;t.dollar=556;t.percent=889;t.ampersand=667;t.quoteright=222;t.parenleft=333;t.parenright=333;t.asterisk=389;t.plus=584;t.comma=278;t.hyphen=333;t.period=278;t.slash=278;t.zero=556;t.one=556;t.two=556;t.three=556;t.four=556;t.five=556;t.six=556;t.seven=556;t.eight=556;t.nine=556;t.colon=278;t.semicolon=278;t.less=584;t.equal=584;t.greater=584;t.question=556;t.at=1015;t.A=667;t.B=667;t.C=722;t.D=722;t.E=667;t.F=611;t.G=778;t.H=722;t.I=278;t.J=500;t.K=667;t.L=556;t.M=833;t.N=722;t.O=778;t.P=667;t.Q=778;t.R=722;t.S=667;t.T=611;t.U=722;t.V=667;t.W=944;t.X=667;t.Y=667;t.Z=611;t.bracketleft=278;t.backslash=278;t.bracketright=278;t.asciicircum=469;t.underscore=556;t.quoteleft=222;t.a=556;t.b=556;t.c=500;t.d=556;t.e=556;t.f=278;t.g=556;t.h=556;t.i=222;t.j=222;t.k=500;t.l=222;t.m=833;t.n=556;t.o=556;t.p=556;t.q=556;t.r=333;t.s=500;t.t=278;t.u=556;t.v=500;t.w=722;t.x=500;t.y=500;t.z=500;t.braceleft=334;t.bar=260;t.braceright=334;t.asciitilde=584;t.exclamdown=333;t.cent=556;t.sterling=556;t.fraction=167;t.yen=556;t.florin=556;t.section=556;t.currency=556;t.quotesingle=191;t.quotedblleft=333;t.guillemotleft=556;t.guilsinglleft=333;t.guilsinglright=333;t.fi=500;t.fl=500;t.endash=556;t.dagger=556;t.daggerdbl=556;t.periodcentered=278;t.paragraph=537;t.bullet=350;t.quotesinglbase=222;t.quotedblbase=333;t.quotedblright=333;t.guillemotright=556;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=611;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=1e3;t.ordfeminine=370;t.Lslash=556;t.Oslash=778;t.OE=1e3;t.ordmasculine=365;t.ae=889;t.dotlessi=278;t.lslash=222;t.oslash=611;t.oe=944;t.germandbls=611;t.Idieresis=278;t.eacute=556;t.abreve=556;t.uhungarumlaut=556;t.ecaron=556;t.Ydieresis=667;t.divide=584;t.Yacute=667;t.Acircumflex=667;t.aacute=556;t.Ucircumflex=722;t.yacute=500;t.scommaaccent=500;t.ecircumflex=556;t.Uring=722;t.Udieresis=722;t.aogonek=556;t.Uacute=722;t.uogonek=556;t.Edieresis=667;t.Dcroat=722;t.commaaccent=250;t.copyright=737;t.Emacron=667;t.ccaron=500;t.aring=556;t.Ncommaaccent=722;t.lacute=222;t.agrave=556;t.Tcommaaccent=611;t.Cacute=722;t.atilde=556;t.Edotaccent=667;t.scaron=500;t.scedilla=500;t.iacute=278;t.lozenge=471;t.Rcaron=722;t.Gcommaaccent=778;t.ucircumflex=556;t.acircumflex=556;t.Amacron=667;t.rcaron=333;t.ccedilla=500;t.Zdotaccent=611;t.Thorn=667;t.Omacron=778;t.Racute=722;t.Sacute=667;t.dcaron=643;t.Umacron=722;t.uring=556;t.threesuperior=333;t.Ograve=778;t.Agrave=667;t.Abreve=667;t.multiply=584;t.uacute=556;t.Tcaron=611;t.partialdiff=476;t.ydieresis=500;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=667;t.adieresis=556;t.edieresis=556;t.cacute=500;t.nacute=556;t.umacron=556;t.Ncaron=722;t.Iacute=278;t.plusminus=584;t.brokenbar=260;t.registered=737;t.Gbreve=778;t.Idotaccent=278;t.summation=600;t.Egrave=667;t.racute=333;t.omacron=556;t.Zacute=611;t.Zcaron=611;t.greaterequal=549;t.Eth=722;t.Ccedilla=722;t.lcommaaccent=222;t.tcaron=317;t.eogonek=556;t.Uogonek=722;t.Aacute=667;t.Adieresis=667;t.egrave=556;t.zacute=500;t.iogonek=222;t.Oacute=778;t.oacute=556;t.amacron=556;t.sacute=500;t.idieresis=278;t.Ocircumflex=778;t.Ugrave=722;t.Delta=612;t.thorn=556;t.twosuperior=333;t.Odieresis=778;t.mu=556;t.igrave=278;t.ohungarumlaut=556;t.Eogonek=667;t.dcroat=556;t.threequarters=834;t.Scedilla=667;t.lcaron=299;t.Kcommaaccent=667;t.Lacute=556;t.trademark=1e3;t.edotaccent=556;t.Igrave=278;t.Imacron=278;t.Lcaron=556;t.onehalf=834;t.lessequal=549;t.ocircumflex=556;t.ntilde=556;t.Uhungarumlaut=722;t.Eacute=667;t.emacron=556;t.gbreve=556;t.onequarter=834;t.Scaron=667;t.Scommaaccent=667;t.Ohungarumlaut=778;t.degree=400;t.ograve=556;t.Ccaron=722;t.ugrave=556;t.radical=453;t.Dcaron=722;t.rcommaaccent=333;t.Ntilde=722;t.otilde=556;t.Rcommaaccent=722;t.Lcommaaccent=556;t.Atilde=667;t.Aogonek=667;t.Aring=667;t.Otilde=778;t.zdotaccent=500;t.Ecaron=667;t.Iogonek=278;t.kcommaaccent=500;t.minus=584;t.Icircumflex=278;t.ncaron=556;t.tcommaaccent=278;t.logicalnot=584;t.odieresis=556;t.udieresis=556;t.notequal=549;t.gcommaaccent=556;t.eth=556;t.zcaron=500;t.ncommaaccent=556;t.onesuperior=333;t.imacron=278;t.Euro=556}));t.Symbol=(0,c.getLookupTableFactory)((function(t){t.space=250;t.exclam=333;t.universal=713;t.numbersign=500;t.existential=549;t.percent=833;t.ampersand=778;t.suchthat=439;t.parenleft=333;t.parenright=333;t.asteriskmath=500;t.plus=549;t.comma=250;t.minus=549;t.period=250;t.slash=278;t.zero=500;t.one=500;t.two=500;t.three=500;t.four=500;t.five=500;t.six=500;t.seven=500;t.eight=500;t.nine=500;t.colon=278;t.semicolon=278;t.less=549;t.equal=549;t.greater=549;t.question=444;t.congruent=549;t.Alpha=722;t.Beta=667;t.Chi=722;t.Delta=612;t.Epsilon=611;t.Phi=763;t.Gamma=603;t.Eta=722;t.Iota=333;t.theta1=631;t.Kappa=722;t.Lambda=686;t.Mu=889;t.Nu=722;t.Omicron=722;t.Pi=768;t.Theta=741;t.Rho=556;t.Sigma=592;t.Tau=611;t.Upsilon=690;t.sigma1=439;t.Omega=768;t.Xi=645;t.Psi=795;t.Zeta=611;t.bracketleft=333;t.therefore=863;t.bracketright=333;t.perpendicular=658;t.underscore=500;t.radicalex=500;t.alpha=631;t.beta=549;t.chi=549;t.delta=494;t.epsilon=439;t.phi=521;t.gamma=411;t.eta=603;t.iota=329;t.phi1=603;t.kappa=549;t.lambda=549;t.mu=576;t.nu=521;t.omicron=549;t.pi=549;t.theta=521;t.rho=549;t.sigma=603;t.tau=439;t.upsilon=576;t.omega1=713;t.omega=686;t.xi=493;t.psi=686;t.zeta=494;t.braceleft=480;t.bar=200;t.braceright=480;t.similar=549;t.Euro=750;t.Upsilon1=620;t.minute=247;t.lessequal=549;t.fraction=167;t.infinity=713;t.florin=500;t.club=753;t.diamond=753;t.heart=753;t.spade=753;t.arrowboth=1042;t.arrowleft=987;t.arrowup=603;t.arrowright=987;t.arrowdown=603;t.degree=400;t.plusminus=549;t.second=411;t.greaterequal=549;t.multiply=549;t.proportional=713;t.partialdiff=494;t.bullet=460;t.divide=549;t.notequal=549;t.equivalence=549;t.approxequal=549;t.ellipsis=1e3;t.arrowvertex=603;t.arrowhorizex=1e3;t.carriagereturn=658;t.aleph=823;t.Ifraktur=686;t.Rfraktur=795;t.weierstrass=987;t.circlemultiply=768;t.circleplus=768;t.emptyset=823;t.intersection=768;t.union=768;t.propersuperset=713;t.reflexsuperset=713;t.notsubset=713;t.propersubset=713;t.reflexsubset=713;t.element=713;t.notelement=713;t.angle=768;t.gradient=713;t.registerserif=790;t.copyrightserif=790;t.trademarkserif=890;t.product=823;t.radical=549;t.dotmath=250;t.logicalnot=713;t.logicaland=603;t.logicalor=603;t.arrowdblboth=1042;t.arrowdblleft=987;t.arrowdblup=603;t.arrowdblright=987;t.arrowdbldown=603;t.lozenge=494;t.angleleft=329;t.registersans=790;t.copyrightsans=790;t.trademarksans=786;t.summation=713;t.parenlefttp=384;t.parenleftex=384;t.parenleftbt=384;t.bracketlefttp=384;t.bracketleftex=384;t.bracketleftbt=384;t.bracelefttp=494;t.braceleftmid=494;t.braceleftbt=494;t.braceex=494;t.angleright=329;t.integral=274;t.integraltp=686;t.integralex=686;t.integralbt=686;t.parenrighttp=384;t.parenrightex=384;t.parenrightbt=384;t.bracketrighttp=384;t.bracketrightex=384;t.bracketrightbt=384;t.bracerighttp=494;t.bracerightmid=494;t.bracerightbt=494;t.apple=790}));t["Times-Roman"]=(0,c.getLookupTableFactory)((function(t){t.space=250;t.exclam=333;t.quotedbl=408;t.numbersign=500;t.dollar=500;t.percent=833;t.ampersand=778;t.quoteright=333;t.parenleft=333;t.parenright=333;t.asterisk=500;t.plus=564;t.comma=250;t.hyphen=333;t.period=250;t.slash=278;t.zero=500;t.one=500;t.two=500;t.three=500;t.four=500;t.five=500;t.six=500;t.seven=500;t.eight=500;t.nine=500;t.colon=278;t.semicolon=278;t.less=564;t.equal=564;t.greater=564;t.question=444;t.at=921;t.A=722;t.B=667;t.C=667;t.D=722;t.E=611;t.F=556;t.G=722;t.H=722;t.I=333;t.J=389;t.K=722;t.L=611;t.M=889;t.N=722;t.O=722;t.P=556;t.Q=722;t.R=667;t.S=556;t.T=611;t.U=722;t.V=722;t.W=944;t.X=722;t.Y=722;t.Z=611;t.bracketleft=333;t.backslash=278;t.bracketright=333;t.asciicircum=469;t.underscore=500;t.quoteleft=333;t.a=444;t.b=500;t.c=444;t.d=500;t.e=444;t.f=333;t.g=500;t.h=500;t.i=278;t.j=278;t.k=500;t.l=278;t.m=778;t.n=500;t.o=500;t.p=500;t.q=500;t.r=333;t.s=389;t.t=278;t.u=500;t.v=500;t.w=722;t.x=500;t.y=500;t.z=444;t.braceleft=480;t.bar=200;t.braceright=480;t.asciitilde=541;t.exclamdown=333;t.cent=500;t.sterling=500;t.fraction=167;t.yen=500;t.florin=500;t.section=500;t.currency=500;t.quotesingle=180;t.quotedblleft=444;t.guillemotleft=500;t.guilsinglleft=333;t.guilsinglright=333;t.fi=556;t.fl=556;t.endash=500;t.dagger=500;t.daggerdbl=500;t.periodcentered=250;t.paragraph=453;t.bullet=350;t.quotesinglbase=333;t.quotedblbase=444;t.quotedblright=444;t.guillemotright=500;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=444;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=889;t.ordfeminine=276;t.Lslash=611;t.Oslash=722;t.OE=889;t.ordmasculine=310;t.ae=667;t.dotlessi=278;t.lslash=278;t.oslash=500;t.oe=722;t.germandbls=500;t.Idieresis=333;t.eacute=444;t.abreve=444;t.uhungarumlaut=500;t.ecaron=444;t.Ydieresis=722;t.divide=564;t.Yacute=722;t.Acircumflex=722;t.aacute=444;t.Ucircumflex=722;t.yacute=500;t.scommaaccent=389;t.ecircumflex=444;t.Uring=722;t.Udieresis=722;t.aogonek=444;t.Uacute=722;t.uogonek=500;t.Edieresis=611;t.Dcroat=722;t.commaaccent=250;t.copyright=760;t.Emacron=611;t.ccaron=444;t.aring=444;t.Ncommaaccent=722;t.lacute=278;t.agrave=444;t.Tcommaaccent=611;t.Cacute=667;t.atilde=444;t.Edotaccent=611;t.scaron=389;t.scedilla=389;t.iacute=278;t.lozenge=471;t.Rcaron=667;t.Gcommaaccent=722;t.ucircumflex=500;t.acircumflex=444;t.Amacron=722;t.rcaron=333;t.ccedilla=444;t.Zdotaccent=611;t.Thorn=556;t.Omacron=722;t.Racute=667;t.Sacute=556;t.dcaron=588;t.Umacron=722;t.uring=500;t.threesuperior=300;t.Ograve=722;t.Agrave=722;t.Abreve=722;t.multiply=564;t.uacute=500;t.Tcaron=611;t.partialdiff=476;t.ydieresis=500;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=611;t.adieresis=444;t.edieresis=444;t.cacute=444;t.nacute=500;t.umacron=500;t.Ncaron=722;t.Iacute=333;t.plusminus=564;t.brokenbar=200;t.registered=760;t.Gbreve=722;t.Idotaccent=333;t.summation=600;t.Egrave=611;t.racute=333;t.omacron=500;t.Zacute=611;t.Zcaron=611;t.greaterequal=549;t.Eth=722;t.Ccedilla=667;t.lcommaaccent=278;t.tcaron=326;t.eogonek=444;t.Uogonek=722;t.Aacute=722;t.Adieresis=722;t.egrave=444;t.zacute=444;t.iogonek=278;t.Oacute=722;t.oacute=500;t.amacron=444;t.sacute=389;t.idieresis=278;t.Ocircumflex=722;t.Ugrave=722;t.Delta=612;t.thorn=500;t.twosuperior=300;t.Odieresis=722;t.mu=500;t.igrave=278;t.ohungarumlaut=500;t.Eogonek=611;t.dcroat=500;t.threequarters=750;t.Scedilla=556;t.lcaron=344;t.Kcommaaccent=722;t.Lacute=611;t.trademark=980;t.edotaccent=444;t.Igrave=333;t.Imacron=333;t.Lcaron=611;t.onehalf=750;t.lessequal=549;t.ocircumflex=500;t.ntilde=500;t.Uhungarumlaut=722;t.Eacute=611;t.emacron=444;t.gbreve=500;t.onequarter=750;t.Scaron=556;t.Scommaaccent=556;t.Ohungarumlaut=722;t.degree=400;t.ograve=500;t.Ccaron=667;t.ugrave=500;t.radical=453;t.Dcaron=722;t.rcommaaccent=333;t.Ntilde=722;t.otilde=500;t.Rcommaaccent=667;t.Lcommaaccent=611;t.Atilde=722;t.Aogonek=722;t.Aring=722;t.Otilde=722;t.zdotaccent=444;t.Ecaron=611;t.Iogonek=333;t.kcommaaccent=500;t.minus=564;t.Icircumflex=333;t.ncaron=500;t.tcommaaccent=278;t.logicalnot=564;t.odieresis=500;t.udieresis=500;t.notequal=549;t.gcommaaccent=500;t.eth=500;t.zcaron=444;t.ncommaaccent=500;t.onesuperior=300;t.imacron=278;t.Euro=500}));t["Times-Bold"]=(0,c.getLookupTableFactory)((function(t){t.space=250;t.exclam=333;t.quotedbl=555;t.numbersign=500;t.dollar=500;t.percent=1e3;t.ampersand=833;t.quoteright=333;t.parenleft=333;t.parenright=333;t.asterisk=500;t.plus=570;t.comma=250;t.hyphen=333;t.period=250;t.slash=278;t.zero=500;t.one=500;t.two=500;t.three=500;t.four=500;t.five=500;t.six=500;t.seven=500;t.eight=500;t.nine=500;t.colon=333;t.semicolon=333;t.less=570;t.equal=570;t.greater=570;t.question=500;t.at=930;t.A=722;t.B=667;t.C=722;t.D=722;t.E=667;t.F=611;t.G=778;t.H=778;t.I=389;t.J=500;t.K=778;t.L=667;t.M=944;t.N=722;t.O=778;t.P=611;t.Q=778;t.R=722;t.S=556;t.T=667;t.U=722;t.V=722;t.W=1e3;t.X=722;t.Y=722;t.Z=667;t.bracketleft=333;t.backslash=278;t.bracketright=333;t.asciicircum=581;t.underscore=500;t.quoteleft=333;t.a=500;t.b=556;t.c=444;t.d=556;t.e=444;t.f=333;t.g=500;t.h=556;t.i=278;t.j=333;t.k=556;t.l=278;t.m=833;t.n=556;t.o=500;t.p=556;t.q=556;t.r=444;t.s=389;t.t=333;t.u=556;t.v=500;t.w=722;t.x=500;t.y=500;t.z=444;t.braceleft=394;t.bar=220;t.braceright=394;t.asciitilde=520;t.exclamdown=333;t.cent=500;t.sterling=500;t.fraction=167;t.yen=500;t.florin=500;t.section=500;t.currency=500;t.quotesingle=278;t.quotedblleft=500;t.guillemotleft=500;t.guilsinglleft=333;t.guilsinglright=333;t.fi=556;t.fl=556;t.endash=500;t.dagger=500;t.daggerdbl=500;t.periodcentered=250;t.paragraph=540;t.bullet=350;t.quotesinglbase=333;t.quotedblbase=500;t.quotedblright=500;t.guillemotright=500;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=500;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=1e3;t.ordfeminine=300;t.Lslash=667;t.Oslash=778;t.OE=1e3;t.ordmasculine=330;t.ae=722;t.dotlessi=278;t.lslash=278;t.oslash=500;t.oe=722;t.germandbls=556;t.Idieresis=389;t.eacute=444;t.abreve=500;t.uhungarumlaut=556;t.ecaron=444;t.Ydieresis=722;t.divide=570;t.Yacute=722;t.Acircumflex=722;t.aacute=500;t.Ucircumflex=722;t.yacute=500;t.scommaaccent=389;t.ecircumflex=444;t.Uring=722;t.Udieresis=722;t.aogonek=500;t.Uacute=722;t.uogonek=556;t.Edieresis=667;t.Dcroat=722;t.commaaccent=250;t.copyright=747;t.Emacron=667;t.ccaron=444;t.aring=500;t.Ncommaaccent=722;t.lacute=278;t.agrave=500;t.Tcommaaccent=667;t.Cacute=722;t.atilde=500;t.Edotaccent=667;t.scaron=389;t.scedilla=389;t.iacute=278;t.lozenge=494;t.Rcaron=722;t.Gcommaaccent=778;t.ucircumflex=556;t.acircumflex=500;t.Amacron=722;t.rcaron=444;t.ccedilla=444;t.Zdotaccent=667;t.Thorn=611;t.Omacron=778;t.Racute=722;t.Sacute=556;t.dcaron=672;t.Umacron=722;t.uring=556;t.threesuperior=300;t.Ograve=778;t.Agrave=722;t.Abreve=722;t.multiply=570;t.uacute=556;t.Tcaron=667;t.partialdiff=494;t.ydieresis=500;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=667;t.adieresis=500;t.edieresis=444;t.cacute=444;t.nacute=556;t.umacron=556;t.Ncaron=722;t.Iacute=389;t.plusminus=570;t.brokenbar=220;t.registered=747;t.Gbreve=778;t.Idotaccent=389;t.summation=600;t.Egrave=667;t.racute=444;t.omacron=500;t.Zacute=667;t.Zcaron=667;t.greaterequal=549;t.Eth=722;t.Ccedilla=722;t.lcommaaccent=278;t.tcaron=416;t.eogonek=444;t.Uogonek=722;t.Aacute=722;t.Adieresis=722;t.egrave=444;t.zacute=444;t.iogonek=278;t.Oacute=778;t.oacute=500;t.amacron=500;t.sacute=389;t.idieresis=278;t.Ocircumflex=778;t.Ugrave=722;t.Delta=612;t.thorn=556;t.twosuperior=300;t.Odieresis=778;t.mu=556;t.igrave=278;t.ohungarumlaut=500;t.Eogonek=667;t.dcroat=556;t.threequarters=750;t.Scedilla=556;t.lcaron=394;t.Kcommaaccent=778;t.Lacute=667;t.trademark=1e3;t.edotaccent=444;t.Igrave=389;t.Imacron=389;t.Lcaron=667;t.onehalf=750;t.lessequal=549;t.ocircumflex=500;t.ntilde=556;t.Uhungarumlaut=722;t.Eacute=667;t.emacron=444;t.gbreve=500;t.onequarter=750;t.Scaron=556;t.Scommaaccent=556;t.Ohungarumlaut=778;t.degree=400;t.ograve=500;t.Ccaron=722;t.ugrave=556;t.radical=549;t.Dcaron=722;t.rcommaaccent=444;t.Ntilde=722;t.otilde=500;t.Rcommaaccent=722;t.Lcommaaccent=667;t.Atilde=722;t.Aogonek=722;t.Aring=722;t.Otilde=778;t.zdotaccent=444;t.Ecaron=667;t.Iogonek=389;t.kcommaaccent=556;t.minus=570;t.Icircumflex=389;t.ncaron=556;t.tcommaaccent=333;t.logicalnot=570;t.odieresis=500;t.udieresis=556;t.notequal=549;t.gcommaaccent=500;t.eth=500;t.zcaron=444;t.ncommaaccent=556;t.onesuperior=300;t.imacron=278;t.Euro=500}));t["Times-BoldItalic"]=(0,c.getLookupTableFactory)((function(t){t.space=250;t.exclam=389;t.quotedbl=555;t.numbersign=500;t.dollar=500;t.percent=833;t.ampersand=778;t.quoteright=333;t.parenleft=333;t.parenright=333;t.asterisk=500;t.plus=570;t.comma=250;t.hyphen=333;t.period=250;t.slash=278;t.zero=500;t.one=500;t.two=500;t.three=500;t.four=500;t.five=500;t.six=500;t.seven=500;t.eight=500;t.nine=500;t.colon=333;t.semicolon=333;t.less=570;t.equal=570;t.greater=570;t.question=500;t.at=832;t.A=667;t.B=667;t.C=667;t.D=722;t.E=667;t.F=667;t.G=722;t.H=778;t.I=389;t.J=500;t.K=667;t.L=611;t.M=889;t.N=722;t.O=722;t.P=611;t.Q=722;t.R=667;t.S=556;t.T=611;t.U=722;t.V=667;t.W=889;t.X=667;t.Y=611;t.Z=611;t.bracketleft=333;t.backslash=278;t.bracketright=333;t.asciicircum=570;t.underscore=500;t.quoteleft=333;t.a=500;t.b=500;t.c=444;t.d=500;t.e=444;t.f=333;t.g=500;t.h=556;t.i=278;t.j=278;t.k=500;t.l=278;t.m=778;t.n=556;t.o=500;t.p=500;t.q=500;t.r=389;t.s=389;t.t=278;t.u=556;t.v=444;t.w=667;t.x=500;t.y=444;t.z=389;t.braceleft=348;t.bar=220;t.braceright=348;t.asciitilde=570;t.exclamdown=389;t.cent=500;t.sterling=500;t.fraction=167;t.yen=500;t.florin=500;t.section=500;t.currency=500;t.quotesingle=278;t.quotedblleft=500;t.guillemotleft=500;t.guilsinglleft=333;t.guilsinglright=333;t.fi=556;t.fl=556;t.endash=500;t.dagger=500;t.daggerdbl=500;t.periodcentered=250;t.paragraph=500;t.bullet=350;t.quotesinglbase=333;t.quotedblbase=500;t.quotedblright=500;t.guillemotright=500;t.ellipsis=1e3;t.perthousand=1e3;t.questiondown=500;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=1e3;t.AE=944;t.ordfeminine=266;t.Lslash=611;t.Oslash=722;t.OE=944;t.ordmasculine=300;t.ae=722;t.dotlessi=278;t.lslash=278;t.oslash=500;t.oe=722;t.germandbls=500;t.Idieresis=389;t.eacute=444;t.abreve=500;t.uhungarumlaut=556;t.ecaron=444;t.Ydieresis=611;t.divide=570;t.Yacute=611;t.Acircumflex=667;t.aacute=500;t.Ucircumflex=722;t.yacute=444;t.scommaaccent=389;t.ecircumflex=444;t.Uring=722;t.Udieresis=722;t.aogonek=500;t.Uacute=722;t.uogonek=556;t.Edieresis=667;t.Dcroat=722;t.commaaccent=250;t.copyright=747;t.Emacron=667;t.ccaron=444;t.aring=500;t.Ncommaaccent=722;t.lacute=278;t.agrave=500;t.Tcommaaccent=611;t.Cacute=667;t.atilde=500;t.Edotaccent=667;t.scaron=389;t.scedilla=389;t.iacute=278;t.lozenge=494;t.Rcaron=667;t.Gcommaaccent=722;t.ucircumflex=556;t.acircumflex=500;t.Amacron=667;t.rcaron=389;t.ccedilla=444;t.Zdotaccent=611;t.Thorn=611;t.Omacron=722;t.Racute=667;t.Sacute=556;t.dcaron=608;t.Umacron=722;t.uring=556;t.threesuperior=300;t.Ograve=722;t.Agrave=667;t.Abreve=667;t.multiply=570;t.uacute=556;t.Tcaron=611;t.partialdiff=494;t.ydieresis=444;t.Nacute=722;t.icircumflex=278;t.Ecircumflex=667;t.adieresis=500;t.edieresis=444;t.cacute=444;t.nacute=556;t.umacron=556;t.Ncaron=722;t.Iacute=389;t.plusminus=570;t.brokenbar=220;t.registered=747;t.Gbreve=722;t.Idotaccent=389;t.summation=600;t.Egrave=667;t.racute=389;t.omacron=500;t.Zacute=611;t.Zcaron=611;t.greaterequal=549;t.Eth=722;t.Ccedilla=667;t.lcommaaccent=278;t.tcaron=366;t.eogonek=444;t.Uogonek=722;t.Aacute=667;t.Adieresis=667;t.egrave=444;t.zacute=389;t.iogonek=278;t.Oacute=722;t.oacute=500;t.amacron=500;t.sacute=389;t.idieresis=278;t.Ocircumflex=722;t.Ugrave=722;t.Delta=612;t.thorn=500;t.twosuperior=300;t.Odieresis=722;t.mu=576;t.igrave=278;t.ohungarumlaut=500;t.Eogonek=667;t.dcroat=500;t.threequarters=750;t.Scedilla=556;t.lcaron=382;t.Kcommaaccent=667;t.Lacute=611;t.trademark=1e3;t.edotaccent=444;t.Igrave=389;t.Imacron=389;t.Lcaron=611;t.onehalf=750;t.lessequal=549;t.ocircumflex=500;t.ntilde=556;t.Uhungarumlaut=722;t.Eacute=667;t.emacron=444;t.gbreve=500;t.onequarter=750;t.Scaron=556;t.Scommaaccent=556;t.Ohungarumlaut=722;t.degree=400;t.ograve=500;t.Ccaron=667;t.ugrave=556;t.radical=549;t.Dcaron=722;t.rcommaaccent=389;t.Ntilde=722;t.otilde=500;t.Rcommaaccent=667;t.Lcommaaccent=611;t.Atilde=667;t.Aogonek=667;t.Aring=667;t.Otilde=722;t.zdotaccent=389;t.Ecaron=667;t.Iogonek=389;t.kcommaaccent=500;t.minus=606;t.Icircumflex=389;t.ncaron=556;t.tcommaaccent=278;t.logicalnot=606;t.odieresis=500;t.udieresis=556;t.notequal=549;t.gcommaaccent=500;t.eth=500;t.zcaron=389;t.ncommaaccent=556;t.onesuperior=300;t.imacron=278;t.Euro=500}));t["Times-Italic"]=(0,c.getLookupTableFactory)((function(t){t.space=250;t.exclam=333;t.quotedbl=420;t.numbersign=500;t.dollar=500;t.percent=833;t.ampersand=778;t.quoteright=333;t.parenleft=333;t.parenright=333;t.asterisk=500;t.plus=675;t.comma=250;t.hyphen=333;t.period=250;t.slash=278;t.zero=500;t.one=500;t.two=500;t.three=500;t.four=500;t.five=500;t.six=500;t.seven=500;t.eight=500;t.nine=500;t.colon=333;t.semicolon=333;t.less=675;t.equal=675;t.greater=675;t.question=500;t.at=920;t.A=611;t.B=611;t.C=667;t.D=722;t.E=611;t.F=611;t.G=722;t.H=722;t.I=333;t.J=444;t.K=667;t.L=556;t.M=833;t.N=667;t.O=722;t.P=611;t.Q=722;t.R=611;t.S=500;t.T=556;t.U=722;t.V=611;t.W=833;t.X=611;t.Y=556;t.Z=556;t.bracketleft=389;t.backslash=278;t.bracketright=389;t.asciicircum=422;t.underscore=500;t.quoteleft=333;t.a=500;t.b=500;t.c=444;t.d=500;t.e=444;t.f=278;t.g=500;t.h=500;t.i=278;t.j=278;t.k=444;t.l=278;t.m=722;t.n=500;t.o=500;t.p=500;t.q=500;t.r=389;t.s=389;t.t=278;t.u=500;t.v=444;t.w=667;t.x=444;t.y=444;t.z=389;t.braceleft=400;t.bar=275;t.braceright=400;t.asciitilde=541;t.exclamdown=389;t.cent=500;t.sterling=500;t.fraction=167;t.yen=500;t.florin=500;t.section=500;t.currency=500;t.quotesingle=214;t.quotedblleft=556;t.guillemotleft=500;t.guilsinglleft=333;t.guilsinglright=333;t.fi=500;t.fl=500;t.endash=500;t.dagger=500;t.daggerdbl=500;t.periodcentered=250;t.paragraph=523;t.bullet=350;t.quotesinglbase=333;t.quotedblbase=556;t.quotedblright=556;t.guillemotright=500;t.ellipsis=889;t.perthousand=1e3;t.questiondown=500;t.grave=333;t.acute=333;t.circumflex=333;t.tilde=333;t.macron=333;t.breve=333;t.dotaccent=333;t.dieresis=333;t.ring=333;t.cedilla=333;t.hungarumlaut=333;t.ogonek=333;t.caron=333;t.emdash=889;t.AE=889;t.ordfeminine=276;t.Lslash=556;t.Oslash=722;t.OE=944;t.ordmasculine=310;t.ae=667;t.dotlessi=278;t.lslash=278;t.oslash=500;t.oe=667;t.germandbls=500;t.Idieresis=333;t.eacute=444;t.abreve=500;t.uhungarumlaut=500;t.ecaron=444;t.Ydieresis=556;t.divide=675;t.Yacute=556;t.Acircumflex=611;t.aacute=500;t.Ucircumflex=722;t.yacute=444;t.scommaaccent=389;t.ecircumflex=444;t.Uring=722;t.Udieresis=722;t.aogonek=500;t.Uacute=722;t.uogonek=500;t.Edieresis=611;t.Dcroat=722;t.commaaccent=250;t.copyright=760;t.Emacron=611;t.ccaron=444;t.aring=500;t.Ncommaaccent=667;t.lacute=278;t.agrave=500;t.Tcommaaccent=556;t.Cacute=667;t.atilde=500;t.Edotaccent=611;t.scaron=389;t.scedilla=389;t.iacute=278;t.lozenge=471;t.Rcaron=611;t.Gcommaaccent=722;t.ucircumflex=500;t.acircumflex=500;t.Amacron=611;t.rcaron=389;t.ccedilla=444;t.Zdotaccent=556;t.Thorn=611;t.Omacron=722;t.Racute=611;t.Sacute=500;t.dcaron=544;t.Umacron=722;t.uring=500;t.threesuperior=300;t.Ograve=722;t.Agrave=611;t.Abreve=611;t.multiply=675;t.uacute=500;t.Tcaron=556;t.partialdiff=476;t.ydieresis=444;t.Nacute=667;t.icircumflex=278;t.Ecircumflex=611;t.adieresis=500;t.edieresis=444;t.cacute=444;t.nacute=500;t.umacron=500;t.Ncaron=667;t.Iacute=333;t.plusminus=675;t.brokenbar=275;t.registered=760;t.Gbreve=722;t.Idotaccent=333;t.summation=600;t.Egrave=611;t.racute=389;t.omacron=500;t.Zacute=556;t.Zcaron=556;t.greaterequal=549;t.Eth=722;t.Ccedilla=667;t.lcommaaccent=278;t.tcaron=300;t.eogonek=444;t.Uogonek=722;t.Aacute=611;t.Adieresis=611;t.egrave=444;t.zacute=389;t.iogonek=278;t.Oacute=722;t.oacute=500;t.amacron=500;t.sacute=389;t.idieresis=278;t.Ocircumflex=722;t.Ugrave=722;t.Delta=612;t.thorn=500;t.twosuperior=300;t.Odieresis=722;t.mu=500;t.igrave=278;t.ohungarumlaut=500;t.Eogonek=611;t.dcroat=500;t.threequarters=750;t.Scedilla=500;t.lcaron=300;t.Kcommaaccent=667;t.Lacute=556;t.trademark=980;t.edotaccent=444;t.Igrave=333;t.Imacron=333;t.Lcaron=611;t.onehalf=750;t.lessequal=549;t.ocircumflex=500;t.ntilde=500;t.Uhungarumlaut=722;t.Eacute=611;t.emacron=444;t.gbreve=500;t.onequarter=750;t.Scaron=500;t.Scommaaccent=500;t.Ohungarumlaut=722;t.degree=400;t.ograve=500;t.Ccaron=667;t.ugrave=500;t.radical=453;t.Dcaron=722;t.rcommaaccent=389;t.Ntilde=667;t.otilde=500;t.Rcommaaccent=611;t.Lcommaaccent=556;t.Atilde=611;t.Aogonek=611;t.Aring=611;t.Otilde=722;t.zdotaccent=389;t.Ecaron=611;t.Iogonek=333;t.kcommaaccent=444;t.minus=675;t.Icircumflex=333;t.ncaron=500;t.tcommaaccent=278;t.logicalnot=675;t.odieresis=500;t.udieresis=500;t.notequal=549;t.gcommaaccent=500;t.eth=500;t.zcaron=389;t.ncommaaccent=500;t.onesuperior=300;t.imacron=278;t.Euro=500}));t.ZapfDingbats=(0,c.getLookupTableFactory)((function(t){t.space=278;t.a1=974;t.a2=961;t.a202=974;t.a3=980;t.a4=719;t.a5=789;t.a119=790;t.a118=791;t.a117=690;t.a11=960;t.a12=939;t.a13=549;t.a14=855;t.a15=911;t.a16=933;t.a105=911;t.a17=945;t.a18=974;t.a19=755;t.a20=846;t.a21=762;t.a22=761;t.a23=571;t.a24=677;t.a25=763;t.a26=760;t.a27=759;t.a28=754;t.a6=494;t.a7=552;t.a8=537;t.a9=577;t.a10=692;t.a29=786;t.a30=788;t.a31=788;t.a32=790;t.a33=793;t.a34=794;t.a35=816;t.a36=823;t.a37=789;t.a38=841;t.a39=823;t.a40=833;t.a41=816;t.a42=831;t.a43=923;t.a44=744;t.a45=723;t.a46=749;t.a47=790;t.a48=792;t.a49=695;t.a50=776;t.a51=768;t.a52=792;t.a53=759;t.a54=707;t.a55=708;t.a56=682;t.a57=701;t.a58=826;t.a59=815;t.a60=789;t.a61=789;t.a62=707;t.a63=687;t.a64=696;t.a65=689;t.a66=786;t.a67=787;t.a68=713;t.a69=791;t.a70=785;t.a71=791;t.a72=873;t.a73=761;t.a74=762;t.a203=762;t.a75=759;t.a204=759;t.a76=892;t.a77=892;t.a78=788;t.a79=784;t.a81=438;t.a82=138;t.a83=277;t.a84=415;t.a97=392;t.a98=392;t.a99=668;t.a100=668;t.a89=390;t.a90=390;t.a93=317;t.a94=317;t.a91=276;t.a92=276;t.a205=509;t.a85=509;t.a206=410;t.a86=410;t.a87=234;t.a88=234;t.a95=334;t.a96=334;t.a101=732;t.a102=544;t.a103=544;t.a104=910;t.a106=667;t.a107=760;t.a108=760;t.a112=776;t.a111=595;t.a110=694;t.a109=626;t.a120=788;t.a121=788;t.a122=788;t.a123=788;t.a124=788;t.a125=788;t.a126=788;t.a127=788;t.a128=788;t.a129=788;t.a130=788;t.a131=788;t.a132=788;t.a133=788;t.a134=788;t.a135=788;t.a136=788;t.a137=788;t.a138=788;t.a139=788;t.a140=788;t.a141=788;t.a142=788;t.a143=788;t.a144=788;t.a145=788;t.a146=788;t.a147=788;t.a148=788;t.a149=788;t.a150=788;t.a151=788;t.a152=788;t.a153=788;t.a154=788;t.a155=788;t.a156=788;t.a157=788;t.a158=788;t.a159=788;t.a160=894;t.a161=838;t.a163=1016;t.a164=458;t.a196=748;t.a165=924;t.a192=748;t.a166=918;t.a167=927;t.a168=928;t.a169=928;t.a170=834;t.a171=873;t.a172=828;t.a173=924;t.a162=924;t.a174=917;t.a175=930;t.a176=931;t.a177=463;t.a178=883;t.a179=836;t.a193=836;t.a180=867;t.a199=867;t.a181=696;t.a200=696;t.a182=874;t.a201=874;t.a183=760;t.a184=946;t.a197=771;t.a185=865;t.a194=771;t.a198=888;t.a186=967;t.a195=888;t.a187=831;t.a188=873;t.a189=927;t.a190=970;t.a191=918}))}));r.getMetrics=l;var u=(0,c.getLookupTableFactory)((function(t){t.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426};t["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439};t["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};t["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};t.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523};t["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532};t["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523};t["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532};t["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450};t["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461};t["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441};t["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462};t.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN};t.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}));r.getFontBasicMetrics=u},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.GlyfTable=void 0;function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var o=function(){function GlyfTable(t){var r=t.glyfTable,o=t.isGlyphLocationsLong,l=t.locaTable,u=t.numGlyphs;_classCallCheck(this,GlyfTable);this.glyphs=[];for(var h=new DataView(l.buffer,l.byteOffset,l.byteLength),d=new DataView(r.buffer,r.byteOffset,r.byteLength),g=o?4:2,m=o?h.getUint32(0):2*h.getUint16(0),y=0,v=0;v<u;v++){y+=g;var k=o?h.getUint32(y):2*h.getUint16(y);if(k!==m){var _=c.parse(m,d);this.glyphs.push(_);m=k}else this.glyphs.push(new c({}))}}_createClass(GlyfTable,[{key:"getSize",value:function getSize(){return this.glyphs.reduce((function(t,r){return t+(r.getSize()+3&-4)}),0)}},{key:"write",value:function write(){var t=this.getSize(),r=new DataView(new ArrayBuffer(t)),o=t>131070,c=o?4:2,l=new DataView(new ArrayBuffer((this.glyphs.length+1)*c));o?l.setUint32(0,0):l.setUint16(0,0);var u,h=0,d=0,g=_createForOfIteratorHelper(this.glyphs);try{for(g.s();!(u=g.n()).done;){h=(h+=u.value.write(h,r))+3&-4;d+=c;o?l.setUint32(d,h):l.setUint16(d,h>>1)}}catch(t){g.e(t)}finally{g.f()}return{isLocationLong:o,loca:new Uint8Array(l.buffer),glyf:new Uint8Array(r.buffer)}}},{key:"scale",value:function scale(t){for(var r=0,o=this.glyphs.length;r<o;r++)this.glyphs[r].scale(t[r])}}]);return GlyfTable}();r.GlyfTable=o;var c=function(){function Glyph(t){var r=t.header,o=void 0===r?null:r,c=t.simple,l=void 0===c?null:c,u=t.composites,h=void 0===u?null:u;_classCallCheck(this,Glyph);this.header=o;this.simple=l;this.composites=h}_createClass(Glyph,[{key:"getSize",value:function getSize(){if(!this.header)return 0;var t=this.simple?this.simple.getSize():this.composites.reduce((function(t,r){return t+r.getSize()}),0);return this.header.getSize()+t}},{key:"write",value:function write(t,r){if(!this.header)return 0;var o=t;t+=this.header.write(t,r);if(this.simple)t+=this.simple.write(t,r);else{var c,l=_createForOfIteratorHelper(this.composites);try{for(l.s();!(c=l.n()).done;){t+=c.value.write(t,r)}}catch(t){l.e(t)}finally{l.f()}}return t-o}},{key:"scale",value:function scale(t){if(this.header){var r=(this.header.xMin+this.header.xMax)/2;this.header.scale(r,t);if(this.simple)this.simple.scale(r,t);else{var o,c=_createForOfIteratorHelper(this.composites);try{for(c.s();!(o=c.n()).done;){o.value.scale(r,t)}}catch(t){c.e(t)}finally{c.f()}}}}}],[{key:"parse",value:function parse(t,r){var o=_slicedToArray(l.parse(t,r),2),c=o[0],u=o[1];t+=c;if(u.numberOfContours<0){for(var g=[];;){var m=_slicedToArray(d.parse(t,r),2),y=m[0],v=m[1];t+=y;g.push(v);if(!(32&v.flags))break}return new Glyph({header:u,composites:g})}return new Glyph({header:u,simple:h.parse(t,r,u.numberOfContours)})}}]);return Glyph}(),l=function(){function GlyphHeader(t){var r=t.numberOfContours,o=t.xMin,c=t.yMin,l=t.xMax,u=t.yMax;_classCallCheck(this,GlyphHeader);this.numberOfContours=r;this.xMin=o;this.yMin=c;this.xMax=l;this.yMax=u}_createClass(GlyphHeader,[{key:"getSize",value:function getSize(){return 10}},{key:"write",value:function write(t,r){r.setInt16(t,this.numberOfContours);r.setInt16(t+2,this.xMin);r.setInt16(t+4,this.yMin);r.setInt16(t+6,this.xMax);r.setInt16(t+8,this.yMax);return 10}},{key:"scale",value:function scale(t,r){this.xMin=Math.round(t+(this.xMin-t)*r);this.xMax=Math.round(t+(this.xMax-t)*r)}}],[{key:"parse",value:function parse(t,r){return[10,new GlyphHeader({numberOfContours:r.getInt16(t),xMin:r.getInt16(t+2),yMin:r.getInt16(t+4),xMax:r.getInt16(t+6),yMax:r.getInt16(t+8)})]}}]);return GlyphHeader}(),u=_createClass((function Contour(t){var r=t.flags,o=t.xCoordinates,c=t.yCoordinates;_classCallCheck(this,Contour);this.xCoordinates=o;this.yCoordinates=c;this.flags=r})),h=function(){function SimpleGlyph(t){var r=t.contours,o=t.instructions;_classCallCheck(this,SimpleGlyph);this.contours=r;this.instructions=o}_createClass(SimpleGlyph,[{key:"getSize",value:function getSize(){var t,r=2*this.contours.length+2+this.instructions.length,o=0,c=0,l=_createForOfIteratorHelper(this.contours);try{for(l.s();!(t=l.n()).done;){var u=t.value;r+=u.flags.length;for(var h=0,d=u.xCoordinates.length;h<d;h++){var g=u.xCoordinates[h],m=u.yCoordinates[h],y=Math.abs(g-o);y>255?r+=2:y>0&&(r+=1);o=g;(y=Math.abs(m-c))>255?r+=2:y>0&&(r+=1);c=m}}}catch(t){l.e(t)}finally{l.f()}return r}},{key:"write",value:function write(t,r){var o,c=t,l=[],u=[],h=[],d=0,g=0,m=_createForOfIteratorHelper(this.contours);try{for(m.s();!(o=m.n()).done;){for(var y=o.value,v=0,k=y.xCoordinates.length;v<k;v++){var _=y.flags[v],w=y.xCoordinates[v],S=w-d;if(0===S){_|=16;l.push(0)}else{var C=Math.abs(S);if(C<=255){_|=S>=0?18:2;l.push(C)}else l.push(S)}d=w;var x=y.yCoordinates[v];if(0===(S=x-g)){_|=32;u.push(0)}else{var O=Math.abs(S);if(O<=255){_|=S>=0?36:4;u.push(O)}else u.push(S)}g=x;h.push(_)}r.setUint16(t,l.length-1);t+=2}}catch(t){m.e(t)}finally{m.f()}r.setUint16(t,this.instructions.length);t+=2;if(this.instructions.length){new Uint8Array(r.buffer,0,r.buffer.byteLength).set(this.instructions,t);t+=this.instructions.length}for(var T=0,E=h;T<E.length;T++){var M=E[T];r.setUint8(t++,M)}for(var R=0,j=l.length;R<j;R++){var D=l[R],L=h[R];if(2&L)r.setUint8(t++,D);else if(!(16&L)){r.setInt16(t,D);t+=2}}for(var N=0,U=u.length;N<U;N++){var H=u[N],$=h[N];if(4&$)r.setUint8(t++,H);else if(!(32&$)){r.setInt16(t,H);t+=2}}return t-c}},{key:"scale",value:function scale(t,r){var o,c=_createForOfIteratorHelper(this.contours);try{for(c.s();!(o=c.n()).done;){var l=o.value;if(0!==l.xCoordinates.length)for(var u=0,h=l.xCoordinates.length;u<h;u++)l.xCoordinates[u]=Math.round(t+(l.xCoordinates[u]-t)*r)}}catch(t){c.e(t)}finally{c.f()}}}],[{key:"parse",value:function parse(t,r,o){for(var c=[],l=0;l<o;l++){var h=r.getUint16(t);t+=2;c.push(h)}var d=c[o-1]+1,g=r.getUint16(t);t+=2;var m=new Uint8Array(r).slice(t,t+g);t+=g;for(var y=[],v=0;v<d;t++,v++){var k=r.getUint8(t);y.push(k);if(8&k){var _=r.getUint8(++t);k^=8;for(var w=0;w<_;w++)y.push(k);v+=_}}for(var S=[],C=[],x=[],O=[],T=[],E=0,M=0,R=0;R<d;R++){var j=y[R];if(2&j){var D=r.getUint8(t++);M+=16&j?D:-D;C.push(M)}else if(16&j)C.push(M);else{M+=r.getInt16(t);t+=2;C.push(M)}if(c[E]===R){E++;S.push(C);C=[]}}M=0;E=0;for(var L=0;L<d;L++){var N=y[L];if(4&N){var U=r.getUint8(t++);M+=32&N?U:-U;x.push(M)}else if(32&N)x.push(M);else{M+=r.getInt16(t);t+=2;x.push(M)}O.push(1&N|64&N);if(c[E]===L){C=S[E];E++;T.push(new u({flags:O,xCoordinates:C,yCoordinates:x}));x=[];O=[]}}return new SimpleGlyph({contours:T,instructions:m})}}]);return SimpleGlyph}(),d=function(){function CompositeGlyph(t){var r=t.flags,o=t.glyphIndex,c=t.argument1,l=t.argument2,u=t.transf,h=t.instructions;_classCallCheck(this,CompositeGlyph);this.flags=r;this.glyphIndex=o;this.argument1=c;this.argument2=l;this.transf=u;this.instructions=h}_createClass(CompositeGlyph,[{key:"getSize",value:function getSize(){var t=4+2*this.transf.length;256&this.flags&&(t+=2+this.instructions.length);t+=2;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(t+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(t+=2);return t}},{key:"write",value:function write(t,r){var o=t;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1);r.setUint16(t,this.flags);r.setUint16(t+2,this.glyphIndex);t+=4;if(1&this.flags){if(2&this.flags){r.setInt16(t,this.argument1);r.setInt16(t+2,this.argument2)}else{r.setUint16(t,this.argument1);r.setUint16(t+2,this.argument2)}t+=4}else{r.setUint8(t,this.argument1);r.setUint8(t+1,this.argument2);t+=2}if(256&this.flags){r.setUint16(t,this.instructions.length);t+=2;if(this.instructions.length){new Uint8Array(r.buffer,0,r.buffer.byteLength).set(this.instructions,t);t+=this.instructions.length}}return t-o}},{key:"scale",value:function scale(t,r){}}],[{key:"parse",value:function parse(t,r){var o,c,l=t,u=[],h=r.getUint16(t),d=r.getUint16(t+2);t+=4;if(1&h){if(2&h){o=r.getInt16(t);c=r.getInt16(t+2)}else{o=r.getUint16(t);c=r.getUint16(t+2)}t+=4;h^=1}else{if(2&h){o=r.getInt8(t);c=r.getInt8(t+1)}else{o=r.getUint8(t);c=r.getUint8(t+1)}t+=2}if(8&h){u.push(r.getUint16(t));t+=2}else if(64&h){u.push(r.getUint16(t),r.getUint16(t+2));t+=4}else if(128&h){u.push(r.getUint16(t),r.getUint16(t+2),r.getUint16(t+4),r.getUint16(t+6));t+=8}var g=null;if(256&h){var m=r.getUint16(t);t+=2;g=new Uint8Array(r).slice(t,t+m);t+=m}return[t-l,new CompositeGlyph({flags:h,glyphIndex:d,argument1:o,argument2:c,transf:u,instructions:g})]}}]);return CompositeGlyph}()},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OpenTypeFileBuilder=void 0;var c=o(149),l=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function writeInt16(t,r,o){t[r]=o>>8&255;t[r+1]=255&o}function writeInt32(t,r,o){t[r]=o>>24&255;t[r+1]=o>>16&255;t[r+2]=o>>8&255;t[r+3]=255&o}function writeData(t,r,o){if(o instanceof Uint8Array)t.set(o,r);else if("string"==typeof o)for(var c=0,l=o.length;c<l;c++)t[r++]=255&o.charCodeAt(c);else for(var u=0,h=o.length;u<h;u++)t[r++]=255&o[u]}var u=function(){function OpenTypeFileBuilder(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,OpenTypeFileBuilder);this.sfnt=t;this.tables=Object.create(null)}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(OpenTypeFileBuilder,[{key:"toArray",value:function toArray(){var t=this.sfnt,r=this.tables,o=Object.keys(r);o.sort();var u,h,d,g,m,y=o.length,v=12+16*y,k=[v];for(u=0;u<y;u++){v+=((g=r[o[u]]).length+3&-4)>>>0;k.push(v)}var _=new Uint8Array(v);for(u=0;u<y;u++){g=r[o[u]];writeData(_,k[u],g)}"true"===t&&(t=(0,l.string32)(65536));_[0]=255&t.charCodeAt(0);_[1]=255&t.charCodeAt(1);_[2]=255&t.charCodeAt(2);_[3]=255&t.charCodeAt(3);writeInt16(_,4,y);var w=OpenTypeFileBuilder.getSearchParams(y,16);writeInt16(_,6,w.range);writeInt16(_,8,w.entry);writeInt16(_,10,w.rangeShift);v=12;for(u=0;u<y;u++){m=o[u];_[v]=255&m.charCodeAt(0);_[v+1]=255&m.charCodeAt(1);_[v+2]=255&m.charCodeAt(2);_[v+3]=255&m.charCodeAt(3);var S=0;for(h=k[u],d=k[u+1];h<d;h+=4){S=S+(0,c.readUint32)(_,h)>>>0}writeInt32(_,v+4,S);writeInt32(_,v+8,k[u]);writeInt32(_,v+12,r[m].length);v+=16}return _}},{key:"addTable",value:function addTable(t,r){if(t in this.tables)throw new Error("Table "+t+" already exists");this.tables[t]=r}}],[{key:"getSearchParams",value:function getSearchParams(t,r){for(var o=1,c=0;(o^t)>o;){o<<=1;c++}var l=o*r;return{range:l,entry:c,rangeShift:r*t-l}}}]);return OpenTypeFileBuilder}();r.OpenTypeFileBuilder=u},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Type1Font=void 0;var c=o(186),l=o(159),u=o(149),h=o(151),d=o(196),g=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function findBlock(t,r,o){for(var c=t.length,l=r.length,h=c-l,d=o,g=!1;d<h;){for(var m=0;m<l&&t[d+m]===r[m];)m++;if(m>=l){d+=m;for(;d<c&&(0,u.isWhiteSpace)(t[d]);)d++;g=!0;break}d++}return{found:g,length:d}}var m=function(){function Type1Font(t,r,o){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Type1Font);var c=o.length1,u=(o.length2,r.peekBytes(6)),m=128===u[0]&&1===u[1];if(m){r.skip(6);c=u[5]<<24|u[4]<<16|u[3]<<8|u[2]}var y=function getHeaderBlock(t,r){var o,c,l,u,d=[101,101,120,101,99],m=t.pos;try{c=(o=t.getBytes(r)).length}catch(t){}if(c===r&&(l=findBlock(o,d,r-2*d.length)).found&&l.length===r)return{stream:new h.Stream(o),length:r};(0,g.warn)('Invalid "Length1" property in Type1 font -- trying to recover.');t.pos=m;for(;0!==(l=findBlock(t.peekBytes(2048),d,0)).length;){t.pos+=l.length;if(l.found){u=t.pos-m;break}}t.pos=m;if(u)return{stream:new h.Stream(t.getBytes(u)),length:u};(0,g.warn)('Unable to recover "Length1" property in Type1 font -- using as is.');return{stream:new h.Stream(t.getBytes(r)),length:r}}(r,c);new d.Type1Parser(y.stream,!1,l.SEAC_ANALYSIS_ENABLED).extractFontHeader(o);m&&(u=r.getBytes(6))[5]<<24|u[4]<<16|u[3]<<8|u[2];var v=function getEexecBlock(t,r){var o=t.getBytes();return{stream:new h.Stream(o),length:o.length}}(r),k=new d.Type1Parser(v.stream,!0,l.SEAC_ANALYSIS_ENABLED).extractFontProgram(o);for(var _ in k.properties)o[_]=k.properties[_];var w=k.charstrings,S=this.getType2Charstrings(w),C=this.getType2Subrs(k.subrs);this.charstrings=w;this.data=this.wrap(t,S,this.charstrings,C,o);this.seacs=this.getSeacs(k.charstrings)}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(Type1Font,[{key:"numGlyphs",get:function get(){return this.charstrings.length+1}},{key:"getCharset",value:function getCharset(){for(var t=[".notdef"],r=this.charstrings,o=0;o<r.length;o++)t.push(r[o].glyphName);return t}},{key:"getGlyphMapping",value:function getGlyphMapping(t){var r=this.charstrings;if(t.composite){for(var o=Object.create(null),c=0,u=r.length;c<u;c++){o[t.cMap.charCodeOf(c)]=c+1}return o}var h,d,g=[".notdef"];for(d=0;d<r.length;d++)g.push(r[d].glyphName);var m=t.builtInEncoding;if(m){h=Object.create(null);for(var y in m)(d=g.indexOf(m[y]))>=0&&(h[y]=d)}return(0,l.type1FontGlyphMapping)(t,h,g)}},{key:"hasGlyphId",value:function hasGlyphId(t){return!(t<0||t>=this.numGlyphs)&&(0===t||this.charstrings[t-1].charstring.length>0)}},{key:"getSeacs",value:function getSeacs(t){for(var r=[],o=0,c=t.length;o<c;o++){var l=t[o];l.seac&&(r[o+1]=l.seac)}return r}},{key:"getType2Charstrings",value:function getType2Charstrings(t){for(var r=[],o=0,c=t.length;o<c;o++)r.push(t[o].charstring);return r}},{key:"getType2Subrs",value:function getType2Subrs(t){var r=0,o=t.length;r=o<1133?107:o<33769?1131:32768;var c,l=[];for(c=0;c<r;c++)l.push([11]);for(c=0;c<o;c++)l.push(t[c]);return l}},{key:"wrap",value:function wrap(t,r,o,l,u){var h=new c.CFF;h.header=new c.CFFHeader(1,0,4,4);h.names=[t];var d=new c.CFFTopDict;d.setByName("version",391);d.setByName("Notice",392);d.setByName("FullName",393);d.setByName("FamilyName",394);d.setByName("Weight",395);d.setByName("Encoding",null);d.setByName("FontMatrix",u.fontMatrix);d.setByName("FontBBox",u.bbox);d.setByName("charset",null);d.setByName("CharStrings",null);d.setByName("Private",null);h.topDict=d;var g=new c.CFFStrings;g.add("Version 0.11");g.add("See original notice");g.add(t);g.add(t);g.add("Medium");h.strings=g;h.globalSubrIndex=new c.CFFIndex;var m,y,v=r.length,k=[".notdef"];for(m=0;m<v;m++){var _=o[m].glyphName;-1===c.CFFStandardStrings.indexOf(_)&&g.add(_);k.push(_)}h.charset=new c.CFFCharset(!1,0,k);var w=new c.CFFIndex;w.add([139,14]);for(m=0;m<v;m++)w.add(r[m]);h.charStrings=w;var S=new c.CFFPrivateDict;S.setByName("Subrs",null);var C=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(m=0,y=C.length;m<y;m++){var x=C[m];if(x in u.privateData){var O=u.privateData[x];if(Array.isArray(O))for(var T=O.length-1;T>0;T--)O[T]-=O[T-1];S.setByName(x,O)}}h.topDict.privateDict=S;var E=new c.CFFIndex;for(m=0,y=l.length;m<y;m++)E.add(l[m]);S.subrsIndex=E;return new c.CFFCompiler(h).compile()}}]);return Type1Font}();r.Type1Font=m},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Type1Parser=void 0;var c=o(160),l=o(149),u=o(151),h=o(4);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var d=function Type1CharStringClosure(){var t=[4],r=[5],o=[6],c=[7],l=[8],u=[12,35],d=[14],g=[21],m=[22],y=[30],v=[31];return function(){function Type1CharString(){_classCallCheck(this,Type1CharString);this.width=0;this.lsb=0;this.flexing=!1;this.output=[];this.stack=[]}_createClass(Type1CharString,[{key:"convert",value:function convert(k,_,w){for(var S,C,x,O=k.length,T=!1,E=0;E<O;E++){var M=k[E];if(M<32){12===M&&(M=(M<<8)+k[++E]);switch(M){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){T=!0;break}var R=this.stack.pop();this.stack.push(0,R);break}T=this.executeCommand(1,t);break;case 5:T=this.executeCommand(2,r);break;case 6:T=this.executeCommand(1,o);break;case 7:T=this.executeCommand(1,c);break;case 8:T=this.executeCommand(6,l);break;case 10:if(this.stack.length<1){T=!0;break}if(!_[x=this.stack.pop()]){T=!0;break}T=this.convert(_[x],_,w);break;case 11:return T;case 13:if(this.stack.length<2){T=!0;break}S=this.stack.pop();C=this.stack.pop();this.lsb=C;this.width=S;this.stack.push(S,C);T=this.executeCommand(2,m);break;case 14:this.output.push(d[0]);break;case 21:if(this.flexing)break;T=this.executeCommand(2,g);break;case 22:if(this.flexing){this.stack.push(0);break}T=this.executeCommand(1,m);break;case 30:T=this.executeCommand(4,y);break;case 31:T=this.executeCommand(4,v);break;case 3078:if(w){var j=this.stack[this.stack.length-5];this.seac=this.stack.splice(-4,4);this.seac[0]+=this.lsb-j;T=this.executeCommand(0,d)}else T=this.executeCommand(4,d);break;case 3079:if(this.stack.length<4){T=!0;break}this.stack.pop();S=this.stack.pop();var D=this.stack.pop();C=this.stack.pop();this.lsb=C;this.width=S;this.stack.push(S,C,D);T=this.executeCommand(3,g);break;case 3084:if(this.stack.length<2){T=!0;break}var L=this.stack.pop(),N=this.stack.pop();this.stack.push(N/L);break;case 3088:if(this.stack.length<2){T=!0;break}x=this.stack.pop();var U=this.stack.pop();if(0===x&&3===U){var H=this.stack.splice(this.stack.length-17,17);this.stack.push(H[2]+H[0],H[3]+H[1],H[4],H[5],H[6],H[7],H[8],H[9],H[10],H[11],H[12],H[13],H[14]);T=this.executeCommand(13,u,!0);this.flexing=!1;this.stack.push(H[15],H[16])}else 1===x&&0===U&&(this.flexing=!0);break;case 3089:break;default:(0,h.warn)('Unknown type 1 charstring command of "'+M+'"')}if(T)break}else{M<=246?M-=139:M=M<=250?256*(M-247)+k[++E]+108:M<=254?-256*(M-251)-k[++E]-108:(255&k[++E])<<24|(255&k[++E])<<16|(255&k[++E])<<8|(255&k[++E])<<0;this.stack.push(M)}}return T}},{key:"executeCommand",value:function executeCommand(t,r,o){var c=this.stack.length;if(t>c)return!0;for(var l=c-t,u=l;u<c;u++){var h=this.stack[u];if(Number.isInteger(h))this.output.push(28,h>>8&255,255&h);else{h=65536*h|0;this.output.push(255,h>>24&255,h>>16&255,h>>8&255,255&h)}}this.output.push.apply(this.output,r);o?this.stack.splice(l,t):this.stack.length=0;return!1}}]);return Type1CharString}()}(),g=function Type1ParserClosure(){function isHexDigit(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function decrypt(t,r,o){if(o>=t.length)return new Uint8Array(0);var c,l,u=0|r;for(c=0;c<o;c++)u=52845*(t[c]+u)+22719&65535;var h=t.length-o,d=new Uint8Array(h);for(c=o,l=0;l<h;c++,l++){var g=t[c];d[l]=g^u>>8;u=52845*(g+u)+22719&65535}return d}function isSpecial(t){return 47===t||91===t||93===t||123===t||125===t||40===t||41===t}return function(){function Type1Parser(t,r,o){_classCallCheck(this,Type1Parser);if(r){var c=t.getBytes(),h=!((isHexDigit(c[0])||(0,l.isWhiteSpace)(c[0]))&&isHexDigit(c[1])&&isHexDigit(c[2])&&isHexDigit(c[3])&&isHexDigit(c[4])&&isHexDigit(c[5])&&isHexDigit(c[6])&&isHexDigit(c[7]));t=new u.Stream(h?decrypt(c,55665,4):function decryptAscii(t,r,o){var c,l,u=0|r,h=t.length,d=new Uint8Array(h>>>1);for(c=0,l=0;c<h;c++){var g=t[c];if(isHexDigit(g)){c++;for(var m=void 0;c<h&&!isHexDigit(m=t[c]);)c++;if(c<h){var y=parseInt(String.fromCharCode(g,m),16);d[l++]=y^u>>8;u=52845*(y+u)+22719&65535}}}return d.slice(o,l)}(c,55665,4))}this.seacAnalysisEnabled=!!o;this.stream=t;this.nextChar()}_createClass(Type1Parser,[{key:"readNumberArray",value:function readNumberArray(){this.getToken();for(var t=[];;){var r=this.getToken();if(null===r||"]"===r||"}"===r)break;t.push(parseFloat(r||0))}return t}},{key:"readNumber",value:function readNumber(){var t=this.getToken();return parseFloat(t||0)}},{key:"readInt",value:function readInt(){var t=this.getToken();return 0|parseInt(t||0,10)}},{key:"readBoolean",value:function readBoolean(){return"true"===this.getToken()?1:0}},{key:"nextChar",value:function nextChar(){return this.currentChar=this.stream.getByte()}},{key:"prevChar",value:function prevChar(){this.stream.skip(-2);return this.currentChar=this.stream.getByte()}},{key:"getToken",value:function getToken(){for(var t=!1,r=this.currentChar;;){if(-1===r)return null;if(t)10!==r&&13!==r||(t=!1);else if(37===r)t=!0;else if(!(0,l.isWhiteSpace)(r))break;r=this.nextChar()}if(isSpecial(r)){this.nextChar();return String.fromCharCode(r)}var o="";do{o+=String.fromCharCode(r);r=this.nextChar()}while(r>=0&&!(0,l.isWhiteSpace)(r)&&!isSpecial(r));return o}},{key:"readCharStrings",value:function readCharStrings(t,r){return-1===r?t:decrypt(t,4330,r)}},{key:"extractFontProgram",value:function extractFontProgram(t){var r=this.stream,o=[],c=[],l=Object.create(null);l.lenIV=4;for(var u,h,g,m,y,v={subrs:[],charstrings:[],properties:{privateData:l}};null!==(u=this.getToken());)if("/"===u)switch(u=this.getToken()){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();for(;null!==(u=this.getToken())&&"end"!==u;)if("/"===u){var k=this.getToken();h=this.readInt();this.getToken();g=h>0?r.getBytes(h):new Uint8Array(0);m=v.properties.privateData.lenIV;y=this.readCharStrings(g,m);this.nextChar();"noaccess"===(u=this.getToken())?this.getToken():"/"===u&&this.prevChar();c.push({glyph:k,encoded:y})}break;case"Subrs":this.readInt();this.getToken();for(;"dup"===this.getToken();){var _=this.readInt();h=this.readInt();this.getToken();g=h>0?r.getBytes(h):new Uint8Array(0);m=v.properties.privateData.lenIV;y=this.readCharStrings(g,m);this.nextChar();"noaccess"===(u=this.getToken())&&this.getToken();o[_]=y}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":var w=this.readNumberArray();w.length>0&&w.length,0;break;case"StemSnapH":case"StemSnapV":v.properties.privateData[u]=this.readNumberArray();break;case"StdHW":case"StdVW":v.properties.privateData[u]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":v.properties.privateData[u]=this.readNumber();break;case"ForceBold":v.properties.privateData[u]=this.readBoolean()}for(var S=0;S<c.length;S++){var C=c[S].glyph;y=c[S].encoded;var x=new d,O=x.convert(y,o,this.seacAnalysisEnabled),T=x.output;O&&(T=[14]);var E={glyphName:C,charstring:T,width:x.width,lsb:x.lsb,seac:x.seac};".notdef"===C?v.charstrings.unshift(E):v.charstrings.push(E);if(t.builtInEncoding){var M=t.builtInEncoding.indexOf(C);M>-1&&void 0===t.widths[M]&&M>=t.firstChar&&M<=t.lastChar&&(t.widths[M]=x.width)}}return v}},{key:"extractFontHeader",value:function extractFontHeader(t){for(var r;null!==(r=this.getToken());)if("/"===r)switch(r=this.getToken()){case"FontMatrix":var o=this.readNumberArray();t.fontMatrix=o;break;case"Encoding":var l=this.getToken(),u=void 0;if(/^\d+$/.test(l)){u=[];var h=0|parseInt(l,10);this.getToken();for(var d=0;d<h;d++){r=this.getToken();for(;"dup"!==r&&"def"!==r;)if(null===(r=this.getToken()))return;if("def"===r)break;var g=this.readInt();this.getToken();var m=this.getToken();u[g]=m;this.getToken()}}else u=(0,c.getEncoding)(l);t.builtInEncoding=u;break;case"FontBBox":var y=this.readNumberArray();t.ascent=Math.max(y[3],y[1]);t.descent=Math.min(y[1],y[3]);t.ascentScaled=!0}}}]);return Type1Parser}()}();r.Type1Parser=g},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Pattern=void 0;r.getTilingPatternIR=function getTilingPatternIR(t,r,o){var l=r.getArray("Matrix"),u=c.Util.normalizeRect(r.getArray("BBox")),h=r.get("XStep"),d=r.get("YStep"),g=r.get("PaintType"),m=r.get("TilingType");if(u[2]-u[0]==0||u[3]-u[1]==0)throw new c.FormatError("Invalid getTilingPatternIR /BBox array: [".concat(u,"]."));return["TilingPattern",o,t,l,u,h,d,g,m]};var c=o(4),l=o(150),u=o(165),h=o(149);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var d=2,g=3,m=4,y=5,v=6,k=7,_=function(){function Pattern(){_classCallCheck(this,Pattern);(0,c.unreachable)("Cannot initialize Pattern.")}_createClass(Pattern,null,[{key:"parseShading",value:function parseShading(t,r,o,u,_,w){var C=t instanceof l.BaseStream?t.dict:t,x=C.get("ShadingType");try{switch(x){case d:case g:return new S(C,r,o,_,w);case m:case y:case v:case k:return new O(t,r,o,_,w);default:throw new c.FormatError("Unsupported ShadingType: "+x)}}catch(t){if(t instanceof h.MissingDataException)throw t;u.send("UnsupportedFeature",{featureId:c.UNSUPPORTED_FEATURES.shadingPattern});(0,c.warn)(t);return new T}}}]);return Pattern}();r.Pattern=_;var w=function(){function BaseShading(){_classCallCheck(this,BaseShading);this.constructor===BaseShading&&(0,c.unreachable)("Cannot initialize BaseShading.")}_createClass(BaseShading,[{key:"getIR",value:function getIR(){(0,c.unreachable)("Abstract method `getIR` called.")}}],[{key:"SMALL_NUMBER",get:function get(){return(0,c.shadow)(this,"SMALL_NUMBER",1e-6)}}]);return BaseShading}(),S=function(t){_inherits(RadialAxialShading,t);var r=_createSuper(RadialAxialShading);function RadialAxialShading(t,o,l,h,d){var m;_classCallCheck(this,RadialAxialShading);(m=r.call(this)).coordsArr=t.getArray("Coords");m.shadingType=t.get("ShadingType");var y=u.ColorSpace.parse({cs:t.getRaw("CS")||t.getRaw("ColorSpace"),xref:o,resources:l,pdfFunctionFactory:h,localColorSpaceCache:d}),v=t.getArray("BBox");Array.isArray(v)&&4===v.length?m.bbox=c.Util.normalizeRect(v):m.bbox=null;var k=0,_=1;if(t.has("Domain")){var S=t.getArray("Domain");k=S[0];_=S[1]}var C=!1,x=!1;if(t.has("Extend")){var O=t.getArray("Extend");C=O[0];x=O[1]}if(!(m.shadingType!==g||C&&x)){var T=_slicedToArray(m.coordsArr,6),E=T[0],M=T[1],R=T[2],j=T[3],D=T[4],L=T[5],N=Math.hypot(E-j,M-D);R<=L+N&&L<=R+N&&(0,c.warn)("Unsupported radial gradient.")}m.extendStart=C;m.extendEnd=x;var U=t.getRaw("Function"),H=h.createFromArray(U),$=(_-k)/10,X=m.colorStops=[];if(k>=_||$<=0){(0,c.info)("Bad shading domain.");return _possibleConstructorReturn(m)}for(var q,G=new Float32Array(y.numComps),z=new Float32Array(1),W=0;W<=10;W++){z[0]=k+W*$;H(z,0,G,0);q=y.getRgb(G,0);var V=c.Util.makeHexColor(q[0],q[1],q[2]);X.push([W/10,V])}var K="transparent";if(t.has("Background")){q=y.getRgb(t.get("Background"),0);K=c.Util.makeHexColor(q[0],q[1],q[2])}if(!C){X.unshift([0,K]);X[1][0]+=w.SMALL_NUMBER}if(!x){X[X.length-1][0]-=w.SMALL_NUMBER;X.push([1,K])}m.colorStops=X;return m}_createClass(RadialAxialShading,[{key:"getIR",value:function getIR(){var t,r,o,l,u,h=this.coordsArr,m=this.shadingType;if(m===d){r=[h[0],h[1]];o=[h[2],h[3]];l=null;u=null;t="axial"}else if(m===g){r=[h[0],h[1]];o=[h[3],h[4]];l=h[2];u=h[5];t="radial"}else(0,c.unreachable)("getPattern type unknown: ".concat(m));return["RadialAxial",t,this.bbox,this.colorStops,r,o,l,u]}}]);return RadialAxialShading}(w),C=function(){function MeshStreamReader(t,r){_classCallCheck(this,MeshStreamReader);this.stream=t;this.context=r;this.buffer=0;this.bufferLength=0;var o=r.numComps;this.tmpCompsBuf=new Float32Array(o);var c=r.colorSpace.numComps;this.tmpCsCompsBuf=r.colorFn?new Float32Array(c):this.tmpCompsBuf}_createClass(MeshStreamReader,[{key:"hasData",get:function get(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;var t=this.stream.getByte();if(t<0)return!1;this.buffer=t;this.bufferLength=8;return!0}},{key:"readBits",value:function readBits(t){var r=this.buffer,o=this.bufferLength;if(32===t){if(0===o)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;r=r<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();var c=this.stream.getByte();this.buffer=c&(1<<o)-1;return(r<<8-o|(255&c)>>o)>>>0}if(8===t&&0===o)return this.stream.getByte();for(;o<t;){r=r<<8|this.stream.getByte();o+=8}o-=t;this.bufferLength=o;this.buffer=r&(1<<o)-1;return r>>o}},{key:"align",value:function align(){this.buffer=0;this.bufferLength=0}},{key:"readFlag",value:function readFlag(){return this.readBits(this.context.bitsPerFlag)}},{key:"readCoordinate",value:function readCoordinate(){var t=this.context.bitsPerCoordinate,r=this.readBits(t),o=this.readBits(t),c=this.context.decode,l=t<32?1/((1<<t)-1):2.3283064365386963e-10;return[r*l*(c[1]-c[0])+c[0],o*l*(c[3]-c[2])+c[2]]}},{key:"readComponents",value:function readComponents(){for(var t=this.context.numComps,r=this.context.bitsPerComponent,o=r<32?1/((1<<r)-1):2.3283064365386963e-10,c=this.context.decode,l=this.tmpCompsBuf,u=0,h=4;u<t;u++,h+=2){var d=this.readBits(r);l[u]=d*o*(c[h+1]-c[h])+c[h]}var g=this.tmpCsCompsBuf;this.context.colorFn&&this.context.colorFn(l,0,g,0);return this.context.colorSpace.getRgb(g,0)}}]);return MeshStreamReader}(),x=function getBClosure(){var t=[];return function(r){t[r]||(t[r]=function buildB(t){for(var r=[],o=0;o<=t;o++){var c=o/t,l=1-c;r.push(new Float32Array([l*l*l,3*c*l*l,3*c*c*l,c*c*c]))}return r}(r));return t[r]}}(),O=function(t){_inherits(MeshShading,t);var r=_createSuper(MeshShading);function MeshShading(t,o,h,d,g){var _;_classCallCheck(this,MeshShading);_=r.call(this);if(!(t instanceof l.BaseStream))throw new c.FormatError("Mesh data is not a stream");var w=t.dict;_.shadingType=w.get("ShadingType");var S=w.getArray("BBox");Array.isArray(S)&&4===S.length?_.bbox=c.Util.normalizeRect(S):_.bbox=null;var x=u.ColorSpace.parse({cs:w.getRaw("CS")||w.getRaw("ColorSpace"),xref:o,resources:h,pdfFunctionFactory:d,localColorSpaceCache:g});_.background=w.has("Background")?x.getRgb(w.get("Background"),0):null;var O=w.getRaw("Function"),T=O?d.createFromArray(O):null;_.coords=[];_.colors=[];_.figures=[];var E={bitsPerCoordinate:w.get("BitsPerCoordinate"),bitsPerComponent:w.get("BitsPerComponent"),bitsPerFlag:w.get("BitsPerFlag"),decode:w.getArray("Decode"),colorFn:T,colorSpace:x,numComps:T?1:x.numComps},M=new C(t,E),R=!1;switch(_.shadingType){case m:_._decodeType4Shading(M);break;case y:var j=0|w.get("VerticesPerRow");if(j<2)throw new c.FormatError("Invalid VerticesPerRow");_._decodeType5Shading(M,j);break;case v:_._decodeType6Shading(M);R=!0;break;case k:_._decodeType7Shading(M);R=!0;break;default:(0,c.unreachable)("Unsupported mesh type.")}if(R){_._updateBounds();for(var D=0,L=_.figures.length;D<L;D++)_._buildFigureFromPatch(D)}_._updateBounds();_._packData();return _}_createClass(MeshShading,[{key:"_decodeType4Shading",value:function _decodeType4Shading(t){for(var r=this.coords,o=this.colors,l=[],u=[],h=0;t.hasData;){var d=t.readFlag(),g=t.readCoordinate(),m=t.readComponents();if(0===h){if(!(0<=d&&d<=2))throw new c.FormatError("Unknown type4 flag");switch(d){case 0:h=3;break;case 1:u.push(u[u.length-2],u[u.length-1]);h=1;break;case 2:u.push(u[u.length-3],u[u.length-1]);h=1}l.push(d)}u.push(r.length);r.push(g);o.push(m);h--;t.align()}this.figures.push({type:"triangles",coords:new Int32Array(u),colors:new Int32Array(u)})}},{key:"_decodeType5Shading",value:function _decodeType5Shading(t,r){for(var o=this.coords,c=this.colors,l=[];t.hasData;){var u=t.readCoordinate(),h=t.readComponents();l.push(o.length);o.push(u);c.push(h)}this.figures.push({type:"lattice",coords:new Int32Array(l),colors:new Int32Array(l),verticesPerRow:r})}},{key:"_decodeType6Shading",value:function _decodeType6Shading(t){for(var r=this.coords,o=this.colors,l=new Int32Array(16),u=new Int32Array(4);t.hasData;){var h=t.readFlag();if(!(0<=h&&h<=3))throw new c.FormatError("Unknown type6 flag");for(var d=r.length,g=0,m=0!==h?8:12;g<m;g++)r.push(t.readCoordinate());for(var y=o.length,v=0,k=0!==h?2:4;v<k;v++)o.push(t.readComponents());var _=void 0,w=void 0,S=void 0,C=void 0;switch(h){case 0:l[12]=d+3;l[13]=d+4;l[14]=d+5;l[15]=d+6;l[8]=d+2;l[11]=d+7;l[4]=d+1;l[7]=d+8;l[0]=d;l[1]=d+11;l[2]=d+10;l[3]=d+9;u[2]=y+1;u[3]=y+2;u[0]=y;u[1]=y+3;break;case 1:_=l[12];w=l[13];S=l[14];C=l[15];l[12]=C;l[13]=d+0;l[14]=d+1;l[15]=d+2;l[8]=S;l[11]=d+3;l[4]=w;l[7]=d+4;l[0]=_;l[1]=d+7;l[2]=d+6;l[3]=d+5;_=u[2];w=u[3];u[2]=w;u[3]=y;u[0]=_;u[1]=y+1;break;case 2:_=l[15];w=l[11];l[12]=l[3];l[13]=d+0;l[14]=d+1;l[15]=d+2;l[8]=l[7];l[11]=d+3;l[4]=w;l[7]=d+4;l[0]=_;l[1]=d+7;l[2]=d+6;l[3]=d+5;_=u[3];u[2]=u[1];u[3]=y;u[0]=_;u[1]=y+1;break;case 3:l[12]=l[0];l[13]=d+0;l[14]=d+1;l[15]=d+2;l[8]=l[1];l[11]=d+3;l[4]=l[2];l[7]=d+4;l[0]=l[3];l[1]=d+7;l[2]=d+6;l[3]=d+5;u[2]=u[0];u[3]=y;u[0]=u[1];u[1]=y+1}l[5]=r.length;r.push([(-4*r[l[0]][0]-r[l[15]][0]+6*(r[l[4]][0]+r[l[1]][0])-2*(r[l[12]][0]+r[l[3]][0])+3*(r[l[13]][0]+r[l[7]][0]))/9,(-4*r[l[0]][1]-r[l[15]][1]+6*(r[l[4]][1]+r[l[1]][1])-2*(r[l[12]][1]+r[l[3]][1])+3*(r[l[13]][1]+r[l[7]][1]))/9]);l[6]=r.length;r.push([(-4*r[l[3]][0]-r[l[12]][0]+6*(r[l[2]][0]+r[l[7]][0])-2*(r[l[0]][0]+r[l[15]][0])+3*(r[l[4]][0]+r[l[14]][0]))/9,(-4*r[l[3]][1]-r[l[12]][1]+6*(r[l[2]][1]+r[l[7]][1])-2*(r[l[0]][1]+r[l[15]][1])+3*(r[l[4]][1]+r[l[14]][1]))/9]);l[9]=r.length;r.push([(-4*r[l[12]][0]-r[l[3]][0]+6*(r[l[8]][0]+r[l[13]][0])-2*(r[l[0]][0]+r[l[15]][0])+3*(r[l[11]][0]+r[l[1]][0]))/9,(-4*r[l[12]][1]-r[l[3]][1]+6*(r[l[8]][1]+r[l[13]][1])-2*(r[l[0]][1]+r[l[15]][1])+3*(r[l[11]][1]+r[l[1]][1]))/9]);l[10]=r.length;r.push([(-4*r[l[15]][0]-r[l[0]][0]+6*(r[l[11]][0]+r[l[14]][0])-2*(r[l[12]][0]+r[l[3]][0])+3*(r[l[2]][0]+r[l[8]][0]))/9,(-4*r[l[15]][1]-r[l[0]][1]+6*(r[l[11]][1]+r[l[14]][1])-2*(r[l[12]][1]+r[l[3]][1])+3*(r[l[2]][1]+r[l[8]][1]))/9]);this.figures.push({type:"patch",coords:new Int32Array(l),colors:new Int32Array(u)})}}},{key:"_decodeType7Shading",value:function _decodeType7Shading(t){for(var r=this.coords,o=this.colors,l=new Int32Array(16),u=new Int32Array(4);t.hasData;){var h=t.readFlag();if(!(0<=h&&h<=3))throw new c.FormatError("Unknown type7 flag");for(var d=r.length,g=0,m=0!==h?12:16;g<m;g++)r.push(t.readCoordinate());for(var y=o.length,v=0,k=0!==h?2:4;v<k;v++)o.push(t.readComponents());var _=void 0,w=void 0,S=void 0,C=void 0;switch(h){case 0:l[12]=d+3;l[13]=d+4;l[14]=d+5;l[15]=d+6;l[8]=d+2;l[9]=d+13;l[10]=d+14;l[11]=d+7;l[4]=d+1;l[5]=d+12;l[6]=d+15;l[7]=d+8;l[0]=d;l[1]=d+11;l[2]=d+10;l[3]=d+9;u[2]=y+1;u[3]=y+2;u[0]=y;u[1]=y+3;break;case 1:_=l[12];w=l[13];S=l[14];C=l[15];l[12]=C;l[13]=d+0;l[14]=d+1;l[15]=d+2;l[8]=S;l[9]=d+9;l[10]=d+10;l[11]=d+3;l[4]=w;l[5]=d+8;l[6]=d+11;l[7]=d+4;l[0]=_;l[1]=d+7;l[2]=d+6;l[3]=d+5;_=u[2];w=u[3];u[2]=w;u[3]=y;u[0]=_;u[1]=y+1;break;case 2:_=l[15];w=l[11];l[12]=l[3];l[13]=d+0;l[14]=d+1;l[15]=d+2;l[8]=l[7];l[9]=d+9;l[10]=d+10;l[11]=d+3;l[4]=w;l[5]=d+8;l[6]=d+11;l[7]=d+4;l[0]=_;l[1]=d+7;l[2]=d+6;l[3]=d+5;_=u[3];u[2]=u[1];u[3]=y;u[0]=_;u[1]=y+1;break;case 3:l[12]=l[0];l[13]=d+0;l[14]=d+1;l[15]=d+2;l[8]=l[1];l[9]=d+9;l[10]=d+10;l[11]=d+3;l[4]=l[2];l[5]=d+8;l[6]=d+11;l[7]=d+4;l[0]=l[3];l[1]=d+7;l[2]=d+6;l[3]=d+5;u[2]=u[0];u[3]=y;u[0]=u[1];u[1]=y+1}this.figures.push({type:"patch",coords:new Int32Array(l),colors:new Int32Array(u)})}}},{key:"_buildFigureFromPatch",value:function _buildFigureFromPatch(t){var r=this.figures[t];(0,c.assert)("patch"===r.type,"Unexpected patch mesh figure");var o=this.coords,l=this.colors,u=r.coords,h=r.colors,d=Math.min(o[u[0]][0],o[u[3]][0],o[u[12]][0],o[u[15]][0]),g=Math.min(o[u[0]][1],o[u[3]][1],o[u[12]][1],o[u[15]][1]),m=Math.max(o[u[0]][0],o[u[3]][0],o[u[12]][0],o[u[15]][0]),y=Math.max(o[u[0]][1],o[u[3]][1],o[u[12]][1],o[u[15]][1]),v=Math.ceil((m-d)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));v=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,v));var k=Math.ceil((y-g)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));k=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,k));for(var _=v+1,w=new Int32Array((k+1)*_),S=new Int32Array((k+1)*_),C=0,O=new Uint8Array(3),T=new Uint8Array(3),E=l[h[0]],M=l[h[1]],R=l[h[2]],j=l[h[3]],D=x(k),L=x(v),N=0;N<=k;N++){O[0]=(E[0]*(k-N)+R[0]*N)/k|0;O[1]=(E[1]*(k-N)+R[1]*N)/k|0;O[2]=(E[2]*(k-N)+R[2]*N)/k|0;T[0]=(M[0]*(k-N)+j[0]*N)/k|0;T[1]=(M[1]*(k-N)+j[1]*N)/k|0;T[2]=(M[2]*(k-N)+j[2]*N)/k|0;for(var U=0;U<=v;U++,C++)if(0!==N&&N!==k||0!==U&&U!==v){for(var H=0,$=0,X=0,q=0;q<=3;q++)for(var G=0;G<=3;G++,X++){var z=D[N][q]*L[U][G];H+=o[u[X]][0]*z;$+=o[u[X]][1]*z}w[C]=o.length;o.push([H,$]);S[C]=l.length;var W=new Uint8Array(3);W[0]=(O[0]*(v-U)+T[0]*U)/v|0;W[1]=(O[1]*(v-U)+T[1]*U)/v|0;W[2]=(O[2]*(v-U)+T[2]*U)/v|0;l.push(W)}}w[0]=u[0];S[0]=h[0];w[v]=u[3];S[v]=h[1];w[_*k]=u[12];S[_*k]=h[2];w[_*k+v]=u[15];S[_*k+v]=h[3];this.figures[t]={type:"lattice",coords:w,colors:S,verticesPerRow:_}}},{key:"_updateBounds",value:function _updateBounds(){for(var t=this.coords[0][0],r=this.coords[0][1],o=t,c=r,l=1,u=this.coords.length;l<u;l++){var h=this.coords[l][0],d=this.coords[l][1];t=t>h?h:t;r=r>d?d:r;o=o<h?h:o;c=c<d?d:c}this.bounds=[t,r,o,c]}},{key:"_packData",value:function _packData(){var t,r,o,c,l=this.coords,u=new Float32Array(2*l.length);for(t=0,o=0,r=l.length;t<r;t++){var h=l[t];u[o++]=h[0];u[o++]=h[1]}this.coords=u;var d=this.colors,g=new Uint8Array(3*d.length);for(t=0,o=0,r=d.length;t<r;t++){var m=d[t];g[o++]=m[0];g[o++]=m[1];g[o++]=m[2]}this.colors=g;var y=this.figures;for(t=0,r=y.length;t<r;t++){var v=y[t],k=v.coords,_=v.colors;for(o=0,c=k.length;o<c;o++){k[o]*=2;_[o]*=3}}}},{key:"getIR",value:function getIR(){return["Mesh",this.shadingType,this.coords,this.colors,this.figures,this.bounds,this.bbox,this.background]}}],[{key:"MIN_SPLIT_PATCH_CHUNKS_AMOUNT",get:function get(){return(0,c.shadow)(this,"MIN_SPLIT_PATCH_CHUNKS_AMOUNT",3)}},{key:"MAX_SPLIT_PATCH_CHUNKS_AMOUNT",get:function get(){return(0,c.shadow)(this,"MAX_SPLIT_PATCH_CHUNKS_AMOUNT",20)}},{key:"TRIANGLE_DENSITY",get:function get(){return(0,c.shadow)(this,"TRIANGLE_DENSITY",20)}}]);return MeshShading}(w),T=function(t){_inherits(DummyShading,t);var r=_createSuper(DummyShading);function DummyShading(){_classCallCheck(this,DummyShading);return r.apply(this,arguments)}_createClass(DummyShading,[{key:"getIR",value:function getIR(){return["Dummy"]}}]);return DummyShading}(w)},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PostScriptEvaluator=r.PostScriptCompiler=r.PDFFunctionFactory=void 0;r.isPDFFunction=function isPDFFunction(t){var r;if("object"!==_typeof(t))return!1;if(t instanceof c.Dict)r=t;else{if(!(t instanceof h.BaseStream))return!1;r=t.dict}return r.has("FunctionType")};var c=o(146),l=o(4),u=o(199),h=o(150),d=o(200);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var g=function(){function PDFFunctionFactory(t){var r=t.xref,o=t.isEvalSupported,c=void 0===o||o;_classCallCheck(this,PDFFunctionFactory);this.xref=r;this.isEvalSupported=!1!==c}_createClass(PDFFunctionFactory,[{key:"create",value:function create(t){var r=this.getCached(t);if(r)return r;var o=m.parse({xref:this.xref,isEvalSupported:this.isEvalSupported,fn:t instanceof c.Ref?this.xref.fetch(t):t});this._cache(t,o);return o}},{key:"createFromArray",value:function createFromArray(t){var r=this.getCached(t);if(r)return r;var o=m.parseArray({xref:this.xref,isEvalSupported:this.isEvalSupported,fnObj:t instanceof c.Ref?this.xref.fetch(t):t});this._cache(t,o);return o}},{key:"getCached",value:function getCached(t){var r;t instanceof c.Ref?r=t:t instanceof c.Dict?r=t.objId:t instanceof h.BaseStream&&(r=t.dict&&t.dict.objId);if(r){var o=this._localFunctionCache.getByRef(r);if(o)return o}return null}},{key:"_cache",value:function _cache(t,r){if(!r)throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');var o;t instanceof c.Ref?o=t:t instanceof c.Dict?o=t.objId:t instanceof h.BaseStream&&(o=t.dict&&t.dict.objId);o&&this._localFunctionCache.set(null,o,r)}},{key:"_localFunctionCache",get:function get(){return(0,l.shadow)(this,"_localFunctionCache",new d.LocalFunctionCache)}}]);return PDFFunctionFactory}();r.PDFFunctionFactory=g;function toNumberArray(t){if(!Array.isArray(t))return null;for(var r=t.length,o=0;o<r;o++)if("number"!=typeof t[o]){for(var c=new Array(r),l=0;l<r;l++)c[l]=+t[l];return c}return t}var m=function(){function PDFFunction(){_classCallCheck(this,PDFFunction)}_createClass(PDFFunction,null,[{key:"getSampleArray",value:function getSampleArray(t,r,o,c){var l,u,h=1;for(l=0,u=t.length;l<u;l++)h*=t[l];h*=r;var d=new Array(h),g=0,m=0,y=1/(Math.pow(2,o)-1),v=c.getBytes((h*o+7)/8),k=0;for(l=0;l<h;l++){for(;g<o;){m<<=8;m|=v[k++];g+=8}g-=o;d[l]=(m>>g)*y;m&=(1<<g)-1}return d}},{key:"parse",value:function parse(t){var r=t.xref,o=t.isEvalSupported,c=t.fn,u=c.dict||c;switch(u.get("FunctionType")){case 0:return this.constructSampled({xref:r,isEvalSupported:o,fn:c,dict:u});case 1:break;case 2:return this.constructInterpolated({xref:r,isEvalSupported:o,dict:u});case 3:return this.constructStiched({xref:r,isEvalSupported:o,dict:u});case 4:return this.constructPostScript({xref:r,isEvalSupported:o,fn:c,dict:u})}throw new l.FormatError("Unknown type of function")}},{key:"parseArray",value:function parseArray(t){var r=t.xref,o=t.isEvalSupported,c=t.fnObj;if(!Array.isArray(c))return this.parse({xref:r,isEvalSupported:o,fn:c});for(var l=[],u=0,h=c.length;u<h;u++)l.push(this.parse({xref:r,isEvalSupported:o,fn:r.fetchIfRef(c[u])}));return function(t,r,o,c){for(var u=0,h=l.length;u<h;u++)l[u](t,r,o,c+u)}}},{key:"constructSampled",value:function constructSampled(t){t.xref,t.isEvalSupported;var r=t.fn,o=t.dict;function toMultiArray(t){for(var r=t.length,o=[],c=0,l=0;l<r;l+=2)o[c++]=[t[l],t[l+1]];return o}function interpolate(t,r,o,c,l){return c+(l-c)/(o-r)*(t-r)}var c=toNumberArray(o.getArray("Domain")),u=toNumberArray(o.getArray("Range"));if(!c||!u)throw new l.FormatError("No domain or range");var h=c.length/2,d=u.length/2;c=toMultiArray(c);u=toMultiArray(u);var g=toNumberArray(o.getArray("Size")),m=o.get("BitsPerSample"),y=o.get("Order")||1;1!==y&&(0,l.info)("No support for cubic spline interpolation: "+y);var v=toNumberArray(o.getArray("Encode"));if(v)v=toMultiArray(v);else{v=[];for(var k=0;k<h;++k)v.push([0,g[k]-1])}var _=toNumberArray(o.getArray("Decode"));_=_?toMultiArray(_):u;var w=this.getSampleArray(g,d,m,r);return function constructSampledFn(t,r,o,l){var m,y,k=1<<h,S=new Float64Array(k),C=new Uint32Array(k);for(y=0;y<k;y++)S[y]=1;var x=d,O=1;for(m=0;m<h;++m){var T=c[m][0],E=c[m][1],M=interpolate(Math.min(Math.max(t[r+m],T),E),T,E,v[m][0],v[m][1]),R=g[m],j=(M=Math.min(Math.max(M,0),R-1))<R-1?Math.floor(M):M-1,D=j+1-M,L=M-j,N=j*x,U=N+x;for(y=0;y<k;y++)if(y&O){S[y]*=L;C[y]+=U}else{S[y]*=D;C[y]+=N}x*=R;O<<=1}for(y=0;y<d;++y){var H=0;for(m=0;m<k;m++)H+=w[C[m]+y]*S[m];H=interpolate(H,0,1,_[y][0],_[y][1]);o[l+y]=Math.min(Math.max(H,u[y][0]),u[y][1])}}}},{key:"constructInterpolated",value:function constructInterpolated(t){t.xref,t.isEvalSupported;for(var r=t.dict,o=toNumberArray(r.getArray("C0"))||[0],c=toNumberArray(r.getArray("C1"))||[1],l=r.get("N"),u=[],h=0,d=o.length;h<d;++h)u.push(c[h]-o[h]);var g=u.length;return function constructInterpolatedFn(t,r,c,h){for(var d=1===l?t[r]:Math.pow(t[r],l),m=0;m<g;++m)c[h+m]=o[m]+d*u[m]}}},{key:"constructStiched",value:function constructStiched(t){var r=t.xref,o=t.isEvalSupported,c=t.dict,u=toNumberArray(c.getArray("Domain"));if(!u)throw new l.FormatError("No domain");if(1!==u.length/2)throw new l.FormatError("Bad domain for stiched function");for(var h=c.get("Functions"),d=[],g=0,m=h.length;g<m;++g)d.push(this.parse({xref:r,isEvalSupported:o,fn:r.fetchIfRef(h[g])}));var y=toNumberArray(c.getArray("Bounds")),v=toNumberArray(c.getArray("Encode")),k=new Float32Array(1);return function constructStichedFn(t,r,o,c){var l,h=function constructStichedFromIRClip(t,r,o){t>o?t=o:t<r&&(t=r);return t}(t[r],u[0],u[1]),g=y.length;for(l=0;l<g&&!(h<y[l]);++l);var m=u[0];l>0&&(m=y[l-1]);var _=u[1];l<y.length&&(_=y[l]);var w=v[2*l],S=v[2*l+1];k[0]=m===_?w:w+(h-m)*(S-w)/(_-m);d[l](k,0,o,c)}}},{key:"constructPostScript",value:function constructPostScript(t){t.xref;var r=t.isEvalSupported,o=t.fn,c=t.dict,h=toNumberArray(c.getArray("Domain")),d=toNumberArray(c.getArray("Range"));if(!h)throw new l.FormatError("No domain.");if(!d)throw new l.FormatError("No range.");var g=new u.PostScriptLexer(o),m=new u.PostScriptParser(g).parse();if(r&&l.IsEvalSupportedCached.value){var y=(new k).compile(m,h,d);if(y)return new Function("src","srcOffset","dest","destOffset",y)}(0,l.info)("Unable to compile PS function");var _=d.length>>1,w=h.length>>1,S=new v(m),C=Object.create(null),x=8192,O=new Float32Array(w);return function constructPostScriptFn(t,r,o,c){var l,u,h="",g=O;for(l=0;l<w;l++){u=t[r+l];g[l]=u;h+=u+"_"}var m=C[h];if(void 0===m){var y=new Float32Array(_),v=S.execute(g),k=v.length-_;for(l=0;l<_;l++){u=v[k+l];var T=d[2*l];(u<T||u>(T=d[2*l+1]))&&(u=T);y[l]=u}if(x>0){x--;C[h]=y}o.set(y,c)}else o.set(m,c)}}}]);return PDFFunction}();var y=function(){function PostScriptStack(t){_classCallCheck(this,PostScriptStack);this.stack=t?Array.prototype.slice.call(t,0):[]}_createClass(PostScriptStack,[{key:"push",value:function push(t){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(t)}},{key:"pop",value:function pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}},{key:"copy",value:function copy(t){if(this.stack.length+t>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");for(var r=this.stack,o=r.length-t,c=t-1;c>=0;c--,o++)r.push(r[o])}},{key:"index",value:function index(t){this.push(this.stack[this.stack.length-t-1])}},{key:"roll",value:function roll(t,r){for(var o=this.stack,c=o.length-t,l=o.length-1,u=c+(r-Math.floor(r/t)*t),h=c,d=l;h<d;h++,d--){var g=o[h];o[h]=o[d];o[d]=g}for(var m=c,y=u-1;m<y;m++,y--){var v=o[m];o[m]=o[y];o[y]=v}for(var k=u,_=l;k<_;k++,_--){var w=o[k];o[k]=o[_];o[_]=w}}}],[{key:"MAX_STACK_SIZE",get:function get(){return(0,l.shadow)(this,"MAX_STACK_SIZE",100)}}]);return PostScriptStack}(),v=function(){function PostScriptEvaluator(t){_classCallCheck(this,PostScriptEvaluator);this.operators=t}_createClass(PostScriptEvaluator,[{key:"execute",value:function execute(t){for(var r,o,c,u=new y(t),h=0,d=this.operators,g=d.length;h<g;)if("number"!=typeof(r=d[h++]))switch(r){case"jz":c=u.pop();(o=u.pop())||(h=c);break;case"j":h=o=u.pop();break;case"abs":o=u.pop();u.push(Math.abs(o));break;case"add":c=u.pop();o=u.pop();u.push(o+c);break;case"and":c=u.pop();"boolean"==typeof(o=u.pop())&&"boolean"==typeof c?u.push(o&&c):u.push(o&c);break;case"atan":o=u.pop();u.push(Math.atan(o));break;case"bitshift":c=u.pop();(o=u.pop())>0?u.push(o<<c):u.push(o>>c);break;case"ceiling":o=u.pop();u.push(Math.ceil(o));break;case"copy":o=u.pop();u.copy(o);break;case"cos":o=u.pop();u.push(Math.cos(o));break;case"cvi":o=0|u.pop();u.push(o);break;case"cvr":break;case"div":c=u.pop();o=u.pop();u.push(o/c);break;case"dup":u.copy(1);break;case"eq":c=u.pop();o=u.pop();u.push(o===c);break;case"exch":u.roll(2,1);break;case"exp":c=u.pop();o=u.pop();u.push(Math.pow(o,c));break;case"false":u.push(!1);break;case"floor":o=u.pop();u.push(Math.floor(o));break;case"ge":c=u.pop();o=u.pop();u.push(o>=c);break;case"gt":c=u.pop();o=u.pop();u.push(o>c);break;case"idiv":c=u.pop();o=u.pop();u.push(o/c|0);break;case"index":o=u.pop();u.index(o);break;case"le":c=u.pop();o=u.pop();u.push(o<=c);break;case"ln":o=u.pop();u.push(Math.log(o));break;case"log":o=u.pop();u.push(Math.log(o)/Math.LN10);break;case"lt":c=u.pop();o=u.pop();u.push(o<c);break;case"mod":c=u.pop();o=u.pop();u.push(o%c);break;case"mul":c=u.pop();o=u.pop();u.push(o*c);break;case"ne":c=u.pop();o=u.pop();u.push(o!==c);break;case"neg":o=u.pop();u.push(-o);break;case"not":"boolean"==typeof(o=u.pop())?u.push(!o):u.push(~o);break;case"or":c=u.pop();"boolean"==typeof(o=u.pop())&&"boolean"==typeof c?u.push(o||c):u.push(o|c);break;case"pop":u.pop();break;case"roll":c=u.pop();o=u.pop();u.roll(o,c);break;case"round":o=u.pop();u.push(Math.round(o));break;case"sin":o=u.pop();u.push(Math.sin(o));break;case"sqrt":o=u.pop();u.push(Math.sqrt(o));break;case"sub":c=u.pop();o=u.pop();u.push(o-c);break;case"true":u.push(!0);break;case"truncate":o=(o=u.pop())<0?Math.ceil(o):Math.floor(o);u.push(o);break;case"xor":c=u.pop();"boolean"==typeof(o=u.pop())&&"boolean"==typeof c?u.push(o!==c):u.push(o^c);break;default:throw new l.FormatError("Unknown operator ".concat(r))}else u.push(r);return u.stack}}]);return PostScriptEvaluator}();r.PostScriptEvaluator=v;var k=function PostScriptCompilerClosure(){var t=function(){function AstNode(t){_classCallCheck(this,AstNode);this.type=t}_createClass(AstNode,[{key:"visit",value:function visit(t){(0,l.unreachable)("abstract method")}}]);return AstNode}(),r=function(t){_inherits(AstArgument,t);var r=_createSuper(AstArgument);function AstArgument(t,o,c){var l;_classCallCheck(this,AstArgument);(l=r.call(this,"args")).index=t;l.min=o;l.max=c;return l}_createClass(AstArgument,[{key:"visit",value:function visit(t){t.visitArgument(this)}}]);return AstArgument}(t),o=function(t){_inherits(AstLiteral,t);var r=_createSuper(AstLiteral);function AstLiteral(t){var o;_classCallCheck(this,AstLiteral);(o=r.call(this,"literal")).number=t;o.min=t;o.max=t;return o}_createClass(AstLiteral,[{key:"visit",value:function visit(t){t.visitLiteral(this)}}]);return AstLiteral}(t),c=function(t){_inherits(AstBinaryOperation,t);var r=_createSuper(AstBinaryOperation);function AstBinaryOperation(t,o,c,l,u){var h;_classCallCheck(this,AstBinaryOperation);(h=r.call(this,"binary")).op=t;h.arg1=o;h.arg2=c;h.min=l;h.max=u;return h}_createClass(AstBinaryOperation,[{key:"visit",value:function visit(t){t.visitBinaryOperation(this)}}]);return AstBinaryOperation}(t),u=function(t){_inherits(AstMin,t);var r=_createSuper(AstMin);function AstMin(t,o){var c;_classCallCheck(this,AstMin);(c=r.call(this,"max")).arg=t;c.min=t.min;c.max=o;return c}_createClass(AstMin,[{key:"visit",value:function visit(t){t.visitMin(this)}}]);return AstMin}(t),h=function(t){_inherits(AstVariable,t);var r=_createSuper(AstVariable);function AstVariable(t,o,c){var l;_classCallCheck(this,AstVariable);(l=r.call(this,"var")).index=t;l.min=o;l.max=c;return l}_createClass(AstVariable,[{key:"visit",value:function visit(t){t.visitVariable(this)}}]);return AstVariable}(t),d=function(t){_inherits(AstVariableDefinition,t);var r=_createSuper(AstVariableDefinition);function AstVariableDefinition(t,o){var c;_classCallCheck(this,AstVariableDefinition);(c=r.call(this,"definition")).variable=t;c.arg=o;return c}_createClass(AstVariableDefinition,[{key:"visit",value:function visit(t){t.visitVariableDefinition(this)}}]);return AstVariableDefinition}(t),g=function(){function ExpressionBuilderVisitor(){_classCallCheck(this,ExpressionBuilderVisitor);this.parts=[]}_createClass(ExpressionBuilderVisitor,[{key:"visitArgument",value:function visitArgument(t){this.parts.push("Math.max(",t.min,", Math.min(",t.max,", src[srcOffset + ",t.index,"]))")}},{key:"visitVariable",value:function visitVariable(t){this.parts.push("v",t.index)}},{key:"visitLiteral",value:function visitLiteral(t){this.parts.push(t.number)}},{key:"visitBinaryOperation",value:function visitBinaryOperation(t){this.parts.push("(");t.arg1.visit(this);this.parts.push(" ",t.op," ");t.arg2.visit(this);this.parts.push(")")}},{key:"visitVariableDefinition",value:function visitVariableDefinition(t){this.parts.push("var ");t.variable.visit(this);this.parts.push(" = ");t.arg.visit(this);this.parts.push(";")}},{key:"visitMin",value:function visitMin(t){this.parts.push("Math.min(");t.arg.visit(this);this.parts.push(", ",t.max,")")}},{key:"toString",value:function toString(){return this.parts.join("")}}]);return ExpressionBuilderVisitor}();function buildAddOperation(t,r){return"literal"===r.type&&0===r.number?t:"literal"===t.type&&0===t.number?r:"literal"===r.type&&"literal"===t.type?new o(t.number+r.number):new c("+",t,r,t.min+r.min,t.max+r.max)}function buildMulOperation(t,r){if("literal"===r.type){if(0===r.number)return new o(0);if(1===r.number)return t;if("literal"===t.type)return new o(t.number*r.number)}if("literal"===t.type){if(0===t.number)return new o(0);if(1===t.number)return r}var l=Math.min(t.min*r.min,t.min*r.max,t.max*r.min,t.max*r.max),u=Math.max(t.min*r.min,t.min*r.max,t.max*r.min,t.max*r.max);return new c("*",t,r,l,u)}function buildSubOperation(t,r){if("literal"===r.type){if(0===r.number)return t;if("literal"===t.type)return new o(t.number-r.number)}return"binary"===r.type&&"-"===r.op&&"literal"===t.type&&1===t.number&&"literal"===r.arg1.type&&1===r.arg1.number?r.arg2:new c("-",t,r,t.min-r.max,t.max-r.min)}function buildMinOperation(t,r){return t.min>=r?new o(r):t.max<=r?t:new u(t,r)}return function(){function PostScriptCompiler(){_classCallCheck(this,PostScriptCompiler)}_createClass(PostScriptCompiler,[{key:"compile",value:function compile(t,c,l){for(var u,m,y,v,k,_,w,S,C=[],x=[],O=c.length>>1,T=l.length>>1,E=0,M=0;M<O;M++)C.push(new r(M,c[2*M],c[2*M+1]));for(var R=0,j=t.length;R<j;R++)if("number"!=typeof(S=t[R]))switch(S){case"add":if(C.length<2)return null;v=C.pop();y=C.pop();C.push(buildAddOperation(y,v));break;case"cvr":if(C.length<1)return null;break;case"mul":if(C.length<2)return null;v=C.pop();y=C.pop();C.push(buildMulOperation(y,v));break;case"sub":if(C.length<2)return null;v=C.pop();y=C.pop();C.push(buildSubOperation(y,v));break;case"exch":if(C.length<2)return null;k=C.pop();_=C.pop();C.push(k,_);break;case"pop":if(C.length<1)return null;C.pop();break;case"index":if(C.length<1)return null;if("literal"!==(y=C.pop()).type)return null;if((u=y.number)<0||!Number.isInteger(u)||C.length<u)return null;if("literal"===(k=C[C.length-u-1]).type||"var"===k.type){C.push(k);break}w=new h(E++,k.min,k.max);C[C.length-u-1]=w;C.push(w);x.push(new d(w,k));break;case"dup":if(C.length<1)return null;if("number"==typeof t[R+1]&&"gt"===t[R+2]&&t[R+3]===R+7&&"jz"===t[R+4]&&"pop"===t[R+5]&&t[R+6]===t[R+1]){y=C.pop();C.push(buildMinOperation(y,t[R+1]));R+=6;break}if("literal"===(k=C[C.length-1]).type||"var"===k.type){C.push(k);break}w=new h(E++,k.min,k.max);C[C.length-1]=w;C.push(w);x.push(new d(w,k));break;case"roll":if(C.length<2)return null;v=C.pop();y=C.pop();if("literal"!==v.type||"literal"!==y.type)return null;m=v.number;if((u=y.number)<=0||!Number.isInteger(u)||!Number.isInteger(m)||C.length<u)return null;if(0===(m=(m%u+u)%u))break;Array.prototype.push.apply(C,C.splice(C.length-u,u-m));break;default:return null}else C.push(new o(S));if(C.length!==T)return null;for(var D=[],L=0,N=x;L<N.length;L++){var U=N[L],H=new g;U.visit(H);D.push(H.toString())}for(var $=0,X=C.length;$<X;$++){var q=C[$],G=new g;q.visit(G);var z=l[2*$],W=l[2*$+1],V=[G.toString()];if(z>q.min){V.unshift("Math.max(",z,", ");V.push(")")}if(W<q.max){V.unshift("Math.min(",W,", ");V.push(")")}V.unshift("dest[destOffset + ",$,"] = ");V.push(";");D.push(V.join(""))}return D.join("\n")}}]);return PostScriptCompiler}()}();r.PostScriptCompiler=k},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PostScriptParser=r.PostScriptLexer=void 0;var c=o(4),l=o(146),u=o(149);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var h=function(){function PostScriptParser(t){_classCallCheck(this,PostScriptParser);this.lexer=t;this.operators=[];this.token=null;this.prev=null}_createClass(PostScriptParser,[{key:"nextToken",value:function nextToken(){this.prev=this.token;this.token=this.lexer.getToken()}},{key:"accept",value:function accept(t){if(this.token.type===t){this.nextToken();return!0}return!1}},{key:"expect",value:function expect(t){if(this.accept(t))return!0;throw new c.FormatError("Unexpected symbol: found ".concat(this.token.type," expected ").concat(t,"."))}},{key:"parse",value:function parse(){this.nextToken();this.expect(d.LBRACE);this.parseBlock();this.expect(d.RBRACE);return this.operators}},{key:"parseBlock",value:function parseBlock(){for(;;)if(this.accept(d.NUMBER))this.operators.push(this.prev.value);else if(this.accept(d.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(d.LBRACE))return;this.parseCondition()}}},{key:"parseCondition",value:function parseCondition(){var t=this.operators.length;this.operators.push(null,null);this.parseBlock();this.expect(d.RBRACE);if(this.accept(d.IF)){this.operators[t]=this.operators.length;this.operators[t+1]="jz"}else{if(!this.accept(d.LBRACE))throw new c.FormatError("PS Function: error parsing conditional.");var r=this.operators.length;this.operators.push(null,null);var o=this.operators.length;this.parseBlock();this.expect(d.RBRACE);this.expect(d.IFELSE);this.operators[r]=this.operators.length;this.operators[r+1]="j";this.operators[t]=o;this.operators[t+1]="jz"}}}]);return PostScriptParser}();r.PostScriptParser=h;var d={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5},g=function(){function PostScriptToken(t,r){_classCallCheck(this,PostScriptToken);this.type=t;this.value=r}_createClass(PostScriptToken,null,[{key:"opCache",get:function get(){return(0,c.shadow)(this,"opCache",Object.create(null))}},{key:"getOperator",value:function getOperator(t){var r=PostScriptToken.opCache[t];return r||(PostScriptToken.opCache[t]=new PostScriptToken(d.OPERATOR,t))}},{key:"LBRACE",get:function get(){return(0,c.shadow)(this,"LBRACE",new PostScriptToken(d.LBRACE,"{"))}},{key:"RBRACE",get:function get(){return(0,c.shadow)(this,"RBRACE",new PostScriptToken(d.RBRACE,"}"))}},{key:"IF",get:function get(){return(0,c.shadow)(this,"IF",new PostScriptToken(d.IF,"IF"))}},{key:"IFELSE",get:function get(){return(0,c.shadow)(this,"IFELSE",new PostScriptToken(d.IFELSE,"IFELSE"))}}]);return PostScriptToken}(),m=function(){function PostScriptLexer(t){_classCallCheck(this,PostScriptLexer);this.stream=t;this.nextChar();this.strBuf=[]}_createClass(PostScriptLexer,[{key:"nextChar",value:function nextChar(){return this.currentChar=this.stream.getByte()}},{key:"getToken",value:function getToken(){for(var t=!1,r=this.currentChar;;){if(r<0)return l.EOF;if(t)10!==r&&13!==r||(t=!1);else if(37===r)t=!0;else if(!(0,u.isWhiteSpace)(r))break;r=this.nextChar()}switch(0|r){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new g(d.NUMBER,this.getNumber());case 123:this.nextChar();return g.LBRACE;case 125:this.nextChar();return g.RBRACE}var o=this.strBuf;o.length=0;o[0]=String.fromCharCode(r);for(;(r=this.nextChar())>=0&&(r>=65&&r<=90||r>=97&&r<=122);)o.push(String.fromCharCode(r));var c=o.join("");switch(c.toLowerCase()){case"if":return g.IF;case"ifelse":return g.IFELSE;default:return g.getOperator(c)}}},{key:"getNumber",value:function getNumber(){var t=this.currentChar,r=this.strBuf;r.length=0;r[0]=String.fromCharCode(t);for(;(t=this.nextChar())>=0&&(t>=48&&t<=57||45===t||46===t);)r.push(String.fromCharCode(t));var o=parseFloat(r.join(""));if(isNaN(o))throw new c.FormatError("Invalid floating point number: ".concat(o));return o}}]);return PostScriptLexer}();r.PostScriptLexer=m},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.LocalTilingPatternCache=r.LocalImageCache=r.LocalGStateCache=r.LocalFunctionCache=r.LocalColorSpaceCache=r.GlobalImageCache=void 0;var c=o(4),l=o(146);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var u=function(){function BaseLocalCache(t){_classCallCheck(this,BaseLocalCache);this.constructor===BaseLocalCache&&(0,c.unreachable)("Cannot initialize BaseLocalCache.");this._onlyRefs=!0===(t&&t.onlyRefs);if(!this._onlyRefs){this._nameRefMap=new Map;this._imageMap=new Map}this._imageCache=new l.RefSetCache}_createClass(BaseLocalCache,[{key:"getByName",value:function getByName(t){this._onlyRefs&&(0,c.unreachable)("Should not call `getByName` method.");var r=this._nameRefMap.get(t);return r?this.getByRef(r):this._imageMap.get(t)||null}},{key:"getByRef",value:function getByRef(t){return this._imageCache.get(t)||null}},{key:"set",value:function set(t,r,o){(0,c.unreachable)("Abstract method `set` called.")}}]);return BaseLocalCache}(),h=function(t){_inherits(LocalImageCache,t);var r=_createSuper(LocalImageCache);function LocalImageCache(){_classCallCheck(this,LocalImageCache);return r.apply(this,arguments)}_createClass(LocalImageCache,[{key:"set",value:function set(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2?arguments[2]:void 0;if("string"!=typeof t)throw new Error('LocalImageCache.set - expected "name" argument.');if(r){if(this._imageCache.has(r))return;this._nameRefMap.set(t,r);this._imageCache.put(r,o)}else this._imageMap.has(t)||this._imageMap.set(t,o)}}]);return LocalImageCache}(u);r.LocalImageCache=h;var d=function(t){_inherits(LocalColorSpaceCache,t);var r=_createSuper(LocalColorSpaceCache);function LocalColorSpaceCache(){_classCallCheck(this,LocalColorSpaceCache);return r.apply(this,arguments)}_createClass(LocalColorSpaceCache,[{key:"set",value:function set(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2?arguments[2]:void 0;if("string"!=typeof t&&!r)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(r){if(this._imageCache.has(r))return;null!==t&&this._nameRefMap.set(t,r);this._imageCache.put(r,o)}else this._imageMap.has(t)||this._imageMap.set(t,o)}}]);return LocalColorSpaceCache}(u);r.LocalColorSpaceCache=d;var g=function(t){_inherits(LocalFunctionCache,t);var r=_createSuper(LocalFunctionCache);function LocalFunctionCache(t){_classCallCheck(this,LocalFunctionCache);return r.call(this,{onlyRefs:!0})}_createClass(LocalFunctionCache,[{key:"set",value:function set(){var t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,r)}}]);return LocalFunctionCache}(u);r.LocalFunctionCache=g;var m=function(t){_inherits(LocalGStateCache,t);var r=_createSuper(LocalGStateCache);function LocalGStateCache(){_classCallCheck(this,LocalGStateCache);return r.apply(this,arguments)}_createClass(LocalGStateCache,[{key:"set",value:function set(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2?arguments[2]:void 0;if("string"!=typeof t)throw new Error('LocalGStateCache.set - expected "name" argument.');if(r){if(this._imageCache.has(r))return;this._nameRefMap.set(t,r);this._imageCache.put(r,o)}else this._imageMap.has(t)||this._imageMap.set(t,o)}}]);return LocalGStateCache}(u);r.LocalGStateCache=m;var y=function(t){_inherits(LocalTilingPatternCache,t);var r=_createSuper(LocalTilingPatternCache);function LocalTilingPatternCache(t){_classCallCheck(this,LocalTilingPatternCache);return r.call(this,{onlyRefs:!0})}_createClass(LocalTilingPatternCache,[{key:"set",value:function set(){var t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;if(!t)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(t)||this._imageCache.put(t,r)}}]);return LocalTilingPatternCache}(u);r.LocalTilingPatternCache=y;var v=function(){function GlobalImageCache(){_classCallCheck(this,GlobalImageCache);this._refCache=new l.RefSetCache;this._imageCache=new l.RefSetCache}_createClass(GlobalImageCache,[{key:"_byteSize",get:function get(){var t,r=0,o=_createForOfIteratorHelper(this._imageCache);try{for(o.s();!(t=o.n()).done;){r+=t.value.byteSize}}catch(t){o.e(t)}finally{o.f()}return r}},{key:"_cacheLimitReached",get:function get(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this._byteSize<GlobalImageCache.MAX_BYTE_SIZE)}},{key:"shouldCache",value:function shouldCache(t,r){var o=this._refCache.get(t);return!((o?o.size+(o.has(r)?0:1):1)<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(t)&&this._cacheLimitReached)}},{key:"addPageIndex",value:function addPageIndex(t,r){var o=this._refCache.get(t);if(!o){o=new Set;this._refCache.put(t,o)}o.add(r)}},{key:"addByteSize",value:function addByteSize(t,r){var o=this._imageCache.get(t);o&&(o.byteSize||(o.byteSize=r))}},{key:"getData",value:function getData(t,r){var o=this._refCache.get(t);if(!o)return null;if(o.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;var c=this._imageCache.get(t);if(!c)return null;o.add(r);return c}},{key:"setData",value:function setData(t,r){if(!this._refCache.has(t))throw new Error('GlobalImageCache.setData - expected "addPageIndex" to have been called.');this._imageCache.has(t)||(this._cacheLimitReached?(0,c.warn)("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(t,r))}},{key:"clear",value:function clear(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t||this._refCache.clear();this._imageCache.clear()}}],[{key:"NUM_PAGES_THRESHOLD",get:function get(){return(0,c.shadow)(this,"NUM_PAGES_THRESHOLD",2)}},{key:"MIN_IMAGES_TO_CACHE",get:function get(){return(0,c.shadow)(this,"MIN_IMAGES_TO_CACHE",10)}},{key:"MAX_BYTE_SIZE",get:function get(){return(0,c.shadow)(this,"MAX_BYTE_SIZE",4e7)}}]);return GlobalImageCache}();r.GlobalImageCache=v},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.bidi=function bidi(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],g=!0,m=t.length;if(0===m||o)return createBidiText(t,g,o);h.length=m;d.length=m;var y,v,k=0;for(y=0;y<m;++y){h[y]=t.charAt(y);var _=t.charCodeAt(y),w="L";_<=255?w=l[_]:1424<=_&&_<=1524?w="R":1536<=_&&_<=1791?(w=u[255&_])||(0,c.warn)("Bidi: invalid Unicode character "+_.toString(16)):1792<=_&&_<=2220&&(w="AL");"R"!==w&&"AL"!==w&&"AN"!==w||k++;d[y]=w}if(0===k)return createBidiText(t,g=!0);if(-1===r)if(k/m<.3&&m>4){g=!0;r=0}else{g=!1;r=1}var S=[];for(y=0;y<m;++y)S[y]=r;var C,x=isOdd(r)?"R":"L",O=x,T=O,E=O;for(y=0;y<m;++y)"NSM"===d[y]?d[y]=E:E=d[y];E=O;for(y=0;y<m;++y)"EN"===(C=d[y])?d[y]="AL"===E?"AN":"EN":"R"!==C&&"L"!==C&&"AL"!==C||(E=C);for(y=0;y<m;++y)"AL"===(C=d[y])&&(d[y]="R");for(y=1;y<m-1;++y){"ES"===d[y]&&"EN"===d[y-1]&&"EN"===d[y+1]&&(d[y]="EN");"CS"!==d[y]||"EN"!==d[y-1]&&"AN"!==d[y-1]||d[y+1]!==d[y-1]||(d[y]=d[y-1])}for(y=0;y<m;++y)if("EN"===d[y]){for(var M=y-1;M>=0&&"ET"===d[M];--M)d[M]="EN";for(var R=y+1;R<m&&"ET"===d[R];++R)d[R]="EN"}for(y=0;y<m;++y)"WS"!==(C=d[y])&&"ES"!==C&&"ET"!==C&&"CS"!==C||(d[y]="ON");E=O;for(y=0;y<m;++y)"EN"===(C=d[y])?d[y]="L"===E?"L":"EN":"R"!==C&&"L"!==C||(E=C);for(y=0;y<m;++y)if("ON"===d[y]){var j=findUnequal(d,y+1,"ON"),D=O;y>0&&(D=d[y-1]);var L=T;j+1<m&&(L=d[j+1]);"L"!==D&&(D="R");"L"!==L&&(L="R");D===L&&setValues(d,y,j,D);y=j-1}for(y=0;y<m;++y)"ON"===d[y]&&(d[y]=x);for(y=0;y<m;++y){C=d[y];isEven(S[y])?"R"===C?S[y]+=1:"AN"!==C&&"EN"!==C||(S[y]+=2):"L"!==C&&"AN"!==C&&"EN"!==C||(S[y]+=1)}var N,U=-1,H=99;for(y=0,v=S.length;y<v;++y){N=S[y];U<N&&(U=N);H>N&&isOdd(N)&&(H=N)}for(N=U;N>=H;--N){var $=-1;for(y=0,v=S.length;y<v;++y)if(S[y]<N){if($>=0){reverseValues(h,$,y);$=-1}}else $<0&&($=y);$>=0&&reverseValues(h,$,S.length)}for(y=0,v=h.length;y<v;++y){var X=h[y];"<"!==X&&">"!==X||(h[y]="")}return createBidiText(h.join(""),g)};var c=o(4),l=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],u=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(t){return 0!=(1&t)}function isEven(t){return 0==(1&t)}function findUnequal(t,r,o){var c,l;for(c=r,l=t.length;c<l;++c)if(t[c]!==o)return c;return c}function setValues(t,r,o,c){for(var l=r;l<o;++l)t[l]=c}function reverseValues(t,r,o){for(var c=r,l=o-1;c<l;++c,--l){var u=t[c];t[c]=t[l];t[l]=u}}function createBidiText(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c="ltr";o?c="ttb":r||(c="rtl");return{str:t,dir:c}}var h=[],d=[]},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MurmurHash3_64=void 0;var c=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var l=3285377520,u=4294901760,h=65535,d=function(){function MurmurHash3_64(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MurmurHash3_64);this.h1=t?4294967295&t:l;this.h2=t?4294967295&t:l}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(MurmurHash3_64,[{key:"update",value:function update(t){var r,o;if("string"==typeof t){r=new Uint8Array(2*t.length);o=0;for(var l=0,d=t.length;l<d;l++){var g=t.charCodeAt(l);if(g<=255)r[o++]=g;else{r[o++]=g>>>8;r[o++]=255&g}}}else{if(!(0,c.isArrayBuffer)(t))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");o=(r=t.slice()).byteLength}for(var m=o>>2,y=o-4*m,v=new Uint32Array(r.buffer,0,m),k=0,_=0,w=this.h1,S=this.h2,C=3432918353,x=461845907,O=11601,T=13715,E=0;E<m;E++)1&E?w=5*(w=(w^=k=(k=(k=(k=v[E])*C&u|k*O&h)<<15|k>>>17)*x&u|k*T&h)<<13|w>>>19)+3864292196:S=5*(S=(S^=_=(_=(_=(_=v[E])*C&u|_*O&h)<<15|_>>>17)*x&u|_*T&h)<<13|S>>>19)+3864292196;k=0;switch(y){case 3:k^=r[4*m+2]<<16;case 2:k^=r[4*m+1]<<8;case 1:k=(k=(k=(k^=r[4*m])*C&u|k*O&h)<<15|k>>>17)*x&u|k*T&h;1&m?w^=k:S^=k}this.h1=w;this.h2=S}},{key:"hexdigest",value:function hexdigest(){var t=this.h1,r=this.h2;t=3981806797*(t^=r>>>1)&u|36045*t&h;t=444984403*(t^=(r=4283543511*r&u|(2950163797*(r<<16|t>>>16)&u)>>>16)>>>1)&u|60499*t&h;var o=((t^=(r=3301882366*r&u|(3120437893*(r<<16|t>>>16)&u)>>>16)>>>1)>>>0).toString(16),c=(r>>>0).toString(16);return o.padStart(8,"0")+c.padStart(8,"0")}}]);return MurmurHash3_64}();r.MurmurHash3_64=d},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.OperatorList=void 0;var c=o(4);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function addState(t,r,o,c,l){for(var u=t,h=0,d=r.length-1;h<d;h++){var g=r[h];u=u[g]||(u[g]=[])}u[r[r.length-1]]={checkFn:o,iterateFn:c,processFn:l}}var l=[];addState(l,[c.OPS.save,c.OPS.transform,c.OPS.paintInlineImageXObject,c.OPS.restore],null,(function iterateInlineImageGroup(t,r){var o=t.fnArray,l=(r-(t.iCurr-3))%4;switch(l){case 0:return o[r]===c.OPS.save;case 1:return o[r]===c.OPS.transform;case 2:return o[r]===c.OPS.paintInlineImageXObject;case 3:return o[r]===c.OPS.restore}throw new Error("iterateInlineImageGroup - invalid pos: ".concat(l))}),(function foundInlineImageGroup(t,r){var o=t.fnArray,l=t.argsArray,u=t.iCurr,h=u-3,d=u-2,g=u-1,m=Math.min(Math.floor((r-h)/4),200);if(m<10)return r-(r-h)%4;for(var y=0,v=[],k=0,_=1,w=1,S=0;S<m;S++){var C=l[d+(S<<2)],x=l[g+(S<<2)][0];if(_+x.width>1e3){y=Math.max(y,_);w+=k+2;_=0;k=0}v.push({transform:C,x:_,y:w,w:x.width,h:x.height});_+=x.width+2;k=Math.max(k,x.height)}for(var O=Math.max(y,_)+1,T=w+k+1,E=new Uint8ClampedArray(O*T*4),M=O<<2,R=0;R<m;R++){var j=l[g+(R<<2)][0].data,D=v[R].w<<2,L=0,N=v[R].x+v[R].y*O<<2;E.set(j.subarray(0,D),N-M);for(var U=0,H=v[R].h;U<H;U++){E.set(j.subarray(L,L+D),N);L+=D;N+=M}E.set(j.subarray(L-D,L),N);for(;N>=0;){j[N-4]=j[N];j[N-3]=j[N+1];j[N-2]=j[N+2];j[N-1]=j[N+3];j[N+D]=j[N+D-4];j[N+D+1]=j[N+D-3];j[N+D+2]=j[N+D-2];j[N+D+3]=j[N+D-1];N-=M}}o.splice(h,4*m,c.OPS.paintInlineImageXObjectGroup);l.splice(h,4*m,[{width:O,height:T,kind:c.ImageKind.RGBA_32BPP,data:E},v]);return h+1}));addState(l,[c.OPS.save,c.OPS.transform,c.OPS.paintImageMaskXObject,c.OPS.restore],null,(function iterateImageMaskGroup(t,r){var o=t.fnArray,l=(r-(t.iCurr-3))%4;switch(l){case 0:return o[r]===c.OPS.save;case 1:return o[r]===c.OPS.transform;case 2:return o[r]===c.OPS.paintImageMaskXObject;case 3:return o[r]===c.OPS.restore}throw new Error("iterateImageMaskGroup - invalid pos: ".concat(l))}),(function foundImageMaskGroup(t,r){var o=t.fnArray,l=t.argsArray,u=t.iCurr,h=u-3,d=u-2,g=u-1,m=Math.floor((r-h)/4);m=function handlePaintSolidColorImageMask(t,r,o,l){var u,h=t+2;for(u=0;u<r;u++){var d=l[h+4*u],g=1===d.length&&d[0];if(!g||1!==g.width||1!==g.height||g.data.length&&(1!==g.data.length||0!==g.data[0]))break;o[h+4*u]=c.OPS.paintSolidColorImageMask}return r-u}(h,m,o,l);if(m<10)return r-(r-h)%4;var y,v,k=!1,_=l[g][0],w=l[d][0],S=l[d][1],C=l[d][2],x=l[d][3];if(S===C){k=!0;y=d+4;for(var O=g+4,T=1;T<m;T++,y+=4,O+=4){v=l[y];if(l[O][0]!==_||v[0]!==w||v[1]!==S||v[2]!==C||v[3]!==x){T<10?k=!1:m=T;break}}}if(k){m=Math.min(m,1e3);var E=new Float32Array(2*m);y=d;for(var M=0;M<m;M++,y+=4){v=l[y];E[M<<1]=v[4];E[1+(M<<1)]=v[5]}o.splice(h,4*m,c.OPS.paintImageMaskXObjectRepeat);l.splice(h,4*m,[_,w,S,C,x,E])}else{m=Math.min(m,100);for(var R=[],j=0;j<m;j++){v=l[d+(j<<2)];var D=l[g+(j<<2)][0];R.push({data:D.data,width:D.width,height:D.height,transform:v})}o.splice(h,4*m,c.OPS.paintImageMaskXObjectGroup);l.splice(h,4*m,[R])}return h+1}));addState(l,[c.OPS.save,c.OPS.transform,c.OPS.paintImageXObject,c.OPS.restore],(function(t){var r=t.argsArray,o=t.iCurr-2;return 0===r[o][1]&&0===r[o][2]}),(function iterateImageGroup(t,r){var o=t.fnArray,l=t.argsArray,u=(r-(t.iCurr-3))%4;switch(u){case 0:return o[r]===c.OPS.save;case 1:if(o[r]!==c.OPS.transform)return!1;var h=t.iCurr-2,d=l[h][0],g=l[h][3];return l[r][0]===d&&0===l[r][1]&&0===l[r][2]&&l[r][3]===g;case 2:if(o[r]!==c.OPS.paintImageXObject)return!1;var m=l[t.iCurr-1][0];return l[r][0]===m;case 3:return o[r]===c.OPS.restore}throw new Error("iterateImageGroup - invalid pos: ".concat(u))}),(function(t,r){var o=t.fnArray,l=t.argsArray,u=t.iCurr,h=u-3,d=u-2,g=l[u-1][0],m=l[d][0],y=l[d][3],v=Math.min(Math.floor((r-h)/4),1e3);if(v<3)return r-(r-h)%4;for(var k=new Float32Array(2*v),_=d,w=0;w<v;w++,_+=4){var S=l[_];k[w<<1]=S[4];k[1+(w<<1)]=S[5]}var C=[g,m,y,k];o.splice(h,4*v,c.OPS.paintImageXObjectRepeat);l.splice(h,4*v,C);return h+1}));addState(l,[c.OPS.beginText,c.OPS.setFont,c.OPS.setTextMatrix,c.OPS.showText,c.OPS.endText],null,(function iterateShowTextGroup(t,r){var o=t.fnArray,l=t.argsArray,u=(r-(t.iCurr-4))%5;switch(u){case 0:return o[r]===c.OPS.beginText;case 1:return o[r]===c.OPS.setFont;case 2:return o[r]===c.OPS.setTextMatrix;case 3:if(o[r]!==c.OPS.showText)return!1;var h=t.iCurr-3,d=l[h][0],g=l[h][1];return l[r][0]===d&&l[r][1]===g;case 4:return o[r]===c.OPS.endText}throw new Error("iterateShowTextGroup - invalid pos: ".concat(u))}),(function(t,r){var o=t.fnArray,c=t.argsArray,l=t.iCurr,u=l-4,h=l-3,d=l-2,g=l-1,m=l,y=c[h][0],v=c[h][1],k=Math.min(Math.floor((r-u)/5),1e3);if(k<3)return r-(r-u)%5;var _=u;if(u>=4&&o[u-4]===o[h]&&o[u-3]===o[d]&&o[u-2]===o[g]&&o[u-1]===o[m]&&c[u-4][0]===y&&c[u-4][1]===v){k++;_-=5}for(var w=_+4,S=1;S<k;S++){o.splice(w,3);c.splice(w,3);w+=2}return w+1}));var u=function(){function NullOptimizer(t){_classCallCheck(this,NullOptimizer);this.queue=t}_createClass(NullOptimizer,[{key:"_optimize",value:function _optimize(){}},{key:"push",value:function push(t,r){this.queue.fnArray.push(t);this.queue.argsArray.push(r);this._optimize()}},{key:"flush",value:function flush(){}},{key:"reset",value:function reset(){}}]);return NullOptimizer}(),h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(QueueOptimizer,t);var r=_createSuper(QueueOptimizer);function QueueOptimizer(t){var o;_classCallCheck(this,QueueOptimizer);(o=r.call(this,t)).state=null;o.context={iCurr:0,fnArray:t.fnArray,argsArray:t.argsArray};o.match=null;o.lastProcessed=0;return o}_createClass(QueueOptimizer,[{key:"_optimize",value:function _optimize(){var t=this.queue.fnArray,r=this.lastProcessed,o=t.length,c=this.state,u=this.match;if(c||u||r+1!==o||l[t[r]]){for(var h=this.context;r<o;){if(u){if((0,u.iterateFn)(h,r)){r++;continue}r=(0,u.processFn)(h,r+1);u=null;c=null;if(r>=(o=t.length))break}if((c=(c||l)[t[r]])&&!Array.isArray(c)){h.iCurr=r;r++;if(!c.checkFn||(0,c.checkFn)(h)){u=c;c=null}else c=null}else r++}this.state=c;this.match=u;this.lastProcessed=r}else this.lastProcessed=o}},{key:"flush",value:function flush(){for(;this.match;){var t=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,t);this.match=null;this.state=null;this._optimize()}}},{key:"reset",value:function reset(){this.state=null;this.match=null;this.lastProcessed=0}}]);return QueueOptimizer}(u),d=function(){function OperatorList(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1?arguments[1]:void 0;_classCallCheck(this,OperatorList);this._streamSink=r;this.fnArray=[];this.argsArray=[];!r||t&c.RenderingIntentFlag.OPLIST?this.optimizer=new u(this):this.optimizer=new h(this);this.dependencies=new Set;this._totalLength=0;this.weight=0;this._resolved=r?null:Promise.resolve()}_createClass(OperatorList,[{key:"length",get:function get(){return this.argsArray.length}},{key:"ready",get:function get(){return this._resolved||this._streamSink.ready}},{key:"totalLength",get:function get(){return this._totalLength+this.length}},{key:"addOp",value:function addOp(t,r){this.optimizer.push(t,r);this.weight++;this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(t===c.OPS.restore||t===c.OPS.endText))&&this.flush()}},{key:"addDependency",value:function addDependency(t){if(!this.dependencies.has(t)){this.dependencies.add(t);this.addOp(c.OPS.dependency,[t])}}},{key:"addDependencies",value:function addDependencies(t){var r,o=_createForOfIteratorHelper(t);try{for(o.s();!(r=o.n()).done;){var c=r.value;this.addDependency(c)}}catch(t){o.e(t)}finally{o.f()}}},{key:"addOpList",value:function addOpList(t){if(t instanceof OperatorList){var r,o=_createForOfIteratorHelper(t.dependencies);try{for(o.s();!(r=o.n()).done;){var l=r.value;this.dependencies.add(l)}}catch(t){o.e(t)}finally{o.f()}for(var u=0,h=t.length;u<h;u++)this.addOp(t.fnArray[u],t.argsArray[u])}else(0,c.warn)('addOpList - ignoring invalid "opList" parameter.')}},{key:"getIR",value:function getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}},{key:"_transfers",get:function get(){for(var t=[],r=this.fnArray,o=this.argsArray,l=this.length,u=0;u<l;u++)switch(r[u]){case c.OPS.paintInlineImageXObject:case c.OPS.paintInlineImageXObjectGroup:case c.OPS.paintImageMaskXObject:var h=o[u][0];h.cached||t.push(h.data.buffer)}return t}},{key:"flush",value:function flush(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.optimizer.flush();var r=this.length;this._totalLength+=r;this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:t,length:r},1,this._transfers);this.dependencies.clear();this.fnArray.length=0;this.argsArray.length=0;this.weight=0;this.optimizer.reset()}}],[{key:"CHUNK_SIZE",get:function get(){return(0,c.shadow)(this,"CHUNK_SIZE",1e3)}},{key:"CHUNK_SIZE_ABOUT",get:function get(){return(0,c.shadow)(this,"CHUNK_SIZE_ABOUT",this.CHUNK_SIZE-5)}}]);return OperatorList}();r.OperatorList=d},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFImage=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(150),h=o(165),d=o(170),g=o(178),m=o(181),y=o(146);function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function decodeAndClamp(t,r,o,c){(t=r+t*o)<0?t=0:t>c&&(t=c);return t}function resizeImageMask(t,r,o,c,l,u){var h,d=l*u;h=r<=8?new Uint8Array(d):r<=16?new Uint16Array(d):new Uint32Array(d);var g,m,y,v,k=o/l,_=c/u,w=0,S=new Uint16Array(l),C=o;for(g=0;g<l;g++)S[g]=Math.floor(g*k);for(g=0;g<u;g++){y=Math.floor(g*_)*C;for(m=0;m<l;m++){v=y+S[m];h[w++]=t[v]}}return h}var v=function(){function PDFImage(t){var r=t.xref,o=t.res,c=t.image,d=t.isInline,g=void 0!==d&&d,v=t.smask,k=void 0===v?null:v,_=t.mask,w=void 0===_?null:_,S=t.isMask,C=void 0!==S&&S,x=t.pdfFunctionFactory,O=t.localColorSpaceCache;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,PDFImage);this.image=c;var T=c.dict,E=T.get("F","Filter");if(E instanceof y.Name)switch(E.name){case"JPXDecode":var M=new m.JpxImage;M.parseImageProperties(c.stream);c.stream.reset();c.width=M.width;c.height=M.height;c.bitsPerComponent=M.bitsPerComponent;c.numComps=M.componentsCount;break;case"JBIG2Decode":c.bitsPerComponent=1;c.numComps=1}var R=T.get("W","Width"),j=T.get("H","Height");if(Number.isInteger(c.width)&&c.width>0&&Number.isInteger(c.height)&&c.height>0&&(c.width!==R||c.height!==j)){(0,l.warn)("PDFImage - using the Width/Height of the image data, rather than the image dictionary.");R=c.width;j=c.height}if(R<1||j<1)throw new l.FormatError("Invalid image width: ".concat(R," or height: ").concat(j));this.width=R;this.height=j;this.interpolate=T.get("I","Interpolate");this.imageMask=T.get("IM","ImageMask")||!1;this.matte=T.get("Matte")||!1;var D=c.bitsPerComponent;if(!D&&!(D=T.get("BPC","BitsPerComponent"))){if(!this.imageMask)throw new l.FormatError("Bits per component missing in image: ".concat(this.imageMask));D=1}this.bpc=D;if(!this.imageMask){var L=T.getRaw("CS")||T.getRaw("ColorSpace");if(!L){(0,l.info)("JPX images (which do not require color spaces)");switch(c.numComps){case 1:L=y.Name.get("DeviceGray");break;case 3:L=y.Name.get("DeviceRGB");break;case 4:L=y.Name.get("DeviceCMYK");break;default:throw new Error("JPX images with ".concat(c.numComps," color components not supported."))}}this.colorSpace=h.ColorSpace.parse({cs:L,xref:r,resources:g?o:null,pdfFunctionFactory:x,localColorSpaceCache:O});this.numComps=this.colorSpace.numComps}this.decode=T.getArray("D","Decode");this.needsDecode=!1;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,D)||C&&!h.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;var N=(1<<D)-1;this.decodeCoefficients=[];this.decodeAddends=[];for(var U=this.colorSpace&&"Indexed"===this.colorSpace.name,H=0,$=0;H<this.decode.length;H+=2,++$){var X=this.decode[H],q=this.decode[H+1];this.decodeCoefficients[$]=U?(q-X)/N:q-X;this.decodeAddends[$]=U?X:N*X}}if(k)this.smask=new PDFImage({xref:r,res:o,image:k,isInline:g,pdfFunctionFactory:x,localColorSpaceCache:O});else if(w)if(w instanceof u.BaseStream){w.dict.get("IM","ImageMask")?this.mask=new PDFImage({xref:r,res:o,image:w,isInline:g,isMask:!0,pdfFunctionFactory:x,localColorSpaceCache:O}):(0,l.warn)("Ignoring /Mask in image without /ImageMask.")}else this.mask=w}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(PDFImage,[{key:"drawWidth",get:function get(){return Math.max(this.width,this.smask&&this.smask.width||0,this.mask&&this.mask.width||0)}},{key:"drawHeight",get:function get(){return Math.max(this.height,this.smask&&this.smask.height||0,this.mask&&this.mask.height||0)}},{key:"decodeBuffer",value:function decodeBuffer(t){var r,o,c=this.bpc,l=this.numComps,u=this.decodeAddends,h=this.decodeCoefficients,d=(1<<c)-1;if(1!==c){var g=0;for(r=0,o=this.width*this.height;r<o;r++)for(var m=0;m<l;m++){t[g]=decodeAndClamp(t[g],u[m],h[m],d);g++}}else for(r=0,o=t.length;r<o;r++)t[r]=+!t[r]}},{key:"getComponents",value:function getComponents(t){var r=this.bpc;if(8===r)return t;var o,c=this.width,l=this.height,u=this.numComps,h=c*l*u,d=0;o=r<=8?new Uint8Array(h):r<=16?new Uint16Array(h):new Uint32Array(h);var g,m,y=c*u,v=(1<<r)-1,k=0;if(1===r)for(var _,w,S,C=0;C<l;C++){w=k+(-8&y);S=k+y;for(;k<w;){m=t[d++];o[k]=m>>7&1;o[k+1]=m>>6&1;o[k+2]=m>>5&1;o[k+3]=m>>4&1;o[k+4]=m>>3&1;o[k+5]=m>>2&1;o[k+6]=m>>1&1;o[k+7]=1&m;k+=8}if(k<S){m=t[d++];_=128;for(;k<S;){o[k++]=+!!(m&_);_>>=1}}}else{var x=0;m=0;for(k=0,g=h;k<g;++k){if(k%y==0){m=0;x=0}for(;x<r;){m=m<<8|t[d++];x+=8}var O=x-r,T=m>>O;T<0?T=0:T>v&&(T=v);o[k]=T;m&=(1<<O)-1;x=O}}return o}},{key:"fillOpacity",value:function fillOpacity(t,r,o,c,u){var h,d,g,m,y,v,k=this.smask,_=this.mask;if(k){d=k.width;g=k.height;h=new Uint8ClampedArray(d*g);k.fillGrayBuffer(h);d===r&&g===o||(h=resizeImageMask(h,k.bpc,d,g,r,o))}else if(_)if(_ instanceof PDFImage){d=_.width;g=_.height;h=new Uint8ClampedArray(d*g);_.numComps=1;_.fillGrayBuffer(h);for(m=0,y=d*g;m<y;++m)h[m]=255-h[m];d===r&&g===o||(h=resizeImageMask(h,_.bpc,d,g,r,o))}else{if(!Array.isArray(_))throw new l.FormatError("Unknown mask format.");h=new Uint8ClampedArray(r*o);var w=this.numComps;for(m=0,y=r*o;m<y;++m){var S=0,C=m*w;for(v=0;v<w;++v){var x=u[C+v],O=2*v;if(x<_[O]||x>_[O+1]){S=255;break}}h[m]=S}}if(h)for(m=0,v=3,y=r*c;m<y;++m,v+=4)t[v]=h[m];else for(m=0,v=3,y=r*c;m<y;++m,v+=4)t[v]=255}},{key:"undoPreblend",value:function undoPreblend(t,r,o){var c=this.smask&&this.smask.matte;if(c)for(var l=this.colorSpace.getRgb(c,0),u=l[0],h=l[1],d=l[2],g=r*o*4,m=0;m<g;m+=4){var y=t[m+3];if(0!==y){var v=255/y;t[m]=(t[m]-u)*v+u;t[m+1]=(t[m+1]-h)*v+h;t[m+2]=(t[m+2]-d)*v+d}else{t[m]=255;t[m+1]=255;t[m+2]=255}}}},{key:"createImageData",value:function createImageData(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=this.drawWidth,c=this.drawHeight,u={width:o,height:c,interpolate:this.interpolate,kind:0,data:null},h=this.numComps,m=this.width,y=this.height,v=this.bpc,k=m*h*v+7>>3;if(!r){var _;"DeviceGray"===this.colorSpace.name&&1===v?_=l.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==v||this.needsDecode||(_=l.ImageKind.RGB_24BPP);if(_&&!this.smask&&!this.mask&&o===m&&c===y){u.kind=_;t=this.getImageBytes(y*k);if(this.image instanceof d.DecodeStream)u.data=t;else{var w=new Uint8ClampedArray(t.length);w.set(t);u.data=w}if(this.needsDecode){(0,l.assert)(_===l.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");for(var S=u.data,C=0,x=S.length;C<x;C++)S[C]^=255}return u}if(this.image instanceof g.JpegStream&&!this.smask&&!this.mask){var O=y*k;switch(this.colorSpace.name){case"DeviceGray":O*=3;case"DeviceRGB":case"DeviceCMYK":u.kind=l.ImageKind.RGB_24BPP;u.data=this.getImageBytes(O,o,c,!0);return u}}}var T,E,M=0|(t=this.getImageBytes(y*k)).length/k*c/y,R=this.getComponents(t);if(r||this.smask||this.mask){u.kind=l.ImageKind.RGBA_32BPP;u.data=new Uint8ClampedArray(o*c*4);T=1;E=!0;this.fillOpacity(u.data,o,c,M,R)}else{u.kind=l.ImageKind.RGB_24BPP;u.data=new Uint8ClampedArray(o*c*3);T=0;E=!1}this.needsDecode&&this.decodeBuffer(R);this.colorSpace.fillRgb(u.data,m,y,o,c,M,v,R,T);E&&this.undoPreblend(u.data,o,M);return u}},{key:"fillGrayBuffer",value:function fillGrayBuffer(t){var r=this.numComps;if(1!==r)throw new l.FormatError("Reading gray scale from a color image: ".concat(r));var o,c,u=this.width,h=this.height,d=this.bpc,g=u*r*d+7>>3,m=this.getImageBytes(h*g),y=this.getComponents(m);if(1!==d){this.needsDecode&&this.decodeBuffer(y);c=u*h;var v=255/((1<<d)-1);for(o=0;o<c;++o)t[o]=v*y[o]}else{c=u*h;if(this.needsDecode)for(o=0;o<c;++o)t[o]=y[o]-1&255;else for(o=0;o<c;++o)t[o]=255&-y[o]}}},{key:"getImageBytes",value:function getImageBytes(t,r,o){var c=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.image.reset();this.image.drawWidth=r||this.width;this.image.drawHeight=o||this.height;this.image.forceRGB=!!c;return this.image.getBytes(t,!0)}}],[{key:"buildImage",value:(t=function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}(c.default.mark((function _callee(t){var r,o,h,d,g,m,y,v,k,_,w,S;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:r=t.xref,o=t.res,h=t.image,d=t.isInline,g=void 0!==d&&d,m=t.pdfFunctionFactory,y=t.localColorSpaceCache;v=h;k=null;_=null;w=h.dict.get("SMask");S=h.dict.get("Mask");w?k=w:S&&(S instanceof u.BaseStream||Array.isArray(S)?_=S:(0,l.warn)("Unsupported mask format."));return c.abrupt("return",new PDFImage({xref:r,res:o,image:v,isInline:g,smask:k,mask:_,pdfFunctionFactory:m,localColorSpaceCache:y}));case 8:case"end":return c.stop()}}),_callee)}))),function buildImage(r){return t.apply(this,arguments)})},{key:"createMask",value:function createMask(t){var r,o,c=t.imgArray,l=t.width,u=t.height,h=t.imageIsFromDecodeStream,d=t.inverseDecode,g=t.interpolate,m=(l+7>>3)*u,y=c.byteLength;if(!h||d&&!(m===y))if(d){(r=new Uint8ClampedArray(m)).set(c);for(o=y;o<m;o++)r[o]=255}else(r=new Uint8ClampedArray(y)).set(c);else r=c;if(d)for(o=0;o<y;o++)r[o]^=255;return{data:r,width:l,height:u,interpolate:g}}}]);var t;return PDFImage}();r.PDFImage=v},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Catalog=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(149),u=o(4),h=o(146),d=o(206),g=o(150),m=o(207),y=o(165),v=o(208),k=o(200),_=o(209),w=o(211);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function fetchDestination(t){t instanceof h.Dict&&(t=t.get("D"));return Array.isArray(t)?t:null}var S=function(){function Catalog(t,r){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Catalog);this.pdfManager=t;this.xref=r;this._catDict=r.getCatalogObj();if(!(this._catDict instanceof h.Dict))throw new u.FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict;this._actualNumPages=null;this.fontCache=new h.RefSetCache;this.builtInCMapCache=new Map;this.standardFontDataCache=new Map;this.globalImageCache=new k.GlobalImageCache;this.pageKidsCountCache=new h.RefSetCache;this.pageIndexCache=new h.RefSetCache;this.nonBlendModesSet=new h.RefSet}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(Catalog,[{key:"version",get:function get(){var t=this._catDict.get("Version");return(0,u.shadow)(this,"version",t instanceof h.Name?t.name:null)}},{key:"lang",get:function get(){var t=this._catDict.get("Lang");return(0,u.shadow)(this,"lang","string"==typeof t?(0,u.stringToPDFString)(t):null)}},{key:"needsRendering",get:function get(){var t=this._catDict.get("NeedsRendering");return(0,u.shadow)(this,"needsRendering","boolean"==typeof t&&t)}},{key:"collection",get:function get(){var t=null;try{var r=this._catDict.get("Collection");r instanceof h.Dict&&r.size>0&&(t=r)}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.info)("Cannot fetch Collection entry; assuming no collection is present.")}return(0,u.shadow)(this,"collection",t)}},{key:"acroForm",get:function get(){var t=null;try{var r=this._catDict.get("AcroForm");r instanceof h.Dict&&r.size>0&&(t=r)}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.info)("Cannot fetch AcroForm entry; assuming no forms are present.")}return(0,u.shadow)(this,"acroForm",t)}},{key:"acroFormRef",get:function get(){var t=this._catDict.getRaw("AcroForm");return(0,u.shadow)(this,"acroFormRef",t instanceof h.Ref?t:null)}},{key:"metadata",get:function get(){var t=this._catDict.getRaw("Metadata");if(!(t instanceof h.Ref))return(0,u.shadow)(this,"metadata",null);var r=null;try{var o=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),c=this.xref.fetch(t,o);if(c instanceof g.BaseStream&&c.dict instanceof h.Dict){var d=c.dict.get("Type"),m=c.dict.get("Subtype");if((0,h.isName)(d,"Metadata")&&(0,h.isName)(m,"XML")){var y=(0,u.stringToUTF8String)(c.getString());y&&(r=new _.MetadataParser(y).serializable)}}}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.info)('Skipping invalid Metadata: "'.concat(t,'".'))}return(0,u.shadow)(this,"metadata",r)}},{key:"markInfo",get:function get(){var t=null;try{t=this._readMarkInfo()}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.warn)("Unable to read mark info.")}return(0,u.shadow)(this,"markInfo",t)}},{key:"_readMarkInfo",value:function _readMarkInfo(){var t=this._catDict.get("MarkInfo");if(!(t instanceof h.Dict))return null;var r=Object.assign(Object.create(null),{Marked:!1,UserProperties:!1,Suspects:!1});for(var o in r)if(t.has(o)){var c=t.get(o);"boolean"==typeof c&&(r[o]=c)}return r}},{key:"structTreeRoot",get:function get(){var t=null;try{t=this._readStructTreeRoot()}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.warn)("Unable read to structTreeRoot info.")}return(0,u.shadow)(this,"structTreeRoot",t)}},{key:"_readStructTreeRoot",value:function _readStructTreeRoot(){var t=this._catDict.get("StructTreeRoot");if(!(t instanceof h.Dict))return null;var r=new w.StructTreeRoot(t);r.init();return r}},{key:"toplevelPagesDict",get:function get(){var t=this._catDict.get("Pages");if(!(t instanceof h.Dict))throw new u.FormatError("Invalid top-level pages dictionary.");return(0,u.shadow)(this,"toplevelPagesDict",t)}},{key:"documentOutline",get:function get(){var t=null;try{t=this._readDocumentOutline()}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.warn)("Unable to read document outline.")}return(0,u.shadow)(this,"documentOutline",t)}},{key:"_readDocumentOutline",value:function _readDocumentOutline(){var t=this._catDict.get("Outlines");if(!(t instanceof h.Dict))return null;if(!((t=t.getRaw("First"))instanceof h.Ref))return null;var r={items:[]},o=[{obj:t,parent:r}],c=new h.RefSet;c.put(t);for(var l=this.xref,d=new Uint8ClampedArray(3);o.length>0;){var g=o.shift(),m=l.fetchIfRef(g.obj);if(null!==m){if(!m.has("Title"))throw new u.FormatError("Invalid outline item encountered.");var v={url:null,dest:null};Catalog.parseDestDictionary({destDict:m,resultObj:v,docBaseUrl:this.pdfManager.docBaseUrl});var k=m.get("Title"),_=m.get("F")||0,w=m.getArray("C"),S=m.get("Count"),C=d;!Array.isArray(w)||3!==w.length||0===w[0]&&0===w[1]&&0===w[2]||(C=y.ColorSpace.singletons.rgb.getRgb(w,0));var x={dest:v.dest,url:v.url,unsafeUrl:v.unsafeUrl,newWindow:v.newWindow,title:(0,u.stringToPDFString)(k),color:C,count:Number.isInteger(S)?S:void 0,bold:!!(2&_),italic:!!(1&_),items:[]};g.parent.items.push(x);if((t=m.getRaw("First"))instanceof h.Ref&&!c.has(t)){o.push({obj:t,parent:x});c.put(t)}if((t=m.getRaw("Next"))instanceof h.Ref&&!c.has(t)){o.push({obj:t,parent:g.parent});c.put(t)}}}return r.items.length>0?r.items:null}},{key:"permissions",get:function get(){var t=null;try{t=this._readPermissions()}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.warn)("Unable to read permissions.")}return(0,u.shadow)(this,"permissions",t)}},{key:"_readPermissions",value:function _readPermissions(){var t=this.xref.trailer.get("Encrypt");if(!(t instanceof h.Dict))return null;var r=t.get("P");if("number"!=typeof r)return null;r+=Math.pow(2,32);var o=[];for(var c in u.PermissionFlag){var l=u.PermissionFlag[c];r&l&&o.push(l)}return o}},{key:"optionalContentConfig",get:function get(){var t=null;try{var r=this._catDict.get("OCProperties");if(!r)return(0,u.shadow)(this,"optionalContentConfig",null);var o=r.get("D");if(!o)return(0,u.shadow)(this,"optionalContentConfig",null);var c=r.get("OCGs");if(!Array.isArray(c))return(0,u.shadow)(this,"optionalContentConfig",null);var d,g=[],m=[],y=_createForOfIteratorHelper(c);try{for(y.s();!(d=y.n()).done;){var v=d.value;if(v instanceof h.Ref){m.push(v);var k=this.xref.fetchIfRef(v);g.push({id:v.toString(),name:"string"==typeof k.get("Name")?(0,u.stringToPDFString)(k.get("Name")):null,intent:"string"==typeof k.get("Intent")?(0,u.stringToPDFString)(k.get("Intent")):null})}}}catch(t){y.e(t)}finally{y.f()}(t=this._readOptionalContentConfig(o,m)).groups=g}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.warn)("Unable to read optional content config: ".concat(t))}return(0,u.shadow)(this,"optionalContentConfig",t)}},{key:"_readOptionalContentConfig",value:function _readOptionalContentConfig(t,r){function parseOnOff(t){var o=[];if(Array.isArray(t)){var c,l=_createForOfIteratorHelper(t);try{for(l.s();!(c=l.n()).done;){var u=c.value;u instanceof h.Ref&&(r.includes(u)&&o.push(u.toString()))}}catch(t){l.e(t)}finally{l.f()}}return o}function parseOrder(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!Array.isArray(t))return null;var l,u=[],d=_createForOfIteratorHelper(t);try{for(d.s();!(l=d.n()).done;){var g=l.value;if(g instanceof h.Ref&&r.includes(g)){c.put(g);u.push(g.toString())}else{var m=parseNestedOrder(g,o);m&&u.push(m)}}}catch(t){d.e(t)}finally{d.f()}if(o>0)return u;var y,v=[],k=_createForOfIteratorHelper(r);try{for(k.s();!(y=k.n()).done;){var _=y.value;c.has(_)||v.push(_.toString())}}catch(t){k.e(t)}finally{k.f()}v.length&&u.push({name:null,order:v});return u}function parseNestedOrder(t,r){if(++r>l){(0,u.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS.");return null}var c=o.fetchIfRef(t);if(!Array.isArray(c))return null;var h=o.fetchIfRef(c[0]);if("string"!=typeof h)return null;var d=parseOrder(c.slice(1),r);return d&&d.length?{name:(0,u.stringToPDFString)(h),order:d}:null}var o=this.xref,c=new h.RefSet,l=10;return{name:"string"==typeof t.get("Name")?(0,u.stringToPDFString)(t.get("Name")):null,creator:"string"==typeof t.get("Creator")?(0,u.stringToPDFString)(t.get("Creator")):null,baseState:t.get("BaseState")instanceof h.Name?t.get("BaseState").name:null,on:parseOnOff(t.get("ON")),off:parseOnOff(t.get("OFF")),order:parseOrder(t.get("Order")),groups:null}}},{key:"setActualNumPages",value:function setActualNumPages(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._actualNumPages=t}},{key:"hasActualNumPages",get:function get(){return null!==this._actualNumPages}},{key:"_pagesCount",get:function get(){var t=this.toplevelPagesDict.get("Count");if(!Number.isInteger(t))throw new u.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,u.shadow)(this,"_pagesCount",t)}},{key:"numPages",get:function get(){return this.hasActualNumPages?this._actualNumPages:this._pagesCount}},{key:"destinations",get:function get(){var t=this._readDests(),r=Object.create(null);if(t instanceof d.NameTree){var o,c=_createForOfIteratorHelper(t.getAll());try{for(c.s();!(o=c.n()).done;){var l=_slicedToArray(o.value,2),g=l[0],m=fetchDestination(l[1]);m&&(r[g]=m)}}catch(t){c.e(t)}finally{c.f()}}else t instanceof h.Dict&&t.forEach((function(t,o){var c=fetchDestination(o);c&&(r[t]=c)}));return(0,u.shadow)(this,"destinations",r)}},{key:"getDestination",value:function getDestination(t){var r=this._readDests();if(r instanceof d.NameTree){var o=fetchDestination(r.get(t));if(o)return o;var c=this.destinations[t];if(c){(0,u.warn)('Found "'.concat(t,'" at an incorrect position in the NameTree.'));return c}}else if(r instanceof h.Dict){var l=fetchDestination(r.get(t));if(l)return l}return null}},{key:"_readDests",value:function _readDests(){var t=this._catDict.get("Names");return t&&t.has("Dests")?new d.NameTree(t.getRaw("Dests"),this.xref):this._catDict.has("Dests")?this._catDict.get("Dests"):void 0}},{key:"pageLabels",get:function get(){var t=null;try{t=this._readPageLabels()}catch(t){if(t instanceof l.MissingDataException)throw t;(0,u.warn)("Unable to read page labels.")}return(0,u.shadow)(this,"pageLabels",t)}},{key:"_readPageLabels",value:function _readPageLabels(){var t=this._catDict.getRaw("PageLabels");if(!t)return null;for(var r=new Array(this.numPages),o=null,c="",g=new d.NumberTree(t,this.xref).getAll(),m="",y=1,v=0,k=this.numPages;v<k;v++){var _=g.get(v);if(void 0!==_){if(!(_ instanceof h.Dict))throw new u.FormatError("PageLabel is not a dictionary.");if(_.has("Type")&&!(0,h.isName)(_.get("Type"),"PageLabel"))throw new u.FormatError("Invalid type in PageLabel dictionary.");if(_.has("S")){var w=_.get("S");if(!(w instanceof h.Name))throw new u.FormatError("Invalid style in PageLabel dictionary.");o=w.name}else o=null;if(_.has("P")){var S=_.get("P");if("string"!=typeof S)throw new u.FormatError("Invalid prefix in PageLabel dictionary.");c=(0,u.stringToPDFString)(S)}else c="";if(_.has("St")){var C=_.get("St");if(!(Number.isInteger(C)&&C>=1))throw new u.FormatError("Invalid start in PageLabel dictionary.");y=C}else y=1}switch(o){case"D":m=y;break;case"R":case"r":m=(0,l.toRomanNumerals)(y,"r"===o);break;case"A":case"a":for(var x="a"===o?97:65,O=y-1,T=String.fromCharCode(x+O%26),E=[],M=0,R=O/26|0;M<=R;M++)E.push(T);m=E.join("");break;default:if(o)throw new u.FormatError('Invalid style "'.concat(o,'" in PageLabel dictionary.'));m=""}r[v]=c+m;y++}return r}},{key:"pageLayout",get:function get(){var t=this._catDict.get("PageLayout"),r="";if(t instanceof h.Name)switch(t.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":r=t.name}return(0,u.shadow)(this,"pageLayout",r)}},{key:"pageMode",get:function get(){var t=this._catDict.get("PageMode"),r="UseNone";if(t instanceof h.Name)switch(t.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":r=t.name}return(0,u.shadow)(this,"pageMode",r)}},{key:"viewerPreferences",get:function get(){var t=this,r=this._catDict.get("ViewerPreferences");if(!(r instanceof h.Dict))return(0,u.shadow)(this,"viewerPreferences",null);var o,c=null,l=_createForOfIteratorHelper(r.getKeys());try{for(l.s();!(o=l.n()).done;){var d=o.value,g=r.get(d),m=void 0;switch(d){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof g&&(m=g);break;case"NonFullScreenPageMode":if(g instanceof h.Name)switch(g.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":m=g.name;break;default:m="UseNone"}break;case"Direction":if(g instanceof h.Name)switch(g.name){case"L2R":case"R2L":m=g.name;break;default:m="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(g instanceof h.Name)switch(g.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":m=g.name;break;default:m="CropBox"}break;case"PrintScaling":if(g instanceof h.Name)switch(g.name){case"None":case"AppDefault":m=g.name;break;default:m="AppDefault"}break;case"Duplex":if(g instanceof h.Name)switch(g.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":m=g.name;break;default:m="None"}break;case"PrintPageRange":if(Array.isArray(g)&&g.length%2==0){g.every((function(r,o,c){return Number.isInteger(r)&&r>0&&(0===o||r>=c[o-1])&&r<=t.numPages}))&&(m=g)}break;case"NumCopies":Number.isInteger(g)&&g>0&&(m=g);break;default:(0,u.warn)("Ignoring non-standard key in ViewerPreferences: ".concat(d,"."));continue}if(void 0!==m){c||(c=Object.create(null));c[d]=m}else(0,u.warn)('Bad value, for key "'.concat(d,'", in ViewerPreferences: ').concat(g,"."))}}catch(t){l.e(t)}finally{l.f()}return(0,u.shadow)(this,"viewerPreferences",c)}},{key:"openAction",get:function get(){var t=this._catDict.get("OpenAction"),r=Object.create(null);if(t instanceof h.Dict){var o=new h.Dict(this.xref);o.set("A",t);var c={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:o,resultObj:c});Array.isArray(c.dest)?r.dest=c.dest:c.action&&(r.action=c.action)}else Array.isArray(t)&&(r.dest=t);return(0,u.shadow)(this,"openAction",(0,u.objectSize)(r)>0?r:null)}},{key:"attachments",get:function get(){var t=this._catDict.get("Names"),r=null;if(t instanceof h.Dict&&t.has("EmbeddedFiles")){var o,c=_createForOfIteratorHelper(new d.NameTree(t.getRaw("EmbeddedFiles"),this.xref).getAll());try{for(c.s();!(o=c.n()).done;){var l=_slicedToArray(o.value,2),g=l[0],m=l[1],y=new v.FileSpec(m,this.xref);r||(r=Object.create(null));r[(0,u.stringToPDFString)(g)]=y.serializable}}catch(t){c.e(t)}finally{c.f()}}return(0,u.shadow)(this,"attachments",r)}},{key:"xfaImages",get:function get(){var t=this._catDict.get("Names"),r=null;if(t instanceof h.Dict&&t.has("XFAImages")){var o,c=_createForOfIteratorHelper(new d.NameTree(t.getRaw("XFAImages"),this.xref).getAll());try{for(c.s();!(o=c.n()).done;){var l=_slicedToArray(o.value,2),g=l[0],m=l[1];r||(r=new h.Dict(this.xref));r.set(g,m)}}catch(t){c.e(t)}finally{c.f()}}return(0,u.shadow)(this,"xfaImages",r)}},{key:"_collectJavaScript",value:function _collectJavaScript(){var t=this._catDict.get("Names"),r=null;function appendIfJavaScriptDict(t,o){if(o instanceof h.Dict&&(0,h.isName)(o.get("S"),"JavaScript")){var c=o.get("JS");if(c instanceof g.BaseStream)c=c.getString();else if("string"!=typeof c)return;null===r&&(r=new Map);r.set(t,(0,u.stringToPDFString)(c))}}if(t instanceof h.Dict&&t.has("JavaScript")){var o,c=_createForOfIteratorHelper(new d.NameTree(t.getRaw("JavaScript"),this.xref).getAll());try{for(c.s();!(o=c.n()).done;){var l=_slicedToArray(o.value,2);appendIfJavaScriptDict(l[0],l[1])}}catch(t){c.e(t)}finally{c.f()}}var m=this._catDict.get("OpenAction");m&&appendIfJavaScriptDict("OpenAction",m);return r}},{key:"javaScript",get:function get(){var t=this._collectJavaScript();return(0,u.shadow)(this,"javaScript",t?_toConsumableArray(t.values()):null)}},{key:"jsActions",get:function get(){var t=this._collectJavaScript(),r=(0,l.collectActions)(this.xref,this._catDict,u.DocumentActionEventType);if(t){r||(r=Object.create(null));var o,c=_createForOfIteratorHelper(t);try{for(c.s();!(o=c.n()).done;){var h=_slicedToArray(o.value,2),d=h[0],g=h[1];d in r?r[d].push(g):r[d]=[g]}}catch(t){c.e(t)}finally{c.f()}}return(0,u.shadow)(this,"jsActions",r)}},{key:"fontFallback",value:(S=_asyncToGenerator(c.default.mark((function _callee(t,r){var o,l,u,h;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:c.next=2;return Promise.all(this.fontCache);case 2:o=c.sent;l=_createForOfIteratorHelper(o);c.prev=4;l.s();case 6:if((u=l.n()).done){c.next=13;break}if((h=u.value).loadedName!==t){c.next=11;break}h.fallback(r);return c.abrupt("return");case 11:c.next=6;break;case 13:c.next=18;break;case 15:c.prev=15;c.t0=c.catch(4);l.e(c.t0);case 18:c.prev=18;l.f();return c.finish(18);case 21:case"end":return c.stop()}}),_callee,this,[[4,15,18,21]])}))),function fontFallback(t,r){return S.apply(this,arguments)})},{key:"cleanup",value:(o=_asyncToGenerator(c.default.mark((function _callee2(){var t,r,o,l,u=arguments;return c.default.wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:t=u.length>0&&void 0!==u[0]&&u[0];(0,m.clearGlobalCaches)();this.globalImageCache.clear(t);this.pageKidsCountCache.clear();this.pageIndexCache.clear();this.nonBlendModesSet.clear();c.next=8;return Promise.all(this.fontCache);case 8:r=c.sent;o=_createForOfIteratorHelper(r);try{for(o.s();!(l=o.n()).done;)delete l.value.dict.cacheKey}catch(t){o.e(t)}finally{o.f()}this.fontCache.clear();this.builtInCMapCache.clear();this.standardFontDataCache.clear();case 14:case"end":return c.stop()}}),_callee2,this)}))),function cleanup(){return o.apply(this,arguments)})},{key:"getPageDict",value:(r=_asyncToGenerator(c.default.mark((function _callee3(t){var r,o,l,d,g,m,y,v,k,_,w,S,C,x,O,T;return c.default.wrap((function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:r=[this.toplevelPagesDict];o=new h.RefSet;(l=this._catDict.getRaw("Pages"))instanceof h.Ref&&o.put(l);d=this.xref,g=this.pageKidsCountCache,m=this.pageIndexCache;y=0;case 6:if(!r.length){c.next=67;break}if(!((v=r.pop())instanceof h.Ref)){c.next=34;break}if(!((k=g.get(v))>=0&&y+k<=t)){c.next=13;break}y+=k;return c.abrupt("continue",6);case 13:if(!o.has(v)){c.next=15;break}throw new u.FormatError("Pages tree contains circular reference.");case 15:o.put(v);c.next=18;return d.fetchAsync(v);case 18:if(!((_=c.sent)instanceof h.Dict)){c.next=32;break}if(!((w=_.getRaw("Type"))instanceof h.Ref)){c.next=25;break}c.next=24;return d.fetchAsync(w);case 24:w=c.sent;case 25:if(!(0,h.isName)(w,"Page")&&_.has("Kids")){c.next=32;break}g.has(v)||g.put(v,1);m.has(v)||m.put(v,y);if(y!==t){c.next=30;break}return c.abrupt("return",[_,v]);case 30:y++;return c.abrupt("continue",6);case 32:r.push(_);return c.abrupt("continue",6);case 34:if(v instanceof h.Dict){c.next=36;break}throw new u.FormatError("Page dictionary kid reference points to wrong type of object.");case 36:S=v.objId;if(!((C=v.getRaw("Count"))instanceof h.Ref)){c.next=42;break}c.next=41;return d.fetchAsync(C);case 41:C=c.sent;case 42:if(!(Number.isInteger(C)&&C>=0)){c.next=47;break}S&&!g.has(S)&&g.put(S,C);if(!(y+C<=t)){c.next=47;break}y+=C;return c.abrupt("continue",6);case 47:if(!((x=v.getRaw("Kids"))instanceof h.Ref)){c.next=52;break}c.next=51;return d.fetchAsync(x);case 51:x=c.sent;case 52:if(Array.isArray(x)){c.next=64;break}if(!((O=v.getRaw("Type"))instanceof h.Ref)){c.next=58;break}c.next=57;return d.fetchAsync(O);case 57:O=c.sent;case 58:if(!(0,h.isName)(O,"Page")&&v.has("Kids")){c.next=63;break}if(y!==t){c.next=61;break}return c.abrupt("return",[v,null]);case 61:y++;return c.abrupt("continue",6);case 63:throw new u.FormatError("Page dictionary kids object is not an array.");case 64:for(T=x.length-1;T>=0;T--)r.push(x[T]);c.next=6;break;case 67:throw new Error("Page index ".concat(t," not found."));case 68:case"end":return c.stop()}}),_callee3,this)}))),function getPageDict(t){return r.apply(this,arguments)})},{key:"getAllPageDicts",value:(t=_asyncToGenerator(c.default.mark((function _callee4(){var t,r,o,d,g,m,y,v,k,_,w,S,C,x,O,T,E,M=arguments;return c.default.wrap((function _callee4$(c){for(;;)switch(c.prev=c.next){case 0:_=function _addPageError(r){if(r instanceof l.XRefEntryException&&!t)throw r;g.set(v++,[r,null])};k=function _addPageDict(t,r){r&&!y.has(r)&&y.put(r,v);g.set(v++,[t,r])};t=M.length>0&&void 0!==M[0]&&M[0];r=[{currentNode:this.toplevelPagesDict,posInKids:0}];o=new h.RefSet;(d=this._catDict.getRaw("Pages"))instanceof h.Ref&&o.put(d);g=new Map,m=this.xref,y=this.pageIndexCache;v=0;case 9:if(!(r.length>0)){c.next=69;break}w=r[r.length-1];S=w.currentNode,C=w.posInKids;if(!((x=S.getRaw("Kids"))instanceof h.Ref)){c.next=24;break}c.prev=14;c.next=17;return m.fetchAsync(x);case 17:x=c.sent;c.next=24;break;case 20:c.prev=20;c.t0=c.catch(14);_(c.t0);return c.abrupt("break",69);case 24:if(Array.isArray(x)){c.next=27;break}_(new u.FormatError("Page dictionary kids object is not an array."));return c.abrupt("break",69);case 27:if(!(C>=x.length)){c.next=30;break}r.pop();return c.abrupt("continue",9);case 30:O=x[C];T=void 0;if(!(O instanceof h.Ref)){c.next=49;break}if(!o.has(O)){c.next=36;break}_(new u.FormatError("Pages tree contains circular reference."));return c.abrupt("break",69);case 36:o.put(O);c.prev=37;c.next=40;return m.fetchAsync(O);case 40:T=c.sent;c.next=47;break;case 43:c.prev=43;c.t1=c.catch(37);_(c.t1);return c.abrupt("break",69);case 47:c.next=50;break;case 49:T=O;case 50:if(T instanceof h.Dict){c.next=53;break}_(new u.FormatError("Page dictionary kid reference points to wrong type of object."));return c.abrupt("break",69);case 53:if(!((E=T.getRaw("Type"))instanceof h.Ref)){c.next=65;break}c.prev=55;c.next=58;return m.fetchAsync(E);case 58:E=c.sent;c.next=65;break;case 61:c.prev=61;c.t2=c.catch(55);_(c.t2);return c.abrupt("break",69);case 65:(0,h.isName)(E,"Page")||!T.has("Kids")?k(T,O instanceof h.Ref?O:null):r.push({currentNode:T,posInKids:0});w.posInKids++;c.next=9;break;case 69:return c.abrupt("return",g);case 70:case"end":return c.stop()}}),_callee4,this,[[14,20],[37,43],[55,61]])}))),function getAllPageDicts(){return t.apply(this,arguments)})},{key:"getPageIndex",value:function getPageIndex(t){var r=this,o=this.pageIndexCache.get(t);if(void 0!==o)return Promise.resolve(o);var c=this.xref;var l=0;return function next(o){return function pagesBeforeRef(r){var o,l=0;return c.fetchAsync(r).then((function(c){if((0,h.isRefsEqual)(r,t)&&!(0,h.isDict)(c,"Page")&&!(c instanceof h.Dict&&!c.has("Type")&&c.has("Contents")))throw new u.FormatError("The reference does not point to a /Page dictionary.");if(!c)return null;if(!(c instanceof h.Dict))throw new u.FormatError("Node must be a dictionary.");o=c.getRaw("Parent");return c.getAsync("Parent")})).then((function(t){if(!t)return null;if(!(t instanceof h.Dict))throw new u.FormatError("Parent must be a dictionary.");return t.getAsync("Kids")})).then((function(t){if(!t)return null;for(var d=[],g=!1,m=0,y=t.length;m<y;m++){var v=t[m];if(!(v instanceof h.Ref))throw new u.FormatError("Kid must be a reference.");if((0,h.isRefsEqual)(v,r)){g=!0;break}d.push(c.fetchAsync(v).then((function(t){if(!(t instanceof h.Dict))throw new u.FormatError("Kid node must be a dictionary.");t.has("Count")?l+=t.get("Count"):l++})))}if(!g)throw new u.FormatError("Kid reference not found in parent's kids.");return Promise.all(d).then((function(){return[l,o]}))}))}(o).then((function(o){if(!o){r.pageIndexCache.put(t,l);return l}var c=_slicedToArray(o,2),u=c[0],h=c[1];l+=u;return next(h)}))}(t)}}],[{key:"parseDestDictionary",value:function parseDestDictionary(t){var r=t.destDict;if(r instanceof h.Dict){var o=t.resultObj;if("object"===_typeof(o)){var c,d,m=t.docBaseUrl||null,y=r.get("A");y instanceof h.Dict||(r.has("Dest")?y=r.get("Dest"):(y=r.get("AA"))instanceof h.Dict&&(y.has("D")?y=y.get("D"):y.has("U")&&(y=y.get("U"))));if(y instanceof h.Dict){var v=y.get("S");if(!(v instanceof h.Name)){(0,u.warn)("parseDestDictionary: Invalid type in Action dictionary.");return}var k=v.name;switch(k){case"ResetForm":var _,w=y.get("Flags"),S=0==(1&("number"==typeof w?w:0)),C=[],x=[],O=_createForOfIteratorHelper(y.get("Fields")||[]);try{for(O.s();!(_=O.n()).done;){var T=_.value;T instanceof h.Ref?x.push(T.toString()):"string"==typeof T&&C.push((0,u.stringToPDFString)(T))}}catch(t){O.e(t)}finally{O.f()}o.resetForm={fields:C,refs:x,include:S};break;case"URI":(c=y.get("URI"))instanceof h.Name&&(c="/"+c.name);break;case"GoTo":d=y.get("D");break;case"Launch":case"GoToR":var E=y.get("F");E instanceof h.Dict?c=E.get("F")||null:"string"==typeof E&&(c=E);var M=y.get("D");if(M){M instanceof h.Name&&(M=M.name);if("string"==typeof c){var R=c.split("#")[0];"string"==typeof M?c=R+"#"+M:Array.isArray(M)&&(c=R+"#"+JSON.stringify(M))}}var j=y.get("NewWindow");"boolean"==typeof j&&(o.newWindow=j);break;case"Named":var D=y.get("N");D instanceof h.Name&&(o.action=D.name);break;case"JavaScript":var L,N=y.get("JS");N instanceof g.BaseStream?L=N.getString():"string"==typeof N&&(L=N);var U=L&&(0,l.recoverJsURL)((0,u.stringToPDFString)(L));if(U){c=U.url;o.newWindow=U.newWindow;break}default:if("JavaScript"===k||"SubmitForm"===k)break;(0,u.warn)('parseDestDictionary - unsupported action: "'.concat(k,'".'))}}else r.has("Dest")&&(d=r.get("Dest"));if("string"==typeof c){var H=(0,u.createValidAbsoluteUrl)(c,m,{addDefaultProtocol:!0,tryConvertEncoding:!0});H&&(o.url=H.href);o.unsafeUrl=c}if(d){d instanceof h.Name&&(d=d.name);("string"==typeof d||Array.isArray(d))&&(o.dest=d)}}else(0,u.warn)("parseDestDictionary: `resultObj` must be an object.")}else(0,u.warn)("parseDestDictionary: `destDict` must be a dictionary.")}}]);var t,r,o,S;return Catalog}();r.Catalog=S},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.NumberTree=r.NameTree=void 0;var c=o(146),l=o(4);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var u=function(){function NameOrNumberTree(t,r,o){_classCallCheck(this,NameOrNumberTree);this.constructor===NameOrNumberTree&&(0,l.unreachable)("Cannot initialize NameOrNumberTree.");this.root=t;this.xref=r;this._type=o}_createClass(NameOrNumberTree,[{key:"getAll",value:function getAll(){var t=new Map;if(!this.root)return t;var r=this.xref,o=new c.RefSet;o.put(this.root);for(var u=[this.root];u.length>0;){var h=r.fetchIfRef(u.shift());if(h instanceof c.Dict)if(h.has("Kids"))for(var d=h.get("Kids"),g=0,m=d.length;g<m;g++){var y=d[g];if(o.has(y))throw new l.FormatError('Duplicate entry in "'.concat(this._type,'" tree.'));u.push(y);o.put(y)}else{var v=h.get(this._type);if(Array.isArray(v))for(var k=0,_=v.length;k<_;k+=2)t.set(r.fetchIfRef(v[k]),r.fetchIfRef(v[k+1]))}}return t}},{key:"get",value:function get(t){if(!this.root)return null;for(var r=this.xref,o=r.fetchIfRef(this.root),c=0;o.has("Kids");){if(++c>10){(0,l.warn)('Search depth limit reached for "'.concat(this._type,'" tree.'));return null}var u=o.get("Kids");if(!Array.isArray(u))return null;for(var h=0,d=u.length-1;h<=d;){var g=h+d>>1,m=r.fetchIfRef(u[g]).get("Limits");if(t<r.fetchIfRef(m[0]))d=g-1;else{if(!(t>r.fetchIfRef(m[1]))){o=r.fetchIfRef(u[g]);break}h=g+1}}if(h>d)return null}var y=o.get(this._type);if(Array.isArray(y))for(var v=0,k=y.length-2;v<=k;){var _=v+k>>1,w=_+(1&_),S=r.fetchIfRef(y[w]);if(t<S)k=w-2;else{if(!(t>S))return r.fetchIfRef(y[w+1]);v=w+2}}return null}}]);return NameOrNumberTree}(),h=function(t){_inherits(NameTree,t);var r=_createSuper(NameTree);function NameTree(t,o){_classCallCheck(this,NameTree);return r.call(this,t,o,"Names")}return _createClass(NameTree)}(u);r.NameTree=h;var d=function(t){_inherits(NumberTree,t);var r=_createSuper(NumberTree);function NumberTree(t,o){_classCallCheck(this,NumberTree);return r.call(this,t,o,"Nums")}return _createClass(NumberTree)}(u);r.NumberTree=d},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.clearGlobalCaches=function clearGlobalCaches(){(0,c.clearPrimitiveCaches)();(0,l.clearUnicodeCaches)()};var c=o(146),l=o(162)},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.FileSpec=void 0;var c=o(4),l=o(150),u=o(146);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function pickPlatformItem(t){return t.has("UF")?t.get("UF"):t.has("F")?t.get("F"):t.has("Unix")?t.get("Unix"):t.has("Mac")?t.get("Mac"):t.has("DOS")?t.get("DOS"):null}var h=function(){function FileSpec(t,r){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,FileSpec);if(t instanceof u.Dict){this.xref=r;this.root=t;t.has("FS")&&(this.fs=t.get("FS"));this.description=t.has("Desc")?(0,c.stringToPDFString)(t.get("Desc")):"";t.has("RF")&&(0,c.warn)("Related file specifications are not supported");this.contentAvailable=!0;if(!t.has("EF")){this.contentAvailable=!1;(0,c.warn)("Non-embedded file specifications are not supported")}}}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(FileSpec,[{key:"filename",get:function get(){if(!this._filename&&this.root){var t=pickPlatformItem(this.root)||"unnamed";this._filename=(0,c.stringToPDFString)(t).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename}},{key:"content",get:function get(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=pickPlatformItem(this.root.get("EF")));var t=null;if(this.contentRef){var r=this.xref.fetchIfRef(this.contentRef);r instanceof l.BaseStream?t=r.getBytes():(0,c.warn)("Embedded file specification points to non-existing/invalid content")}else(0,c.warn)("Embedded file specification does not have a content");return t}},{key:"serializable",get:function get(){return{filename:this.filename,content:this.content}}}]);return FileSpec}();r.FileSpec=h},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MetadataParser=void 0;var c=o(210);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var l=function(){function MetadataParser(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MetadataParser);t=this._repair(t);var r=new c.SimpleXMLParser({lowerCaseName:!0}).parseFromString(t);this._metadataMap=new Map;this._data=t;r&&this._parse(r)}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(MetadataParser,[{key:"_repair",value:function _repair(t){return t.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(t,r){for(var o=r.replace(/\\([0-3])([0-7])([0-7])/g,(function(t,r,o,c){return String.fromCharCode(64*r+8*o+1*c)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(t,r){switch(r){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error("_repair: ".concat(r," isn't defined."))})),c=[],l=0,u=o.length;l<u;l+=2){var h=256*o.charCodeAt(l)+o.charCodeAt(l+1);h>=32&&h<127&&60!==h&&62!==h&&38!==h?c.push(String.fromCharCode(h)):c.push("&#x"+(65536+h).toString(16).substring(1)+";")}return">"+c.join("")}))}},{key:"_getSequence",value:function _getSequence(t){var r=t.nodeName;return"rdf:bag"!==r&&"rdf:seq"!==r&&"rdf:alt"!==r?null:t.childNodes.filter((function(t){return"rdf:li"===t.nodeName}))}},{key:"_parseArray",value:function _parseArray(t){if(t.hasChildNodes()){var r=_slicedToArray(t.childNodes,1)[0],o=this._getSequence(r)||[];this._metadataMap.set(t.nodeName,o.map((function(t){return t.textContent.trim()})))}}},{key:"_parse",value:function _parse(t){var r=t.documentElement;if("rdf:rdf"!==r.nodeName){r=r.firstChild;for(;r&&"rdf:rdf"!==r.nodeName;)r=r.nextSibling}if(r&&"rdf:rdf"===r.nodeName&&r.hasChildNodes()){var o,c=_createForOfIteratorHelper(r.childNodes);try{for(c.s();!(o=c.n()).done;){var l=o.value;if("rdf:description"===l.nodeName){var u,h=_createForOfIteratorHelper(l.childNodes);try{for(h.s();!(u=h.n()).done;){var d=u.value,g=d.nodeName;switch(g){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(d);continue}this._metadataMap.set(g,d.textContent.trim())}}catch(t){h.e(t)}finally{h.f()}}}}catch(t){c.e(t)}finally{c.f()}}}},{key:"serializable",get:function get(){return{parsedData:this._metadataMap,rawData:this._data}}}]);return MetadataParser}();r.MetadataParser=l},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XMLParserErrorCode=r.XMLParserBase=r.SimpleXMLParser=r.SimpleDOMNode=void 0;var c=o(149);function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var l={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};r.XMLParserErrorCode=l;function isWhitespace(t,r){var o=t[r];return" "===o||"\n"===o||"\r"===o||"\t"===o}var u=function(){function XMLParserBase(){_classCallCheck(this,XMLParserBase)}_createClass(XMLParserBase,[{key:"_resolveEntities",value:function _resolveEntities(t){var r=this;return t.replace(/&([^;]+);/g,(function(t,o){if("#x"===o.substring(0,2))return String.fromCodePoint(parseInt(o.substring(2),16));if("#"===o.substring(0,1))return String.fromCodePoint(parseInt(o.substring(1),10));switch(o){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return r.onResolveEntity(o)}))}},{key:"_parseContent",value:function _parseContent(t,r){var o=[],c=r;function skipWs(){for(;c<t.length&&isWhitespace(t,c);)++c}for(;c<t.length&&!isWhitespace(t,c)&&">"!==t[c]&&"/"!==t[c];)++c;var l=t.substring(r,c);skipWs();for(;c<t.length&&">"!==t[c]&&"/"!==t[c]&&"?"!==t[c];){skipWs();for(var u,h="";c<t.length&&!isWhitespace(t,c)&&"="!==t[c];){h+=t[c];++c}skipWs();if("="!==t[c])return null;++c;skipWs();var d=t[c];if('"'!==d&&"'"!==d)return null;var g=t.indexOf(d,++c);if(g<0)return null;u=t.substring(c,g);o.push({name:h,value:this._resolveEntities(u)});c=g+1;skipWs()}return{name:l,attributes:o,parsed:c-r}}},{key:"_parseProcessingInstruction",value:function _parseProcessingInstruction(t,r){var o=r;for(;o<t.length&&!isWhitespace(t,o)&&">"!==t[o]&&"?"!==t[o]&&"/"!==t[o];)++o;var c=t.substring(r,o);!function skipWs(){for(;o<t.length&&isWhitespace(t,o);)++o}();for(var l=o;o<t.length&&("?"!==t[o]||">"!==t[o+1]);)++o;return{name:c,value:t.substring(l,o),parsed:o-r}}},{key:"parseXml",value:function parseXml(t){for(var r=0;r<t.length;){var o=r;if("<"===t[r]){var c=void 0;switch(t[++o]){case"/":++o;if((c=t.indexOf(">",o))<0){this.onError(l.UnterminatedElement);return}this.onEndElement(t.substring(o,c));o=c+1;break;case"?":++o;var u=this._parseProcessingInstruction(t,o);if("?>"!==t.substring(o+u.parsed,o+u.parsed+2)){this.onError(l.UnterminatedXmlDeclaration);return}this.onPi(u.name,u.value);o+=u.parsed+2;break;case"!":if("--"===t.substring(o+1,o+3)){if((c=t.indexOf("--\x3e",o+3))<0){this.onError(l.UnterminatedComment);return}this.onComment(t.substring(o+3,c));o=c+3}else if("[CDATA["===t.substring(o+1,o+8)){if((c=t.indexOf("]]>",o+8))<0){this.onError(l.UnterminatedCdat);return}this.onCdata(t.substring(o+8,c));o=c+3}else{if("DOCTYPE"!==t.substring(o+1,o+8)){this.onError(l.MalformedElement);return}var h=t.indexOf("[",o+8),d=!1;if((c=t.indexOf(">",o+8))<0){this.onError(l.UnterminatedDoctypeDeclaration);return}if(h>0&&c>h){if((c=t.indexOf("]>",o+8))<0){this.onError(l.UnterminatedDoctypeDeclaration);return}d=!0}var g=t.substring(o+8,c+(d?1:0));this.onDoctype(g);o=c+(d?2:1)}break;default:var m=this._parseContent(t,o);if(null===m){this.onError(l.MalformedElement);return}var y=!1;if("/>"===t.substring(o+m.parsed,o+m.parsed+2))y=!0;else if(">"!==t.substring(o+m.parsed,o+m.parsed+1)){this.onError(l.UnterminatedElement);return}this.onBeginElement(m.name,m.attributes,y);o+=m.parsed+(y?2:1)}}else{for(;o<t.length&&"<"!==t[o];)o++;var v=t.substring(r,o);this.onText(this._resolveEntities(v))}r=o}}},{key:"onResolveEntity",value:function onResolveEntity(t){return"&".concat(t,";")}},{key:"onPi",value:function onPi(t,r){}},{key:"onComment",value:function onComment(t){}},{key:"onCdata",value:function onCdata(t){}},{key:"onDoctype",value:function onDoctype(t){}},{key:"onText",value:function onText(t){}},{key:"onBeginElement",value:function onBeginElement(t,r,o){}},{key:"onEndElement",value:function onEndElement(t){}},{key:"onError",value:function onError(t){}}]);return XMLParserBase}();r.XMLParserBase=u;var h=function(){function SimpleDOMNode(t,r){_classCallCheck(this,SimpleDOMNode);this.nodeName=t;this.nodeValue=r;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}_createClass(SimpleDOMNode,[{key:"firstChild",get:function get(){return this.childNodes&&this.childNodes[0]}},{key:"nextSibling",get:function get(){var t=this.parentNode.childNodes;if(t){var r=t.indexOf(this);if(-1!==r)return t[r+1]}}},{key:"textContent",get:function get(){return this.childNodes?this.childNodes.map((function(t){return t.textContent})).join(""):this.nodeValue||""}},{key:"hasChildNodes",value:function hasChildNodes(){return this.childNodes&&this.childNodes.length>0}},{key:"searchNode",value:function searchNode(t,r){if(r>=t.length)return this;for(var o=t[r],c=[],l=this;;){if(o.name===l.nodeName){if(0!==o.pos){if(0===c.length)return null;var u,h=0,d=_createForOfIteratorHelper(_slicedToArray(c.pop(),1)[0].childNodes);try{for(d.s();!(u=d.n()).done;){var g=u.value;if(o.name===g.nodeName){if(h===o.pos)return g.searchNode(t,r+1);h++}}}catch(t){d.e(t)}finally{d.f()}return l.searchNode(t,r+1)}var m=l.searchNode(t,r+1);if(null!==m)return m}if(l.childNodes&&0!==l.childNodes.length){c.push([l,0]);l=l.childNodes[0]}else{if(0===c.length)return null;for(;0!==c.length;){var y=_slicedToArray(c.pop(),2),v=y[0],k=y[1]+1;if(k<v.childNodes.length){c.push([v,k]);l=v.childNodes[k];break}}if(0===c.length)return null}}}},{key:"dump",value:function dump(t){if("#text"!==this.nodeName){t.push("<".concat(this.nodeName));if(this.attributes){var r,o=_createForOfIteratorHelper(this.attributes);try{for(o.s();!(r=o.n()).done;){var l=r.value;t.push(" ".concat(l.name,'="').concat((0,c.encodeToXmlString)(l.value),'"'))}}catch(t){o.e(t)}finally{o.f()}}if(this.hasChildNodes()){t.push(">");var u,h=_createForOfIteratorHelper(this.childNodes);try{for(h.s();!(u=h.n()).done;){u.value.dump(t)}}catch(t){h.e(t)}finally{h.f()}t.push("</".concat(this.nodeName,">"))}else this.nodeValue?t.push(">".concat((0,c.encodeToXmlString)(this.nodeValue),"</").concat(this.nodeName,">")):t.push("/>")}else t.push((0,c.encodeToXmlString)(this.nodeValue))}}]);return SimpleDOMNode}();r.SimpleDOMNode=h;var d=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(SimpleXMLParser,t);var r=_createSuper(SimpleXMLParser);function SimpleXMLParser(t){var o,c=t.hasAttributes,u=void 0!==c&&c,h=t.lowerCaseName,d=void 0!==h&&h;_classCallCheck(this,SimpleXMLParser);(o=r.call(this))._currentFragment=null;o._stack=null;o._errorCode=l.NoError;o._hasAttributes=u;o._lowerCaseName=d;return o}_createClass(SimpleXMLParser,[{key:"parseFromString",value:function parseFromString(t){this._currentFragment=[];this._stack=[];this._errorCode=l.NoError;this.parseXml(t);if(this._errorCode===l.NoError){var r=_slicedToArray(this._currentFragment,1)[0];if(r)return{documentElement:r}}}},{key:"onText",value:function onText(t){if(!function isWhitespaceString(t){for(var r=0,o=t.length;r<o;r++)if(!isWhitespace(t,r))return!1;return!0}(t)){var r=new h("#text",t);this._currentFragment.push(r)}}},{key:"onCdata",value:function onCdata(t){var r=new h("#text",t);this._currentFragment.push(r)}},{key:"onBeginElement",value:function onBeginElement(t,r,o){this._lowerCaseName&&(t=t.toLowerCase());var c=new h(t);c.childNodes=[];this._hasAttributes&&(c.attributes=r);this._currentFragment.push(c);if(!o){this._stack.push(this._currentFragment);this._currentFragment=c.childNodes}}},{key:"onEndElement",value:function onEndElement(t){this._currentFragment=this._stack.pop()||[];var r=this._currentFragment[this._currentFragment.length-1];if(r)for(var o=0,c=r.childNodes.length;o<c;o++)r.childNodes[o].parentNode=r}},{key:"onError",value:function onError(t){this._errorCode=t}}]);return SimpleXMLParser}(u);r.SimpleXMLParser=d},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.StructTreeRoot=r.StructTreePage=void 0;var c=o(146),l=o(4),u=o(206);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var h="PAGE_CONTENT",d="STREAM_CONTENT",g="OBJECT",m="ELEMENT",y=function(){function StructTreeRoot(t){_classCallCheck(this,StructTreeRoot);this.dict=t;this.roleMap=new Map}_createClass(StructTreeRoot,[{key:"init",value:function init(){this.readRoleMap()}},{key:"readRoleMap",value:function readRoleMap(){var t=this,r=this.dict.get("RoleMap");r instanceof c.Dict&&r.forEach((function(r,o){o instanceof c.Name&&t.roleMap.set(r,o.name)}))}}]);return StructTreeRoot}();r.StructTreeRoot=y;var v=function(){function StructElementNode(t,r){_classCallCheck(this,StructElementNode);this.tree=t;this.dict=r;this.kids=[];this.parseKids()}_createClass(StructElementNode,[{key:"role",get:function get(){var t=this.dict.get("S"),r=t instanceof c.Name?t.name:"",o=this.tree.root;return o.roleMap.has(r)?o.roleMap.get(r):r}},{key:"parseKids",value:function parseKids(){var t=null,r=this.dict.getRaw("Pg");r instanceof c.Ref&&(t=r.toString());var o=this.dict.get("K");if(Array.isArray(o)){var l,u=_createForOfIteratorHelper(o);try{for(u.s();!(l=u.n()).done;){var h=l.value,d=this.parseKid(t,h);d&&this.kids.push(d)}}catch(t){u.e(t)}finally{u.f()}}else{var g=this.parseKid(t,o);g&&this.kids.push(g)}}},{key:"parseKid",value:function parseKid(t,r){if(Number.isInteger(r))return this.tree.pageDict.objId!==t?null:new k({type:h,mcid:r,pageObjId:t});var o=null;r instanceof c.Ref?o=this.dict.xref.fetch(r):r instanceof c.Dict&&(o=r);if(!o)return null;var l=o.getRaw("Pg");l instanceof c.Ref&&(t=l.toString());var u=o.get("Type")instanceof c.Name?o.get("Type").name:null;return"MCR"===u?this.tree.pageDict.objId!==t?null:new k({type:d,refObjId:o.getRaw("Stm")instanceof c.Ref?o.getRaw("Stm").toString():null,pageObjId:t,mcid:o.get("MCID")}):"OBJR"===u?this.tree.pageDict.objId!==t?null:new k({type:g,refObjId:o.getRaw("Obj")instanceof c.Ref?o.getRaw("Obj").toString():null,pageObjId:t}):new k({type:m,dict:o})}}]);return StructElementNode}(),k=_createClass((function StructElement(t){var r=t.type,o=t.dict,c=void 0===o?null:o,l=t.mcid,u=void 0===l?null:l,h=t.pageObjId,d=void 0===h?null:h,g=t.refObjId,m=void 0===g?null:g;_classCallCheck(this,StructElement);this.type=r;this.dict=c;this.mcid=u;this.pageObjId=d;this.refObjId=m;this.parentNode=null})),_=function(){function StructTreePage(t,r){_classCallCheck(this,StructTreePage);this.root=t;this.rootDict=t?t.dict:null;this.pageDict=r;this.nodes=[]}_createClass(StructTreePage,[{key:"parse",value:function parse(){if(this.root&&this.rootDict){var t=this.rootDict.get("ParentTree");if(t){var r=this.pageDict.get("StructParents");if(Number.isInteger(r)){var o=new u.NumberTree(t,this.rootDict.xref).get(r);if(Array.isArray(o)){var l,h=new Map,d=_createForOfIteratorHelper(o);try{for(d.s();!(l=d.n()).done;){var g=l.value;g instanceof c.Ref&&this.addNode(this.rootDict.xref.fetch(g),h)}}catch(t){d.e(t)}finally{d.f()}}}}}}},{key:"addNode",value:function addNode(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(o>40){(0,l.warn)("StructTree MAX_DEPTH reached.");return null}if(r.has(t))return r.get(t);var u=new v(this,t);r.set(t,u);var h=t.get("P");if(!h||(0,c.isName)(h.get("Type"),"StructTreeRoot")){this.addTopLevelNode(t,u)||r.delete(t);return u}var d=this.addNode(h,r,o+1);if(!d)return u;var g,y=!1,k=_createForOfIteratorHelper(d.kids);try{for(k.s();!(g=k.n()).done;){var _=g.value;if(_.type===m&&_.dict===t){_.parentNode=u;y=!0}}}catch(t){k.e(t)}finally{k.f()}y||r.delete(t);return u}},{key:"addTopLevelNode",value:function addTopLevelNode(t,r){var o=this.rootDict.get("K");if(!o)return!1;if(o instanceof c.Dict){if(o.objId!==t.objId)return!1;this.nodes[0]=r;return!0}if(!Array.isArray(o))return!0;for(var l=!1,u=0;u<o.length;u++){var h=o[u];if(h&&h.toString()===t.objId){this.nodes[u]=r;l=!0}}return l}},{key:"serializable",get:function get(){function nodeToSerializable(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(o>40)(0,l.warn)("StructTree too deep to be fully serialized.");else{var c=Object.create(null);c.role=t.role;c.children=[];r.children.push(c);var u=t.dict.get("Alt");"string"==typeof u&&(c.alt=(0,l.stringToPDFString)(u));var y=t.dict.get("Lang");"string"==typeof y&&(c.lang=(0,l.stringToPDFString)(y));var v,k=_createForOfIteratorHelper(t.kids);try{for(k.s();!(v=k.n()).done;){var _=v.value,w=_.type===m?_.parentNode:null;w?nodeToSerializable(w,c,o+1):_.type===h||_.type===d?c.children.push({type:"content",id:"page".concat(_.pageObjId,"_mcid").concat(_.mcid)}):_.type===g&&c.children.push({type:"object",id:_.refObjId})}}catch(t){k.e(t)}finally{k.f()}}}var t=Object.create(null);t.children=[];t.role="Root";var r,o=_createForOfIteratorHelper(this.nodes);try{for(o.s();!(r=o.n()).done;){var c=r.value;c&&nodeToSerializable(c,t)}}catch(t){o.e(t)}finally{o.f()}return t}}]);return StructTreePage}();r.StructTreePage=_},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ObjectLoader=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(146),u=o(150),h=o(149),d=o(4);function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function addChildren(t,r){if(t instanceof l.Dict)t=t.getRawValues();else if(t instanceof u.BaseStream)t=t.dict.getRawValues();else if(!Array.isArray(t))return;var o,c,h=_createForOfIteratorHelper(t);try{for(h.s();!(o=h.n()).done;){var d=o.value;((c=d)instanceof l.Ref||c instanceof l.Dict||c instanceof u.BaseStream||Array.isArray(c))&&r.push(d)}}catch(t){h.e(t)}finally{h.f()}}var g=function(){function ObjectLoader(t,r,o){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,ObjectLoader);this.dict=t;this.keys=r;this.xref=o;this.refSet=null}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(ObjectLoader,[{key:"load",value:(r=_asyncToGenerator(c.default.mark((function _callee(){var t,r,o,u,h,d;return c.default.wrap((function _callee$(c){for(;;)switch(c.prev=c.next){case 0:if(!this.xref.stream.isDataLoaded){c.next=2;break}return c.abrupt("return",void 0);case 2:t=this.keys,r=this.dict;this.refSet=new l.RefSet;o=[];for(u=0,h=t.length;u<h;u++)void 0!==(d=r.getRaw(t[u]))&&o.push(d);return c.abrupt("return",this._walk(o));case 7:case"end":return c.stop()}}),_callee,this)}))),function load(){return r.apply(this,arguments)})},{key:"_walk",value:(t=_asyncToGenerator(c.default.mark((function _callee2(t){var r,o,g,m,y,v,k,_,w,S,C,x;return c.default.wrap((function _callee2$(c){for(;;)switch(c.prev=c.next){case 0:r=[];o=[];case 2:if(!t.length){c.next=48;break}if(!((g=t.pop())instanceof l.Ref)){c.next=21;break}if(!this.refSet.has(g)){c.next=7;break}return c.abrupt("continue",2);case 7:c.prev=7;this.refSet.put(g);g=this.xref.fetch(g);c.next=21;break;case 12:c.prev=12;c.t0=c.catch(7);if(c.t0 instanceof h.MissingDataException){c.next=19;break}(0,d.warn)('ObjectLoader._walk - requesting all data: "'.concat(c.t0,'".'));this.refSet=null;m=this.xref.stream.manager;return c.abrupt("return",m.requestAllChunks());case 19:r.push(g);o.push({begin:c.t0.begin,end:c.t0.end});case 21:if(!(g instanceof u.BaseStream)){c.next=45;break}if(!(y=g.getBaseStreams())){c.next=45;break}v=!1;k=_createForOfIteratorHelper(y);c.prev=26;k.s();case 28:if((_=k.n()).done){c.next=36;break}if(!(w=_.value).isDataLoaded){c.next=32;break}return c.abrupt("continue",34);case 32:v=!0;o.push({begin:w.start,end:w.end});case 34:c.next=28;break;case 36:c.next=41;break;case 38:c.prev=38;c.t1=c.catch(26);k.e(c.t1);case 41:c.prev=41;k.f();return c.finish(41);case 44:v&&r.push(g);case 45:addChildren(g,t);c.next=2;break;case 48:if(!o.length){c.next=54;break}c.next=51;return this.xref.stream.manager.requestRanges(o);case 51:S=_createForOfIteratorHelper(r);try{for(S.s();!(C=S.n()).done;)(x=C.value)instanceof l.Ref&&this.refSet.remove(x)}catch(t){S.e(t)}finally{S.f()}return c.abrupt("return",this._walk(r));case 54:this.refSet=null;return c.abrupt("return",void 0);case 56:case"end":return c.stop()}}),_callee2,this,[[7,12],[26,38,41,44]])}))),function _walk(r){return t.apply(this,arguments)})}]);var t,r;return ObjectLoader}();r.ObjectLoader=g},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.incrementalUpdate=function incrementalUpdate(t){var r=t.originalData,o=t.xrefInfo,d=t.newRefs,m=t.xref,y=void 0===m?null:m,v=t.hasXfa,k=void 0!==v&&v,_=t.xfaDatasetsRef,w=void 0===_?null:_,S=t.hasXfaDatasetsEntry,C=void 0!==S&&S,x=t.acroFormRef,O=void 0===x?null:x,T=t.acroForm,E=void 0===T?null:T,M=t.xfaData,R=void 0===M?null:M;k&&function updateXFA(t){var r=t.xfaData,o=t.xfaDatasetsRef,l=t.hasXfaDatasetsEntry,d=t.acroFormRef,g=t.acroForm,m=t.newRefs,y=t.xref;t.xrefInfo;if(null===y)return;if(!l){if(!d){(0,c.warn)("XFA - Cannot save it");return}var v=g.get("XFA"),k=v.slice();k.splice(2,0,"datasets");k.splice(3,0,o);g.set("XFA",k);var _=y.encrypt,w=null;_&&(w=_.createCipherTransform(d.num,d.gen));var S=["".concat(d.num," ").concat(d.gen," obj\n")];writeDict(g,S,w);S.push("\n");g.set("XFA",v);m.push({ref:d,data:S.join("")})}if(null===r){r=function writeXFADataForAcroform(t,r){var o,l=new h.SimpleXMLParser({hasAttributes:!0}).parseFromString(t),d=_createForOfIteratorHelper(r);try{for(d.s();!(o=d.n()).done;){var g=o.value.xfa;if(g){var m=g.path,y=g.value;if(m){var v=l.documentElement.searchNode((0,u.parseXFAPath)(m),0);v?v.childNodes=[new h.SimpleDOMNode("#text",y)]:(0,c.warn)("Node not found for path: ".concat(m))}}}}catch(t){d.e(t)}finally{d.f()}var k=[];l.documentElement.dump(k);return k.join("")}(y.fetchIfRef(o).getString(),m)}var C=y.encrypt;if(C){r=C.createCipherTransform(o.num,o.gen).encryptString(r)}var x="".concat(o.num," ").concat(o.gen," obj\n")+"<< /Type /EmbeddedFile /Length ".concat(r.length,">>\nstream\n")+r+"\nendstream\nendobj\n";m.push({ref:o,data:x})}({xfaData:R,xfaDatasetsRef:w,hasXfaDatasetsEntry:C,acroFormRef:O,acroForm:E,newRefs:d,xref:y,xrefInfo:o});var j,D,L=new l.Dict(null),N=o.newRef,U=r[r.length-1];if(10===U||13===U){j=[];D=r.length}else{j=["\n"];D=r.length+1}L.set("Size",N.num+1);L.set("Prev",o.startXRef);L.set("Type",l.Name.get("XRef"));null!==o.rootRef&&L.set("Root",o.rootRef);null!==o.infoRef&&L.set("Info",o.infoRef);null!==o.encryptRef&&L.set("Encrypt",o.encryptRef);d.push({ref:N,data:""});d=d.sort((function(t,r){return t.ref.num-r.ref.num}));var H,$=[[0,1,65535]],X=[0,1],q=0,G=_createForOfIteratorHelper(d);try{for(G.s();!(H=G.n()).done;){var z=H.value,W=z.ref,V=z.data;q=Math.max(q,D);$.push([1,D,Math.min(W.gen,65535)]);D+=V.length;X.push(W.num,1);j.push(V)}}catch(t){G.e(t)}finally{G.f()}L.set("Index",X);if(Array.isArray(o.fileIds)&&o.fileIds.length>0){var K=function computeMD5(t,r){for(var o=Math.floor(Date.now()/1e3),l=r.filename||"",u=[o.toString(),l,t.toString()],h=u.reduce((function(t,r){return t+r.length}),0),d=0,m=Object.values(r.info);d<m.length;d++){var y=m[d];u.push(y);h+=y.length}for(var v=new Uint8Array(h),k=0,_=0,w=u;_<w.length;_++){var S=w[_];writeString(S,k,v);k+=S.length}return(0,c.bytesToString)((0,g.calculateMD5)(v))}(D,o);L.set("ID",[o.fileIds[0],K])}var Y=[1,Math.ceil(Math.log2(q)/8),2],J=(Y[0]+Y[1]+Y[2])*$.length;L.set("W",Y);L.set("Length",J);j.push("".concat(N.num," ").concat(N.gen," obj\n"));writeDict(L,j,null);j.push(" stream\n");var Z=j.reduce((function(t,r){return t+r.length}),0),Q="\nendstream\nendobj\nstartxref\n".concat(D,"\n%%EOF\n"),ee=new Uint8Array(r.length+Z+J+Q.length);ee.set(r);var te,re=r.length,ae=_createForOfIteratorHelper(j);try{for(ae.s();!(te=ae.n()).done;){var ne=te.value;writeString(ne,re,ee);re+=ne.length}}catch(t){ae.e(t)}finally{ae.f()}for(var ie=0,oe=$;ie<oe.length;ie++){var se=(fe=oe[ie],he=3,function _arrayWithHoles(t){if(Array.isArray(t))return t}(fe)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(fe,he)||_unsupportedIterableToArray(fe,he)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),ce=se[0],le=se[1],ue=se[2];re=writeInt(ce,Y[0],re,ee);re=writeInt(le,Y[1],re,ee);re=writeInt(ue,Y[2],re,ee)}var fe,he;writeString(Q,re,ee);return ee};r.writeDict=writeDict;var c=o(4),l=o(146),u=o(149),h=o(210),d=o(150),g=o(214);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function writeDict(t,r,o){r.push("<<");var c,l=_createForOfIteratorHelper(t.getKeys());try{for(l.s();!(c=l.n()).done;){var h=c.value;r.push(" /".concat((0,u.escapePDFName)(h)," "));writeValue(t.getRaw(h),r,o)}}catch(t){l.e(t)}finally{l.f()}r.push(">>")}function writeValue(t,r,o){if(t instanceof l.Name)r.push("/".concat((0,u.escapePDFName)(t.name)));else if(t instanceof l.Ref)r.push("".concat(t.num," ").concat(t.gen," R"));else if(Array.isArray(t))!function writeArray(t,r,o){r.push("[");var c,l=!0,u=_createForOfIteratorHelper(t);try{for(u.s();!(c=u.n()).done;){var h=c.value;l?l=!1:r.push(" ");writeValue(h,r,o)}}catch(t){u.e(t)}finally{u.f()}r.push("]")}(t,r,o);else if("string"==typeof t){null!==o&&(t=o.encryptString(t));r.push("(".concat((0,c.escapeString)(t),")"))}else"number"==typeof t?r.push(function numberToString(t){if(Number.isInteger(t))return t.toString();var r=Math.round(100*t);return r%100==0?(r/100).toString():r%10==0?t.toFixed(1):t.toFixed(2)}(t)):"boolean"==typeof t?r.push(t.toString()):t instanceof l.Dict?writeDict(t,r,o):t instanceof d.BaseStream?function writeStream(t,r,o){writeDict(t.dict,r,o);r.push(" stream\n");var c=t.getString();null!==o&&(c=o.encryptString(c));r.push(c,"\nendstream\n")}(t,r,o):null===t?r.push("null"):(0,c.warn)("Unhandled value in writer: ".concat(_typeof(t),", please file a bug."))}function writeInt(t,r,o,c){for(var l=r+o-1;l>o-1;l--){c[l]=255&t;t>>=8}return o+r}function writeString(t,r,o){for(var c=0,l=t.length;c<l;c++)o[r+c]=255&t.charCodeAt(c)}},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.calculateSHA256=r.calculateMD5=r.PDF20=r.PDF17=r.CipherTransformFactory=r.ARCFourCipher=r.AES256Cipher=r.AES128Cipher=void 0;r.calculateSHA384=calculateSHA384;r.calculateSHA512=void 0;var c=o(4),l=o(146),u=o(215);function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var h=function(){function ARCFourCipher(t){_classCallCheck(this,ARCFourCipher);this.a=0;this.b=0;for(var r=new Uint8Array(256),o=t.length,c=0;c<256;++c)r[c]=c;for(var l=0,u=0;l<256;++l){var h=r[l];u=u+h+t[l%o]&255;r[l]=r[u];r[u]=h}this.s=r}_createClass(ARCFourCipher,[{key:"encryptBlock",value:function encryptBlock(t){for(var r=this.a,o=this.b,c=this.s,l=t.length,u=new Uint8Array(l),h=0;h<l;++h){var d=c[r=r+1&255],g=c[o=o+d&255];c[r]=g;c[o]=d;u[h]=t[h]^c[d+g&255]}this.a=r;this.b=o;return u}},{key:"decryptBlock",value:function decryptBlock(t){return this.encryptBlock(t)}},{key:"encrypt",value:function encrypt(t){return this.encryptBlock(t)}}]);return ARCFourCipher}();r.ARCFourCipher=h;var d=function calculateMD5Closure(){var t=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),r=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return function hash(o,c,l){var u,h,d=1732584193,g=-271733879,m=-1732584194,y=271733878,v=l+72&-64,k=new Uint8Array(v);for(u=0;u<l;++u)k[u]=o[c++];k[u++]=128;for(var _=v-8;u<_;)k[u++]=0;k[u++]=l<<3&255;k[u++]=l>>5&255;k[u++]=l>>13&255;k[u++]=l>>21&255;k[u++]=l>>>29&255;k[u++]=0;k[u++]=0;k[u++]=0;var w=new Int32Array(16);for(u=0;u<v;){for(h=0;h<16;++h,u+=4)w[h]=k[u]|k[u+1]<<8|k[u+2]<<16|k[u+3]<<24;var S=d,C=g,x=m,O=y,T=void 0,E=void 0;for(h=0;h<64;++h){if(h<16){T=C&x|~C&O;E=h}else if(h<32){T=O&C|~O&x;E=5*h+1&15}else if(h<48){T=C^x^O;E=3*h+5&15}else{T=x^(C|~O);E=7*h&15}var M=O,R=S+T+r[h]+w[E]|0,j=t[h];O=x;x=C;C=C+(R<<j|R>>>32-j)|0;S=M}d=d+S|0;g=g+C|0;m=m+x|0;y=y+O|0}return new Uint8Array([255&d,d>>8&255,d>>16&255,d>>>24&255,255&g,g>>8&255,g>>16&255,g>>>24&255,255&m,m>>8&255,m>>16&255,m>>>24&255,255&y,y>>8&255,y>>16&255,y>>>24&255])}}();r.calculateMD5=d;var g=function(){function Word64(t,r){_classCallCheck(this,Word64);this.high=0|t;this.low=0|r}_createClass(Word64,[{key:"and",value:function and(t){this.high&=t.high;this.low&=t.low}},{key:"xor",value:function xor(t){this.high^=t.high;this.low^=t.low}},{key:"or",value:function or(t){this.high|=t.high;this.low|=t.low}},{key:"shiftRight",value:function shiftRight(t){if(t>=32){this.low=this.high>>>t-32|0;this.high=0}else{this.low=this.low>>>t|this.high<<32-t;this.high=this.high>>>t|0}}},{key:"shiftLeft",value:function shiftLeft(t){if(t>=32){this.high=this.low<<t-32;this.low=0}else{this.high=this.high<<t|this.low>>>32-t;this.low<<=t}}},{key:"rotateRight",value:function rotateRight(t){var r,o;if(32&t){o=this.low;r=this.high}else{r=this.low;o=this.high}t&=31;this.low=r>>>t|o<<32-t;this.high=o>>>t|r<<32-t}},{key:"not",value:function not(){this.high=~this.high;this.low=~this.low}},{key:"add",value:function add(t){var r=(this.low>>>0)+(t.low>>>0),o=(this.high>>>0)+(t.high>>>0);r>4294967295&&(o+=1);this.low=0|r;this.high=0|o}},{key:"copyTo",value:function copyTo(t,r){t[r]=this.high>>>24&255;t[r+1]=this.high>>16&255;t[r+2]=this.high>>8&255;t[r+3]=255&this.high;t[r+4]=this.low>>>24&255;t[r+5]=this.low>>16&255;t[r+6]=this.low>>8&255;t[r+7]=255&this.low}},{key:"assign",value:function assign(t){this.high=t.high;this.low=t.low}}]);return Word64}(),m=function calculateSHA256Closure(){function rotr(t,r){return t>>>r|t<<32-r}function ch(t,r,o){return t&r^~t&o}function maj(t,r,o){return t&r^t&o^r&o}function sigma(t){return rotr(t,2)^rotr(t,13)^rotr(t,22)}function sigmaPrime(t){return rotr(t,6)^rotr(t,11)^rotr(t,25)}function littleSigma(t){return rotr(t,7)^rotr(t,18)^t>>>3}var t=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function hash(r,o,c){var l,u,h=1779033703,d=3144134277,g=1013904242,m=2773480762,y=1359893119,v=2600822924,k=528734635,_=1541459225,w=64*Math.ceil((c+9)/64),S=new Uint8Array(w);for(l=0;l<c;++l)S[l]=r[o++];S[l++]=128;for(var C=w-8;l<C;)S[l++]=0;S[l++]=0;S[l++]=0;S[l++]=0;S[l++]=c>>>29&255;S[l++]=c>>21&255;S[l++]=c>>13&255;S[l++]=c>>5&255;S[l++]=c<<3&255;var x,O=new Uint32Array(64);for(l=0;l<w;){for(u=0;u<16;++u){O[u]=S[l]<<24|S[l+1]<<16|S[l+2]<<8|S[l+3];l+=4}for(u=16;u<64;++u)O[u]=(rotr(x=O[u-2],17)^rotr(x,19)^x>>>10)+O[u-7]+littleSigma(O[u-15])+O[u-16]|0;var T=h,E=d,M=g,R=m,j=y,D=v,L=k,N=_,U=void 0,H=void 0;for(u=0;u<64;++u){U=N+sigmaPrime(j)+ch(j,D,L)+t[u]+O[u];H=sigma(T)+maj(T,E,M);N=L;L=D;D=j;j=R+U|0;R=M;M=E;E=T;T=U+H|0}h=h+T|0;d=d+E|0;g=g+M|0;m=m+R|0;y=y+j|0;v=v+D|0;k=k+L|0;_=_+N|0}return new Uint8Array([h>>24&255,h>>16&255,h>>8&255,255&h,d>>24&255,d>>16&255,d>>8&255,255&d,g>>24&255,g>>16&255,g>>8&255,255&g,m>>24&255,m>>16&255,m>>8&255,255&m,y>>24&255,y>>16&255,y>>8&255,255&y,v>>24&255,v>>16&255,v>>8&255,255&v,k>>24&255,k>>16&255,k>>8&255,255&k,_>>24&255,_>>16&255,_>>8&255,255&_])}}();r.calculateSHA256=m;var y=function calculateSHA512Closure(){function ch(t,r,o,c,l){t.assign(r);t.and(o);l.assign(r);l.not();l.and(c);t.xor(l)}function maj(t,r,o,c,l){t.assign(r);t.and(o);l.assign(r);l.and(c);t.xor(l);l.assign(o);l.and(c);t.xor(l)}function sigma(t,r,o){t.assign(r);t.rotateRight(28);o.assign(r);o.rotateRight(34);t.xor(o);o.assign(r);o.rotateRight(39);t.xor(o)}function sigmaPrime(t,r,o){t.assign(r);t.rotateRight(14);o.assign(r);o.rotateRight(18);t.xor(o);o.assign(r);o.rotateRight(41);t.xor(o)}function littleSigma(t,r,o){t.assign(r);t.rotateRight(1);o.assign(r);o.rotateRight(8);t.xor(o);o.assign(r);o.shiftRight(7);t.xor(o)}function littleSigmaPrime(t,r,o){t.assign(r);t.rotateRight(19);o.assign(r);o.rotateRight(61);t.xor(o);o.assign(r);o.shiftRight(6);t.xor(o)}var t=[new g(1116352408,3609767458),new g(1899447441,602891725),new g(3049323471,3964484399),new g(3921009573,2173295548),new g(961987163,4081628472),new g(1508970993,3053834265),new g(2453635748,2937671579),new g(2870763221,3664609560),new g(3624381080,2734883394),new g(310598401,1164996542),new g(607225278,1323610764),new g(1426881987,3590304994),new g(1925078388,4068182383),new g(2162078206,991336113),new g(2614888103,633803317),new g(3248222580,3479774868),new g(3835390401,2666613458),new g(4022224774,944711139),new g(264347078,2341262773),new g(604807628,2007800933),new g(770255983,1495990901),new g(1249150122,1856431235),new g(1555081692,3175218132),new g(1996064986,2198950837),new g(2554220882,3999719339),new g(2821834349,766784016),new g(2952996808,2566594879),new g(3210313671,3203337956),new g(3336571891,1034457026),new g(3584528711,2466948901),new g(113926993,3758326383),new g(338241895,168717936),new g(666307205,1188179964),new g(773529912,1546045734),new g(1294757372,1522805485),new g(1396182291,2643833823),new g(1695183700,2343527390),new g(1986661051,1014477480),new g(2177026350,1206759142),new g(2456956037,344077627),new g(2730485921,1290863460),new g(2820302411,3158454273),new g(3259730800,3505952657),new g(3345764771,106217008),new g(3516065817,3606008344),new g(3600352804,1432725776),new g(4094571909,1467031594),new g(275423344,851169720),new g(430227734,3100823752),new g(506948616,1363258195),new g(659060556,3750685593),new g(883997877,3785050280),new g(958139571,3318307427),new g(1322822218,3812723403),new g(1537002063,2003034995),new g(1747873779,3602036899),new g(1955562222,1575990012),new g(2024104815,1125592928),new g(2227730452,2716904306),new g(2361852424,442776044),new g(2428436474,593698344),new g(2756734187,3733110249),new g(3204031479,2999351573),new g(3329325298,3815920427),new g(3391569614,3928383900),new g(3515267271,566280711),new g(3940187606,3454069534),new g(4118630271,4000239992),new g(116418474,1914138554),new g(174292421,2731055270),new g(289380356,3203993006),new g(460393269,320620315),new g(685471733,587496836),new g(852142971,1086792851),new g(1017036298,365543100),new g(1126000580,2618297676),new g(1288033470,3409855158),new g(1501505948,4234509866),new g(1607167915,987167468),new g(1816402316,1246189591)];return function hash(r,o,c){var l,u,h,d,m,y,v,k,_=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(_){l=new g(3418070365,3238371032);u=new g(1654270250,914150663);h=new g(2438529370,812702999);d=new g(355462360,4144912697);m=new g(1731405415,4290775857);y=new g(2394180231,1750603025);v=new g(3675008525,1694076839);k=new g(1203062813,3204075428)}else{l=new g(1779033703,4089235720);u=new g(3144134277,2227873595);h=new g(1013904242,4271175723);d=new g(2773480762,1595750129);m=new g(1359893119,2917565137);y=new g(2600822924,725511199);v=new g(528734635,4215389547);k=new g(1541459225,327033209)}var w,S,C=128*Math.ceil((c+17)/128),x=new Uint8Array(C);for(w=0;w<c;++w)x[w]=r[o++];x[w++]=128;for(var O=C-16;w<O;)x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=0;x[w++]=c>>>29&255;x[w++]=c>>21&255;x[w++]=c>>13&255;x[w++]=c>>5&255;x[w++]=c<<3&255;var T=new Array(80);for(w=0;w<80;w++)T[w]=new g(0,0);var E,M,R=new g(0,0),j=new g(0,0),D=new g(0,0),L=new g(0,0),N=new g(0,0),U=new g(0,0),H=new g(0,0),$=new g(0,0),X=new g(0,0),q=new g(0,0),G=new g(0,0),z=new g(0,0);for(w=0;w<C;){for(S=0;S<16;++S){T[S].high=x[w]<<24|x[w+1]<<16|x[w+2]<<8|x[w+3];T[S].low=x[w+4]<<24|x[w+5]<<16|x[w+6]<<8|x[w+7];w+=8}for(S=16;S<80;++S){littleSigmaPrime(E=T[S],T[S-2],z);E.add(T[S-7]);littleSigma(G,T[S-15],z);E.add(G);E.add(T[S-16])}R.assign(l);j.assign(u);D.assign(h);L.assign(d);N.assign(m);U.assign(y);H.assign(v);$.assign(k);for(S=0;S<80;++S){X.assign($);sigmaPrime(G,N,z);X.add(G);ch(G,N,U,H,z);X.add(G);X.add(t[S]);X.add(T[S]);sigma(q,R,z);maj(G,R,j,D,z);q.add(G);E=$;$=H;H=U;U=N;L.add(X);N=L;L=D;D=j;j=R;E.assign(X);E.add(q);R=E}l.add(R);u.add(j);h.add(D);d.add(L);m.add(N);y.add(U);v.add(H);k.add($)}if(_){M=new Uint8Array(48);l.copyTo(M,0);u.copyTo(M,8);h.copyTo(M,16);d.copyTo(M,24);m.copyTo(M,32);y.copyTo(M,40)}else{M=new Uint8Array(64);l.copyTo(M,0);u.copyTo(M,8);h.copyTo(M,16);d.copyTo(M,24);m.copyTo(M,32);y.copyTo(M,40);v.copyTo(M,48);k.copyTo(M,56)}return M}}();r.calculateSHA512=y;function calculateSHA384(t,r,o){return y(t,r,o,!0)}var v=function(){function NullCipher(){_classCallCheck(this,NullCipher)}_createClass(NullCipher,[{key:"decryptBlock",value:function decryptBlock(t){return t}},{key:"encrypt",value:function encrypt(t){return t}}]);return NullCipher}(),k=function(){function AESBaseCipher(){_classCallCheck(this,AESBaseCipher);this.constructor===AESBaseCipher&&(0,c.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);this._inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);this._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);this._mixCol=new Uint8Array(256);for(var t=0;t<256;t++)this._mixCol[t]=t<128?t<<1:t<<1^27;this.buffer=new Uint8Array(16);this.bufferPosition=0}_createClass(AESBaseCipher,[{key:"_expandKey",value:function _expandKey(t){(0,c.unreachable)("Cannot call `_expandKey` on the base class")}},{key:"_decrypt",value:function _decrypt(t,r){var o,c,l,u=new Uint8Array(16);u.set(t);for(var h=0,d=this._keySize;h<16;++h,++d)u[h]^=r[d];for(var g=this._cyclesOfRepetition-1;g>=1;--g){o=u[13];u[13]=u[9];u[9]=u[5];u[5]=u[1];u[1]=o;o=u[14];c=u[10];u[14]=u[6];u[10]=u[2];u[6]=o;u[2]=c;o=u[15];c=u[11];l=u[7];u[15]=u[3];u[11]=o;u[7]=c;u[3]=l;for(var m=0;m<16;++m)u[m]=this._inv_s[u[m]];for(var y=0,v=16*g;y<16;++y,++v)u[y]^=r[v];for(var k=0;k<16;k+=4){var _=this._mix[u[k]],w=this._mix[u[k+1]],S=this._mix[u[k+2]],C=this._mix[u[k+3]];o=_^w>>>8^w<<24^S>>>16^S<<16^C>>>24^C<<8;u[k]=o>>>24&255;u[k+1]=o>>16&255;u[k+2]=o>>8&255;u[k+3]=255&o}}o=u[13];u[13]=u[9];u[9]=u[5];u[5]=u[1];u[1]=o;o=u[14];c=u[10];u[14]=u[6];u[10]=u[2];u[6]=o;u[2]=c;o=u[15];c=u[11];l=u[7];u[15]=u[3];u[11]=o;u[7]=c;u[3]=l;for(var x=0;x<16;++x){u[x]=this._inv_s[u[x]];u[x]^=r[x]}return u}},{key:"_encrypt",value:function _encrypt(t,r){var o,c,l,u=this._s,h=new Uint8Array(16);h.set(t);for(var d=0;d<16;++d)h[d]^=r[d];for(var g=1;g<this._cyclesOfRepetition;g++){for(var m=0;m<16;++m)h[m]=u[h[m]];l=h[1];h[1]=h[5];h[5]=h[9];h[9]=h[13];h[13]=l;l=h[2];c=h[6];h[2]=h[10];h[6]=h[14];h[10]=l;h[14]=c;l=h[3];c=h[7];o=h[11];h[3]=h[15];h[7]=l;h[11]=c;h[15]=o;for(var y=0;y<16;y+=4){var v=h[y+0],k=h[y+1],_=h[y+2],w=h[y+3];o=v^k^_^w;h[y+0]^=o^this._mixCol[v^k];h[y+1]^=o^this._mixCol[k^_];h[y+2]^=o^this._mixCol[_^w];h[y+3]^=o^this._mixCol[w^v]}for(var S=0,C=16*g;S<16;++S,++C)h[S]^=r[C]}for(var x=0;x<16;++x)h[x]=u[h[x]];l=h[1];h[1]=h[5];h[5]=h[9];h[9]=h[13];h[13]=l;l=h[2];c=h[6];h[2]=h[10];h[6]=h[14];h[10]=l;h[14]=c;l=h[3];c=h[7];o=h[11];h[3]=h[15];h[7]=l;h[11]=c;h[15]=o;for(var O=0,T=this._keySize;O<16;++O,++T)h[O]^=r[T];return h}},{key:"_decryptBlock2",value:function _decryptBlock2(t,r){for(var o=t.length,c=this.buffer,l=this.bufferPosition,u=[],h=this.iv,d=0;d<o;++d){c[l]=t[d];if(!(++l<16)){for(var g=this._decrypt(c,this._key),m=0;m<16;++m)g[m]^=h[m];h=c;u.push(g);c=new Uint8Array(16);l=0}}this.buffer=c;this.bufferLength=l;this.iv=h;if(0===u.length)return new Uint8Array(0);var y=16*u.length;if(r){var v=u[u.length-1],k=v[15];if(k<=16){for(var _=15,w=16-k;_>=w;--_)if(v[_]!==k){k=0;break}y-=k;u[u.length-1]=v.subarray(0,16-k)}}for(var S=new Uint8Array(y),C=0,x=0,O=u.length;C<O;++C,x+=16)S.set(u[C],x);return S}},{key:"decryptBlock",value:function decryptBlock(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,c=t.length,l=this.buffer,u=this.bufferPosition;if(o)this.iv=o;else{for(var h=0;u<16&&h<c;++h,++u)l[u]=t[h];if(u<16){this.bufferLength=u;return new Uint8Array(0)}this.iv=l;t=t.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(t,r)}},{key:"encrypt",value:function encrypt(t,r){var o=t.length,c=this.buffer,l=this.bufferPosition,u=[];r||(r=new Uint8Array(16));for(var h=0;h<o;++h){c[l]=t[h];if(!(++l<16)){for(var d=0;d<16;++d)c[d]^=r[d];var g=this._encrypt(c,this._key);r=g;u.push(g);c=new Uint8Array(16);l=0}}this.buffer=c;this.bufferLength=l;this.iv=r;if(0===u.length)return new Uint8Array(0);for(var m=16*u.length,y=new Uint8Array(m),v=0,k=0,_=u.length;v<_;++v,k+=16)y.set(u[v],k);return y}}]);return AESBaseCipher}(),_=function(t){_inherits(AES128Cipher,t);var r=_createSuper(AES128Cipher);function AES128Cipher(t){var o;_classCallCheck(this,AES128Cipher);(o=r.call(this))._cyclesOfRepetition=10;o._keySize=160;o._rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);o._key=o._expandKey(t);return o}_createClass(AES128Cipher,[{key:"_expandKey",value:function _expandKey(t){var r=this._s,o=this._rcon,c=new Uint8Array(176);c.set(t);for(var l=16,u=1;l<176;++u){var h=c[l-3],d=c[l-2],g=c[l-1],m=c[l-4];h=r[h];d=r[d];g=r[g];m=r[m];h^=o[u];for(var y=0;y<4;++y){c[l]=h^=c[l-16];c[++l]=d^=c[l-16];c[++l]=g^=c[l-16];c[++l]=m^=c[l-16];l++}}return c}}]);return AES128Cipher}(k);r.AES128Cipher=_;var w=function(t){_inherits(AES256Cipher,t);var r=_createSuper(AES256Cipher);function AES256Cipher(t){var o;_classCallCheck(this,AES256Cipher);(o=r.call(this))._cyclesOfRepetition=14;o._keySize=224;o._key=o._expandKey(t);return o}_createClass(AES256Cipher,[{key:"_expandKey",value:function _expandKey(t){var r=this._s,o=new Uint8Array(240);o.set(t);for(var c,l,u,h,d=1,g=32,m=1;g<240;++m){if(g%32==16){c=r[c];l=r[l];u=r[u];h=r[h]}else if(g%32==0){c=o[g-3];l=o[g-2];u=o[g-1];h=o[g-4];c=r[c];l=r[l];u=r[u];h=r[h];c^=d;(d<<=1)>=256&&(d=255&(27^d))}for(var y=0;y<4;++y){o[g]=c^=o[g-32];o[++g]=l^=o[g-32];o[++g]=u^=o[g-32];o[++g]=h^=o[g-32];g++}}return o}}]);return AES256Cipher}(k);r.AES256Cipher=w;var S=function(){function PDF17(){_classCallCheck(this,PDF17)}_createClass(PDF17,[{key:"checkOwnerPassword",value:function checkOwnerPassword(t,r,o,l){var u=new Uint8Array(t.length+56);u.set(t,0);u.set(r,t.length);u.set(o,t.length+r.length);var h=m(u,0,u.length);return(0,c.isArrayEqual)(h,l)}},{key:"checkUserPassword",value:function checkUserPassword(t,r,o){var l=new Uint8Array(t.length+8);l.set(t,0);l.set(r,t.length);var u=m(l,0,l.length);return(0,c.isArrayEqual)(u,o)}},{key:"getOwnerKey",value:function getOwnerKey(t,r,o,c){var l=new Uint8Array(t.length+56);l.set(t,0);l.set(r,t.length);l.set(o,t.length+r.length);var u=m(l,0,l.length);return new w(u).decryptBlock(c,!1,new Uint8Array(16))}},{key:"getUserKey",value:function getUserKey(t,r,o){var c=new Uint8Array(t.length+8);c.set(t,0);c.set(r,t.length);var l=m(c,0,c.length);return new w(l).decryptBlock(o,!1,new Uint8Array(16))}}]);return PDF17}();r.PDF17=S;var C=function PDF20Closure(){function calculatePDF20Hash(t,r,o){for(var c=m(r,0,r.length).subarray(0,32),l=[0],u=0;u<64||l[l.length-1]>u-32;){var h=t.length+c.length+o.length,d=new Uint8Array(h),g=0;d.set(t,g);g+=t.length;d.set(c,g);g+=c.length;d.set(o,g);for(var v=new Uint8Array(64*h),k=0,w=0;k<64;k++,w+=h)v.set(d,w);l=new _(c.subarray(0,16)).encrypt(v,c.subarray(16,32));for(var S=0,C=0;C<16;C++){S*=1;S%=3;S+=(l[C]>>>0)%3;S%=3}0===S?c=m(l,0,l.length):1===S?c=calculateSHA384(l,0,l.length):2===S&&(c=y(l,0,l.length));u++}return c.subarray(0,32)}return function(){function PDF20(){_classCallCheck(this,PDF20)}_createClass(PDF20,[{key:"hash",value:function hash(t,r,o){return calculatePDF20Hash(t,r,o)}},{key:"checkOwnerPassword",value:function checkOwnerPassword(t,r,o,l){var u=new Uint8Array(t.length+56);u.set(t,0);u.set(r,t.length);u.set(o,t.length+r.length);var h=calculatePDF20Hash(t,u,o);return(0,c.isArrayEqual)(h,l)}},{key:"checkUserPassword",value:function checkUserPassword(t,r,o){var l=new Uint8Array(t.length+8);l.set(t,0);l.set(r,t.length);var u=calculatePDF20Hash(t,l,[]);return(0,c.isArrayEqual)(u,o)}},{key:"getOwnerKey",value:function getOwnerKey(t,r,o,c){var l=new Uint8Array(t.length+56);l.set(t,0);l.set(r,t.length);l.set(o,t.length+r.length);var u=calculatePDF20Hash(t,l,o);return new w(u).decryptBlock(c,!1,new Uint8Array(16))}},{key:"getUserKey",value:function getUserKey(t,r,o){var c=new Uint8Array(t.length+8);c.set(t,0);c.set(r,t.length);var l=calculatePDF20Hash(t,c,[]);return new w(l).decryptBlock(o,!1,new Uint8Array(16))}}]);return PDF20}()}();r.PDF20=C;var x=function(){function CipherTransform(t,r){_classCallCheck(this,CipherTransform);this.StringCipherConstructor=t;this.StreamCipherConstructor=r}_createClass(CipherTransform,[{key:"createStream",value:function createStream(t,r){var o=new this.StreamCipherConstructor;return new u.DecryptStream(t,r,(function cipherTransformDecryptStream(t,r){return o.decryptBlock(t,r)}))}},{key:"decryptString",value:function decryptString(t){var r=new this.StringCipherConstructor,o=(0,c.stringToBytes)(t);o=r.decryptBlock(o,!0);return(0,c.bytesToString)(o)}},{key:"encryptString",value:function encryptString(t){var r=new this.StringCipherConstructor;if(r instanceof k){var o=16-t.length%16;t+=String.fromCharCode(o).repeat(o);var l=new Uint8Array(16);if("undefined"!=typeof crypto)crypto.getRandomValues(l);else for(var u=0;u<16;u++)l[u]=Math.floor(256*Math.random());var h=(0,c.stringToBytes)(t);h=r.encrypt(h,l);var d=new Uint8Array(16+h.length);d.set(l);d.set(h,16);return(0,c.bytesToString)(d)}var g=(0,c.stringToBytes)(t);g=r.encrypt(g);return(0,c.bytesToString)(g)}}]);return CipherTransform}(),O=function CipherTransformFactoryClosure(){var t=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]);function prepareKeyData(r,o,c,l,u,g,m,y){var v,k,_=40+c.length+r.length,w=new Uint8Array(_),S=0;if(o){k=Math.min(32,o.length);for(;S<k;++S)w[S]=o[S]}v=0;for(;S<32;)w[S++]=t[v++];for(v=0,k=c.length;v<k;++v)w[S++]=c[v];w[S++]=255&u;w[S++]=u>>8&255;w[S++]=u>>16&255;w[S++]=u>>>24&255;for(v=0,k=r.length;v<k;++v)w[S++]=r[v];if(g>=4&&!y){w[S++]=255;w[S++]=255;w[S++]=255;w[S++]=255}var C=d(w,0,S),x=m>>3;if(g>=3)for(v=0;v<50;++v)C=d(C,0,x);var O,T=C.subarray(0,x);if(g>=3){for(S=0;S<32;++S)w[S]=t[S];for(v=0,k=r.length;v<k;++v)w[S++]=r[v];O=new h(T).encryptBlock(d(w,0,S));k=T.length;var E=new Uint8Array(k);for(v=1;v<=19;++v){for(var M=0;M<k;++M)E[M]=T[M]^v;O=new h(E).encryptBlock(O)}for(v=0,k=O.length;v<k;++v)if(l[v]!==O[v])return null}else for(v=0,k=(O=new h(T).encryptBlock(t)).length;v<k;++v)if(l[v]!==O[v])return null;return T}var r=l.Name.get("Identity");function buildObjectKey(t,r,o){var c,l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],u=new Uint8Array(o.length+9),h=o.length;for(c=0;c<h;++c)u[c]=o[c];u[c++]=255&t;u[c++]=t>>8&255;u[c++]=t>>16&255;u[c++]=255&r;u[c++]=r>>8&255;if(l){u[c++]=115;u[c++]=65;u[c++]=108;u[c++]=84}var g=d(u,0,c);return g.subarray(0,Math.min(o.length+5,16))}function buildCipherConstructor(t,r,o,u,d){if(!(r instanceof l.Name))throw new c.FormatError("Invalid crypt filter name.");var g,m=t.get(r.name);null!=m&&(g=m.get("CFM"));if(!g||"None"===g.name)return function cipherTransformFactoryBuildCipherConstructorNone(){return new v};if("V2"===g.name)return function cipherTransformFactoryBuildCipherConstructorV2(){return new h(buildObjectKey(o,u,d,!1))};if("AESV2"===g.name)return function cipherTransformFactoryBuildCipherConstructorAESV2(){return new _(buildObjectKey(o,u,d,!0))};if("AESV3"===g.name)return function cipherTransformFactoryBuildCipherConstructorAESV3(){return new w(d)};throw new c.FormatError("Unknown crypto method")}return function(){function CipherTransformFactory(o,u,g){_classCallCheck(this,CipherTransformFactory);var m=o.get("Filter");if(!(0,l.isName)(m,"Standard"))throw new c.FormatError("unknown encryption method");this.filterName=m.name;this.dict=o;var y=o.get("V");if(!Number.isInteger(y)||1!==y&&2!==y&&4!==y&&5!==y)throw new c.FormatError("unsupported encryption algorithm");this.algorithm=y;var v=o.get("Length");if(!v)if(y<=3)v=40;else{var k=o.get("CF"),_=o.get("StmF");if(k instanceof l.Dict&&_ instanceof l.Name){k.suppressEncryption=!0;var w=k.get(_.name);(v=w&&w.get("Length")||128)<40&&(v<<=3)}}if(!Number.isInteger(v)||v<40||v%8!=0)throw new c.FormatError("invalid key length");var x=(0,c.stringToBytes)(o.get("O")).subarray(0,32),O=(0,c.stringToBytes)(o.get("U")).subarray(0,32),T=o.get("P"),E=o.get("R"),M=(4===y||5===y)&&!1!==o.get("EncryptMetadata");this.encryptMetadata=M;var R,j,D=(0,c.stringToBytes)(u);if(g){if(6===E)try{g=(0,c.utf8StringToString)(g)}catch(t){(0,c.warn)("CipherTransformFactory: Unable to convert UTF8 encoded password.")}R=(0,c.stringToBytes)(g)}if(5!==y)j=prepareKeyData(D,R,x,O,T,E,v,M);else{var L=(0,c.stringToBytes)(o.get("O")).subarray(32,40),N=(0,c.stringToBytes)(o.get("O")).subarray(40,48),U=(0,c.stringToBytes)(o.get("U")).subarray(0,48),H=(0,c.stringToBytes)(o.get("U")).subarray(32,40),$=(0,c.stringToBytes)(o.get("U")).subarray(40,48),X=(0,c.stringToBytes)(o.get("OE")),q=(0,c.stringToBytes)(o.get("UE"));(0,c.stringToBytes)(o.get("Perms"));j=function createEncryptionKey20(t,r,o,c,l,u,h,d,g,m,y,v){if(r){var k=Math.min(127,r.length);r=r.subarray(0,k)}else r=[];var _;return(_=6===t?new C:new S).checkUserPassword(r,d,h)?_.getUserKey(r,g,y):r.length&&_.checkOwnerPassword(r,c,u,o)?_.getOwnerKey(r,l,u,m):null}(E,R,x,L,N,U,O,H,$,X,q)}if(!j&&!g)throw new c.PasswordException("No password given",c.PasswordResponses.NEED_PASSWORD);if(!j&&g){var G=function decodeUserPassword(r,o,c,l){for(var u=new Uint8Array(32),g=0,m=Math.min(32,r.length);g<m;++g)u[g]=r[g];for(var y=0;g<32;)u[g++]=t[y++];var v,k=d(u,0,g),_=l>>3;if(c>=3)for(y=0;y<50;++y)k=d(k,0,k.length);if(c>=3){v=o;var w=new Uint8Array(_);for(y=19;y>=0;y--){for(var S=0;S<_;++S)w[S]=k[S]^y;v=new h(w).encryptBlock(v)}}else v=new h(k.subarray(0,_)).encryptBlock(o);return v}(R,x,E,v);j=prepareKeyData(D,G,x,O,T,E,v,M)}if(!j)throw new c.PasswordException("Incorrect Password",c.PasswordResponses.INCORRECT_PASSWORD);this.encryptionKey=j;if(y>=4){var z=o.get("CF");z instanceof l.Dict&&(z.suppressEncryption=!0);this.cf=z;this.stmf=o.get("StmF")||r;this.strf=o.get("StrF")||r;this.eff=o.get("EFF")||this.stmf}}_createClass(CipherTransformFactory,[{key:"createCipherTransform",value:function createCipherTransform(t,r){if(4===this.algorithm||5===this.algorithm)return new x(buildCipherConstructor(this.cf,this.stmf,t,r,this.encryptionKey),buildCipherConstructor(this.cf,this.strf,t,r,this.encryptionKey));var o=buildObjectKey(t,r,this.encryptionKey,!1),c=function buildCipherCipherConstructor(){return new h(o)};return new x(c,c)}}]);return CipherTransformFactory}()}();r.CipherTransformFactory=O},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.DecryptStream=void 0;var c=o(170);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var l=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(DecryptStream,t);var r=_createSuper(DecryptStream);function DecryptStream(t,o,c){var l;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,DecryptStream);(l=r.call(this,o)).str=t;l.dict=t.dict;l.decrypt=c;l.nextChunk=null;l.initialized=!1;return l}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(DecryptStream,[{key:"readBlock",value:function readBlock(){var t;if(this.initialized)t=this.nextChunk;else{t=this.str.getBytes(512);this.initialized=!0}if(t&&0!==t.length){this.nextChunk=this.str.getBytes(512);var r=this.nextChunk&&this.nextChunk.length>0;t=(0,this.decrypt)(t,!r);for(var o=this.bufferLength,c=t.length,l=this.ensureBuffer(o+c),u=0;u<c;u++)l[o++]=t[u];this.bufferLength=o}else this.eof=!0}}]);return DecryptStream}(c.DecodeStream);r.DecryptStream=l},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.XFAFactory=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(217),u=o(221),h=o(227),d=o(225),g=o(218),m=o(4),y=o(228),v=o(238);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var k=function(){function XFAFactory(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XFAFactory);try{this.root=(new y.XFAParser).parse(XFAFactory._createDocument(t));var r=new u.Binder(this.root);this.form=r.bind();this.dataHandler=new h.DataHandler(this.root,r.getData());this.form[l.$globalData].template=this.form}catch(t){(0,m.warn)("XFA - an error occurred during parsing and binding: ".concat(t))}}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(XFAFactory,[{key:"isValid",value:function isValid(){return this.root&&this.form}},{key:"_createPagesHelper",value:function _createPagesHelper(){var t=this.form[l.$toPages]();return new Promise((function(r,o){setTimeout((function nextIteration(){try{var c=t.next();c.done?r(c.value):setTimeout(nextIteration,0)}catch(t){o(t)}}),0)}))}},{key:"_createPages",value:(o=_asyncToGenerator(c.default.mark((function _callee(){return c.default.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0;t.next=3;return this._createPagesHelper();case 3:this.pages=t.sent;this.dims=this.pages.children.map((function(t){var r=t.attributes.style,o=r.width,c=r.height;return[0,0,parseInt(o),parseInt(c)]}));t.next=10;break;case 7:t.prev=7;t.t0=t.catch(0);(0,m.warn)("XFA - an error occurred during layout: ".concat(t.t0));case 10:case"end":return t.stop()}}),_callee,this,[[0,7]])}))),function _createPages(){return o.apply(this,arguments)})},{key:"getBoundingBox",value:function getBoundingBox(t){return this.dims[t]}},{key:"getNumPages",value:(r=_asyncToGenerator(c.default.mark((function _callee2(){return c.default.wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:if(this.pages){t.next=3;break}t.next=3;return this._createPages();case 3:return t.abrupt("return",this.dims.length);case 4:case"end":return t.stop()}}),_callee2,this)}))),function getNumPages(){return r.apply(this,arguments)})},{key:"setImages",value:function setImages(t){this.form[l.$globalData].images=t}},{key:"setFonts",value:function setFonts(t){this.form[l.$globalData].fontFinder=new d.FontFinder(t);var r,o=[],c=_createForOfIteratorHelper(this.form[l.$globalData].usedTypefaces);try{for(c.s();!(r=c.n()).done;){var u=r.value;u=(0,g.stripQuotes)(u);this.form[l.$globalData].fontFinder.find(u)||o.push(u)}}catch(t){c.e(t)}finally{c.f()}return o.length>0?o:null}},{key:"appendFonts",value:function appendFonts(t,r){this.form[l.$globalData].fontFinder.add(t,r)}},{key:"getPages",value:(t=_asyncToGenerator(c.default.mark((function _callee3(){var t;return c.default.wrap((function _callee3$(r){for(;;)switch(r.prev=r.next){case 0:if(this.pages){r.next=3;break}r.next=3;return this._createPages();case 3:t=this.pages;this.pages=null;return r.abrupt("return",t);case 6:case"end":return r.stop()}}),_callee3,this)}))),function getPages(){return t.apply(this,arguments)})},{key:"serializeData",value:function serializeData(t){return this.dataHandler.serialize(t)}}],[{key:"_createDocument",value:function _createDocument(t){return t["/xdp:xdp"]?Object.values(t).join(""):t["xdp:xdp"]}},{key:"getRichTextAsHtml",value:function getRichTextAsHtml(t){if(!t||"string"!=typeof t)return null;try{var r=new y.XFAParser(v.XhtmlNamespace,!0).parse(t);if(!["body","xhtml"].includes(r[l.$nodeName])){var o=v.XhtmlNamespace.body({});o[l.$appendChild](r);r=o}var c=r[l.$toHTML]();if(!c.success)return null;var u=c.html,h=u.attributes;if(h){h.class&&(h.class=h.class.filter((function(t){return!t.startsWith("xfa")})));h.dir="auto"}return{html:u,str:r[l.$text]()}}catch(t){(0,m.warn)("XFA - an error occurred during parsing of rich text: ".concat(t))}return null}}]);var t,r,o;return XFAFactory}();r.XFAFactory=k},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.XmlObject=r.XFAObjectArray=r.XFAObject=r.XFAAttribute=r.StringObject=r.OptionObject=r.Option10=r.Option01=r.IntegerObject=r.ContentObject=r.$uid=r.$toStyle=r.$toString=r.$toPages=r.$toHTML=r.$text=r.$tabIndex=r.$setValue=r.$setSetAttributes=r.$setId=r.$searchNode=r.$root=r.$resolvePrototypes=r.$removeChild=r.$pushPara=r.$pushGlyphs=r.$popPara=r.$onText=r.$onChildCheck=r.$onChild=r.$nsAttributes=r.$nodeName=r.$namespaceId=r.$isUsable=r.$isTransparent=r.$isThereMoreWidth=r.$isSplittable=r.$isNsAgnostic=r.$isDescendent=r.$isDataValue=r.$isCDATAXml=r.$isBindable=r.$insertAt=r.$indexOf=r.$ids=r.$hasSettableValue=r.$globalData=r.$getTemplateRoot=r.$getSubformParent=r.$getRealChildrenByNameIt=r.$getParent=r.$getNextPage=r.$getExtra=r.$getDataValue=r.$getContainedChildren=r.$getChildrenByNameIt=r.$getChildrenByName=r.$getChildrenByClass=r.$getChildren=r.$getAvailableSpace=r.$getAttributes=r.$getAttributeIt=r.$flushHTML=r.$finalize=r.$extra=r.$dump=r.$data=r.$content=r.$consumed=r.$clone=r.$cleanup=r.$cleanPage=r.$clean=r.$childrenToHTML=r.$appendChild=r.$addHTML=r.$acceptWhitespace=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(218),u=o(4),h=o(149),d=o(219),g=o(220);function _get(){_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,o){var c=_superPropBase(t,r);if(c){var l=Object.getOwnPropertyDescriptor(c,r);return l.get?l.get.call(arguments.length<3?t:o):l.value}};return _get.apply(this,arguments)}function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var m=Symbol();r.$acceptWhitespace=m;var y=Symbol();r.$addHTML=y;var v=Symbol();r.$appendChild=v;var k=Symbol();r.$childrenToHTML=k;var _=Symbol();r.$clean=_;var w=Symbol();r.$cleanPage=w;var S=Symbol();r.$cleanup=S;var C=Symbol();r.$clone=C;var x=Symbol();r.$consumed=x;var O=Symbol("content");r.$content=O;var T=Symbol("data");r.$data=T;var E=Symbol();r.$dump=E;var M=Symbol("extra");r.$extra=M;var R=Symbol();r.$finalize=R;var j=Symbol();r.$flushHTML=j;var D=Symbol();r.$getAttributeIt=D;var L=Symbol();r.$getAttributes=L;var N=Symbol();r.$getAvailableSpace=N;var U=Symbol();r.$getChildrenByClass=U;var H=Symbol();r.$getChildrenByName=H;var $=Symbol();r.$getChildrenByNameIt=$;var X=Symbol();r.$getDataValue=X;var q=Symbol();r.$getExtra=q;var G=Symbol();r.$getRealChildrenByNameIt=G;var z=Symbol();r.$getChildren=z;var W=Symbol();r.$getContainedChildren=W;var V=Symbol();r.$getNextPage=V;var K=Symbol();r.$getSubformParent=K;var Y=Symbol();r.$getParent=Y;var J=Symbol();r.$getTemplateRoot=J;var Z=Symbol();r.$globalData=Z;var Q=Symbol();r.$hasSettableValue=Q;var ee=Symbol();r.$ids=ee;var te=Symbol();r.$indexOf=te;var re=Symbol();r.$insertAt=re;var ae=Symbol();r.$isCDATAXml=ae;var ne=Symbol();r.$isBindable=ne;var ie=Symbol();r.$isDataValue=ie;var oe=Symbol();r.$isDescendent=oe;var se=Symbol();r.$isNsAgnostic=se;var ce=Symbol();r.$isSplittable=ce;var le=Symbol();r.$isThereMoreWidth=le;var ue=Symbol();r.$isTransparent=ue;var fe=Symbol();r.$isUsable=fe;var he=Symbol(),de=Symbol("namespaceId");r.$namespaceId=de;var pe=Symbol("nodeName");r.$nodeName=pe;var ge=Symbol();r.$nsAttributes=ge;var me=Symbol();r.$onChild=me;var ye=Symbol();r.$onChildCheck=ye;var ve=Symbol();r.$onText=ve;var be=Symbol();r.$pushGlyphs=be;var ke=Symbol();r.$popPara=ke;var _e=Symbol();r.$pushPara=_e;var we=Symbol();r.$removeChild=we;var Se=Symbol("root");r.$root=Se;var Ce=Symbol();r.$resolvePrototypes=Ce;var xe=Symbol();r.$searchNode=xe;var Oe=Symbol();r.$setId=Oe;var Ae=Symbol();r.$setSetAttributes=Ae;var Pe=Symbol();r.$setValue=Pe;var Te=Symbol();r.$tabIndex=Te;var Fe=Symbol();r.$text=Fe;var Ie=Symbol();r.$toPages=Ie;var Ee=Symbol();r.$toHTML=Ee;var Me=Symbol();r.$toString=Me;var Re=Symbol();r.$toStyle=Re;var je=Symbol("uid");r.$uid=je;var De=Symbol(),Be=Symbol(),Le=Symbol(),Ne=Symbol("_children"),Ue=Symbol(),He=Symbol(),$e=Symbol(),Xe=Symbol(),qe=Symbol(),Ge=Symbol(),ze=Symbol(),We=Symbol(),Ve=Symbol(),Ke=Symbol("parent"),Ye=Symbol(),Je=Symbol(),Ze=Symbol(),Qe=0,et=d.NamespaceIds.datasets.id,tt=function(){function XFAObject(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,XFAObject);this[de]=t;this[pe]=r;this[ze]=o;this[Ke]=null;this[Ne]=[];this[je]="".concat(r).concat(Qe++);this[Z]=null}_createClass(XFAObject,[{key:me,value:function value(t){if(!this[ze]||!this[ye](t))return!1;var r=t[pe],o=this[r];if(!(o instanceof rt)){null!==o&&this[we](o);this[r]=t;this[v](t);return!0}if(o.push(t)){this[v](t);return!0}var c="";this.id?c=" (id: ".concat(this.id,")"):this.name&&(c=" (name: ".concat(this.name," ").concat(this.h.value,")"));(0,u.warn)('XFA - node "'.concat(this[pe],'"').concat(c,' has already enough "').concat(r,'"!'));return!1}},{key:ye,value:function value(t){return this.hasOwnProperty(t[pe])&&t[de]===this[de]}},{key:se,value:function value(){return!1}},{key:m,value:function value(){return!1}},{key:ae,value:function value(){return!1}},{key:ne,value:function value(){return!1}},{key:ke,value:function value(){this.para&&this[J]()[M].paraStack.pop()}},{key:_e,value:function value(){this[J]()[M].paraStack.push(this.para)}},{key:Oe,value:function value(t){this.id&&this[de]===d.NamespaceIds.template.id&&t.set(this.id,this)}},{key:J,value:function value(){return this[Z].template}},{key:ce,value:function value(){return!1}},{key:le,value:function value(){return!1}},{key:v,value:function value(t){t[Ke]=this;this[Ne].push(t);!t[Z]&&this[Z]&&(t[Z]=this[Z])}},{key:we,value:function value(t){var r=this[Ne].indexOf(t);this[Ne].splice(r,1)}},{key:Q,value:function value(){return this.hasOwnProperty("value")}},{key:Pe,value:function value(t){}},{key:ve,value:function value(t){}},{key:R,value:function value(){}},{key:_,value:function value(t){delete this[ze];if(this[S]){t.clean(this[S]);delete this[S]}}},{key:te,value:function value(t){return this[Ne].indexOf(t)}},{key:re,value:function value(t,r){r[Ke]=this;this[Ne].splice(t,0,r);!r[Z]&&this[Z]&&(r[Z]=this[Z])}},{key:ue,value:function value(){return!this.name}},{key:he,value:function value(){return""}},{key:Fe,value:function value(){return 0===this[Ne].length?this[O]:this[Ne].map((function(t){return t[Fe]()})).join("")}},{key:Le,get:function get(){var t=Object.getPrototypeOf(this);if(!t._attributes){var r,o=t._attributes=new Set,c=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(c.s();!(r=c.n()).done;){var l=r.value;if(null===this[l]||this[l]instanceof XFAObject||this[l]instanceof rt)break;o.add(l)}}catch(t){c.e(t)}finally{c.f()}}return(0,u.shadow)(this,Le,t._attributes)}},{key:oe,value:function value(t){for(var r=this;r;){if(r===t)return!0;r=r[Y]()}return!1}},{key:Y,value:function value(){return this[Ke]}},{key:K,value:function value(){return this[Y]()}},{key:z,value:function value(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t?this[t]:this[Ne]}},{key:E,value:function value(){var t=Object.create(null);this[O]&&(t.$content=this[O]);var r,o=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(o.s();!(r=o.n()).done;){var c=r.value,value=this[c];null!==value&&(value instanceof XFAObject?t[c]=value[E]():value instanceof rt?value.isEmpty()||(t[c]=value.dump()):t[c]=value)}}catch(t){o.e(t)}finally{o.f()}return t}},{key:Re,value:function value(){return null}},{key:Ee,value:function value(){return l.HTMLResult.EMPTY}},{key:W,value:c.default.mark((function value(){var t,r,o;return c.default.wrap((function value$(c){for(;;)switch(c.prev=c.next){case 0:t=_createForOfIteratorHelper(this[z]());c.prev=1;t.s();case 3:if((r=t.n()).done){c.next=9;break}o=r.value;c.next=7;return o;case 7:c.next=3;break;case 9:c.next=14;break;case 11:c.prev=11;c.t0=c.catch(1);t.e(c.t0);case 14:c.prev=14;t.f();return c.finish(14);case 17:case"end":return c.stop()}}),value,this,[[1,11,14,17]])}))},{key:Xe,value:c.default.mark((function value(t,r){var o,l,u,h,d;return c.default.wrap((function value$(c){for(;;)switch(c.prev=c.next){case 0:o=_createForOfIteratorHelper(this[W]());c.prev=1;o.s();case 3:if((l=o.n()).done){c.next=13;break}u=l.value;if(t&&r!==t.has(u[pe])){c.next=11;break}h=this[N]();(d=u[Ee](h)).success||(this[M].failingNode=u);c.next=11;return d;case 11:c.next=3;break;case 13:c.next=18;break;case 15:c.prev=15;c.t0=c.catch(1);o.e(c.t0);case 18:c.prev=18;o.f();return c.finish(18);case 21:case"end":return c.stop()}}),value,this,[[1,15,18,21]])}))},{key:j,value:function value(){return null}},{key:y,value:function value(t,r){this[M].children.push(t)}},{key:N,value:function value(){}},{key:k,value:function value(t){var r=t.filter,o=void 0===r?null:r,c=t.include,u=void 0===c||c;if(this[M].generator){var h=this[N](),d=this[M].failingNode[Ee](h);if(!d.success)return d;d.html&&this[y](d.html,d.bbox);delete this[M].failingNode}else this[M].generator=this[Xe](o,u);for(;;){var g=this[M].generator.next();if(g.done)break;var m=g.value;if(!m.success)return m;m.html&&this[y](m.html,m.bbox)}this[M].generator=null;return l.HTMLResult.EMPTY}},{key:Ae,value:function value(t){this[Je]=new Set(Object.keys(t))}},{key:Ge,value:function value(t){var r=this[Le],o=this[Je];return _toConsumableArray(t).filter((function(t){return r.has(t)&&!o.has(t)}))}},{key:Ce,value:function value(t){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set,c=_createForOfIteratorHelper(this[Ne]);try{for(c.s();!(r=c.n()).done;){var l=r.value;l[Ye](t,o)}}catch(t){c.e(t)}finally{c.f()}}},{key:Ye,value:function value(t,r){var o=this[qe](t,r);o?this[De](o,t,r):this[Ce](t,r)}},{key:qe,value:function value(t,r){var o=this.use,c=this.usehref;if(!o&&!c)return null;var l=null,h=null,d=null,m=o;if(c){m=c;c.startsWith("#som(")&&c.endsWith(")")?h=c.slice("#som(".length,c.length-1):c.startsWith(".#som(")&&c.endsWith(")")?h=c.slice(".#som(".length,c.length-1):c.startsWith("#")?d=c.slice(1):c.startsWith(".#")&&(d=c.slice(2))}else o.startsWith("#")?d=o.slice(1):h=o;this.use=this.usehref="";d?l=t.get(d):(l=(0,g.searchNode)(t.get(Se),this,h,!0,!1))&&(l=l[0]);if(!l){(0,u.warn)("XFA - Invalid prototype reference: ".concat(m,"."));return null}if(l[pe]!==this[pe]){(0,u.warn)("XFA - Incompatible prototype: ".concat(l[pe]," !== ").concat(this[pe],"."));return null}if(r.has(l)){(0,u.warn)("XFA - Cycle detected in prototypes use.");return null}r.add(l);var y=l[qe](t,r);y&&l[De](y,t,r);l[Ce](t,r);r.delete(l);return l}},{key:De,value:function value(t,r,o){if(o.has(t))(0,u.warn)("XFA - Cycle detected in prototypes use.");else{!this[O]&&t[O]&&(this[O]=t[O]);new Set(o).add(t);var c,l=_createForOfIteratorHelper(this[Ge](t[Je]));try{for(l.s();!(c=l.n()).done;){var h=c.value;this[h]=t[h];this[Je]&&this[Je].add(h)}}catch(t){l.e(t)}finally{l.f()}var d,g=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(g.s();!(d=g.n()).done;){var m=d.value;if(!this[Le].has(m)){var y=this[m],v=t[m];if(y instanceof rt){var k,_=_createForOfIteratorHelper(y[Ne]);try{for(_.s();!(k=_.n()).done;){k.value[Ye](r,o)}}catch(t){_.e(t)}finally{_.f()}for(var w=y[Ne].length,S=v[Ne].length;w<S;w++){var x=t[Ne][w][C]();if(!y.push(x))break;x[Ke]=this;this[Ne].push(x);x[Ye](r,o)}}else if(null===y){if(null!==v){var T=v[C]();T[Ke]=this;this[m]=T;this[Ne].push(T);T[Ye](r,o)}}else{y[Ce](r,o);v&&y[De](v,r,o)}}}}catch(t){g.e(t)}finally{g.f()}}}},{key:C,value:function value(){var t,r=Object.create(Object.getPrototypeOf(this)),o=_createForOfIteratorHelper(Object.getOwnPropertySymbols(this));try{for(o.s();!(t=o.n()).done;){var c=t.value;try{r[c]=this[c]}catch(t){(0,u.shadow)(r,c,this[c])}}}catch(t){o.e(t)}finally{o.f()}r[je]="".concat(r[pe]).concat(Qe++);r[Ne]=[];var l,h=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(h.s();!(l=h.n()).done;){var d=l.value;if(this[Le].has(d))r[d]=XFAObject[Ue](this[d]);else{var g=this[d];r[d]=g instanceof rt?new rt(g[We]):null}}}catch(t){h.e(t)}finally{h.f()}var m,y=_createForOfIteratorHelper(this[Ne]);try{for(y.s();!(m=y.n()).done;){var v=m.value,k=v[pe],_=v[C]();r[Ne].push(_);_[Ke]=r;null===r[k]?r[k]=_:r[k][Ne].push(_)}}catch(t){y.e(t)}finally{y.f()}return r}},{key:z,value:function value(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t?this[Ne].filter((function(r){return r[pe]===t})):this[Ne]}},{key:U,value:function value(t){return this[t]}},{key:H,value:function value(t,r){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.from(this[$](t,r,o))}},{key:$,value:c.default.mark((function value(t,r){var o,l,u,h,d=arguments;return c.default.wrap((function value$(c){for(;;)switch(c.prev=c.next){case 0:o=!(d.length>2&&void 0!==d[2])||d[2];if("parent"!==t){c.next=5;break}c.next=4;return this[Ke];case 4:return c.abrupt("return");case 5:l=_createForOfIteratorHelper(this[Ne]);c.prev=6;l.s();case 8:if((u=l.n()).done){c.next=20;break}if((h=u.value)[pe]!==t){c.next=13;break}c.next=13;return h;case 13:if(h.name!==t){c.next=16;break}c.next=16;return h;case 16:if(!r&&!h[ue]()){c.next=18;break}return c.delegateYield(h[$](t,r,!1),"t0",18);case 18:c.next=8;break;case 20:c.next=25;break;case 22:c.prev=22;c.t1=c.catch(6);l.e(c.t1);case 25:c.prev=25;l.f();return c.finish(25);case 28:if(!o||!this[Le].has(t)){c.next=31;break}c.next=31;return new at(this,t,this[t]);case 31:case"end":return c.stop()}}),value,this,[[6,22,25,28]])}))}],[{key:Ue,value:function value(t){return Array.isArray(t)?t.map((function(t){return XFAObject[Ue](t)})):"object"===_typeof(t)&&null!==t?Object.assign({},t):t}}]);return XFAObject}();r.XFAObject=tt;var rt=function(){function XFAObjectArray(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0;_classCallCheck(this,XFAObjectArray);this[We]=t;this[Ne]=[]}_createClass(XFAObjectArray,[{key:"push",value:function push(t){if(this[Ne].length<=this[We]){this[Ne].push(t);return!0}(0,u.warn)('XFA - node "'.concat(t[pe],'" accepts no more than ').concat(this[We]," children"));return!1}},{key:"isEmpty",value:function isEmpty(){return 0===this[Ne].length}},{key:"dump",value:function dump(){return 1===this[Ne].length?this[Ne][0][E]():this[Ne].map((function(t){return t[E]()}))}},{key:C,value:function value(){var t=new XFAObjectArray(this[We]);t[Ne]=this[Ne].map((function(t){return t[C]()}));return t}},{key:"children",get:function get(){return this[Ne]}},{key:"clear",value:function clear(){this[Ne].length=0}}]);return XFAObjectArray}();r.XFAObjectArray=rt;var at=function(){function XFAAttribute(t,r,o){_classCallCheck(this,XFAAttribute);this[Ke]=t;this[pe]=r;this[O]=o;this[x]=!1;this[je]="attribute".concat(Qe++)}_createClass(XFAAttribute,[{key:Y,value:function value(){return this[Ke]}},{key:ie,value:function value(){return!0}},{key:X,value:function value(){return this[O].trim()}},{key:Pe,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){t=t.value||"";this[O]=t.toString()}))},{key:Fe,value:function value(){return this[O]}},{key:oe,value:function value(t){return this[Ke]===t||this[Ke][oe](t)}}]);return XFAAttribute}();r.XFAAttribute=at;var nt=function(t){_inherits(XmlObject,t);var r=_createSuper(XmlObject);function XmlObject(t,o){var c,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};_classCallCheck(this,XmlObject);(c=r.call(this,t,o))[O]="";c[He]=null;if("#text"!==o){var u=new Map;c[Be]=u;for(var h=0,d=Object.entries(l);h<d.length;h++){var g=_slicedToArray(d[h],2),m=g[0],y=g[1];u.set(m,new at(_assertThisInitialized(c),m,y))}if(l.hasOwnProperty(ge)){var v=l[ge].xfa.dataNode;void 0!==v&&("dataGroup"===v?c[He]=!1:"dataValue"===v&&(c[He]=!0))}}c[x]=!1;return c}_createClass(XmlObject,[{key:Me,value:function value(t){var r=this[pe];if("#text"!==r){var o=(0,u.utf8StringToString)(r),c=this[de]===et?"xfa:":"";t.push("<".concat(c).concat(o));var l,d=_createForOfIteratorHelper(this[Be].entries());try{for(d.s();!(l=d.n()).done;){var g=_slicedToArray(l.value,2),m=g[0],y=g[1],v=(0,u.utf8StringToString)(m);t.push(" ".concat(v,'="').concat((0,h.encodeToXmlString)(y[O]),'"'))}}catch(t){d.e(t)}finally{d.f()}null!==this[He]&&(this[He]?t.push(' xfa:dataNode="dataValue"'):t.push(' xfa:dataNode="dataGroup"'));if(this[O]||0!==this[Ne].length){t.push(">");if(this[O])"string"==typeof this[O]?t.push((0,h.encodeToXmlString)(this[O])):this[O][Me](t);else{var k,_=_createForOfIteratorHelper(this[Ne]);try{for(_.s();!(k=_.n()).done;){k.value[Me](t)}}catch(t){_.e(t)}finally{_.f()}}t.push("</".concat(c).concat(o,">"))}else t.push("/>")}else t.push((0,h.encodeToXmlString)(this[O]))}},{key:me,value:function value(t){if(this[O]){var r=new XmlObject(this[de],"#text");this[v](r);r[O]=this[O];this[O]=""}this[v](t);return!0}},{key:ve,value:function value(t){this[O]+=t}},{key:R,value:function value(){if(this[O]&&this[Ne].length>0){var t=new XmlObject(this[de],"#text");this[v](t);t[O]=this[O];delete this[O]}}},{key:Ee,value:function value(){return"#text"===this[pe]?l.HTMLResult.success({name:"#text",value:this[O]}):l.HTMLResult.EMPTY}},{key:z,value:function value(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t?this[Ne].filter((function(r){return r[pe]===t})):this[Ne]}},{key:L,value:function value(){return this[Be]}},{key:U,value:function value(t){var value=this[Be].get(t);return void 0!==value?value:this[z](t)}},{key:$,value:c.default.mark((function value(t,r){var value,o,l,u;return c.default.wrap((function value$(c){for(;;)switch(c.prev=c.next){case 0:value=this[Be].get(t);if(!value){c.next=4;break}c.next=4;return value;case 4:o=_createForOfIteratorHelper(this[Ne]);c.prev=5;o.s();case 7:if((l=o.n()).done){c.next=16;break}if((u=l.value)[pe]!==t){c.next=12;break}c.next=12;return u;case 12:if(!r){c.next=14;break}return c.delegateYield(u[$](t,r),"t0",14);case 14:c.next=7;break;case 16:c.next=21;break;case 18:c.prev=18;c.t1=c.catch(5);o.e(c.t1);case 21:c.prev=21;o.f();return c.finish(21);case 24:case"end":return c.stop()}}),value,this,[[5,18,21,24]])}))},{key:D,value:c.default.mark((function value(t,r){var value,o,l,u;return c.default.wrap((function value$(c){for(;;)switch(c.prev=c.next){case 0:value=this[Be].get(t);if(!value||r&&value[x]){c.next=4;break}c.next=4;return value;case 4:o=_createForOfIteratorHelper(this[Ne]);c.prev=5;o.s();case 7:if((l=o.n()).done){c.next=12;break}u=l.value;return c.delegateYield(u[D](t,r),"t0",10);case 10:c.next=7;break;case 12:c.next=17;break;case 14:c.prev=14;c.t1=c.catch(5);o.e(c.t1);case 17:c.prev=17;o.f();return c.finish(17);case 20:case"end":return c.stop()}}),value,this,[[5,14,17,20]])}))},{key:G,value:c.default.mark((function value(t,r,o){var l,u,h;return c.default.wrap((function value$(c){for(;;)switch(c.prev=c.next){case 0:l=_createForOfIteratorHelper(this[Ne]);c.prev=1;l.s();case 3:if((u=l.n()).done){c.next=12;break}if((h=u.value)[pe]!==t||o&&h[x]){c.next=8;break}c.next=8;return h;case 8:if(!r){c.next=10;break}return c.delegateYield(h[G](t,r,o),"t0",10);case 10:c.next=3;break;case 12:c.next=17;break;case 14:c.prev=14;c.t1=c.catch(1);l.e(c.t1);case 17:c.prev=17;l.f();return c.finish(17);case 20:case"end":return c.stop()}}),value,this,[[1,14,17,20]])}))},{key:ie,value:function value(){return null===this[He]?0===this[Ne].length||this[Ne][0][de]===d.NamespaceIds.xhtml.id:this[He]}},{key:X,value:function value(){return null===this[He]?0===this[Ne].length?this[O].trim():this[Ne][0][de]===d.NamespaceIds.xhtml.id?this[Ne][0][Fe]().trim():null:this[O].trim()}},{key:Pe,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){t=t.value||"";this[O]=t.toString()}))},{key:E,value:function value(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=Object.create(null);t&&(r.$ns=this[de]);this[O]&&(r.$content=this[O]);r.$name=this[pe];r.children=[];var o,c=_createForOfIteratorHelper(this[Ne]);try{for(c.s();!(o=c.n()).done;){var l=o.value;r.children.push(l[E](t))}}catch(t){c.e(t)}finally{c.f()}r.attributes=Object.create(null);var u,h=_createForOfIteratorHelper(this[Be]);try{for(h.s();!(u=h.n()).done;){var d=_slicedToArray(u.value,2),g=d[0],m=d[1];r.attributes[g]=m[O]}}catch(t){h.e(t)}finally{h.f()}return r}}]);return XmlObject}(tt);r.XmlObject=nt;var it=function(t){_inherits(ContentObject,t);var r=_createSuper(ContentObject);function ContentObject(t,o){var c;_classCallCheck(this,ContentObject);(c=r.call(this,t,o))[O]="";return c}_createClass(ContentObject,[{key:ve,value:function value(t){this[O]+=t}},{key:R,value:function value(){}}]);return ContentObject}(tt);r.ContentObject=it;var ot=function(t){_inherits(OptionObject,t);var r=_createSuper(OptionObject);function OptionObject(t,o,c){var l;_classCallCheck(this,OptionObject);(l=r.call(this,t,o))[Ve]=c;return l}_createClass(OptionObject,[{key:R,value:function value(){var t=this;this[O]=(0,l.getKeyword)({data:this[O],defaultValue:this[Ve][0],validate:function validate(r){return t[Ve].includes(r)}})}},{key:_,value:function value(t){_get(_getPrototypeOf(OptionObject.prototype),_,this).call(this,t);delete this[Ve]}}]);return OptionObject}(it);r.OptionObject=ot;var st=function(t){_inherits(StringObject,t);var r=_createSuper(StringObject);function StringObject(){_classCallCheck(this,StringObject);return r.apply(this,arguments)}_createClass(StringObject,[{key:R,value:function value(){this[O]=this[O].trim()}}]);return StringObject}(it);r.StringObject=st;var ct=function(t){_inherits(IntegerObject,t);var r=_createSuper(IntegerObject);function IntegerObject(t,o,c,l){var u;_classCallCheck(this,IntegerObject);(u=r.call(this,t,o))[$e]=c;u[Ze]=l;return u}_createClass(IntegerObject,[{key:R,value:function value(){this[O]=(0,l.getInteger)({data:this[O],defaultValue:this[$e],validate:this[Ze]})}},{key:_,value:function value(t){_get(_getPrototypeOf(IntegerObject.prototype),_,this).call(this,t);delete this[$e];delete this[Ze]}}]);return IntegerObject}(it);r.IntegerObject=ct;var lt=function(t){_inherits(Option01,t);var r=_createSuper(Option01);function Option01(t,o){_classCallCheck(this,Option01);return r.call(this,t,o,0,(function(t){return 1===t}))}return _createClass(Option01)}(ct);r.Option01=lt;var ut=function(t){_inherits(Option10,t);var r=_createSuper(Option10);function Option10(t,o){_classCallCheck(this,Option10);return r.call(this,t,o,1,(function(t){return 0===t}))}return _createClass(Option10)}(ct);r.Option10=ut},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.HTMLResult=void 0;r.getBBox=function getBBox(t){var r=-1;if(!t)return{x:r,y:r,width:r,height:r};var o=t.trim().split(/\s*,\s*/).map((function(t){return getMeasurement(t,"-1")}));if(o.length<4||o[2]<0||o[3]<0)return{x:r,y:r,width:r,height:r};var c=_slicedToArray(o,4),l=c[0],u=c[1],h=c[2],d=c[3];return{x:l,y:u,width:h,height:d}};r.getColor=function getColor(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],o=_slicedToArray(r,3),c=o[0],l=o[1],u=o[2];if(!t)return{r:c,g:l,b:u};var h=t.trim().split(/\s*,\s*/).map((function(t){return Math.min(Math.max(0,parseInt(t.trim(),10)),255)})).map((function(t){return isNaN(t)?0:t}));if(h.length<3)return{r:c,g:l,b:u};var d=_slicedToArray(h,3);c=d[0];l=d[1];u=d[2];return{r:c,g:l,b:u}};r.getFloat=function getFloat(t){var r=t.data,o=t.defaultValue,c=t.validate;if(!r)return o;r=r.trim();var l=parseFloat(r);if(!isNaN(l)&&c(l))return l;return o};r.getInteger=function getInteger(t){var r=t.data,o=t.defaultValue,c=t.validate;if(!r)return o;r=r.trim();var l=parseInt(r,10);if(!isNaN(l)&&c(l))return l;return o};r.getKeyword=getKeyword;r.getMeasurement=getMeasurement;r.getRatio=function getRatio(t){if(!t)return{num:1,den:1};var r=t.trim().split(/\s*:\s*/).map((function(t){return parseFloat(t)})).filter((function(t){return!isNaN(t)}));1===r.length&&r.push(1);if(0===r.length)return{num:1,den:1};var o=_slicedToArray(r,2),c=o[0],l=o[1];return{num:c,den:l}};r.getRelevant=function getRelevant(t){if(!t)return[];return t.trim().split(/\s+/).map((function(t){return{excluded:"-"===t[0],viewname:t.substring(1)}}))};r.getStringOption=function getStringOption(t,r){return getKeyword({data:t,defaultValue:r[0],validate:function validate(t){return r.includes(t)}})};r.stripQuotes=function stripQuotes(t){if(t.startsWith("'")||t.startsWith('"'))return t.slice(1,t.length-1);return t};var c=o(4);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}var l={pt:function pt(t){return t},cm:function cm(t){return t/2.54*72},mm:function mm(t){return t/25.4*72},in:function _in(t){return 72*t},px:function px(t){return t}},u=/([+-]?\d+\.?\d*)(.*)/;function getKeyword(t){var r=t.data,o=t.defaultValue,c=t.validate;return r&&c(r=r.trim())?r:o}function getMeasurement(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";r=r||"0";if(!t)return getMeasurement(r);var o=t.trim().match(u);if(!o)return getMeasurement(r);var c=_slicedToArray(o,3),h=c[1],d=c[2],g=parseFloat(h);if(isNaN(g))return getMeasurement(r);if(0===g)return 0;var m=l[d];return m?m(g):g}var h=function(){function HTMLResult(t,r,o,c){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,HTMLResult);this.success=t;this.html=r;this.bbox=o;this.breakNode=c}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(HTMLResult,[{key:"isBreak",value:function isBreak(){return!!this.breakNode}}],[{key:"FAILURE",get:function get(){return(0,c.shadow)(this,"FAILURE",new HTMLResult(!1,null,null,null))}},{key:"EMPTY",get:function get(){return(0,c.shadow)(this,"EMPTY",new HTMLResult(!0,null,null,null))}},{key:"breakNode",value:function breakNode(t){return new HTMLResult(!1,null,null,t)}},{key:"success",value:function success(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new HTMLResult(!0,t,r,null)}}]);return HTMLResult}();r.HTMLResult=h},(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.NamespaceIds=r.$buildXFAObject=void 0;var o=Symbol();r.$buildXFAObject=o;r.NamespaceIds={config:{id:0,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xci/")}},connectionSet:{id:1,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xfa-connection-set/")}},datasets:{id:2,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xfa-data/")}},form:{id:3,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xfa-form/")}},localeSet:{id:4,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xfa-locale-set/")}},pdf:{id:5,check:function check(t){return"http://ns.adobe.com/xdp/pdf/"===t}},signature:{id:6,check:function check(t){return"http://www.w3.org/2000/09/xmldsig#"===t}},sourceSet:{id:7,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xfa-source-set/")}},stylesheet:{id:8,check:function check(t){return"http://www.w3.org/1999/XSL/Transform"===t}},template:{id:9,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xfa-template/")}},xdc:{id:10,check:function check(t){return t.startsWith("http://www.xfa.org/schema/xdc/")}},xdp:{id:11,check:function check(t){return"http://ns.adobe.com/xdp/"===t}},xfdf:{id:12,check:function check(t){return"http://ns.adobe.com/xfdf/"===t}},xhtml:{id:13,check:function check(t){return"http://www.w3.org/1999/xhtml"===t}},xmpmeta:{id:14,check:function check(t){return"http://ns.adobe.com/xmpmeta/"===t}}}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.createDataNode=function createDataNode(t,r,o){var l=parseExpression(o);if(!l)return null;if(l.some((function(t){return t.operator===m})))return null;var h=_.get(l[0].name),d=0;if(h){t=h(t,r);d=1}else t=r||t;for(var v=l.length;d<v;d++){var k=l[d],w=k.name,S=k.operator,C=k.index;if(!isFinite(C)){l[d].index=0;return createNodes(t,l.slice(d))}var x=void 0;switch(S){case g:x=t[c.$getChildrenByName](w,!1);break;case m:x=t[c.$getChildrenByName](w,!0);break;case y:x=(x=t[c.$getChildrenByClass](w))instanceof c.XFAObjectArray?x.children:[x]}if(0===x.length)return createNodes(t,l.slice(d));if(!(C<x.length)){l[d].index=C-x.length;return createNodes(t,l.slice(d))}var O=x[C];if(!(O instanceof c.XFAObject)){(0,u.warn)("XFA - Cannot create a node.");return null}t=O}return null};r.searchNode=function searchNode(t,r,o){var l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],h=parseExpression(o,l);if(!h)return null;var d,v=_.get(h[0].name),k=0;if(v){d=!0;t=[v(t,r)];k=1}else{d=null===r;t=[r||t]}for(var S=function _loop(o){var l,v=h[k],_=v.name,S=v.cacheName,C=v.operator,x=v.index,O=[],T=_createForOfIteratorHelper(t);try{for(T.s();!(l=T.n()).done;){var E=l.value;if(E instanceof c.XFAObject){var M=void 0,R=void 0;if(u){if(!(R=w.get(E))){R=new Map;w.set(E,R)}M=R.get(S)}if(!M){switch(C){case g:M=E[c.$getChildrenByName](_,!1);break;case m:M=E[c.$getChildrenByName](_,!0);break;case y:M=(M=E[c.$getChildrenByClass](_))instanceof c.XFAObjectArray?M.children:[M]}u&&R.set(S,M)}M.length>0&&O.push(M)}}}catch(t){T.e(t)}finally{T.f()}if(0===O.length&&!d&&0===k){var j=r[c.$getParent]();if(!(r=j))return{v:null};k=-1;t=[r];return"continue"}t=isFinite(x)?O.filter((function(t){return x<t.length})).map((function(t){return t[x]})):O.reduce((function(t,r){return t.concat(r)}),[])},C=h.length;k<C;k++){var x=S(C);if("continue"!==x&&"object"===_typeof(x))return x.v}if(0===t.length)return null;return t};var c=o(217),l=o(219),u=o(4);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}var h=/^[^.[]+/,d=/^[^\]]+/,g=0,m=1,y=2,v=3,k=4,_=new Map([["$data",function(t,r){return t.datasets?t.datasets.data:t}],["$record",function(t,r){return(t.datasets?t.datasets.data:t)[c.$getChildren]()[0]}],["$template",function(t,r){return t.template}],["$connectionSet",function(t,r){return t.connectionSet}],["$form",function(t,r){return t.form}],["$layout",function(t,r){return t.layout}],["$host",function(t,r){return t.host}],["$dataWindow",function(t,r){return t.dataWindow}],["$event",function(t,r){return t.event}],["!",function(t,r){return t.datasets}],["$xfa",function(t,r){return t}],["xfa",function(t,r){return t}],["$",function(t,r){return r}]]),w=new WeakMap,S=l.NamespaceIds.datasets.id;function parseIndex(t){return"*"===(t=t.trim())?1/0:parseInt(t,10)||0}function parseExpression(t,r){var o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=t.match(h);if(!c)return null;for(var l=c,_=_slicedToArray(l,1),w=_[0],S=[{name:w,cacheName:"."+w,index:0,js:null,formCalc:null,operator:g}],C=w.length;C<t.length;){var x=C,O=t.charAt(C++);if("["!==O){var T=void 0;switch(t.charAt(C)){case".":if(!r)return null;C++;T=m;break;case"#":C++;T=y;break;case"[":if(o){(0,u.warn)("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");return null}T=v;break;case"(":if(o){(0,u.warn)("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");return null}T=k;break;default:T=g}if(!(c=t.slice(C).match(h)))break;var E=c,M=_slicedToArray(E,1);C+=(w=M[0]).length;S.push({name:w,cacheName:t.slice(x,C),operator:T,index:0,js:null,formCalc:null})}else{if(!(c=t.slice(C).match(d))){(0,u.warn)("XFA - Invalid index in SOM expression");return null}S[S.length-1].index=parseIndex(c[0]);C+=c[0].length+1}}return S}function createNodes(t,r){var o,l=null,u=_createForOfIteratorHelper(r);try{for(u.s();!(o=u.n()).done;){for(var h=o.value,d=h.name,g=h.index,m=0,y=isFinite(g)?g:0;m<=y;m++){var v=t[c.$namespaceId]===S?-1:t[c.$namespaceId];l=new c.XmlObject(v,d);t[c.$appendChild](l)}t=l}}catch(t){u.e(t)}finally{u.f()}return l}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.Binder=void 0;var c=o(217),l=o(222),u=o(220),h=o(219),d=o(4);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var g=h.NamespaceIds.datasets.id;function createText(t){var r=new l.Text({});r[c.$content]=t;return r}var m=function(){function Binder(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,Binder);this.root=t;this.datasets=t.datasets;t.datasets&&t.datasets.data?this.data=t.datasets.data:this.data=new c.XmlObject(h.NamespaceIds.datasets.id,"data");this.emptyMerge=0===this.data[c.$getChildren]().length;this.root.form=this.form=t.template[c.$clone]()}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(Binder,[{key:"_isConsumeData",value:function _isConsumeData(){return!this.emptyMerge&&this._mergeMode}},{key:"_isMatchTemplate",value:function _isMatchTemplate(){return!this._isConsumeData()}},{key:"bind",value:function bind(){this._bindElement(this.form,this.data);return this.form}},{key:"getData",value:function getData(){return this.data}},{key:"_bindValue",value:function _bindValue(t,r,o){t[c.$data]=r;if(t[c.$hasSettableValue]())if(r[c.$isDataValue]()){var u=r[c.$getDataValue]();t[c.$setValue](createText(u))}else if(t instanceof l.Field&&t.ui&&t.ui.choiceList&&"multiSelect"===t.ui.choiceList.open){var h=r[c.$getChildren]().map((function(t){return t[c.$content].trim()})).join("\n");t[c.$setValue](createText(h))}else this._isConsumeData()&&(0,d.warn)("XFA - Nodes haven't the same type.");else!r[c.$isDataValue]()||this._isMatchTemplate()?this._bindElement(t,r):(0,d.warn)("XFA - Nodes haven't the same type.")}},{key:"_findDataByNameToConsume",value:function _findDataByNameToConsume(t,r,o,l){if(!t)return null;for(var u,d,g=0;g<3;g++){u=o[c.$getRealChildrenByNameIt](t,!1,!0);for(;d=u.next().value;)if(r===d[c.$isDataValue]())return d;if(o[c.$namespaceId]===h.NamespaceIds.datasets.id&&"data"===o[c.$nodeName])break;o=o[c.$getParent]()}return l&&((d=(u=this.data[c.$getRealChildrenByNameIt](t,!0,!1)).next().value)||(d=(u=this.data[c.$getAttributeIt](t,!0)).next().value)&&d[c.$isDataValue]())?d:null}},{key:"_setProperties",value:function _setProperties(t,r){if(t.hasOwnProperty("setProperty")){var o,h=_createForOfIteratorHelper(t.setProperty.children);try{for(h.s();!(o=h.n()).done;){var g=o.value,m=g.ref,y=g.target;if(!g.connection&&m){var v=(0,u.searchNode)(this.root,r,m,!1,!1);if(v){var k=_slicedToArray(v,1)[0];if(k[c.$isDescendent](this.data)){var _=(0,u.searchNode)(this.root,t,y,!1,!1);if(_){var w=_slicedToArray(_,1)[0];if(w[c.$isDescendent](t)){var S=w[c.$getParent]();if(w instanceof l.SetProperty||S instanceof l.SetProperty)(0,d.warn)("XFA - Invalid target: cannot be a setProperty or one of its properties.");else if(w instanceof l.BindItems||S instanceof l.BindItems)(0,d.warn)("XFA - Invalid target: cannot be a bindItems or one of its properties.");else{var C=k[c.$text](),x=w[c.$nodeName];if(w instanceof c.XFAAttribute){var O=Object.create(null);O[x]=C;var T=Reflect.construct(Object.getPrototypeOf(S).constructor,[O]);S[x]=T[x]}else if(w.hasOwnProperty(c.$content)){w[c.$data]=k;w[c.$content]=C;w[c.$finalize]()}else(0,d.warn)("XFA - Invalid node to use in setProperty")}}else(0,d.warn)("XFA - Invalid target: must be a property or subproperty.")}else(0,d.warn)("XFA - Invalid target: ".concat(y,"."))}else(0,d.warn)("XFA - Invalid node: must be a data node.")}else(0,d.warn)("XFA - Invalid reference: ".concat(m,"."))}}}catch(t){h.e(t)}finally{h.f()}}}},{key:"_bindItems",value:function _bindItems(t,r){if(t.hasOwnProperty("items")&&t.hasOwnProperty("bindItems")&&!t.bindItems.isEmpty()){var o,h=_createForOfIteratorHelper(t.items.children);try{for(h.s();!(o=h.n()).done;){var g=o.value;t[c.$removeChild](g)}}catch(t){h.e(t)}finally{h.f()}t.items.clear();var m=new l.Items({}),y=new l.Items({});t[c.$appendChild](m);t.items.push(m);t[c.$appendChild](y);t.items.push(y);var v,k=_createForOfIteratorHelper(t.bindItems.children);try{for(k.s();!(v=k.n()).done;){var _=v.value,w=_.ref,S=_.labelRef,C=_.valueRef;if(!_.connection&&w){var x=(0,u.searchNode)(this.root,r,w,!1,!1);if(x){var O,T=_createForOfIteratorHelper(x);try{for(T.s();!(O=T.n()).done;){var E=O.value;if(E[c.$isDescendent](this.datasets)){var M=(0,u.searchNode)(this.root,E,S,!0,!1);if(M){var R=_slicedToArray(M,1)[0];if(R[c.$isDescendent](this.datasets)){var j=(0,u.searchNode)(this.root,E,C,!0,!1);if(j){var D=_slicedToArray(j,1)[0];if(D[c.$isDescendent](this.datasets)){var L=createText(R[c.$text]()),N=createText(D[c.$text]());m[c.$appendChild](L);m.text.push(L);y[c.$appendChild](N);y.text.push(N)}else(0,d.warn)("XFA - Invalid value: must be a datasets child.")}else(0,d.warn)("XFA - Invalid value: ".concat(C,"."))}else(0,d.warn)("XFA - Invalid label: must be a datasets child.")}else(0,d.warn)("XFA - Invalid label: ".concat(S,"."))}else(0,d.warn)("XFA - Invalid ref (".concat(w,"): must be a datasets child."))}}catch(t){T.e(t)}finally{T.f()}}else(0,d.warn)("XFA - Invalid reference: ".concat(w,"."))}}}catch(t){k.e(t)}finally{k.f()}}}},{key:"_bindOccurrences",value:function _bindOccurrences(t,r,o){var l;if(r.length>1){(l=t[c.$clone]())[c.$removeChild](l.occur);l.occur=null}this._bindValue(t,r[0],o);this._setProperties(t,r[0]);this._bindItems(t,r[0]);if(1!==r.length)for(var u=t[c.$getParent](),h=t[c.$nodeName],d=u[c.$indexOf](t),g=1,m=r.length;g<m;g++){var y=r[g],v=l[c.$clone]();u[h].push(v);u[c.$insertAt](d+g,v);this._bindValue(v,y,o);this._setProperties(v,y);this._bindItems(v,y)}}},{key:"_createOccurrences",value:function _createOccurrences(t){if(this.emptyMerge){var r=t.occur;if(r&&!(r.initial<=1)){var o=t[c.$getParent](),l=t[c.$nodeName];if(o[l]instanceof c.XFAObjectArray){var u;u=t.name?o[l].children.filter((function(r){return r.name===t.name})).length:o[l].children.length;var h=o[c.$indexOf](t)+1,d=r.initial-u;if(d){var g=t[c.$clone]();g[c.$removeChild](g.occur);g.occur=null;o[l].push(g);o[c.$insertAt](h,g);for(var m=1;m<d;m++){var y=g[c.$clone]();o[l].push(y);o[c.$insertAt](h+m,y)}}}}}}},{key:"_getOccurInfo",value:function _getOccurInfo(t){var r=t.name,o=t.occur;if(!o||!r)return[1,1];var c=-1===o.max?1/0:o.max;return[o.min,c]}},{key:"_setAndBind",value:function _setAndBind(t,r){this._setProperties(t,r);this._bindItems(t,r);this._bindElement(t,r)}},{key:"_bindElement",value:function _bindElement(t,r){var o=[];this._createOccurrences(t);var l,h=_createForOfIteratorHelper(t[c.$getChildren]());try{for(h.s();!(l=h.n()).done;){var m=l.value;if(!m[c.$data])if(void 0!==this._mergeMode||"subform"!==m[c.$nodeName]){if(m[c.$isBindable]()){var y=!1,v=null,k=null,_=null;if(m.bind){switch(m.bind.match){case"none":this._setAndBind(m,r);continue;case"global":y=!0;break;case"dataRef":if(!m.bind.ref){(0,d.warn)("XFA - ref is empty in node ".concat(m[c.$nodeName],"."));this._setAndBind(m,r);continue}k=m.bind.ref}m.bind.picture&&(v=m.bind.picture[c.$content])}var w=_slicedToArray(this._getOccurInfo(m),2),S=w[0],C=w[1];if(k){if(null===(_=(0,u.searchNode)(this.root,r,k,!0,!1))){if(!(_=(0,u.createDataNode)(this.data,r,k)))continue;this._isConsumeData()&&(_[c.$consumed]=!0);this._setAndBind(m,_);continue}this._isConsumeData()&&(_=_.filter((function(t){return!t[c.$consumed]})));_.length>C?_=_.slice(0,C):0===_.length&&(_=null);_&&this._isConsumeData()&&_.forEach((function(t){t[c.$consumed]=!0}))}else{if(!m.name){this._setAndBind(m,r);continue}if(this._isConsumeData()){for(var x=[];x.length<C;){var O=this._findDataByNameToConsume(m.name,m[c.$hasSettableValue](),r,y);if(!O)break;O[c.$consumed]=!0;x.push(O)}_=x.length>0?x:null}else{if(!(_=r[c.$getRealChildrenByNameIt](m.name,!1,this.emptyMerge).next().value)){if(0===S){o.push(m);continue}var T=r[c.$namespaceId]===g?-1:r[c.$namespaceId];_=m[c.$data]=new c.XmlObject(T,m.name);this.emptyMerge&&(_[c.$consumed]=!0);r[c.$appendChild](_);this._setAndBind(m,_);continue}this.emptyMerge&&(_[c.$consumed]=!0);_=[_]}}_?this._bindOccurrences(m,_,v):S>0?this._setAndBind(m,r):o.push(m)}}else{this._mergeMode="consumeData"===m.mergeMode;var E=r[c.$getChildren]();if(E.length>0)this._bindOccurrences(m,[E[0]],null);else if(this.emptyMerge){var M=r[c.$namespaceId]===g?-1:r[c.$namespaceId],R=m[c.$data]=new c.XmlObject(M,m.name||"root");r[c.$appendChild](R);this._bindElement(m,R)}}}}catch(t){h.e(t)}finally{h.f()}o.forEach((function(t){return t[c.$getParent]()[c.$removeChild](t)}))}}]);return Binder}();r.Binder=m},(t,r,o)=>{"use strict";var c=o(2);Object.defineProperty(r,"__esModule",{value:!0});r.Value=r.Text=r.TemplateNamespace=r.Template=r.SetProperty=r.Items=r.Field=r.BindItems=void 0;var l=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),u=o(217),h=o(219),d=o(223),g=o(224),m=o(218),y=o(4),v=o(225),k=o(149),_=o(220);function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _get(){_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,o){var c=_superPropBase(t,r);if(c){var l=Object.getOwnPropertyDescriptor(c,r);return l.get?l.get.call(arguments.length<3?t:o):l.value}};return _get.apply(this,arguments)}function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var w=c.mark(getContainedChildren);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}var S=h.NamespaceIds.template.id,C="http://www.w3.org/2000/svg",x=/^H(\d+)$/,O=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),T=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(t){if(!t||!t.border)return{w:0,h:0};var r=t.border[u.$getExtra]();return r?{w:r.widths[0]+r.widths[2]+r.insets[0]+r.insets[2],h:r.widths[1]+r.widths[3]+r.insets[1]+r.insets[3]}:{w:0,h:0}}function hasMargin(t){return t.margin&&(t.margin.topInset||t.margin.rightInset||t.margin.bottomInset||t.margin.leftInset)}function _setValue(t,r){if(!t.value){var o=new Bt({});t[u.$appendChild](o);t.value=o}t.value[u.$setValue](r)}function getContainedChildren(t){var r,o,c;return l.default.wrap((function getContainedChildren$(l){for(;;)switch(l.prev=l.next){case 0:r=_createForOfIteratorHelper(t[u.$getChildren]());l.prev=1;r.s();case 3:if((o=r.n()).done){l.next=12;break}if(!((c=o.value)instanceof St)){l.next=8;break}return l.delegateYield(c[u.$getContainedChildren](),"t0",7);case 7:return l.abrupt("continue",10);case 8:l.next=10;return c;case 10:l.next=3;break;case 12:l.next=17;break;case 14:l.prev=14;l.t1=l.catch(1);r.e(l.t1);case 17:l.prev=17;r.f();return l.finish(17);case 20:case"end":return l.stop()}}),w,null,[[1,14,17,20]])}function setTabIndex(t){for(;t;){if(!t.traversal){t[u.$tabIndex]=t[u.$getParent]()[u.$tabIndex];return}if(t[u.$tabIndex])return;var r,o=null,c=_createForOfIteratorHelper(t.traversal[u.$getChildren]());try{for(c.s();!(r=c.n()).done;){var l=r.value;if("next"===l.operation){o=l;break}}}catch(t){c.e(t)}finally{c.f()}if(!o||!o.ref){t[u.$tabIndex]=t[u.$getParent]()[u.$tabIndex];return}var h=t[u.$getTemplateRoot]();t[u.$tabIndex]=++h[u.$tabIndex];var d=h[u.$searchNode](o.ref,t);if(!d)return;t=d[0]}}function applyAssist(t,r){var o=t.assist;if(o){var c=o[u.$toHTML]();c&&(r.title=c);var l=o.role.match(x);if(l){var h=l[1];r.role="heading";r["aria-level"]=h}}if("table"===t.layout)r.role="table";else if("row"===t.layout)r.role="row";else{var d=t[u.$getParent]();"row"===d.layout&&(d.assist&&"TH"===d.assist.role?r.role="columnheader":r.role="cell")}}function ariaLabel(t){if(!t.assist)return null;var r=t.assist;return r.speak&&""!==r.speak[u.$content]?r.speak[u.$content]:r.toolTip?r.toolTip[u.$content]:null}function valueToHtml(t){return m.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:t}]})}function setFirstUnsplittable(t){var r=t[u.$getTemplateRoot]();if(null===r[u.$extra].firstUnsplittable){r[u.$extra].firstUnsplittable=t;r[u.$extra].noLayoutFailure=!0}}function unsetFirstUnsplittable(t){var r=t[u.$getTemplateRoot]();r[u.$extra].firstUnsplittable===t&&(r[u.$extra].noLayoutFailure=!1)}function handleBreak(t){if(t[u.$extra])return!1;t[u.$extra]=Object.create(null);if("auto"===t.targetType)return!1;var r=t[u.$getTemplateRoot](),o=null;if(t.target){if(!(o=r[u.$searchNode](t.target,t[u.$getParent]())))return!1;o=o[0]}var c=r[u.$extra],l=c.currentPageArea,h=c.currentContentArea;if("pageArea"===t.targetType){o instanceof tt||(o=null);if(t.startNew){t[u.$extra].target=o||l;return!0}if(o&&o!==l){t[u.$extra].target=o;return!0}return!1}o instanceof re||(o=null);var d,g=o&&o[u.$getParent](),m=g;if(t.startNew)if(o){var y=g.contentArea.children,v=y.indexOf(h),k=y.indexOf(o);-1!==v&&v<k&&(m=null);d=k-1}else d=l.contentArea.children.indexOf(h);else{if(!o||o===h)return!1;d=g.contentArea.children.indexOf(o)-1;m=g===l?null:g}t[u.$extra].target=m;t[u.$extra].index=d;return!0}function handleOverflow(t,r,o){var c=t[u.$getTemplateRoot](),l=c[u.$extra].noLayoutFailure,h=r[u.$getSubformParent];r[u.$getSubformParent]=function(){return t};c[u.$extra].noLayoutFailure=!0;var d=r[u.$toHTML](o);t[u.$addHTML](d.html,d.bbox);c[u.$extra].noLayoutFailure=l;r[u.$getSubformParent]=h}var E=function(t){_inherits(AppearanceFilter,t);var r=_createSuper(AppearanceFilter);function AppearanceFilter(t){var o;_classCallCheck(this,AppearanceFilter);(o=r.call(this,S,"appearanceFilter")).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(AppearanceFilter)}(u.StringObject),M=function(t){_inherits(Arc,t);var r=_createSuper(Arc);function Arc(t){var o;_classCallCheck(this,Arc);(o=r.call(this,S,"arc",!0)).circular=(0,m.getInteger)({data:t.circular,defaultValue:0,validate:function validate(t){return 1===t}});o.hand=(0,m.getStringOption)(t.hand,["even","left","right"]);o.id=t.id||"";o.startAngle=(0,m.getFloat)({data:t.startAngle,defaultValue:0,validate:function validate(t){return!0}});o.sweepAngle=(0,m.getFloat)({data:t.sweepAngle,defaultValue:360,validate:function validate(t){return!0}});o.use=t.use||"";o.usehref=t.usehref||"";o.edge=null;o.fill=null;return o}_createClass(Arc,[{key:u.$toHTML,value:function value(){var t,r=this.edge?this.edge:new de({}),o=r[u.$toStyle](),c=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(c,this.fill[u.$toStyle]()):c.fill="transparent";c.strokeWidth=(0,g.measureToString)("visible"===r.presence?r.thickness:0);c.stroke=o.color;var l={xmlns:C,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)t={name:"ellipse",attributes:{xmlns:C,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:c}};else{var h=this.startAngle*Math.PI/180,d=this.sweepAngle*Math.PI/180,y=this.sweepAngle>180?1:0,v=50*(1+Math.cos(h)),k=50*(1-Math.sin(h)),_=50*(1+Math.cos(h+d)),w=50*(1-Math.sin(h+d));t={name:"path",attributes:{xmlns:C,d:"M ".concat(v," ").concat(k," A 50 50 0 ").concat(y," 0 ").concat(_," ").concat(w),vectorEffect:"non-scaling-stroke",style:c}};Object.assign(l,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}var S={name:"svg",children:[t],attributes:l};if(hasMargin(this[u.$getParent]()[u.$getParent]()))return m.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[S]});S.attributes.style.position="absolute";return m.HTMLResult.success(S)}}]);return Arc}(u.XFAObject),R=function(t){_inherits(Area,t);var r=_createSuper(Area);function Area(t){var o;_classCallCheck(this,Area);(o=r.call(this,S,"area",!0)).colSpan=(0,m.getInteger)({data:t.colSpan,defaultValue:1,validate:function validate(t){return t>=1||-1===t}});o.id=t.id||"";o.name=t.name||"";o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.x=(0,m.getMeasurement)(t.x,"0pt");o.y=(0,m.getMeasurement)(t.y,"0pt");o.desc=null;o.extras=null;o.area=new u.XFAObjectArray;o.draw=new u.XFAObjectArray;o.exObject=new u.XFAObjectArray;o.exclGroup=new u.XFAObjectArray;o.field=new u.XFAObjectArray;o.subform=new u.XFAObjectArray;o.subformSet=new u.XFAObjectArray;return o}_createClass(Area,[{key:u.$getContainedChildren,value:l.default.mark((function value(){return l.default.wrap((function value$(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(getContainedChildren(this),"t0",1);case 1:case"end":return t.stop()}}),value,this)}))},{key:u.$isTransparent,value:function value(){return!0}},{key:u.$isBindable,value:function value(){return!0}},{key:u.$addHTML,value:function value(t,r){var o=_slicedToArray(r,4),c=o[0],l=o[1],h=o[2],d=o[3];this[u.$extra].width=Math.max(this[u.$extra].width,c+h);this[u.$extra].height=Math.max(this[u.$extra].height,l+d);this[u.$extra].children.push(t)}},{key:u.$getAvailableSpace,value:function value(){return this[u.$extra].availableSpace}},{key:u.$toHTML,value:function value(t){var r=(0,g.toStyle)(this,"position"),o={style:r,id:this[u.$uid],class:["xfaArea"]};(0,g.isPrintOnly)(this)&&o.class.push("xfaPrintOnly");this.name&&(o.xfaName=this.name);var c=[];this[u.$extra]={children:c,width:0,height:0,availableSpace:t};var l=this[u.$childrenToHTML]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!l.success){if(l.isBreak())return l;delete this[u.$extra];return m.HTMLResult.FAILURE}r.width=(0,g.measureToString)(this[u.$extra].width);r.height=(0,g.measureToString)(this[u.$extra].height);var h={name:"div",attributes:o,children:c},d=[this.x,this.y,this[u.$extra].width,this[u.$extra].height];delete this[u.$extra];return m.HTMLResult.success(h,d)}}]);return Area}(u.XFAObject),j=function(t){_inherits(Assist,t);var r=_createSuper(Assist);function Assist(t){var o;_classCallCheck(this,Assist);(o=r.call(this,S,"assist",!0)).id=t.id||"";o.role=t.role||"";o.use=t.use||"";o.usehref=t.usehref||"";o.speak=null;o.toolTip=null;return o}_createClass(Assist,[{key:u.$toHTML,value:function value(){return this.toolTip&&this.toolTip[u.$content]?this.toolTip[u.$content]:null}}]);return Assist}(u.XFAObject),D=function(t){_inherits(Barcode,t);var r=_createSuper(Barcode);function Barcode(t){var o;_classCallCheck(this,Barcode);(o=r.call(this,S,"barcode",!0)).charEncoding=(0,m.getKeyword)({data:t.charEncoding?t.charEncoding.toLowerCase():"",defaultValue:"",validate:function validate(t){return["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(t)||t.match(/iso-8859-\d{2}/)}});o.checksum=(0,m.getStringOption)(t.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]);o.dataColumnCount=(0,m.getInteger)({data:t.dataColumnCount,defaultValue:-1,validate:function validate(t){return t>=0}});o.dataLength=(0,m.getInteger)({data:t.dataLength,defaultValue:-1,validate:function validate(t){return t>=0}});o.dataPrep=(0,m.getStringOption)(t.dataPrep,["none","flateCompress"]);o.dataRowCount=(0,m.getInteger)({data:t.dataRowCount,defaultValue:-1,validate:function validate(t){return t>=0}});o.endChar=t.endChar||"";o.errorCorrectionLevel=(0,m.getInteger)({data:t.errorCorrectionLevel,defaultValue:-1,validate:function validate(t){return t>=0&&t<=8}});o.id=t.id||"";o.moduleHeight=(0,m.getMeasurement)(t.moduleHeight,"5mm");o.moduleWidth=(0,m.getMeasurement)(t.moduleWidth,"0.25mm");o.printCheckDigit=(0,m.getInteger)({data:t.printCheckDigit,defaultValue:0,validate:function validate(t){return 1===t}});o.rowColumnRatio=(0,m.getRatio)(t.rowColumnRatio);o.startChar=t.startChar||"";o.textLocation=(0,m.getStringOption)(t.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]);o.truncate=(0,m.getInteger)({data:t.truncate,defaultValue:0,validate:function validate(t){return 1===t}});o.type=(0,m.getStringOption)(t.type?t.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]);o.upsMode=(0,m.getStringOption)(t.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]);o.use=t.use||"";o.usehref=t.usehref||"";o.wideNarrowRatio=(0,m.getRatio)(t.wideNarrowRatio);o.encrypt=null;o.extras=null;return o}return _createClass(Barcode)}(u.XFAObject),L=function(t){_inherits(Bind,t);var r=_createSuper(Bind);function Bind(t){var o;_classCallCheck(this,Bind);(o=r.call(this,S,"bind",!0)).match=(0,m.getStringOption)(t.match,["once","dataRef","global","none"]);o.ref=t.ref||"";o.picture=null;return o}return _createClass(Bind)}(u.XFAObject),N=function(t){_inherits(BindItems,t);var r=_createSuper(BindItems);function BindItems(t){var o;_classCallCheck(this,BindItems);(o=r.call(this,S,"bindItems")).connection=t.connection||"";o.labelRef=t.labelRef||"";o.ref=t.ref||"";o.valueRef=t.valueRef||"";return o}return _createClass(BindItems)}(u.XFAObject);r.BindItems=N;var U=function(t){_inherits(Bookend,t);var r=_createSuper(Bookend);function Bookend(t){var o;_classCallCheck(this,Bookend);(o=r.call(this,S,"bookend")).id=t.id||"";o.leader=t.leader||"";o.trailer=t.trailer||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Bookend)}(u.XFAObject),H=function(t){_inherits(BooleanElement,t);var r=_createSuper(BooleanElement);function BooleanElement(t){var o;_classCallCheck(this,BooleanElement);(o=r.call(this,S,"boolean")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(BooleanElement,[{key:u.$toHTML,value:function value(t){return valueToHtml(1===this[u.$content]?"1":"0")}}]);return BooleanElement}(u.Option01),$=function(t){_inherits(Border,t);var r=_createSuper(Border);function Border(t){var o;_classCallCheck(this,Border);(o=r.call(this,S,"border",!0)).break=(0,m.getStringOption)(t.break,["close","open"]);o.hand=(0,m.getStringOption)(t.hand,["even","left","right"]);o.id=t.id||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.corner=new u.XFAObjectArray(4);o.edge=new u.XFAObjectArray(4);o.extras=null;o.fill=null;o.margin=null;return o}_createClass(Border,[{key:u.$getExtra,value:function value(){if(!this[u.$extra]){var t=this.edge.children.slice();if(t.length<4)for(var r=t[t.length-1]||new de({}),o=t.length;o<4;o++)t.push(r);var c=t.map((function(t){return t.thickness})),l=[0,0,0,0];if(this.margin){l[0]=this.margin.topInset;l[1]=this.margin.rightInset;l[2]=this.margin.bottomInset;l[3]=this.margin.leftInset}this[u.$extra]={widths:c,insets:l,edges:t}}return this[u.$extra]}},{key:u.$toStyle,value:function value(){var t=this[u.$getExtra]().edges.map((function(t){var r=t[u.$toStyle]();r.color=r.color||"#000000";return r})),r=Object.create(null);this.margin&&Object.assign(r,this.margin[u.$toStyle]());this.fill&&"visible"===this.fill.presence&&Object.assign(r,this.fill[u.$toStyle]());if(this.corner.children.some((function(t){return 0!==t.radius}))){var o=this.corner.children.map((function(t){return t[u.$toStyle]()}));if(2===o.length||3===o.length)for(var c=o[o.length-1],l=o.length;l<4;l++)o.push(c);r.borderRadius=o.map((function(t){return t.radius})).join(" ")}switch(this.presence){case"invisible":case"hidden":r.borderStyle="";break;case"inactive":r.borderStyle="none";break;default:r.borderStyle=t.map((function(t){return t.style})).join(" ")}r.borderWidth=t.map((function(t){return t.width})).join(" ");r.borderColor=t.map((function(t){return t.color})).join(" ");return r}}]);return Border}(u.XFAObject),X=function(t){_inherits(Break,t);var r=_createSuper(Break);function Break(t){var o;_classCallCheck(this,Break);(o=r.call(this,S,"break",!0)).after=(0,m.getStringOption)(t.after,["auto","contentArea","pageArea","pageEven","pageOdd"]);o.afterTarget=t.afterTarget||"";o.before=(0,m.getStringOption)(t.before,["auto","contentArea","pageArea","pageEven","pageOdd"]);o.beforeTarget=t.beforeTarget||"";o.bookendLeader=t.bookendLeader||"";o.bookendTrailer=t.bookendTrailer||"";o.id=t.id||"";o.overflowLeader=t.overflowLeader||"";o.overflowTarget=t.overflowTarget||"";o.overflowTrailer=t.overflowTrailer||"";o.startNew=(0,m.getInteger)({data:t.startNew,defaultValue:0,validate:function validate(t){return 1===t}});o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}return _createClass(Break)}(u.XFAObject),q=function(t){_inherits(BreakAfter,t);var r=_createSuper(BreakAfter);function BreakAfter(t){var o;_classCallCheck(this,BreakAfter);(o=r.call(this,S,"breakAfter",!0)).id=t.id||"";o.leader=t.leader||"";o.startNew=(0,m.getInteger)({data:t.startNew,defaultValue:0,validate:function validate(t){return 1===t}});o.target=t.target||"";o.targetType=(0,m.getStringOption)(t.targetType,["auto","contentArea","pageArea"]);o.trailer=t.trailer||"";o.use=t.use||"";o.usehref=t.usehref||"";o.script=null;return o}return _createClass(BreakAfter)}(u.XFAObject),G=function(t){_inherits(BreakBefore,t);var r=_createSuper(BreakBefore);function BreakBefore(t){var o;_classCallCheck(this,BreakBefore);(o=r.call(this,S,"breakBefore",!0)).id=t.id||"";o.leader=t.leader||"";o.startNew=(0,m.getInteger)({data:t.startNew,defaultValue:0,validate:function validate(t){return 1===t}});o.target=t.target||"";o.targetType=(0,m.getStringOption)(t.targetType,["auto","contentArea","pageArea"]);o.trailer=t.trailer||"";o.use=t.use||"";o.usehref=t.usehref||"";o.script=null;return o}_createClass(BreakBefore,[{key:u.$toHTML,value:function value(t){this[u.$extra]={};return m.HTMLResult.FAILURE}}]);return BreakBefore}(u.XFAObject),z=function(t){_inherits(Button,t);var r=_createSuper(Button);function Button(t){var o;_classCallCheck(this,Button);(o=r.call(this,S,"button",!0)).highlight=(0,m.getStringOption)(t.highlight,["inverted","none","outline","push"]);o.id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}_createClass(Button,[{key:u.$toHTML,value:function value(t){var r,o=this[u.$getParent]()[u.$getParent](),c={name:"button",attributes:{id:this[u.$uid],class:["xfaButton"],style:{}},children:[]},l=_createForOfIteratorHelper(o.event.children);try{for(l.s();!(r=l.n()).done;){var h=r.value;if("click"===h.activity&&h.script){var d=(0,k.recoverJsURL)(h.script[u.$content]);if(d){var y=(0,g.fixURL)(d.url);y&&c.children.push({name:"a",attributes:{id:"link"+this[u.$uid],href:y,newWindow:d.newWindow,class:["xfaLink"],style:{}},children:[]})}}}}catch(t){l.e(t)}finally{l.f()}return m.HTMLResult.success(c)}}]);return Button}(u.XFAObject),W=function(t){_inherits(Calculate,t);var r=_createSuper(Calculate);function Calculate(t){var o;_classCallCheck(this,Calculate);(o=r.call(this,S,"calculate",!0)).id=t.id||"";o.override=(0,m.getStringOption)(t.override,["disabled","error","ignore","warning"]);o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.message=null;o.script=null;return o}return _createClass(Calculate)}(u.XFAObject),V=function(t){_inherits(Caption,t);var r=_createSuper(Caption);function Caption(t){var o;_classCallCheck(this,Caption);(o=r.call(this,S,"caption",!0)).id=t.id||"";o.placement=(0,m.getStringOption)(t.placement,["left","bottom","inline","right","top"]);o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.reserve=Math.ceil((0,m.getMeasurement)(t.reserve));o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.font=null;o.margin=null;o.para=null;o.value=null;return o}_createClass(Caption,[{key:u.$setValue,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){_setValue(this,t)}))},{key:u.$getExtra,value:function value(t){if(!this[u.$extra]){var r=t.width,o=t.height;switch(this.placement){case"left":case"right":case"inline":r=this.reserve<=0?r:this.reserve;break;case"top":case"bottom":o=this.reserve<=0?o:this.reserve}this[u.$extra]=(0,g.layoutNode)(this,{width:r,height:o})}return this[u.$extra]}},{key:u.$toHTML,value:function value(t){if(!this.value)return m.HTMLResult.EMPTY;this[u.$pushPara]();var value=this.value[u.$toHTML](t).html;if(!value){this[u.$popPara]();return m.HTMLResult.EMPTY}var r=this.reserve;if(this.reserve<=0){var o=this[u.$getExtra](t),c=o.w,l=o.h;switch(this.placement){case"left":case"right":case"inline":this.reserve=c;break;case"top":case"bottom":this.reserve=l}}var h=[];"string"==typeof value?h.push({name:"#text",value:value}):h.push(value);var d=(0,g.toStyle)(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(d.width=(0,g.measureToString)(this.reserve));break;case"top":case"bottom":this.reserve>0&&(d.height=(0,g.measureToString)(this.reserve))}(0,g.setPara)(this,null,value);this[u.$popPara]();this.reserve=r;return m.HTMLResult.success({name:"div",attributes:{style:d,class:["xfaCaption"]},children:h})}}]);return Caption}(u.XFAObject),K=function(t){_inherits(Certificate,t);var r=_createSuper(Certificate);function Certificate(t){var o;_classCallCheck(this,Certificate);(o=r.call(this,S,"certificate")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Certificate)}(u.StringObject),Y=function(t){_inherits(Certificates,t);var r=_createSuper(Certificates);function Certificates(t){var o;_classCallCheck(this,Certificates);(o=r.call(this,S,"certificates",!0)).credentialServerPolicy=(0,m.getStringOption)(t.credentialServerPolicy,["optional","required"]);o.id=t.id||"";o.url=t.url||"";o.urlPolicy=t.urlPolicy||"";o.use=t.use||"";o.usehref=t.usehref||"";o.encryption=null;o.issuers=null;o.keyUsage=null;o.oids=null;o.signing=null;o.subjectDNs=null;return o}return _createClass(Certificates)}(u.XFAObject),J=function(t){_inherits(CheckButton,t);var r=_createSuper(CheckButton);function CheckButton(t){var o;_classCallCheck(this,CheckButton);(o=r.call(this,S,"checkButton",!0)).id=t.id||"";o.mark=(0,m.getStringOption)(t.mark,["default","check","circle","cross","diamond","square","star"]);o.shape=(0,m.getStringOption)(t.shape,["square","round"]);o.size=(0,m.getMeasurement)(t.size,"10pt");o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.extras=null;o.margin=null;return o}_createClass(CheckButton,[{key:u.$toHTML,value:function value(t){var r,o,c,l=(0,g.toStyle)("margin"),h=(0,g.measureToString)(this.size);l.width=l.height=h;var d,y=this[u.$getParent]()[u.$getParent](),v=y.items.children.length&&y.items.children[0][u.$toHTML]().html||[],k={on:(void 0!==v[0]?v[0]:"on").toString(),off:(void 0!==v[1]?v[1]:"off").toString()},value=y.value&&y.value[u.$text]()||"off",_=value===k.on||void 0,w=y[u.$getSubformParent](),S=y[u.$uid];if(w instanceof Ce){c=w[u.$uid];r="radio";o="xfaRadio";d=w[u.$data]&&w[u.$data][u.$uid]||w[u.$uid]}else{r="checkbox";o="xfaCheckbox";d=y[u.$data]&&y[u.$data][u.$uid]||y[u.$uid]}var C={name:"input",attributes:{class:[o],style:l,fieldId:S,dataId:d,type:r,checked:_,xfaOn:k.on,xfaOff:k.off,"aria-label":ariaLabel(y)}};c&&(C.attributes.name=c);return m.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[C]})}}]);return CheckButton}(u.XFAObject),Z=function(t){_inherits(ChoiceList,t);var r=_createSuper(ChoiceList);function ChoiceList(t){var o;_classCallCheck(this,ChoiceList);(o=r.call(this,S,"choiceList",!0)).commitOn=(0,m.getStringOption)(t.commitOn,["select","exit"]);o.id=t.id||"";o.open=(0,m.getStringOption)(t.open,["userControl","always","multiSelect","onEntry"]);o.textEntry=(0,m.getInteger)({data:t.textEntry,defaultValue:0,validate:function validate(t){return 1===t}});o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.extras=null;o.margin=null;return o}_createClass(ChoiceList,[{key:u.$toHTML,value:function value(t){var r=(0,g.toStyle)(this,"border","margin"),o=this[u.$getParent]()[u.$getParent](),c=o.font&&o.font.size||10,l={fontSize:"calc(".concat(c,"px * var(--zoom-factor))")},h=[];if(o.items.children.length>0){var d=o.items,y=0,v=0;2===d.children.length&&(v=1-(y=d.children[0].save));for(var k=d.children[y][u.$toHTML]().html,_=d.children[v][u.$toHTML]().html,w=!1,S=o.value&&o.value[u.$text]()||"",C=0,x=k.length;C<x;C++){var O={name:"option",attributes:{value:_[C]||k[C],style:l},value:k[C]};_[C]===S&&(O.attributes.selected=w=!0);h.push(O)}w||h.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}var T={class:["xfaSelect"],fieldId:o[u.$uid],dataId:o[u.$data]&&o[u.$data][u.$uid]||o[u.$uid],style:r,"aria-label":ariaLabel(o)};"multiSelect"===this.open&&(T.multiple=!0);return m.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:h,attributes:T}]})}}]);return ChoiceList}(u.XFAObject),Q=function(t){_inherits(Color,t);var r=_createSuper(Color);function Color(t){var o;_classCallCheck(this,Color);(o=r.call(this,S,"color",!0)).cSpace=(0,m.getStringOption)(t.cSpace,["SRGB"]);o.id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.value=t.value?(0,m.getColor)(t.value):"";o.extras=null;return o}_createClass(Color,[{key:u.$hasSettableValue,value:function value(){return!1}},{key:u.$toStyle,value:function value(){return this.value?y.Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}]);return Color}(u.XFAObject),ee=function(t){_inherits(Comb,t);var r=_createSuper(Comb);function Comb(t){var o;_classCallCheck(this,Comb);(o=r.call(this,S,"comb")).id=t.id||"";o.numberOfCells=(0,m.getInteger)({data:t.numberOfCells,defaultValue:0,validate:function validate(t){return t>=0}});o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Comb)}(u.XFAObject),te=function(t){_inherits(Connect,t);var r=_createSuper(Connect);function Connect(t){var o;_classCallCheck(this,Connect);(o=r.call(this,S,"connect",!0)).connection=t.connection||"";o.id=t.id||"";o.ref=t.ref||"";o.usage=(0,m.getStringOption)(t.usage,["exportAndImport","exportOnly","importOnly"]);o.use=t.use||"";o.usehref=t.usehref||"";o.picture=null;return o}return _createClass(Connect)}(u.XFAObject),re=function(t){_inherits(ContentArea,t);var r=_createSuper(ContentArea);function ContentArea(t){var o;_classCallCheck(this,ContentArea);(o=r.call(this,S,"contentArea",!0)).h=(0,m.getMeasurement)(t.h);o.id=t.id||"";o.name=t.name||"";o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.w=(0,m.getMeasurement)(t.w);o.x=(0,m.getMeasurement)(t.x,"0pt");o.y=(0,m.getMeasurement)(t.y,"0pt");o.desc=null;o.extras=null;return o}_createClass(ContentArea,[{key:u.$toHTML,value:function value(t){var r={left:(0,g.measureToString)(this.x),top:(0,g.measureToString)(this.y),width:(0,g.measureToString)(this.w),height:(0,g.measureToString)(this.h)},o=["xfaContentarea"];(0,g.isPrintOnly)(this)&&o.push("xfaPrintOnly");return m.HTMLResult.success({name:"div",children:[],attributes:{style:r,class:o,id:this[u.$uid]}})}}]);return ContentArea}(u.XFAObject),ae=function(t){_inherits(Corner,t);var r=_createSuper(Corner);function Corner(t){var o;_classCallCheck(this,Corner);(o=r.call(this,S,"corner",!0)).id=t.id||"";o.inverted=(0,m.getInteger)({data:t.inverted,defaultValue:0,validate:function validate(t){return 1===t}});o.join=(0,m.getStringOption)(t.join,["square","round"]);o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.radius=(0,m.getMeasurement)(t.radius);o.stroke=(0,m.getStringOption)(t.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);o.thickness=(0,m.getMeasurement)(t.thickness,"0.5pt");o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;return o}_createClass(Corner,[{key:u.$toStyle,value:function value(){var t=(0,g.toStyle)(this,"visibility");t.radius=(0,g.measureToString)("square"===this.join?0:this.radius);return t}}]);return Corner}(u.XFAObject),ne=function(t){_inherits(DateElement,t);var r=_createSuper(DateElement);function DateElement(t){var o;_classCallCheck(this,DateElement);(o=r.call(this,S,"date")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(DateElement,[{key:u.$finalize,value:function value(){var t=this[u.$content].trim();this[u.$content]=t?new Date(t):null}},{key:u.$toHTML,value:function value(t){return valueToHtml(this[u.$content]?this[u.$content].toString():"")}}]);return DateElement}(u.ContentObject),ie=function(t){_inherits(DateTime,t);var r=_createSuper(DateTime);function DateTime(t){var o;_classCallCheck(this,DateTime);(o=r.call(this,S,"dateTime")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(DateTime,[{key:u.$finalize,value:function value(){var t=this[u.$content].trim();this[u.$content]=t?new Date(t):null}},{key:u.$toHTML,value:function value(t){return valueToHtml(this[u.$content]?this[u.$content].toString():"")}}]);return DateTime}(u.ContentObject),oe=function(t){_inherits(DateTimeEdit,t);var r=_createSuper(DateTimeEdit);function DateTimeEdit(t){var o;_classCallCheck(this,DateTimeEdit);(o=r.call(this,S,"dateTimeEdit",!0)).hScrollPolicy=(0,m.getStringOption)(t.hScrollPolicy,["auto","off","on"]);o.id=t.id||"";o.picker=(0,m.getStringOption)(t.picker,["host","none"]);o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.comb=null;o.extras=null;o.margin=null;return o}_createClass(DateTimeEdit,[{key:u.$toHTML,value:function value(t){var r=(0,g.toStyle)(this,"border","font","margin"),o=this[u.$getParent]()[u.$getParent](),c={name:"input",attributes:{type:"text",fieldId:o[u.$uid],dataId:o[u.$data]&&o[u.$data][u.$uid]||o[u.$uid],class:["xfaTextfield"],style:r,"aria-label":ariaLabel(o)}};return m.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[c]})}}]);return DateTimeEdit}(u.XFAObject),se=function(t){_inherits(Decimal,t);var r=_createSuper(Decimal);function Decimal(t){var o;_classCallCheck(this,Decimal);(o=r.call(this,S,"decimal")).fracDigits=(0,m.getInteger)({data:t.fracDigits,defaultValue:2,validate:function validate(t){return!0}});o.id=t.id||"";o.leadDigits=(0,m.getInteger)({data:t.leadDigits,defaultValue:-1,validate:function validate(t){return!0}});o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Decimal,[{key:u.$finalize,value:function value(){var t=parseFloat(this[u.$content].trim());this[u.$content]=isNaN(t)?null:t}},{key:u.$toHTML,value:function value(t){return valueToHtml(null!==this[u.$content]?this[u.$content].toString():"")}}]);return Decimal}(u.ContentObject),ce=function(t){_inherits(DefaultUi,t);var r=_createSuper(DefaultUi);function DefaultUi(t){var o;_classCallCheck(this,DefaultUi);(o=r.call(this,S,"defaultUi",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}return _createClass(DefaultUi)}(u.XFAObject),le=function(t){_inherits(Desc,t);var r=_createSuper(Desc);function Desc(t){var o;_classCallCheck(this,Desc);(o=r.call(this,S,"desc",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.boolean=new u.XFAObjectArray;o.date=new u.XFAObjectArray;o.dateTime=new u.XFAObjectArray;o.decimal=new u.XFAObjectArray;o.exData=new u.XFAObjectArray;o.float=new u.XFAObjectArray;o.image=new u.XFAObjectArray;o.integer=new u.XFAObjectArray;o.text=new u.XFAObjectArray;o.time=new u.XFAObjectArray;return o}return _createClass(Desc)}(u.XFAObject),ue=function(t){_inherits(DigestMethod,t);var r=_createSuper(DigestMethod);function DigestMethod(t){var o;_classCallCheck(this,DigestMethod);(o=r.call(this,S,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"])).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(DigestMethod)}(u.OptionObject),fe=function(t){_inherits(DigestMethods,t);var r=_createSuper(DigestMethods);function DigestMethods(t){var o;_classCallCheck(this,DigestMethods);(o=r.call(this,S,"digestMethods",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.digestMethod=new u.XFAObjectArray;return o}return _createClass(DigestMethods)}(u.XFAObject),he=function(t){_inherits(Draw,t);var r=_createSuper(Draw);function Draw(t){var o;_classCallCheck(this,Draw);(o=r.call(this,S,"draw",!0)).anchorType=(0,m.getStringOption)(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);o.colSpan=(0,m.getInteger)({data:t.colSpan,defaultValue:1,validate:function validate(t){return t>=1||-1===t}});o.h=t.h?(0,m.getMeasurement)(t.h):"";o.hAlign=(0,m.getStringOption)(t.hAlign,["left","center","justify","justifyAll","radix","right"]);o.id=t.id||"";o.locale=t.locale||"";o.maxH=(0,m.getMeasurement)(t.maxH,"0pt");o.maxW=(0,m.getMeasurement)(t.maxW,"0pt");o.minH=(0,m.getMeasurement)(t.minH,"0pt");o.minW=(0,m.getMeasurement)(t.minW,"0pt");o.name=t.name||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.relevant=(0,m.getRelevant)(t.relevant);o.rotate=(0,m.getInteger)({data:t.rotate,defaultValue:0,validate:function validate(t){return t%90==0}});o.use=t.use||"";o.usehref=t.usehref||"";o.w=t.w?(0,m.getMeasurement)(t.w):"";o.x=(0,m.getMeasurement)(t.x,"0pt");o.y=(0,m.getMeasurement)(t.y,"0pt");o.assist=null;o.border=null;o.caption=null;o.desc=null;o.extras=null;o.font=null;o.keep=null;o.margin=null;o.para=null;o.traversal=null;o.ui=null;o.value=null;o.setProperty=new u.XFAObjectArray;return o}_createClass(Draw,[{key:u.$setValue,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){_setValue(this,t)}))},{key:u.$toHTML,value:function value(t){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence)return m.HTMLResult.EMPTY;(0,g.fixDimensions)(this);this[u.$pushPara]();var r=this.w,o=this.h,c=(0,g.layoutNode)(this,t),l=c.w,h=c.h,y=c.isBroken;if(l&&""===this.w){if(y&&this[u.$getSubformParent]()[u.$isThereMoreWidth]()){this[u.$popPara]();return m.HTMLResult.FAILURE}this.w=l}h&&""===this.h&&(this.h=h);setFirstUnsplittable(this);if(!(0,d.checkDimensions)(this,t)){this.w=r;this.h=o;this[u.$popPara]();return m.HTMLResult.FAILURE}unsetFirstUnsplittable(this);var v=(0,g.toStyle)(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");(0,g.setMinMaxDimensions)(this,v);if(v.margin){v.padding=v.margin;delete v.margin}var k=["xfaDraw"];this.font&&k.push("xfaFont");(0,g.isPrintOnly)(this)&&k.push("xfaPrintOnly");var _={style:v,id:this[u.$uid],class:k};this.name&&(_.xfaName=this.name);var w={name:"div",attributes:_,children:[]};applyAssist(this,_);var S=(0,g.computeBbox)(this,w,t),value=this.value?this.value[u.$toHTML](t).html:null;if(null===value){this.w=r;this.h=o;this[u.$popPara]();return m.HTMLResult.success((0,g.createWrapper)(this,w),S)}w.children.push(value);(0,g.setPara)(this,v,value);this.w=r;this.h=o;this[u.$popPara]();return m.HTMLResult.success((0,g.createWrapper)(this,w),S)}}]);return Draw}(u.XFAObject),de=function(t){_inherits(Edge,t);var r=_createSuper(Edge);function Edge(t){var o;_classCallCheck(this,Edge);(o=r.call(this,S,"edge",!0)).cap=(0,m.getStringOption)(t.cap,["square","butt","round"]);o.id=t.id||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.stroke=(0,m.getStringOption)(t.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);o.thickness=(0,m.getMeasurement)(t.thickness,"0.5pt");o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;return o}_createClass(Edge,[{key:u.$toStyle,value:function value(){var t=(0,g.toStyle)(this,"visibility");Object.assign(t,{linecap:this.cap,width:(0,g.measureToString)(this.thickness),color:this.color?this.color[u.$toStyle]():"#000000",style:""});if("visible"!==this.presence)t.style="none";else switch(this.stroke){case"solid":t.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":t.style="dashed";break;case"dotted":t.style="dotted";break;case"embossed":t.style="ridge";break;case"etched":t.style="groove";break;case"lowered":t.style="inset";break;case"raised":t.style="outset"}return t}}]);return Edge}(u.XFAObject),pe=function(t){_inherits(Encoding,t);var r=_createSuper(Encoding);function Encoding(t){var o;_classCallCheck(this,Encoding);(o=r.call(this,S,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"])).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Encoding)}(u.OptionObject),ge=function(t){_inherits(Encodings,t);var r=_createSuper(Encodings);function Encodings(t){var o;_classCallCheck(this,Encodings);(o=r.call(this,S,"encodings",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.encoding=new u.XFAObjectArray;return o}return _createClass(Encodings)}(u.XFAObject),me=function(t){_inherits(Encrypt,t);var r=_createSuper(Encrypt);function Encrypt(t){var o;_classCallCheck(this,Encrypt);(o=r.call(this,S,"encrypt",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.certificate=null;return o}return _createClass(Encrypt)}(u.XFAObject),ye=function(t){_inherits(EncryptData,t);var r=_createSuper(EncryptData);function EncryptData(t){var o;_classCallCheck(this,EncryptData);(o=r.call(this,S,"encryptData",!0)).id=t.id||"";o.operation=(0,m.getStringOption)(t.operation,["encrypt","decrypt"]);o.target=t.target||"";o.use=t.use||"";o.usehref=t.usehref||"";o.filter=null;o.manifest=null;return o}return _createClass(EncryptData)}(u.XFAObject),ve=function(t){_inherits(Encryption,t);var r=_createSuper(Encryption);function Encryption(t){var o;_classCallCheck(this,Encryption);(o=r.call(this,S,"encryption",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.certificate=new u.XFAObjectArray;return o}return _createClass(Encryption)}(u.XFAObject),be=function(t){_inherits(EncryptionMethod,t);var r=_createSuper(EncryptionMethod);function EncryptionMethod(t){var o;_classCallCheck(this,EncryptionMethod);(o=r.call(this,S,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"])).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(EncryptionMethod)}(u.OptionObject),ke=function(t){_inherits(EncryptionMethods,t);var r=_createSuper(EncryptionMethods);function EncryptionMethods(t){var o;_classCallCheck(this,EncryptionMethods);(o=r.call(this,S,"encryptionMethods",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.encryptionMethod=new u.XFAObjectArray;return o}return _createClass(EncryptionMethods)}(u.XFAObject),_e=function(t){_inherits(Event,t);var r=_createSuper(Event);function Event(t){var o;_classCallCheck(this,Event);(o=r.call(this,S,"event",!0)).activity=(0,m.getStringOption)(t.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]);o.id=t.id||"";o.listen=(0,m.getStringOption)(t.listen,["refOnly","refAndDescendents"]);o.name=t.name||"";o.ref=t.ref||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.encryptData=null;o.execute=null;o.script=null;o.signData=null;o.submit=null;return o}return _createClass(Event)}(u.XFAObject),we=function(t){_inherits(ExData,t);var r=_createSuper(ExData);function ExData(t){var o;_classCallCheck(this,ExData);(o=r.call(this,S,"exData")).contentType=t.contentType||"";o.href=t.href||"";o.id=t.id||"";o.maxLength=(0,m.getInteger)({data:t.maxLength,defaultValue:-1,validate:function validate(t){return t>=-1}});o.name=t.name||"";o.rid=t.rid||"";o.transferEncoding=(0,m.getStringOption)(t.transferEncoding,["none","base64","package"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(ExData,[{key:u.$isCDATAXml,value:function value(){return"text/html"===this.contentType}},{key:u.$onChild,value:function value(t){if("text/html"===this.contentType&&t[u.$namespaceId]===h.NamespaceIds.xhtml.id){this[u.$content]=t;return!0}if("text/xml"===this.contentType){this[u.$content]=t;return!0}return!1}},{key:u.$toHTML,value:function value(t){return"text/html"===this.contentType&&this[u.$content]?this[u.$content][u.$toHTML](t):m.HTMLResult.EMPTY}}]);return ExData}(u.ContentObject),Se=function(t){_inherits(ExObject,t);var r=_createSuper(ExObject);function ExObject(t){var o;_classCallCheck(this,ExObject);(o=r.call(this,S,"exObject",!0)).archive=t.archive||"";o.classId=t.classId||"";o.codeBase=t.codeBase||"";o.codeType=t.codeType||"";o.id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.boolean=new u.XFAObjectArray;o.date=new u.XFAObjectArray;o.dateTime=new u.XFAObjectArray;o.decimal=new u.XFAObjectArray;o.exData=new u.XFAObjectArray;o.exObject=new u.XFAObjectArray;o.float=new u.XFAObjectArray;o.image=new u.XFAObjectArray;o.integer=new u.XFAObjectArray;o.text=new u.XFAObjectArray;o.time=new u.XFAObjectArray;return o}return _createClass(ExObject)}(u.XFAObject),Ce=function(t){_inherits(ExclGroup,t);var r=_createSuper(ExclGroup);function ExclGroup(t){var o;_classCallCheck(this,ExclGroup);(o=r.call(this,S,"exclGroup",!0)).access=(0,m.getStringOption)(t.access,["open","nonInteractive","protected","readOnly"]);o.accessKey=t.accessKey||"";o.anchorType=(0,m.getStringOption)(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);o.colSpan=(0,m.getInteger)({data:t.colSpan,defaultValue:1,validate:function validate(t){return t>=1||-1===t}});o.h=t.h?(0,m.getMeasurement)(t.h):"";o.hAlign=(0,m.getStringOption)(t.hAlign,["left","center","justify","justifyAll","radix","right"]);o.id=t.id||"";o.layout=(0,m.getStringOption)(t.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);o.maxH=(0,m.getMeasurement)(t.maxH,"0pt");o.maxW=(0,m.getMeasurement)(t.maxW,"0pt");o.minH=(0,m.getMeasurement)(t.minH,"0pt");o.minW=(0,m.getMeasurement)(t.minW,"0pt");o.name=t.name||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.w=t.w?(0,m.getMeasurement)(t.w):"";o.x=(0,m.getMeasurement)(t.x,"0pt");o.y=(0,m.getMeasurement)(t.y,"0pt");o.assist=null;o.bind=null;o.border=null;o.calculate=null;o.caption=null;o.desc=null;o.extras=null;o.margin=null;o.para=null;o.traversal=null;o.validate=null;o.connect=new u.XFAObjectArray;o.event=new u.XFAObjectArray;o.field=new u.XFAObjectArray;o.setProperty=new u.XFAObjectArray;return o}_createClass(ExclGroup,[{key:u.$isBindable,value:function value(){return!0}},{key:u.$hasSettableValue,value:function value(){return!0}},{key:u.$setValue,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){var r,o=_createForOfIteratorHelper(this.field.children);try{for(o.s();!(r=o.n()).done;){var c=r.value;if(!c.value){var l=new Bt({});c[u.$appendChild](l);c.value=l}c.value[u.$setValue](t)}}catch(t){o.e(t)}finally{o.f()}}))},{key:u.$isThereMoreWidth,value:function value(){return this.layout.endsWith("-tb")&&0===this[u.$extra].attempt&&this[u.$extra].numberInLine>0||this[u.$getParent]()[u.$isThereMoreWidth]()}},{key:u.$isSplittable,value:function value(){var t=this[u.$getSubformParent]();if(!t[u.$isSplittable]())return!1;if(void 0!==this[u.$extra]._isSplittable)return this[u.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[u.$extra]._isSplittable=!1;return!1}if(t.layout&&t.layout.endsWith("-tb")&&0!==t[u.$extra].numberInLine)return!1;this[u.$extra]._isSplittable=!0;return!0}},{key:u.$flushHTML,value:function value(){return(0,d.flushHTML)(this)}},{key:u.$addHTML,value:function value(t,r){(0,d.addHTML)(this,t,r)}},{key:u.$getAvailableSpace,value:function value(){return(0,d.getAvailableSpace)(this)}},{key:u.$toHTML,value:function value(t){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return m.HTMLResult.EMPTY;(0,g.fixDimensions)(this);var r=[],o={id:this[u.$uid],class:[]};(0,g.setAccess)(this,o.class);this[u.$extra]||(this[u.$extra]=Object.create(null));Object.assign(this[u.$extra],{children:r,attributes:o,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,t.width),height:Math.min(this.h||1/0,t.height)},width:0,height:0,prevHeight:0,currentWidth:0});var c=this[u.$isSplittable]();c||setFirstUnsplittable(this);if(!(0,d.checkDimensions)(this,t))return m.HTMLResult.FAILURE;var l=new Set(["field"]);if(this.layout.includes("row")){var h=this[u.$getSubformParent]().columnWidths;if(Array.isArray(h)&&h.length>0){this[u.$extra].columnWidths=h;this[u.$extra].currentColumn=0}}var y=(0,g.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),v=["xfaExclgroup"],k=(0,g.layoutClass)(this);k&&v.push(k);(0,g.isPrintOnly)(this)&&v.push("xfaPrintOnly");o.style=y;o.class=v;this.name&&(o.xfaName=this.name);this[u.$pushPara]();for(var _="lr-tb"===this.layout||"rl-tb"===this.layout,w=_?2:1;this[u.$extra].attempt<w;this[u.$extra].attempt++){_&&1===this[u.$extra].attempt&&(this[u.$extra].numberInLine=0);var S=this[u.$childrenToHTML]({filter:l,include:!0});if(S.success)break;if(S.isBreak()){this[u.$popPara]();return S}if(_&&0===this[u.$extra].attempt&&0===this[u.$extra].numberInLine&&!this[u.$getTemplateRoot]()[u.$extra].noLayoutFailure){this[u.$extra].attempt=w;break}}this[u.$popPara]();c||unsetFirstUnsplittable(this);if(this[u.$extra].attempt===w){c||delete this[u.$extra];return m.HTMLResult.FAILURE}var C=0,x=0;if(this.margin){C=this.margin.leftInset+this.margin.rightInset;x=this.margin.topInset+this.margin.bottomInset}var O=Math.max(this[u.$extra].width+C,this.w||0),T=Math.max(this[u.$extra].height+x,this.h||0),E=[this.x,this.y,O,T];""===this.w&&(y.width=(0,g.measureToString)(O));""===this.h&&(y.height=(0,g.measureToString)(T));var M={name:"div",attributes:o,children:r};applyAssist(this,o);delete this[u.$extra];return m.HTMLResult.success((0,g.createWrapper)(this,M),E)}}]);return ExclGroup}(u.XFAObject),xe=function(t){_inherits(Execute,t);var r=_createSuper(Execute);function Execute(t){var o;_classCallCheck(this,Execute);(o=r.call(this,S,"execute")).connection=t.connection||"";o.executeType=(0,m.getStringOption)(t.executeType,["import","remerge"]);o.id=t.id||"";o.runAt=(0,m.getStringOption)(t.runAt,["client","both","server"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Execute)}(u.XFAObject),Oe=function(t){_inherits(Extras,t);var r=_createSuper(Extras);function Extras(t){var o;_classCallCheck(this,Extras);(o=r.call(this,S,"extras",!0)).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";o.boolean=new u.XFAObjectArray;o.date=new u.XFAObjectArray;o.dateTime=new u.XFAObjectArray;o.decimal=new u.XFAObjectArray;o.exData=new u.XFAObjectArray;o.extras=new u.XFAObjectArray;o.float=new u.XFAObjectArray;o.image=new u.XFAObjectArray;o.integer=new u.XFAObjectArray;o.text=new u.XFAObjectArray;o.time=new u.XFAObjectArray;return o}return _createClass(Extras)}(u.XFAObject),Ae=function(t){_inherits(Field,t);var r=_createSuper(Field);function Field(t){var o;_classCallCheck(this,Field);(o=r.call(this,S,"field",!0)).access=(0,m.getStringOption)(t.access,["open","nonInteractive","protected","readOnly"]);o.accessKey=t.accessKey||"";o.anchorType=(0,m.getStringOption)(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);o.colSpan=(0,m.getInteger)({data:t.colSpan,defaultValue:1,validate:function validate(t){return t>=1||-1===t}});o.h=t.h?(0,m.getMeasurement)(t.h):"";o.hAlign=(0,m.getStringOption)(t.hAlign,["left","center","justify","justifyAll","radix","right"]);o.id=t.id||"";o.locale=t.locale||"";o.maxH=(0,m.getMeasurement)(t.maxH,"0pt");o.maxW=(0,m.getMeasurement)(t.maxW,"0pt");o.minH=(0,m.getMeasurement)(t.minH,"0pt");o.minW=(0,m.getMeasurement)(t.minW,"0pt");o.name=t.name||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.relevant=(0,m.getRelevant)(t.relevant);o.rotate=(0,m.getInteger)({data:t.rotate,defaultValue:0,validate:function validate(t){return t%90==0}});o.use=t.use||"";o.usehref=t.usehref||"";o.w=t.w?(0,m.getMeasurement)(t.w):"";o.x=(0,m.getMeasurement)(t.x,"0pt");o.y=(0,m.getMeasurement)(t.y,"0pt");o.assist=null;o.bind=null;o.border=null;o.calculate=null;o.caption=null;o.desc=null;o.extras=null;o.font=null;o.format=null;o.items=new u.XFAObjectArray(2);o.keep=null;o.margin=null;o.para=null;o.traversal=null;o.ui=null;o.validate=null;o.value=null;o.bindItems=new u.XFAObjectArray;o.connect=new u.XFAObjectArray;o.event=new u.XFAObjectArray;o.setProperty=new u.XFAObjectArray;return o}_createClass(Field,[{key:u.$isBindable,value:function value(){return!0}},{key:u.$setValue,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){_setValue(this,t)}))},{key:u.$toHTML,value:function value(t){setTabIndex(this);if(!this.ui){this.ui=new jt({});this.ui[u.$globalData]=this[u.$globalData];this[u.$appendChild](this.ui);var r;switch(this.items.children.length){case 0:r=new Tt({});this.ui.textEdit=r;break;case 1:r=new J({});this.ui.checkButton=r;break;case 2:r=new Z({});this.ui.choiceList=r}this.ui[u.$appendChild](r)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return m.HTMLResult.EMPTY;this.caption&&delete this.caption[u.$extra];this[u.$pushPara]();var o=this.caption?this.caption[u.$toHTML](t).html:null,c=this.w,l=this.h,h=0,y=0;if(this.margin){h=this.margin.leftInset+this.margin.rightInset;y=this.margin.topInset+this.margin.bottomInset}var k=null;if(""===this.w||""===this.h){var _=null,w=null,S=0,C=0;if(this.ui.checkButton)S=C=this.ui.checkButton.size;else{var x=(0,g.layoutNode)(this,t),O=x.w,T=x.h;if(null!==O){S=O;C=T}else C=(0,v.getMetrics)(this.font,!0).lineNoGap}S+=(k=getBorderDims(this.ui[u.$getExtra]())).w;C+=k.h;if(this.caption){var E=this.caption[u.$getExtra](t),M=E.w,R=E.h;if(E.isBroken&&this[u.$getSubformParent]()[u.$isThereMoreWidth]()){this[u.$popPara]();return m.HTMLResult.FAILURE}_=M;w=R;switch(this.caption.placement){case"left":case"right":case"inline":_+=S;break;case"top":case"bottom":w+=C}}else{_=S;w=C}if(_&&""===this.w){_+=h;this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<_?_:this.minW)}if(w&&""===this.h){w+=y;this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<w?w:this.minH)}}this[u.$popPara]();(0,g.fixDimensions)(this);setFirstUnsplittable(this);if(!(0,d.checkDimensions)(this,t)){this.w=c;this.h=l;this[u.$popPara]();return m.HTMLResult.FAILURE}unsetFirstUnsplittable(this);var j=(0,g.toStyle)(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");(0,g.setMinMaxDimensions)(this,j);var D=["xfaField"];this.font&&D.push("xfaFont");(0,g.isPrintOnly)(this)&&D.push("xfaPrintOnly");var L={style:j,id:this[u.$uid],class:D};if(j.margin){j.padding=j.margin;delete j.margin}(0,g.setAccess)(this,D);this.name&&(L.xfaName=this.name);var N=[],U={name:"div",attributes:L,children:N};applyAssist(this,L);var H=this.border?this.border[u.$toStyle]():null,$=(0,g.computeBbox)(this,U,t),X=this.ui[u.$toHTML]().html;if(!X){Object.assign(j,H);return m.HTMLResult.success((0,g.createWrapper)(this,U),$)}this[u.$tabIndex]&&(X.children&&X.children[0]?X.children[0].attributes.tabindex=this[u.$tabIndex]:X.attributes.tabindex=this[u.$tabIndex]);X.attributes.style||(X.attributes.style=Object.create(null));var q=null;if(this.ui.button){if(1===X.children.length){q=_slicedToArray(X.children.splice(0,1),1)[0]}Object.assign(X.attributes.style,H)}else Object.assign(j,H);N.push(X);if(this.value)if(this.ui.imageEdit)X.children.push(this.value[u.$toHTML]().html);else if(!this.ui.button){var G="";if(this.value.exData)G=this.value.exData[u.$text]();else if(this.value.text)G=this.value.text[u.$getExtra]();else{var z=this.value[u.$toHTML]().html;null!==z&&(G=z.children[0].value)}this.ui.textEdit&&this.value.text&&this.value.text.maxChars&&(X.children[0].attributes.maxLength=this.value.text.maxChars);if(G){if(this.ui.numericEdit){G=parseFloat(G);G=isNaN(G)?"":G.toString()}"textarea"===X.children[0].name?X.children[0].attributes.textContent=G:X.children[0].attributes.value=G}}if(!this.ui.imageEdit&&X.children&&X.children[0]&&this.h){k=k||getBorderDims(this.ui[u.$getExtra]());var W=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){(W=this.caption.reserve)<=0&&(W=this.caption[u.$getExtra](t).h);var V=this.h-W-y-k.h;X.children[0].attributes.style.height=(0,g.measureToString)(V)}else X.children[0].attributes.style.height="100%"}q&&X.children.push(q);if(!o){X.attributes.class&&X.attributes.class.push("xfaLeft");this.w=c;this.h=l;return m.HTMLResult.success((0,g.createWrapper)(this,U),$)}if(this.ui.button){j.padding&&delete j.padding;"div"===o.name&&(o.name="span");X.children.push(o);return m.HTMLResult.success(U,$)}this.ui.checkButton&&(o.attributes.class[0]="xfaCaptionForCheckButton");X.attributes.class||(X.attributes.class=[]);X.children.splice(0,0,o);switch(this.caption.placement){case"left":case"inline":X.attributes.class.push("xfaLeft");break;case"right":X.attributes.class.push("xfaRight");break;case"top":X.attributes.class.push("xfaTop");break;case"bottom":X.attributes.class.push("xfaBottom")}this.w=c;this.h=l;return m.HTMLResult.success((0,g.createWrapper)(this,U),$)}}]);return Field}(u.XFAObject);r.Field=Ae;var Pe=function(t){_inherits(Fill,t);var r=_createSuper(Fill);function Fill(t){var o;_classCallCheck(this,Fill);(o=r.call(this,S,"fill",!0)).id=t.id||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;o.linear=null;o.pattern=null;o.radial=null;o.solid=null;o.stipple=null;return o}_createClass(Fill,[{key:u.$toStyle,value:function value(){var t=this[u.$getParent](),r=t[u.$getParent]()[u.$getParent](),o=Object.create(null),c="color",l=c;if(t instanceof $){c="background-color";l="background";r instanceof jt&&(o.backgroundColor="white")}if(t instanceof ft||t instanceof M){c=l="fill";o.fill="white"}var h,d=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(d.s();!(h=d.n()).done;){var g=h.value;if("extras"!==g&&"color"!==g){var m=this[g];if(m instanceof u.XFAObject){var y=m[u.$toStyle](this.color);y&&(o[y.startsWith("#")?c:l]=y);return o}}}}catch(t){d.e(t)}finally{d.f()}if(this.color&&this.color.value){var v=this.color[u.$toStyle]();o[v.startsWith("#")?c:l]=v}return o}}]);return Fill}(u.XFAObject),Te=function(t){_inherits(Filter,t);var r=_createSuper(Filter);function Filter(t){var o;_classCallCheck(this,Filter);(o=r.call(this,S,"filter",!0)).addRevocationInfo=(0,m.getStringOption)(t.addRevocationInfo,["","required","optional","none"]);o.id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";o.version=(0,m.getInteger)({data:o.version,defaultValue:5,validate:function validate(t){return t>=1&&t<=5}});o.appearanceFilter=null;o.certificates=null;o.digestMethods=null;o.encodings=null;o.encryptionMethods=null;o.handler=null;o.lockDocument=null;o.mdp=null;o.reasons=null;o.timeStamp=null;return o}return _createClass(Filter)}(u.XFAObject),Fe=function(t){_inherits(Float,t);var r=_createSuper(Float);function Float(t){var o;_classCallCheck(this,Float);(o=r.call(this,S,"float")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Float,[{key:u.$finalize,value:function value(){var t=parseFloat(this[u.$content].trim());this[u.$content]=isNaN(t)?null:t}},{key:u.$toHTML,value:function value(t){return valueToHtml(null!==this[u.$content]?this[u.$content].toString():"")}}]);return Float}(u.ContentObject),Ie=function(t){_inherits(Font,t);var r=_createSuper(Font);function Font(t){var o;_classCallCheck(this,Font);(o=r.call(this,S,"font",!0)).baselineShift=(0,m.getMeasurement)(t.baselineShift);o.fontHorizontalScale=(0,m.getFloat)({data:t.fontHorizontalScale,defaultValue:100,validate:function validate(t){return t>=0}});o.fontVerticalScale=(0,m.getFloat)({data:t.fontVerticalScale,defaultValue:100,validate:function validate(t){return t>=0}});o.id=t.id||"";o.kerningMode=(0,m.getStringOption)(t.kerningMode,["none","pair"]);o.letterSpacing=(0,m.getMeasurement)(t.letterSpacing,"0");o.lineThrough=(0,m.getInteger)({data:t.lineThrough,defaultValue:0,validate:function validate(t){return 1===t||2===t}});o.lineThroughPeriod=(0,m.getStringOption)(t.lineThroughPeriod,["all","word"]);o.overline=(0,m.getInteger)({data:t.overline,defaultValue:0,validate:function validate(t){return 1===t||2===t}});o.overlinePeriod=(0,m.getStringOption)(t.overlinePeriod,["all","word"]);o.posture=(0,m.getStringOption)(t.posture,["normal","italic"]);o.size=(0,m.getMeasurement)(t.size,"10pt");o.typeface=t.typeface||"Courier";o.underline=(0,m.getInteger)({data:t.underline,defaultValue:0,validate:function validate(t){return 1===t||2===t}});o.underlinePeriod=(0,m.getStringOption)(t.underlinePeriod,["all","word"]);o.use=t.use||"";o.usehref=t.usehref||"";o.weight=(0,m.getStringOption)(t.weight,["normal","bold"]);o.extras=null;o.fill=null;return o}_createClass(Font,[{key:u.$clean,value:function value(t){_get(_getPrototypeOf(Font.prototype),u.$clean,this).call(this,t);this[u.$globalData].usedTypefaces.add(this.typeface)}},{key:u.$toStyle,value:function value(){var t=(0,g.toStyle)(this,"fill"),r=t.color;if(r)if("#000000"===r)delete t.color;else if(!r.startsWith("#")){t.background=r;t.backgroundClip="text";t.color="transparent"}this.baselineShift&&(t.verticalAlign=(0,g.measureToString)(this.baselineShift));t.fontKerning="none"===this.kerningMode?"none":"normal";t.letterSpacing=(0,g.measureToString)(this.letterSpacing);if(0!==this.lineThrough){t.textDecoration="line-through";2===this.lineThrough&&(t.textDecorationStyle="double")}if(0!==this.overline){t.textDecoration="overline";2===this.overline&&(t.textDecorationStyle="double")}t.fontStyle=this.posture;t.fontSize=(0,g.measureToString)(.99*this.size);(0,g.setFontFamily)(this,this,this[u.$globalData].fontFinder,t);if(0!==this.underline){t.textDecoration="underline";2===this.underline&&(t.textDecorationStyle="double")}t.fontWeight=this.weight;return t}}]);return Font}(u.XFAObject),Ee=function(t){_inherits(Format,t);var r=_createSuper(Format);function Format(t){var o;_classCallCheck(this,Format);(o=r.call(this,S,"format",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.picture=null;return o}return _createClass(Format)}(u.XFAObject),Me=function(t){_inherits(Handler,t);var r=_createSuper(Handler);function Handler(t){var o;_classCallCheck(this,Handler);(o=r.call(this,S,"handler")).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Handler)}(u.StringObject),Re=function(t){_inherits(Hyphenation,t);var r=_createSuper(Hyphenation);function Hyphenation(t){var o;_classCallCheck(this,Hyphenation);(o=r.call(this,S,"hyphenation")).excludeAllCaps=(0,m.getInteger)({data:t.excludeAllCaps,defaultValue:0,validate:function validate(t){return 1===t}});o.excludeInitialCap=(0,m.getInteger)({data:t.excludeInitialCap,defaultValue:0,validate:function validate(t){return 1===t}});o.hyphenate=(0,m.getInteger)({data:t.hyphenate,defaultValue:0,validate:function validate(t){return 1===t}});o.id=t.id||"";o.pushCharacterCount=(0,m.getInteger)({data:t.pushCharacterCount,defaultValue:3,validate:function validate(t){return t>=0}});o.remainCharacterCount=(0,m.getInteger)({data:t.remainCharacterCount,defaultValue:3,validate:function validate(t){return t>=0}});o.use=t.use||"";o.usehref=t.usehref||"";o.wordCharacterCount=(0,m.getInteger)({data:t.wordCharacterCount,defaultValue:7,validate:function validate(t){return t>=0}});return o}return _createClass(Hyphenation)}(u.XFAObject),je=function(t){_inherits(Image,t);var r=_createSuper(Image);function Image(t){var o;_classCallCheck(this,Image);(o=r.call(this,S,"image")).aspect=(0,m.getStringOption)(t.aspect,["fit","actual","height","none","width"]);o.contentType=t.contentType||"";o.href=t.href||"";o.id=t.id||"";o.name=t.name||"";o.transferEncoding=(0,m.getStringOption)(t.transferEncoding,["base64","none","package"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Image,[{key:u.$toHTML,value:function value(){if(this.contentType&&!O.has(this.contentType.toLowerCase()))return m.HTMLResult.EMPTY;var t=this[u.$globalData].images&&this[u.$globalData].images.get(this.href);if(!t&&(this.href||!this[u.$content]))return m.HTMLResult.EMPTY;t||"base64"!==this.transferEncoding||(t=(0,y.stringToBytes)(atob(this[u.$content])));if(!t)return m.HTMLResult.EMPTY;if(!this.contentType){var r,o=_createForOfIteratorHelper(T);try{for(o.s();!(r=o.n()).done;){var c=_slicedToArray(r.value,2),l=c[0],h=c[1];if(t.length>l.length&&l.every((function(r,o){return r===t[o]}))){this.contentType=h;break}}}catch(t){o.e(t)}finally{o.f()}if(!this.contentType)return m.HTMLResult.EMPTY}var d,g=new Blob([t],{type:this.contentType});switch(this.aspect){case"fit":case"actual":break;case"height":d={height:"100%",objectFit:"fill"};break;case"none":d={width:"100%",height:"100%",objectFit:"fill"};break;case"width":d={width:"100%",objectFit:"fill"}}var v=this[u.$getParent]();return m.HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:d,src:URL.createObjectURL(g),alt:v?ariaLabel(v[u.$getParent]()):null}})}}]);return Image}(u.StringObject),De=function(t){_inherits(ImageEdit,t);var r=_createSuper(ImageEdit);function ImageEdit(t){var o;_classCallCheck(this,ImageEdit);(o=r.call(this,S,"imageEdit",!0)).data=(0,m.getStringOption)(t.data,["link","embed"]);o.id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.extras=null;o.margin=null;return o}_createClass(ImageEdit,[{key:u.$toHTML,value:function value(t){return"embed"===this.data?m.HTMLResult.success({name:"div",children:[],attributes:{}}):m.HTMLResult.EMPTY}}]);return ImageEdit}(u.XFAObject),Be=function(t){_inherits(Integer,t);var r=_createSuper(Integer);function Integer(t){var o;_classCallCheck(this,Integer);(o=r.call(this,S,"integer")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Integer,[{key:u.$finalize,value:function value(){var t=parseInt(this[u.$content].trim(),10);this[u.$content]=isNaN(t)?null:t}},{key:u.$toHTML,value:function value(t){return valueToHtml(null!==this[u.$content]?this[u.$content].toString():"")}}]);return Integer}(u.ContentObject),Le=function(t){_inherits(Issuers,t);var r=_createSuper(Issuers);function Issuers(t){var o;_classCallCheck(this,Issuers);(o=r.call(this,S,"issuers",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.certificate=new u.XFAObjectArray;return o}return _createClass(Issuers)}(u.XFAObject),Ne=function(t){_inherits(Items,t);var r=_createSuper(Items);function Items(t){var o;_classCallCheck(this,Items);(o=r.call(this,S,"items",!0)).id=t.id||"";o.name=t.name||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.ref=t.ref||"";o.save=(0,m.getInteger)({data:t.save,defaultValue:0,validate:function validate(t){return 1===t}});o.use=t.use||"";o.usehref=t.usehref||"";o.boolean=new u.XFAObjectArray;o.date=new u.XFAObjectArray;o.dateTime=new u.XFAObjectArray;o.decimal=new u.XFAObjectArray;o.exData=new u.XFAObjectArray;o.float=new u.XFAObjectArray;o.image=new u.XFAObjectArray;o.integer=new u.XFAObjectArray;o.text=new u.XFAObjectArray;o.time=new u.XFAObjectArray;return o}_createClass(Items,[{key:u.$toHTML,value:function value(){var t,r=[],o=_createForOfIteratorHelper(this[u.$getChildren]());try{for(o.s();!(t=o.n()).done;){var c=t.value;r.push(c[u.$text]())}}catch(t){o.e(t)}finally{o.f()}return m.HTMLResult.success(r)}}]);return Items}(u.XFAObject);r.Items=Ne;var Ue=function(t){_inherits(Keep,t);var r=_createSuper(Keep);function Keep(t){var o;_classCallCheck(this,Keep);(o=r.call(this,S,"keep",!0)).id=t.id||"";var c=["none","contentArea","pageArea"];o.intact=(0,m.getStringOption)(t.intact,c);o.next=(0,m.getStringOption)(t.next,c);o.previous=(0,m.getStringOption)(t.previous,c);o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}return _createClass(Keep)}(u.XFAObject),He=function(t){_inherits(KeyUsage,t);var r=_createSuper(KeyUsage);function KeyUsage(t){var o;_classCallCheck(this,KeyUsage);var c=["","yes","no"];(o=r.call(this,S,"keyUsage")).crlSign=(0,m.getStringOption)(t.crlSign,c);o.dataEncipherment=(0,m.getStringOption)(t.dataEncipherment,c);o.decipherOnly=(0,m.getStringOption)(t.decipherOnly,c);o.digitalSignature=(0,m.getStringOption)(t.digitalSignature,c);o.encipherOnly=(0,m.getStringOption)(t.encipherOnly,c);o.id=t.id||"";o.keyAgreement=(0,m.getStringOption)(t.keyAgreement,c);o.keyCertSign=(0,m.getStringOption)(t.keyCertSign,c);o.keyEncipherment=(0,m.getStringOption)(t.keyEncipherment,c);o.nonRepudiation=(0,m.getStringOption)(t.nonRepudiation,c);o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(KeyUsage)}(u.XFAObject),$e=function(t){_inherits(Line,t);var r=_createSuper(Line);function Line(t){var o;_classCallCheck(this,Line);(o=r.call(this,S,"line",!0)).hand=(0,m.getStringOption)(t.hand,["even","left","right"]);o.id=t.id||"";o.slope=(0,m.getStringOption)(t.slope,["\\","/"]);o.use=t.use||"";o.usehref=t.usehref||"";o.edge=null;return o}_createClass(Line,[{key:u.$toHTML,value:function value(){var t,r,o,c,l=this[u.$getParent]()[u.$getParent](),h=this.edge?this.edge:new de({}),d=h[u.$toStyle](),y=Object.create(null),v="visible"===h.presence?h.thickness:0;y.strokeWidth=(0,g.measureToString)(v);y.stroke=d.color;var k="100%",_="100%";if(l.w<=v){t="50%";r=0;o="50%";c="100%";k=y.strokeWidth}else if(l.h<=v){t=0;r="50%";o="100%";c="50%";_=y.strokeWidth}else if("\\"===this.slope){t=0;r=0;o="100%";c="100%"}else{t=0;r="100%";o="100%";c=0}var w={name:"svg",children:[{name:"line",attributes:{xmlns:C,x1:t,y1:r,x2:o,y2:c,style:y}}],attributes:{xmlns:C,width:k,height:_,style:{overflow:"visible"}}};if(hasMargin(l))return m.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[w]});w.attributes.style.position="absolute";return m.HTMLResult.success(w)}}]);return Line}(u.XFAObject),Xe=function(t){_inherits(Linear,t);var r=_createSuper(Linear);function Linear(t){var o;_classCallCheck(this,Linear);(o=r.call(this,S,"linear",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["toRight","toBottom","toLeft","toTop"]);o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;return o}_createClass(Linear,[{key:u.$toStyle,value:function value(t){t=t?t[u.$toStyle]():"#FFFFFF";var r=this.type.replace(/([RBLT])/," $1").toLowerCase(),o=this.color?this.color[u.$toStyle]():"#000000";return"linear-gradient(".concat(r,", ").concat(t,", ").concat(o,")")}}]);return Linear}(u.XFAObject),qe=function(t){_inherits(LockDocument,t);var r=_createSuper(LockDocument);function LockDocument(t){var o;_classCallCheck(this,LockDocument);(o=r.call(this,S,"lockDocument")).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(LockDocument,[{key:u.$finalize,value:function value(){this[u.$content]=(0,m.getStringOption)(this[u.$content],["auto","0","1"])}}]);return LockDocument}(u.ContentObject),Ge=function(t){_inherits(Manifest,t);var r=_createSuper(Manifest);function Manifest(t){var o;_classCallCheck(this,Manifest);(o=r.call(this,S,"manifest",!0)).action=(0,m.getStringOption)(t.action,["include","all","exclude"]);o.id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.ref=new u.XFAObjectArray;return o}return _createClass(Manifest)}(u.XFAObject),ze=function(t){_inherits(Margin,t);var r=_createSuper(Margin);function Margin(t){var o;_classCallCheck(this,Margin);(o=r.call(this,S,"margin",!0)).bottomInset=(0,m.getMeasurement)(t.bottomInset,"0");o.id=t.id||"";o.leftInset=(0,m.getMeasurement)(t.leftInset,"0");o.rightInset=(0,m.getMeasurement)(t.rightInset,"0");o.topInset=(0,m.getMeasurement)(t.topInset,"0");o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}_createClass(Margin,[{key:u.$toStyle,value:function value(){return{margin:(0,g.measureToString)(this.topInset)+" "+(0,g.measureToString)(this.rightInset)+" "+(0,g.measureToString)(this.bottomInset)+" "+(0,g.measureToString)(this.leftInset)}}}]);return Margin}(u.XFAObject),We=function(t){_inherits(Mdp,t);var r=_createSuper(Mdp);function Mdp(t){var o;_classCallCheck(this,Mdp);(o=r.call(this,S,"mdp")).id=t.id||"";o.permissions=(0,m.getInteger)({data:t.permissions,defaultValue:2,validate:function validate(t){return 1===t||3===t}});o.signatureType=(0,m.getStringOption)(t.signatureType,["filler","author"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Mdp)}(u.XFAObject),Ve=function(t){_inherits(Medium,t);var r=_createSuper(Medium);function Medium(t){var o;_classCallCheck(this,Medium);(o=r.call(this,S,"medium")).id=t.id||"";o.imagingBBox=(0,m.getBBox)(t.imagingBBox);o.long=(0,m.getMeasurement)(t.long);o.orientation=(0,m.getStringOption)(t.orientation,["portrait","landscape"]);o.short=(0,m.getMeasurement)(t.short);o.stock=t.stock||"";o.trayIn=(0,m.getStringOption)(t.trayIn,["auto","delegate","pageFront"]);o.trayOut=(0,m.getStringOption)(t.trayOut,["auto","delegate"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Medium)}(u.XFAObject),Ke=function(t){_inherits(Message,t);var r=_createSuper(Message);function Message(t){var o;_classCallCheck(this,Message);(o=r.call(this,S,"message",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.text=new u.XFAObjectArray;return o}return _createClass(Message)}(u.XFAObject),Ye=function(t){_inherits(NumericEdit,t);var r=_createSuper(NumericEdit);function NumericEdit(t){var o;_classCallCheck(this,NumericEdit);(o=r.call(this,S,"numericEdit",!0)).hScrollPolicy=(0,m.getStringOption)(t.hScrollPolicy,["auto","off","on"]);o.id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.comb=null;o.extras=null;o.margin=null;return o}_createClass(NumericEdit,[{key:u.$toHTML,value:function value(t){var r=(0,g.toStyle)(this,"border","font","margin"),o=this[u.$getParent]()[u.$getParent](),c={name:"input",attributes:{type:"text",fieldId:o[u.$uid],dataId:o[u.$data]&&o[u.$data][u.$uid]||o[u.$uid],class:["xfaTextfield"],style:r,"aria-label":ariaLabel(o)}};return m.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[c]})}}]);return NumericEdit}(u.XFAObject),Je=function(t){_inherits(Occur,t);var r=_createSuper(Occur);function Occur(t){var o;_classCallCheck(this,Occur);(o=r.call(this,S,"occur",!0)).id=t.id||"";o.initial=""!==t.initial?(0,m.getInteger)({data:t.initial,defaultValue:"",validate:function validate(t){return!0}}):"";o.max=""!==t.max?(0,m.getInteger)({data:t.max,defaultValue:1,validate:function validate(t){return!0}}):"";o.min=""!==t.min?(0,m.getInteger)({data:t.min,defaultValue:1,validate:function validate(t){return!0}}):"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}_createClass(Occur,[{key:u.$clean,value:function value(){var t=this[u.$getParent](),r=this.min;""===this.min&&(this.min=t instanceof tt||t instanceof rt?0:1);""===this.max&&(this.max=""===r?t instanceof tt||t instanceof rt?-1:1:this.min);-1!==this.max&&this.max<this.min&&(this.max=this.min);""===this.initial&&(this.initial=t instanceof At?1:this.min)}}]);return Occur}(u.XFAObject),Ze=function(t){_inherits(Oid,t);var r=_createSuper(Oid);function Oid(t){var o;_classCallCheck(this,Oid);(o=r.call(this,S,"oid")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Oid)}(u.StringObject),Qe=function(t){_inherits(Oids,t);var r=_createSuper(Oids);function Oids(t){var o;_classCallCheck(this,Oids);(o=r.call(this,S,"oids",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.oid=new u.XFAObjectArray;return o}return _createClass(Oids)}(u.XFAObject),et=function(t){_inherits(Overflow,t);var r=_createSuper(Overflow);function Overflow(t){var o;_classCallCheck(this,Overflow);(o=r.call(this,S,"overflow")).id=t.id||"";o.leader=t.leader||"";o.target=t.target||"";o.trailer=t.trailer||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Overflow,[{key:u.$getExtra,value:function value(){if(!this[u.$extra]){var t=this[u.$getParent](),r=this[u.$getTemplateRoot](),o=r[u.$searchNode](this.target,t),c=r[u.$searchNode](this.leader,t),l=r[u.$searchNode](this.trailer,t);this[u.$extra]={target:o&&o[0]||null,leader:c&&c[0]||null,trailer:l&&l[0]||null,addLeader:!1,addTrailer:!1}}return this[u.$extra]}}]);return Overflow}(u.XFAObject),tt=function(t){_inherits(PageArea,t);var r=_createSuper(PageArea);function PageArea(t){var o;_classCallCheck(this,PageArea);(o=r.call(this,S,"pageArea",!0)).blankOrNotBlank=(0,m.getStringOption)(t.blankOrNotBlank,["any","blank","notBlank"]);o.id=t.id||"";o.initialNumber=(0,m.getInteger)({data:t.initialNumber,defaultValue:1,validate:function validate(t){return!0}});o.name=t.name||"";o.numbered=(0,m.getInteger)({data:t.numbered,defaultValue:1,validate:function validate(t){return!0}});o.oddOrEven=(0,m.getStringOption)(t.oddOrEven,["any","even","odd"]);o.pagePosition=(0,m.getStringOption)(t.pagePosition,["any","first","last","only","rest"]);o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.desc=null;o.extras=null;o.medium=null;o.occur=null;o.area=new u.XFAObjectArray;o.contentArea=new u.XFAObjectArray;o.draw=new u.XFAObjectArray;o.exclGroup=new u.XFAObjectArray;o.field=new u.XFAObjectArray;o.subform=new u.XFAObjectArray;return o}_createClass(PageArea,[{key:u.$isUsable,value:function value(){if(!this[u.$extra]){this[u.$extra]={numberOfUse:0};return!0}return!this.occur||-1===this.occur.max||this[u.$extra].numberOfUse<this.occur.max}},{key:u.$cleanPage,value:function value(){delete this[u.$extra]}},{key:u.$getNextPage,value:function value(){this[u.$extra]||(this[u.$extra]={numberOfUse:0});var t=this[u.$getParent]();if("orderedOccurrence"===t.relation&&this[u.$isUsable]()){this[u.$extra].numberOfUse+=1;return this}return t[u.$getNextPage]()}},{key:u.$getAvailableSpace,value:function value(){return this[u.$extra].space||{width:0,height:0}}},{key:u.$toHTML,value:function value(){this[u.$extra]||(this[u.$extra]={numberOfUse:1});var t=[];this[u.$extra].children=t;var r=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){r.width=(0,g.measureToString)(this.medium.short);r.height=(0,g.measureToString)(this.medium.long);this[u.$extra].space={width:this.medium.short,height:this.medium.long};if("landscape"===this.medium.orientation){var o=r.width;r.width=r.height;r.height=o;this[u.$extra].space={width:this.medium.long,height:this.medium.short}}}else(0,y.warn)("XFA - No medium specified in pageArea: please file a bug.");this[u.$childrenToHTML]({filter:new Set(["area","draw","field","subform"]),include:!0});this[u.$childrenToHTML]({filter:new Set(["contentArea"]),include:!0});return m.HTMLResult.success({name:"div",children:t,attributes:{class:["xfaPage"],id:this[u.$uid],style:r,xfaName:this.name}})}}]);return PageArea}(u.XFAObject),rt=function(t){_inherits(PageSet,t);var r=_createSuper(PageSet);function PageSet(t){var o;_classCallCheck(this,PageSet);(o=r.call(this,S,"pageSet",!0)).duplexImposition=(0,m.getStringOption)(t.duplexImposition,["longEdge","shortEdge"]);o.id=t.id||"";o.name=t.name||"";o.relation=(0,m.getStringOption)(t.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]);o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.occur=null;o.pageArea=new u.XFAObjectArray;o.pageSet=new u.XFAObjectArray;return o}_createClass(PageSet,[{key:u.$cleanPage,value:function value(){var t,r=_createForOfIteratorHelper(this.pageArea.children);try{for(r.s();!(t=r.n()).done;){t.value[u.$cleanPage]()}}catch(t){r.e(t)}finally{r.f()}var o,c=_createForOfIteratorHelper(this.pageSet.children);try{for(c.s();!(o=c.n()).done;){o.value[u.$cleanPage]()}}catch(t){c.e(t)}finally{c.f()}}},{key:u.$isUsable,value:function value(){return!this.occur||-1===this.occur.max||this[u.$extra].numberOfUse<this.occur.max}},{key:u.$getNextPage,value:function value(){this[u.$extra]||(this[u.$extra]={numberOfUse:1,pageIndex:-1,pageSetIndex:-1});if("orderedOccurrence"===this.relation){if(this[u.$extra].pageIndex+1<this.pageArea.children.length){this[u.$extra].pageIndex+=1;return this.pageArea.children[this[u.$extra].pageIndex][u.$getNextPage]()}if(this[u.$extra].pageSetIndex+1<this.pageSet.children.length){this[u.$extra].pageSetIndex+=1;return this.pageSet.children[this[u.$extra].pageSetIndex][u.$getNextPage]()}if(this[u.$isUsable]()){this[u.$extra].numberOfUse+=1;this[u.$extra].pageIndex=-1;this[u.$extra].pageSetIndex=-1;return this[u.$getNextPage]()}var t=this[u.$getParent]();if(t instanceof PageSet)return t[u.$getNextPage]();this[u.$cleanPage]();return this[u.$getNextPage]()}var r=this[u.$getTemplateRoot]()[u.$extra].pageNumber,o=r%2==0?"even":"odd",c=0===r?"first":"rest",l=this.pageArea.children.find((function(t){return t.oddOrEven===o&&t.pagePosition===c}));return l||((l=this.pageArea.children.find((function(t){return"any"===t.oddOrEven&&t.pagePosition===c})))?l:(l=this.pageArea.children.find((function(t){return"any"===t.oddOrEven&&"any"===t.pagePosition})))||this.pageArea.children[0])}}]);return PageSet}(u.XFAObject),at=function(t){_inherits(Para,t);var r=_createSuper(Para);function Para(t){var o;_classCallCheck(this,Para);(o=r.call(this,S,"para",!0)).hAlign=(0,m.getStringOption)(t.hAlign,["left","center","justify","justifyAll","radix","right"]);o.id=t.id||"";o.lineHeight=t.lineHeight?(0,m.getMeasurement)(t.lineHeight,"0pt"):"";o.marginLeft=t.marginLeft?(0,m.getMeasurement)(t.marginLeft,"0pt"):"";o.marginRight=t.marginRight?(0,m.getMeasurement)(t.marginRight,"0pt"):"";o.orphans=(0,m.getInteger)({data:t.orphans,defaultValue:0,validate:function validate(t){return t>=0}});o.preserve=t.preserve||"";o.radixOffset=t.radixOffset?(0,m.getMeasurement)(t.radixOffset,"0pt"):"";o.spaceAbove=t.spaceAbove?(0,m.getMeasurement)(t.spaceAbove,"0pt"):"";o.spaceBelow=t.spaceBelow?(0,m.getMeasurement)(t.spaceBelow,"0pt"):"";o.tabDefault=t.tabDefault?(0,m.getMeasurement)(o.tabDefault):"";o.tabStops=(t.tabStops||"").trim().split(/\s+/).map((function(t,r){return r%2==1?(0,m.getMeasurement)(t):t}));o.textIndent=t.textIndent?(0,m.getMeasurement)(t.textIndent,"0pt"):"";o.use=t.use||"";o.usehref=t.usehref||"";o.vAlign=(0,m.getStringOption)(t.vAlign,["top","bottom","middle"]);o.widows=(0,m.getInteger)({data:t.widows,defaultValue:0,validate:function validate(t){return t>=0}});o.hyphenation=null;return o}_createClass(Para,[{key:u.$toStyle,value:function value(){var t=(0,g.toStyle)(this,"hAlign");""!==this.marginLeft&&(t.paddingLeft=(0,g.measureToString)(this.marginLeft));""!==this.marginRight&&(t.paddingight=(0,g.measureToString)(this.marginRight));""!==this.spaceAbove&&(t.paddingTop=(0,g.measureToString)(this.spaceAbove));""!==this.spaceBelow&&(t.paddingBottom=(0,g.measureToString)(this.spaceBelow));if(""!==this.textIndent){t.textIndent=(0,g.measureToString)(this.textIndent);(0,g.fixTextIndent)(t)}this.lineHeight>0&&(t.lineHeight=(0,g.measureToString)(this.lineHeight));""!==this.tabDefault&&(t.tabSize=(0,g.measureToString)(this.tabDefault));this.tabStops.length;this.hyphenatation&&Object.assign(t,this.hyphenatation[u.$toStyle]());return t}}]);return Para}(u.XFAObject),nt=function(t){_inherits(PasswordEdit,t);var r=_createSuper(PasswordEdit);function PasswordEdit(t){var o;_classCallCheck(this,PasswordEdit);(o=r.call(this,S,"passwordEdit",!0)).hScrollPolicy=(0,m.getStringOption)(t.hScrollPolicy,["auto","off","on"]);o.id=t.id||"";o.passwordChar=t.passwordChar||"*";o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.extras=null;o.margin=null;return o}return _createClass(PasswordEdit)}(u.XFAObject),it=function(t){_inherits(Pattern,t);var r=_createSuper(Pattern);function Pattern(t){var o;_classCallCheck(this,Pattern);(o=r.call(this,S,"pattern",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]);o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;return o}_createClass(Pattern,[{key:u.$toStyle,value:function value(t){t=t?t[u.$toStyle]():"#FFFFFF";var r=this.color?this.color[u.$toStyle]():"#000000",o="repeating-linear-gradient",c="".concat(t,",").concat(t," ").concat(5,"px,").concat(r," ").concat(5,"px,").concat(r," ").concat(10,"px");switch(this.type){case"crossHatch":return"".concat(o,"(to top,").concat(c,") ").concat(o,"(to right,").concat(c,")");case"crossDiagonal":return"".concat(o,"(45deg,").concat(c,") ").concat(o,"(-45deg,").concat(c,")");case"diagonalLeft":return"".concat(o,"(45deg,").concat(c,")");case"diagonalRight":return"".concat(o,"(-45deg,").concat(c,")");case"horizontal":return"".concat(o,"(to top,").concat(c,")");case"vertical":return"".concat(o,"(to right,").concat(c,")")}return""}}]);return Pattern}(u.XFAObject),ot=function(t){_inherits(Picture,t);var r=_createSuper(Picture);function Picture(t){var o;_classCallCheck(this,Picture);(o=r.call(this,S,"picture")).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Picture)}(u.StringObject),st=function(t){_inherits(Proto,t);var r=_createSuper(Proto);function Proto(t){var o;_classCallCheck(this,Proto);(o=r.call(this,S,"proto",!0)).appearanceFilter=new u.XFAObjectArray;o.arc=new u.XFAObjectArray;o.area=new u.XFAObjectArray;o.assist=new u.XFAObjectArray;o.barcode=new u.XFAObjectArray;o.bindItems=new u.XFAObjectArray;o.bookend=new u.XFAObjectArray;o.boolean=new u.XFAObjectArray;o.border=new u.XFAObjectArray;o.break=new u.XFAObjectArray;o.breakAfter=new u.XFAObjectArray;o.breakBefore=new u.XFAObjectArray;o.button=new u.XFAObjectArray;o.calculate=new u.XFAObjectArray;o.caption=new u.XFAObjectArray;o.certificate=new u.XFAObjectArray;o.certificates=new u.XFAObjectArray;o.checkButton=new u.XFAObjectArray;o.choiceList=new u.XFAObjectArray;o.color=new u.XFAObjectArray;o.comb=new u.XFAObjectArray;o.connect=new u.XFAObjectArray;o.contentArea=new u.XFAObjectArray;o.corner=new u.XFAObjectArray;o.date=new u.XFAObjectArray;o.dateTime=new u.XFAObjectArray;o.dateTimeEdit=new u.XFAObjectArray;o.decimal=new u.XFAObjectArray;o.defaultUi=new u.XFAObjectArray;o.desc=new u.XFAObjectArray;o.digestMethod=new u.XFAObjectArray;o.digestMethods=new u.XFAObjectArray;o.draw=new u.XFAObjectArray;o.edge=new u.XFAObjectArray;o.encoding=new u.XFAObjectArray;o.encodings=new u.XFAObjectArray;o.encrypt=new u.XFAObjectArray;o.encryptData=new u.XFAObjectArray;o.encryption=new u.XFAObjectArray;o.encryptionMethod=new u.XFAObjectArray;o.encryptionMethods=new u.XFAObjectArray;o.event=new u.XFAObjectArray;o.exData=new u.XFAObjectArray;o.exObject=new u.XFAObjectArray;o.exclGroup=new u.XFAObjectArray;o.execute=new u.XFAObjectArray;o.extras=new u.XFAObjectArray;o.field=new u.XFAObjectArray;o.fill=new u.XFAObjectArray;o.filter=new u.XFAObjectArray;o.float=new u.XFAObjectArray;o.font=new u.XFAObjectArray;o.format=new u.XFAObjectArray;o.handler=new u.XFAObjectArray;o.hyphenation=new u.XFAObjectArray;o.image=new u.XFAObjectArray;o.imageEdit=new u.XFAObjectArray;o.integer=new u.XFAObjectArray;o.issuers=new u.XFAObjectArray;o.items=new u.XFAObjectArray;o.keep=new u.XFAObjectArray;o.keyUsage=new u.XFAObjectArray;o.line=new u.XFAObjectArray;o.linear=new u.XFAObjectArray;o.lockDocument=new u.XFAObjectArray;o.manifest=new u.XFAObjectArray;o.margin=new u.XFAObjectArray;o.mdp=new u.XFAObjectArray;o.medium=new u.XFAObjectArray;o.message=new u.XFAObjectArray;o.numericEdit=new u.XFAObjectArray;o.occur=new u.XFAObjectArray;o.oid=new u.XFAObjectArray;o.oids=new u.XFAObjectArray;o.overflow=new u.XFAObjectArray;o.pageArea=new u.XFAObjectArray;o.pageSet=new u.XFAObjectArray;o.para=new u.XFAObjectArray;o.passwordEdit=new u.XFAObjectArray;o.pattern=new u.XFAObjectArray;o.picture=new u.XFAObjectArray;o.radial=new u.XFAObjectArray;o.reason=new u.XFAObjectArray;o.reasons=new u.XFAObjectArray;o.rectangle=new u.XFAObjectArray;o.ref=new u.XFAObjectArray;o.script=new u.XFAObjectArray;o.setProperty=new u.XFAObjectArray;o.signData=new u.XFAObjectArray;o.signature=new u.XFAObjectArray;o.signing=new u.XFAObjectArray;o.solid=new u.XFAObjectArray;o.speak=new u.XFAObjectArray;o.stipple=new u.XFAObjectArray;o.subform=new u.XFAObjectArray;o.subformSet=new u.XFAObjectArray;o.subjectDN=new u.XFAObjectArray;o.subjectDNs=new u.XFAObjectArray;o.submit=new u.XFAObjectArray;o.text=new u.XFAObjectArray;o.textEdit=new u.XFAObjectArray;o.time=new u.XFAObjectArray;o.timeStamp=new u.XFAObjectArray;o.toolTip=new u.XFAObjectArray;o.traversal=new u.XFAObjectArray;o.traverse=new u.XFAObjectArray;o.ui=new u.XFAObjectArray;o.validate=new u.XFAObjectArray;o.value=new u.XFAObjectArray;o.variables=new u.XFAObjectArray;return o}return _createClass(Proto)}(u.XFAObject),ct=function(t){_inherits(Radial,t);var r=_createSuper(Radial);function Radial(t){var o;_classCallCheck(this,Radial);(o=r.call(this,S,"radial",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["toEdge","toCenter"]);o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;return o}_createClass(Radial,[{key:u.$toStyle,value:function value(t){t=t?t[u.$toStyle]():"#FFFFFF";var r=this.color?this.color[u.$toStyle]():"#000000",o="toEdge"===this.type?"".concat(t,",").concat(r):"".concat(r,",").concat(t);return"radial-gradient(circle at center, ".concat(o,")")}}]);return Radial}(u.XFAObject),lt=function(t){_inherits(Reason,t);var r=_createSuper(Reason);function Reason(t){var o;_classCallCheck(this,Reason);(o=r.call(this,S,"reason")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Reason)}(u.StringObject),ut=function(t){_inherits(Reasons,t);var r=_createSuper(Reasons);function Reasons(t){var o;_classCallCheck(this,Reasons);(o=r.call(this,S,"reasons",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.reason=new u.XFAObjectArray;return o}return _createClass(Reasons)}(u.XFAObject),ft=function(t){_inherits(Rectangle,t);var r=_createSuper(Rectangle);function Rectangle(t){var o;_classCallCheck(this,Rectangle);(o=r.call(this,S,"rectangle",!0)).hand=(0,m.getStringOption)(t.hand,["even","left","right"]);o.id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.corner=new u.XFAObjectArray(4);o.edge=new u.XFAObjectArray(4);o.fill=null;return o}_createClass(Rectangle,[{key:u.$toHTML,value:function value(){var t=this.edge.children.length?this.edge.children[0]:new de({}),r=t[u.$toStyle](),o=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(o,this.fill[u.$toStyle]()):o.fill="transparent";o.strokeWidth=(0,g.measureToString)("visible"===t.presence?t.thickness:0);o.stroke=r.color;var c=(this.corner.children.length?this.corner.children[0]:new ae({}))[u.$toStyle](),l={name:"svg",children:[{name:"rect",attributes:{xmlns:C,width:"100%",height:"100%",x:0,y:0,rx:c.radius,ry:c.radius,style:o}}],attributes:{xmlns:C,style:{overflow:"visible"},width:"100%",height:"100%"}};if(hasMargin(this[u.$getParent]()[u.$getParent]()))return m.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[l]});l.attributes.style.position="absolute";return m.HTMLResult.success(l)}}]);return Rectangle}(u.XFAObject),ht=function(t){_inherits(RefElement,t);var r=_createSuper(RefElement);function RefElement(t){var o;_classCallCheck(this,RefElement);(o=r.call(this,S,"ref")).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(RefElement)}(u.StringObject),dt=function(t){_inherits(Script,t);var r=_createSuper(Script);function Script(t){var o;_classCallCheck(this,Script);(o=r.call(this,S,"script")).binding=t.binding||"";o.contentType=t.contentType||"";o.id=t.id||"";o.name=t.name||"";o.runAt=(0,m.getStringOption)(t.runAt,["client","both","server"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Script)}(u.StringObject),gt=function(t){_inherits(SetProperty,t);var r=_createSuper(SetProperty);function SetProperty(t){var o;_classCallCheck(this,SetProperty);(o=r.call(this,S,"setProperty")).connection=t.connection||"";o.ref=t.ref||"";o.target=t.target||"";return o}return _createClass(SetProperty)}(u.XFAObject);r.SetProperty=gt;var mt=function(t){_inherits(SignData,t);var r=_createSuper(SignData);function SignData(t){var o;_classCallCheck(this,SignData);(o=r.call(this,S,"signData",!0)).id=t.id||"";o.operation=(0,m.getStringOption)(t.operation,["sign","clear","verify"]);o.ref=t.ref||"";o.target=t.target||"";o.use=t.use||"";o.usehref=t.usehref||"";o.filter=null;o.manifest=null;return o}return _createClass(SignData)}(u.XFAObject),yt=function(t){_inherits(Signature,t);var r=_createSuper(Signature);function Signature(t){var o;_classCallCheck(this,Signature);(o=r.call(this,S,"signature",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["PDF1.3","PDF1.6"]);o.use=t.use||"";o.usehref=t.usehref||"";o.border=null;o.extras=null;o.filter=null;o.manifest=null;o.margin=null;return o}return _createClass(Signature)}(u.XFAObject),vt=function(t){_inherits(Signing,t);var r=_createSuper(Signing);function Signing(t){var o;_classCallCheck(this,Signing);(o=r.call(this,S,"signing",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.certificate=new u.XFAObjectArray;return o}return _createClass(Signing)}(u.XFAObject),bt=function(t){_inherits(Solid,t);var r=_createSuper(Solid);function Solid(t){var o;_classCallCheck(this,Solid);(o=r.call(this,S,"solid",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;return o}_createClass(Solid,[{key:u.$toStyle,value:function value(t){return t?t[u.$toStyle]():"#FFFFFF"}}]);return Solid}(u.XFAObject),kt=function(t){_inherits(Speak,t);var r=_createSuper(Speak);function Speak(t){var o;_classCallCheck(this,Speak);(o=r.call(this,S,"speak")).disable=(0,m.getInteger)({data:t.disable,defaultValue:0,validate:function validate(t){return 1===t}});o.id=t.id||"";o.priority=(0,m.getStringOption)(t.priority,["custom","caption","name","toolTip"]);o.rid=t.rid||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Speak)}(u.StringObject),_t=function(t){_inherits(Stipple,t);var r=_createSuper(Stipple);function Stipple(t){var o;_classCallCheck(this,Stipple);(o=r.call(this,S,"stipple",!0)).id=t.id||"";o.rate=(0,m.getInteger)({data:t.rate,defaultValue:50,validate:function validate(t){return t>=0&&t<=100}});o.use=t.use||"";o.usehref=t.usehref||"";o.color=null;o.extras=null;return o}_createClass(Stipple,[{key:u.$toStyle,value:function value(t){var r=this.rate/100;return y.Util.makeHexColor(Math.round(t.value.r*(1-r)+this.value.r*r),Math.round(t.value.g*(1-r)+this.value.g*r),Math.round(t.value.b*(1-r)+this.value.b*r))}}]);return Stipple}(u.XFAObject),wt=function(t){_inherits(Subform,t);var r=_createSuper(Subform);function Subform(t){var o;_classCallCheck(this,Subform);(o=r.call(this,S,"subform",!0)).access=(0,m.getStringOption)(t.access,["open","nonInteractive","protected","readOnly"]);o.allowMacro=(0,m.getInteger)({data:t.allowMacro,defaultValue:0,validate:function validate(t){return 1===t}});o.anchorType=(0,m.getStringOption)(t.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);o.colSpan=(0,m.getInteger)({data:t.colSpan,defaultValue:1,validate:function validate(t){return t>=1||-1===t}});o.columnWidths=(t.columnWidths||"").trim().split(/\s+/).map((function(t){return"-1"===t?-1:(0,m.getMeasurement)(t)}));o.h=t.h?(0,m.getMeasurement)(t.h):"";o.hAlign=(0,m.getStringOption)(t.hAlign,["left","center","justify","justifyAll","radix","right"]);o.id=t.id||"";o.layout=(0,m.getStringOption)(t.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);o.locale=t.locale||"";o.maxH=(0,m.getMeasurement)(t.maxH,"0pt");o.maxW=(0,m.getMeasurement)(t.maxW,"0pt");o.mergeMode=(0,m.getStringOption)(t.mergeMode,["consumeData","matchTemplate"]);o.minH=(0,m.getMeasurement)(t.minH,"0pt");o.minW=(0,m.getMeasurement)(t.minW,"0pt");o.name=t.name||"";o.presence=(0,m.getStringOption)(t.presence,["visible","hidden","inactive","invisible"]);o.relevant=(0,m.getRelevant)(t.relevant);o.restoreState=(0,m.getStringOption)(t.restoreState,["manual","auto"]);o.scope=(0,m.getStringOption)(t.scope,["name","none"]);o.use=t.use||"";o.usehref=t.usehref||"";o.w=t.w?(0,m.getMeasurement)(t.w):"";o.x=(0,m.getMeasurement)(t.x,"0pt");o.y=(0,m.getMeasurement)(t.y,"0pt");o.assist=null;o.bind=null;o.bookend=null;o.border=null;o.break=null;o.calculate=null;o.desc=null;o.extras=null;o.keep=null;o.margin=null;o.occur=null;o.overflow=null;o.pageSet=null;o.para=null;o.traversal=null;o.validate=null;o.variables=null;o.area=new u.XFAObjectArray;o.breakAfter=new u.XFAObjectArray;o.breakBefore=new u.XFAObjectArray;o.connect=new u.XFAObjectArray;o.draw=new u.XFAObjectArray;o.event=new u.XFAObjectArray;o.exObject=new u.XFAObjectArray;o.exclGroup=new u.XFAObjectArray;o.field=new u.XFAObjectArray;o.proto=new u.XFAObjectArray;o.setProperty=new u.XFAObjectArray;o.subform=new u.XFAObjectArray;o.subformSet=new u.XFAObjectArray;return o}_createClass(Subform,[{key:u.$getSubformParent,value:function value(){var t=this[u.$getParent]();return t instanceof St?t[u.$getSubformParent]():t}},{key:u.$isBindable,value:function value(){return!0}},{key:u.$isThereMoreWidth,value:function value(){return this.layout.endsWith("-tb")&&0===this[u.$extra].attempt&&this[u.$extra].numberInLine>0||this[u.$getParent]()[u.$isThereMoreWidth]()}},{key:u.$getContainedChildren,value:l.default.mark((function value(){return l.default.wrap((function value$(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(getContainedChildren(this),"t0",1);case 1:case"end":return t.stop()}}),value,this)}))},{key:u.$flushHTML,value:function value(){return(0,d.flushHTML)(this)}},{key:u.$addHTML,value:function value(t,r){(0,d.addHTML)(this,t,r)}},{key:u.$getAvailableSpace,value:function value(){return(0,d.getAvailableSpace)(this)}},{key:u.$isSplittable,value:function value(){var t=this[u.$getSubformParent]();if(!t[u.$isSplittable]())return!1;if(void 0!==this[u.$extra]._isSplittable)return this[u.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[u.$extra]._isSplittable=!1;return!1}if(this.keep&&"none"!==this.keep.intact){this[u.$extra]._isSplittable=!1;return!1}if(t.layout&&t.layout.endsWith("-tb")&&0!==t[u.$extra].numberInLine)return!1;this[u.$extra]._isSplittable=!0;return!0}},{key:u.$toHTML,value:function value(t){setTabIndex(this);if(this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){var r=new q({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});r[u.$globalData]=this[u.$globalData];this[u.$appendChild](r);this.breakAfter.push(r)}if("auto"!==this.break.before||""!==this.break.beforeTarget){var o=new G({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});o[u.$globalData]=this[u.$globalData];this[u.$appendChild](o);this.breakBefore.push(o)}if(""!==this.break.overflowTarget){var c=new et({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});c[u.$globalData]=this[u.$globalData];this[u.$appendChild](c);this.overflow.push(c)}this[u.$removeChild](this.break);this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return m.HTMLResult.EMPTY;(this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&(0,y.warn)("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");if(this.breakBefore.children.length>=1){var l=this.breakBefore.children[0];if(handleBreak(l))return m.HTMLResult.breakNode(l)}if(this[u.$extra]&&this[u.$extra].afterBreakAfter)return m.HTMLResult.EMPTY;(0,g.fixDimensions)(this);var h=[],v={id:this[u.$uid],class:[]};(0,g.setAccess)(this,v.class);this[u.$extra]||(this[u.$extra]=Object.create(null));Object.assign(this[u.$extra],{children:h,line:null,attributes:v,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,t.width),height:Math.min(this.h||1/0,t.height)},width:0,height:0,prevHeight:0,currentWidth:0});var k=this[u.$getTemplateRoot](),_=k[u.$extra].noLayoutFailure,w=this[u.$isSplittable]();w||setFirstUnsplittable(this);if(!(0,d.checkDimensions)(this,t))return m.HTMLResult.FAILURE;var S=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){var C=this[u.$getSubformParent]().columnWidths;if(Array.isArray(C)&&C.length>0){this[u.$extra].columnWidths=C;this[u.$extra].currentColumn=0}}var x=(0,g.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),O=["xfaSubform"],T=(0,g.layoutClass)(this);T&&O.push(T);v.style=x;v.class=O;this.name&&(v.xfaName=this.name);if(this.overflow){var E=this.overflow[u.$getExtra]();if(E.addLeader){E.addLeader=!1;handleOverflow(this,E.leader,t)}}this[u.$pushPara]();for(var M="lr-tb"===this.layout||"rl-tb"===this.layout,R=M?2:1;this[u.$extra].attempt<R;this[u.$extra].attempt++){M&&1===this[u.$extra].attempt&&(this[u.$extra].numberInLine=0);var j=this[u.$childrenToHTML]({filter:S,include:!0});if(j.success)break;if(j.isBreak()){this[u.$popPara]();return j}if(M&&0===this[u.$extra].attempt&&0===this[u.$extra].numberInLine&&!k[u.$extra].noLayoutFailure){this[u.$extra].attempt=R;break}}this[u.$popPara]();w||unsetFirstUnsplittable(this);k[u.$extra].noLayoutFailure=_;if(this[u.$extra].attempt===R){this.overflow&&(this[u.$getTemplateRoot]()[u.$extra].overflowNode=this.overflow);w||delete this[u.$extra];return m.HTMLResult.FAILURE}if(this.overflow){var D=this.overflow[u.$getExtra]();if(D.addTrailer){D.addTrailer=!1;handleOverflow(this,D.trailer,t)}}var L=0,N=0;if(this.margin){L=this.margin.leftInset+this.margin.rightInset;N=this.margin.topInset+this.margin.bottomInset}var U=Math.max(this[u.$extra].width+L,this.w||0),H=Math.max(this[u.$extra].height+N,this.h||0),$=[this.x,this.y,U,H];""===this.w&&(x.width=(0,g.measureToString)(U));""===this.h&&(x.height=(0,g.measureToString)(H));if(("0px"===x.width||"0px"===x.height)&&0===h.length)return m.HTMLResult.EMPTY;var X={name:"div",attributes:v,children:h};applyAssist(this,v);var z=m.HTMLResult.success((0,g.createWrapper)(this,X),$);if(this.breakAfter.children.length>=1){var W=this.breakAfter.children[0];if(handleBreak(W)){this[u.$extra].afterBreakAfter=z;return m.HTMLResult.breakNode(W)}}delete this[u.$extra];return z}}]);return Subform}(u.XFAObject),St=function(t){_inherits(SubformSet,t);var r=_createSuper(SubformSet);function SubformSet(t){var o;_classCallCheck(this,SubformSet);(o=r.call(this,S,"subformSet",!0)).id=t.id||"";o.name=t.name||"";o.relation=(0,m.getStringOption)(t.relation,["ordered","choice","unordered"]);o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.bookend=null;o.break=null;o.desc=null;o.extras=null;o.occur=null;o.overflow=null;o.breakAfter=new u.XFAObjectArray;o.breakBefore=new u.XFAObjectArray;o.subform=new u.XFAObjectArray;o.subformSet=new u.XFAObjectArray;return o}_createClass(SubformSet,[{key:u.$getContainedChildren,value:l.default.mark((function value(){return l.default.wrap((function value$(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(getContainedChildren(this),"t0",1);case 1:case"end":return t.stop()}}),value,this)}))},{key:u.$getSubformParent,value:function value(){for(var t=this[u.$getParent]();!(t instanceof wt);)t=t[u.$getParent]();return t}},{key:u.$isBindable,value:function value(){return!0}}]);return SubformSet}(u.XFAObject),Ct=function(t){_inherits(SubjectDN,t);var r=_createSuper(SubjectDN);function SubjectDN(t){var o;_classCallCheck(this,SubjectDN);(o=r.call(this,S,"subjectDN")).delimiter=t.delimiter||",";o.id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(SubjectDN,[{key:u.$finalize,value:function value(){this[u.$content]=new Map(this[u.$content].split(this.delimiter).map((function(t){(t=t.split("=",2))[0]=t[0].trim();return t})))}}]);return SubjectDN}(u.ContentObject),xt=function(t){_inherits(SubjectDNs,t);var r=_createSuper(SubjectDNs);function SubjectDNs(t){var o;_classCallCheck(this,SubjectDNs);(o=r.call(this,S,"subjectDNs",!0)).id=t.id||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";o.subjectDN=new u.XFAObjectArray;return o}return _createClass(SubjectDNs)}(u.XFAObject),Ot=function(t){_inherits(Submit,t);var r=_createSuper(Submit);function Submit(t){var o;_classCallCheck(this,Submit);(o=r.call(this,S,"submit",!0)).embedPDF=(0,m.getInteger)({data:t.embedPDF,defaultValue:0,validate:function validate(t){return 1===t}});o.format=(0,m.getStringOption)(t.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]);o.id=t.id||"";o.target=t.target||"";o.textEncoding=(0,m.getKeyword)({data:t.textEncoding?t.textEncoding.toLowerCase():"",defaultValue:"",validate:function validate(t){return["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(t)||t.match(/iso-8859-\d{2}/)}});o.use=t.use||"";o.usehref=t.usehref||"";o.xdpContent=t.xdpContent||"";o.encrypt=null;o.encryptData=new u.XFAObjectArray;o.signData=new u.XFAObjectArray;return o}return _createClass(Submit)}(u.XFAObject),At=function(t){_inherits(Template,t);var r=_createSuper(Template);function Template(t){var o;_classCallCheck(this,Template);(o=r.call(this,S,"template",!0)).baseProfile=(0,m.getStringOption)(t.baseProfile,["full","interactiveForms"]);o.extras=null;o.subform=new u.XFAObjectArray;return o}_createClass(Template,[{key:u.$finalize,value:function value(){0===this.subform.children.length&&(0,y.warn)("XFA - No subforms in template node.");this.subform.children.length>=2&&(0,y.warn)("XFA - Several subforms in template node: please file a bug.");this[u.$tabIndex]=5e3}},{key:u.$isSplittable,value:function value(){return!0}},{key:u.$searchNode,value:function value(t,r){return t.startsWith("#")?[this[u.$ids].get(t.slice(1))]:(0,_.searchNode)(this,r,t,!0,!0)}},{key:u.$toPages,value:l.default.mark((function value(){var t,r,o,c,h,d,g,v,k,_,w,S,C,x,O,T,E=this;return l.default.wrap((function value$(M){for(;;)switch(M.prev=M.next){case 0:if(this.subform.children.length){M.next=2;break}return M.abrupt("return",m.HTMLResult.success({name:"div",children:[]}));case 2:this[u.$extra]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};(t=this.subform.children[0]).pageSet[u.$cleanPage]();r=t.pageSet.pageArea.children;o={name:"div",children:[]};c=null;h=null;d=null;if(t.breakBefore.children.length>=1){h=t.breakBefore.children[0];d=h.target}else if(t.subform.children.length>=1&&t.subform.children[0].breakBefore.children.length>=1){h=t.subform.children[0].breakBefore.children[0];d=h.target}else if(t.break&&t.break.beforeTarget){h=t.break;d=h.beforeTarget}else if(t.subform.children.length>=1&&t.subform.children[0].break&&t.subform.children[0].break.beforeTarget){h=t.subform.children[0].break;d=h.beforeTarget}if(h&&(g=this[u.$searchNode](d,h[u.$getParent]()))instanceof tt){c=g;h[u.$extra]={}}c||(c=r[0]);c[u.$extra]={numberOfUse:1};(v=c[u.$getParent]())[u.$extra]={numberOfUse:1,pageIndex:v.pageArea.children.indexOf(c),pageSetIndex:0};_=null;w=null;S=!0;C=0;x=0;O=l.default.mark((function _loop(){var r,h,d,g,m,v,O,T,M,R,j;return l.default.wrap((function _loop$(l){for(;;)switch(l.prev=l.next){case 0:if(S){l.next=7;break}o.children.pop();if(3!=++C){l.next=5;break}(0,y.warn)("XFA - Something goes wrong: please file a bug.");return l.abrupt("return",{v:o});case 5:l.next=8;break;case 7:C=0;case 8:k=null;E[u.$extra].currentPageArea=c;r=c[u.$toHTML]().html;o.children.push(r);if(_){E[u.$extra].noLayoutFailure=!0;r.children.push(_[u.$toHTML](c[u.$extra].space).html);_=null}if(w){E[u.$extra].noLayoutFailure=!0;r.children.push(w[u.$toHTML](c[u.$extra].space).html);w=null}h=c.contentArea.children;d=r.children.filter((function(t){return t.attributes.class.includes("xfaContentarea")}));S=!1;E[u.$extra].firstUnsplittable=null;E[u.$extra].noLayoutFailure=!1;g=function flush(r){var o=t[u.$flushHTML]();if(o){S=S||o.children&&0!==o.children.length;d[r].children.push(o)}};m=x,v=h.length;case 21:if(!(m<v)){l.next=48;break}O=E[u.$extra].currentContentArea=h[m];T={width:O.w,height:O.h};x=0;if(_){d[m].children.push(_[u.$toHTML](T).html);_=null}if(w){d[m].children.push(w[u.$toHTML](T).html);w=null}if(!(M=t[u.$toHTML](T)).success){l.next=31;break}if(M.html){S=S||M.html.children&&0!==M.html.children.length;d[m].children.push(M.html)}else!S&&o.children.length>1&&o.children.pop();return l.abrupt("return",{v:o});case 31:if(!M.isBreak()){l.next=40;break}R=M.breakNode;g(m);if("auto"!==R.targetType){l.next=36;break}return l.abrupt("continue",45);case 36:R.leader&&(_=(_=E[u.$searchNode](R.leader,R[u.$getParent]()))?_[0]:null);R.trailer&&(w=(w=E[u.$searchNode](R.trailer,R[u.$getParent]()))?w[0]:null);if("pageArea"===R.targetType){k=R[u.$extra].target;m=1/0}else if(R[u.$extra].target){k=R[u.$extra].target;x=R[u.$extra].index+1;m=1/0}else m=R[u.$extra].index;return l.abrupt("continue",45);case 40:if(!E[u.$extra].overflowNode){l.next=44;break}j=function(){var t=E[u.$extra].overflowNode;E[u.$extra].overflowNode=null;var r=t[u.$getExtra](),o=r.target;r.addLeader=null!==r.leader;r.addTrailer=null!==r.trailer;g(m);var c=m;m=1/0;if(o instanceof tt)k=o;else if(o instanceof re){var l=h.findIndex((function(t){return t===o}));if(-1!==l)l>c?m=l-1:x=l;else{k=o[u.$getParent]();x=k.contentArea.children.findIndex((function(t){return t===o}))}}return"continue"}();if("continue"!==j){l.next=44;break}return l.abrupt("continue",45);case 44:g(m);case 45:m++;l.next=21;break;case 48:E[u.$extra].pageNumber+=1;k&&(k[u.$isUsable]()?k[u.$extra].numberOfUse+=1:k=null);c=k||c[u.$getNextPage]();l.next=53;return null;case 53:case"end":return l.stop()}}),_loop)}));case 22:0;return M.delegateYield(O(),"t0",24);case 24:if("object"!==_typeof(T=M.t0)){M.next=27;break}return M.abrupt("return",T.v);case 27:M.next=22;break;case 29:case"end":return M.stop()}}),value,this)}))}]);return Template}(u.XFAObject);r.Template=At;var Pt=function(t){_inherits(Text,t);var r=_createSuper(Text);function Text(t){var o;_classCallCheck(this,Text);(o=r.call(this,S,"text")).id=t.id||"";o.maxChars=(0,m.getInteger)({data:t.maxChars,defaultValue:0,validate:function validate(t){return t>=0}});o.name=t.name||"";o.rid=t.rid||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Text,[{key:u.$acceptWhitespace,value:function value(){return!0}},{key:u.$onChild,value:function value(t){if(t[u.$namespaceId]===h.NamespaceIds.xhtml.id){this[u.$content]=t;return!0}(0,y.warn)("XFA - Invalid content in Text: ".concat(t[u.$nodeName],"."));return!1}},{key:u.$onText,value:function value(t){this[u.$content]instanceof u.XFAObject||_get(_getPrototypeOf(Text.prototype),u.$onText,this).call(this,t)}},{key:u.$finalize,value:function value(){"string"==typeof this[u.$content]&&(this[u.$content]=this[u.$content].replace(/\r\n/g,"\n"))}},{key:u.$getExtra,value:function value(){return"string"==typeof this[u.$content]?this[u.$content].split(/[\u2029\u2028\n]/).reduce((function(t,r){r&&t.push(r);return t}),[]).join("\n"):this[u.$content][u.$text]()}},{key:u.$toHTML,value:function value(t){if("string"==typeof this[u.$content]){var r=valueToHtml(this[u.$content]).html;if(this[u.$content].includes("\u2029")){r.name="div";r.children=[];this[u.$content].split("\u2029").map((function(t){return t.split(/[\u2028\n]/).reduce((function(t,r){t.push({name:"span",value:r},{name:"br"});return t}),[])})).forEach((function(t){r.children.push({name:"p",children:t})}))}else if(/[\u2028\n]/.test(this[u.$content])){r.name="div";r.children=[];this[u.$content].split(/[\u2028\n]/).forEach((function(t){r.children.push({name:"span",value:t},{name:"br"})}))}return m.HTMLResult.success(r)}return this[u.$content][u.$toHTML](t)}}]);return Text}(u.ContentObject);r.Text=Pt;var Tt=function(t){_inherits(TextEdit,t);var r=_createSuper(TextEdit);function TextEdit(t){var o;_classCallCheck(this,TextEdit);(o=r.call(this,S,"textEdit",!0)).allowRichText=(0,m.getInteger)({data:t.allowRichText,defaultValue:0,validate:function validate(t){return 1===t}});o.hScrollPolicy=(0,m.getStringOption)(t.hScrollPolicy,["auto","off","on"]);o.id=t.id||"";o.multiLine=(0,m.getInteger)({data:t.multiLine,defaultValue:"",validate:function validate(t){return 0===t||1===t}});o.use=t.use||"";o.usehref=t.usehref||"";o.vScrollPolicy=(0,m.getStringOption)(t.vScrollPolicy,["auto","off","on"]);o.border=null;o.comb=null;o.extras=null;o.margin=null;return o}_createClass(TextEdit,[{key:u.$toHTML,value:function value(t){var r,o=(0,g.toStyle)(this,"border","font","margin"),c=this[u.$getParent]()[u.$getParent]();""===this.multiLine&&(this.multiLine=c instanceof he?1:0);r=1===this.multiLine?{name:"textarea",attributes:{dataId:c[u.$data]&&c[u.$data][u.$uid]||c[u.$uid],fieldId:c[u.$uid],class:["xfaTextfield"],style:o,"aria-label":ariaLabel(c)}}:{name:"input",attributes:{type:"text",dataId:c[u.$data]&&c[u.$data][u.$uid]||c[u.$uid],fieldId:c[u.$uid],class:["xfaTextfield"],style:o,"aria-label":ariaLabel(c)}};return m.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[r]})}}]);return TextEdit}(u.XFAObject),Ft=function(t){_inherits(Time,t);var r=_createSuper(Time);function Time(t){var o;_classCallCheck(this,Time);(o=r.call(this,S,"time")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}_createClass(Time,[{key:u.$finalize,value:function value(){var t=this[u.$content].trim();this[u.$content]=t?new Date(t):null}},{key:u.$toHTML,value:function value(t){return valueToHtml(this[u.$content]?this[u.$content].toString():"")}}]);return Time}(u.StringObject),It=function(t){_inherits(TimeStamp,t);var r=_createSuper(TimeStamp);function TimeStamp(t){var o;_classCallCheck(this,TimeStamp);(o=r.call(this,S,"timeStamp")).id=t.id||"";o.server=t.server||"";o.type=(0,m.getStringOption)(t.type,["optional","required"]);o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(TimeStamp)}(u.XFAObject),Et=function(t){_inherits(ToolTip,t);var r=_createSuper(ToolTip);function ToolTip(t){var o;_classCallCheck(this,ToolTip);(o=r.call(this,S,"toolTip")).id=t.id||"";o.rid=t.rid||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(ToolTip)}(u.StringObject),Mt=function(t){_inherits(Traversal,t);var r=_createSuper(Traversal);function Traversal(t){var o;_classCallCheck(this,Traversal);(o=r.call(this,S,"traversal",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.traverse=new u.XFAObjectArray;return o}return _createClass(Traversal)}(u.XFAObject),Rt=function(t){_inherits(Traverse,t);var r=_createSuper(Traverse);function Traverse(t){var o;_classCallCheck(this,Traverse);(o=r.call(this,S,"traverse",!0)).id=t.id||"";o.operation=(0,m.getStringOption)(t.operation,["next","back","down","first","left","right","up"]);o.ref=t.ref||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.script=null;return o}_createClass(Traverse,[{key:"name",get:function get(){return this.operation}},{key:u.$isTransparent,value:function value(){return!1}}]);return Traverse}(u.XFAObject),jt=function(t){_inherits(Ui,t);var r=_createSuper(Ui);function Ui(t){var o;_classCallCheck(this,Ui);(o=r.call(this,S,"ui",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.picture=null;o.barcode=null;o.button=null;o.checkButton=null;o.choiceList=null;o.dateTimeEdit=null;o.defaultUi=null;o.imageEdit=null;o.numericEdit=null;o.passwordEdit=null;o.signature=null;o.textEdit=null;return o}_createClass(Ui,[{key:u.$getExtra,value:function value(){if(void 0===this[u.$extra]){var t,r=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(r.s();!(t=r.n()).done;){var o=t.value;if("extras"!==o&&"picture"!==o){var c=this[o];if(c instanceof u.XFAObject){this[u.$extra]=c;return c}}}}catch(t){r.e(t)}finally{r.f()}this[u.$extra]=null}return this[u.$extra]}},{key:u.$toHTML,value:function value(t){var r=this[u.$getExtra]();return r?r[u.$toHTML](t):m.HTMLResult.EMPTY}}]);return Ui}(u.XFAObject),Dt=function(t){_inherits(Validate,t);var r=_createSuper(Validate);function Validate(t){var o;_classCallCheck(this,Validate);(o=r.call(this,S,"validate",!0)).formatTest=(0,m.getStringOption)(t.formatTest,["warning","disabled","error"]);o.id=t.id||"";o.nullTest=(0,m.getStringOption)(t.nullTest,["disabled","error","warning"]);o.scriptTest=(0,m.getStringOption)(t.scriptTest,["error","disabled","warning"]);o.use=t.use||"";o.usehref=t.usehref||"";o.extras=null;o.message=null;o.picture=null;o.script=null;return o}return _createClass(Validate)}(u.XFAObject),Bt=function(t){_inherits(Value,t);var r=_createSuper(Value);function Value(t){var o;_classCallCheck(this,Value);(o=r.call(this,S,"value",!0)).id=t.id||"";o.override=(0,m.getInteger)({data:t.override,defaultValue:0,validate:function validate(t){return 1===t}});o.relevant=(0,m.getRelevant)(t.relevant);o.use=t.use||"";o.usehref=t.usehref||"";o.arc=null;o.boolean=null;o.date=null;o.dateTime=null;o.decimal=null;o.exData=null;o.float=null;o.image=null;o.integer=null;o.line=null;o.rectangle=null;o.text=null;o.time=null;return o}_createClass(Value,[{key:u.$setValue,value:function(t){function value(r){return t.apply(this,arguments)}value.toString=function(){return t.toString()};return value}((function(t){var r=this[u.$getParent]();if(r instanceof Ae&&r.ui&&r.ui.imageEdit){if(!this.image){this.image=new je({});this[u.$appendChild](this.image)}this.image[u.$content]=t[u.$content]}else{var o=t[u.$nodeName];if(null===this[o]){var c,l=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(l.s();!(c=l.n()).done;){var h=c.value,d=this[h];if(d instanceof u.XFAObject){this[h]=null;this[u.$removeChild](d)}}}catch(t){l.e(t)}finally{l.f()}this[t[u.$nodeName]]=t;this[u.$appendChild](t)}else this[o][u.$content]=t[u.$content]}}))},{key:u.$text,value:function value(){if(this.exData)return"string"==typeof this.exData[u.$content]?this.exData[u.$content].trim():this.exData[u.$content][u.$text]().trim();var t,r=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(r.s();!(t=r.n()).done;){var o=t.value;if("image"!==o){var c=this[o];if(c instanceof u.XFAObject)return(c[u.$content]||"").toString().trim()}}}catch(t){r.e(t)}finally{r.f()}return null}},{key:u.$toHTML,value:function value(t){var r,o=_createForOfIteratorHelper(Object.getOwnPropertyNames(this));try{for(o.s();!(r=o.n()).done;){var c=this[r.value];if(c instanceof u.XFAObject)return c[u.$toHTML](t)}}catch(t){o.e(t)}finally{o.f()}return m.HTMLResult.EMPTY}}]);return Value}(u.XFAObject);r.Value=Bt;var Lt=function(t){_inherits(Variables,t);var r=_createSuper(Variables);function Variables(t){var o;_classCallCheck(this,Variables);(o=r.call(this,S,"variables",!0)).id=t.id||"";o.use=t.use||"";o.usehref=t.usehref||"";o.boolean=new u.XFAObjectArray;o.date=new u.XFAObjectArray;o.dateTime=new u.XFAObjectArray;o.decimal=new u.XFAObjectArray;o.exData=new u.XFAObjectArray;o.float=new u.XFAObjectArray;o.image=new u.XFAObjectArray;o.integer=new u.XFAObjectArray;o.manifest=new u.XFAObjectArray;o.script=new u.XFAObjectArray;o.text=new u.XFAObjectArray;o.time=new u.XFAObjectArray;return o}_createClass(Variables,[{key:u.$isTransparent,value:function value(){return!0}}]);return Variables}(u.XFAObject),Nt=function(){function TemplateNamespace(){_classCallCheck(this,TemplateNamespace)}_createClass(TemplateNamespace,null,[{key:h.$buildXFAObject,value:function value(t,r){if(TemplateNamespace.hasOwnProperty(t)){var o=TemplateNamespace[t](r);o[u.$setSetAttributes](r);return o}}},{key:"appearanceFilter",value:function appearanceFilter(t){return new E(t)}},{key:"arc",value:function arc(t){return new M(t)}},{key:"area",value:function area(t){return new R(t)}},{key:"assist",value:function assist(t){return new j(t)}},{key:"barcode",value:function barcode(t){return new D(t)}},{key:"bind",value:function bind(t){return new L(t)}},{key:"bindItems",value:function bindItems(t){return new N(t)}},{key:"bookend",value:function bookend(t){return new U(t)}},{key:"boolean",value:function boolean(t){return new H(t)}},{key:"border",value:function border(t){return new $(t)}},{key:"break",value:function _break(t){return new X(t)}},{key:"breakAfter",value:function breakAfter(t){return new q(t)}},{key:"breakBefore",value:function breakBefore(t){return new G(t)}},{key:"button",value:function button(t){return new z(t)}},{key:"calculate",value:function calculate(t){return new W(t)}},{key:"caption",value:function caption(t){return new V(t)}},{key:"certificate",value:function certificate(t){return new K(t)}},{key:"certificates",value:function certificates(t){return new Y(t)}},{key:"checkButton",value:function checkButton(t){return new J(t)}},{key:"choiceList",value:function choiceList(t){return new Z(t)}},{key:"color",value:function color(t){return new Q(t)}},{key:"comb",value:function comb(t){return new ee(t)}},{key:"connect",value:function connect(t){return new te(t)}},{key:"contentArea",value:function contentArea(t){return new re(t)}},{key:"corner",value:function corner(t){return new ae(t)}},{key:"date",value:function date(t){return new ne(t)}},{key:"dateTime",value:function dateTime(t){return new ie(t)}},{key:"dateTimeEdit",value:function dateTimeEdit(t){return new oe(t)}},{key:"decimal",value:function decimal(t){return new se(t)}},{key:"defaultUi",value:function defaultUi(t){return new ce(t)}},{key:"desc",value:function desc(t){return new le(t)}},{key:"digestMethod",value:function digestMethod(t){return new ue(t)}},{key:"digestMethods",value:function digestMethods(t){return new fe(t)}},{key:"draw",value:function draw(t){return new he(t)}},{key:"edge",value:function edge(t){return new de(t)}},{key:"encoding",value:function encoding(t){return new pe(t)}},{key:"encodings",value:function encodings(t){return new ge(t)}},{key:"encrypt",value:function encrypt(t){return new me(t)}},{key:"encryptData",value:function encryptData(t){return new ye(t)}},{key:"encryption",value:function encryption(t){return new ve(t)}},{key:"encryptionMethod",value:function encryptionMethod(t){return new be(t)}},{key:"encryptionMethods",value:function encryptionMethods(t){return new ke(t)}},{key:"event",value:function event(t){return new _e(t)}},{key:"exData",value:function exData(t){return new we(t)}},{key:"exObject",value:function exObject(t){return new Se(t)}},{key:"exclGroup",value:function exclGroup(t){return new Ce(t)}},{key:"execute",value:function execute(t){return new xe(t)}},{key:"extras",value:function extras(t){return new Oe(t)}},{key:"field",value:function field(t){return new Ae(t)}},{key:"fill",value:function fill(t){return new Pe(t)}},{key:"filter",value:function filter(t){return new Te(t)}},{key:"float",value:function float(t){return new Fe(t)}},{key:"font",value:function font(t){return new Ie(t)}},{key:"format",value:function format(t){return new Ee(t)}},{key:"handler",value:function handler(t){return new Me(t)}},{key:"hyphenation",value:function hyphenation(t){return new Re(t)}},{key:"image",value:function image(t){return new je(t)}},{key:"imageEdit",value:function imageEdit(t){return new De(t)}},{key:"integer",value:function integer(t){return new Be(t)}},{key:"issuers",value:function issuers(t){return new Le(t)}},{key:"items",value:function items(t){return new Ne(t)}},{key:"keep",value:function keep(t){return new Ue(t)}},{key:"keyUsage",value:function keyUsage(t){return new He(t)}},{key:"line",value:function line(t){return new $e(t)}},{key:"linear",value:function linear(t){return new Xe(t)}},{key:"lockDocument",value:function lockDocument(t){return new qe(t)}},{key:"manifest",value:function manifest(t){return new Ge(t)}},{key:"margin",value:function margin(t){return new ze(t)}},{key:"mdp",value:function mdp(t){return new We(t)}},{key:"medium",value:function medium(t){return new Ve(t)}},{key:"message",value:function message(t){return new Ke(t)}},{key:"numericEdit",value:function numericEdit(t){return new Ye(t)}},{key:"occur",value:function occur(t){return new Je(t)}},{key:"oid",value:function oid(t){return new Ze(t)}},{key:"oids",value:function oids(t){return new Qe(t)}},{key:"overflow",value:function overflow(t){return new et(t)}},{key:"pageArea",value:function pageArea(t){return new tt(t)}},{key:"pageSet",value:function pageSet(t){return new rt(t)}},{key:"para",value:function para(t){return new at(t)}},{key:"passwordEdit",value:function passwordEdit(t){return new nt(t)}},{key:"pattern",value:function pattern(t){return new it(t)}},{key:"picture",value:function picture(t){return new ot(t)}},{key:"proto",value:function proto(t){return new st(t)}},{key:"radial",value:function radial(t){return new ct(t)}},{key:"reason",value:function reason(t){return new lt(t)}},{key:"reasons",value:function reasons(t){return new ut(t)}},{key:"rectangle",value:function rectangle(t){return new ft(t)}},{key:"ref",value:function ref(t){return new ht(t)}},{key:"script",value:function script(t){return new dt(t)}},{key:"setProperty",value:function setProperty(t){return new gt(t)}},{key:"signData",value:function signData(t){return new mt(t)}},{key:"signature",value:function signature(t){return new yt(t)}},{key:"signing",value:function signing(t){return new vt(t)}},{key:"solid",value:function solid(t){return new bt(t)}},{key:"speak",value:function speak(t){return new kt(t)}},{key:"stipple",value:function stipple(t){return new _t(t)}},{key:"subform",value:function subform(t){return new wt(t)}},{key:"subformSet",value:function subformSet(t){return new St(t)}},{key:"subjectDN",value:function subjectDN(t){return new Ct(t)}},{key:"subjectDNs",value:function subjectDNs(t){return new xt(t)}},{key:"submit",value:function submit(t){return new Ot(t)}},{key:"template",value:function template(t){return new At(t)}},{key:"text",value:function text(t){return new Pt(t)}},{key:"textEdit",value:function textEdit(t){return new Tt(t)}},{key:"time",value:function time(t){return new Ft(t)}},{key:"timeStamp",value:function timeStamp(t){return new It(t)}},{key:"toolTip",value:function toolTip(t){return new Et(t)}},{key:"traversal",value:function traversal(t){return new Mt(t)}},{key:"traverse",value:function traverse(t){return new Rt(t)}},{key:"ui",value:function ui(t){return new jt(t)}},{key:"validate",value:function validate(t){return new Dt(t)}},{key:"value",value:function value(t){return new Bt(t)}},{key:"variables",value:function variables(t){return new Lt(t)}}]);return TemplateNamespace}();r.TemplateNamespace=Nt},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.addHTML=function addHTML(t,r,o){var u=t[c.$extra],h=u.availableSpace,d=_slicedToArray(o,4),g=d[0],m=d[1],y=d[2],v=d[3];switch(t.layout){case"position":u.width=Math.max(u.width,g+y);u.height=Math.max(u.height,m+v);u.children.push(r);break;case"lr-tb":case"rl-tb":if(!u.line||1===u.attempt){u.line=createLine(t,[]);u.children.push(u.line);u.numberInLine=0}u.numberInLine+=1;u.line.children.push(r);if(0===u.attempt){u.currentWidth+=y;u.height=Math.max(u.height,u.prevHeight+v)}else{u.currentWidth=y;u.prevHeight=u.height;u.height+=v;u.attempt=0}u.width=Math.max(u.width,u.currentWidth);break;case"rl-row":case"row":u.children.push(r);u.width+=y;u.height=Math.max(u.height,v);var k,_=(0,l.measureToString)(u.height),w=function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}(u.children);try{for(w.s();!(k=w.n()).done;){k.value.attributes.style.height=_}}catch(t){w.e(t)}finally{w.f()}break;case"table":case"tb":u.width=Math.min(h.width,Math.max(u.width,y));u.height+=v;u.children.push(r)}};r.checkDimensions=function checkDimensions(t,r){if(null===t[c.$getTemplateRoot]()[c.$extra].firstUnsplittable)return!0;if(0===t.w||0===t.h)return!0;var o=t[c.$getSubformParent](),l=o[c.$extra]&&o[c.$extra].attempt||0,u=_slicedToArray(function getTransformedBBox(t){var r,o,c=""===t.w?NaN:t.w,l=""===t.h?NaN:t.h,u=0,h=0;switch(t.anchorType||""){case"bottomCenter":u=c/2;h=l;break;case"bottomLeft":u=0;h=l;break;case"bottomRight":u=c;h=l;break;case"middleCenter":u=c/2;h=l/2;break;case"middleLeft":u=0;h=l/2;break;case"middleRight":u=c;h=l/2;break;case"topCenter":u=c/2;h=0;break;case"topRight":u=c;h=0}switch(t.rotate||0){case 0:r=-u;o=-h;break;case 90:r=-h;o=u;var d=[l,-c];c=d[0];l=d[1];break;case 180:r=u;o=h;var g=[-c,-l];c=g[0];l=g[1];break;case 270:r=h;o=-u;var m=[-l,c];c=m[0];l=m[1]}return[t.x+r+Math.min(0,c),t.y+o+Math.min(0,l),Math.abs(c),Math.abs(l)]}(t),4),h=u[1],d=u[2],g=u[3];switch(o.layout){case"lr-tb":case"rl-tb":return 0===l?t[c.$getTemplateRoot]()[c.$extra].noLayoutFailure?""!==t.w?Math.round(d-r.width)<=2:r.width>2:!(""!==t.h&&Math.round(g-r.height)>2)&&(""!==t.w?Math.round(d-r.width)<=2||0===o[c.$extra].numberInLine&&r.height>2:r.width>2):!!t[c.$getTemplateRoot]()[c.$extra].noLayoutFailure||!(""!==t.h&&Math.round(g-r.height)>2)&&((""===t.w||Math.round(d-r.width)<=2||!o[c.$isThereMoreWidth]())&&r.height>2);case"table":case"tb":return!!t[c.$getTemplateRoot]()[c.$extra].noLayoutFailure||(""===t.h||t[c.$isSplittable]()?(""===t.w||Math.round(d-r.width)<=2||!o[c.$isThereMoreWidth]())&&r.height>2:Math.round(g-r.height)<=2);case"position":if(t[c.$getTemplateRoot]()[c.$extra].noLayoutFailure)return!0;if(""===t.h||Math.round(g+h-r.height)<=2)return!0;var m=t[c.$getTemplateRoot]()[c.$extra].currentContentArea;return g+h>m.h;case"rl-row":case"row":return!!t[c.$getTemplateRoot]()[c.$extra].noLayoutFailure||(""===t.h||Math.round(g-r.height)<=2);default:return!0}};r.flushHTML=function flushHTML(t){if(!t[c.$extra])return null;var r={name:"div",attributes:t[c.$extra].attributes,children:t[c.$extra].children};if(t[c.$extra].failingNode){var o=t[c.$extra].failingNode[c.$flushHTML]();o&&(t.layout.endsWith("-tb")?r.children.push(createLine(t,[o])):r.children.push(o))}if(0===r.children.length)return null;return r};r.getAvailableSpace=function getAvailableSpace(t){var r=t[c.$extra].availableSpace,o=t.margin?t.margin.topInset+t.margin.bottomInset:0,l=t.margin?t.margin.leftInset+t.margin.rightInset:0;switch(t.layout){case"lr-tb":case"rl-tb":return 0===t[c.$extra].attempt?{width:r.width-l-t[c.$extra].currentWidth,height:r.height-o-t[c.$extra].prevHeight}:{width:r.width-l,height:r.height-o-t[c.$extra].height};case"rl-row":case"row":return{width:t[c.$extra].columnWidths.slice(t[c.$extra].currentColumn).reduce((function(t,r){return t+r})),height:r.height-l};case"table":case"tb":return{width:r.width-l,height:r.height-o-t[c.$extra].height};default:return r}};var c=o(217),l=o(224);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function createLine(t,r){return{name:"div",attributes:{class:["lr-tb"===t.layout?"xfaLr":"xfaRl"]},children:r}}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.computeBbox=function computeBbox(t,r,o){var l;if(""!==t.w&&""!==t.h)l=[t.x,t.y,t.w,t.h];else{if(!o)return null;var u=t.w;if(""===u){if(0===t.maxW){var h=t[c.$getSubformParent]();u="position"===h.layout&&""!==h.w?0:t.minW}else u=Math.min(t.maxW,o.width);r.attributes.style.width=measureToString(u)}var d=t.h;if(""===d){if(0===t.maxH){var g=t[c.$getSubformParent]();d="position"===g.layout&&""!==g.h?0:t.minH}else d=Math.min(t.maxH,o.height);r.attributes.style.height=measureToString(d)}l=[t.x,t.y,u,d]}return l};r.createWrapper=function createWrapper(t,r){var o=r.attributes,l=o.style,u={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};o.class.push("xfaWrapped");if(t.border){var h,d,g=t.border[c.$extra],m=g.widths,y=g.insets,v=y[0],k=y[3],_=y[0]+y[2],w=y[1]+y[3];switch(t.border.hand){case"even":v-=m[0]/2;k-=m[3]/2;h="calc(100% + ".concat((m[1]+m[3])/2-w,"px)");d="calc(100% + ".concat((m[0]+m[2])/2-_,"px)");break;case"left":v-=m[0];k-=m[3];h="calc(100% + ".concat(m[1]+m[3]-w,"px)");d="calc(100% + ".concat(m[0]+m[2]-_,"px)");break;case"right":h=w?"calc(100% - ".concat(w,"px)"):"100%";d=_?"calc(100% - ".concat(_,"px)"):"100%"}var S=["xfaBorder"];isPrintOnly(t.border)&&S.push("xfaPrintOnly");for(var C={name:"div",attributes:{class:S,style:{top:"".concat(v,"px"),left:"".concat(k,"px"),width:h,height:d}},children:[]},x=0,O=["border","borderWidth","borderColor","borderRadius","borderStyle"];x<O.length;x++){var T=O[x];if(void 0!==l[T]){C.attributes.style[T]=l[T];delete l[T]}}u.children.push(C,r)}else u.children.push(r);for(var E=0,M=["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"];E<M.length;E++){var R=M[E];if(void 0!==l[R]){u.attributes.style[R]=l[R];delete l[R]}}"absolute"===l.position?u.attributes.style.position="absolute":u.attributes.style.position="relative";delete l.position;if(l.alignSelf){u.attributes.style.alignSelf=l.alignSelf;delete l.alignSelf}return u};r.fixDimensions=function fixDimensions(t){var r=t[c.$getSubformParent]();if(r.layout&&r.layout.includes("row")){var o,l=r[c.$extra],u=t.colSpan;o=-1===u?l.columnWidths.slice(l.currentColumn).reduce((function(t,r){return t+r}),0):l.columnWidths.slice(l.currentColumn,l.currentColumn+u).reduce((function(t,r){return t+r}),0);isNaN(o)||(t.w=o)}r.layout&&"position"!==r.layout&&(t.x=t.y=0);"table"===t.layout&&""===t.w&&Array.isArray(t.columnWidths)&&(t.w=t.columnWidths.reduce((function(t,r){return t+r}),0))};r.fixTextIndent=function fixTextIndent(t){var r=(0,u.getMeasurement)(t.textIndent,"0px");if(r>=0)return;var o="padding"+("left"==("right"===t.textAlign?"right":"left")?"Left":"Right"),c=(0,u.getMeasurement)(t[o],"0px");t[o]="".concat(c-r,"px")};r.fixURL=function fixURL(t){var r=(0,l.createValidAbsoluteUrl)(t,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return r?r.href:null};r.isPrintOnly=isPrintOnly;r.layoutClass=function layoutClass(t){switch(t.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}};r.layoutNode=function layoutNode(t,r){var o=null,l=null,u=!1;if((!t.w||!t.h)&&t.value){var h=0,d=0;if(t.margin){h=t.margin.leftInset+t.margin.rightInset;d=t.margin.topInset+t.margin.bottomInset}var g=null,m=null;if(t.para){m=Object.create(null);g=""===t.para.lineHeight?null:t.para.lineHeight;m.top=""===t.para.spaceAbove?0:t.para.spaceAbove;m.bottom=""===t.para.spaceBelow?0:t.para.spaceBelow;m.left=""===t.para.marginLeft?0:t.para.marginLeft;m.right=""===t.para.marginRight?0:t.para.marginRight}var y=t.font;if(!y)for(var v=t[c.$getTemplateRoot](),k=t[c.$getParent]();k&&k!==v;){if(k.font){y=k.font;break}k=k[c.$getParent]()}var _=(t.w?t.w:r.width)-h,w=t[c.$globalData].fontFinder;if(t.value.exData&&t.value.exData[c.$content]&&"text/html"===t.value.exData.contentType){var S=layoutText(t.value.exData[c.$content],y,m,g,w,_);l=S.width;o=S.height;u=S.isBroken}else{var C=t.value[c.$text]();if(C){var x=layoutText(C,y,m,g,w,_);l=x.width;o=x.height;u=x.isBroken}}null===l||t.w||(l+=h);null===o||t.h||(o+=d)}return{w:l,h:o,isBroken:u}};r.measureToString=measureToString;r.setAccess=function setAccess(t,r){switch(t.access){case"nonInteractive":r.push("xfaNonInteractive");break;case"readOnly":r.push("xfaReadOnly");break;case"protected":r.push("xfaDisabled")}};r.setFontFamily=function setFontFamily(t,r,o,c){if(!o){delete c.fontFamily;return}var l=(0,u.stripQuotes)(t.typeface);c.fontFamily='"'.concat(l,'"');var d=o.find(l);if(d){var g=d.regular.cssFontInfo.fontFamily;g!==l&&(c.fontFamily='"'.concat(g,'"'));var m=getCurrentPara(r);if(m&&""!==m.lineHeight)return;if(c.lineHeight)return;var y=(0,h.selectFont)(t,d);y&&(c.lineHeight=Math.max(1.2,y.lineHeight))}};r.setMinMaxDimensions=function setMinMaxDimensions(t,r){if("position"===t[c.$getSubformParent]().layout){t.minW>0&&(r.minWidth=measureToString(t.minW));t.maxW>0&&(r.maxWidth=measureToString(t.maxW));t.minH>0&&(r.minHeight=measureToString(t.minH));t.maxH>0&&(r.maxHeight=measureToString(t.maxH))}};r.setPara=function setPara(t,r,o){if(o.attributes.class&&o.attributes.class.includes("xfaRich")){if(r){""===t.h&&(r.height="auto");""===t.w&&(r.width="auto")}var l=getCurrentPara(t);if(l){var u=o.attributes.style;u.display="flex";u.flexDirection="column";switch(l.vAlign){case"top":u.justifyContent="start";break;case"bottom":u.justifyContent="end";break;case"middle":u.justifyContent="center"}for(var h=l[c.$toStyle](),d=0,g=Object.entries(h);d<g.length;d++){var m=(k=g[d],_=2,function _arrayWithHoles(t){if(Array.isArray(t))return t}(k)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(k,_)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(k,_)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),y=m[0],v=m[1];y in u||(u[y]=v)}}}var k,_};r.toStyle=function toStyle(t){for(var r=Object.create(null),o=arguments.length,u=new Array(o>1?o-1:0),h=1;h<o;h++)u[h-1]=arguments[h];for(var d=0,m=u;d<m.length;d++){var y=m[d],v=t[y];if(null!==v)if(g.hasOwnProperty(y))g[y](t,r);else if(v instanceof c.XFAObject){var k=v[c.$toStyle]();k?Object.assign(r,k):(0,l.warn)("(DEBUG) - XFA - style for ".concat(y," not implemented yet"))}}return r};var c=o(217),l=o(4),u=o(218),h=o(225),d=o(226);function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function measureToString(t){return"string"==typeof t?"0px":Number.isInteger(t)?"".concat(t,"px"):"".concat(t.toFixed(2),"px")}var g={anchorType:function anchorType(t,r){var o=t[c.$getSubformParent]();if(o&&(!o.layout||"position"===o.layout)){"transform"in r||(r.transform="");switch(t.anchorType){case"bottomCenter":r.transform+="translate(-50%, -100%)";break;case"bottomLeft":r.transform+="translate(0,-100%)";break;case"bottomRight":r.transform+="translate(-100%,-100%)";break;case"middleCenter":r.transform+="translate(-50%,-50%)";break;case"middleLeft":r.transform+="translate(0,-50%)";break;case"middleRight":r.transform+="translate(-100%,-50%)";break;case"topCenter":r.transform+="translate(-50%,0)";break;case"topRight":r.transform+="translate(-100%,0)"}}},dimensions:function dimensions(t,r){var o=t[c.$getSubformParent](),l=t.w,u=t.h;if(o.layout&&o.layout.includes("row")){var h,d=o[c.$extra],g=t.colSpan;if(-1===g){h=d.columnWidths.slice(d.currentColumn).reduce((function(t,r){return t+r}),0);d.currentColumn=0}else{h=d.columnWidths.slice(d.currentColumn,d.currentColumn+g).reduce((function(t,r){return t+r}),0);d.currentColumn=(d.currentColumn+t.colSpan)%d.columnWidths.length}isNaN(h)||(l=t.w=h)}r.width=""!==l?measureToString(l):"auto";r.height=""!==u?measureToString(u):"auto"},position:function position(t,r){var o=t[c.$getSubformParent]();if(!o||!o.layout||"position"===o.layout){r.position="absolute";r.left=measureToString(t.x);r.top=measureToString(t.y)}},rotate:function rotate(t,r){if(t.rotate){"transform"in r||(r.transform="");r.transform+="rotate(-".concat(t.rotate,"deg)");r.transformOrigin="top left"}},presence:function presence(t,r){switch(t.presence){case"invisible":r.visibility="hidden";break;case"hidden":case"inactive":r.display="none"}},hAlign:function hAlign(t,r){if("para"===t[c.$nodeName])switch(t.hAlign){case"justifyAll":r.textAlign="justify-all";break;case"radix":r.textAlign="left";break;default:r.textAlign=t.hAlign}else switch(t.hAlign){case"left":r.alignSelf="start";break;case"center":r.alignSelf="center";break;case"right":r.alignSelf="end"}},margin:function margin(t,r){t.margin&&(r.margin=t.margin[c.$toStyle]().margin)}};function layoutText(t,r,o,l,u,h){var g=new d.TextMeasure(r,o,l,u);"string"==typeof t?g.addString(t):t[c.$pushGlyphs](g);return g.compute(h)}function isPrintOnly(t){return t.relevant.length>0&&!t.relevant[0].excluded&&"print"===t.relevant[0].viewname}function getCurrentPara(t){var r=t[c.$getTemplateRoot]()[c.$extra].paraStack;return r.length?r[r.length-1]:null}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.FontFinder=void 0;r.getMetrics=function getMetrics(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=null;if(t){var u=(0,l.stripQuotes)(t.typeface),h=t[c.$globalData].fontFinder.find(u);o=selectFont(t,h)}if(!o)return{lineHeight:12,lineGap:2,lineNoGap:10};var d=t.size||10,g=o.lineHeight?Math.max(r?0:1.2,o.lineHeight):1.2,m=void 0===o.lineGap?.2:o.lineGap;return{lineHeight:g*d,lineGap:m*d,lineNoGap:Math.max(1,g-m)*d}};r.selectFont=selectFont;var c=o(217),l=o(218),u=o(4);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var h=function(){function FontFinder(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,FontFinder);this.fonts=new Map;this.cache=new Map;this.warned=new Set;this.defaultFont=null;this.add(t)}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(FontFinder,[{key:"add",value:function add(t){var r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=_createForOfIteratorHelper(t);try{for(c.s();!(r=c.n()).done;){var l=r.value;this.addPdfFont(l)}}catch(t){c.e(t)}finally{c.f()}var u,h=_createForOfIteratorHelper(this.fonts.values());try{for(h.s();!(u=h.n()).done;){var d=u.value;d.regular||(d.regular=d.italic||d.bold||d.bolditalic)}}catch(t){h.e(t)}finally{h.f()}if(o&&0!==o.size){var g,m=this.fonts.get("PdfJS-Fallback-PdfJS-XFA"),y=_createForOfIteratorHelper(o);try{for(y.s();!(g=y.n()).done;){var v=g.value;this.fonts.set(v,m)}}catch(t){y.e(t)}finally{y.f()}}}},{key:"addPdfFont",value:function addPdfFont(t){var r=t.cssFontInfo,o=r.fontFamily,c=this.fonts.get(o);if(!c){c=Object.create(null);this.fonts.set(o,c);this.defaultFont||(this.defaultFont=c)}var l="",u=parseFloat(r.fontWeight);0!==parseFloat(r.italicAngle)?l=u>=700?"bolditalic":"italic":u>=700&&(l="bold");if(!l){(t.name.includes("Bold")||t.psName&&t.psName.includes("Bold"))&&(l="bold");(t.name.includes("Italic")||t.name.endsWith("It")||t.psName&&(t.psName.includes("Italic")||t.psName.endsWith("It")))&&(l+="italic")}l||(l="regular");c[l]=t}},{key:"getDefault",value:function getDefault(){return this.defaultFont}},{key:"find",value:function find(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=this.fonts.get(t)||this.cache.get(t);if(o)return o;var c=/,|-|_| |bolditalic|bold|italic|regular|it/gi,l=t.replace(c,"");if(o=this.fonts.get(l)){this.cache.set(t,o);return o}l=l.toLowerCase();var h,d=[],g=_createForOfIteratorHelper(this.fonts.entries());try{for(g.s();!(h=g.n()).done;){var m=_slicedToArray(h.value,2),y=m[0],v=m[1];y.replace(c,"").toLowerCase().startsWith(l)&&d.push(v)}}catch(t){g.e(t)}finally{g.f()}if(0===d.length){var k,_=_createForOfIteratorHelper(this.fonts.entries());try{for(_.s();!(k=_.n()).done;){var w=_slicedToArray(k.value,2),S=w[1];S.regular.name&&S.regular.name.replace(c,"").toLowerCase().startsWith(l)&&d.push(S)}}catch(t){_.e(t)}finally{_.f()}}if(0===d.length){l=l.replace(/psmt|mt/gi,"");var C,x=_createForOfIteratorHelper(this.fonts.entries());try{for(x.s();!(C=x.n()).done;){var O=_slicedToArray(C.value,2),T=O[0],E=O[1];T.replace(c,"").toLowerCase().startsWith(l)&&d.push(E)}}catch(t){x.e(t)}finally{x.f()}}if(0===d.length){var M,R=_createForOfIteratorHelper(this.fonts.values());try{for(R.s();!(M=R.n()).done;){var j=M.value;j.regular.name&&j.regular.name.replace(c,"").toLowerCase().startsWith(l)&&d.push(j)}}catch(t){R.e(t)}finally{R.f()}}if(d.length>=1){1!==d.length&&r&&(0,u.warn)("XFA - Too many choices to guess the correct font: ".concat(t));this.cache.set(t,d[0]);return d[0]}if(r&&!this.warned.has(t)){this.warned.add(t);(0,u.warn)("XFA - Cannot find the font: ".concat(t))}return null}}]);return FontFinder}();r.FontFinder=h;function selectFont(t,r){return"italic"===t.posture?"bold"===t.weight?r.bolditalic:r.italic:"bold"===t.weight?r.bold:r.regular}},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TextMeasure=void 0;var c=o(225);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var l=function(){function FontInfo(t,r,o,l){_classCallCheck(this,FontInfo);this.lineHeight=o;this.paraMargin=r||{top:0,bottom:0,left:0,right:0};if(t){this.xfaFont={typeface:t.typeface,posture:t.posture,weight:t.weight,size:t.size,letterSpacing:t.letterSpacing};var u=l.find(t.typeface);if(u){this.pdfFont=(0,c.selectFont)(t,u);if(!this.pdfFont){var h=_slicedToArray(this.defaultFont(l),2);this.pdfFont=h[0];this.xfaFont=h[1]}}else{var d=_slicedToArray(this.defaultFont(l),2);this.pdfFont=d[0];this.xfaFont=d[1]}}else{var g=_slicedToArray(this.defaultFont(l),2);this.pdfFont=g[0];this.xfaFont=g[1]}}_createClass(FontInfo,[{key:"defaultFont",value:function defaultFont(t){var r=t.find("Helvetica",!1)||t.find("Myriad Pro",!1)||t.find("Arial",!1)||t.getDefault();if(r&&r.regular){var o=r.regular;return[o,{typeface:o.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}]);return FontInfo}(),u=function(){function FontSelector(t,r,o,c){_classCallCheck(this,FontSelector);this.fontFinder=c;this.stack=[new l(t,r,o,c)]}_createClass(FontSelector,[{key:"pushData",value:function pushData(t,r,o){for(var c=this.stack[this.stack.length-1],u=0,h=["typeface","posture","weight","size","letterSpacing"];u<h.length;u++){var d=h[u];t[d]||(t[d]=c.xfaFont[d])}for(var g=0,m=["top","bottom","left","right"];g<m.length;g++){var y=m[g];isNaN(r[y])&&(r[y]=c.paraMargin[y])}var v=new l(t,r,o||c.lineHeight,this.fontFinder);v.pdfFont||(v.pdfFont=c.pdfFont);this.stack.push(v)}},{key:"popFont",value:function popFont(){this.stack.pop()}},{key:"topFont",value:function topFont(){return this.stack[this.stack.length-1]}}]);return FontSelector}(),h=function(){function TextMeasure(t,r,o,c){_classCallCheck(this,TextMeasure);this.glyphs=[];this.fontSelector=new u(t,r,o,c);this.extraHeight=0}_createClass(TextMeasure,[{key:"pushData",value:function pushData(t,r,o){this.fontSelector.pushData(t,r,o)}},{key:"popFont",value:function popFont(t){return this.fontSelector.popFont()}},{key:"addPara",value:function addPara(){var t=this.fontSelector.topFont();this.extraHeight+=t.paraMargin.top+t.paraMargin.bottom}},{key:"addString",value:function addString(t){if(t){var r=this.fontSelector.topFont(),o=r.xfaFont.size;if(r.pdfFont){var c,l=r.xfaFont.letterSpacing,u=r.pdfFont,h=u.lineHeight||1.2,d=r.lineHeight||Math.max(1.2,h)*o,g=h-(void 0===u.lineGap?.2:u.lineGap),m=Math.max(1,g)*o,y=o/1e3,v=u.defaultWidth||u.charsToGlyphs(" ")[0].width,k=_createForOfIteratorHelper(t.split(/[\u2029\n]/));try{for(k.s();!(c=k.n()).done;){var _,w=c.value,S=u.encodeString(w).join(""),C=_createForOfIteratorHelper(u.charsToGlyphs(S));try{for(C.s();!(_=C.n()).done;){var x=_.value,O=x.width||v;this.glyphs.push([O*y+l,d,m,x.unicode,!1])}}catch(t){C.e(t)}finally{C.f()}this.glyphs.push([0,0,0,"\n",!0])}}catch(t){k.e(t)}finally{k.f()}this.glyphs.pop()}else{var T,E=_createForOfIteratorHelper(t.split(/[\u2029\n]/));try{for(E.s();!(T=E.n()).done;){var M,R=_createForOfIteratorHelper(T.value.split(""));try{for(R.s();!(M=R.n()).done;){var j=M.value;this.glyphs.push([o,1.2*o,o,j,!1])}}catch(t){R.e(t)}finally{R.f()}this.glyphs.push([0,0,0,"\n",!0])}}catch(t){E.e(t)}finally{E.f()}this.glyphs.pop()}}}},{key:"compute",value:function compute(t){for(var r=-1,o=0,c=0,l=0,u=0,h=0,d=!1,g=!0,m=0,y=this.glyphs.length;m<y;m++){var v=_slicedToArray(this.glyphs[m],5),k=v[0],_=v[1],w=v[2],S=" "===v[3],C=g?w:_;if(v[4]){c=Math.max(c,u);u=0;l+=h;h=C;r=-1;o=0;g=!1}else if(S)if(u+k>t){c=Math.max(c,u);u=0;l+=h;h=C;r=-1;o=0;d=!0;g=!1}else{h=Math.max(C,h);o=u;u+=k;r=m}else if(u+k>t){l+=h;h=C;if(-1!==r){m=r;c=Math.max(c,o);u=0;r=-1;o=0}else{c=Math.max(c,u);u=k}d=!0;g=!1}else{u+=k;h=Math.max(C,h)}}return{width:1.02*(c=Math.max(c,u)),height:l+=h+this.extraHeight,isBroken:d}}}]);return TextMeasure}();r.TextMeasure=h},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DataHandler=void 0;var c=o(217);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var l=function(){function DataHandler(t,r){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,DataHandler);this.data=r;this.dataset=t.datasets||null}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(DataHandler,[{key:"serialize",value:function serialize(t){for(var r=[[-1,this.data[c.$getChildren]()]];r.length>0;){var o=r[r.length-1],l=_slicedToArray(o,2),u=l[0],h=l[1];if(u+1!==h.length){var d=h[++o[0]],g=t.get(d[c.$uid]);if(g)d[c.$setValue](g);else{var m,y=_createForOfIteratorHelper(d[c.$getAttributes]().values());try{for(y.s();!(m=y.n()).done;){var v=m.value,k=t.get(v[c.$uid]);if(k){v[c.$setValue](k);break}}}catch(t){y.e(t)}finally{y.f()}}var _=d[c.$getChildren]();_.length>0&&r.push([-1,_])}else r.pop()}var w=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset){var S,C=_createForOfIteratorHelper(this.dataset[c.$getChildren]());try{for(C.s();!(S=C.n()).done;){var x=S.value;"data"!==x[c.$nodeName]&&x[c.$toString](w)}}catch(t){C.e(t)}finally{C.f()}}this.data[c.$toString](w);w.push("</xfa:datasets>");return w.join("")}}]);return DataHandler}();r.DataHandler=l},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XFAParser=void 0;var c=o(217),l=o(210),u=o(229),h=o(4);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var d=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(XFAParser,t);var r=_createSuper(XFAParser);function XFAParser(){var t,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];_classCallCheck(this,XFAParser);(t=r.call(this))._builder=new u.Builder(o);t._stack=[];t._globalData={usedTypefaces:new Set};t._ids=new Map;t._current=t._builder.buildRoot(t._ids);t._errorCode=l.XMLParserErrorCode.NoError;t._whiteRegex=/^\s+$/;t._nbsps=/\xa0+/g;t._richText=c;return t}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(XFAParser,[{key:"parse",value:function parse(t){this.parseXml(t);if(this._errorCode===l.XMLParserErrorCode.NoError){this._current[c.$finalize]();return this._current.element}}},{key:"onText",value:function onText(t){t=t.replace(this._nbsps,(function(t){return t.slice(1)+" "}));this._richText||this._current[c.$acceptWhitespace]()?this._current[c.$onText](t,this._richText):this._whiteRegex.test(t)||this._current[c.$onText](t.trim())}},{key:"onCdata",value:function onCdata(t){this._current[c.$onText](t)}},{key:"_mkAttributes",value:function _mkAttributes(t,r){var o,l=null,u=null,d=Object.create({}),g=function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}(t);try{for(g.s();!(o=g.n()).done;){var m=o.value,y=m.name,v=m.value;if("xmlns"===y)l?(0,h.warn)("XFA - multiple namespace definition in <".concat(r,">")):l=v;else if(y.startsWith("xmlns:")){var k=y.substring("xmlns:".length);u||(u=[]);u.push({prefix:k,value:v})}else{var _=y.indexOf(":");if(-1===_)d[y]=v;else{var w=d[c.$nsAttributes];w||(w=d[c.$nsAttributes]=Object.create(null));var S=[y.slice(0,_),y.slice(_+1)],C=S[0],x=S[1],O=w[C];O||(O=w[C]=Object.create(null));O[x]=v}}}}catch(t){g.e(t)}finally{g.f()}return[l,u,d]}},{key:"_getNameAndPrefix",value:function _getNameAndPrefix(t,r){var o=t.indexOf(":");return-1===o?[t,null]:[t.substring(o+1),r?"":t.substring(0,o)]}},{key:"onBeginElement",value:function onBeginElement(t,r,o){var l=_slicedToArray(this._mkAttributes(r,t),3),u=l[0],h=l[1],d=l[2],g=_slicedToArray(this._getNameAndPrefix(t,this._builder.isNsAgnostic()),2),m=g[0],y=g[1],v=this._builder.build({nsPrefix:y,name:m,attributes:d,namespace:u,prefixes:h});v[c.$globalData]=this._globalData;if(o){v[c.$finalize]();this._current[c.$onChild](v)&&v[c.$setId](this._ids);v[c.$clean](this._builder)}else{this._stack.push(this._current);this._current=v}}},{key:"onEndElement",value:function onEndElement(t){var r=this._current;if(r[c.$isCDATAXml]()&&"string"==typeof r[c.$content]){var o=new XFAParser;o._globalData=this._globalData;var l=o.parse(r[c.$content]);r[c.$content]=null;r[c.$onChild](l)}r[c.$finalize]();this._current=this._stack.pop();this._current[c.$onChild](r)&&r[c.$setId](this._ids);r[c.$clean](this._builder)}},{key:"onError",value:function onError(t){this._errorCode=t}}]);return XFAParser}(l.XMLParserBase);r.XFAParser=d},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.Builder=void 0;var c=o(219),l=o(217),u=o(230),h=o(222),d=o(239),g=o(4);function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(t){return function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}(t)||function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_unsupportedIterableToArray(t)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _get(){_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,o){var c=_superPropBase(t,r);if(c){var l=Object.getOwnPropertyDescriptor(c,r);return l.get?l.get.call(arguments.length<3?t:o):l.value}};return _get.apply(this,arguments)}function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var m=function(t){_inherits(Root,t);var r=_createSuper(Root);function Root(t){var o;_classCallCheck(this,Root);(o=r.call(this,-1,"root",Object.create(null))).element=null;o[l.$ids]=t;return o}_createClass(Root,[{key:l.$onChild,value:function value(t){this.element=t;return!0}},{key:l.$finalize,value:function value(){_get(_getPrototypeOf(Root.prototype),l.$finalize,this).call(this);if(this.element.template instanceof h.Template){this[l.$ids].set(l.$root,this.element);this.element.template[l.$resolvePrototypes](this[l.$ids]);this.element.template[l.$ids]=this[l.$ids]}}}]);return Root}(l.XFAObject),y=function(t){_inherits(Empty,t);var r=_createSuper(Empty);function Empty(){_classCallCheck(this,Empty);return r.call(this,-1,"",Object.create(null))}_createClass(Empty,[{key:l.$onChild,value:function value(t){return!1}}]);return Empty}(l.XFAObject),v=function(){function Builder(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_classCallCheck(this,Builder);this._namespaceStack=[];this._nsAgnosticLevel=0;this._namespacePrefixes=new Map;this._namespaces=new Map;this._nextNsId=Math.max.apply(Math,_toConsumableArray(Object.values(c.NamespaceIds).map((function(t){return t.id}))));this._currentNamespace=t||new d.UnknownNamespace(++this._nextNsId)}_createClass(Builder,[{key:"buildRoot",value:function buildRoot(t){return new m(t)}},{key:"build",value:function build(t){var r=t.nsPrefix,o=t.name,h=t.attributes,d=t.namespace,g=t.prefixes,m=null!==d;if(m){this._namespaceStack.push(this._currentNamespace);this._currentNamespace=this._searchNamespace(d)}g&&this._addNamespacePrefix(g);if(h.hasOwnProperty(l.$nsAttributes)){for(var v=u.NamespaceSetUp.datasets,k=h[l.$nsAttributes],_=null,w=0,S=Object.entries(k);w<S.length;w++){var C=_slicedToArray(S[w],2),x=C[0],O=C[1];if(this._getNamespaceToUse(x)===v){_={xfa:O};break}}_?h[l.$nsAttributes]=_:delete h[l.$nsAttributes]}var T=this._getNamespaceToUse(r),E=T&&T[c.$buildXFAObject](o,h)||new y;E[l.$isNsAgnostic]()&&this._nsAgnosticLevel++;(m||g||E[l.$isNsAgnostic]())&&(E[l.$cleanup]={hasNamespace:m,prefixes:g,nsAgnostic:E[l.$isNsAgnostic]()});return E}},{key:"isNsAgnostic",value:function isNsAgnostic(){return this._nsAgnosticLevel>0}},{key:"_searchNamespace",value:function _searchNamespace(t){var r=this._namespaces.get(t);if(r)return r;for(var o=0,l=Object.entries(c.NamespaceIds);o<l.length;o++){var h=_slicedToArray(l[o],2),g=h[0];if((0,h[1].check)(t)){if(r=u.NamespaceSetUp[g]){this._namespaces.set(t,r);return r}break}}r=new d.UnknownNamespace(++this._nextNsId);this._namespaces.set(t,r);return r}},{key:"_addNamespacePrefix",value:function _addNamespacePrefix(t){var r,o=function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}(t);try{for(o.s();!(r=o.n()).done;){var c=r.value,l=c.prefix,u=c.value,h=this._searchNamespace(u),d=this._namespacePrefixes.get(l);if(!d){d=[];this._namespacePrefixes.set(l,d)}d.push(h)}}catch(t){o.e(t)}finally{o.f()}}},{key:"_getNamespaceToUse",value:function _getNamespaceToUse(t){if(!t)return this._currentNamespace;var r=this._namespacePrefixes.get(t);if(r&&r.length>0)return r[r.length-1];(0,g.warn)("Unknown namespace prefix: ".concat(t,"."));return null}},{key:"clean",value:function clean(t){var r=this,o=t.hasNamespace,c=t.prefixes,l=t.nsAgnostic;o&&(this._currentNamespace=this._namespaceStack.pop());c&&c.forEach((function(t){var o=t.prefix;r._namespacePrefixes.get(o).pop()}));l&&this._nsAgnosticLevel--}}]);return Builder}();r.Builder=v},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.NamespaceSetUp=void 0;var c=o(231),l=o(232),u=o(233),h=o(234),d=o(235),g=o(236),m=o(222),y=o(237),v=o(238),k={config:c.ConfigNamespace,connection:l.ConnectionSetNamespace,datasets:u.DatasetsNamespace,localeSet:h.LocaleSetNamespace,signature:d.SignatureNamespace,stylesheet:g.StylesheetNamespace,template:m.TemplateNamespace,xdp:y.XdpNamespace,xhtml:v.XhtmlNamespace};r.NamespaceSetUp=k},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.ConfigNamespace=void 0;var c=o(219),l=o(217),u=o(218),h=o(4);function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var d=c.NamespaceIds.config.id,g=function(t){_inherits(Acrobat,t);var r=_createSuper(Acrobat);function Acrobat(t){var o;_classCallCheck(this,Acrobat);(o=r.call(this,d,"acrobat",!0)).acrobat7=null;o.autoSave=null;o.common=null;o.validate=null;o.validateApprovalSignatures=null;o.submitUrl=new l.XFAObjectArray;return o}return _createClass(Acrobat)}(l.XFAObject),m=function(t){_inherits(Acrobat7,t);var r=_createSuper(Acrobat7);function Acrobat7(t){var o;_classCallCheck(this,Acrobat7);(o=r.call(this,d,"acrobat7",!0)).dynamicRender=null;return o}return _createClass(Acrobat7)}(l.XFAObject),y=function(t){_inherits(ADBE_JSConsole,t);var r=_createSuper(ADBE_JSConsole);function ADBE_JSConsole(t){_classCallCheck(this,ADBE_JSConsole);return r.call(this,d,"ADBE_JSConsole",["delegate","Enable","Disable"])}return _createClass(ADBE_JSConsole)}(l.OptionObject),v=function(t){_inherits(ADBE_JSDebugger,t);var r=_createSuper(ADBE_JSDebugger);function ADBE_JSDebugger(t){_classCallCheck(this,ADBE_JSDebugger);return r.call(this,d,"ADBE_JSDebugger",["delegate","Enable","Disable"])}return _createClass(ADBE_JSDebugger)}(l.OptionObject),k=function(t){_inherits(AddSilentPrint,t);var r=_createSuper(AddSilentPrint);function AddSilentPrint(t){_classCallCheck(this,AddSilentPrint);return r.call(this,d,"addSilentPrint")}return _createClass(AddSilentPrint)}(l.Option01),_=function(t){_inherits(AddViewerPreferences,t);var r=_createSuper(AddViewerPreferences);function AddViewerPreferences(t){_classCallCheck(this,AddViewerPreferences);return r.call(this,d,"addViewerPreferences")}return _createClass(AddViewerPreferences)}(l.Option01),w=function(t){_inherits(AdjustData,t);var r=_createSuper(AdjustData);function AdjustData(t){_classCallCheck(this,AdjustData);return r.call(this,d,"adjustData")}return _createClass(AdjustData)}(l.Option10),S=function(t){_inherits(AdobeExtensionLevel,t);var r=_createSuper(AdobeExtensionLevel);function AdobeExtensionLevel(t){_classCallCheck(this,AdobeExtensionLevel);return r.call(this,d,"adobeExtensionLevel",0,(function(t){return t>=1&&t<=8}))}return _createClass(AdobeExtensionLevel)}(l.IntegerObject),C=function(t){_inherits(Agent,t);var r=_createSuper(Agent);function Agent(t){var o;_classCallCheck(this,Agent);(o=r.call(this,d,"agent",!0)).name=t.name?t.name.trim():"";o.common=new l.XFAObjectArray;return o}return _createClass(Agent)}(l.XFAObject),x=function(t){_inherits(AlwaysEmbed,t);var r=_createSuper(AlwaysEmbed);function AlwaysEmbed(t){_classCallCheck(this,AlwaysEmbed);return r.call(this,d,"alwaysEmbed")}return _createClass(AlwaysEmbed)}(l.ContentObject),O=function(t){_inherits(Amd,t);var r=_createSuper(Amd);function Amd(t){_classCallCheck(this,Amd);return r.call(this,d,"amd")}return _createClass(Amd)}(l.StringObject),T=function(t){_inherits(Area,t);var r=_createSuper(Area);function Area(t){var o;_classCallCheck(this,Area);(o=r.call(this,d,"area")).level=(0,u.getInteger)({data:t.level,defaultValue:0,validate:function validate(t){return t>=1&&t<=3}});o.name=(0,u.getStringOption)(t.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"]);return o}return _createClass(Area)}(l.XFAObject),E=function(t){_inherits(Attributes,t);var r=_createSuper(Attributes);function Attributes(t){_classCallCheck(this,Attributes);return r.call(this,d,"attributes",["preserve","delegate","ignore"])}return _createClass(Attributes)}(l.OptionObject),M=function(t){_inherits(AutoSave,t);var r=_createSuper(AutoSave);function AutoSave(t){_classCallCheck(this,AutoSave);return r.call(this,d,"autoSave",["disabled","enabled"])}return _createClass(AutoSave)}(l.OptionObject),R=function(t){_inherits(Base,t);var r=_createSuper(Base);function Base(t){_classCallCheck(this,Base);return r.call(this,d,"base")}return _createClass(Base)}(l.StringObject),j=function(t){_inherits(BatchOutput,t);var r=_createSuper(BatchOutput);function BatchOutput(t){var o;_classCallCheck(this,BatchOutput);(o=r.call(this,d,"batchOutput")).format=(0,u.getStringOption)(t.format,["none","concat","zip","zipCompress"]);return o}return _createClass(BatchOutput)}(l.XFAObject),D=function(t){_inherits(BehaviorOverride,t);var r=_createSuper(BehaviorOverride);function BehaviorOverride(t){_classCallCheck(this,BehaviorOverride);return r.call(this,d,"behaviorOverride")}_createClass(BehaviorOverride,[{key:l.$finalize,value:function value(){this[l.$content]=new Map(this[l.$content].trim().split(/\s+/).filter((function(t){return t.includes(":")})).map((function(t){return t.split(":",2)})))}}]);return BehaviorOverride}(l.ContentObject),L=function(t){_inherits(Cache,t);var r=_createSuper(Cache);function Cache(t){var o;_classCallCheck(this,Cache);(o=r.call(this,d,"cache",!0)).templateCache=null;return o}return _createClass(Cache)}(l.XFAObject),N=function(t){_inherits(Change,t);var r=_createSuper(Change);function Change(t){_classCallCheck(this,Change);return r.call(this,d,"change")}return _createClass(Change)}(l.Option01),U=function(t){_inherits(Common,t);var r=_createSuper(Common);function Common(t){var o;_classCallCheck(this,Common);(o=r.call(this,d,"common",!0)).data=null;o.locale=null;o.localeSet=null;o.messaging=null;o.suppressBanner=null;o.template=null;o.validationMessaging=null;o.versionControl=null;o.log=new l.XFAObjectArray;return o}return _createClass(Common)}(l.XFAObject),H=function(t){_inherits(Compress,t);var r=_createSuper(Compress);function Compress(t){var o;_classCallCheck(this,Compress);(o=r.call(this,d,"compress")).scope=(0,u.getStringOption)(t.scope,["imageOnly","document"]);return o}return _createClass(Compress)}(l.XFAObject),$=function(t){_inherits(CompressLogicalStructure,t);var r=_createSuper(CompressLogicalStructure);function CompressLogicalStructure(t){_classCallCheck(this,CompressLogicalStructure);return r.call(this,d,"compressLogicalStructure")}return _createClass(CompressLogicalStructure)}(l.Option01),X=function(t){_inherits(CompressObjectStream,t);var r=_createSuper(CompressObjectStream);function CompressObjectStream(t){_classCallCheck(this,CompressObjectStream);return r.call(this,d,"compressObjectStream")}return _createClass(CompressObjectStream)}(l.Option10),q=function(t){_inherits(Compression,t);var r=_createSuper(Compression);function Compression(t){var o;_classCallCheck(this,Compression);(o=r.call(this,d,"compression",!0)).compressLogicalStructure=null;o.compressObjectStream=null;o.level=null;o.type=null;return o}return _createClass(Compression)}(l.XFAObject),G=function(t){_inherits(Config,t);var r=_createSuper(Config);function Config(t){var o;_classCallCheck(this,Config);(o=r.call(this,d,"config",!0)).acrobat=null;o.present=null;o.trace=null;o.agent=new l.XFAObjectArray;return o}return _createClass(Config)}(l.XFAObject),z=function(t){_inherits(Conformance,t);var r=_createSuper(Conformance);function Conformance(t){_classCallCheck(this,Conformance);return r.call(this,d,"conformance",["A","B"])}return _createClass(Conformance)}(l.OptionObject),W=function(t){_inherits(ContentCopy,t);var r=_createSuper(ContentCopy);function ContentCopy(t){_classCallCheck(this,ContentCopy);return r.call(this,d,"contentCopy")}return _createClass(ContentCopy)}(l.Option01),V=function(t){_inherits(Copies,t);var r=_createSuper(Copies);function Copies(t){_classCallCheck(this,Copies);return r.call(this,d,"copies",1,(function(t){return t>=1}))}return _createClass(Copies)}(l.IntegerObject),K=function(t){_inherits(Creator,t);var r=_createSuper(Creator);function Creator(t){_classCallCheck(this,Creator);return r.call(this,d,"creator")}return _createClass(Creator)}(l.StringObject),Y=function(t){_inherits(CurrentPage,t);var r=_createSuper(CurrentPage);function CurrentPage(t){_classCallCheck(this,CurrentPage);return r.call(this,d,"currentPage",0,(function(t){return t>=0}))}return _createClass(CurrentPage)}(l.IntegerObject),J=function(t){_inherits(Data,t);var r=_createSuper(Data);function Data(t){var o;_classCallCheck(this,Data);(o=r.call(this,d,"data",!0)).adjustData=null;o.attributes=null;o.incrementalLoad=null;o.outputXSL=null;o.range=null;o.record=null;o.startNode=null;o.uri=null;o.window=null;o.xsl=null;o.excludeNS=new l.XFAObjectArray;o.transform=new l.XFAObjectArray;return o}return _createClass(Data)}(l.XFAObject),Z=function(t){_inherits(Debug,t);var r=_createSuper(Debug);function Debug(t){var o;_classCallCheck(this,Debug);(o=r.call(this,d,"debug",!0)).uri=null;return o}return _createClass(Debug)}(l.XFAObject),Q=function(t){_inherits(DefaultTypeface,t);var r=_createSuper(DefaultTypeface);function DefaultTypeface(t){var o;_classCallCheck(this,DefaultTypeface);(o=r.call(this,d,"defaultTypeface")).writingScript=(0,u.getStringOption)(t.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"]);return o}return _createClass(DefaultTypeface)}(l.ContentObject),ee=function(t){_inherits(Destination,t);var r=_createSuper(Destination);function Destination(t){_classCallCheck(this,Destination);return r.call(this,d,"destination",["pdf","pcl","ps","webClient","zpl"])}return _createClass(Destination)}(l.OptionObject),te=function(t){_inherits(DocumentAssembly,t);var r=_createSuper(DocumentAssembly);function DocumentAssembly(t){_classCallCheck(this,DocumentAssembly);return r.call(this,d,"documentAssembly")}return _createClass(DocumentAssembly)}(l.Option01),re=function(t){_inherits(Driver,t);var r=_createSuper(Driver);function Driver(t){var o;_classCallCheck(this,Driver);(o=r.call(this,d,"driver",!0)).name=t.name?t.name.trim():"";o.fontInfo=null;o.xdc=null;return o}return _createClass(Driver)}(l.XFAObject),ae=function(t){_inherits(DuplexOption,t);var r=_createSuper(DuplexOption);function DuplexOption(t){_classCallCheck(this,DuplexOption);return r.call(this,d,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}return _createClass(DuplexOption)}(l.OptionObject),ne=function(t){_inherits(DynamicRender,t);var r=_createSuper(DynamicRender);function DynamicRender(t){_classCallCheck(this,DynamicRender);return r.call(this,d,"dynamicRender",["forbidden","required"])}return _createClass(DynamicRender)}(l.OptionObject),ie=function(t){_inherits(Embed,t);var r=_createSuper(Embed);function Embed(t){_classCallCheck(this,Embed);return r.call(this,d,"embed")}return _createClass(Embed)}(l.Option01),oe=function(t){_inherits(Encrypt,t);var r=_createSuper(Encrypt);function Encrypt(t){_classCallCheck(this,Encrypt);return r.call(this,d,"encrypt")}return _createClass(Encrypt)}(l.Option01),se=function(t){_inherits(Encryption,t);var r=_createSuper(Encryption);function Encryption(t){var o;_classCallCheck(this,Encryption);(o=r.call(this,d,"encryption",!0)).encrypt=null;o.encryptionLevel=null;o.permissions=null;return o}return _createClass(Encryption)}(l.XFAObject),ce=function(t){_inherits(EncryptionLevel,t);var r=_createSuper(EncryptionLevel);function EncryptionLevel(t){_classCallCheck(this,EncryptionLevel);return r.call(this,d,"encryptionLevel",["40bit","128bit"])}return _createClass(EncryptionLevel)}(l.OptionObject),le=function(t){_inherits(Enforce,t);var r=_createSuper(Enforce);function Enforce(t){_classCallCheck(this,Enforce);return r.call(this,d,"enforce")}return _createClass(Enforce)}(l.StringObject),ue=function(t){_inherits(Equate,t);var r=_createSuper(Equate);function Equate(t){var o;_classCallCheck(this,Equate);(o=r.call(this,d,"equate")).force=(0,u.getInteger)({data:t.force,defaultValue:1,validate:function validate(t){return 0===t}});o.from=t.from||"";o.to=t.to||"";return o}return _createClass(Equate)}(l.XFAObject),fe=function(t){_inherits(EquateRange,t);var r=_createSuper(EquateRange);function EquateRange(t){var o;_classCallCheck(this,EquateRange);(o=r.call(this,d,"equateRange")).from=t.from||"";o.to=t.to||"";o._unicodeRange=t.unicodeRange||"";return o}_createClass(EquateRange,[{key:"unicodeRange",get:function get(){var t,r=[],o=/U\+([0-9a-fA-F]+)/,c=_createForOfIteratorHelper(this._unicodeRange.split(",").map((function(t){return t.trim()})).filter((function(t){return!!t})));try{for(c.s();!(t=c.n()).done;){var l=t.value;1===(l=l.split("-",2).map((function(t){var r=t.match(o);return r?parseInt(r[1],16):0}))).length&&l.push(l[0]);r.push(l)}}catch(t){c.e(t)}finally{c.f()}return(0,h.shadow)(this,"unicodeRange",r)}}]);return EquateRange}(l.XFAObject),he=function(t){_inherits(Exclude,t);var r=_createSuper(Exclude);function Exclude(t){_classCallCheck(this,Exclude);return r.call(this,d,"exclude")}_createClass(Exclude,[{key:l.$finalize,value:function value(){this[l.$content]=this[l.$content].trim().split(/\s+/).filter((function(t){return t&&["calculate","close","enter","exit","initialize","ready","validate"].includes(t)}))}}]);return Exclude}(l.ContentObject),de=function(t){_inherits(ExcludeNS,t);var r=_createSuper(ExcludeNS);function ExcludeNS(t){_classCallCheck(this,ExcludeNS);return r.call(this,d,"excludeNS")}return _createClass(ExcludeNS)}(l.StringObject),pe=function(t){_inherits(FlipLabel,t);var r=_createSuper(FlipLabel);function FlipLabel(t){_classCallCheck(this,FlipLabel);return r.call(this,d,"flipLabel",["usePrinterSetting","on","off"])}return _createClass(FlipLabel)}(l.OptionObject),ge=function(t){_inherits(FontInfo,t);var r=_createSuper(FontInfo);function FontInfo(t){var o;_classCallCheck(this,FontInfo);(o=r.call(this,d,"fontInfo",!0)).embed=null;o.map=null;o.subsetBelow=null;o.alwaysEmbed=new l.XFAObjectArray;o.defaultTypeface=new l.XFAObjectArray;o.neverEmbed=new l.XFAObjectArray;return o}return _createClass(FontInfo)}(l.XFAObject),me=function(t){_inherits(FormFieldFilling,t);var r=_createSuper(FormFieldFilling);function FormFieldFilling(t){_classCallCheck(this,FormFieldFilling);return r.call(this,d,"formFieldFilling")}return _createClass(FormFieldFilling)}(l.Option01),ye=function(t){_inherits(GroupParent,t);var r=_createSuper(GroupParent);function GroupParent(t){_classCallCheck(this,GroupParent);return r.call(this,d,"groupParent")}return _createClass(GroupParent)}(l.StringObject),ve=function(t){_inherits(IfEmpty,t);var r=_createSuper(IfEmpty);function IfEmpty(t){_classCallCheck(this,IfEmpty);return r.call(this,d,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}return _createClass(IfEmpty)}(l.OptionObject),be=function(t){_inherits(IncludeXDPContent,t);var r=_createSuper(IncludeXDPContent);function IncludeXDPContent(t){_classCallCheck(this,IncludeXDPContent);return r.call(this,d,"includeXDPContent")}return _createClass(IncludeXDPContent)}(l.StringObject),ke=function(t){_inherits(IncrementalLoad,t);var r=_createSuper(IncrementalLoad);function IncrementalLoad(t){_classCallCheck(this,IncrementalLoad);return r.call(this,d,"incrementalLoad",["none","forwardOnly"])}return _createClass(IncrementalLoad)}(l.OptionObject),_e=function(t){_inherits(IncrementalMerge,t);var r=_createSuper(IncrementalMerge);function IncrementalMerge(t){_classCallCheck(this,IncrementalMerge);return r.call(this,d,"incrementalMerge")}return _createClass(IncrementalMerge)}(l.Option01),we=function(t){_inherits(Interactive,t);var r=_createSuper(Interactive);function Interactive(t){_classCallCheck(this,Interactive);return r.call(this,d,"interactive")}return _createClass(Interactive)}(l.Option01),Se=function(t){_inherits(Jog,t);var r=_createSuper(Jog);function Jog(t){_classCallCheck(this,Jog);return r.call(this,d,"jog",["usePrinterSetting","none","pageSet"])}return _createClass(Jog)}(l.OptionObject),Ce=function(t){_inherits(LabelPrinter,t);var r=_createSuper(LabelPrinter);function LabelPrinter(t){var o;_classCallCheck(this,LabelPrinter);(o=r.call(this,d,"labelPrinter",!0)).name=(0,u.getStringOption)(t.name,["zpl","dpl","ipl","tcpl"]);o.batchOutput=null;o.flipLabel=null;o.fontInfo=null;o.xdc=null;return o}return _createClass(LabelPrinter)}(l.XFAObject),xe=function(t){_inherits(Layout,t);var r=_createSuper(Layout);function Layout(t){_classCallCheck(this,Layout);return r.call(this,d,"layout",["paginate","panel"])}return _createClass(Layout)}(l.OptionObject),Oe=function(t){_inherits(Level,t);var r=_createSuper(Level);function Level(t){_classCallCheck(this,Level);return r.call(this,d,"level",0,(function(t){return t>0}))}return _createClass(Level)}(l.IntegerObject),Ae=function(t){_inherits(Linearized,t);var r=_createSuper(Linearized);function Linearized(t){_classCallCheck(this,Linearized);return r.call(this,d,"linearized")}return _createClass(Linearized)}(l.Option01),Pe=function(t){_inherits(Locale,t);var r=_createSuper(Locale);function Locale(t){_classCallCheck(this,Locale);return r.call(this,d,"locale")}return _createClass(Locale)}(l.StringObject),Te=function(t){_inherits(LocaleSet,t);var r=_createSuper(LocaleSet);function LocaleSet(t){_classCallCheck(this,LocaleSet);return r.call(this,d,"localeSet")}return _createClass(LocaleSet)}(l.StringObject),Fe=function(t){_inherits(Log,t);var r=_createSuper(Log);function Log(t){var o;_classCallCheck(this,Log);(o=r.call(this,d,"log",!0)).mode=null;o.threshold=null;o.to=null;o.uri=null;return o}return _createClass(Log)}(l.XFAObject),Ie=function(t){_inherits(MapElement,t);var r=_createSuper(MapElement);function MapElement(t){var o;_classCallCheck(this,MapElement);(o=r.call(this,d,"map",!0)).equate=new l.XFAObjectArray;o.equateRange=new l.XFAObjectArray;return o}return _createClass(MapElement)}(l.XFAObject),Ee=function(t){_inherits(MediumInfo,t);var r=_createSuper(MediumInfo);function MediumInfo(t){var o;_classCallCheck(this,MediumInfo);(o=r.call(this,d,"mediumInfo",!0)).map=null;return o}return _createClass(MediumInfo)}(l.XFAObject),Me=function(t){_inherits(Message,t);var r=_createSuper(Message);function Message(t){var o;_classCallCheck(this,Message);(o=r.call(this,d,"message",!0)).msgId=null;o.severity=null;return o}return _createClass(Message)}(l.XFAObject),Re=function(t){_inherits(Messaging,t);var r=_createSuper(Messaging);function Messaging(t){var o;_classCallCheck(this,Messaging);(o=r.call(this,d,"messaging",!0)).message=new l.XFAObjectArray;return o}return _createClass(Messaging)}(l.XFAObject),je=function(t){_inherits(Mode,t);var r=_createSuper(Mode);function Mode(t){_classCallCheck(this,Mode);return r.call(this,d,"mode",["append","overwrite"])}return _createClass(Mode)}(l.OptionObject),De=function(t){_inherits(ModifyAnnots,t);var r=_createSuper(ModifyAnnots);function ModifyAnnots(t){_classCallCheck(this,ModifyAnnots);return r.call(this,d,"modifyAnnots")}return _createClass(ModifyAnnots)}(l.Option01),Be=function(t){_inherits(MsgId,t);var r=_createSuper(MsgId);function MsgId(t){_classCallCheck(this,MsgId);return r.call(this,d,"msgId",1,(function(t){return t>=1}))}return _createClass(MsgId)}(l.IntegerObject),Le=function(t){_inherits(NameAttr,t);var r=_createSuper(NameAttr);function NameAttr(t){_classCallCheck(this,NameAttr);return r.call(this,d,"nameAttr")}return _createClass(NameAttr)}(l.StringObject),Ne=function(t){_inherits(NeverEmbed,t);var r=_createSuper(NeverEmbed);function NeverEmbed(t){_classCallCheck(this,NeverEmbed);return r.call(this,d,"neverEmbed")}return _createClass(NeverEmbed)}(l.ContentObject),Ue=function(t){_inherits(NumberOfCopies,t);var r=_createSuper(NumberOfCopies);function NumberOfCopies(t){_classCallCheck(this,NumberOfCopies);return r.call(this,d,"numberOfCopies",null,(function(t){return t>=2&&t<=5}))}return _createClass(NumberOfCopies)}(l.IntegerObject),He=function(t){_inherits(OpenAction,t);var r=_createSuper(OpenAction);function OpenAction(t){var o;_classCallCheck(this,OpenAction);(o=r.call(this,d,"openAction",!0)).destination=null;return o}return _createClass(OpenAction)}(l.XFAObject),$e=function(t){_inherits(Output,t);var r=_createSuper(Output);function Output(t){var o;_classCallCheck(this,Output);(o=r.call(this,d,"output",!0)).to=null;o.type=null;o.uri=null;return o}return _createClass(Output)}(l.XFAObject),Xe=function(t){_inherits(OutputBin,t);var r=_createSuper(OutputBin);function OutputBin(t){_classCallCheck(this,OutputBin);return r.call(this,d,"outputBin")}return _createClass(OutputBin)}(l.StringObject),qe=function(t){_inherits(OutputXSL,t);var r=_createSuper(OutputXSL);function OutputXSL(t){var o;_classCallCheck(this,OutputXSL);(o=r.call(this,d,"outputXSL",!0)).uri=null;return o}return _createClass(OutputXSL)}(l.XFAObject),Ge=function(t){_inherits(Overprint,t);var r=_createSuper(Overprint);function Overprint(t){_classCallCheck(this,Overprint);return r.call(this,d,"overprint",["none","both","draw","field"])}return _createClass(Overprint)}(l.OptionObject),ze=function(t){_inherits(Packets,t);var r=_createSuper(Packets);function Packets(t){_classCallCheck(this,Packets);return r.call(this,d,"packets")}_createClass(Packets,[{key:l.$finalize,value:function value(){"*"!==this[l.$content]&&(this[l.$content]=this[l.$content].trim().split(/\s+/).filter((function(t){return["config","datasets","template","xfdf","xslt"].includes(t)})))}}]);return Packets}(l.StringObject),We=function(t){_inherits(PageOffset,t);var r=_createSuper(PageOffset);function PageOffset(t){var o;_classCallCheck(this,PageOffset);(o=r.call(this,d,"pageOffset")).x=(0,u.getInteger)({data:t.x,defaultValue:"useXDCSetting",validate:function validate(t){return!0}});o.y=(0,u.getInteger)({data:t.y,defaultValue:"useXDCSetting",validate:function validate(t){return!0}});return o}return _createClass(PageOffset)}(l.XFAObject),Ve=function(t){_inherits(PageRange,t);var r=_createSuper(PageRange);function PageRange(t){_classCallCheck(this,PageRange);return r.call(this,d,"pageRange")}_createClass(PageRange,[{key:l.$finalize,value:function value(){for(var t=this[l.$content].trim().split(/\s+/).map((function(t){return parseInt(t,10)})),r=[],o=0,c=t.length;o<c;o+=2)r.push(t.slice(o,o+2));this[l.$content]=r}}]);return PageRange}(l.StringObject),Ke=function(t){_inherits(Pagination,t);var r=_createSuper(Pagination);function Pagination(t){_classCallCheck(this,Pagination);return r.call(this,d,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}return _createClass(Pagination)}(l.OptionObject),Ye=function(t){_inherits(PaginationOverride,t);var r=_createSuper(PaginationOverride);function PaginationOverride(t){_classCallCheck(this,PaginationOverride);return r.call(this,d,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}return _createClass(PaginationOverride)}(l.OptionObject),Je=function(t){_inherits(Part,t);var r=_createSuper(Part);function Part(t){_classCallCheck(this,Part);return r.call(this,d,"part",1,(function(t){return!1}))}return _createClass(Part)}(l.IntegerObject),Ze=function(t){_inherits(Pcl,t);var r=_createSuper(Pcl);function Pcl(t){var o;_classCallCheck(this,Pcl);(o=r.call(this,d,"pcl",!0)).name=t.name||"";o.batchOutput=null;o.fontInfo=null;o.jog=null;o.mediumInfo=null;o.outputBin=null;o.pageOffset=null;o.staple=null;o.xdc=null;return o}return _createClass(Pcl)}(l.XFAObject),Qe=function(t){_inherits(Pdf,t);var r=_createSuper(Pdf);function Pdf(t){var o;_classCallCheck(this,Pdf);(o=r.call(this,d,"pdf",!0)).name=t.name||"";o.adobeExtensionLevel=null;o.batchOutput=null;o.compression=null;o.creator=null;o.encryption=null;o.fontInfo=null;o.interactive=null;o.linearized=null;o.openAction=null;o.pdfa=null;o.producer=null;o.renderPolicy=null;o.scriptModel=null;o.silentPrint=null;o.submitFormat=null;o.tagged=null;o.version=null;o.viewerPreferences=null;o.xdc=null;return o}return _createClass(Pdf)}(l.XFAObject),et=function(t){_inherits(Pdfa,t);var r=_createSuper(Pdfa);function Pdfa(t){var o;_classCallCheck(this,Pdfa);(o=r.call(this,d,"pdfa",!0)).amd=null;o.conformance=null;o.includeXDPContent=null;o.part=null;return o}return _createClass(Pdfa)}(l.XFAObject),tt=function(t){_inherits(Permissions,t);var r=_createSuper(Permissions);function Permissions(t){var o;_classCallCheck(this,Permissions);(o=r.call(this,d,"permissions",!0)).accessibleContent=null;o.change=null;o.contentCopy=null;o.documentAssembly=null;o.formFieldFilling=null;o.modifyAnnots=null;o.plaintextMetadata=null;o.print=null;o.printHighQuality=null;return o}return _createClass(Permissions)}(l.XFAObject),rt=function(t){_inherits(PickTrayByPDFSize,t);var r=_createSuper(PickTrayByPDFSize);function PickTrayByPDFSize(t){_classCallCheck(this,PickTrayByPDFSize);return r.call(this,d,"pickTrayByPDFSize")}return _createClass(PickTrayByPDFSize)}(l.Option01),at=function(t){_inherits(Picture,t);var r=_createSuper(Picture);function Picture(t){_classCallCheck(this,Picture);return r.call(this,d,"picture")}return _createClass(Picture)}(l.StringObject),nt=function(t){_inherits(PlaintextMetadata,t);var r=_createSuper(PlaintextMetadata);function PlaintextMetadata(t){_classCallCheck(this,PlaintextMetadata);return r.call(this,d,"plaintextMetadata")}return _createClass(PlaintextMetadata)}(l.Option01),it=function(t){_inherits(Presence,t);var r=_createSuper(Presence);function Presence(t){_classCallCheck(this,Presence);return r.call(this,d,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}return _createClass(Presence)}(l.OptionObject),ot=function(t){_inherits(Present,t);var r=_createSuper(Present);function Present(t){var o;_classCallCheck(this,Present);(o=r.call(this,d,"present",!0)).behaviorOverride=null;o.cache=null;o.common=null;o.copies=null;o.destination=null;o.incrementalMerge=null;o.layout=null;o.output=null;o.overprint=null;o.pagination=null;o.paginationOverride=null;o.script=null;o.validate=null;o.xdp=null;o.driver=new l.XFAObjectArray;o.labelPrinter=new l.XFAObjectArray;o.pcl=new l.XFAObjectArray;o.pdf=new l.XFAObjectArray;o.ps=new l.XFAObjectArray;o.submitUrl=new l.XFAObjectArray;o.webClient=new l.XFAObjectArray;o.zpl=new l.XFAObjectArray;return o}return _createClass(Present)}(l.XFAObject),st=function(t){_inherits(Print,t);var r=_createSuper(Print);function Print(t){_classCallCheck(this,Print);return r.call(this,d,"print")}return _createClass(Print)}(l.Option01),ct=function(t){_inherits(PrintHighQuality,t);var r=_createSuper(PrintHighQuality);function PrintHighQuality(t){_classCallCheck(this,PrintHighQuality);return r.call(this,d,"printHighQuality")}return _createClass(PrintHighQuality)}(l.Option01),lt=function(t){_inherits(PrintScaling,t);var r=_createSuper(PrintScaling);function PrintScaling(t){_classCallCheck(this,PrintScaling);return r.call(this,d,"printScaling",["appdefault","noScaling"])}return _createClass(PrintScaling)}(l.OptionObject),ut=function(t){_inherits(PrinterName,t);var r=_createSuper(PrinterName);function PrinterName(t){_classCallCheck(this,PrinterName);return r.call(this,d,"printerName")}return _createClass(PrinterName)}(l.StringObject),ft=function(t){_inherits(Producer,t);var r=_createSuper(Producer);function Producer(t){_classCallCheck(this,Producer);return r.call(this,d,"producer")}return _createClass(Producer)}(l.StringObject),ht=function(t){_inherits(Ps,t);var r=_createSuper(Ps);function Ps(t){var o;_classCallCheck(this,Ps);(o=r.call(this,d,"ps",!0)).name=t.name||"";o.batchOutput=null;o.fontInfo=null;o.jog=null;o.mediumInfo=null;o.outputBin=null;o.staple=null;o.xdc=null;return o}return _createClass(Ps)}(l.XFAObject),dt=function(t){_inherits(Range,t);var r=_createSuper(Range);function Range(t){_classCallCheck(this,Range);return r.call(this,d,"range")}_createClass(Range,[{key:l.$finalize,value:function value(){this[l.$content]=this[l.$content].trim().split(/\s*,\s*/,2).map((function(t){return t.split("-").map((function(t){return parseInt(t.trim(),10)}))})).filter((function(t){return t.every((function(t){return!isNaN(t)}))})).map((function(t){1===t.length&&t.push(t[0]);return t}))}}]);return Range}(l.ContentObject),gt=function(t){_inherits(Record,t);var r=_createSuper(Record);function Record(t){_classCallCheck(this,Record);return r.call(this,d,"record")}_createClass(Record,[{key:l.$finalize,value:function value(){this[l.$content]=this[l.$content].trim();var t=parseInt(this[l.$content],10);!isNaN(t)&&t>=0&&(this[l.$content]=t)}}]);return Record}(l.ContentObject),mt=function(t){_inherits(Relevant,t);var r=_createSuper(Relevant);function Relevant(t){_classCallCheck(this,Relevant);return r.call(this,d,"relevant")}_createClass(Relevant,[{key:l.$finalize,value:function value(){this[l.$content]=this[l.$content].trim().split(/\s+/)}}]);return Relevant}(l.ContentObject),yt=function(t){_inherits(Rename,t);var r=_createSuper(Rename);function Rename(t){_classCallCheck(this,Rename);return r.call(this,d,"rename")}_createClass(Rename,[{key:l.$finalize,value:function value(){this[l.$content]=this[l.$content].trim();(this[l.$content].toLowerCase().startsWith("xml")||this[l.$content].match(new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u")))&&(0,h.warn)("XFA - Rename: invalid XFA name")}}]);return Rename}(l.ContentObject),vt=function(t){_inherits(RenderPolicy,t);var r=_createSuper(RenderPolicy);function RenderPolicy(t){_classCallCheck(this,RenderPolicy);return r.call(this,d,"renderPolicy",["server","client"])}return _createClass(RenderPolicy)}(l.OptionObject),bt=function(t){_inherits(RunScripts,t);var r=_createSuper(RunScripts);function RunScripts(t){_classCallCheck(this,RunScripts);return r.call(this,d,"runScripts",["both","client","none","server"])}return _createClass(RunScripts)}(l.OptionObject),kt=function(t){_inherits(Script,t);var r=_createSuper(Script);function Script(t){var o;_classCallCheck(this,Script);(o=r.call(this,d,"script",!0)).currentPage=null;o.exclude=null;o.runScripts=null;return o}return _createClass(Script)}(l.XFAObject),_t=function(t){_inherits(ScriptModel,t);var r=_createSuper(ScriptModel);function ScriptModel(t){_classCallCheck(this,ScriptModel);return r.call(this,d,"scriptModel",["XFA","none"])}return _createClass(ScriptModel)}(l.OptionObject),wt=function(t){_inherits(Severity,t);var r=_createSuper(Severity);function Severity(t){_classCallCheck(this,Severity);return r.call(this,d,"severity",["ignore","error","information","trace","warning"])}return _createClass(Severity)}(l.OptionObject),St=function(t){_inherits(SilentPrint,t);var r=_createSuper(SilentPrint);function SilentPrint(t){var o;_classCallCheck(this,SilentPrint);(o=r.call(this,d,"silentPrint",!0)).addSilentPrint=null;o.printerName=null;return o}return _createClass(SilentPrint)}(l.XFAObject),Ct=function(t){_inherits(Staple,t);var r=_createSuper(Staple);function Staple(t){var o;_classCallCheck(this,Staple);(o=r.call(this,d,"staple")).mode=(0,u.getStringOption)(t.mode,["usePrinterSetting","on","off"]);return o}return _createClass(Staple)}(l.XFAObject),xt=function(t){_inherits(StartNode,t);var r=_createSuper(StartNode);function StartNode(t){_classCallCheck(this,StartNode);return r.call(this,d,"startNode")}return _createClass(StartNode)}(l.StringObject),Ot=function(t){_inherits(StartPage,t);var r=_createSuper(StartPage);function StartPage(t){_classCallCheck(this,StartPage);return r.call(this,d,"startPage",0,(function(t){return!0}))}return _createClass(StartPage)}(l.IntegerObject),At=function(t){_inherits(SubmitFormat,t);var r=_createSuper(SubmitFormat);function SubmitFormat(t){_classCallCheck(this,SubmitFormat);return r.call(this,d,"submitFormat",["html","delegate","fdf","xml","pdf"])}return _createClass(SubmitFormat)}(l.OptionObject),Pt=function(t){_inherits(SubmitUrl,t);var r=_createSuper(SubmitUrl);function SubmitUrl(t){_classCallCheck(this,SubmitUrl);return r.call(this,d,"submitUrl")}return _createClass(SubmitUrl)}(l.StringObject),Tt=function(t){_inherits(SubsetBelow,t);var r=_createSuper(SubsetBelow);function SubsetBelow(t){_classCallCheck(this,SubsetBelow);return r.call(this,d,"subsetBelow",100,(function(t){return t>=0&&t<=100}))}return _createClass(SubsetBelow)}(l.IntegerObject),Ft=function(t){_inherits(SuppressBanner,t);var r=_createSuper(SuppressBanner);function SuppressBanner(t){_classCallCheck(this,SuppressBanner);return r.call(this,d,"suppressBanner")}return _createClass(SuppressBanner)}(l.Option01),It=function(t){_inherits(Tagged,t);var r=_createSuper(Tagged);function Tagged(t){_classCallCheck(this,Tagged);return r.call(this,d,"tagged")}return _createClass(Tagged)}(l.Option01),Et=function(t){_inherits(Template,t);var r=_createSuper(Template);function Template(t){var o;_classCallCheck(this,Template);(o=r.call(this,d,"template",!0)).base=null;o.relevant=null;o.startPage=null;o.uri=null;o.xsl=null;return o}return _createClass(Template)}(l.XFAObject),Mt=function(t){_inherits(Threshold,t);var r=_createSuper(Threshold);function Threshold(t){_classCallCheck(this,Threshold);return r.call(this,d,"threshold",["trace","error","information","warning"])}return _createClass(Threshold)}(l.OptionObject),Rt=function(t){_inherits(To,t);var r=_createSuper(To);function To(t){_classCallCheck(this,To);return r.call(this,d,"to",["null","memory","stderr","stdout","system","uri"])}return _createClass(To)}(l.OptionObject),jt=function(t){_inherits(TemplateCache,t);var r=_createSuper(TemplateCache);function TemplateCache(t){var o;_classCallCheck(this,TemplateCache);(o=r.call(this,d,"templateCache")).maxEntries=(0,u.getInteger)({data:t.maxEntries,defaultValue:5,validate:function validate(t){return t>=0}});return o}return _createClass(TemplateCache)}(l.XFAObject),Dt=function(t){_inherits(Trace,t);var r=_createSuper(Trace);function Trace(t){var o;_classCallCheck(this,Trace);(o=r.call(this,d,"trace",!0)).area=new l.XFAObjectArray;return o}return _createClass(Trace)}(l.XFAObject),Bt=function(t){_inherits(Transform,t);var r=_createSuper(Transform);function Transform(t){var o;_classCallCheck(this,Transform);(o=r.call(this,d,"transform",!0)).groupParent=null;o.ifEmpty=null;o.nameAttr=null;o.picture=null;o.presence=null;o.rename=null;o.whitespace=null;return o}return _createClass(Transform)}(l.XFAObject),Lt=function(t){_inherits(Type,t);var r=_createSuper(Type);function Type(t){_classCallCheck(this,Type);return r.call(this,d,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}return _createClass(Type)}(l.OptionObject),Nt=function(t){_inherits(Uri,t);var r=_createSuper(Uri);function Uri(t){_classCallCheck(this,Uri);return r.call(this,d,"uri")}return _createClass(Uri)}(l.StringObject),Ut=function(t){_inherits(Validate,t);var r=_createSuper(Validate);function Validate(t){_classCallCheck(this,Validate);return r.call(this,d,"validate",["preSubmit","prePrint","preExecute","preSave"])}return _createClass(Validate)}(l.OptionObject),Ht=function(t){_inherits(ValidateApprovalSignatures,t);var r=_createSuper(ValidateApprovalSignatures);function ValidateApprovalSignatures(t){_classCallCheck(this,ValidateApprovalSignatures);return r.call(this,d,"validateApprovalSignatures")}_createClass(ValidateApprovalSignatures,[{key:l.$finalize,value:function value(){this[l.$content]=this[l.$content].trim().split(/\s+/).filter((function(t){return["docReady","postSign"].includes(t)}))}}]);return ValidateApprovalSignatures}(l.ContentObject),$t=function(t){_inherits(ValidationMessaging,t);var r=_createSuper(ValidationMessaging);function ValidationMessaging(t){_classCallCheck(this,ValidationMessaging);return r.call(this,d,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}return _createClass(ValidationMessaging)}(l.OptionObject),Xt=function(t){_inherits(Version,t);var r=_createSuper(Version);function Version(t){_classCallCheck(this,Version);return r.call(this,d,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}return _createClass(Version)}(l.OptionObject),qt=function(t){_inherits(VersionControl,t);var r=_createSuper(VersionControl);function VersionControl(t){var o;_classCallCheck(this,VersionControl);(o=r.call(this,d,"VersionControl")).outputBelow=(0,u.getStringOption)(t.outputBelow,["warn","error","update"]);o.sourceAbove=(0,u.getStringOption)(t.sourceAbove,["warn","error"]);o.sourceBelow=(0,u.getStringOption)(t.sourceBelow,["update","maintain"]);return o}return _createClass(VersionControl)}(l.XFAObject),Gt=function(t){_inherits(ViewerPreferences,t);var r=_createSuper(ViewerPreferences);function ViewerPreferences(t){var o;_classCallCheck(this,ViewerPreferences);(o=r.call(this,d,"viewerPreferences",!0)).ADBE_JSConsole=null;o.ADBE_JSDebugger=null;o.addViewerPreferences=null;o.duplexOption=null;o.enforce=null;o.numberOfCopies=null;o.pageRange=null;o.pickTrayByPDFSize=null;o.printScaling=null;return o}return _createClass(ViewerPreferences)}(l.XFAObject),zt=function(t){_inherits(WebClient,t);var r=_createSuper(WebClient);function WebClient(t){var o;_classCallCheck(this,WebClient);(o=r.call(this,d,"webClient",!0)).name=t.name?t.name.trim():"";o.fontInfo=null;o.xdc=null;return o}return _createClass(WebClient)}(l.XFAObject),Wt=function(t){_inherits(Whitespace,t);var r=_createSuper(Whitespace);function Whitespace(t){_classCallCheck(this,Whitespace);return r.call(this,d,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}return _createClass(Whitespace)}(l.OptionObject),Vt=function(t){_inherits(Window,t);var r=_createSuper(Window);function Window(t){_classCallCheck(this,Window);return r.call(this,d,"window")}_createClass(Window,[{key:l.$finalize,value:function value(){var t=this[l.$content].trim().split(/\s*,\s*/,2).map((function(t){return parseInt(t,10)}));if(t.some((function(t){return isNaN(t)})))this[l.$content]=[0,0];else{1===t.length&&t.push(t[0]);this[l.$content]=t}}}]);return Window}(l.ContentObject),Kt=function(t){_inherits(Xdc,t);var r=_createSuper(Xdc);function Xdc(t){var o;_classCallCheck(this,Xdc);(o=r.call(this,d,"xdc",!0)).uri=new l.XFAObjectArray;o.xsl=new l.XFAObjectArray;return o}return _createClass(Xdc)}(l.XFAObject),Yt=function(t){_inherits(Xdp,t);var r=_createSuper(Xdp);function Xdp(t){var o;_classCallCheck(this,Xdp);(o=r.call(this,d,"xdp",!0)).packets=null;return o}return _createClass(Xdp)}(l.XFAObject),Jt=function(t){_inherits(Xsl,t);var r=_createSuper(Xsl);function Xsl(t){var o;_classCallCheck(this,Xsl);(o=r.call(this,d,"xsl",!0)).debug=null;o.uri=null;return o}return _createClass(Xsl)}(l.XFAObject),Zt=function(t){_inherits(Zpl,t);var r=_createSuper(Zpl);function Zpl(t){var o;_classCallCheck(this,Zpl);(o=r.call(this,d,"zpl",!0)).name=t.name?t.name.trim():"";o.batchOutput=null;o.flipLabel=null;o.fontInfo=null;o.xdc=null;return o}return _createClass(Zpl)}(l.XFAObject),Qt=function(){function ConfigNamespace(){_classCallCheck(this,ConfigNamespace)}_createClass(ConfigNamespace,null,[{key:c.$buildXFAObject,value:function value(t,r){if(ConfigNamespace.hasOwnProperty(t))return ConfigNamespace[t](r)}},{key:"acrobat",value:function acrobat(t){return new g(t)}},{key:"acrobat7",value:function acrobat7(t){return new m(t)}},{key:"ADBE_JSConsole",value:function ADBE_JSConsole(t){return new y(t)}},{key:"ADBE_JSDebugger",value:function ADBE_JSDebugger(t){return new v(t)}},{key:"addSilentPrint",value:function addSilentPrint(t){return new k(t)}},{key:"addViewerPreferences",value:function addViewerPreferences(t){return new _(t)}},{key:"adjustData",value:function adjustData(t){return new w(t)}},{key:"adobeExtensionLevel",value:function adobeExtensionLevel(t){return new S(t)}},{key:"agent",value:function agent(t){return new C(t)}},{key:"alwaysEmbed",value:function alwaysEmbed(t){return new x(t)}},{key:"amd",value:function amd(t){return new O(t)}},{key:"area",value:function area(t){return new T(t)}},{key:"attributes",value:function attributes(t){return new E(t)}},{key:"autoSave",value:function autoSave(t){return new M(t)}},{key:"base",value:function base(t){return new R(t)}},{key:"batchOutput",value:function batchOutput(t){return new j(t)}},{key:"behaviorOverride",value:function behaviorOverride(t){return new D(t)}},{key:"cache",value:function cache(t){return new L(t)}},{key:"change",value:function change(t){return new N(t)}},{key:"common",value:function common(t){return new U(t)}},{key:"compress",value:function compress(t){return new H(t)}},{key:"compressLogicalStructure",value:function compressLogicalStructure(t){return new $(t)}},{key:"compressObjectStream",value:function compressObjectStream(t){return new X(t)}},{key:"compression",value:function compression(t){return new q(t)}},{key:"config",value:function config(t){return new G(t)}},{key:"conformance",value:function conformance(t){return new z(t)}},{key:"contentCopy",value:function contentCopy(t){return new W(t)}},{key:"copies",value:function copies(t){return new V(t)}},{key:"creator",value:function creator(t){return new K(t)}},{key:"currentPage",value:function currentPage(t){return new Y(t)}},{key:"data",value:function data(t){return new J(t)}},{key:"debug",value:function debug(t){return new Z(t)}},{key:"defaultTypeface",value:function defaultTypeface(t){return new Q(t)}},{key:"destination",value:function destination(t){return new ee(t)}},{key:"documentAssembly",value:function documentAssembly(t){return new te(t)}},{key:"driver",value:function driver(t){return new re(t)}},{key:"duplexOption",value:function duplexOption(t){return new ae(t)}},{key:"dynamicRender",value:function dynamicRender(t){return new ne(t)}},{key:"embed",value:function embed(t){return new ie(t)}},{key:"encrypt",value:function encrypt(t){return new oe(t)}},{key:"encryption",value:function encryption(t){return new se(t)}},{key:"encryptionLevel",value:function encryptionLevel(t){return new ce(t)}},{key:"enforce",value:function enforce(t){return new le(t)}},{key:"equate",value:function equate(t){return new ue(t)}},{key:"equateRange",value:function equateRange(t){return new fe(t)}},{key:"exclude",value:function exclude(t){return new he(t)}},{key:"excludeNS",value:function excludeNS(t){return new de(t)}},{key:"flipLabel",value:function flipLabel(t){return new pe(t)}},{key:"fontInfo",value:function fontInfo(t){return new ge(t)}},{key:"formFieldFilling",value:function formFieldFilling(t){return new me(t)}},{key:"groupParent",value:function groupParent(t){return new ye(t)}},{key:"ifEmpty",value:function ifEmpty(t){return new ve(t)}},{key:"includeXDPContent",value:function includeXDPContent(t){return new be(t)}},{key:"incrementalLoad",value:function incrementalLoad(t){return new ke(t)}},{key:"incrementalMerge",value:function incrementalMerge(t){return new _e(t)}},{key:"interactive",value:function interactive(t){return new we(t)}},{key:"jog",value:function jog(t){return new Se(t)}},{key:"labelPrinter",value:function labelPrinter(t){return new Ce(t)}},{key:"layout",value:function layout(t){return new xe(t)}},{key:"level",value:function level(t){return new Oe(t)}},{key:"linearized",value:function linearized(t){return new Ae(t)}},{key:"locale",value:function locale(t){return new Pe(t)}},{key:"localeSet",value:function localeSet(t){return new Te(t)}},{key:"log",value:function log(t){return new Fe(t)}},{key:"map",value:function map(t){return new Ie(t)}},{key:"mediumInfo",value:function mediumInfo(t){return new Ee(t)}},{key:"message",value:function message(t){return new Me(t)}},{key:"messaging",value:function messaging(t){return new Re(t)}},{key:"mode",value:function mode(t){return new je(t)}},{key:"modifyAnnots",value:function modifyAnnots(t){return new De(t)}},{key:"msgId",value:function msgId(t){return new Be(t)}},{key:"nameAttr",value:function nameAttr(t){return new Le(t)}},{key:"neverEmbed",value:function neverEmbed(t){return new Ne(t)}},{key:"numberOfCopies",value:function numberOfCopies(t){return new Ue(t)}},{key:"openAction",value:function openAction(t){return new He(t)}},{key:"output",value:function output(t){return new $e(t)}},{key:"outputBin",value:function outputBin(t){return new Xe(t)}},{key:"outputXSL",value:function outputXSL(t){return new qe(t)}},{key:"overprint",value:function overprint(t){return new Ge(t)}},{key:"packets",value:function packets(t){return new ze(t)}},{key:"pageOffset",value:function pageOffset(t){return new We(t)}},{key:"pageRange",value:function pageRange(t){return new Ve(t)}},{key:"pagination",value:function pagination(t){return new Ke(t)}},{key:"paginationOverride",value:function paginationOverride(t){return new Ye(t)}},{key:"part",value:function part(t){return new Je(t)}},{key:"pcl",value:function pcl(t){return new Ze(t)}},{key:"pdf",value:function pdf(t){return new Qe(t)}},{key:"pdfa",value:function pdfa(t){return new et(t)}},{key:"permissions",value:function permissions(t){return new tt(t)}},{key:"pickTrayByPDFSize",value:function pickTrayByPDFSize(t){return new rt(t)}},{key:"picture",value:function picture(t){return new at(t)}},{key:"plaintextMetadata",value:function plaintextMetadata(t){return new nt(t)}},{key:"presence",value:function presence(t){return new it(t)}},{key:"present",value:function present(t){return new ot(t)}},{key:"print",value:function print(t){return new st(t)}},{key:"printHighQuality",value:function printHighQuality(t){return new ct(t)}},{key:"printScaling",value:function printScaling(t){return new lt(t)}},{key:"printerName",value:function printerName(t){return new ut(t)}},{key:"producer",value:function producer(t){return new ft(t)}},{key:"ps",value:function ps(t){return new ht(t)}},{key:"range",value:function range(t){return new dt(t)}},{key:"record",value:function record(t){return new gt(t)}},{key:"relevant",value:function relevant(t){return new mt(t)}},{key:"rename",value:function rename(t){return new yt(t)}},{key:"renderPolicy",value:function renderPolicy(t){return new vt(t)}},{key:"runScripts",value:function runScripts(t){return new bt(t)}},{key:"script",value:function script(t){return new kt(t)}},{key:"scriptModel",value:function scriptModel(t){return new _t(t)}},{key:"severity",value:function severity(t){return new wt(t)}},{key:"silentPrint",value:function silentPrint(t){return new St(t)}},{key:"staple",value:function staple(t){return new Ct(t)}},{key:"startNode",value:function startNode(t){return new xt(t)}},{key:"startPage",value:function startPage(t){return new Ot(t)}},{key:"submitFormat",value:function submitFormat(t){return new At(t)}},{key:"submitUrl",value:function submitUrl(t){return new Pt(t)}},{key:"subsetBelow",value:function subsetBelow(t){return new Tt(t)}},{key:"suppressBanner",value:function suppressBanner(t){return new Ft(t)}},{key:"tagged",value:function tagged(t){return new It(t)}},{key:"template",value:function template(t){return new Et(t)}},{key:"templateCache",value:function templateCache(t){return new jt(t)}},{key:"threshold",value:function threshold(t){return new Mt(t)}},{key:"to",value:function to(t){return new Rt(t)}},{key:"trace",value:function trace(t){return new Dt(t)}},{key:"transform",value:function transform(t){return new Bt(t)}},{key:"type",value:function type(t){return new Lt(t)}},{key:"uri",value:function uri(t){return new Nt(t)}},{key:"validate",value:function validate(t){return new Ut(t)}},{key:"validateApprovalSignatures",value:function validateApprovalSignatures(t){return new Ht(t)}},{key:"validationMessaging",value:function validationMessaging(t){return new $t(t)}},{key:"version",value:function version(t){return new Xt(t)}},{key:"versionControl",value:function versionControl(t){return new qt(t)}},{key:"viewerPreferences",value:function viewerPreferences(t){return new Gt(t)}},{key:"webClient",value:function webClient(t){return new zt(t)}},{key:"whitespace",value:function whitespace(t){return new Wt(t)}},{key:"window",value:function window(t){return new Vt(t)}},{key:"xdc",value:function xdc(t){return new Kt(t)}},{key:"xdp",value:function xdp(t){return new Yt(t)}},{key:"xsl",value:function xsl(t){return new Jt(t)}},{key:"zpl",value:function zpl(t){return new Zt(t)}}]);return ConfigNamespace}();r.ConfigNamespace=Qt},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.ConnectionSetNamespace=void 0;var c=o(219),l=o(217);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=c.NamespaceIds.connectionSet.id,h=function(t){_inherits(ConnectionSet,t);var r=_createSuper(ConnectionSet);function ConnectionSet(t){var o;_classCallCheck(this,ConnectionSet);(o=r.call(this,u,"connectionSet",!0)).wsdlConnection=new l.XFAObjectArray;o.xmlConnection=new l.XFAObjectArray;o.xsdConnection=new l.XFAObjectArray;return o}return _createClass(ConnectionSet)}(l.XFAObject),d=function(t){_inherits(EffectiveInputPolicy,t);var r=_createSuper(EffectiveInputPolicy);function EffectiveInputPolicy(t){var o;_classCallCheck(this,EffectiveInputPolicy);(o=r.call(this,u,"effectiveInputPolicy")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(EffectiveInputPolicy)}(l.XFAObject),g=function(t){_inherits(EffectiveOutputPolicy,t);var r=_createSuper(EffectiveOutputPolicy);function EffectiveOutputPolicy(t){var o;_classCallCheck(this,EffectiveOutputPolicy);(o=r.call(this,u,"effectiveOutputPolicy")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(EffectiveOutputPolicy)}(l.XFAObject),m=function(t){_inherits(Operation,t);var r=_createSuper(Operation);function Operation(t){var o;_classCallCheck(this,Operation);(o=r.call(this,u,"operation")).id=t.id||"";o.input=t.input||"";o.name=t.name||"";o.output=t.output||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Operation)}(l.StringObject),y=function(t){_inherits(RootElement,t);var r=_createSuper(RootElement);function RootElement(t){var o;_classCallCheck(this,RootElement);(o=r.call(this,u,"rootElement")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(RootElement)}(l.StringObject),v=function(t){_inherits(SoapAction,t);var r=_createSuper(SoapAction);function SoapAction(t){var o;_classCallCheck(this,SoapAction);(o=r.call(this,u,"soapAction")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(SoapAction)}(l.StringObject),k=function(t){_inherits(SoapAddress,t);var r=_createSuper(SoapAddress);function SoapAddress(t){var o;_classCallCheck(this,SoapAddress);(o=r.call(this,u,"soapAddress")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(SoapAddress)}(l.StringObject),_=function(t){_inherits(Uri,t);var r=_createSuper(Uri);function Uri(t){var o;_classCallCheck(this,Uri);(o=r.call(this,u,"uri")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(Uri)}(l.StringObject),w=function(t){_inherits(WsdlAddress,t);var r=_createSuper(WsdlAddress);function WsdlAddress(t){var o;_classCallCheck(this,WsdlAddress);(o=r.call(this,u,"wsdlAddress")).id=t.id||"";o.name=t.name||"";o.use=t.use||"";o.usehref=t.usehref||"";return o}return _createClass(WsdlAddress)}(l.StringObject),S=function(t){_inherits(WsdlConnection,t);var r=_createSuper(WsdlConnection);function WsdlConnection(t){var o;_classCallCheck(this,WsdlConnection);(o=r.call(this,u,"wsdlConnection",!0)).dataDescription=t.dataDescription||"";o.name=t.name||"";o.effectiveInputPolicy=null;o.effectiveOutputPolicy=null;o.operation=null;o.soapAction=null;o.soapAddress=null;o.wsdlAddress=null;return o}return _createClass(WsdlConnection)}(l.XFAObject),C=function(t){_inherits(XmlConnection,t);var r=_createSuper(XmlConnection);function XmlConnection(t){var o;_classCallCheck(this,XmlConnection);(o=r.call(this,u,"xmlConnection",!0)).dataDescription=t.dataDescription||"";o.name=t.name||"";o.uri=null;return o}return _createClass(XmlConnection)}(l.XFAObject),x=function(t){_inherits(XsdConnection,t);var r=_createSuper(XsdConnection);function XsdConnection(t){var o;_classCallCheck(this,XsdConnection);(o=r.call(this,u,"xsdConnection",!0)).dataDescription=t.dataDescription||"";o.name=t.name||"";o.rootElement=null;o.uri=null;return o}return _createClass(XsdConnection)}(l.XFAObject),O=function(){function ConnectionSetNamespace(){_classCallCheck(this,ConnectionSetNamespace)}_createClass(ConnectionSetNamespace,null,[{key:c.$buildXFAObject,value:function value(t,r){if(ConnectionSetNamespace.hasOwnProperty(t))return ConnectionSetNamespace[t](r)}},{key:"connectionSet",value:function connectionSet(t){return new h(t)}},{key:"effectiveInputPolicy",value:function effectiveInputPolicy(t){return new d(t)}},{key:"effectiveOutputPolicy",value:function effectiveOutputPolicy(t){return new g(t)}},{key:"operation",value:function operation(t){return new m(t)}},{key:"rootElement",value:function rootElement(t){return new y(t)}},{key:"soapAction",value:function soapAction(t){return new v(t)}},{key:"soapAddress",value:function soapAddress(t){return new k(t)}},{key:"uri",value:function uri(t){return new _(t)}},{key:"wsdlAddress",value:function wsdlAddress(t){return new w(t)}},{key:"wsdlConnection",value:function wsdlConnection(t){return new S(t)}},{key:"xmlConnection",value:function xmlConnection(t){return new C(t)}},{key:"xsdConnection",value:function xsdConnection(t){return new x(t)}}]);return ConnectionSetNamespace}();r.ConnectionSetNamespace=O},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.DatasetsNamespace=void 0;var c=o(217),l=o(219);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=l.NamespaceIds.datasets.id,h=function(t){_inherits(Data,t);var r=_createSuper(Data);function Data(t){_classCallCheck(this,Data);return r.call(this,u,"data",t)}_createClass(Data,[{key:c.$isNsAgnostic,value:function value(){return!0}}]);return Data}(c.XmlObject),d=function(t){_inherits(Datasets,t);var r=_createSuper(Datasets);function Datasets(t){var o;_classCallCheck(this,Datasets);(o=r.call(this,u,"datasets",!0)).data=null;o.Signature=null;return o}_createClass(Datasets,[{key:c.$onChild,value:function value(t){var r=t[c.$nodeName];("data"===r&&t[c.$namespaceId]===u||"Signature"===r&&t[c.$namespaceId]===l.NamespaceIds.signature.id)&&(this[r]=t);this[c.$appendChild](t)}}]);return Datasets}(c.XFAObject),g=function(){function DatasetsNamespace(){_classCallCheck(this,DatasetsNamespace)}_createClass(DatasetsNamespace,null,[{key:l.$buildXFAObject,value:function value(t,r){if(DatasetsNamespace.hasOwnProperty(t))return DatasetsNamespace[t](r)}},{key:"datasets",value:function datasets(t){return new d(t)}},{key:"data",value:function data(t){return new h(t)}}]);return DatasetsNamespace}();r.DatasetsNamespace=g},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.LocaleSetNamespace=void 0;var c=o(219),l=o(217),u=o(218);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var h=c.NamespaceIds.localeSet.id,d=function(t){_inherits(CalendarSymbols,t);var r=_createSuper(CalendarSymbols);function CalendarSymbols(t){var o;_classCallCheck(this,CalendarSymbols);(o=r.call(this,h,"calendarSymbols",!0)).name="gregorian";o.dayNames=new l.XFAObjectArray(2);o.eraNames=null;o.meridiemNames=null;o.monthNames=new l.XFAObjectArray(2);return o}return _createClass(CalendarSymbols)}(l.XFAObject),g=function(t){_inherits(CurrencySymbol,t);var r=_createSuper(CurrencySymbol);function CurrencySymbol(t){var o;_classCallCheck(this,CurrencySymbol);(o=r.call(this,h,"currencySymbol")).name=(0,u.getStringOption)(t.name,["symbol","isoname","decimal"]);return o}return _createClass(CurrencySymbol)}(l.StringObject),m=function(t){_inherits(CurrencySymbols,t);var r=_createSuper(CurrencySymbols);function CurrencySymbols(t){var o;_classCallCheck(this,CurrencySymbols);(o=r.call(this,h,"currencySymbols",!0)).currencySymbol=new l.XFAObjectArray(3);return o}return _createClass(CurrencySymbols)}(l.XFAObject),y=function(t){_inherits(DatePattern,t);var r=_createSuper(DatePattern);function DatePattern(t){var o;_classCallCheck(this,DatePattern);(o=r.call(this,h,"datePattern")).name=(0,u.getStringOption)(t.name,["full","long","med","short"]);return o}return _createClass(DatePattern)}(l.StringObject),v=function(t){_inherits(DatePatterns,t);var r=_createSuper(DatePatterns);function DatePatterns(t){var o;_classCallCheck(this,DatePatterns);(o=r.call(this,h,"datePatterns",!0)).datePattern=new l.XFAObjectArray(4);return o}return _createClass(DatePatterns)}(l.XFAObject),k=function(t){_inherits(DateTimeSymbols,t);var r=_createSuper(DateTimeSymbols);function DateTimeSymbols(t){_classCallCheck(this,DateTimeSymbols);return r.call(this,h,"dateTimeSymbols")}return _createClass(DateTimeSymbols)}(l.ContentObject),_=function(t){_inherits(Day,t);var r=_createSuper(Day);function Day(t){_classCallCheck(this,Day);return r.call(this,h,"day")}return _createClass(Day)}(l.StringObject),w=function(t){_inherits(DayNames,t);var r=_createSuper(DayNames);function DayNames(t){var o;_classCallCheck(this,DayNames);(o=r.call(this,h,"dayNames",!0)).abbr=(0,u.getInteger)({data:t.abbr,defaultValue:0,validate:function validate(t){return 1===t}});o.day=new l.XFAObjectArray(7);return o}return _createClass(DayNames)}(l.XFAObject),S=function(t){_inherits(Era,t);var r=_createSuper(Era);function Era(t){_classCallCheck(this,Era);return r.call(this,h,"era")}return _createClass(Era)}(l.StringObject),C=function(t){_inherits(EraNames,t);var r=_createSuper(EraNames);function EraNames(t){var o;_classCallCheck(this,EraNames);(o=r.call(this,h,"eraNames",!0)).era=new l.XFAObjectArray(2);return o}return _createClass(EraNames)}(l.XFAObject),x=function(t){_inherits(Locale,t);var r=_createSuper(Locale);function Locale(t){var o;_classCallCheck(this,Locale);(o=r.call(this,h,"locale",!0)).desc=t.desc||"";o.name="isoname";o.calendarSymbols=null;o.currencySymbols=null;o.datePatterns=null;o.dateTimeSymbols=null;o.numberPatterns=null;o.numberSymbols=null;o.timePatterns=null;o.typeFaces=null;return o}return _createClass(Locale)}(l.XFAObject),O=function(t){_inherits(LocaleSet,t);var r=_createSuper(LocaleSet);function LocaleSet(t){var o;_classCallCheck(this,LocaleSet);(o=r.call(this,h,"localeSet",!0)).locale=new l.XFAObjectArray;return o}return _createClass(LocaleSet)}(l.XFAObject),T=function(t){_inherits(Meridiem,t);var r=_createSuper(Meridiem);function Meridiem(t){_classCallCheck(this,Meridiem);return r.call(this,h,"meridiem")}return _createClass(Meridiem)}(l.StringObject),E=function(t){_inherits(MeridiemNames,t);var r=_createSuper(MeridiemNames);function MeridiemNames(t){var o;_classCallCheck(this,MeridiemNames);(o=r.call(this,h,"meridiemNames",!0)).meridiem=new l.XFAObjectArray(2);return o}return _createClass(MeridiemNames)}(l.XFAObject),M=function(t){_inherits(Month,t);var r=_createSuper(Month);function Month(t){_classCallCheck(this,Month);return r.call(this,h,"month")}return _createClass(Month)}(l.StringObject),R=function(t){_inherits(MonthNames,t);var r=_createSuper(MonthNames);function MonthNames(t){var o;_classCallCheck(this,MonthNames);(o=r.call(this,h,"monthNames",!0)).abbr=(0,u.getInteger)({data:t.abbr,defaultValue:0,validate:function validate(t){return 1===t}});o.month=new l.XFAObjectArray(12);return o}return _createClass(MonthNames)}(l.XFAObject),j=function(t){_inherits(NumberPattern,t);var r=_createSuper(NumberPattern);function NumberPattern(t){var o;_classCallCheck(this,NumberPattern);(o=r.call(this,h,"numberPattern")).name=(0,u.getStringOption)(t.name,["full","long","med","short"]);return o}return _createClass(NumberPattern)}(l.StringObject),D=function(t){_inherits(NumberPatterns,t);var r=_createSuper(NumberPatterns);function NumberPatterns(t){var o;_classCallCheck(this,NumberPatterns);(o=r.call(this,h,"numberPatterns",!0)).numberPattern=new l.XFAObjectArray(4);return o}return _createClass(NumberPatterns)}(l.XFAObject),L=function(t){_inherits(NumberSymbol,t);var r=_createSuper(NumberSymbol);function NumberSymbol(t){var o;_classCallCheck(this,NumberSymbol);(o=r.call(this,h,"numberSymbol")).name=(0,u.getStringOption)(t.name,["decimal","grouping","percent","minus","zero"]);return o}return _createClass(NumberSymbol)}(l.StringObject),N=function(t){_inherits(NumberSymbols,t);var r=_createSuper(NumberSymbols);function NumberSymbols(t){var o;_classCallCheck(this,NumberSymbols);(o=r.call(this,h,"numberSymbols",!0)).numberSymbol=new l.XFAObjectArray(5);return o}return _createClass(NumberSymbols)}(l.XFAObject),U=function(t){_inherits(TimePattern,t);var r=_createSuper(TimePattern);function TimePattern(t){var o;_classCallCheck(this,TimePattern);(o=r.call(this,h,"timePattern")).name=(0,u.getStringOption)(t.name,["full","long","med","short"]);return o}return _createClass(TimePattern)}(l.StringObject),H=function(t){_inherits(TimePatterns,t);var r=_createSuper(TimePatterns);function TimePatterns(t){var o;_classCallCheck(this,TimePatterns);(o=r.call(this,h,"timePatterns",!0)).timePattern=new l.XFAObjectArray(4);return o}return _createClass(TimePatterns)}(l.XFAObject),$=function(t){_inherits(TypeFace,t);var r=_createSuper(TypeFace);function TypeFace(t){var o;_classCallCheck(this,TypeFace);(o=r.call(this,h,"typeFace",!0)).name=""|t.name;return o}return _createClass(TypeFace)}(l.XFAObject),X=function(t){_inherits(TypeFaces,t);var r=_createSuper(TypeFaces);function TypeFaces(t){var o;_classCallCheck(this,TypeFaces);(o=r.call(this,h,"typeFaces",!0)).typeFace=new l.XFAObjectArray;return o}return _createClass(TypeFaces)}(l.XFAObject),q=function(){function LocaleSetNamespace(){_classCallCheck(this,LocaleSetNamespace)}_createClass(LocaleSetNamespace,null,[{key:c.$buildXFAObject,value:function value(t,r){if(LocaleSetNamespace.hasOwnProperty(t))return LocaleSetNamespace[t](r)}},{key:"calendarSymbols",value:function calendarSymbols(t){return new d(t)}},{key:"currencySymbol",value:function currencySymbol(t){return new g(t)}},{key:"currencySymbols",value:function currencySymbols(t){return new m(t)}},{key:"datePattern",value:function datePattern(t){return new y(t)}},{key:"datePatterns",value:function datePatterns(t){return new v(t)}},{key:"dateTimeSymbols",value:function dateTimeSymbols(t){return new k(t)}},{key:"day",value:function day(t){return new _(t)}},{key:"dayNames",value:function dayNames(t){return new w(t)}},{key:"era",value:function era(t){return new S(t)}},{key:"eraNames",value:function eraNames(t){return new C(t)}},{key:"locale",value:function locale(t){return new x(t)}},{key:"localeSet",value:function localeSet(t){return new O(t)}},{key:"meridiem",value:function meridiem(t){return new T(t)}},{key:"meridiemNames",value:function meridiemNames(t){return new E(t)}},{key:"month",value:function month(t){return new M(t)}},{key:"monthNames",value:function monthNames(t){return new R(t)}},{key:"numberPattern",value:function numberPattern(t){return new j(t)}},{key:"numberPatterns",value:function numberPatterns(t){return new D(t)}},{key:"numberSymbol",value:function numberSymbol(t){return new L(t)}},{key:"numberSymbols",value:function numberSymbols(t){return new N(t)}},{key:"timePattern",value:function timePattern(t){return new U(t)}},{key:"timePatterns",value:function timePatterns(t){return new H(t)}},{key:"typeFace",value:function typeFace(t){return new $(t)}},{key:"typeFaces",value:function typeFaces(t){return new X(t)}}]);return LocaleSetNamespace}();r.LocaleSetNamespace=q},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.SignatureNamespace=void 0;var c=o(219),l=o(217);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=c.NamespaceIds.signature.id,h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Signature,t);var r=_createSuper(Signature);function Signature(t){_classCallCheck(this,Signature);return r.call(this,u,"signature",!0)}return _createClass(Signature)}(l.XFAObject),d=function(){function SignatureNamespace(){_classCallCheck(this,SignatureNamespace)}_createClass(SignatureNamespace,null,[{key:c.$buildXFAObject,value:function value(t,r){if(SignatureNamespace.hasOwnProperty(t))return SignatureNamespace[t](r)}},{key:"signature",value:function signature(t){return new h(t)}}]);return SignatureNamespace}();r.SignatureNamespace=d},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.StylesheetNamespace=void 0;var c=o(219),l=o(217);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=c.NamespaceIds.stylesheet.id,h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Stylesheet,t);var r=_createSuper(Stylesheet);function Stylesheet(t){_classCallCheck(this,Stylesheet);return r.call(this,u,"stylesheet",!0)}return _createClass(Stylesheet)}(l.XFAObject),d=function(){function StylesheetNamespace(){_classCallCheck(this,StylesheetNamespace)}_createClass(StylesheetNamespace,null,[{key:c.$buildXFAObject,value:function value(t,r){if(StylesheetNamespace.hasOwnProperty(t))return StylesheetNamespace[t](r)}},{key:"stylesheet",value:function stylesheet(t){return new h(t)}}]);return StylesheetNamespace}();r.StylesheetNamespace=d},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XdpNamespace=void 0;var c=o(219),l=o(217);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}var u=c.NamespaceIds.xdp.id,h=function(t){!function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}(Xdp,t);var r=_createSuper(Xdp);function Xdp(t){var o;_classCallCheck(this,Xdp);(o=r.call(this,u,"xdp",!0)).uuid=t.uuid||"";o.timeStamp=t.timeStamp||"";o.config=null;o.connectionSet=null;o.datasets=null;o.localeSet=null;o.stylesheet=new l.XFAObjectArray;o.template=null;return o}_createClass(Xdp,[{key:l.$onChildCheck,value:function value(t){var r=c.NamespaceIds[t[l.$nodeName]];return r&&t[l.$namespaceId]===r.id}}]);return Xdp}(l.XFAObject),d=function(){function XdpNamespace(){_classCallCheck(this,XdpNamespace)}_createClass(XdpNamespace,null,[{key:c.$buildXFAObject,value:function value(t,r){if(XdpNamespace.hasOwnProperty(t))return XdpNamespace[t](r)}},{key:"xdp",value:function xdp(t){return new h(t)}}]);return XdpNamespace}();r.XdpNamespace=d},(t,r,o)=>{"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}Object.defineProperty(r,"__esModule",{value:!0});r.XhtmlNamespace=void 0;var c=o(217),l=o(219),u=o(224),h=o(218);function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}function _get(){_get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function _get(t,r,o){var c=_superPropBase(t,r);if(c){var l=Object.getOwnPropertyDescriptor(c,r);return l.get?l.get.call(arguments.length<3?t:o):l.value}};return _get.apply(this,arguments)}function _superPropBase(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&null!==(t=_getPrototypeOf(t)););return t}function _inherits(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}});Object.defineProperty(t,"prototype",{writable:!1});r&&_setPrototypeOf(t,r)}function _setPrototypeOf(t,r){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(t,r){t.__proto__=r;return t};return _setPrototypeOf(t,r)}function _createSuper(t){var r=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})));return!0}catch(t){return!1}}();return function _createSuperInternal(){var o,c=_getPrototypeOf(t);if(r){var l=_getPrototypeOf(this).constructor;o=Reflect.construct(c,arguments,l)}else o=c.apply(this,arguments);return _possibleConstructorReturn(this,o)}}function _possibleConstructorReturn(t,r){if(r&&("object"===_typeof(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function _getPrototypeOf(t){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(t){return t.__proto__||Object.getPrototypeOf(t)};return _getPrototypeOf(t)}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||_unsupportedIterableToArray(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=_unsupportedIterableToArray(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);return"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(t,r):void 0}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}var d=l.NamespaceIds.xhtml.id,g=Symbol(),m=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),y=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",function(t){return"none"===t?"none":"normal"}],["xfa-font-horizontal-scale",function(t){return"scaleX(".concat(Math.max(0,Math.min(parseInt(t)/100)).toFixed(2),")")}],["xfa-font-vertical-scale",function(t){return"scaleY(".concat(Math.max(0,Math.min(parseInt(t)/100)).toFixed(2),")")}],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",function(t,r){t=r.fontSize=(0,h.getMeasurement)(t);return(0,u.measureToString)(.99*t)}],["letter-spacing",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["line-height",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["margin",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["margin-bottom",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["margin-left",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["margin-right",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["margin-top",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["text-indent",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}],["font-family",function(t){return t}],["vertical-align",function(t){return(0,u.measureToString)((0,h.getMeasurement)(t))}]]),v=/\s+/g,k=/[\r\n]+/g,_=/\r\n?/g;function mapStyle(t,r,o){var l=Object.create(null);if(!t)return l;var d,g=Object.create(null),m=_createForOfIteratorHelper(t.split(";").map((function(t){return t.split(":",2)})));try{for(m.s();!(d=m.n()).done;){var v=_slicedToArray(d.value,2),k=v[0],_=v[1],w=y.get(k);if(""!==w){var S=_;w&&(S="string"==typeof w?w:w(_,g));k.endsWith("scale")?l.transform?l.transform="".concat(l[k]," ").concat(S):l.transform=S:l[k.replaceAll(/-([a-zA-Z])/g,(function(t,r){return r.toUpperCase()}))]=S}}}catch(t){m.e(t)}finally{m.f()}l.fontFamily&&(0,u.setFontFamily)({typeface:l.fontFamily,weight:l.fontWeight||"normal",posture:l.fontStyle||"normal",size:g.fontSize||0},r,r[c.$globalData].fontFinder,l);if(o&&l.verticalAlign&&"0px"!==l.verticalAlign&&l.fontSize){var C=(0,h.getMeasurement)(l.fontSize);l.fontSize=(0,u.measureToString)(.583*C);l.verticalAlign=(0,u.measureToString)(Math.sign((0,h.getMeasurement)(l.verticalAlign))*C*.333)}(0,u.fixTextIndent)(l);return l}var w=new Set(["body","html"]),S=function(t){_inherits(XhtmlObject,t);var r=_createSuper(XhtmlObject);function XhtmlObject(t,o){var c;_classCallCheck(this,XhtmlObject);(c=r.call(this,d,o))[g]=!1;c.style=t.style||"";return c}_createClass(XhtmlObject,[{key:c.$clean,value:function value(t){_get(_getPrototypeOf(XhtmlObject.prototype),c.$clean,this).call(this,t);this.style=function checkStyle(t){return t.style?t.style.trim().split(/\s*;\s*/).filter((function(t){return!!t})).map((function(t){return t.split(/\s*:\s*/,2)})).filter((function(r){var o=_slicedToArray(r,2),l=o[0],u=o[1];"font-family"===l&&t[c.$globalData].usedTypefaces.add(u);return m.has(l)})).map((function(t){return t.join(":")})).join(";"):""}(this)}},{key:c.$acceptWhitespace,value:function value(){return!w.has(this[c.$nodeName])}},{key:c.$onText,value:function value(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r)this[g]=!0;else{t=t.replace(k,"");this.style.includes("xfa-spacerun:yes")||(t=t.replace(v," "))}t&&(this[c.$content]+=t)}},{key:c.$pushGlyphs,value:function value(t){var r,o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],l=Object.create(null),u={top:NaN,bottom:NaN,left:NaN,right:NaN},d=null,g=_createForOfIteratorHelper(this.style.split(";").map((function(t){return t.split(":",2)})));try{for(g.s();!(r=g.n()).done;){var m=_slicedToArray(r.value,2),y=m[0],value=m[1];switch(y){case"font-family":l.typeface=(0,h.stripQuotes)(value);break;case"font-size":l.size=(0,h.getMeasurement)(value);break;case"font-weight":l.weight=value;break;case"font-style":l.posture=value;break;case"letter-spacing":l.letterSpacing=(0,h.getMeasurement)(value);break;case"margin":var v=value.split(/ \t/).map((function(t){return(0,h.getMeasurement)(t)}));switch(v.length){case 1:u.top=u.bottom=u.left=u.right=v[0];break;case 2:u.top=u.bottom=v[0];u.left=u.right=v[1];break;case 3:u.top=v[0];u.bottom=v[2];u.left=u.right=v[1];break;case 4:u.top=v[0];u.left=v[1];u.bottom=v[2];u.right=v[3]}break;case"margin-top":u.top=(0,h.getMeasurement)(value);break;case"margin-bottom":u.bottom=(0,h.getMeasurement)(value);break;case"margin-left":u.left=(0,h.getMeasurement)(value);break;case"margin-right":u.right=(0,h.getMeasurement)(value);break;case"line-height":d=(0,h.getMeasurement)(value)}}}catch(t){g.e(t)}finally{g.f()}t.pushData(l,u,d);if(this[c.$content])t.addString(this[c.$content]);else{var k,_=_createForOfIteratorHelper(this[c.$getChildren]());try{for(_.s();!(k=_.n()).done;){var w=k.value;"#text"!==w[c.$nodeName]?w[c.$pushGlyphs](t):t.addString(w[c.$content])}}catch(t){_.e(t)}finally{_.f()}}o&&t.popFont()}},{key:c.$toHTML,value:function value(t){var value,r=[];this[c.$extra]={children:r};this[c.$childrenToHTML]({});if(0===r.length&&!this[c.$content])return h.HTMLResult.EMPTY;value=this[g]?this[c.$content]?this[c.$content].replace(_,"\n"):void 0:this[c.$content]||void 0;return h.HTMLResult.success({name:this[c.$nodeName],attributes:{href:this.href,style:mapStyle(this.style,this,this[g])},children:r,value:value})}}]);return XhtmlObject}(c.XmlObject),C=function(t){_inherits(A,t);var r=_createSuper(A);function A(t){var o;_classCallCheck(this,A);(o=r.call(this,t,"a")).href=(0,u.fixURL)(t.href)||"";return o}return _createClass(A)}(S),x=function(t){_inherits(B,t);var r=_createSuper(B);function B(t){_classCallCheck(this,B);return r.call(this,t,"b")}_createClass(B,[{key:c.$pushGlyphs,value:function value(t){t.pushFont({weight:"bold"});_get(_getPrototypeOf(B.prototype),c.$pushGlyphs,this).call(this,t);t.popFont()}}]);return B}(S),O=function(t){_inherits(Body,t);var r=_createSuper(Body);function Body(t){_classCallCheck(this,Body);return r.call(this,t,"body")}_createClass(Body,[{key:c.$toHTML,value:function value(t){var r=_get(_getPrototypeOf(Body.prototype),c.$toHTML,this).call(this,t),o=r.html;if(!o)return h.HTMLResult.EMPTY;o.name="div";o.attributes.class=["xfaRich"];return r}}]);return Body}(S),T=function(t){_inherits(Br,t);var r=_createSuper(Br);function Br(t){_classCallCheck(this,Br);return r.call(this,t,"br")}_createClass(Br,[{key:c.$text,value:function value(){return"\n"}},{key:c.$pushGlyphs,value:function value(t){t.addString("\n")}},{key:c.$toHTML,value:function value(t){return h.HTMLResult.success({name:"br"})}}]);return Br}(S),E=function(t){_inherits(Html,t);var r=_createSuper(Html);function Html(t){_classCallCheck(this,Html);return r.call(this,t,"html")}_createClass(Html,[{key:c.$toHTML,value:function value(t){var r=[];this[c.$extra]={children:r};this[c.$childrenToHTML]({});if(0===r.length)return h.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[c.$content]||""});if(1===r.length){var o=r[0];if(o.attributes&&o.attributes.class.includes("xfaRich"))return h.HTMLResult.success(o)}return h.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:r})}}]);return Html}(S),M=function(t){_inherits(I,t);var r=_createSuper(I);function I(t){_classCallCheck(this,I);return r.call(this,t,"i")}_createClass(I,[{key:c.$pushGlyphs,value:function value(t){t.pushFont({posture:"italic"});_get(_getPrototypeOf(I.prototype),c.$pushGlyphs,this).call(this,t);t.popFont()}}]);return I}(S),R=function(t){_inherits(Li,t);var r=_createSuper(Li);function Li(t){_classCallCheck(this,Li);return r.call(this,t,"li")}return _createClass(Li)}(S),j=function(t){_inherits(Ol,t);var r=_createSuper(Ol);function Ol(t){_classCallCheck(this,Ol);return r.call(this,t,"ol")}return _createClass(Ol)}(S),D=function(t){_inherits(P,t);var r=_createSuper(P);function P(t){_classCallCheck(this,P);return r.call(this,t,"p")}_createClass(P,[{key:c.$pushGlyphs,value:function value(t){_get(_getPrototypeOf(P.prototype),c.$pushGlyphs,this).call(this,t,!1);t.addString("\n");t.addPara();t.popFont()}},{key:c.$text,value:function value(){var t=this[c.$getParent]()[c.$getChildren]();return t[t.length-1]===this?_get(_getPrototypeOf(P.prototype),c.$text,this).call(this):_get(_getPrototypeOf(P.prototype),c.$text,this).call(this)+"\n"}}]);return P}(S),L=function(t){_inherits(Span,t);var r=_createSuper(Span);function Span(t){_classCallCheck(this,Span);return r.call(this,t,"span")}return _createClass(Span)}(S),N=function(t){_inherits(Sub,t);var r=_createSuper(Sub);function Sub(t){_classCallCheck(this,Sub);return r.call(this,t,"sub")}return _createClass(Sub)}(S),U=function(t){_inherits(Sup,t);var r=_createSuper(Sup);function Sup(t){_classCallCheck(this,Sup);return r.call(this,t,"sup")}return _createClass(Sup)}(S),H=function(t){_inherits(Ul,t);var r=_createSuper(Ul);function Ul(t){_classCallCheck(this,Ul);return r.call(this,t,"ul")}return _createClass(Ul)}(S),$=function(){function XhtmlNamespace(){_classCallCheck(this,XhtmlNamespace)}_createClass(XhtmlNamespace,null,[{key:l.$buildXFAObject,value:function value(t,r){if(XhtmlNamespace.hasOwnProperty(t))return XhtmlNamespace[t](r)}},{key:"a",value:function a(t){return new C(t)}},{key:"b",value:function b(t){return new x(t)}},{key:"body",value:function body(t){return new O(t)}},{key:"br",value:function br(t){return new T(t)}},{key:"html",value:function html(t){return new E(t)}},{key:"i",value:function i(t){return new M(t)}},{key:"li",value:function li(t){return new R(t)}},{key:"ol",value:function ol(t){return new j(t)}},{key:"p",value:function p(t){return new D(t)}},{key:"span",value:function span(t){return new L(t)}},{key:"sub",value:function sub(t){return new N(t)}},{key:"sup",value:function sup(t){return new U(t)}},{key:"ul",value:function ul(t){return new H(t)}}]);return XhtmlNamespace}();r.XhtmlNamespace=$},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.UnknownNamespace=void 0;var c=o(219),l=o(217);function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var u=function(){function UnknownNamespace(t){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,UnknownNamespace);this.namespaceId=t}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(UnknownNamespace,[{key:c.$buildXFAObject,value:function value(t,r){return new l.XmlObject(this.namespaceId,t,r)}}]);return UnknownNamespace}();r.UnknownNamespace=u},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.XRef=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4),u=o(146),h=o(149),d=o(168),g=o(150),m=o(214);function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _slicedToArray(t,r){return function _arrayWithHoles(t){if(Array.isArray(t))return t}(t)||function _iterableToArrayLimit(t,r){var o=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==o)return;var c,l,u=[],h=!0,d=!1;try{for(o=o.call(t);!(h=(c=o.next()).done);h=!0){u.push(c.value);if(r&&u.length===r)break}}catch(t){d=!0;l=t}finally{try{h||null==o.return||o.return()}finally{if(d)throw l}}return u}(t,r)||function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t,r)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}var y=function(){function XRef(t,r){!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,XRef);this.stream=t;this.pdfManager=r;this.entries=[];this.xrefstms=Object.create(null);this._cacheMap=new Map;this._pendingRefs=new u.RefSet;this.stats=new h.DocStats(r.msgHandler);this._newRefNum=null}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(XRef,[{key:"getNewRef",value:function getNewRef(){null===this._newRefNum&&(this._newRefNum=this.entries.length);return u.Ref.get(this._newRefNum++,0)}},{key:"resetNewRef",value:function resetNewRef(){this._newRefNum=null}},{key:"setStartXRef",value:function setStartXRef(t){this.startXRefQueue=[t]}},{key:"parse",value:function parse(){var t,r,o,c=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(c){(0,l.warn)("Indexing all PDF objects");t=this.indexObjects()}else t=this.readXRef();t.assignXref(this);this.trailer=t;try{r=t.get("Encrypt")}catch(t){if(t instanceof h.MissingDataException)throw t;(0,l.warn)('XRef.parse - Invalid "Encrypt" reference: "'.concat(t,'".'))}if(r instanceof u.Dict){var d=t.get("ID"),g=d&&d.length?d[0]:"";r.suppressEncryption=!0;this.encrypt=new m.CipherTransformFactory(r,g,this.pdfManager.password)}try{o=t.get("Root")}catch(t){if(t instanceof h.MissingDataException)throw t;(0,l.warn)('XRef.parse - Invalid "Root" reference: "'.concat(t,'".'))}if(o instanceof u.Dict)try{var y=o.get("Pages");if(y instanceof u.Dict){this.root=o;return}}catch(t){if(t instanceof h.MissingDataException)throw t;(0,l.warn)('XRef.parse - Invalid "Pages" reference: "'.concat(t,'".'))}if(!c)throw new h.XRefParseException;throw new l.InvalidPDFException("Invalid Root reference.")}},{key:"processXRefTable",value:function processXRefTable(t){"tableState"in this||(this.tableState={entryNum:0,streamPos:t.lexer.stream.pos,parserBuf1:t.buf1,parserBuf2:t.buf2});var r=this.readXRefTable(t);if(!(0,u.isCmd)(r,"trailer"))throw new l.FormatError("Invalid XRef table: could not find trailer dictionary");var o=t.getObj();o instanceof u.Dict||!o.dict||(o=o.dict);if(!(o instanceof u.Dict))throw new l.FormatError("Invalid XRef table: could not parse trailer dictionary");delete this.tableState;return o}},{key:"readXRefTable",value:function readXRefTable(t){var r,o=t.lexer.stream,c=this.tableState;o.pos=c.streamPos;t.buf1=c.parserBuf1;t.buf2=c.parserBuf2;for(;;){if(!("firstEntryNum"in c)||!("entryCount"in c)){if((0,u.isCmd)(r=t.getObj(),"trailer"))break;c.firstEntryNum=r;c.entryCount=t.getObj()}var h=c.firstEntryNum,d=c.entryCount;if(!Number.isInteger(h)||!Number.isInteger(d))throw new l.FormatError("Invalid XRef table: wrong types in subsection header");for(var g=c.entryNum;g<d;g++){c.streamPos=o.pos;c.entryNum=g;c.parserBuf1=t.buf1;c.parserBuf2=t.buf2;var m={};m.offset=t.getObj();m.gen=t.getObj();var y=t.getObj();if(y instanceof u.Cmd)switch(y.cmd){case"f":m.free=!0;break;case"n":m.uncompressed=!0}if(!Number.isInteger(m.offset)||!Number.isInteger(m.gen)||!m.free&&!m.uncompressed)throw new l.FormatError("Invalid entry in XRef subsection: ".concat(h,", ").concat(d));0===g&&m.free&&1===h&&(h=0);this.entries[g+h]||(this.entries[g+h]=m)}c.entryNum=0;c.streamPos=o.pos;c.parserBuf1=t.buf1;c.parserBuf2=t.buf2;delete c.firstEntryNum;delete c.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new l.FormatError("Invalid XRef table: unexpected first object");return r}},{key:"processXRefStream",value:function processXRefStream(t){if(!("streamState"in this)){var r=t.dict,o=r.get("W"),c=r.get("Index");c||(c=[0,r.get("Size")]);this.streamState={entryRanges:c,byteWidths:o,entryNum:0,streamPos:t.pos}}this.readXRefStream(t);delete this.streamState;return t.dict}},{key:"readXRefStream",value:function readXRefStream(t){var r=this.streamState;t.pos=r.streamPos;for(var o=_slicedToArray(r.byteWidths,3),c=o[0],u=o[1],h=o[2],d=r.entryRanges;d.length>0;){var g=_slicedToArray(d,2),m=g[0],y=g[1];if(!Number.isInteger(m)||!Number.isInteger(y))throw new l.FormatError("Invalid XRef range fields: ".concat(m,", ").concat(y));if(!Number.isInteger(c)||!Number.isInteger(u)||!Number.isInteger(h))throw new l.FormatError("Invalid XRef entry fields length: ".concat(m,", ").concat(y));for(var v=r.entryNum;v<y;++v){r.entryNum=v;r.streamPos=t.pos;for(var k=0,_=0,w=0,S=0;S<c;++S){var C=t.getByte();if(-1===C)throw new l.FormatError("Invalid XRef byteWidths 'type'.");k=k<<8|C}0===c&&(k=1);for(var x=0;x<u;++x){var O=t.getByte();if(-1===O)throw new l.FormatError("Invalid XRef byteWidths 'offset'.");_=_<<8|O}for(var T=0;T<h;++T){var E=t.getByte();if(-1===E)throw new l.FormatError("Invalid XRef byteWidths 'generation'.");w=w<<8|E}var M={};M.offset=_;M.gen=w;switch(k){case 0:M.free=!0;break;case 1:M.uncompressed=!0;break;case 2:break;default:throw new l.FormatError("Invalid XRef entry type: ".concat(k))}this.entries[m+v]||(this.entries[m+v]=M)}r.entryNum=0;r.streamPos=t.pos;d.splice(0,2)}}},{key:"indexObjects",value:function indexObjects(){function readToken(t,r){for(var o="",c=t[r];10!==c&&13!==c&&60!==c&&!(++r>=t.length);){o+=String.fromCharCode(c);c=t[r]}return o}function skipUntil(t,r,o){for(var c=o.length,l=t.length,u=0;r<l;){for(var h=0;h<c&&t[r+h]===o[h];)++h;if(h>=c)break;r++;u++}return u}var t=/^(\d+)\s+(\d+)\s+obj\b/,r=/\bendobj[\b\s]$/,o=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,c=new Uint8Array([116,114,97,105,108,101,114]),g=new Uint8Array([115,116,97,114,116,120,114,101,102]),m=new Uint8Array([111,98,106]),y=new Uint8Array([47,88,82,101,102]);this.entries.length=0;this._cacheMap.clear();var v=this.stream;v.pos=0;for(var k,_=v.getBytes(),w=_.length,S=v.start,C=[],x=[];S<w;){var O=_[S];if(9!==O&&10!==O&&13!==O&&32!==O)if(37!==O){var T=readToken(_,S),E=void 0;if(T.startsWith("xref")&&(4===T.length||/\s/.test(T[4]))){S+=skipUntil(_,S,c);C.push(S);S+=skipUntil(_,S,g)}else if(E=t.exec(T)){var M=0|E[1],R=0|E[2],j=void 0,D=S+T.length,L=!1;if(this.entries[M]){if(this.entries[M].gen===R)try{new d.Parser({lexer:new d.Lexer(v.makeSubStream(D))}).getObj();L=!0}catch(t){t instanceof h.ParserEOFException?(0,l.warn)("indexObjects -- checking object (".concat(T,'): "').concat(t,'".')):L=!0}}else L=!0;L&&(this.entries[M]={offset:S-v.start,gen:R,uncompressed:!0});for(;D<_.length;){var N=D+skipUntil(_,D,m)+4;j=N-S;var U=Math.max(N-25,D),H=(0,l.bytesToString)(_.subarray(U,N));if(r.test(H))break;var $=o.exec(H);if($&&$[1]){(0,l.warn)('indexObjects: Found new "obj" inside of another "obj", caused by missing "endobj" -- trying to recover.');j-=$[1].length;break}D=N}var X=_.subarray(S,S+j),q=skipUntil(X,0,y);if(q<j&&X[q+5]<64){x.push(S-v.start);this.xrefstms[S-v.start]=1}S+=j}else if(T.startsWith("trailer")&&(7===T.length||/\s/.test(T[7]))){C.push(S);S+=skipUntil(_,S,g)}else S+=T.length+1}else do{if(++S>=w)break;O=_[S]}while(10!==O&&13!==O);else++S}for(var G=0,z=x.length;G<z;++G){this.startXRefQueue.push(x[G]);this.readXRef(!0)}for(var W=0,V=C.length;W<V;++W){v.pos=C[W];var K=new d.Parser({lexer:new d.Lexer(v),xref:this,allowStreams:!0,recoveryMode:!0}),Y=K.getObj();if((0,u.isCmd)(Y,"trailer")){var J=K.getObj();if(J instanceof u.Dict){try{var Z=J.get("Root");if(!(Z instanceof u.Dict))continue;var Q=Z.get("Pages");if(!(Q instanceof u.Dict))continue;var ee=Q.get("Count");if(!Number.isInteger(ee))continue}catch(t){continue}if(J.has("ID"))return J;k=J}}}if(k)return k;if(this.topDict)return this.topDict;throw new l.InvalidPDFException("Invalid PDF structure.")}},{key:"readXRef",value:function readXRef(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.stream,o=new Set;try{for(;this.startXRefQueue.length;){var c=this.startXRefQueue[0];if(o.has(c)){(0,l.warn)("readXRef - skipping XRef table since it was already parsed.");this.startXRefQueue.shift()}else{o.add(c);r.pos=c+r.start;var m=new d.Parser({lexer:new d.Lexer(r),xref:this,allowStreams:!0}),y=m.getObj(),v=void 0;if((0,u.isCmd)(y,"xref")){v=this.processXRefTable(m);this.topDict||(this.topDict=v);y=v.get("XRefStm");if(Number.isInteger(y)){var k=y;if(!(k in this.xrefstms)){this.xrefstms[k]=1;this.startXRefQueue.push(k)}}}else{if(!Number.isInteger(y))throw new l.FormatError("Invalid XRef stream header");if(!(Number.isInteger(m.getObj())&&(0,u.isCmd)(m.getObj(),"obj")&&(y=m.getObj())instanceof g.BaseStream))throw new l.FormatError("Invalid XRef stream");v=this.processXRefStream(y);this.topDict||(this.topDict=v);if(!v)throw new l.FormatError("Failed to read XRef stream")}y=v.get("Prev");Number.isInteger(y)?this.startXRefQueue.push(y):y instanceof u.Ref&&this.startXRefQueue.push(y.num);this.startXRefQueue.shift()}}return this.topDict}catch(t){if(t instanceof h.MissingDataException)throw t;(0,l.info)("(while reading XRef): "+t);this.startXRefQueue.shift()}if(!t)throw new h.XRefParseException}},{key:"getEntry",value:function getEntry(t){var r=this.entries[t];return r&&!r.free&&r.offset?r:null}},{key:"fetchIfRef",value:function fetchIfRef(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t instanceof u.Ref?this.fetch(t,r):t}},{key:"fetch",value:function fetch(t){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(t instanceof u.Ref))throw new Error("ref object is not a reference");var o=t.num,c=this._cacheMap.get(o);if(void 0!==c){c instanceof u.Dict&&!c.objId&&(c.objId=t.toString());return c}var h=this.getEntry(o);if(null===h){this._cacheMap.set(o,h);return h}if(this._pendingRefs.has(t)){this._pendingRefs.remove(t);(0,l.warn)("Ignoring circular reference: ".concat(t,"."));return u.CIRCULAR_REF}this._pendingRefs.put(t);try{h=h.uncompressed?this.fetchUncompressed(t,h,r):this.fetchCompressed(t,h,r);this._pendingRefs.remove(t)}catch(r){this._pendingRefs.remove(t);throw r}h instanceof u.Dict?h.objId=t.toString():h instanceof g.BaseStream&&(h.dict.objId=t.toString());return h}},{key:"fetchUncompressed",value:function fetchUncompressed(t,r){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=t.gen,l=t.num;if(r.gen!==c)throw new h.XRefEntryException("Inconsistent generation in XRef: ".concat(t));var m=this.stream.makeSubStream(r.offset+this.stream.start),y=new d.Parser({lexer:new d.Lexer(m),xref:this,allowStreams:!0}),v=y.getObj(),k=y.getObj(),_=y.getObj();if(v!==l||k!==c||!(_ instanceof u.Cmd))throw new h.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(t));if("obj"!==_.cmd){if(_.cmd.startsWith("obj")){l=parseInt(_.cmd.substring(3),10);if(!Number.isNaN(l))return l}throw new h.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(t))}(r=this.encrypt&&!o?y.getObj(this.encrypt.createCipherTransform(l,c)):y.getObj())instanceof g.BaseStream||this._cacheMap.set(l,r);return r}},{key:"fetchCompressed",value:function fetchCompressed(t,r){var o=r.offset,c=this.fetch(u.Ref.get(o,0));if(!(c instanceof g.BaseStream))throw new l.FormatError("bad ObjStm stream");var m=c.dict.get("First"),y=c.dict.get("N");if(!Number.isInteger(m)||!Number.isInteger(y))throw new l.FormatError("invalid first and n parameters for ObjStm stream");for(var v=new d.Parser({lexer:new d.Lexer(c),xref:this,allowStreams:!0}),k=new Array(y),_=new Array(y),w=0;w<y;++w){var S=v.getObj();if(!Number.isInteger(S))throw new l.FormatError("invalid object number in the ObjStm stream: ".concat(S));var C=v.getObj();if(!Number.isInteger(C))throw new l.FormatError("invalid object offset in the ObjStm stream: ".concat(C));k[w]=S;_[w]=C}for(var x=(c.start||0)+m,O=new Array(y),T=0;T<y;++T){var E=T<y-1?_[T+1]-_[T]:void 0;if(E<0)throw new l.FormatError("Invalid offset in the ObjStm stream.");var M=(v=new d.Parser({lexer:new d.Lexer(c.makeSubStream(x+_[T],E,c.dict)),xref:this,allowStreams:!0})).getObj();O[T]=M;if(!(M instanceof g.BaseStream)){var R=k[T],j=this.entries[R];j&&j.offset===o&&j.gen===T&&this._cacheMap.set(R,M)}}if(void 0===(r=O[r.gen]))throw new h.XRefEntryException("Bad (compressed) XRef entry: ".concat(t));return r}},{key:"fetchIfRefAsync",value:(r=_asyncToGenerator(c.default.mark((function _callee(t,r){return c.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:if(!(t instanceof u.Ref)){o.next=2;break}return o.abrupt("return",this.fetchAsync(t,r));case 2:return o.abrupt("return",t);case 3:case"end":return o.stop()}}),_callee,this)}))),function fetchIfRefAsync(t,o){return r.apply(this,arguments)})},{key:"fetchAsync",value:(t=_asyncToGenerator(c.default.mark((function _callee2(t,r){return c.default.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:o.prev=0;return o.abrupt("return",this.fetch(t,r));case 4:o.prev=4;o.t0=o.catch(0);if(o.t0 instanceof h.MissingDataException){o.next=8;break}throw o.t0;case 8:o.next=10;return this.pdfManager.requestRange(o.t0.begin,o.t0.end);case 10:return o.abrupt("return",this.fetchAsync(t,r));case 11:case"end":return o.stop()}}),_callee2,this,[[0,4]])}))),function fetchAsync(r,o){return t.apply(this,arguments)})},{key:"getCatalogObj",value:function getCatalogObj(){return this.root}}]);var t,r;return XRef}();r.XRef=y},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MessageHandler=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4);function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var u=1,h=2,d=1,g=2,m=3,y=4,v=5,k=6,_=7,w=8;function wrapReason(t){t instanceof Error||"object"===_typeof(t)&&null!==t||(0,l.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(t.name){case"AbortException":return new l.AbortException(t.message);case"MissingPDFException":return new l.MissingPDFException(t.message);case"PasswordException":return new l.PasswordException(t.message,t.code);case"UnexpectedResponseException":return new l.UnexpectedResponseException(t.message,t.status);case"UnknownErrorException":return new l.UnknownErrorException(t.message,t.details);default:return new l.UnknownErrorException(t.message,t.toString())}}var S=function(){function MessageHandler(t,r,o){var c=this;!function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,MessageHandler);this.sourceName=t;this.targetName=r;this.comObj=o;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=function(t){var r=t.data;if(r.targetName===c.sourceName)if(r.stream)c._processStreamMessage(r);else if(r.callback){var l=r.callbackId,d=c.callbackCapabilities[l];if(!d)throw new Error("Cannot resolve callback ".concat(l));delete c.callbackCapabilities[l];if(r.callback===u)d.resolve(r.data);else{if(r.callback!==h)throw new Error("Unexpected callback case");d.reject(wrapReason(r.reason))}}else{var g=c.actionHandler[r.action];if(!g)throw new Error("Unknown action from worker: ".concat(r.action));if(r.callbackId){var m=c.sourceName,y=r.sourceName;new Promise((function(t){t(g(r.data))})).then((function(t){o.postMessage({sourceName:m,targetName:y,callback:u,callbackId:r.callbackId,data:t})}),(function(t){o.postMessage({sourceName:m,targetName:y,callback:h,callbackId:r.callbackId,reason:wrapReason(t)})}))}else r.streamId?c._createStreamSink(r):g(r.data)}};o.addEventListener("message",this._onComObjOnMessage)}!function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}(MessageHandler,[{key:"on",value:function on(t,r){var o=this.actionHandler;if(o[t])throw new Error('There is already an actionName called "'.concat(t,'"'));o[t]=r}},{key:"send",value:function send(t,r,o){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:r},o)}},{key:"sendWithPromise",value:function sendWithPromise(t,r,o){var c=this.callbackId++,u=(0,l.createPromiseCapability)();this.callbackCapabilities[c]=u;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:c,data:r},o)}catch(t){u.reject(t)}return u.promise}},{key:"sendWithStream",value:function sendWithStream(t,r,o,c){var u=this,h=this.streamId++,g=this.sourceName,m=this.targetName,y=this.comObj;return new ReadableStream({start:function start(o){var d=(0,l.createPromiseCapability)();u.streamControllers[h]={controller:o,startCall:d,pullCall:null,cancelCall:null,isClosed:!1};y.postMessage({sourceName:g,targetName:m,action:t,streamId:h,data:r,desiredSize:o.desiredSize},c);return d.promise},pull:function pull(t){var r=(0,l.createPromiseCapability)();u.streamControllers[h].pullCall=r;y.postMessage({sourceName:g,targetName:m,stream:k,streamId:h,desiredSize:t.desiredSize});return r.promise},cancel:function cancel(t){(0,l.assert)(t instanceof Error,"cancel must have a valid reason");var r=(0,l.createPromiseCapability)();u.streamControllers[h].cancelCall=r;u.streamControllers[h].isClosed=!0;y.postMessage({sourceName:g,targetName:m,stream:d,streamId:h,reason:wrapReason(t)});return r.promise}},o)}},{key:"_createStreamSink",value:function _createStreamSink(t){var r=t.streamId,o=this.sourceName,c=t.sourceName,u=this.comObj,h=this,d=this.actionHandler[t.action],g={enqueue:function enqueue(t){var h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,d=arguments.length>2?arguments[2]:void 0;if(!this.isCancelled){var g=this.desiredSize;this.desiredSize-=h;if(g>0&&this.desiredSize<=0){this.sinkCapability=(0,l.createPromiseCapability)();this.ready=this.sinkCapability.promise}u.postMessage({sourceName:o,targetName:c,stream:y,streamId:r,chunk:t},d)}},close:function close(){if(!this.isCancelled){this.isCancelled=!0;u.postMessage({sourceName:o,targetName:c,stream:m,streamId:r});delete h.streamSinks[r]}},error:function error(t){(0,l.assert)(t instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;u.postMessage({sourceName:o,targetName:c,stream:v,streamId:r,reason:wrapReason(t)})}},sinkCapability:(0,l.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};g.sinkCapability.resolve();g.ready=g.sinkCapability.promise;this.streamSinks[r]=g;new Promise((function(r){r(d(t.data,g))})).then((function(){u.postMessage({sourceName:o,targetName:c,stream:w,streamId:r,success:!0})}),(function(t){u.postMessage({sourceName:o,targetName:c,stream:w,streamId:r,reason:wrapReason(t)})}))}},{key:"_processStreamMessage",value:function _processStreamMessage(t){var r=t.streamId,o=this.sourceName,c=t.sourceName,u=this.comObj,h=this.streamControllers[r],S=this.streamSinks[r];switch(t.stream){case w:t.success?h.startCall.resolve():h.startCall.reject(wrapReason(t.reason));break;case _:t.success?h.pullCall.resolve():h.pullCall.reject(wrapReason(t.reason));break;case k:if(!S){u.postMessage({sourceName:o,targetName:c,stream:_,streamId:r,success:!0});break}S.desiredSize<=0&&t.desiredSize>0&&S.sinkCapability.resolve();S.desiredSize=t.desiredSize;new Promise((function(t){t(S.onPull&&S.onPull())})).then((function(){u.postMessage({sourceName:o,targetName:c,stream:_,streamId:r,success:!0})}),(function(t){u.postMessage({sourceName:o,targetName:c,stream:_,streamId:r,reason:wrapReason(t)})}));break;case y:(0,l.assert)(h,"enqueue should have stream controller");if(h.isClosed)break;h.controller.enqueue(t.chunk);break;case m:(0,l.assert)(h,"close should have stream controller");if(h.isClosed)break;h.isClosed=!0;h.controller.close();this._deleteStreamController(h,r);break;case v:(0,l.assert)(h,"error should have stream controller");h.controller.error(wrapReason(t.reason));this._deleteStreamController(h,r);break;case g:t.success?h.cancelCall.resolve():h.cancelCall.reject(wrapReason(t.reason));this._deleteStreamController(h,r);break;case d:if(!S)break;new Promise((function(r){r(S.onCancel&&S.onCancel(wrapReason(t.reason)))})).then((function(){u.postMessage({sourceName:o,targetName:c,stream:g,streamId:r,success:!0})}),(function(t){u.postMessage({sourceName:o,targetName:c,stream:g,streamId:r,reason:wrapReason(t)})}));S.sinkCapability.reject(wrapReason(t.reason));S.isCancelled=!0;delete this.streamSinks[r];break;default:throw new Error("Unexpected stream case")}}},{key:"_deleteStreamController",value:(t=function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}(c.default.mark((function _callee(t,r){return c.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return Promise.allSettled([t.startCall&&t.startCall.promise,t.pullCall&&t.pullCall.promise,t.cancelCall&&t.cancelCall.promise]);case 2:delete this.streamControllers[r];case 3:case"end":return o.stop()}}),_callee,this)}))),function _deleteStreamController(r,o){return t.apply(this,arguments)})},{key:"destroy",value:function destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}]);var t;return MessageHandler}();r.MessageHandler=S},(t,r,o)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.PDFWorkerStream=void 0;var c=function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}(o(2)),l=o(4);function asyncGeneratorStep(t,r,o,c,l,u,h){try{var d=t[u](h),g=d.value}catch(t){o(t);return}d.done?r(g):Promise.resolve(g).then(c,l)}function _asyncToGenerator(t){return function(){var r=this,o=arguments;return new Promise((function(c,l){var u=t.apply(r,o);function _next(t){asyncGeneratorStep(u,c,l,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,c,l,_next,_throw,"throw",t)}_next(void 0)}))}}function _createForOfIteratorHelper(t,r){var o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(t,r){if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,r);var o=Object.prototype.toString.call(t).slice(8,-1);"Object"===o&&t.constructor&&(o=t.constructor.name);if("Map"===o||"Set"===o)return Array.from(t);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _arrayLikeToArray(t,r)}(t))||r&&t&&"number"==typeof t.length){o&&(t=o);var c=0,l=function F(){};return{s:l,n:function n(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function e(t){throw t},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,h=!0,d=!1;return{s:function s(){o=o.call(t)},n:function n(){var t=o.next();h=t.done;return t},e:function e(t){d=!0;u=t},f:function f(){try{h||null==o.return||o.return()}finally{if(d)throw u}}}}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var o=0,c=new Array(r);o<r;o++)c[o]=t[o];return c}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var o=0;o<r.length;o++){var c=r[o];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(t,c.key,c)}}function _createClass(t,r,o){r&&_defineProperties(t.prototype,r);o&&_defineProperties(t,o);Object.defineProperty(t,"prototype",{writable:!1});return t}var u=function(){function PDFWorkerStream(t){_classCallCheck(this,PDFWorkerStream);this._msgHandler=t;this._contentLength=null;this._fullRequestReader=null;this._rangeRequestReaders=[]}_createClass(PDFWorkerStream,[{key:"getFullReader",value:function getFullReader(){(0,l.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once.");this._fullRequestReader=new h(this._msgHandler);return this._fullRequestReader}},{key:"getRangeReader",value:function getRangeReader(t,r){var o=new d(t,r,this._msgHandler);this._rangeRequestReaders.push(o);return o}},{key:"cancelAllRequests",value:function cancelAllRequests(t){this._fullRequestReader&&this._fullRequestReader.cancel(t);var r,o=_createForOfIteratorHelper(this._rangeRequestReaders.slice(0));try{for(o.s();!(r=o.n()).done;){r.value.cancel(t)}}catch(t){o.e(t)}finally{o.f()}}}]);return PDFWorkerStream}();r.PDFWorkerStream=u;var h=function(){function PDFWorkerStreamReader(t){var r=this;_classCallCheck(this,PDFWorkerStreamReader);this._msgHandler=t;this.onProgress=null;this._contentLength=null;this._isRangeSupported=!1;this._isStreamingSupported=!1;var o=this._msgHandler.sendWithStream("GetReader");this._reader=o.getReader();this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((function(t){r._isStreamingSupported=t.isStreamingSupported;r._isRangeSupported=t.isRangeSupported;r._contentLength=t.contentLength}))}_createClass(PDFWorkerStreamReader,[{key:"headersReady",get:function get(){return this._headersReady}},{key:"contentLength",get:function get(){return this._contentLength}},{key:"isStreamingSupported",get:function get(){return this._isStreamingSupported}},{key:"isRangeSupported",get:function get(){return this._isRangeSupported}},{key:"read",value:(t=_asyncToGenerator(c.default.mark((function _callee(){var t,r;return c.default.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._reader.read();case 2:t=o.sent;r=t.value;if(!t.done){o.next=7;break}return o.abrupt("return",{value:void 0,done:!0});case 7:return o.abrupt("return",{value:r.buffer,done:!1});case 8:case"end":return o.stop()}}),_callee,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._reader.cancel(t)}}]);var t;return PDFWorkerStreamReader}(),d=function(){function PDFWorkerStreamRangeReader(t,r,o){_classCallCheck(this,PDFWorkerStreamRangeReader);this._msgHandler=o;this.onProgress=null;var c=this._msgHandler.sendWithStream("GetRangeReader",{begin:t,end:r});this._reader=c.getReader()}_createClass(PDFWorkerStreamRangeReader,[{key:"isStreamingSupported",get:function get(){return!1}},{key:"read",value:(t=_asyncToGenerator(c.default.mark((function _callee2(){var t,r;return c.default.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:o.next=2;return this._reader.read();case 2:t=o.sent;r=t.value;if(!t.done){o.next=7;break}return o.abrupt("return",{value:void 0,done:!0});case 7:return o.abrupt("return",{value:r.buffer,done:!1});case 8:case"end":return o.stop()}}),_callee2,this)}))),function read(){return t.apply(this,arguments)})},{key:"cancel",value:function cancel(t){this._reader.cancel(t)}}]);var t;return PDFWorkerStreamRangeReader}()}],r={};function __w_pdfjs_require__(o){var c=r[o];if(void 0!==c)return c.exports;var l=r[o]={id:o,loaded:!1,exports:{}};t[o](l,l.exports,__w_pdfjs_require__);l.loaded=!0;return l.exports}__w_pdfjs_require__.d=(t,r)=>{for(var o in r)__w_pdfjs_require__.o(r,o)&&!__w_pdfjs_require__.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})};__w_pdfjs_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r);__w_pdfjs_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});Object.defineProperty(t,"__esModule",{value:!0})};__w_pdfjs_require__.nmd=t=>{t.paths=[];t.children||(t.children=[]);return t};var o={};(()=>{"use strict";var t=o;Object.defineProperty(t,"__esModule",{value:!0});Object.defineProperty(t,"WorkerMessageHandler",{enumerable:!0,get:function get(){return r.WorkerMessageHandler}});var r=__w_pdfjs_require__(1)})();return o})()}));\ No newline at end of file+!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("pdfjs-dist/build/pdf.worker",[],t):"object"==typeof exports?exports["pdfjs-dist/build/pdf.worker"]=t():e["pdfjs-dist/build/pdf.worker"]=e.pdfjsWorker=t()}(globalThis,(()=>(()=>{var e=[,(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.WorkerTask=t.WorkerMessageHandler=void 0;var a=r(2),n=r(133),i=r(134),s=r(136),o=r(199),c=r(193),l=r(4),h=r(230),u=r(231);class WorkerTask{constructor(e){this.name=e;this.terminated=!1;this._capability=(0,a.createPromiseCapability)()}get finished(){return this._capability.promise}finish(){this._capability.resolve()}terminate(){this.terminated=!0}ensureNotTerminated(){if(this.terminated)throw new Error("Worker task was terminated")}}t.WorkerTask=WorkerTask;class WorkerMessageHandler{static setup(e,t){let r=!1;e.on("test",(function wphSetupTest(t){if(!r){r=!0;e.send("test",t instanceof Uint8Array)}}));e.on("configure",(function wphConfigure(e){(0,a.setVerbosityLevel)(e.verbosity)}));e.on("GetDocRequest",(function wphSetupDoc(e){return WorkerMessageHandler.createDocumentHandler(e,t)}))}static createDocumentHandler(e,t){let r,d=!1,f=null;const g=[],p=(0,a.getVerbosityLevel)(),m=e.apiVersion,b="3.0.150";if(m!==b)throw new Error(`The API version "${m}" does not match the Worker version "3.0.150".`);const y=[];for(const e in[])y.push(e);if(y.length)throw new Error("The `Array.prototype` contains unexpected enumerable properties: "+y.join(", ")+"; thus breaking e.g. `for...in` iteration of `Array`s.");if("undefined"==typeof ReadableStream){const e="The browser/environment lacks native support for critical functionality used by the PDF.js library (e.g. `ReadableStream`); ";if(l.isNodeJS)throw new Error(e+"please use a `legacy`-build instead.");throw new Error(e+"please update to a supported browser.")}const w=e.docId,S=e.docBaseUrl,x=e.docId+"_worker";let k=new h.MessageHandler(x,w,t);function ensureNotTerminated(){if(d)throw new Error("Worker was terminated")}function startWorkerTask(e){g.push(e)}function finishWorkerTask(e){e.finish();const t=g.indexOf(e);g.splice(t,1)}async function loadDocument(e){await r.ensureDoc("checkHeader");await r.ensureDoc("parseStartXRef");await r.ensureDoc("parse",[e]);await r.ensureDoc("checkFirstPage",[e]);await r.ensureDoc("checkLastPage",[e]);const t=await r.ensureDoc("isPureXfa");if(t){const e=new WorkerTask("loadXfaFonts");startWorkerTask(e);await Promise.all([r.loadXfaFonts(k,e).catch((e=>{})).then((()=>finishWorkerTask(e))),r.loadXfaImages()])}const[a,n]=await Promise.all([r.ensureDoc("numPages"),r.ensureDoc("fingerprints")]);return{numPages:a,fingerprints:n,htmlForXfa:t?await r.ensureDoc("htmlForXfa"):null}}function getPdfManager(e,t,r){const n=(0,a.createPromiseCapability)();let i;const o=e.source;if(o.data){try{i=new s.LocalPdfManager(w,o.data,o.password,k,t,r,S);n.resolve(i)}catch(e){n.reject(e)}return n.promise}let c,l=[];try{c=new u.PDFWorkerStream(k)}catch(e){n.reject(e);return n.promise}const h=c.getFullReader();h.headersReady.then((function(){if(!h.isRangeSupported)return;const e=o.disableAutoFetch||h.isStreamingSupported;i=new s.NetworkPdfManager(w,c,{msgHandler:k,password:o.password,length:h.contentLength,disableAutoFetch:e,rangeChunkSize:o.rangeChunkSize},t,r,S);for(const e of l)i.sendProgressiveData(e);l=[];n.resolve(i);f=null})).catch((function(e){n.reject(e);f=null}));let d=0;new Promise((function(e,c){const readChunk=function(e){let{value:u,done:g}=e;try{ensureNotTerminated();if(g){i||function(){const e=(0,a.arraysToBytes)(l);o.length&&e.length!==o.length&&(0,a.warn)("reported HTTP length is different from actual");try{i=new s.LocalPdfManager(w,e,o.password,k,t,r,S);n.resolve(i)}catch(e){n.reject(e)}l=[]}();f=null;return}d+=(0,a.arrayByteLength)(u);h.isStreamingSupported||k.send("DocProgress",{loaded:d,total:Math.max(d,h.contentLength||0)});i?i.sendProgressiveData(u):l.push(u);h.read().then(readChunk,c)}catch(e){c(e)}};h.read().then(readChunk,c)})).catch((function(e){n.reject(e);f=null}));f=function(e){c.cancelAllRequests(e)};return n.promise}k.on("GetPage",(function wphSetupGetPage(e){return r.getPage(e.pageIndex).then((function(e){return Promise.all([r.ensure(e,"rotate"),r.ensure(e,"ref"),r.ensure(e,"userUnit"),r.ensure(e,"view")]).then((function(e){let[t,r,a,n]=e;return{rotate:t,ref:r,userUnit:a,view:n}}))}))}));k.on("GetPageIndex",(function wphSetupGetPageIndex(e){const t=n.Ref.get(e.num,e.gen);return r.ensureCatalog("getPageIndex",[t])}));k.on("GetDestinations",(function wphSetupGetDestinations(e){return r.ensureCatalog("destinations")}));k.on("GetDestination",(function wphSetupGetDestination(e){return r.ensureCatalog("getDestination",[e.id])}));k.on("GetPageLabels",(function wphSetupGetPageLabels(e){return r.ensureCatalog("pageLabels")}));k.on("GetPageLayout",(function wphSetupGetPageLayout(e){return r.ensureCatalog("pageLayout")}));k.on("GetPageMode",(function wphSetupGetPageMode(e){return r.ensureCatalog("pageMode")}));k.on("GetViewerPreferences",(function(e){return r.ensureCatalog("viewerPreferences")}));k.on("GetOpenAction",(function(e){return r.ensureCatalog("openAction")}));k.on("GetAttachments",(function wphSetupGetAttachments(e){return r.ensureCatalog("attachments")}));k.on("GetJavaScript",(function wphSetupGetJavaScript(e){return r.ensureCatalog("javaScript")}));k.on("GetDocJSActions",(function wphSetupGetDocJSActions(e){return r.ensureCatalog("jsActions")}));k.on("GetPageJSActions",(function(e){let{pageIndex:t}=e;return r.getPage(t).then((function(e){return r.ensure(e,"jsActions")}))}));k.on("GetOutline",(function wphSetupGetOutline(e){return r.ensureCatalog("documentOutline")}));k.on("GetOptionalContentConfig",(function(e){return r.ensureCatalog("optionalContentConfig")}));k.on("GetPermissions",(function(e){return r.ensureCatalog("permissions")}));k.on("GetMetadata",(function wphSetupGetMetadata(e){return Promise.all([r.ensureDoc("documentInfo"),r.ensureCatalog("metadata")])}));k.on("GetMarkInfo",(function wphSetupGetMarkInfo(e){return r.ensureCatalog("markInfo")}));k.on("GetData",(function wphSetupGetData(e){r.requestLoadedStream();return r.onLoadedStream().then((function(e){return e.bytes}))}));k.on("GetAnnotations",(function(e){let{pageIndex:t,intent:a}=e;return r.getPage(t).then((function(e){const r=new WorkerTask(`GetAnnotations: page ${t}`);startWorkerTask(r);return e.getAnnotationsData(k,r,a).then((e=>{finishWorkerTask(r);return e}),(e=>{finishWorkerTask(r)}))}))}));k.on("GetFieldObjects",(function(e){return r.ensureDoc("fieldObjects")}));k.on("HasJSActions",(function(e){return r.ensureDoc("hasJSActions")}));k.on("GetCalculationOrderIds",(function(e){return r.ensureDoc("calculationOrderIds")}));k.on("SaveDocument",(function(e){let{isPureXfa:t,numPages:s,annotationStorage:o,filename:l}=e;r.requestLoadedStream();const h=t?null:(0,i.getNewAnnotationsMap)(o),u=[r.onLoadedStream(),r.ensureCatalog("acroForm"),r.ensureCatalog("acroFormRef"),r.ensureDoc("xref"),r.ensureDoc("startXRef")];if(h)for(const[e,t]of h)u.push(r.getPage(e).then((r=>{const a=new WorkerTask(`Save (editor): page ${e}`);return r.saveNewAnnotations(k,a,t).finally((function(){finishWorkerTask(a)}))})));if(t)u.push(r.serializeXfaData(o));else for(let e=0;e<s;e++)u.push(r.getPage(e).then((function(t){const r=new WorkerTask(`Save: page ${e}`);return t.save(k,r,o).finally((function(){finishWorkerTask(r)}))})));return Promise.all(u).then((function(e){let[r,i,s,o,h,...u]=e,d=[],f=null;if(t){f=u[0];if(!f)return r.bytes}else{d=u.flat(2);if(0===d.length)return r.bytes}const g=i instanceof n.Dict&&i.get("XFA")||null;let p=null,m=!1;if(Array.isArray(g)){for(let e=0,t=g.length;e<t;e+=2)if("datasets"===g[e]){p=g[e+1];s=null;m=!0}null===p&&(p=o.getNewRef())}else if(g){s=null;(0,a.warn)("Unsupported XFA type.")}let b=Object.create(null);if(o.trailer){const e=Object.create(null),t=o.trailer.get("Info")||null;t instanceof n.Dict&&t.forEach(((t,r)=>{"string"==typeof r&&(e[t]=(0,a.stringToPDFString)(r))}));b={rootRef:o.trailer.getRaw("Root")||null,encryptRef:o.trailer.getRaw("Encrypt")||null,newRef:o.getNewRef(),infoRef:o.trailer.getRaw("Info")||null,info:e,fileIds:o.trailer.get("ID")||null,startXRef:h,filename:l}}o.resetNewRef();return(0,c.incrementalUpdate)({originalData:r.bytes,xrefInfo:b,newRefs:d,xref:o,hasXfa:!!g,xfaDatasetsRef:p,hasXfaDatasetsEntry:m,acroFormRef:s,acroForm:i,xfaData:f})}))}));k.on("GetOperatorList",(function wphSetupRenderPage(e,t){const n=e.pageIndex;r.getPage(n).then((function(r){const i=new WorkerTask(`GetOperatorList: page ${n}`);startWorkerTask(i);const s=p>=a.VerbosityLevel.INFOS?Date.now():0;r.getOperatorList({handler:k,sink:t,task:i,intent:e.intent,cacheKey:e.cacheKey,annotationStorage:e.annotationStorage}).then((function(e){finishWorkerTask(i);s&&(0,a.info)(`page=${n+1} - getOperatorList: time=${Date.now()-s}ms, len=${e.length}`);t.close()}),(function(e){finishWorkerTask(i);if(!i.terminated){k.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorOperatorList});t.error(e)}}))}))}));k.on("GetTextContent",(function wphExtractText(e,t){const n=e.pageIndex;r.getPage(n).then((function(r){const i=new WorkerTask("GetTextContent: page "+n);startWorkerTask(i);const s=p>=a.VerbosityLevel.INFOS?Date.now():0;r.extractTextContent({handler:k,task:i,sink:t,includeMarkedContent:e.includeMarkedContent,combineTextItems:e.combineTextItems}).then((function(){finishWorkerTask(i);s&&(0,a.info)(`page=${n+1} - getTextContent: time=`+(Date.now()-s)+"ms");t.close()}),(function(e){finishWorkerTask(i);i.terminated||t.error(e)}))}))}));k.on("GetStructTree",(function wphGetStructTree(e){return r.getPage(e.pageIndex).then((function(e){return r.ensure(e,"getStructTree")}))}));k.on("FontFallback",(function(e){return r.fontFallback(e.id,k)}));k.on("Cleanup",(function wphCleanup(e){return r.cleanup(!0)}));k.on("Terminate",(function wphTerminate(e){d=!0;const t=[];if(r){r.terminate(new a.AbortException("Worker was terminated."));const e=r.cleanup();t.push(e);r=null}else(0,o.clearGlobalCaches)();f&&f(new a.AbortException("Worker was terminated."));for(const e of g){t.push(e.finished);e.terminate()}return Promise.all(t).then((function(){k.destroy();k=null}))}));k.on("Ready",(function wphReady(t){!function setupDoc(e){function onSuccess(e){ensureNotTerminated();k.send("GetDoc",{pdfInfo:e})}function onFailure(e){ensureNotTerminated();if(e instanceof a.PasswordException){const t=new WorkerTask(`PasswordException: response ${e.code}`);startWorkerTask(t);k.sendWithPromise("PasswordRequest",e).then((function(e){let{password:a}=e;finishWorkerTask(t);r.updatePassword(a);pdfManagerReady()})).catch((function(){finishWorkerTask(t);k.send("DocException",e)}))}else e instanceof a.InvalidPDFException||e instanceof a.MissingPDFException||e instanceof a.UnexpectedResponseException||e instanceof a.UnknownErrorException?k.send("DocException",e):k.send("DocException",new a.UnknownErrorException(e.message,e.toString()))}function pdfManagerReady(){ensureNotTerminated();loadDocument(!1).then(onSuccess,(function(e){ensureNotTerminated();if(e instanceof i.XRefParseException){r.requestLoadedStream();r.onLoadedStream().then((function(){ensureNotTerminated();loadDocument(!0).then(onSuccess,onFailure)}))}else onFailure(e)}))}ensureNotTerminated();getPdfManager(e,{maxImageSize:e.maxImageSize,disableFontFace:e.disableFontFace,ignoreErrors:e.ignoreErrors,isEvalSupported:e.isEvalSupported,fontExtraProperties:e.fontExtraProperties,useSystemFonts:e.useSystemFonts,cMapUrl:e.cMapUrl,standardFontDataUrl:e.standardFontDataUrl},e.enableXfa).then((function(e){if(d){e.terminate(new a.AbortException("Worker was terminated."));throw new Error("Worker was terminated")}r=e;r.onLoadedStream().then((function(e){k.send("DataLoaded",{length:e.bytes.byteLength})}))})).then(pdfManagerReady,onFailure)}(e);e=null}));return x}static initializeFromPort(e){const t=new h.MessageHandler("worker","main",e);WorkerMessageHandler.setup(t,e);t.send("ready",null)}}t.WorkerMessageHandler=WorkerMessageHandler;"undefined"==typeof window&&!l.isNodeJS&&"undefined"!=typeof self&&function isMessagePort(e){return"function"==typeof e.postMessage&&"onmessage"in e}(self)&&WorkerMessageHandler.initializeFromPort(self)},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.VerbosityLevel=t.Util=t.UnknownErrorException=t.UnexpectedResponseException=t.UNSUPPORTED_FEATURES=t.TextRenderingMode=t.StreamType=t.RenderingIntentFlag=t.PermissionFlag=t.PasswordResponses=t.PasswordException=t.PageActionEventType=t.OPS=t.MissingPDFException=t.LINE_FACTOR=t.LINE_DESCENT_FACTOR=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FontType=t.FeatureTest=t.FONT_IDENTITY_MATRIX=t.DocumentActionEventType=t.CMapCompressionType=t.BaseException=t.AnnotationType=t.AnnotationStateModelType=t.AnnotationReviewState=t.AnnotationReplyType=t.AnnotationMode=t.AnnotationMarkedState=t.AnnotationFlag=t.AnnotationFieldFlag=t.AnnotationEditorType=t.AnnotationEditorPrefix=t.AnnotationEditorParamsType=t.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0;t.arrayByteLength=arrayByteLength;t.arraysToBytes=function arraysToBytes(e){const t=e.length;if(1===t&&e[0]instanceof Uint8Array)return e[0];let r=0;for(let a=0;a<t;a++)r+=arrayByteLength(e[a]);let a=0;const n=new Uint8Array(r);for(let r=0;r<t;r++){let t=e[r];t instanceof Uint8Array||(t="string"==typeof t?stringToBytes(t):new Uint8Array(t));const i=t.byteLength;n.set(t,a);a+=i}return n};t.assert=function assert(e,t){e||unreachable(t)};t.bytesToString=function bytesToString(e){"object"==typeof e&&null!==e&&void 0!==e.length||unreachable("Invalid argument for bytesToString");const t=e.length,r=8192;if(t<r)return String.fromCharCode.apply(null,e);const a=[];for(let n=0;n<t;n+=r){const i=Math.min(n+r,t),s=e.subarray(n,i);a.push(String.fromCharCode.apply(null,s))}return a.join("")};t.createPromiseCapability=function createPromiseCapability(){const e=Object.create(null);let t=!1;Object.defineProperty(e,"settled",{get:()=>t});e.promise=new Promise((function(r,a){e.resolve=function(e){t=!0;r(e)};e.reject=function(e){t=!0;a(e)}}));return e};t.createValidAbsoluteUrl=function createValidAbsoluteUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return null;try{if(r&&"string"==typeof e){if(r.addDefaultProtocol&&e.startsWith("www.")){const t=e.match(/\./g);t&&t.length>=2&&(e=`http://${e}`)}if(r.tryConvertEncoding)try{e=stringToUTF8String(e)}catch(e){}}const a=t?new URL(e,t):new URL(e);if(_isValidProtocol(a))return a}catch(e){}return null};t.escapeString=function escapeString(e){return e.replace(/([()\\\n\r])/g,(e=>"\n"===e?"\\n":"\r"===e?"\\r":`\\${e}`))};t.getModificationDate=function getModificationDate(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const t=[e.getUTCFullYear().toString(),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0"),e.getUTCHours().toString().padStart(2,"0"),e.getUTCMinutes().toString().padStart(2,"0"),e.getUTCSeconds().toString().padStart(2,"0")];return t.join("")};t.getVerbosityLevel=function getVerbosityLevel(){return n};t.info=function info(e){n>=a.INFOS&&console.log(`Info: ${e}`)};t.isArrayBuffer=function isArrayBuffer(e){return"object"==typeof e&&null!==e&&void 0!==e.byteLength};t.isArrayEqual=function isArrayEqual(e,t){if(e.length!==t.length)return!1;for(let r=0,a=e.length;r<a;r++)if(e[r]!==t[r])return!1;return!0};t.isAscii=function isAscii(e){return/^[\x00-\x7F]*$/.test(e)};t.objectFromMap=function objectFromMap(e){const t=Object.create(null);for(const[r,a]of e)t[r]=a;return t};t.objectSize=function objectSize(e){return Object.keys(e).length};t.setVerbosityLevel=function setVerbosityLevel(e){Number.isInteger(e)&&(n=e)};t.shadow=shadow;t.string32=function string32(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e)};t.stringToBytes=stringToBytes;t.stringToPDFString=function stringToPDFString(e){if(e[0]>="ï"){let t;"þ"===e[0]&&"ÿ"===e[1]?t="utf-16be":"ÿ"===e[0]&&"þ"===e[1]?t="utf-16le":"ï"===e[0]&&"»"===e[1]&&"¿"===e[2]&&(t="utf-8");if(t)try{const r=new TextDecoder(t,{fatal:!0}),a=stringToBytes(e);return r.decode(a)}catch(e){warn(`stringToPDFString: "${e}".`)}}const t=[];for(let r=0,a=e.length;r<a;r++){const a=o[e.charCodeAt(r)];t.push(a?String.fromCharCode(a):e.charAt(r))}return t.join("")};t.stringToUTF16BEString=function stringToUTF16BEString(e){const t=["þÿ"];for(let r=0,a=e.length;r<a;r++){const a=e.charCodeAt(r);t.push(String.fromCharCode(a>>8&255),String.fromCharCode(255&a))}return t.join("")};t.stringToUTF8String=stringToUTF8String;t.unreachable=unreachable;t.utf8StringToString=function utf8StringToString(e){return unescape(encodeURIComponent(e))};t.warn=warn;r(3);t.IDENTITY_MATRIX=[1,0,0,1,0,0];t.FONT_IDENTITY_MATRIX=[.001,0,0,.001,0,0];t.LINE_FACTOR=1.35;t.LINE_DESCENT_FACTOR=.35;t.RenderingIntentFlag={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};t.AnnotationMode={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};t.AnnotationEditorPrefix="pdfjs_internal_editor_";t.AnnotationEditorType={DISABLE:-1,NONE:0,FREETEXT:3,INK:15};t.AnnotationEditorParamsType={FREETEXT_SIZE:1,FREETEXT_COLOR:2,FREETEXT_OPACITY:3,INK_COLOR:11,INK_THICKNESS:12,INK_OPACITY:13};t.PermissionFlag={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};t.TextRenderingMode={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};t.ImageKind={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};t.AnnotationType={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};t.AnnotationStateModelType={MARKED:"Marked",REVIEW:"Review"};t.AnnotationMarkedState={MARKED:"Marked",UNMARKED:"Unmarked"};t.AnnotationReviewState={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};t.AnnotationReplyType={GROUP:"Group",REPLY:"R"};t.AnnotationFlag={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};t.AnnotationFieldFlag={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};t.AnnotationBorderStyleType={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};t.AnnotationActionEventType={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};t.DocumentActionEventType={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};t.PageActionEventType={O:"PageOpen",C:"PageClose"};t.StreamType={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};t.FontType={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};const a={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=a;t.CMapCompressionType={NONE:0,BINARY:1,STREAM:2};t.OPS={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotations:78,endAnnotations:79,beginAnnotation:80,endAnnotation:81,paintJpegXObject:82,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};t.UNSUPPORTED_FEATURES={unknown:"unknown",forms:"forms",javaScript:"javaScript",signatures:"signatures",smask:"smask",shadingPattern:"shadingPattern",font:"font",errorTilingPattern:"errorTilingPattern",errorExtGState:"errorExtGState",errorXObject:"errorXObject",errorFontLoadType3:"errorFontLoadType3",errorFontState:"errorFontState",errorFontMissing:"errorFontMissing",errorFontTranslate:"errorFontTranslate",errorColorSpace:"errorColorSpace",errorOperatorList:"errorOperatorList",errorFontToUnicode:"errorFontToUnicode",errorFontLoadNative:"errorFontLoadNative",errorFontBuildPath:"errorFontBuildPath",errorFontGetPath:"errorFontGetPath",errorMarkedContent:"errorMarkedContent",errorContentSubStream:"errorContentSubStream"};t.PasswordResponses={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let n=a.WARNINGS;function warn(e){n>=a.WARNINGS&&console.log(`Warning: ${e}`)}function unreachable(e){throw new Error(e)}function _isValidProtocol(e){if(!e)return!1;switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function shadow(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!1});return r}const i=function BaseExceptionClosure(){function BaseException(e,t){this.constructor===BaseException&&unreachable("Cannot initialize BaseException.");this.message=e;this.name=t}BaseException.prototype=new Error;BaseException.constructor=BaseException;return BaseException}();t.BaseException=i;t.PasswordException=class PasswordException extends i{constructor(e,t){super(e,"PasswordException");this.code=t}};t.UnknownErrorException=class UnknownErrorException extends i{constructor(e,t){super(e,"UnknownErrorException");this.details=t}};t.InvalidPDFException=class InvalidPDFException extends i{constructor(e){super(e,"InvalidPDFException")}};t.MissingPDFException=class MissingPDFException extends i{constructor(e){super(e,"MissingPDFException")}};t.UnexpectedResponseException=class UnexpectedResponseException extends i{constructor(e,t){super(e,"UnexpectedResponseException");this.status=t}};t.FormatError=class FormatError extends i{constructor(e){super(e,"FormatError")}};t.AbortException=class AbortException extends i{constructor(e){super(e,"AbortException")}};function stringToBytes(e){"string"!=typeof e&&unreachable("Invalid argument for stringToBytes");const t=e.length,r=new Uint8Array(t);for(let a=0;a<t;++a)r[a]=255&e.charCodeAt(a);return r}function arrayByteLength(e){if(void 0!==e.length)return e.length;if(void 0!==e.byteLength)return e.byteLength;unreachable("Invalid argument for arrayByteLength")}t.FeatureTest=class FeatureTest{static get isLittleEndian(){return shadow(this,"isLittleEndian",function isLittleEndian(){const e=new Uint8Array(4);e[0]=1;return 1===new Uint32Array(e.buffer,0,1)[0]}())}static get isEvalSupported(){return shadow(this,"isEvalSupported",function isEvalSupported(){try{new Function("");return!0}catch(e){return!1}}())}static get isOffscreenCanvasSupported(){return shadow(this,"isOffscreenCanvasSupported","undefined"!=typeof OffscreenCanvas)}};const s=[...Array(256).keys()].map((e=>e.toString(16).padStart(2,"0")));class Util{static makeHexColor(e,t,r){return`#${s[e]}${s[t]}${s[r]}`}static scaleMinMax(e,t){let r;if(e[0]){if(e[0]<0){r=t[0];t[0]=t[1];t[1]=r}t[0]*=e[0];t[1]*=e[0];if(e[3]<0){r=t[2];t[2]=t[3];t[3]=r}t[2]*=e[3];t[3]*=e[3]}else{r=t[0];t[0]=t[2];t[2]=r;r=t[1];t[1]=t[3];t[3]=r;if(e[1]<0){r=t[2];t[2]=t[3];t[3]=r}t[2]*=e[1];t[3]*=e[1];if(e[2]<0){r=t[0];t[0]=t[1];t[1]=r}t[0]*=e[2];t[1]*=e[2]}t[0]+=e[4];t[1]+=e[4];t[2]+=e[5];t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){return[e[0]*t[0]+e[1]*t[2]+t[4],e[0]*t[1]+e[1]*t[3]+t[5]]}static applyInverseTransform(e,t){const r=t[0]*t[3]-t[1]*t[2];return[(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r,(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r]}static getAxialAlignedBoundingBox(e,t){const r=Util.applyTransform(e,t),a=Util.applyTransform(e.slice(2,4),t),n=Util.applyTransform([e[0],e[3]],t),i=Util.applyTransform([e[2],e[1]],t);return[Math.min(r[0],a[0],n[0],i[0]),Math.min(r[1],a[1],n[1],i[1]),Math.max(r[0],a[0],n[0],i[0]),Math.max(r[1],a[1],n[1],i[1])]}static inverseTransform(e){const t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static apply3dTransform(e,t){return[e[0]*t[0]+e[1]*t[1]+e[2]*t[2],e[3]*t[0]+e[4]*t[1]+e[5]*t[2],e[6]*t[0]+e[7]*t[1]+e[8]*t[2]]}static singularValueDecompose2dScale(e){const t=[e[0],e[2],e[1],e[3]],r=e[0]*t[0]+e[1]*t[2],a=e[0]*t[1]+e[1]*t[3],n=e[2]*t[0]+e[3]*t[2],i=e[2]*t[1]+e[3]*t[3],s=(r+i)/2,o=Math.sqrt((r+i)**2-4*(r*i-n*a))/2,c=s+o||1,l=s-o||1;return[Math.sqrt(c),Math.sqrt(l)]}static normalizeRect(e){const t=e.slice(0);if(e[0]>e[2]){t[0]=e[2];t[2]=e[0]}if(e[1]>e[3]){t[1]=e[3];t[3]=e[1]}return t}static intersect(e,t){const r=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),a=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(r>a)return null;const n=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),i=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return n>i?null:[r,n,a,i]}static bezierBoundingBox(e,t,r,a,n,i,s,o){const c=[],l=[[],[]];let h,u,d,f,g,p,m,b;for(let l=0;l<2;++l){if(0===l){u=6*e-12*r+6*n;h=-3*e+9*r-9*n+3*s;d=3*r-3*e}else{u=6*t-12*a+6*i;h=-3*t+9*a-9*i+3*o;d=3*a-3*t}if(Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-d/u;0<f&&f<1&&c.push(f)}else{m=u*u-4*d*h;b=Math.sqrt(m);if(!(m<0)){g=(-u+b)/(2*h);0<g&&g<1&&c.push(g);p=(-u-b)/(2*h);0<p&&p<1&&c.push(p)}}}let y,w=c.length;const S=w;for(;w--;){f=c[w];y=1-f;l[0][w]=y*y*y*e+3*y*y*f*r+3*y*f*f*n+f*f*f*s;l[1][w]=y*y*y*t+3*y*y*f*a+3*y*f*f*i+f*f*f*o}l[0][S]=e;l[1][S]=t;l[0][S+1]=s;l[1][S+1]=o;l[0].length=l[1].length=S+2;return[Math.min(...l[0]),Math.min(...l[1]),Math.max(...l[0]),Math.max(...l[1])]}}t.Util=Util;const o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,728,711,710,729,733,731,730,732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8226,8224,8225,8230,8212,8211,402,8260,8249,8250,8722,8240,8222,8220,8221,8216,8217,8218,8482,64257,64258,321,338,352,376,381,305,322,339,353,382,0,8364];function stringToUTF8String(e){return decodeURIComponent(escape(e))}},(e,t,r)=>{"use strict";var a=r(4);if(!globalThis._pdfjsCompatibilityChecked){globalThis._pdfjsCompatibilityChecked=!0;!function checkNodeBtoa(){!globalThis.btoa&&a.isNodeJS&&(globalThis.btoa=function(e){return Buffer.from(e,"binary").toString("base64")})}();!function checkNodeAtob(){!globalThis.atob&&a.isNodeJS&&(globalThis.atob=function(e){return Buffer.from(e,"base64").toString("binary")})}();!function checkDOMMatrix(){!globalThis.DOMMatrix&&a.isNodeJS&&(globalThis.DOMMatrix=require("dommatrix/dist/dommatrix.js"))}();!function checkReadableStream(){!globalThis.ReadableStream&&a.isNodeJS&&(globalThis.ReadableStream=require("web-streams-polyfill/dist/ponyfill.js").ReadableStream)}();!function checkArrayAt(){Array.prototype.at||r(5)}();!function checkTypedArrayAt(){Uint8Array.prototype.at||r(79)}();!function checkStructuredClone(){globalThis.structuredClone||r(89)}()}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isNodeJS=void 0;const r=!("object"!=typeof process||process+""!="[object process]"||process.versions.nw||process.versions.electron&&process.type&&"browser"!==process.type);t.isNodeJS=r},(e,t,r)=>{r(6);var a=r(78);e.exports=a("Array","at")},(e,t,r)=>{"use strict";var a=r(7),n=r(44),i=r(68),s=r(66),o=r(73);a({target:"Array",proto:!0},{at:function at(e){var t=n(this),r=i(t),a=s(e),o=a>=0?a:r+a;return o<0||o>=r?void 0:t[o]}});o("at")},(e,t,r)=>{var a=r(8),n=r(9).f,i=r(48),s=r(52),o=r(42),c=r(60),l=r(72);e.exports=function(e,t){var r,h,u,d,f,g=e.target,p=e.global,m=e.stat;if(r=p?a:m?a[g]||o(g,{}):(a[g]||{}).prototype)for(h in t){d=t[h];u=e.dontCallGetSet?(f=n(r,h))&&f.value:r[h];if(!l(p?h:g+(m?".":"#")+h,e.forced)&&void 0!==u){if(typeof d==typeof u)continue;c(d,u)}(e.sham||u&&u.sham)&&i(d,"sham",!0);s(r,h,d,e)}}},e=>{var check=function(e){return e&&e.Math==Math&&e};e.exports=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof global&&global)||function(){return this}()||Function("return this")()},(e,t,r)=>{var a=r(10),n=r(12),i=r(14),s=r(15),o=r(16),c=r(22),l=r(43),h=r(46),u=Object.getOwnPropertyDescriptor;t.f=a?u:function getOwnPropertyDescriptor(e,t){e=o(e);t=c(t);if(h)try{return u(e,t)}catch(e){}if(l(e,t))return s(!n(i.f,e,t),e[t])}},(e,t,r)=>{var a=r(11);e.exports=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},(e,t,r)=>{var a=r(13),n=Function.prototype.call;e.exports=a?n.bind(n):function(){return n.apply(n,arguments)}},(e,t,r)=>{var a=r(11);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},(e,t)=>{"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,n=a&&!r.call({1:2},1);t.f=n?function propertyIsEnumerable(e){var t=a(this,e);return!!t&&t.enumerable}:r},e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},(e,t,r)=>{var a=r(17),n=r(20);e.exports=function(e){return a(n(e))}},(e,t,r)=>{var a=r(18),n=r(11),i=r(19),s=Object,o=a("".split);e.exports=n((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?o(e,""):s(e)}:s},(e,t,r)=>{var a=r(13),n=Function.prototype,i=n.bind,s=n.call,o=a&&i.bind(s,s);e.exports=a?function(e){return e&&o(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},(e,t,r)=>{var a=r(18),n=a({}.toString),i=a("".slice);e.exports=function(e){return i(n(e),8,-1)}},(e,t,r)=>{var a=r(21),n=TypeError;e.exports=function(e){if(a(e))throw n("Can't call method on "+e);return e}},e=>{e.exports=function(e){return null==e}},(e,t,r)=>{var a=r(23),n=r(27);e.exports=function(e){var t=a(e,"string");return n(t)?t:t+""}},(e,t,r)=>{var a=r(12),n=r(24),i=r(27),s=r(34),o=r(37),c=r(38),l=TypeError,h=c("toPrimitive");e.exports=function(e,t){if(!n(e)||i(e))return e;var r,c=s(e,h);if(c){void 0===t&&(t="default");r=a(c,e,t);if(!n(r)||i(r))return r;throw l("Can't convert object to primitive value")}void 0===t&&(t="number");return o(e,t)}},(e,t,r)=>{var a=r(25),n=r(26),i=n.all;e.exports=n.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:a(e)||e===i}:function(e){return"object"==typeof e?null!==e:a(e)}},(e,t,r)=>{var a=r(26),n=a.all;e.exports=a.IS_HTMLDDA?function(e){return"function"==typeof e||e===n}:function(e){return"function"==typeof e}},e=>{var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},(e,t,r)=>{var a=r(28),n=r(25),i=r(29),s=r(30),o=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return n(t)&&i(t.prototype,o(e))}},(e,t,r)=>{var a=r(8),n=r(25),aFunction=function(e){return n(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?aFunction(a[e]):a[e]&&a[e][t]}},(e,t,r)=>{var a=r(18);e.exports=a({}.isPrototypeOf)},(e,t,r)=>{var a=r(31);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},(e,t,r)=>{var a=r(32),n=r(11);e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},(e,t,r)=>{var a,n,i=r(8),s=r(33),o=i.process,c=i.Deno,l=o&&o.versions||c&&c.version,h=l&&l.v8;h&&(n=(a=h.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1]));!n&&s&&(!(a=s.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=s.match(/Chrome\/(\d+)/))&&(n=+a[1]);e.exports=n},(e,t,r)=>{var a=r(28);e.exports=a("navigator","userAgent")||""},(e,t,r)=>{var a=r(35),n=r(21);e.exports=function(e,t){var r=e[t];return n(r)?void 0:a(r)}},(e,t,r)=>{var a=r(25),n=r(36),i=TypeError;e.exports=function(e){if(a(e))return e;throw i(n(e)+" is not a function")}},e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},(e,t,r)=>{var a=r(12),n=r(25),i=r(24),s=TypeError;e.exports=function(e,t){var r,o;if("string"===t&&n(r=e.toString)&&!i(o=a(r,e)))return o;if(n(r=e.valueOf)&&!i(o=a(r,e)))return o;if("string"!==t&&n(r=e.toString)&&!i(o=a(r,e)))return o;throw s("Can't convert object to primitive value")}},(e,t,r)=>{var a=r(8),n=r(39),i=r(43),s=r(45),o=r(31),c=r(30),l=n("wks"),h=a.Symbol,u=h&&h.for,d=c?h:h&&h.withoutSetter||s;e.exports=function(e){if(!i(l,e)||!o&&"string"!=typeof l[e]){var t="Symbol."+e;o&&i(h,e)?l[e]=h[e]:l[e]=c&&u?u(t):d(t)}return l[e]}},(e,t,r)=>{var a=r(40),n=r(41);(e.exports=function(e,t){return n[e]||(n[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.25.3",mode:a?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.3/LICENSE",source:"https://github.com/zloirock/core-js"})},e=>{e.exports=!1},(e,t,r)=>{var a=r(8),n=r(42),i="__core-js_shared__",s=a[i]||n(i,{});e.exports=s},(e,t,r)=>{var a=r(8),n=Object.defineProperty;e.exports=function(e,t){try{n(a,e,{value:t,configurable:!0,writable:!0})}catch(r){a[e]=t}return t}},(e,t,r)=>{var a=r(18),n=r(44),i=a({}.hasOwnProperty);e.exports=Object.hasOwn||function hasOwn(e,t){return i(n(e),t)}},(e,t,r)=>{var a=r(20),n=Object;e.exports=function(e){return n(a(e))}},(e,t,r)=>{var a=r(18),n=0,i=Math.random(),s=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++n+i,36)}},(e,t,r)=>{var a=r(10),n=r(11),i=r(47);e.exports=!a&&!n((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},(e,t,r)=>{var a=r(8),n=r(24),i=a.document,s=n(i)&&n(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},(e,t,r)=>{var a=r(10),n=r(49),i=r(15);e.exports=a?function(e,t,r){return n.f(e,t,i(1,r))}:function(e,t,r){e[t]=r;return e}},(e,t,r)=>{var a=r(10),n=r(46),i=r(50),s=r(51),o=r(22),c=TypeError,l=Object.defineProperty,h=Object.getOwnPropertyDescriptor,u="enumerable",d="configurable",f="writable";t.f=a?i?function defineProperty(e,t,r){s(e);t=o(t);s(r);if("function"==typeof e&&"prototype"===t&&"value"in r&&f in r&&!r.writable){var a=h(e,t);if(a&&a.writable){e[t]=r.value;r={configurable:d in r?r.configurable:a.configurable,enumerable:u in r?r.enumerable:a.enumerable,writable:!1}}}return l(e,t,r)}:l:function defineProperty(e,t,r){s(e);t=o(t);s(r);if(n)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw c("Accessors not supported");"value"in r&&(e[t]=r.value);return e}},(e,t,r)=>{var a=r(10),n=r(11);e.exports=a&&n((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},(e,t,r)=>{var a=r(24),n=String,i=TypeError;e.exports=function(e){if(a(e))return e;throw i(n(e)+" is not an object")}},(e,t,r)=>{var a=r(25),n=r(49),i=r(53),s=r(42);e.exports=function(e,t,r,o){o||(o={});var c=o.enumerable,l=void 0!==o.name?o.name:t;a(r)&&i(r,l,o);if(o.global)c?e[t]=r:s(t,r);else{try{o.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:n.f(e,t,{value:r,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}},(e,t,r)=>{var a=r(11),n=r(25),i=r(43),s=r(10),o=r(54).CONFIGURABLE,c=r(55),l=r(56),h=l.enforce,u=l.get,d=Object.defineProperty,f=s&&!a((function(){return 8!==d((function(){}),"length",{value:8}).length})),g=String(String).split("String"),p=e.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]");r&&r.getter&&(t="get "+t);r&&r.setter&&(t="set "+t);(!i(e,"name")||o&&e.name!==t)&&(s?d(e,"name",{value:t,configurable:!0}):e.name=t);f&&r&&i(r,"arity")&&e.length!==r.arity&&d(e,"length",{value:r.arity});try{r&&i(r,"constructor")&&r.constructor?s&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=h(e);i(a,"source")||(a.source=g.join("string"==typeof t?t:""));return e};Function.prototype.toString=p((function toString(){return n(this)&&u(this).source||c(this)}),"toString")},(e,t,r)=>{var a=r(10),n=r(43),i=Function.prototype,s=a&&Object.getOwnPropertyDescriptor,o=n(i,"name"),c=o&&"something"===function something(){}.name,l=o&&(!a||a&&s(i,"name").configurable);e.exports={EXISTS:o,PROPER:c,CONFIGURABLE:l}},(e,t,r)=>{var a=r(18),n=r(25),i=r(41),s=a(Function.toString);n(i.inspectSource)||(i.inspectSource=function(e){return s(e)});e.exports=i.inspectSource},(e,t,r)=>{var a,n,i,s=r(57),o=r(8),c=r(18),l=r(24),h=r(48),u=r(43),d=r(41),f=r(58),g=r(59),p="Object already initialized",m=o.TypeError,b=o.WeakMap;if(s||d.state){var y=d.state||(d.state=new b),w=c(y.get),S=c(y.has),x=c(y.set);a=function(e,t){if(S(y,e))throw m(p);t.facade=e;x(y,e,t);return t};n=function(e){return w(y,e)||{}};i=function(e){return S(y,e)}}else{var k=f("state");g[k]=!0;a=function(e,t){if(u(e,k))throw m(p);t.facade=e;h(e,k,t);return t};n=function(e){return u(e,k)?e[k]:{}};i=function(e){return u(e,k)}}e.exports={set:a,get:n,has:i,enforce:function(e){return i(e)?n(e):a(e,{})},getterFor:function(e){return function(t){var r;if(!l(t)||(r=n(t)).type!==e)throw m("Incompatible receiver, "+e+" required");return r}}}},(e,t,r)=>{var a=r(8),n=r(25),i=a.WeakMap;e.exports=n(i)&&/native code/.test(String(i))},(e,t,r)=>{var a=r(39),n=r(45),i=a("keys");e.exports=function(e){return i[e]||(i[e]=n(e))}},e=>{e.exports={}},(e,t,r)=>{var a=r(43),n=r(61),i=r(9),s=r(49);e.exports=function(e,t,r){for(var o=n(t),c=s.f,l=i.f,h=0;h<o.length;h++){var u=o[h];a(e,u)||r&&a(r,u)||c(e,u,l(t,u))}}},(e,t,r)=>{var a=r(28),n=r(18),i=r(62),s=r(71),o=r(51),c=n([].concat);e.exports=a("Reflect","ownKeys")||function ownKeys(e){var t=i.f(o(e)),r=s.f;return r?c(t,r(e)):t}},(e,t,r)=>{var a=r(63),n=r(70).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return a(e,n)}},(e,t,r)=>{var a=r(18),n=r(43),i=r(16),s=r(64).indexOf,o=r(59),c=a([].push);e.exports=function(e,t){var r,a=i(e),l=0,h=[];for(r in a)!n(o,r)&&n(a,r)&&c(h,r);for(;t.length>l;)n(a,r=t[l++])&&(~s(h,r)||c(h,r));return h}},(e,t,r)=>{var a=r(16),n=r(65),i=r(68),createMethod=function(e){return function(t,r,s){var o,c=a(t),l=i(c),h=n(s,l);if(e&&r!=r){for(;l>h;)if((o=c[h++])!=o)return!0}else for(;l>h;h++)if((e||h in c)&&c[h]===r)return e||h||0;return!e&&-1}};e.exports={includes:createMethod(!0),indexOf:createMethod(!1)}},(e,t,r)=>{var a=r(66),n=Math.max,i=Math.min;e.exports=function(e,t){var r=a(e);return r<0?n(r+t,0):i(r,t)}},(e,t,r)=>{var a=r(67);e.exports=function(e){var t=+e;return t!=t||0===t?0:a(t)}},e=>{var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function trunc(e){var a=+e;return(a>0?r:t)(a)}},(e,t,r)=>{var a=r(69);e.exports=function(e){return a(e.length)}},(e,t,r)=>{var a=r(66),n=Math.min;e.exports=function(e){return e>0?n(a(e),9007199254740991):0}},e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},(e,t)=>{t.f=Object.getOwnPropertySymbols},(e,t,r)=>{var a=r(11),n=r(25),i=/#|\.prototype\./,isForced=function(e,t){var r=o[s(e)];return r==l||r!=c&&(n(t)?a(t):!!t)},s=isForced.normalize=function(e){return String(e).replace(i,".").toLowerCase()},o=isForced.data={},c=isForced.NATIVE="N",l=isForced.POLYFILL="P";e.exports=isForced},(e,t,r)=>{var a=r(38),n=r(74),i=r(49).f,s=a("unscopables"),o=Array.prototype;null==o[s]&&i(o,s,{configurable:!0,value:n(null)});e.exports=function(e){o[s][e]=!0}},(e,t,r)=>{var a,n=r(51),i=r(75),s=r(70),o=r(59),c=r(77),l=r(47),h=r(58),u=h("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return"<script>"+e+"</"+"script>"},NullProtoObjectViaActiveX=function(e){e.write(scriptTag(""));e.close();var t=e.parentWindow.Object;e=null;return t},NullProtoObject=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}NullProtoObject="undefined"!=typeof document?document.domain&&a?NullProtoObjectViaActiveX(a):function(){var e,t=l("iframe");t.style.display="none";c.appendChild(t);t.src=String("javascript:");(e=t.contentWindow.document).open();e.write(scriptTag("document.F=Object"));e.close();return e.F}():NullProtoObjectViaActiveX(a);for(var e=s.length;e--;)delete NullProtoObject.prototype[s[e]];return NullProtoObject()};o[u]=!0;e.exports=Object.create||function create(e,t){var r;if(null!==e){EmptyConstructor.prototype=n(e);r=new EmptyConstructor;EmptyConstructor.prototype=null;r[u]=e}else r=NullProtoObject();return void 0===t?r:i.f(r,t)}},(e,t,r)=>{var a=r(10),n=r(50),i=r(49),s=r(51),o=r(16),c=r(76);t.f=a&&!n?Object.defineProperties:function defineProperties(e,t){s(e);for(var r,a=o(t),n=c(t),l=n.length,h=0;l>h;)i.f(e,r=n[h++],a[r]);return e}},(e,t,r)=>{var a=r(63),n=r(70);e.exports=Object.keys||function keys(e){return a(e,n)}},(e,t,r)=>{var a=r(28);e.exports=a("document","documentElement")},(e,t,r)=>{var a=r(8),n=r(18);e.exports=function(e,t){return n(a[e].prototype[t])}},(e,t,r)=>{r(80)},(e,t,r)=>{"use strict";var a=r(81),n=r(68),i=r(66),s=a.aTypedArray;(0,a.exportTypedArrayMethod)("at",(function at(e){var t=s(this),r=n(t),a=i(e),o=a>=0?a:r+a;return o<0||o>=r?void 0:t[o]}))},(e,t,r)=>{"use strict";var a,n,i,s=r(82),o=r(10),c=r(8),l=r(25),h=r(24),u=r(43),d=r(83),f=r(36),g=r(48),p=r(52),m=r(49).f,b=r(29),y=r(85),w=r(87),S=r(38),x=r(45),k=r(56),C=k.enforce,v=k.get,O=c.Int8Array,T=O&&O.prototype,M=c.Uint8ClampedArray,E=M&&M.prototype,D=O&&y(O),N=T&&y(T),R=Object.prototype,L=c.TypeError,j=S("toStringTag"),$=x("TYPED_ARRAY_TAG"),_="TypedArrayConstructor",U=s&&!!w&&"Opera"!==d(c.opera),X=!1,H={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},q={BigInt64Array:8,BigUint64Array:8},getTypedArrayConstructor=function(e){var t=y(e);if(h(t)){var r=v(t);return r&&u(r,_)?r.TypedArrayConstructor:getTypedArrayConstructor(t)}},isTypedArray=function(e){if(!h(e))return!1;var t=d(e);return u(H,t)||u(q,t)};for(a in H)(i=(n=c[a])&&n.prototype)?C(i).TypedArrayConstructor=n:U=!1;for(a in q)(i=(n=c[a])&&n.prototype)&&(C(i).TypedArrayConstructor=n);if(!U||!l(D)||D===Function.prototype){D=function TypedArray(){throw L("Incorrect invocation")};if(U)for(a in H)c[a]&&w(c[a],D)}if(!U||!N||N===R){N=D.prototype;if(U)for(a in H)c[a]&&w(c[a].prototype,N)}U&&y(E)!==N&&w(E,N);if(o&&!u(N,j)){X=!0;m(N,j,{get:function(){return h(this)?this[$]:void 0}});for(a in H)c[a]&&g(c[a],$,a)}e.exports={NATIVE_ARRAY_BUFFER_VIEWS:U,TYPED_ARRAY_TAG:X&&$,aTypedArray:function(e){if(isTypedArray(e))return e;throw L("Target is not a typed array")},aTypedArrayConstructor:function(e){if(l(e)&&(!w||b(D,e)))return e;throw L(f(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,a){if(o){if(r)for(var n in H){var i=c[n];if(i&&u(i.prototype,e))try{delete i.prototype[e]}catch(r){try{i.prototype[e]=t}catch(e){}}}N[e]&&!r||p(N,e,r?t:U&&T[e]||t,a)}},exportTypedArrayStaticMethod:function(e,t,r){var a,n;if(o){if(w){if(r)for(a in H)if((n=c[a])&&u(n,e))try{delete n[e]}catch(e){}if(D[e]&&!r)return;try{return p(D,e,r?t:U&&D[e]||t)}catch(e){}}for(a in H)!(n=c[a])||n[e]&&!r||p(n,e,t)}},getTypedArrayConstructor:getTypedArrayConstructor,isView:function isView(e){if(!h(e))return!1;var t=d(e);return"DataView"===t||u(H,t)||u(q,t)},isTypedArray:isTypedArray,TypedArray:D,TypedArrayPrototype:N}},e=>{e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},(e,t,r)=>{var a=r(84),n=r(25),i=r(19),s=r(38)("toStringTag"),o=Object,c="Arguments"==i(function(){return arguments}());e.exports=a?i:function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=o(e),s))?r:c?i(t):"Object"==(a=i(t))&&n(t.callee)?"Arguments":a}},(e,t,r)=>{var a={};a[r(38)("toStringTag")]="z";e.exports="[object z]"===String(a)},(e,t,r)=>{var a=r(43),n=r(25),i=r(44),s=r(58),o=r(86),c=s("IE_PROTO"),l=Object,h=l.prototype;e.exports=o?l.getPrototypeOf:function(e){var t=i(e);if(a(t,c))return t[c];var r=t.constructor;return n(r)&&t instanceof r?r.prototype:t instanceof l?h:null}},(e,t,r)=>{var a=r(11);e.exports=!a((function(){function F(){}F.prototype.constructor=null;return Object.getPrototypeOf(new F)!==F.prototype}))},(e,t,r)=>{var a=r(18),n=r(51),i=r(88);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=a(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]);t=r instanceof Array}catch(e){}return function setPrototypeOf(r,a){n(r);i(a);t?e(r,a):r.__proto__=a;return r}}():void 0)},(e,t,r)=>{var a=r(25),n=String,i=TypeError;e.exports=function(e){if("object"==typeof e||a(e))return e;throw i("Can't set "+n(e)+" as a prototype")}},(e,t,r)=>{r(90);r(97);r(99);r(121);r(123);var a=r(132);e.exports=a.structuredClone},(e,t,r)=>{"use strict";var a=r(16),n=r(73),i=r(91),s=r(56),o=r(49).f,c=r(92),l=r(96),h=r(40),u=r(10),d="Array Iterator",f=s.set,g=s.getterFor(d);e.exports=c(Array,"Array",(function(e,t){f(this,{type:d,target:a(e),index:0,kind:t})}),(function(){var e=g(this),t=e.target,r=e.kind,a=e.index++;if(!t||a>=t.length){e.target=void 0;return l(void 0,!0)}return l("keys"==r?a:"values"==r?t[a]:[a,t[a]],!1)}),"values");var p=i.Arguments=i.Array;n("keys");n("values");n("entries");if(!h&&u&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(e){}},e=>{e.exports={}},(e,t,r)=>{"use strict";var a=r(7),n=r(12),i=r(40),s=r(54),o=r(25),c=r(93),l=r(85),h=r(87),u=r(95),d=r(48),f=r(52),g=r(38),p=r(91),m=r(94),b=s.PROPER,y=s.CONFIGURABLE,w=m.IteratorPrototype,S=m.BUGGY_SAFARI_ITERATORS,x=g("iterator"),k="keys",C="values",v="entries",returnThis=function(){return this};e.exports=function(e,t,r,s,g,m,O){c(r,t,s);var T,M,E,getIterationMethod=function(e){if(e===g&&j)return j;if(!S&&e in R)return R[e];switch(e){case k:return function keys(){return new r(this,e)};case C:return function values(){return new r(this,e)};case v:return function entries(){return new r(this,e)}}return function(){return new r(this)}},D=t+" Iterator",N=!1,R=e.prototype,L=R[x]||R["@@iterator"]||g&&R[g],j=!S&&L||getIterationMethod(g),$="Array"==t&&R.entries||L;if($&&(T=l($.call(new e)))!==Object.prototype&&T.next){i||l(T)===w||(h?h(T,w):o(T[x])||f(T,x,returnThis));u(T,D,!0,!0);i&&(p[D]=returnThis)}if(b&&g==C&&L&&L.name!==C)if(!i&&y)d(R,"name",C);else{N=!0;j=function values(){return n(L,this)}}if(g){M={values:getIterationMethod(C),keys:m?j:getIterationMethod(k),entries:getIterationMethod(v)};if(O)for(E in M)(S||N||!(E in R))&&f(R,E,M[E]);else a({target:t,proto:!0,forced:S||N},M)}i&&!O||R[x]===j||f(R,x,j,{name:g});p[t]=j;return M}},(e,t,r)=>{"use strict";var a=r(94).IteratorPrototype,n=r(74),i=r(15),s=r(95),o=r(91),returnThis=function(){return this};e.exports=function(e,t,r,c){var l=t+" Iterator";e.prototype=n(a,{next:i(+!c,r)});s(e,l,!1,!0);o[l]=returnThis;return e}},(e,t,r)=>{"use strict";var a,n,i,s=r(11),o=r(25),c=r(24),l=r(74),h=r(85),u=r(52),d=r(38),f=r(40),g=d("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(n=h(h(i)))!==Object.prototype&&(a=n):p=!0);!c(a)||s((function(){var e={};return a[g].call(e)!==e}))?a={}:f&&(a=l(a));o(a[g])||u(a,g,(function(){return this}));e.exports={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:p}},(e,t,r)=>{var a=r(49).f,n=r(43),i=r(38)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype);e&&!n(e,i)&&a(e,i,{configurable:!0,value:t})}},e=>{e.exports=function(e,t){return{value:e,done:t}}},(e,t,r)=>{var a=r(84),n=r(52),i=r(98);a||n(Object.prototype,"toString",i,{unsafe:!0})},(e,t,r)=>{"use strict";var a=r(84),n=r(83);e.exports=a?{}.toString:function toString(){return"[object "+n(this)+"]"}},(e,t,r)=>{r(100)},(e,t,r)=>{"use strict";r(101)("Map",(function(e){return function Map(){return e(this,arguments.length?arguments[0]:void 0)}}),r(118))},(e,t,r)=>{"use strict";var a=r(7),n=r(8),i=r(18),s=r(72),o=r(52),c=r(102),l=r(109),h=r(115),u=r(25),d=r(21),f=r(24),g=r(11),p=r(116),m=r(95),b=r(117);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),w=-1!==e.indexOf("Weak"),S=y?"set":"add",x=n[e],k=x&&x.prototype,C=x,v={},fixMethod=function(e){var t=i(k[e]);o(k,e,"add"==e?function add(e){t(this,0===e?0:e);return this}:"delete"==e?function(e){return!(w&&!f(e))&&t(this,0===e?0:e)}:"get"==e?function get(e){return w&&!f(e)?void 0:t(this,0===e?0:e)}:"has"==e?function has(e){return!(w&&!f(e))&&t(this,0===e?0:e)}:function set(e,r){t(this,0===e?0:e,r);return this})};if(s(e,!u(x)||!(w||k.forEach&&!g((function(){(new x).entries().next()}))))){C=r.getConstructor(t,e,y,S);c.enable()}else if(s(e,!0)){var O=new C,T=O[S](w?{}:-0,1)!=O,M=g((function(){O.has(1)})),E=p((function(e){new x(e)})),D=!w&&g((function(){for(var e=new x,t=5;t--;)e[S](t,t);return!e.has(-0)}));if(!E){(C=t((function(e,t){h(e,k);var r=b(new x,e,C);d(t)||l(t,r[S],{that:r,AS_ENTRIES:y});return r}))).prototype=k;k.constructor=C}if(M||D){fixMethod("delete");fixMethod("has");y&&fixMethod("get")}(D||T)&&fixMethod(S);w&&k.clear&&delete k.clear}v[e]=C;a({global:!0,constructor:!0,forced:C!=x},v);m(C,e);w||r.setStrong(C,e,y);return C}},(e,t,r)=>{var a=r(7),n=r(18),i=r(59),s=r(24),o=r(43),c=r(49).f,l=r(62),h=r(103),u=r(106),d=r(45),f=r(108),g=!1,p=d("meta"),m=0,setMetadata=function(e){c(e,p,{value:{objectID:"O"+m++,weakData:{}}})},b=e.exports={enable:function(){b.enable=function(){};g=!0;var e=l.f,t=n([].splice),r={};r[p]=1;if(e(r).length){l.f=function(r){for(var a=e(r),n=0,i=a.length;n<i;n++)if(a[n]===p){t(a,n,1);break}return a};a({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:h.f})}},fastKey:function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,p)){if(!u(e))return"F";if(!t)return"E";setMetadata(e)}return e[p].objectID},getWeakData:function(e,t){if(!o(e,p)){if(!u(e))return!0;if(!t)return!1;setMetadata(e)}return e[p].weakData},onFreeze:function(e){f&&g&&u(e)&&!o(e,p)&&setMetadata(e);return e}};i[p]=!0},(e,t,r)=>{var a=r(19),n=r(16),i=r(62).f,s=r(104),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function getOwnPropertyNames(e){return o&&"Window"==a(e)?function(e){try{return i(e)}catch(e){return s(o)}}(e):i(n(e))}},(e,t,r)=>{var a=r(65),n=r(68),i=r(105),s=Array,o=Math.max;e.exports=function(e,t,r){for(var c=n(e),l=a(t,c),h=a(void 0===r?c:r,c),u=s(o(h-l,0)),d=0;l<h;l++,d++)i(u,d,e[l]);u.length=d;return u}},(e,t,r)=>{"use strict";var a=r(22),n=r(49),i=r(15);e.exports=function(e,t,r){var s=a(t);s in e?n.f(e,s,i(0,r)):e[s]=r}},(e,t,r)=>{var a=r(11),n=r(24),i=r(19),s=r(107),o=Object.isExtensible,c=a((function(){o(1)}));e.exports=c||s?function isExtensible(e){return!!n(e)&&((!s||"ArrayBuffer"!=i(e))&&(!o||o(e)))}:o},(e,t,r)=>{var a=r(11);e.exports=a((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},(e,t,r)=>{var a=r(11);e.exports=!a((function(){return Object.isExtensible(Object.preventExtensions({}))}))},(e,t,r)=>{var a=r(110),n=r(12),i=r(51),s=r(36),o=r(111),c=r(68),l=r(29),h=r(112),u=r(113),d=r(114),f=TypeError,Result=function(e,t){this.stopped=e;this.result=t},g=Result.prototype;e.exports=function(e,t,r){var p,m,b,y,w,S,x,k=r&&r.that,C=!(!r||!r.AS_ENTRIES),v=!(!r||!r.IS_RECORD),O=!(!r||!r.IS_ITERATOR),T=!(!r||!r.INTERRUPTED),M=a(t,k),stop=function(e){p&&d(p,"normal",e);return new Result(!0,e)},callFn=function(e){if(C){i(e);return T?M(e[0],e[1],stop):M(e[0],e[1])}return T?M(e,stop):M(e)};if(v)p=e.iterator;else if(O)p=e;else{if(!(m=u(e)))throw f(s(e)+" is not iterable");if(o(m)){for(b=0,y=c(e);y>b;b++)if((w=callFn(e[b]))&&l(g,w))return w;return new Result(!1)}p=h(e,m)}S=v?e.next:p.next;for(;!(x=n(S,p)).done;){try{w=callFn(x.value)}catch(e){d(p,"throw",e)}if("object"==typeof w&&w&&l(g,w))return w}return new Result(!1)}},(e,t,r)=>{var a=r(18),n=r(35),i=r(13),s=a(a.bind);e.exports=function(e,t){n(e);return void 0===t?e:i?s(e,t):function(){return e.apply(t,arguments)}}},(e,t,r)=>{var a=r(38),n=r(91),i=a("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||s[i]===e)}},(e,t,r)=>{var a=r(12),n=r(35),i=r(51),s=r(36),o=r(113),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?o(e):t;if(n(r))return i(a(r,e));throw c(s(e)+" is not iterable")}},(e,t,r)=>{var a=r(83),n=r(34),i=r(21),s=r(91),o=r(38)("iterator");e.exports=function(e){if(!i(e))return n(e,o)||n(e,"@@iterator")||s[a(e)]}},(e,t,r)=>{var a=r(12),n=r(51),i=r(34);e.exports=function(e,t,r){var s,o;n(e);try{if(!(s=i(e,"return"))){if("throw"===t)throw r;return r}s=a(s,e)}catch(e){o=!0;s=e}if("throw"===t)throw r;if(o)throw s;n(s);return r}},(e,t,r)=>{var a=r(29),n=TypeError;e.exports=function(e,t){if(a(t,e))return e;throw n("Incorrect invocation")}},(e,t,r)=>{var a=r(38)("iterator"),n=!1;try{var i=0,s={next:function(){return{done:!!i++}},return:function(){n=!0}};s[a]=function(){return this};Array.from(s,(function(){throw 2}))}catch(e){}e.exports=function(e,t){if(!t&&!n)return!1;var r=!1;try{var i={};i[a]=function(){return{next:function(){return{done:r=!0}}}};e(i)}catch(e){}return r}},(e,t,r)=>{var a=r(25),n=r(24),i=r(87);e.exports=function(e,t,r){var s,o;i&&a(s=t.constructor)&&s!==r&&n(o=s.prototype)&&o!==r.prototype&&i(e,o);return e}},(e,t,r)=>{"use strict";var a=r(49).f,n=r(74),i=r(119),s=r(110),o=r(115),c=r(21),l=r(109),h=r(92),u=r(96),d=r(120),f=r(10),g=r(102).fastKey,p=r(56),m=p.set,b=p.getterFor;e.exports={getConstructor:function(e,t,r,h){var u=e((function(e,a){o(e,d);m(e,{type:t,index:n(null),first:void 0,last:void 0,size:0});f||(e.size=0);c(a)||l(a,e[h],{that:e,AS_ENTRIES:r})})),d=u.prototype,p=b(t),define=function(e,t,r){var a,n,i=p(e),s=getEntry(e,t);if(s)s.value=r;else{i.last=s={index:n=g(t,!0),key:t,value:r,previous:a=i.last,next:void 0,removed:!1};i.first||(i.first=s);a&&(a.next=s);f?i.size++:e.size++;"F"!==n&&(i.index[n]=s)}return e},getEntry=function(e,t){var r,a=p(e),n=g(t);if("F"!==n)return a.index[n];for(r=a.first;r;r=r.next)if(r.key==t)return r};i(d,{clear:function clear(){for(var e=p(this),t=e.index,r=e.first;r;){r.removed=!0;r.previous&&(r.previous=r.previous.next=void 0);delete t[r.index];r=r.next}e.first=e.last=void 0;f?e.size=0:this.size=0},delete:function(e){var t=this,r=p(t),a=getEntry(t,e);if(a){var n=a.next,i=a.previous;delete r.index[a.index];a.removed=!0;i&&(i.next=n);n&&(n.previous=i);r.first==a&&(r.first=n);r.last==a&&(r.last=i);f?r.size--:t.size--}return!!a},forEach:function forEach(e){for(var t,r=p(this),a=s(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;){a(t.value,t.key,this);for(;t&&t.removed;)t=t.previous}},has:function has(e){return!!getEntry(this,e)}});i(d,r?{get:function get(e){var t=getEntry(this,e);return t&&t.value},set:function set(e,t){return define(this,0===e?0:e,t)}}:{add:function add(e){return define(this,e=0===e?0:e,e)}});f&&a(d,"size",{get:function(){return p(this).size}});return u},setStrong:function(e,t,r){var a=t+" Iterator",n=b(t),i=b(a);h(e,t,(function(e,t){m(this,{type:a,target:e,state:n(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;if(!e.target||!(e.last=r=r?r.next:e.state.first)){e.target=void 0;return u(void 0,!0)}return u("keys"==t?r.key:"values"==t?r.value:[r.key,r.value],!1)}),r?"entries":"values",!r,!0);d(t)}}},(e,t,r)=>{var a=r(52);e.exports=function(e,t,r){for(var n in t)a(e,n,t[n],r);return e}},(e,t,r)=>{"use strict";var a=r(28),n=r(49),i=r(38),s=r(10),o=i("species");e.exports=function(e){var t=a(e),r=n.f;s&&t&&!t[o]&&r(t,o,{configurable:!0,get:function(){return this}})}},(e,t,r)=>{r(122)},(e,t,r)=>{"use strict";r(101)("Set",(function(e){return function Set(){return e(this,arguments.length?arguments[0]:void 0)}}),r(118))},(e,t,r)=>{var a,n=r(40),i=r(7),s=r(8),o=r(28),c=r(18),l=r(11),h=r(45),u=r(25),d=r(124),f=r(21),g=r(24),p=r(27),m=r(109),b=r(51),y=r(83),w=r(43),S=r(105),x=r(48),k=r(68),C=r(125),v=r(126),O=r(128),T=r(32),M=r(129),E=r(130),D=r(131),N=s.Object,R=s.Date,L=s.Error,j=s.EvalError,$=s.RangeError,_=s.ReferenceError,U=s.SyntaxError,X=s.TypeError,H=s.URIError,q=s.PerformanceMark,z=s.WebAssembly,W=z&&z.CompileError||L,G=z&&z.LinkError||L,V=z&&z.RuntimeError||L,K=o("DOMException"),Y=o("Set"),J=o("Map"),Z=J.prototype,Q=c(Z.has),ee=c(Z.get),te=c(Z.set),re=c(Y.prototype.add),ae=o("Object","keys"),ne=c([].push),ie=c((!0).valueOf),se=c(1..valueOf),oe=c("".valueOf),ce=c(R.prototype.getTime),le=h("structuredClone"),he="DataCloneError",ue="Transferring",checkBasicSemantic=function(e){return!l((function(){var t=new s.Set([7]),r=e(t),a=e(N(7));return r==t||!r.has(7)||"object"!=typeof a||7!=a}))&&e},checkErrorsCloning=function(e,t){return!l((function(){var r=new t,a=e({a:r,b:r});return!(a&&a.a===a.b&&a.a instanceof t&&a.a.stack===r.stack)}))},de=s.structuredClone,fe=n||!checkErrorsCloning(de,L)||!checkErrorsCloning(de,K)||!(a=de,!l((function(){var e=a(new s.AggregateError([1],le,{cause:3}));return"AggregateError"!=e.name||1!=e.errors[0]||e.message!=le||3!=e.cause}))),ge=!de&&checkBasicSemantic((function(e){return new q(le,{detail:e}).detail})),pe=checkBasicSemantic(de)||ge,throwUncloneable=function(e){throw new K("Uncloneable type: "+e,he)},throwUnpolyfillable=function(e,t){throw new K((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",he)},structuredCloneInternal=function(e,t){p(e)&&throwUncloneable("Symbol");if(!g(e))return e;if(t){if(Q(t,e))return ee(t,e)}else t=new J;var r,a,n,i,c,l,h,d,f,m,b=y(e),C=!1;switch(b){case"Array":n=[];C=!0;break;case"Object":n={};C=!0;break;case"Map":n=new J;C=!0;break;case"Set":n=new Y;C=!0;break;case"RegExp":n=new RegExp(e.source,v(e));break;case"Error":switch(a=e.name){case"AggregateError":n=o("AggregateError")([]);break;case"EvalError":n=j();break;case"RangeError":n=$();break;case"ReferenceError":n=_();break;case"SyntaxError":n=U();break;case"TypeError":n=X();break;case"URIError":n=H();break;case"CompileError":n=W();break;case"LinkError":n=G();break;case"RuntimeError":n=V();break;default:n=L()}C=!0;break;case"DOMException":n=new K(e.message,e.name);C=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":r=s[b];g(r)||throwUnpolyfillable(b);n=new r(structuredCloneInternal(e.buffer,t),e.byteOffset,"DataView"===b?e.byteLength:e.length);break;case"DOMQuad":try{n=new DOMQuad(structuredCloneInternal(e.p1,t),structuredCloneInternal(e.p2,t),structuredCloneInternal(e.p3,t),structuredCloneInternal(e.p4,t))}catch(t){pe?n=pe(e):throwUnpolyfillable(b)}break;case"FileList":if(i=function(){var e;try{e=new s.DataTransfer}catch(t){try{e=new s.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(c=0,l=k(e);c<l;c++)i.items.add(structuredCloneInternal(e[c],t));n=i.files}else pe?n=pe(e):throwUnpolyfillable(b);break;case"ImageData":try{n=new ImageData(structuredCloneInternal(e.data,t),e.width,e.height,{colorSpace:e.colorSpace})}catch(t){pe?n=pe(e):throwUnpolyfillable(b)}break;default:if(pe)n=pe(e);else switch(b){case"BigInt":n=N(e.valueOf());break;case"Boolean":n=N(ie(e));break;case"Number":n=N(se(e));break;case"String":n=N(oe(e));break;case"Date":n=new R(ce(e));break;case"ArrayBuffer":(r=s.DataView)||"function"==typeof e.slice||throwUnpolyfillable(b);try{if("function"==typeof e.slice)n=e.slice(0);else{l=e.byteLength;n=new ArrayBuffer(l);f=new r(e);m=new r(n);for(c=0;c<l;c++)m.setUint8(c,f.getUint8(c))}}catch(e){throw new K("ArrayBuffer is detached",he)}break;case"SharedArrayBuffer":n=e;break;case"Blob":try{n=e.slice(0,e.size,e.type)}catch(e){throwUnpolyfillable(b)}break;case"DOMPoint":case"DOMPointReadOnly":r=s[b];try{n=r.fromPoint?r.fromPoint(e):new r(e.x,e.y,e.z,e.w)}catch(e){throwUnpolyfillable(b)}break;case"DOMRect":case"DOMRectReadOnly":r=s[b];try{n=r.fromRect?r.fromRect(e):new r(e.x,e.y,e.width,e.height)}catch(e){throwUnpolyfillable(b)}break;case"DOMMatrix":case"DOMMatrixReadOnly":r=s[b];try{n=r.fromMatrix?r.fromMatrix(e):new r(e)}catch(e){throwUnpolyfillable(b)}break;case"AudioData":case"VideoFrame":u(e.clone)||throwUnpolyfillable(b);try{n=e.clone()}catch(e){throwUncloneable(b)}break;case"File":try{n=new File([e],e.name,e)}catch(e){throwUnpolyfillable(b)}break;case"CryptoKey":case"GPUCompilationMessage":case"GPUCompilationInfo":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":throwUnpolyfillable(b);default:throwUncloneable(b)}}te(t,e,n);if(C)switch(b){case"Array":case"Object":h=ae(e);for(c=0,l=k(h);c<l;c++){d=h[c];S(n,d,structuredCloneInternal(e[d],t))}break;case"Map":e.forEach((function(e,r){te(n,structuredCloneInternal(r,t),structuredCloneInternal(e,t))}));break;case"Set":e.forEach((function(e){re(n,structuredCloneInternal(e,t))}));break;case"Error":x(n,"message",structuredCloneInternal(e.message,t));w(e,"cause")&&x(n,"cause",structuredCloneInternal(e.cause,t));"AggregateError"==a&&(n.errors=structuredCloneInternal(e.errors,t));case"DOMException":O&&x(n,"stack",structuredCloneInternal(e.stack,t))}return n},me=de&&!l((function(){if(E&&T>92||D&&T>94||M&&T>97)return!1;var e=new ArrayBuffer(8),t=de(e,{transfer:[e]});return 0!=e.byteLength||8!=t.byteLength})),tryToTransfer=function(e,t){if(!g(e))throw X("Transfer option cannot be converted to a sequence");var r=[];m(e,(function(e){ne(r,b(e))}));var a,n,i,o,c,l,h=0,f=k(r);if(me){o=de(r,{transfer:r});for(;h<f;)te(t,r[h],o[h++])}else for(;h<f;){a=r[h++];if(Q(t,a))throw new K("Duplicate transferable",he);switch(n=y(a)){case"ImageBitmap":i=s.OffscreenCanvas;d(i)||throwUnpolyfillable(n,ue);try{(l=new i(a.width,a.height)).getContext("bitmaprenderer").transferFromImageBitmap(a);c=l.transferToImageBitmap()}catch(e){}break;case"AudioData":case"VideoFrame":u(a.clone)&&u(a.close)||throwUnpolyfillable(n,ue);try{c=a.clone();a.close()}catch(e){}break;case"ArrayBuffer":case"MessagePort":case"OffscreenCanvas":case"ReadableStream":case"TransformStream":case"WritableStream":throwUnpolyfillable(n,ue)}if(void 0===c)throw new K("This object cannot be transferred: "+n,he);te(t,a,c)}};i({global:!0,enumerable:!0,sham:!me,forced:fe},{structuredClone:function structuredClone(e){var t,r=C(arguments.length,1)>1&&!f(arguments[1])?b(arguments[1]):void 0,a=r?r.transfer:void 0;if(void 0!==a){t=new J;tryToTransfer(a,t)}return structuredCloneInternal(e,t)}})},(e,t,r)=>{var a=r(18),n=r(11),i=r(25),s=r(83),o=r(28),c=r(55),noop=function(){},l=[],h=o("Reflect","construct"),u=/^\s*(?:class|function)\b/,d=a(u.exec),f=!u.exec(noop),g=function isConstructor(e){if(!i(e))return!1;try{h(noop,l,e);return!0}catch(e){return!1}},p=function isConstructor(e){if(!i(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!d(u,c(e))}catch(e){return!0}};p.sham=!0;e.exports=!h||n((function(){var e;return g(g.call)||!g(Object)||!g((function(){e=!0}))||e}))?p:g},e=>{var t=TypeError;e.exports=function(e,r){if(e<r)throw t("Not enough arguments");return e}},(e,t,r)=>{var a=r(12),n=r(43),i=r(29),s=r(127),o=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in o||n(e,"flags")||!i(o,e)?t:a(s,e)}},(e,t,r)=>{"use strict";var a=r(51);e.exports=function(){var e=a(this),t="";e.hasIndices&&(t+="d");e.global&&(t+="g");e.ignoreCase&&(t+="i");e.multiline&&(t+="m");e.dotAll&&(t+="s");e.unicode&&(t+="u");e.unicodeSets&&(t+="v");e.sticky&&(t+="y");return t}},(e,t,r)=>{var a=r(11),n=r(15);e.exports=!a((function(){var e=Error("a");if(!("stack"in e))return!0;Object.defineProperty(e,"stack",n(1,7));return 7!==e.stack}))},(e,t,r)=>{var a=r(130),n=r(131);e.exports=!a&&!n&&"object"==typeof window&&"object"==typeof document},e=>{e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},(e,t,r)=>{var a=r(19),n=r(8);e.exports="process"==a(n.process)},(e,t,r)=>{var a=r(8);e.exports=a},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.RefSetCache=t.RefSet=t.Ref=t.Name=t.EOF=t.Dict=t.Cmd=t.CIRCULAR_REF=void 0;t.clearPrimitiveCaches=function clearPrimitiveCaches(){o._clearCache();s._clearCache();l._clearCache()};t.isCmd=function isCmd(e,t){return e instanceof o&&(void 0===t||e.cmd===t)};t.isDict=function isDict(e,t){return e instanceof Dict&&(void 0===t||isName(e.get("Type"),t))};t.isName=isName;t.isRefsEqual=function isRefsEqual(e,t){return e.num===t.num&&e.gen===t.gen};var a=r(2);const n=Symbol("CIRCULAR_REF");t.CIRCULAR_REF=n;const i=Symbol("EOF");t.EOF=i;const s=function NameClosure(){let e=Object.create(null);class Name{constructor(e){this.name=e}static get(t){return e[t]||(e[t]=new Name(t))}static _clearCache(){e=Object.create(null)}}return Name}();t.Name=s;const o=function CmdClosure(){let e=Object.create(null);class Cmd{constructor(e){this.cmd=e}static get(t){return e[t]||(e[t]=new Cmd(t))}static _clearCache(){e=Object.create(null)}}return Cmd}();t.Cmd=o;const c=function nonSerializableClosure(){return c};class Dict{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._map=Object.create(null);this.xref=e;this.objId=null;this.suppressEncryption=!1;this.__nonSerializable__=c}assignXref(e){this.xref=e}get size(){return Object.keys(this._map).length}get(e,t,r){let a=this._map[e];if(void 0===a&&void 0!==t){a=this._map[t];void 0===a&&void 0!==r&&(a=this._map[r])}return a instanceof l&&this.xref?this.xref.fetch(a,this.suppressEncryption):a}async getAsync(e,t,r){let a=this._map[e];if(void 0===a&&void 0!==t){a=this._map[t];void 0===a&&void 0!==r&&(a=this._map[r])}return a instanceof l&&this.xref?this.xref.fetchAsync(a,this.suppressEncryption):a}getArray(e,t,r){let a=this._map[e];if(void 0===a&&void 0!==t){a=this._map[t];void 0===a&&void 0!==r&&(a=this._map[r])}a instanceof l&&this.xref&&(a=this.xref.fetch(a,this.suppressEncryption));if(Array.isArray(a)){a=a.slice();for(let e=0,t=a.length;e<t;e++)a[e]instanceof l&&this.xref&&(a[e]=this.xref.fetch(a[e],this.suppressEncryption))}return a}getRaw(e){return this._map[e]}getKeys(){return Object.keys(this._map)}getRawValues(){return Object.values(this._map)}set(e,t){this._map[e]=t}has(e){return void 0!==this._map[e]}forEach(e){for(const t in this._map)e(t,this.get(t))}static get empty(){const e=new Dict(null);e.set=(e,t)=>{(0,a.unreachable)("Should not call `set` on the empty dictionary.")};return(0,a.shadow)(this,"empty",e)}static merge(e){let{xref:t,dictArray:r,mergeSubDicts:a=!1}=e;const n=new Dict(t),i=new Map;for(const e of r)if(e instanceof Dict)for(const[t,r]of Object.entries(e._map)){let e=i.get(t);if(void 0===e){e=[];i.set(t,e)}else if(!(a&&r instanceof Dict))continue;e.push(r)}for(const[e,r]of i){if(1===r.length||!(r[0]instanceof Dict)){n._map[e]=r[0];continue}const a=new Dict(t);for(const e of r)for(const[t,r]of Object.entries(e._map))void 0===a._map[t]&&(a._map[t]=r);a.size>0&&(n._map[e]=a)}i.clear();return n.size>0?n:Dict.empty}}t.Dict=Dict;const l=function RefClosure(){let e=Object.create(null);class Ref{constructor(e,t){this.num=e;this.gen=t}toString(){return 0===this.gen?`${this.num}R`:`${this.num}R${this.gen}`}static get(t,r){const a=0===r?`${t}R`:`${t}R${r}`;return e[a]||(e[a]=new Ref(t,r))}static _clearCache(){e=Object.create(null)}}return Ref}();t.Ref=l;class RefSet{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._set=new Set(e&&e._set)}has(e){return this._set.has(e.toString())}put(e){this._set.add(e.toString())}remove(e){this._set.delete(e.toString())}[Symbol.iterator](){return this._set.values()}clear(){this._set.clear()}}t.RefSet=RefSet;class RefSetCache{constructor(){this._map=new Map}get size(){return this._map.size}get(e){return this._map.get(e.toString())}has(e){return this._map.has(e.toString())}put(e,t){this._map.set(e.toString(),t)}putAlias(e,t){this._map.set(e.toString(),this.get(t))}[Symbol.iterator](){return this._map.values()}clear(){this._map.clear()}}t.RefSetCache=RefSetCache;function isName(e,t){return e instanceof s&&(void 0===t||e.name===t)}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XRefParseException=t.XRefEntryException=t.ParserEOFException=t.MissingDataException=t.DocStats=void 0;t.collectActions=function collectActions(e,t,r){const i=Object.create(null),s=getInheritableProperty({dict:t,key:"AA",stopWhenFound:!1});if(s)for(let t=s.length-1;t>=0;t--){const a=s[t];if(a instanceof n.Dict)for(const t of a.getKeys()){const s=r[t];if(!s)continue;const o=a.getRaw(t),c=new n.RefSet,l=[];_collectJS(o,e,l,c);l.length>0&&(i[s]=l)}}if(t.has("A")){const r=t.get("A"),a=new n.RefSet,s=[];_collectJS(r,e,s,a);s.length>0&&(i.Action=s)}return(0,a.objectSize)(i)>0?i:null};t.encodeToXmlString=function encodeToXmlString(e){const t=[];let r=0;for(let a=0,n=e.length;a<n;a++){const n=e.codePointAt(a);if(32<=n&&n<=126){const i=o[n];if(i){r<a&&t.push(e.substring(r,a));t.push(i);r=a+1}}else{r<a&&t.push(e.substring(r,a));t.push(`&#x${n.toString(16).toUpperCase()};`);n>55295&&(n<57344||n>65533)&&a++;r=a+1}}if(0===t.length)return e;r<e.length&&t.push(e.substring(r,e.length));return t.join("")};t.escapePDFName=function escapePDFName(e){const t=[];let r=0;for(let a=0,n=e.length;a<n;a++){const n=e.charCodeAt(a);if(n<33||n>126||35===n||40===n||41===n||60===n||62===n||91===n||93===n||123===n||125===n||47===n||37===n){r<a&&t.push(e.substring(r,a));t.push(`#${n.toString(16)}`);r=a+1}}if(0===t.length)return e;r<e.length&&t.push(e.substring(r,e.length));return t.join("")};t.getArrayLookupTableFactory=function getArrayLookupTableFactory(e){let t;return function(){if(e){let r=e();e=null;t=Object.create(null);for(let e=0,a=r.length;e<a;e+=2)t[r[e]]=r[e+1];r=null}return t}};t.getInheritableProperty=getInheritableProperty;t.getLookupTableFactory=function getLookupTableFactory(e){let t;return function(){if(e){t=Object.create(null);e(t);e=null}return t}};t.getNewAnnotationsMap=function getNewAnnotationsMap(e){if(!e)return null;const t=new Map;for(const[r,n]of e){if(!r.startsWith(a.AnnotationEditorPrefix))continue;let e=t.get(n.pageIndex);if(!e){e=[];t.set(n.pageIndex,e)}e.push(n)}return t.size>0?t:null};t.isWhiteSpace=function isWhiteSpace(e){return 32===e||9===e||13===e||10===e};t.log2=function log2(e){if(e<=0)return 0;return Math.ceil(Math.log2(e))};t.numberToString=function numberToString(e){if(Number.isInteger(e))return e.toString();const t=Math.round(100*e);if(t%100==0)return(t/100).toString();if(t%10==0)return e.toFixed(1);return e.toFixed(2)};t.parseXFAPath=function parseXFAPath(e){const t=/(.+)\[(\d+)\]$/;return e.split(".").map((e=>{const r=e.match(t);return r?{name:r[1],pos:parseInt(r[2],10)}:{name:e,pos:0}}))};t.readInt8=function readInt8(e,t){return e[t]<<24>>24};t.readUint16=function readUint16(e,t){return e[t]<<8|e[t+1]};t.readUint32=function readUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0};t.recoverJsURL=function recoverJsURL(e){const t=new RegExp("^\\s*("+["app.launchURL","window.open","xfa.host.gotoURL"].join("|").split(".").join("\\.")+")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))","i").exec(e);if(t&&t[2]){const e=t[2];let r=!1;"true"===t[3]&&"app.launchURL"===t[1]&&(r=!0);return{url:e,newWindow:r}}return null};t.toRomanNumerals=function toRomanNumerals(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,a.assert)(Number.isInteger(e)&&e>0,"The number should be a positive integer.");const r=[];let n;for(;e>=1e3;){e-=1e3;r.push("M")}n=e/100|0;e%=100;r.push(s[n]);n=e/10|0;e%=10;r.push(s[10+n]);r.push(s[20+e]);const i=r.join("");return t?i.toLowerCase():i};t.validateCSSFont=function validateCSSFont(e){const t=new Set(["100","200","300","400","500","600","700","800","900","1000","normal","bold","bolder","lighter"]),{fontFamily:r,fontWeight:n,italicAngle:i}=e;if(/^".*"$/.test(r)){if(/[^\\]"/.test(r.slice(1,r.length-1))){(0,a.warn)(`XFA - FontFamily contains some unescaped ": ${r}.`);return!1}}else if(/^'.*'$/.test(r)){if(/[^\\]'/.test(r.slice(1,r.length-1))){(0,a.warn)(`XFA - FontFamily contains some unescaped ': ${r}.`);return!1}}else for(const e of r.split(/[ \t]+/))if(/^(\d|(-(\d|-)))/.test(e)||!/^[\w-\\]+$/.test(e)){(0,a.warn)(`XFA - FontFamily contains some invalid <custom-ident>: ${r}.`);return!1}const s=n?n.toString():"";e.fontWeight=t.has(s)?s:"400";const o=parseFloat(i);e.italicAngle=isNaN(o)||o<-90||o>90?"14":i.toString();return!0};var a=r(2),n=r(133),i=r(135);class MissingDataException extends a.BaseException{constructor(e,t){super(`Missing data [${e}, ${t})`,"MissingDataException");this.begin=e;this.end=t}}t.MissingDataException=MissingDataException;class ParserEOFException extends a.BaseException{constructor(e){super(e,"ParserEOFException")}}t.ParserEOFException=ParserEOFException;class XRefEntryException extends a.BaseException{constructor(e){super(e,"XRefEntryException")}}t.XRefEntryException=XRefEntryException;class XRefParseException extends a.BaseException{constructor(e){super(e,"XRefParseException")}}t.XRefParseException=XRefParseException;t.DocStats=class DocStats{constructor(e){this._handler=e;this._streamTypes=new Set;this._fontTypes=new Set}_send(){const e=Object.create(null),t=Object.create(null);for(const t of this._streamTypes)e[t]=!0;for(const e of this._fontTypes)t[e]=!0;this._handler.send("DocStats",{streamTypes:e,fontTypes:t})}addStreamType(e){if(!this._streamTypes.has(e)){this._streamTypes.add(e);this._send()}}addFontType(e){if(!this._fontTypes.has(e)){this._fontTypes.add(e);this._send()}}};function getInheritableProperty(e){let t,{dict:r,key:a,getArray:i=!1,stopWhenFound:s=!0}=e;const o=new n.RefSet;for(;r instanceof n.Dict&&(!r.objId||!o.has(r.objId));){r.objId&&o.put(r.objId);const e=i?r.getArray(a):r.get(a);if(void 0!==e){if(s)return e;t||(t=[]);t.push(e)}r=r.get("Parent")}return t}const s=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];function _collectJS(e,t,r,s){if(!e)return;let o=null;if(e instanceof n.Ref){if(s.has(e))return;o=e;s.put(o);e=t.fetch(e)}if(Array.isArray(e))for(const a of e)_collectJS(a,t,r,s);else if(e instanceof n.Dict){if((0,n.isName)(e.get("S"),"JavaScript")){const t=e.get("JS");let n;t instanceof i.BaseStream?n=t.getString():"string"==typeof t&&(n=t);n=n&&(0,a.stringToPDFString)(n).replace(/\u0000/g,"");n&&r.push(n)}_collectJS(e.getRaw("Next"),t,r,s)}o&&s.remove(o)}const o={60:"<",62:">",38:"&",34:""",39:"'"}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.BaseStream=void 0;var a=r(2);class BaseStream{constructor(){this.constructor===BaseStream&&(0,a.unreachable)("Cannot initialize BaseStream.")}get length(){(0,a.unreachable)("Abstract getter `length` accessed")}get isEmpty(){(0,a.unreachable)("Abstract getter `isEmpty` accessed")}get isDataLoaded(){return(0,a.shadow)(this,"isDataLoaded",!0)}getByte(){(0,a.unreachable)("Abstract method `getByte` called")}getBytes(e){(0,a.unreachable)("Abstract method `getBytes` called")}peekByte(){const e=this.getByte();-1!==e&&this.pos--;return e}peekBytes(e){const t=this.getBytes(e);this.pos-=t.length;return t}getUint16(){const e=this.getByte(),t=this.getByte();return-1===e||-1===t?-1:(e<<8)+t}getInt32(){return(this.getByte()<<24)+(this.getByte()<<16)+(this.getByte()<<8)+this.getByte()}getByteRange(e,t){(0,a.unreachable)("Abstract method `getByteRange` called")}getString(e){return(0,a.bytesToString)(this.getBytes(e))}skip(e){this.pos+=e||1}reset(){(0,a.unreachable)("Abstract method `reset` called")}moveStart(){(0,a.unreachable)("Abstract method `moveStart` called")}makeSubStream(e,t){(0,a.unreachable)("Abstract method `makeSubStream` called")}getBaseStreams(){return null}}t.BaseStream=BaseStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NetworkPdfManager=t.LocalPdfManager=void 0;var a=r(2),n=r(137),i=r(134),s=r(139),o=r(138);function parseDocBaseUrl(e){if(e){const t=(0,a.createValidAbsoluteUrl)(e);if(t)return t.href;(0,a.warn)(`Invalid absolute docBaseUrl: "${e}".`)}return null}class BasePdfManager{constructor(){this.constructor===BasePdfManager&&(0,a.unreachable)("Cannot initialize BasePdfManager.")}get docId(){return this._docId}get password(){return this._password}get docBaseUrl(){const e=this.pdfDocument.catalog;return(0,a.shadow)(this,"docBaseUrl",e.baseUrl||this._docBaseUrl)}onLoadedStream(){(0,a.unreachable)("Abstract method `onLoadedStream` called")}ensureDoc(e,t){return this.ensure(this.pdfDocument,e,t)}ensureXRef(e,t){return this.ensure(this.pdfDocument.xref,e,t)}ensureCatalog(e,t){return this.ensure(this.pdfDocument.catalog,e,t)}getPage(e){return this.pdfDocument.getPage(e)}fontFallback(e,t){return this.pdfDocument.fontFallback(e,t)}loadXfaFonts(e,t){return this.pdfDocument.loadXfaFonts(e,t)}loadXfaImages(){return this.pdfDocument.loadXfaImages()}serializeXfaData(e){return this.pdfDocument.serializeXfaData(e)}cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.pdfDocument.cleanup(e)}async ensure(e,t,r){(0,a.unreachable)("Abstract method `ensure` called")}requestRange(e,t){(0,a.unreachable)("Abstract method `requestRange` called")}requestLoadedStream(){(0,a.unreachable)("Abstract method `requestLoadedStream` called")}sendProgressiveData(e){(0,a.unreachable)("Abstract method `sendProgressiveData` called")}updatePassword(e){this._password=e}terminate(e){(0,a.unreachable)("Abstract method `terminate` called")}}t.LocalPdfManager=class LocalPdfManager extends BasePdfManager{constructor(e,t,r,a,n,i,c){super();this._docId=e;this._password=r;this._docBaseUrl=parseDocBaseUrl(c);this.msgHandler=a;this.evaluatorOptions=n;this.enableXfa=i;const l=new o.Stream(t);this.pdfDocument=new s.PDFDocument(this,l);this._loadedStreamPromise=Promise.resolve(l)}async ensure(e,t,r){const a=e[t];return"function"==typeof a?a.apply(e,r):a}requestRange(e,t){return Promise.resolve()}requestLoadedStream(){}onLoadedStream(){return this._loadedStreamPromise}terminate(e){}};t.NetworkPdfManager=class NetworkPdfManager extends BasePdfManager{constructor(e,t,r,a,i,o){super();this._docId=e;this._password=r.password;this._docBaseUrl=parseDocBaseUrl(o);this.msgHandler=r.msgHandler;this.evaluatorOptions=a;this.enableXfa=i;this.streamManager=new n.ChunkedStreamManager(t,{msgHandler:r.msgHandler,length:r.length,disableAutoFetch:r.disableAutoFetch,rangeChunkSize:r.rangeChunkSize});this.pdfDocument=new s.PDFDocument(this,this.streamManager.getStream())}async ensure(e,t,r){try{const a=e[t];return"function"==typeof a?a.apply(e,r):a}catch(a){if(!(a instanceof i.MissingDataException))throw a;await this.requestRange(a.begin,a.end);return this.ensure(e,t,r)}}requestRange(e,t){return this.streamManager.requestRange(e,t)}requestLoadedStream(){this.streamManager.requestAllChunks()}sendProgressiveData(e){this.streamManager.onReceiveData({chunk:e})}onLoadedStream(){return this.streamManager.onLoadedStream()}terminate(e){this.streamManager.abort(e)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ChunkedStreamManager=t.ChunkedStream=void 0;var a=r(2),n=r(134),i=r(138);class ChunkedStream extends i.Stream{constructor(e,t,r){super(new Uint8Array(e),0,e,null);this.chunkSize=t;this._loadedChunks=new Set;this.numChunks=Math.ceil(e/t);this.manager=r;this.progressiveDataLength=0;this.lastSuccessfulEnsureByteChunk=-1}getMissingChunks(){const e=[];for(let t=0,r=this.numChunks;t<r;++t)this._loadedChunks.has(t)||e.push(t);return e}get numChunksLoaded(){return this._loadedChunks.size}get isDataLoaded(){return this.numChunksLoaded===this.numChunks}onReceiveData(e,t){const r=this.chunkSize;if(e%r!=0)throw new Error(`Bad begin offset: ${e}`);const a=e+t.byteLength;if(a%r!=0&&a!==this.bytes.length)throw new Error(`Bad end offset: ${a}`);this.bytes.set(new Uint8Array(t),e);const n=Math.floor(e/r),i=Math.floor((a-1)/r)+1;for(let e=n;e<i;++e)this._loadedChunks.add(e)}onReceiveProgressiveData(e){let t=this.progressiveDataLength;const r=Math.floor(t/this.chunkSize);this.bytes.set(new Uint8Array(e),t);t+=e.byteLength;this.progressiveDataLength=t;const a=t>=this.end?this.numChunks:Math.floor(t/this.chunkSize);for(let e=r;e<a;++e)this._loadedChunks.add(e)}ensureByte(e){if(e<this.progressiveDataLength)return;const t=Math.floor(e/this.chunkSize);if(!(t>this.numChunks)&&t!==this.lastSuccessfulEnsureByteChunk){if(!this._loadedChunks.has(t))throw new n.MissingDataException(e,e+1);this.lastSuccessfulEnsureByteChunk=t}}ensureRange(e,t){if(e>=t)return;if(t<=this.progressiveDataLength)return;const r=Math.floor(e/this.chunkSize);if(r>this.numChunks)return;const a=Math.min(Math.floor((t-1)/this.chunkSize)+1,this.numChunks);for(let i=r;i<a;++i)if(!this._loadedChunks.has(i))throw new n.MissingDataException(e,t)}nextEmptyChunk(e){const t=this.numChunks;for(let r=0;r<t;++r){const a=(e+r)%t;if(!this._loadedChunks.has(a))return a}return null}hasChunk(e){return this._loadedChunks.has(e)}getByte(){const e=this.pos;if(e>=this.end)return-1;e>=this.progressiveDataLength&&this.ensureByte(e);return this.bytes[this.pos++]}getBytes(e){const t=this.bytes,r=this.pos,a=this.end;if(!e){a>this.progressiveDataLength&&this.ensureRange(r,a);return t.subarray(r,a)}let n=r+e;n>a&&(n=a);n>this.progressiveDataLength&&this.ensureRange(r,n);this.pos=n;return t.subarray(r,n)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);t>this.progressiveDataLength&&this.ensureRange(e,t);return this.bytes.subarray(e,t)}makeSubStream(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t?e+t>this.progressiveDataLength&&this.ensureRange(e,e+t):e>=this.progressiveDataLength&&this.ensureByte(e);function ChunkedStreamSubstream(){}ChunkedStreamSubstream.prototype=Object.create(this);ChunkedStreamSubstream.prototype.getMissingChunks=function(){const e=this.chunkSize,t=Math.floor(this.start/e),r=Math.floor((this.end-1)/e)+1,a=[];for(let e=t;e<r;++e)this._loadedChunks.has(e)||a.push(e);return a};Object.defineProperty(ChunkedStreamSubstream.prototype,"isDataLoaded",{get(){return this.numChunksLoaded===this.numChunks||0===this.getMissingChunks().length},configurable:!0});const a=new ChunkedStreamSubstream;a.pos=a.start=e;a.end=e+t||this.end;a.dict=r;return a}getBaseStreams(){return[this]}}t.ChunkedStream=ChunkedStream;t.ChunkedStreamManager=class ChunkedStreamManager{constructor(e,t){this.length=t.length;this.chunkSize=t.rangeChunkSize;this.stream=new ChunkedStream(this.length,this.chunkSize,this);this.pdfNetworkStream=e;this.disableAutoFetch=t.disableAutoFetch;this.msgHandler=t.msgHandler;this.currRequestId=0;this._chunksNeededByRequest=new Map;this._requestsByChunk=new Map;this._promisesByRequest=new Map;this.progressiveDataLength=0;this.aborted=!1;this._loadedStreamCapability=(0,a.createPromiseCapability)()}onLoadedStream(){return this._loadedStreamCapability.promise}sendRequest(e,t){const r=this.pdfNetworkStream.getRangeReader(e,t);r.isStreamingSupported||(r.onProgress=this.onProgress.bind(this));let n=[],i=0;return new Promise(((e,t)=>{const readChunk=s=>{try{if(!s.done){const e=s.value;n.push(e);i+=(0,a.arrayByteLength)(e);r.isStreamingSupported&&this.onProgress({loaded:i});r.read().then(readChunk,t);return}const o=(0,a.arraysToBytes)(n);n=null;e(o)}catch(e){t(e)}};r.read().then(readChunk,t)})).then((t=>{this.aborted||this.onReceiveData({chunk:t,begin:e})}))}requestAllChunks(){const e=this.stream.getMissingChunks();this._requestChunks(e);return this._loadedStreamCapability.promise}_requestChunks(e){const t=this.currRequestId++,r=new Set;this._chunksNeededByRequest.set(t,r);for(const t of e)this.stream.hasChunk(t)||r.add(t);if(0===r.size)return Promise.resolve();const n=(0,a.createPromiseCapability)();this._promisesByRequest.set(t,n);const i=[];for(const e of r){let r=this._requestsByChunk.get(e);if(!r){r=[];this._requestsByChunk.set(e,r);i.push(e)}r.push(t)}if(i.length>0){const e=this.groupChunks(i);for(const t of e){const e=t.beginChunk*this.chunkSize,r=Math.min(t.endChunk*this.chunkSize,this.length);this.sendRequest(e,r).catch(n.reject)}}return n.promise.catch((e=>{if(!this.aborted)throw e}))}getStream(){return this.stream}requestRange(e,t){t=Math.min(t,this.length);const r=this.getBeginChunk(e),a=this.getEndChunk(t),n=[];for(let e=r;e<a;++e)n.push(e);return this._requestChunks(n)}requestRanges(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[];for(const r of e){const e=this.getBeginChunk(r.begin),a=this.getEndChunk(r.end);for(let r=e;r<a;++r)t.includes(r)||t.push(r)}t.sort((function(e,t){return e-t}));return this._requestChunks(t)}groupChunks(e){const t=[];let r=-1,a=-1;for(let n=0,i=e.length;n<i;++n){const i=e[n];r<0&&(r=i);if(a>=0&&a+1!==i){t.push({beginChunk:r,endChunk:a+1});r=i}n+1===e.length&&t.push({beginChunk:r,endChunk:i+1});a=i}return t}onProgress(e){this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize+e.loaded,total:this.length})}onReceiveData(e){const t=e.chunk,r=void 0===e.begin,a=r?this.progressiveDataLength:e.begin,n=a+t.byteLength,i=Math.floor(a/this.chunkSize),s=n<this.length?Math.floor(n/this.chunkSize):Math.ceil(n/this.chunkSize);if(r){this.stream.onReceiveProgressiveData(t);this.progressiveDataLength=n}else this.stream.onReceiveData(a,t);this.stream.isDataLoaded&&this._loadedStreamCapability.resolve(this.stream);const o=[];for(let e=i;e<s;++e){const t=this._requestsByChunk.get(e);if(t){this._requestsByChunk.delete(e);for(const r of t){const t=this._chunksNeededByRequest.get(r);t.has(e)&&t.delete(e);t.size>0||o.push(r)}}}if(!this.disableAutoFetch&&0===this._requestsByChunk.size){let e;if(1===this.stream.numChunksLoaded){const t=this.stream.numChunks-1;this.stream.hasChunk(t)||(e=t)}else e=this.stream.nextEmptyChunk(s);Number.isInteger(e)&&this._requestChunks([e])}for(const e of o){const t=this._promisesByRequest.get(e);this._promisesByRequest.delete(e);t.resolve()}this.msgHandler.send("DocProgress",{loaded:this.stream.numChunksLoaded*this.chunkSize,total:this.length})}onError(e){this._loadedStreamCapability.reject(e)}getBeginChunk(e){return Math.floor(e/this.chunkSize)}getEndChunk(e){return Math.floor((e-1)/this.chunkSize)+1}abort(e){this.aborted=!0;this.pdfNetworkStream&&this.pdfNetworkStream.cancelAllRequests(e);for(const t of this._promisesByRequest.values())t.reject(e)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StringStream=t.Stream=t.NullStream=void 0;var a=r(135),n=r(2);class Stream extends a.BaseStream{constructor(e,t,r,a){super();this.bytes=e instanceof Uint8Array?e:new Uint8Array(e);this.start=t||0;this.pos=this.start;this.end=t+r||this.bytes.length;this.dict=a}get length(){return this.end-this.start}get isEmpty(){return 0===this.length}getByte(){return this.pos>=this.end?-1:this.bytes[this.pos++]}getBytes(e){const t=this.bytes,r=this.pos,a=this.end;if(!e)return t.subarray(r,a);let n=r+e;n>a&&(n=a);this.pos=n;return t.subarray(r,n)}getByteRange(e,t){e<0&&(e=0);t>this.end&&(t=this.end);return this.bytes.subarray(e,t)}reset(){this.pos=this.start}moveStart(){this.start=this.pos}makeSubStream(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Stream(this.bytes.buffer,e,t,r)}}t.Stream=Stream;t.StringStream=class StringStream extends Stream{constructor(e){super((0,n.stringToBytes)(e))}};t.NullStream=class NullStream extends Stream{constructor(){super(new Uint8Array(0))}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Page=t.PDFDocument=void 0;var a=r(140),n=r(2),i=r(134),s=r(133),o=r(179),c=r(135),l=r(195),h=r(197),u=r(199),d=r(228),f=r(145),g=r(138),p=r(203),m=r(190),b=r(143),y=r(147),w=r(202),S=r(193),x=r(204),k=r(229);const C=[0,0,612,792];class Page{constructor(e){let{pdfManager:t,xref:r,pageIndex:a,pageDict:n,ref:i,globalIdFactory:s,fontCache:o,builtInCMapCache:c,standardFontDataCache:l,globalImageCache:h,nonBlendModesSet:u,xfaFactory:d}=e;this.pdfManager=t;this.pageIndex=a;this.pageDict=n;this.xref=r;this.ref=i;this.fontCache=o;this.builtInCMapCache=c;this.standardFontDataCache=l;this.globalImageCache=h;this.nonBlendModesSet=u;this.evaluatorOptions=t.evaluatorOptions;this.resourcesPromise=null;this.xfaFactory=d;const f={obj:0};this._localIdFactory=class extends s{static createObjId(){return`p${a}_${++f.obj}`}static getPageObjId(){return`page${i.toString()}`}}}_getInheritableProperty(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=(0,i.getInheritableProperty)({dict:this.pageDict,key:e,getArray:t,stopWhenFound:!1});return Array.isArray(r)?1!==r.length&&r[0]instanceof s.Dict?s.Dict.merge({xref:this.xref,dictArray:r}):r[0]:r}get content(){return this.pageDict.getArray("Contents")}get resources(){const e=this._getInheritableProperty("Resources");return(0,n.shadow)(this,"resources",e instanceof s.Dict?e:s.Dict.empty)}_getBoundingBox(e){if(this.xfaData)return this.xfaData.bbox;const t=this._getInheritableProperty(e,!0);if(Array.isArray(t)&&4===t.length){if(t[2]-t[0]!=0&&t[3]-t[1]!=0)return t;(0,n.warn)(`Empty /${e} entry.`)}return null}get mediaBox(){return(0,n.shadow)(this,"mediaBox",this._getBoundingBox("MediaBox")||C)}get cropBox(){return(0,n.shadow)(this,"cropBox",this._getBoundingBox("CropBox")||this.mediaBox)}get userUnit(){let e=this.pageDict.get("UserUnit");("number"!=typeof e||e<=0)&&(e=1);return(0,n.shadow)(this,"userUnit",e)}get view(){const{cropBox:e,mediaBox:t}=this;let r;if(e===t||(0,n.isArrayEqual)(e,t))r=t;else{const a=n.Util.intersect(e,t);a&&a[2]-a[0]!=0&&a[3]-a[1]!=0?r=a:(0,n.warn)("Empty /CropBox and /MediaBox intersection.")}return(0,n.shadow)(this,"view",r||t)}get rotate(){let e=this._getInheritableProperty("Rotate")||0;e%90!=0?e=0:e>=360?e%=360:e<0&&(e=(e%360+360)%360);return(0,n.shadow)(this,"rotate",e)}_onSubStreamError(e,t,r){if(!this.evaluatorOptions.ignoreErrors)throw t;e.send("UnsupportedFeature",{featureId:n.UNSUPPORTED_FEATURES.errorContentSubStream});(0,n.warn)(`getContentStream - ignoring sub-stream (${r}): "${t}".`)}getContentStream(e){return this.pdfManager.ensure(this,"content").then((t=>t instanceof c.BaseStream?t:Array.isArray(t)?new y.StreamsSequenceStream(t,this._onSubStreamError.bind(this,e)):new g.NullStream))}get xfaData(){return(0,n.shadow)(this,"xfaData",this.xfaFactory?{bbox:this.xfaFactory.getBoundingBox(this.pageIndex)}:null)}async saveNewAnnotations(e,t,r){if(this.xfaFactory)throw new Error("XFA: Cannot save new annotations.");const n=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),i=this.pageDict,s=this.annotations.slice(),o=await a.AnnotationFactory.saveNewAnnotations(n,t,r);for(const{ref:e}of o.annotations)s.push(e);const c=i.get("Annots");i.set("Annots",s);const l=[];let h=null;this.xref.encrypt&&(h=this.xref.encrypt.createCipherTransform(this.ref.num,this.ref.gen));(0,S.writeObject)(this.ref,i,l,h);c&&i.set("Annots",c);const u=o.dependencies;u.push({ref:this.ref,data:l.join("")},...o.annotations);return u}save(e,t,r){const a=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions});return this._parsedAnnotations.then((function(e){const i=[];for(const s of e)s.mustBePrinted(r)&&i.push(s.save(a,t,r).catch((function(e){(0,n.warn)(`save - ignoring annotation data during "${t.name}" task: "${e}".`);return null})));return Promise.all(i).then((function(e){return e.filter((e=>!!e))}))}))}loadResources(e){this.resourcesPromise||(this.resourcesPromise=this.pdfManager.ensure(this,"resources"));return this.resourcesPromise.then((()=>new p.ObjectLoader(this.resources,e,this.xref).load()))}getOperatorList(e){let{handler:t,sink:r,task:s,intent:o,cacheKey:c,annotationStorage:l=null}=e;const h=this.getContentStream(t),u=this.loadResources(["ColorSpace","ExtGState","Font","Pattern","Properties","Shading","XObject"]),d=new b.PartialEvaluator({xref:this.xref,handler:t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}),f=this.xfaFactory?null:(0,i.getNewAnnotationsMap)(l);let g=Promise.resolve(null);if(f){const e=f.get(this.pageIndex);e&&(g=a.AnnotationFactory.printNewAnnotations(d,s,e))}const p=Promise.all([h,u]).then((e=>{let[a]=e;const n=new m.OperatorList(o,r);t.send("StartRenderPage",{transparency:d.hasBlendModes(this.resources,this.nonBlendModesSet),pageIndex:this.pageIndex,cacheKey:c});return d.getOperatorList({stream:a,task:s,resources:this.resources,operatorList:n}).then((function(){return n}))}));return Promise.all([p,this._parsedAnnotations,g]).then((function(e){let[t,r,a]=e;a&&(r=r.concat(a));if(0===r.length||o&n.RenderingIntentFlag.ANNOTATIONS_DISABLE){t.flush(!0);return{length:t.totalLength}}const i=!!(o&n.RenderingIntentFlag.ANNOTATIONS_FORMS),c=!!(o&n.RenderingIntentFlag.ANY),h=!!(o&n.RenderingIntentFlag.DISPLAY),u=!!(o&n.RenderingIntentFlag.PRINT),f=[];for(const e of r)(c||h&&e.mustBeViewed(l)||u&&e.mustBePrinted(l))&&f.push(e.getOperatorList(d,s,o,i,l).catch((function(e){(0,n.warn)(`getOperatorList - ignoring annotation data during "${s.name}" task: "${e}".`);return null})));return Promise.all(f).then((function(e){let r=!1,a=!1;for(const{opList:n,separateForm:i,separateCanvas:s}of e){t.addOpList(n);i&&(r=i);s&&(a=s)}t.flush(!0,{form:r,canvas:a});return{length:t.totalLength}}))}))}extractTextContent(e){let{handler:t,task:r,includeMarkedContent:a,sink:n,combineTextItems:i}=e;const s=this.getContentStream(t),o=this.loadResources(["ExtGState","Font","Properties","XObject"]);return Promise.all([s,o]).then((e=>{let[s]=e;return new b.PartialEvaluator({xref:this.xref,handler:t,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}).getTextContent({stream:s,task:r,resources:this.resources,includeMarkedContent:a,combineTextItems:i,sink:n,viewBox:this.view})}))}async getStructTree(){const e=await this.pdfManager.ensureCatalog("structTreeRoot");if(!e)return null;return(await this.pdfManager.ensure(this,"_parseStructTree",[e])).serializable}_parseStructTree(e){const t=new w.StructTreePage(e,this.pageDict);t.parse();return t}async getAnnotationsData(e,t,r){const a=await this._parsedAnnotations;if(0===a.length)return[];const i=[],s=[];let o;const c=!!(r&n.RenderingIntentFlag.ANY),l=!!(r&n.RenderingIntentFlag.DISPLAY),h=!!(r&n.RenderingIntentFlag.PRINT);for(const r of a){const a=c||l&&r.viewable;(a||h&&r.printable)&&s.push(r.data);if(r.hasTextContent&&a){o||(o=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:this.pageIndex,idFactory:this._localIdFactory,fontCache:this.fontCache,builtInCMapCache:this.builtInCMapCache,standardFontDataCache:this.standardFontDataCache,globalImageCache:this.globalImageCache,options:this.evaluatorOptions}));i.push(r.extractTextContent(o,t,this.view).catch((function(e){(0,n.warn)(`getAnnotationsData - ignoring textContent during "${t.name}" task: "${e}".`)})))}}await Promise.all(i);return s}get annotations(){const e=this._getInheritableProperty("Annots");return(0,n.shadow)(this,"annotations",Array.isArray(e)?e:[])}get _parsedAnnotations(){const e=this.pdfManager.ensure(this,"annotations").then((()=>{const e=[];for(const t of this.annotations)e.push(a.AnnotationFactory.create(this.xref,t,this.pdfManager,this._localIdFactory,!1).catch((function(e){(0,n.warn)(`_parsedAnnotations: "${e}".`);return null})));return Promise.all(e).then((function(e){if(0===e.length)return e;const t=[];let r;for(const n of e)if(n)if(n instanceof a.PopupAnnotation){r||(r=[]);r.push(n)}else t.push(n);r&&t.push(...r);return t}))}));return(0,n.shadow)(this,"_parsedAnnotations",e)}get jsActions(){const e=(0,i.collectActions)(this.xref,this.pageDict,n.PageActionEventType);return(0,n.shadow)(this,"jsActions",e)}}t.Page=Page;const v=new Uint8Array([37,80,68,70,45]),O=new Uint8Array([115,116,97,114,116,120,114,101,102]),T=new Uint8Array([101,110,100,111,98,106]),M=/^[1-9]\.\d$/;function find(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1024,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=t.length,i=e.peekBytes(r),s=i.length-n;if(s<=0)return!1;if(a){const r=n-1;let a=i.length-1;for(;a>=r;){let s=0;for(;s<n&&i[a-s]===t[r-s];)s++;if(s>=n){e.pos+=a-r;return!0}a--}}else{let r=0;for(;r<=s;){let a=0;for(;a<n&&i[r+a]===t[a];)a++;if(a>=n){e.pos+=r;return!0}r++}}return!1}t.PDFDocument=class PDFDocument{constructor(e,t){if(t.length<=0)throw new n.InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes.");this.pdfManager=e;this.stream=t;this.xref=new k.XRef(t,e);this._pagePromises=new Map;this._version=null;const r={font:0};this._globalIdFactory=class{static getDocId(){return`g_${e.docId}`}static createFontId(){return"f"+ ++r.font}static createObjId(){(0,n.unreachable)("Abstract method `createObjId` called.")}static getPageObjId(){(0,n.unreachable)("Abstract method `getPageObjId` called.")}}}parse(e){this.xref.parse(e);this.catalog=new h.Catalog(this.pdfManager,this.xref);this.catalog.version&&(this._version=this.catalog.version)}get linearization(){let e=null;try{e=f.Linearization.create(this.stream)}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.info)(e)}return(0,n.shadow)(this,"linearization",e)}get startXRef(){const e=this.stream;let t=0;if(this.linearization){e.reset();find(e,T)&&(t=e.pos+6-e.start)}else{const r=1024,a=O.length;let n=!1,s=e.end;for(;!n&&s>0;){s-=r-a;s<0&&(s=0);e.pos=s;n=find(e,O,r,!0)}if(n){e.skip(9);let r;do{r=e.getByte()}while((0,i.isWhiteSpace)(r));let a="";for(;r>=32&&r<=57;){a+=String.fromCharCode(r);r=e.getByte()}t=parseInt(a,10);isNaN(t)&&(t=0)}}return(0,n.shadow)(this,"startXRef",t)}checkHeader(){const e=this.stream;e.reset();if(!find(e,v))return;e.moveStart();let t,r="";for(;(t=e.getByte())>32&&!(r.length>=12);)r+=String.fromCharCode(t);this._version||(this._version=r.substring(5))}parseStartXRef(){this.xref.setStartXRef(this.startXRef)}get numPages(){let e=0;e=this.catalog.hasActualNumPages?this.catalog.numPages:this.xfaFactory?this.xfaFactory.getNumPages():this.linearization?this.linearization.numPages:this.catalog.numPages;return(0,n.shadow)(this,"numPages",e)}_hasOnlyDocumentSignatures(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!Array.isArray(e)&&e.every((e=>{if(!((e=this.xref.fetchIfRef(e))instanceof s.Dict))return!1;if(e.has("Kids")){if(++t>10){(0,n.warn)("_hasOnlyDocumentSignatures: maximum recursion depth reached");return!1}return this._hasOnlyDocumentSignatures(e.get("Kids"),t)}const r=(0,s.isName)(e.get("FT"),"Sig"),a=e.get("Rect"),i=Array.isArray(a)&&a.every((e=>0===e));return r&&i}))}get _xfaStreams(){const e=this.catalog.acroForm;if(!e)return null;const t=e.get("XFA"),r={"xdp:xdp":"",template:"",datasets:"",config:"",connectionSet:"",localeSet:"",stylesheet:"","/xdp:xdp":""};if(t instanceof c.BaseStream&&!t.isEmpty){r["xdp:xdp"]=t;return r}if(!Array.isArray(t)||0===t.length)return null;for(let e=0,a=t.length;e<a;e+=2){let n;n=0===e?"xdp:xdp":e===a-2?"/xdp:xdp":t[e];if(!r.hasOwnProperty(n))continue;const i=this.xref.fetchIfRef(t[e+1]);i instanceof c.BaseStream&&!i.isEmpty&&(r[n]=i)}return r}get xfaDatasets(){const e=this._xfaStreams;if(!e)return(0,n.shadow)(this,"xfaDatasets",null);for(const t of["datasets","xdp:xdp"]){const r=e[t];if(r)try{const e={[t]:(0,n.stringToUTF8String)(r.getString())};return(0,n.shadow)(this,"xfaDatasets",new d.DatasetReader(e))}catch(e){(0,n.warn)("XFA - Invalid utf-8 string.");break}}return(0,n.shadow)(this,"xfaDatasets",null)}get xfaData(){const e=this._xfaStreams;if(!e)return null;const t=Object.create(null);for(const[r,a]of Object.entries(e))if(a)try{t[r]=(0,n.stringToUTF8String)(a.getString())}catch(e){(0,n.warn)("XFA - Invalid utf-8 string.");return null}return t}get xfaFactory(){let e;this.pdfManager.enableXfa&&this.catalog.needsRendering&&this.formInfo.hasXfa&&!this.formInfo.hasAcroForm&&(e=this.xfaData);return(0,n.shadow)(this,"xfaFactory",e?new x.XFAFactory(e):null)}get isPureXfa(){return!!this.xfaFactory&&this.xfaFactory.isValid()}get htmlForXfa(){return this.xfaFactory?this.xfaFactory.getPages():null}async loadXfaImages(){const e=await this.pdfManager.ensureCatalog("xfaImages");if(!e)return;const t=e.getKeys(),r=new p.ObjectLoader(e,t,this.xref);await r.load();const a=new Map;for(const r of t){const t=e.get(r);t instanceof c.BaseStream&&a.set(r,t.getBytes())}this.xfaFactory.setImages(a)}async loadXfaFonts(e,t){const r=await this.pdfManager.ensureCatalog("acroForm");if(!r)return;const a=await r.getAsync("DR");if(!(a instanceof s.Dict))return;const c=new p.ObjectLoader(a,["Font"],this.xref);await c.load();const l=a.get("Font");if(!(l instanceof s.Dict))return;const h=Object.assign(Object.create(null),this.pdfManager.evaluatorOptions);h.useSystemFonts=!1;const u=new b.PartialEvaluator({xref:this.xref,handler:e,pageIndex:-1,idFactory:this._globalIdFactory,fontCache:this.catalog.fontCache,builtInCMapCache:this.catalog.builtInCMapCache,standardFontDataCache:this.catalog.standardFontDataCache,options:h}),d=new m.OperatorList,f=[],g={get font(){return f.at(-1)},set font(e){f.push(e)},clone(){return this}},y=new Map;l.forEach(((e,t)=>{y.set(e,t)}));const w=[];for(const[e,r]of y){const o=r.get("FontDescriptor");if(!(o instanceof s.Dict))continue;let c=o.get("FontFamily");c=c.replace(/[ ]+(\d)/g,"$1");const l={fontFamily:c,fontWeight:o.get("FontWeight"),italicAngle:-o.get("ItalicAngle")};(0,i.validateCSSFont)(l)&&w.push(u.handleSetFont(a,[s.Name.get(e),1],null,d,t,g,null,l).catch((function(e){(0,n.warn)(`loadXfaFonts: "${e}".`);return null})))}await Promise.all(w);const S=this.xfaFactory.setFonts(f);if(!S)return;h.ignoreErrors=!0;w.length=0;f.length=0;const x=new Set;for(const e of S)(0,o.getXfaFontName)(`${e}-Regular`)||x.add(e);x.size&&S.push("PdfJS-Fallback");for(const e of S)if(!x.has(e))for(const r of[{name:"Regular",fontWeight:400,italicAngle:0},{name:"Bold",fontWeight:700,italicAngle:0},{name:"Italic",fontWeight:400,italicAngle:12},{name:"BoldItalic",fontWeight:700,italicAngle:12}]){const i=`${e}-${r.name}`,c=(0,o.getXfaFontDict)(i);w.push(u.handleSetFont(a,[s.Name.get(i),1],null,d,t,g,c,{fontFamily:e,fontWeight:r.fontWeight,italicAngle:r.italicAngle}).catch((function(e){(0,n.warn)(`loadXfaFonts: "${e}".`);return null})))}await Promise.all(w);this.xfaFactory.appendFonts(f,x)}async serializeXfaData(e){return this.xfaFactory?this.xfaFactory.serializeData(e):null}get formInfo(){const e={hasFields:!1,hasAcroForm:!1,hasXfa:!1,hasSignatures:!1},t=this.catalog.acroForm;if(!t)return(0,n.shadow)(this,"formInfo",e);try{const r=t.get("Fields"),a=Array.isArray(r)&&r.length>0;e.hasFields=a;const n=t.get("XFA");e.hasXfa=Array.isArray(n)&&n.length>0||n instanceof c.BaseStream&&!n.isEmpty;const i=!!(1&t.get("SigFlags")),s=i&&this._hasOnlyDocumentSignatures(r);e.hasAcroForm=a&&!s;e.hasSignatures=i}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.warn)(`Cannot fetch form information: "${e}".`)}return(0,n.shadow)(this,"formInfo",e)}get documentInfo(){let e=this._version;if("string"!=typeof e||!M.test(e)){(0,n.warn)(`Invalid PDF header version number: ${e}`);e=null}const t={PDFFormatVersion:e,Language:this.catalog.lang,EncryptFilterName:this.xref.encrypt?this.xref.encrypt.filterName:null,IsLinearized:!!this.linearization,IsAcroFormPresent:this.formInfo.hasAcroForm,IsXFAPresent:this.formInfo.hasXfa,IsCollectionPresent:!!this.catalog.collection,IsSignaturesPresent:this.formInfo.hasSignatures};let r;try{r=this.xref.trailer.get("Info")}catch(e){if(e instanceof i.MissingDataException)throw e;(0,n.info)("The document information dictionary is invalid.")}if(!(r instanceof s.Dict))return(0,n.shadow)(this,"documentInfo",t);for(const e of r.getKeys()){const a=r.get(e);switch(e){case"Title":case"Author":case"Subject":case"Keywords":case"Creator":case"Producer":case"CreationDate":case"ModDate":if("string"==typeof a){t[e]=(0,n.stringToPDFString)(a);continue}break;case"Trapped":if(a instanceof s.Name){t[e]=a;continue}break;default:let r;switch(typeof a){case"string":r=(0,n.stringToPDFString)(a);break;case"number":case"boolean":r=a;break;default:a instanceof s.Name&&(r=a)}if(void 0===r){(0,n.warn)(`Bad value, for custom key "${e}", in Info: ${a}.`);continue}t.Custom||(t.Custom=Object.create(null));t.Custom[e]=r;continue}(0,n.warn)(`Bad value, for key "${e}", in Info: ${a}.`)}return(0,n.shadow)(this,"documentInfo",t)}get fingerprints(){function validate(e){return"string"==typeof e&&e.length>0&&"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"!==e}function hexString(e){const t=[];for(let r=0,a=e.length;r<a;r++){const a=e[r].toString(16);t.push(a.padStart(2,"0"))}return t.join("")}const e=this.xref.trailer.get("ID");let t,r;if(Array.isArray(e)&&validate(e[0])){t=(0,n.stringToBytes)(e[0]);e[1]!==e[0]&&validate(e[1])&&(r=(0,n.stringToBytes)(e[1]))}else t=(0,l.calculateMD5)(this.stream.getByteRange(0,1024),0,1024);return(0,n.shadow)(this,"fingerprints",[hexString(t),r?hexString(r):null])}async _getLinearizationPage(e){const{catalog:t,linearization:r,xref:a}=this,i=s.Ref.get(r.objectNumberFirst,0);try{const e=await a.fetchAsync(i);if(e instanceof s.Dict){let r=e.getRaw("Type");r instanceof s.Ref&&(r=await a.fetchAsync(r));if((0,s.isName)(r,"Page")||!e.has("Type")&&!e.has("Kids")){t.pageKidsCountCache.has(i)||t.pageKidsCountCache.put(i,1);t.pageIndexCache.has(i)||t.pageIndexCache.put(i,0);return[e,i]}}throw new n.FormatError("The Linearization dictionary doesn't point to a valid Page dictionary.")}catch(r){(0,n.warn)(`_getLinearizationPage: "${r.message}".`);return t.getPageDict(e)}}getPage(e){const t=this._pagePromises.get(e);if(t)return t;const{catalog:r,linearization:a,xfaFactory:n}=this;let i;i=n?Promise.resolve([s.Dict.empty,null]):a&&a.pageFirst===e?this._getLinearizationPage(e):r.getPageDict(e);i=i.then((t=>{let[a,i]=t;return new Page({pdfManager:this.pdfManager,xref:this.xref,pageIndex:e,pageDict:a,ref:i,globalIdFactory:this._globalIdFactory,fontCache:r.fontCache,builtInCMapCache:r.builtInCMapCache,standardFontDataCache:r.standardFontDataCache,globalImageCache:r.globalImageCache,nonBlendModesSet:r.nonBlendModesSet,xfaFactory:n})}));this._pagePromises.set(e,i);return i}async checkFirstPage(){if(!(arguments.length>0&&void 0!==arguments[0]&&arguments[0]))try{await this.getPage(0)}catch(e){if(e instanceof i.XRefEntryException){this._pagePromises.delete(0);await this.cleanup();throw new i.XRefParseException}}}async checkLastPage(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{catalog:t,pdfManager:r}=this;t.setActualNumPages();let a;try{await Promise.all([r.ensureDoc("xfaFactory"),r.ensureDoc("linearization"),r.ensureCatalog("numPages")]);if(this.xfaFactory)return;a=this.linearization?this.linearization.numPages:t.numPages;if(!Number.isInteger(a))throw new n.FormatError("Page count is not an integer.");if(a<=1)return;await this.getPage(a-1)}catch(s){this._pagePromises.delete(a-1);await this.cleanup();if(s instanceof i.XRefEntryException&&!e)throw new i.XRefParseException;(0,n.warn)(`checkLastPage - invalid /Pages tree /Count: ${a}.`);let o;try{o=await t.getAllPageDicts(e)}catch(r){if(r instanceof i.XRefEntryException&&!e)throw new i.XRefParseException;t.setActualNumPages(1);return}for(const[e,[a,n]]of o){let i;if(a instanceof Error){i=Promise.reject(a);i.catch((()=>{}))}else i=Promise.resolve(new Page({pdfManager:r,xref:this.xref,pageIndex:e,pageDict:a,ref:n,globalIdFactory:this._globalIdFactory,fontCache:t.fontCache,builtInCMapCache:t.builtInCMapCache,standardFontDataCache:t.standardFontDataCache,globalImageCache:t.globalImageCache,nonBlendModesSet:t.nonBlendModesSet,xfaFactory:null}));this._pagePromises.set(e,i)}t.setActualNumPages(o.size)}}fontFallback(e,t){return this.catalog.fontFallback(e,t)}async cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.catalog?this.catalog.cleanup(e):(0,u.clearGlobalCaches)()}_collectFieldObjects(e,t,r){const i=this.xref.fetchIfRef(t);if(i.has("T")){const t=(0,n.stringToPDFString)(i.get("T"));e=""===e?t:`${e}.${t}`}r.has(e)||r.set(e,[]);r.get(e).push(a.AnnotationFactory.create(this.xref,t,this.pdfManager,this._localIdFactory,!0).then((e=>e&&e.getFieldObject())).catch((function(e){(0,n.warn)(`_collectFieldObjects: "${e}".`);return null})));if(i.has("Kids")){const t=i.get("Kids");for(const a of t)this._collectFieldObjects(e,a,r)}}get fieldObjects(){if(!this.formInfo.hasFields)return(0,n.shadow)(this,"fieldObjects",Promise.resolve(null));const e=Object.create(null),t=new Map;for(const e of this.catalog.acroForm.get("Fields"))this._collectFieldObjects("",e,t);const r=[];for(const[a,n]of t)r.push(Promise.all(n).then((t=>{(t=t.filter((e=>!!e))).length>0&&(e[a]=t)})));return(0,n.shadow)(this,"fieldObjects",Promise.all(r).then((()=>e)))}get hasJSActions(){const e=this.pdfManager.ensureDoc("_parseHasJSActions");return(0,n.shadow)(this,"hasJSActions",e)}async _parseHasJSActions(){const[e,t]=await Promise.all([this.pdfManager.ensureCatalog("jsActions"),this.pdfManager.ensureDoc("fieldObjects")]);return!!e||!!t&&Object.values(t).some((e=>e.some((e=>null!==e.actions))))}get calculationOrderIds(){const e=this.catalog.acroForm;if(!e||!e.has("CO"))return(0,n.shadow)(this,"calculationOrderIds",null);const t=e.get("CO");if(!Array.isArray(t)||0===t.length)return(0,n.shadow)(this,"calculationOrderIds",null);const r=[];for(const e of t)e instanceof s.Ref&&r.push(e.toString());return 0===r.length?(0,n.shadow)(this,"calculationOrderIds",null):(0,n.shadow)(this,"calculationOrderIds",r)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PopupAnnotation=t.MarkupAnnotation=t.AnnotationFactory=t.AnnotationBorderStyle=t.Annotation=void 0;t.getQuadPoints=getQuadPoints;var a=r(2),n=r(134),i=r(141),s=r(133),o=r(193),c=r(135),l=r(188),h=r(197),u=r(142),d=r(200),f=r(203),g=r(190),p=r(138),m=r(204);t.AnnotationFactory=class AnnotationFactory{static create(e,t,r,a,n){return Promise.all([r.ensureCatalog("acroForm"),r.ensureCatalog("baseUrl"),r.ensureDoc("xfaDatasets"),n?this._getPageIndex(e,t,r):-1]).then((i=>{let[s,o,c,l]=i;return r.ensure(this,"_create",[e,t,r,a,s,c,n,l])}))}static _create(e,t,r,i,o,c,l){let h=arguments.length>7&&void 0!==arguments[7]?arguments[7]:-1;const u=e.fetchIfRef(t);if(!(u instanceof s.Dict))return;const d=t instanceof s.Ref?t.toString():`annot_${i.createObjId()}`;let f=u.get("Subtype");f=f instanceof s.Name?f.name:null;const g={xref:e,ref:t,dict:u,subtype:f,id:d,pdfManager:r,acroForm:o instanceof s.Dict?o:s.Dict.empty,xfaDatasets:c,collectFields:l,pageIndex:h};switch(f){case"Link":return new LinkAnnotation(g);case"Text":return new TextAnnotation(g);case"Widget":let e=(0,n.getInheritableProperty)({dict:u,key:"FT"});e=e instanceof s.Name?e.name:null;switch(e){case"Tx":return new TextWidgetAnnotation(g);case"Btn":return new ButtonWidgetAnnotation(g);case"Ch":return new ChoiceWidgetAnnotation(g);case"Sig":return new SignatureWidgetAnnotation(g)}(0,a.warn)(`Unimplemented widget field type "${e}", falling back to base field type.`);return new WidgetAnnotation(g);case"Popup":return new PopupAnnotation(g);case"FreeText":return new FreeTextAnnotation(g);case"Line":return new LineAnnotation(g);case"Square":return new SquareAnnotation(g);case"Circle":return new CircleAnnotation(g);case"PolyLine":return new PolylineAnnotation(g);case"Polygon":return new PolygonAnnotation(g);case"Caret":return new CaretAnnotation(g);case"Ink":return new InkAnnotation(g);case"Highlight":return new HighlightAnnotation(g);case"Underline":return new UnderlineAnnotation(g);case"Squiggly":return new SquigglyAnnotation(g);case"StrikeOut":return new StrikeOutAnnotation(g);case"Stamp":return new StampAnnotation(g);case"FileAttachment":return new FileAttachmentAnnotation(g);default:l||(f?(0,a.warn)(`Unimplemented annotation type "${f}", falling back to base annotation.`):(0,a.warn)("Annotation is missing the required /Subtype."));return new Annotation(g)}}static async _getPageIndex(e,t,r){try{const a=await e.fetchIfRefAsync(t);if(!(a instanceof s.Dict))return-1;const n=a.getRaw("P");if(!(n instanceof s.Ref))return-1;return await r.ensureCatalog("getPageIndex",[n])}catch(e){(0,a.warn)(`_getPageIndex: "${e}".`);return-1}}static async saveNewAnnotations(e,t,r){const n=e.xref;let i;const c=[],l=[];for(const h of r)switch(h.annotationType){case a.AnnotationEditorType.FREETEXT:if(!i){const e=new s.Dict(n);e.set("BaseFont",s.Name.get("Helvetica"));e.set("Type",s.Name.get("Font"));e.set("Subtype",s.Name.get("Type1"));e.set("Encoding",s.Name.get("WinAnsiEncoding"));const t=[];i=n.getNewRef();(0,o.writeObject)(i,e,t,null);c.push({ref:i,data:t.join("")})}l.push(FreeTextAnnotation.createNewAnnotation(n,h,c,{evaluator:e,task:t,baseFontRef:i}));break;case a.AnnotationEditorType.INK:l.push(InkAnnotation.createNewAnnotation(n,h,c))}return{annotations:await Promise.all(l),dependencies:c}}static async printNewAnnotations(e,t,r){if(!r)return null;const n=e.xref,i=[];for(const s of r)switch(s.annotationType){case a.AnnotationEditorType.FREETEXT:i.push(FreeTextAnnotation.createNewPrintAnnotation(n,s,{evaluator:e,task:t}));break;case a.AnnotationEditorType.INK:i.push(InkAnnotation.createNewPrintAnnotation(n,s))}return Promise.all(i)}};function getRgbColor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Uint8ClampedArray(3);if(!Array.isArray(e))return t;const r=t||new Uint8ClampedArray(3);switch(e.length){case 0:return null;case 1:u.ColorSpace.singletons.gray.getRgbItem(e,0,r,0);return r;case 3:u.ColorSpace.singletons.rgb.getRgbItem(e,0,r,0);return r;case 4:u.ColorSpace.singletons.cmyk.getRgbItem(e,0,r,0);return r;default:return t}}function getQuadPoints(e,t){if(!e.has("QuadPoints"))return null;const r=e.getArray("QuadPoints");if(!Array.isArray(r)||0===r.length||r.length%8>0)return null;const a=[];for(let e=0,n=r.length/8;e<n;e++){a.push([]);for(let n=8*e,i=8*e+8;n<i;n+=2){const i=r[n],s=r[n+1];if(null!==t&&(i<t[0]||i>t[2]||s<t[1]||s>t[3]))return null;a[e].push({x:i,y:s})}}return a.map((e=>{const[t,r,a,n]=e.reduce(((e,t)=>{let[r,a,n,i]=e;return[Math.min(r,t.x),Math.max(a,t.x),Math.min(n,t.y),Math.max(i,t.y)]}),[Number.MAX_VALUE,Number.MIN_VALUE,Number.MAX_VALUE,Number.MIN_VALUE]);return[{x:t,y:n},{x:r,y:n},{x:t,y:a},{x:r,y:a}]}))}function getTransformMatrix(e,t,r){const[n,i,s,o]=a.Util.getAxialAlignedBoundingBox(t,r);if(n===s||i===o)return[1,0,0,1,e[0],e[1]];const c=(e[2]-e[0])/(s-n),l=(e[3]-e[1])/(o-i);return[c,0,0,l,e[0]-n*c,e[1]-i*l]}class Annotation{constructor(e){const t=e.dict;this.setTitle(t.get("T"));this.setContents(t.get("Contents"));this.setModificationDate(t.get("M"));this.setFlags(t.get("F"));this.setRectangle(t.getArray("Rect"));this.setColor(t.getArray("C"));this.setBorderStyle(t);this.setAppearance(t);this.setOptionalContent(t);const r=t.get("MK");this.setBorderAndBackgroundColors(r);this.setRotation(r);this._streams=[];this.appearance&&this._streams.push(this.appearance);this.data={annotationFlags:this.flags,borderStyle:this.borderStyle,color:this.color,backgroundColor:this.backgroundColor,borderColor:this.borderColor,rotation:this.rotation,contentsObj:this._contents,hasAppearance:!!this.appearance,id:e.id,modificationDate:this.modificationDate,rect:this.rectangle,subtype:e.subtype,hasOwnCanvas:!1};if(e.collectFields){const r=t.get("Kids");if(Array.isArray(r)){const e=[];for(const t of r)t instanceof s.Ref&&e.push(t.toString());0!==e.length&&(this.data.kidIds=e)}this.data.actions=(0,n.collectActions)(e.xref,t,a.AnnotationActionEventType);this.data.fieldName=this._constructFieldName(t);this.data.pageIndex=e.pageIndex}this._fallbackFontDict=null}_hasFlag(e,t){return!!(e&t)}_isViewable(e){return!this._hasFlag(e,a.AnnotationFlag.INVISIBLE)&&!this._hasFlag(e,a.AnnotationFlag.NOVIEW)}_isPrintable(e){return this._hasFlag(e,a.AnnotationFlag.PRINT)&&!this._hasFlag(e,a.AnnotationFlag.INVISIBLE)}mustBeViewed(e){const t=e&&e.get(this.data.id);return t&&void 0!==t.hidden?!t.hidden:this.viewable&&!this._hasFlag(this.flags,a.AnnotationFlag.HIDDEN)}mustBePrinted(e){const t=e&&e.get(this.data.id);return t&&void 0!==t.print?t.print:this.printable}get viewable(){return null!==this.data.quadPoints&&(0===this.flags||this._isViewable(this.flags))}get printable(){return null!==this.data.quadPoints&&(0!==this.flags&&this._isPrintable(this.flags))}_parseStringHelper(e){const t="string"==typeof e?(0,a.stringToPDFString)(e):"";return{str:t,dir:t&&"rtl"===(0,l.bidi)(t).dir?"rtl":"ltr"}}setTitle(e){this._title=this._parseStringHelper(e)}setContents(e){this._contents=this._parseStringHelper(e)}setModificationDate(e){this.modificationDate="string"==typeof e?e:null}setFlags(e){this.flags=Number.isInteger(e)&&e>0?e:0}hasFlag(e){return this._hasFlag(this.flags,e)}setRectangle(e){Array.isArray(e)&&4===e.length?this.rectangle=a.Util.normalizeRect(e):this.rectangle=[0,0,0,0]}setColor(e){this.color=getRgbColor(e)}setLineEndings(e){this.lineEndings=["None","None"];if(Array.isArray(e)&&2===e.length)for(let t=0;t<2;t++){const r=e[t];if(r instanceof s.Name)switch(r.name){case"None":continue;case"Square":case"Circle":case"Diamond":case"OpenArrow":case"ClosedArrow":case"Butt":case"ROpenArrow":case"RClosedArrow":case"Slash":this.lineEndings[t]=r.name;continue}(0,a.warn)(`Ignoring invalid lineEnding: ${r}`)}}setRotation(e){this.rotation=0;if(e instanceof s.Dict){let t=e.get("R")||0;if(Number.isInteger(t)&&0!==t){t%=360;t<0&&(t+=360);t%90==0&&(this.rotation=t)}}}setBorderAndBackgroundColors(e){if(e instanceof s.Dict){this.borderColor=getRgbColor(e.getArray("BC"),null);this.backgroundColor=getRgbColor(e.getArray("BG"),null)}else this.borderColor=this.backgroundColor=null}setBorderStyle(e){this.borderStyle=new AnnotationBorderStyle;if(e instanceof s.Dict)if(e.has("BS")){const t=e.get("BS"),r=t.get("Type");if(!r||(0,s.isName)(r,"Border")){this.borderStyle.setWidth(t.get("W"),this.rectangle);this.borderStyle.setStyle(t.get("S"));this.borderStyle.setDashArray(t.getArray("D"))}}else if(e.has("Border")){const t=e.getArray("Border");if(Array.isArray(t)&&t.length>=3){this.borderStyle.setHorizontalCornerRadius(t[0]);this.borderStyle.setVerticalCornerRadius(t[1]);this.borderStyle.setWidth(t[2],this.rectangle);4===t.length&&this.borderStyle.setDashArray(t[3],!0)}}else this.borderStyle.setWidth(0)}setAppearance(e){this.appearance=null;const t=e.get("AP");if(!(t instanceof s.Dict))return;const r=t.get("N");if(r instanceof c.BaseStream){this.appearance=r;return}if(!(r instanceof s.Dict))return;const a=e.get("AS");a instanceof s.Name&&r.has(a.name)&&(this.appearance=r.get(a.name))}setOptionalContent(e){this.oc=null;const t=e.get("OC");t instanceof s.Name?(0,a.warn)("setOptionalContent: Support for /Name-entry is not implemented."):t instanceof s.Dict&&(this.oc=t)}loadResources(e,t){return t.dict.getAsync("Resources").then((t=>{if(!t)return;return new f.ObjectLoader(t,e,t.xref).load().then((function(){return t}))}))}async getOperatorList(e,t,r,n,i){const o=this.data;let c=this.appearance;const l=!!(this.data.hasOwnCanvas&&r&a.RenderingIntentFlag.DISPLAY);if(!c){if(!l)return{opList:new g.OperatorList,separateForm:!1,separateCanvas:!1};c=new p.StringStream("");c.dict=new s.Dict}const h=c.dict,u=await this.loadResources(["ExtGState","ColorSpace","Pattern","Shading","XObject","Font"],c),d=h.getArray("BBox")||[0,0,1,1],f=h.getArray("Matrix")||[1,0,0,1,0,0],m=getTransformMatrix(o.rect,d,f),b=new g.OperatorList;let y;this.oc&&(y=await e.parseMarkedContentProps(this.oc,null));void 0!==y&&b.addOp(a.OPS.beginMarkedContentProps,["OC",y]);b.addOp(a.OPS.beginAnnotation,[o.id,o.rect,m,f,l]);await e.getOperatorList({stream:c,task:t,resources:u,operatorList:b,fallbackFontDict:this._fallbackFontDict});b.addOp(a.OPS.endAnnotation,[]);void 0!==y&&b.addOp(a.OPS.endMarkedContent,[]);this.reset();return{opList:b,separateForm:!1,separateCanvas:l}}async save(e,t,r){return null}get hasTextContent(){return!1}async extractTextContent(e,t,r){if(!this.appearance)return;const a=await this.loadResources(["ExtGState","Font","Properties","XObject"],this.appearance),n=[],i=[],s={desiredSize:Math.Infinity,ready:!0,enqueue(e,t){for(const t of e.items){i.push(t.str);if(t.hasEOL){n.push(i.join(""));i.length=0}}}};await e.getTextContent({stream:this.appearance,task:t,resources:a,includeMarkedContent:!0,combineTextItems:!0,sink:s,viewBox:r});this.reset();i.length&&n.push(i.join(""));n.length>0&&(this.data.textContent=n)}getFieldObject(){return this.data.kidIds?{id:this.data.id,actions:this.data.actions,name:this.data.fieldName,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,type:"",kidIds:this.data.kidIds,page:this.data.pageIndex,rotation:this.rotation}:null}reset(){for(const e of this._streams)e.reset()}_constructFieldName(e){if(!e.has("T")&&!e.has("Parent")){(0,a.warn)("Unknown field name, falling back to empty field name.");return""}if(!e.has("Parent"))return(0,a.stringToPDFString)(e.get("T"));const t=[];e.has("T")&&t.unshift((0,a.stringToPDFString)(e.get("T")));let r=e;const n=new s.RefSet;e.objId&&n.put(e.objId);for(;r.has("Parent");){r=r.get("Parent");if(!(r instanceof s.Dict)||r.objId&&n.has(r.objId))break;r.objId&&n.put(r.objId);r.has("T")&&t.unshift((0,a.stringToPDFString)(r.get("T")))}return t.join(".")}}t.Annotation=Annotation;class AnnotationBorderStyle{constructor(){this.width=1;this.style=a.AnnotationBorderStyleType.SOLID;this.dashArray=[3];this.horizontalCornerRadius=0;this.verticalCornerRadius=0}setWidth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0];if(e instanceof s.Name)this.width=0;else if("number"==typeof e){if(e>0){const r=(t[2]-t[0])/2,n=(t[3]-t[1])/2;if(r>0&&n>0&&(e>r||e>n)){(0,a.warn)(`AnnotationBorderStyle.setWidth - ignoring width: ${e}`);e=1}}this.width=e}}setStyle(e){if(e instanceof s.Name)switch(e.name){case"S":this.style=a.AnnotationBorderStyleType.SOLID;break;case"D":this.style=a.AnnotationBorderStyleType.DASHED;break;case"B":this.style=a.AnnotationBorderStyleType.BEVELED;break;case"I":this.style=a.AnnotationBorderStyleType.INSET;break;case"U":this.style=a.AnnotationBorderStyleType.UNDERLINE}}setDashArray(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(e)&&e.length>0){let r=!0,a=!0;for(const t of e){if(!(+t>=0)){r=!1;break}t>0&&(a=!1)}if(r&&!a){this.dashArray=e;t&&this.setStyle(s.Name.get("D"))}else this.width=0}else e&&(this.width=0)}setHorizontalCornerRadius(e){Number.isInteger(e)&&(this.horizontalCornerRadius=e)}setVerticalCornerRadius(e){Number.isInteger(e)&&(this.verticalCornerRadius=e)}}t.AnnotationBorderStyle=AnnotationBorderStyle;class MarkupAnnotation extends Annotation{constructor(e){super(e);const t=e.dict;if(t.has("IRT")){const e=t.getRaw("IRT");this.data.inReplyTo=e instanceof s.Ref?e.toString():null;const r=t.get("RT");this.data.replyType=r instanceof s.Name?r.name:a.AnnotationReplyType.REPLY}if(this.data.replyType===a.AnnotationReplyType.GROUP){const e=t.get("IRT");this.setTitle(e.get("T"));this.data.titleObj=this._title;this.setContents(e.get("Contents"));this.data.contentsObj=this._contents;if(e.has("CreationDate")){this.setCreationDate(e.get("CreationDate"));this.data.creationDate=this.creationDate}else this.data.creationDate=null;if(e.has("M")){this.setModificationDate(e.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;this.data.hasPopup=e.has("Popup");if(e.has("C")){this.setColor(e.getArray("C"));this.data.color=this.color}else this.data.color=null}else{this.data.titleObj=this._title;this.setCreationDate(t.get("CreationDate"));this.data.creationDate=this.creationDate;this.data.hasPopup=t.has("Popup");t.has("C")||(this.data.color=null)}t.has("RC")&&(this.data.richText=m.XFAFactory.getRichTextAsHtml(t.get("RC")))}setCreationDate(e){this.creationDate="string"==typeof e?e:null}_setDefaultAppearance(e){let{xref:t,extra:r,strokeColor:a,fillColor:n,blendMode:i,strokeAlpha:o,fillAlpha:c,pointsCallback:l}=e,h=Number.MAX_VALUE,u=Number.MAX_VALUE,d=Number.MIN_VALUE,f=Number.MIN_VALUE;const g=["q"];r&&g.push(r);a&&g.push(`${a[0]} ${a[1]} ${a[2]} RG`);n&&g.push(`${n[0]} ${n[1]} ${n[2]} rg`);let m=this.data.quadPoints;m||(m=[[{x:this.rectangle[0],y:this.rectangle[3]},{x:this.rectangle[2],y:this.rectangle[3]},{x:this.rectangle[0],y:this.rectangle[1]},{x:this.rectangle[2],y:this.rectangle[1]}]]);for(const e of m){const[t,r,a,n]=l(g,e);h=Math.min(h,t);d=Math.max(d,r);u=Math.min(u,a);f=Math.max(f,n)}g.push("Q");const b=new s.Dict(t),y=new s.Dict(t);y.set("Subtype",s.Name.get("Form"));const w=new p.StringStream(g.join(" "));w.dict=y;b.set("Fm0",w);const S=new s.Dict(t);i&&S.set("BM",s.Name.get(i));"number"==typeof o&&S.set("CA",o);"number"==typeof c&&S.set("ca",c);const x=new s.Dict(t);x.set("GS0",S);const k=new s.Dict(t);k.set("ExtGState",x);k.set("XObject",b);const C=new s.Dict(t);C.set("Resources",k);const v=this.data.rect=[h,u,d,f];C.set("BBox",v);this.appearance=new p.StringStream("/GS0 gs /Fm0 Do");this.appearance.dict=C;this._streams.push(this.appearance,w)}static async createNewAnnotation(e,t,r,a){const n=e.getNewRef(),i=e.getNewRef(),s=this.createNewDict(t,e,{apRef:i}),c=await this.createNewAppearanceStream(t,e,a),l=[];let h=e.encrypt?e.encrypt.createCipherTransform(i.num,i.gen):null;(0,o.writeObject)(i,c,l,h);r.push({ref:i,data:l.join("")});l.length=0;h=e.encrypt?e.encrypt.createCipherTransform(n.num,n.gen):null;(0,o.writeObject)(n,s,l,h);return{ref:n,data:l.join("")}}static async createNewPrintAnnotation(e,t,r){const a=await this.createNewAppearanceStream(t,e,r),n=this.createNewDict(t,e,{ap:a});return new this.prototype.constructor({dict:n,xref:e})}}t.MarkupAnnotation=MarkupAnnotation;class WidgetAnnotation extends Annotation{constructor(e){super(e);const t=e.dict,r=this.data;this.ref=e.ref;r.annotationType=a.AnnotationType.WIDGET;void 0===r.fieldName&&(r.fieldName=this._constructFieldName(t));void 0===r.actions&&(r.actions=(0,n.collectActions)(e.xref,t,a.AnnotationActionEventType));let o=(0,n.getInheritableProperty)({dict:t,key:"V",getArray:!0});r.fieldValue=this._decodeFormValue(o);const c=(0,n.getInheritableProperty)({dict:t,key:"DV",getArray:!0});r.defaultFieldValue=this._decodeFormValue(c);if(void 0===o&&e.xfaDatasets){const t=this._title.str;if(t){this._hasValueFromXFA=!0;r.fieldValue=o=e.xfaDatasets.getValue(t)}}void 0===o&&null!==r.defaultFieldValue&&(r.fieldValue=r.defaultFieldValue);r.alternativeText=(0,a.stringToPDFString)(t.get("TU")||"");const l=(0,n.getInheritableProperty)({dict:t,key:"DA"})||e.acroForm.get("DA");this._defaultAppearance="string"==typeof l?l:"";r.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance);const h=(0,n.getInheritableProperty)({dict:t,key:"FT"});r.fieldType=h instanceof s.Name?h.name:null;const u=(0,n.getInheritableProperty)({dict:t,key:"DR"}),d=e.acroForm.get("DR"),f=this.appearance&&this.appearance.dict.get("Resources");this._fieldResources={localResources:u,acroFormResources:d,appearanceResources:f,mergedResources:s.Dict.merge({xref:e.xref,dictArray:[u,f,d],mergeSubDicts:!0})};r.fieldFlags=(0,n.getInheritableProperty)({dict:t,key:"Ff"});(!Number.isInteger(r.fieldFlags)||r.fieldFlags<0)&&(r.fieldFlags=0);r.readOnly=this.hasFieldFlag(a.AnnotationFieldFlag.READONLY);r.required=this.hasFieldFlag(a.AnnotationFieldFlag.REQUIRED);r.hidden=this._hasFlag(r.annotationFlags,a.AnnotationFlag.HIDDEN)}_decodeFormValue(e){return Array.isArray(e)?e.filter((e=>"string"==typeof e)).map((e=>(0,a.stringToPDFString)(e))):e instanceof s.Name?(0,a.stringToPDFString)(e.name):"string"==typeof e?(0,a.stringToPDFString)(e):null}hasFieldFlag(e){return!!(this.data.fieldFlags&e)}static _getRotationMatrix(e,t,r){switch(e){case 90:return[0,1,-1,0,t,0];case 180:return[-1,0,0,-1,t,r];case 270:return[0,-1,1,0,0,r];default:throw new Error("Invalid rotation")}}getRotationMatrix(e){const t=e?e.get(this.data.id):void 0;let r=t&&t.rotation;void 0===r&&(r=this.rotation);if(0===r)return a.IDENTITY_MATRIX;const n=this.data.rect[2]-this.data.rect[0],i=this.data.rect[3]-this.data.rect[1];return WidgetAnnotation._getRotationMatrix(r,n,i)}getBorderAndBackgroundAppearances(e){const t=e?e.get(this.data.id):void 0;let r=t&&t.rotation;void 0===r&&(r=this.rotation);if(!this.backgroundColor&&!this.borderColor)return"";const a=this.data.rect[2]-this.data.rect[0],n=this.data.rect[3]-this.data.rect[1],s=0===r||180===r?`0 0 ${a} ${n} re`:`0 0 ${n} ${a} re`;let o="";this.backgroundColor&&(o=`${(0,i.getPdfColor)(this.backgroundColor,!0)} ${s} f `);if(this.borderColor){o+=`${this.borderStyle.width||1} w ${(0,i.getPdfColor)(this.borderColor,!1)} ${s} S `}return o}async getOperatorList(e,t,r,n,i){if(n&&!(this instanceof SignatureWidgetAnnotation))return{opList:new g.OperatorList,separateForm:!0,separateCanvas:!1};if(!this._hasText)return super.getOperatorList(e,t,r,n,i);const s=await this._getAppearance(e,t,i);if(this.appearance&&null===s)return super.getOperatorList(e,t,r,n,i);const o=new g.OperatorList;if(!this._defaultAppearance||null===s)return{opList:o,separateForm:!1,separateCanvas:!1};const c=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]],l=getTransformMatrix(this.data.rect,c,[1,0,0,1,0,0]);let h;this.oc&&(h=await e.parseMarkedContentProps(this.oc,null));void 0!==h&&o.addOp(a.OPS.beginMarkedContentProps,["OC",h]);o.addOp(a.OPS.beginAnnotation,[this.data.id,this.data.rect,l,this.getRotationMatrix(i),!1]);const u=new p.StringStream(s);await e.getOperatorList({stream:u,task:t,resources:this._fieldResources.mergedResources,operatorList:o});o.addOp(a.OPS.endAnnotation,[]);void 0!==h&&o.addOp(a.OPS.endMarkedContent,[]);return{opList:o,separateForm:!1,separateCanvas:!1}}_getMKDict(e){const t=new s.Dict(null);e&&t.set("R",e);this.borderColor&&t.set("BC",Array.from(this.borderColor).map((e=>e/255)));this.backgroundColor&&t.set("BG",Array.from(this.backgroundColor).map((e=>e/255)));return t.size>0?t:null}async save(e,t,r){const n=r?r.get(this.data.id):void 0;let i=n&&n.value,c=n&&n.rotation;if(i===this.data.fieldValue||void 0===i){if(!this._hasValueFromXFA&&void 0===c)return null;i=i||this.data.fieldValue}if(void 0===c&&!this._hasValueFromXFA&&Array.isArray(i)&&Array.isArray(this.data.fieldValue)&&i.length===this.data.fieldValue.length&&i.every(((e,t)=>e===this.data.fieldValue[t])))return null;void 0===c&&(c=this.rotation);let l=await this._getAppearance(e,t,r);if(null===l)return null;const{xref:h}=e,u=h.fetchIfRef(this.ref);if(!(u instanceof s.Dict))return null;const d=[0,0,this.data.rect[2]-this.data.rect[0],this.data.rect[3]-this.data.rect[1]],f={path:(0,a.stringToPDFString)(u.get("T")||""),value:i},g=h.getNewRef(),p=new s.Dict(h);p.set("N",g);const m=h.encrypt;let b=null,y=null;if(m){b=m.createCipherTransform(this.ref.num,this.ref.gen);y=m.createCipherTransform(g.num,g.gen);l=y.encryptString(l)}const encoder=e=>(0,a.isAscii)(e)?e:(0,a.stringToUTF16BEString)(e);u.set("V",Array.isArray(i)?i.map(encoder):encoder(i));u.set("AP",p);u.set("M",`D:${(0,a.getModificationDate)()}`);const w=this._getMKDict(c);w&&u.set("MK",w);const S=new s.Dict(h);S.set("Length",l.length);S.set("Subtype",s.Name.get("Form"));S.set("Resources",this._getSaveFieldResources(h));S.set("BBox",d);const x=this.getRotationMatrix(r);x!==a.IDENTITY_MATRIX&&S.set("Matrix",x);const k=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(u,k,b);k.push("\nendobj\n");const C=[`${g.num} ${g.gen} obj\n`];(0,o.writeDict)(S,C,y);C.push(" stream\n",l,"\nendstream\nendobj\n");return[{ref:this.ref,data:k.join(""),xfa:f},{ref:g,data:C.join(""),xfa:null}]}async _getAppearance(e,t,r){if(this.hasFieldFlag(a.AnnotationFieldFlag.PASSWORD))return null;const n=r?r.get(this.data.id):void 0;let s,o;if(n){s=n.formattedValue||n.value;o=n.rotation}if(void 0===o&&void 0===s&&(!this._hasValueFromXFA||this.appearance))return null;if(void 0===s){s=this.data.fieldValue;if(!s)return""}Array.isArray(s)&&1===s.length&&(s=s[0]);(0,a.assert)("string"==typeof s,"Expected `value` to be a string.");s=s.trim();if(""===s)return"";void 0===o&&(o=this.rotation);let c=-1;this.data.multiLine&&(c=s.split(/\r\n|\r|\n/).length);let l=this.data.rect[3]-this.data.rect[1],h=this.data.rect[2]-this.data.rect[0];90!==o&&270!==o||([h,l]=[l,h]);this._defaultAppearance||(this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const u=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources),[d,f]=this._computeFontSize(l-2,h-4,s,u,c);let g=u.descent;isNaN(g)&&(g=0);const p=Math.min(Math.floor((l-f)/2),2)+Math.abs(g)*f,m=this.data.textAlignment;if(this.data.multiLine)return this._getMultilineAppearance(d,s,u,f,h,l,m,2,p,r);const b=u.encodeString(s).join("");if(this.data.comb)return this._getCombAppearance(d,u,b,h,2,p,r);const y=this.getBorderAndBackgroundAppearances(r);if(0===m||m>2)return`/Tx BMC q ${y}BT `+d+` 1 0 0 1 2 ${p} Tm (${(0,a.escapeString)(b)}) Tj ET Q EMC`;return`/Tx BMC q ${y}BT `+d+` 1 0 0 1 0 0 Tm ${this._renderText(b,u,f,h,m,2,p)} ET Q EMC`}static async _getFontData(e,t,r,a){const n=new g.OperatorList,i={font:null,clone(){return this}},{fontName:o,fontSize:c}=r;await e.handleSetFont(a,[o&&s.Name.get(o),c],null,n,t,i,null);return i.font}_getTextWidth(e,t){return t.charsToGlyphs(e).reduce(((e,t)=>e+t.width),0)/1e3}_computeFontSize(e,t,r,n,s){let{fontSize:o}=this.data.defaultAppearanceData;if(!o){const roundWithTwoDigits=e=>Math.floor(100*e)/100;if(-1===s){const i=this._getTextWidth(r,n);o=roundWithTwoDigits(Math.min(e/a.LINE_FACTOR,t/i))}else{const i=r.split(/\r\n?|\n/),c=[];for(const e of i){const t=n.encodeString(e).join(""),r=n.charsToGlyphs(t),a=n.getCharPositions(t);c.push({line:t,glyphs:r,positions:a})}const isTooBig=r=>{let a=0;for(const i of c){a+=this._splitLine(null,n,r,t,i).length*r;if(a>e)return!0}return!1};o=12;let l=o*a.LINE_FACTOR,h=Math.round(e/l);h=Math.max(h,s);for(;;){l=e/h;o=roundWithTwoDigits(l/a.LINE_FACTOR);if(!isTooBig(o))break;h++}}const{fontName:c,fontColor:l}=this.data.defaultAppearanceData;this._defaultAppearance=(0,i.createDefaultAppearance)({fontSize:o,fontName:c,fontColor:l})}return[this._defaultAppearance,o]}_renderText(e,t,r,i,s,o,c){let l;if(1===s){l=(i-this._getTextWidth(e,t)*r)/2}else if(2===s){l=i-this._getTextWidth(e,t)*r-o}else l=o;l=(0,n.numberToString)(l);return`${l} ${c=(0,n.numberToString)(c)} Td (${(0,a.escapeString)(e)}) Tj`}_getSaveFieldResources(e){const{localResources:t,appearanceResources:r,acroFormResources:a}=this._fieldResources,n=this.data.defaultAppearanceData&&this.data.defaultAppearanceData.fontName;if(!n)return t||s.Dict.empty;for(const e of[t,r])if(e instanceof s.Dict){const t=e.get("Font");if(t instanceof s.Dict&&t.has(n))return e}if(a instanceof s.Dict){const r=a.get("Font");if(r instanceof s.Dict&&r.has(n)){const a=new s.Dict(e);a.set(n,r.getRaw(n));const i=new s.Dict(e);i.set("Font",a);return s.Dict.merge({xref:e,dictArray:[i,t],mergeSubDicts:!0})}}return t||s.Dict.empty}getFieldObject(){return null}}class TextWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this._hasText=!0;const t=e.dict;"string"!=typeof this.data.fieldValue&&(this.data.fieldValue="");let r=(0,n.getInheritableProperty)({dict:t,key:"Q"});(!Number.isInteger(r)||r<0||r>2)&&(r=null);this.data.textAlignment=r;let i=(0,n.getInheritableProperty)({dict:t,key:"MaxLen"});(!Number.isInteger(i)||i<0)&&(i=0);this.data.maxLen=i;this.data.multiLine=this.hasFieldFlag(a.AnnotationFieldFlag.MULTILINE);this.data.comb=this.hasFieldFlag(a.AnnotationFieldFlag.COMB)&&!this.hasFieldFlag(a.AnnotationFieldFlag.MULTILINE)&&!this.hasFieldFlag(a.AnnotationFieldFlag.PASSWORD)&&!this.hasFieldFlag(a.AnnotationFieldFlag.FILESELECT)&&0!==this.data.maxLen;this.data.doNotScroll=this.hasFieldFlag(a.AnnotationFieldFlag.DONOTSCROLL)}_getCombAppearance(e,t,r,i,s,o,c){const l=(0,n.numberToString)(i/this.data.maxLen),h=[],u=t.getCharPositions(r);for(const[e,t]of u)h.push(`(${(0,a.escapeString)(r.substring(e,t))}) Tj`);return`/Tx BMC q ${this.getBorderAndBackgroundAppearances(c)}BT `+e+` 1 0 0 1 ${s} ${o} Tm ${h.join(` ${l} 0 Td `)} ET Q EMC`}_getMultilineAppearance(e,t,r,a,n,i,s,o,c,l){const h=t.split(/\r\n?|\n/),u=[],d=n-2*o;for(const e of h){const t=this._splitLine(e,r,a,d);for(const e of t){const t=0===u.length?o:0;u.push(this._renderText(e,r,a,n,s,t,-a))}}const f=u.join("\n");return`/Tx BMC q ${this.getBorderAndBackgroundAppearances(l)}BT `+e+` 1 0 0 1 0 ${i} Tm ${f} ET Q EMC`}_splitLine(e,t,r,a){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};e=n.line||t.encodeString(e).join("");const i=n.glyphs||t.charsToGlyphs(e);if(i.length<=1)return[e];const s=n.positions||t.getCharPositions(e),o=r/1e3,c=[];let l=-1,h=-1,u=-1,d=0,f=0;for(let t=0,r=i.length;t<r;t++){const[r,n]=s[t],g=i[t],p=g.width*o;if(" "===g.unicode)if(f+p>a){c.push(e.substring(d,r));d=r;f=p;l=-1;u=-1}else{f+=p;l=r;h=n;u=t}else if(f+p>a)if(-1!==l){c.push(e.substring(d,h));d=h;t=u+1;l=-1;f=0}else{c.push(e.substring(d,r));d=r;f=p}else f+=p}d<e.length&&c.push(e.substring(d,e.length));return c}getFieldObject(){return{id:this.data.id,value:this.data.fieldValue,defaultValue:this.data.defaultFieldValue||"",multiline:this.data.multiLine,password:this.hasFieldFlag(a.AnnotationFieldFlag.PASSWORD),charLimit:this.data.maxLen,comb:this.data.comb,editable:!this.data.readOnly,hidden:this.data.hidden,name:this.data.fieldName,rect:this.data.rect,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:"text"}}}class ButtonWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.checkedAppearance=null;this.uncheckedAppearance=null;this.data.checkBox=!this.hasFieldFlag(a.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(a.AnnotationFieldFlag.PUSHBUTTON);this.data.radioButton=this.hasFieldFlag(a.AnnotationFieldFlag.RADIO)&&!this.hasFieldFlag(a.AnnotationFieldFlag.PUSHBUTTON);this.data.pushButton=this.hasFieldFlag(a.AnnotationFieldFlag.PUSHBUTTON);this.data.isTooltipOnly=!1;if(this.data.checkBox)this._processCheckBox(e);else if(this.data.radioButton)this._processRadioButton(e);else if(this.data.pushButton){this.data.hasOwnCanvas=!0;this._processPushButton(e)}else(0,a.warn)("Invalid field flags for button widget annotation")}async getOperatorList(e,t,r,n,i){if(this.data.pushButton)return super.getOperatorList(e,t,r,!1,i);let s=null,o=null;if(i){const e=i.get(this.data.id);s=e?e.value:null;o=e?e.rotation:null}if(null===s&&this.appearance)return super.getOperatorList(e,t,r,n,i);null==s&&(s=this.data.checkBox?this.data.fieldValue===this.data.exportValue:this.data.fieldValue===this.data.buttonValue);const c=s?this.checkedAppearance:this.uncheckedAppearance;if(c){const s=this.appearance,l=c.dict.getArray("Matrix")||a.IDENTITY_MATRIX;o&&c.dict.set("Matrix",this.getRotationMatrix(i));this.appearance=c;const h=super.getOperatorList(e,t,r,n,i);this.appearance=s;c.dict.set("Matrix",l);return h}return{opList:new g.OperatorList,separateForm:!1,separateCanvas:!1}}async save(e,t,r){return this.data.checkBox?this._saveCheckbox(e,t,r):this.data.radioButton?this._saveRadioButton(e,t,r):null}async _saveCheckbox(e,t,r){if(!r)return null;const n=r.get(this.data.id);let i=n&&n.rotation,c=n&&n.value;if(void 0===i){if(void 0===c)return null;if(this.data.fieldValue===this.data.exportValue===c)return null}const l=e.xref.fetchIfRef(this.ref);if(!(l instanceof s.Dict))return null;void 0===i&&(i=this.rotation);void 0===c&&(c=this.data.fieldValue===this.data.exportValue);const h={path:(0,a.stringToPDFString)(l.get("T")||""),value:c?this.data.exportValue:""},u=s.Name.get(c?this.data.exportValue:"Off");l.set("V",u);l.set("AS",u);l.set("M",`D:${(0,a.getModificationDate)()}`);const d=this._getMKDict(i);d&&l.set("MK",d);const f=e.xref.encrypt;let g=null;f&&(g=f.createCipherTransform(this.ref.num,this.ref.gen));const p=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(l,p,g);p.push("\nendobj\n");return[{ref:this.ref,data:p.join(""),xfa:h}]}async _saveRadioButton(e,t,r){if(!r)return null;const n=r.get(this.data.id);let i=n&&n.rotation,c=n&&n.value;if(void 0===i){if(void 0===c)return null;if(this.data.fieldValue===this.data.buttonValue===c)return null}const l=e.xref.fetchIfRef(this.ref);if(!(l instanceof s.Dict))return null;void 0===c&&(c=this.data.fieldValue===this.data.buttonValue);void 0===i&&(i=this.rotation);const h={path:(0,a.stringToPDFString)(l.get("T")||""),value:c?this.data.buttonValue:""},u=s.Name.get(c?this.data.buttonValue:"Off");let d=null;const f=e.xref.encrypt;if(c)if(this.parent instanceof s.Ref){const t=e.xref.fetch(this.parent);let r=null;f&&(r=f.createCipherTransform(this.parent.num,this.parent.gen));t.set("V",u);d=[`${this.parent.num} ${this.parent.gen} obj\n`];(0,o.writeDict)(t,d,r);d.push("\nendobj\n")}else this.parent instanceof s.Dict&&this.parent.set("V",u);l.set("AS",u);l.set("M",`D:${(0,a.getModificationDate)()}`);const g=this._getMKDict(i);g&&l.set("MK",g);let p=null;f&&(p=f.createCipherTransform(this.ref.num,this.ref.gen));const m=[`${this.ref.num} ${this.ref.gen} obj\n`];(0,o.writeDict)(l,m,p);m.push("\nendobj\n");const b=[{ref:this.ref,data:m.join(""),xfa:h}];null!==d&&b.push({ref:this.parent,data:d.join(""),xfa:null});return b}_getDefaultCheckedAppearance(e,t){const r=this.data.rect[2]-this.data.rect[0],i=this.data.rect[3]-this.data.rect[1],o=[0,0,r,i],c=.8*Math.min(r,i);let l,h;if("check"===t){l={width:.755*c,height:.705*c};h="3"}else if("disc"===t){l={width:.791*c,height:.705*c};h="l"}else(0,a.unreachable)(`_getDefaultCheckedAppearance - unsupported type: ${t}`);const u=`q BT /PdfJsZaDb ${c} Tf 0 g ${(0,n.numberToString)((r-l.width)/2)} ${(0,n.numberToString)((i-l.height)/2)} Td (${h}) Tj ET Q`,d=new s.Dict(e.xref);d.set("FormType",1);d.set("Subtype",s.Name.get("Form"));d.set("Type",s.Name.get("XObject"));d.set("BBox",o);d.set("Matrix",[1,0,0,1,0,0]);d.set("Length",u.length);const f=new s.Dict(e.xref),g=new s.Dict(e.xref);g.set("PdfJsZaDb",this.fallbackFontDict);f.set("Font",g);d.set("Resources",f);this.checkedAppearance=new p.StringStream(u);this.checkedAppearance.dict=d;this._streams.push(this.checkedAppearance)}_processCheckBox(e){const t=e.dict.get("AP");if(!(t instanceof s.Dict))return;const r=t.get("N");if(!(r instanceof s.Dict))return;const a=this._decodeFormValue(e.dict.get("AS"));"string"==typeof a&&(this.data.fieldValue=a);const n=null!==this.data.fieldValue&&"Off"!==this.data.fieldValue?this.data.fieldValue:"Yes",i=r.getKeys();if(0===i.length)i.push("Off",n);else if(1===i.length)"Off"===i[0]?i.push(n):i.unshift("Off");else if(i.includes(n)){i.length=0;i.push("Off",n)}else{const e=i.find((e=>"Off"!==e));i.length=0;i.push("Off",e)}i.includes(this.data.fieldValue)||(this.data.fieldValue="Off");this.data.exportValue=i[1];this.checkedAppearance=r.get(this.data.exportValue)||null;this.uncheckedAppearance=r.get("Off")||null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"check");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}_processRadioButton(e){this.data.fieldValue=this.data.buttonValue=null;const t=e.dict.get("Parent");if(t instanceof s.Dict){this.parent=e.dict.getRaw("Parent");const r=t.get("V");r instanceof s.Name&&(this.data.fieldValue=this._decodeFormValue(r))}const r=e.dict.get("AP");if(!(r instanceof s.Dict))return;const a=r.get("N");if(a instanceof s.Dict){for(const e of a.getKeys())if("Off"!==e){this.data.buttonValue=this._decodeFormValue(e);break}this.checkedAppearance=a.get(this.data.buttonValue)||null;this.uncheckedAppearance=a.get("Off")||null;this.checkedAppearance?this._streams.push(this.checkedAppearance):this._getDefaultCheckedAppearance(e,"disc");this.uncheckedAppearance&&this._streams.push(this.uncheckedAppearance);this._fallbackFontDict=this.fallbackFontDict}}_processPushButton(e){if(e.dict.has("A")||e.dict.has("AA")||this.data.alternativeText){this.data.isTooltipOnly=!e.dict.has("A")&&!e.dict.has("AA");h.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl})}else(0,a.warn)("Push buttons without action dictionaries are not supported")}getFieldObject(){let e,t="button";if(this.data.checkBox){t="checkbox";e=this.data.exportValue}else if(this.data.radioButton){t="radiobutton";e=this.data.buttonValue}return{id:this.data.id,value:this.data.fieldValue||"Off",defaultValue:this.data.defaultFieldValue,exportValues:e,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,hidden:this.data.hidden,actions:this.data.actions,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:t}}get fallbackFontDict(){const e=new s.Dict;e.set("BaseFont",s.Name.get("ZapfDingbats"));e.set("Type",s.Name.get("FallbackType"));e.set("Subtype",s.Name.get("FallbackType"));e.set("Encoding",s.Name.get("ZapfDingbatsEncoding"));return(0,a.shadow)(this,"fallbackFontDict",e)}}class ChoiceWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.data.options=[];const t=(0,n.getInheritableProperty)({dict:e.dict,key:"Opt"});if(Array.isArray(t)){const r=e.xref;for(let e=0,a=t.length;e<a;e++){const a=r.fetchIfRef(t[e]),n=Array.isArray(a);this.data.options[e]={exportValue:this._decodeFormValue(n?r.fetchIfRef(a[0]):a),displayValue:this._decodeFormValue(n?r.fetchIfRef(a[1]):a)}}}"string"==typeof this.data.fieldValue?this.data.fieldValue=[this.data.fieldValue]:this.data.fieldValue||(this.data.fieldValue=[]);this.data.combo=this.hasFieldFlag(a.AnnotationFieldFlag.COMBO);this.data.multiSelect=this.hasFieldFlag(a.AnnotationFieldFlag.MULTISELECT);this._hasText=!0}getFieldObject(){const e=this.data.combo?"combobox":"listbox",t=this.data.fieldValue.length>0?this.data.fieldValue[0]:null;return{id:this.data.id,value:t,defaultValue:this.data.defaultFieldValue,editable:!this.data.readOnly,name:this.data.fieldName,rect:this.data.rect,numItems:this.data.fieldValue.length,multipleSelection:this.data.multiSelect,hidden:this.data.hidden,actions:this.data.actions,items:this.data.options,page:this.data.pageIndex,strokeColor:this.data.borderColor,fillColor:this.data.backgroundColor,rotation:this.rotation,type:e}}async _getAppearance(e,t,r){if(this.data.combo)return super._getAppearance(e,t,r);if(!r)return null;const n=r.get(this.data.id);if(!n)return null;const s=n.rotation;let o=n.value;if(void 0===s&&void 0===o)return null;void 0===o?o=this.data.fieldValue:Array.isArray(o)||(o=[o]);let c=this.data.rect[3]-this.data.rect[1],l=this.data.rect[2]-this.data.rect[0];90!==s&&270!==s||([l,c]=[c,l]);const h=this.data.options.length,u=[];for(let e=0;e<h;e++){const{exportValue:t}=this.data.options[e];o.includes(t)&&u.push(e)}this._defaultAppearance||(this.data.defaultAppearanceData=(0,i.parseDefaultAppearance)(this._defaultAppearance="/Helvetica 0 Tf 0 g"));const d=await WidgetAnnotation._getFontData(e,t,this.data.defaultAppearanceData,this._fieldResources.mergedResources);let f,{fontSize:g}=this.data.defaultAppearanceData;if(g)f=this._defaultAppearance;else{const e=(c-2)/h;let t,r=-1;for(const{displayValue:e}of this.data.options){const a=this._getTextWidth(e,d);if(a>r){r=a;t=e}}[f,g]=this._computeFontSize(e,l-4,t,d,-1)}const p=g*a.LINE_FACTOR,m=(p-g)/2,b=Math.floor(c/p);let y;if(1===u.length){const e=u[0];y=e-e%b}else y=u.length?u[0]:0;const w=Math.min(y+b+1,h),S=["/Tx BMC q",`1 1 ${l} ${c} re W n`];if(u.length){S.push("0.600006 0.756866 0.854904 rg");for(const e of u)y<=e&&e<w&&S.push(`1 ${c-(e-y+1)*p} ${l} ${p} re f`)}S.push("BT",f,`1 0 0 1 0 ${c} Tm`);for(let e=y;e<w;e++){const{displayValue:t}=this.data.options[e],r=e===y?2:0,a=e===y?m:0;S.push(this._renderText(t,d,g,l,0,r,-p+a))}S.push("ET Q EMC");return S.join("\n")}}class SignatureWidgetAnnotation extends WidgetAnnotation{constructor(e){super(e);this.data.fieldValue=null}getFieldObject(){return{id:this.data.id,value:null,page:this.data.pageIndex,type:"signature"}}}class TextAnnotation extends MarkupAnnotation{constructor(e){super(e);const t=e.dict;this.data.annotationType=a.AnnotationType.TEXT;if(this.data.hasAppearance)this.data.name="NoIcon";else{this.data.rect[1]=this.data.rect[3]-22;this.data.rect[2]=this.data.rect[0]+22;this.data.name=t.has("Name")?t.get("Name").name:"Note"}if(t.has("State")){this.data.state=t.get("State")||null;this.data.stateModel=t.get("StateModel")||null}else{this.data.state=null;this.data.stateModel=null}}}class LinkAnnotation extends Annotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.LINK;const t=getQuadPoints(e.dict,this.rectangle);t&&(this.data.quadPoints=t);this.data.borderColor=this.data.borderColor||this.data.color;h.Catalog.parseDestDictionary({destDict:e.dict,resultObj:this.data,docBaseUrl:e.pdfManager.docBaseUrl})}}class PopupAnnotation extends Annotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.POPUP;let t=e.dict.get("Parent");if(!t){(0,a.warn)("Popup annotation has a missing or invalid parent annotation.");return}const r=t.get("Subtype");this.data.parentType=r instanceof s.Name?r.name:null;const n=e.dict.getRaw("Parent");this.data.parentId=n instanceof s.Ref?n.toString():null;const i=t.getArray("Rect");Array.isArray(i)&&4===i.length?this.data.parentRect=a.Util.normalizeRect(i):this.data.parentRect=[0,0,0,0];const o=t.get("RT");(0,s.isName)(o,a.AnnotationReplyType.GROUP)&&(t=t.get("IRT"));if(t.has("M")){this.setModificationDate(t.get("M"));this.data.modificationDate=this.modificationDate}else this.data.modificationDate=null;if(t.has("C")){this.setColor(t.getArray("C"));this.data.color=this.color}else this.data.color=null;if(!this.viewable){const e=t.get("F");this._isViewable(e)&&this.setFlags(e)}this.setTitle(t.get("T"));this.data.titleObj=this._title;this.setContents(t.get("Contents"));this.data.contentsObj=this._contents;t.has("RC")&&(this.data.richText=m.XFAFactory.getRichTextAsHtml(t.get("RC")))}}t.PopupAnnotation=PopupAnnotation;class FreeTextAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.FREETEXT}get hasTextContent(){return!!this.appearance}static createNewDict(e,t,r){let{apRef:n,ap:o}=r;const{color:c,fontSize:l,rect:h,rotation:u,user:d,value:f}=e,g=new s.Dict(t);g.set("Type",s.Name.get("Annot"));g.set("Subtype",s.Name.get("FreeText"));g.set("CreationDate",`D:${(0,a.getModificationDate)()}`);g.set("Rect",h);const p=`/Helv ${l} Tf ${(0,i.getPdfColor)(c,!0)}`;g.set("DA",p);g.set("Contents",f);g.set("F",4);g.set("Border",[0,0,0]);g.set("Rotate",u);d&&g.set("T",(0,a.stringToUTF8String)(d));const m=new s.Dict(t);g.set("AP",m);n?m.set("N",n):m.set("N",o);return g}static async createNewAppearanceStream(e,t,r){const{baseFontRef:o,evaluator:c,task:l}=r,{color:h,fontSize:u,rect:d,rotation:f,value:g}=e,m=new s.Dict(t),b=new s.Dict(t);if(o)b.set("Helv",o);else{const e=new s.Dict(t);e.set("BaseFont",s.Name.get("Helvetica"));e.set("Type",s.Name.get("Font"));e.set("Subtype",s.Name.get("Type1"));e.set("Encoding",s.Name.get("WinAnsiEncoding"));b.set("Helv",e)}m.set("Font",b);const y=await WidgetAnnotation._getFontData(c,l,{fontName:"Helvetica",fontSize:u},m),[w,S,x,k]=d;let C=x-w,v=k-S;f%180!=0&&([C,v]=[v,C]);const O=g.split("\n"),T=u/1e3;let M=-1/0;const E=[];for(let e of O){e=y.encodeString(e).join("");E.push(e);let t=0;const r=y.charsToGlyphs(e);for(const e of r)t+=e.width*T;M=Math.max(M,t)}let D=1;M>C&&(D=C/M);let N=1;const R=a.LINE_FACTOR*u,L=a.LINE_DESCENT_FACTOR*u,j=R*O.length;j>v&&(N=v/j);const $=u*Math.min(D,N),_=["q",`0 0 ${(0,n.numberToString)(C)} ${(0,n.numberToString)(v)} re W n`,"BT",`1 0 0 1 0 ${(0,n.numberToString)(v+L)} Tm 0 Tc ${(0,i.getPdfColor)(h,!0)}`,`/Helv ${(0,n.numberToString)($)} Tf`],U=(0,n.numberToString)(R);for(const e of E)_.push(`0 -${U} Td (${(0,a.escapeString)(e)}) Tj`);_.push("ET","Q");const X=_.join("\n"),H=new s.Dict(t);H.set("FormType",1);H.set("Subtype",s.Name.get("Form"));H.set("Type",s.Name.get("XObject"));H.set("BBox",[0,0,C,v]);H.set("Length",X.length);H.set("Resources",m);if(f){const e=WidgetAnnotation._getRotationMatrix(f,C,v);H.set("Matrix",e)}const q=new p.StringStream(X);q.dict=H;return q}}class LineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=a.AnnotationType.LINE;const r=t.getArray("L");this.data.lineCoordinates=a.Util.normalizeRect(r);this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings;if(!this.appearance){const n=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],i=t.get("CA");let s=null,o=t.getArray("IC");if(o){o=getRgbColor(o,null);s=o?Array.from(o).map((e=>e/255)):null}const c=s?i:null,l=this.borderStyle.width||1,h=2*l,u=[this.data.lineCoordinates[0]-h,this.data.lineCoordinates[1]-h,this.data.lineCoordinates[2]+h,this.data.lineCoordinates[3]+h];a.Util.intersect(this.rectangle,u)||(this.rectangle=u);this._setDefaultAppearance({xref:e.xref,extra:`${l} w`,strokeColor:n,fillColor:s,strokeAlpha:i,fillAlpha:c,pointsCallback:(e,t)=>{e.push(`${r[0]} ${r[1]} m`,`${r[2]} ${r[3]} l`,"S");return[t[0].x-l,t[1].x+l,t[3].y-l,t[1].y+l]}})}}}class SquareAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.SQUARE;if(!this.appearance){const t=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],r=e.dict.get("CA");let a=null,n=e.dict.getArray("IC");if(n){n=getRgbColor(n,null);a=n?Array.from(n).map((e=>e/255)):null}const i=a?r:null;if(0===this.borderStyle.width&&!a)return;this._setDefaultAppearance({xref:e.xref,extra:`${this.borderStyle.width} w`,strokeColor:t,fillColor:a,strokeAlpha:r,fillAlpha:i,pointsCallback:(e,t)=>{const r=t[2].x+this.borderStyle.width/2,n=t[2].y+this.borderStyle.width/2,i=t[3].x-t[2].x-this.borderStyle.width,s=t[1].y-t[3].y-this.borderStyle.width;e.push(`${r} ${n} ${i} ${s} re`);a?e.push("B"):e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}class CircleAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.CIRCLE;if(!this.appearance){const t=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],r=e.dict.get("CA");let a=null,n=e.dict.getArray("IC");if(n){n=getRgbColor(n,null);a=n?Array.from(n).map((e=>e/255)):null}const i=a?r:null;if(0===this.borderStyle.width&&!a)return;const s=4/3*Math.tan(Math.PI/8);this._setDefaultAppearance({xref:e.xref,extra:`${this.borderStyle.width} w`,strokeColor:t,fillColor:a,strokeAlpha:r,fillAlpha:i,pointsCallback:(e,t)=>{const r=t[0].x+this.borderStyle.width/2,n=t[0].y-this.borderStyle.width/2,i=t[3].x-this.borderStyle.width/2,o=t[3].y+this.borderStyle.width/2,c=r+(i-r)/2,l=n+(o-n)/2,h=(i-r)/2*s,u=(o-n)/2*s;e.push(`${c} ${o} m`,`${c+h} ${o} ${i} ${l+u} ${i} ${l} c`,`${i} ${l-u} ${c+h} ${n} ${c} ${n} c`,`${c-h} ${n} ${r} ${l-u} ${r} ${l} c`,`${r} ${l+u} ${c-h} ${o} ${c} ${o} c`,"h");a?e.push("B"):e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}class PolylineAnnotation extends MarkupAnnotation{constructor(e){super(e);const{dict:t}=e;this.data.annotationType=a.AnnotationType.POLYLINE;this.data.vertices=[];if(!(this instanceof PolygonAnnotation)){this.setLineEndings(t.getArray("LE"));this.data.lineEndings=this.lineEndings}const r=t.getArray("Vertices");if(Array.isArray(r)){for(let e=0,t=r.length;e<t;e+=2)this.data.vertices.push({x:r[e],y:r[e+1]});if(!this.appearance){const r=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],n=t.get("CA"),i=this.borderStyle.width||1,s=2*i,o=[1/0,1/0,-1/0,-1/0];for(const e of this.data.vertices){o[0]=Math.min(o[0],e.x-s);o[1]=Math.min(o[1],e.y-s);o[2]=Math.max(o[2],e.x+s);o[3]=Math.max(o[3],e.y+s)}a.Util.intersect(this.rectangle,o)||(this.rectangle=o);this._setDefaultAppearance({xref:e.xref,extra:`${i} w`,strokeColor:r,strokeAlpha:n,pointsCallback:(e,t)=>{const r=this.data.vertices;for(let t=0,a=r.length;t<a;t++)e.push(`${r[t].x} ${r[t].y} ${0===t?"m":"l"}`);e.push("S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}}}class PolygonAnnotation extends PolylineAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.POLYGON}}class CaretAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.CARET}}class InkAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.INK;this.data.inkLists=[];const t=e.dict.getArray("InkList");if(!Array.isArray(t))return;const r=e.xref;for(let e=0,a=t.length;e<a;++e){this.data.inkLists.push([]);for(let a=0,n=t[e].length;a<n;a+=2)this.data.inkLists[e].push({x:r.fetchIfRef(t[e][a]),y:r.fetchIfRef(t[e][a+1])})}if(!this.appearance){const t=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],r=e.dict.get("CA"),n=this.borderStyle.width||1,i=2*n,s=[1/0,1/0,-1/0,-1/0];for(const e of this.data.inkLists)for(const t of e){s[0]=Math.min(s[0],t.x-i);s[1]=Math.min(s[1],t.y-i);s[2]=Math.max(s[2],t.x+i);s[3]=Math.max(s[3],t.y+i)}a.Util.intersect(this.rectangle,s)||(this.rectangle=s);this._setDefaultAppearance({xref:e.xref,extra:`${n} w`,strokeColor:t,strokeAlpha:r,pointsCallback:(e,t)=>{for(const t of this.data.inkLists){for(let r=0,a=t.length;r<a;r++)e.push(`${t[r].x} ${t[r].y} ${0===r?"m":"l"}`);e.push("S")}return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}static createNewDict(e,t,r){let{apRef:n,ap:i}=r;const{paths:o,rect:c,rotation:l}=e,h=new s.Dict(t);h.set("Type",s.Name.get("Annot"));h.set("Subtype",s.Name.get("Ink"));h.set("CreationDate",`D:${(0,a.getModificationDate)()}`);h.set("Rect",c);h.set("InkList",o.map((e=>e.points)));h.set("F",4);h.set("Border",[0,0,0]);h.set("Rotate",l);const u=new s.Dict(t);h.set("AP",u);n?u.set("N",n):u.set("N",i);return h}static async createNewAppearanceStream(e,t,r){const{color:a,rect:o,rotation:c,paths:l,thickness:h,opacity:u}=e,[d,f,g,m]=o;let b=g-d,y=m-f;c%180!=0&&([b,y]=[y,b]);const w=[`${h} w 1 J 1 j`,`${(0,i.getPdfColor)(a,!1)}`];1!==u&&w.push("/R0 gs");const S=[];for(const{bezier:e}of l){S.length=0;S.push(`${(0,n.numberToString)(e[0])} ${(0,n.numberToString)(e[1])} m`);for(let t=2,r=e.length;t<r;t+=6){const r=e.slice(t,t+6).map(n.numberToString).join(" ");S.push(`${r} c`)}S.push("S");w.push(S.join("\n"))}const x=w.join("\n"),k=new s.Dict(t);k.set("FormType",1);k.set("Subtype",s.Name.get("Form"));k.set("Type",s.Name.get("XObject"));k.set("BBox",[0,0,b,y]);k.set("Length",x.length);if(c){const e=WidgetAnnotation._getRotationMatrix(c,b,y);k.set("Matrix",e)}if(1!==u){const e=new s.Dict(t),r=new s.Dict(t),a=new s.Dict(t);a.set("CA",u);a.set("Type",s.Name.get("ExtGState"));r.set("R0",a);e.set("ExtGState",r);k.set("Resources",e)}const C=new p.StringStream(x);C.dict=k;return C}}class HighlightAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.HIGHLIGHT;if(this.data.quadPoints=getQuadPoints(e.dict,null)){const t=this.appearance&&this.appearance.dict.get("Resources");if(!this.appearance||!t||!t.has("ExtGState")){this.appearance&&(0,a.warn)("HighlightAnnotation - ignoring built-in appearance stream.");const t=this.color?Array.from(this.color).map((e=>e/255)):[1,1,0],r=e.dict.get("CA");this._setDefaultAppearance({xref:e.xref,fillColor:t,blendMode:"Multiply",fillAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[0].x} ${t[0].y} m`,`${t[1].x} ${t[1].y} l`,`${t[3].x} ${t[3].y} l`,`${t[2].x} ${t[2].y} l`,"f");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class UnderlineAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.UNDERLINE;if(this.data.quadPoints=getQuadPoints(e.dict,null)){if(!this.appearance){const t=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],r=e.dict.get("CA");this._setDefaultAppearance({xref:e.xref,extra:"[] 0 d 1 w",strokeColor:t,strokeAlpha:r,pointsCallback:(e,t)=>{e.push(`${t[2].x} ${t[2].y} m`,`${t[3].x} ${t[3].y} l`,"S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class SquigglyAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.SQUIGGLY;if(this.data.quadPoints=getQuadPoints(e.dict,null)){if(!this.appearance){const t=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],r=e.dict.get("CA");this._setDefaultAppearance({xref:e.xref,extra:"[] 0 d 1 w",strokeColor:t,strokeAlpha:r,pointsCallback:(e,t)=>{const r=(t[0].y-t[2].y)/6;let a=r,n=t[2].x;const i=t[2].y,s=t[3].x;e.push(`${n} ${i+a} m`);do{n+=2;a=0===a?r:0;e.push(`${n} ${i+a} l`)}while(n<s);e.push("S");return[t[2].x,s,i-2*r,i+2*r]}})}}else this.data.hasPopup=!1}}class StrikeOutAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.STRIKEOUT;if(this.data.quadPoints=getQuadPoints(e.dict,null)){if(!this.appearance){const t=this.color?Array.from(this.color).map((e=>e/255)):[0,0,0],r=e.dict.get("CA");this._setDefaultAppearance({xref:e.xref,extra:"[] 0 d 1 w",strokeColor:t,strokeAlpha:r,pointsCallback:(e,t)=>{e.push((t[0].x+t[2].x)/2+" "+(t[0].y+t[2].y)/2+" m",(t[1].x+t[3].x)/2+" "+(t[1].y+t[3].y)/2+" l","S");return[t[0].x,t[1].x,t[3].y,t[1].y]}})}}else this.data.hasPopup=!1}}class StampAnnotation extends MarkupAnnotation{constructor(e){super(e);this.data.annotationType=a.AnnotationType.STAMP}}class FileAttachmentAnnotation extends MarkupAnnotation{constructor(e){super(e);const t=new d.FileSpec(e.dict.get("FS"),e.xref);this.data.annotationType=a.AnnotationType.FILEATTACHMENT;this.data.file=t.serializable}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createDefaultAppearance=function createDefaultAppearance(e){let{fontSize:t,fontName:r,fontColor:n}=e;return`/${(0,a.escapePDFName)(r)} ${t} Tf ${getPdfColor(n,!0)}`};t.getPdfColor=getPdfColor;t.parseDefaultAppearance=function parseDefaultAppearance(e){return new DefaultAppearanceEvaluator(e).parse()};var a=r(134),n=r(2),i=r(142),s=r(143),o=r(133),c=r(138);class DefaultAppearanceEvaluator extends s.EvaluatorPreprocessor{constructor(e){super(new c.StringStream(e))}parse(){const e={fn:0,args:[]},t={fontSize:0,fontName:"",fontColor:new Uint8ClampedArray(3)};try{for(;;){e.args.length=0;if(!this.read(e))break;if(0!==this.savedStatesDepth)continue;const{fn:r,args:a}=e;switch(0|r){case n.OPS.setFont:const[e,r]=a;e instanceof o.Name&&(t.fontName=e.name);"number"==typeof r&&r>0&&(t.fontSize=r);break;case n.OPS.setFillRGBColor:i.ColorSpace.singletons.rgb.getRgbItem(a,0,t.fontColor,0);break;case n.OPS.setFillGray:i.ColorSpace.singletons.gray.getRgbItem(a,0,t.fontColor,0);break;case n.OPS.setFillColorSpace:i.ColorSpace.singletons.cmyk.getRgbItem(a,0,t.fontColor,0)}}}catch(e){(0,n.warn)(`parseDefaultAppearance - ignoring errors: "${e}".`)}return t}}function getPdfColor(e,t){if(e[0]===e[1]&&e[1]===e[2]){const r=e[0]/255;return`${(0,a.numberToString)(r)} ${t?"g":"G"}`}return Array.from(e).map((e=>(0,a.numberToString)(e/255))).join(" ")+" "+(t?"rg":"RG")}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ColorSpace=void 0;var a=r(2),n=r(133),i=r(135),s=r(134);class ColorSpace{constructor(e,t){this.constructor===ColorSpace&&(0,a.unreachable)("Cannot initialize ColorSpace.");this.name=e;this.numComps=t}getRgb(e,t){const r=new Uint8ClampedArray(3);this.getRgbItem(e,t,r,0);return r}getRgbItem(e,t,r,n){(0,a.unreachable)("Should not call ColorSpace.getRgbItem")}getRgbBuffer(e,t,r,n,i,s,o){(0,a.unreachable)("Should not call ColorSpace.getRgbBuffer")}getOutputLength(e,t){(0,a.unreachable)("Should not call ColorSpace.getOutputLength")}isPassthrough(e){return!1}isDefaultDecode(e,t){return ColorSpace.isDefaultDecode(e,this.numComps)}fillRgb(e,t,r,a,n,i,s,o,c){const l=t*r;let h=null;const u=1<<s,d=r!==n||t!==a;if(this.isPassthrough(s))h=o;else if(1===this.numComps&&l>u&&"DeviceGray"!==this.name&&"DeviceRGB"!==this.name){const t=s<=8?new Uint8Array(u):new Uint16Array(u);for(let e=0;e<u;e++)t[e]=e;const r=new Uint8ClampedArray(3*u);this.getRgbBuffer(t,0,u,r,0,s,0);if(d){h=new Uint8Array(3*l);let e=0;for(let t=0;t<l;++t){const a=3*o[t];h[e++]=r[a];h[e++]=r[a+1];h[e++]=r[a+2]}}else{let t=0;for(let a=0;a<l;++a){const n=3*o[a];e[t++]=r[n];e[t++]=r[n+1];e[t++]=r[n+2];t+=c}}}else if(d){h=new Uint8ClampedArray(3*l);this.getRgbBuffer(o,0,l,h,0,s,0)}else this.getRgbBuffer(o,0,a*i,e,0,s,c);if(h)if(d)!function resizeRgbImage(e,t,r,a,n,i,s){s=1!==s?0:s;const o=r/n,c=a/i;let l,h=0;const u=new Uint16Array(n),d=3*r;for(let e=0;e<n;e++)u[e]=3*Math.floor(e*o);for(let r=0;r<i;r++){const a=Math.floor(r*c)*d;for(let r=0;r<n;r++){l=a+u[r];t[h++]=e[l++];t[h++]=e[l++];t[h++]=e[l++];h+=s}}}(h,e,t,r,a,n,c);else{let t=0,r=0;for(let n=0,s=a*i;n<s;n++){e[t++]=h[r++];e[t++]=h[r++];e[t++]=h[r++];t+=c}}}get usesZeroToOneRange(){return(0,a.shadow)(this,"usesZeroToOneRange",!0)}static _cache(e,t,r,a){if(!r)throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.');if(!a)throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.');let i,s;if(e instanceof n.Ref){s=e;e=t.fetch(e)}e instanceof n.Name&&(i=e.name);(i||s)&&r.set(i,s,a)}static getCached(e,t,r){if(!r)throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.');if(e instanceof n.Ref){const a=r.getByRef(e);if(a)return a;try{e=t.fetch(e)}catch(e){if(e instanceof s.MissingDataException)throw e}}if(e instanceof n.Name){const t=r.getByName(e.name);if(t)return t}return null}static async parseAsync(e){let{cs:t,xref:r,resources:a=null,pdfFunctionFactory:n,localColorSpaceCache:i}=e;const s=this._parse(t,r,a,n);this._cache(t,r,i,s);return s}static parse(e){let{cs:t,xref:r,resources:a=null,pdfFunctionFactory:n,localColorSpaceCache:i}=e;const s=this.getCached(t,r,i);if(s)return s;const o=this._parse(t,r,a,n);this._cache(t,r,i,o);return o}static _parse(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;if((e=t.fetchIfRef(e))instanceof n.Name)switch(e.name){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"Pattern":return new PatternCS(null);default:if(r instanceof n.Dict){const a=r.get("ColorSpace");if(a instanceof n.Dict){const s=a.get(e.name);if(s){if(s instanceof n.Name)return this._parse(s,t,r,i);e=s;break}}}throw new a.FormatError(`Unrecognized ColorSpace: ${e.name}`)}if(Array.isArray(e)){const n=t.fetchIfRef(e[0]).name;let s,o,u,d,f,g;switch(n){case"G":case"DeviceGray":return this.singletons.gray;case"RGB":case"DeviceRGB":return this.singletons.rgb;case"CMYK":case"DeviceCMYK":return this.singletons.cmyk;case"CalGray":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");g=s.get("Gamma");return new c(d,f,g);case"CalRGB":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");g=s.getArray("Gamma");const p=s.getArray("Matrix");return new l(d,f,g,p);case"ICCBased":const m=t.fetchIfRef(e[1]).dict;o=m.get("N");const b=m.get("Alternate");if(b){const e=this._parse(b,t,r,i);if(e.numComps===o)return e;(0,a.warn)("ICCBased color space: Ignoring incorrect /Alternate entry.")}if(1===o)return this.singletons.gray;if(3===o)return this.singletons.rgb;if(4===o)return this.singletons.cmyk;break;case"Pattern":u=e[1]||null;u&&(u=this._parse(u,t,r,i));return new PatternCS(u);case"I":case"Indexed":u=this._parse(e[1],t,r,i);const y=t.fetchIfRef(e[2])+1,w=t.fetchIfRef(e[3]);return new IndexedCS(u,y,w);case"Separation":case"DeviceN":const S=t.fetchIfRef(e[1]);o=Array.isArray(S)?S.length:1;u=this._parse(e[2],t,r,i);const x=i.create(e[3]);return new AlternateCS(o,u,x);case"Lab":s=t.fetchIfRef(e[1]);d=s.getArray("WhitePoint");f=s.getArray("BlackPoint");const k=s.getArray("Range");return new h(d,f,k);default:throw new a.FormatError(`Unimplemented ColorSpace object: ${n}`)}}throw new a.FormatError(`Unrecognized ColorSpace object: ${e}`)}static isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2*t!==e.length){(0,a.warn)("The decode map is not the correct length");return!0}for(let t=0,r=e.length;t<r;t+=2)if(0!==e[t]||1!==e[t+1])return!1;return!0}static get singletons(){return(0,a.shadow)(this,"singletons",{get gray(){return(0,a.shadow)(this,"gray",new DeviceGrayCS)},get rgb(){return(0,a.shadow)(this,"rgb",new DeviceRgbCS)},get cmyk(){return(0,a.shadow)(this,"cmyk",new o)}})}}t.ColorSpace=ColorSpace;class AlternateCS extends ColorSpace{constructor(e,t,r){super("Alternate",e);this.base=t;this.tintFn=r;this.tmpBuf=new Float32Array(t.numComps)}getRgbItem(e,t,r,a){const n=this.tmpBuf;this.tintFn(e,t,n,0);this.base.getRgbItem(n,0,r,a)}getRgbBuffer(e,t,r,a,n,i,s){const o=this.tintFn,c=this.base,l=1/((1<<i)-1),h=c.numComps,u=c.usesZeroToOneRange,d=(c.isPassthrough(8)||!u)&&0===s;let f=d?n:0;const g=d?a:new Uint8ClampedArray(h*r),p=this.numComps,m=new Float32Array(p),b=new Float32Array(h);let y,w;for(y=0;y<r;y++){for(w=0;w<p;w++)m[w]=e[t++]*l;o(m,0,b,0);if(u)for(w=0;w<h;w++)g[f++]=255*b[w];else{c.getRgbItem(b,0,g,f);f+=h}}d||c.getRgbBuffer(g,0,r,a,n,8,s)}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps/this.numComps,t)}}class PatternCS extends ColorSpace{constructor(e){super("Pattern",null);this.base=e}isDefaultDecode(e,t){(0,a.unreachable)("Should not call PatternCS.isDefaultDecode")}}class IndexedCS extends ColorSpace{constructor(e,t,r){super("Indexed",1);this.base=e;this.highVal=t;const n=e.numComps*t;this.lookup=new Uint8Array(n);if(r instanceof i.BaseStream){const e=r.getBytes(n);this.lookup.set(e)}else{if("string"!=typeof r)throw new a.FormatError(`IndexedCS - unrecognized lookup table: ${r}`);for(let e=0;e<n;++e)this.lookup[e]=255&r.charCodeAt(e)}}getRgbItem(e,t,r,a){const n=this.base.numComps,i=e[t]*n;this.base.getRgbBuffer(this.lookup,i,1,r,a,8,0)}getRgbBuffer(e,t,r,a,n,i,s){const o=this.base,c=o.numComps,l=o.getOutputLength(c,s),h=this.lookup;for(let i=0;i<r;++i){const r=e[t++]*c;o.getRgbBuffer(h,r,1,a,n,8,s);n+=l}}getOutputLength(e,t){return this.base.getOutputLength(e*this.base.numComps,t)}isDefaultDecode(e,t){if(!Array.isArray(e))return!0;if(2!==e.length){(0,a.warn)("Decode map length is not correct");return!0}if(!Number.isInteger(t)||t<1){(0,a.warn)("Bits per component is not correct");return!0}return 0===e[0]&&e[1]===(1<<t)-1}}class DeviceGrayCS extends ColorSpace{constructor(){super("DeviceGray",1)}getRgbItem(e,t,r,a){const n=255*e[t];r[a]=r[a+1]=r[a+2]=n}getRgbBuffer(e,t,r,a,n,i,s){const o=255/((1<<i)-1);let c=t,l=n;for(let t=0;t<r;++t){const t=o*e[c++];a[l++]=t;a[l++]=t;a[l++]=t;l+=s}}getOutputLength(e,t){return e*(3+t)}}class DeviceRgbCS extends ColorSpace{constructor(){super("DeviceRGB",3)}getRgbItem(e,t,r,a){r[a]=255*e[t];r[a+1]=255*e[t+1];r[a+2]=255*e[t+2]}getRgbBuffer(e,t,r,a,n,i,s){if(8===i&&0===s){a.set(e.subarray(t,t+3*r),n);return}const o=255/((1<<i)-1);let c=t,l=n;for(let t=0;t<r;++t){a[l++]=o*e[c++];a[l++]=o*e[c++];a[l++]=o*e[c++];l+=s}}getOutputLength(e,t){return e*(3+t)/3|0}isPassthrough(e){return 8===e}}const o=function DeviceCmykCSClosure(){function convertToRgb(e,t,r,a,n){const i=e[t]*r,s=e[t+1]*r,o=e[t+2]*r,c=e[t+3]*r;a[n]=255+i*(-4.387332384609988*i+54.48615194189176*s+18.82290502165302*o+212.25662451639585*c-285.2331026137004)+s*(1.7149763477362134*s-5.6096736904047315*o+-17.873870861415444*c-5.497006427196366)+o*(-2.5217340131683033*o-21.248923337353073*c+17.5119270841813)+c*(-21.86122147463605*c-189.48180835922747);a[n+1]=255+i*(8.841041422036149*i+60.118027045597366*s+6.871425592049007*o+31.159100130055922*c-79.2970844816548)+s*(-15.310361306967817*s+17.575251261109482*o+131.35250912493976*c-190.9453302588951)+o*(4.444339102852739*o+9.8632861493405*c-24.86741582555878)+c*(-20.737325471181034*c-187.80453709719578);a[n+2]=255+i*(.8842522430003296*i+8.078677503112928*s+30.89978309703729*o-.23883238689178934*c-14.183576799673286)+s*(10.49593273432072*s+63.02378494754052*o+50.606957656360734*c-112.23884253719248)+o*(.03296041114873217*o+115.60384449646641*c-193.58209356861505)+c*(-22.33816807309886*c-180.12613974708367)}return class DeviceCmykCS extends ColorSpace{constructor(){super("DeviceCMYK",4)}getRgbItem(e,t,r,a){convertToRgb(e,t,1,r,a)}getRgbBuffer(e,t,r,a,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<r;i++){convertToRgb(e,t,o,a,n);t+=4;n+=3+s}}getOutputLength(e,t){return e/4*(3+t)|0}}}(),c=function CalGrayCSClosure(){function convertToRgb(e,t,r,a,n,i){const s=(t[r]*i)**e.G,o=e.YW*s,c=Math.max(295.8*o**.3333333333333333-40.8,0);a[n]=c;a[n+1]=c;a[n+2]=c}return class CalGrayCS extends ColorSpace{constructor(e,t,r){super("CalGray",1);if(!e)throw new a.FormatError("WhitePoint missing - required for color space CalGray");t=t||[0,0,0];r=r||1;this.XW=e[0];this.YW=e[1];this.ZW=e[2];this.XB=t[0];this.YB=t[1];this.ZB=t[2];this.G=r;if(this.XW<0||this.ZW<0||1!==this.YW)throw new a.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(this.XB<0||this.YB<0||this.ZB<0){(0,a.info)(`Invalid BlackPoint for ${this.name}, falling back to default.`);this.XB=this.YB=this.ZB=0}0===this.XB&&0===this.YB&&0===this.ZB||(0,a.warn)(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`);if(this.G<1){(0,a.info)(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`);this.G=1}}getRgbItem(e,t,r,a){convertToRgb(this,e,t,r,a,1)}getRgbBuffer(e,t,r,a,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<r;++i){convertToRgb(this,e,t,a,n,o);t+=1;n+=3+s}}getOutputLength(e,t){return e*(3+t)}}}(),l=function CalRGBCSClosure(){const e=new Float32Array([.8951,.2664,-.1614,-.7502,1.7135,.0367,.0389,-.0685,1.0296]),t=new Float32Array([.9869929,-.1470543,.1599627,.4323053,.5183603,.0492912,-.0085287,.0400428,.9684867]),r=new Float32Array([3.2404542,-1.5371385,-.4985314,-.969266,1.8760108,.041556,.0556434,-.2040259,1.0572252]),n=new Float32Array([1,1,1]),i=new Float32Array(3),s=new Float32Array(3),o=new Float32Array(3);function matrixProduct(e,t,r){r[0]=e[0]*t[0]+e[1]*t[1]+e[2]*t[2];r[1]=e[3]*t[0]+e[4]*t[1]+e[5]*t[2];r[2]=e[6]*t[0]+e[7]*t[1]+e[8]*t[2]}function sRGBTransferFunction(e){return e<=.0031308?adjustToRange(0,1,12.92*e):e>=.99554525?1:adjustToRange(0,1,1.055*e**(1/2.4)-.055)}function adjustToRange(e,t,r){return Math.max(e,Math.min(t,r))}function decodeL(e){return e<0?-decodeL(-e):e>8?((e+16)/116)**3:.0011070564598794539*e}function convertToRgb(a,c,l,h,u,d){const f=adjustToRange(0,1,c[l]*d),g=adjustToRange(0,1,c[l+1]*d),p=adjustToRange(0,1,c[l+2]*d),m=1===f?1:f**a.GR,b=1===g?1:g**a.GG,y=1===p?1:p**a.GB,w=a.MXA*m+a.MXB*b+a.MXC*y,S=a.MYA*m+a.MYB*b+a.MYC*y,x=a.MZA*m+a.MZB*b+a.MZC*y,k=s;k[0]=w;k[1]=S;k[2]=x;const C=o;!function normalizeWhitePointToFlat(r,a,n){if(1===r[0]&&1===r[2]){n[0]=a[0];n[1]=a[1];n[2]=a[2];return}const s=n;matrixProduct(e,a,s);const o=i;!function convertToFlat(e,t,r){r[0]=1*t[0]/e[0];r[1]=1*t[1]/e[1];r[2]=1*t[2]/e[2]}(r,s,o);matrixProduct(t,o,n)}(a.whitePoint,k,C);const v=s;!function compensateBlackPoint(e,t,r){if(0===e[0]&&0===e[1]&&0===e[2]){r[0]=t[0];r[1]=t[1];r[2]=t[2];return}const a=decodeL(0),n=(1-a)/(1-decodeL(e[0])),i=1-n,s=(1-a)/(1-decodeL(e[1])),o=1-s,c=(1-a)/(1-decodeL(e[2])),l=1-c;r[0]=t[0]*n+i;r[1]=t[1]*s+o;r[2]=t[2]*c+l}(a.blackPoint,C,v);const O=o;!function normalizeWhitePointToD65(r,a,n){const s=n;matrixProduct(e,a,s);const o=i;!function convertToD65(e,t,r){r[0]=.95047*t[0]/e[0];r[1]=1*t[1]/e[1];r[2]=1.08883*t[2]/e[2]}(r,s,o);matrixProduct(t,o,n)}(n,v,O);const T=s;matrixProduct(r,O,T);h[u]=255*sRGBTransferFunction(T[0]);h[u+1]=255*sRGBTransferFunction(T[1]);h[u+2]=255*sRGBTransferFunction(T[2])}return class CalRGBCS extends ColorSpace{constructor(e,t,r,n){super("CalRGB",3);if(!e)throw new a.FormatError("WhitePoint missing - required for color space CalRGB");t=t||new Float32Array(3);r=r||new Float32Array([1,1,1]);n=n||new Float32Array([1,0,0,0,1,0,0,0,1]);const i=e[0],s=e[1],o=e[2];this.whitePoint=e;const c=t[0],l=t[1],h=t[2];this.blackPoint=t;this.GR=r[0];this.GG=r[1];this.GB=r[2];this.MXA=n[0];this.MYA=n[1];this.MZA=n[2];this.MXB=n[3];this.MYB=n[4];this.MZB=n[5];this.MXC=n[6];this.MYC=n[7];this.MZC=n[8];if(i<0||o<0||1!==s)throw new a.FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`);if(c<0||l<0||h<0){(0,a.info)(`Invalid BlackPoint for ${this.name} [${c}, ${l}, ${h}], falling back to default.`);this.blackPoint=new Float32Array(3)}if(this.GR<0||this.GG<0||this.GB<0){(0,a.info)(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`);this.GR=this.GG=this.GB=1}}getRgbItem(e,t,r,a){convertToRgb(this,e,t,r,a,1)}getRgbBuffer(e,t,r,a,n,i,s){const o=1/((1<<i)-1);for(let i=0;i<r;++i){convertToRgb(this,e,t,a,n,o);t+=3;n+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}}}(),h=function LabCSClosure(){function fn_g(e){let t;t=e>=6/29?e**3:108/841*(e-4/29);return t}function decode(e,t,r,a){return r+e*(a-r)/t}function convertToRgb(e,t,r,a,n,i){let s=t[r],o=t[r+1],c=t[r+2];if(!1!==a){s=decode(s,a,0,100);o=decode(o,a,e.amin,e.amax);c=decode(c,a,e.bmin,e.bmax)}o>e.amax?o=e.amax:o<e.amin&&(o=e.amin);c>e.bmax?c=e.bmax:c<e.bmin&&(c=e.bmin);const l=(s+16)/116,h=l+o/500,u=l-c/200,d=e.XW*fn_g(h),f=e.YW*fn_g(l),g=e.ZW*fn_g(u);let p,m,b;if(e.ZW<1){p=3.1339*d+-1.617*f+-.4906*g;m=-.9785*d+1.916*f+.0333*g;b=.072*d+-.229*f+1.4057*g}else{p=3.2406*d+-1.5372*f+-.4986*g;m=-.9689*d+1.8758*f+.0415*g;b=.0557*d+-.204*f+1.057*g}n[i]=255*Math.sqrt(p);n[i+1]=255*Math.sqrt(m);n[i+2]=255*Math.sqrt(b)}return class LabCS extends ColorSpace{constructor(e,t,r){super("Lab",3);if(!e)throw new a.FormatError("WhitePoint missing - required for color space Lab");t=t||[0,0,0];r=r||[-100,100,-100,100];this.XW=e[0];this.YW=e[1];this.ZW=e[2];this.amin=r[0];this.amax=r[1];this.bmin=r[2];this.bmax=r[3];this.XB=t[0];this.YB=t[1];this.ZB=t[2];if(this.XW<0||this.ZW<0||1!==this.YW)throw new a.FormatError("Invalid WhitePoint components, no fallback available");if(this.XB<0||this.YB<0||this.ZB<0){(0,a.info)("Invalid BlackPoint, falling back to default");this.XB=this.YB=this.ZB=0}if(this.amin>this.amax||this.bmin>this.bmax){(0,a.info)("Invalid Range, falling back to defaults");this.amin=-100;this.amax=100;this.bmin=-100;this.bmax=100}}getRgbItem(e,t,r,a){convertToRgb(this,e,t,!1,r,a)}getRgbBuffer(e,t,r,a,n,i,s){const o=(1<<i)-1;for(let i=0;i<r;i++){convertToRgb(this,e,t,o,a,n);t+=3;n+=3+s}}getOutputLength(e,t){return e*(3+t)/3|0}isDefaultDecode(e,t){return!0}get usesZeroToOneRange(){return(0,a.shadow)(this,"usesZeroToOneRange",!1)}}}()},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PartialEvaluator=t.EvaluatorPreprocessor=void 0;var a=r(2),n=r(144),i=r(133),s=r(162),o=r(166),c=r(165),l=r(169),h=r(168),u=r(178),d=r(179),f=r(170),g=r(185),p=r(145),m=r(187),b=r(138),y=r(135),w=r(188),S=r(142),x=r(147),k=r(167),C=r(134),v=r(173),O=r(189),T=r(190),M=r(191);const E=Object.freeze({maxImageSize:-1,disableFontFace:!1,ignoreErrors:!1,isEvalSupported:!0,fontExtraProperties:!1,useSystemFonts:!0,cMapUrl:null,standardFontDataUrl:null}),D=1,N=2,R=Promise.resolve();function normalizeBlendMode(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++){const r=normalizeBlendMode(e[t],!0);if(r)return r}(0,a.warn)(`Unsupported blend mode Array: ${e}`);return"source-over"}if(!(e instanceof i.Name))return t?null:"source-over";switch(e.name){case"Normal":case"Compatible":return"source-over";case"Multiply":return"multiply";case"Screen":return"screen";case"Overlay":return"overlay";case"Darken":return"darken";case"Lighten":return"lighten";case"ColorDodge":return"color-dodge";case"ColorBurn":return"color-burn";case"HardLight":return"hard-light";case"SoftLight":return"soft-light";case"Difference":return"difference";case"Exclusion":return"exclusion";case"Hue":return"hue";case"Saturation":return"saturation";case"Color":return"color";case"Luminosity":return"luminosity"}if(t)return null;(0,a.warn)(`Unsupported blend mode: ${e.name}`);return"source-over"}function incrementCachedImageMaskCount(e){e.fn===a.OPS.paintImageMaskXObject&&e.args[0]&&e.args[0].count>0&&e.args[0].count++}class TimeSlotManager{static get TIME_SLOT_DURATION_MS(){return(0,a.shadow)(this,"TIME_SLOT_DURATION_MS",20)}static get CHECK_TIME_EVERY(){return(0,a.shadow)(this,"CHECK_TIME_EVERY",100)}constructor(){this.reset()}check(){if(++this.checked<TimeSlotManager.CHECK_TIME_EVERY)return!1;this.checked=0;return this.endTime<=Date.now()}reset(){this.endTime=Date.now()+TimeSlotManager.TIME_SLOT_DURATION_MS;this.checked=0}}class PartialEvaluator{constructor(e){let{xref:t,handler:r,pageIndex:a,idFactory:n,fontCache:i,builtInCMapCache:s,standardFontDataCache:o,globalImageCache:c,options:l=null}=e;this.xref=t;this.handler=r;this.pageIndex=a;this.idFactory=n;this.fontCache=i;this.builtInCMapCache=s;this.standardFontDataCache=o;this.globalImageCache=c;this.options=l||E;this.parsingType3Font=!1;this._fetchBuiltInCMapBound=this.fetchBuiltInCMap.bind(this)}get _pdfFunctionFactory(){const e=new g.PDFFunctionFactory({xref:this.xref,isEvalSupported:this.options.isEvalSupported});return(0,a.shadow)(this,"_pdfFunctionFactory",e)}clone(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=Object.create(this);t.options=Object.assign(Object.create(null),this.options,e);return t}hasBlendModes(e,t){if(!(e instanceof i.Dict))return!1;if(e.objId&&t.has(e.objId))return!1;const r=new i.RefSet(t);e.objId&&r.put(e.objId);const n=[e],s=this.xref;for(;n.length;){const e=n.shift(),t=e.get("ExtGState");if(t instanceof i.Dict)for(let e of t.getRawValues()){if(e instanceof i.Ref){if(r.has(e))continue;try{e=s.fetch(e)}catch(t){r.put(e);(0,a.info)(`hasBlendModes - ignoring ExtGState: "${t}".`);continue}}if(!(e instanceof i.Dict))continue;e.objId&&r.put(e.objId);const t=e.get("BM");if(t instanceof i.Name){if("Normal"!==t.name)return!0}else if(void 0!==t&&Array.isArray(t))for(const e of t)if(e instanceof i.Name&&"Normal"!==e.name)return!0}const o=e.get("XObject");if(o instanceof i.Dict)for(let e of o.getRawValues()){if(e instanceof i.Ref){if(r.has(e))continue;try{e=s.fetch(e)}catch(t){r.put(e);(0,a.info)(`hasBlendModes - ignoring XObject: "${t}".`);continue}}if(!(e instanceof y.BaseStream))continue;e.dict.objId&&r.put(e.dict.objId);const t=e.dict.get("Resources");if(t instanceof i.Dict&&(!t.objId||!r.has(t.objId))){n.push(t);t.objId&&r.put(t.objId)}}}for(const e of r)t.put(e);return!1}async fetchBuiltInCMap(e){const t=this.builtInCMapCache.get(e);if(t)return t;let r;if(null!==this.options.cMapUrl){const t=`${this.options.cMapUrl}${e}.bcmap`,n=await fetch(t);if(!n.ok)throw new Error(`fetchBuiltInCMap: failed to fetch file "${t}" with "${n.statusText}".`);r={cMapData:new Uint8Array(await n.arrayBuffer()),compressionType:a.CMapCompressionType.BINARY}}else r=await this.handler.sendWithPromise("FetchBuiltInCMap",{name:e});r.compressionType!==a.CMapCompressionType.NONE&&this.builtInCMapCache.set(e,r);return r}async fetchStandardFontData(e){const t=this.standardFontDataCache.get(e);if(t)return new b.Stream(t);if(this.options.useSystemFonts&&"Symbol"!==e&&"ZapfDingbats"!==e)return null;const r=(0,l.getFontNameToFileMap)()[e];let n;if(null!==this.options.standardFontDataUrl){const e=`${this.options.standardFontDataUrl}${r}`,t=await fetch(e);t.ok?n=await t.arrayBuffer():(0,a.warn)(`fetchStandardFontData: failed to fetch file "${e}" with "${t.statusText}".`)}else try{n=await this.handler.sendWithPromise("FetchStandardFontData",{filename:r})}catch(e){(0,a.warn)(`fetchStandardFontData: failed to fetch file "${r}" with "${e}".`)}if(!n)return null;this.standardFontDataCache.set(e,n);return new b.Stream(n)}async buildFormXObject(e,t,r,n,s,o,c){const l=t.dict,h=l.getArray("Matrix");let u,d,f=l.getArray("BBox");f=Array.isArray(f)&&4===f.length?a.Util.normalizeRect(f):null;l.has("OC")&&(u=await this.parseMarkedContentProps(l.get("OC"),e));void 0!==u&&n.addOp(a.OPS.beginMarkedContentProps,["OC",u]);const g=l.get("Group");if(g){d={matrix:h,bbox:f,smask:r,isolated:!1,knockout:!1};const t=g.get("S");let s=null;if((0,i.isName)(t,"Transparency")){d.isolated=g.get("I")||!1;d.knockout=g.get("K")||!1;if(g.has("CS")){const t=g.getRaw("CS"),r=S.ColorSpace.getCached(t,this.xref,c);s=r||await this.parseColorSpace({cs:t,resources:e,localColorSpaceCache:c})}}if(r&&r.backdrop){s=s||S.ColorSpace.singletons.rgb;r.backdrop=s.getRgb(r.backdrop,0)}n.addOp(a.OPS.beginGroup,[d])}const p=g?[h,null]:[h,f];n.addOp(a.OPS.paintFormXObjectBegin,p);return this.getOperatorList({stream:t,task:s,resources:l.get("Resources")||e,operatorList:n,initialState:o}).then((function(){n.addOp(a.OPS.paintFormXObjectEnd,[]);g&&n.addOp(a.OPS.endGroup,[d]);void 0!==u&&n.addOp(a.OPS.endMarkedContent,[])}))}_sendImgData(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=t?[t.bitmap||t.data.buffer]:null;return this.parsingType3Font||r?this.handler.send("commonobj",[e,"Image",t],a):this.handler.send("obj",[e,this.pageIndex,"Image",t],a)}async buildPaintImageXObject(e){let{resources:t,image:r,isInline:n=!1,operatorList:i,cacheKey:s,localImageCache:o,localColorSpaceCache:c}=e;const l=r.dict,h=l.objId,u=l.get("W","Width"),d=l.get("H","Height");if(!u||"number"!=typeof u||!d||"number"!=typeof d){(0,a.warn)("Image dimensions are missing, or not numbers.");return}const f=this.options.maxImageSize;if(-1!==f&&u*d>f){const e="Image exceeded maximum allowed size and was removed.";if(this.options.ignoreErrors){(0,a.warn)(e);return}throw new Error(e)}let g;l.has("OC")&&(g=await this.parseMarkedContentProps(l.get("OC"),t));let p,m;if(l.get("IM","ImageMask")||!1){const e=l.get("I","Interpolate"),t=u+7>>3,n=r.getBytes(t*d),c=l.getArray("D","Decode");if(this.parsingType3Font){p=M.PDFImage.createRawMask({imgArray:n,width:u,height:d,imageIsFromDecodeStream:r instanceof x.DecodeStream,inverseDecode:!!c&&c[0]>0,interpolate:e});p.cached=!!s;m=[p];i.addImageOps(a.OPS.paintImageMaskXObject,m,g);s&&o.set(s,h,{fn:a.OPS.paintImageMaskXObject,args:m,optionalContent:g});return}p=M.PDFImage.createMask({imgArray:n,width:u,height:d,imageIsFromDecodeStream:r instanceof x.DecodeStream,inverseDecode:!!c&&c[0]>0,interpolate:e});if(p.isSingleOpaquePixel){i.addImageOps(a.OPS.paintSolidColorImageMask,[],g);s&&o.set(s,h,{fn:a.OPS.paintSolidColorImageMask,args:[],optionalContent:g});return}const f=`mask_${this.idFactory.createObjId()}`;i.addDependency(f);this._sendImgData(f,p);m=[{data:f,width:p.width,height:p.height,interpolate:p.interpolate,count:1}];i.addImageOps(a.OPS.paintImageMaskXObject,m,g);s&&o.set(s,h,{fn:a.OPS.paintImageMaskXObject,args:m,optionalContent:g});return}const b=l.get("SM","SMask")||!1,y=l.get("Mask")||!1;if(n&&!b&&!y&&u+d<200){const e=new M.PDFImage({xref:this.xref,res:t,image:r,isInline:n,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:c});p=e.createImageData(!0);i.addImageOps(a.OPS.paintInlineImageXObject,[p],g);return}let w=`img_${this.idFactory.createObjId()}`,S=!1;if(this.parsingType3Font)w=`${this.idFactory.getDocId()}_type3_${w}`;else if(h){S=this.globalImageCache.shouldCache(h,this.pageIndex);S&&(w=`${this.idFactory.getDocId()}_${w}`)}i.addDependency(w);m=[w,u,d];M.PDFImage.buildImage({xref:this.xref,res:t,image:r,isInline:n,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:c}).then((e=>{p=e.createImageData(!1);s&&h&&S&&this.globalImageCache.addByteSize(h,p.data.length);return this._sendImgData(w,p,S)})).catch((e=>{(0,a.warn)(`Unable to decode image "${w}": "${e}".`);return this._sendImgData(w,null,S)}));i.addImageOps(a.OPS.paintImageXObject,m,g);if(s){o.set(s,h,{fn:a.OPS.paintImageXObject,args:m,optionalContent:g});if(h){(0,a.assert)(!n,"Cannot cache an inline image globally.");this.globalImageCache.addPageIndex(h,this.pageIndex);S&&this.globalImageCache.setData(h,{objId:w,fn:a.OPS.paintImageXObject,args:m,optionalContent:g,byteSize:0})}}}handleSMask(e,t,r,a,n,i){const s=e.get("G"),o={subtype:e.get("S").name,backdrop:e.get("BC")},c=e.get("TR");if((0,g.isPDFFunction)(c)){const e=this._pdfFunctionFactory.create(c),t=new Uint8Array(256),r=new Float32Array(1);for(let a=0;a<256;a++){r[0]=a/255;e(r,0,r,0);t[a]=255*r[0]|0}o.transferMap=t}return this.buildFormXObject(t,s,o,r,a,n.state.clone(),i)}handleTransferFunction(e){let t;if(Array.isArray(e))t=e;else{if(!(0,g.isPDFFunction)(e))return null;t=[e]}const r=[];let a=0,n=0;for(const e of t){const t=this.xref.fetchIfRef(e);a++;if((0,i.isName)(t,"Identity")){r.push(null);continue}if(!(0,g.isPDFFunction)(t))return null;const s=this._pdfFunctionFactory.create(t),o=new Uint8Array(256),c=new Float32Array(1);for(let e=0;e<256;e++){c[0]=e/255;s(c,0,c,0);o[e]=255*c[0]|0}r.push(o);n++}return 1!==a&&4!==a||0===n?null:r}handleTilingType(e,t,r,n,s,o,c,l){const h=new T.OperatorList,d=i.Dict.merge({xref:this.xref,dictArray:[s.get("Resources"),r]});return this.getOperatorList({stream:n,task:c,resources:d,operatorList:h}).then((function(){const r=h.getIR(),a=(0,u.getTilingPatternIR)(r,s,t);o.addDependencies(h.dependencies);o.addOp(e,a);s.objId&&l.set(null,s.objId,{operatorListIR:r,dict:s})})).catch((e=>{if(!(e instanceof a.AbortException)){if(!this.options.ignoreErrors)throw e;this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorTilingPattern});(0,a.warn)(`handleTilingType - ignoring pattern: "${e}".`)}}))}handleSetFont(e,t,r,n,o,c){let l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,h=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;const u=t&&t[0]instanceof i.Name?t[0].name:null;return this.loadFont(u,r,e,l,h).then((t=>t.font.isType3Font?t.loadType3Data(this,e,o).then((function(){n.addDependencies(t.type3Dependencies);return t})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontLoadType3});return new TranslatedFont({loadedName:"g_font_error",font:new s.ErrorFont(`Type3 font load error: ${e}`),dict:t.font,evaluatorOptions:this.options})})):t)).then((e=>{c.font=e.font;e.send(this.handler);return e.loadedName}))}handleText(e,t){const r=t.font,n=r.charsToGlyphs(e);if(r.data){(!!(t.textRenderingMode&a.TextRenderingMode.ADD_TO_PATH_FLAG)||"Pattern"===t.fillColorSpace.name||r.disableFontFace||this.options.disableFontFace)&&PartialEvaluator.buildFontPaths(r,n,this.handler,this.options)}return n}ensureStateFont(e){if(e.font)return;const t=new a.FormatError("Missing setFont (Tf) operator before text rendering operator.");if(!this.options.ignoreErrors)throw t;this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontState});(0,a.warn)(`ensureStateFont: "${t}".`)}async setGState(e){let{resources:t,gState:r,operatorList:n,cacheKey:s,task:o,stateManager:c,localGStateCache:l,localColorSpaceCache:h}=e;const u=r.objId;let d=!0;const f=[],g=r.getKeys();let p=Promise.resolve();for(let e=0,s=g.length;e<s;e++){const s=g[e],l=r.get(s);switch(s){case"Type":break;case"LW":case"LC":case"LJ":case"ML":case"D":case"RI":case"FL":case"CA":case"ca":f.push([s,l]);break;case"Font":d=!1;p=p.then((()=>this.handleSetFont(t,null,l[0],n,o,c.state).then((function(e){n.addDependency(e);f.push([s,[e,l[1]]])}))));break;case"BM":f.push([s,normalizeBlendMode(l)]);break;case"SMask":if((0,i.isName)(l,"None")){f.push([s,!1]);break}if(l instanceof i.Dict){d=!1;p=p.then((()=>this.handleSMask(l,t,n,o,c,h)));f.push([s,!0])}else(0,a.warn)("Unsupported SMask type");break;case"TR":const e=this.handleTransferFunction(l);f.push([s,e]);break;case"OP":case"op":case"OPM":case"BG":case"BG2":case"UCR":case"UCR2":case"TR2":case"HT":case"SM":case"SA":case"AIS":case"TK":(0,a.info)("graphic state operator "+s);break;default:(0,a.info)("Unknown graphic state operator "+s)}}return p.then((function(){f.length>0&&n.addOp(a.OPS.setGState,[f]);d&&l.set(s,u,f)}))}loadFont(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const errorFont=async()=>new TranslatedFont({loadedName:"g_font_error",font:new s.ErrorFont(`Font "${e}" is not available.`),dict:t,evaluatorOptions:this.options}),l=this.xref;let h;if(t)t instanceof i.Ref&&(h=t);else{const t=r.get("Font");t&&(h=t.getRaw(e))}if(!h){const r=`Font "${e||t&&t.toString()}" is not available`;if(!this.options.ignoreErrors&&!this.parsingType3Font){(0,a.warn)(`${r}.`);return errorFont()}this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontMissing});(0,a.warn)(`${r} -- attempting to fallback to a default font.`);h=n||PartialEvaluator.fallbackFontDict}if(this.parsingType3Font&&this.type3FontRefs.has(h))return errorFont();if(this.fontCache.has(h))return this.fontCache.get(h);if(!((t=l.fetchIfRef(h))instanceof i.Dict))return errorFont();if(t.cacheKey&&this.fontCache.has(t.cacheKey))return this.fontCache.get(t.cacheKey);const u=(0,a.createPromiseCapability)();let d;try{d=this.preEvaluateFont(t);d.cssFontInfo=c}catch(e){(0,a.warn)(`loadFont - preEvaluateFont failed: "${e}".`);return errorFont()}const{descriptor:f,hash:g}=d,p=h instanceof i.Ref;let m;p&&(m=`f${h.toString()}`);if(g&&f instanceof i.Dict){f.fontAliases||(f.fontAliases=Object.create(null));const e=f.fontAliases;if(e[g]){const t=e[g].aliasRef;if(p&&t&&this.fontCache.has(t)){this.fontCache.putAlias(h,t);return this.fontCache.get(h)}}else e[g]={fontID:this.idFactory.createFontId()};p&&(e[g].aliasRef=h);m=e[g].fontID}if(p)this.fontCache.put(h,u.promise);else{m||(m=this.idFactory.createFontId());t.cacheKey=`cacheKey_${m}`;this.fontCache.put(t.cacheKey,u.promise)}(0,a.assert)(m&&m.startsWith("f"),'The "fontID" must be (correctly) defined.');t.loadedName=`${this.idFactory.getDocId()}_${m}`;this.translateFont(d).then((e=>{void 0!==e.fontType&&l.stats.addFontType(e.fontType);u.resolve(new TranslatedFont({loadedName:t.loadedName,font:e,dict:t,evaluatorOptions:this.options}))})).catch((e=>{this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontTranslate});(0,a.warn)(`loadFont - translateFont failed: "${e}".`);try{const e=f&&f.get("FontFile3"),t=e&&e.get("Subtype"),r=(0,o.getFontType)(d.type,t&&t.name);void 0!==r&&l.stats.addFontType(r)}catch(e){}u.resolve(new TranslatedFont({loadedName:t.loadedName,font:new s.ErrorFont(e instanceof Error?e.message:e),dict:t,evaluatorOptions:this.options}))}));return u.promise}buildPath(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const i=e.length-1;r||(r=[]);if(i<0||e.fnArray[i]!==a.OPS.constructPath){if(n){(0,a.warn)(`Encountered path operator "${t}" inside of a text object.`);e.addOp(a.OPS.save,null)}let i;switch(t){case a.OPS.rectangle:const e=r[0]+r[2],t=r[1]+r[3];i=[Math.min(r[0],e),Math.max(r[0],e),Math.min(r[1],t),Math.max(r[1],t)];break;case a.OPS.moveTo:case a.OPS.lineTo:i=[r[0],r[0],r[1],r[1]];break;default:i=[1/0,-1/0,1/0,-1/0]}e.addOp(a.OPS.constructPath,[[t],r,i]);n&&e.addOp(a.OPS.restore,null)}else{const n=e.argsArray[i];n[0].push(t);n[1].push(...r);const s=n[2];switch(t){case a.OPS.rectangle:const e=r[0]+r[2],t=r[1]+r[3];s[0]=Math.min(s[0],r[0],e);s[1]=Math.max(s[1],r[0],e);s[2]=Math.min(s[2],r[1],t);s[3]=Math.max(s[3],r[1],t);break;case a.OPS.moveTo:case a.OPS.lineTo:s[0]=Math.min(s[0],r[0]);s[1]=Math.max(s[1],r[0]);s[2]=Math.min(s[2],r[1]);s[3]=Math.max(s[3],r[1])}}}parseColorSpace(e){let{cs:t,resources:r,localColorSpaceCache:n}=e;return S.ColorSpace.parseAsync({cs:t,xref:this.xref,resources:r,pdfFunctionFactory:this._pdfFunctionFactory,localColorSpaceCache:n}).catch((e=>{if(e instanceof a.AbortException)return null;if(this.options.ignoreErrors){this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorColorSpace});(0,a.warn)(`parseColorSpace - ignoring ColorSpace: "${e}".`);return null}throw e}))}parseShading(e){let{shading:t,resources:r,localColorSpaceCache:a,localShadingPatternCache:n}=e,i=n.get(t);if(!i){const e=u.Pattern.parseShading(t,this.xref,r,this.handler,this._pdfFunctionFactory,a).getIR();i=`pattern_${this.idFactory.createObjId()}`;n.set(t,i);this.handler.send("obj",[i,this.pageIndex,"Pattern",e])}return i}handleColorN(e,t,r,n,s,o,c,l,h,d){const f=r.pop();if(f instanceof i.Name){const g=s.getRaw(f.name),p=g instanceof i.Ref&&h.getByRef(g);if(p)try{const a=n.base?n.base.getRgb(r,0):null,i=(0,u.getTilingPatternIR)(p.operatorListIR,p.dict,a);e.addOp(t,i);return}catch(e){}const m=this.xref.fetchIfRef(g);if(m){const i=m instanceof y.BaseStream?m.dict:m,s=i.get("PatternType");if(s===D){const a=n.base?n.base.getRgb(r,0):null;return this.handleTilingType(t,a,o,m,i,e,c,h)}if(s===N){const r=i.get("Shading"),a=i.getArray("Matrix"),n=this.parseShading({shading:r,resources:o,localColorSpaceCache:l,localShadingPatternCache:d});e.addOp(t,["Shading",n,a]);return}throw new a.FormatError(`Unknown PatternType: ${s}`)}}throw new a.FormatError(`Unknown PatternName: ${f}`)}_parseVisibilityExpression(e,t,r){if(++t>10){(0,a.warn)("Visibility expression is too deeply nested");return}const n=e.length,s=this.xref.fetchIfRef(e[0]);if(!(n<2)&&s instanceof i.Name){switch(s.name){case"And":case"Or":case"Not":r.push(s.name);break;default:(0,a.warn)(`Invalid operator ${s.name} in visibility expression`);return}for(let a=1;a<n;a++){const n=e[a],s=this.xref.fetchIfRef(n);if(Array.isArray(s)){const e=[];r.push(e);this._parseVisibilityExpression(s,t,e)}else n instanceof i.Ref&&r.push(n.toString())}}else(0,a.warn)("Invalid visibility expression")}async parseMarkedContentProps(e,t){let r;if(e instanceof i.Name){r=t.get("Properties").get(e.name)}else{if(!(e instanceof i.Dict))throw new a.FormatError("Optional content properties malformed.");r=e}const n=r.get("Type").name;if("OCG"===n)return{type:n,id:r.objId};if("OCMD"===n){const e=r.get("VE");if(Array.isArray(e)){const t=[];this._parseVisibilityExpression(e,0,t);if(t.length>0)return{type:"OCMD",expression:t}}const t=r.get("OCGs");if(Array.isArray(t)||t instanceof i.Dict){const e=[];if(Array.isArray(t))for(const r of t)e.push(r.toString());else e.push(t.objId);return{type:n,ids:e,policy:r.get("P")instanceof i.Name?r.get("P").name:null,expression:null}}if(t instanceof i.Ref)return{type:n,id:t.toString()}}return null}getOperatorList(e){let{stream:t,task:r,resources:n,operatorList:s,initialState:o=null,fallbackFontDict:c=null}=e;n=n||i.Dict.empty;o=o||new EvalState;if(!s)throw new Error('getOperatorList: missing "operatorList" parameter');const l=this,h=this.xref;let u=!1;const d=new m.LocalImageCache,f=new m.LocalColorSpaceCache,g=new m.LocalGStateCache,p=new m.LocalTilingPatternCache,b=new Map,w=n.get("XObject")||i.Dict.empty,x=n.get("Pattern")||i.Dict.empty,k=new StateManager(o),C=new EvaluatorPreprocessor(t,h,k),v=new TimeSlotManager;function closePendingRestoreOPS(e){for(let e=0,t=C.savedStatesDepth;e<t;e++)s.addOp(a.OPS.restore,[])}return new Promise((function promiseBody(e,t){const next=function(r){Promise.all([r,s.ready]).then((function(){try{promiseBody(e,t)}catch(e){t(e)}}),t)};r.ensureNotTerminated();v.reset();const o={};let m,O,T,M,E,D;for(;!(m=v.check());){o.args=null;if(!C.read(o))break;let e=o.args,t=o.fn;switch(0|t){case a.OPS.paintXObject:D=e[0]instanceof i.Name;E=e[0].name;if(D){const t=d.getByName(E);if(t){s.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e=null;continue}}next(new Promise((function(e,t){if(!D)throw new a.FormatError("XObject must be referred to by name.");let o=w.getRaw(E);if(o instanceof i.Ref){const t=d.getByRef(o);if(t){s.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e();return}const r=l.globalImageCache.getData(o,l.pageIndex);if(r){s.addDependency(r.objId);s.addImageOps(r.fn,r.args,r.optionalContent);e();return}o=h.fetch(o)}if(!(o instanceof y.BaseStream))throw new a.FormatError("XObject should be a stream");const c=o.dict.get("Subtype");if(!(c instanceof i.Name))throw new a.FormatError("XObject should have a Name subtype");if("Form"!==c.name)if("Image"!==c.name){if("PS"!==c.name)throw new a.FormatError(`Unhandled XObject subtype ${c.name}`);(0,a.info)("Ignored XObject subtype PS");e()}else l.buildPaintImageXObject({resources:n,image:o,operatorList:s,cacheKey:E,localImageCache:d,localColorSpaceCache:f}).then(e,t);else{k.save();l.buildFormXObject(n,o,null,s,r,k.state.clone(),f).then((function(){k.restore();e()}),t)}})).catch((function(e){if(!(e instanceof a.AbortException)){if(!l.options.ignoreErrors)throw e;l.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorXObject});(0,a.warn)(`getOperatorList - ignoring XObject: "${e}".`)}})));return;case a.OPS.setFont:var N=e[1];next(l.handleSetFont(n,e,null,s,r,k.state,c).then((function(e){s.addDependency(e);s.addOp(a.OPS.setFont,[e,N])})));return;case a.OPS.beginText:u=!0;break;case a.OPS.endText:u=!1;break;case a.OPS.endInlineImage:var L=e[0].cacheKey;if(L){const t=d.getByName(L);if(t){s.addImageOps(t.fn,t.args,t.optionalContent);incrementCachedImageMaskCount(t);e=null;continue}}next(l.buildPaintImageXObject({resources:n,image:e[0],isInline:!0,operatorList:s,cacheKey:L,localImageCache:d,localColorSpaceCache:f}));return;case a.OPS.showText:if(!k.state.font){l.ensureStateFont(k.state);continue}e[0]=l.handleText(e[0],k.state);break;case a.OPS.showSpacedText:if(!k.state.font){l.ensureStateFont(k.state);continue}var j=[],$=k.state;for(const t of e[0])"string"==typeof t?j.push(...l.handleText(t,$)):"number"==typeof t&&j.push(t);e[0]=j;t=a.OPS.showText;break;case a.OPS.nextLineShowText:if(!k.state.font){l.ensureStateFont(k.state);continue}s.addOp(a.OPS.nextLine);e[0]=l.handleText(e[0],k.state);t=a.OPS.showText;break;case a.OPS.nextLineSetSpacingShowText:if(!k.state.font){l.ensureStateFont(k.state);continue}s.addOp(a.OPS.nextLine);s.addOp(a.OPS.setWordSpacing,[e.shift()]);s.addOp(a.OPS.setCharSpacing,[e.shift()]);e[0]=l.handleText(e[0],k.state);t=a.OPS.showText;break;case a.OPS.setTextRenderingMode:k.state.textRenderingMode=e[0];break;case a.OPS.setFillColorSpace:{const t=S.ColorSpace.getCached(e[0],h,f);if(t){k.state.fillColorSpace=t;continue}next(l.parseColorSpace({cs:e[0],resources:n,localColorSpaceCache:f}).then((function(e){e&&(k.state.fillColorSpace=e)})));return}case a.OPS.setStrokeColorSpace:{const t=S.ColorSpace.getCached(e[0],h,f);if(t){k.state.strokeColorSpace=t;continue}next(l.parseColorSpace({cs:e[0],resources:n,localColorSpaceCache:f}).then((function(e){e&&(k.state.strokeColorSpace=e)})));return}case a.OPS.setFillColor:M=k.state.fillColorSpace;e=M.getRgb(e,0);t=a.OPS.setFillRGBColor;break;case a.OPS.setStrokeColor:M=k.state.strokeColorSpace;e=M.getRgb(e,0);t=a.OPS.setStrokeRGBColor;break;case a.OPS.setFillGray:k.state.fillColorSpace=S.ColorSpace.singletons.gray;e=S.ColorSpace.singletons.gray.getRgb(e,0);t=a.OPS.setFillRGBColor;break;case a.OPS.setStrokeGray:k.state.strokeColorSpace=S.ColorSpace.singletons.gray;e=S.ColorSpace.singletons.gray.getRgb(e,0);t=a.OPS.setStrokeRGBColor;break;case a.OPS.setFillCMYKColor:k.state.fillColorSpace=S.ColorSpace.singletons.cmyk;e=S.ColorSpace.singletons.cmyk.getRgb(e,0);t=a.OPS.setFillRGBColor;break;case a.OPS.setStrokeCMYKColor:k.state.strokeColorSpace=S.ColorSpace.singletons.cmyk;e=S.ColorSpace.singletons.cmyk.getRgb(e,0);t=a.OPS.setStrokeRGBColor;break;case a.OPS.setFillRGBColor:k.state.fillColorSpace=S.ColorSpace.singletons.rgb;e=S.ColorSpace.singletons.rgb.getRgb(e,0);break;case a.OPS.setStrokeRGBColor:k.state.strokeColorSpace=S.ColorSpace.singletons.rgb;e=S.ColorSpace.singletons.rgb.getRgb(e,0);break;case a.OPS.setFillColorN:M=k.state.fillColorSpace;if("Pattern"===M.name){next(l.handleColorN(s,a.OPS.setFillColorN,e,M,x,n,r,f,p,b));return}e=M.getRgb(e,0);t=a.OPS.setFillRGBColor;break;case a.OPS.setStrokeColorN:M=k.state.strokeColorSpace;if("Pattern"===M.name){next(l.handleColorN(s,a.OPS.setStrokeColorN,e,M,x,n,r,f,p,b));return}e=M.getRgb(e,0);t=a.OPS.setStrokeRGBColor;break;case a.OPS.shadingFill:var _=n.get("Shading");if(!_)throw new a.FormatError("No shading resource found");var U=_.get(e[0].name);if(!U)throw new a.FormatError("No shading object found");e=[l.parseShading({shading:U,resources:n,localColorSpaceCache:f,localShadingPatternCache:b})];t=a.OPS.shadingFill;break;case a.OPS.setGState:D=e[0]instanceof i.Name;E=e[0].name;if(D){const t=g.getByName(E);if(t){t.length>0&&s.addOp(a.OPS.setGState,[t]);e=null;continue}}next(new Promise((function(e,t){if(!D)throw new a.FormatError("GState must be referred to by name.");const o=n.get("ExtGState");if(!(o instanceof i.Dict))throw new a.FormatError("ExtGState should be a dictionary.");const c=o.get(E);if(!(c instanceof i.Dict))throw new a.FormatError("GState should be a dictionary.");l.setGState({resources:n,gState:c,operatorList:s,cacheKey:E,task:r,stateManager:k,localGStateCache:g,localColorSpaceCache:f}).then(e,t)})).catch((function(e){if(!(e instanceof a.AbortException)){if(!l.options.ignoreErrors)throw e;l.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorExtGState});(0,a.warn)(`getOperatorList - ignoring ExtGState: "${e}".`)}})));return;case a.OPS.moveTo:case a.OPS.lineTo:case a.OPS.curveTo:case a.OPS.curveTo2:case a.OPS.curveTo3:case a.OPS.closePath:case a.OPS.rectangle:l.buildPath(s,t,e,u);continue;case a.OPS.markPoint:case a.OPS.markPointProps:case a.OPS.beginCompat:case a.OPS.endCompat:continue;case a.OPS.beginMarkedContentProps:if(!(e[0]instanceof i.Name)){(0,a.warn)(`Expected name for beginMarkedContentProps arg0=${e[0]}`);continue}if("OC"===e[0].name){next(l.parseMarkedContentProps(e[1],n).then((e=>{s.addOp(a.OPS.beginMarkedContentProps,["OC",e])})).catch((e=>{if(!(e instanceof a.AbortException)){if(!l.options.ignoreErrors)throw e;l.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorMarkedContent});(0,a.warn)(`getOperatorList - ignoring beginMarkedContentProps: "${e}".`)}})));return}e=[e[0].name,e[1]instanceof i.Dict?e[1].get("MCID"):null];break;case a.OPS.beginMarkedContent:case a.OPS.endMarkedContent:default:if(null!==e){for(O=0,T=e.length;O<T&&!(e[O]instanceof i.Dict);O++);if(O<T){(0,a.warn)("getOperatorList - ignoring operator: "+t);continue}}}s.addOp(t,e)}if(m)next(R);else{closePendingRestoreOPS();e()}})).catch((e=>{if(!(e instanceof a.AbortException)){if(!this.options.ignoreErrors)throw e;this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorOperatorList});(0,a.warn)(`getOperatorList - ignoring errors during "${r.name}" task: "${e}".`);closePendingRestoreOPS()}}))}getTextContent(e){let{stream:t,task:r,resources:n,stateManager:s=null,combineTextItems:o=!1,includeMarkedContent:c=!1,sink:l,seenStyles:u=new Set,viewBox:d}=e;n=n||i.Dict.empty;s=s||new StateManager(new TextState);const f=(0,h.getNormalizedUnicodes)(),g={items:[],styles:Object.create(null)},p={initialized:!1,str:[],totalWidth:0,totalHeight:0,width:0,height:0,vertical:!1,prevTransform:null,textAdvanceScale:0,spaceInFlowMin:0,spaceInFlowMax:0,trackingSpaceMin:1/0,negativeSpaceMax:-1/0,notASpace:-1/0,transform:null,fontName:null,hasEOL:!1},b=[" "," "];let S=0;function saveLastChar(e){const t=(S+1)%2,r=" "!==b[S]&&" "===b[t];b[S]=e;S=t;return r}function resetLastChars(){b[0]=b[1]=" ";S=0}const x=this,k=this.xref,C=[];let v=null;const O=new m.LocalImageCache,T=new m.LocalGStateCache,M=new EvaluatorPreprocessor(t,k,s);let E;function getCurrentTextTransform(){const e=E.font,t=[E.fontSize*E.textHScale,0,0,E.fontSize,0,E.textRise];if(e.isType3Font&&(E.fontSize<=1||e.isCharBBox)&&!(0,a.isArrayEqual)(E.fontMatrix,a.FONT_IDENTITY_MATRIX)){const r=e.bbox[3]-e.bbox[1];r>0&&(t[3]*=r*E.fontMatrix[3])}return a.Util.transform(E.ctm,a.Util.transform(E.textMatrix,t))}function ensureTextContentItem(){if(p.initialized)return p;const e=E.font,t=e.loadedName;if(!u.has(t)){u.add(t);g.styles[t]={fontFamily:e.fallbackName,ascent:e.ascent,descent:e.descent,vertical:e.vertical}}p.fontName=t;const r=p.transform=getCurrentTextTransform();if(e.vertical){p.width=p.totalWidth=Math.hypot(r[0],r[1]);p.height=p.totalHeight=0;p.vertical=!0}else{p.width=p.totalWidth=0;p.height=p.totalHeight=Math.hypot(r[2],r[3]);p.vertical=!1}const a=Math.hypot(E.textLineMatrix[0],E.textLineMatrix[1]),n=Math.hypot(E.ctm[0],E.ctm[1]);p.textAdvanceScale=n*a;p.trackingSpaceMin=.1*E.fontSize;p.notASpace=.03*E.fontSize;p.negativeSpaceMax=-.2*E.fontSize;p.spaceInFlowMin=.1*E.fontSize;p.spaceInFlowMax=.6*E.fontSize;p.hasEOL=!1;p.initialized=!0;return p}function updateAdvanceScale(){if(!p.initialized)return;const e=Math.hypot(E.textLineMatrix[0],E.textLineMatrix[1]),t=Math.hypot(E.ctm[0],E.ctm[1])*e;if(t!==p.textAdvanceScale){if(p.vertical){p.totalHeight+=p.height*p.textAdvanceScale;p.height=0}else{p.totalWidth+=p.width*p.textAdvanceScale;p.width=0}p.textAdvanceScale=t}}function handleSetFont(e,t){return x.loadFont(e,t,n).then((function(e){return e.font.isType3Font?e.loadType3Data(x,n,r).catch((function(){})).then((function(){return e})):e})).then((function(e){E.font=e.font;E.fontMatrix=e.font.fontMatrix||a.FONT_IDENTITY_MATRIX}))}function applyInverseRotation(e,t,r){const a=Math.hypot(r[0],r[1]);return[(r[0]*e+r[1]*t)/a,(r[2]*e+r[3]*t)/a]}function compareWithLastPosition(){const e=getCurrentTextTransform();let t=e[4],r=e[5];const a=t-d[0],n=r-d[1];if(a<0||a>d[2]||n<0||n>d[3])return!1;if(!o||!E.font||!p.prevTransform)return!0;let i=p.prevTransform[4],s=p.prevTransform[5];if(i===t&&s===r)return!0;let c=-1;e[0]&&0===e[1]&&0===e[2]?c=e[0]>0?0:180:e[1]&&0===e[0]&&0===e[3]&&(c=e[1]>0?90:270);switch(c){case 0:break;case 90:[t,r]=[r,t];[i,s]=[s,i];break;case 180:[t,r,i,s]=[-t,-r,-i,-s];break;case 270:[t,r]=[-r,-t];[i,s]=[-s,-i];break;default:[t,r]=applyInverseRotation(t,r,e);[i,s]=applyInverseRotation(i,s,p.prevTransform)}if(E.font.vertical){const e=(s-r)/p.textAdvanceScale,a=t-i,n=Math.sign(p.height);if(e<n*p.negativeSpaceMax){if(Math.abs(a)>.5*p.width){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(a)>p.width){appendEOL();return!0}e<=n*p.notASpace&&resetLastChars();if(e<=n*p.trackingSpaceMin)p.height+=e;else if(!addFakeSpaces(e,p.prevTransform,n))if(0===p.str.length){resetLastChars();g.items.push({str:" ",dir:"ltr",width:0,height:Math.abs(e),transform:p.prevTransform,fontName:p.fontName,hasEOL:!1})}else p.height+=e;return!0}const l=(t-i)/p.textAdvanceScale,h=r-s,u=Math.sign(p.width);if(l<u*p.negativeSpaceMax){if(Math.abs(h)>.5*p.height){appendEOL();return!0}resetLastChars();flushTextContentItem();return!0}if(Math.abs(h)>p.height){appendEOL();return!0}l<=u*p.notASpace&&resetLastChars();if(l<=u*p.trackingSpaceMin)p.width+=l;else if(!addFakeSpaces(l,p.prevTransform,u))if(0===p.str.length){resetLastChars();g.items.push({str:" ",dir:"ltr",width:Math.abs(l),height:0,transform:p.prevTransform,fontName:p.fontName,hasEOL:!1})}else p.width+=l;return!0}function buildTextContentItem(e){let{chars:t,extraSpacing:r}=e;const a=E.font;if(!t){const e=E.charSpacing+r;e&&(a.vertical?E.translateTextMatrix(0,-e):E.translateTextMatrix(e*E.textHScale,0));return}const n=a.charsToGlyphs(t),i=E.fontMatrix[0]*E.fontSize;for(let e=0,t=n.length;e<t;e++){const s=n[e];if(s.isInvisibleFormatMark)continue;let o=E.charSpacing+(e+1===t?r:0),c=s.width;a.vertical&&(c=s.vmetric?s.vmetric[0]:-c);let l=c*i;if(s.isWhitespace){if(a.vertical){o+=-l+E.wordSpacing;E.translateTextMatrix(0,-o)}else{o+=l+E.wordSpacing;E.translateTextMatrix(o*E.textHScale,0)}saveLastChar(" ");continue}if(!compareWithLastPosition())continue;const u=ensureTextContentItem();s.isZeroWidthDiacritic&&(l=0);if(a.vertical){E.translateTextMatrix(0,l);l=Math.abs(l);u.height+=l}else{l*=E.textHScale;E.translateTextMatrix(l,0);u.width+=l}l&&(u.prevTransform=getCurrentTextTransform());let d=s.unicode;d=f[d]||d;d=(0,h.reverseIfRtl)(d);saveLastChar(d)&&u.str.push(" ");u.str.push(d);o&&(a.vertical?E.translateTextMatrix(0,-o):E.translateTextMatrix(o*E.textHScale,0))}}function appendEOL(){resetLastChars();if(p.initialized){p.hasEOL=!0;flushTextContentItem()}else g.items.push({str:"",dir:"ltr",width:0,height:0,transform:getCurrentTextTransform(),fontName:E.font.loadedName,hasEOL:!0})}function addFakeSpaces(e,t,r){if(r*p.spaceInFlowMin<=e&&e<=r*p.spaceInFlowMax){if(p.initialized){resetLastChars();p.str.push(" ")}return!1}const a=p.fontName;let n=0;if(p.vertical){n=e;e=0}flushTextContentItem();resetLastChars();g.items.push({str:" ",dir:"ltr",width:Math.abs(e),height:Math.abs(n),transform:t||getCurrentTextTransform(),fontName:a,hasEOL:!1});return!0}function flushTextContentItem(){if(p.initialized&&p.str){p.vertical?p.totalHeight+=p.height*p.textAdvanceScale:p.totalWidth+=p.width*p.textAdvanceScale;g.items.push(function runBidiTransform(e){const t=e.str.join(""),r=(0,w.bidi)(t,-1,e.vertical);return{str:r.str,dir:r.dir,width:Math.abs(e.totalWidth),height:Math.abs(e.totalHeight),transform:e.transform,fontName:e.fontName,hasEOL:e.hasEOL}}(p));p.initialized=!1;p.str.length=0}}function enqueueChunk(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=g.items.length;if(0!==t&&!(e&&t<10)){l.enqueue(g,t);g.items=[];g.styles=Object.create(null)}}const D=new TimeSlotManager;return new Promise((function promiseBody(e,t){const next=function(r){enqueueChunk(!0);Promise.all([r,l.ready]).then((function(){try{promiseBody(e,t)}catch(e){t(e)}}),t)};r.ensureNotTerminated();D.reset();const h={};let f,p=[];for(;!(f=D.check());){p.length=0;h.args=p;if(!M.read(h))break;E=s.state;const e=h.fn;p=h.args;switch(0|e){case a.OPS.setFont:var m=p[0].name,b=p[1];if(E.font&&m===E.fontName&&b===E.fontSize)break;flushTextContentItem();E.fontName=m;E.fontSize=b;next(handleSetFont(m,null));return;case a.OPS.setTextRise:E.textRise=p[0];break;case a.OPS.setHScale:E.textHScale=p[0]/100;break;case a.OPS.setLeading:E.leading=p[0];break;case a.OPS.moveText:E.translateTextLineMatrix(p[0],p[1]);E.textMatrix=E.textLineMatrix.slice();break;case a.OPS.setLeadingMoveText:E.leading=-p[1];E.translateTextLineMatrix(p[0],p[1]);E.textMatrix=E.textLineMatrix.slice();break;case a.OPS.nextLine:E.carriageReturn();break;case a.OPS.setTextMatrix:E.setTextMatrix(p[0],p[1],p[2],p[3],p[4],p[5]);E.setTextLineMatrix(p[0],p[1],p[2],p[3],p[4],p[5]);updateAdvanceScale();break;case a.OPS.setCharSpacing:E.charSpacing=p[0];break;case a.OPS.setWordSpacing:E.wordSpacing=p[0];break;case a.OPS.beginText:E.textMatrix=a.IDENTITY_MATRIX.slice();E.textLineMatrix=a.IDENTITY_MATRIX.slice();break;case a.OPS.showSpacedText:if(!s.state.font){x.ensureStateFont(s.state);continue}const e=(E.font.vertical?1:-1)*E.fontSize/1e3,t=p[0];for(let r=0,a=t.length;r<a-1;r++){const a=t[r];if("string"==typeof a)C.push(a);else if("number"==typeof a&&0!==a){const t=C.join("");C.length=0;buildTextContentItem({chars:t,extraSpacing:a*e})}}const h=t.at(-1);"string"==typeof h&&C.push(h);if(C.length>0){const e=C.join("");C.length=0;buildTextContentItem({chars:e,extraSpacing:0})}break;case a.OPS.showText:if(!s.state.font){x.ensureStateFont(s.state);continue}buildTextContentItem({chars:p[0],extraSpacing:0});break;case a.OPS.nextLineShowText:if(!s.state.font){x.ensureStateFont(s.state);continue}E.carriageReturn();buildTextContentItem({chars:p[0],extraSpacing:0});break;case a.OPS.nextLineSetSpacingShowText:if(!s.state.font){x.ensureStateFont(s.state);continue}E.wordSpacing=p[0];E.charSpacing=p[1];E.carriageReturn();buildTextContentItem({chars:p[2],extraSpacing:0});break;case a.OPS.paintXObject:flushTextContentItem();v||(v=n.get("XObject")||i.Dict.empty);var w=p[0]instanceof i.Name,S=p[0].name;if(w&&O.getByName(S))break;next(new Promise((function(e,t){if(!w)throw new a.FormatError("XObject must be referred to by name.");let h=v.getRaw(S);if(h instanceof i.Ref){if(O.getByRef(h)){e();return}if(x.globalImageCache.getData(h,x.pageIndex)){e();return}h=k.fetch(h)}if(!(h instanceof y.BaseStream))throw new a.FormatError("XObject should be a stream");const f=h.dict.get("Subtype");if(!(f instanceof i.Name))throw new a.FormatError("XObject should have a Name subtype");if("Form"!==f.name){O.set(S,h.dict.objId,!0);e();return}const g=s.state.clone(),p=new StateManager(g),m=h.dict.getArray("Matrix");Array.isArray(m)&&6===m.length&&p.transform(m);enqueueChunk();const b={enqueueInvoked:!1,enqueue(e,t){this.enqueueInvoked=!0;l.enqueue(e,t)},get desiredSize(){return l.desiredSize},get ready(){return l.ready}};x.getTextContent({stream:h,task:r,resources:h.dict.get("Resources")||n,stateManager:p,combineTextItems:o,includeMarkedContent:c,sink:b,seenStyles:u,viewBox:d}).then((function(){b.enqueueInvoked||O.set(S,h.dict.objId,!0);e()}),t)})).catch((function(e){if(!(e instanceof a.AbortException)){if(!x.options.ignoreErrors)throw e;(0,a.warn)(`getTextContent - ignoring XObject: "${e}".`)}})));return;case a.OPS.setGState:w=p[0]instanceof i.Name;S=p[0].name;if(w&&T.getByName(S))break;next(new Promise((function(e,t){if(!w)throw new a.FormatError("GState must be referred to by name.");const r=n.get("ExtGState");if(!(r instanceof i.Dict))throw new a.FormatError("ExtGState should be a dictionary.");const s=r.get(S);if(!(s instanceof i.Dict))throw new a.FormatError("GState should be a dictionary.");const o=s.get("Font");if(o){flushTextContentItem();E.fontName=null;E.fontSize=o[1];handleSetFont(null,o[0]).then(e,t)}else{T.set(S,s.objId,!0);e()}})).catch((function(e){if(!(e instanceof a.AbortException)){if(!x.options.ignoreErrors)throw e;(0,a.warn)(`getTextContent - ignoring ExtGState: "${e}".`)}})));return;case a.OPS.beginMarkedContent:flushTextContentItem();c&&g.items.push({type:"beginMarkedContent",tag:p[0]instanceof i.Name?p[0].name:null});break;case a.OPS.beginMarkedContentProps:flushTextContentItem();if(c){let e=null;p[1]instanceof i.Dict&&(e=p[1].get("MCID"));g.items.push({type:"beginMarkedContentProps",id:Number.isInteger(e)?`${x.idFactory.getPageObjId()}_mcid${e}`:null,tag:p[0]instanceof i.Name?p[0].name:null})}break;case a.OPS.endMarkedContent:flushTextContentItem();c&&g.items.push({type:"endMarkedContent"})}if(g.items.length>=l.desiredSize){f=!0;break}}if(f)next(R);else{flushTextContentItem();enqueueChunk();e()}})).catch((e=>{if(!(e instanceof a.AbortException)){if(!this.options.ignoreErrors)throw e;(0,a.warn)(`getTextContent - ignoring errors during "${r.name}" task: "${e}".`);flushTextContentItem();enqueueChunk()}}))}extractDataStructures(e,t,r){const n=this.xref;let s;const l=this.readToUnicode(r.toUnicode||e.get("ToUnicode")||t.get("ToUnicode"));if(r.composite){const t=e.get("CIDSystemInfo");t instanceof i.Dict&&(r.cidSystemInfo={registry:(0,a.stringToPDFString)(t.get("Registry")),ordering:(0,a.stringToPDFString)(t.get("Ordering")),supplement:t.get("Supplement")});try{const t=e.get("CIDToGIDMap");t instanceof y.BaseStream&&(s=t.getBytes())}catch(e){if(!this.options.ignoreErrors)throw e;(0,a.warn)(`extractDataStructures - ignoring CIDToGIDMap data: "${e}".`)}}const h=[];let u,d=null;if(e.has("Encoding")){u=e.get("Encoding");if(u instanceof i.Dict){d=u.get("BaseEncoding");d=d instanceof i.Name?d.name:null;if(u.has("Differences")){const e=u.get("Differences");let t=0;for(let r=0,s=e.length;r<s;r++){const s=n.fetchIfRef(e[r]);if("number"==typeof s)t=s;else{if(!(s instanceof i.Name))throw new a.FormatError(`Invalid entry in 'Differences' array: ${s}`);h[t++]=s.name}}}}else if(u instanceof i.Name)d=u.name;else{const e="Encoding is not a Name nor a Dict";if(!this.options.ignoreErrors)throw new a.FormatError(e);(0,a.warn)(e)}"MacRomanEncoding"!==d&&"MacExpertEncoding"!==d&&"WinAnsiEncoding"!==d&&(d=null)}if(d)r.defaultEncoding=(0,c.getEncoding)(d);else{const e=!!(r.flags&o.FontFlags.Symbolic),t=!!(r.flags&o.FontFlags.Nonsymbolic);u=c.StandardEncoding;"TrueType"!==r.type||t||(u=c.WinAnsiEncoding);if(e){u=c.MacRomanEncoding;r.file&&!r.isInternalFont||(/Symbol/i.test(r.name)?u=c.SymbolSetEncoding:/Dingbats|Wingdings/i.test(r.name)&&(u=c.ZapfDingbatsEncoding))}r.defaultEncoding=u}r.differences=h;r.baseEncodingName=d;r.hasEncoding=!!d||h.length>0;r.dict=e;return l.then((e=>{r.toUnicode=e;return this.buildToUnicode(r)})).then((e=>{r.toUnicode=e;s&&(r.cidToGidMap=this.readCidToGidMap(s,e));return r}))}_simpleFontToUnicode(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(0,a.assert)(!e.composite,"Must be a simple font.");const r=[],n=e.defaultEncoding.slice(),i=e.baseEncodingName,s=e.differences;for(const e in s){const t=s[e];".notdef"!==t&&(n[e]=t)}const o=(0,k.getGlyphsUnicode)();for(const a in n){let s=n[a];if(""!==s)if(void 0!==o[s])r[a]=String.fromCharCode(o[s]);else{let n=0;switch(s[0]){case"G":3===s.length&&(n=parseInt(s.substring(1),16));break;case"g":5===s.length&&(n=parseInt(s.substring(1),16));break;case"C":case"c":if(s.length>=3&&s.length<=4){const r=s.substring(1);if(t){n=parseInt(r,16);break}n=+r;if(Number.isNaN(n)&&Number.isInteger(parseInt(r,16)))return this._simpleFontToUnicode(e,!0)}break;default:const r=(0,h.getUnicodeForGlyph)(s,o);-1!==r&&(n=r)}if(n>0&&n<=1114111&&Number.isInteger(n)){if(i&&n===+a){const e=(0,c.getEncoding)(i);if(e&&(s=e[a])){r[a]=String.fromCharCode(o[s]);continue}}r[a]=String.fromCodePoint(n)}}}return r}async buildToUnicode(e){e.hasIncludedToUnicodeMap=!!e.toUnicode&&e.toUnicode.length>0;if(e.hasIncludedToUnicodeMap){!e.composite&&e.hasEncoding&&(e.fallbackToUnicode=this._simpleFontToUnicode(e));return e.toUnicode}if(!e.composite)return new f.ToUnicodeMap(this._simpleFontToUnicode(e));if(e.composite&&(e.cMap.builtInCMap&&!(e.cMap instanceof n.IdentityCMap)||"Adobe"===e.cidSystemInfo.registry&&("GB1"===e.cidSystemInfo.ordering||"CNS1"===e.cidSystemInfo.ordering||"Japan1"===e.cidSystemInfo.ordering||"Korea1"===e.cidSystemInfo.ordering))){const{registry:t,ordering:r}=e.cidSystemInfo,s=i.Name.get(`${t}-${r}-UCS2`),o=await n.CMapFactory.create({encoding:s,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}),c=[];e.cMap.forEach((function(e,t){if(t>65535)throw new a.FormatError("Max size of CID is 65,535");const r=o.lookup(t);r&&(c[e]=String.fromCharCode((r.charCodeAt(0)<<8)+r.charCodeAt(1)))}));return new f.ToUnicodeMap(c)}return new f.IdentityToUnicodeMap(e.firstChar,e.lastChar)}readToUnicode(e){return e?e instanceof i.Name?n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){return e instanceof n.IdentityCMap?new f.IdentityToUnicodeMap(0,65535):new f.ToUnicodeMap(e.getMap())})):e instanceof y.BaseStream?n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null}).then((function(e){if(e instanceof n.IdentityCMap)return new f.IdentityToUnicodeMap(0,65535);const t=new Array(e.length);e.forEach((function(e,r){if("number"==typeof r){t[e]=String.fromCodePoint(r);return}const a=[];for(let e=0;e<r.length;e+=2){const t=r.charCodeAt(e)<<8|r.charCodeAt(e+1);if(55296!=(63488&t)){a.push(t);continue}e+=2;const n=r.charCodeAt(e)<<8|r.charCodeAt(e+1);a.push(((1023&t)<<10)+(1023&n)+65536)}t[e]=String.fromCodePoint(...a)}));return new f.ToUnicodeMap(t)}),(e=>{if(e instanceof a.AbortException)return null;if(this.options.ignoreErrors){this.handler.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontToUnicode});(0,a.warn)(`readToUnicode - ignoring ToUnicode data: "${e}".`);return null}throw e})):Promise.resolve(null):Promise.resolve(null)}readCidToGidMap(e,t){const r=[];for(let a=0,n=e.length;a<n;a++){const n=e[a++]<<8|e[a],i=a>>1;(0!==n||t.has(i))&&(r[i]=n)}return r}extractWidths(e,t,r){const a=this.xref;let n=[],s=0;const c=[];let l,h,u,d,f,g,p,m;if(r.composite){s=e.has("DW")?e.get("DW"):1e3;m=e.get("W");if(m)for(h=0,u=m.length;h<u;h++){g=a.fetchIfRef(m[h++]);p=a.fetchIfRef(m[h]);if(Array.isArray(p))for(d=0,f=p.length;d<f;d++)n[g++]=a.fetchIfRef(p[d]);else{const e=a.fetchIfRef(m[++h]);for(d=g;d<=p;d++)n[d]=e}}if(r.vertical){let t=e.getArray("DW2")||[880,-1e3];l=[t[1],.5*s,t[0]];t=e.get("W2");if(t)for(h=0,u=t.length;h<u;h++){g=a.fetchIfRef(t[h++]);p=a.fetchIfRef(t[h]);if(Array.isArray(p))for(d=0,f=p.length;d<f;d++)c[g++]=[a.fetchIfRef(p[d++]),a.fetchIfRef(p[d++]),a.fetchIfRef(p[d])];else{const e=[a.fetchIfRef(t[++h]),a.fetchIfRef(t[++h]),a.fetchIfRef(t[++h])];for(d=g;d<=p;d++)c[d]=e}}}}else{const o=r.firstChar;m=e.get("Widths");if(m){d=o;for(h=0,u=m.length;h<u;h++)n[d++]=a.fetchIfRef(m[h]);s=parseFloat(t.get("MissingWidth"))||0}else{const t=e.get("BaseFont");if(t instanceof i.Name){const e=this.getBaseFontMetrics(t.name);n=this.buildCharCodeToWidth(e.widths,r);s=e.defaultWidth}}}let b=!0,y=s;for(const e in n){const t=n[e];if(t)if(y){if(y!==t){b=!1;break}}else y=t}b&&(r.flags|=o.FontFlags.FixedPitch);r.defaultWidth=s;r.widths=n;r.defaultVMetrics=l;r.vmetrics=c}isSerifFont(e){const t=e.split("-")[0];return t in(0,l.getSerifFonts)()||/serif/gi.test(t)}getBaseFontMetrics(e){let t=0,r=Object.create(null),a=!1;let n=(0,l.getStdFontMap)()[e]||e;const i=(0,v.getMetrics)();n in i||(n=this.isSerifFont(e)?"Times-Roman":"Helvetica");const s=i[n];if("number"==typeof s){t=s;a=!0}else r=s();return{defaultWidth:t,monospace:a,widths:r}}buildCharCodeToWidth(e,t){const r=Object.create(null),a=t.differences,n=t.defaultEncoding;for(let t=0;t<256;t++)t in a&&e[a[t]]?r[t]=e[a[t]]:t in n&&e[n[t]]&&(r[t]=e[n[t]]);return r}preEvaluateFont(e){const t=e;let r=e.get("Subtype");if(!(r instanceof i.Name))throw new a.FormatError("invalid font Subtype");let n,s,o=!1;if("Type0"===r.name){const t=e.get("DescendantFonts");if(!t)throw new a.FormatError("Descendant fonts are not specified");if(!((e=Array.isArray(t)?this.xref.fetchIfRef(t[0]):t)instanceof i.Dict))throw new a.FormatError("Descendant font is not a dictionary.");r=e.get("Subtype");if(!(r instanceof i.Name))throw new a.FormatError("invalid font Subtype");o=!0}const c=e.get("FirstChar")||0,l=e.get("LastChar")||(o?65535:255),h=e.get("FontDescriptor");if(h){n=new O.MurmurHash3_64;const r=t.getRaw("Encoding");if(r instanceof i.Name)n.update(r.name);else if(r instanceof i.Ref)n.update(r.toString());else if(r instanceof i.Dict)for(const e of r.getRawValues())if(e instanceof i.Name)n.update(e.name);else if(e instanceof i.Ref)n.update(e.toString());else if(Array.isArray(e)){const t=e.length,r=new Array(t);for(let a=0;a<t;a++){const t=e[a];t instanceof i.Name?r[a]=t.name:("number"==typeof t||t instanceof i.Ref)&&(r[a]=t.toString())}n.update(r.join())}n.update(`${c}-${l}`);s=e.get("ToUnicode")||t.get("ToUnicode");if(s instanceof y.BaseStream){const e=s.str||s,t=e.buffer?new Uint8Array(e.buffer.buffer,0,e.bufferLength):new Uint8Array(e.bytes.buffer,e.start,e.end-e.start);n.update(t)}else s instanceof i.Name&&n.update(s.name);const a=e.get("Widths")||t.get("Widths");if(Array.isArray(a)){const e=[];for(const t of a)("number"==typeof t||t instanceof i.Ref)&&e.push(t.toString());n.update(e.join())}if(o){n.update("compositeFont");const r=e.get("W")||t.get("W");if(Array.isArray(r)){const e=[];for(const t of r)if("number"==typeof t||t instanceof i.Ref)e.push(t.toString());else if(Array.isArray(t)){const r=[];for(const e of t)("number"==typeof e||e instanceof i.Ref)&&r.push(e.toString());e.push(`[${r.join()}]`)}n.update(e.join())}const a=e.getRaw("CIDToGIDMap")||t.getRaw("CIDToGIDMap");a instanceof i.Name?n.update(a.name):a instanceof i.Ref?n.update(a.toString()):a instanceof y.BaseStream&&n.update(a.peekBytes())}}return{descriptor:h,dict:e,baseDict:t,composite:o,type:r.name,firstChar:c,lastChar:l,toUnicode:s,hash:n?n.hexdigest():""}}async translateFont(e){let{descriptor:t,dict:r,baseDict:c,composite:h,type:u,firstChar:f,lastChar:g,toUnicode:p,cssFontInfo:m}=e;const y="Type3"===u;let w;if(!t){if(!y){let e=r.get("BaseFont");if(!(e instanceof i.Name))throw new a.FormatError("Base font is not specified");e=e.name.replace(/[,_]/g,"-");const t=this.getBaseFontMetrics(e),n=e.split("-")[0],h=(this.isSerifFont(n)?o.FontFlags.Serif:0)|(t.monospace?o.FontFlags.FixedPitch:0)|((0,l.getSymbolsFonts)()[n]?o.FontFlags.Symbolic:o.FontFlags.Nonsymbolic);w={type:u,name:e,loadedName:c.loadedName,widths:t.widths,defaultWidth:t.defaultWidth,isSimulatedFlags:!0,flags:h,firstChar:f,lastChar:g,toUnicode:p,xHeight:0,capHeight:0,italicAngle:0,isType3Font:y};const d=r.get("Widths"),m=(0,l.getStandardFontName)(e);let b=null;if(m){w.isStandardFont=!0;b=await this.fetchStandardFontData(m);w.isInternalFont=!!b}return this.extractDataStructures(r,r,w).then((r=>{if(d){const e=[];let t=f;for(let r=0,a=d.length;r<a;r++)e[t++]=this.xref.fetchIfRef(d[r]);r.widths=e}else r.widths=this.buildCharCodeToWidth(t.widths,r);return new s.Font(e,b,r)}))}t=new i.Dict(null);t.set("FontName",i.Name.get(u));t.set("FontBBox",r.getArray("FontBBox")||[0,0,0,0])}let S,x,k,C,v,O=t.get("FontName"),T=r.get("BaseFont");"string"==typeof O&&(O=i.Name.get(O));"string"==typeof T&&(T=i.Name.get(T));if(!y){const e=O&&O.name,t=T&&T.name;if(e!==t){(0,a.info)(`The FontDescriptor's FontName is "${e}" but should be the same as the Font's BaseFont "${t}".`);e&&t&&t.startsWith(e)&&(O=T)}}O=O||T;if(!(O instanceof i.Name))throw new a.FormatError("invalid font name");try{S=t.get("FontFile","FontFile2","FontFile3")}catch(e){if(!this.options.ignoreErrors)throw e;(0,a.warn)(`translateFont - fetching "${O.name}" font file: "${e}".`);S=new b.NullStream}let M=!1,E=!1,D=null;if(S){if(S.dict){const e=S.dict.get("Subtype");e instanceof i.Name&&(x=e.name);k=S.dict.get("Length1");C=S.dict.get("Length2");v=S.dict.get("Length3")}}else if(m){const e=(0,d.getXfaFontName)(O.name);if(e){m.fontFamily=`${m.fontFamily}-PdfJS-XFA`;m.metrics=e.metrics||null;D=e.factors||null;S=await this.fetchStandardFontData(e.name);E=!!S;c=r=(0,d.getXfaFontDict)(O.name);h=!0}}else if(!y){const e=(0,l.getStandardFontName)(O.name);if(e){M=!0;S=await this.fetchStandardFontData(e);E=!!S}}w={type:u,name:O.name,subtype:x,file:S,length1:k,length2:C,length3:v,isStandardFont:M,isInternalFont:E,loadedName:c.loadedName,composite:h,fixedPitch:!1,fontMatrix:r.getArray("FontMatrix")||a.FONT_IDENTITY_MATRIX,firstChar:f,lastChar:g,toUnicode:p,bbox:t.getArray("FontBBox")||r.getArray("FontBBox"),ascent:t.get("Ascent"),descent:t.get("Descent"),xHeight:t.get("XHeight")||0,capHeight:t.get("CapHeight")||0,flags:t.get("Flags"),italicAngle:t.get("ItalicAngle")||0,isType3Font:y,cssFontInfo:m,scaleFactors:D};if(h){const e=c.get("Encoding");e instanceof i.Name&&(w.cidEncoding=e.name);const t=await n.CMapFactory.create({encoding:e,fetchBuiltInCMap:this._fetchBuiltInCMapBound,useCMap:null});w.cMap=t;w.vertical=w.cMap.vertical}return this.extractDataStructures(r,c,w).then((e=>{this.extractWidths(r,t,e);return new s.Font(O.name,S,e)}))}static buildFontPaths(e,t,r,n){function buildPath(t){const i=`${e.loadedName}_path_${t}`;try{if(e.renderer.hasBuiltPath(t))return;r.send("commonobj",[i,"FontPath",e.renderer.getPathJs(t)])}catch(e){if(n.ignoreErrors){r.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.errorFontBuildPath});(0,a.warn)(`buildFontPaths - ignoring ${i} glyph: "${e}".`);return}throw e}}for(const e of t){buildPath(e.fontChar);const t=e.accent;t&&t.fontChar&&buildPath(t.fontChar)}}static get fallbackFontDict(){const e=new i.Dict;e.set("BaseFont",i.Name.get("PDFJS-FallbackFont"));e.set("Type",i.Name.get("FallbackType"));e.set("Subtype",i.Name.get("FallbackType"));e.set("Encoding",i.Name.get("WinAnsiEncoding"));return(0,a.shadow)(this,"fallbackFontDict",e)}}t.PartialEvaluator=PartialEvaluator;class TranslatedFont{constructor(e){let{loadedName:t,font:r,dict:a,evaluatorOptions:n}=e;this.loadedName=t;this.font=r;this.dict=a;this._evaluatorOptions=n||E;this.type3Loaded=null;this.type3Dependencies=r.isType3Font?new Set:null;this.sent=!1}send(e){if(!this.sent){this.sent=!0;e.send("commonobj",[this.loadedName,"Font",this.font.exportData(this._evaluatorOptions.fontExtraProperties)])}}fallback(e){if(this.font.data){this.font.disableFontFace=!0;PartialEvaluator.buildFontPaths(this.font,this.font.glyphCacheValues,e,this._evaluatorOptions)}}loadType3Data(e,t,r){if(this.type3Loaded)return this.type3Loaded;if(!this.font.isType3Font)throw new Error("Must be a Type3 font.");const n=e.clone({ignoreErrors:!1});n.parsingType3Font=!0;const s=new i.RefSet(e.type3FontRefs);this.dict.objId&&!s.has(this.dict.objId)&&s.put(this.dict.objId);n.type3FontRefs=s;const o=this.font,c=this.type3Dependencies;let l=Promise.resolve();const h=this.dict.get("CharProcs"),u=this.dict.get("Resources")||t,d=Object.create(null),f=a.Util.normalizeRect(o.bbox||[0,0,0,0]),g=f[2]-f[0],p=f[3]-f[1],m=Math.hypot(g,p);for(const e of h.getKeys())l=l.then((()=>{const t=h.get(e),i=new T.OperatorList;return n.getOperatorList({stream:t,task:r,resources:u,operatorList:i}).then((()=>{i.fnArray[0]===a.OPS.setCharWidthAndBounds&&this._removeType3ColorOperators(i,m);d[e]=i.getIR();for(const e of i.dependencies)c.add(e)})).catch((function(t){(0,a.warn)(`Type3 font resource "${e}" is not available.`);const r=new T.OperatorList;d[e]=r.getIR()}))}));this.type3Loaded=l.then((()=>{o.charProcOperatorList=d;if(this._bbox){o.isCharBBox=!0;o.bbox=this._bbox}}));return this.type3Loaded}_removeType3ColorOperators(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:NaN;const r=a.Util.normalizeRect(e.argsArray[0].slice(2)),n=r[2]-r[0],i=r[3]-r[1],s=Math.hypot(n,i);if(0===n||0===i){e.fnArray.splice(0,1);e.argsArray.splice(0,1)}else if(0===t||Math.round(s/t)>=10){this._bbox||(this._bbox=[1/0,1/0,-1/0,-1/0]);this._bbox[0]=Math.min(this._bbox[0],r[0]);this._bbox[1]=Math.min(this._bbox[1],r[1]);this._bbox[2]=Math.max(this._bbox[2],r[2]);this._bbox[3]=Math.max(this._bbox[3],r[3])}let o=0,c=e.length;for(;o<c;){switch(e.fnArray[o]){case a.OPS.setCharWidthAndBounds:break;case a.OPS.setStrokeColorSpace:case a.OPS.setFillColorSpace:case a.OPS.setStrokeColor:case a.OPS.setStrokeColorN:case a.OPS.setFillColor:case a.OPS.setFillColorN:case a.OPS.setStrokeGray:case a.OPS.setFillGray:case a.OPS.setStrokeRGBColor:case a.OPS.setFillRGBColor:case a.OPS.setStrokeCMYKColor:case a.OPS.setFillCMYKColor:case a.OPS.shadingFill:case a.OPS.setRenderingIntent:e.fnArray.splice(o,1);e.argsArray.splice(o,1);c--;continue;case a.OPS.setGState:const[t]=e.argsArray[o];let r=0,n=t.length;for(;r<n;){const[e]=t[r];switch(e){case"TR":case"TR2":case"HT":case"BG":case"BG2":case"UCR":case"UCR2":t.splice(r,1);n--;continue}r++}}o++}}}class StateManager{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new EvalState;this.state=e;this.stateStack=[]}save(){const e=this.state;this.stateStack.push(this.state);this.state=e.clone()}restore(){const e=this.stateStack.pop();e&&(this.state=e)}transform(e){this.state.ctm=a.Util.transform(this.state.ctm,e)}}class TextState{constructor(){this.ctm=new Float32Array(a.IDENTITY_MATRIX);this.fontName=null;this.fontSize=0;this.font=null;this.fontMatrix=a.FONT_IDENTITY_MATRIX;this.textMatrix=a.IDENTITY_MATRIX.slice();this.textLineMatrix=a.IDENTITY_MATRIX.slice();this.charSpacing=0;this.wordSpacing=0;this.leading=0;this.textHScale=1;this.textRise=0}setTextMatrix(e,t,r,a,n,i){const s=this.textMatrix;s[0]=e;s[1]=t;s[2]=r;s[3]=a;s[4]=n;s[5]=i}setTextLineMatrix(e,t,r,a,n,i){const s=this.textLineMatrix;s[0]=e;s[1]=t;s[2]=r;s[3]=a;s[4]=n;s[5]=i}translateTextMatrix(e,t){const r=this.textMatrix;r[4]=r[0]*e+r[2]*t+r[4];r[5]=r[1]*e+r[3]*t+r[5]}translateTextLineMatrix(e,t){const r=this.textLineMatrix;r[4]=r[0]*e+r[2]*t+r[4];r[5]=r[1]*e+r[3]*t+r[5]}carriageReturn(){this.translateTextLineMatrix(0,-this.leading);this.textMatrix=this.textLineMatrix.slice()}clone(){const e=Object.create(this);e.textMatrix=this.textMatrix.slice();e.textLineMatrix=this.textLineMatrix.slice();e.fontMatrix=this.fontMatrix.slice();return e}}class EvalState{constructor(){this.ctm=new Float32Array(a.IDENTITY_MATRIX);this.font=null;this.textRenderingMode=a.TextRenderingMode.FILL;this.fillColorSpace=S.ColorSpace.singletons.gray;this.strokeColorSpace=S.ColorSpace.singletons.gray}clone(){return Object.create(this)}}class EvaluatorPreprocessor{static get opMap(){const e=(0,C.getLookupTableFactory)((function(e){e.w={id:a.OPS.setLineWidth,numArgs:1,variableArgs:!1};e.J={id:a.OPS.setLineCap,numArgs:1,variableArgs:!1};e.j={id:a.OPS.setLineJoin,numArgs:1,variableArgs:!1};e.M={id:a.OPS.setMiterLimit,numArgs:1,variableArgs:!1};e.d={id:a.OPS.setDash,numArgs:2,variableArgs:!1};e.ri={id:a.OPS.setRenderingIntent,numArgs:1,variableArgs:!1};e.i={id:a.OPS.setFlatness,numArgs:1,variableArgs:!1};e.gs={id:a.OPS.setGState,numArgs:1,variableArgs:!1};e.q={id:a.OPS.save,numArgs:0,variableArgs:!1};e.Q={id:a.OPS.restore,numArgs:0,variableArgs:!1};e.cm={id:a.OPS.transform,numArgs:6,variableArgs:!1};e.m={id:a.OPS.moveTo,numArgs:2,variableArgs:!1};e.l={id:a.OPS.lineTo,numArgs:2,variableArgs:!1};e.c={id:a.OPS.curveTo,numArgs:6,variableArgs:!1};e.v={id:a.OPS.curveTo2,numArgs:4,variableArgs:!1};e.y={id:a.OPS.curveTo3,numArgs:4,variableArgs:!1};e.h={id:a.OPS.closePath,numArgs:0,variableArgs:!1};e.re={id:a.OPS.rectangle,numArgs:4,variableArgs:!1};e.S={id:a.OPS.stroke,numArgs:0,variableArgs:!1};e.s={id:a.OPS.closeStroke,numArgs:0,variableArgs:!1};e.f={id:a.OPS.fill,numArgs:0,variableArgs:!1};e.F={id:a.OPS.fill,numArgs:0,variableArgs:!1};e["f*"]={id:a.OPS.eoFill,numArgs:0,variableArgs:!1};e.B={id:a.OPS.fillStroke,numArgs:0,variableArgs:!1};e["B*"]={id:a.OPS.eoFillStroke,numArgs:0,variableArgs:!1};e.b={id:a.OPS.closeFillStroke,numArgs:0,variableArgs:!1};e["b*"]={id:a.OPS.closeEOFillStroke,numArgs:0,variableArgs:!1};e.n={id:a.OPS.endPath,numArgs:0,variableArgs:!1};e.W={id:a.OPS.clip,numArgs:0,variableArgs:!1};e["W*"]={id:a.OPS.eoClip,numArgs:0,variableArgs:!1};e.BT={id:a.OPS.beginText,numArgs:0,variableArgs:!1};e.ET={id:a.OPS.endText,numArgs:0,variableArgs:!1};e.Tc={id:a.OPS.setCharSpacing,numArgs:1,variableArgs:!1};e.Tw={id:a.OPS.setWordSpacing,numArgs:1,variableArgs:!1};e.Tz={id:a.OPS.setHScale,numArgs:1,variableArgs:!1};e.TL={id:a.OPS.setLeading,numArgs:1,variableArgs:!1};e.Tf={id:a.OPS.setFont,numArgs:2,variableArgs:!1};e.Tr={id:a.OPS.setTextRenderingMode,numArgs:1,variableArgs:!1};e.Ts={id:a.OPS.setTextRise,numArgs:1,variableArgs:!1};e.Td={id:a.OPS.moveText,numArgs:2,variableArgs:!1};e.TD={id:a.OPS.setLeadingMoveText,numArgs:2,variableArgs:!1};e.Tm={id:a.OPS.setTextMatrix,numArgs:6,variableArgs:!1};e["T*"]={id:a.OPS.nextLine,numArgs:0,variableArgs:!1};e.Tj={id:a.OPS.showText,numArgs:1,variableArgs:!1};e.TJ={id:a.OPS.showSpacedText,numArgs:1,variableArgs:!1};e["'"]={id:a.OPS.nextLineShowText,numArgs:1,variableArgs:!1};e['"']={id:a.OPS.nextLineSetSpacingShowText,numArgs:3,variableArgs:!1};e.d0={id:a.OPS.setCharWidth,numArgs:2,variableArgs:!1};e.d1={id:a.OPS.setCharWidthAndBounds,numArgs:6,variableArgs:!1};e.CS={id:a.OPS.setStrokeColorSpace,numArgs:1,variableArgs:!1};e.cs={id:a.OPS.setFillColorSpace,numArgs:1,variableArgs:!1};e.SC={id:a.OPS.setStrokeColor,numArgs:4,variableArgs:!0};e.SCN={id:a.OPS.setStrokeColorN,numArgs:33,variableArgs:!0};e.sc={id:a.OPS.setFillColor,numArgs:4,variableArgs:!0};e.scn={id:a.OPS.setFillColorN,numArgs:33,variableArgs:!0};e.G={id:a.OPS.setStrokeGray,numArgs:1,variableArgs:!1};e.g={id:a.OPS.setFillGray,numArgs:1,variableArgs:!1};e.RG={id:a.OPS.setStrokeRGBColor,numArgs:3,variableArgs:!1};e.rg={id:a.OPS.setFillRGBColor,numArgs:3,variableArgs:!1};e.K={id:a.OPS.setStrokeCMYKColor,numArgs:4,variableArgs:!1};e.k={id:a.OPS.setFillCMYKColor,numArgs:4,variableArgs:!1};e.sh={id:a.OPS.shadingFill,numArgs:1,variableArgs:!1};e.BI={id:a.OPS.beginInlineImage,numArgs:0,variableArgs:!1};e.ID={id:a.OPS.beginImageData,numArgs:0,variableArgs:!1};e.EI={id:a.OPS.endInlineImage,numArgs:1,variableArgs:!1};e.Do={id:a.OPS.paintXObject,numArgs:1,variableArgs:!1};e.MP={id:a.OPS.markPoint,numArgs:1,variableArgs:!1};e.DP={id:a.OPS.markPointProps,numArgs:2,variableArgs:!1};e.BMC={id:a.OPS.beginMarkedContent,numArgs:1,variableArgs:!1};e.BDC={id:a.OPS.beginMarkedContentProps,numArgs:2,variableArgs:!1};e.EMC={id:a.OPS.endMarkedContent,numArgs:0,variableArgs:!1};e.BX={id:a.OPS.beginCompat,numArgs:0,variableArgs:!1};e.EX={id:a.OPS.endCompat,numArgs:0,variableArgs:!1};e.BM=null;e.BD=null;e.true=null;e.fa=null;e.fal=null;e.fals=null;e.false=null;e.nu=null;e.nul=null;e.null=null}));return(0,a.shadow)(this,"opMap",e())}static get MAX_INVALID_PATH_OPS(){return(0,a.shadow)(this,"MAX_INVALID_PATH_OPS",10)}constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new StateManager;this.parser=new p.Parser({lexer:new p.Lexer(e,EvaluatorPreprocessor.opMap),xref:t});this.stateManager=r;this.nonProcessedArgs=[];this._isPathOp=!1;this._numInvalidPathOPS=0}get savedStatesDepth(){return this.stateManager.stateStack.length}read(e){let t=e.args;for(;;){const r=this.parser.getObj();if(r instanceof i.Cmd){const n=r.cmd,i=EvaluatorPreprocessor.opMap[n];if(!i){(0,a.warn)(`Unknown command "${n}".`);continue}const s=i.id,o=i.numArgs;let c=null!==t?t.length:0;this._isPathOp||(this._numInvalidPathOPS=0);this._isPathOp=s>=a.OPS.moveTo&&s<=a.OPS.endPath;if(i.variableArgs)c>o&&(0,a.info)(`Command ${n}: expected [0, ${o}] args, but received ${c} args.`);else{if(c!==o){const e=this.nonProcessedArgs;for(;c>o;){e.push(t.shift());c--}for(;c<o&&0!==e.length;){null===t&&(t=[]);t.unshift(e.pop());c++}}if(c<o){const e=`command ${n}: expected ${o} args, but received ${c} args.`;if(this._isPathOp&&++this._numInvalidPathOPS>EvaluatorPreprocessor.MAX_INVALID_PATH_OPS)throw new a.FormatError(`Invalid ${e}`);(0,a.warn)(`Skipping ${e}`);null!==t&&(t.length=0);continue}}this.preprocessCommand(s,t);e.fn=s;e.args=t;return!0}if(r===i.EOF)return!1;if(null!==r){null===t&&(t=[]);t.push(r);if(t.length>33)throw new a.FormatError("Too many arguments")}}}preprocessCommand(e,t){switch(0|e){case a.OPS.save:this.stateManager.save();break;case a.OPS.restore:this.stateManager.restore();break;case a.OPS.transform:this.stateManager.transform(t)}}}t.EvaluatorPreprocessor=EvaluatorPreprocessor},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.IdentityCMap=t.CMapFactory=t.CMap=void 0;var a=r(2),n=r(133),i=r(135),s=r(145),o=r(134),c=r(138);const l=["Adobe-GB1-UCS2","Adobe-CNS1-UCS2","Adobe-Japan1-UCS2","Adobe-Korea1-UCS2","78-EUC-H","78-EUC-V","78-H","78-RKSJ-H","78-RKSJ-V","78-V","78ms-RKSJ-H","78ms-RKSJ-V","83pv-RKSJ-H","90ms-RKSJ-H","90ms-RKSJ-V","90msp-RKSJ-H","90msp-RKSJ-V","90pv-RKSJ-H","90pv-RKSJ-V","Add-H","Add-RKSJ-H","Add-RKSJ-V","Add-V","Adobe-CNS1-0","Adobe-CNS1-1","Adobe-CNS1-2","Adobe-CNS1-3","Adobe-CNS1-4","Adobe-CNS1-5","Adobe-CNS1-6","Adobe-GB1-0","Adobe-GB1-1","Adobe-GB1-2","Adobe-GB1-3","Adobe-GB1-4","Adobe-GB1-5","Adobe-Japan1-0","Adobe-Japan1-1","Adobe-Japan1-2","Adobe-Japan1-3","Adobe-Japan1-4","Adobe-Japan1-5","Adobe-Japan1-6","Adobe-Korea1-0","Adobe-Korea1-1","Adobe-Korea1-2","B5-H","B5-V","B5pc-H","B5pc-V","CNS-EUC-H","CNS-EUC-V","CNS1-H","CNS1-V","CNS2-H","CNS2-V","ETHK-B5-H","ETHK-B5-V","ETen-B5-H","ETen-B5-V","ETenms-B5-H","ETenms-B5-V","EUC-H","EUC-V","Ext-H","Ext-RKSJ-H","Ext-RKSJ-V","Ext-V","GB-EUC-H","GB-EUC-V","GB-H","GB-V","GBK-EUC-H","GBK-EUC-V","GBK2K-H","GBK2K-V","GBKp-EUC-H","GBKp-EUC-V","GBT-EUC-H","GBT-EUC-V","GBT-H","GBT-V","GBTpc-EUC-H","GBTpc-EUC-V","GBpc-EUC-H","GBpc-EUC-V","H","HKdla-B5-H","HKdla-B5-V","HKdlb-B5-H","HKdlb-B5-V","HKgccs-B5-H","HKgccs-B5-V","HKm314-B5-H","HKm314-B5-V","HKm471-B5-H","HKm471-B5-V","HKscs-B5-H","HKscs-B5-V","Hankaku","Hiragana","KSC-EUC-H","KSC-EUC-V","KSC-H","KSC-Johab-H","KSC-Johab-V","KSC-V","KSCms-UHC-H","KSCms-UHC-HW-H","KSCms-UHC-HW-V","KSCms-UHC-V","KSCpc-EUC-H","KSCpc-EUC-V","Katakana","NWP-H","NWP-V","RKSJ-H","RKSJ-V","Roman","UniCNS-UCS2-H","UniCNS-UCS2-V","UniCNS-UTF16-H","UniCNS-UTF16-V","UniCNS-UTF32-H","UniCNS-UTF32-V","UniCNS-UTF8-H","UniCNS-UTF8-V","UniGB-UCS2-H","UniGB-UCS2-V","UniGB-UTF16-H","UniGB-UTF16-V","UniGB-UTF32-H","UniGB-UTF32-V","UniGB-UTF8-H","UniGB-UTF8-V","UniJIS-UCS2-H","UniJIS-UCS2-HW-H","UniJIS-UCS2-HW-V","UniJIS-UCS2-V","UniJIS-UTF16-H","UniJIS-UTF16-V","UniJIS-UTF32-H","UniJIS-UTF32-V","UniJIS-UTF8-H","UniJIS-UTF8-V","UniJIS2004-UTF16-H","UniJIS2004-UTF16-V","UniJIS2004-UTF32-H","UniJIS2004-UTF32-V","UniJIS2004-UTF8-H","UniJIS2004-UTF8-V","UniJISPro-UCS2-HW-V","UniJISPro-UCS2-V","UniJISPro-UTF8-V","UniJISX0213-UTF32-H","UniJISX0213-UTF32-V","UniJISX02132004-UTF32-H","UniJISX02132004-UTF32-V","UniKS-UCS2-H","UniKS-UCS2-V","UniKS-UTF16-H","UniKS-UTF16-V","UniKS-UTF32-H","UniKS-UTF32-V","UniKS-UTF8-H","UniKS-UTF8-V","V","WP-Symbol"],h=2**24-1;class CMap{constructor(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.codespaceRanges=[[],[],[],[]];this.numCodespaceRanges=0;this._map=[];this.name="";this.vertical=!1;this.useCMap=null;this.builtInCMap=e}addCodespaceRange(e,t,r){this.codespaceRanges[e-1].push(t,r);this.numCodespaceRanges++}mapCidRange(e,t,r){if(t-e>h)throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");for(;e<=t;)this._map[e++]=r++}mapBfRange(e,t,r){if(t-e>h)throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");const a=r.length-1;for(;e<=t;){this._map[e++]=r;const t=r.charCodeAt(a)+1;t>255?r=r.substring(0,a-1)+String.fromCharCode(r.charCodeAt(a-1)+1)+"\0":r=r.substring(0,a)+String.fromCharCode(t)}}mapBfRangeToArray(e,t,r){if(t-e>h)throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");const a=r.length;let n=0;for(;e<=t&&n<a;){this._map[e]=r[n++];++e}}mapOne(e,t){this._map[e]=t}lookup(e){return this._map[e]}contains(e){return void 0!==this._map[e]}forEach(e){const t=this._map,r=t.length;if(r<=65536)for(let a=0;a<r;a++)void 0!==t[a]&&e(a,t[a]);else for(const r in t)e(r,t[r])}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const r in t)if(t[r]===e)return 0|r;return-1}getMap(){return this._map}readCharCode(e,t,r){let a=0;const n=this.codespaceRanges;for(let i=0,s=n.length;i<s;i++){a=(a<<8|e.charCodeAt(t+i))>>>0;const s=n[i];for(let e=0,t=s.length;e<t;){const t=s[e++],n=s[e++];if(a>=t&&a<=n){r.charcode=a;r.length=i+1;return}}}r.charcode=0;r.length=1}getCharCodeLength(e){const t=this.codespaceRanges;for(let r=0,a=t.length;r<a;r++){const a=t[r];for(let t=0,n=a.length;t<n;){const n=a[t++],i=a[t++];if(e>=n&&e<=i)return r+1}}return 1}get length(){return this._map.length}get isIdentityCMap(){if("Identity-H"!==this.name&&"Identity-V"!==this.name)return!1;if(65536!==this._map.length)return!1;for(let e=0;e<65536;e++)if(this._map[e]!==e)return!1;return!0}}t.CMap=CMap;class IdentityCMap extends CMap{constructor(e,t){super();this.vertical=e;this.addCodespaceRange(t,0,65535)}mapCidRange(e,t,r){(0,a.unreachable)("should not call mapCidRange")}mapBfRange(e,t,r){(0,a.unreachable)("should not call mapBfRange")}mapBfRangeToArray(e,t,r){(0,a.unreachable)("should not call mapBfRangeToArray")}mapOne(e,t){(0,a.unreachable)("should not call mapCidOne")}lookup(e){return Number.isInteger(e)&&e<=65535?e:void 0}contains(e){return Number.isInteger(e)&&e<=65535}forEach(e){for(let t=0;t<=65535;t++)e(t,t)}charCodeOf(e){return Number.isInteger(e)&&e<=65535?e:-1}getMap(){const e=new Array(65536);for(let t=0;t<=65535;t++)e[t]=t;return e}get length(){return 65536}get isIdentityCMap(){(0,a.unreachable)("should not access .isIdentityCMap")}}t.IdentityCMap=IdentityCMap;const u=function BinaryCMapReaderClosure(){function hexToInt(e,t){let r=0;for(let a=0;a<=t;a++)r=r<<8|e[a];return r>>>0}function hexToStr(e,t){return 1===t?String.fromCharCode(e[0],e[1]):3===t?String.fromCharCode(e[0],e[1],e[2],e[3]):String.fromCharCode.apply(null,e.subarray(0,t+1))}function addHex(e,t,r){let a=0;for(let n=r;n>=0;n--){a+=e[n]+t[n];e[n]=255&a;a>>=8}}function incHex(e,t){let r=1;for(let a=t;a>=0&&r>0;a--){r+=e[a];e[a]=255&r;r>>=8}}const e=16;class BinaryCMapStream{constructor(e){this.buffer=e;this.pos=0;this.end=e.length;this.tmpBuf=new Uint8Array(19)}readByte(){return this.pos>=this.end?-1:this.buffer[this.pos++]}readNumber(){let e,t=0;do{const r=this.readByte();if(r<0)throw new a.FormatError("unexpected EOF in bcmap");e=!(128&r);t=t<<7|127&r}while(!e);return t}readSigned(){const e=this.readNumber();return 1&e?~(e>>>1):e>>>1}readHex(e,t){e.set(this.buffer.subarray(this.pos,this.pos+t+1));this.pos+=t+1}readHexNumber(e,t){let r;const n=this.tmpBuf;let i=0;do{const e=this.readByte();if(e<0)throw new a.FormatError("unexpected EOF in bcmap");r=!(128&e);n[i++]=127&e}while(!r);let s=t,o=0,c=0;for(;s>=0;){for(;c<8&&n.length>0;){o|=n[--i]<<c;c+=7}e[s]=255&o;s--;o>>=8;c-=8}}readHexSigned(e,t){this.readHexNumber(e,t);const r=1&e[t]?255:0;let a=0;for(let n=0;n<=t;n++){a=(1&a)<<8|e[n];e[n]=a>>1^r}}readString(){const e=this.readNumber();let t="";for(let r=0;r<e;r++)t+=String.fromCharCode(this.readNumber());return t}}return class BinaryCMapReader{async process(t,r,a){const n=new BinaryCMapStream(t),i=n.readByte();r.vertical=!!(1&i);let s=null;const o=new Uint8Array(e),c=new Uint8Array(e),l=new Uint8Array(e),h=new Uint8Array(e),u=new Uint8Array(e);let d,f;for(;(f=n.readByte())>=0;){const t=f>>5;if(7===t){switch(31&f){case 0:n.readString();break;case 1:s=n.readString()}continue}const a=!!(16&f),i=15&f;if(i+1>e)throw new Error("BinaryCMapReader.process: Invalid dataSize.");const g=1,p=n.readNumber();switch(t){case 0:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);r.addCodespaceRange(i+1,hexToInt(o,i),hexToInt(c,i));for(let e=1;e<p;e++){incHex(c,i);n.readHexNumber(o,i);addHex(o,c,i);n.readHexNumber(c,i);addHex(c,o,i);r.addCodespaceRange(i+1,hexToInt(o,i),hexToInt(c,i))}break;case 1:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);n.readNumber();for(let e=1;e<p;e++){incHex(c,i);n.readHexNumber(o,i);addHex(o,c,i);n.readHexNumber(c,i);addHex(c,o,i);n.readNumber()}break;case 2:n.readHex(l,i);d=n.readNumber();r.mapOne(hexToInt(l,i),d);for(let e=1;e<p;e++){incHex(l,i);if(!a){n.readHexNumber(u,i);addHex(l,u,i)}d=n.readSigned()+(d+1);r.mapOne(hexToInt(l,i),d)}break;case 3:n.readHex(o,i);n.readHexNumber(c,i);addHex(c,o,i);d=n.readNumber();r.mapCidRange(hexToInt(o,i),hexToInt(c,i),d);for(let e=1;e<p;e++){incHex(c,i);if(a)o.set(c);else{n.readHexNumber(o,i);addHex(o,c,i)}n.readHexNumber(c,i);addHex(c,o,i);d=n.readNumber();r.mapCidRange(hexToInt(o,i),hexToInt(c,i),d)}break;case 4:n.readHex(l,g);n.readHex(h,i);r.mapOne(hexToInt(l,g),hexToStr(h,i));for(let e=1;e<p;e++){incHex(l,g);if(!a){n.readHexNumber(u,g);addHex(l,u,g)}incHex(h,i);n.readHexSigned(u,i);addHex(h,u,i);r.mapOne(hexToInt(l,g),hexToStr(h,i))}break;case 5:n.readHex(o,g);n.readHexNumber(c,g);addHex(c,o,g);n.readHex(h,i);r.mapBfRange(hexToInt(o,g),hexToInt(c,g),hexToStr(h,i));for(let e=1;e<p;e++){incHex(c,g);if(a)o.set(c);else{n.readHexNumber(o,g);addHex(o,c,g)}n.readHexNumber(c,g);addHex(c,o,g);n.readHex(h,i);r.mapBfRange(hexToInt(o,g),hexToInt(c,g),hexToStr(h,i))}break;default:throw new Error(`BinaryCMapReader.process - unknown type: ${t}`)}}return s?a(s):r}}}(),d=function CMapFactoryClosure(){function strToInt(e){let t=0;for(let r=0;r<e.length;r++)t=t<<8|e.charCodeAt(r);return t>>>0}function expectString(e){if("string"!=typeof e)throw new a.FormatError("Malformed CMap: expected string.")}function expectInt(e){if(!Number.isInteger(e))throw new a.FormatError("Malformed CMap: expected int.")}function parseBfChar(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endbfchar"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectString(r);const i=r;e.mapOne(a,i)}}function parseBfRange(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endbfrange"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectString(r);const i=strToInt(r);r=t.getObj();if(Number.isInteger(r)||"string"==typeof r){const t=Number.isInteger(r)?String.fromCharCode(r):r;e.mapBfRange(a,i,t)}else{if(!(0,n.isCmd)(r,"["))break;{r=t.getObj();const s=[];for(;!(0,n.isCmd)(r,"]")&&r!==n.EOF;){s.push(r);r=t.getObj()}e.mapBfRangeToArray(a,i,s)}}}throw new a.FormatError("Invalid bf range.")}function parseCidChar(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endcidchar"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectInt(r);const i=r;e.mapOne(a,i)}}function parseCidRange(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endcidrange"))return;expectString(r);const a=strToInt(r);r=t.getObj();expectString(r);const i=strToInt(r);r=t.getObj();expectInt(r);const s=r;e.mapCidRange(a,i,s)}}function parseCodespaceRange(e,t){for(;;){let r=t.getObj();if(r===n.EOF)break;if((0,n.isCmd)(r,"endcodespacerange"))return;if("string"!=typeof r)break;const a=strToInt(r);r=t.getObj();if("string"!=typeof r)break;const i=strToInt(r);e.addCodespaceRange(r.length,a,i)}throw new a.FormatError("Invalid codespace range.")}function parseWMode(e,t){const r=t.getObj();Number.isInteger(r)&&(e.vertical=!!r)}function parseCMapName(e,t){const r=t.getObj();r instanceof n.Name&&(e.name=r.name)}async function parseCMap(e,t,r,i){let s,c;e:for(;;)try{const r=t.getObj();if(r===n.EOF)break;if(r instanceof n.Name){"WMode"===r.name?parseWMode(e,t):"CMapName"===r.name&&parseCMapName(e,t);s=r}else if(r instanceof n.Cmd)switch(r.cmd){case"endcmap":break e;case"usecmap":s instanceof n.Name&&(c=s.name);break;case"begincodespacerange":parseCodespaceRange(e,t);break;case"beginbfchar":parseBfChar(e,t);break;case"begincidchar":parseCidChar(e,t);break;case"beginbfrange":parseBfRange(e,t);break;case"begincidrange":parseCidRange(e,t)}}catch(e){if(e instanceof o.MissingDataException)throw e;(0,a.warn)("Invalid cMap data: "+e);continue}!i&&c&&(i=c);return i?extendCMap(e,r,i):e}async function extendCMap(e,t,r){e.useCMap=await createBuiltInCMap(r,t);if(0===e.numCodespaceRanges){const t=e.useCMap.codespaceRanges;for(let r=0;r<t.length;r++)e.codespaceRanges[r]=t[r].slice();e.numCodespaceRanges=e.useCMap.numCodespaceRanges}e.useCMap.forEach((function(t,r){e.contains(t)||e.mapOne(t,e.useCMap.lookup(t))}));return e}async function createBuiltInCMap(e,t){if("Identity-H"===e)return new IdentityCMap(!1,2);if("Identity-V"===e)return new IdentityCMap(!0,2);if(!l.includes(e))throw new Error("Unknown CMap name: "+e);if(!t)throw new Error("Built-in CMap parameters are not provided.");const{cMapData:r,compressionType:n}=await t(e),i=new CMap(!0);if(n===a.CMapCompressionType.BINARY)return(new u).process(r,i,(e=>extendCMap(i,t,e)));if(n===a.CMapCompressionType.NONE){const e=new s.Lexer(new c.Stream(r));return parseCMap(i,e,t,null)}throw new Error("TODO: Only BINARY/NONE CMap compression is currently supported.")}return{async create(e){const t=e.encoding,r=e.fetchBuiltInCMap,a=e.useCMap;if(t instanceof n.Name)return createBuiltInCMap(t.name,r);if(t instanceof i.BaseStream){const e=await parseCMap(new CMap,new s.Lexer(t),r,a);return e.isIdentityCMap?createBuiltInCMap(e.name,r):e}throw new Error("Encoding required.")}}}();t.CMapFactory=d},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Parser=t.Linearization=t.Lexer=void 0;var a=r(2),n=r(133),i=r(134),s=r(146),o=r(148),c=r(149),l=r(151),h=r(152),u=r(155),d=r(157),f=r(159),g=r(138),p=r(160),m=r(161);function computeAdler32(e){const t=e.length;let r=1,a=0;for(let n=0;n<t;++n){r+=255&e[n];a+=r}return a%65521<<16|r%65521}class Parser{constructor(e){let{lexer:t,xref:r,allowStreams:a=!1,recoveryMode:n=!1}=e;this.lexer=t;this.xref=r;this.allowStreams=a;this.recoveryMode=n;this.imageCache=Object.create(null);this.refill()}refill(){this.buf1=this.lexer.getObj();this.buf2=this.lexer.getObj()}shift(){if(this.buf2 instanceof n.Cmd&&"ID"===this.buf2.cmd){this.buf1=this.buf2;this.buf2=null}else{this.buf1=this.buf2;this.buf2=this.lexer.getObj()}}tryShift(){try{this.shift();return!0}catch(e){if(e instanceof i.MissingDataException)throw e;return!1}}getObj(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=this.buf1;this.shift();if(t instanceof n.Cmd)switch(t.cmd){case"BI":return this.makeInlineImage(e);case"[":const r=[];for(;!(0,n.isCmd)(this.buf1,"]")&&this.buf1!==n.EOF;)r.push(this.getObj(e));if(this.buf1===n.EOF){if(this.recoveryMode)return r;throw new i.ParserEOFException("End of file inside array.")}this.shift();return r;case"<<":const s=new n.Dict(this.xref);for(;!(0,n.isCmd)(this.buf1,">>")&&this.buf1!==n.EOF;){if(!(this.buf1 instanceof n.Name)){(0,a.info)("Malformed dictionary: key must be a name object");this.shift();continue}const t=this.buf1.name;this.shift();if(this.buf1===n.EOF)break;s.set(t,this.getObj(e))}if(this.buf1===n.EOF){if(this.recoveryMode)return s;throw new i.ParserEOFException("End of file inside dictionary.")}if((0,n.isCmd)(this.buf2,"stream"))return this.allowStreams?this.makeStream(s,e):s;this.shift();return s;default:return t}if(Number.isInteger(t)){if(Number.isInteger(this.buf1)&&(0,n.isCmd)(this.buf2,"R")){const e=n.Ref.get(t,this.buf1);this.shift();this.shift();return e}return t}return"string"==typeof t&&e?e.decryptString(t):t}findDefaultInlineStreamEnd(e){const t=this.lexer,r=e.pos;let s,o,c=0;for(;-1!==(s=e.getByte());)if(0===c)c=69===s?1:0;else if(1===c)c=73===s?2:0;else{(0,a.assert)(2===c,"findDefaultInlineStreamEnd - invalid state.");if(32===s||10===s||13===s){o=e.pos;const r=e.peekBytes(10);for(let e=0,t=r.length;e<t;e++){s=r[e];if((0!==s||0===r[e+1])&&(10!==s&&13!==s&&(s<32||s>127))){c=0;break}}if(2!==c)continue;if(t.knownCommands){const e=t.peekObj();e instanceof n.Cmd&&!t.knownCommands[e.cmd]&&(c=0)}else(0,a.warn)("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");if(2===c)break}else c=0}if(-1===s){(0,a.warn)("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker");if(o){(0,a.warn)('... trying to recover by using the last "EI" occurrence.');e.skip(-(e.pos-o))}}let l=4;e.skip(-l);s=e.peekByte();e.skip(l);(0,i.isWhiteSpace)(s)||l--;return e.pos-l-r}findDCTDecodeInlineStreamEnd(e){const t=e.pos;let r,n,i=!1;for(;-1!==(r=e.getByte());)if(255===r){switch(e.getByte()){case 0:break;case 255:e.skip(-1);break;case 217:i=!0;break;case 192:case 193:case 194:case 195:case 197:case 198:case 199:case 201:case 202:case 203:case 205:case 206:case 207:case 196:case 204:case 218:case 219:case 220:case 221:case 222:case 223:case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:case 254:n=e.getUint16();n>2?e.skip(n-2):e.skip(-2)}if(i)break}const s=e.pos-t;if(-1===r){(0,a.warn)("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead.");e.skip(-s);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return s}findASCII85DecodeInlineStreamEnd(e){const t=e.pos;let r;for(;-1!==(r=e.getByte());)if(126===r){const t=e.pos;r=e.peekByte();for(;(0,i.isWhiteSpace)(r);){e.skip();r=e.peekByte()}if(62===r){e.skip();break}if(e.pos>t){const t=e.peekBytes(2);if(69===t[0]&&73===t[1])break}}const n=e.pos-t;if(-1===r){(0,a.warn)("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}findASCIIHexDecodeInlineStreamEnd(e){const t=e.pos;let r;for(;-1!==(r=e.getByte())&&62!==r;);const n=e.pos-t;if(-1===r){(0,a.warn)("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead.");e.skip(-n);return this.findDefaultInlineStreamEnd(e)}this.inlineStreamSkipEI(e);return n}inlineStreamSkipEI(e){let t,r=0;for(;-1!==(t=e.getByte());)if(0===r)r=69===t?1:0;else if(1===r)r=73===t?2:0;else if(2===r)break}makeInlineImage(e){const t=this.lexer,r=t.stream,i=new n.Dict(this.xref);let s;for(;!(0,n.isCmd)(this.buf1,"ID")&&this.buf1!==n.EOF;){if(!(this.buf1 instanceof n.Name))throw new a.FormatError("Dictionary key must be a name object");const t=this.buf1.name;this.shift();if(this.buf1===n.EOF)break;i.set(t,this.getObj(e))}-1!==t.beginInlineImagePos&&(s=r.pos-t.beginInlineImagePos);const o=i.get("F","Filter");let c;if(o instanceof n.Name)c=o.name;else if(Array.isArray(o)){const e=this.xref.fetchIfRef(o[0]);e instanceof n.Name&&(c=e.name)}const l=r.pos;let h;switch(c){case"DCT":case"DCTDecode":h=this.findDCTDecodeInlineStreamEnd(r);break;case"A85":case"ASCII85Decode":h=this.findASCII85DecodeInlineStreamEnd(r);break;case"AHx":case"ASCIIHexDecode":h=this.findASCIIHexDecodeInlineStreamEnd(r);break;default:h=this.findDefaultInlineStreamEnd(r)}let u,d=r.makeSubStream(l,h,i);if(h<1e3&&s<5552){const e=d.getBytes();d.reset();const a=r.pos;r.pos=t.beginInlineImagePos;const i=r.getBytes(s);r.pos=a;u=computeAdler32(e)+"_"+computeAdler32(i);const o=this.imageCache[u];if(void 0!==o){this.buf2=n.Cmd.get("EI");this.shift();o.reset();return o}}e&&(d=e.createStream(d,h));d=this.filter(d,i,h);d.dict=i;if(void 0!==u){d.cacheKey=`inline_${h}_${u}`;this.imageCache[u]=d}this.buf2=n.Cmd.get("EI");this.shift();return d}_findStreamLength(e,t){const{stream:r}=this.lexer;r.pos=e;const a=t.length;for(;r.pos<r.end;){const n=r.peekBytes(2048),i=n.length-a;if(i<=0)break;let s=0;for(;s<i;){let i=0;for(;i<a&&n[s+i]===t[i];)i++;if(i>=a){r.pos+=s;return r.pos-e}s++}r.pos+=i}return-1}makeStream(e,t){const r=this.lexer;let s=r.stream;r.skipToNextLine();const o=s.pos-1;let c=e.get("Length");if(!Number.isInteger(c)){(0,a.info)(`Bad length "${c&&c.toString()}" in stream.`);c=0}s.pos=o+c;r.nextChar();if(this.tryShift()&&(0,n.isCmd)(this.buf2,"endstream"))this.shift();else{const e=new Uint8Array([101,110,100,115,116,114,101,97,109]);let t=this._findStreamLength(o,e);if(t<0){const r=1;for(let n=1;n<=r;n++){const r=e.length-n,c=e.slice(0,r),l=this._findStreamLength(o,c);if(l>=0){const e=s.peekBytes(r+1)[r];if(!(0,i.isWhiteSpace)(e))break;(0,a.info)(`Found "${(0,a.bytesToString)(c)}" when searching for endstream command.`);t=l;break}}if(t<0)throw new a.FormatError("Missing endstream command.")}c=t;r.nextChar();this.shift();this.shift()}this.shift();s=s.makeSubStream(o,c,e);t&&(s=t.createStream(s,c));s=this.filter(s,e,c);s.dict=e;return s}filter(e,t,r){let i=t.get("F","Filter"),s=t.get("DP","DecodeParms");if(i instanceof n.Name){Array.isArray(s)&&(0,a.warn)("/DecodeParms should not be an Array, when /Filter is a Name.");return this.makeFilter(e,i.name,r,s)}let o=r;if(Array.isArray(i)){const t=i,r=s;for(let c=0,l=t.length;c<l;++c){i=this.xref.fetchIfRef(t[c]);if(!(i instanceof n.Name))throw new a.FormatError(`Bad filter name "${i}"`);s=null;Array.isArray(r)&&c in r&&(s=this.xref.fetchIfRef(r[c]));e=this.makeFilter(e,i.name,o,s);o=null}}return e}makeFilter(e,t,r,n){if(0===r){(0,a.warn)(`Empty "${t}" stream.`);return new g.NullStream}const b=this.xref.stats;try{switch(t){case"Fl":case"FlateDecode":b.addStreamType(a.StreamType.FLATE);return n?new p.PredictorStream(new l.FlateStream(e,r),r,n):new l.FlateStream(e,r);case"LZW":case"LZWDecode":b.addStreamType(a.StreamType.LZW);let t=1;if(n){n.has("EarlyChange")&&(t=n.get("EarlyChange"));return new p.PredictorStream(new f.LZWStream(e,r,t),r,n)}return new f.LZWStream(e,r,t);case"DCT":case"DCTDecode":b.addStreamType(a.StreamType.DCT);return new u.JpegStream(e,r,n);case"JPX":case"JPXDecode":b.addStreamType(a.StreamType.JPX);return new d.JpxStream(e,r,n);case"A85":case"ASCII85Decode":b.addStreamType(a.StreamType.A85);return new s.Ascii85Stream(e,r);case"AHx":case"ASCIIHexDecode":b.addStreamType(a.StreamType.AHX);return new o.AsciiHexStream(e,r);case"CCF":case"CCITTFaxDecode":b.addStreamType(a.StreamType.CCF);return new c.CCITTFaxStream(e,r,n);case"RL":case"RunLengthDecode":b.addStreamType(a.StreamType.RLX);return new m.RunLengthStream(e,r);case"JBIG2Decode":b.addStreamType(a.StreamType.JBIG);return new h.Jbig2Stream(e,r,n)}(0,a.warn)(`Filter "${t}" is not supported.`);return e}catch(e){if(e instanceof i.MissingDataException)throw e;(0,a.warn)(`Invalid stream: "${e}"`);return new g.NullStream}}}t.Parser=Parser;const b=[1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,2,0,0,2,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];function toHexDigit(e){return e>=48&&e<=57?15&e:e>=65&&e<=70||e>=97&&e<=102?9+(15&e):-1}class Lexer{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.stream=e;this.nextChar();this.strBuf=[];this.knownCommands=t;this._hexStringNumWarn=0;this.beginInlineImagePos=-1}nextChar(){return this.currentChar=this.stream.getByte()}peekChar(){return this.stream.peekByte()}getNumber(){let e=this.currentChar,t=!1,r=0,n=0;if(45===e){n=-1;e=this.nextChar();45===e&&(e=this.nextChar())}else if(43===e){n=1;e=this.nextChar()}if(10===e||13===e)do{e=this.nextChar()}while(10===e||13===e);if(46===e){r=10;e=this.nextChar()}if(e<48||e>57){if((0,i.isWhiteSpace)(e)||-1===e){if(10===r&&0===n){(0,a.warn)("Lexer.getNumber - treating a single decimal point as zero.");return 0}if(0===r&&-1===n){(0,a.warn)("Lexer.getNumber - treating a single minus sign as zero.");return 0}}throw new a.FormatError(`Invalid number: ${String.fromCharCode(e)} (charCode ${e})`)}n=n||1;let s=e-48,o=0,c=1;for(;(e=this.nextChar())>=0;)if(e>=48&&e<=57){const a=e-48;if(t)o=10*o+a;else{0!==r&&(r*=10);s=10*s+a}}else if(46===e){if(0!==r)break;r=1}else if(45===e)(0,a.warn)("Badly formatted number: minus sign in the middle");else{if(69!==e&&101!==e)break;e=this.peekChar();if(43===e||45===e){c=45===e?-1:1;this.nextChar()}else if(e<48||e>57)break;t=!0}0!==r&&(s/=r);t&&(s*=10**(c*o));return n*s}getString(){let e=1,t=!1;const r=this.strBuf;r.length=0;let n=this.nextChar();for(;;){let i=!1;switch(0|n){case-1:(0,a.warn)("Unterminated string");t=!0;break;case 40:++e;r.push("(");break;case 41:if(0==--e){this.nextChar();t=!0}else r.push(")");break;case 92:n=this.nextChar();switch(n){case-1:(0,a.warn)("Unterminated string");t=!0;break;case 110:r.push("\n");break;case 114:r.push("\r");break;case 116:r.push("\t");break;case 98:r.push("\b");break;case 102:r.push("\f");break;case 92:case 40:case 41:r.push(String.fromCharCode(n));break;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:let e=15&n;n=this.nextChar();i=!0;if(n>=48&&n<=55){e=(e<<3)+(15&n);n=this.nextChar();if(n>=48&&n<=55){i=!1;e=(e<<3)+(15&n)}}r.push(String.fromCharCode(e));break;case 13:10===this.peekChar()&&this.nextChar();break;case 10:break;default:r.push(String.fromCharCode(n))}break;default:r.push(String.fromCharCode(n))}if(t)break;i||(n=this.nextChar())}return r.join("")}getName(){let e,t;const r=this.strBuf;r.length=0;for(;(e=this.nextChar())>=0&&!b[e];)if(35===e){e=this.nextChar();if(b[e]){(0,a.warn)("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number.");r.push("#");break}const n=toHexDigit(e);if(-1!==n){t=e;e=this.nextChar();const i=toHexDigit(e);if(-1===i){(0,a.warn)(`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`);r.push("#",String.fromCharCode(t));if(b[e])break;r.push(String.fromCharCode(e));continue}r.push(String.fromCharCode(n<<4|i))}else r.push("#",String.fromCharCode(e))}else r.push(String.fromCharCode(e));r.length>127&&(0,a.warn)(`Name token is longer than allowed by the spec: ${r.length}`);return n.Name.get(r.join(""))}_hexStringWarn(e){5!=this._hexStringNumWarn++?this._hexStringNumWarn>5||(0,a.warn)(`getHexString - ignoring invalid character: ${e}`):(0,a.warn)("getHexString - ignoring additional invalid characters.")}getHexString(){const e=this.strBuf;e.length=0;let t,r,n=this.currentChar,i=!0;this._hexStringNumWarn=0;for(;;){if(n<0){(0,a.warn)("Unterminated hex string");break}if(62===n){this.nextChar();break}if(1!==b[n]){if(i){t=toHexDigit(n);if(-1===t){this._hexStringWarn(n);n=this.nextChar();continue}}else{r=toHexDigit(n);if(-1===r){this._hexStringWarn(n);n=this.nextChar();continue}e.push(String.fromCharCode(t<<4|r))}i=!i;n=this.nextChar()}else n=this.nextChar()}return e.join("")}getObj(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(1!==b[t])break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return this.getNumber();case 40:return this.getString();case 47:return this.getName();case 91:this.nextChar();return n.Cmd.get("[");case 93:this.nextChar();return n.Cmd.get("]");case 60:t=this.nextChar();if(60===t){this.nextChar();return n.Cmd.get("<<")}return this.getHexString();case 62:t=this.nextChar();if(62===t){this.nextChar();return n.Cmd.get(">>")}return n.Cmd.get(">");case 123:this.nextChar();return n.Cmd.get("{");case 125:this.nextChar();return n.Cmd.get("}");case 41:this.nextChar();throw new a.FormatError(`Illegal character: ${t}`)}let r=String.fromCharCode(t);if(t<32||t>127){const e=this.peekChar();if(e>=32&&e<=127){this.nextChar();return n.Cmd.get(r)}}const i=this.knownCommands;let s=i&&void 0!==i[r];for(;(t=this.nextChar())>=0&&!b[t];){const e=r+String.fromCharCode(t);if(s&&void 0===i[e])break;if(128===r.length)throw new a.FormatError(`Command token too long: ${r.length}`);r=e;s=i&&void 0!==i[r]}if("true"===r)return!0;if("false"===r)return!1;if("null"===r)return null;"BI"===r&&(this.beginInlineImagePos=this.stream.pos);return n.Cmd.get(r)}peekObj(){const e=this.stream.pos,t=this.currentChar,r=this.beginInlineImagePos;let n;try{n=this.getObj()}catch(e){if(e instanceof i.MissingDataException)throw e;(0,a.warn)(`peekObj: ${e}`)}this.stream.pos=e;this.currentChar=t;this.beginInlineImagePos=r;return n}skipToNextLine(){let e=this.currentChar;for(;e>=0;){if(13===e){e=this.nextChar();10===e&&this.nextChar();break}if(10===e){this.nextChar();break}e=this.nextChar()}}}t.Lexer=Lexer;t.Linearization=class Linearization{static create(e){function getInt(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=e.get(t);if(Number.isInteger(a)&&(r?a>=0:a>0))return a;throw new Error(`The "${t}" parameter in the linearization dictionary is invalid.`)}const t=new Parser({lexer:new Lexer(e),xref:null}),r=t.getObj(),a=t.getObj(),i=t.getObj(),s=t.getObj();let o,c;if(!(Number.isInteger(r)&&Number.isInteger(a)&&(0,n.isCmd)(i,"obj")&&s instanceof n.Dict&&"number"==typeof(o=s.get("Linearized"))&&o>0))return null;if((c=getInt(s,"L"))!==e.length)throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');return{length:c,hints:function getHints(e){const t=e.get("H");let r;if(Array.isArray(t)&&(2===(r=t.length)||4===r)){for(let e=0;e<r;e++){const r=t[e];if(!(Number.isInteger(r)&&r>0))throw new Error(`Hint (${e}) in the linearization dictionary is invalid.`)}return t}throw new Error("Hint array in the linearization dictionary is invalid.")}(s),objectNumberFirst:getInt(s,"O"),endFirst:getInt(s,"E"),numPages:getInt(s,"N"),mainXRefEntriesOffset:getInt(s,"T"),pageFirst:s.has("P")?getInt(s,"P",!0):0}}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Ascii85Stream=void 0;var a=r(147),n=r(134);class Ascii85Stream extends a.DecodeStream{constructor(e,t){t&&(t*=.8);super(t);this.str=e;this.dict=e.dict;this.input=new Uint8Array(5)}readBlock(){const e=this.str;let t=e.getByte();for(;(0,n.isWhiteSpace)(t);)t=e.getByte();if(-1===t||126===t){this.eof=!0;return}const r=this.bufferLength;let a,i;if(122===t){a=this.ensureBuffer(r+4);for(i=0;i<4;++i)a[r+i]=0;this.bufferLength+=4}else{const s=this.input;s[0]=t;for(i=1;i<5;++i){t=e.getByte();for(;(0,n.isWhiteSpace)(t);)t=e.getByte();s[i]=t;if(-1===t||126===t)break}a=this.ensureBuffer(r+i-1);this.bufferLength+=i-1;if(i<5){for(;i<5;++i)s[i]=117;this.eof=!0}let o=0;for(i=0;i<5;++i)o=85*o+(s[i]-33);for(i=3;i>=0;--i){a[r+i]=255&o;o>>=8}}}}t.Ascii85Stream=Ascii85Stream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StreamsSequenceStream=t.DecodeStream=void 0;var a=r(135),n=r(138);const i=new Uint8Array(0);class DecodeStream extends a.BaseStream{constructor(e){super();this._rawMinBufferLength=e||0;this.pos=0;this.bufferLength=0;this.eof=!1;this.buffer=i;this.minBufferLength=512;if(e)for(;this.minBufferLength<e;)this.minBufferLength*=2}get isEmpty(){for(;!this.eof&&0===this.bufferLength;)this.readBlock();return 0===this.bufferLength}ensureBuffer(e){const t=this.buffer;if(e<=t.byteLength)return t;let r=this.minBufferLength;for(;r<e;)r*=2;const a=new Uint8Array(r);a.set(t);return this.buffer=a}getByte(){const e=this.pos;for(;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]}getBytes(e){const t=this.pos;let r;if(e){this.ensureBuffer(t+e);r=t+e;for(;!this.eof&&this.bufferLength<r;)this.readBlock();const a=this.bufferLength;r>a&&(r=a)}else{for(;!this.eof;)this.readBlock();r=this.bufferLength}this.pos=r;return this.buffer.subarray(t,r)}reset(){this.pos=0}makeSubStream(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(void 0===t)for(;!this.eof;)this.readBlock();else{const r=e+t;for(;this.bufferLength<=r&&!this.eof;)this.readBlock()}return new n.Stream(this.buffer,e,t,r)}getBaseStreams(){return this.str?this.str.getBaseStreams():null}}t.DecodeStream=DecodeStream;t.StreamsSequenceStream=class StreamsSequenceStream extends DecodeStream{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=0;for(const t of e)r+=t instanceof DecodeStream?t._rawMinBufferLength:t.length;super(r);this.streams=e;this._onError=t}readBlock(){const e=this.streams;if(0===e.length){this.eof=!0;return}const t=e.shift();let r;try{r=t.getBytes()}catch(e){if(this._onError){this._onError(e,t.dict&&t.dict.objId);return}throw e}const a=this.bufferLength,n=a+r.length;this.ensureBuffer(n).set(r,a);this.bufferLength=n}getBaseStreams(){const e=[];for(const t of this.streams){const r=t.getBaseStreams();r&&e.push(...r)}return e.length>0?e:null}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AsciiHexStream=void 0;var a=r(147);class AsciiHexStream extends a.DecodeStream{constructor(e,t){t&&(t*=.5);super(t);this.str=e;this.dict=e.dict;this.firstDigit=-1}readBlock(){const e=this.str.getBytes(8e3);if(!e.length){this.eof=!0;return}const t=e.length+1>>1,r=this.ensureBuffer(this.bufferLength+t);let a=this.bufferLength,n=this.firstDigit;for(const t of e){let e;if(t>=48&&t<=57)e=15&t;else{if(!(t>=65&&t<=70||t>=97&&t<=102)){if(62===t){this.eof=!0;break}continue}e=9+(15&t)}if(n<0)n=e;else{r[a++]=n<<4|e;n=-1}}if(n>=0&&this.eof){r[a++]=n<<4;n=-1}this.firstDigit=n;this.bufferLength=a}}t.AsciiHexStream=AsciiHexStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CCITTFaxStream=void 0;var a=r(150),n=r(147),i=r(133);class CCITTFaxStream extends n.DecodeStream{constructor(e,t,r){super(t);this.str=e;this.dict=e.dict;r instanceof i.Dict||(r=i.Dict.empty);const n={next:()=>e.getByte()};this.ccittFaxDecoder=new a.CCITTFaxDecoder(n,{K:r.get("K"),EndOfLine:r.get("EndOfLine"),EncodedByteAlign:r.get("EncodedByteAlign"),Columns:r.get("Columns"),Rows:r.get("Rows"),EndOfBlock:r.get("EndOfBlock"),BlackIs1:r.get("BlackIs1")})}readBlock(){for(;!this.eof;){const e=this.ccittFaxDecoder.readNextChar();if(-1===e){this.eof=!0;return}this.ensureBuffer(this.bufferLength+1);this.buffer[this.bufferLength++]=e}}}t.CCITTFaxStream=CCITTFaxStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CCITTFaxDecoder=void 0;var a=r(2);const n=-1,i=[[-1,-1],[-1,-1],[7,8],[7,7],[6,6],[6,6],[6,5],[6,5],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[4,0],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[3,3],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2],[1,2]],s=[[-1,-1],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[12,1984],[12,2048],[12,2112],[12,2176],[12,2240],[12,2304],[11,1856],[11,1856],[11,1920],[11,1920],[12,2368],[12,2432],[12,2496],[12,2560]],o=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[8,29],[8,29],[8,30],[8,30],[8,45],[8,45],[8,46],[8,46],[7,22],[7,22],[7,22],[7,22],[7,23],[7,23],[7,23],[7,23],[8,47],[8,47],[8,48],[8,48],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[6,13],[7,20],[7,20],[7,20],[7,20],[8,33],[8,33],[8,34],[8,34],[8,35],[8,35],[8,36],[8,36],[8,37],[8,37],[8,38],[8,38],[7,19],[7,19],[7,19],[7,19],[8,31],[8,31],[8,32],[8,32],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[6,12],[8,53],[8,53],[8,54],[8,54],[7,26],[7,26],[7,26],[7,26],[8,39],[8,39],[8,40],[8,40],[8,41],[8,41],[8,42],[8,42],[8,43],[8,43],[8,44],[8,44],[7,21],[7,21],[7,21],[7,21],[7,28],[7,28],[7,28],[7,28],[8,61],[8,61],[8,62],[8,62],[8,63],[8,63],[8,0],[8,0],[8,320],[8,320],[8,384],[8,384],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,10],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[5,11],[7,27],[7,27],[7,27],[7,27],[8,59],[8,59],[8,60],[8,60],[9,1472],[9,1536],[9,1600],[9,1728],[7,18],[7,18],[7,18],[7,18],[7,24],[7,24],[7,24],[7,24],[8,49],[8,49],[8,50],[8,50],[8,51],[8,51],[8,52],[8,52],[7,25],[7,25],[7,25],[7,25],[8,55],[8,55],[8,56],[8,56],[8,57],[8,57],[8,58],[8,58],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,192],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[6,1664],[8,448],[8,448],[8,512],[8,512],[9,704],[9,768],[8,640],[8,640],[8,576],[8,576],[9,832],[9,896],[9,960],[9,1024],[9,1088],[9,1152],[9,1216],[9,1280],[9,1344],[9,1408],[7,256],[7,256],[7,256],[7,256],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,2],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,128],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,8],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[5,9],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,16],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[6,17],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,4],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[4,5],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,14],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[6,15],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[5,64],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,6],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7],[4,7]],c=[[-1,-1],[-1,-1],[12,-2],[12,-2],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[-1,-1],[11,1792],[11,1792],[11,1792],[11,1792],[12,1984],[12,1984],[12,2048],[12,2048],[12,2112],[12,2112],[12,2176],[12,2176],[12,2240],[12,2240],[12,2304],[12,2304],[11,1856],[11,1856],[11,1856],[11,1856],[11,1920],[11,1920],[11,1920],[11,1920],[12,2368],[12,2368],[12,2432],[12,2432],[12,2496],[12,2496],[12,2560],[12,2560],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[10,18],[12,52],[12,52],[13,640],[13,704],[13,768],[13,832],[12,55],[12,55],[12,56],[12,56],[13,1280],[13,1344],[13,1408],[13,1472],[12,59],[12,59],[12,60],[12,60],[13,1536],[13,1600],[11,24],[11,24],[11,24],[11,24],[11,25],[11,25],[11,25],[11,25],[13,1664],[13,1728],[12,320],[12,320],[12,384],[12,384],[12,448],[12,448],[13,512],[13,576],[12,53],[12,53],[12,54],[12,54],[13,896],[13,960],[13,1024],[13,1088],[13,1152],[13,1216],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64],[10,64]],l=[[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[8,13],[11,23],[11,23],[12,50],[12,51],[12,44],[12,45],[12,46],[12,47],[12,57],[12,58],[12,61],[12,256],[10,16],[10,16],[10,16],[10,16],[10,17],[10,17],[10,17],[10,17],[12,48],[12,49],[12,62],[12,63],[12,30],[12,31],[12,32],[12,33],[12,40],[12,41],[11,22],[11,22],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[8,14],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,10],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[7,11],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[9,15],[12,128],[12,192],[12,26],[12,27],[12,28],[12,29],[11,19],[11,19],[11,20],[11,20],[12,34],[12,35],[12,36],[12,37],[12,38],[12,39],[11,21],[11,21],[12,42],[12,43],[10,0],[10,0],[10,0],[10,0],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12],[7,12]],h=[[-1,-1],[-1,-1],[-1,-1],[-1,-1],[6,9],[6,8],[5,7],[5,7],[4,6],[4,6],[4,6],[4,6],[4,5],[4,5],[4,5],[4,5],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[3,4],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,3],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2],[2,2]];t.CCITTFaxDecoder=class CCITTFaxDecoder{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"function"!=typeof e.next)throw new Error('CCITTFaxDecoder - invalid "source" parameter.');this.source=e;this.eof=!1;this.encoding=t.K||0;this.eoline=t.EndOfLine||!1;this.byteAlign=t.EncodedByteAlign||!1;this.columns=t.Columns||1728;this.rows=t.Rows||0;let r,a=t.EndOfBlock;null==a&&(a=!0);this.eoblock=a;this.black=t.BlackIs1||!1;this.codingLine=new Uint32Array(this.columns+1);this.refLine=new Uint32Array(this.columns+2);this.codingLine[0]=this.columns;this.codingPos=0;this.row=0;this.nextLine2D=this.encoding<0;this.inputBits=0;this.inputBuf=0;this.outputBits=0;this.rowsDone=!1;for(;0===(r=this._lookBits(12));)this._eatBits(1);1===r&&this._eatBits(12);if(this.encoding>0){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}}readNextChar(){if(this.eof)return-1;const e=this.refLine,t=this.codingLine,r=this.columns;let i,s,o,c,l;if(0===this.outputBits){this.rowsDone&&(this.eof=!0);if(this.eof)return-1;this.err=!1;let o,l,h;if(this.nextLine2D){for(c=0;t[c]<r;++c)e[c]=t[c];e[c++]=r;e[c]=r;t[0]=0;this.codingPos=0;i=0;s=0;for(;t[this.codingPos]<r;){o=this._getTwoDimCode();switch(o){case 0:this._addPixels(e[i+1],s);e[i+1]<r&&(i+=2);break;case 1:o=l=0;if(s){do{o+=h=this._getBlackCode()}while(h>=64);do{l+=h=this._getWhiteCode()}while(h>=64)}else{do{o+=h=this._getWhiteCode()}while(h>=64);do{l+=h=this._getBlackCode()}while(h>=64)}this._addPixels(t[this.codingPos]+o,s);t[this.codingPos]<r&&this._addPixels(t[this.codingPos]+l,1^s);for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2;break;case 7:this._addPixels(e[i]+3,s);s^=1;if(t[this.codingPos]<r){++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case 5:this._addPixels(e[i]+2,s);s^=1;if(t[this.codingPos]<r){++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case 3:this._addPixels(e[i]+1,s);s^=1;if(t[this.codingPos]<r){++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case 2:this._addPixels(e[i],s);s^=1;if(t[this.codingPos]<r){++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case 8:this._addPixelsNeg(e[i]-3,s);s^=1;if(t[this.codingPos]<r){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case 6:this._addPixelsNeg(e[i]-2,s);s^=1;if(t[this.codingPos]<r){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case 4:this._addPixelsNeg(e[i]-1,s);s^=1;if(t[this.codingPos]<r){i>0?--i:++i;for(;e[i]<=t[this.codingPos]&&e[i]<r;)i+=2}break;case n:this._addPixels(r,0);this.eof=!0;break;default:(0,a.info)("bad 2d code");this._addPixels(r,0);this.err=!0}}}else{t[0]=0;this.codingPos=0;s=0;for(;t[this.codingPos]<r;){o=0;if(s)do{o+=h=this._getBlackCode()}while(h>=64);else do{o+=h=this._getWhiteCode()}while(h>=64);this._addPixels(t[this.codingPos]+o,s);s^=1}}let u=!1;this.byteAlign&&(this.inputBits&=-8);if(this.eoblock||this.row!==this.rows-1){o=this._lookBits(12);if(this.eoline)for(;o!==n&&1!==o;){this._eatBits(1);o=this._lookBits(12)}else for(;0===o;){this._eatBits(1);o=this._lookBits(12)}if(1===o){this._eatBits(12);u=!0}else o===n&&(this.eof=!0)}else this.rowsDone=!0;if(!this.eof&&this.encoding>0&&!this.rowsDone){this.nextLine2D=!this._lookBits(1);this._eatBits(1)}if(this.eoblock&&u&&this.byteAlign){o=this._lookBits(12);if(1===o){this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}if(this.encoding>=0)for(c=0;c<4;++c){o=this._lookBits(12);1!==o&&(0,a.info)("bad rtc code: "+o);this._eatBits(12);if(this.encoding>0){this._lookBits(1);this._eatBits(1)}}this.eof=!0}}else if(this.err&&this.eoline){for(;;){o=this._lookBits(13);if(o===n){this.eof=!0;return-1}if(o>>1==1)break;this._eatBits(1)}this._eatBits(12);if(this.encoding>0){this._eatBits(1);this.nextLine2D=!(1&o)}}t[0]>0?this.outputBits=t[this.codingPos=0]:this.outputBits=t[this.codingPos=1];this.row++}if(this.outputBits>=8){l=1&this.codingPos?0:255;this.outputBits-=8;if(0===this.outputBits&&t[this.codingPos]<r){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}}else{o=8;l=0;do{if("number"!=typeof this.outputBits)throw new a.FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');if(this.outputBits>o){l<<=o;1&this.codingPos||(l|=255>>8-o);this.outputBits-=o;o=0}else{l<<=this.outputBits;1&this.codingPos||(l|=255>>8-this.outputBits);o-=this.outputBits;this.outputBits=0;if(t[this.codingPos]<r){this.codingPos++;this.outputBits=t[this.codingPos]-t[this.codingPos-1]}else if(o>0){l<<=o;o=0}}}while(o)}this.black&&(l^=255);return l}_addPixels(e,t){const r=this.codingLine;let n=this.codingPos;if(e>r[n]){if(e>this.columns){(0,a.info)("row is wrong length");this.err=!0;e=this.columns}1&n^t&&++n;r[n]=e}this.codingPos=n}_addPixelsNeg(e,t){const r=this.codingLine;let n=this.codingPos;if(e>r[n]){if(e>this.columns){(0,a.info)("row is wrong length");this.err=!0;e=this.columns}1&n^t&&++n;r[n]=e}else if(e<r[n]){if(e<0){(0,a.info)("invalid code");this.err=!0;e=0}for(;n>0&&e<r[n-1];)--n;r[n]=e}this.codingPos=n}_findTableCode(e,t,r,a){const i=a||0;for(let a=e;a<=t;++a){let e=this._lookBits(a);if(e===n)return[!0,1,!1];a<t&&(e<<=t-a);if(!i||e>=i){const t=r[e-i];if(t[0]===a){this._eatBits(a);return[!0,t[1],!0]}}}return[!1,0,!1]}_getTwoDimCode(){let e,t=0;if(this.eoblock){t=this._lookBits(7);e=i[t];if(e&&e[0]>0){this._eatBits(e[0]);return e[1]}}else{const e=this._findTableCode(1,7,i);if(e[0]&&e[2])return e[1]}(0,a.info)("Bad two dim code");return n}_getWhiteCode(){let e,t=0;if(this.eoblock){t=this._lookBits(12);if(t===n)return 1;e=t>>5==0?s[t]:o[t>>3];if(e[0]>0){this._eatBits(e[0]);return e[1]}}else{let e=this._findTableCode(1,9,o);if(e[0])return e[1];e=this._findTableCode(11,12,s);if(e[0])return e[1]}(0,a.info)("bad white code");this._eatBits(1);return 1}_getBlackCode(){let e,t;if(this.eoblock){e=this._lookBits(13);if(e===n)return 1;t=e>>7==0?c[e]:e>>9==0&&e>>7!=0?l[(e>>1)-64]:h[e>>7];if(t[0]>0){this._eatBits(t[0]);return t[1]}}else{let e=this._findTableCode(2,6,h);if(e[0])return e[1];e=this._findTableCode(7,12,l,64);if(e[0])return e[1];e=this._findTableCode(10,13,c);if(e[0])return e[1]}(0,a.info)("bad black code");this._eatBits(1);return 1}_lookBits(e){let t;for(;this.inputBits<e;){if(-1===(t=this.source.next()))return 0===this.inputBits?n:this.inputBuf<<e-this.inputBits&65535>>16-e;this.inputBuf=this.inputBuf<<8|t;this.inputBits+=8}return this.inputBuf>>this.inputBits-e&65535>>16-e}_eatBits(e){(this.inputBits-=e)<0&&(this.inputBits=0)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FlateStream=void 0;var a=r(147),n=r(2);const i=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),o=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),c=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],l=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];class FlateStream extends a.DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict;const r=e.getByte(),a=e.getByte();if(-1===r||-1===a)throw new n.FormatError(`Invalid header in flate stream: ${r}, ${a}`);if(8!=(15&r))throw new n.FormatError(`Unknown compression method in flate stream: ${r}, ${a}`);if(((r<<8)+a)%31!=0)throw new n.FormatError(`Bad FCHECK in flate stream: ${r}, ${a}`);if(32&a)throw new n.FormatError(`FDICT bit set in flate stream: ${r}, ${a}`);this.codeSize=0;this.codeBuf=0}getBits(e){const t=this.str;let r,a=this.codeSize,i=this.codeBuf;for(;a<e;){if(-1===(r=t.getByte()))throw new n.FormatError("Bad encoding in flate stream");i|=r<<a;a+=8}r=i&(1<<e)-1;this.codeBuf=i>>e;this.codeSize=a-=e;return r}getCode(e){const t=this.str,r=e[0],a=e[1];let i,s=this.codeSize,o=this.codeBuf;for(;s<a&&-1!==(i=t.getByte());){o|=i<<s;s+=8}const c=r[o&(1<<a)-1],l=c>>16,h=65535&c;if(l<1||s<l)throw new n.FormatError("Bad encoding in flate stream");this.codeBuf=o>>l;this.codeSize=s-l;return h}generateHuffmanTable(e){const t=e.length;let r,a=0;for(r=0;r<t;++r)e[r]>a&&(a=e[r]);const n=1<<a,i=new Int32Array(n);for(let s=1,o=0,c=2;s<=a;++s,o<<=1,c<<=1)for(let a=0;a<t;++a)if(e[a]===s){let e=0,t=o;for(r=0;r<s;++r){e=e<<1|1&t;t>>=1}for(r=e;r<n;r+=c)i[r]=s<<16|a;++o}return[i,a]}readBlock(){let e,t;const r=this.str;let a,h,u=this.getBits(3);1&u&&(this.eof=!0);u>>=1;if(0===u){let t;if(-1===(t=r.getByte()))throw new n.FormatError("Bad block header in flate stream");let a=t;if(-1===(t=r.getByte()))throw new n.FormatError("Bad block header in flate stream");a|=t<<8;if(-1===(t=r.getByte()))throw new n.FormatError("Bad block header in flate stream");let i=t;if(-1===(t=r.getByte()))throw new n.FormatError("Bad block header in flate stream");i|=t<<8;if(i!==(65535&~a)&&(0!==a||0!==i))throw new n.FormatError("Bad uncompressed block length in flate stream");this.codeBuf=0;this.codeSize=0;const s=this.bufferLength,o=s+a;e=this.ensureBuffer(o);this.bufferLength=o;if(0===a)-1===r.peekByte()&&(this.eof=!0);else{const t=r.getBytes(a);e.set(t,s);t.length<a&&(this.eof=!0)}return}if(1===u){a=c;h=l}else{if(2!==u)throw new n.FormatError("Unknown block type in flate stream");{const e=this.getBits(5)+257,r=this.getBits(5)+1,n=this.getBits(4)+4,s=new Uint8Array(i.length);let o;for(o=0;o<n;++o)s[i[o]]=this.getBits(3);const c=this.generateHuffmanTable(s);t=0;o=0;const l=e+r,u=new Uint8Array(l);let d,f,g;for(;o<l;){const e=this.getCode(c);if(16===e){d=2;f=3;g=t}else if(17===e){d=3;f=3;g=t=0}else{if(18!==e){u[o++]=t=e;continue}d=7;f=11;g=t=0}let r=this.getBits(d)+f;for(;r-- >0;)u[o++]=g}a=this.generateHuffmanTable(u.subarray(0,e));h=this.generateHuffmanTable(u.subarray(e,l))}}e=this.buffer;let d=e?e.length:0,f=this.bufferLength;for(;;){let r=this.getCode(a);if(r<256){if(f+1>=d){e=this.ensureBuffer(f+1);d=e.length}e[f++]=r;continue}if(256===r){this.bufferLength=f;return}r-=257;r=s[r];let n=r>>16;n>0&&(n=this.getBits(n));t=(65535&r)+n;r=this.getCode(h);r=o[r];n=r>>16;n>0&&(n=this.getBits(n));const i=(65535&r)+n;if(f+t>=d){e=this.ensureBuffer(f+t);d=e.length}for(let r=0;r<t;++r,++f)e[f]=e[f-i]}}}t.FlateStream=FlateStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Jbig2Stream=void 0;var a=r(135),n=r(147),i=r(133),s=r(153),o=r(2);class Jbig2Stream extends n.DecodeStream{constructor(e,t,r){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=r}get bytes(){return(0,o.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e=new s.Jbig2Image,t=[];if(this.params instanceof i.Dict){const e=this.params.get("JBIG2Globals");if(e instanceof a.BaseStream){const r=e.getBytes();t.push({data:r,start:0,end:r.length})}}t.push({data:this.bytes,start:0,end:this.bytes.length});const r=e.parseChunks(t),n=r.length;for(let e=0;e<n;e++)r[e]^=255;this.buffer=r;this.bufferLength=n;this.eof=!0}}t.Jbig2Stream=Jbig2Stream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Jbig2Image=void 0;var a=r(2),n=r(134),i=r(154),s=r(150);class Jbig2Error extends a.BaseException{constructor(e){super(`JBIG2 error: ${e}`,"Jbig2Error")}}class ContextCache{getContexts(e){return e in this?this[e]:this[e]=new Int8Array(65536)}}class DecodingContext{constructor(e,t,r){this.data=e;this.start=t;this.end=r}get decoder(){const e=new i.ArithmeticDecoder(this.data,this.start,this.end);return(0,a.shadow)(this,"decoder",e)}get contextCache(){const e=new ContextCache;return(0,a.shadow)(this,"contextCache",e)}}function decodeInteger(e,t,r){const a=e.getContexts(t);let n=1;function readBits(e){let t=0;for(let i=0;i<e;i++){const e=r.readBit(a,n);n=n<256?n<<1|e:511&(n<<1|e)|256;t=t<<1|e}return t>>>0}const i=readBits(1),s=readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(1)?readBits(32)+4436:readBits(12)+340:readBits(8)+84:readBits(6)+20:readBits(4)+4:readBits(2);return 0===i?s:s>0?-s:null}function decodeIAID(e,t,r){const a=e.getContexts("IAID");let n=1;for(let e=0;e<r;e++){n=n<<1|t.readBit(a,n)}return r<31?n&(1<<r)-1:2147483647&n}const o=["SymbolDictionary",null,null,null,"IntermediateTextRegion",null,"ImmediateTextRegion","ImmediateLosslessTextRegion",null,null,null,null,null,null,null,null,"PatternDictionary",null,null,null,"IntermediateHalftoneRegion",null,"ImmediateHalftoneRegion","ImmediateLosslessHalftoneRegion",null,null,null,null,null,null,null,null,null,null,null,null,"IntermediateGenericRegion",null,"ImmediateGenericRegion","ImmediateLosslessGenericRegion","IntermediateGenericRefinementRegion",null,"ImmediateGenericRefinementRegion","ImmediateLosslessGenericRefinementRegion",null,null,null,null,"PageInformation","EndOfPage","EndOfStripe","EndOfFile","Profiles","Tables",null,null,null,null,null,null,null,null,"Extension"],c=[[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:2,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:2,y:-1},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}],[{x:-1,y:-2},{x:0,y:-2},{x:1,y:-2},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-2,y:0},{x:-1,y:0}],[{x:-3,y:-1},{x:-2,y:-1},{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-4,y:0},{x:-3,y:0},{x:-2,y:0},{x:-1,y:0}]],l=[{coding:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:1,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:-1,y:1},{x:0,y:1},{x:1,y:1}]},{coding:[{x:-1,y:-1},{x:0,y:-1},{x:1,y:-1},{x:-1,y:0}],reference:[{x:0,y:-1},{x:-1,y:0},{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}]}],h=[39717,1941,229,405],u=[32,8];function decodeBitmap(e,t,r,a,n,i,s,o){if(e){return decodeMMRBitmap(new Reader(o.data,o.start,o.end),t,r,!1)}if(0===a&&!i&&!n&&4===s.length&&3===s[0].x&&-1===s[0].y&&-3===s[1].x&&-1===s[1].y&&2===s[2].x&&-2===s[2].y&&-2===s[3].x&&-2===s[3].y)return function decodeBitmapTemplate0(e,t,r){const a=r.decoder,n=r.contextCache.getContexts("GB"),i=[];let s,o,c,l,h,u,d;for(o=0;o<t;o++){h=i[o]=new Uint8Array(e);u=o<1?h:i[o-1];d=o<2?h:i[o-2];s=d[0]<<13|d[1]<<12|d[2]<<11|u[0]<<7|u[1]<<6|u[2]<<5|u[3]<<4;for(c=0;c<e;c++){h[c]=l=a.readBit(n,s);s=(31735&s)<<1|(c+3<e?d[c+3]<<11:0)|(c+4<e?u[c+4]<<4:0)|l}}return i}(t,r,o);const l=!!i,u=c[a].concat(s);u.sort((function(e,t){return e.y-t.y||e.x-t.x}));const d=u.length,f=new Int8Array(d),g=new Int8Array(d),p=[];let m,b,y=0,w=0,S=0,x=0;for(b=0;b<d;b++){f[b]=u[b].x;g[b]=u[b].y;w=Math.min(w,u[b].x);S=Math.max(S,u[b].x);x=Math.min(x,u[b].y);b<d-1&&u[b].y===u[b+1].y&&u[b].x===u[b+1].x-1?y|=1<<d-1-b:p.push(b)}const k=p.length,C=new Int8Array(k),v=new Int8Array(k),O=new Uint16Array(k);for(m=0;m<k;m++){b=p[m];C[m]=u[b].x;v[m]=u[b].y;O[m]=1<<d-1-b}const T=-w,M=-x,E=t-S,D=h[a];let N=new Uint8Array(t);const R=[],L=o.decoder,j=o.contextCache.getContexts("GB");let $,_,U,X,H,q=0,z=0;for(let e=0;e<r;e++){if(n){q^=L.readBit(j,D);if(q){R.push(N);continue}}N=new Uint8Array(N);R.push(N);for($=0;$<t;$++){if(l&&i[e][$]){N[$]=0;continue}if($>=T&&$<E&&e>=M){z=z<<1&y;for(b=0;b<k;b++){_=e+v[b];U=$+C[b];X=R[_][U];if(X){X=O[b];z|=X}}}else{z=0;H=d-1;for(b=0;b<d;b++,H--){U=$+f[b];if(U>=0&&U<t){_=e+g[b];if(_>=0){X=R[_][U];X&&(z|=X<<H)}}}}const r=L.readBit(j,z);N[$]=r}}return R}function decodeRefinement(e,t,r,a,n,i,s,o,c){let h=l[r].coding;0===r&&(h=h.concat([o[0]]));const d=h.length,f=new Int32Array(d),g=new Int32Array(d);let p;for(p=0;p<d;p++){f[p]=h[p].x;g[p]=h[p].y}let m=l[r].reference;0===r&&(m=m.concat([o[1]]));const b=m.length,y=new Int32Array(b),w=new Int32Array(b);for(p=0;p<b;p++){y[p]=m[p].x;w[p]=m[p].y}const S=a[0].length,x=a.length,k=u[r],C=[],v=c.decoder,O=c.contextCache.getContexts("GR");let T=0;for(let r=0;r<t;r++){if(s){T^=v.readBit(O,k);if(T)throw new Jbig2Error("prediction is not supported")}const t=new Uint8Array(e);C.push(t);for(let s=0;s<e;s++){let o,c,l=0;for(p=0;p<d;p++){o=r+g[p];c=s+f[p];o<0||c<0||c>=e?l<<=1:l=l<<1|C[o][c]}for(p=0;p<b;p++){o=r+w[p]-i;c=s+y[p]-n;o<0||o>=x||c<0||c>=S?l<<=1:l=l<<1|a[o][c]}const h=v.readBit(O,l);t[s]=h}}return C}function decodeTextRegion(e,t,r,a,n,i,s,o,c,l,h,u,d,f,g,p,m,b,y){if(e&&t)throw new Jbig2Error("refinement with Huffman is not supported");const w=[];let S,x;for(S=0;S<a;S++){x=new Uint8Array(r);if(n)for(let e=0;e<r;e++)x[e]=n;w.push(x)}const k=m.decoder,C=m.contextCache;let v=e?-f.tableDeltaT.decode(y):-decodeInteger(C,"IADT",k),O=0;S=0;for(;S<i;){v+=e?f.tableDeltaT.decode(y):decodeInteger(C,"IADT",k);O+=e?f.tableFirstS.decode(y):decodeInteger(C,"IAFS",k);let a=O;for(;;){let n=0;s>1&&(n=e?y.readBits(b):decodeInteger(C,"IAIT",k));const i=s*v+n,O=e?f.symbolIDTable.decode(y):decodeIAID(C,k,c),T=t&&(e?y.readBit():decodeInteger(C,"IARI",k));let M=o[O],E=M[0].length,D=M.length;if(T){const e=decodeInteger(C,"IARDW",k),t=decodeInteger(C,"IARDH",k),r=decodeInteger(C,"IARDX",k),a=decodeInteger(C,"IARDY",k);E+=e;D+=t;M=decodeRefinement(E,D,g,M,(e>>1)+r,(t>>1)+a,!1,p,m)}const N=i-(1&u?0:D-1),R=a-(2&u?E-1:0);let L,j,$;if(l){for(L=0;L<D;L++){x=w[R+L];if(!x)continue;$=M[L];const e=Math.min(r-N,E);switch(d){case 0:for(j=0;j<e;j++)x[N+j]|=$[j];break;case 2:for(j=0;j<e;j++)x[N+j]^=$[j];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}a+=D-1}else{for(j=0;j<D;j++){x=w[N+j];if(x){$=M[j];switch(d){case 0:for(L=0;L<E;L++)x[R+L]|=$[L];break;case 2:for(L=0;L<E;L++)x[R+L]^=$[L];break;default:throw new Jbig2Error(`operator ${d} is not supported`)}}}a+=E-1}S++;const _=e?f.tableDeltaS.decode(y):decodeInteger(C,"IADS",k);if(null===_)break;a+=_+h}}return w}function readSegmentHeader(e,t){const r={};r.number=(0,n.readUint32)(e,t);const a=e[t+4],i=63&a;if(!o[i])throw new Jbig2Error("invalid segment type: "+i);r.type=i;r.typeName=o[i];r.deferredNonRetain=!!(128&a);const s=!!(64&a),c=e[t+5];let l=c>>5&7;const h=[31&c];let u=t+6;if(7===c){l=536870911&(0,n.readUint32)(e,u-1);u+=3;let t=l+7>>3;h[0]=e[u++];for(;--t>0;)h.push(e[u++])}else if(5===c||6===c)throw new Jbig2Error("invalid referred-to flags");r.retainBits=h;let f=4;r.number<=256?f=1:r.number<=65536&&(f=2);const g=[];let p,m;for(p=0;p<l;p++){let t;t=1===f?e[u]:2===f?(0,n.readUint16)(e,u):(0,n.readUint32)(e,u);g.push(t);u+=f}r.referredTo=g;if(s){r.pageAssociation=(0,n.readUint32)(e,u);u+=4}else r.pageAssociation=e[u++];r.length=(0,n.readUint32)(e,u);u+=4;if(4294967295===r.length){if(38!==i)throw new Jbig2Error("invalid unknown segment length");{const t=readRegionSegmentInformation(e,u),a=!!(1&e[u+d]),n=6,i=new Uint8Array(n);if(!a){i[0]=255;i[1]=172}i[2]=t.height>>>24&255;i[3]=t.height>>16&255;i[4]=t.height>>8&255;i[5]=255&t.height;for(p=u,m=e.length;p<m;p++){let t=0;for(;t<n&&i[t]===e[p+t];)t++;if(t===n){r.length=p+n;break}}if(4294967295===r.length)throw new Jbig2Error("segment end was not found")}}r.headerEnd=u;return r}function readSegments(e,t,r,a){const n=[];let i=r;for(;i<a;){const r=readSegmentHeader(t,i);i=r.headerEnd;const a={header:r,data:t};if(!e.randomAccess){a.start=i;i+=r.length;a.end=i}n.push(a);if(51===r.type)break}if(e.randomAccess)for(let e=0,t=n.length;e<t;e++){n[e].start=i;i+=n[e].header.length;n[e].end=i}return n}function readRegionSegmentInformation(e,t){return{width:(0,n.readUint32)(e,t),height:(0,n.readUint32)(e,t+4),x:(0,n.readUint32)(e,t+8),y:(0,n.readUint32)(e,t+12),combinationOperator:7&e[t+16]}}const d=17;function processSegment(e,t){const r=e.header,a=e.data,i=e.end;let s,o,c,l,h=e.start;switch(r.type){case 0:const e={},t=(0,n.readUint16)(a,h);e.huffman=!!(1&t);e.refinement=!!(2&t);e.huffmanDHSelector=t>>2&3;e.huffmanDWSelector=t>>4&3;e.bitmapSizeSelector=t>>6&1;e.aggregationInstancesSelector=t>>7&1;e.bitmapCodingContextUsed=!!(256&t);e.bitmapCodingContextRetained=!!(512&t);e.template=t>>10&3;e.refinementTemplate=t>>12&1;h+=2;if(!e.huffman){l=0===e.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,n.readInt8)(a,h),y:(0,n.readInt8)(a,h+1)});h+=2}e.at=o}if(e.refinement&&!e.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,n.readInt8)(a,h),y:(0,n.readInt8)(a,h+1)});h+=2}e.refinementAt=o}e.numberOfExportedSymbols=(0,n.readUint32)(a,h);h+=4;e.numberOfNewSymbols=(0,n.readUint32)(a,h);h+=4;s=[e,r.number,r.referredTo,a,h,i];break;case 6:case 7:const u={};u.info=readRegionSegmentInformation(a,h);h+=d;const f=(0,n.readUint16)(a,h);h+=2;u.huffman=!!(1&f);u.refinement=!!(2&f);u.logStripSize=f>>2&3;u.stripSize=1<<u.logStripSize;u.referenceCorner=f>>4&3;u.transposed=!!(64&f);u.combinationOperator=f>>7&3;u.defaultPixelValue=f>>9&1;u.dsOffset=f<<17>>27;u.refinementTemplate=f>>15&1;if(u.huffman){const e=(0,n.readUint16)(a,h);h+=2;u.huffmanFS=3&e;u.huffmanDS=e>>2&3;u.huffmanDT=e>>4&3;u.huffmanRefinementDW=e>>6&3;u.huffmanRefinementDH=e>>8&3;u.huffmanRefinementDX=e>>10&3;u.huffmanRefinementDY=e>>12&3;u.huffmanRefinementSizeSelector=!!(16384&e)}if(u.refinement&&!u.refinementTemplate){o=[];for(c=0;c<2;c++){o.push({x:(0,n.readInt8)(a,h),y:(0,n.readInt8)(a,h+1)});h+=2}u.refinementAt=o}u.numberOfSymbolInstances=(0,n.readUint32)(a,h);h+=4;s=[u,r.referredTo,a,h,i];break;case 16:const g={},p=a[h++];g.mmr=!!(1&p);g.template=p>>1&3;g.patternWidth=a[h++];g.patternHeight=a[h++];g.maxPatternIndex=(0,n.readUint32)(a,h);h+=4;s=[g,r.number,a,h,i];break;case 22:case 23:const m={};m.info=readRegionSegmentInformation(a,h);h+=d;const b=a[h++];m.mmr=!!(1&b);m.template=b>>1&3;m.enableSkip=!!(8&b);m.combinationOperator=b>>4&7;m.defaultPixelValue=b>>7&1;m.gridWidth=(0,n.readUint32)(a,h);h+=4;m.gridHeight=(0,n.readUint32)(a,h);h+=4;m.gridOffsetX=4294967295&(0,n.readUint32)(a,h);h+=4;m.gridOffsetY=4294967295&(0,n.readUint32)(a,h);h+=4;m.gridVectorX=(0,n.readUint16)(a,h);h+=2;m.gridVectorY=(0,n.readUint16)(a,h);h+=2;s=[m,r.referredTo,a,h,i];break;case 38:case 39:const y={};y.info=readRegionSegmentInformation(a,h);h+=d;const w=a[h++];y.mmr=!!(1&w);y.template=w>>1&3;y.prediction=!!(8&w);if(!y.mmr){l=0===y.template?4:1;o=[];for(c=0;c<l;c++){o.push({x:(0,n.readInt8)(a,h),y:(0,n.readInt8)(a,h+1)});h+=2}y.at=o}s=[y,a,h,i];break;case 48:const S={width:(0,n.readUint32)(a,h),height:(0,n.readUint32)(a,h+4),resolutionX:(0,n.readUint32)(a,h+8),resolutionY:(0,n.readUint32)(a,h+12)};4294967295===S.height&&delete S.height;const x=a[h+16];(0,n.readUint16)(a,h+17);S.lossless=!!(1&x);S.refinement=!!(2&x);S.defaultPixelValue=x>>2&1;S.combinationOperator=x>>3&3;S.requiresBuffer=!!(32&x);S.combinationOperatorOverride=!!(64&x);s=[S];break;case 49:case 50:case 51:case 62:break;case 53:s=[r.number,a,h,i];break;default:throw new Jbig2Error(`segment type ${r.typeName}(${r.type}) is not implemented`)}const u="on"+r.typeName;u in t&&t[u].apply(t,s)}function processSegments(e,t){for(let r=0,a=e.length;r<a;r++)processSegment(e[r],t)}class SimpleSegmentVisitor{onPageInformation(e){this.currentPageInfo=e;const t=e.width+7>>3,r=new Uint8ClampedArray(t*e.height);e.defaultPixelValue&&r.fill(255);this.buffer=r}drawBitmap(e,t){const r=this.currentPageInfo,a=e.width,n=e.height,i=r.width+7>>3,s=r.combinationOperatorOverride?e.combinationOperator:r.combinationOperator,o=this.buffer,c=128>>(7&e.x);let l,h,u,d,f=e.y*i+(e.x>>3);switch(s){case 0:for(l=0;l<n;l++){u=c;d=f;for(h=0;h<a;h++){t[l][h]&&(o[d]|=u);u>>=1;if(!u){u=128;d++}}f+=i}break;case 2:for(l=0;l<n;l++){u=c;d=f;for(h=0;h<a;h++){t[l][h]&&(o[d]^=u);u>>=1;if(!u){u=128;d++}}f+=i}break;default:throw new Jbig2Error(`operator ${s} is not supported`)}}onImmediateGenericRegion(e,t,r,a){const n=e.info,i=new DecodingContext(t,r,a),s=decodeBitmap(e.mmr,n.width,n.height,e.template,e.prediction,null,e.at,i);this.drawBitmap(n,s)}onImmediateLosslessGenericRegion(){this.onImmediateGenericRegion(...arguments)}onSymbolDictionary(e,t,r,a,i,s){let o,c;if(e.huffman){o=function getSymbolDictionaryHuffmanTables(e,t,r){let a,n,i,s,o=0;switch(e.huffmanDHSelector){case 0:case 1:a=getStandardTable(e.huffmanDHSelector+4);break;case 3:a=getCustomHuffmanTable(o,t,r);o++;break;default:throw new Jbig2Error("invalid Huffman DH selector")}switch(e.huffmanDWSelector){case 0:case 1:n=getStandardTable(e.huffmanDWSelector+2);break;case 3:n=getCustomHuffmanTable(o,t,r);o++;break;default:throw new Jbig2Error("invalid Huffman DW selector")}if(e.bitmapSizeSelector){i=getCustomHuffmanTable(o,t,r);o++}else i=getStandardTable(1);s=e.aggregationInstancesSelector?getCustomHuffmanTable(o,t,r):getStandardTable(1);return{tableDeltaHeight:a,tableDeltaWidth:n,tableBitmapSize:i,tableAggregateInstances:s}}(e,r,this.customTables);c=new Reader(a,i,s)}let l=this.symbols;l||(this.symbols=l={});const h=[];for(const e of r){const t=l[e];t&&h.push(...t)}const u=new DecodingContext(a,i,s);l[t]=function decodeSymbolDictionary(e,t,r,a,i,s,o,c,l,h,u,d){if(e&&t)throw new Jbig2Error("symbol refinement with Huffman is not supported");const f=[];let g=0,p=(0,n.log2)(r.length+a);const m=u.decoder,b=u.contextCache;let y,w;if(e){y=getStandardTable(1);w=[];p=Math.max(p,1)}for(;f.length<a;){g+=e?s.tableDeltaHeight.decode(d):decodeInteger(b,"IADH",m);let a=0,n=0;const i=e?w.length:0;for(;;){const i=e?s.tableDeltaWidth.decode(d):decodeInteger(b,"IADW",m);if(null===i)break;a+=i;n+=a;let y;if(t){const n=decodeInteger(b,"IAAI",m);if(n>1)y=decodeTextRegion(e,t,a,g,0,n,1,r.concat(f),p,0,0,1,0,s,l,h,u,0,d);else{const e=decodeIAID(b,m,p),t=decodeInteger(b,"IARDX",m),n=decodeInteger(b,"IARDY",m);y=decodeRefinement(a,g,l,e<r.length?r[e]:f[e-r.length],t,n,!1,h,u)}f.push(y)}else if(e)w.push(a);else{y=decodeBitmap(!1,a,g,o,!1,null,c,u);f.push(y)}}if(e&&!t){const e=s.tableBitmapSize.decode(d);d.byteAlign();let t;if(0===e)t=readUncompressedBitmap(d,n,g);else{const r=d.end,a=d.position+e;d.end=a;t=decodeMMRBitmap(d,n,g,!1);d.end=r;d.position=a}const r=w.length;if(i===r-1)f.push(t);else{let e,a,n,s,o,c=0;for(e=i;e<r;e++){s=w[e];n=c+s;o=[];for(a=0;a<g;a++)o.push(t[a].subarray(c,n));f.push(o);c=n}}}}const S=[],x=[];let k,C,v=!1;const O=r.length+a;for(;x.length<O;){let t=e?y.decode(d):decodeInteger(b,"IAEX",m);for(;t--;)x.push(v);v=!v}for(k=0,C=r.length;k<C;k++)x[k]&&S.push(r[k]);for(let e=0;e<a;k++,e++)x[k]&&S.push(f[e]);return S}(e.huffman,e.refinement,h,e.numberOfNewSymbols,e.numberOfExportedSymbols,o,e.template,e.at,e.refinementTemplate,e.refinementAt,u,c)}onImmediateTextRegion(e,t,r,a,i){const s=e.info;let o,c;const l=this.symbols,h=[];for(const e of t){const t=l[e];t&&h.push(...t)}const u=(0,n.log2)(h.length);if(e.huffman){c=new Reader(r,a,i);o=function getTextRegionHuffmanTables(e,t,r,a,n){const i=[];for(let e=0;e<=34;e++){const t=n.readBits(4);i.push(new HuffmanLine([e,t,0,0]))}const s=new HuffmanTable(i,!1);i.length=0;for(let e=0;e<a;){const t=s.decode(n);if(t>=32){let r,a,s;switch(t){case 32:if(0===e)throw new Jbig2Error("no previous value in symbol ID table");a=n.readBits(2)+3;r=i[e-1].prefixLength;break;case 33:a=n.readBits(3)+3;r=0;break;case 34:a=n.readBits(7)+11;r=0;break;default:throw new Jbig2Error("invalid code length in symbol ID table")}for(s=0;s<a;s++){i.push(new HuffmanLine([e,r,0,0]));e++}}else{i.push(new HuffmanLine([e,t,0,0]));e++}}n.byteAlign();const o=new HuffmanTable(i,!1);let c,l,h,u=0;switch(e.huffmanFS){case 0:case 1:c=getStandardTable(e.huffmanFS+6);break;case 3:c=getCustomHuffmanTable(u,t,r);u++;break;default:throw new Jbig2Error("invalid Huffman FS selector")}switch(e.huffmanDS){case 0:case 1:case 2:l=getStandardTable(e.huffmanDS+8);break;case 3:l=getCustomHuffmanTable(u,t,r);u++;break;default:throw new Jbig2Error("invalid Huffman DS selector")}switch(e.huffmanDT){case 0:case 1:case 2:h=getStandardTable(e.huffmanDT+11);break;case 3:h=getCustomHuffmanTable(u,t,r);u++;break;default:throw new Jbig2Error("invalid Huffman DT selector")}if(e.refinement)throw new Jbig2Error("refinement with Huffman is not supported");return{symbolIDTable:o,tableFirstS:c,tableDeltaS:l,tableDeltaT:h}}(e,t,this.customTables,h.length,c)}const d=new DecodingContext(r,a,i),f=decodeTextRegion(e.huffman,e.refinement,s.width,s.height,e.defaultPixelValue,e.numberOfSymbolInstances,e.stripSize,h,u,e.transposed,e.dsOffset,e.referenceCorner,e.combinationOperator,o,e.refinementTemplate,e.refinementAt,d,e.logStripSize,c);this.drawBitmap(s,f)}onImmediateLosslessTextRegion(){this.onImmediateTextRegion(...arguments)}onPatternDictionary(e,t,r,a,n){let i=this.patterns;i||(this.patterns=i={});const s=new DecodingContext(r,a,n);i[t]=function decodePatternDictionary(e,t,r,a,n,i){const s=[];if(!e){s.push({x:-t,y:0});0===n&&s.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const o=decodeBitmap(e,(a+1)*t,r,n,!1,null,s,i),c=[];for(let e=0;e<=a;e++){const a=[],n=t*e,i=n+t;for(let e=0;e<r;e++)a.push(o[e].subarray(n,i));c.push(a)}return c}(e.mmr,e.patternWidth,e.patternHeight,e.maxPatternIndex,e.template,s)}onImmediateHalftoneRegion(e,t,r,a,i){const s=this.patterns[t[0]],o=e.info,c=new DecodingContext(r,a,i),l=function decodeHalftoneRegion(e,t,r,a,i,s,o,c,l,h,u,d,f,g,p){if(o)throw new Jbig2Error("skip is not supported");if(0!==c)throw new Jbig2Error(`operator "${c}" is not supported in halftone region`);const m=[];let b,y,w;for(b=0;b<i;b++){w=new Uint8Array(a);if(s)for(y=0;y<a;y++)w[y]=s;m.push(w)}const S=t.length,x=t[0],k=x[0].length,C=x.length,v=(0,n.log2)(S),O=[];if(!e){O.push({x:r<=1?3:2,y:-1});0===r&&O.push({x:-3,y:-1},{x:2,y:-2},{x:-2,y:-2})}const T=[];let M,E,D,N,R,L,j,$,_,U,X;e&&(M=new Reader(p.data,p.start,p.end));for(b=v-1;b>=0;b--){E=e?decodeMMRBitmap(M,l,h,!0):decodeBitmap(!1,l,h,r,!1,null,O,p);T[b]=E}for(D=0;D<h;D++)for(N=0;N<l;N++){R=0;L=0;for(y=v-1;y>=0;y--){R^=T[y][D][N];L|=R<<y}j=t[L];$=u+D*g+N*f>>8;_=d+D*f-N*g>>8;if($>=0&&$+k<=a&&_>=0&&_+C<=i)for(b=0;b<C;b++){X=m[_+b];U=j[b];for(y=0;y<k;y++)X[$+y]|=U[y]}else{let e,t;for(b=0;b<C;b++){t=_+b;if(!(t<0||t>=i)){X=m[t];U=j[b];for(y=0;y<k;y++){e=$+y;e>=0&&e<a&&(X[e]|=U[y])}}}}}return m}(e.mmr,s,e.template,o.width,o.height,e.defaultPixelValue,e.enableSkip,e.combinationOperator,e.gridWidth,e.gridHeight,e.gridOffsetX,e.gridOffsetY,e.gridVectorX,e.gridVectorY,c);this.drawBitmap(o,l)}onImmediateLosslessHalftoneRegion(){this.onImmediateHalftoneRegion(...arguments)}onTables(e,t,r,a){let i=this.customTables;i||(this.customTables=i={});i[e]=function decodeTablesSegment(e,t,r){const a=e[t],i=4294967295&(0,n.readUint32)(e,t+1),s=4294967295&(0,n.readUint32)(e,t+5),o=new Reader(e,t+9,r),c=1+(a>>1&7),l=1+(a>>4&7),h=[];let u,d,f=i;do{u=o.readBits(c);d=o.readBits(l);h.push(new HuffmanLine([f,u,d,0]));f+=1<<d}while(f<s);u=o.readBits(c);h.push(new HuffmanLine([i-1,u,32,0,"lower"]));u=o.readBits(c);h.push(new HuffmanLine([s,u,32,0]));if(1&a){u=o.readBits(c);h.push(new HuffmanLine([u,0]))}return new HuffmanTable(h,!1)}(t,r,a)}}class HuffmanLine{constructor(e){if(2===e.length){this.isOOB=!0;this.rangeLow=0;this.prefixLength=e[0];this.rangeLength=0;this.prefixCode=e[1];this.isLowerRange=!1}else{this.isOOB=!1;this.rangeLow=e[0];this.prefixLength=e[1];this.rangeLength=e[2];this.prefixCode=e[3];this.isLowerRange="lower"===e[4]}}}class HuffmanTreeNode{constructor(e){this.children=[];if(e){this.isLeaf=!0;this.rangeLength=e.rangeLength;this.rangeLow=e.rangeLow;this.isLowerRange=e.isLowerRange;this.isOOB=e.isOOB}else this.isLeaf=!1}buildTree(e,t){const r=e.prefixCode>>t&1;if(t<=0)this.children[r]=new HuffmanTreeNode(e);else{let a=this.children[r];a||(this.children[r]=a=new HuffmanTreeNode(null));a.buildTree(e,t-1)}}decodeNode(e){if(this.isLeaf){if(this.isOOB)return null;const t=e.readBits(this.rangeLength);return this.rangeLow+(this.isLowerRange?-t:t)}const t=this.children[e.readBit()];if(!t)throw new Jbig2Error("invalid Huffman data");return t.decodeNode(e)}}class HuffmanTable{constructor(e,t){t||this.assignPrefixCodes(e);this.rootNode=new HuffmanTreeNode(null);for(let t=0,r=e.length;t<r;t++){const r=e[t];r.prefixLength>0&&this.rootNode.buildTree(r,r.prefixLength-1)}}decode(e){return this.rootNode.decodeNode(e)}assignPrefixCodes(e){const t=e.length;let r=0;for(let a=0;a<t;a++)r=Math.max(r,e[a].prefixLength);const a=new Uint32Array(r+1);for(let r=0;r<t;r++)a[e[r].prefixLength]++;let n,i,s,o=1,c=0;a[0]=0;for(;o<=r;){c=c+a[o-1]<<1;n=c;i=0;for(;i<t;){s=e[i];if(s.prefixLength===o){s.prefixCode=n;n++}i++}o++}}}const f={};function getStandardTable(e){let t,r=f[e];if(r)return r;switch(e){case 1:t=[[0,1,4,0],[16,2,8,2],[272,3,16,6],[65808,3,32,7]];break;case 2:t=[[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[75,6,32,62],[6,63]];break;case 3:t=[[-256,8,8,254],[0,1,0,0],[1,2,0,2],[2,3,0,6],[3,4,3,14],[11,5,6,30],[-257,8,32,255,"lower"],[75,7,32,126],[6,62]];break;case 4:t=[[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[76,5,32,31]];break;case 5:t=[[-255,7,8,126],[1,1,0,0],[2,2,0,2],[3,3,0,6],[4,4,3,14],[12,5,6,30],[-256,7,32,127,"lower"],[76,6,32,62]];break;case 6:t=[[-2048,5,10,28],[-1024,4,9,8],[-512,4,8,9],[-256,4,7,10],[-128,5,6,29],[-64,5,5,30],[-32,4,5,11],[0,2,7,0],[128,3,7,2],[256,3,8,3],[512,4,9,12],[1024,4,10,13],[-2049,6,32,62,"lower"],[2048,6,32,63]];break;case 7:t=[[-1024,4,9,8],[-512,3,8,0],[-256,4,7,9],[-128,5,6,26],[-64,5,5,27],[-32,4,5,10],[0,4,5,11],[32,5,5,28],[64,5,6,29],[128,4,7,12],[256,3,8,1],[512,3,9,2],[1024,3,10,3],[-1025,5,32,30,"lower"],[2048,5,32,31]];break;case 8:t=[[-15,8,3,252],[-7,9,1,508],[-5,8,1,253],[-3,9,0,509],[-2,7,0,124],[-1,4,0,10],[0,2,1,0],[2,5,0,26],[3,6,0,58],[4,3,4,4],[20,6,1,59],[22,4,4,11],[38,4,5,12],[70,5,6,27],[134,5,7,28],[262,6,7,60],[390,7,8,125],[646,6,10,61],[-16,9,32,510,"lower"],[1670,9,32,511],[2,1]];break;case 9:t=[[-31,8,4,252],[-15,9,2,508],[-11,8,2,253],[-7,9,1,509],[-5,7,1,124],[-3,4,1,10],[-1,3,1,2],[1,3,1,3],[3,5,1,26],[5,6,1,58],[7,3,5,4],[39,6,2,59],[43,4,5,11],[75,4,6,12],[139,5,7,27],[267,5,8,28],[523,6,8,60],[779,7,9,125],[1291,6,11,61],[-32,9,32,510,"lower"],[3339,9,32,511],[2,0]];break;case 10:t=[[-21,7,4,122],[-5,8,0,252],[-4,7,0,123],[-3,5,0,24],[-2,2,2,0],[2,5,0,25],[3,6,0,54],[4,7,0,124],[5,8,0,253],[6,2,6,1],[70,5,5,26],[102,6,5,55],[134,6,6,56],[198,6,7,57],[326,6,8,58],[582,6,9,59],[1094,6,10,60],[2118,7,11,125],[-22,8,32,254,"lower"],[4166,8,32,255],[2,2]];break;case 11:t=[[1,1,0,0],[2,2,1,2],[4,4,0,12],[5,4,1,13],[7,5,1,28],[9,5,2,29],[13,6,2,60],[17,7,2,122],[21,7,3,123],[29,7,4,124],[45,7,5,125],[77,7,6,126],[141,7,32,127]];break;case 12:t=[[1,1,0,0],[2,2,0,2],[3,3,1,6],[5,5,0,28],[6,5,1,29],[8,6,1,60],[10,7,0,122],[11,7,1,123],[13,7,2,124],[17,7,3,125],[25,7,4,126],[41,8,5,254],[73,8,32,255]];break;case 13:t=[[1,1,0,0],[2,3,0,4],[3,4,0,12],[4,5,0,28],[5,4,1,13],[7,3,3,5],[15,6,1,58],[17,6,2,59],[21,6,3,60],[29,6,4,61],[45,6,5,62],[77,7,6,126],[141,7,32,127]];break;case 14:t=[[-2,3,0,4],[-1,3,0,5],[0,1,0,0],[1,3,0,6],[2,3,0,7]];break;case 15:t=[[-24,7,4,124],[-8,6,2,60],[-4,5,1,28],[-2,4,0,12],[-1,3,0,4],[0,1,0,0],[1,3,0,5],[2,4,0,13],[3,5,1,29],[5,6,2,61],[9,7,4,125],[-25,7,32,126,"lower"],[25,7,32,127]];break;default:throw new Jbig2Error(`standard table B.${e} does not exist`)}for(let e=0,r=t.length;e<r;e++)t[e]=new HuffmanLine(t[e]);r=new HuffmanTable(t,!0);f[e]=r;return r}class Reader{constructor(e,t,r){this.data=e;this.start=t;this.end=r;this.position=t;this.shift=-1;this.currentByte=0}readBit(){if(this.shift<0){if(this.position>=this.end)throw new Jbig2Error("end of data while reading bit");this.currentByte=this.data[this.position++];this.shift=7}const e=this.currentByte>>this.shift&1;this.shift--;return e}readBits(e){let t,r=0;for(t=e-1;t>=0;t--)r|=this.readBit()<<t;return r}byteAlign(){this.shift=-1}next(){return this.position>=this.end?-1:this.data[this.position++]}}function getCustomHuffmanTable(e,t,r){let a=0;for(let n=0,i=t.length;n<i;n++){const i=r[t[n]];if(i){if(e===a)return i;a++}}throw new Jbig2Error("can't find custom Huffman table")}function readUncompressedBitmap(e,t,r){const a=[];for(let n=0;n<r;n++){const r=new Uint8Array(t);a.push(r);for(let a=0;a<t;a++)r[a]=e.readBit();e.byteAlign()}return a}function decodeMMRBitmap(e,t,r,a){const n={K:-1,Columns:t,Rows:r,BlackIs1:!0,EndOfBlock:a},i=new s.CCITTFaxDecoder(e,n),o=[];let c,l=!1;for(let e=0;e<r;e++){const e=new Uint8Array(t);o.push(e);let r=-1;for(let a=0;a<t;a++){if(r<0){c=i.readNextChar();if(-1===c){c=0;l=!0}r=7}e[a]=c>>r&1;r--}}if(a&&!l){const e=5;for(let t=0;t<e&&-1!==i.readNextChar();t++);}return o}t.Jbig2Image=class Jbig2Image{parseChunks(e){return function parseJbig2Chunks(e){const t=new SimpleSegmentVisitor;for(let r=0,a=e.length;r<a;r++){const a=e[r];processSegments(readSegments({},a.data,a.start,a.end),t)}return t.buffer}(e)}parse(e){throw new Error("Not implemented: Jbig2Image.parse")}}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ArithmeticDecoder=void 0;const r=[{qe:22017,nmps:1,nlps:1,switchFlag:1},{qe:13313,nmps:2,nlps:6,switchFlag:0},{qe:6145,nmps:3,nlps:9,switchFlag:0},{qe:2753,nmps:4,nlps:12,switchFlag:0},{qe:1313,nmps:5,nlps:29,switchFlag:0},{qe:545,nmps:38,nlps:33,switchFlag:0},{qe:22017,nmps:7,nlps:6,switchFlag:1},{qe:21505,nmps:8,nlps:14,switchFlag:0},{qe:18433,nmps:9,nlps:14,switchFlag:0},{qe:14337,nmps:10,nlps:14,switchFlag:0},{qe:12289,nmps:11,nlps:17,switchFlag:0},{qe:9217,nmps:12,nlps:18,switchFlag:0},{qe:7169,nmps:13,nlps:20,switchFlag:0},{qe:5633,nmps:29,nlps:21,switchFlag:0},{qe:22017,nmps:15,nlps:14,switchFlag:1},{qe:21505,nmps:16,nlps:14,switchFlag:0},{qe:20737,nmps:17,nlps:15,switchFlag:0},{qe:18433,nmps:18,nlps:16,switchFlag:0},{qe:14337,nmps:19,nlps:17,switchFlag:0},{qe:13313,nmps:20,nlps:18,switchFlag:0},{qe:12289,nmps:21,nlps:19,switchFlag:0},{qe:10241,nmps:22,nlps:19,switchFlag:0},{qe:9217,nmps:23,nlps:20,switchFlag:0},{qe:8705,nmps:24,nlps:21,switchFlag:0},{qe:7169,nmps:25,nlps:22,switchFlag:0},{qe:6145,nmps:26,nlps:23,switchFlag:0},{qe:5633,nmps:27,nlps:24,switchFlag:0},{qe:5121,nmps:28,nlps:25,switchFlag:0},{qe:4609,nmps:29,nlps:26,switchFlag:0},{qe:4353,nmps:30,nlps:27,switchFlag:0},{qe:2753,nmps:31,nlps:28,switchFlag:0},{qe:2497,nmps:32,nlps:29,switchFlag:0},{qe:2209,nmps:33,nlps:30,switchFlag:0},{qe:1313,nmps:34,nlps:31,switchFlag:0},{qe:1089,nmps:35,nlps:32,switchFlag:0},{qe:673,nmps:36,nlps:33,switchFlag:0},{qe:545,nmps:37,nlps:34,switchFlag:0},{qe:321,nmps:38,nlps:35,switchFlag:0},{qe:273,nmps:39,nlps:36,switchFlag:0},{qe:133,nmps:40,nlps:37,switchFlag:0},{qe:73,nmps:41,nlps:38,switchFlag:0},{qe:37,nmps:42,nlps:39,switchFlag:0},{qe:21,nmps:43,nlps:40,switchFlag:0},{qe:9,nmps:44,nlps:41,switchFlag:0},{qe:5,nmps:45,nlps:42,switchFlag:0},{qe:1,nmps:45,nlps:43,switchFlag:0},{qe:22017,nmps:46,nlps:46,switchFlag:0}];t.ArithmeticDecoder=class ArithmeticDecoder{constructor(e,t,r){this.data=e;this.bp=t;this.dataEnd=r;this.chigh=e[t];this.clow=0;this.byteIn();this.chigh=this.chigh<<7&65535|this.clow>>9&127;this.clow=this.clow<<7&65535;this.ct-=7;this.a=32768}byteIn(){const e=this.data;let t=this.bp;if(255===e[t])if(e[t+1]>143){this.clow+=65280;this.ct=8}else{t++;this.clow+=e[t]<<9;this.ct=7;this.bp=t}else{t++;this.clow+=t<this.dataEnd?e[t]<<8:65280;this.ct=8;this.bp=t}if(this.clow>65535){this.chigh+=this.clow>>16;this.clow&=65535}}readBit(e,t){let a=e[t]>>1,n=1&e[t];const i=r[a],s=i.qe;let o,c=this.a-s;if(this.chigh<s)if(c<s){c=s;o=n;a=i.nmps}else{c=s;o=1^n;1===i.switchFlag&&(n=o);a=i.nlps}else{this.chigh-=s;if(0!=(32768&c)){this.a=c;return n}if(c<s){o=1^n;1===i.switchFlag&&(n=o);a=i.nlps}else{o=n;a=i.nmps}}do{0===this.ct&&this.byteIn();c<<=1;this.chigh=this.chigh<<1&65535|this.clow>>15&1;this.clow=this.clow<<1&65535;this.ct--}while(0==(32768&c));this.a=c;e[t]=a<<1|n;return o}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.JpegStream=void 0;var a=r(147),n=r(133),i=r(156),s=r(2);class JpegStream extends a.DecodeStream{constructor(e,t,r){let a;for(;-1!==(a=e.getByte());)if(255===a){e.skip(-1);break}super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=r}get bytes(){return(0,s.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e={decodeTransform:void 0,colorTransform:void 0},t=this.dict.getArray("D","Decode");if(this.forceRGB&&Array.isArray(t)){const r=this.dict.get("BPC","BitsPerComponent")||8,a=t.length,n=new Int32Array(a);let i=!1;const s=(1<<r)-1;for(let e=0;e<a;e+=2){n[e]=256*(t[e+1]-t[e])|0;n[e+1]=t[e]*s|0;256===n[e]&&0===n[e+1]||(i=!0)}i&&(e.decodeTransform=n)}if(this.params instanceof n.Dict){const t=this.params.get("ColorTransform");Number.isInteger(t)&&(e.colorTransform=t)}const r=new i.JpegImage(e);r.parse(this.bytes);const a=r.getData({width:this.drawWidth,height:this.drawHeight,forceRGB:this.forceRGB,isSourcePDF:!0});this.buffer=a;this.bufferLength=a.length;this.eof=!0}}t.JpegStream=JpegStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.JpegImage=void 0;var a=r(2),n=r(134);class JpegError extends a.BaseException{constructor(e){super(`JPEG error: ${e}`,"JpegError")}}class DNLMarkerError extends a.BaseException{constructor(e,t){super(e,"DNLMarkerError");this.scanLines=t}}class EOIMarkerError extends a.BaseException{constructor(e){super(e,"EOIMarkerError")}}const i=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),s=4017,o=799,c=3406,l=2276,h=1567,u=3784,d=5793,f=2896;function buildHuffmanTable(e,t){let r,a,n=0,i=16;for(;i>0&&!e[i-1];)i--;const s=[{children:[],index:0}];let o,c=s[0];for(r=0;r<i;r++){for(a=0;a<e[r];a++){c=s.pop();c.children[c.index]=t[n];for(;c.index>0;)c=s.pop();c.index++;s.push(c);for(;s.length<=r;){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}n++}if(r+1<i){s.push(o={children:[],index:0});c.children[c.index]=o.children;c=o}}return s[0].children}function getBlockBufferOffset(e,t,r){return 64*((e.blocksPerLine+1)*t+r)}function decodeScan(e,t,r,s,o,c,l,h,u){let d=arguments.length>9&&void 0!==arguments[9]&&arguments[9];const f=r.mcusPerLine,g=r.progressive,p=t;let m=0,b=0;function readBit(){if(b>0){b--;return m>>b&1}m=e[t++];if(255===m){const a=e[t++];if(a){if(220===a&&d){t+=2;const a=(0,n.readUint16)(e,t);t+=2;if(a>0&&a!==r.scanLines)throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data",a)}else if(217===a){if(d){const e=x*(8===r.precision?8:0);if(e>0&&Math.round(r.scanLines/e)>=5)throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter",e)}throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data")}throw new JpegError(`unexpected marker ${(m<<8|a).toString(16)}`)}}b=7;return m>>>7}function decodeHuffman(e){let t=e;for(;;){t=t[readBit()];switch(typeof t){case"number":return t;case"object":continue}throw new JpegError("invalid huffman sequence")}}function receive(e){let t=0;for(;e>0;){t=t<<1|readBit();e--}return t}function receiveAndExtend(e){if(1===e)return 1===readBit()?1:-1;const t=receive(e);return t>=1<<e-1?t:t+(-1<<e)+1}function decodeBaseline(e,t){const r=decodeHuffman(e.huffmanTableDC),a=0===r?0:receiveAndExtend(r);e.blockData[t]=e.pred+=a;let n=1;for(;n<64;){const r=decodeHuffman(e.huffmanTableAC),a=15&r,s=r>>4;if(0===a){if(s<15)break;n+=16;continue}n+=s;const o=i[n];e.blockData[t+o]=receiveAndExtend(a);n++}}function decodeDCFirst(e,t){const r=decodeHuffman(e.huffmanTableDC),a=0===r?0:receiveAndExtend(r)<<u;e.blockData[t]=e.pred+=a}function decodeDCSuccessive(e,t){e.blockData[t]|=readBit()<<u}let y=0;function decodeACFirst(e,t){if(y>0){y--;return}let r=c;const a=l;for(;r<=a;){const a=decodeHuffman(e.huffmanTableAC),n=15&a,s=a>>4;if(0===n){if(s<15){y=receive(s)+(1<<s)-1;break}r+=16;continue}r+=s;const o=i[r];e.blockData[t+o]=receiveAndExtend(n)*(1<<u);r++}}let w,S=0;function decodeACSuccessive(e,t){let r=c;const a=l;let n,s,o=0;for(;r<=a;){const a=t+i[r],c=e.blockData[a]<0?-1:1;switch(S){case 0:s=decodeHuffman(e.huffmanTableAC);n=15&s;o=s>>4;if(0===n)if(o<15){y=receive(o)+(1<<o);S=4}else{o=16;S=1}else{if(1!==n)throw new JpegError("invalid ACn encoding");w=receiveAndExtend(n);S=o?2:3}continue;case 1:case 2:if(e.blockData[a])e.blockData[a]+=c*(readBit()<<u);else{o--;0===o&&(S=2===S?3:0)}break;case 3:if(e.blockData[a])e.blockData[a]+=c*(readBit()<<u);else{e.blockData[a]=w<<u;S=0}break;case 4:e.blockData[a]&&(e.blockData[a]+=c*(readBit()<<u))}r++}if(4===S){y--;0===y&&(S=0)}}let x=0;function decodeMcu(e,t,r,a,n){const i=r%f;x=(r/f|0)*e.v+a;const s=i*e.h+n;t(e,getBlockBufferOffset(e,x,s))}function decodeBlock(e,t,r){x=r/e.blocksPerLine|0;const a=r%e.blocksPerLine;t(e,getBlockBufferOffset(e,x,a))}const k=s.length;let C,v,O,T,M,E;E=g?0===c?0===h?decodeDCFirst:decodeDCSuccessive:0===h?decodeACFirst:decodeACSuccessive:decodeBaseline;let D,N,R,L,j=0;N=1===k?s[0].blocksPerLine*s[0].blocksPerColumn:f*r.mcusPerColumn;for(;j<=N;){const r=o?Math.min(N-j,o):N;if(r>0){for(v=0;v<k;v++)s[v].pred=0;y=0;if(1===k){C=s[0];for(M=0;M<r;M++){decodeBlock(C,E,j);j++}}else for(M=0;M<r;M++){for(v=0;v<k;v++){C=s[v];R=C.h;L=C.v;for(O=0;O<L;O++)for(T=0;T<R;T++)decodeMcu(C,E,j,O,T)}j++}}b=0;D=findNextFileMarker(e,t);if(!D)break;if(D.invalid){const e=r>0?"unexpected":"excessive";(0,a.warn)(`decodeScan - ${e} MCU data, current marker is: ${D.invalid}`);t=D.offset}if(!(D.marker>=65488&&D.marker<=65495))break;t+=2}return t-p}function quantizeAndInverse(e,t,r){const a=e.quantizationTable,n=e.blockData;let i,g,p,m,b,y,w,S,x,k,C,v,O,T,M,E,D;if(!a)throw new JpegError("missing required Quantization Table.");for(let e=0;e<64;e+=8){x=n[t+e];k=n[t+e+1];C=n[t+e+2];v=n[t+e+3];O=n[t+e+4];T=n[t+e+5];M=n[t+e+6];E=n[t+e+7];x*=a[e];if(0!=(k|C|v|O|T|M|E)){k*=a[e+1];C*=a[e+2];v*=a[e+3];O*=a[e+4];T*=a[e+5];M*=a[e+6];E*=a[e+7];i=d*x+128>>8;g=d*O+128>>8;p=C;m=M;b=f*(k-E)+128>>8;S=f*(k+E)+128>>8;y=v<<4;w=T<<4;i=i+g+1>>1;g=i-g;D=p*u+m*h+128>>8;p=p*h-m*u+128>>8;m=D;b=b+w+1>>1;w=b-w;S=S+y+1>>1;y=S-y;i=i+m+1>>1;m=i-m;g=g+p+1>>1;p=g-p;D=b*l+S*c+2048>>12;b=b*c-S*l+2048>>12;S=D;D=y*o+w*s+2048>>12;y=y*s-w*o+2048>>12;w=D;r[e]=i+S;r[e+7]=i-S;r[e+1]=g+w;r[e+6]=g-w;r[e+2]=p+y;r[e+5]=p-y;r[e+3]=m+b;r[e+4]=m-b}else{D=d*x+512>>10;r[e]=D;r[e+1]=D;r[e+2]=D;r[e+3]=D;r[e+4]=D;r[e+5]=D;r[e+6]=D;r[e+7]=D}}for(let e=0;e<8;++e){x=r[e];k=r[e+8];C=r[e+16];v=r[e+24];O=r[e+32];T=r[e+40];M=r[e+48];E=r[e+56];if(0!=(k|C|v|O|T|M|E)){i=d*x+2048>>12;g=d*O+2048>>12;p=C;m=M;b=f*(k-E)+2048>>12;S=f*(k+E)+2048>>12;y=v;w=T;i=4112+(i+g+1>>1);g=i-g;D=p*u+m*h+2048>>12;p=p*h-m*u+2048>>12;m=D;b=b+w+1>>1;w=b-w;S=S+y+1>>1;y=S-y;i=i+m+1>>1;m=i-m;g=g+p+1>>1;p=g-p;D=b*l+S*c+2048>>12;b=b*c-S*l+2048>>12;S=D;D=y*o+w*s+2048>>12;y=y*s-w*o+2048>>12;w=D;x=i+S;E=i-S;k=g+w;M=g-w;C=p+y;T=p-y;v=m+b;O=m-b;x<16?x=0:x>=4080?x=255:x>>=4;k<16?k=0:k>=4080?k=255:k>>=4;C<16?C=0:C>=4080?C=255:C>>=4;v<16?v=0:v>=4080?v=255:v>>=4;O<16?O=0:O>=4080?O=255:O>>=4;T<16?T=0:T>=4080?T=255:T>>=4;M<16?M=0:M>=4080?M=255:M>>=4;E<16?E=0:E>=4080?E=255:E>>=4;n[t+e]=x;n[t+e+8]=k;n[t+e+16]=C;n[t+e+24]=v;n[t+e+32]=O;n[t+e+40]=T;n[t+e+48]=M;n[t+e+56]=E}else{D=d*x+8192>>14;D=D<-2040?0:D>=2024?255:D+2056>>4;n[t+e]=D;n[t+e+8]=D;n[t+e+16]=D;n[t+e+24]=D;n[t+e+32]=D;n[t+e+40]=D;n[t+e+48]=D;n[t+e+56]=D}}}function buildComponentData(e,t){const r=t.blocksPerLine,a=t.blocksPerColumn,n=new Int16Array(64);for(let e=0;e<a;e++)for(let a=0;a<r;a++){quantizeAndInverse(t,getBlockBufferOffset(t,e,a),n)}return t.blockData}function findNextFileMarker(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;const a=e.length-1;let i=r<t?r:t;if(t>=a)return null;const s=(0,n.readUint16)(e,t);if(s>=65472&&s<=65534)return{invalid:null,marker:s,offset:t};let o=(0,n.readUint16)(e,i);for(;!(o>=65472&&o<=65534);){if(++i>=a)return null;o=(0,n.readUint16)(e,i)}return{invalid:s.toString(16),marker:o,offset:i}}t.JpegImage=class JpegImage{constructor(){let{decodeTransform:e=null,colorTransform:t=-1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._decodeTransform=e;this._colorTransform=t}parse(e){let{dnlScanLines:t=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function readDataBlock(){const t=(0,n.readUint16)(e,o);o+=2;let r=o+t-2;const i=findNextFileMarker(e,r,o);if(i&&i.invalid){(0,a.warn)("readDataBlock - incorrect length, current marker is: "+i.invalid);r=i.offset}const s=e.subarray(o,r);o+=s.length;return s}function prepareComponents(e){const t=Math.ceil(e.samplesPerLine/8/e.maxH),r=Math.ceil(e.scanLines/8/e.maxV);for(let a=0,n=e.components.length;a<n;a++){const n=e.components[a],i=Math.ceil(Math.ceil(e.samplesPerLine/8)*n.h/e.maxH),s=Math.ceil(Math.ceil(e.scanLines/8)*n.v/e.maxV),o=t*n.h,c=64*(r*n.v)*(o+1);n.blockData=new Int16Array(c);n.blocksPerLine=i;n.blocksPerColumn=s}e.mcusPerLine=t;e.mcusPerColumn=r}let r,s,o=0,c=null,l=null,h=0;const u=[],d=[],f=[];let g=(0,n.readUint16)(e,o);o+=2;if(65496!==g)throw new JpegError("SOI not found");g=(0,n.readUint16)(e,o);o+=2;e:for(;65497!==g;){let p,m,b;switch(g){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:const y=readDataBlock();65504===g&&74===y[0]&&70===y[1]&&73===y[2]&&70===y[3]&&0===y[4]&&(c={version:{major:y[5],minor:y[6]},densityUnits:y[7],xDensity:y[8]<<8|y[9],yDensity:y[10]<<8|y[11],thumbWidth:y[12],thumbHeight:y[13],thumbData:y.subarray(14,14+3*y[12]*y[13])});65518===g&&65===y[0]&&100===y[1]&&111===y[2]&&98===y[3]&&101===y[4]&&(l={version:y[5]<<8|y[6],flags0:y[7]<<8|y[8],flags1:y[9]<<8|y[10],transformCode:y[11]});break;case 65499:const w=(0,n.readUint16)(e,o);o+=2;const S=w+o-2;let x;for(;o<S;){const t=e[o++],r=new Uint16Array(64);if(t>>4==0)for(m=0;m<64;m++){x=i[m];r[x]=e[o++]}else{if(t>>4!=1)throw new JpegError("DQT - invalid table spec");for(m=0;m<64;m++){x=i[m];r[x]=(0,n.readUint16)(e,o);o+=2}}u[15&t]=r}break;case 65472:case 65473:case 65474:if(r)throw new JpegError("Only single frame JPEGs supported");o+=2;r={};r.extended=65473===g;r.progressive=65474===g;r.precision=e[o++];const k=(0,n.readUint16)(e,o);o+=2;r.scanLines=t||k;r.samplesPerLine=(0,n.readUint16)(e,o);o+=2;r.components=[];r.componentIds={};const C=e[o++];let v=0,O=0;for(p=0;p<C;p++){const t=e[o],a=e[o+1]>>4,n=15&e[o+1];v<a&&(v=a);O<n&&(O=n);const i=e[o+2];b=r.components.push({h:a,v:n,quantizationId:i,quantizationTable:null});r.componentIds[t]=b-1;o+=3}r.maxH=v;r.maxV=O;prepareComponents(r);break;case 65476:const T=(0,n.readUint16)(e,o);o+=2;for(p=2;p<T;){const t=e[o++],r=new Uint8Array(16);let a=0;for(m=0;m<16;m++,o++)a+=r[m]=e[o];const n=new Uint8Array(a);for(m=0;m<a;m++,o++)n[m]=e[o];p+=17+a;(t>>4==0?f:d)[15&t]=buildHuffmanTable(r,n)}break;case 65501:o+=2;s=(0,n.readUint16)(e,o);o+=2;break;case 65498:const M=1==++h&&!t;o+=2;const E=e[o++],D=[];for(p=0;p<E;p++){const t=e[o++],a=r.componentIds[t],n=r.components[a];n.index=t;const i=e[o++];n.huffmanTableDC=f[i>>4];n.huffmanTableAC=d[15&i];D.push(n)}const N=e[o++],R=e[o++],L=e[o++];try{const t=decodeScan(e,o,r,D,s,N,R,L>>4,15&L,M);o+=t}catch(t){if(t instanceof DNLMarkerError){(0,a.warn)(`${t.message} -- attempting to re-parse the JPEG image.`);return this.parse(e,{dnlScanLines:t.scanLines})}if(t instanceof EOIMarkerError){(0,a.warn)(`${t.message} -- ignoring the rest of the image data.`);break e}throw t}break;case 65500:o+=4;break;case 65535:255!==e[o]&&o--;break;default:const j=findNextFileMarker(e,o-2,o-3);if(j&&j.invalid){(0,a.warn)("JpegImage.parse - unexpected data, current marker is: "+j.invalid);o=j.offset;break}if(!j||o>=e.length-1){(0,a.warn)("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");break e}throw new JpegError("JpegImage.parse - unknown marker: "+g.toString(16))}g=(0,n.readUint16)(e,o);o+=2}this.width=r.samplesPerLine;this.height=r.scanLines;this.jfif=c;this.adobe=l;this.components=[];for(let e=0,t=r.components.length;e<t;e++){const t=r.components[e],a=u[t.quantizationId];a&&(t.quantizationTable=a);this.components.push({index:t.index,output:buildComponentData(0,t),scaleX:t.h/r.maxH,scaleY:t.v/r.maxV,blocksPerLine:t.blocksPerLine,blocksPerColumn:t.blocksPerColumn})}this.numComponents=this.components.length}_getLinearizedBlockData(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=this.width/e,n=this.height/t;let i,s,o,c,l,h,u,d,f,g,p,m=0;const b=this.components.length,y=e*t*b,w=new Uint8ClampedArray(y),S=new Uint32Array(e),x=4294967288;let k;for(u=0;u<b;u++){i=this.components[u];s=i.scaleX*a;o=i.scaleY*n;m=u;p=i.output;c=i.blocksPerLine+1<<3;if(s!==k){for(l=0;l<e;l++){d=0|l*s;S[l]=(d&x)<<3|7&d}k=s}for(h=0;h<t;h++){d=0|h*o;g=c*(d&x)|(7&d)<<3;for(l=0;l<e;l++){w[m]=p[g+S[l]];m+=b}}}let C=this._decodeTransform;r||4!==b||C||(C=new Int32Array([-256,255,-256,255,-256,255,-256,255]));if(C)for(u=0;u<y;)for(d=0,f=0;d<b;d++,u++,f+=2)w[u]=(w[u]*C[f]>>8)+C[f+1];return w}get _isColorConversionNeeded(){return this.adobe?!!this.adobe.transformCode:3===this.numComponents?0!==this._colorTransform&&(82!==this.components[0].index||71!==this.components[1].index||66!==this.components[2].index):1===this._colorTransform}_convertYccToRgb(e){let t,r,a;for(let n=0,i=e.length;n<i;n+=3){t=e[n];r=e[n+1];a=e[n+2];e[n]=t-179.456+1.402*a;e[n+1]=t+135.459-.344*r-.714*a;e[n+2]=t-226.816+1.772*r}return e}_convertYcckToRgb(e){let t,r,a,n,i=0;for(let s=0,o=e.length;s<o;s+=4){t=e[s];r=e[s+1];a=e[s+2];n=e[s+3];e[i++]=r*(-660635669420364e-19*r+.000437130475926232*a-54080610064599e-18*t+.00048449797120281*n-.154362151871126)-122.67195406894+a*(-.000957964378445773*a+.000817076911346625*t-.00477271405408747*n+1.53380253221734)+t*(.000961250184130688*t-.00266257332283933*n+.48357088451265)+n*(-.000336197177618394*n+.484791561490776);e[i++]=107.268039397724+r*(219927104525741e-19*r-.000640992018297945*a+.000659397001245577*t+.000426105652938837*n-.176491792462875)+a*(-.000778269941513683*a+.00130872261408275*t+.000770482631801132*n-.151051492775562)+t*(.00126935368114843*t-.00265090189010898*n+.25802910206845)+n*(-.000318913117588328*n-.213742400323665);e[i++]=r*(-.000570115196973677*r-263409051004589e-19*a+.0020741088115012*t-.00288260236853442*n+.814272968359295)-20.810012546947+a*(-153496057440975e-19*a-.000132689043961446*t+.000560833691242812*n-.195152027534049)+t*(.00174418132927582*t-.00255243321439347*n+.116935020465145)+n*(-.000343531996510555*n+.24165260232407)}return e.subarray(0,i)}_convertYcckToCmyk(e){let t,r,a;for(let n=0,i=e.length;n<i;n+=4){t=e[n];r=e[n+1];a=e[n+2];e[n]=434.456-t-1.402*a;e[n+1]=119.541-t+.344*r+.714*a;e[n+2]=481.816-t-1.772*r}return e}_convertCmykToRgb(e){let t,r,a,n,i=0;for(let s=0,o=e.length;s<o;s+=4){t=e[s];r=e[s+1];a=e[s+2];n=e[s+3];e[i++]=255+t*(-6747147073602441e-20*t+.0008379262121013727*r+.0002894718188643294*a+.003264231057537806*n-1.1185611867203937)+r*(26374107616089405e-21*r-8626949158638572e-20*a-.0002748769067499491*n-.02155688794978967)+a*(-3878099212869363e-20*a-.0003267808279485286*n+.0686742238595345)-n*(.0003361971776183937*n+.7430659151342254);e[i++]=255+t*(.00013596372813588848*t+.000924537132573585*r+.00010567359618683593*a+.0004791864687436512*n-.3109689587515875)+r*(-.00023545346108370344*r+.0002702845253534714*a+.0020200308977307156*n-.7488052167015494)+a*(6834815998235662e-20*a+.00015168452363460973*n-.09751927774728933)-n*(.0003189131175883281*n+.7364883807733168);e[i++]=255+t*(13598650411385307e-21*t+.00012423956175490851*r+.0004751985097583589*a-36729317476630422e-22*n-.05562186980264034)+r*(.00016141380598724676*r+.0009692239130725186*a+.0007782692450036253*n-.44015232367526463)+a*(5.068882914068769e-7*a+.0017778369011375071*n-.7591454649749609)-n*(.0003435319965105553*n+.7063770186160144)}return e.subarray(0,i)}getData(e){let{width:t,height:r,forceRGB:a=!1,isSourcePDF:n=!1}=e;if(this.numComponents>4)throw new JpegError("Unsupported color mode");const i=this._getLinearizedBlockData(t,r,n);if(1===this.numComponents&&a){const e=i.length,t=new Uint8ClampedArray(3*e);let r=0;for(let a=0;a<e;a++){const e=i[a];t[r++]=e;t[r++]=e;t[r++]=e}return t}if(3===this.numComponents&&this._isColorConversionNeeded)return this._convertYccToRgb(i);if(4===this.numComponents){if(this._isColorConversionNeeded)return a?this._convertYcckToRgb(i):this._convertYcckToCmyk(i);if(a)return this._convertCmykToRgb(i)}return i}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.JpxStream=void 0;var a=r(147),n=r(158),i=r(2);class JpxStream extends a.DecodeStream{constructor(e,t,r){super(t);this.stream=e;this.dict=e.dict;this.maybeLength=t;this.params=r}get bytes(){return(0,i.shadow)(this,"bytes",this.stream.getBytes(this.maybeLength))}ensureBuffer(e){}readBlock(){if(this.eof)return;const e=new n.JpxImage;e.parse(this.bytes);const t=e.width,r=e.height,a=e.componentsCount,i=e.tiles.length;if(1===i)this.buffer=e.tiles[0].items;else{const n=new Uint8ClampedArray(t*r*a);for(let r=0;r<i;r++){const i=e.tiles[r],s=i.width,o=i.height,c=i.left,l=i.top,h=i.items;let u=0,d=(t*l+c)*a;const f=t*a,g=s*a;for(let e=0;e<o;e++){const e=h.subarray(u,u+g);n.set(e,d);u+=g;d+=f}}this.buffer=n}this.bufferLength=this.buffer.length;this.eof=!0}}t.JpxStream=JpxStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.JpxImage=void 0;var a=r(2),n=r(134),i=r(154);class JpxError extends a.BaseException{constructor(e){super(`JPX error: ${e}`,"JpxError")}}const s={LL:0,LH:1,HL:1,HH:2};t.JpxImage=class JpxImage{constructor(){this.failOnCorruptedImage=!1}parse(e){if(65359===(0,n.readUint16)(e,0)){this.parseCodestream(e,0,e.length);return}const t=e.length;let r=0;for(;r<t;){let i=8,s=(0,n.readUint32)(e,r);const o=(0,n.readUint32)(e,r+4);r+=i;if(1===s){s=4294967296*(0,n.readUint32)(e,r)+(0,n.readUint32)(e,r+4);r+=8;i+=8}0===s&&(s=t-r+i);if(s<i)throw new JpxError("Invalid box field size");const c=s-i;let l=!0;switch(o){case 1785737832:l=!1;break;case 1668246642:const t=e[r];if(1===t){const t=(0,n.readUint32)(e,r+3);switch(t){case 16:case 17:case 18:break;default:(0,a.warn)("Unknown colorspace "+t)}}else 2===t&&(0,a.info)("ICC profile not supported");break;case 1785737827:this.parseCodestream(e,r,r+c);break;case 1783636e3:218793738!==(0,n.readUint32)(e,r)&&(0,a.warn)("Invalid JP2 signature");break;case 1783634458:case 1718909296:case 1920099697:case 1919251232:case 1768449138:break;default:const i=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);(0,a.warn)(`Unsupported header type ${o} (${i}).`)}l&&(r+=c)}}parseImageProperties(e){let t=e.getByte();for(;t>=0;){const r=t;t=e.getByte();if(65361===(r<<8|t)){e.skip(4);const t=e.getInt32()>>>0,r=e.getInt32()>>>0,a=e.getInt32()>>>0,n=e.getInt32()>>>0;e.skip(16);const i=e.getUint16();this.width=t-a;this.height=r-n;this.componentsCount=i;this.bitsPerComponent=8;return}}throw new JpxError("No size marker found in JPX stream")}parseCodestream(e,t,r){const i={};let s=!1;try{let o=t;for(;o+1<r;){const t=(0,n.readUint16)(e,o);o+=2;let r,c,l,h,u,d,f=0;switch(t){case 65359:i.mainHeader=!0;break;case 65497:break;case 65361:f=(0,n.readUint16)(e,o);const g={};g.Xsiz=(0,n.readUint32)(e,o+4);g.Ysiz=(0,n.readUint32)(e,o+8);g.XOsiz=(0,n.readUint32)(e,o+12);g.YOsiz=(0,n.readUint32)(e,o+16);g.XTsiz=(0,n.readUint32)(e,o+20);g.YTsiz=(0,n.readUint32)(e,o+24);g.XTOsiz=(0,n.readUint32)(e,o+28);g.YTOsiz=(0,n.readUint32)(e,o+32);const p=(0,n.readUint16)(e,o+36);g.Csiz=p;const m=[];r=o+38;for(let t=0;t<p;t++){const t={precision:1+(127&e[r]),isSigned:!!(128&e[r]),XRsiz:e[r+1],YRsiz:e[r+2]};r+=3;calculateComponentDimensions(t,g);m.push(t)}i.SIZ=g;i.components=m;calculateTileGrids(i,m);i.QCC=[];i.COC=[];break;case 65372:f=(0,n.readUint16)(e,o);const b={};r=o+2;c=e[r++];switch(31&c){case 0:h=8;u=!0;break;case 1:h=16;u=!1;break;case 2:h=16;u=!0;break;default:throw new Error("Invalid SQcd value "+c)}b.noQuantization=8===h;b.scalarExpounded=u;b.guardBits=c>>5;l=[];for(;r<f+o;){const t={};if(8===h){t.epsilon=e[r++]>>3;t.mu=0}else{t.epsilon=e[r]>>3;t.mu=(7&e[r])<<8|e[r+1];r+=2}l.push(t)}b.SPqcds=l;if(i.mainHeader)i.QCD=b;else{i.currentTile.QCD=b;i.currentTile.QCC=[]}break;case 65373:f=(0,n.readUint16)(e,o);const y={};r=o+2;let w;if(i.SIZ.Csiz<257)w=e[r++];else{w=(0,n.readUint16)(e,r);r+=2}c=e[r++];switch(31&c){case 0:h=8;u=!0;break;case 1:h=16;u=!1;break;case 2:h=16;u=!0;break;default:throw new Error("Invalid SQcd value "+c)}y.noQuantization=8===h;y.scalarExpounded=u;y.guardBits=c>>5;l=[];for(;r<f+o;){const t={};if(8===h){t.epsilon=e[r++]>>3;t.mu=0}else{t.epsilon=e[r]>>3;t.mu=(7&e[r])<<8|e[r+1];r+=2}l.push(t)}y.SPqcds=l;i.mainHeader?i.QCC[w]=y:i.currentTile.QCC[w]=y;break;case 65362:f=(0,n.readUint16)(e,o);const S={};r=o+2;const x=e[r++];S.entropyCoderWithCustomPrecincts=!!(1&x);S.sopMarkerUsed=!!(2&x);S.ephMarkerUsed=!!(4&x);S.progressionOrder=e[r++];S.layersCount=(0,n.readUint16)(e,r);r+=2;S.multipleComponentTransform=e[r++];S.decompositionLevelsCount=e[r++];S.xcb=2+(15&e[r++]);S.ycb=2+(15&e[r++]);const k=e[r++];S.selectiveArithmeticCodingBypass=!!(1&k);S.resetContextProbabilities=!!(2&k);S.terminationOnEachCodingPass=!!(4&k);S.verticallyStripe=!!(8&k);S.predictableTermination=!!(16&k);S.segmentationSymbolUsed=!!(32&k);S.reversibleTransformation=e[r++];if(S.entropyCoderWithCustomPrecincts){const t=[];for(;r<f+o;){const a=e[r++];t.push({PPx:15&a,PPy:a>>4})}S.precinctsSizes=t}const C=[];S.selectiveArithmeticCodingBypass&&C.push("selectiveArithmeticCodingBypass");S.terminationOnEachCodingPass&&C.push("terminationOnEachCodingPass");S.verticallyStripe&&C.push("verticallyStripe");S.predictableTermination&&C.push("predictableTermination");if(C.length>0){s=!0;(0,a.warn)(`JPX: Unsupported COD options (${C.join(", ")}).`)}if(i.mainHeader)i.COD=S;else{i.currentTile.COD=S;i.currentTile.COC=[]}break;case 65424:f=(0,n.readUint16)(e,o);d={};d.index=(0,n.readUint16)(e,o+2);d.length=(0,n.readUint32)(e,o+4);d.dataEnd=d.length+o-2;d.partIndex=e[o+8];d.partsCount=e[o+9];i.mainHeader=!1;if(0===d.partIndex){d.COD=i.COD;d.COC=i.COC.slice(0);d.QCD=i.QCD;d.QCC=i.QCC.slice(0)}i.currentTile=d;break;case 65427:d=i.currentTile;if(0===d.partIndex){initializeTile(i,d.index);buildPackets(i)}f=d.dataEnd-o;parseTilePackets(i,e,o,f);break;case 65363:(0,a.warn)("JPX: Codestream code 0xFF53 (COC) is not implemented.");case 65365:case 65367:case 65368:case 65380:f=(0,n.readUint16)(e,o);break;default:throw new Error("Unknown codestream code: "+t.toString(16))}o+=f}}catch(e){if(s||this.failOnCorruptedImage)throw new JpxError(e.message);(0,a.warn)(`JPX: Trying to recover from: "${e.message}".`)}this.tiles=function transformComponents(e){const t=e.SIZ,r=e.components,a=t.Csiz,n=[];for(let t=0,i=e.tiles.length;t<i;t++){const i=e.tiles[t],s=[];for(let t=0;t<a;t++)s[t]=transformTile(e,i,t);const o=s[0],c=new Uint8ClampedArray(o.items.length*a),l={left:o.left,top:o.top,width:o.width,height:o.height,items:c};let h,u,d,f,g,p,m,b=0;if(i.codingStyleDefaultParameters.multipleComponentTransform){const e=4===a,t=s[0].items,n=s[1].items,o=s[2].items,l=e?s[3].items:null;h=r[0].precision-8;u=.5+(128<<h);const y=i.components[0],w=a-3;f=t.length;if(y.codingStyleParameters.reversibleTransformation)for(d=0;d<f;d++,b+=w){g=t[d]+u;p=n[d];m=o[d];const e=g-(m+p>>2);c[b++]=e+m>>h;c[b++]=e>>h;c[b++]=e+p>>h}else for(d=0;d<f;d++,b+=w){g=t[d]+u;p=n[d];m=o[d];c[b++]=g+1.402*m>>h;c[b++]=g-.34413*p-.71414*m>>h;c[b++]=g+1.772*p>>h}if(e)for(d=0,b=3;d<f;d++,b+=4)c[b]=l[d]+u>>h}else for(let e=0;e<a;e++){const t=s[e].items;h=r[e].precision-8;u=.5+(128<<h);for(b=e,d=0,f=t.length;d<f;d++){c[b]=t[d]+u>>h;b+=a}}n.push(l)}return n}(i);this.width=i.SIZ.Xsiz-i.SIZ.XOsiz;this.height=i.SIZ.Ysiz-i.SIZ.YOsiz;this.componentsCount=i.SIZ.Csiz}};function calculateComponentDimensions(e,t){e.x0=Math.ceil(t.XOsiz/e.XRsiz);e.x1=Math.ceil(t.Xsiz/e.XRsiz);e.y0=Math.ceil(t.YOsiz/e.YRsiz);e.y1=Math.ceil(t.Ysiz/e.YRsiz);e.width=e.x1-e.x0;e.height=e.y1-e.y0}function calculateTileGrids(e,t){const r=e.SIZ,a=[];let n;const i=Math.ceil((r.Xsiz-r.XTOsiz)/r.XTsiz),s=Math.ceil((r.Ysiz-r.YTOsiz)/r.YTsiz);for(let e=0;e<s;e++)for(let t=0;t<i;t++){n={};n.tx0=Math.max(r.XTOsiz+t*r.XTsiz,r.XOsiz);n.ty0=Math.max(r.YTOsiz+e*r.YTsiz,r.YOsiz);n.tx1=Math.min(r.XTOsiz+(t+1)*r.XTsiz,r.Xsiz);n.ty1=Math.min(r.YTOsiz+(e+1)*r.YTsiz,r.Ysiz);n.width=n.tx1-n.tx0;n.height=n.ty1-n.ty0;n.components=[];a.push(n)}e.tiles=a;for(let e=0,i=r.Csiz;e<i;e++){const r=t[e];for(let t=0,i=a.length;t<i;t++){const i={};n=a[t];i.tcx0=Math.ceil(n.tx0/r.XRsiz);i.tcy0=Math.ceil(n.ty0/r.YRsiz);i.tcx1=Math.ceil(n.tx1/r.XRsiz);i.tcy1=Math.ceil(n.ty1/r.YRsiz);i.width=i.tcx1-i.tcx0;i.height=i.tcy1-i.tcy0;n.components[e]=i}}}function getBlocksDimensions(e,t,r){const a=t.codingStyleParameters,n={};if(a.entropyCoderWithCustomPrecincts){n.PPx=a.precinctsSizes[r].PPx;n.PPy=a.precinctsSizes[r].PPy}else{n.PPx=15;n.PPy=15}n.xcb_=r>0?Math.min(a.xcb,n.PPx-1):Math.min(a.xcb,n.PPx);n.ycb_=r>0?Math.min(a.ycb,n.PPy-1):Math.min(a.ycb,n.PPy);return n}function buildPrecincts(e,t,r){const a=1<<r.PPx,n=1<<r.PPy,i=0===t.resLevel,s=1<<r.PPx+(i?0:-1),o=1<<r.PPy+(i?0:-1),c=t.trx1>t.trx0?Math.ceil(t.trx1/a)-Math.floor(t.trx0/a):0,l=t.try1>t.try0?Math.ceil(t.try1/n)-Math.floor(t.try0/n):0,h=c*l;t.precinctParameters={precinctWidth:a,precinctHeight:n,numprecinctswide:c,numprecinctshigh:l,numprecincts:h,precinctWidthInSubband:s,precinctHeightInSubband:o}}function buildCodeblocks(e,t,r){const a=r.xcb_,n=r.ycb_,i=1<<a,s=1<<n,o=t.tbx0>>a,c=t.tby0>>n,l=t.tbx1+i-1>>a,h=t.tby1+s-1>>n,u=t.resolution.precinctParameters,d=[],f=[];let g,p,m,b;for(p=c;p<h;p++)for(g=o;g<l;g++){m={cbx:g,cby:p,tbx0:i*g,tby0:s*p,tbx1:i*(g+1),tby1:s*(p+1)};m.tbx0_=Math.max(t.tbx0,m.tbx0);m.tby0_=Math.max(t.tby0,m.tby0);m.tbx1_=Math.min(t.tbx1,m.tbx1);m.tby1_=Math.min(t.tby1,m.tby1);b=Math.floor((m.tbx0_-t.tbx0)/u.precinctWidthInSubband)+Math.floor((m.tby0_-t.tby0)/u.precinctHeightInSubband)*u.numprecinctswide;m.precinctNumber=b;m.subbandType=t.type;m.Lblock=3;if(m.tbx1_<=m.tbx0_||m.tby1_<=m.tby0_)continue;d.push(m);let e=f[b];if(void 0!==e){g<e.cbxMin?e.cbxMin=g:g>e.cbxMax&&(e.cbxMax=g);p<e.cbyMin?e.cbxMin=p:p>e.cbyMax&&(e.cbyMax=p)}else f[b]=e={cbxMin:g,cbyMin:p,cbxMax:g,cbyMax:p};m.precinct=e}t.codeblockParameters={codeblockWidth:a,codeblockHeight:n,numcodeblockwide:l-o+1,numcodeblockhigh:h-c+1};t.codeblocks=d;t.precincts=f}function createPacket(e,t,r){const a=[],n=e.subbands;for(let e=0,r=n.length;e<r;e++){const r=n[e].codeblocks;for(let e=0,n=r.length;e<n;e++){const n=r[e];n.precinctNumber===t&&a.push(n)}}return{layerNumber:r,codeblocks:a}}function LayerResolutionComponentPositionIterator(e){const t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],n=a.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s=0;for(let e=0;e<i;e++)s=Math.max(s,a.components[e].codingStyleParameters.decompositionLevelsCount);let o=0,c=0,l=0,h=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<n;o++){for(;c<=s;c++){for(;l<i;l++){const e=a.components[l];if(c>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[c],r=t.precinctParameters.numprecincts;for(;h<r;){const e=createPacket(t,h,o);h++;return e}h=0}l=0}c=0}throw new JpxError("Out of packets")}}function ResolutionLayerComponentPositionIterator(e){const t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],n=a.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s=0;for(let e=0;e<i;e++)s=Math.max(s,a.components[e].codingStyleParameters.decompositionLevelsCount);let o=0,c=0,l=0,h=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=s;o++){for(;c<n;c++){for(;l<i;l++){const e=a.components[l];if(o>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[o],r=t.precinctParameters.numprecincts;for(;h<r;){const e=createPacket(t,h,c);h++;return e}h=0}l=0}c=0}throw new JpxError("Out of packets")}}function ResolutionPositionComponentLayerIterator(e){const t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],n=a.codingStyleDefaultParameters.layersCount,i=t.Csiz;let s,o,c,l,h=0;for(c=0;c<i;c++){const e=a.components[c];h=Math.max(h,e.codingStyleParameters.decompositionLevelsCount)}const u=new Int32Array(h+1);for(o=0;o<=h;++o){let e=0;for(c=0;c<i;++c){const t=a.components[c].resolutions;o<t.length&&(e=Math.max(e,t[o].precinctParameters.numprecincts))}u[o]=e}s=0;o=0;c=0;l=0;this.nextPacket=function JpxImage_nextPacket(){for(;o<=h;o++){for(;l<u[o];l++){for(;c<i;c++){const e=a.components[c];if(o>e.codingStyleParameters.decompositionLevelsCount)continue;const t=e.resolutions[o],r=t.precinctParameters.numprecincts;if(!(l>=r)){for(;s<n;){const e=createPacket(t,l,s);s++;return e}s=0}}c=0}l=0}throw new JpxError("Out of packets")}}function PositionComponentResolutionLayerIterator(e){const t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],n=a.codingStyleDefaultParameters.layersCount,i=t.Csiz,s=getPrecinctSizesInImageScale(a),o=s;let c=0,l=0,h=0,u=0,d=0;this.nextPacket=function JpxImage_nextPacket(){for(;d<o.maxNumHigh;d++){for(;u<o.maxNumWide;u++){for(;h<i;h++){const e=a.components[h],t=e.codingStyleParameters.decompositionLevelsCount;for(;l<=t;l++){const t=e.resolutions[l],r=s.components[h].resolutions[l],a=getPrecinctIndexIfExist(u,d,r,o,t);if(null!==a){for(;c<n;){const e=createPacket(t,a,c);c++;return e}c=0}}l=0}h=0}u=0}throw new JpxError("Out of packets")}}function ComponentPositionResolutionLayerIterator(e){const t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],n=a.codingStyleDefaultParameters.layersCount,i=t.Csiz,s=getPrecinctSizesInImageScale(a);let o=0,c=0,l=0,h=0,u=0;this.nextPacket=function JpxImage_nextPacket(){for(;l<i;++l){const e=a.components[l],t=s.components[l],r=e.codingStyleParameters.decompositionLevelsCount;for(;u<t.maxNumHigh;u++){for(;h<t.maxNumWide;h++){for(;c<=r;c++){const r=e.resolutions[c],a=t.resolutions[c],i=getPrecinctIndexIfExist(h,u,a,t,r);if(null!==i){for(;o<n;){const e=createPacket(r,i,o);o++;return e}o=0}}c=0}h=0}u=0}throw new JpxError("Out of packets")}}function getPrecinctIndexIfExist(e,t,r,a,n){const i=e*a.minWidth,s=t*a.minHeight;if(i%r.width!=0||s%r.height!=0)return null;const o=s/r.width*n.precinctParameters.numprecinctswide;return i/r.height+o}function getPrecinctSizesInImageScale(e){const t=e.components.length;let r=Number.MAX_VALUE,a=Number.MAX_VALUE,n=0,i=0;const s=new Array(t);for(let o=0;o<t;o++){const t=e.components[o],c=t.codingStyleParameters.decompositionLevelsCount,l=new Array(c+1);let h=Number.MAX_VALUE,u=Number.MAX_VALUE,d=0,f=0,g=1;for(let e=c;e>=0;--e){const r=t.resolutions[e],a=g*r.precinctParameters.precinctWidth,n=g*r.precinctParameters.precinctHeight;h=Math.min(h,a);u=Math.min(u,n);d=Math.max(d,r.precinctParameters.numprecinctswide);f=Math.max(f,r.precinctParameters.numprecinctshigh);l[e]={width:a,height:n};g<<=1}r=Math.min(r,h);a=Math.min(a,u);n=Math.max(n,d);i=Math.max(i,f);s[o]={resolutions:l,minWidth:h,minHeight:u,maxNumWide:d,maxNumHigh:f}}return{components:s,minWidth:r,minHeight:a,maxNumWide:n,maxNumHigh:i}}function buildPackets(e){const t=e.SIZ,r=e.currentTile.index,a=e.tiles[r],n=t.Csiz;for(let e=0;e<n;e++){const t=a.components[e],r=t.codingStyleParameters.decompositionLevelsCount,n=[],i=[];for(let e=0;e<=r;e++){const a=getBlocksDimensions(0,t,e),s={},o=1<<r-e;s.trx0=Math.ceil(t.tcx0/o);s.try0=Math.ceil(t.tcy0/o);s.trx1=Math.ceil(t.tcx1/o);s.try1=Math.ceil(t.tcy1/o);s.resLevel=e;buildPrecincts(0,s,a);n.push(s);let c;if(0===e){c={};c.type="LL";c.tbx0=Math.ceil(t.tcx0/o);c.tby0=Math.ceil(t.tcy0/o);c.tbx1=Math.ceil(t.tcx1/o);c.tby1=Math.ceil(t.tcy1/o);c.resolution=s;buildCodeblocks(0,c,a);i.push(c);s.subbands=[c]}else{const n=1<<r-e+1,o=[];c={};c.type="HL";c.tbx0=Math.ceil(t.tcx0/n-.5);c.tby0=Math.ceil(t.tcy0/n);c.tbx1=Math.ceil(t.tcx1/n-.5);c.tby1=Math.ceil(t.tcy1/n);c.resolution=s;buildCodeblocks(0,c,a);i.push(c);o.push(c);c={};c.type="LH";c.tbx0=Math.ceil(t.tcx0/n);c.tby0=Math.ceil(t.tcy0/n-.5);c.tbx1=Math.ceil(t.tcx1/n);c.tby1=Math.ceil(t.tcy1/n-.5);c.resolution=s;buildCodeblocks(0,c,a);i.push(c);o.push(c);c={};c.type="HH";c.tbx0=Math.ceil(t.tcx0/n-.5);c.tby0=Math.ceil(t.tcy0/n-.5);c.tbx1=Math.ceil(t.tcx1/n-.5);c.tby1=Math.ceil(t.tcy1/n-.5);c.resolution=s;buildCodeblocks(0,c,a);i.push(c);o.push(c);s.subbands=o}}t.resolutions=n;t.subbands=i}const i=a.codingStyleDefaultParameters.progressionOrder;switch(i){case 0:a.packetsIterator=new LayerResolutionComponentPositionIterator(e);break;case 1:a.packetsIterator=new ResolutionLayerComponentPositionIterator(e);break;case 2:a.packetsIterator=new ResolutionPositionComponentLayerIterator(e);break;case 3:a.packetsIterator=new PositionComponentResolutionLayerIterator(e);break;case 4:a.packetsIterator=new ComponentPositionResolutionLayerIterator(e);break;default:throw new JpxError(`Unsupported progression order ${i}`)}}function parseTilePackets(e,t,r,a){let i,s=0,o=0,c=!1;function readBits(e){for(;o<e;){const e=t[r+s];s++;if(c){i=i<<7|e;o+=7;c=!1}else{i=i<<8|e;o+=8}255===e&&(c=!0)}o-=e;return i>>>o&(1<<e)-1}function skipMarkerIfEqual(e){if(255===t[r+s-1]&&t[r+s]===e){skipBytes(1);return!0}if(255===t[r+s]&&t[r+s+1]===e){skipBytes(2);return!0}return!1}function skipBytes(e){s+=e}function alignToByte(){o=0;if(c){s++;c=!1}}function readCodingpasses(){if(0===readBits(1))return 1;if(0===readBits(1))return 2;let e=readBits(2);if(e<3)return e+3;e=readBits(5);if(e<31)return e+6;e=readBits(7);return e+37}const l=e.currentTile.index,h=e.tiles[l],u=e.COD.sopMarkerUsed,d=e.COD.ephMarkerUsed,f=h.packetsIterator;for(;s<a;){alignToByte();u&&skipMarkerIfEqual(145)&&skipBytes(4);const e=f.nextPacket();if(!readBits(1))continue;const a=e.layerNumber,i=[];let o;for(let t=0,r=e.codeblocks.length;t<r;t++){o=e.codeblocks[t];let r=o.precinct;const s=o.cbx-r.cbxMin,c=o.cby-r.cbyMin;let l,h,u=!1,d=!1;if(void 0!==o.included)u=!!readBits(1);else{r=o.precinct;let e;if(void 0!==r.inclusionTree)e=r.inclusionTree;else{const t=r.cbxMax-r.cbxMin+1,n=r.cbyMax-r.cbyMin+1;e=new InclusionTree(t,n,a);h=new TagTree(t,n);r.inclusionTree=e;r.zeroBitPlanesTree=h;for(let e=0;e<a;e++)if(0!==readBits(1))throw new JpxError("Invalid tag tree")}if(e.reset(s,c,a))for(;;){if(!readBits(1)){e.incrementValue(a);break}l=!e.nextLevel();if(l){o.included=!0;u=d=!0;break}}}if(!u)continue;if(d){h=r.zeroBitPlanesTree;h.reset(s,c);for(;;)if(readBits(1)){l=!h.nextLevel();if(l)break}else h.incrementValue();o.zeroBitPlanes=h.value}const f=readCodingpasses();for(;readBits(1);)o.Lblock++;const g=(0,n.log2)(f),p=readBits((f<1<<g?g-1:g)+o.Lblock);i.push({codeblock:o,codingpasses:f,dataLength:p})}alignToByte();d&&skipMarkerIfEqual(146);for(;i.length>0;){const e=i.shift();o=e.codeblock;void 0===o.data&&(o.data=[]);o.data.push({data:t,start:r+s,end:r+s+e.dataLength,codingpasses:e.codingpasses});s+=e.dataLength}}return s}function copyCoefficients(e,t,r,a,n,s,c,l,h){const u=a.tbx0,d=a.tby0,f=a.tbx1-a.tbx0,g=a.codeblocks,p="H"===a.type.charAt(0)?1:0,m="H"===a.type.charAt(1)?t:0;for(let r=0,b=g.length;r<b;++r){const b=g[r],y=b.tbx1_-b.tbx0_,w=b.tby1_-b.tby0_;if(0===y||0===w)continue;if(void 0===b.data)continue;const S=new o(y,w,b.subbandType,b.zeroBitPlanes,s);let x=2;const k=b.data;let C,v,O,T=0,M=0;for(C=0,v=k.length;C<v;C++){O=k[C];T+=O.end-O.start;M+=O.codingpasses}const E=new Uint8Array(T);let D=0;for(C=0,v=k.length;C<v;C++){O=k[C];const e=O.data.subarray(O.start,O.end);E.set(e,D);D+=e.length}const N=new i.ArithmeticDecoder(E,0,T);S.setDecoder(N);for(C=0;C<M;C++){switch(x){case 0:S.runSignificancePropagationPass();break;case 1:S.runMagnitudeRefinementPass();break;case 2:S.runCleanupPass();l&&S.checkSegmentationSymbol()}h&&S.reset();x=(x+1)%3}let R=b.tbx0_-u+(b.tby0_-d)*f;const L=S.coefficentsSign,j=S.coefficentsMagnitude,$=S.bitsDecoded,_=c?0:.5;let U,X,H;D=0;const q="LL"!==a.type;for(C=0;C<w;C++){const r=2*(R/f|0)*(t-f)+p+m;for(U=0;U<y;U++){X=j[D];if(0!==X){X=(X+_)*n;0!==L[D]&&(X=-X);H=$[D];const t=q?r+(R<<1):R;e[t]=c&&H>=s?X:X*(1<<s-H)}R++;D++}R+=f-y}}}function transformTile(e,t,r){const a=t.components[r],n=a.codingStyleParameters,i=a.quantizationParameters,o=n.decompositionLevelsCount,c=i.SPqcds,l=i.scalarExpounded,h=i.guardBits,u=n.segmentationSymbolUsed,d=n.resetContextProbabilities,f=e.components[r].precision,g=n.reversibleTransformation,p=g?new ReversibleTransform:new IrreversibleTransform,m=[];let b=0;for(let e=0;e<=o;e++){const t=a.resolutions[e],r=t.trx1-t.trx0,n=t.try1-t.try0,i=new Float32Array(r*n);for(let a=0,n=t.subbands.length;a<n;a++){let n,o;if(l){n=c[b].mu;o=c[b].epsilon;b++}else{n=c[0].mu;o=c[0].epsilon+(e>0?1-e:0)}const p=t.subbands[a],m=s[p.type];copyCoefficients(i,r,0,p,g?1:2**(f+m-o)*(1+n/2048),h+o-1,g,u,d)}m.push({width:r,height:n,items:i})}const y=p.calculate(m,a.tcx0,a.tcy0);return{left:a.tcx0,top:a.tcy0,width:y.width,height:y.height,items:y.items}}function initializeTile(e,t){const r=e.SIZ.Csiz,a=e.tiles[t];for(let t=0;t<r;t++){const r=a.components[t],n=void 0!==e.currentTile.QCC[t]?e.currentTile.QCC[t]:e.currentTile.QCD;r.quantizationParameters=n;const i=void 0!==e.currentTile.COC[t]?e.currentTile.COC[t]:e.currentTile.COD;r.codingStyleParameters=i}a.codingStyleDefaultParameters=e.currentTile.COD}class TagTree{constructor(e,t){const r=(0,n.log2)(Math.max(e,t))+1;this.levels=[];for(let a=0;a<r;a++){const r={width:e,height:t,items:[]};this.levels.push(r);e=Math.ceil(e/2);t=Math.ceil(t/2)}}reset(e,t){let r,a=0,n=0;for(;a<this.levels.length;){r=this.levels[a];const i=e+t*r.width;if(void 0!==r.items[i]){n=r.items[i];break}r.index=i;e>>=1;t>>=1;a++}a--;r=this.levels[a];r.items[r.index]=n;this.currentLevel=a;delete this.value}incrementValue(){const e=this.levels[this.currentLevel];e.items[e.index]++}nextLevel(){let e=this.currentLevel,t=this.levels[e];const r=t.items[t.index];e--;if(e<0){this.value=r;return!1}this.currentLevel=e;t=this.levels[e];t.items[t.index]=r;return!0}}class InclusionTree{constructor(e,t,r){const a=(0,n.log2)(Math.max(e,t))+1;this.levels=[];for(let n=0;n<a;n++){const a=new Uint8Array(e*t);for(let e=0,t=a.length;e<t;e++)a[e]=r;const n={width:e,height:t,items:a};this.levels.push(n);e=Math.ceil(e/2);t=Math.ceil(t/2)}}reset(e,t,r){let a=0;for(;a<this.levels.length;){const n=this.levels[a],i=e+t*n.width;n.index=i;const s=n.items[i];if(255===s)break;if(s>r){this.currentLevel=a;this.propagateValues();return!1}e>>=1;t>>=1;a++}this.currentLevel=a-1;return!0}incrementValue(e){const t=this.levels[this.currentLevel];t.items[t.index]=e+1;this.propagateValues()}propagateValues(){let e=this.currentLevel,t=this.levels[e];const r=t.items[t.index];for(;--e>=0;){t=this.levels[e];t.items[t.index]=r}}nextLevel(){let e=this.currentLevel,t=this.levels[e];const r=t.items[t.index];t.items[t.index]=255;e--;if(e<0)return!1;this.currentLevel=e;t=this.levels[e];t.items[t.index]=r;return!0}}const o=function BitModelClosure(){const e=17,t=new Uint8Array([0,5,8,0,3,7,8,0,4,7,8,0,0,0,0,0,1,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8,0,0,0,0,0,2,6,8,0,3,7,8,0,4,7,8]),r=new Uint8Array([0,3,4,0,5,7,7,0,8,8,8,0,0,0,0,0,1,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8,0,0,0,0,0,2,3,4,0,6,7,7,0,8,8,8]),a=new Uint8Array([0,1,2,0,1,2,2,0,2,2,2,0,0,0,0,0,3,4,5,0,4,5,5,0,5,5,5,0,0,0,0,0,6,7,7,0,7,7,7,0,7,7,7,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8,0,0,0,0,0,8,8,8,0,8,8,8,0,8,8,8]);return class BitModel{constructor(e,n,i,s,o){this.width=e;this.height=n;let c;c="HH"===i?a:"HL"===i?r:t;this.contextLabelTable=c;const l=e*n;this.neighborsSignificance=new Uint8Array(l);this.coefficentsSign=new Uint8Array(l);let h;h=o>14?new Uint32Array(l):o>6?new Uint16Array(l):new Uint8Array(l);this.coefficentsMagnitude=h;this.processingFlags=new Uint8Array(l);const u=new Uint8Array(l);if(0!==s)for(let e=0;e<l;e++)u[e]=s;this.bitsDecoded=u;this.reset()}setDecoder(e){this.decoder=e}reset(){this.contexts=new Int8Array(19);this.contexts[0]=8;this.contexts[17]=92;this.contexts[18]=6}setNeighborsSignificance(e,t,r){const a=this.neighborsSignificance,n=this.width,i=this.height,s=t>0,o=t+1<n;let c;if(e>0){c=r-n;s&&(a[c-1]+=16);o&&(a[c+1]+=16);a[c]+=4}if(e+1<i){c=r+n;s&&(a[c-1]+=16);o&&(a[c+1]+=16);a[c]+=4}s&&(a[r-1]+=1);o&&(a[r+1]+=1);a[r]|=128}runSignificancePropagationPass(){const e=this.decoder,t=this.width,r=this.height,a=this.coefficentsMagnitude,n=this.coefficentsSign,i=this.neighborsSignificance,s=this.processingFlags,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded;for(let h=0;h<r;h+=4)for(let u=0;u<t;u++){let d=h*t+u;for(let f=0;f<4;f++,d+=t){const t=h+f;if(t>=r)break;s[d]&=-2;if(a[d]||!i[d])continue;const g=c[i[d]];if(e.readBit(o,g)){const e=this.decodeSignBit(t,u,d);n[d]=e;a[d]=1;this.setNeighborsSignificance(t,u,d);s[d]|=2}l[d]++;s[d]|=1}}}decodeSignBit(e,t,r){const a=this.width,n=this.height,i=this.coefficentsMagnitude,s=this.coefficentsSign;let o,c,l,h,u,d;h=t>0&&0!==i[r-1];if(t+1<a&&0!==i[r+1]){l=s[r+1];if(h){c=s[r-1];o=1-l-c}else o=1-l-l}else if(h){c=s[r-1];o=1-c-c}else o=0;const f=3*o;h=e>0&&0!==i[r-a];if(e+1<n&&0!==i[r+a]){l=s[r+a];if(h){c=s[r-a];o=1-l-c+f}else o=1-l-l+f}else if(h){c=s[r-a];o=1-c-c+f}else o=f;if(o>=0){u=9+o;d=this.decoder.readBit(this.contexts,u)}else{u=9-o;d=1^this.decoder.readBit(this.contexts,u)}return d}runMagnitudeRefinementPass(){const e=this.decoder,t=this.width,r=this.height,a=this.coefficentsMagnitude,n=this.neighborsSignificance,i=this.contexts,s=this.bitsDecoded,o=this.processingFlags,c=t*r,l=4*t;for(let r,h=0;h<c;h=r){r=Math.min(c,h+l);for(let c=0;c<t;c++)for(let l=h+c;l<r;l+=t){if(!a[l]||0!=(1&o[l]))continue;let t=16;if(0!=(2&o[l])){o[l]^=2;t=0===(127&n[l])?15:14}const r=e.readBit(i,t);a[l]=a[l]<<1|r;s[l]++;o[l]|=1}}}runCleanupPass(){const t=this.decoder,r=this.width,a=this.height,n=this.neighborsSignificance,i=this.coefficentsMagnitude,s=this.coefficentsSign,o=this.contexts,c=this.contextLabelTable,l=this.bitsDecoded,h=this.processingFlags,u=r,d=2*r,f=3*r;let g;for(let p=0;p<a;p=g){g=Math.min(p+4,a);const m=p*r,b=p+3<a;for(let a=0;a<r;a++){const y=m+a;let w,S=0,x=y,k=p;if(b&&0===h[y]&&0===h[y+u]&&0===h[y+d]&&0===h[y+f]&&0===n[y]&&0===n[y+u]&&0===n[y+d]&&0===n[y+f]){if(!t.readBit(o,18)){l[y]++;l[y+u]++;l[y+d]++;l[y+f]++;continue}S=t.readBit(o,e)<<1|t.readBit(o,e);if(0!==S){k=p+S;x+=S*r}w=this.decodeSignBit(k,a,x);s[x]=w;i[x]=1;this.setNeighborsSignificance(k,a,x);h[x]|=2;x=y;for(let e=p;e<=k;e++,x+=r)l[x]++;S++}for(k=p+S;k<g;k++,x+=r){if(i[x]||0!=(1&h[x]))continue;const e=c[n[x]];if(1===t.readBit(o,e)){w=this.decodeSignBit(k,a,x);s[x]=w;i[x]=1;this.setNeighborsSignificance(k,a,x);h[x]|=2}l[x]++}}}}checkSegmentationSymbol(){const t=this.decoder,r=this.contexts;if(10!==(t.readBit(r,e)<<3|t.readBit(r,e)<<2|t.readBit(r,e)<<1|t.readBit(r,e)))throw new JpxError("Invalid segmentation symbol")}}}();class Transform{constructor(){this.constructor===Transform&&(0,a.unreachable)("Cannot initialize Transform.")}calculate(e,t,r){let a=e[0];for(let n=1,i=e.length;n<i;n++)a=this.iterate(a,e[n],t,r);return a}extend(e,t,r){let a=t-1,n=t+1,i=t+r-2,s=t+r;e[a--]=e[n++];e[s++]=e[i--];e[a--]=e[n++];e[s++]=e[i--];e[a--]=e[n++];e[s++]=e[i--];e[a]=e[n];e[s]=e[i]}filter(e,t,r){(0,a.unreachable)("Abstract method `filter` called")}iterate(e,t,r,a){const n=e.width,i=e.height;let s=e.items;const o=t.width,c=t.height,l=t.items;let h,u,d,f,g,p;for(d=0,h=0;h<i;h++){f=2*h*o;for(u=0;u<n;u++,d++,f+=2)l[f]=s[d]}s=e.items=null;const m=new Float32Array(o+8);if(1===o){if(0!=(1&r))for(p=0,d=0;p<c;p++,d+=o)l[d]*=.5}else for(p=0,d=0;p<c;p++,d+=o){m.set(l.subarray(d,d+o),4);this.extend(m,4,o);this.filter(m,4,o);l.set(m.subarray(4,4+o),d)}let b=16;const y=[];for(h=0;h<b;h++)y.push(new Float32Array(c+8));let w,S=0;e=4+c;if(1===c){if(0!=(1&a))for(g=0;g<o;g++)l[g]*=.5}else for(g=0;g<o;g++){if(0===S){b=Math.min(o-g,b);for(d=g,f=4;f<e;d+=o,f++)for(w=0;w<b;w++)y[w][f]=l[d+w];S=b}S--;const t=y[S];this.extend(t,4,c);this.filter(t,4,c);if(0===S){d=g-b+1;for(f=4;f<e;d+=o,f++)for(w=0;w<b;w++)l[d+w]=y[w][f]}}return{width:o,height:c,items:l}}}class IrreversibleTransform extends Transform{filter(e,t,r){const a=r>>1;let n,i,s,o;const c=-1.586134342059924,l=-.052980118572961,h=.882911075530934,u=.443506852043971,d=1.230174104914001;n=(t|=0)-3;for(i=a+4;i--;n+=2)e[n]*=.8128930661159609;n=t-2;s=u*e[n-1];for(i=a+3;i--;n+=2){o=u*e[n+1];e[n]=d*e[n]-s-o;if(!i--)break;n+=2;s=u*e[n+1];e[n]=d*e[n]-s-o}n=t-1;s=h*e[n-1];for(i=a+2;i--;n+=2){o=h*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=h*e[n+1];e[n]-=s+o}n=t;s=l*e[n-1];for(i=a+1;i--;n+=2){o=l*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=l*e[n+1];e[n]-=s+o}if(0!==a){n=t+1;s=c*e[n-1];for(i=a;i--;n+=2){o=c*e[n+1];e[n]-=s+o;if(!i--)break;n+=2;s=c*e[n+1];e[n]-=s+o}}}}class ReversibleTransform extends Transform{filter(e,t,r){const a=r>>1;let n,i;for(n=t|=0,i=a+1;i--;n+=2)e[n]-=e[n-1]+e[n+1]+2>>2;for(n=t+1,i=a;i--;n+=2)e[n]+=e[n-1]+e[n+1]>>1}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LZWStream=void 0;var a=r(147);class LZWStream extends a.DecodeStream{constructor(e,t,r){super(t);this.str=e;this.dict=e.dict;this.cachedData=0;this.bitsCached=0;const a=4096,n={earlyChange:r,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0};for(let e=0;e<256;++e){n.dictionaryValues[e]=e;n.dictionaryLengths[e]=1}this.lzwState=n}readBits(e){let t=this.bitsCached,r=this.cachedData;for(;t<e;){const e=this.str.getByte();if(-1===e){this.eof=!0;return null}r=r<<8|e;t+=8}this.bitsCached=t-=e;this.cachedData=r;this.lastCode=null;return r>>>t&(1<<e)-1}readBlock(){let e,t,r,a=1024;const n=this.lzwState;if(!n)return;const i=n.earlyChange;let s=n.nextCode;const o=n.dictionaryValues,c=n.dictionaryLengths,l=n.dictionaryPrevCodes;let h=n.codeLength,u=n.prevCode;const d=n.currentSequence;let f=n.currentSequenceLength,g=0,p=this.bufferLength,m=this.ensureBuffer(this.bufferLength+a);for(e=0;e<512;e++){const e=this.readBits(h),n=f>0;if(e<256){d[0]=e;f=1}else{if(!(e>=258)){if(256===e){h=9;s=258;f=0;continue}this.eof=!0;delete this.lzwState;break}if(e<s){f=c[e];for(t=f-1,r=e;t>=0;t--){d[t]=o[r];r=l[r]}}else d[f++]=d[0]}if(n){l[s]=u;c[s]=c[u]+1;o[s]=d[0];s++;h=s+i&s+i-1?h:0|Math.min(Math.log(s+i)/.6931471805599453+1,12)}u=e;g+=f;if(a<g){do{a+=512}while(a<g);m=this.ensureBuffer(this.bufferLength+a)}for(t=0;t<f;t++)m[p++]=d[t]}n.nextCode=s;n.codeLength=h;n.prevCode=u;n.currentSequenceLength=f;this.bufferLength=p}}t.LZWStream=LZWStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PredictorStream=void 0;var a=r(147),n=r(133),i=r(2);class PredictorStream extends a.DecodeStream{constructor(e,t,r){super(t);if(!(r instanceof n.Dict))return e;const a=this.predictor=r.get("Predictor")||1;if(a<=1)return e;if(2!==a&&(a<10||a>15))throw new i.FormatError(`Unsupported predictor: ${a}`);this.readBlock=2===a?this.readBlockTiff:this.readBlockPng;this.str=e;this.dict=e.dict;const s=this.colors=r.get("Colors")||1,o=this.bits=r.get("BPC","BitsPerComponent")||8,c=this.columns=r.get("Columns")||1;this.pixBytes=s*o+7>>3;this.rowBytes=c*s*o+7>>3;return this}readBlockTiff(){const e=this.rowBytes,t=this.bufferLength,r=this.ensureBuffer(t+e),a=this.bits,n=this.colors,i=this.str.getBytes(e);this.eof=!i.length;if(this.eof)return;let s,o=0,c=0,l=0,h=0,u=t;if(1===a&&1===n)for(s=0;s<e;++s){let e=i[s]^o;e^=e>>1;e^=e>>2;e^=e>>4;o=(1&e)<<7;r[u++]=e}else if(8===a){for(s=0;s<n;++s)r[u++]=i[s];for(;s<e;++s){r[u]=r[u-n]+i[s];u++}}else if(16===a){const t=2*n;for(s=0;s<t;++s)r[u++]=i[s];for(;s<e;s+=2){const e=((255&i[s])<<8)+(255&i[s+1])+((255&r[u-t])<<8)+(255&r[u-t+1]);r[u++]=e>>8&255;r[u++]=255&e}}else{const e=new Uint8Array(n+1),u=(1<<a)-1;let d=0,f=t;const g=this.columns;for(s=0;s<g;++s)for(let t=0;t<n;++t){if(l<a){o=o<<8|255&i[d++];l+=8}e[t]=e[t]+(o>>l-a)&u;l-=a;c=c<<a|e[t];h+=a;if(h>=8){r[f++]=c>>h-8&255;h-=8}}h>0&&(r[f++]=(c<<8-h)+(o&(1<<8-h)-1))}this.bufferLength+=e}readBlockPng(){const e=this.rowBytes,t=this.pixBytes,r=this.str.getByte(),a=this.str.getBytes(e);this.eof=!a.length;if(this.eof)return;const n=this.bufferLength,s=this.ensureBuffer(n+e);let o=s.subarray(n-e,n);0===o.length&&(o=new Uint8Array(e));let c,l,h,u=n;switch(r){case 0:for(c=0;c<e;++c)s[u++]=a[c];break;case 1:for(c=0;c<t;++c)s[u++]=a[c];for(;c<e;++c){s[u]=s[u-t]+a[c]&255;u++}break;case 2:for(c=0;c<e;++c)s[u++]=o[c]+a[c]&255;break;case 3:for(c=0;c<t;++c)s[u++]=(o[c]>>1)+a[c];for(;c<e;++c){s[u]=(o[c]+s[u-t]>>1)+a[c]&255;u++}break;case 4:for(c=0;c<t;++c){l=o[c];h=a[c];s[u++]=l+h}for(;c<e;++c){l=o[c];const e=o[c-t],r=s[u-t],n=r+l-e;let i=n-r;i<0&&(i=-i);let d=n-l;d<0&&(d=-d);let f=n-e;f<0&&(f=-f);h=a[c];s[u++]=i<=d&&i<=f?r+h:d<=f?l+h:e+h}break;default:throw new i.FormatError(`Unsupported predictor: ${r}`)}this.bufferLength+=e}}t.PredictorStream=PredictorStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.RunLengthStream=void 0;var a=r(147);class RunLengthStream extends a.DecodeStream{constructor(e,t){super(t);this.str=e;this.dict=e.dict}readBlock(){const e=this.str.getBytes(2);if(!e||e.length<2||128===e[0]){this.eof=!0;return}let t,r=this.bufferLength,a=e[0];if(a<128){t=this.ensureBuffer(r+a+1);t[r++]=e[1];if(a>0){const e=this.str.getBytes(a);t.set(e,r);r+=a}}else{a=257-a;const n=e[1];t=this.ensureBuffer(r+a+1);for(let e=0;e<a;e++)t[r++]=n}this.bufferLength=r}}t.RunLengthStream=RunLengthStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Font=t.ErrorFont=void 0;var a=r(2),n=r(163),i=r(166),s=r(168),o=r(167),c=r(165),l=r(169),h=r(170),u=r(171),d=r(172),f=r(173),g=r(174),p=r(144),m=r(175),b=r(134),y=r(138),w=r(176);const S=[[57344,63743],[1048576,1114109]],x=1e3,k=["ascent","bbox","black","bold","charProcOperatorList","composite","cssFontInfo","data","defaultVMetrics","defaultWidth","descent","fallbackName","fontMatrix","fontType","isType3Font","italic","loadedName","mimetype","missingFile","name","remeasure","subtype","type","vertical"],C=["cMap","defaultEncoding","differences","isMonospace","isSerifFont","isSymbolicFont","seacMap","toFontChar","toUnicode","vmetrics","widths"];function adjustWidths(e){if(!e.fontMatrix)return;if(e.fontMatrix[0]===a.FONT_IDENTITY_MATRIX[0])return;const t=.001/e.fontMatrix[0],r=e.widths;for(const e in r)r[e]*=t;e.defaultWidth*=t}function amendFallbackToUnicode(e){if(!e.fallbackToUnicode)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;const t=[];for(const r in e.fallbackToUnicode)e.toUnicode.has(r)||(t[r]=e.fallbackToUnicode[r]);t.length>0&&e.toUnicode.amend(t)}class Glyph{constructor(e,t,r,a,n,i,o,c,l){this.originalCharCode=e;this.fontChar=t;this.unicode=r;this.accent=a;this.width=n;this.vmetric=i;this.operatorListId=o;this.isSpace=c;this.isInFont=l;const h=(0,s.getCharUnicodeCategory)(r);this.isWhitespace=h.isWhitespace;this.isZeroWidthDiacritic=h.isZeroWidthDiacritic;this.isInvisibleFormatMark=h.isInvisibleFormatMark}matchesForCache(e,t,r,a,n,i,s,o,c){return this.originalCharCode===e&&this.fontChar===t&&this.unicode===r&&this.accent===a&&this.width===n&&this.vmetric===i&&this.operatorListId===s&&this.isSpace===o&&this.isInFont===c}}function int16(e,t){return(e<<8)+t}function writeSignedInt16(e,t,r){e[t+1]=r;e[t]=r>>>8}function signedInt16(e,t){const r=(e<<8)+t;return 32768&r?r-65536:r}function string16(e){return String.fromCharCode(e>>8&255,255&e)}function safeString16(e){e>32767?e=32767:e<-32768&&(e=-32768);return String.fromCharCode(e>>8&255,255&e)}function isTrueTypeCollectionFile(e){const t=e.peekBytes(4);return"ttcf"===(0,a.bytesToString)(t)}function getFontFileType(e,t){let r,n,{type:i,subtype:s,composite:o}=t;if(function isTrueTypeFile(e){const t=e.peekBytes(4);return 65536===(0,b.readUint32)(t,0)||"true"===(0,a.bytesToString)(t)}(e)||isTrueTypeCollectionFile(e))r=o?"CIDFontType2":"TrueType";else if(function isOpenTypeFile(e){const t=e.peekBytes(4);return"OTTO"===(0,a.bytesToString)(t)}(e))r=o?"CIDFontType2":"OpenType";else if(function isType1File(e){const t=e.peekBytes(2);return 37===t[0]&&33===t[1]||128===t[0]&&1===t[1]}(e))r=o?"CIDFontType0":"MMType1"===i?"MMType1":"Type1";else if(function isCFFFile(e){const t=e.peekBytes(4);return t[0]>=1&&t[3]>=1&&t[3]<=4}(e))if(o){r="CIDFontType0";n="CIDFontType0C"}else{r="MMType1"===i?"MMType1":"Type1";n="Type1C"}else{(0,a.warn)("getFontFileType: Unable to detect correct font file Type/Subtype.");r=i;n=s}return[r,n]}function applyStandardFontGlyphMap(e,t){for(const r in t)e[+r]=t[r]}function buildToFontChar(e,t,r){const a=[];let n;for(let r=0,i=e.length;r<i;r++){n=(0,s.getUnicodeForGlyph)(e[r],t);-1!==n&&(a[r]=n)}for(const e in r){n=(0,s.getUnicodeForGlyph)(r[e],t);-1!==n&&(a[+e]=n)}return a}function convertCidString(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(t.length){case 1:return t.charCodeAt(0);case 2:return t.charCodeAt(0)<<8|t.charCodeAt(1)}const n=`Unsupported CID string (charCode ${e}): "${t}".`;if(r)throw new a.FormatError(n);(0,a.warn)(n);return t}function adjustMapping(e,t,r,n){const i=Object.create(null),s=new Map,o=[],c=new Set;let l=0;const h=S[l][0];let u=h,d=S[l][1];for(let f in e){f|=0;let g=e[f];if(!t(g))continue;if(u>d){l++;if(l>=S.length){(0,a.warn)("Ran out of space in font private use area.");break}u=S[l][0];d=S[l][1]}const p=u++;0===g&&(g=r);let m=n.get(f);"string"==typeof m&&(m=m.codePointAt(0));if(m&&m<h&&!c.has(g)){s.set(m,g);c.add(g)}i[p]=g;o[f]=p}return{toFontChar:o,charCodeToGlyphId:i,toUnicodeExtraMap:s,nextAvailableFontCharCode:u}}function createCmapTable(e,t,r){const n=function getRanges(e,t,r){const a=[];for(const t in e)e[t]>=r||a.push({fontCharCode:0|t,glyphId:e[t]});if(t)for(const[e,n]of t)n>=r||a.push({fontCharCode:e,glyphId:n});0===a.length&&a.push({fontCharCode:0,glyphId:0});a.sort((function fontGetRangesSort(e,t){return e.fontCharCode-t.fontCharCode}));const n=[],i=a.length;for(let e=0;e<i;){const t=a[e].fontCharCode,r=[a[e].glyphId];++e;let s=t;for(;e<i&&s+1===a[e].fontCharCode;){r.push(a[e].glyphId);++s;++e;if(65535===s)break}n.push([t,s,r])}return n}(e,t,r),i=n.at(-1)[1]>65535?2:1;let s,o,c,l,h="\0\0"+string16(i)+"\0\0"+(0,a.string32)(4+8*i);for(s=n.length-1;s>=0&&!(n[s][0]<=65535);--s);const u=s+1;n[s][0]<65535&&65535===n[s][1]&&(n[s][1]=65534);const d=n[s][1]<65535?1:0,f=u+d,g=m.OpenTypeFileBuilder.getSearchParams(f,2);let p,b,y,w,S="",x="",k="",C="",v="",O=0;for(s=0,o=u;s<o;s++){p=n[s];b=p[0];y=p[1];S+=string16(b);x+=string16(y);w=p[2];let e=!0;for(c=1,l=w.length;c<l;++c)if(w[c]!==w[c-1]+1){e=!1;break}if(e){k+=string16(w[0]-b&65535);C+=string16(0)}else{const e=2*(f-s)+2*O;O+=y-b+1;k+=string16(0);C+=string16(e);for(c=0,l=w.length;c<l;++c)v+=string16(w[c])}}if(d>0){x+="ÿÿ";S+="ÿÿ";k+="\0";C+="\0\0"}const T="\0\0"+string16(2*f)+string16(g.range)+string16(g.entry)+string16(g.rangeShift)+x+"\0\0"+S+k+C+v;let M="",E="";if(i>1){h+="\0\0\n"+(0,a.string32)(4+8*i+4+T.length);M="";for(s=0,o=n.length;s<o;s++){p=n[s];b=p[0];w=p[2];let e=w[0];for(c=1,l=w.length;c<l;++c)if(w[c]!==w[c-1]+1){y=p[0]+c-1;M+=(0,a.string32)(b)+(0,a.string32)(y)+(0,a.string32)(e);b=y+1;e=w[c]}M+=(0,a.string32)(b)+(0,a.string32)(p[1])+(0,a.string32)(e)}E="\0\f\0\0"+(0,a.string32)(M.length+16)+"\0\0\0\0"+(0,a.string32)(M.length/12)}return h+"\0"+string16(T.length+4)+T+E+M}function createOS2Table(e,t,r){r=r||{unitsPerEm:0,yMax:0,yMin:0,ascent:0,descent:0};let n=0,i=0,o=0,c=0,l=null,h=0;if(t){for(let e in t){e|=0;(l>e||!l)&&(l=e);h<e&&(h=e);const t=(0,s.getUnicodeRangeFor)(e);if(t<32)n|=1<<t;else if(t<64)i|=1<<t-32;else if(t<96)o|=1<<t-64;else{if(!(t<123))throw new a.FormatError("Unicode ranges Bits > 123 are reserved for internal usage");c|=1<<t-96}}h>65535&&(h=65535)}else{l=0;h=255}const u=e.bbox||[0,0,0,0],d=r.unitsPerEm||1/(e.fontMatrix||a.FONT_IDENTITY_MATRIX)[0],f=e.ascentScaled?1:d/x,g=r.ascent||Math.round(f*(e.ascent||u[3]));let p=r.descent||Math.round(f*(e.descent||u[1]));p>0&&e.descent>0&&u[1]<0&&(p=-p);const m=r.yMax||g,b=-r.yMin||-p;return"\0$ô\0\0\0»\0\0\0»\0\0ß\x001\0\0\0\0"+String.fromCharCode(e.fixedPitch?9:0)+"\0\0\0\0\0\0"+(0,a.string32)(n)+(0,a.string32)(i)+(0,a.string32)(o)+(0,a.string32)(c)+"*21*"+string16(e.italicAngle?1:0)+string16(l||e.firstChar)+string16(h||e.lastChar)+string16(g)+string16(p)+"\0d"+string16(m)+string16(b)+"\0\0\0\0\0\0\0\0"+string16(e.xHeight)+string16(e.capHeight)+string16(0)+string16(l||e.firstChar)+"\0"}function createPostTable(e){const t=Math.floor(65536*e.italicAngle);return"\0\0\0"+(0,a.string32)(t)+"\0\0\0\0"+(0,a.string32)(e.fixedPitch?1:0)+"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}function createPostscriptName(e){return e.replace(/[^\x21-\x7E]|[[\](){}<>/%]/g,"").slice(0,63)}function createNameTable(e,t){t||(t=[[],[]]);const r=[t[0][0]||"Original licence",t[0][1]||e,t[0][2]||"Unknown",t[0][3]||"uniqueID",t[0][4]||e,t[0][5]||"Version 0.11",t[0][6]||createPostscriptName(e),t[0][7]||"Unknown",t[0][8]||"Unknown",t[0][9]||"Unknown"],a=[];let n,i,s,o,c;for(n=0,i=r.length;n<i;n++){c=t[1][n]||r[n];const e=[];for(s=0,o=c.length;s<o;s++)e.push(string16(c.charCodeAt(s)));a.push(e.join(""))}const l=[r,a],h=["\0","\0"],u=["\0\0","\0"],d=["\0\0","\t"],f=r.length*h.length;let g="\0\0"+string16(f)+string16(12*f+6),p=0;for(n=0,i=h.length;n<i;n++){const e=l[n];for(s=0,o=e.length;s<o;s++){c=e[s];g+=h[n]+u[n]+d[n]+string16(s)+string16(c.length)+string16(p);p+=c.length}}g+=r.join("")+a.join("");return g}t.Font=class Font{constructor(e,t,r){this.name=e;this.psName=null;this.mimetype=null;this.disableFontFace=!1;this.loadedName=r.loadedName;this.isType3Font=r.isType3Font;this.missingFile=!1;this.cssFontInfo=r.cssFontInfo;this._charsCache=Object.create(null);this._glyphCache=Object.create(null);let n=!!(r.flags&i.FontFlags.Serif);if(!n&&!r.isSimulatedFlags){const t=e.replace(/[,_]/g,"-").split("-")[0],r=(0,l.getSerifFonts)();for(const e of t.split("+"))if(r[e]){n=!0;break}}this.isSerifFont=n;this.isSymbolicFont=!!(r.flags&i.FontFlags.Symbolic);this.isMonospace=!!(r.flags&i.FontFlags.FixedPitch);let s=r.type,o=r.subtype;this.type=s;this.subtype=o;let c,h="sans-serif";this.isMonospace?h="monospace":this.isSerifFont&&(h="serif");this.fallbackName=h;this.differences=r.differences;this.widths=r.widths;this.defaultWidth=r.defaultWidth;this.composite=r.composite;this.cMap=r.cMap;this.capHeight=r.capHeight/x;this.ascent=r.ascent/x;this.descent=r.descent/x;this.lineHeight=this.ascent-this.descent;this.fontMatrix=r.fontMatrix;this.bbox=r.bbox;this.defaultEncoding=r.defaultEncoding;this.toUnicode=r.toUnicode;this.toFontChar=[];if("Type3"!==r.type){this.cidEncoding=r.cidEncoding||"";this.vertical=!!r.vertical;if(this.vertical){this.vmetrics=r.vmetrics;this.defaultVMetrics=r.defaultVMetrics}if(t&&!t.isEmpty){[s,o]=getFontFileType(t,r);s===this.type&&o===this.subtype||(0,a.info)(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${s}/${o}.`);try{switch(s){case"MMType1":(0,a.info)("MMType1 font ("+e+"), falling back to Type1.");case"Type1":case"CIDFontType0":this.mimetype="font/opentype";const n="Type1C"===o||"CIDFontType0C"===o?new u.CFFFont(t,r):new w.Type1Font(e,t,r);adjustWidths(r);c=this.convert(e,n,r);break;case"OpenType":case"TrueType":case"CIDFontType2":this.mimetype="font/opentype";c=this.checkAndRepair(e,t,r);if(this.isOpenType){adjustWidths(r);s="OpenType"}break;default:throw new a.FormatError(`Font ${s} is not supported`)}}catch(e){(0,a.warn)(e);this.fallbackToSystemFont(r);return}amendFallbackToUnicode(r);this.data=c;this.fontType=(0,i.getFontType)(s,o,r.isStandardFont);this.fontMatrix=r.fontMatrix;this.widths=r.widths;this.defaultWidth=r.defaultWidth;this.toUnicode=r.toUnicode;this.seacMap=r.seacMap}else{t&&(0,a.warn)('Font file is empty in "'+e+'" ('+this.loadedName+")");this.fallbackToSystemFont(r)}}else{for(let e=0;e<256;e++)this.toFontChar[e]=this.differences[e]||r.defaultEncoding[e];this.fontType=a.FontType.TYPE3}}get renderer(){const e=d.FontRendererFactory.create(this,i.SEAC_ANALYSIS_ENABLED);return(0,a.shadow)(this,"renderer",e)}exportData(){const e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]?[...k,...C]:k,t=Object.create(null);let r,a;for(r of e){a=this[r];void 0!==a&&(t[r]=a)}return t}fallbackToSystemFont(e){this.missingFile=!0;const t=this.name,r=this.type,n=this.subtype;let u=(0,i.normalizeFontName)(t);const d=(0,l.getStdFontMap)(),g=(0,l.getNonStdFontMap)(),p=!!d[u],m=!(!g[u]||!d[g[u]]);u=d[u]||g[u]||u;const b=(0,f.getFontBasicMetrics)()[u];if(b){isNaN(this.ascent)&&(this.ascent=b.ascent/x);isNaN(this.descent)&&(this.descent=b.descent/x);isNaN(this.capHeight)&&(this.capHeight=b.capHeight/x)}this.bold=/bold/gi.test(u);this.italic=/oblique|italic/gi.test(u);this.black=/Black/g.test(t);const y=/Narrow/g.test(t);this.remeasure=(!p||y)&&Object.keys(this.widths).length>0;if((p||m)&&"CIDFontType2"===r&&this.cidEncoding.startsWith("Identity-")){const r=e.cidToGidMap,a=[];applyStandardFontGlyphMap(a,(0,l.getGlyphMapForStandardFonts)());/Arial-?Black/i.test(t)?applyStandardFontGlyphMap(a,(0,l.getSupplementalGlyphMapForArialBlack)()):/Calibri/i.test(t)&&applyStandardFontGlyphMap(a,(0,l.getSupplementalGlyphMapForCalibri)());if(r){for(const e in a){const t=a[e];void 0!==r[t]&&(a[+e]=r[t])}r.length!==this.toUnicode.length&&e.hasIncludedToUnicodeMap&&this.toUnicode instanceof h.IdentityToUnicodeMap&&this.toUnicode.forEach((function(e,t){const n=a[e];void 0===r[n]&&(a[+e]=t)}))}this.toUnicode instanceof h.IdentityToUnicodeMap||this.toUnicode.forEach((function(e,t){a[+e]=t}));this.toFontChar=a;this.toUnicode=new h.ToUnicodeMap(a)}else if(/Symbol/i.test(u))this.toFontChar=buildToFontChar(c.SymbolSetEncoding,(0,o.getGlyphsUnicode)(),this.differences);else if(/Dingbats/i.test(u)){/Wingdings/i.test(t)&&(0,a.warn)("Non-embedded Wingdings font, falling back to ZapfDingbats.");this.toFontChar=buildToFontChar(c.ZapfDingbatsEncoding,(0,o.getDingbatsGlyphsUnicode)(),this.differences)}else if(p){const e=buildToFontChar(this.defaultEncoding,(0,o.getGlyphsUnicode)(),this.differences);"CIDFontType2"!==r||this.cidEncoding.startsWith("Identity-")||this.toUnicode instanceof h.IdentityToUnicodeMap||this.toUnicode.forEach((function(t,r){e[+t]=r}));this.toFontChar=e}else{const e=(0,o.getGlyphsUnicode)(),r=[];this.toUnicode.forEach(((t,a)=>{if(!this.composite){const r=this.differences[t]||this.defaultEncoding[t],n=(0,s.getUnicodeForGlyph)(r,e);-1!==n&&(a=n)}r[+t]=a}));this.composite&&this.toUnicode instanceof h.IdentityToUnicodeMap&&/Verdana/i.test(t)&&applyStandardFontGlyphMap(r,(0,l.getGlyphMapForStandardFonts)());this.toFontChar=r}amendFallbackToUnicode(e);this.loadedName=u.split("-")[0];this.fontType=(0,i.getFontType)(r,n,e.isStandardFont)}checkAndRepair(e,t,r){const s=["OS/2","cmap","head","hhea","hmtx","maxp","name","post","loca","glyf","fpgm","prep","cvt ","CFF "];function readTables(e,t){const r=Object.create(null);r["OS/2"]=null;r.cmap=null;r.head=null;r.hhea=null;r.hmtx=null;r.maxp=null;r.name=null;r.post=null;for(let a=0;a<t;a++){const t=readTableEntry(e);s.includes(t.tag)&&(0!==t.length&&(r[t.tag]=t))}return r}function readTableEntry(e){const t=e.getString(4),r=e.getInt32()>>>0,a=e.getInt32()>>>0,n=e.getInt32()>>>0,i=e.pos;e.pos=e.start||0;e.skip(a);const s=e.getBytes(n);e.pos=i;if("head"===t){s[8]=s[9]=s[10]=s[11]=0;s[17]|=32}return{tag:t,checksum:r,length:n,offset:a,data:s}}function readOpenTypeHeader(e){return{version:e.getString(4),numTables:e.getUint16(),searchRange:e.getUint16(),entrySelector:e.getUint16(),rangeShift:e.getUint16()}}function sanitizeGlyph(e,t,r,a,n,i){const s={length:0,sizeOfInstructions:0};if(r-t<=12)return s;const o=e.subarray(t,r);let c=signedInt16(o[0],o[1]);if(c<0){c=-1;writeSignedInt16(o,0,c);a.set(o,n);s.length=o.length;return s}let l,h=10,u=0;for(l=0;l<c;l++){u=(o[h]<<8|o[h+1])+1;h+=2}const d=h,f=o[h]<<8|o[h+1];s.sizeOfInstructions=f;h+=2+f;const g=h;let p=0;for(l=0;l<u;l++){const e=o[h++];192&e&&(o[h-1]=63&e);let t=2;2&e?t=1:16&e&&(t=0);let r=2;4&e?r=1:32&e&&(r=0);const a=t+r;p+=a;if(8&e){const e=o[h++];l+=e;p+=e*a}}if(0===p)return s;let m=h+p;if(m>o.length)return s;if(!i&&f>0){a.set(o.subarray(0,d),n);a.set([0,0],n+d);a.set(o.subarray(g,m),n+d+2);m-=f;o.length-m>3&&(m=m+3&-4);s.length=m;return s}if(o.length-m>3){m=m+3&-4;a.set(o.subarray(0,m),n);s.length=m;return s}a.set(o,n);s.length=o.length;return s}function readNameTable(e){const r=(t.start||0)+e.offset;t.pos=r;const a=[[],[]],n=e.length,i=r+n;if(0!==t.getUint16()||n<6)return a;const s=t.getUint16(),o=t.getUint16(),c=[];let l,h;for(l=0;l<s&&t.pos+12<=i;l++){const e={platform:t.getUint16(),encoding:t.getUint16(),language:t.getUint16(),name:t.getUint16(),length:t.getUint16(),offset:t.getUint16()};(1===e.platform&&0===e.encoding&&0===e.language||3===e.platform&&1===e.encoding&&1033===e.language)&&c.push(e)}for(l=0,h=c.length;l<h;l++){const e=c[l];if(e.length<=0)continue;const n=r+o+e.offset;if(n+e.length>i)continue;t.pos=n;const s=e.name;if(e.encoding){let r="";for(let a=0,n=e.length;a<n;a+=2)r+=String.fromCharCode(t.getUint16());a[1][s]=r}else a[0][s]=t.getString(e.length)}return a}const l=[0,0,0,0,0,0,0,0,-2,-2,-2,-2,0,0,-2,-5,-1,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,-1,-1,1,-1,-999,0,1,0,-1,-2,0,-1,-2,-1,-1,0,-1,-1,0,0,-999,-999,-1,-1,-1,-1,-2,-999,-2,-2,-999,0,-2,-2,0,0,-2,0,-2,0,0,0,-2,-1,-1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,0,0,-1,0,-1,-1,0,-999,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,-2,-999,-999,-999,-999,-999,-1,-1,-2,-2,0,0,0,0,-1,-1,-999,-2,-2,0,0,-1,-2,-2,0,0,0,-1,-1,-1,-2];function sanitizeTTProgram(e,t){let r,n,i,s,o,c=e.data,h=0,u=0,d=0;const f=[],g=[],p=[];let m=t.tooComplexToFollowFunctions,b=!1,y=0,w=0;for(let e=c.length;h<e;){const e=c[h++];if(64===e){n=c[h++];if(b||w)h+=n;else for(r=0;r<n;r++)f.push(c[h++])}else if(65===e){n=c[h++];if(b||w)h+=2*n;else for(r=0;r<n;r++){i=c[h++];f.push(i<<8|c[h++])}}else if(176==(248&e)){n=e-176+1;if(b||w)h+=n;else for(r=0;r<n;r++)f.push(c[h++])}else if(184==(248&e)){n=e-184+1;if(b||w)h+=2*n;else for(r=0;r<n;r++){i=c[h++];f.push(i<<8|c[h++])}}else if(43!==e||m)if(44!==e||m){if(45===e)if(b){b=!1;u=h}else{o=g.pop();if(!o){(0,a.warn)("TT: ENDF bad stack");t.hintsValid=!1;return}s=p.pop();c=o.data;h=o.i;t.functionsStackDeltas[s]=f.length-o.stackTop}else if(137===e){if(b||w){(0,a.warn)("TT: nested IDEFs not allowed");m=!0}b=!0;d=h}else if(88===e)++y;else if(27===e)w=y;else if(89===e){w===y&&(w=0);--y}else if(28===e&&!b&&!w){const e=f.at(-1);e>0&&(h+=e-1)}}else{if(b||w){(0,a.warn)("TT: nested FDEFs not allowed");m=!0}b=!0;d=h;s=f.pop();t.functionsDefined[s]={data:c,i:h}}else if(!b&&!w){s=f.at(-1);if(isNaN(s))(0,a.info)("TT: CALL empty stack (or invalid entry).");else{t.functionsUsed[s]=!0;if(s in t.functionsStackDeltas){const e=f.length+t.functionsStackDeltas[s];if(e<0){(0,a.warn)("TT: CALL invalid functions stack delta.");t.hintsValid=!1;return}f.length=e}else if(s in t.functionsDefined&&!p.includes(s)){g.push({data:c,i:h,stackTop:f.length-1});p.push(s);o=t.functionsDefined[s];if(!o){(0,a.warn)("TT: CALL non-existent function");t.hintsValid=!1;return}c=o.data;h=o.i}}}if(!b&&!w){let t=0;e<=142?t=l[e]:e>=192&&e<=223?t=-1:e>=224&&(t=-2);if(e>=113&&e<=117){n=f.pop();isNaN(n)||(t=2*-n)}for(;t<0&&f.length>0;){f.pop();t++}for(;t>0;){f.push(NaN);t--}}}t.tooComplexToFollowFunctions=m;const S=[c];h>c.length&&S.push(new Uint8Array(h-c.length));if(d>u){(0,a.warn)("TT: complementing a missing function tail");S.push(new Uint8Array([34,45]))}!function foldTTTable(e,t){if(t.length>1){let r,a,n=0;for(r=0,a=t.length;r<a;r++)n+=t[r].length;n=n+3&-4;const i=new Uint8Array(n);let s=0;for(r=0,a=t.length;r<a;r++){i.set(t[r],s);s+=t[r].length}e.data=i;e.length=n}}(e,S)}let d,f,b,w;if(isTrueTypeCollectionFile(t=new y.Stream(new Uint8Array(t.getBytes())))){const e=function readTrueTypeCollectionData(e,t){const{numFonts:r,offsetTable:n}=function readTrueTypeCollectionHeader(e){const t=e.getString(4);(0,a.assert)("ttcf"===t,"Must be a TrueType Collection font.");const r=e.getUint16(),n=e.getUint16(),i=e.getInt32()>>>0,s=[];for(let t=0;t<i;t++)s.push(e.getInt32()>>>0);const o={ttcTag:t,majorVersion:r,minorVersion:n,numFonts:i,offsetTable:s};switch(r){case 1:return o;case 2:o.dsigTag=e.getInt32()>>>0;o.dsigLength=e.getInt32()>>>0;o.dsigOffset=e.getInt32()>>>0;return o}throw new a.FormatError(`Invalid TrueType Collection majorVersion: ${r}.`)}(e),i=t.split("+");let s;for(let o=0;o<r;o++){e.pos=(e.start||0)+n[o];const r=readOpenTypeHeader(e),c=readTables(e,r.numTables);if(!c.name)throw new a.FormatError('TrueType Collection font must contain a "name" table.');const l=readNameTable(c.name);for(let e=0,a=l.length;e<a;e++)for(let a=0,n=l[e].length;a<n;a++){const n=l[e][a]&&l[e][a].replace(/\s/g,"");if(n){if(n===t)return{header:r,tables:c};if(!(i.length<2))for(const e of i)n===e&&(s={name:e,header:r,tables:c})}}}if(s){(0,a.warn)(`TrueType Collection does not contain "${t}" font, falling back to "${s.name}" font instead.`);return{header:s.header,tables:s.tables}}throw new a.FormatError(`TrueType Collection does not contain "${t}" font.`)}(t,this.name);d=e.header;f=e.tables}else{d=readOpenTypeHeader(t);f=readTables(t,d.numTables)}const S=!f["CFF "];if(S){if(!f.loca)throw new a.FormatError('Required "loca" table is not found');if(!f.glyf){(0,a.warn)('Required "glyf" table is not found -- trying to recover.');f.glyf={tag:"glyf",data:new Uint8Array(0)}}this.isOpenType=!1}else{const t=r.composite&&((r.cidToGidMap||[]).length>0||!(r.cMap instanceof p.IdentityCMap));if("OTTO"===d.version&&!t||!f.head||!f.hhea||!f.maxp||!f.post){w=new y.Stream(f["CFF "].data);b=new u.CFFFont(w,r);adjustWidths(r);return this.convert(e,b,r)}delete f.glyf;delete f.loca;delete f.fpgm;delete f.prep;delete f["cvt "];this.isOpenType=!0}if(!f.maxp)throw new a.FormatError('Required "maxp" table is not found');t.pos=(t.start||0)+f.maxp.offset;const x=t.getInt32(),k=t.getUint16();if(r.scaleFactors&&r.scaleFactors.length===k&&S){const{scaleFactors:e}=r,t=int16(f.head.data[50],f.head.data[51]),a=new g.GlyfTable({glyfTable:f.glyf.data,isGlyphLocationsLong:t,locaTable:f.loca.data,numGlyphs:k});a.scale(e);const{glyf:n,loca:i,isLocationLong:s}=a.write();f.glyf.data=n;f.loca.data=i;if(s!==!!t){f.head.data[50]=0;f.head.data[51]=s?1:0}const o=f.hmtx.data;for(let t=0;t<k;t++){const r=4*t,a=Math.round(e[t]*int16(o[r],o[r+1]));o[r]=a>>8&255;o[r+1]=255&a;writeSignedInt16(o,r+2,Math.round(e[t]*signedInt16(o[r+2],o[r+3])))}}let C=k+1,v=!0;if(C>65535){v=!1;C=k;(0,a.warn)("Not enough space in glyfs to duplicate first glyph.")}let O=0,T=0;if(x>=65536&&f.maxp.length>=22){t.pos+=8;if(t.getUint16()>2){f.maxp.data[14]=0;f.maxp.data[15]=2}t.pos+=4;O=t.getUint16();t.pos+=4;T=t.getUint16()}f.maxp.data[4]=C>>8;f.maxp.data[5]=255&C;const M=function sanitizeTTPrograms(e,t,r,n){const i={functionsDefined:[],functionsUsed:[],functionsStackDeltas:[],tooComplexToFollowFunctions:!1,hintsValid:!0};e&&sanitizeTTProgram(e,i);t&&sanitizeTTProgram(t,i);e&&function checkInvalidFunctions(e,t){if(!e.tooComplexToFollowFunctions)if(e.functionsDefined.length>t){(0,a.warn)("TT: more functions defined than expected");e.hintsValid=!1}else for(let r=0,n=e.functionsUsed.length;r<n;r++){if(r>t){(0,a.warn)("TT: invalid function id: "+r);e.hintsValid=!1;return}if(e.functionsUsed[r]&&!e.functionsDefined[r]){(0,a.warn)("TT: undefined function: "+r);e.hintsValid=!1;return}}}(i,n);if(r&&1&r.length){const e=new Uint8Array(r.length+1);e.set(r.data);r.data=e}return i.hintsValid}(f.fpgm,f.prep,f["cvt "],O);if(!M){delete f.fpgm;delete f.prep;delete f["cvt "]}!function sanitizeMetrics(e,t,r,n,i,s){if(!t){r&&(r.data=null);return}e.pos=(e.start||0)+t.offset;e.pos+=4;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;e.pos+=2;const o=e.getUint16();e.pos+=8;e.pos+=2;let c=e.getUint16();if(0!==o){if(!(2&int16(n.data[44],n.data[45]))){t.data[22]=0;t.data[23]=0}}if(c>i){(0,a.info)(`The numOfMetrics (${c}) should not be greater than the numGlyphs (${i}).`);c=i;t.data[34]=(65280&c)>>8;t.data[35]=255&c}const l=i-c-(r.length-4*c>>1);if(l>0){const e=new Uint8Array(r.length+2*l);e.set(r.data);if(s){e[r.length]=r.data[2];e[r.length+1]=r.data[3]}r.data=e}}(t,f.hhea,f.hmtx,f.head,C,v);if(!f.head)throw new a.FormatError('Required "head" table is not found');!function sanitizeHead(e,t,r){const n=e.data,i=function int32(e,t,r,a){return(e<<24)+(t<<16)+(r<<8)+a}(n[0],n[1],n[2],n[3]);if(i>>16!=1){(0,a.info)("Attempting to fix invalid version in head table: "+i);n[0]=0;n[1]=1;n[2]=0;n[3]=0}const s=int16(n[50],n[51]);if(s<0||s>1){(0,a.info)("Attempting to fix invalid indexToLocFormat in head table: "+s);const e=t+1;if(r===e<<1){n[50]=0;n[51]=0}else{if(r!==e<<2)throw new a.FormatError("Could not fix indexToLocFormat: "+s);n[50]=0;n[51]=1}}}(f.head,k,S?f.loca.length:0);let E=Object.create(null);if(S){const e=int16(f.head.data[50],f.head.data[51]),t=function sanitizeGlyphLocations(e,t,r,a,n,i,s){let o,c,l;if(a){o=4;c=function fontItemDecodeLong(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]};l=function fontItemEncodeLong(e,t,r){e[t]=r>>>24&255;e[t+1]=r>>16&255;e[t+2]=r>>8&255;e[t+3]=255&r}}else{o=2;c=function fontItemDecode(e,t){return e[t]<<9|e[t+1]<<1};l=function fontItemEncode(e,t,r){e[t]=r>>9&255;e[t+1]=r>>1&255}}const h=i?r+1:r,u=o*(1+h),d=new Uint8Array(u);d.set(e.data.subarray(0,u));e.data=d;const f=t.data,g=f.length,p=new Uint8Array(g);let m,b;const y=[];for(m=0,b=0;m<r+1;m++,b+=o){let e=c(d,b);e>g&&(e=g);y.push({index:m,offset:e,endOffset:0})}y.sort(((e,t)=>e.offset-t.offset));for(m=0;m<r;m++)y[m].endOffset=y[m+1].offset;y.sort(((e,t)=>e.index-t.index));for(m=0;m<r;m++){const{offset:e,endOffset:t}=y[m];if(0!==e||0!==t)break;const r=y[m+1].offset;if(0!==r){y[m].endOffset=r;break}}const w=Object.create(null);let S=0;l(d,0,S);for(m=0,b=o;m<r;m++,b+=o){const e=sanitizeGlyph(f,y[m].offset,y[m].endOffset,p,S,n),t=e.length;0===t&&(w[m]=!0);e.sizeOfInstructions>s&&(s=e.sizeOfInstructions);S+=t;l(d,b,S)}if(0===S){const e=new Uint8Array([0,1,0,0,0,0,0,0,0,0,0,0,0,0,49,0]);for(m=0,b=o;m<h;m++,b+=o)l(d,b,e.length);t.data=e}else if(i){const r=c(d,o);if(p.length>r+S)t.data=p.subarray(0,r+S);else{t.data=new Uint8Array(r+S);t.data.set(p.subarray(0,S))}t.data.set(p.subarray(0,r),S);l(e.data,d.length-o,S+r)}else t.data=p.subarray(0,S);return{missingGlyphs:w,maxSizeOfInstructions:s}}(f.loca,f.glyf,k,e,M,v,T);E=t.missingGlyphs;if(x>=65536&&f.maxp.length>=22){f.maxp.data[26]=t.maxSizeOfInstructions>>8;f.maxp.data[27]=255&t.maxSizeOfInstructions}}if(!f.hhea)throw new a.FormatError('Required "hhea" table is not found');if(0===f.hhea.data[10]&&0===f.hhea.data[11]){f.hhea.data[10]=255;f.hhea.data[11]=255}const D={unitsPerEm:int16(f.head.data[18],f.head.data[19]),yMax:int16(f.head.data[42],f.head.data[43]),yMin:signedInt16(f.head.data[38],f.head.data[39]),ascent:signedInt16(f.hhea.data[4],f.hhea.data[5]),descent:signedInt16(f.hhea.data[6],f.hhea.data[7]),lineGap:signedInt16(f.hhea.data[8],f.hhea.data[9])};this.ascent=D.ascent/D.unitsPerEm;this.descent=D.descent/D.unitsPerEm;this.lineGap=D.lineGap/D.unitsPerEm;if(this.cssFontInfo&&this.cssFontInfo.lineHeight){this.lineHeight=this.cssFontInfo.metrics.lineHeight;this.lineGap=this.cssFontInfo.metrics.lineGap}else this.lineHeight=this.ascent-this.descent+this.lineGap;f.post&&function readPostScriptTable(e,r,n){const s=(t.start||0)+e.offset;t.pos=s;const o=s+e.length,c=t.getInt32();t.skip(28);let l,h,u=!0;switch(c){case 65536:l=i.MacStandardGlyphOrdering;break;case 131072:const e=t.getUint16();if(e!==n){u=!1;break}const s=[];for(h=0;h<e;++h){const e=t.getUint16();if(e>=32768){u=!1;break}s.push(e)}if(!u)break;const d=[],f=[];for(;t.pos<o;){const e=t.getByte();f.length=e;for(h=0;h<e;++h)f[h]=String.fromCharCode(t.getByte());d.push(f.join(""))}l=[];for(h=0;h<e;++h){const e=s[h];e<258?l.push(i.MacStandardGlyphOrdering[e]):l.push(d[e-258])}break;case 196608:break;default:(0,a.warn)("Unknown/unsupported post table version "+c);u=!1;r.defaultEncoding&&(l=r.defaultEncoding)}r.glyphNames=l;return u}(f.post,r,k);f.post={tag:"post",data:createPostTable(r)};const N=[];function hasGlyph(e){return!E[e]}if(r.composite){const e=r.cidToGidMap||[],t=0===e.length;r.cMap.forEach((function(r,n){"string"==typeof n&&(n=convertCidString(r,n,!0));if(n>65535)throw new a.FormatError("Max size of CID is 65,535");let i=-1;t?i=n:void 0!==e[n]&&(i=e[n]);i>=0&&i<k&&hasGlyph(i)&&(N[r]=i)}))}else{const e=function readCmapTable(e,t,r,n){if(!e){(0,a.warn)("No cmap table available.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}let i,s=(t.start||0)+e.offset;t.pos=s;t.skip(2);const o=t.getUint16();let c,l=!1;for(let e=0;e<o;e++){const a=t.getUint16(),i=t.getUint16(),s=t.getInt32()>>>0;let h=!1;if(!c||c.platformId!==a||c.encodingId!==i){if(0!==a||0!==i&&1!==i&&3!==i)if(1===a&&0===i)h=!0;else if(3!==a||1!==i||!n&&c){if(r&&3===a&&0===i){h=!0;let r=!0;if(e<o-1){const e=t.peekBytes(2);int16(e[0],e[1])<a&&(r=!1)}r&&(l=!0)}}else{h=!0;r||(l=!0)}else h=!0;h&&(c={platformId:a,encodingId:i,offset:s});if(l)break}}c&&(t.pos=s+c.offset);if(!c||-1===t.peekByte()){(0,a.warn)("Could not find a preferred cmap table.");return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}const h=t.getUint16();let u=!1;const d=[];let f,g;if(0===h){t.skip(4);for(f=0;f<256;f++){const e=t.getByte();e&&d.push({charCode:f,glyphId:e})}u=!0}else if(2===h){t.skip(4);const e=[];let r=0;for(let a=0;a<256;a++){const a=t.getUint16()>>3;e.push(a);r=Math.max(a,r)}const a=[];for(let e=0;e<=r;e++)a.push({firstCode:t.getUint16(),entryCount:t.getUint16(),idDelta:signedInt16(t.getByte(),t.getByte()),idRangePos:t.pos+t.getUint16()});for(let r=0;r<256;r++)if(0===e[r]){t.pos=a[0].idRangePos+2*r;g=t.getUint16();d.push({charCode:r,glyphId:g})}else{const n=a[e[r]];for(f=0;f<n.entryCount;f++){const e=(r<<8)+f+n.firstCode;t.pos=n.idRangePos+2*f;g=t.getUint16();0!==g&&(g=(g+n.idDelta)%65536);d.push({charCode:e,glyphId:g})}}}else if(4===h){t.skip(4);const e=t.getUint16()>>1;t.skip(6);const r=[];let a;for(a=0;a<e;a++)r.push({end:t.getUint16()});t.skip(2);for(a=0;a<e;a++)r[a].start=t.getUint16();for(a=0;a<e;a++)r[a].delta=t.getUint16();let n,o=0;for(a=0;a<e;a++){i=r[a];const s=t.getUint16();if(s){n=(s>>1)-(e-a);i.offsetIndex=n;o=Math.max(o,n+i.end-i.start+1)}else i.offsetIndex=-1}const c=[];for(f=0;f<o;f++)c.push(t.getUint16());for(a=0;a<e;a++){i=r[a];s=i.start;const e=i.end,t=i.delta;n=i.offsetIndex;for(f=s;f<=e;f++)if(65535!==f){g=n<0?f:c[n+f-s];g=g+t&65535;d.push({charCode:f,glyphId:g})}}}else if(6===h){t.skip(4);const e=t.getUint16(),r=t.getUint16();for(f=0;f<r;f++){g=t.getUint16();const r=e+f;d.push({charCode:r,glyphId:g})}}else{if(12!==h){(0,a.warn)("cmap table has unsupported format: "+h);return{platformId:-1,encodingId:-1,mappings:[],hasShortCmap:!1}}{t.skip(10);const e=t.getInt32()>>>0;for(f=0;f<e;f++){const e=t.getInt32()>>>0,r=t.getInt32()>>>0;let a=t.getInt32()>>>0;for(let t=e;t<=r;t++)d.push({charCode:t,glyphId:a++})}}}d.sort((function(e,t){return e.charCode-t.charCode}));for(let e=1;e<d.length;e++)if(d[e-1].charCode===d[e].charCode){d.splice(e,1);e--}return{platformId:c.platformId,encodingId:c.encodingId,mappings:d,hasShortCmap:u}}(f.cmap,t,this.isSymbolicFont,r.hasEncoding),n=e.platformId,s=e.encodingId,l=e.mappings,u=l.length;let d=[],g=!1;!r.hasEncoding||"MacRomanEncoding"!==r.baseEncodingName&&"WinAnsiEncoding"!==r.baseEncodingName||(d=(0,c.getEncoding)(r.baseEncodingName));if(r.hasEncoding&&!this.isSymbolicFont&&(3===n&&1===s||1===n&&0===s)){const e=(0,o.getGlyphsUnicode)();for(let t=0;t<256;t++){let a;a=void 0!==this.differences[t]?this.differences[t]:d.length&&""!==d[t]?d[t]:c.StandardEncoding[t];if(!a)continue;const o=(0,i.recoverGlyphName)(a,e);let f;3===n&&1===s?f=e[o]:1===n&&0===s&&(f=c.MacRomanEncoding.indexOf(o));if(void 0===f){if(!r.glyphNames&&r.hasIncludedToUnicodeMap&&!(this.toUnicode instanceof h.IdentityToUnicodeMap)){const e=this.toUnicode.get(t);e&&(f=e.codePointAt(0))}if(void 0===f)continue}for(let e=0;e<u;++e)if(l[e].charCode===f){N[t]=l[e].glyphId;break}}}else if(0===n){for(let e=0;e<u;++e)N[l[e].charCode]=l[e].glyphId;g=!0}else for(let e=0;e<u;++e){let t=l[e].charCode;3===n&&t>=61440&&t<=61695&&(t&=255);N[t]=l[e].glyphId}if(r.glyphNames&&(d.length||this.differences.length))for(let e=0;e<256;++e){if(!g&&void 0!==N[e])continue;const t=this.differences[e]||d[e];if(!t)continue;const a=r.glyphNames.indexOf(t);a>0&&hasGlyph(a)&&(N[e]=a)}}0===N.length&&(N[0]=0);let R=C-1;v||(R=0);if(!r.cssFontInfo){const e=adjustMapping(N,hasGlyph,R,this.toUnicode);this.toFontChar=e.toFontChar;f.cmap={tag:"cmap",data:createCmapTable(e.charCodeToGlyphId,e.toUnicodeExtraMap,C)};f["OS/2"]&&function validateOS2Table(e,t){t.pos=(t.start||0)+e.offset;const r=t.getUint16();t.skip(60);const a=t.getUint16();if(r<4&&768&a)return!1;if(t.getUint16()>t.getUint16())return!1;t.skip(6);if(0===t.getUint16())return!1;e.data[8]=e.data[9]=0;return!0}(f["OS/2"],t)||(f["OS/2"]={tag:"OS/2",data:createOS2Table(r,e.charCodeToGlyphId,D)})}if(!S)try{w=new y.Stream(f["CFF "].data);b=new n.CFFParser(w,r,i.SEAC_ANALYSIS_ENABLED).parse();b.duplicateFirstGlyph();const e=new n.CFFCompiler(b);f["CFF "].data=e.compile()}catch(e){(0,a.warn)("Failed to compile font "+r.loadedName)}if(f.name){const t=readNameTable(f.name);f.name.data=createNameTable(e,t);this.psName=t[0][6]||null}else f.name={tag:"name",data:createNameTable(this.name)};const L=new m.OpenTypeFileBuilder(d.version);for(const e in f)L.addTable(e,f[e].data);return L.toArray()}convert(e,t,r){r.fixedPitch=!1;r.builtInEncoding&&function adjustToUnicode(e,t){if(e.isInternalFont)return;if(e.hasIncludedToUnicodeMap)return;if(t===e.defaultEncoding)return;if(e.toUnicode instanceof h.IdentityToUnicodeMap)return;const r=[],a=(0,o.getGlyphsUnicode)();for(const n in t){if(e.hasEncoding&&(0===e.differences.length||void 0!==e.differences[n]))continue;const i=t[n],o=(0,s.getUnicodeForGlyph)(i,a);-1!==o&&(r[n]=String.fromCharCode(o))}r.length>0&&e.toUnicode.amend(r)}(r,r.builtInEncoding);let n=1;t instanceof u.CFFFont&&(n=t.numGlyphs-1);const l=t.getGlyphMapping(r);let d=null,f=l,g=null;if(!r.cssFontInfo){d=adjustMapping(l,t.hasGlyphId.bind(t),n,this.toUnicode);this.toFontChar=d.toFontChar;f=d.charCodeToGlyphId;g=d.toUnicodeExtraMap}const p=t.numGlyphs;function getCharCodes(e,t){let r=null;for(const a in e)if(t===e[a]){r||(r=[]);r.push(0|a)}return r}function createCharCode(e,t){for(const r in e)if(t===e[r])return 0|r;d.charCodeToGlyphId[d.nextAvailableFontCharCode]=t;return d.nextAvailableFontCharCode++}const b=t.seacs;if(d&&i.SEAC_ANALYSIS_ENABLED&&b&&b.length){const e=r.fontMatrix||a.FONT_IDENTITY_MATRIX,n=t.getCharset(),i=Object.create(null);for(let t in b){t|=0;const r=b[t],a=c.StandardEncoding[r[2]],s=c.StandardEncoding[r[3]],o=n.indexOf(a),h=n.indexOf(s);if(o<0||h<0)continue;const u={x:r[0]*e[0]+r[1]*e[2]+e[4],y:r[0]*e[1]+r[1]*e[3]+e[5]},f=getCharCodes(l,t);if(f)for(let e=0,t=f.length;e<t;e++){const t=f[e],r=d.charCodeToGlyphId,a=createCharCode(r,o),n=createCharCode(r,h);i[t]={baseFontCharCode:a,accentFontCharCode:n,accentOffset:u}}}r.seacMap=i}const y=1/(r.fontMatrix||a.FONT_IDENTITY_MATRIX)[0],w=new m.OpenTypeFileBuilder("OTTO");w.addTable("CFF ",t.data);w.addTable("OS/2",createOS2Table(r,f));w.addTable("cmap",createCmapTable(f,g,p));w.addTable("head","\0\0\0\0\0\0\0\0\0\0_<õ\0\0"+safeString16(y)+"\0\0\0\0\v~'\0\0\0\0\v~'\0\0"+safeString16(r.descent)+"ÿ"+safeString16(r.ascent)+string16(r.italicAngle?2:0)+"\0\0\0\0\0\0\0");w.addTable("hhea","\0\0\0"+safeString16(r.ascent)+safeString16(r.descent)+"\0\0ÿÿ\0\0\0\0\0\0"+safeString16(r.capHeight)+safeString16(Math.tan(r.italicAngle)*r.xHeight)+"\0\0\0\0\0\0\0\0\0\0\0\0"+string16(p));w.addTable("hmtx",function fontFieldsHmtx(){const e=t.charstrings,r=t.cff?t.cff.widths:null;let a="\0\0\0\0";for(let t=1,n=p;t<n;t++){let n=0;if(e){const r=e[t-1];n="width"in r?r.width:0}else r&&(n=Math.ceil(r[t]||0));a+=string16(n)+string16(0)}return a}());w.addTable("maxp","\0\0P\0"+string16(p));w.addTable("name",createNameTable(e));w.addTable("post",createPostTable(r));return w.toArray()}get spaceWidth(){const e=["space","minus","one","i","I"];let t;for(let r=0,a=e.length;r<a;r++){const a=e[r];if(a in this.widths){t=this.widths[a];break}const n=(0,o.getGlyphsUnicode)()[a];let i=0;if(this.composite&&this.cMap.contains(n)){i=this.cMap.lookup(n);"string"==typeof i&&(i=convertCidString(n,i))}!i&&this.toUnicode&&(i=this.toUnicode.charCodeOf(n));i<=0&&(i=n);t=this.widths[i];if(t)break}t=t||this.defaultWidth;return(0,a.shadow)(this,"spaceWidth",t)}_charToGlyph(e){let t,r,n,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=e;if(this.cMap&&this.cMap.contains(e)){o=this.cMap.lookup(e);"string"==typeof o&&(o=convertCidString(e,o))}r=this.widths[o];"number"!=typeof r&&(r=this.defaultWidth);const c=this.vmetrics&&this.vmetrics[o];let l=this.toUnicode.get(e)||e;"number"==typeof l&&(l=String.fromCharCode(l));let h=void 0!==this.toFontChar[e];t=this.toFontChar[e]||e;if(this.missingFile){const r=this.differences[e]||this.defaultEncoding[e];".notdef"!==r&&""!==r||"Type1"!==this.type||(t=32);t=(0,s.mapSpecialUnicodeValues)(t)}this.isType3Font&&(n=t);let u=null;if(this.seacMap&&this.seacMap[e]){h=!0;const r=this.seacMap[e];t=r.baseFontCharCode;u={fontChar:String.fromCodePoint(r.accentFontCharCode),offset:r.accentOffset}}let d="";"number"==typeof t&&(t<=1114111?d=String.fromCodePoint(t):(0,a.warn)(`charToGlyph - invalid fontCharCode: ${t}`));let f=this._glyphCache[e];if(!f||!f.matchesForCache(e,d,l,u,r,c,n,i,h)){f=new Glyph(e,d,l,u,r,c,n,i,h);this._glyphCache[e]=f}return f}charsToGlyphs(e){let t=this._charsCache[e];if(t)return t;t=[];if(this.cMap){const r=Object.create(null),a=e.length;let n=0;for(;n<a;){this.cMap.readCharCode(e,n,r);const{charcode:a,length:i}=r;n+=i;const s=this._charToGlyph(a,1===i&&32===e.charCodeAt(n-1));t.push(s)}}else for(let r=0,a=e.length;r<a;++r){const a=e.charCodeAt(r),n=this._charToGlyph(a,32===a);t.push(n)}return this._charsCache[e]=t}getCharPositions(e){const t=[];if(this.cMap){const r=Object.create(null);let a=0;for(;a<e.length;){this.cMap.readCharCode(e,a,r);const n=r.length;t.push([a,a+n]);a+=n}}else for(let r=0,a=e.length;r<a;++r)t.push([r,r+1]);return t}get glyphCacheValues(){return Object.values(this._glyphCache)}encodeString(e){const t=[],r=[],hasCurrentBufErrors=()=>t.length%2==1,a=this.toUnicode instanceof h.IdentityToUnicodeMap?e=>this.toUnicode.charCodeOf(e):e=>this.toUnicode.charCodeOf(String.fromCodePoint(e));for(let n=0,i=e.length;n<i;n++){const i=e.codePointAt(n);i>55295&&(i<57344||i>65533)&&n++;if(this.toUnicode){const e=a(i);if(-1!==e){if(hasCurrentBufErrors()){t.push(r.join(""));r.length=0}for(let t=(this.cMap?this.cMap.getCharCodeLength(e):1)-1;t>=0;t--)r.push(String.fromCharCode(e>>8*t&255));continue}}if(!hasCurrentBufErrors()){t.push(r.join(""));r.length=0}r.push(String.fromCodePoint(i))}t.push(r.join(""));return t}};t.ErrorFont=class ErrorFont{constructor(e){this.error=e;this.loadedName="g_font_error";this.missingFile=!0}charsToGlyphs(){return[]}encodeString(e){return[e]}exportData(){return{error:this.error}}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CFFTopDict=t.CFFStrings=t.CFFStandardStrings=t.CFFPrivateDict=t.CFFParser=t.CFFIndex=t.CFFHeader=t.CFFFDSelect=t.CFFCompiler=t.CFFCharset=t.CFF=void 0;var a=r(2),n=r(164),i=r(165);const s=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"];t.CFFStandardStrings=s;const o=391,c=[null,{id:"hstem",min:2,stackClearing:!0,stem:!0},null,{id:"vstem",min:2,stackClearing:!0,stem:!0},{id:"vmoveto",min:1,stackClearing:!0},{id:"rlineto",min:2,resetStack:!0},{id:"hlineto",min:1,resetStack:!0},{id:"vlineto",min:1,resetStack:!0},{id:"rrcurveto",min:6,resetStack:!0},null,{id:"callsubr",min:1,undefStack:!0},{id:"return",min:0,undefStack:!0},null,null,{id:"endchar",min:0,stackClearing:!0},null,null,null,{id:"hstemhm",min:2,stackClearing:!0,stem:!0},{id:"hintmask",min:0,stackClearing:!0},{id:"cntrmask",min:0,stackClearing:!0},{id:"rmoveto",min:2,stackClearing:!0},{id:"hmoveto",min:1,stackClearing:!0},{id:"vstemhm",min:2,stackClearing:!0,stem:!0},{id:"rcurveline",min:8,resetStack:!0},{id:"rlinecurve",min:8,resetStack:!0},{id:"vvcurveto",min:4,resetStack:!0},{id:"hhcurveto",min:4,resetStack:!0},null,{id:"callgsubr",min:1,undefStack:!0},{id:"vhcurveto",min:4,resetStack:!0},{id:"hvcurveto",min:4,resetStack:!0}],l=[null,null,null,{id:"and",min:2,stackDelta:-1},{id:"or",min:2,stackDelta:-1},{id:"not",min:1,stackDelta:0},null,null,null,{id:"abs",min:1,stackDelta:0},{id:"add",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]+e[t-1]}},{id:"sub",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]-e[t-1]}},{id:"div",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]/e[t-1]}},null,{id:"neg",min:1,stackDelta:0,stackFn(e,t){e[t-1]=-e[t-1]}},{id:"eq",min:2,stackDelta:-1},null,null,{id:"drop",min:1,stackDelta:-1},null,{id:"put",min:2,stackDelta:-2},{id:"get",min:1,stackDelta:0},{id:"ifelse",min:4,stackDelta:-3},{id:"random",min:0,stackDelta:1},{id:"mul",min:2,stackDelta:-1,stackFn(e,t){e[t-2]=e[t-2]*e[t-1]}},null,{id:"sqrt",min:1,stackDelta:0},{id:"dup",min:1,stackDelta:1},{id:"exch",min:2,stackDelta:0},{id:"index",min:2,stackDelta:0},{id:"roll",min:3,stackDelta:-2},null,null,null,{id:"hflex",min:7,resetStack:!0},{id:"flex",min:13,resetStack:!0},{id:"hflex1",min:9,resetStack:!0},{id:"flex1",min:11,resetStack:!0}];t.CFFParser=class CFFParser{constructor(e,t,r){this.bytes=e.getBytes();this.properties=t;this.seacAnalysisEnabled=!!r}parse(){const e=this.properties,t=new CFF;this.cff=t;const r=this.parseHeader(),a=this.parseIndex(r.endPos),n=this.parseIndex(a.endPos),i=this.parseIndex(n.endPos),s=this.parseIndex(i.endPos),o=this.parseDict(n.obj.get(0)),c=this.createDict(CFFTopDict,o,t.strings);t.header=r.obj;t.names=this.parseNameIndex(a.obj);t.strings=this.parseStringIndex(i.obj);t.topDict=c;t.globalSubrIndex=s.obj;this.parsePrivateDict(t.topDict);t.isCIDFont=c.hasName("ROS");const l=c.getByName("CharStrings"),h=this.parseIndex(l).obj,u=c.getByName("FontMatrix");u&&(e.fontMatrix=u);const d=c.getByName("FontBBox");if(d){e.ascent=Math.max(d[3],d[1]);e.descent=Math.min(d[1],d[3]);e.ascentScaled=!0}let f,g;if(t.isCIDFont){const e=this.parseIndex(c.getByName("FDArray")).obj;for(let r=0,a=e.count;r<a;++r){const a=e.get(r),n=this.createDict(CFFTopDict,this.parseDict(a),t.strings);this.parsePrivateDict(n);t.fdArray.push(n)}g=null;f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!0);t.fdSelect=this.parseFDSelect(c.getByName("FDSelect"),h.count)}else{f=this.parseCharsets(c.getByName("charset"),h.count,t.strings,!1);g=this.parseEncoding(c.getByName("Encoding"),e,t.strings,f.charset)}t.charset=f;t.encoding=g;const p=this.parseCharStrings({charStrings:h,localSubrIndex:c.privateDict.subrsIndex,globalSubrIndex:s.obj,fdSelect:t.fdSelect,fdArray:t.fdArray,privateDict:c.privateDict});t.charStrings=p.charStrings;t.seacs=p.seacs;t.widths=p.widths;return t}parseHeader(){let e=this.bytes;const t=e.length;let r=0;for(;r<t&&1!==e[r];)++r;if(r>=t)throw new a.FormatError("Invalid CFF header");if(0!==r){(0,a.info)("cff data is shifted");e=e.subarray(r);this.bytes=e}const n=e[0],i=e[1],s=e[2],o=e[3];return{obj:new CFFHeader(n,i,s,o),endPos:s}}parseDict(e){let t=0;function parseOperand(){let r=e[t++];if(30===r)return function parseFloatOperand(){let r="";const a=15,n=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"],i=e.length;for(;t<i;){const i=e[t++],s=i>>4,o=15&i;if(s===a)break;r+=n[s];if(o===a)break;r+=n[o]}return parseFloat(r)}();if(28===r){r=e[t++];r=(r<<24|e[t++]<<16)>>16;return r}if(29===r){r=e[t++];r=r<<8|e[t++];r=r<<8|e[t++];r=r<<8|e[t++];return r}if(r>=32&&r<=246)return r-139;if(r>=247&&r<=250)return 256*(r-247)+e[t++]+108;if(r>=251&&r<=254)return-256*(r-251)-e[t++]-108;(0,a.warn)('CFFParser_parseDict: "'+r+'" is a reserved command.');return NaN}let r=[];const n=[];t=0;const i=e.length;for(;t<i;){let a=e[t];if(a<=21){12===a&&(a=a<<8|e[++t]);n.push([a,r]);r=[];++t}else r.push(parseOperand())}return n}parseIndex(e){const t=new CFFIndex,r=this.bytes,a=r[e++]<<8|r[e++],n=[];let i,s,o=e;if(0!==a){const t=r[e++],c=e+(a+1)*t-1;for(i=0,s=a+1;i<s;++i){let a=0;for(let n=0;n<t;++n){a<<=8;a+=r[e++]}n.push(c+a)}o=n[a]}for(i=0,s=n.length-1;i<s;++i){const e=n[i],a=n[i+1];t.add(r.subarray(e,a))}return{obj:t,endPos:o}}parseNameIndex(e){const t=[];for(let r=0,n=e.count;r<n;++r){const n=e.get(r);t.push((0,a.bytesToString)(n))}return t}parseStringIndex(e){const t=new CFFStrings;for(let r=0,n=e.count;r<n;++r){const n=e.get(r);t.add((0,a.bytesToString)(n))}return t}createDict(e,t,r){const a=new e(r);for(let e=0,r=t.length;e<r;++e){const r=t[e],n=r[0],i=r[1];a.setByKey(n,i)}return a}parseCharString(e,t,r,n){if(!t||e.callDepth>10)return!1;let i=e.stackSize;const s=e.stack,o=t.length;for(let h=0;h<o;){const o=t[h++];let u=null;if(12===o){const e=t[h++];if(0===e){t[h-2]=139;t[h-1]=22;i=0}else u=l[e]}else if(28===o){s[i]=(t[h]<<24|t[h+1]<<16)>>16;h+=2;i++}else if(14===o){if(i>=4){i-=4;if(this.seacAnalysisEnabled){e.seac=s.slice(i,i+4);return!1}}u=c[o]}else if(o>=32&&o<=246){s[i]=o-139;i++}else if(o>=247&&o<=254){s[i]=o<251?(o-247<<8)+t[h]+108:-(o-251<<8)-t[h]-108;h++;i++}else if(255===o){s[i]=(t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3])/65536;h+=4;i++}else if(19===o||20===o){e.hints+=i>>1;h+=e.hints+7>>3;i%=2;u=c[o]}else{if(10===o||29===o){let t;t=10===o?r:n;if(!t){u=c[o];(0,a.warn)("Missing subrsIndex for "+u.id);return!1}let l=32768;t.count<1240?l=107:t.count<33900&&(l=1131);const h=s[--i]+l;if(h<0||h>=t.count||isNaN(h)){u=c[o];(0,a.warn)("Out of bounds subrIndex for "+u.id);return!1}e.stackSize=i;e.callDepth++;if(!this.parseCharString(e,t.get(h),r,n))return!1;e.callDepth--;i=e.stackSize;continue}if(11===o){e.stackSize=i;return!0}if(0===o&&h===t.length){t[h-1]=14;u=c[14]}else u=c[o]}if(u){if(u.stem){e.hints+=i>>1;if(3===o||23===o)e.hasVStems=!0;else if(e.hasVStems&&(1===o||18===o)){(0,a.warn)("CFF stem hints are in wrong order");t[h-1]=1===o?3:23}}if("min"in u&&!e.undefStack&&i<u.min){(0,a.warn)("Not enough parameters for "+u.id+"; actual: "+i+", expected: "+u.min);if(0===i){t[h-1]=14;return!0}return!1}if(e.firstStackClearing&&u.stackClearing){e.firstStackClearing=!1;i-=u.min;i>=2&&u.stem?i%=2:i>1&&(0,a.warn)("Found too many parameters for stack-clearing command");i>0&&(e.width=s[i-1])}if("stackDelta"in u){"stackFn"in u&&u.stackFn(s,i);i+=u.stackDelta}else if(u.stackClearing)i=0;else if(u.resetStack){i=0;e.undefStack=!1}else if(u.undefStack){i=0;e.undefStack=!0;e.firstStackClearing=!1}}}e.stackSize=i;return!0}parseCharStrings(e){let{charStrings:t,localSubrIndex:r,globalSubrIndex:n,fdSelect:i,fdArray:s,privateDict:o}=e;const c=[],l=[],h=t.count;for(let e=0;e<h;e++){const h=t.get(e),u={callDepth:0,stackSize:0,stack:[],undefStack:!0,hints:0,firstStackClearing:!0,seac:null,width:null,hasVStems:!1};let d=!0,f=null,g=o;if(i&&s.length){const t=i.getFDIndex(e);if(-1===t){(0,a.warn)("Glyph index is not in fd select.");d=!1}if(t>=s.length){(0,a.warn)("Invalid fd index for glyph index.");d=!1}if(d){g=s[t].privateDict;f=g.subrsIndex}}else r&&(f=r);d&&(d=this.parseCharString(u,h,f,n));if(null!==u.width){const t=g.getByName("nominalWidthX");l[e]=t+u.width}else{const t=g.getByName("defaultWidthX");l[e]=t}null!==u.seac&&(c[e]=u.seac);d||t.set(e,new Uint8Array([14]))}return{charStrings:t,seacs:c,widths:l}}emptyPrivateDictionary(e){const t=this.createDict(CFFPrivateDict,[],e.strings);e.setByKey(18,[0,0]);e.privateDict=t}parsePrivateDict(e){if(!e.hasName("Private")){this.emptyPrivateDictionary(e);return}const t=e.getByName("Private");if(!Array.isArray(t)||2!==t.length){e.removeByName("Private");return}const r=t[0],a=t[1];if(0===r||a>=this.bytes.length){this.emptyPrivateDictionary(e);return}const n=a+r,i=this.bytes.subarray(a,n),s=this.parseDict(i),o=this.createDict(CFFPrivateDict,s,e.strings);e.privateDict=o;if(!o.getByName("Subrs"))return;const c=o.getByName("Subrs"),l=a+c;if(0===c||l>=this.bytes.length){this.emptyPrivateDictionary(e);return}const h=this.parseIndex(l);o.subrsIndex=h.obj}parseCharsets(e,t,r,i){if(0===e)return new CFFCharset(!0,d.ISO_ADOBE,n.ISOAdobeCharset);if(1===e)return new CFFCharset(!0,d.EXPERT,n.ExpertCharset);if(2===e)return new CFFCharset(!0,d.EXPERT_SUBSET,n.ExpertSubsetCharset);const s=this.bytes,o=e,c=s[e++],l=[i?0:".notdef"];let h,u,f;t-=1;switch(c){case 0:for(f=0;f<t;f++){h=s[e++]<<8|s[e++];l.push(i?h:r.get(h))}break;case 1:for(;l.length<=t;){h=s[e++]<<8|s[e++];u=s[e++];for(f=0;f<=u;f++)l.push(i?h++:r.get(h++))}break;case 2:for(;l.length<=t;){h=s[e++]<<8|s[e++];u=s[e++]<<8|s[e++];for(f=0;f<=u;f++)l.push(i?h++:r.get(h++))}break;default:throw new a.FormatError("Unknown charset format")}const g=e,p=s.subarray(o,g);return new CFFCharset(!1,c,l,p)}parseEncoding(e,t,r,n){const s=Object.create(null),o=this.bytes;let c,l,h,u=!1,d=null;if(0===e||1===e){u=!0;c=e;const t=e?i.ExpertEncoding:i.StandardEncoding;for(l=0,h=n.length;l<h;l++){const e=t.indexOf(n[l]);-1!==e&&(s[e]=l)}}else{const t=e;c=o[e++];switch(127&c){case 0:const t=o[e++];for(l=1;l<=t;l++)s[o[e++]]=l;break;case 1:const r=o[e++];let n=1;for(l=0;l<r;l++){const t=o[e++],r=o[e++];for(let e=t;e<=t+r;e++)s[e]=n++}break;default:throw new a.FormatError(`Unknown encoding format: ${c} in CFF`)}const i=e;if(128&c){o[t]&=127;!function readSupplement(){const t=o[e++];for(l=0;l<t;l++){const t=o[e++],a=(o[e++]<<8)+(255&o[e++]);s[t]=n.indexOf(r.get(a))}}()}d=o.subarray(t,i)}c&=127;return new CFFEncoding(u,c,s,d)}parseFDSelect(e,t){const r=this.bytes,n=r[e++],i=[];let s;switch(n){case 0:for(s=0;s<t;++s){const t=r[e++];i.push(t)}break;case 3:const o=r[e++]<<8|r[e++];for(s=0;s<o;++s){let t=r[e++]<<8|r[e++];if(0===s&&0!==t){(0,a.warn)("parseFDSelect: The first range must have a first GID of 0 -- trying to recover.");t=0}const n=r[e++],o=r[e]<<8|r[e+1];for(let e=t;e<o;++e)i.push(n)}e+=2;break;default:throw new a.FormatError(`parseFDSelect: Unknown format "${n}".`)}if(i.length!==t)throw new a.FormatError("parseFDSelect: Invalid font data.");return new CFFFDSelect(n,i)}};class CFF{constructor(){this.header=null;this.names=[];this.topDict=null;this.strings=new CFFStrings;this.globalSubrIndex=null;this.encoding=null;this.charset=null;this.charStrings=null;this.fdArray=[];this.fdSelect=null;this.isCIDFont=!1}duplicateFirstGlyph(){if(this.charStrings.count>=65535){(0,a.warn)("Not enough space in charstrings to duplicate first glyph.");return}const e=this.charStrings.get(0);this.charStrings.add(e);this.isCIDFont&&this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0])}hasGlyphId(e){if(e<0||e>=this.charStrings.count)return!1;return this.charStrings.get(e).length>0}}t.CFF=CFF;class CFFHeader{constructor(e,t,r,a){this.major=e;this.minor=t;this.hdrSize=r;this.offSize=a}}t.CFFHeader=CFFHeader;class CFFStrings{constructor(){this.strings=[]}get(e){return e>=0&&e<=390?s[e]:e-o<=this.strings.length?this.strings[e-o]:s[0]}getSID(e){let t=s.indexOf(e);if(-1!==t)return t;t=this.strings.indexOf(e);return-1!==t?t+o:-1}add(e){this.strings.push(e)}get count(){return this.strings.length}}t.CFFStrings=CFFStrings;class CFFIndex{constructor(){this.objects=[];this.length=0}add(e){this.length+=e.length;this.objects.push(e)}set(e,t){this.length+=t.length-this.objects[e].length;this.objects[e]=t}get(e){return this.objects[e]}get count(){return this.objects.length}}t.CFFIndex=CFFIndex;class CFFDict{constructor(e,t){this.keyToNameMap=e.keyToNameMap;this.nameToKeyMap=e.nameToKeyMap;this.defaults=e.defaults;this.types=e.types;this.opcodes=e.opcodes;this.order=e.order;this.strings=t;this.values=Object.create(null)}setByKey(e,t){if(!(e in this.keyToNameMap))return!1;const r=t.length;if(0===r)return!0;for(let n=0;n<r;n++)if(isNaN(t[n])){(0,a.warn)('Invalid CFFDict value: "'+t+'" for key "'+e+'".');return!0}const n=this.types[e];"num"!==n&&"sid"!==n&&"offset"!==n||(t=t[0]);this.values[e]=t;return!0}setByName(e,t){if(!(e in this.nameToKeyMap))throw new a.FormatError(`Invalid dictionary name "${e}"`);this.values[this.nameToKeyMap[e]]=t}hasName(e){return this.nameToKeyMap[e]in this.values}getByName(e){if(!(e in this.nameToKeyMap))throw new a.FormatError(`Invalid dictionary name ${e}"`);const t=this.nameToKeyMap[e];return t in this.values?this.values[t]:this.defaults[t]}removeByName(e){delete this.values[this.nameToKeyMap[e]]}static createTables(e){const t={keyToNameMap:{},nameToKeyMap:{},defaults:{},types:{},opcodes:{},order:[]};for(let r=0,a=e.length;r<a;++r){const a=e[r],n=Array.isArray(a[0])?(a[0][0]<<8)+a[0][1]:a[0];t.keyToNameMap[n]=a[1];t.nameToKeyMap[a[1]]=n;t.types[n]=a[2];t.defaults[n]=a[3];t.opcodes[n]=Array.isArray(a[0])?a[0]:[a[0]];t.order.push(n)}return t}}const h=[[[12,30],"ROS",["sid","sid","num"],null],[[12,20],"SyntheticBase","num",null],[0,"version","sid",null],[1,"Notice","sid",null],[[12,0],"Copyright","sid",null],[2,"FullName","sid",null],[3,"FamilyName","sid",null],[4,"Weight","sid",null],[[12,1],"isFixedPitch","num",0],[[12,2],"ItalicAngle","num",0],[[12,3],"UnderlinePosition","num",-100],[[12,4],"UnderlineThickness","num",50],[[12,5],"PaintType","num",0],[[12,6],"CharstringType","num",2],[[12,7],"FontMatrix",["num","num","num","num","num","num"],[.001,0,0,.001,0,0]],[13,"UniqueID","num",null],[5,"FontBBox",["num","num","num","num"],[0,0,0,0]],[[12,8],"StrokeWidth","num",0],[14,"XUID","array",null],[15,"charset","offset",0],[16,"Encoding","offset",0],[17,"CharStrings","offset",0],[18,"Private",["offset","offset"],null],[[12,21],"PostScript","sid",null],[[12,22],"BaseFontName","sid",null],[[12,23],"BaseFontBlend","delta",null],[[12,31],"CIDFontVersion","num",0],[[12,32],"CIDFontRevision","num",0],[[12,33],"CIDFontType","num",0],[[12,34],"CIDCount","num",8720],[[12,35],"UIDBase","num",null],[[12,37],"FDSelect","offset",null],[[12,36],"FDArray","offset",null],[[12,38],"FontName","sid",null]];class CFFTopDict extends CFFDict{static get tables(){return(0,a.shadow)(this,"tables",this.createTables(h))}constructor(e){super(CFFTopDict.tables,e);this.privateDict=null}}t.CFFTopDict=CFFTopDict;const u=[[6,"BlueValues","delta",null],[7,"OtherBlues","delta",null],[8,"FamilyBlues","delta",null],[9,"FamilyOtherBlues","delta",null],[[12,9],"BlueScale","num",.039625],[[12,10],"BlueShift","num",7],[[12,11],"BlueFuzz","num",1],[10,"StdHW","num",null],[11,"StdVW","num",null],[[12,12],"StemSnapH","delta",null],[[12,13],"StemSnapV","delta",null],[[12,14],"ForceBold","num",0],[[12,17],"LanguageGroup","num",0],[[12,18],"ExpansionFactor","num",.06],[[12,19],"initialRandomSeed","num",0],[20,"defaultWidthX","num",0],[21,"nominalWidthX","num",0],[19,"Subrs","offset",null]];class CFFPrivateDict extends CFFDict{static get tables(){return(0,a.shadow)(this,"tables",this.createTables(u))}constructor(e){super(CFFPrivateDict.tables,e);this.subrsIndex=null}}t.CFFPrivateDict=CFFPrivateDict;const d={ISO_ADOBE:0,EXPERT:1,EXPERT_SUBSET:2};class CFFCharset{constructor(e,t,r,a){this.predefined=e;this.format=t;this.charset=r;this.raw=a}}t.CFFCharset=CFFCharset;class CFFEncoding{constructor(e,t,r,a){this.predefined=e;this.format=t;this.encoding=r;this.raw=a}}class CFFFDSelect{constructor(e,t){this.format=e;this.fdSelect=t}getFDIndex(e){return e<0||e>=this.fdSelect.length?-1:this.fdSelect[e]}}t.CFFFDSelect=CFFFDSelect;class CFFOffsetTracker{constructor(){this.offsets=Object.create(null)}isTracking(e){return e in this.offsets}track(e,t){if(e in this.offsets)throw new a.FormatError(`Already tracking location of ${e}`);this.offsets[e]=t}offset(e){for(const t in this.offsets)this.offsets[t]+=e}setEntryLocation(e,t,r){if(!(e in this.offsets))throw new a.FormatError(`Not tracking location of ${e}`);const n=r.data,i=this.offsets[e];for(let e=0,r=t.length;e<r;++e){const r=5*e+i,s=r+1,o=r+2,c=r+3,l=r+4;if(29!==n[r]||0!==n[s]||0!==n[o]||0!==n[c]||0!==n[l])throw new a.FormatError("writing to an offset that is not empty");const h=t[e];n[r]=29;n[s]=h>>24&255;n[o]=h>>16&255;n[c]=h>>8&255;n[l]=255&h}}}class CFFCompiler{constructor(e){this.cff=e}compile(){const e=this.cff,t={data:[],length:0,add(e){this.data=this.data.concat(e);this.length=this.data.length}},r=this.compileHeader(e.header);t.add(r);const n=this.compileNameIndex(e.names);t.add(n);if(e.isCIDFont&&e.topDict.hasName("FontMatrix")){const t=e.topDict.getByName("FontMatrix");e.topDict.removeByName("FontMatrix");for(let r=0,n=e.fdArray.length;r<n;r++){const n=e.fdArray[r];let i=t.slice(0);n.hasName("FontMatrix")&&(i=a.Util.transform(i,n.getByName("FontMatrix")));n.setByName("FontMatrix",i)}}const i=e.topDict.getByName("XUID");i&&i.length>16&&e.topDict.removeByName("XUID");e.topDict.setByName("charset",0);let s=this.compileTopDicts([e.topDict],t.length,e.isCIDFont);t.add(s.output);const o=s.trackers[0],c=this.compileStringIndex(e.strings.strings);t.add(c);const l=this.compileIndex(e.globalSubrIndex);t.add(l);if(e.encoding&&e.topDict.hasName("Encoding"))if(e.encoding.predefined)o.setEntryLocation("Encoding",[e.encoding.format],t);else{const r=this.compileEncoding(e.encoding);o.setEntryLocation("Encoding",[t.length],t);t.add(r)}const h=this.compileCharset(e.charset,e.charStrings.count,e.strings,e.isCIDFont);o.setEntryLocation("charset",[t.length],t);t.add(h);const u=this.compileCharStrings(e.charStrings);o.setEntryLocation("CharStrings",[t.length],t);t.add(u);if(e.isCIDFont){o.setEntryLocation("FDSelect",[t.length],t);const r=this.compileFDSelect(e.fdSelect);t.add(r);s=this.compileTopDicts(e.fdArray,t.length,!0);o.setEntryLocation("FDArray",[t.length],t);t.add(s.output);const a=s.trackers;this.compilePrivateDicts(e.fdArray,a,t)}this.compilePrivateDicts([e.topDict],[o],t);t.add([0]);return t.data}encodeNumber(e){return Number.isInteger(e)?this.encodeInteger(e):this.encodeFloat(e)}static get EncodeFloatRegExp(){return(0,a.shadow)(this,"EncodeFloatRegExp",/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/)}encodeFloat(e){let t=e.toString();const r=CFFCompiler.EncodeFloatRegExp.exec(t);if(r){const a=parseFloat("1e"+((r[2]?+r[2]:0)+r[1].length));t=(Math.round(e*a)/a).toString()}let a,n,i="";for(a=0,n=t.length;a<n;++a){const e=t[a];i+="e"===e?"-"===t[++a]?"c":"b":"."===e?"a":"-"===e?"e":e}i+=1&i.length?"f":"ff";const s=[30];for(a=0,n=i.length;a<n;a+=2)s.push(parseInt(i.substring(a,a+2),16));return s}encodeInteger(e){let t;t=e>=-107&&e<=107?[e+139]:e>=108&&e<=1131?[247+((e-=108)>>8),255&e]:e>=-1131&&e<=-108?[251+((e=-e-108)>>8),255&e]:e>=-32768&&e<=32767?[28,e>>8&255,255&e]:[29,e>>24&255,e>>16&255,e>>8&255,255&e];return t}compileHeader(e){return[e.major,e.minor,4,e.offSize]}compileNameIndex(e){const t=new CFFIndex;for(let r=0,n=e.length;r<n;++r){const n=e[r],i=Math.min(n.length,127);let s=new Array(i);for(let e=0;e<i;e++){let t=n[e];(t<"!"||t>"~"||"["===t||"]"===t||"("===t||")"===t||"{"===t||"}"===t||"<"===t||">"===t||"/"===t||"%"===t)&&(t="_");s[e]=t}s=s.join("");""===s&&(s="Bad_Font_Name");t.add((0,a.stringToBytes)(s))}return this.compileIndex(t)}compileTopDicts(e,t,r){const a=[];let n=new CFFIndex;for(let i=0,s=e.length;i<s;++i){const s=e[i];if(r){s.removeByName("CIDFontVersion");s.removeByName("CIDFontRevision");s.removeByName("CIDFontType");s.removeByName("CIDCount");s.removeByName("UIDBase")}const o=new CFFOffsetTracker,c=this.compileDict(s,o);a.push(o);n.add(c);o.offset(t)}n=this.compileIndex(n,a);return{trackers:a,output:n}}compilePrivateDicts(e,t,r){for(let n=0,i=e.length;n<i;++n){const i=e[n],s=i.privateDict;if(!s||!i.hasName("Private"))throw new a.FormatError("There must be a private dictionary.");const o=new CFFOffsetTracker,c=this.compileDict(s,o);let l=r.length;o.offset(l);c.length||(l=0);t[n].setEntryLocation("Private",[c.length,l],r);r.add(c);if(s.subrsIndex&&s.hasName("Subrs")){const e=this.compileIndex(s.subrsIndex);o.setEntryLocation("Subrs",[c.length],r);r.add(e)}}}compileDict(e,t){const r=[];for(const n of e.order){if(!(n in e.values))continue;let i=e.values[n],s=e.types[n];Array.isArray(s)||(s=[s]);Array.isArray(i)||(i=[i]);if(0!==i.length){for(let o=0,c=s.length;o<c;++o){const c=s[o],l=i[o];switch(c){case"num":case"sid":r.push(...this.encodeNumber(l));break;case"offset":const s=e.keyToNameMap[n];t.isTracking(s)||t.track(s,r.length);r.push(29,0,0,0,0);break;case"array":case"delta":r.push(...this.encodeNumber(l));for(let e=1,t=i.length;e<t;++e)r.push(...this.encodeNumber(i[e]));break;default:throw new a.FormatError(`Unknown data type of ${c}`)}}r.push(...e.opcodes[n])}}return r}compileStringIndex(e){const t=new CFFIndex;for(let r=0,n=e.length;r<n;++r)t.add((0,a.stringToBytes)(e[r]));return this.compileIndex(t)}compileGlobalSubrIndex(){const e=this.cff.globalSubrIndex;this.out.writeByteArray(this.compileIndex(e))}compileCharStrings(e){const t=new CFFIndex;for(let r=0;r<e.count;r++){const a=e.get(r);0!==a.length?t.add(a):t.add(new Uint8Array([139,14]))}return this.compileIndex(t)}compileCharset(e,t,r,n){let i;const s=t-1;if(n)i=new Uint8Array([2,0,0,s>>8&255,255&s]);else{i=new Uint8Array(1+2*s);i[0]=0;let t=0;const n=e.charset.length;let o=!1;for(let s=1;s<i.length;s+=2){let c=0;if(t<n){const n=e.charset[t++];c=r.getSID(n);if(-1===c){c=0;if(!o){o=!0;(0,a.warn)(`Couldn't find ${n} in CFF strings`)}}}i[s]=c>>8&255;i[s+1]=255&c}}return this.compileTypedArray(i)}compileEncoding(e){return this.compileTypedArray(e.raw)}compileFDSelect(e){const t=e.format;let r,a;switch(t){case 0:r=new Uint8Array(1+e.fdSelect.length);r[0]=t;for(a=0;a<e.fdSelect.length;a++)r[a+1]=e.fdSelect[a];break;case 3:const n=0;let i=e.fdSelect[0];const s=[t,0,0,n>>8&255,255&n,i];for(a=1;a<e.fdSelect.length;a++){const t=e.fdSelect[a];if(t!==i){s.push(a>>8&255,255&a,t);i=t}}const o=(s.length-3)/3;s[1]=o>>8&255;s[2]=255&o;s.push(a>>8&255,255&a);r=new Uint8Array(s)}return this.compileTypedArray(r)}compileTypedArray(e){const t=[];for(let r=0,a=e.length;r<a;++r)t[r]=e[r];return t}compileIndex(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e.objects,a=r.length;if(0===a)return[0,0];const n=[a>>8&255,255&a];let i,s,o=1;for(i=0;i<a;++i)o+=r[i].length;s=o<256?1:o<65536?2:o<16777216?3:4;n.push(s);let c=1;for(i=0;i<a+1;i++){1===s?n.push(255&c):2===s?n.push(c>>8&255,255&c):3===s?n.push(c>>16&255,c>>8&255,255&c):n.push(c>>>24&255,c>>16&255,c>>8&255,255&c);r[i]&&(c+=r[i].length)}for(i=0;i<a;i++){t[i]&&t[i].offset(n.length);for(let e=0,t=r[i].length;e<t;e++)n.push(r[i][e])}return n}}t.CFFCompiler=CFFCompiler},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ISOAdobeCharset=t.ExpertSubsetCharset=t.ExpertCharset=void 0;t.ISOAdobeCharset=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron"];t.ExpertCharset=[".notdef","space","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];t.ExpertSubsetCharset=[".notdef","space","dollaroldstyle","dollarsuperior","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","fi","fl","ffi","ffl","parenleftinferior","parenrightinferior","hyphensuperior","colonmonetary","onefitted","rupiah","centoldstyle","figuredash","hypheninferior","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior"]},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ZapfDingbatsEncoding=t.WinAnsiEncoding=t.SymbolSetEncoding=t.StandardEncoding=t.MacRomanEncoding=t.ExpertEncoding=void 0;t.getEncoding=function getEncoding(e){switch(e){case"WinAnsiEncoding":return s;case"StandardEncoding":return i;case"MacRomanEncoding":return n;case"SymbolSetEncoding":return o;case"ZapfDingbatsEncoding":return c;case"ExpertEncoding":return r;case"MacExpertEncoding":return a;default:return null}};const r=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"];t.ExpertEncoding=r;const a=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","centoldstyle","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","","threequartersemdash","","questionsmall","","","","","Ethsmall","","","onequarter","onehalf","threequarters","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","","","","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hypheninferior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","asuperior","centsuperior","","","","","Aacutesmall","Agravesmall","Acircumflexsmall","Adieresissmall","Atildesmall","Aringsmall","Ccedillasmall","Eacutesmall","Egravesmall","Ecircumflexsmall","Edieresissmall","Iacutesmall","Igravesmall","Icircumflexsmall","Idieresissmall","Ntildesmall","Oacutesmall","Ogravesmall","Ocircumflexsmall","Odieresissmall","Otildesmall","Uacutesmall","Ugravesmall","Ucircumflexsmall","Udieresissmall","","eightsuperior","fourinferior","threeinferior","sixinferior","eightinferior","seveninferior","Scaronsmall","","centinferior","twoinferior","","Dieresissmall","","Caronsmall","osuperior","fiveinferior","","commainferior","periodinferior","Yacutesmall","","dollarinferior","","","Thornsmall","","nineinferior","zeroinferior","Zcaronsmall","AEsmall","Oslashsmall","questiondownsmall","oneinferior","Lslashsmall","","","","","","","Cedillasmall","","","","","","OEsmall","figuredash","hyphensuperior","","","","","exclamdownsmall","","Ydieresissmall","","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","ninesuperior","zerosuperior","","esuperior","rsuperior","tsuperior","","","isuperior","ssuperior","dsuperior","","","","","","lsuperior","Ogoneksmall","Brevesmall","Macronsmall","bsuperior","nsuperior","msuperior","commasuperior","periodsuperior","Dotaccentsmall","Ringsmall","","","",""],n=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","space","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron"];t.MacRomanEncoding=n;const i=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls","","","",""];t.StandardEncoding=i;const s=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","bullet","Euro","bullet","quotesinglbase","florin","quotedblbase","ellipsis","dagger","daggerdbl","circumflex","perthousand","Scaron","guilsinglleft","OE","bullet","Zcaron","bullet","bullet","quoteleft","quoteright","quotedblleft","quotedblright","bullet","endash","emdash","tilde","trademark","scaron","guilsinglright","oe","bullet","zcaron","Ydieresis","space","exclamdown","cent","sterling","currency","yen","brokenbar","section","dieresis","copyright","ordfeminine","guillemotleft","logicalnot","hyphen","registered","macron","degree","plusminus","twosuperior","threesuperior","acute","mu","paragraph","periodcentered","cedilla","onesuperior","ordmasculine","guillemotright","onequarter","onehalf","threequarters","questiondown","Agrave","Aacute","Acircumflex","Atilde","Adieresis","Aring","AE","Ccedilla","Egrave","Eacute","Ecircumflex","Edieresis","Igrave","Iacute","Icircumflex","Idieresis","Eth","Ntilde","Ograve","Oacute","Ocircumflex","Otilde","Odieresis","multiply","Oslash","Ugrave","Uacute","Ucircumflex","Udieresis","Yacute","Thorn","germandbls","agrave","aacute","acircumflex","atilde","adieresis","aring","ae","ccedilla","egrave","eacute","ecircumflex","edieresis","igrave","iacute","icircumflex","idieresis","eth","ntilde","ograve","oacute","ocircumflex","otilde","odieresis","divide","oslash","ugrave","uacute","ucircumflex","udieresis","yacute","thorn","ydieresis"];t.WinAnsiEncoding=s;const o=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","universal","numbersign","existential","percent","ampersand","suchthat","parenleft","parenright","asteriskmath","plus","comma","minus","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","congruent","Alpha","Beta","Chi","Delta","Epsilon","Phi","Gamma","Eta","Iota","theta1","Kappa","Lambda","Mu","Nu","Omicron","Pi","Theta","Rho","Sigma","Tau","Upsilon","sigma1","Omega","Xi","Psi","Zeta","bracketleft","therefore","bracketright","perpendicular","underscore","radicalex","alpha","beta","chi","delta","epsilon","phi","gamma","eta","iota","phi1","kappa","lambda","mu","nu","omicron","pi","theta","rho","sigma","tau","upsilon","omega1","omega","xi","psi","zeta","braceleft","bar","braceright","similar","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Euro","Upsilon1","minute","lessequal","fraction","infinity","florin","club","diamond","heart","spade","arrowboth","arrowleft","arrowup","arrowright","arrowdown","degree","plusminus","second","greaterequal","multiply","proportional","partialdiff","bullet","divide","notequal","equivalence","approxequal","ellipsis","arrowvertex","arrowhorizex","carriagereturn","aleph","Ifraktur","Rfraktur","weierstrass","circlemultiply","circleplus","emptyset","intersection","union","propersuperset","reflexsuperset","notsubset","propersubset","reflexsubset","element","notelement","angle","gradient","registerserif","copyrightserif","trademarkserif","product","radical","dotmath","logicalnot","logicaland","logicalor","arrowdblboth","arrowdblleft","arrowdblup","arrowdblright","arrowdbldown","lozenge","angleleft","registersans","copyrightsans","trademarksans","summation","parenlefttp","parenleftex","parenleftbt","bracketlefttp","bracketleftex","bracketleftbt","bracelefttp","braceleftmid","braceleftbt","braceex","","angleright","integral","integraltp","integralex","integralbt","parenrighttp","parenrightex","parenrightbt","bracketrighttp","bracketrightex","bracketrightbt","bracerighttp","bracerightmid","bracerightbt",""];t.SymbolSetEncoding=o;const c=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","a1","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","","","","","","","","","","","","","","","","","","","","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191",""];t.ZapfDingbatsEncoding=c},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SEAC_ANALYSIS_ENABLED=t.MacStandardGlyphOrdering=t.FontFlags=void 0;t.getFontType=function getFontType(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];switch(e){case"Type1":return r?a.FontType.TYPE1STANDARD:"Type1C"===t?a.FontType.TYPE1C:a.FontType.TYPE1;case"CIDFontType0":return"CIDFontType0C"===t?a.FontType.CIDFONTTYPE0C:a.FontType.CIDFONTTYPE0;case"OpenType":return a.FontType.OPENTYPE;case"TrueType":return a.FontType.TRUETYPE;case"CIDFontType2":return a.FontType.CIDFONTTYPE2;case"MMType1":return a.FontType.MMTYPE1;case"Type0":return a.FontType.TYPE0;default:return a.FontType.UNKNOWN}};t.normalizeFontName=function normalizeFontName(e){return e.replace(/[,_]/g,"-").replace(/\s/g,"")};t.recoverGlyphName=recoverGlyphName;t.type1FontGlyphMapping=function type1FontGlyphMapping(e,t,r){const a=Object.create(null);let s,c,l;const h=!!(e.flags&o.Symbolic);if(e.isInternalFont){l=t;for(c=0;c<l.length;c++){s=r.indexOf(l[c]);a[c]=s>=0?s:0}}else if(e.baseEncodingName){l=(0,n.getEncoding)(e.baseEncodingName);for(c=0;c<l.length;c++){s=r.indexOf(l[c]);a[c]=s>=0?s:0}}else if(h)for(c in t)a[c]=t[c];else{l=n.StandardEncoding;for(c=0;c<l.length;c++){s=r.indexOf(l[c]);a[c]=s>=0?s:0}}const u=e.differences;let d;if(u)for(c in u){const e=u[c];s=r.indexOf(e);if(-1===s){d||(d=(0,i.getGlyphsUnicode)());const t=recoverGlyphName(e,d);t!==e&&(s=r.indexOf(t))}a[c]=s>=0?s:0}return a};var a=r(2),n=r(165),i=r(167),s=r(168);t.SEAC_ANALYSIS_ENABLED=!0;const o={FixedPitch:1,Serif:2,Symbolic:4,Script:8,Nonsymbolic:32,Italic:64,AllCap:65536,SmallCap:131072,ForceBold:262144};t.FontFlags=o;t.MacStandardGlyphOrdering=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];function recoverGlyphName(e,t){if(void 0!==t[e])return e;const r=(0,s.getUnicodeForGlyph)(e,t);if(-1!==r)for(const e in t)if(t[e]===r)return e;(0,a.info)("Unable to recover a standard glyph name for: "+e);return e}},(e,t,r)=>{"use strict";r.r(t);r.d(t,{getDingbatsGlyphsUnicode:()=>i,getGlyphsUnicode:()=>n});var a=r(134);const n=(0,a.getArrayLookupTableFactory)((function(){return["A",65,"AE",198,"AEacute",508,"AEmacron",482,"AEsmall",63462,"Aacute",193,"Aacutesmall",63457,"Abreve",258,"Abreveacute",7854,"Abrevecyrillic",1232,"Abrevedotbelow",7862,"Abrevegrave",7856,"Abrevehookabove",7858,"Abrevetilde",7860,"Acaron",461,"Acircle",9398,"Acircumflex",194,"Acircumflexacute",7844,"Acircumflexdotbelow",7852,"Acircumflexgrave",7846,"Acircumflexhookabove",7848,"Acircumflexsmall",63458,"Acircumflextilde",7850,"Acute",63177,"Acutesmall",63412,"Acyrillic",1040,"Adblgrave",512,"Adieresis",196,"Adieresiscyrillic",1234,"Adieresismacron",478,"Adieresissmall",63460,"Adotbelow",7840,"Adotmacron",480,"Agrave",192,"Agravesmall",63456,"Ahookabove",7842,"Aiecyrillic",1236,"Ainvertedbreve",514,"Alpha",913,"Alphatonos",902,"Amacron",256,"Amonospace",65313,"Aogonek",260,"Aring",197,"Aringacute",506,"Aringbelow",7680,"Aringsmall",63461,"Asmall",63329,"Atilde",195,"Atildesmall",63459,"Aybarmenian",1329,"B",66,"Bcircle",9399,"Bdotaccent",7682,"Bdotbelow",7684,"Becyrillic",1041,"Benarmenian",1330,"Beta",914,"Bhook",385,"Blinebelow",7686,"Bmonospace",65314,"Brevesmall",63220,"Bsmall",63330,"Btopbar",386,"C",67,"Caarmenian",1342,"Cacute",262,"Caron",63178,"Caronsmall",63221,"Ccaron",268,"Ccedilla",199,"Ccedillaacute",7688,"Ccedillasmall",63463,"Ccircle",9400,"Ccircumflex",264,"Cdot",266,"Cdotaccent",266,"Cedillasmall",63416,"Chaarmenian",1353,"Cheabkhasiancyrillic",1212,"Checyrillic",1063,"Chedescenderabkhasiancyrillic",1214,"Chedescendercyrillic",1206,"Chedieresiscyrillic",1268,"Cheharmenian",1347,"Chekhakassiancyrillic",1227,"Cheverticalstrokecyrillic",1208,"Chi",935,"Chook",391,"Circumflexsmall",63222,"Cmonospace",65315,"Coarmenian",1361,"Csmall",63331,"D",68,"DZ",497,"DZcaron",452,"Daarmenian",1332,"Dafrican",393,"Dcaron",270,"Dcedilla",7696,"Dcircle",9401,"Dcircumflexbelow",7698,"Dcroat",272,"Ddotaccent",7690,"Ddotbelow",7692,"Decyrillic",1044,"Deicoptic",1006,"Delta",8710,"Deltagreek",916,"Dhook",394,"Dieresis",63179,"DieresisAcute",63180,"DieresisGrave",63181,"Dieresissmall",63400,"Digammagreek",988,"Djecyrillic",1026,"Dlinebelow",7694,"Dmonospace",65316,"Dotaccentsmall",63223,"Dslash",272,"Dsmall",63332,"Dtopbar",395,"Dz",498,"Dzcaron",453,"Dzeabkhasiancyrillic",1248,"Dzecyrillic",1029,"Dzhecyrillic",1039,"E",69,"Eacute",201,"Eacutesmall",63465,"Ebreve",276,"Ecaron",282,"Ecedillabreve",7708,"Echarmenian",1333,"Ecircle",9402,"Ecircumflex",202,"Ecircumflexacute",7870,"Ecircumflexbelow",7704,"Ecircumflexdotbelow",7878,"Ecircumflexgrave",7872,"Ecircumflexhookabove",7874,"Ecircumflexsmall",63466,"Ecircumflextilde",7876,"Ecyrillic",1028,"Edblgrave",516,"Edieresis",203,"Edieresissmall",63467,"Edot",278,"Edotaccent",278,"Edotbelow",7864,"Efcyrillic",1060,"Egrave",200,"Egravesmall",63464,"Eharmenian",1335,"Ehookabove",7866,"Eightroman",8551,"Einvertedbreve",518,"Eiotifiedcyrillic",1124,"Elcyrillic",1051,"Elevenroman",8554,"Emacron",274,"Emacronacute",7702,"Emacrongrave",7700,"Emcyrillic",1052,"Emonospace",65317,"Encyrillic",1053,"Endescendercyrillic",1186,"Eng",330,"Enghecyrillic",1188,"Enhookcyrillic",1223,"Eogonek",280,"Eopen",400,"Epsilon",917,"Epsilontonos",904,"Ercyrillic",1056,"Ereversed",398,"Ereversedcyrillic",1069,"Escyrillic",1057,"Esdescendercyrillic",1194,"Esh",425,"Esmall",63333,"Eta",919,"Etarmenian",1336,"Etatonos",905,"Eth",208,"Ethsmall",63472,"Etilde",7868,"Etildebelow",7706,"Euro",8364,"Ezh",439,"Ezhcaron",494,"Ezhreversed",440,"F",70,"Fcircle",9403,"Fdotaccent",7710,"Feharmenian",1366,"Feicoptic",996,"Fhook",401,"Fitacyrillic",1138,"Fiveroman",8548,"Fmonospace",65318,"Fourroman",8547,"Fsmall",63334,"G",71,"GBsquare",13191,"Gacute",500,"Gamma",915,"Gammaafrican",404,"Gangiacoptic",1002,"Gbreve",286,"Gcaron",486,"Gcedilla",290,"Gcircle",9404,"Gcircumflex",284,"Gcommaaccent",290,"Gdot",288,"Gdotaccent",288,"Gecyrillic",1043,"Ghadarmenian",1346,"Ghemiddlehookcyrillic",1172,"Ghestrokecyrillic",1170,"Gheupturncyrillic",1168,"Ghook",403,"Gimarmenian",1331,"Gjecyrillic",1027,"Gmacron",7712,"Gmonospace",65319,"Grave",63182,"Gravesmall",63328,"Gsmall",63335,"Gsmallhook",667,"Gstroke",484,"H",72,"H18533",9679,"H18543",9642,"H18551",9643,"H22073",9633,"HPsquare",13259,"Haabkhasiancyrillic",1192,"Hadescendercyrillic",1202,"Hardsigncyrillic",1066,"Hbar",294,"Hbrevebelow",7722,"Hcedilla",7720,"Hcircle",9405,"Hcircumflex",292,"Hdieresis",7718,"Hdotaccent",7714,"Hdotbelow",7716,"Hmonospace",65320,"Hoarmenian",1344,"Horicoptic",1e3,"Hsmall",63336,"Hungarumlaut",63183,"Hungarumlautsmall",63224,"Hzsquare",13200,"I",73,"IAcyrillic",1071,"IJ",306,"IUcyrillic",1070,"Iacute",205,"Iacutesmall",63469,"Ibreve",300,"Icaron",463,"Icircle",9406,"Icircumflex",206,"Icircumflexsmall",63470,"Icyrillic",1030,"Idblgrave",520,"Idieresis",207,"Idieresisacute",7726,"Idieresiscyrillic",1252,"Idieresissmall",63471,"Idot",304,"Idotaccent",304,"Idotbelow",7882,"Iebrevecyrillic",1238,"Iecyrillic",1045,"Ifraktur",8465,"Igrave",204,"Igravesmall",63468,"Ihookabove",7880,"Iicyrillic",1048,"Iinvertedbreve",522,"Iishortcyrillic",1049,"Imacron",298,"Imacroncyrillic",1250,"Imonospace",65321,"Iniarmenian",1339,"Iocyrillic",1025,"Iogonek",302,"Iota",921,"Iotaafrican",406,"Iotadieresis",938,"Iotatonos",906,"Ismall",63337,"Istroke",407,"Itilde",296,"Itildebelow",7724,"Izhitsacyrillic",1140,"Izhitsadblgravecyrillic",1142,"J",74,"Jaarmenian",1345,"Jcircle",9407,"Jcircumflex",308,"Jecyrillic",1032,"Jheharmenian",1355,"Jmonospace",65322,"Jsmall",63338,"K",75,"KBsquare",13189,"KKsquare",13261,"Kabashkircyrillic",1184,"Kacute",7728,"Kacyrillic",1050,"Kadescendercyrillic",1178,"Kahookcyrillic",1219,"Kappa",922,"Kastrokecyrillic",1182,"Kaverticalstrokecyrillic",1180,"Kcaron",488,"Kcedilla",310,"Kcircle",9408,"Kcommaaccent",310,"Kdotbelow",7730,"Keharmenian",1364,"Kenarmenian",1343,"Khacyrillic",1061,"Kheicoptic",998,"Khook",408,"Kjecyrillic",1036,"Klinebelow",7732,"Kmonospace",65323,"Koppacyrillic",1152,"Koppagreek",990,"Ksicyrillic",1134,"Ksmall",63339,"L",76,"LJ",455,"LL",63167,"Lacute",313,"Lambda",923,"Lcaron",317,"Lcedilla",315,"Lcircle",9409,"Lcircumflexbelow",7740,"Lcommaaccent",315,"Ldot",319,"Ldotaccent",319,"Ldotbelow",7734,"Ldotbelowmacron",7736,"Liwnarmenian",1340,"Lj",456,"Ljecyrillic",1033,"Llinebelow",7738,"Lmonospace",65324,"Lslash",321,"Lslashsmall",63225,"Lsmall",63340,"M",77,"MBsquare",13190,"Macron",63184,"Macronsmall",63407,"Macute",7742,"Mcircle",9410,"Mdotaccent",7744,"Mdotbelow",7746,"Menarmenian",1348,"Mmonospace",65325,"Msmall",63341,"Mturned",412,"Mu",924,"N",78,"NJ",458,"Nacute",323,"Ncaron",327,"Ncedilla",325,"Ncircle",9411,"Ncircumflexbelow",7754,"Ncommaaccent",325,"Ndotaccent",7748,"Ndotbelow",7750,"Nhookleft",413,"Nineroman",8552,"Nj",459,"Njecyrillic",1034,"Nlinebelow",7752,"Nmonospace",65326,"Nowarmenian",1350,"Nsmall",63342,"Ntilde",209,"Ntildesmall",63473,"Nu",925,"O",79,"OE",338,"OEsmall",63226,"Oacute",211,"Oacutesmall",63475,"Obarredcyrillic",1256,"Obarreddieresiscyrillic",1258,"Obreve",334,"Ocaron",465,"Ocenteredtilde",415,"Ocircle",9412,"Ocircumflex",212,"Ocircumflexacute",7888,"Ocircumflexdotbelow",7896,"Ocircumflexgrave",7890,"Ocircumflexhookabove",7892,"Ocircumflexsmall",63476,"Ocircumflextilde",7894,"Ocyrillic",1054,"Odblacute",336,"Odblgrave",524,"Odieresis",214,"Odieresiscyrillic",1254,"Odieresissmall",63478,"Odotbelow",7884,"Ogoneksmall",63227,"Ograve",210,"Ogravesmall",63474,"Oharmenian",1365,"Ohm",8486,"Ohookabove",7886,"Ohorn",416,"Ohornacute",7898,"Ohorndotbelow",7906,"Ohorngrave",7900,"Ohornhookabove",7902,"Ohorntilde",7904,"Ohungarumlaut",336,"Oi",418,"Oinvertedbreve",526,"Omacron",332,"Omacronacute",7762,"Omacrongrave",7760,"Omega",8486,"Omegacyrillic",1120,"Omegagreek",937,"Omegaroundcyrillic",1146,"Omegatitlocyrillic",1148,"Omegatonos",911,"Omicron",927,"Omicrontonos",908,"Omonospace",65327,"Oneroman",8544,"Oogonek",490,"Oogonekmacron",492,"Oopen",390,"Oslash",216,"Oslashacute",510,"Oslashsmall",63480,"Osmall",63343,"Ostrokeacute",510,"Otcyrillic",1150,"Otilde",213,"Otildeacute",7756,"Otildedieresis",7758,"Otildesmall",63477,"P",80,"Pacute",7764,"Pcircle",9413,"Pdotaccent",7766,"Pecyrillic",1055,"Peharmenian",1354,"Pemiddlehookcyrillic",1190,"Phi",934,"Phook",420,"Pi",928,"Piwrarmenian",1363,"Pmonospace",65328,"Psi",936,"Psicyrillic",1136,"Psmall",63344,"Q",81,"Qcircle",9414,"Qmonospace",65329,"Qsmall",63345,"R",82,"Raarmenian",1356,"Racute",340,"Rcaron",344,"Rcedilla",342,"Rcircle",9415,"Rcommaaccent",342,"Rdblgrave",528,"Rdotaccent",7768,"Rdotbelow",7770,"Rdotbelowmacron",7772,"Reharmenian",1360,"Rfraktur",8476,"Rho",929,"Ringsmall",63228,"Rinvertedbreve",530,"Rlinebelow",7774,"Rmonospace",65330,"Rsmall",63346,"Rsmallinverted",641,"Rsmallinvertedsuperior",694,"S",83,"SF010000",9484,"SF020000",9492,"SF030000",9488,"SF040000",9496,"SF050000",9532,"SF060000",9516,"SF070000",9524,"SF080000",9500,"SF090000",9508,"SF100000",9472,"SF110000",9474,"SF190000",9569,"SF200000",9570,"SF210000",9558,"SF220000",9557,"SF230000",9571,"SF240000",9553,"SF250000",9559,"SF260000",9565,"SF270000",9564,"SF280000",9563,"SF360000",9566,"SF370000",9567,"SF380000",9562,"SF390000",9556,"SF400000",9577,"SF410000",9574,"SF420000",9568,"SF430000",9552,"SF440000",9580,"SF450000",9575,"SF460000",9576,"SF470000",9572,"SF480000",9573,"SF490000",9561,"SF500000",9560,"SF510000",9554,"SF520000",9555,"SF530000",9579,"SF540000",9578,"Sacute",346,"Sacutedotaccent",7780,"Sampigreek",992,"Scaron",352,"Scarondotaccent",7782,"Scaronsmall",63229,"Scedilla",350,"Schwa",399,"Schwacyrillic",1240,"Schwadieresiscyrillic",1242,"Scircle",9416,"Scircumflex",348,"Scommaaccent",536,"Sdotaccent",7776,"Sdotbelow",7778,"Sdotbelowdotaccent",7784,"Seharmenian",1357,"Sevenroman",8550,"Shaarmenian",1351,"Shacyrillic",1064,"Shchacyrillic",1065,"Sheicoptic",994,"Shhacyrillic",1210,"Shimacoptic",1004,"Sigma",931,"Sixroman",8549,"Smonospace",65331,"Softsigncyrillic",1068,"Ssmall",63347,"Stigmagreek",986,"T",84,"Tau",932,"Tbar",358,"Tcaron",356,"Tcedilla",354,"Tcircle",9417,"Tcircumflexbelow",7792,"Tcommaaccent",354,"Tdotaccent",7786,"Tdotbelow",7788,"Tecyrillic",1058,"Tedescendercyrillic",1196,"Tenroman",8553,"Tetsecyrillic",1204,"Theta",920,"Thook",428,"Thorn",222,"Thornsmall",63486,"Threeroman",8546,"Tildesmall",63230,"Tiwnarmenian",1359,"Tlinebelow",7790,"Tmonospace",65332,"Toarmenian",1337,"Tonefive",444,"Tonesix",388,"Tonetwo",423,"Tretroflexhook",430,"Tsecyrillic",1062,"Tshecyrillic",1035,"Tsmall",63348,"Twelveroman",8555,"Tworoman",8545,"U",85,"Uacute",218,"Uacutesmall",63482,"Ubreve",364,"Ucaron",467,"Ucircle",9418,"Ucircumflex",219,"Ucircumflexbelow",7798,"Ucircumflexsmall",63483,"Ucyrillic",1059,"Udblacute",368,"Udblgrave",532,"Udieresis",220,"Udieresisacute",471,"Udieresisbelow",7794,"Udieresiscaron",473,"Udieresiscyrillic",1264,"Udieresisgrave",475,"Udieresismacron",469,"Udieresissmall",63484,"Udotbelow",7908,"Ugrave",217,"Ugravesmall",63481,"Uhookabove",7910,"Uhorn",431,"Uhornacute",7912,"Uhorndotbelow",7920,"Uhorngrave",7914,"Uhornhookabove",7916,"Uhorntilde",7918,"Uhungarumlaut",368,"Uhungarumlautcyrillic",1266,"Uinvertedbreve",534,"Ukcyrillic",1144,"Umacron",362,"Umacroncyrillic",1262,"Umacrondieresis",7802,"Umonospace",65333,"Uogonek",370,"Upsilon",933,"Upsilon1",978,"Upsilonacutehooksymbolgreek",979,"Upsilonafrican",433,"Upsilondieresis",939,"Upsilondieresishooksymbolgreek",980,"Upsilonhooksymbol",978,"Upsilontonos",910,"Uring",366,"Ushortcyrillic",1038,"Usmall",63349,"Ustraightcyrillic",1198,"Ustraightstrokecyrillic",1200,"Utilde",360,"Utildeacute",7800,"Utildebelow",7796,"V",86,"Vcircle",9419,"Vdotbelow",7806,"Vecyrillic",1042,"Vewarmenian",1358,"Vhook",434,"Vmonospace",65334,"Voarmenian",1352,"Vsmall",63350,"Vtilde",7804,"W",87,"Wacute",7810,"Wcircle",9420,"Wcircumflex",372,"Wdieresis",7812,"Wdotaccent",7814,"Wdotbelow",7816,"Wgrave",7808,"Wmonospace",65335,"Wsmall",63351,"X",88,"Xcircle",9421,"Xdieresis",7820,"Xdotaccent",7818,"Xeharmenian",1341,"Xi",926,"Xmonospace",65336,"Xsmall",63352,"Y",89,"Yacute",221,"Yacutesmall",63485,"Yatcyrillic",1122,"Ycircle",9422,"Ycircumflex",374,"Ydieresis",376,"Ydieresissmall",63487,"Ydotaccent",7822,"Ydotbelow",7924,"Yericyrillic",1067,"Yerudieresiscyrillic",1272,"Ygrave",7922,"Yhook",435,"Yhookabove",7926,"Yiarmenian",1349,"Yicyrillic",1031,"Yiwnarmenian",1362,"Ymonospace",65337,"Ysmall",63353,"Ytilde",7928,"Yusbigcyrillic",1130,"Yusbigiotifiedcyrillic",1132,"Yuslittlecyrillic",1126,"Yuslittleiotifiedcyrillic",1128,"Z",90,"Zaarmenian",1334,"Zacute",377,"Zcaron",381,"Zcaronsmall",63231,"Zcircle",9423,"Zcircumflex",7824,"Zdot",379,"Zdotaccent",379,"Zdotbelow",7826,"Zecyrillic",1047,"Zedescendercyrillic",1176,"Zedieresiscyrillic",1246,"Zeta",918,"Zhearmenian",1338,"Zhebrevecyrillic",1217,"Zhecyrillic",1046,"Zhedescendercyrillic",1174,"Zhedieresiscyrillic",1244,"Zlinebelow",7828,"Zmonospace",65338,"Zsmall",63354,"Zstroke",437,"a",97,"aabengali",2438,"aacute",225,"aadeva",2310,"aagujarati",2694,"aagurmukhi",2566,"aamatragurmukhi",2622,"aarusquare",13059,"aavowelsignbengali",2494,"aavowelsigndeva",2366,"aavowelsigngujarati",2750,"abbreviationmarkarmenian",1375,"abbreviationsigndeva",2416,"abengali",2437,"abopomofo",12570,"abreve",259,"abreveacute",7855,"abrevecyrillic",1233,"abrevedotbelow",7863,"abrevegrave",7857,"abrevehookabove",7859,"abrevetilde",7861,"acaron",462,"acircle",9424,"acircumflex",226,"acircumflexacute",7845,"acircumflexdotbelow",7853,"acircumflexgrave",7847,"acircumflexhookabove",7849,"acircumflextilde",7851,"acute",180,"acutebelowcmb",791,"acutecmb",769,"acutecomb",769,"acutedeva",2388,"acutelowmod",719,"acutetonecmb",833,"acyrillic",1072,"adblgrave",513,"addakgurmukhi",2673,"adeva",2309,"adieresis",228,"adieresiscyrillic",1235,"adieresismacron",479,"adotbelow",7841,"adotmacron",481,"ae",230,"aeacute",509,"aekorean",12624,"aemacron",483,"afii00208",8213,"afii08941",8356,"afii10017",1040,"afii10018",1041,"afii10019",1042,"afii10020",1043,"afii10021",1044,"afii10022",1045,"afii10023",1025,"afii10024",1046,"afii10025",1047,"afii10026",1048,"afii10027",1049,"afii10028",1050,"afii10029",1051,"afii10030",1052,"afii10031",1053,"afii10032",1054,"afii10033",1055,"afii10034",1056,"afii10035",1057,"afii10036",1058,"afii10037",1059,"afii10038",1060,"afii10039",1061,"afii10040",1062,"afii10041",1063,"afii10042",1064,"afii10043",1065,"afii10044",1066,"afii10045",1067,"afii10046",1068,"afii10047",1069,"afii10048",1070,"afii10049",1071,"afii10050",1168,"afii10051",1026,"afii10052",1027,"afii10053",1028,"afii10054",1029,"afii10055",1030,"afii10056",1031,"afii10057",1032,"afii10058",1033,"afii10059",1034,"afii10060",1035,"afii10061",1036,"afii10062",1038,"afii10063",63172,"afii10064",63173,"afii10065",1072,"afii10066",1073,"afii10067",1074,"afii10068",1075,"afii10069",1076,"afii10070",1077,"afii10071",1105,"afii10072",1078,"afii10073",1079,"afii10074",1080,"afii10075",1081,"afii10076",1082,"afii10077",1083,"afii10078",1084,"afii10079",1085,"afii10080",1086,"afii10081",1087,"afii10082",1088,"afii10083",1089,"afii10084",1090,"afii10085",1091,"afii10086",1092,"afii10087",1093,"afii10088",1094,"afii10089",1095,"afii10090",1096,"afii10091",1097,"afii10092",1098,"afii10093",1099,"afii10094",1100,"afii10095",1101,"afii10096",1102,"afii10097",1103,"afii10098",1169,"afii10099",1106,"afii10100",1107,"afii10101",1108,"afii10102",1109,"afii10103",1110,"afii10104",1111,"afii10105",1112,"afii10106",1113,"afii10107",1114,"afii10108",1115,"afii10109",1116,"afii10110",1118,"afii10145",1039,"afii10146",1122,"afii10147",1138,"afii10148",1140,"afii10192",63174,"afii10193",1119,"afii10194",1123,"afii10195",1139,"afii10196",1141,"afii10831",63175,"afii10832",63176,"afii10846",1241,"afii299",8206,"afii300",8207,"afii301",8205,"afii57381",1642,"afii57388",1548,"afii57392",1632,"afii57393",1633,"afii57394",1634,"afii57395",1635,"afii57396",1636,"afii57397",1637,"afii57398",1638,"afii57399",1639,"afii57400",1640,"afii57401",1641,"afii57403",1563,"afii57407",1567,"afii57409",1569,"afii57410",1570,"afii57411",1571,"afii57412",1572,"afii57413",1573,"afii57414",1574,"afii57415",1575,"afii57416",1576,"afii57417",1577,"afii57418",1578,"afii57419",1579,"afii57420",1580,"afii57421",1581,"afii57422",1582,"afii57423",1583,"afii57424",1584,"afii57425",1585,"afii57426",1586,"afii57427",1587,"afii57428",1588,"afii57429",1589,"afii57430",1590,"afii57431",1591,"afii57432",1592,"afii57433",1593,"afii57434",1594,"afii57440",1600,"afii57441",1601,"afii57442",1602,"afii57443",1603,"afii57444",1604,"afii57445",1605,"afii57446",1606,"afii57448",1608,"afii57449",1609,"afii57450",1610,"afii57451",1611,"afii57452",1612,"afii57453",1613,"afii57454",1614,"afii57455",1615,"afii57456",1616,"afii57457",1617,"afii57458",1618,"afii57470",1607,"afii57505",1700,"afii57506",1662,"afii57507",1670,"afii57508",1688,"afii57509",1711,"afii57511",1657,"afii57512",1672,"afii57513",1681,"afii57514",1722,"afii57519",1746,"afii57534",1749,"afii57636",8362,"afii57645",1470,"afii57658",1475,"afii57664",1488,"afii57665",1489,"afii57666",1490,"afii57667",1491,"afii57668",1492,"afii57669",1493,"afii57670",1494,"afii57671",1495,"afii57672",1496,"afii57673",1497,"afii57674",1498,"afii57675",1499,"afii57676",1500,"afii57677",1501,"afii57678",1502,"afii57679",1503,"afii57680",1504,"afii57681",1505,"afii57682",1506,"afii57683",1507,"afii57684",1508,"afii57685",1509,"afii57686",1510,"afii57687",1511,"afii57688",1512,"afii57689",1513,"afii57690",1514,"afii57694",64298,"afii57695",64299,"afii57700",64331,"afii57705",64287,"afii57716",1520,"afii57717",1521,"afii57718",1522,"afii57723",64309,"afii57793",1460,"afii57794",1461,"afii57795",1462,"afii57796",1467,"afii57797",1464,"afii57798",1463,"afii57799",1456,"afii57800",1458,"afii57801",1457,"afii57802",1459,"afii57803",1474,"afii57804",1473,"afii57806",1465,"afii57807",1468,"afii57839",1469,"afii57841",1471,"afii57842",1472,"afii57929",700,"afii61248",8453,"afii61289",8467,"afii61352",8470,"afii61573",8236,"afii61574",8237,"afii61575",8238,"afii61664",8204,"afii63167",1645,"afii64937",701,"agrave",224,"agujarati",2693,"agurmukhi",2565,"ahiragana",12354,"ahookabove",7843,"aibengali",2448,"aibopomofo",12574,"aideva",2320,"aiecyrillic",1237,"aigujarati",2704,"aigurmukhi",2576,"aimatragurmukhi",2632,"ainarabic",1593,"ainfinalarabic",65226,"aininitialarabic",65227,"ainmedialarabic",65228,"ainvertedbreve",515,"aivowelsignbengali",2504,"aivowelsigndeva",2376,"aivowelsigngujarati",2760,"akatakana",12450,"akatakanahalfwidth",65393,"akorean",12623,"alef",1488,"alefarabic",1575,"alefdageshhebrew",64304,"aleffinalarabic",65166,"alefhamzaabovearabic",1571,"alefhamzaabovefinalarabic",65156,"alefhamzabelowarabic",1573,"alefhamzabelowfinalarabic",65160,"alefhebrew",1488,"aleflamedhebrew",64335,"alefmaddaabovearabic",1570,"alefmaddaabovefinalarabic",65154,"alefmaksuraarabic",1609,"alefmaksurafinalarabic",65264,"alefmaksurainitialarabic",65267,"alefmaksuramedialarabic",65268,"alefpatahhebrew",64302,"alefqamatshebrew",64303,"aleph",8501,"allequal",8780,"alpha",945,"alphatonos",940,"amacron",257,"amonospace",65345,"ampersand",38,"ampersandmonospace",65286,"ampersandsmall",63270,"amsquare",13250,"anbopomofo",12578,"angbopomofo",12580,"angbracketleft",12296,"angbracketright",12297,"angkhankhuthai",3674,"angle",8736,"anglebracketleft",12296,"anglebracketleftvertical",65087,"anglebracketright",12297,"anglebracketrightvertical",65088,"angleleft",9001,"angleright",9002,"angstrom",8491,"anoteleia",903,"anudattadeva",2386,"anusvarabengali",2434,"anusvaradeva",2306,"anusvaragujarati",2690,"aogonek",261,"apaatosquare",13056,"aparen",9372,"apostrophearmenian",1370,"apostrophemod",700,"apple",63743,"approaches",8784,"approxequal",8776,"approxequalorimage",8786,"approximatelyequal",8773,"araeaekorean",12686,"araeakorean",12685,"arc",8978,"arighthalfring",7834,"aring",229,"aringacute",507,"aringbelow",7681,"arrowboth",8596,"arrowdashdown",8675,"arrowdashleft",8672,"arrowdashright",8674,"arrowdashup",8673,"arrowdblboth",8660,"arrowdbldown",8659,"arrowdblleft",8656,"arrowdblright",8658,"arrowdblup",8657,"arrowdown",8595,"arrowdownleft",8601,"arrowdownright",8600,"arrowdownwhite",8681,"arrowheaddownmod",709,"arrowheadleftmod",706,"arrowheadrightmod",707,"arrowheadupmod",708,"arrowhorizex",63719,"arrowleft",8592,"arrowleftdbl",8656,"arrowleftdblstroke",8653,"arrowleftoverright",8646,"arrowleftwhite",8678,"arrowright",8594,"arrowrightdblstroke",8655,"arrowrightheavy",10142,"arrowrightoverleft",8644,"arrowrightwhite",8680,"arrowtableft",8676,"arrowtabright",8677,"arrowup",8593,"arrowupdn",8597,"arrowupdnbse",8616,"arrowupdownbase",8616,"arrowupleft",8598,"arrowupleftofdown",8645,"arrowupright",8599,"arrowupwhite",8679,"arrowvertex",63718,"asciicircum",94,"asciicircummonospace",65342,"asciitilde",126,"asciitildemonospace",65374,"ascript",593,"ascriptturned",594,"asmallhiragana",12353,"asmallkatakana",12449,"asmallkatakanahalfwidth",65383,"asterisk",42,"asteriskaltonearabic",1645,"asteriskarabic",1645,"asteriskmath",8727,"asteriskmonospace",65290,"asterisksmall",65121,"asterism",8258,"asuperior",63209,"asymptoticallyequal",8771,"at",64,"atilde",227,"atmonospace",65312,"atsmall",65131,"aturned",592,"aubengali",2452,"aubopomofo",12576,"audeva",2324,"augujarati",2708,"augurmukhi",2580,"aulengthmarkbengali",2519,"aumatragurmukhi",2636,"auvowelsignbengali",2508,"auvowelsigndeva",2380,"auvowelsigngujarati",2764,"avagrahadeva",2365,"aybarmenian",1377,"ayin",1506,"ayinaltonehebrew",64288,"ayinhebrew",1506,"b",98,"babengali",2476,"backslash",92,"backslashmonospace",65340,"badeva",2348,"bagujarati",2732,"bagurmukhi",2604,"bahiragana",12400,"bahtthai",3647,"bakatakana",12496,"bar",124,"barmonospace",65372,"bbopomofo",12549,"bcircle",9425,"bdotaccent",7683,"bdotbelow",7685,"beamedsixteenthnotes",9836,"because",8757,"becyrillic",1073,"beharabic",1576,"behfinalarabic",65168,"behinitialarabic",65169,"behiragana",12409,"behmedialarabic",65170,"behmeeminitialarabic",64671,"behmeemisolatedarabic",64520,"behnoonfinalarabic",64621,"bekatakana",12505,"benarmenian",1378,"bet",1489,"beta",946,"betasymbolgreek",976,"betdagesh",64305,"betdageshhebrew",64305,"bethebrew",1489,"betrafehebrew",64332,"bhabengali",2477,"bhadeva",2349,"bhagujarati",2733,"bhagurmukhi",2605,"bhook",595,"bihiragana",12403,"bikatakana",12499,"bilabialclick",664,"bindigurmukhi",2562,"birusquare",13105,"blackcircle",9679,"blackdiamond",9670,"blackdownpointingtriangle",9660,"blackleftpointingpointer",9668,"blackleftpointingtriangle",9664,"blacklenticularbracketleft",12304,"blacklenticularbracketleftvertical",65083,"blacklenticularbracketright",12305,"blacklenticularbracketrightvertical",65084,"blacklowerlefttriangle",9699,"blacklowerrighttriangle",9698,"blackrectangle",9644,"blackrightpointingpointer",9658,"blackrightpointingtriangle",9654,"blacksmallsquare",9642,"blacksmilingface",9787,"blacksquare",9632,"blackstar",9733,"blackupperlefttriangle",9700,"blackupperrighttriangle",9701,"blackuppointingsmalltriangle",9652,"blackuppointingtriangle",9650,"blank",9251,"blinebelow",7687,"block",9608,"bmonospace",65346,"bobaimaithai",3610,"bohiragana",12412,"bokatakana",12508,"bparen",9373,"bqsquare",13251,"braceex",63732,"braceleft",123,"braceleftbt",63731,"braceleftmid",63730,"braceleftmonospace",65371,"braceleftsmall",65115,"bracelefttp",63729,"braceleftvertical",65079,"braceright",125,"bracerightbt",63742,"bracerightmid",63741,"bracerightmonospace",65373,"bracerightsmall",65116,"bracerighttp",63740,"bracerightvertical",65080,"bracketleft",91,"bracketleftbt",63728,"bracketleftex",63727,"bracketleftmonospace",65339,"bracketlefttp",63726,"bracketright",93,"bracketrightbt",63739,"bracketrightex",63738,"bracketrightmonospace",65341,"bracketrighttp",63737,"breve",728,"brevebelowcmb",814,"brevecmb",774,"breveinvertedbelowcmb",815,"breveinvertedcmb",785,"breveinverteddoublecmb",865,"bridgebelowcmb",810,"bridgeinvertedbelowcmb",826,"brokenbar",166,"bstroke",384,"bsuperior",63210,"btopbar",387,"buhiragana",12406,"bukatakana",12502,"bullet",8226,"bulletinverse",9688,"bulletoperator",8729,"bullseye",9678,"c",99,"caarmenian",1390,"cabengali",2458,"cacute",263,"cadeva",2330,"cagujarati",2714,"cagurmukhi",2586,"calsquare",13192,"candrabindubengali",2433,"candrabinducmb",784,"candrabindudeva",2305,"candrabindugujarati",2689,"capslock",8682,"careof",8453,"caron",711,"caronbelowcmb",812,"caroncmb",780,"carriagereturn",8629,"cbopomofo",12568,"ccaron",269,"ccedilla",231,"ccedillaacute",7689,"ccircle",9426,"ccircumflex",265,"ccurl",597,"cdot",267,"cdotaccent",267,"cdsquare",13253,"cedilla",184,"cedillacmb",807,"cent",162,"centigrade",8451,"centinferior",63199,"centmonospace",65504,"centoldstyle",63394,"centsuperior",63200,"chaarmenian",1401,"chabengali",2459,"chadeva",2331,"chagujarati",2715,"chagurmukhi",2587,"chbopomofo",12564,"cheabkhasiancyrillic",1213,"checkmark",10003,"checyrillic",1095,"chedescenderabkhasiancyrillic",1215,"chedescendercyrillic",1207,"chedieresiscyrillic",1269,"cheharmenian",1395,"chekhakassiancyrillic",1228,"cheverticalstrokecyrillic",1209,"chi",967,"chieuchacirclekorean",12919,"chieuchaparenkorean",12823,"chieuchcirclekorean",12905,"chieuchkorean",12618,"chieuchparenkorean",12809,"chochangthai",3594,"chochanthai",3592,"chochingthai",3593,"chochoethai",3596,"chook",392,"cieucacirclekorean",12918,"cieucaparenkorean",12822,"cieuccirclekorean",12904,"cieuckorean",12616,"cieucparenkorean",12808,"cieucuparenkorean",12828,"circle",9675,"circlecopyrt",169,"circlemultiply",8855,"circleot",8857,"circleplus",8853,"circlepostalmark",12342,"circlewithlefthalfblack",9680,"circlewithrighthalfblack",9681,"circumflex",710,"circumflexbelowcmb",813,"circumflexcmb",770,"clear",8999,"clickalveolar",450,"clickdental",448,"clicklateral",449,"clickretroflex",451,"club",9827,"clubsuitblack",9827,"clubsuitwhite",9831,"cmcubedsquare",13220,"cmonospace",65347,"cmsquaredsquare",13216,"coarmenian",1409,"colon",58,"colonmonetary",8353,"colonmonospace",65306,"colonsign",8353,"colonsmall",65109,"colontriangularhalfmod",721,"colontriangularmod",720,"comma",44,"commaabovecmb",787,"commaaboverightcmb",789,"commaaccent",63171,"commaarabic",1548,"commaarmenian",1373,"commainferior",63201,"commamonospace",65292,"commareversedabovecmb",788,"commareversedmod",701,"commasmall",65104,"commasuperior",63202,"commaturnedabovecmb",786,"commaturnedmod",699,"compass",9788,"congruent",8773,"contourintegral",8750,"control",8963,"controlACK",6,"controlBEL",7,"controlBS",8,"controlCAN",24,"controlCR",13,"controlDC1",17,"controlDC2",18,"controlDC3",19,"controlDC4",20,"controlDEL",127,"controlDLE",16,"controlEM",25,"controlENQ",5,"controlEOT",4,"controlESC",27,"controlETB",23,"controlETX",3,"controlFF",12,"controlFS",28,"controlGS",29,"controlHT",9,"controlLF",10,"controlNAK",21,"controlNULL",0,"controlRS",30,"controlSI",15,"controlSO",14,"controlSOT",2,"controlSTX",1,"controlSUB",26,"controlSYN",22,"controlUS",31,"controlVT",11,"copyright",169,"copyrightsans",63721,"copyrightserif",63193,"cornerbracketleft",12300,"cornerbracketlefthalfwidth",65378,"cornerbracketleftvertical",65089,"cornerbracketright",12301,"cornerbracketrighthalfwidth",65379,"cornerbracketrightvertical",65090,"corporationsquare",13183,"cosquare",13255,"coverkgsquare",13254,"cparen",9374,"cruzeiro",8354,"cstretched",663,"curlyand",8911,"curlyor",8910,"currency",164,"cyrBreve",63185,"cyrFlex",63186,"cyrbreve",63188,"cyrflex",63189,"d",100,"daarmenian",1380,"dabengali",2470,"dadarabic",1590,"dadeva",2342,"dadfinalarabic",65214,"dadinitialarabic",65215,"dadmedialarabic",65216,"dagesh",1468,"dageshhebrew",1468,"dagger",8224,"daggerdbl",8225,"dagujarati",2726,"dagurmukhi",2598,"dahiragana",12384,"dakatakana",12480,"dalarabic",1583,"dalet",1491,"daletdagesh",64307,"daletdageshhebrew",64307,"dalethebrew",1491,"dalfinalarabic",65194,"dammaarabic",1615,"dammalowarabic",1615,"dammatanaltonearabic",1612,"dammatanarabic",1612,"danda",2404,"dargahebrew",1447,"dargalefthebrew",1447,"dasiapneumatacyrilliccmb",1157,"dblGrave",63187,"dblanglebracketleft",12298,"dblanglebracketleftvertical",65085,"dblanglebracketright",12299,"dblanglebracketrightvertical",65086,"dblarchinvertedbelowcmb",811,"dblarrowleft",8660,"dblarrowright",8658,"dbldanda",2405,"dblgrave",63190,"dblgravecmb",783,"dblintegral",8748,"dbllowline",8215,"dbllowlinecmb",819,"dbloverlinecmb",831,"dblprimemod",698,"dblverticalbar",8214,"dblverticallineabovecmb",782,"dbopomofo",12553,"dbsquare",13256,"dcaron",271,"dcedilla",7697,"dcircle",9427,"dcircumflexbelow",7699,"dcroat",273,"ddabengali",2465,"ddadeva",2337,"ddagujarati",2721,"ddagurmukhi",2593,"ddalarabic",1672,"ddalfinalarabic",64393,"dddhadeva",2396,"ddhabengali",2466,"ddhadeva",2338,"ddhagujarati",2722,"ddhagurmukhi",2594,"ddotaccent",7691,"ddotbelow",7693,"decimalseparatorarabic",1643,"decimalseparatorpersian",1643,"decyrillic",1076,"degree",176,"dehihebrew",1453,"dehiragana",12391,"deicoptic",1007,"dekatakana",12487,"deleteleft",9003,"deleteright",8998,"delta",948,"deltaturned",397,"denominatorminusonenumeratorbengali",2552,"dezh",676,"dhabengali",2471,"dhadeva",2343,"dhagujarati",2727,"dhagurmukhi",2599,"dhook",599,"dialytikatonos",901,"dialytikatonoscmb",836,"diamond",9830,"diamondsuitwhite",9826,"dieresis",168,"dieresisacute",63191,"dieresisbelowcmb",804,"dieresiscmb",776,"dieresisgrave",63192,"dieresistonos",901,"dihiragana",12386,"dikatakana",12482,"dittomark",12291,"divide",247,"divides",8739,"divisionslash",8725,"djecyrillic",1106,"dkshade",9619,"dlinebelow",7695,"dlsquare",13207,"dmacron",273,"dmonospace",65348,"dnblock",9604,"dochadathai",3598,"dodekthai",3604,"dohiragana",12393,"dokatakana",12489,"dollar",36,"dollarinferior",63203,"dollarmonospace",65284,"dollaroldstyle",63268,"dollarsmall",65129,"dollarsuperior",63204,"dong",8363,"dorusquare",13094,"dotaccent",729,"dotaccentcmb",775,"dotbelowcmb",803,"dotbelowcomb",803,"dotkatakana",12539,"dotlessi",305,"dotlessj",63166,"dotlessjstrokehook",644,"dotmath",8901,"dottedcircle",9676,"doubleyodpatah",64287,"doubleyodpatahhebrew",64287,"downtackbelowcmb",798,"downtackmod",725,"dparen",9375,"dsuperior",63211,"dtail",598,"dtopbar",396,"duhiragana",12389,"dukatakana",12485,"dz",499,"dzaltone",675,"dzcaron",454,"dzcurl",677,"dzeabkhasiancyrillic",1249,"dzecyrillic",1109,"dzhecyrillic",1119,"e",101,"eacute",233,"earth",9793,"ebengali",2447,"ebopomofo",12572,"ebreve",277,"ecandradeva",2317,"ecandragujarati",2701,"ecandravowelsigndeva",2373,"ecandravowelsigngujarati",2757,"ecaron",283,"ecedillabreve",7709,"echarmenian",1381,"echyiwnarmenian",1415,"ecircle",9428,"ecircumflex",234,"ecircumflexacute",7871,"ecircumflexbelow",7705,"ecircumflexdotbelow",7879,"ecircumflexgrave",7873,"ecircumflexhookabove",7875,"ecircumflextilde",7877,"ecyrillic",1108,"edblgrave",517,"edeva",2319,"edieresis",235,"edot",279,"edotaccent",279,"edotbelow",7865,"eegurmukhi",2575,"eematragurmukhi",2631,"efcyrillic",1092,"egrave",232,"egujarati",2703,"eharmenian",1383,"ehbopomofo",12573,"ehiragana",12360,"ehookabove",7867,"eibopomofo",12575,"eight",56,"eightarabic",1640,"eightbengali",2542,"eightcircle",9319,"eightcircleinversesansserif",10129,"eightdeva",2414,"eighteencircle",9329,"eighteenparen",9349,"eighteenperiod",9369,"eightgujarati",2798,"eightgurmukhi",2670,"eighthackarabic",1640,"eighthangzhou",12328,"eighthnotebeamed",9835,"eightideographicparen",12839,"eightinferior",8328,"eightmonospace",65304,"eightoldstyle",63288,"eightparen",9339,"eightperiod",9359,"eightpersian",1784,"eightroman",8567,"eightsuperior",8312,"eightthai",3672,"einvertedbreve",519,"eiotifiedcyrillic",1125,"ekatakana",12456,"ekatakanahalfwidth",65396,"ekonkargurmukhi",2676,"ekorean",12628,"elcyrillic",1083,"element",8712,"elevencircle",9322,"elevenparen",9342,"elevenperiod",9362,"elevenroman",8570,"ellipsis",8230,"ellipsisvertical",8942,"emacron",275,"emacronacute",7703,"emacrongrave",7701,"emcyrillic",1084,"emdash",8212,"emdashvertical",65073,"emonospace",65349,"emphasismarkarmenian",1371,"emptyset",8709,"enbopomofo",12579,"encyrillic",1085,"endash",8211,"endashvertical",65074,"endescendercyrillic",1187,"eng",331,"engbopomofo",12581,"enghecyrillic",1189,"enhookcyrillic",1224,"enspace",8194,"eogonek",281,"eokorean",12627,"eopen",603,"eopenclosed",666,"eopenreversed",604,"eopenreversedclosed",606,"eopenreversedhook",605,"eparen",9376,"epsilon",949,"epsilontonos",941,"equal",61,"equalmonospace",65309,"equalsmall",65126,"equalsuperior",8316,"equivalence",8801,"erbopomofo",12582,"ercyrillic",1088,"ereversed",600,"ereversedcyrillic",1101,"escyrillic",1089,"esdescendercyrillic",1195,"esh",643,"eshcurl",646,"eshortdeva",2318,"eshortvowelsigndeva",2374,"eshreversedloop",426,"eshsquatreversed",645,"esmallhiragana",12359,"esmallkatakana",12455,"esmallkatakanahalfwidth",65386,"estimated",8494,"esuperior",63212,"eta",951,"etarmenian",1384,"etatonos",942,"eth",240,"etilde",7869,"etildebelow",7707,"etnahtafoukhhebrew",1425,"etnahtafoukhlefthebrew",1425,"etnahtahebrew",1425,"etnahtalefthebrew",1425,"eturned",477,"eukorean",12641,"euro",8364,"evowelsignbengali",2503,"evowelsigndeva",2375,"evowelsigngujarati",2759,"exclam",33,"exclamarmenian",1372,"exclamdbl",8252,"exclamdown",161,"exclamdownsmall",63393,"exclammonospace",65281,"exclamsmall",63265,"existential",8707,"ezh",658,"ezhcaron",495,"ezhcurl",659,"ezhreversed",441,"ezhtail",442,"f",102,"fadeva",2398,"fagurmukhi",2654,"fahrenheit",8457,"fathaarabic",1614,"fathalowarabic",1614,"fathatanarabic",1611,"fbopomofo",12552,"fcircle",9429,"fdotaccent",7711,"feharabic",1601,"feharmenian",1414,"fehfinalarabic",65234,"fehinitialarabic",65235,"fehmedialarabic",65236,"feicoptic",997,"female",9792,"ff",64256,"f_f",64256,"ffi",64259,"f_f_i",64259,"ffl",64260,"f_f_l",64260,"fi",64257,"f_i",64257,"fifteencircle",9326,"fifteenparen",9346,"fifteenperiod",9366,"figuredash",8210,"filledbox",9632,"filledrect",9644,"finalkaf",1498,"finalkafdagesh",64314,"finalkafdageshhebrew",64314,"finalkafhebrew",1498,"finalmem",1501,"finalmemhebrew",1501,"finalnun",1503,"finalnunhebrew",1503,"finalpe",1507,"finalpehebrew",1507,"finaltsadi",1509,"finaltsadihebrew",1509,"firsttonechinese",713,"fisheye",9673,"fitacyrillic",1139,"five",53,"fivearabic",1637,"fivebengali",2539,"fivecircle",9316,"fivecircleinversesansserif",10126,"fivedeva",2411,"fiveeighths",8541,"fivegujarati",2795,"fivegurmukhi",2667,"fivehackarabic",1637,"fivehangzhou",12325,"fiveideographicparen",12836,"fiveinferior",8325,"fivemonospace",65301,"fiveoldstyle",63285,"fiveparen",9336,"fiveperiod",9356,"fivepersian",1781,"fiveroman",8564,"fivesuperior",8309,"fivethai",3669,"fl",64258,"f_l",64258,"florin",402,"fmonospace",65350,"fmsquare",13209,"fofanthai",3615,"fofathai",3613,"fongmanthai",3663,"forall",8704,"four",52,"fourarabic",1636,"fourbengali",2538,"fourcircle",9315,"fourcircleinversesansserif",10125,"fourdeva",2410,"fourgujarati",2794,"fourgurmukhi",2666,"fourhackarabic",1636,"fourhangzhou",12324,"fourideographicparen",12835,"fourinferior",8324,"fourmonospace",65300,"fournumeratorbengali",2551,"fouroldstyle",63284,"fourparen",9335,"fourperiod",9355,"fourpersian",1780,"fourroman",8563,"foursuperior",8308,"fourteencircle",9325,"fourteenparen",9345,"fourteenperiod",9365,"fourthai",3668,"fourthtonechinese",715,"fparen",9377,"fraction",8260,"franc",8355,"g",103,"gabengali",2455,"gacute",501,"gadeva",2327,"gafarabic",1711,"gaffinalarabic",64403,"gafinitialarabic",64404,"gafmedialarabic",64405,"gagujarati",2711,"gagurmukhi",2583,"gahiragana",12364,"gakatakana",12460,"gamma",947,"gammalatinsmall",611,"gammasuperior",736,"gangiacoptic",1003,"gbopomofo",12557,"gbreve",287,"gcaron",487,"gcedilla",291,"gcircle",9430,"gcircumflex",285,"gcommaaccent",291,"gdot",289,"gdotaccent",289,"gecyrillic",1075,"gehiragana",12370,"gekatakana",12466,"geometricallyequal",8785,"gereshaccenthebrew",1436,"gereshhebrew",1523,"gereshmuqdamhebrew",1437,"germandbls",223,"gershayimaccenthebrew",1438,"gershayimhebrew",1524,"getamark",12307,"ghabengali",2456,"ghadarmenian",1394,"ghadeva",2328,"ghagujarati",2712,"ghagurmukhi",2584,"ghainarabic",1594,"ghainfinalarabic",65230,"ghaininitialarabic",65231,"ghainmedialarabic",65232,"ghemiddlehookcyrillic",1173,"ghestrokecyrillic",1171,"gheupturncyrillic",1169,"ghhadeva",2394,"ghhagurmukhi",2650,"ghook",608,"ghzsquare",13203,"gihiragana",12366,"gikatakana",12462,"gimarmenian",1379,"gimel",1490,"gimeldagesh",64306,"gimeldageshhebrew",64306,"gimelhebrew",1490,"gjecyrillic",1107,"glottalinvertedstroke",446,"glottalstop",660,"glottalstopinverted",662,"glottalstopmod",704,"glottalstopreversed",661,"glottalstopreversedmod",705,"glottalstopreversedsuperior",740,"glottalstopstroke",673,"glottalstopstrokereversed",674,"gmacron",7713,"gmonospace",65351,"gohiragana",12372,"gokatakana",12468,"gparen",9378,"gpasquare",13228,"gradient",8711,"grave",96,"gravebelowcmb",790,"gravecmb",768,"gravecomb",768,"gravedeva",2387,"gravelowmod",718,"gravemonospace",65344,"gravetonecmb",832,"greater",62,"greaterequal",8805,"greaterequalorless",8923,"greatermonospace",65310,"greaterorequivalent",8819,"greaterorless",8823,"greateroverequal",8807,"greatersmall",65125,"gscript",609,"gstroke",485,"guhiragana",12368,"guillemotleft",171,"guillemotright",187,"guilsinglleft",8249,"guilsinglright",8250,"gukatakana",12464,"guramusquare",13080,"gysquare",13257,"h",104,"haabkhasiancyrillic",1193,"haaltonearabic",1729,"habengali",2489,"hadescendercyrillic",1203,"hadeva",2361,"hagujarati",2745,"hagurmukhi",2617,"haharabic",1581,"hahfinalarabic",65186,"hahinitialarabic",65187,"hahiragana",12399,"hahmedialarabic",65188,"haitusquare",13098,"hakatakana",12495,"hakatakanahalfwidth",65418,"halantgurmukhi",2637,"hamzaarabic",1569,"hamzalowarabic",1569,"hangulfiller",12644,"hardsigncyrillic",1098,"harpoonleftbarbup",8636,"harpoonrightbarbup",8640,"hasquare",13258,"hatafpatah",1458,"hatafpatah16",1458,"hatafpatah23",1458,"hatafpatah2f",1458,"hatafpatahhebrew",1458,"hatafpatahnarrowhebrew",1458,"hatafpatahquarterhebrew",1458,"hatafpatahwidehebrew",1458,"hatafqamats",1459,"hatafqamats1b",1459,"hatafqamats28",1459,"hatafqamats34",1459,"hatafqamatshebrew",1459,"hatafqamatsnarrowhebrew",1459,"hatafqamatsquarterhebrew",1459,"hatafqamatswidehebrew",1459,"hatafsegol",1457,"hatafsegol17",1457,"hatafsegol24",1457,"hatafsegol30",1457,"hatafsegolhebrew",1457,"hatafsegolnarrowhebrew",1457,"hatafsegolquarterhebrew",1457,"hatafsegolwidehebrew",1457,"hbar",295,"hbopomofo",12559,"hbrevebelow",7723,"hcedilla",7721,"hcircle",9431,"hcircumflex",293,"hdieresis",7719,"hdotaccent",7715,"hdotbelow",7717,"he",1492,"heart",9829,"heartsuitblack",9829,"heartsuitwhite",9825,"hedagesh",64308,"hedageshhebrew",64308,"hehaltonearabic",1729,"heharabic",1607,"hehebrew",1492,"hehfinalaltonearabic",64423,"hehfinalalttwoarabic",65258,"hehfinalarabic",65258,"hehhamzaabovefinalarabic",64421,"hehhamzaaboveisolatedarabic",64420,"hehinitialaltonearabic",64424,"hehinitialarabic",65259,"hehiragana",12408,"hehmedialaltonearabic",64425,"hehmedialarabic",65260,"heiseierasquare",13179,"hekatakana",12504,"hekatakanahalfwidth",65421,"hekutaarusquare",13110,"henghook",615,"herutusquare",13113,"het",1495,"hethebrew",1495,"hhook",614,"hhooksuperior",689,"hieuhacirclekorean",12923,"hieuhaparenkorean",12827,"hieuhcirclekorean",12909,"hieuhkorean",12622,"hieuhparenkorean",12813,"hihiragana",12402,"hikatakana",12498,"hikatakanahalfwidth",65419,"hiriq",1460,"hiriq14",1460,"hiriq21",1460,"hiriq2d",1460,"hiriqhebrew",1460,"hiriqnarrowhebrew",1460,"hiriqquarterhebrew",1460,"hiriqwidehebrew",1460,"hlinebelow",7830,"hmonospace",65352,"hoarmenian",1392,"hohipthai",3627,"hohiragana",12411,"hokatakana",12507,"hokatakanahalfwidth",65422,"holam",1465,"holam19",1465,"holam26",1465,"holam32",1465,"holamhebrew",1465,"holamnarrowhebrew",1465,"holamquarterhebrew",1465,"holamwidehebrew",1465,"honokhukthai",3630,"hookabovecomb",777,"hookcmb",777,"hookpalatalizedbelowcmb",801,"hookretroflexbelowcmb",802,"hoonsquare",13122,"horicoptic",1001,"horizontalbar",8213,"horncmb",795,"hotsprings",9832,"house",8962,"hparen",9379,"hsuperior",688,"hturned",613,"huhiragana",12405,"huiitosquare",13107,"hukatakana",12501,"hukatakanahalfwidth",65420,"hungarumlaut",733,"hungarumlautcmb",779,"hv",405,"hyphen",45,"hypheninferior",63205,"hyphenmonospace",65293,"hyphensmall",65123,"hyphensuperior",63206,"hyphentwo",8208,"i",105,"iacute",237,"iacyrillic",1103,"ibengali",2439,"ibopomofo",12583,"ibreve",301,"icaron",464,"icircle",9432,"icircumflex",238,"icyrillic",1110,"idblgrave",521,"ideographearthcircle",12943,"ideographfirecircle",12939,"ideographicallianceparen",12863,"ideographiccallparen",12858,"ideographiccentrecircle",12965,"ideographicclose",12294,"ideographiccomma",12289,"ideographiccommaleft",65380,"ideographiccongratulationparen",12855,"ideographiccorrectcircle",12963,"ideographicearthparen",12847,"ideographicenterpriseparen",12861,"ideographicexcellentcircle",12957,"ideographicfestivalparen",12864,"ideographicfinancialcircle",12950,"ideographicfinancialparen",12854,"ideographicfireparen",12843,"ideographichaveparen",12850,"ideographichighcircle",12964,"ideographiciterationmark",12293,"ideographiclaborcircle",12952,"ideographiclaborparen",12856,"ideographicleftcircle",12967,"ideographiclowcircle",12966,"ideographicmedicinecircle",12969,"ideographicmetalparen",12846,"ideographicmoonparen",12842,"ideographicnameparen",12852,"ideographicperiod",12290,"ideographicprintcircle",12958,"ideographicreachparen",12867,"ideographicrepresentparen",12857,"ideographicresourceparen",12862,"ideographicrightcircle",12968,"ideographicsecretcircle",12953,"ideographicselfparen",12866,"ideographicsocietyparen",12851,"ideographicspace",12288,"ideographicspecialparen",12853,"ideographicstockparen",12849,"ideographicstudyparen",12859,"ideographicsunparen",12848,"ideographicsuperviseparen",12860,"ideographicwaterparen",12844,"ideographicwoodparen",12845,"ideographiczero",12295,"ideographmetalcircle",12942,"ideographmooncircle",12938,"ideographnamecircle",12948,"ideographsuncircle",12944,"ideographwatercircle",12940,"ideographwoodcircle",12941,"ideva",2311,"idieresis",239,"idieresisacute",7727,"idieresiscyrillic",1253,"idotbelow",7883,"iebrevecyrillic",1239,"iecyrillic",1077,"ieungacirclekorean",12917,"ieungaparenkorean",12821,"ieungcirclekorean",12903,"ieungkorean",12615,"ieungparenkorean",12807,"igrave",236,"igujarati",2695,"igurmukhi",2567,"ihiragana",12356,"ihookabove",7881,"iibengali",2440,"iicyrillic",1080,"iideva",2312,"iigujarati",2696,"iigurmukhi",2568,"iimatragurmukhi",2624,"iinvertedbreve",523,"iishortcyrillic",1081,"iivowelsignbengali",2496,"iivowelsigndeva",2368,"iivowelsigngujarati",2752,"ij",307,"ikatakana",12452,"ikatakanahalfwidth",65394,"ikorean",12643,"ilde",732,"iluyhebrew",1452,"imacron",299,"imacroncyrillic",1251,"imageorapproximatelyequal",8787,"imatragurmukhi",2623,"imonospace",65353,"increment",8710,"infinity",8734,"iniarmenian",1387,"integral",8747,"integralbottom",8993,"integralbt",8993,"integralex",63733,"integraltop",8992,"integraltp",8992,"intersection",8745,"intisquare",13061,"invbullet",9688,"invcircle",9689,"invsmileface",9787,"iocyrillic",1105,"iogonek",303,"iota",953,"iotadieresis",970,"iotadieresistonos",912,"iotalatin",617,"iotatonos",943,"iparen",9380,"irigurmukhi",2674,"ismallhiragana",12355,"ismallkatakana",12451,"ismallkatakanahalfwidth",65384,"issharbengali",2554,"istroke",616,"isuperior",63213,"iterationhiragana",12445,"iterationkatakana",12541,"itilde",297,"itildebelow",7725,"iubopomofo",12585,"iucyrillic",1102,"ivowelsignbengali",2495,"ivowelsigndeva",2367,"ivowelsigngujarati",2751,"izhitsacyrillic",1141,"izhitsadblgravecyrillic",1143,"j",106,"jaarmenian",1393,"jabengali",2460,"jadeva",2332,"jagujarati",2716,"jagurmukhi",2588,"jbopomofo",12560,"jcaron",496,"jcircle",9433,"jcircumflex",309,"jcrossedtail",669,"jdotlessstroke",607,"jecyrillic",1112,"jeemarabic",1580,"jeemfinalarabic",65182,"jeeminitialarabic",65183,"jeemmedialarabic",65184,"jeharabic",1688,"jehfinalarabic",64395,"jhabengali",2461,"jhadeva",2333,"jhagujarati",2717,"jhagurmukhi",2589,"jheharmenian",1403,"jis",12292,"jmonospace",65354,"jparen",9381,"jsuperior",690,"k",107,"kabashkircyrillic",1185,"kabengali",2453,"kacute",7729,"kacyrillic",1082,"kadescendercyrillic",1179,"kadeva",2325,"kaf",1499,"kafarabic",1603,"kafdagesh",64315,"kafdageshhebrew",64315,"kaffinalarabic",65242,"kafhebrew",1499,"kafinitialarabic",65243,"kafmedialarabic",65244,"kafrafehebrew",64333,"kagujarati",2709,"kagurmukhi",2581,"kahiragana",12363,"kahookcyrillic",1220,"kakatakana",12459,"kakatakanahalfwidth",65398,"kappa",954,"kappasymbolgreek",1008,"kapyeounmieumkorean",12657,"kapyeounphieuphkorean",12676,"kapyeounpieupkorean",12664,"kapyeounssangpieupkorean",12665,"karoriisquare",13069,"kashidaautoarabic",1600,"kashidaautonosidebearingarabic",1600,"kasmallkatakana",12533,"kasquare",13188,"kasraarabic",1616,"kasratanarabic",1613,"kastrokecyrillic",1183,"katahiraprolongmarkhalfwidth",65392,"kaverticalstrokecyrillic",1181,"kbopomofo",12558,"kcalsquare",13193,"kcaron",489,"kcedilla",311,"kcircle",9434,"kcommaaccent",311,"kdotbelow",7731,"keharmenian",1412,"kehiragana",12369,"kekatakana",12465,"kekatakanahalfwidth",65401,"kenarmenian",1391,"kesmallkatakana",12534,"kgreenlandic",312,"khabengali",2454,"khacyrillic",1093,"khadeva",2326,"khagujarati",2710,"khagurmukhi",2582,"khaharabic",1582,"khahfinalarabic",65190,"khahinitialarabic",65191,"khahmedialarabic",65192,"kheicoptic",999,"khhadeva",2393,"khhagurmukhi",2649,"khieukhacirclekorean",12920,"khieukhaparenkorean",12824,"khieukhcirclekorean",12906,"khieukhkorean",12619,"khieukhparenkorean",12810,"khokhaithai",3586,"khokhonthai",3589,"khokhuatthai",3587,"khokhwaithai",3588,"khomutthai",3675,"khook",409,"khorakhangthai",3590,"khzsquare",13201,"kihiragana",12365,"kikatakana",12461,"kikatakanahalfwidth",65399,"kiroguramusquare",13077,"kiromeetorusquare",13078,"kirosquare",13076,"kiyeokacirclekorean",12910,"kiyeokaparenkorean",12814,"kiyeokcirclekorean",12896,"kiyeokkorean",12593,"kiyeokparenkorean",12800,"kiyeoksioskorean",12595,"kjecyrillic",1116,"klinebelow",7733,"klsquare",13208,"kmcubedsquare",13222,"kmonospace",65355,"kmsquaredsquare",13218,"kohiragana",12371,"kohmsquare",13248,"kokaithai",3585,"kokatakana",12467,"kokatakanahalfwidth",65402,"kooposquare",13086,"koppacyrillic",1153,"koreanstandardsymbol",12927,"koroniscmb",835,"kparen",9382,"kpasquare",13226,"ksicyrillic",1135,"ktsquare",13263,"kturned",670,"kuhiragana",12367,"kukatakana",12463,"kukatakanahalfwidth",65400,"kvsquare",13240,"kwsquare",13246,"l",108,"labengali",2482,"lacute",314,"ladeva",2354,"lagujarati",2738,"lagurmukhi",2610,"lakkhangyaothai",3653,"lamaleffinalarabic",65276,"lamalefhamzaabovefinalarabic",65272,"lamalefhamzaaboveisolatedarabic",65271,"lamalefhamzabelowfinalarabic",65274,"lamalefhamzabelowisolatedarabic",65273,"lamalefisolatedarabic",65275,"lamalefmaddaabovefinalarabic",65270,"lamalefmaddaaboveisolatedarabic",65269,"lamarabic",1604,"lambda",955,"lambdastroke",411,"lamed",1500,"lameddagesh",64316,"lameddageshhebrew",64316,"lamedhebrew",1500,"lamfinalarabic",65246,"lamhahinitialarabic",64714,"laminitialarabic",65247,"lamjeeminitialarabic",64713,"lamkhahinitialarabic",64715,"lamlamhehisolatedarabic",65010,"lammedialarabic",65248,"lammeemhahinitialarabic",64904,"lammeeminitialarabic",64716,"largecircle",9711,"lbar",410,"lbelt",620,"lbopomofo",12556,"lcaron",318,"lcedilla",316,"lcircle",9435,"lcircumflexbelow",7741,"lcommaaccent",316,"ldot",320,"ldotaccent",320,"ldotbelow",7735,"ldotbelowmacron",7737,"leftangleabovecmb",794,"lefttackbelowcmb",792,"less",60,"lessequal",8804,"lessequalorgreater",8922,"lessmonospace",65308,"lessorequivalent",8818,"lessorgreater",8822,"lessoverequal",8806,"lesssmall",65124,"lezh",622,"lfblock",9612,"lhookretroflex",621,"lira",8356,"liwnarmenian",1388,"lj",457,"ljecyrillic",1113,"ll",63168,"lladeva",2355,"llagujarati",2739,"llinebelow",7739,"llladeva",2356,"llvocalicbengali",2529,"llvocalicdeva",2401,"llvocalicvowelsignbengali",2531,"llvocalicvowelsigndeva",2403,"lmiddletilde",619,"lmonospace",65356,"lmsquare",13264,"lochulathai",3628,"logicaland",8743,"logicalnot",172,"logicalnotreversed",8976,"logicalor",8744,"lolingthai",3621,"longs",383,"lowlinecenterline",65102,"lowlinecmb",818,"lowlinedashed",65101,"lozenge",9674,"lparen",9383,"lslash",322,"lsquare",8467,"lsuperior",63214,"ltshade",9617,"luthai",3622,"lvocalicbengali",2444,"lvocalicdeva",2316,"lvocalicvowelsignbengali",2530,"lvocalicvowelsigndeva",2402,"lxsquare",13267,"m",109,"mabengali",2478,"macron",175,"macronbelowcmb",817,"macroncmb",772,"macronlowmod",717,"macronmonospace",65507,"macute",7743,"madeva",2350,"magujarati",2734,"magurmukhi",2606,"mahapakhhebrew",1444,"mahapakhlefthebrew",1444,"mahiragana",12414,"maichattawalowleftthai",63637,"maichattawalowrightthai",63636,"maichattawathai",3659,"maichattawaupperleftthai",63635,"maieklowleftthai",63628,"maieklowrightthai",63627,"maiekthai",3656,"maiekupperleftthai",63626,"maihanakatleftthai",63620,"maihanakatthai",3633,"maitaikhuleftthai",63625,"maitaikhuthai",3655,"maitholowleftthai",63631,"maitholowrightthai",63630,"maithothai",3657,"maithoupperleftthai",63629,"maitrilowleftthai",63634,"maitrilowrightthai",63633,"maitrithai",3658,"maitriupperleftthai",63632,"maiyamokthai",3654,"makatakana",12510,"makatakanahalfwidth",65423,"male",9794,"mansyonsquare",13127,"maqafhebrew",1470,"mars",9794,"masoracirclehebrew",1455,"masquare",13187,"mbopomofo",12551,"mbsquare",13268,"mcircle",9436,"mcubedsquare",13221,"mdotaccent",7745,"mdotbelow",7747,"meemarabic",1605,"meemfinalarabic",65250,"meeminitialarabic",65251,"meemmedialarabic",65252,"meemmeeminitialarabic",64721,"meemmeemisolatedarabic",64584,"meetorusquare",13133,"mehiragana",12417,"meizierasquare",13182,"mekatakana",12513,"mekatakanahalfwidth",65426,"mem",1502,"memdagesh",64318,"memdageshhebrew",64318,"memhebrew",1502,"menarmenian",1396,"merkhahebrew",1445,"merkhakefulahebrew",1446,"merkhakefulalefthebrew",1446,"merkhalefthebrew",1445,"mhook",625,"mhzsquare",13202,"middledotkatakanahalfwidth",65381,"middot",183,"mieumacirclekorean",12914,"mieumaparenkorean",12818,"mieumcirclekorean",12900,"mieumkorean",12609,"mieumpansioskorean",12656,"mieumparenkorean",12804,"mieumpieupkorean",12654,"mieumsioskorean",12655,"mihiragana",12415,"mikatakana",12511,"mikatakanahalfwidth",65424,"minus",8722,"minusbelowcmb",800,"minuscircle",8854,"minusmod",727,"minusplus",8723,"minute",8242,"miribaarusquare",13130,"mirisquare",13129,"mlonglegturned",624,"mlsquare",13206,"mmcubedsquare",13219,"mmonospace",65357,"mmsquaredsquare",13215,"mohiragana",12418,"mohmsquare",13249,"mokatakana",12514,"mokatakanahalfwidth",65427,"molsquare",13270,"momathai",3617,"moverssquare",13223,"moverssquaredsquare",13224,"mparen",9384,"mpasquare",13227,"mssquare",13235,"msuperior",63215,"mturned",623,"mu",181,"mu1",181,"muasquare",13186,"muchgreater",8811,"muchless",8810,"mufsquare",13196,"mugreek",956,"mugsquare",13197,"muhiragana",12416,"mukatakana",12512,"mukatakanahalfwidth",65425,"mulsquare",13205,"multiply",215,"mumsquare",13211,"munahhebrew",1443,"munahlefthebrew",1443,"musicalnote",9834,"musicalnotedbl",9835,"musicflatsign",9837,"musicsharpsign",9839,"mussquare",13234,"muvsquare",13238,"muwsquare",13244,"mvmegasquare",13241,"mvsquare",13239,"mwmegasquare",13247,"mwsquare",13245,"n",110,"nabengali",2472,"nabla",8711,"nacute",324,"nadeva",2344,"nagujarati",2728,"nagurmukhi",2600,"nahiragana",12394,"nakatakana",12490,"nakatakanahalfwidth",65413,"napostrophe",329,"nasquare",13185,"nbopomofo",12555,"nbspace",160,"ncaron",328,"ncedilla",326,"ncircle",9437,"ncircumflexbelow",7755,"ncommaaccent",326,"ndotaccent",7749,"ndotbelow",7751,"nehiragana",12397,"nekatakana",12493,"nekatakanahalfwidth",65416,"newsheqelsign",8362,"nfsquare",13195,"ngabengali",2457,"ngadeva",2329,"ngagujarati",2713,"ngagurmukhi",2585,"ngonguthai",3591,"nhiragana",12435,"nhookleft",626,"nhookretroflex",627,"nieunacirclekorean",12911,"nieunaparenkorean",12815,"nieuncieuckorean",12597,"nieuncirclekorean",12897,"nieunhieuhkorean",12598,"nieunkorean",12596,"nieunpansioskorean",12648,"nieunparenkorean",12801,"nieunsioskorean",12647,"nieuntikeutkorean",12646,"nihiragana",12395,"nikatakana",12491,"nikatakanahalfwidth",65414,"nikhahitleftthai",63641,"nikhahitthai",3661,"nine",57,"ninearabic",1641,"ninebengali",2543,"ninecircle",9320,"ninecircleinversesansserif",10130,"ninedeva",2415,"ninegujarati",2799,"ninegurmukhi",2671,"ninehackarabic",1641,"ninehangzhou",12329,"nineideographicparen",12840,"nineinferior",8329,"ninemonospace",65305,"nineoldstyle",63289,"nineparen",9340,"nineperiod",9360,"ninepersian",1785,"nineroman",8568,"ninesuperior",8313,"nineteencircle",9330,"nineteenparen",9350,"nineteenperiod",9370,"ninethai",3673,"nj",460,"njecyrillic",1114,"nkatakana",12531,"nkatakanahalfwidth",65437,"nlegrightlong",414,"nlinebelow",7753,"nmonospace",65358,"nmsquare",13210,"nnabengali",2467,"nnadeva",2339,"nnagujarati",2723,"nnagurmukhi",2595,"nnnadeva",2345,"nohiragana",12398,"nokatakana",12494,"nokatakanahalfwidth",65417,"nonbreakingspace",160,"nonenthai",3603,"nonuthai",3609,"noonarabic",1606,"noonfinalarabic",65254,"noonghunnaarabic",1722,"noonghunnafinalarabic",64415,"nooninitialarabic",65255,"noonjeeminitialarabic",64722,"noonjeemisolatedarabic",64587,"noonmedialarabic",65256,"noonmeeminitialarabic",64725,"noonmeemisolatedarabic",64590,"noonnoonfinalarabic",64653,"notcontains",8716,"notelement",8713,"notelementof",8713,"notequal",8800,"notgreater",8815,"notgreaternorequal",8817,"notgreaternorless",8825,"notidentical",8802,"notless",8814,"notlessnorequal",8816,"notparallel",8742,"notprecedes",8832,"notsubset",8836,"notsucceeds",8833,"notsuperset",8837,"nowarmenian",1398,"nparen",9385,"nssquare",13233,"nsuperior",8319,"ntilde",241,"nu",957,"nuhiragana",12396,"nukatakana",12492,"nukatakanahalfwidth",65415,"nuktabengali",2492,"nuktadeva",2364,"nuktagujarati",2748,"nuktagurmukhi",2620,"numbersign",35,"numbersignmonospace",65283,"numbersignsmall",65119,"numeralsigngreek",884,"numeralsignlowergreek",885,"numero",8470,"nun",1504,"nundagesh",64320,"nundageshhebrew",64320,"nunhebrew",1504,"nvsquare",13237,"nwsquare",13243,"nyabengali",2462,"nyadeva",2334,"nyagujarati",2718,"nyagurmukhi",2590,"o",111,"oacute",243,"oangthai",3629,"obarred",629,"obarredcyrillic",1257,"obarreddieresiscyrillic",1259,"obengali",2451,"obopomofo",12571,"obreve",335,"ocandradeva",2321,"ocandragujarati",2705,"ocandravowelsigndeva",2377,"ocandravowelsigngujarati",2761,"ocaron",466,"ocircle",9438,"ocircumflex",244,"ocircumflexacute",7889,"ocircumflexdotbelow",7897,"ocircumflexgrave",7891,"ocircumflexhookabove",7893,"ocircumflextilde",7895,"ocyrillic",1086,"odblacute",337,"odblgrave",525,"odeva",2323,"odieresis",246,"odieresiscyrillic",1255,"odotbelow",7885,"oe",339,"oekorean",12634,"ogonek",731,"ogonekcmb",808,"ograve",242,"ogujarati",2707,"oharmenian",1413,"ohiragana",12362,"ohookabove",7887,"ohorn",417,"ohornacute",7899,"ohorndotbelow",7907,"ohorngrave",7901,"ohornhookabove",7903,"ohorntilde",7905,"ohungarumlaut",337,"oi",419,"oinvertedbreve",527,"okatakana",12458,"okatakanahalfwidth",65397,"okorean",12631,"olehebrew",1451,"omacron",333,"omacronacute",7763,"omacrongrave",7761,"omdeva",2384,"omega",969,"omega1",982,"omegacyrillic",1121,"omegalatinclosed",631,"omegaroundcyrillic",1147,"omegatitlocyrillic",1149,"omegatonos",974,"omgujarati",2768,"omicron",959,"omicrontonos",972,"omonospace",65359,"one",49,"onearabic",1633,"onebengali",2535,"onecircle",9312,"onecircleinversesansserif",10122,"onedeva",2407,"onedotenleader",8228,"oneeighth",8539,"onefitted",63196,"onegujarati",2791,"onegurmukhi",2663,"onehackarabic",1633,"onehalf",189,"onehangzhou",12321,"oneideographicparen",12832,"oneinferior",8321,"onemonospace",65297,"onenumeratorbengali",2548,"oneoldstyle",63281,"oneparen",9332,"oneperiod",9352,"onepersian",1777,"onequarter",188,"oneroman",8560,"onesuperior",185,"onethai",3665,"onethird",8531,"oogonek",491,"oogonekmacron",493,"oogurmukhi",2579,"oomatragurmukhi",2635,"oopen",596,"oparen",9386,"openbullet",9702,"option",8997,"ordfeminine",170,"ordmasculine",186,"orthogonal",8735,"oshortdeva",2322,"oshortvowelsigndeva",2378,"oslash",248,"oslashacute",511,"osmallhiragana",12361,"osmallkatakana",12457,"osmallkatakanahalfwidth",65387,"ostrokeacute",511,"osuperior",63216,"otcyrillic",1151,"otilde",245,"otildeacute",7757,"otildedieresis",7759,"oubopomofo",12577,"overline",8254,"overlinecenterline",65098,"overlinecmb",773,"overlinedashed",65097,"overlinedblwavy",65100,"overlinewavy",65099,"overscore",175,"ovowelsignbengali",2507,"ovowelsigndeva",2379,"ovowelsigngujarati",2763,"p",112,"paampssquare",13184,"paasentosquare",13099,"pabengali",2474,"pacute",7765,"padeva",2346,"pagedown",8671,"pageup",8670,"pagujarati",2730,"pagurmukhi",2602,"pahiragana",12401,"paiyannoithai",3631,"pakatakana",12497,"palatalizationcyrilliccmb",1156,"palochkacyrillic",1216,"pansioskorean",12671,"paragraph",182,"parallel",8741,"parenleft",40,"parenleftaltonearabic",64830,"parenleftbt",63725,"parenleftex",63724,"parenleftinferior",8333,"parenleftmonospace",65288,"parenleftsmall",65113,"parenleftsuperior",8317,"parenlefttp",63723,"parenleftvertical",65077,"parenright",41,"parenrightaltonearabic",64831,"parenrightbt",63736,"parenrightex",63735,"parenrightinferior",8334,"parenrightmonospace",65289,"parenrightsmall",65114,"parenrightsuperior",8318,"parenrighttp",63734,"parenrightvertical",65078,"partialdiff",8706,"paseqhebrew",1472,"pashtahebrew",1433,"pasquare",13225,"patah",1463,"patah11",1463,"patah1d",1463,"patah2a",1463,"patahhebrew",1463,"patahnarrowhebrew",1463,"patahquarterhebrew",1463,"patahwidehebrew",1463,"pazerhebrew",1441,"pbopomofo",12550,"pcircle",9439,"pdotaccent",7767,"pe",1508,"pecyrillic",1087,"pedagesh",64324,"pedageshhebrew",64324,"peezisquare",13115,"pefinaldageshhebrew",64323,"peharabic",1662,"peharmenian",1402,"pehebrew",1508,"pehfinalarabic",64343,"pehinitialarabic",64344,"pehiragana",12410,"pehmedialarabic",64345,"pekatakana",12506,"pemiddlehookcyrillic",1191,"perafehebrew",64334,"percent",37,"percentarabic",1642,"percentmonospace",65285,"percentsmall",65130,"period",46,"periodarmenian",1417,"periodcentered",183,"periodhalfwidth",65377,"periodinferior",63207,"periodmonospace",65294,"periodsmall",65106,"periodsuperior",63208,"perispomenigreekcmb",834,"perpendicular",8869,"perthousand",8240,"peseta",8359,"pfsquare",13194,"phabengali",2475,"phadeva",2347,"phagujarati",2731,"phagurmukhi",2603,"phi",966,"phi1",981,"phieuphacirclekorean",12922,"phieuphaparenkorean",12826,"phieuphcirclekorean",12908,"phieuphkorean",12621,"phieuphparenkorean",12812,"philatin",632,"phinthuthai",3642,"phisymbolgreek",981,"phook",421,"phophanthai",3614,"phophungthai",3612,"phosamphaothai",3616,"pi",960,"pieupacirclekorean",12915,"pieupaparenkorean",12819,"pieupcieuckorean",12662,"pieupcirclekorean",12901,"pieupkiyeokkorean",12658,"pieupkorean",12610,"pieupparenkorean",12805,"pieupsioskiyeokkorean",12660,"pieupsioskorean",12612,"pieupsiostikeutkorean",12661,"pieupthieuthkorean",12663,"pieuptikeutkorean",12659,"pihiragana",12404,"pikatakana",12500,"pisymbolgreek",982,"piwrarmenian",1411,"plus",43,"plusbelowcmb",799,"pluscircle",8853,"plusminus",177,"plusmod",726,"plusmonospace",65291,"plussmall",65122,"plussuperior",8314,"pmonospace",65360,"pmsquare",13272,"pohiragana",12413,"pointingindexdownwhite",9759,"pointingindexleftwhite",9756,"pointingindexrightwhite",9758,"pointingindexupwhite",9757,"pokatakana",12509,"poplathai",3611,"postalmark",12306,"postalmarkface",12320,"pparen",9387,"precedes",8826,"prescription",8478,"primemod",697,"primereversed",8245,"product",8719,"projective",8965,"prolongedkana",12540,"propellor",8984,"propersubset",8834,"propersuperset",8835,"proportion",8759,"proportional",8733,"psi",968,"psicyrillic",1137,"psilipneumatacyrilliccmb",1158,"pssquare",13232,"puhiragana",12407,"pukatakana",12503,"pvsquare",13236,"pwsquare",13242,"q",113,"qadeva",2392,"qadmahebrew",1448,"qafarabic",1602,"qaffinalarabic",65238,"qafinitialarabic",65239,"qafmedialarabic",65240,"qamats",1464,"qamats10",1464,"qamats1a",1464,"qamats1c",1464,"qamats27",1464,"qamats29",1464,"qamats33",1464,"qamatsde",1464,"qamatshebrew",1464,"qamatsnarrowhebrew",1464,"qamatsqatanhebrew",1464,"qamatsqatannarrowhebrew",1464,"qamatsqatanquarterhebrew",1464,"qamatsqatanwidehebrew",1464,"qamatsquarterhebrew",1464,"qamatswidehebrew",1464,"qarneyparahebrew",1439,"qbopomofo",12561,"qcircle",9440,"qhook",672,"qmonospace",65361,"qof",1511,"qofdagesh",64327,"qofdageshhebrew",64327,"qofhebrew",1511,"qparen",9388,"quarternote",9833,"qubuts",1467,"qubuts18",1467,"qubuts25",1467,"qubuts31",1467,"qubutshebrew",1467,"qubutsnarrowhebrew",1467,"qubutsquarterhebrew",1467,"qubutswidehebrew",1467,"question",63,"questionarabic",1567,"questionarmenian",1374,"questiondown",191,"questiondownsmall",63423,"questiongreek",894,"questionmonospace",65311,"questionsmall",63295,"quotedbl",34,"quotedblbase",8222,"quotedblleft",8220,"quotedblmonospace",65282,"quotedblprime",12318,"quotedblprimereversed",12317,"quotedblright",8221,"quoteleft",8216,"quoteleftreversed",8219,"quotereversed",8219,"quoteright",8217,"quoterightn",329,"quotesinglbase",8218,"quotesingle",39,"quotesinglemonospace",65287,"r",114,"raarmenian",1404,"rabengali",2480,"racute",341,"radeva",2352,"radical",8730,"radicalex",63717,"radoverssquare",13230,"radoverssquaredsquare",13231,"radsquare",13229,"rafe",1471,"rafehebrew",1471,"ragujarati",2736,"ragurmukhi",2608,"rahiragana",12425,"rakatakana",12521,"rakatakanahalfwidth",65431,"ralowerdiagonalbengali",2545,"ramiddlediagonalbengali",2544,"ramshorn",612,"ratio",8758,"rbopomofo",12566,"rcaron",345,"rcedilla",343,"rcircle",9441,"rcommaaccent",343,"rdblgrave",529,"rdotaccent",7769,"rdotbelow",7771,"rdotbelowmacron",7773,"referencemark",8251,"reflexsubset",8838,"reflexsuperset",8839,"registered",174,"registersans",63720,"registerserif",63194,"reharabic",1585,"reharmenian",1408,"rehfinalarabic",65198,"rehiragana",12428,"rekatakana",12524,"rekatakanahalfwidth",65434,"resh",1512,"reshdageshhebrew",64328,"reshhebrew",1512,"reversedtilde",8765,"reviahebrew",1431,"reviamugrashhebrew",1431,"revlogicalnot",8976,"rfishhook",638,"rfishhookreversed",639,"rhabengali",2525,"rhadeva",2397,"rho",961,"rhook",637,"rhookturned",635,"rhookturnedsuperior",693,"rhosymbolgreek",1009,"rhotichookmod",734,"rieulacirclekorean",12913,"rieulaparenkorean",12817,"rieulcirclekorean",12899,"rieulhieuhkorean",12608,"rieulkiyeokkorean",12602,"rieulkiyeoksioskorean",12649,"rieulkorean",12601,"rieulmieumkorean",12603,"rieulpansioskorean",12652,"rieulparenkorean",12803,"rieulphieuphkorean",12607,"rieulpieupkorean",12604,"rieulpieupsioskorean",12651,"rieulsioskorean",12605,"rieulthieuthkorean",12606,"rieultikeutkorean",12650,"rieulyeorinhieuhkorean",12653,"rightangle",8735,"righttackbelowcmb",793,"righttriangle",8895,"rihiragana",12426,"rikatakana",12522,"rikatakanahalfwidth",65432,"ring",730,"ringbelowcmb",805,"ringcmb",778,"ringhalfleft",703,"ringhalfleftarmenian",1369,"ringhalfleftbelowcmb",796,"ringhalfleftcentered",723,"ringhalfright",702,"ringhalfrightbelowcmb",825,"ringhalfrightcentered",722,"rinvertedbreve",531,"rittorusquare",13137,"rlinebelow",7775,"rlongleg",636,"rlonglegturned",634,"rmonospace",65362,"rohiragana",12429,"rokatakana",12525,"rokatakanahalfwidth",65435,"roruathai",3619,"rparen",9389,"rrabengali",2524,"rradeva",2353,"rragurmukhi",2652,"rreharabic",1681,"rrehfinalarabic",64397,"rrvocalicbengali",2528,"rrvocalicdeva",2400,"rrvocalicgujarati",2784,"rrvocalicvowelsignbengali",2500,"rrvocalicvowelsigndeva",2372,"rrvocalicvowelsigngujarati",2756,"rsuperior",63217,"rtblock",9616,"rturned",633,"rturnedsuperior",692,"ruhiragana",12427,"rukatakana",12523,"rukatakanahalfwidth",65433,"rupeemarkbengali",2546,"rupeesignbengali",2547,"rupiah",63197,"ruthai",3620,"rvocalicbengali",2443,"rvocalicdeva",2315,"rvocalicgujarati",2699,"rvocalicvowelsignbengali",2499,"rvocalicvowelsigndeva",2371,"rvocalicvowelsigngujarati",2755,"s",115,"sabengali",2488,"sacute",347,"sacutedotaccent",7781,"sadarabic",1589,"sadeva",2360,"sadfinalarabic",65210,"sadinitialarabic",65211,"sadmedialarabic",65212,"sagujarati",2744,"sagurmukhi",2616,"sahiragana",12373,"sakatakana",12469,"sakatakanahalfwidth",65403,"sallallahoualayhewasallamarabic",65018,"samekh",1505,"samekhdagesh",64321,"samekhdageshhebrew",64321,"samekhhebrew",1505,"saraaathai",3634,"saraaethai",3649,"saraaimaimalaithai",3652,"saraaimaimuanthai",3651,"saraamthai",3635,"saraathai",3632,"saraethai",3648,"saraiileftthai",63622,"saraiithai",3637,"saraileftthai",63621,"saraithai",3636,"saraothai",3650,"saraueeleftthai",63624,"saraueethai",3639,"saraueleftthai",63623,"sarauethai",3638,"sarauthai",3640,"sarauuthai",3641,"sbopomofo",12569,"scaron",353,"scarondotaccent",7783,"scedilla",351,"schwa",601,"schwacyrillic",1241,"schwadieresiscyrillic",1243,"schwahook",602,"scircle",9442,"scircumflex",349,"scommaaccent",537,"sdotaccent",7777,"sdotbelow",7779,"sdotbelowdotaccent",7785,"seagullbelowcmb",828,"second",8243,"secondtonechinese",714,"section",167,"seenarabic",1587,"seenfinalarabic",65202,"seeninitialarabic",65203,"seenmedialarabic",65204,"segol",1462,"segol13",1462,"segol1f",1462,"segol2c",1462,"segolhebrew",1462,"segolnarrowhebrew",1462,"segolquarterhebrew",1462,"segoltahebrew",1426,"segolwidehebrew",1462,"seharmenian",1405,"sehiragana",12379,"sekatakana",12475,"sekatakanahalfwidth",65406,"semicolon",59,"semicolonarabic",1563,"semicolonmonospace",65307,"semicolonsmall",65108,"semivoicedmarkkana",12444,"semivoicedmarkkanahalfwidth",65439,"sentisquare",13090,"sentosquare",13091,"seven",55,"sevenarabic",1639,"sevenbengali",2541,"sevencircle",9318,"sevencircleinversesansserif",10128,"sevendeva",2413,"seveneighths",8542,"sevengujarati",2797,"sevengurmukhi",2669,"sevenhackarabic",1639,"sevenhangzhou",12327,"sevenideographicparen",12838,"seveninferior",8327,"sevenmonospace",65303,"sevenoldstyle",63287,"sevenparen",9338,"sevenperiod",9358,"sevenpersian",1783,"sevenroman",8566,"sevensuperior",8311,"seventeencircle",9328,"seventeenparen",9348,"seventeenperiod",9368,"seventhai",3671,"sfthyphen",173,"shaarmenian",1399,"shabengali",2486,"shacyrillic",1096,"shaddaarabic",1617,"shaddadammaarabic",64609,"shaddadammatanarabic",64606,"shaddafathaarabic",64608,"shaddakasraarabic",64610,"shaddakasratanarabic",64607,"shade",9618,"shadedark",9619,"shadelight",9617,"shademedium",9618,"shadeva",2358,"shagujarati",2742,"shagurmukhi",2614,"shalshelethebrew",1427,"shbopomofo",12565,"shchacyrillic",1097,"sheenarabic",1588,"sheenfinalarabic",65206,"sheeninitialarabic",65207,"sheenmedialarabic",65208,"sheicoptic",995,"sheqel",8362,"sheqelhebrew",8362,"sheva",1456,"sheva115",1456,"sheva15",1456,"sheva22",1456,"sheva2e",1456,"shevahebrew",1456,"shevanarrowhebrew",1456,"shevaquarterhebrew",1456,"shevawidehebrew",1456,"shhacyrillic",1211,"shimacoptic",1005,"shin",1513,"shindagesh",64329,"shindageshhebrew",64329,"shindageshshindot",64300,"shindageshshindothebrew",64300,"shindageshsindot",64301,"shindageshsindothebrew",64301,"shindothebrew",1473,"shinhebrew",1513,"shinshindot",64298,"shinshindothebrew",64298,"shinsindot",64299,"shinsindothebrew",64299,"shook",642,"sigma",963,"sigma1",962,"sigmafinal",962,"sigmalunatesymbolgreek",1010,"sihiragana",12375,"sikatakana",12471,"sikatakanahalfwidth",65404,"siluqhebrew",1469,"siluqlefthebrew",1469,"similar",8764,"sindothebrew",1474,"siosacirclekorean",12916,"siosaparenkorean",12820,"sioscieuckorean",12670,"sioscirclekorean",12902,"sioskiyeokkorean",12666,"sioskorean",12613,"siosnieunkorean",12667,"siosparenkorean",12806,"siospieupkorean",12669,"siostikeutkorean",12668,"six",54,"sixarabic",1638,"sixbengali",2540,"sixcircle",9317,"sixcircleinversesansserif",10127,"sixdeva",2412,"sixgujarati",2796,"sixgurmukhi",2668,"sixhackarabic",1638,"sixhangzhou",12326,"sixideographicparen",12837,"sixinferior",8326,"sixmonospace",65302,"sixoldstyle",63286,"sixparen",9337,"sixperiod",9357,"sixpersian",1782,"sixroman",8565,"sixsuperior",8310,"sixteencircle",9327,"sixteencurrencydenominatorbengali",2553,"sixteenparen",9347,"sixteenperiod",9367,"sixthai",3670,"slash",47,"slashmonospace",65295,"slong",383,"slongdotaccent",7835,"smileface",9786,"smonospace",65363,"sofpasuqhebrew",1475,"softhyphen",173,"softsigncyrillic",1100,"sohiragana",12381,"sokatakana",12477,"sokatakanahalfwidth",65407,"soliduslongoverlaycmb",824,"solidusshortoverlaycmb",823,"sorusithai",3625,"sosalathai",3624,"sosothai",3595,"sosuathai",3626,"space",32,"spacehackarabic",32,"spade",9824,"spadesuitblack",9824,"spadesuitwhite",9828,"sparen",9390,"squarebelowcmb",827,"squarecc",13252,"squarecm",13213,"squarediagonalcrosshatchfill",9641,"squarehorizontalfill",9636,"squarekg",13199,"squarekm",13214,"squarekmcapital",13262,"squareln",13265,"squarelog",13266,"squaremg",13198,"squaremil",13269,"squaremm",13212,"squaremsquared",13217,"squareorthogonalcrosshatchfill",9638,"squareupperlefttolowerrightfill",9639,"squareupperrighttolowerleftfill",9640,"squareverticalfill",9637,"squarewhitewithsmallblack",9635,"srsquare",13275,"ssabengali",2487,"ssadeva",2359,"ssagujarati",2743,"ssangcieuckorean",12617,"ssanghieuhkorean",12677,"ssangieungkorean",12672,"ssangkiyeokkorean",12594,"ssangnieunkorean",12645,"ssangpieupkorean",12611,"ssangsioskorean",12614,"ssangtikeutkorean",12600,"ssuperior",63218,"sterling",163,"sterlingmonospace",65505,"strokelongoverlaycmb",822,"strokeshortoverlaycmb",821,"subset",8834,"subsetnotequal",8842,"subsetorequal",8838,"succeeds",8827,"suchthat",8715,"suhiragana",12377,"sukatakana",12473,"sukatakanahalfwidth",65405,"sukunarabic",1618,"summation",8721,"sun",9788,"superset",8835,"supersetnotequal",8843,"supersetorequal",8839,"svsquare",13276,"syouwaerasquare",13180,"t",116,"tabengali",2468,"tackdown",8868,"tackleft",8867,"tadeva",2340,"tagujarati",2724,"tagurmukhi",2596,"taharabic",1591,"tahfinalarabic",65218,"tahinitialarabic",65219,"tahiragana",12383,"tahmedialarabic",65220,"taisyouerasquare",13181,"takatakana",12479,"takatakanahalfwidth",65408,"tatweelarabic",1600,"tau",964,"tav",1514,"tavdages",64330,"tavdagesh",64330,"tavdageshhebrew",64330,"tavhebrew",1514,"tbar",359,"tbopomofo",12554,"tcaron",357,"tccurl",680,"tcedilla",355,"tcheharabic",1670,"tchehfinalarabic",64379,"tchehinitialarabic",64380,"tchehmedialarabic",64381,"tcircle",9443,"tcircumflexbelow",7793,"tcommaaccent",355,"tdieresis",7831,"tdotaccent",7787,"tdotbelow",7789,"tecyrillic",1090,"tedescendercyrillic",1197,"teharabic",1578,"tehfinalarabic",65174,"tehhahinitialarabic",64674,"tehhahisolatedarabic",64524,"tehinitialarabic",65175,"tehiragana",12390,"tehjeeminitialarabic",64673,"tehjeemisolatedarabic",64523,"tehmarbutaarabic",1577,"tehmarbutafinalarabic",65172,"tehmedialarabic",65176,"tehmeeminitialarabic",64676,"tehmeemisolatedarabic",64526,"tehnoonfinalarabic",64627,"tekatakana",12486,"tekatakanahalfwidth",65411,"telephone",8481,"telephoneblack",9742,"telishagedolahebrew",1440,"telishaqetanahebrew",1449,"tencircle",9321,"tenideographicparen",12841,"tenparen",9341,"tenperiod",9361,"tenroman",8569,"tesh",679,"tet",1496,"tetdagesh",64312,"tetdageshhebrew",64312,"tethebrew",1496,"tetsecyrillic",1205,"tevirhebrew",1435,"tevirlefthebrew",1435,"thabengali",2469,"thadeva",2341,"thagujarati",2725,"thagurmukhi",2597,"thalarabic",1584,"thalfinalarabic",65196,"thanthakhatlowleftthai",63640,"thanthakhatlowrightthai",63639,"thanthakhatthai",3660,"thanthakhatupperleftthai",63638,"theharabic",1579,"thehfinalarabic",65178,"thehinitialarabic",65179,"thehmedialarabic",65180,"thereexists",8707,"therefore",8756,"theta",952,"theta1",977,"thetasymbolgreek",977,"thieuthacirclekorean",12921,"thieuthaparenkorean",12825,"thieuthcirclekorean",12907,"thieuthkorean",12620,"thieuthparenkorean",12811,"thirteencircle",9324,"thirteenparen",9344,"thirteenperiod",9364,"thonangmonthothai",3601,"thook",429,"thophuthaothai",3602,"thorn",254,"thothahanthai",3607,"thothanthai",3600,"thothongthai",3608,"thothungthai",3606,"thousandcyrillic",1154,"thousandsseparatorarabic",1644,"thousandsseparatorpersian",1644,"three",51,"threearabic",1635,"threebengali",2537,"threecircle",9314,"threecircleinversesansserif",10124,"threedeva",2409,"threeeighths",8540,"threegujarati",2793,"threegurmukhi",2665,"threehackarabic",1635,"threehangzhou",12323,"threeideographicparen",12834,"threeinferior",8323,"threemonospace",65299,"threenumeratorbengali",2550,"threeoldstyle",63283,"threeparen",9334,"threeperiod",9354,"threepersian",1779,"threequarters",190,"threequartersemdash",63198,"threeroman",8562,"threesuperior",179,"threethai",3667,"thzsquare",13204,"tihiragana",12385,"tikatakana",12481,"tikatakanahalfwidth",65409,"tikeutacirclekorean",12912,"tikeutaparenkorean",12816,"tikeutcirclekorean",12898,"tikeutkorean",12599,"tikeutparenkorean",12802,"tilde",732,"tildebelowcmb",816,"tildecmb",771,"tildecomb",771,"tildedoublecmb",864,"tildeoperator",8764,"tildeoverlaycmb",820,"tildeverticalcmb",830,"timescircle",8855,"tipehahebrew",1430,"tipehalefthebrew",1430,"tippigurmukhi",2672,"titlocyrilliccmb",1155,"tiwnarmenian",1407,"tlinebelow",7791,"tmonospace",65364,"toarmenian",1385,"tohiragana",12392,"tokatakana",12488,"tokatakanahalfwidth",65412,"tonebarextrahighmod",741,"tonebarextralowmod",745,"tonebarhighmod",742,"tonebarlowmod",744,"tonebarmidmod",743,"tonefive",445,"tonesix",389,"tonetwo",424,"tonos",900,"tonsquare",13095,"topatakthai",3599,"tortoiseshellbracketleft",12308,"tortoiseshellbracketleftsmall",65117,"tortoiseshellbracketleftvertical",65081,"tortoiseshellbracketright",12309,"tortoiseshellbracketrightsmall",65118,"tortoiseshellbracketrightvertical",65082,"totaothai",3605,"tpalatalhook",427,"tparen",9391,"trademark",8482,"trademarksans",63722,"trademarkserif",63195,"tretroflexhook",648,"triagdn",9660,"triaglf",9668,"triagrt",9658,"triagup",9650,"ts",678,"tsadi",1510,"tsadidagesh",64326,"tsadidageshhebrew",64326,"tsadihebrew",1510,"tsecyrillic",1094,"tsere",1461,"tsere12",1461,"tsere1e",1461,"tsere2b",1461,"tserehebrew",1461,"tserenarrowhebrew",1461,"tserequarterhebrew",1461,"tserewidehebrew",1461,"tshecyrillic",1115,"tsuperior",63219,"ttabengali",2463,"ttadeva",2335,"ttagujarati",2719,"ttagurmukhi",2591,"tteharabic",1657,"ttehfinalarabic",64359,"ttehinitialarabic",64360,"ttehmedialarabic",64361,"tthabengali",2464,"tthadeva",2336,"tthagujarati",2720,"tthagurmukhi",2592,"tturned",647,"tuhiragana",12388,"tukatakana",12484,"tukatakanahalfwidth",65410,"tusmallhiragana",12387,"tusmallkatakana",12483,"tusmallkatakanahalfwidth",65391,"twelvecircle",9323,"twelveparen",9343,"twelveperiod",9363,"twelveroman",8571,"twentycircle",9331,"twentyhangzhou",21316,"twentyparen",9351,"twentyperiod",9371,"two",50,"twoarabic",1634,"twobengali",2536,"twocircle",9313,"twocircleinversesansserif",10123,"twodeva",2408,"twodotenleader",8229,"twodotleader",8229,"twodotleadervertical",65072,"twogujarati",2792,"twogurmukhi",2664,"twohackarabic",1634,"twohangzhou",12322,"twoideographicparen",12833,"twoinferior",8322,"twomonospace",65298,"twonumeratorbengali",2549,"twooldstyle",63282,"twoparen",9333,"twoperiod",9353,"twopersian",1778,"tworoman",8561,"twostroke",443,"twosuperior",178,"twothai",3666,"twothirds",8532,"u",117,"uacute",250,"ubar",649,"ubengali",2441,"ubopomofo",12584,"ubreve",365,"ucaron",468,"ucircle",9444,"ucircumflex",251,"ucircumflexbelow",7799,"ucyrillic",1091,"udattadeva",2385,"udblacute",369,"udblgrave",533,"udeva",2313,"udieresis",252,"udieresisacute",472,"udieresisbelow",7795,"udieresiscaron",474,"udieresiscyrillic",1265,"udieresisgrave",476,"udieresismacron",470,"udotbelow",7909,"ugrave",249,"ugujarati",2697,"ugurmukhi",2569,"uhiragana",12358,"uhookabove",7911,"uhorn",432,"uhornacute",7913,"uhorndotbelow",7921,"uhorngrave",7915,"uhornhookabove",7917,"uhorntilde",7919,"uhungarumlaut",369,"uhungarumlautcyrillic",1267,"uinvertedbreve",535,"ukatakana",12454,"ukatakanahalfwidth",65395,"ukcyrillic",1145,"ukorean",12636,"umacron",363,"umacroncyrillic",1263,"umacrondieresis",7803,"umatragurmukhi",2625,"umonospace",65365,"underscore",95,"underscoredbl",8215,"underscoremonospace",65343,"underscorevertical",65075,"underscorewavy",65103,"union",8746,"universal",8704,"uogonek",371,"uparen",9392,"upblock",9600,"upperdothebrew",1476,"upsilon",965,"upsilondieresis",971,"upsilondieresistonos",944,"upsilonlatin",650,"upsilontonos",973,"uptackbelowcmb",797,"uptackmod",724,"uragurmukhi",2675,"uring",367,"ushortcyrillic",1118,"usmallhiragana",12357,"usmallkatakana",12453,"usmallkatakanahalfwidth",65385,"ustraightcyrillic",1199,"ustraightstrokecyrillic",1201,"utilde",361,"utildeacute",7801,"utildebelow",7797,"uubengali",2442,"uudeva",2314,"uugujarati",2698,"uugurmukhi",2570,"uumatragurmukhi",2626,"uuvowelsignbengali",2498,"uuvowelsigndeva",2370,"uuvowelsigngujarati",2754,"uvowelsignbengali",2497,"uvowelsigndeva",2369,"uvowelsigngujarati",2753,"v",118,"vadeva",2357,"vagujarati",2741,"vagurmukhi",2613,"vakatakana",12535,"vav",1493,"vavdagesh",64309,"vavdagesh65",64309,"vavdageshhebrew",64309,"vavhebrew",1493,"vavholam",64331,"vavholamhebrew",64331,"vavvavhebrew",1520,"vavyodhebrew",1521,"vcircle",9445,"vdotbelow",7807,"vecyrillic",1074,"veharabic",1700,"vehfinalarabic",64363,"vehinitialarabic",64364,"vehmedialarabic",64365,"vekatakana",12537,"venus",9792,"verticalbar",124,"verticallineabovecmb",781,"verticallinebelowcmb",809,"verticallinelowmod",716,"verticallinemod",712,"vewarmenian",1406,"vhook",651,"vikatakana",12536,"viramabengali",2509,"viramadeva",2381,"viramagujarati",2765,"visargabengali",2435,"visargadeva",2307,"visargagujarati",2691,"vmonospace",65366,"voarmenian",1400,"voicediterationhiragana",12446,"voicediterationkatakana",12542,"voicedmarkkana",12443,"voicedmarkkanahalfwidth",65438,"vokatakana",12538,"vparen",9393,"vtilde",7805,"vturned",652,"vuhiragana",12436,"vukatakana",12532,"w",119,"wacute",7811,"waekorean",12633,"wahiragana",12431,"wakatakana",12527,"wakatakanahalfwidth",65436,"wakorean",12632,"wasmallhiragana",12430,"wasmallkatakana",12526,"wattosquare",13143,"wavedash",12316,"wavyunderscorevertical",65076,"wawarabic",1608,"wawfinalarabic",65262,"wawhamzaabovearabic",1572,"wawhamzaabovefinalarabic",65158,"wbsquare",13277,"wcircle",9446,"wcircumflex",373,"wdieresis",7813,"wdotaccent",7815,"wdotbelow",7817,"wehiragana",12433,"weierstrass",8472,"wekatakana",12529,"wekorean",12638,"weokorean",12637,"wgrave",7809,"whitebullet",9702,"whitecircle",9675,"whitecircleinverse",9689,"whitecornerbracketleft",12302,"whitecornerbracketleftvertical",65091,"whitecornerbracketright",12303,"whitecornerbracketrightvertical",65092,"whitediamond",9671,"whitediamondcontainingblacksmalldiamond",9672,"whitedownpointingsmalltriangle",9663,"whitedownpointingtriangle",9661,"whiteleftpointingsmalltriangle",9667,"whiteleftpointingtriangle",9665,"whitelenticularbracketleft",12310,"whitelenticularbracketright",12311,"whiterightpointingsmalltriangle",9657,"whiterightpointingtriangle",9655,"whitesmallsquare",9643,"whitesmilingface",9786,"whitesquare",9633,"whitestar",9734,"whitetelephone",9743,"whitetortoiseshellbracketleft",12312,"whitetortoiseshellbracketright",12313,"whiteuppointingsmalltriangle",9653,"whiteuppointingtriangle",9651,"wihiragana",12432,"wikatakana",12528,"wikorean",12639,"wmonospace",65367,"wohiragana",12434,"wokatakana",12530,"wokatakanahalfwidth",65382,"won",8361,"wonmonospace",65510,"wowaenthai",3623,"wparen",9394,"wring",7832,"wsuperior",695,"wturned",653,"wynn",447,"x",120,"xabovecmb",829,"xbopomofo",12562,"xcircle",9447,"xdieresis",7821,"xdotaccent",7819,"xeharmenian",1389,"xi",958,"xmonospace",65368,"xparen",9395,"xsuperior",739,"y",121,"yaadosquare",13134,"yabengali",2479,"yacute",253,"yadeva",2351,"yaekorean",12626,"yagujarati",2735,"yagurmukhi",2607,"yahiragana",12420,"yakatakana",12516,"yakatakanahalfwidth",65428,"yakorean",12625,"yamakkanthai",3662,"yasmallhiragana",12419,"yasmallkatakana",12515,"yasmallkatakanahalfwidth",65388,"yatcyrillic",1123,"ycircle",9448,"ycircumflex",375,"ydieresis",255,"ydotaccent",7823,"ydotbelow",7925,"yeharabic",1610,"yehbarreearabic",1746,"yehbarreefinalarabic",64431,"yehfinalarabic",65266,"yehhamzaabovearabic",1574,"yehhamzaabovefinalarabic",65162,"yehhamzaaboveinitialarabic",65163,"yehhamzaabovemedialarabic",65164,"yehinitialarabic",65267,"yehmedialarabic",65268,"yehmeeminitialarabic",64733,"yehmeemisolatedarabic",64600,"yehnoonfinalarabic",64660,"yehthreedotsbelowarabic",1745,"yekorean",12630,"yen",165,"yenmonospace",65509,"yeokorean",12629,"yeorinhieuhkorean",12678,"yerahbenyomohebrew",1450,"yerahbenyomolefthebrew",1450,"yericyrillic",1099,"yerudieresiscyrillic",1273,"yesieungkorean",12673,"yesieungpansioskorean",12675,"yesieungsioskorean",12674,"yetivhebrew",1434,"ygrave",7923,"yhook",436,"yhookabove",7927,"yiarmenian",1397,"yicyrillic",1111,"yikorean",12642,"yinyang",9775,"yiwnarmenian",1410,"ymonospace",65369,"yod",1497,"yoddagesh",64313,"yoddageshhebrew",64313,"yodhebrew",1497,"yodyodhebrew",1522,"yodyodpatahhebrew",64287,"yohiragana",12424,"yoikorean",12681,"yokatakana",12520,"yokatakanahalfwidth",65430,"yokorean",12635,"yosmallhiragana",12423,"yosmallkatakana",12519,"yosmallkatakanahalfwidth",65390,"yotgreek",1011,"yoyaekorean",12680,"yoyakorean",12679,"yoyakthai",3618,"yoyingthai",3597,"yparen",9396,"ypogegrammeni",890,"ypogegrammenigreekcmb",837,"yr",422,"yring",7833,"ysuperior",696,"ytilde",7929,"yturned",654,"yuhiragana",12422,"yuikorean",12684,"yukatakana",12518,"yukatakanahalfwidth",65429,"yukorean",12640,"yusbigcyrillic",1131,"yusbigiotifiedcyrillic",1133,"yuslittlecyrillic",1127,"yuslittleiotifiedcyrillic",1129,"yusmallhiragana",12421,"yusmallkatakana",12517,"yusmallkatakanahalfwidth",65389,"yuyekorean",12683,"yuyeokorean",12682,"yyabengali",2527,"yyadeva",2399,"z",122,"zaarmenian",1382,"zacute",378,"zadeva",2395,"zagurmukhi",2651,"zaharabic",1592,"zahfinalarabic",65222,"zahinitialarabic",65223,"zahiragana",12374,"zahmedialarabic",65224,"zainarabic",1586,"zainfinalarabic",65200,"zakatakana",12470,"zaqefgadolhebrew",1429,"zaqefqatanhebrew",1428,"zarqahebrew",1432,"zayin",1494,"zayindagesh",64310,"zayindageshhebrew",64310,"zayinhebrew",1494,"zbopomofo",12567,"zcaron",382,"zcircle",9449,"zcircumflex",7825,"zcurl",657,"zdot",380,"zdotaccent",380,"zdotbelow",7827,"zecyrillic",1079,"zedescendercyrillic",1177,"zedieresiscyrillic",1247,"zehiragana",12380,"zekatakana",12476,"zero",48,"zeroarabic",1632,"zerobengali",2534,"zerodeva",2406,"zerogujarati",2790,"zerogurmukhi",2662,"zerohackarabic",1632,"zeroinferior",8320,"zeromonospace",65296,"zerooldstyle",63280,"zeropersian",1776,"zerosuperior",8304,"zerothai",3664,"zerowidthjoiner",65279,"zerowidthnonjoiner",8204,"zerowidthspace",8203,"zeta",950,"zhbopomofo",12563,"zhearmenian",1386,"zhebrevecyrillic",1218,"zhecyrillic",1078,"zhedescendercyrillic",1175,"zhedieresiscyrillic",1245,"zihiragana",12376,"zikatakana",12472,"zinorhebrew",1454,"zlinebelow",7829,"zmonospace",65370,"zohiragana",12382,"zokatakana",12478,"zparen",9397,"zretroflexhook",656,"zstroke",438,"zuhiragana",12378,"zukatakana",12474,".notdef",0,"angbracketleftbig",9001,"angbracketleftBig",9001,"angbracketleftbigg",9001,"angbracketleftBigg",9001,"angbracketrightBig",9002,"angbracketrightbig",9002,"angbracketrightBigg",9002,"angbracketrightbigg",9002,"arrowhookleft",8618,"arrowhookright",8617,"arrowlefttophalf",8636,"arrowleftbothalf",8637,"arrownortheast",8599,"arrownorthwest",8598,"arrowrighttophalf",8640,"arrowrightbothalf",8641,"arrowsoutheast",8600,"arrowsouthwest",8601,"backslashbig",8726,"backslashBig",8726,"backslashBigg",8726,"backslashbigg",8726,"bardbl",8214,"bracehtipdownleft",65079,"bracehtipdownright",65079,"bracehtipupleft",65080,"bracehtipupright",65080,"braceleftBig",123,"braceleftbig",123,"braceleftbigg",123,"braceleftBigg",123,"bracerightBig",125,"bracerightbig",125,"bracerightbigg",125,"bracerightBigg",125,"bracketleftbig",91,"bracketleftBig",91,"bracketleftbigg",91,"bracketleftBigg",91,"bracketrightBig",93,"bracketrightbig",93,"bracketrightbigg",93,"bracketrightBigg",93,"ceilingleftbig",8968,"ceilingleftBig",8968,"ceilingleftBigg",8968,"ceilingleftbigg",8968,"ceilingrightbig",8969,"ceilingrightBig",8969,"ceilingrightbigg",8969,"ceilingrightBigg",8969,"circledotdisplay",8857,"circledottext",8857,"circlemultiplydisplay",8855,"circlemultiplytext",8855,"circleplusdisplay",8853,"circleplustext",8853,"contintegraldisplay",8750,"contintegraltext",8750,"coproductdisplay",8720,"coproducttext",8720,"floorleftBig",8970,"floorleftbig",8970,"floorleftbigg",8970,"floorleftBigg",8970,"floorrightbig",8971,"floorrightBig",8971,"floorrightBigg",8971,"floorrightbigg",8971,"hatwide",770,"hatwider",770,"hatwidest",770,"intercal",7488,"integraldisplay",8747,"integraltext",8747,"intersectiondisplay",8898,"intersectiontext",8898,"logicalanddisplay",8743,"logicalandtext",8743,"logicalordisplay",8744,"logicalortext",8744,"parenleftBig",40,"parenleftbig",40,"parenleftBigg",40,"parenleftbigg",40,"parenrightBig",41,"parenrightbig",41,"parenrightBigg",41,"parenrightbigg",41,"prime",8242,"productdisplay",8719,"producttext",8719,"radicalbig",8730,"radicalBig",8730,"radicalBigg",8730,"radicalbigg",8730,"radicalbt",8730,"radicaltp",8730,"radicalvertex",8730,"slashbig",47,"slashBig",47,"slashBigg",47,"slashbigg",47,"summationdisplay",8721,"summationtext",8721,"tildewide",732,"tildewider",732,"tildewidest",732,"uniondisplay",8899,"unionmultidisplay",8846,"unionmultitext",8846,"unionsqdisplay",8852,"unionsqtext",8852,"uniontext",8899,"vextenddouble",8741,"vextendsingle",8739]})),i=(0,a.getArrayLookupTableFactory)((function(){return["space",32,"a1",9985,"a2",9986,"a202",9987,"a3",9988,"a4",9742,"a5",9990,"a119",9991,"a118",9992,"a117",9993,"a11",9755,"a12",9758,"a13",9996,"a14",9997,"a15",9998,"a16",9999,"a105",1e4,"a17",10001,"a18",10002,"a19",10003,"a20",10004,"a21",10005,"a22",10006,"a23",10007,"a24",10008,"a25",10009,"a26",10010,"a27",10011,"a28",10012,"a6",10013,"a7",10014,"a8",10015,"a9",10016,"a10",10017,"a29",10018,"a30",10019,"a31",10020,"a32",10021,"a33",10022,"a34",10023,"a35",9733,"a36",10025,"a37",10026,"a38",10027,"a39",10028,"a40",10029,"a41",10030,"a42",10031,"a43",10032,"a44",10033,"a45",10034,"a46",10035,"a47",10036,"a48",10037,"a49",10038,"a50",10039,"a51",10040,"a52",10041,"a53",10042,"a54",10043,"a55",10044,"a56",10045,"a57",10046,"a58",10047,"a59",10048,"a60",10049,"a61",10050,"a62",10051,"a63",10052,"a64",10053,"a65",10054,"a66",10055,"a67",10056,"a68",10057,"a69",10058,"a70",10059,"a71",9679,"a72",10061,"a73",9632,"a74",10063,"a203",10064,"a75",10065,"a204",10066,"a76",9650,"a77",9660,"a78",9670,"a79",10070,"a81",9687,"a82",10072,"a83",10073,"a84",10074,"a97",10075,"a98",10076,"a99",10077,"a100",10078,"a101",10081,"a102",10082,"a103",10083,"a104",10084,"a106",10085,"a107",10086,"a108",10087,"a112",9827,"a111",9830,"a110",9829,"a109",9824,"a120",9312,"a121",9313,"a122",9314,"a123",9315,"a124",9316,"a125",9317,"a126",9318,"a127",9319,"a128",9320,"a129",9321,"a130",10102,"a131",10103,"a132",10104,"a133",10105,"a134",10106,"a135",10107,"a136",10108,"a137",10109,"a138",10110,"a139",10111,"a140",10112,"a141",10113,"a142",10114,"a143",10115,"a144",10116,"a145",10117,"a146",10118,"a147",10119,"a148",10120,"a149",10121,"a150",10122,"a151",10123,"a152",10124,"a153",10125,"a154",10126,"a155",10127,"a156",10128,"a157",10129,"a158",10130,"a159",10131,"a160",10132,"a161",8594,"a163",8596,"a164",8597,"a196",10136,"a165",10137,"a192",10138,"a166",10139,"a167",10140,"a168",10141,"a169",10142,"a170",10143,"a171",10144,"a172",10145,"a173",10146,"a162",10147,"a174",10148,"a175",10149,"a176",10150,"a177",10151,"a178",10152,"a179",10153,"a193",10154,"a180",10155,"a199",10156,"a181",10157,"a200",10158,"a182",10159,"a201",10161,"a183",10162,"a184",10163,"a197",10164,"a185",10165,"a194",10166,"a198",10167,"a186",10168,"a195",10169,"a187",10170,"a188",10171,"a189",10172,"a190",10173,"a191",10174,"a89",10088,"a90",10089,"a93",10090,"a94",10091,"a91",10092,"a92",10093,"a205",10094,"a85",10095,"a206",10096,"a86",10097,"a87",10098,"a88",10099,"a95",10100,"a96",10101,".notdef",0]}))},(e,t,r)=>{"use strict";r.r(t);r.d(t,{clearUnicodeCaches:()=>clearUnicodeCaches,getCharUnicodeCategory:()=>getCharUnicodeCategory,getNormalizedUnicodes:()=>s,getUnicodeForGlyph:()=>getUnicodeForGlyph,getUnicodeRangeFor:()=>getUnicodeRangeFor,mapSpecialUnicodeValues:()=>mapSpecialUnicodeValues,reverseIfRtl:()=>reverseIfRtl});var a=r(134);const n=(0,a.getLookupTableFactory)((function(e){e[63721]=169;e[63193]=169;e[63720]=174;e[63194]=174;e[63722]=8482;e[63195]=8482;e[63729]=9127;e[63730]=9128;e[63731]=9129;e[63740]=9131;e[63741]=9132;e[63742]=9133;e[63726]=9121;e[63727]=9122;e[63728]=9123;e[63737]=9124;e[63738]=9125;e[63739]=9126;e[63723]=9115;e[63724]=9116;e[63725]=9117;e[63734]=9118;e[63735]=9119;e[63736]=9120}));function mapSpecialUnicodeValues(e){return e>=65520&&e<=65535?0:e>=62976&&e<=63743?n()[e]||e:173===e?45:e}function getUnicodeForGlyph(e,t){let r=t[e];if(void 0!==r)return r;if(!e)return-1;if("u"===e[0]){const t=e.length;let a;if(7===t&&"n"===e[1]&&"i"===e[2])a=e.substring(3);else{if(!(t>=5&&t<=7))return-1;a=e.substring(1)}if(a===a.toUpperCase()){r=parseInt(a,16);if(r>=0)return r}}return-1}const i=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}];function getUnicodeRangeFor(e){for(let t=0,r=i.length;t<r;t++){const r=i[t];if(e>=r.begin&&e<r.end)return t}return-1}const s=(0,a.getArrayLookupTableFactory)((function(){return["¨"," ̈","¯"," ̄","´"," ́","µ","μ","¸"," ̧","IJ","IJ","ij","ij","Ŀ","L·","ŀ","l·","ʼn","ʼn","ſ","s","DŽ","DŽ","Dž","Dž","dž","dž","LJ","LJ","Lj","Lj","lj","lj","NJ","NJ","Nj","Nj","nj","nj","DZ","DZ","Dz","Dz","dz","dz","˘"," ̆","˙"," ̇","˚"," ̊","˛"," ̨","˜"," ̃","˝"," ̋","ͺ"," ͅ","΄"," ́","ϐ","β","ϑ","θ","ϒ","Υ","ϕ","φ","ϖ","π","ϰ","κ","ϱ","ρ","ϲ","ς","ϴ","Θ","ϵ","ε","Ϲ","Σ","և","եւ","ٵ","اٴ","ٶ","وٴ","ٷ","ۇٴ","ٸ","يٴ","ำ","ํา","ຳ","ໍາ","ໜ","ຫນ","ໝ","ຫມ","ཷ","ྲཱྀ","ཹ","ླཱྀ","ẚ","aʾ","᾽"," ̓","᾿"," ̓","῀"," ͂","῾"," ̔"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","‗"," ̳","․",".","‥","..","…","...","″","′′","‴","′′′","‶","‵‵","‷","‵‵‵","‼","!!","‾"," ̅","⁇","??","⁈","?!","⁉","!?","⁗","′′′′"," "," ","₨","Rs","℀","a/c","℁","a/s","℃","°C","℅","c/o","℆","c/u","ℇ","Ɛ","℉","°F","№","No","℡","TEL","ℵ","א","ℶ","ב","ℷ","ג","ℸ","ד","℻","FAX","Ⅰ","I","Ⅱ","II","Ⅲ","III","Ⅳ","IV","Ⅴ","V","Ⅵ","VI","Ⅶ","VII","Ⅷ","VIII","Ⅸ","IX","Ⅹ","X","Ⅺ","XI","Ⅻ","XII","Ⅼ","L","Ⅽ","C","Ⅾ","D","Ⅿ","M","ⅰ","i","ⅱ","ii","ⅲ","iii","ⅳ","iv","ⅴ","v","ⅵ","vi","ⅶ","vii","ⅷ","viii","ⅸ","ix","ⅹ","x","ⅺ","xi","ⅻ","xii","ⅼ","l","ⅽ","c","ⅾ","d","ⅿ","m","∬","∫∫","∭","∫∫∫","∯","∮∮","∰","∮∮∮","⑴","(1)","⑵","(2)","⑶","(3)","⑷","(4)","⑸","(5)","⑹","(6)","⑺","(7)","⑻","(8)","⑼","(9)","⑽","(10)","⑾","(11)","⑿","(12)","⒀","(13)","⒁","(14)","⒂","(15)","⒃","(16)","⒄","(17)","⒅","(18)","⒆","(19)","⒇","(20)","⒈","1.","⒉","2.","⒊","3.","⒋","4.","⒌","5.","⒍","6.","⒎","7.","⒏","8.","⒐","9.","⒑","10.","⒒","11.","⒓","12.","⒔","13.","⒕","14.","⒖","15.","⒗","16.","⒘","17.","⒙","18.","⒚","19.","⒛","20.","⒜","(a)","⒝","(b)","⒞","(c)","⒟","(d)","⒠","(e)","⒡","(f)","⒢","(g)","⒣","(h)","⒤","(i)","⒥","(j)","⒦","(k)","⒧","(l)","⒨","(m)","⒩","(n)","⒪","(o)","⒫","(p)","⒬","(q)","⒭","(r)","⒮","(s)","⒯","(t)","⒰","(u)","⒱","(v)","⒲","(w)","⒳","(x)","⒴","(y)","⒵","(z)","⨌","∫∫∫∫","⩴","::=","⩵","==","⩶","===","⺟","母","⻳","龟","⼀","一","⼁","丨","⼂","丶","⼃","丿","⼄","乙","⼅","亅","⼆","二","⼇","亠","⼈","人","⼉","儿","⼊","入","⼋","八","⼌","冂","⼍","冖","⼎","冫","⼏","几","⼐","凵","⼑","刀","⼒","力","⼓","勹","⼔","匕","⼕","匚","⼖","匸","⼗","十","⼘","卜","⼙","卩","⼚","厂","⼛","厶","⼜","又","⼝","口","⼞","囗","⼟","土","⼠","士","⼡","夂","⼢","夊","⼣","夕","⼤","大","⼥","女","⼦","子","⼧","宀","⼨","寸","⼩","小","⼪","尢","⼫","尸","⼬","屮","⼭","山","⼮","巛","⼯","工","⼰","己","⼱","巾","⼲","干","⼳","幺","⼴","广","⼵","廴","⼶","廾","⼷","弋","⼸","弓","⼹","彐","⼺","彡","⼻","彳","⼼","心","⼽","戈","⼾","戶","⼿","手","⽀","支","⽁","攴","⽂","文","⽃","斗","⽄","斤","⽅","方","⽆","无","⽇","日","⽈","曰","⽉","月","⽊","木","⽋","欠","⽌","止","⽍","歹","⽎","殳","⽏","毋","⽐","比","⽑","毛","⽒","氏","⽓","气","⽔","水","⽕","火","⽖","爪","⽗","父","⽘","爻","⽙","爿","⽚","片","⽛","牙","⽜","牛","⽝","犬","⽞","玄","⽟","玉","⽠","瓜","⽡","瓦","⽢","甘","⽣","生","⽤","用","⽥","田","⽦","疋","⽧","疒","⽨","癶","⽩","白","⽪","皮","⽫","皿","⽬","目","⽭","矛","⽮","矢","⽯","石","⽰","示","⽱","禸","⽲","禾","⽳","穴","⽴","立","⽵","竹","⽶","米","⽷","糸","⽸","缶","⽹","网","⽺","羊","⽻","羽","⽼","老","⽽","而","⽾","耒","⽿","耳","⾀","聿","⾁","肉","⾂","臣","⾃","自","⾄","至","⾅","臼","⾆","舌","⾇","舛","⾈","舟","⾉","艮","⾊","色","⾋","艸","⾌","虍","⾍","虫","⾎","血","⾏","行","⾐","衣","⾑","襾","⾒","見","⾓","角","⾔","言","⾕","谷","⾖","豆","⾗","豕","⾘","豸","⾙","貝","⾚","赤","⾛","走","⾜","足","⾝","身","⾞","車","⾟","辛","⾠","辰","⾡","辵","⾢","邑","⾣","酉","⾤","釆","⾥","里","⾦","金","⾧","長","⾨","門","⾩","阜","⾪","隶","⾫","隹","⾬","雨","⾭","靑","⾮","非","⾯","面","⾰","革","⾱","韋","⾲","韭","⾳","音","⾴","頁","⾵","風","⾶","飛","⾷","食","⾸","首","⾹","香","⾺","馬","⾻","骨","⾼","高","⾽","髟","⾾","鬥","⾿","鬯","⿀","鬲","⿁","鬼","⿂","魚","⿃","鳥","⿄","鹵","⿅","鹿","⿆","麥","⿇","麻","⿈","黃","⿉","黍","⿊","黑","⿋","黹","⿌","黽","⿍","鼎","⿎","鼓","⿏","鼠","⿐","鼻","⿑","齊","⿒","齒","⿓","龍","⿔","龜","⿕","龠","〶","〒","〸","十","〹","卄","〺","卅","゛"," ゙","゜"," ゚","ㄱ","ᄀ","ㄲ","ᄁ","ㄳ","ᆪ","ㄴ","ᄂ","ㄵ","ᆬ","ㄶ","ᆭ","ㄷ","ᄃ","ㄸ","ᄄ","ㄹ","ᄅ","ㄺ","ᆰ","ㄻ","ᆱ","ㄼ","ᆲ","ㄽ","ᆳ","ㄾ","ᆴ","ㄿ","ᆵ","ㅀ","ᄚ","ㅁ","ᄆ","ㅂ","ᄇ","ㅃ","ᄈ","ㅄ","ᄡ","ㅅ","ᄉ","ㅆ","ᄊ","ㅇ","ᄋ","ㅈ","ᄌ","ㅉ","ᄍ","ㅊ","ᄎ","ㅋ","ᄏ","ㅌ","ᄐ","ㅍ","ᄑ","ㅎ","ᄒ","ㅏ","ᅡ","ㅐ","ᅢ","ㅑ","ᅣ","ㅒ","ᅤ","ㅓ","ᅥ","ㅔ","ᅦ","ㅕ","ᅧ","ㅖ","ᅨ","ㅗ","ᅩ","ㅘ","ᅪ","ㅙ","ᅫ","ㅚ","ᅬ","ㅛ","ᅭ","ㅜ","ᅮ","ㅝ","ᅯ","ㅞ","ᅰ","ㅟ","ᅱ","ㅠ","ᅲ","ㅡ","ᅳ","ㅢ","ᅴ","ㅣ","ᅵ","ㅤ","ᅠ","ㅥ","ᄔ","ㅦ","ᄕ","ㅧ","ᇇ","ㅨ","ᇈ","ㅩ","ᇌ","ㅪ","ᇎ","ㅫ","ᇓ","ㅬ","ᇗ","ㅭ","ᇙ","ㅮ","ᄜ","ㅯ","ᇝ","ㅰ","ᇟ","ㅱ","ᄝ","ㅲ","ᄞ","ㅳ","ᄠ","ㅴ","ᄢ","ㅵ","ᄣ","ㅶ","ᄧ","ㅷ","ᄩ","ㅸ","ᄫ","ㅹ","ᄬ","ㅺ","ᄭ","ㅻ","ᄮ","ㅼ","ᄯ","ㅽ","ᄲ","ㅾ","ᄶ","ㅿ","ᅀ","ㆀ","ᅇ","ㆁ","ᅌ","ㆂ","ᇱ","ㆃ","ᇲ","ㆄ","ᅗ","ㆅ","ᅘ","ㆆ","ᅙ","ㆇ","ᆄ","ㆈ","ᆅ","ㆉ","ᆈ","ㆊ","ᆑ","ㆋ","ᆒ","ㆌ","ᆔ","ㆍ","ᆞ","ㆎ","ᆡ","㈀","(ᄀ)","㈁","(ᄂ)","㈂","(ᄃ)","㈃","(ᄅ)","㈄","(ᄆ)","㈅","(ᄇ)","㈆","(ᄉ)","㈇","(ᄋ)","㈈","(ᄌ)","㈉","(ᄎ)","㈊","(ᄏ)","㈋","(ᄐ)","㈌","(ᄑ)","㈍","(ᄒ)","㈎","(가)","㈏","(나)","㈐","(다)","㈑","(라)","㈒","(마)","㈓","(바)","㈔","(사)","㈕","(아)","㈖","(자)","㈗","(차)","㈘","(카)","㈙","(타)","㈚","(파)","㈛","(하)","㈜","(주)","㈝","(오전)","㈞","(오후)","㈠","(一)","㈡","(二)","㈢","(三)","㈣","(四)","㈤","(五)","㈥","(六)","㈦","(七)","㈧","(八)","㈨","(九)","㈩","(十)","㈪","(月)","㈫","(火)","㈬","(水)","㈭","(木)","㈮","(金)","㈯","(土)","㈰","(日)","㈱","(株)","㈲","(有)","㈳","(社)","㈴","(名)","㈵","(特)","㈶","(財)","㈷","(祝)","㈸","(労)","㈹","(代)","㈺","(呼)","㈻","(学)","㈼","(監)","㈽","(企)","㈾","(資)","㈿","(協)","㉀","(祭)","㉁","(休)","㉂","(自)","㉃","(至)","㋀","1月","㋁","2月","㋂","3月","㋃","4月","㋄","5月","㋅","6月","㋆","7月","㋇","8月","㋈","9月","㋉","10月","㋊","11月","㋋","12月","㍘","0点","㍙","1点","㍚","2点","㍛","3点","㍜","4点","㍝","5点","㍞","6点","㍟","7点","㍠","8点","㍡","9点","㍢","10点","㍣","11点","㍤","12点","㍥","13点","㍦","14点","㍧","15点","㍨","16点","㍩","17点","㍪","18点","㍫","19点","㍬","20点","㍭","21点","㍮","22点","㍯","23点","㍰","24点","㏠","1日","㏡","2日","㏢","3日","㏣","4日","㏤","5日","㏥","6日","㏦","7日","㏧","8日","㏨","9日","㏩","10日","㏪","11日","㏫","12日","㏬","13日","㏭","14日","㏮","15日","㏯","16日","㏰","17日","㏱","18日","㏲","19日","㏳","20日","㏴","21日","㏵","22日","㏶","23日","㏷","24日","㏸","25日","㏹","26日","㏺","27日","㏻","28日","㏼","29日","㏽","30日","㏾","31日","ff","ff","fi","fi","fl","fl","ffi","ffi","ffl","ffl","ſt","ſt","st","st","ﬓ","մն","ﬔ","մե","ﬕ","մի","ﬖ","վն","ﬗ","մխ","ﭏ","אל","ﭐ","ٱ","ﭑ","ٱ","ﭒ","ٻ","ﭓ","ٻ","ﭔ","ٻ","ﭕ","ٻ","ﭖ","پ","ﭗ","پ","ﭘ","پ","ﭙ","پ","ﭚ","ڀ","ﭛ","ڀ","ﭜ","ڀ","ﭝ","ڀ","ﭞ","ٺ","ﭟ","ٺ","ﭠ","ٺ","ﭡ","ٺ","ﭢ","ٿ","ﭣ","ٿ","ﭤ","ٿ","ﭥ","ٿ","ﭦ","ٹ","ﭧ","ٹ","ﭨ","ٹ","ﭩ","ٹ","ﭪ","ڤ","ﭫ","ڤ","ﭬ","ڤ","ﭭ","ڤ","ﭮ","ڦ","ﭯ","ڦ","ﭰ","ڦ","ﭱ","ڦ","ﭲ","ڄ","ﭳ","ڄ","ﭴ","ڄ","ﭵ","ڄ","ﭶ","ڃ","ﭷ","ڃ","ﭸ","ڃ","ﭹ","ڃ","ﭺ","چ","ﭻ","چ","ﭼ","چ","ﭽ","چ","ﭾ","ڇ","ﭿ","ڇ","ﮀ","ڇ","ﮁ","ڇ","ﮂ","ڍ","ﮃ","ڍ","ﮄ","ڌ","ﮅ","ڌ","ﮆ","ڎ","ﮇ","ڎ","ﮈ","ڈ","ﮉ","ڈ","ﮊ","ژ","ﮋ","ژ","ﮌ","ڑ","ﮍ","ڑ","ﮎ","ک","ﮏ","ک","ﮐ","ک","ﮑ","ک","ﮒ","گ","ﮓ","گ","ﮔ","گ","ﮕ","گ","ﮖ","ڳ","ﮗ","ڳ","ﮘ","ڳ","ﮙ","ڳ","ﮚ","ڱ","ﮛ","ڱ","ﮜ","ڱ","ﮝ","ڱ","ﮞ","ں","ﮟ","ں","ﮠ","ڻ","ﮡ","ڻ","ﮢ","ڻ","ﮣ","ڻ","ﮤ","ۀ","ﮥ","ۀ","ﮦ","ہ","ﮧ","ہ","ﮨ","ہ","ﮩ","ہ","ﮪ","ھ","ﮫ","ھ","ﮬ","ھ","ﮭ","ھ","ﮮ","ے","ﮯ","ے","ﮰ","ۓ","ﮱ","ۓ","ﯓ","ڭ","ﯔ","ڭ","ﯕ","ڭ","ﯖ","ڭ","ﯗ","ۇ","ﯘ","ۇ","ﯙ","ۆ","ﯚ","ۆ","ﯛ","ۈ","ﯜ","ۈ","ﯝ","ٷ","ﯞ","ۋ","ﯟ","ۋ","ﯠ","ۅ","ﯡ","ۅ","ﯢ","ۉ","ﯣ","ۉ","ﯤ","ې","ﯥ","ې","ﯦ","ې","ﯧ","ې","ﯨ","ى","ﯩ","ى","ﯪ","ئا","ﯫ","ئا","ﯬ","ئە","ﯭ","ئە","ﯮ","ئو","ﯯ","ئو","ﯰ","ئۇ","ﯱ","ئۇ","ﯲ","ئۆ","ﯳ","ئۆ","ﯴ","ئۈ","ﯵ","ئۈ","ﯶ","ئې","ﯷ","ئې","ﯸ","ئې","ﯹ","ئى","ﯺ","ئى","ﯻ","ئى","ﯼ","ی","ﯽ","ی","ﯾ","ی","ﯿ","ی","ﰀ","ئج","ﰁ","ئح","ﰂ","ئم","ﰃ","ئى","ﰄ","ئي","ﰅ","بج","ﰆ","بح","ﰇ","بخ","ﰈ","بم","ﰉ","بى","ﰊ","بي","ﰋ","تج","ﰌ","تح","ﰍ","تخ","ﰎ","تم","ﰏ","تى","ﰐ","تي","ﰑ","ثج","ﰒ","ثم","ﰓ","ثى","ﰔ","ثي","ﰕ","جح","ﰖ","جم","ﰗ","حج","ﰘ","حم","ﰙ","خج","ﰚ","خح","ﰛ","خم","ﰜ","سج","ﰝ","سح","ﰞ","سخ","ﰟ","سم","ﰠ","صح","ﰡ","صم","ﰢ","ضج","ﰣ","ضح","ﰤ","ضخ","ﰥ","ضم","ﰦ","طح","ﰧ","طم","ﰨ","ظم","ﰩ","عج","ﰪ","عم","ﰫ","غج","ﰬ","غم","ﰭ","فج","ﰮ","فح","ﰯ","فخ","ﰰ","فم","ﰱ","فى","ﰲ","في","ﰳ","قح","ﰴ","قم","ﰵ","قى","ﰶ","قي","ﰷ","كا","ﰸ","كج","ﰹ","كح","ﰺ","كخ","ﰻ","كل","ﰼ","كم","ﰽ","كى","ﰾ","كي","ﰿ","لج","ﱀ","لح","ﱁ","لخ","ﱂ","لم","ﱃ","لى","ﱄ","لي","ﱅ","مج","ﱆ","مح","ﱇ","مخ","ﱈ","مم","ﱉ","مى","ﱊ","مي","ﱋ","نج","ﱌ","نح","ﱍ","نخ","ﱎ","نم","ﱏ","نى","ﱐ","ني","ﱑ","هج","ﱒ","هم","ﱓ","هى","ﱔ","هي","ﱕ","يج","ﱖ","يح","ﱗ","يخ","ﱘ","يم","ﱙ","يى","ﱚ","يي","ﱛ","ذٰ","ﱜ","رٰ","ﱝ","ىٰ","ﱞ"," ٌّ","ﱟ"," ٍّ","ﱠ"," َّ","ﱡ"," ُّ","ﱢ"," ِّ","ﱣ"," ّٰ","ﱤ","ئر","ﱥ","ئز","ﱦ","ئم","ﱧ","ئن","ﱨ","ئى","ﱩ","ئي","ﱪ","بر","ﱫ","بز","ﱬ","بم","ﱭ","بن","ﱮ","بى","ﱯ","بي","ﱰ","تر","ﱱ","تز","ﱲ","تم","ﱳ","تن","ﱴ","تى","ﱵ","تي","ﱶ","ثر","ﱷ","ثز","ﱸ","ثم","ﱹ","ثن","ﱺ","ثى","ﱻ","ثي","ﱼ","فى","ﱽ","في","ﱾ","قى","ﱿ","قي","ﲀ","كا","ﲁ","كل","ﲂ","كم","ﲃ","كى","ﲄ","كي","ﲅ","لم","ﲆ","لى","ﲇ","لي","ﲈ","ما","ﲉ","مم","ﲊ","نر","ﲋ","نز","ﲌ","نم","ﲍ","نن","ﲎ","نى","ﲏ","ني","ﲐ","ىٰ","ﲑ","ير","ﲒ","يز","ﲓ","يم","ﲔ","ين","ﲕ","يى","ﲖ","يي","ﲗ","ئج","ﲘ","ئح","ﲙ","ئخ","ﲚ","ئم","ﲛ","ئه","ﲜ","بج","ﲝ","بح","ﲞ","بخ","ﲟ","بم","ﲠ","به","ﲡ","تج","ﲢ","تح","ﲣ","تخ","ﲤ","تم","ﲥ","ته","ﲦ","ثم","ﲧ","جح","ﲨ","جم","ﲩ","حج","ﲪ","حم","ﲫ","خج","ﲬ","خم","ﲭ","سج","ﲮ","سح","ﲯ","سخ","ﲰ","سم","ﲱ","صح","ﲲ","صخ","ﲳ","صم","ﲴ","ضج","ﲵ","ضح","ﲶ","ضخ","ﲷ","ضم","ﲸ","طح","ﲹ","ظم","ﲺ","عج","ﲻ","عم","ﲼ","غج","ﲽ","غم","ﲾ","فج","ﲿ","فح","ﳀ","فخ","ﳁ","فم","ﳂ","قح","ﳃ","قم","ﳄ","كج","ﳅ","كح","ﳆ","كخ","ﳇ","كل","ﳈ","كم","ﳉ","لج","ﳊ","لح","ﳋ","لخ","ﳌ","لم","ﳍ","له","ﳎ","مج","ﳏ","مح","ﳐ","مخ","ﳑ","مم","ﳒ","نج","ﳓ","نح","ﳔ","نخ","ﳕ","نم","ﳖ","نه","ﳗ","هج","ﳘ","هم","ﳙ","هٰ","ﳚ","يج","ﳛ","يح","ﳜ","يخ","ﳝ","يم","ﳞ","يه","ﳟ","ئم","ﳠ","ئه","ﳡ","بم","ﳢ","به","ﳣ","تم","ﳤ","ته","ﳥ","ثم","ﳦ","ثه","ﳧ","سم","ﳨ","سه","ﳩ","شم","ﳪ","شه","ﳫ","كل","ﳬ","كم","ﳭ","لم","ﳮ","نم","ﳯ","نه","ﳰ","يم","ﳱ","يه","ﳲ","ـَّ","ﳳ","ـُّ","ﳴ","ـِّ","ﳵ","طى","ﳶ","طي","ﳷ","عى","ﳸ","عي","ﳹ","غى","ﳺ","غي","ﳻ","سى","ﳼ","سي","ﳽ","شى","ﳾ","شي","ﳿ","حى","ﴀ","حي","ﴁ","جى","ﴂ","جي","ﴃ","خى","ﴄ","خي","ﴅ","صى","ﴆ","صي","ﴇ","ضى","ﴈ","ضي","ﴉ","شج","ﴊ","شح","ﴋ","شخ","ﴌ","شم","ﴍ","شر","ﴎ","سر","ﴏ","صر","ﴐ","ضر","ﴑ","طى","ﴒ","طي","ﴓ","عى","ﴔ","عي","ﴕ","غى","ﴖ","غي","ﴗ","سى","ﴘ","سي","ﴙ","شى","ﴚ","شي","ﴛ","حى","ﴜ","حي","ﴝ","جى","ﴞ","جي","ﴟ","خى","ﴠ","خي","ﴡ","صى","ﴢ","صي","ﴣ","ضى","ﴤ","ضي","ﴥ","شج","ﴦ","شح","ﴧ","شخ","ﴨ","شم","ﴩ","شر","ﴪ","سر","ﴫ","صر","ﴬ","ضر","ﴭ","شج","ﴮ","شح","ﴯ","شخ","ﴰ","شم","ﴱ","سه","ﴲ","شه","ﴳ","طم","ﴴ","سج","ﴵ","سح","ﴶ","سخ","ﴷ","شج","ﴸ","شح","ﴹ","شخ","ﴺ","طم","ﴻ","ظم","ﴼ","اً","ﴽ","اً","ﵐ","تجم","ﵑ","تحج","ﵒ","تحج","ﵓ","تحم","ﵔ","تخم","ﵕ","تمج","ﵖ","تمح","ﵗ","تمخ","ﵘ","جمح","ﵙ","جمح","ﵚ","حمي","ﵛ","حمى","ﵜ","سحج","ﵝ","سجح","ﵞ","سجى","ﵟ","سمح","ﵠ","سمح","ﵡ","سمج","ﵢ","سمم","ﵣ","سمم","ﵤ","صحح","ﵥ","صحح","ﵦ","صمم","ﵧ","شحم","ﵨ","شحم","ﵩ","شجي","ﵪ","شمخ","ﵫ","شمخ","ﵬ","شمم","ﵭ","شمم","ﵮ","ضحى","ﵯ","ضخم","ﵰ","ضخم","ﵱ","طمح","ﵲ","طمح","ﵳ","طمم","ﵴ","طمي","ﵵ","عجم","ﵶ","عمم","ﵷ","عمم","ﵸ","عمى","ﵹ","غمم","ﵺ","غمي","ﵻ","غمى","ﵼ","فخم","ﵽ","فخم","ﵾ","قمح","ﵿ","قمم","ﶀ","لحم","ﶁ","لحي","ﶂ","لحى","ﶃ","لجج","ﶄ","لجج","ﶅ","لخم","ﶆ","لخم","ﶇ","لمح","ﶈ","لمح","ﶉ","محج","ﶊ","محم","ﶋ","محي","ﶌ","مجح","ﶍ","مجم","ﶎ","مخج","ﶏ","مخم","ﶒ","مجخ","ﶓ","همج","ﶔ","همم","ﶕ","نحم","ﶖ","نحى","ﶗ","نجم","ﶘ","نجم","ﶙ","نجى","ﶚ","نمي","ﶛ","نمى","ﶜ","يمم","ﶝ","يمم","ﶞ","بخي","ﶟ","تجي","ﶠ","تجى","ﶡ","تخي","ﶢ","تخى","ﶣ","تمي","ﶤ","تمى","ﶥ","جمي","ﶦ","جحى","ﶧ","جمى","ﶨ","سخى","ﶩ","صحي","ﶪ","شحي","ﶫ","ضحي","ﶬ","لجي","ﶭ","لمي","ﶮ","يحي","ﶯ","يجي","ﶰ","يمي","ﶱ","ممي","ﶲ","قمي","ﶳ","نحي","ﶴ","قمح","ﶵ","لحم","ﶶ","عمي","ﶷ","كمي","ﶸ","نجح","ﶹ","مخي","ﶺ","لجم","ﶻ","كمم","ﶼ","لجم","ﶽ","نجح","ﶾ","جحي","ﶿ","حجي","ﷀ","مجي","ﷁ","فمي","ﷂ","بحي","ﷃ","كمم","ﷄ","عجم","ﷅ","صمم","ﷆ","سخي","ﷇ","نجي","﹉","‾","﹊","‾","﹋","‾","﹌","‾","﹍","_","﹎","_","﹏","_","ﺀ","ء","ﺁ","آ","ﺂ","آ","ﺃ","أ","ﺄ","أ","ﺅ","ؤ","ﺆ","ؤ","ﺇ","إ","ﺈ","إ","ﺉ","ئ","ﺊ","ئ","ﺋ","ئ","ﺌ","ئ","ﺍ","ا","ﺎ","ا","ﺏ","ب","ﺐ","ب","ﺑ","ب","ﺒ","ب","ﺓ","ة","ﺔ","ة","ﺕ","ت","ﺖ","ت","ﺗ","ت","ﺘ","ت","ﺙ","ث","ﺚ","ث","ﺛ","ث","ﺜ","ث","ﺝ","ج","ﺞ","ج","ﺟ","ج","ﺠ","ج","ﺡ","ح","ﺢ","ح","ﺣ","ح","ﺤ","ح","ﺥ","خ","ﺦ","خ","ﺧ","خ","ﺨ","خ","ﺩ","د","ﺪ","د","ﺫ","ذ","ﺬ","ذ","ﺭ","ر","ﺮ","ر","ﺯ","ز","ﺰ","ز","ﺱ","س","ﺲ","س","ﺳ","س","ﺴ","س","ﺵ","ش","ﺶ","ش","ﺷ","ش","ﺸ","ش","ﺹ","ص","ﺺ","ص","ﺻ","ص","ﺼ","ص","ﺽ","ض","ﺾ","ض","ﺿ","ض","ﻀ","ض","ﻁ","ط","ﻂ","ط","ﻃ","ط","ﻄ","ط","ﻅ","ظ","ﻆ","ظ","ﻇ","ظ","ﻈ","ظ","ﻉ","ع","ﻊ","ع","ﻋ","ع","ﻌ","ع","ﻍ","غ","ﻎ","غ","ﻏ","غ","ﻐ","غ","ﻑ","ف","ﻒ","ف","ﻓ","ف","ﻔ","ف","ﻕ","ق","ﻖ","ق","ﻗ","ق","ﻘ","ق","ﻙ","ك","ﻚ","ك","ﻛ","ك","ﻜ","ك","ﻝ","ل","ﻞ","ل","ﻟ","ل","ﻠ","ل","ﻡ","م","ﻢ","م","ﻣ","م","ﻤ","م","ﻥ","ن","ﻦ","ن","ﻧ","ن","ﻨ","ن","ﻩ","ه","ﻪ","ه","ﻫ","ه","ﻬ","ه","ﻭ","و","ﻮ","و","ﻯ","ى","ﻰ","ى","ﻱ","ي","ﻲ","ي","ﻳ","ي","ﻴ","ي","ﻵ","لآ","ﻶ","لآ","ﻷ","لأ","ﻸ","لأ","ﻹ","لإ","ﻺ","لإ","ﻻ","لا","ﻼ","لا"]}));function reverseIfRtl(e){const t=e.length;if(t<=1||!function isRTLRangeFor(e){let t=i[13];if(e>=t.begin&&e<t.end)return!0;t=i[11];return e>=t.begin&&e<t.end}(e.charCodeAt(0)))return e;const r=[];for(let a=t-1;a>=0;a--)r.push(e[a]);return r.join("")}const o=new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$","u"),c=new Map;function getCharUnicodeCategory(e){const t=c.get(e);if(t)return t;const r=e.match(o),a={isWhitespace:!(!r||!r[1]),isZeroWidthDiacritic:!(!r||!r[2]),isInvisibleFormatMark:!(!r||!r[3])};c.set(e,a);return a}function clearUnicodeCaches(){c.clear()}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getSerifFonts=t.getNonStdFontMap=t.getGlyphMapForStandardFonts=t.getFontNameToFileMap=void 0;t.getStandardFontName=function getStandardFontName(e){const t=(0,n.normalizeFontName)(e);return i()[t]};t.getSymbolsFonts=t.getSupplementalGlyphMapForCalibri=t.getSupplementalGlyphMapForArialBlack=t.getStdFontMap=void 0;var a=r(134),n=r(166);const i=(0,a.getLookupTableFactory)((function(e){e["Times-Roman"]="Times-Roman";e.Helvetica="Helvetica";e.Courier="Courier";e.Symbol="Symbol";e["Times-Bold"]="Times-Bold";e["Helvetica-Bold"]="Helvetica-Bold";e["Courier-Bold"]="Courier-Bold";e.ZapfDingbats="ZapfDingbats";e["Times-Italic"]="Times-Italic";e["Helvetica-Oblique"]="Helvetica-Oblique";e["Courier-Oblique"]="Courier-Oblique";e["Times-BoldItalic"]="Times-BoldItalic";e["Helvetica-BoldOblique"]="Helvetica-BoldOblique";e["Courier-BoldOblique"]="Courier-BoldOblique";e.ArialNarrow="Helvetica";e["ArialNarrow-Bold"]="Helvetica-Bold";e["ArialNarrow-BoldItalic"]="Helvetica-BoldOblique";e["ArialNarrow-Italic"]="Helvetica-Oblique";e.ArialBlack="Helvetica";e["ArialBlack-Bold"]="Helvetica-Bold";e["ArialBlack-BoldItalic"]="Helvetica-BoldOblique";e["ArialBlack-Italic"]="Helvetica-Oblique";e["Arial-Black"]="Helvetica";e["Arial-Black-Bold"]="Helvetica-Bold";e["Arial-Black-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Black-Italic"]="Helvetica-Oblique";e.Arial="Helvetica";e["Arial-Bold"]="Helvetica-Bold";e["Arial-BoldItalic"]="Helvetica-BoldOblique";e["Arial-Italic"]="Helvetica-Oblique";e.ArialMT="Helvetica";e["Arial-BoldItalicMT"]="Helvetica-BoldOblique";e["Arial-BoldMT"]="Helvetica-Bold";e["Arial-ItalicMT"]="Helvetica-Oblique";e.ArialUnicodeMS="Helvetica";e["ArialUnicodeMS-Bold"]="Helvetica-Bold";e["ArialUnicodeMS-BoldItalic"]="Helvetica-BoldOblique";e["ArialUnicodeMS-Italic"]="Helvetica-Oblique";e["Courier-BoldItalic"]="Courier-BoldOblique";e["Courier-Italic"]="Courier-Oblique";e.CourierNew="Courier";e["CourierNew-Bold"]="Courier-Bold";e["CourierNew-BoldItalic"]="Courier-BoldOblique";e["CourierNew-Italic"]="Courier-Oblique";e["CourierNewPS-BoldItalicMT"]="Courier-BoldOblique";e["CourierNewPS-BoldMT"]="Courier-Bold";e["CourierNewPS-ItalicMT"]="Courier-Oblique";e.CourierNewPSMT="Courier";e["Helvetica-BoldItalic"]="Helvetica-BoldOblique";e["Helvetica-Italic"]="Helvetica-Oblique";e["Symbol-Bold"]="Symbol";e["Symbol-BoldItalic"]="Symbol";e["Symbol-Italic"]="Symbol";e.TimesNewRoman="Times-Roman";e["TimesNewRoman-Bold"]="Times-Bold";e["TimesNewRoman-BoldItalic"]="Times-BoldItalic";e["TimesNewRoman-Italic"]="Times-Italic";e.TimesNewRomanPS="Times-Roman";e["TimesNewRomanPS-Bold"]="Times-Bold";e["TimesNewRomanPS-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPS-BoldItalicMT"]="Times-BoldItalic";e["TimesNewRomanPS-BoldMT"]="Times-Bold";e["TimesNewRomanPS-Italic"]="Times-Italic";e["TimesNewRomanPS-ItalicMT"]="Times-Italic";e.TimesNewRomanPSMT="Times-Roman";e["TimesNewRomanPSMT-Bold"]="Times-Bold";e["TimesNewRomanPSMT-BoldItalic"]="Times-BoldItalic";e["TimesNewRomanPSMT-Italic"]="Times-Italic"}));t.getStdFontMap=i;const s=(0,a.getLookupTableFactory)((function(e){e.Courier="FoxitFixed.pfb";e["Courier-Bold"]="FoxitFixedBold.pfb";e["Courier-BoldOblique"]="FoxitFixedBoldItalic.pfb";e["Courier-Oblique"]="FoxitFixedItalic.pfb";e.Helvetica="FoxitSans.pfb";e["Helvetica-Bold"]="FoxitSansBold.pfb";e["Helvetica-BoldOblique"]="FoxitSansBoldItalic.pfb";e["Helvetica-Oblique"]="FoxitSansItalic.pfb";e["Times-Roman"]="FoxitSerif.pfb";e["Times-Bold"]="FoxitSerifBold.pfb";e["Times-BoldItalic"]="FoxitSerifBoldItalic.pfb";e["Times-Italic"]="FoxitSerifItalic.pfb";e.Symbol="FoxitSymbol.pfb";e.ZapfDingbats="FoxitDingbats.pfb";e["LiberationSans-Regular"]="LiberationSans-Regular.ttf";e["LiberationSans-Bold"]="LiberationSans-Bold.ttf";e["LiberationSans-Italic"]="LiberationSans-Italic.ttf";e["LiberationSans-BoldItalic"]="LiberationSans-BoldItalic.ttf"}));t.getFontNameToFileMap=s;const o=(0,a.getLookupTableFactory)((function(e){e.Calibri="Helvetica";e["Calibri-Bold"]="Helvetica-Bold";e["Calibri-BoldItalic"]="Helvetica-BoldOblique";e["Calibri-Italic"]="Helvetica-Oblique";e.CenturyGothic="Helvetica";e["CenturyGothic-Bold"]="Helvetica-Bold";e["CenturyGothic-BoldItalic"]="Helvetica-BoldOblique";e["CenturyGothic-Italic"]="Helvetica-Oblique";e.ComicSansMS="Comic Sans MS";e["ComicSansMS-Bold"]="Comic Sans MS-Bold";e["ComicSansMS-BoldItalic"]="Comic Sans MS-BoldItalic";e["ComicSansMS-Italic"]="Comic Sans MS-Italic";e["ItcSymbol-Bold"]="Helvetica-Bold";e["ItcSymbol-BoldItalic"]="Helvetica-BoldOblique";e["ItcSymbol-Book"]="Helvetica";e["ItcSymbol-BookItalic"]="Helvetica-Oblique";e["ItcSymbol-Medium"]="Helvetica";e["ItcSymbol-MediumItalic"]="Helvetica-Oblique";e.LucidaConsole="Courier";e["LucidaConsole-Bold"]="Courier-Bold";e["LucidaConsole-BoldItalic"]="Courier-BoldOblique";e["LucidaConsole-Italic"]="Courier-Oblique";e["LucidaSans-Demi"]="Helvetica-Bold";e["MS-Gothic"]="MS Gothic";e["MS-Gothic-Bold"]="MS Gothic-Bold";e["MS-Gothic-BoldItalic"]="MS Gothic-BoldItalic";e["MS-Gothic-Italic"]="MS Gothic-Italic";e["MS-Mincho"]="MS Mincho";e["MS-Mincho-Bold"]="MS Mincho-Bold";e["MS-Mincho-BoldItalic"]="MS Mincho-BoldItalic";e["MS-Mincho-Italic"]="MS Mincho-Italic";e["MS-PGothic"]="MS PGothic";e["MS-PGothic-Bold"]="MS PGothic-Bold";e["MS-PGothic-BoldItalic"]="MS PGothic-BoldItalic";e["MS-PGothic-Italic"]="MS PGothic-Italic";e["MS-PMincho"]="MS PMincho";e["MS-PMincho-Bold"]="MS PMincho-Bold";e["MS-PMincho-BoldItalic"]="MS PMincho-BoldItalic";e["MS-PMincho-Italic"]="MS PMincho-Italic";e.NuptialScript="Times-Italic";e.SegoeUISymbol="Helvetica";e.Wingdings="ZapfDingbats";e["Wingdings-Regular"]="ZapfDingbats"}));t.getNonStdFontMap=o;const c=(0,a.getLookupTableFactory)((function(e){e["Adobe Jenson"]=!0;e["Adobe Text"]=!0;e.Albertus=!0;e.Aldus=!0;e.Alexandria=!0;e.Algerian=!0;e["American Typewriter"]=!0;e.Antiqua=!0;e.Apex=!0;e.Arno=!0;e.Aster=!0;e.Aurora=!0;e.Baskerville=!0;e.Bell=!0;e.Bembo=!0;e["Bembo Schoolbook"]=!0;e.Benguiat=!0;e["Berkeley Old Style"]=!0;e["Bernhard Modern"]=!0;e["Berthold City"]=!0;e.Bodoni=!0;e["Bauer Bodoni"]=!0;e["Book Antiqua"]=!0;e.Bookman=!0;e["Bordeaux Roman"]=!0;e["Californian FB"]=!0;e.Calisto=!0;e.Calvert=!0;e.Capitals=!0;e.Cambria=!0;e.Cartier=!0;e.Caslon=!0;e.Catull=!0;e.Centaur=!0;e["Century Old Style"]=!0;e["Century Schoolbook"]=!0;e.Chaparral=!0;e["Charis SIL"]=!0;e.Cheltenham=!0;e["Cholla Slab"]=!0;e.Clarendon=!0;e.Clearface=!0;e.Cochin=!0;e.Colonna=!0;e["Computer Modern"]=!0;e["Concrete Roman"]=!0;e.Constantia=!0;e["Cooper Black"]=!0;e.Corona=!0;e.Ecotype=!0;e.Egyptienne=!0;e.Elephant=!0;e.Excelsior=!0;e.Fairfield=!0;e["FF Scala"]=!0;e.Folkard=!0;e.Footlight=!0;e.FreeSerif=!0;e["Friz Quadrata"]=!0;e.Garamond=!0;e.Gentium=!0;e.Georgia=!0;e.Gloucester=!0;e["Goudy Old Style"]=!0;e["Goudy Schoolbook"]=!0;e["Goudy Pro Font"]=!0;e.Granjon=!0;e["Guardian Egyptian"]=!0;e.Heather=!0;e.Hercules=!0;e["High Tower Text"]=!0;e.Hiroshige=!0;e["Hoefler Text"]=!0;e["Humana Serif"]=!0;e.Imprint=!0;e["Ionic No. 5"]=!0;e.Janson=!0;e.Joanna=!0;e.Korinna=!0;e.Lexicon=!0;e.LiberationSerif=!0;e["Liberation Serif"]=!0;e["Linux Libertine"]=!0;e.Literaturnaya=!0;e.Lucida=!0;e["Lucida Bright"]=!0;e.Melior=!0;e.Memphis=!0;e.Miller=!0;e.Minion=!0;e.Modern=!0;e["Mona Lisa"]=!0;e["Mrs Eaves"]=!0;e["MS Serif"]=!0;e["Museo Slab"]=!0;e["New York"]=!0;e["Nimbus Roman"]=!0;e["NPS Rawlinson Roadway"]=!0;e.NuptialScript=!0;e.Palatino=!0;e.Perpetua=!0;e.Plantin=!0;e["Plantin Schoolbook"]=!0;e.Playbill=!0;e["Poor Richard"]=!0;e["Rawlinson Roadway"]=!0;e.Renault=!0;e.Requiem=!0;e.Rockwell=!0;e.Roman=!0;e["Rotis Serif"]=!0;e.Sabon=!0;e.Scala=!0;e.Seagull=!0;e.Sistina=!0;e.Souvenir=!0;e.STIX=!0;e["Stone Informal"]=!0;e["Stone Serif"]=!0;e.Sylfaen=!0;e.Times=!0;e.Trajan=!0;e["Trinité"]=!0;e["Trump Mediaeval"]=!0;e.Utopia=!0;e["Vale Type"]=!0;e["Bitstream Vera"]=!0;e["Vera Serif"]=!0;e.Versailles=!0;e.Wanted=!0;e.Weiss=!0;e["Wide Latin"]=!0;e.Windsor=!0;e.XITS=!0}));t.getSerifFonts=c;const l=(0,a.getLookupTableFactory)((function(e){e.Dingbats=!0;e.Symbol=!0;e.ZapfDingbats=!0}));t.getSymbolsFonts=l;const h=(0,a.getLookupTableFactory)((function(e){e[2]=10;e[3]=32;e[4]=33;e[5]=34;e[6]=35;e[7]=36;e[8]=37;e[9]=38;e[10]=39;e[11]=40;e[12]=41;e[13]=42;e[14]=43;e[15]=44;e[16]=45;e[17]=46;e[18]=47;e[19]=48;e[20]=49;e[21]=50;e[22]=51;e[23]=52;e[24]=53;e[25]=54;e[26]=55;e[27]=56;e[28]=57;e[29]=58;e[30]=894;e[31]=60;e[32]=61;e[33]=62;e[34]=63;e[35]=64;e[36]=65;e[37]=66;e[38]=67;e[39]=68;e[40]=69;e[41]=70;e[42]=71;e[43]=72;e[44]=73;e[45]=74;e[46]=75;e[47]=76;e[48]=77;e[49]=78;e[50]=79;e[51]=80;e[52]=81;e[53]=82;e[54]=83;e[55]=84;e[56]=85;e[57]=86;e[58]=87;e[59]=88;e[60]=89;e[61]=90;e[62]=91;e[63]=92;e[64]=93;e[65]=94;e[66]=95;e[67]=96;e[68]=97;e[69]=98;e[70]=99;e[71]=100;e[72]=101;e[73]=102;e[74]=103;e[75]=104;e[76]=105;e[77]=106;e[78]=107;e[79]=108;e[80]=109;e[81]=110;e[82]=111;e[83]=112;e[84]=113;e[85]=114;e[86]=115;e[87]=116;e[88]=117;e[89]=118;e[90]=119;e[91]=120;e[92]=121;e[93]=122;e[94]=123;e[95]=124;e[96]=125;e[97]=126;e[98]=196;e[99]=197;e[100]=199;e[101]=201;e[102]=209;e[103]=214;e[104]=220;e[105]=225;e[106]=224;e[107]=226;e[108]=228;e[109]=227;e[110]=229;e[111]=231;e[112]=233;e[113]=232;e[114]=234;e[115]=235;e[116]=237;e[117]=236;e[118]=238;e[119]=239;e[120]=241;e[121]=243;e[122]=242;e[123]=244;e[124]=246;e[125]=245;e[126]=250;e[127]=249;e[128]=251;e[129]=252;e[130]=8224;e[131]=176;e[132]=162;e[133]=163;e[134]=167;e[135]=8226;e[136]=182;e[137]=223;e[138]=174;e[139]=169;e[140]=8482;e[141]=180;e[142]=168;e[143]=8800;e[144]=198;e[145]=216;e[146]=8734;e[147]=177;e[148]=8804;e[149]=8805;e[150]=165;e[151]=181;e[152]=8706;e[153]=8721;e[154]=8719;e[156]=8747;e[157]=170;e[158]=186;e[159]=8486;e[160]=230;e[161]=248;e[162]=191;e[163]=161;e[164]=172;e[165]=8730;e[166]=402;e[167]=8776;e[168]=8710;e[169]=171;e[170]=187;e[171]=8230;e[179]=8220;e[180]=8221;e[181]=8216;e[182]=8217;e[200]=193;e[203]=205;e[210]=218;e[223]=711;e[224]=321;e[225]=322;e[226]=352;e[227]=353;e[228]=381;e[229]=382;e[233]=221;e[234]=253;e[252]=263;e[253]=268;e[254]=269;e[258]=258;e[260]=260;e[261]=261;e[265]=280;e[266]=281;e[267]=282;e[268]=283;e[269]=313;e[275]=323;e[276]=324;e[278]=328;e[283]=344;e[284]=345;e[285]=346;e[286]=347;e[292]=367;e[295]=377;e[296]=378;e[298]=380;e[305]=963;e[306]=964;e[307]=966;e[308]=8215;e[309]=8252;e[310]=8319;e[311]=8359;e[312]=8592;e[313]=8593;e[337]=9552;e[493]=1039;e[494]=1040;e[672]=1488;e[673]=1489;e[674]=1490;e[675]=1491;e[676]=1492;e[677]=1493;e[678]=1494;e[679]=1495;e[680]=1496;e[681]=1497;e[682]=1498;e[683]=1499;e[684]=1500;e[685]=1501;e[686]=1502;e[687]=1503;e[688]=1504;e[689]=1505;e[690]=1506;e[691]=1507;e[692]=1508;e[693]=1509;e[694]=1510;e[695]=1511;e[696]=1512;e[697]=1513;e[698]=1514;e[705]=1524;e[706]=8362;e[710]=64288;e[711]=64298;e[759]=1617;e[761]=1776;e[763]=1778;e[775]=1652;e[777]=1764;e[778]=1780;e[779]=1781;e[780]=1782;e[782]=771;e[783]=64726;e[786]=8363;e[788]=8532;e[790]=768;e[791]=769;e[792]=768;e[795]=803;e[797]=64336;e[798]=64337;e[799]=64342;e[800]=64343;e[801]=64344;e[802]=64345;e[803]=64362;e[804]=64363;e[805]=64364;e[2424]=7821;e[2425]=7822;e[2426]=7823;e[2427]=7824;e[2428]=7825;e[2429]=7826;e[2430]=7827;e[2433]=7682;e[2678]=8045;e[2679]=8046;e[2830]=1552;e[2838]=686;e[2840]=751;e[2842]=753;e[2843]=754;e[2844]=755;e[2846]=757;e[2856]=767;e[2857]=848;e[2858]=849;e[2862]=853;e[2863]=854;e[2864]=855;e[2865]=861;e[2866]=862;e[2906]=7460;e[2908]=7462;e[2909]=7463;e[2910]=7464;e[2912]=7466;e[2913]=7467;e[2914]=7468;e[2916]=7470;e[2917]=7471;e[2918]=7472;e[2920]=7474;e[2921]=7475;e[2922]=7476;e[2924]=7478;e[2925]=7479;e[2926]=7480;e[2928]=7482;e[2929]=7483;e[2930]=7484;e[2932]=7486;e[2933]=7487;e[2934]=7488;e[2936]=7490;e[2937]=7491;e[2938]=7492;e[2940]=7494;e[2941]=7495;e[2942]=7496;e[2944]=7498;e[2946]=7500;e[2948]=7502;e[2950]=7504;e[2951]=7505;e[2952]=7506;e[2954]=7508;e[2955]=7509;e[2956]=7510;e[2958]=7512;e[2959]=7513;e[2960]=7514;e[2962]=7516;e[2963]=7517;e[2964]=7518;e[2966]=7520;e[2967]=7521;e[2968]=7522;e[2970]=7524;e[2971]=7525;e[2972]=7526;e[2974]=7528;e[2975]=7529;e[2976]=7530;e[2978]=1537;e[2979]=1538;e[2980]=1539;e[2982]=1549;e[2983]=1551;e[2984]=1552;e[2986]=1554;e[2987]=1555;e[2988]=1556;e[2990]=1623;e[2991]=1624;e[2995]=1775;e[2999]=1791;e[3002]=64290;e[3003]=64291;e[3004]=64292;e[3006]=64294;e[3007]=64295;e[3008]=64296;e[3011]=1900;e[3014]=8223;e[3015]=8244;e[3017]=7532;e[3018]=7533;e[3019]=7534;e[3075]=7590;e[3076]=7591;e[3079]=7594;e[3080]=7595;e[3083]=7598;e[3084]=7599;e[3087]=7602;e[3088]=7603;e[3091]=7606;e[3092]=7607;e[3095]=7610;e[3096]=7611;e[3099]=7614;e[3100]=7615;e[3103]=7618;e[3104]=7619;e[3107]=8337;e[3108]=8338;e[3116]=1884;e[3119]=1885;e[3120]=1885;e[3123]=1886;e[3124]=1886;e[3127]=1887;e[3128]=1887;e[3131]=1888;e[3132]=1888;e[3135]=1889;e[3136]=1889;e[3139]=1890;e[3140]=1890;e[3143]=1891;e[3144]=1891;e[3147]=1892;e[3148]=1892;e[3153]=580;e[3154]=581;e[3157]=584;e[3158]=585;e[3161]=588;e[3162]=589;e[3165]=891;e[3166]=892;e[3169]=1274;e[3170]=1275;e[3173]=1278;e[3174]=1279;e[3181]=7622;e[3182]=7623;e[3282]=11799;e[3316]=578;e[3379]=42785;e[3393]=1159;e[3416]=8377}));t.getGlyphMapForStandardFonts=h;const u=(0,a.getLookupTableFactory)((function(e){e[227]=322;e[264]=261;e[291]=346}));t.getSupplementalGlyphMapForArialBlack=u;const d=(0,a.getLookupTableFactory)((function(e){e[1]=32;e[4]=65;e[5]=192;e[6]=193;e[17]=66;e[18]=67;e[21]=268;e[24]=68;e[28]=69;e[29]=200;e[30]=201;e[32]=282;e[38]=70;e[39]=71;e[44]=72;e[47]=73;e[48]=204;e[49]=205;e[58]=74;e[60]=75;e[62]=76;e[68]=77;e[69]=78;e[75]=79;e[76]=210;e[87]=80;e[89]=81;e[90]=82;e[92]=344;e[94]=83;e[97]=352;e[100]=84;e[104]=85;e[115]=86;e[116]=87;e[121]=88;e[122]=89;e[124]=221;e[127]=90;e[129]=381;e[258]=97;e[259]=224;e[260]=225;e[268]=261;e[271]=98;e[272]=99;e[273]=263;e[275]=269;e[282]=100;e[286]=101;e[287]=232;e[288]=233;e[290]=283;e[295]=281;e[296]=102;e[336]=103;e[346]=104;e[349]=105;e[350]=236;e[351]=237;e[361]=106;e[364]=107;e[367]=108;e[371]=322;e[373]=109;e[374]=110;e[381]=111;e[382]=242;e[383]=243;e[393]=112;e[395]=113;e[396]=114;e[398]=345;e[400]=115;e[401]=347;e[403]=353;e[410]=116;e[437]=117;e[448]=118;e[449]=119;e[454]=120;e[455]=121;e[457]=253;e[460]=122;e[462]=382;e[463]=380;e[853]=44;e[855]=58;e[856]=46;e[876]=47;e[878]=45;e[882]=45;e[894]=40;e[895]=41;e[896]=91;e[897]=93;e[923]=64;e[1004]=48;e[1005]=49;e[1006]=50;e[1007]=51;e[1008]=52;e[1009]=53;e[1010]=54;e[1011]=55;e[1012]=56;e[1013]=57;e[1081]=37;e[1085]=43;e[1086]=45}));t.getSupplementalGlyphMapForCalibri=d},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ToUnicodeMap=t.IdentityToUnicodeMap=void 0;var a=r(2);t.ToUnicodeMap=class ToUnicodeMap{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._map=e}get length(){return this._map.length}forEach(e){for(const t in this._map)e(t,this._map[t].charCodeAt(0))}has(e){return void 0!==this._map[e]}get(e){return this._map[e]}charCodeOf(e){const t=this._map;if(t.length<=65536)return t.indexOf(e);for(const r in t)if(t[r]===e)return 0|r;return-1}amend(e){for(const t in e)this._map[t]=e[t]}};t.IdentityToUnicodeMap=class IdentityToUnicodeMap{constructor(e,t){this.firstChar=e;this.lastChar=t}get length(){return this.lastChar+1-this.firstChar}forEach(e){for(let t=this.firstChar,r=this.lastChar;t<=r;t++)e(t,t)}has(e){return this.firstChar<=e&&e<=this.lastChar}get(e){if(this.firstChar<=e&&e<=this.lastChar)return String.fromCharCode(e)}charCodeOf(e){return Number.isInteger(e)&&e>=this.firstChar&&e<=this.lastChar?e:-1}amend(e){(0,a.unreachable)("Should not call amend()")}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CFFFont=void 0;var a=r(163),n=r(166),i=r(2);t.CFFFont=class CFFFont{constructor(e,t){this.properties=t;const r=new a.CFFParser(e,t,n.SEAC_ANALYSIS_ENABLED);this.cff=r.parse();this.cff.duplicateFirstGlyph();const s=new a.CFFCompiler(this.cff);this.seacs=this.cff.seacs;try{this.data=s.compile()}catch(r){(0,i.warn)("Failed to compile font "+t.loadedName);this.data=e}this._createBuiltInEncoding()}get numGlyphs(){return this.cff.charStrings.count}getCharset(){return this.cff.charset.charset}getGlyphMapping(){const e=this.cff,t=this.properties,r=e.charset.charset;let a,i;if(t.composite){a=Object.create(null);let n;if(e.isCIDFont)for(i=0;i<r.length;i++){const e=r[i];n=t.cMap.charCodeOf(e);a[n]=i}else for(i=0;i<e.charStrings.count;i++){n=t.cMap.charCodeOf(i);a[n]=i}return a}let s=e.encoding?e.encoding.encoding:null;t.isInternalFont&&(s=t.defaultEncoding);a=(0,n.type1FontGlyphMapping)(t,s,r);return a}hasGlyphId(e){return this.cff.hasGlyphId(e)}_createBuiltInEncoding(){const{charset:e,encoding:t}=this.cff;if(!e||!t)return;const r=e.charset,a=t.encoding,n=[];for(const e in a){const t=a[e];if(t>=0){const a=r[t];a&&(n[e]=a)}}n.length>0&&(this.properties.builtInEncoding=n)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FontRendererFactory=void 0;var a=r(2),n=r(163),i=r(167),s=r(165),o=r(138);function getUint32(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function getUint16(e,t){return e[t]<<8|e[t+1]}function getInt16(e,t){return(e[t]<<24|e[t+1]<<16)>>16}function getInt8(e,t){return e[t]<<24>>24}function getFloat214(e,t){return getInt16(e,t)/16384}function getSubroutineBias(e){const t=e.length;let r=32768;t<1240?r=107:t<33900&&(r=1131);return r}function parseCmap(e,t,r){const n=1===getUint16(e,t+2)?getUint32(e,t+8):getUint32(e,t+16),i=getUint16(e,t+n);let s,o,c;if(4===i){getUint16(e,t+n+2);const r=getUint16(e,t+n+6)>>1;o=t+n+14;s=[];for(c=0;c<r;c++,o+=2)s[c]={end:getUint16(e,o)};o+=2;for(c=0;c<r;c++,o+=2)s[c].start=getUint16(e,o);for(c=0;c<r;c++,o+=2)s[c].idDelta=getUint16(e,o);for(c=0;c<r;c++,o+=2){let t=getUint16(e,o);if(0!==t){s[c].ids=[];for(let r=0,a=s[c].end-s[c].start+1;r<a;r++){s[c].ids[r]=getUint16(e,o+t);t+=2}}}return s}if(12===i){const r=getUint32(e,t+n+12);o=t+n+16;s=[];for(c=0;c<r;c++){t=getUint32(e,o);s.push({start:t,end:getUint32(e,o+4),idDelta:getUint32(e,o+8)-t});o+=12}return s}throw new a.FormatError(`unsupported cmap: ${i}`)}function parseCff(e,t,r,a){const i=new n.CFFParser(new o.Stream(e,t,r-t),{},a).parse();return{glyphs:i.charStrings.objects,subrs:i.topDict.privateDict&&i.topDict.privateDict.subrsIndex&&i.topDict.privateDict.subrsIndex.objects,gsubrs:i.globalSubrIndex&&i.globalSubrIndex.objects,isCFFCIDFont:i.isCIDFont,fdSelect:i.fdSelect,fdArray:i.fdArray}}function lookupCmap(e,t){const r=t.codePointAt(0);let a=0,n=0,i=e.length-1;for(;n<i;){const t=n+i+1>>1;r<e[t].start?i=t-1:n=t}e[n].start<=r&&r<=e[n].end&&(a=e[n].idDelta+(e[n].ids?e[n].ids[r-e[n].start]:r)&65535);return{charCode:r,glyphId:a}}function compileGlyf(e,t,r){function moveTo(e,r){t.push({cmd:"moveTo",args:[e,r]})}function lineTo(e,r){t.push({cmd:"lineTo",args:[e,r]})}function quadraticCurveTo(e,r,a,n){t.push({cmd:"quadraticCurveTo",args:[e,r,a,n]})}let a=0;const n=getInt16(e,a);let i,s=0,o=0;a+=10;if(n<0)do{i=getUint16(e,a);const n=getUint16(e,a+2);a+=4;let c,l;if(1&i){if(2&i){c=getInt16(e,a);l=getInt16(e,a+2)}else{c=getUint16(e,a);l=getUint16(e,a+2)}a+=4}else if(2&i){c=getInt8(e,a++);l=getInt8(e,a++)}else{c=e[a++];l=e[a++]}if(2&i){s=c;o=l}else{s=0;o=0}let h=1,u=1,d=0,f=0;if(8&i){h=u=getFloat214(e,a);a+=2}else if(64&i){h=getFloat214(e,a);u=getFloat214(e,a+2);a+=4}else if(128&i){h=getFloat214(e,a);d=getFloat214(e,a+2);f=getFloat214(e,a+4);u=getFloat214(e,a+6);a+=8}const g=r.glyphs[n];if(g){t.push({cmd:"save"},{cmd:"transform",args:[h,d,f,u,s,o]});compileGlyf(g,t,r);t.push({cmd:"restore"})}}while(32&i);else{const t=[];let r,c;for(r=0;r<n;r++){t.push(getUint16(e,a));a+=2}a+=2+getUint16(e,a);const l=t.at(-1)+1,h=[];for(;h.length<l;){i=e[a++];let t=1;8&i&&(t+=e[a++]);for(;t-- >0;)h.push({flags:i})}for(r=0;r<l;r++){switch(18&h[r].flags){case 0:s+=getInt16(e,a);a+=2;break;case 2:s-=e[a++];break;case 18:s+=e[a++]}h[r].x=s}for(r=0;r<l;r++){switch(36&h[r].flags){case 0:o+=getInt16(e,a);a+=2;break;case 4:o-=e[a++];break;case 36:o+=e[a++]}h[r].y=o}let u=0;for(a=0;a<n;a++){const e=t[a],n=h.slice(u,e+1);if(1&n[0].flags)n.push(n[0]);else if(1&n.at(-1).flags)n.unshift(n.at(-1));else{const e={flags:1,x:(n[0].x+n.at(-1).x)/2,y:(n[0].y+n.at(-1).y)/2};n.unshift(e);n.push(e)}moveTo(n[0].x,n[0].y);for(r=1,c=n.length;r<c;r++)if(1&n[r].flags)lineTo(n[r].x,n[r].y);else if(1&n[r+1].flags){quadraticCurveTo(n[r].x,n[r].y,n[r+1].x,n[r+1].y);r++}else quadraticCurveTo(n[r].x,n[r].y,(n[r].x+n[r+1].x)/2,(n[r].y+n[r+1].y)/2);u=e+1}}}function compileCharString(e,t,r,n){function moveTo(e,r){t.push({cmd:"moveTo",args:[e,r]})}function lineTo(e,r){t.push({cmd:"lineTo",args:[e,r]})}function bezierCurveTo(e,r,a,n,i,s){t.push({cmd:"bezierCurveTo",args:[e,r,a,n,i,s]})}const i=[];let o=0,c=0,l=0;!function parse(e){let h=0;for(;h<e.length;){let u,d,f,g,p,m,b,y,w,S=!1,x=e[h++];switch(x){case 1:case 3:case 18:case 23:l+=i.length>>1;S=!0;break;case 4:c+=i.pop();moveTo(o,c);S=!0;break;case 5:for(;i.length>0;){o+=i.shift();c+=i.shift();lineTo(o,c)}break;case 6:for(;i.length>0;){o+=i.shift();lineTo(o,c);if(0===i.length)break;c+=i.shift();lineTo(o,c)}break;case 7:for(;i.length>0;){c+=i.shift();lineTo(o,c);if(0===i.length)break;o+=i.shift();lineTo(o,c)}break;case 8:for(;i.length>0;){u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}break;case 10:y=i.pop();w=null;if(r.isCFFCIDFont){const e=r.fdSelect.getFDIndex(n);if(e>=0&&e<r.fdArray.length){const t=r.fdArray[e];let a;t.privateDict&&t.privateDict.subrsIndex&&(a=t.privateDict.subrsIndex.objects);if(a){y+=getSubroutineBias(a);w=a[y]}}else(0,a.warn)("Invalid fd index for glyph index.")}else w=r.subrs[y+r.subrsBias];w&&parse(w);break;case 11:return;case 12:x=e[h++];switch(x){case 34:u=o+i.shift();d=u+i.shift();p=c+i.shift();o=d+i.shift();bezierCurveTo(u,c,d,p,o,p);u=o+i.shift();d=u+i.shift();o=d+i.shift();bezierCurveTo(u,p,d,c,o,c);break;case 35:u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);i.pop();break;case 36:u=o+i.shift();p=c+i.shift();d=u+i.shift();m=p+i.shift();o=d+i.shift();bezierCurveTo(u,p,d,m,o,m);u=o+i.shift();d=u+i.shift();b=m+i.shift();o=d+i.shift();bezierCurveTo(u,m,d,b,o,c);break;case 37:const e=o,t=c;u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d;c=g;Math.abs(o-e)>Math.abs(c-t)?o+=i.shift():c+=i.shift();bezierCurveTo(u,f,d,g,o,c);break;default:throw new a.FormatError(`unknown operator: 12 ${x}`)}break;case 14:if(i.length>=4){const e=i.pop(),a=i.pop();c=i.pop();o=i.pop();t.push({cmd:"save"},{cmd:"translate",args:[o,c]});let n=lookupCmap(r.cmap,String.fromCharCode(r.glyphNameMap[s.StandardEncoding[e]]));compileCharString(r.glyphs[n.glyphId],t,r,n.glyphId);t.push({cmd:"restore"});n=lookupCmap(r.cmap,String.fromCharCode(r.glyphNameMap[s.StandardEncoding[a]]));compileCharString(r.glyphs[n.glyphId],t,r,n.glyphId)}return;case 19:case 20:l+=i.length>>1;h+=l+7>>3;S=!0;break;case 21:c+=i.pop();o+=i.pop();moveTo(o,c);S=!0;break;case 22:o+=i.pop();moveTo(o,c);S=!0;break;case 24:for(;i.length>2;){u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}o+=i.shift();c+=i.shift();lineTo(o,c);break;case 25:for(;i.length>6;){o+=i.shift();c+=i.shift();lineTo(o,c)}u=o+i.shift();f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+i.shift();bezierCurveTo(u,f,d,g,o,c);break;case 26:i.length%2&&(o+=i.shift());for(;i.length>0;){u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d;c=g+i.shift();bezierCurveTo(u,f,d,g,o,c)}break;case 27:i.length%2&&(c+=i.shift());for(;i.length>0;){u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g;bezierCurveTo(u,f,d,g,o,c)}break;case 28:i.push((e[h]<<24|e[h+1]<<16)>>16);h+=2;break;case 29:y=i.pop()+r.gsubrsBias;w=r.gsubrs[y];w&&parse(w);break;case 30:for(;i.length>0;){u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c);if(0===i.length)break;u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();c=g+i.shift();o=d+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c)}break;case 31:for(;i.length>0;){u=o+i.shift();f=c;d=u+i.shift();g=f+i.shift();c=g+i.shift();o=d+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c);if(0===i.length)break;u=o;f=c+i.shift();d=u+i.shift();g=f+i.shift();o=d+i.shift();c=g+(1===i.length?i.shift():0);bezierCurveTo(u,f,d,g,o,c)}break;default:if(x<32)throw new a.FormatError(`unknown operator: ${x}`);if(x<247)i.push(x-139);else if(x<251)i.push(256*(x-247)+e[h++]+108);else if(x<255)i.push(256*-(x-251)-e[h++]-108);else{i.push((e[h]<<24|e[h+1]<<16|e[h+2]<<8|e[h+3])/65536);h+=4}}S&&(i.length=0)}}(e)}const c=[];class CompiledFont{constructor(e){this.constructor===CompiledFont&&(0,a.unreachable)("Cannot initialize CompiledFont.");this.fontMatrix=e;this.compiledGlyphs=Object.create(null);this.compiledCharCodeToGlyphId=Object.create(null)}getPathJs(e){const{charCode:t,glyphId:r}=lookupCmap(this.cmap,e);let a=this.compiledGlyphs[r];if(!a)try{a=this.compileGlyph(this.glyphs[r],r);this.compiledGlyphs[r]=a}catch(e){this.compiledGlyphs[r]=c;void 0===this.compiledCharCodeToGlyphId[t]&&(this.compiledCharCodeToGlyphId[t]=r);throw e}void 0===this.compiledCharCodeToGlyphId[t]&&(this.compiledCharCodeToGlyphId[t]=r);return a}compileGlyph(e,t){if(!e||0===e.length||14===e[0])return c;let r=this.fontMatrix;if(this.isCFFCIDFont){const e=this.fdSelect.getFDIndex(t);if(e>=0&&e<this.fdArray.length){r=this.fdArray[e].getByName("FontMatrix")||a.FONT_IDENTITY_MATRIX}else(0,a.warn)("Invalid fd index for glyph index.")}const n=[{cmd:"save"},{cmd:"transform",args:r.slice()},{cmd:"scale",args:["size","-size"]}];this.compileGlyphImpl(e,n,t);n.push({cmd:"restore"});return n}compileGlyphImpl(){(0,a.unreachable)("Children classes should implement this.")}hasBuiltPath(e){const{charCode:t,glyphId:r}=lookupCmap(this.cmap,e);return void 0!==this.compiledGlyphs[r]&&void 0!==this.compiledCharCodeToGlyphId[t]}}class TrueTypeCompiled extends CompiledFont{constructor(e,t,r){super(r||[488e-6,0,0,488e-6,0,0]);this.glyphs=e;this.cmap=t}compileGlyphImpl(e,t){compileGlyf(e,t,this)}}class Type2Compiled extends CompiledFont{constructor(e,t,r,a){super(r||[.001,0,0,.001,0,0]);this.glyphs=e.glyphs;this.gsubrs=e.gsubrs||[];this.subrs=e.subrs||[];this.cmap=t;this.glyphNameMap=a||(0,i.getGlyphsUnicode)();this.gsubrsBias=getSubroutineBias(this.gsubrs);this.subrsBias=getSubroutineBias(this.subrs);this.isCFFCIDFont=e.isCFFCIDFont;this.fdSelect=e.fdSelect;this.fdArray=e.fdArray}compileGlyphImpl(e,t,r){compileCharString(e,t,this,r)}}t.FontRendererFactory=class FontRendererFactory{static create(e,t){const r=new Uint8Array(e.data);let n,i,s,o,c,l;const h=getUint16(r,4);for(let e=0,u=12;e<h;e++,u+=16){const e=(0,a.bytesToString)(r.subarray(u,u+4)),h=getUint32(r,u+8),d=getUint32(r,u+12);switch(e){case"cmap":n=parseCmap(r,h);break;case"glyf":i=r.subarray(h,h+d);break;case"loca":s=r.subarray(h,h+d);break;case"head":l=getUint16(r,h+18);c=getUint16(r,h+50);break;case"CFF ":o=parseCff(r,h,h+d,t)}}if(i){const t=l?[1/l,0,0,1/l,0,0]:e.fontMatrix;return new TrueTypeCompiled(function parseGlyfTable(e,t,r){let a,n;if(r){a=4;n=getUint32}else{a=2;n=(e,t)=>2*getUint16(e,t)}const i=[];let s=n(t,0);for(let r=a;r<t.length;r+=a){const a=n(t,r);i.push(e.subarray(s,a));s=a}return i}(i,s,c),n,t)}return new Type2Compiled(o,n,e.fontMatrix,e.glyphNameMap)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getMetrics=t.getFontBasicMetrics=void 0;var a=r(134);const n=(0,a.getLookupTableFactory)((function(e){e.Courier=600;e["Courier-Bold"]=600;e["Courier-BoldOblique"]=600;e["Courier-Oblique"]=600;e.Helvetica=(0,a.getLookupTableFactory)((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Bold"]=(0,a.getLookupTableFactory)((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-BoldOblique"]=(0,a.getLookupTableFactory)((function(e){e.space=278;e.exclam=333;e.quotedbl=474;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=722;e.quoteright=278;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=333;e.semicolon=333;e.less=584;e.equal=584;e.greater=584;e.question=611;e.at=975;e.A=722;e.B=722;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=556;e.K=722;e.L=611;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=584;e.underscore=556;e.quoteleft=278;e.a=556;e.b=611;e.c=556;e.d=611;e.e=556;e.f=333;e.g=611;e.h=611;e.i=278;e.j=278;e.k=556;e.l=278;e.m=889;e.n=611;e.o=611;e.p=611;e.q=611;e.r=389;e.s=556;e.t=333;e.u=611;e.v=556;e.w=778;e.x=556;e.y=556;e.z=500;e.braceleft=389;e.bar=280;e.braceright=389;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=238;e.quotedblleft=500;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=611;e.fl=611;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=556;e.bullet=350;e.quotesinglbase=278;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=611;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=278;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=611;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=722;e.aacute=556;e.Ucircumflex=722;e.yacute=556;e.scommaaccent=556;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=611;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=556;e.aring=556;e.Ncommaaccent=722;e.lacute=278;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=556;e.scedilla=556;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=611;e.acircumflex=556;e.Amacron=722;e.rcaron=389;e.ccedilla=556;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=743;e.Umacron=722;e.uring=611;e.threesuperior=333;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=584;e.uacute=611;e.Tcaron=611;e.partialdiff=494;e.ydieresis=556;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=556;e.nacute=611;e.umacron=611;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=280;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=611;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=389;e.eogonek=556;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=556;e.zacute=500;e.iogonek=278;e.Oacute=778;e.oacute=611;e.amacron=556;e.sacute=556;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=611;e.twosuperior=333;e.Odieresis=778;e.mu=611;e.igrave=278;e.ohungarumlaut=611;e.Eogonek=667;e.dcroat=611;e.threequarters=834;e.Scedilla=667;e.lcaron=400;e.Kcommaaccent=722;e.Lacute=611;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=611;e.onehalf=834;e.lessequal=549;e.ocircumflex=611;e.ntilde=611;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=611;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=611;e.Ccaron=722;e.ugrave=611;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=611;e.Rcommaaccent=722;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=556;e.minus=584;e.Icircumflex=278;e.ncaron=611;e.tcommaaccent=333;e.logicalnot=584;e.odieresis=611;e.udieresis=611;e.notequal=549;e.gcommaaccent=611;e.eth=611;e.zcaron=500;e.ncommaaccent=611;e.onesuperior=333;e.imacron=278;e.Euro=556}));e["Helvetica-Oblique"]=(0,a.getLookupTableFactory)((function(e){e.space=278;e.exclam=278;e.quotedbl=355;e.numbersign=556;e.dollar=556;e.percent=889;e.ampersand=667;e.quoteright=222;e.parenleft=333;e.parenright=333;e.asterisk=389;e.plus=584;e.comma=278;e.hyphen=333;e.period=278;e.slash=278;e.zero=556;e.one=556;e.two=556;e.three=556;e.four=556;e.five=556;e.six=556;e.seven=556;e.eight=556;e.nine=556;e.colon=278;e.semicolon=278;e.less=584;e.equal=584;e.greater=584;e.question=556;e.at=1015;e.A=667;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=722;e.I=278;e.J=500;e.K=667;e.L=556;e.M=833;e.N=722;e.O=778;e.P=667;e.Q=778;e.R=722;e.S=667;e.T=611;e.U=722;e.V=667;e.W=944;e.X=667;e.Y=667;e.Z=611;e.bracketleft=278;e.backslash=278;e.bracketright=278;e.asciicircum=469;e.underscore=556;e.quoteleft=222;e.a=556;e.b=556;e.c=500;e.d=556;e.e=556;e.f=278;e.g=556;e.h=556;e.i=222;e.j=222;e.k=500;e.l=222;e.m=833;e.n=556;e.o=556;e.p=556;e.q=556;e.r=333;e.s=500;e.t=278;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=500;e.braceleft=334;e.bar=260;e.braceright=334;e.asciitilde=584;e.exclamdown=333;e.cent=556;e.sterling=556;e.fraction=167;e.yen=556;e.florin=556;e.section=556;e.currency=556;e.quotesingle=191;e.quotedblleft=333;e.guillemotleft=556;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=556;e.dagger=556;e.daggerdbl=556;e.periodcentered=278;e.paragraph=537;e.bullet=350;e.quotesinglbase=222;e.quotedblbase=333;e.quotedblright=333;e.guillemotright=556;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=611;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=370;e.Lslash=556;e.Oslash=778;e.OE=1e3;e.ordmasculine=365;e.ae=889;e.dotlessi=278;e.lslash=222;e.oslash=611;e.oe=944;e.germandbls=611;e.Idieresis=278;e.eacute=556;e.abreve=556;e.uhungarumlaut=556;e.ecaron=556;e.Ydieresis=667;e.divide=584;e.Yacute=667;e.Acircumflex=667;e.aacute=556;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=500;e.ecircumflex=556;e.Uring=722;e.Udieresis=722;e.aogonek=556;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=737;e.Emacron=667;e.ccaron=500;e.aring=556;e.Ncommaaccent=722;e.lacute=222;e.agrave=556;e.Tcommaaccent=611;e.Cacute=722;e.atilde=556;e.Edotaccent=667;e.scaron=500;e.scedilla=500;e.iacute=278;e.lozenge=471;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=556;e.Amacron=667;e.rcaron=333;e.ccedilla=500;e.Zdotaccent=611;e.Thorn=667;e.Omacron=778;e.Racute=722;e.Sacute=667;e.dcaron=643;e.Umacron=722;e.uring=556;e.threesuperior=333;e.Ograve=778;e.Agrave=667;e.Abreve=667;e.multiply=584;e.uacute=556;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=556;e.edieresis=556;e.cacute=500;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=278;e.plusminus=584;e.brokenbar=260;e.registered=737;e.Gbreve=778;e.Idotaccent=278;e.summation=600;e.Egrave=667;e.racute=333;e.omacron=556;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=222;e.tcaron=317;e.eogonek=556;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=556;e.zacute=500;e.iogonek=222;e.Oacute=778;e.oacute=556;e.amacron=556;e.sacute=500;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=333;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=556;e.Eogonek=667;e.dcroat=556;e.threequarters=834;e.Scedilla=667;e.lcaron=299;e.Kcommaaccent=667;e.Lacute=556;e.trademark=1e3;e.edotaccent=556;e.Igrave=278;e.Imacron=278;e.Lcaron=556;e.onehalf=834;e.lessequal=549;e.ocircumflex=556;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=556;e.gbreve=556;e.onequarter=834;e.Scaron=667;e.Scommaaccent=667;e.Ohungarumlaut=778;e.degree=400;e.ograve=556;e.Ccaron=722;e.ugrave=556;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=556;e.Rcommaaccent=722;e.Lcommaaccent=556;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=778;e.zdotaccent=500;e.Ecaron=667;e.Iogonek=278;e.kcommaaccent=500;e.minus=584;e.Icircumflex=278;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=584;e.odieresis=556;e.udieresis=556;e.notequal=549;e.gcommaaccent=556;e.eth=556;e.zcaron=500;e.ncommaaccent=556;e.onesuperior=333;e.imacron=278;e.Euro=556}));e.Symbol=(0,a.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.universal=713;e.numbersign=500;e.existential=549;e.percent=833;e.ampersand=778;e.suchthat=439;e.parenleft=333;e.parenright=333;e.asteriskmath=500;e.plus=549;e.comma=250;e.minus=549;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=549;e.equal=549;e.greater=549;e.question=444;e.congruent=549;e.Alpha=722;e.Beta=667;e.Chi=722;e.Delta=612;e.Epsilon=611;e.Phi=763;e.Gamma=603;e.Eta=722;e.Iota=333;e.theta1=631;e.Kappa=722;e.Lambda=686;e.Mu=889;e.Nu=722;e.Omicron=722;e.Pi=768;e.Theta=741;e.Rho=556;e.Sigma=592;e.Tau=611;e.Upsilon=690;e.sigma1=439;e.Omega=768;e.Xi=645;e.Psi=795;e.Zeta=611;e.bracketleft=333;e.therefore=863;e.bracketright=333;e.perpendicular=658;e.underscore=500;e.radicalex=500;e.alpha=631;e.beta=549;e.chi=549;e.delta=494;e.epsilon=439;e.phi=521;e.gamma=411;e.eta=603;e.iota=329;e.phi1=603;e.kappa=549;e.lambda=549;e.mu=576;e.nu=521;e.omicron=549;e.pi=549;e.theta=521;e.rho=549;e.sigma=603;e.tau=439;e.upsilon=576;e.omega1=713;e.omega=686;e.xi=493;e.psi=686;e.zeta=494;e.braceleft=480;e.bar=200;e.braceright=480;e.similar=549;e.Euro=750;e.Upsilon1=620;e.minute=247;e.lessequal=549;e.fraction=167;e.infinity=713;e.florin=500;e.club=753;e.diamond=753;e.heart=753;e.spade=753;e.arrowboth=1042;e.arrowleft=987;e.arrowup=603;e.arrowright=987;e.arrowdown=603;e.degree=400;e.plusminus=549;e.second=411;e.greaterequal=549;e.multiply=549;e.proportional=713;e.partialdiff=494;e.bullet=460;e.divide=549;e.notequal=549;e.equivalence=549;e.approxequal=549;e.ellipsis=1e3;e.arrowvertex=603;e.arrowhorizex=1e3;e.carriagereturn=658;e.aleph=823;e.Ifraktur=686;e.Rfraktur=795;e.weierstrass=987;e.circlemultiply=768;e.circleplus=768;e.emptyset=823;e.intersection=768;e.union=768;e.propersuperset=713;e.reflexsuperset=713;e.notsubset=713;e.propersubset=713;e.reflexsubset=713;e.element=713;e.notelement=713;e.angle=768;e.gradient=713;e.registerserif=790;e.copyrightserif=790;e.trademarkserif=890;e.product=823;e.radical=549;e.dotmath=250;e.logicalnot=713;e.logicaland=603;e.logicalor=603;e.arrowdblboth=1042;e.arrowdblleft=987;e.arrowdblup=603;e.arrowdblright=987;e.arrowdbldown=603;e.lozenge=494;e.angleleft=329;e.registersans=790;e.copyrightsans=790;e.trademarksans=786;e.summation=713;e.parenlefttp=384;e.parenleftex=384;e.parenleftbt=384;e.bracketlefttp=384;e.bracketleftex=384;e.bracketleftbt=384;e.bracelefttp=494;e.braceleftmid=494;e.braceleftbt=494;e.braceex=494;e.angleright=329;e.integral=274;e.integraltp=686;e.integralex=686;e.integralbt=686;e.parenrighttp=384;e.parenrightex=384;e.parenrightbt=384;e.bracketrighttp=384;e.bracketrightex=384;e.bracketrightbt=384;e.bracerighttp=494;e.bracerightmid=494;e.bracerightbt=494;e.apple=790}));e["Times-Roman"]=(0,a.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=408;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=564;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=278;e.semicolon=278;e.less=564;e.equal=564;e.greater=564;e.question=444;e.at=921;e.A=722;e.B=667;e.C=667;e.D=722;e.E=611;e.F=556;e.G=722;e.H=722;e.I=333;e.J=389;e.K=722;e.L=611;e.M=889;e.N=722;e.O=722;e.P=556;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=722;e.W=944;e.X=722;e.Y=722;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=469;e.underscore=500;e.quoteleft=333;e.a=444;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=500;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=500;e.o=500;e.p=500;e.q=500;e.r=333;e.s=389;e.t=278;e.u=500;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=480;e.bar=200;e.braceright=480;e.asciitilde=541;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=180;e.quotedblleft=444;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=453;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=444;e.quotedblright=444;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=444;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=889;e.ordfeminine=276;e.Lslash=611;e.Oslash=722;e.OE=889;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=444;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=722;e.divide=564;e.Yacute=722;e.Acircumflex=722;e.aacute=444;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=444;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=444;e.Ncommaaccent=722;e.lacute=278;e.agrave=444;e.Tcommaaccent=611;e.Cacute=667;e.atilde=444;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=444;e.Amacron=722;e.rcaron=333;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=556;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=588;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=722;e.Abreve=722;e.multiply=564;e.uacute=500;e.Tcaron=611;e.partialdiff=476;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=444;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=722;e.Iacute=333;e.plusminus=564;e.brokenbar=200;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=333;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=326;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=444;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=344;e.Kcommaaccent=722;e.Lacute=611;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=333;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=722;e.zdotaccent=444;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=500;e.minus=564;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=564;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Bold"]=(0,a.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=1e3;e.ampersand=833;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=930;e.A=722;e.B=667;e.C=722;e.D=722;e.E=667;e.F=611;e.G=778;e.H=778;e.I=389;e.J=500;e.K=778;e.L=667;e.M=944;e.N=722;e.O=778;e.P=611;e.Q=778;e.R=722;e.S=556;e.T=667;e.U=722;e.V=722;e.W=1e3;e.X=722;e.Y=722;e.Z=667;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=581;e.underscore=500;e.quoteleft=333;e.a=500;e.b=556;e.c=444;e.d=556;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=333;e.k=556;e.l=278;e.m=833;e.n=556;e.o=500;e.p=556;e.q=556;e.r=444;e.s=389;e.t=333;e.u=556;e.v=500;e.w=722;e.x=500;e.y=500;e.z=444;e.braceleft=394;e.bar=220;e.braceright=394;e.asciitilde=520;e.exclamdown=333;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=540;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=1e3;e.ordfeminine=300;e.Lslash=667;e.Oslash=778;e.OE=1e3;e.ordmasculine=330;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=556;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=722;e.divide=570;e.Yacute=722;e.Acircumflex=722;e.aacute=500;e.Ucircumflex=722;e.yacute=500;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=667;e.Cacute=722;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=722;e.Gcommaaccent=778;e.ucircumflex=556;e.acircumflex=500;e.Amacron=722;e.rcaron=444;e.ccedilla=444;e.Zdotaccent=667;e.Thorn=611;e.Omacron=778;e.Racute=722;e.Sacute=556;e.dcaron=672;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=778;e.Agrave=722;e.Abreve=722;e.multiply=570;e.uacute=556;e.Tcaron=667;e.partialdiff=494;e.ydieresis=500;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=778;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=444;e.omacron=500;e.Zacute=667;e.Zcaron=667;e.greaterequal=549;e.Eth=722;e.Ccedilla=722;e.lcommaaccent=278;e.tcaron=416;e.eogonek=444;e.Uogonek=722;e.Aacute=722;e.Adieresis=722;e.egrave=444;e.zacute=444;e.iogonek=278;e.Oacute=778;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=778;e.Ugrave=722;e.Delta=612;e.thorn=556;e.twosuperior=300;e.Odieresis=778;e.mu=556;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=556;e.threequarters=750;e.Scedilla=556;e.lcaron=394;e.Kcommaaccent=778;e.Lacute=667;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=667;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=778;e.degree=400;e.ograve=500;e.Ccaron=722;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=444;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=722;e.Lcommaaccent=667;e.Atilde=722;e.Aogonek=722;e.Aring=722;e.Otilde=778;e.zdotaccent=444;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=556;e.minus=570;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=333;e.logicalnot=570;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=444;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-BoldItalic"]=(0,a.getLookupTableFactory)((function(e){e.space=250;e.exclam=389;e.quotedbl=555;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=570;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=570;e.equal=570;e.greater=570;e.question=500;e.at=832;e.A=667;e.B=667;e.C=667;e.D=722;e.E=667;e.F=667;e.G=722;e.H=778;e.I=389;e.J=500;e.K=667;e.L=611;e.M=889;e.N=722;e.O=722;e.P=611;e.Q=722;e.R=667;e.S=556;e.T=611;e.U=722;e.V=667;e.W=889;e.X=667;e.Y=611;e.Z=611;e.bracketleft=333;e.backslash=278;e.bracketright=333;e.asciicircum=570;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=333;e.g=500;e.h=556;e.i=278;e.j=278;e.k=500;e.l=278;e.m=778;e.n=556;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=556;e.v=444;e.w=667;e.x=500;e.y=444;e.z=389;e.braceleft=348;e.bar=220;e.braceright=348;e.asciitilde=570;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=278;e.quotedblleft=500;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=556;e.fl=556;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=500;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=500;e.quotedblright=500;e.guillemotright=500;e.ellipsis=1e3;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=1e3;e.AE=944;e.ordfeminine=266;e.Lslash=611;e.Oslash=722;e.OE=944;e.ordmasculine=300;e.ae=722;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=722;e.germandbls=500;e.Idieresis=389;e.eacute=444;e.abreve=500;e.uhungarumlaut=556;e.ecaron=444;e.Ydieresis=611;e.divide=570;e.Yacute=611;e.Acircumflex=667;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=556;e.Edieresis=667;e.Dcroat=722;e.commaaccent=250;e.copyright=747;e.Emacron=667;e.ccaron=444;e.aring=500;e.Ncommaaccent=722;e.lacute=278;e.agrave=500;e.Tcommaaccent=611;e.Cacute=667;e.atilde=500;e.Edotaccent=667;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=494;e.Rcaron=667;e.Gcommaaccent=722;e.ucircumflex=556;e.acircumflex=500;e.Amacron=667;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=611;e.Thorn=611;e.Omacron=722;e.Racute=667;e.Sacute=556;e.dcaron=608;e.Umacron=722;e.uring=556;e.threesuperior=300;e.Ograve=722;e.Agrave=667;e.Abreve=667;e.multiply=570;e.uacute=556;e.Tcaron=611;e.partialdiff=494;e.ydieresis=444;e.Nacute=722;e.icircumflex=278;e.Ecircumflex=667;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=556;e.umacron=556;e.Ncaron=722;e.Iacute=389;e.plusminus=570;e.brokenbar=220;e.registered=747;e.Gbreve=722;e.Idotaccent=389;e.summation=600;e.Egrave=667;e.racute=389;e.omacron=500;e.Zacute=611;e.Zcaron=611;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=366;e.eogonek=444;e.Uogonek=722;e.Aacute=667;e.Adieresis=667;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=576;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=667;e.dcroat=500;e.threequarters=750;e.Scedilla=556;e.lcaron=382;e.Kcommaaccent=667;e.Lacute=611;e.trademark=1e3;e.edotaccent=444;e.Igrave=389;e.Imacron=389;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=556;e.Uhungarumlaut=722;e.Eacute=667;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=556;e.Scommaaccent=556;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=556;e.radical=549;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=722;e.otilde=500;e.Rcommaaccent=667;e.Lcommaaccent=611;e.Atilde=667;e.Aogonek=667;e.Aring=667;e.Otilde=722;e.zdotaccent=389;e.Ecaron=667;e.Iogonek=389;e.kcommaaccent=500;e.minus=606;e.Icircumflex=389;e.ncaron=556;e.tcommaaccent=278;e.logicalnot=606;e.odieresis=500;e.udieresis=556;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=556;e.onesuperior=300;e.imacron=278;e.Euro=500}));e["Times-Italic"]=(0,a.getLookupTableFactory)((function(e){e.space=250;e.exclam=333;e.quotedbl=420;e.numbersign=500;e.dollar=500;e.percent=833;e.ampersand=778;e.quoteright=333;e.parenleft=333;e.parenright=333;e.asterisk=500;e.plus=675;e.comma=250;e.hyphen=333;e.period=250;e.slash=278;e.zero=500;e.one=500;e.two=500;e.three=500;e.four=500;e.five=500;e.six=500;e.seven=500;e.eight=500;e.nine=500;e.colon=333;e.semicolon=333;e.less=675;e.equal=675;e.greater=675;e.question=500;e.at=920;e.A=611;e.B=611;e.C=667;e.D=722;e.E=611;e.F=611;e.G=722;e.H=722;e.I=333;e.J=444;e.K=667;e.L=556;e.M=833;e.N=667;e.O=722;e.P=611;e.Q=722;e.R=611;e.S=500;e.T=556;e.U=722;e.V=611;e.W=833;e.X=611;e.Y=556;e.Z=556;e.bracketleft=389;e.backslash=278;e.bracketright=389;e.asciicircum=422;e.underscore=500;e.quoteleft=333;e.a=500;e.b=500;e.c=444;e.d=500;e.e=444;e.f=278;e.g=500;e.h=500;e.i=278;e.j=278;e.k=444;e.l=278;e.m=722;e.n=500;e.o=500;e.p=500;e.q=500;e.r=389;e.s=389;e.t=278;e.u=500;e.v=444;e.w=667;e.x=444;e.y=444;e.z=389;e.braceleft=400;e.bar=275;e.braceright=400;e.asciitilde=541;e.exclamdown=389;e.cent=500;e.sterling=500;e.fraction=167;e.yen=500;e.florin=500;e.section=500;e.currency=500;e.quotesingle=214;e.quotedblleft=556;e.guillemotleft=500;e.guilsinglleft=333;e.guilsinglright=333;e.fi=500;e.fl=500;e.endash=500;e.dagger=500;e.daggerdbl=500;e.periodcentered=250;e.paragraph=523;e.bullet=350;e.quotesinglbase=333;e.quotedblbase=556;e.quotedblright=556;e.guillemotright=500;e.ellipsis=889;e.perthousand=1e3;e.questiondown=500;e.grave=333;e.acute=333;e.circumflex=333;e.tilde=333;e.macron=333;e.breve=333;e.dotaccent=333;e.dieresis=333;e.ring=333;e.cedilla=333;e.hungarumlaut=333;e.ogonek=333;e.caron=333;e.emdash=889;e.AE=889;e.ordfeminine=276;e.Lslash=556;e.Oslash=722;e.OE=944;e.ordmasculine=310;e.ae=667;e.dotlessi=278;e.lslash=278;e.oslash=500;e.oe=667;e.germandbls=500;e.Idieresis=333;e.eacute=444;e.abreve=500;e.uhungarumlaut=500;e.ecaron=444;e.Ydieresis=556;e.divide=675;e.Yacute=556;e.Acircumflex=611;e.aacute=500;e.Ucircumflex=722;e.yacute=444;e.scommaaccent=389;e.ecircumflex=444;e.Uring=722;e.Udieresis=722;e.aogonek=500;e.Uacute=722;e.uogonek=500;e.Edieresis=611;e.Dcroat=722;e.commaaccent=250;e.copyright=760;e.Emacron=611;e.ccaron=444;e.aring=500;e.Ncommaaccent=667;e.lacute=278;e.agrave=500;e.Tcommaaccent=556;e.Cacute=667;e.atilde=500;e.Edotaccent=611;e.scaron=389;e.scedilla=389;e.iacute=278;e.lozenge=471;e.Rcaron=611;e.Gcommaaccent=722;e.ucircumflex=500;e.acircumflex=500;e.Amacron=611;e.rcaron=389;e.ccedilla=444;e.Zdotaccent=556;e.Thorn=611;e.Omacron=722;e.Racute=611;e.Sacute=500;e.dcaron=544;e.Umacron=722;e.uring=500;e.threesuperior=300;e.Ograve=722;e.Agrave=611;e.Abreve=611;e.multiply=675;e.uacute=500;e.Tcaron=556;e.partialdiff=476;e.ydieresis=444;e.Nacute=667;e.icircumflex=278;e.Ecircumflex=611;e.adieresis=500;e.edieresis=444;e.cacute=444;e.nacute=500;e.umacron=500;e.Ncaron=667;e.Iacute=333;e.plusminus=675;e.brokenbar=275;e.registered=760;e.Gbreve=722;e.Idotaccent=333;e.summation=600;e.Egrave=611;e.racute=389;e.omacron=500;e.Zacute=556;e.Zcaron=556;e.greaterequal=549;e.Eth=722;e.Ccedilla=667;e.lcommaaccent=278;e.tcaron=300;e.eogonek=444;e.Uogonek=722;e.Aacute=611;e.Adieresis=611;e.egrave=444;e.zacute=389;e.iogonek=278;e.Oacute=722;e.oacute=500;e.amacron=500;e.sacute=389;e.idieresis=278;e.Ocircumflex=722;e.Ugrave=722;e.Delta=612;e.thorn=500;e.twosuperior=300;e.Odieresis=722;e.mu=500;e.igrave=278;e.ohungarumlaut=500;e.Eogonek=611;e.dcroat=500;e.threequarters=750;e.Scedilla=500;e.lcaron=300;e.Kcommaaccent=667;e.Lacute=556;e.trademark=980;e.edotaccent=444;e.Igrave=333;e.Imacron=333;e.Lcaron=611;e.onehalf=750;e.lessequal=549;e.ocircumflex=500;e.ntilde=500;e.Uhungarumlaut=722;e.Eacute=611;e.emacron=444;e.gbreve=500;e.onequarter=750;e.Scaron=500;e.Scommaaccent=500;e.Ohungarumlaut=722;e.degree=400;e.ograve=500;e.Ccaron=667;e.ugrave=500;e.radical=453;e.Dcaron=722;e.rcommaaccent=389;e.Ntilde=667;e.otilde=500;e.Rcommaaccent=611;e.Lcommaaccent=556;e.Atilde=611;e.Aogonek=611;e.Aring=611;e.Otilde=722;e.zdotaccent=389;e.Ecaron=611;e.Iogonek=333;e.kcommaaccent=444;e.minus=675;e.Icircumflex=333;e.ncaron=500;e.tcommaaccent=278;e.logicalnot=675;e.odieresis=500;e.udieresis=500;e.notequal=549;e.gcommaaccent=500;e.eth=500;e.zcaron=389;e.ncommaaccent=500;e.onesuperior=300;e.imacron=278;e.Euro=500}));e.ZapfDingbats=(0,a.getLookupTableFactory)((function(e){e.space=278;e.a1=974;e.a2=961;e.a202=974;e.a3=980;e.a4=719;e.a5=789;e.a119=790;e.a118=791;e.a117=690;e.a11=960;e.a12=939;e.a13=549;e.a14=855;e.a15=911;e.a16=933;e.a105=911;e.a17=945;e.a18=974;e.a19=755;e.a20=846;e.a21=762;e.a22=761;e.a23=571;e.a24=677;e.a25=763;e.a26=760;e.a27=759;e.a28=754;e.a6=494;e.a7=552;e.a8=537;e.a9=577;e.a10=692;e.a29=786;e.a30=788;e.a31=788;e.a32=790;e.a33=793;e.a34=794;e.a35=816;e.a36=823;e.a37=789;e.a38=841;e.a39=823;e.a40=833;e.a41=816;e.a42=831;e.a43=923;e.a44=744;e.a45=723;e.a46=749;e.a47=790;e.a48=792;e.a49=695;e.a50=776;e.a51=768;e.a52=792;e.a53=759;e.a54=707;e.a55=708;e.a56=682;e.a57=701;e.a58=826;e.a59=815;e.a60=789;e.a61=789;e.a62=707;e.a63=687;e.a64=696;e.a65=689;e.a66=786;e.a67=787;e.a68=713;e.a69=791;e.a70=785;e.a71=791;e.a72=873;e.a73=761;e.a74=762;e.a203=762;e.a75=759;e.a204=759;e.a76=892;e.a77=892;e.a78=788;e.a79=784;e.a81=438;e.a82=138;e.a83=277;e.a84=415;e.a97=392;e.a98=392;e.a99=668;e.a100=668;e.a89=390;e.a90=390;e.a93=317;e.a94=317;e.a91=276;e.a92=276;e.a205=509;e.a85=509;e.a206=410;e.a86=410;e.a87=234;e.a88=234;e.a95=334;e.a96=334;e.a101=732;e.a102=544;e.a103=544;e.a104=910;e.a106=667;e.a107=760;e.a108=760;e.a112=776;e.a111=595;e.a110=694;e.a109=626;e.a120=788;e.a121=788;e.a122=788;e.a123=788;e.a124=788;e.a125=788;e.a126=788;e.a127=788;e.a128=788;e.a129=788;e.a130=788;e.a131=788;e.a132=788;e.a133=788;e.a134=788;e.a135=788;e.a136=788;e.a137=788;e.a138=788;e.a139=788;e.a140=788;e.a141=788;e.a142=788;e.a143=788;e.a144=788;e.a145=788;e.a146=788;e.a147=788;e.a148=788;e.a149=788;e.a150=788;e.a151=788;e.a152=788;e.a153=788;e.a154=788;e.a155=788;e.a156=788;e.a157=788;e.a158=788;e.a159=788;e.a160=894;e.a161=838;e.a163=1016;e.a164=458;e.a196=748;e.a165=924;e.a192=748;e.a166=918;e.a167=927;e.a168=928;e.a169=928;e.a170=834;e.a171=873;e.a172=828;e.a173=924;e.a162=924;e.a174=917;e.a175=930;e.a176=931;e.a177=463;e.a178=883;e.a179=836;e.a193=836;e.a180=867;e.a199=867;e.a181=696;e.a200=696;e.a182=874;e.a201=874;e.a183=760;e.a184=946;e.a197=771;e.a185=865;e.a194=771;e.a198=888;e.a186=967;e.a195=888;e.a187=831;e.a188=873;e.a189=927;e.a190=970;e.a191=918}))}));t.getMetrics=n;const i=(0,a.getLookupTableFactory)((function(e){e.Courier={ascent:629,descent:-157,capHeight:562,xHeight:-426};e["Courier-Bold"]={ascent:629,descent:-157,capHeight:562,xHeight:439};e["Courier-Oblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e["Courier-BoldOblique"]={ascent:629,descent:-157,capHeight:562,xHeight:426};e.Helvetica={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-Bold"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Helvetica-Oblique"]={ascent:718,descent:-207,capHeight:718,xHeight:523};e["Helvetica-BoldOblique"]={ascent:718,descent:-207,capHeight:718,xHeight:532};e["Times-Roman"]={ascent:683,descent:-217,capHeight:662,xHeight:450};e["Times-Bold"]={ascent:683,descent:-217,capHeight:676,xHeight:461};e["Times-Italic"]={ascent:683,descent:-217,capHeight:653,xHeight:441};e["Times-BoldItalic"]={ascent:683,descent:-217,capHeight:669,xHeight:462};e.Symbol={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN};e.ZapfDingbats={ascent:Math.NaN,descent:Math.NaN,capHeight:Math.NaN,xHeight:Math.NaN}}));t.getFontBasicMetrics=i},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.GlyfTable=void 0;t.GlyfTable=class GlyfTable{constructor(e){let{glyfTable:t,isGlyphLocationsLong:r,locaTable:a,numGlyphs:n}=e;this.glyphs=[];const i=new DataView(a.buffer,a.byteOffset,a.byteLength),s=new DataView(t.buffer,t.byteOffset,t.byteLength),o=r?4:2;let c=r?i.getUint32(0):2*i.getUint16(0),l=0;for(let e=0;e<n;e++){l+=o;const e=r?i.getUint32(l):2*i.getUint16(l);if(e===c){this.glyphs.push(new Glyph({}));continue}const t=Glyph.parse(c,s);this.glyphs.push(t);c=e}}getSize(){return this.glyphs.reduce(((e,t)=>e+(t.getSize()+3&-4)),0)}write(){const e=this.getSize(),t=new DataView(new ArrayBuffer(e)),r=e>131070,a=r?4:2,n=new DataView(new ArrayBuffer((this.glyphs.length+1)*a));r?n.setUint32(0,0):n.setUint16(0,0);let i=0,s=0;for(const e of this.glyphs){i+=e.write(i,t);i=i+3&-4;s+=a;r?n.setUint32(s,i):n.setUint16(s,i>>1)}return{isLocationLong:r,loca:new Uint8Array(n.buffer),glyf:new Uint8Array(t.buffer)}}scale(e){for(let t=0,r=this.glyphs.length;t<r;t++)this.glyphs[t].scale(e[t])}};class Glyph{constructor(e){let{header:t=null,simple:r=null,composites:a=null}=e;this.header=t;this.simple=r;this.composites=a}static parse(e,t){const[r,a]=GlyphHeader.parse(e,t);e+=r;if(a.numberOfContours<0){const r=[];for(;;){const[a,n]=CompositeGlyph.parse(e,t);e+=a;r.push(n);if(!(32&n.flags))break}return new Glyph({header:a,composites:r})}const n=SimpleGlyph.parse(e,t,a.numberOfContours);return new Glyph({header:a,simple:n})}getSize(){if(!this.header)return 0;const e=this.simple?this.simple.getSize():this.composites.reduce(((e,t)=>e+t.getSize()),0);return this.header.getSize()+e}write(e,t){if(!this.header)return 0;const r=e;e+=this.header.write(e,t);if(this.simple)e+=this.simple.write(e,t);else for(const r of this.composites)e+=r.write(e,t);return e-r}scale(e){if(!this.header)return;const t=(this.header.xMin+this.header.xMax)/2;this.header.scale(t,e);if(this.simple)this.simple.scale(t,e);else for(const r of this.composites)r.scale(t,e)}}class GlyphHeader{constructor(e){let{numberOfContours:t,xMin:r,yMin:a,xMax:n,yMax:i}=e;this.numberOfContours=t;this.xMin=r;this.yMin=a;this.xMax=n;this.yMax=i}static parse(e,t){return[10,new GlyphHeader({numberOfContours:t.getInt16(e),xMin:t.getInt16(e+2),yMin:t.getInt16(e+4),xMax:t.getInt16(e+6),yMax:t.getInt16(e+8)})]}getSize(){return 10}write(e,t){t.setInt16(e,this.numberOfContours);t.setInt16(e+2,this.xMin);t.setInt16(e+4,this.yMin);t.setInt16(e+6,this.xMax);t.setInt16(e+8,this.yMax);return 10}scale(e,t){this.xMin=Math.round(e+(this.xMin-e)*t);this.xMax=Math.round(e+(this.xMax-e)*t)}}class Contour{constructor(e){let{flags:t,xCoordinates:r,yCoordinates:a}=e;this.xCoordinates=r;this.yCoordinates=a;this.flags=t}}class SimpleGlyph{constructor(e){let{contours:t,instructions:r}=e;this.contours=t;this.instructions=r}static parse(e,t,r){const a=[];for(let n=0;n<r;n++){const r=t.getUint16(e);e+=2;a.push(r)}const n=a[r-1]+1,i=t.getUint16(e);e+=2;const s=new Uint8Array(t).slice(e,e+i);e+=i;const o=[];for(let r=0;r<n;e++,r++){let a=t.getUint8(e);o.push(a);if(8&a){const n=t.getUint8(++e);a^=8;for(let e=0;e<n;e++)o.push(a);r+=n}}const c=[];let l=[],h=[],u=[];const d=[];let f=0,g=0;for(let r=0;r<n;r++){const n=o[r];if(2&n){const r=t.getUint8(e++);g+=16&n?r:-r;l.push(g)}else if(16&n)l.push(g);else{g+=t.getInt16(e);e+=2;l.push(g)}if(a[f]===r){f++;c.push(l);l=[]}}g=0;f=0;for(let r=0;r<n;r++){const n=o[r];if(4&n){const r=t.getUint8(e++);g+=32&n?r:-r;h.push(g)}else if(32&n)h.push(g);else{g+=t.getInt16(e);e+=2;h.push(g)}u.push(1&n|64&n);if(a[f]===r){l=c[f];f++;d.push(new Contour({flags:u,xCoordinates:l,yCoordinates:h}));h=[];u=[]}}return new SimpleGlyph({contours:d,instructions:s})}getSize(){let e=2*this.contours.length+2+this.instructions.length,t=0,r=0;for(const a of this.contours){e+=a.flags.length;for(let n=0,i=a.xCoordinates.length;n<i;n++){const i=a.xCoordinates[n],s=a.yCoordinates[n];let o=Math.abs(i-t);o>255?e+=2:o>0&&(e+=1);t=i;o=Math.abs(s-r);o>255?e+=2:o>0&&(e+=1);r=s}}return e}write(e,t){const r=e,a=[],n=[],i=[];let s=0,o=0;for(const r of this.contours){for(let e=0,t=r.xCoordinates.length;e<t;e++){let t=r.flags[e];const c=r.xCoordinates[e];let l=c-s;if(0===l){t|=16;a.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?18:2;a.push(e)}else a.push(l)}s=c;const h=r.yCoordinates[e];l=h-o;if(0===l){t|=32;n.push(0)}else{const e=Math.abs(l);if(e<=255){t|=l>=0?36:4;n.push(e)}else n.push(l)}o=h;i.push(t)}t.setUint16(e,a.length-1);e+=2}t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}for(const r of i)t.setUint8(e++,r);for(let r=0,n=a.length;r<n;r++){const n=a[r],s=i[r];if(2&s)t.setUint8(e++,n);else if(!(16&s)){t.setInt16(e,n);e+=2}}for(let r=0,a=n.length;r<a;r++){const a=n[r],s=i[r];if(4&s)t.setUint8(e++,a);else if(!(32&s)){t.setInt16(e,a);e+=2}}return e-r}scale(e,t){for(const r of this.contours)if(0!==r.xCoordinates.length)for(let a=0,n=r.xCoordinates.length;a<n;a++)r.xCoordinates[a]=Math.round(e+(r.xCoordinates[a]-e)*t)}}class CompositeGlyph{constructor(e){let{flags:t,glyphIndex:r,argument1:a,argument2:n,transf:i,instructions:s}=e;this.flags=t;this.glyphIndex=r;this.argument1=a;this.argument2=n;this.transf=i;this.instructions=s}static parse(e,t){const r=e,a=[];let n=t.getUint16(e);const i=t.getUint16(e+2);e+=4;let s,o;if(1&n){if(2&n){s=t.getInt16(e);o=t.getInt16(e+2)}else{s=t.getUint16(e);o=t.getUint16(e+2)}e+=4;n^=1}else{if(2&n){s=t.getInt8(e);o=t.getInt8(e+1)}else{s=t.getUint8(e);o=t.getUint8(e+1)}e+=2}if(8&n){a.push(t.getUint16(e));e+=2}else if(64&n){a.push(t.getUint16(e),t.getUint16(e+2));e+=4}else if(128&n){a.push(t.getUint16(e),t.getUint16(e+2),t.getUint16(e+4),t.getUint16(e+6));e+=8}let c=null;if(256&n){const r=t.getUint16(e);e+=2;c=new Uint8Array(t).slice(e,e+r);e+=r}return[e-r,new CompositeGlyph({flags:n,glyphIndex:i,argument1:s,argument2:o,transf:a,instructions:c})]}getSize(){let e=4+2*this.transf.length;256&this.flags&&(e+=2+this.instructions.length);e+=2;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(e+=2):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(e+=2);return e}write(e,t){const r=e;2&this.flags?this.argument1>=-128&&this.argument1<=127&&this.argument2>=-128&&this.argument2<=127||(this.flags|=1):this.argument1>=0&&this.argument1<=255&&this.argument2>=0&&this.argument2<=255||(this.flags|=1);t.setUint16(e,this.flags);t.setUint16(e+2,this.glyphIndex);e+=4;if(1&this.flags){if(2&this.flags){t.setInt16(e,this.argument1);t.setInt16(e+2,this.argument2)}else{t.setUint16(e,this.argument1);t.setUint16(e+2,this.argument2)}e+=4}else{t.setUint8(e,this.argument1);t.setUint8(e+1,this.argument2);e+=2}if(256&this.flags){t.setUint16(e,this.instructions.length);e+=2;if(this.instructions.length){new Uint8Array(t.buffer,0,t.buffer.byteLength).set(this.instructions,e);e+=this.instructions.length}}return e-r}scale(e,t){}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OpenTypeFileBuilder=void 0;var a=r(134),n=r(2);function writeInt16(e,t,r){e[t]=r>>8&255;e[t+1]=255&r}function writeInt32(e,t,r){e[t]=r>>24&255;e[t+1]=r>>16&255;e[t+2]=r>>8&255;e[t+3]=255&r}function writeData(e,t,r){if(r instanceof Uint8Array)e.set(r,t);else if("string"==typeof r)for(let a=0,n=r.length;a<n;a++)e[t++]=255&r.charCodeAt(a);else for(let a=0,n=r.length;a<n;a++)e[t++]=255&r[a]}class OpenTypeFileBuilder{constructor(e){this.sfnt=e;this.tables=Object.create(null)}static getSearchParams(e,t){let r=1,a=0;for(;(r^e)>r;){r<<=1;a++}const n=r*t;return{range:n,entry:a,rangeShift:t*e-n}}toArray(){let e=this.sfnt;const t=this.tables,r=Object.keys(t);r.sort();const i=r.length;let s,o,c,l,h,u=12+16*i;const d=[u];for(s=0;s<i;s++){l=t[r[s]];u+=(l.length+3&-4)>>>0;d.push(u)}const f=new Uint8Array(u);for(s=0;s<i;s++){l=t[r[s]];writeData(f,d[s],l)}"true"===e&&(e=(0,n.string32)(65536));f[0]=255&e.charCodeAt(0);f[1]=255&e.charCodeAt(1);f[2]=255&e.charCodeAt(2);f[3]=255&e.charCodeAt(3);writeInt16(f,4,i);const g=OpenTypeFileBuilder.getSearchParams(i,16);writeInt16(f,6,g.range);writeInt16(f,8,g.entry);writeInt16(f,10,g.rangeShift);u=12;for(s=0;s<i;s++){h=r[s];f[u]=255&h.charCodeAt(0);f[u+1]=255&h.charCodeAt(1);f[u+2]=255&h.charCodeAt(2);f[u+3]=255&h.charCodeAt(3);let e=0;for(o=d[s],c=d[s+1];o<c;o+=4){e=e+(0,a.readUint32)(f,o)>>>0}writeInt32(f,u+4,e);writeInt32(f,u+8,d[s]);writeInt32(f,u+12,t[h].length);u+=16}return f}addTable(e,t){if(e in this.tables)throw new Error("Table "+e+" already exists");this.tables[e]=t}}t.OpenTypeFileBuilder=OpenTypeFileBuilder},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Type1Font=void 0;var a=r(163),n=r(2),i=r(166),s=r(134),o=r(138),c=r(177);function findBlock(e,t,r){const a=e.length,n=t.length,i=a-n;let o=r,c=!1;for(;o<i;){let r=0;for(;r<n&&e[o+r]===t[r];)r++;if(r>=n){o+=r;for(;o<a&&(0,s.isWhiteSpace)(e[o]);)o++;c=!0;break}o++}return{found:c,length:o}}t.Type1Font=class Type1Font{constructor(e,t,r){let a=r.length1,s=r.length2,l=t.peekBytes(6);const h=128===l[0]&&1===l[1];if(h){t.skip(6);a=l[5]<<24|l[4]<<16|l[3]<<8|l[2]}const u=function getHeaderBlock(e,t){const r=[101,101,120,101,99],a=e.pos;let i,s,c,l;try{i=e.getBytes(t);s=i.length}catch(e){}if(s===t){c=findBlock(i,r,t-2*r.length);if(c.found&&c.length===t)return{stream:new o.Stream(i),length:t}}(0,n.warn)('Invalid "Length1" property in Type1 font -- trying to recover.');e.pos=a;for(;;){c=findBlock(e.peekBytes(2048),r,0);if(0===c.length)break;e.pos+=c.length;if(c.found){l=e.pos-a;break}}e.pos=a;if(l)return{stream:new o.Stream(e.getBytes(l)),length:l};(0,n.warn)('Unable to recover "Length1" property in Type1 font -- using as is.');return{stream:new o.Stream(e.getBytes(t)),length:t}}(t,a);new c.Type1Parser(u.stream,!1,i.SEAC_ANALYSIS_ENABLED).extractFontHeader(r);if(h){l=t.getBytes(6);s=l[5]<<24|l[4]<<16|l[3]<<8|l[2]}const d=function getEexecBlock(e,t){const r=e.getBytes();if(0===r.length)throw new n.FormatError("getEexecBlock - no font program found.");return{stream:new o.Stream(r),length:r.length}}(t),f=new c.Type1Parser(d.stream,!0,i.SEAC_ANALYSIS_ENABLED).extractFontProgram(r);for(const e in f.properties)r[e]=f.properties[e];const g=f.charstrings,p=this.getType2Charstrings(g),m=this.getType2Subrs(f.subrs);this.charstrings=g;this.data=this.wrap(e,p,this.charstrings,m,r);this.seacs=this.getSeacs(f.charstrings)}get numGlyphs(){return this.charstrings.length+1}getCharset(){const e=[".notdef"];for(const{glyphName:t}of this.charstrings)e.push(t);return e}getGlyphMapping(e){const t=this.charstrings;if(e.composite){const r=Object.create(null);for(let a=0,n=t.length;a<n;a++){r[e.cMap.charCodeOf(a)]=a+1}return r}const r=[".notdef"];let a,n;for(n=0;n<t.length;n++)r.push(t[n].glyphName);const s=e.builtInEncoding;if(s){a=Object.create(null);for(const e in s){n=r.indexOf(s[e]);n>=0&&(a[e]=n)}}return(0,i.type1FontGlyphMapping)(e,a,r)}hasGlyphId(e){if(e<0||e>=this.numGlyphs)return!1;if(0===e)return!0;return this.charstrings[e-1].charstring.length>0}getSeacs(e){const t=[];for(let r=0,a=e.length;r<a;r++){const a=e[r];a.seac&&(t[r+1]=a.seac)}return t}getType2Charstrings(e){const t=[];for(let r=0,a=e.length;r<a;r++)t.push(e[r].charstring);return t}getType2Subrs(e){let t=0;const r=e.length;t=r<1133?107:r<33769?1131:32768;const a=[];let n;for(n=0;n<t;n++)a.push([11]);for(n=0;n<r;n++)a.push(e[n]);return a}wrap(e,t,r,n,i){const s=new a.CFF;s.header=new a.CFFHeader(1,0,4,4);s.names=[e];const o=new a.CFFTopDict;o.setByName("version",391);o.setByName("Notice",392);o.setByName("FullName",393);o.setByName("FamilyName",394);o.setByName("Weight",395);o.setByName("Encoding",null);o.setByName("FontMatrix",i.fontMatrix);o.setByName("FontBBox",i.bbox);o.setByName("charset",null);o.setByName("CharStrings",null);o.setByName("Private",null);s.topDict=o;const c=new a.CFFStrings;c.add("Version 0.11");c.add("See original notice");c.add(e);c.add(e);c.add("Medium");s.strings=c;s.globalSubrIndex=new a.CFFIndex;const l=t.length,h=[".notdef"];let u,d;for(u=0;u<l;u++){const e=r[u].glyphName;-1===a.CFFStandardStrings.indexOf(e)&&c.add(e);h.push(e)}s.charset=new a.CFFCharset(!1,0,h);const f=new a.CFFIndex;f.add([139,14]);for(u=0;u<l;u++)f.add(t[u]);s.charStrings=f;const g=new a.CFFPrivateDict;g.setByName("Subrs",null);const p=["BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StemSnapH","StemSnapV","BlueShift","BlueFuzz","BlueScale","LanguageGroup","ExpansionFactor","ForceBold","StdHW","StdVW"];for(u=0,d=p.length;u<d;u++){const e=p[u];if(!(e in i.privateData))continue;const t=i.privateData[e];if(Array.isArray(t))for(let e=t.length-1;e>0;e--)t[e]-=t[e-1];g.setByName(e,t)}s.topDict.privateDict=g;const m=new a.CFFIndex;for(u=0,d=n.length;u<d;u++)m.add(n[u]);g.subrsIndex=m;return new a.CFFCompiler(s).compile()}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Type1Parser=void 0;var a=r(165),n=r(134),i=r(138),s=r(2);const o=[4],c=[5],l=[6],h=[7],u=[8],d=[12,35],f=[14],g=[21],p=[22],m=[30],b=[31];class Type1CharString{constructor(){this.width=0;this.lsb=0;this.flexing=!1;this.output=[];this.stack=[]}convert(e,t,r){const a=e.length;let n,i,y,w=!1;for(let S=0;S<a;S++){let a=e[S];if(a<32){12===a&&(a=(a<<8)+e[++S]);switch(a){case 1:case 3:case 9:case 3072:case 3073:case 3074:case 3105:this.stack=[];break;case 4:if(this.flexing){if(this.stack.length<1){w=!0;break}const e=this.stack.pop();this.stack.push(0,e);break}w=this.executeCommand(1,o);break;case 5:w=this.executeCommand(2,c);break;case 6:w=this.executeCommand(1,l);break;case 7:w=this.executeCommand(1,h);break;case 8:w=this.executeCommand(6,u);break;case 10:if(this.stack.length<1){w=!0;break}y=this.stack.pop();if(!t[y]){w=!0;break}w=this.convert(t[y],t,r);break;case 11:return w;case 13:if(this.stack.length<2){w=!0;break}n=this.stack.pop();i=this.stack.pop();this.lsb=i;this.width=n;this.stack.push(n,i);w=this.executeCommand(2,p);break;case 14:this.output.push(f[0]);break;case 21:if(this.flexing)break;w=this.executeCommand(2,g);break;case 22:if(this.flexing){this.stack.push(0);break}w=this.executeCommand(1,p);break;case 30:w=this.executeCommand(4,m);break;case 31:w=this.executeCommand(4,b);break;case 3078:if(r){const e=this.stack.at(-5);this.seac=this.stack.splice(-4,4);this.seac[0]+=this.lsb-e;w=this.executeCommand(0,f)}else w=this.executeCommand(4,f);break;case 3079:if(this.stack.length<4){w=!0;break}this.stack.pop();n=this.stack.pop();const e=this.stack.pop();i=this.stack.pop();this.lsb=i;this.width=n;this.stack.push(n,i,e);w=this.executeCommand(3,g);break;case 3084:if(this.stack.length<2){w=!0;break}const S=this.stack.pop(),x=this.stack.pop();this.stack.push(x/S);break;case 3088:if(this.stack.length<2){w=!0;break}y=this.stack.pop();const k=this.stack.pop();if(0===y&&3===k){const e=this.stack.splice(this.stack.length-17,17);this.stack.push(e[2]+e[0],e[3]+e[1],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14]);w=this.executeCommand(13,d,!0);this.flexing=!1;this.stack.push(e[15],e[16])}else 1===y&&0===k&&(this.flexing=!0);break;case 3089:break;default:(0,s.warn)('Unknown type 1 charstring command of "'+a+'"')}if(w)break}else{a<=246?a-=139:a=a<=250?256*(a-247)+e[++S]+108:a<=254?-256*(a-251)-e[++S]-108:(255&e[++S])<<24|(255&e[++S])<<16|(255&e[++S])<<8|(255&e[++S])<<0;this.stack.push(a)}}return w}executeCommand(e,t,r){const a=this.stack.length;if(e>a)return!0;const n=a-e;for(let e=n;e<a;e++){let t=this.stack[e];if(Number.isInteger(t))this.output.push(28,t>>8&255,255&t);else{t=65536*t|0;this.output.push(255,t>>24&255,t>>16&255,t>>8&255,255&t)}}this.output.push(...t);r?this.stack.splice(n,e):this.stack.length=0;return!1}}function isHexDigit(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function decrypt(e,t,r){if(r>=e.length)return new Uint8Array(0);let a,n,i=0|t;for(a=0;a<r;a++)i=52845*(e[a]+i)+22719&65535;const s=e.length-r,o=new Uint8Array(s);for(a=r,n=0;n<s;a++,n++){const t=e[a];o[n]=t^i>>8;i=52845*(t+i)+22719&65535}return o}function isSpecial(e){return 47===e||91===e||93===e||123===e||125===e||40===e||41===e}t.Type1Parser=class Type1Parser{constructor(e,t,r){if(t){const t=e.getBytes(),r=!((isHexDigit(t[0])||(0,n.isWhiteSpace)(t[0]))&&isHexDigit(t[1])&&isHexDigit(t[2])&&isHexDigit(t[3])&&isHexDigit(t[4])&&isHexDigit(t[5])&&isHexDigit(t[6])&&isHexDigit(t[7]));e=new i.Stream(r?decrypt(t,55665,4):function decryptAscii(e,t,r){let a=0|t;const n=e.length,i=new Uint8Array(n>>>1);let s,o;for(s=0,o=0;s<n;s++){const t=e[s];if(!isHexDigit(t))continue;s++;let r;for(;s<n&&!isHexDigit(r=e[s]);)s++;if(s<n){const e=parseInt(String.fromCharCode(t,r),16);i[o++]=e^a>>8;a=52845*(e+a)+22719&65535}}return i.slice(r,o)}(t,55665,4))}this.seacAnalysisEnabled=!!r;this.stream=e;this.nextChar()}readNumberArray(){this.getToken();const e=[];for(;;){const t=this.getToken();if(null===t||"]"===t||"}"===t)break;e.push(parseFloat(t||0))}return e}readNumber(){const e=this.getToken();return parseFloat(e||0)}readInt(){const e=this.getToken();return 0|parseInt(e||0,10)}readBoolean(){return"true"===this.getToken()?1:0}nextChar(){return this.currentChar=this.stream.getByte()}prevChar(){this.stream.skip(-2);return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(-1===t)return null;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,n.isWhiteSpace)(t))break;t=this.nextChar()}if(isSpecial(t)){this.nextChar();return String.fromCharCode(t)}let r="";do{r+=String.fromCharCode(t);t=this.nextChar()}while(t>=0&&!(0,n.isWhiteSpace)(t)&&!isSpecial(t));return r}readCharStrings(e,t){return-1===t?e:decrypt(e,4330,t)}extractFontProgram(e){const t=this.stream,r=[],a=[],n=Object.create(null);n.lenIV=4;const i={subrs:[],charstrings:[],properties:{privateData:n}};let s,o,c,l;for(;null!==(s=this.getToken());)if("/"===s){s=this.getToken();switch(s){case"CharStrings":this.getToken();this.getToken();this.getToken();this.getToken();for(;;){s=this.getToken();if(null===s||"end"===s)break;if("/"!==s)continue;const e=this.getToken();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=i.properties.privateData.lenIV;const r=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s?this.getToken():"/"===s&&this.prevChar();a.push({glyph:e,encoded:r})}break;case"Subrs":this.readInt();this.getToken();for(;"dup"===this.getToken();){const e=this.readInt();o=this.readInt();this.getToken();c=o>0?t.getBytes(o):new Uint8Array(0);l=i.properties.privateData.lenIV;const a=this.readCharStrings(c,l);this.nextChar();s=this.getToken();"noaccess"===s&&this.getToken();r[e]=a}break;case"BlueValues":case"OtherBlues":case"FamilyBlues":case"FamilyOtherBlues":const e=this.readNumberArray();e.length>0&&e.length,0;break;case"StemSnapH":case"StemSnapV":i.properties.privateData[s]=this.readNumberArray();break;case"StdHW":case"StdVW":i.properties.privateData[s]=this.readNumberArray()[0];break;case"BlueShift":case"lenIV":case"BlueFuzz":case"BlueScale":case"LanguageGroup":case"ExpansionFactor":i.properties.privateData[s]=this.readNumber();break;case"ForceBold":i.properties.privateData[s]=this.readBoolean()}}for(const{encoded:t,glyph:n}of a){const a=new Type1CharString,s=a.convert(t,r,this.seacAnalysisEnabled);let o=a.output;s&&(o=[14]);const c={glyphName:n,charstring:o,width:a.width,lsb:a.lsb,seac:a.seac};".notdef"===n?i.charstrings.unshift(c):i.charstrings.push(c);if(e.builtInEncoding){const t=e.builtInEncoding.indexOf(n);t>-1&&void 0===e.widths[t]&&t>=e.firstChar&&t<=e.lastChar&&(e.widths[t]=a.width)}}return i}extractFontHeader(e){let t;for(;null!==(t=this.getToken());)if("/"===t){t=this.getToken();switch(t){case"FontMatrix":const r=this.readNumberArray();e.fontMatrix=r;break;case"Encoding":const n=this.getToken();let i;if(/^\d+$/.test(n)){i=[];const e=0|parseInt(n,10);this.getToken();for(let r=0;r<e;r++){t=this.getToken();for(;"dup"!==t&&"def"!==t;){t=this.getToken();if(null===t)return}if("def"===t)break;const e=this.readInt();this.getToken();const r=this.getToken();i[e]=r;this.getToken()}}else i=(0,a.getEncoding)(n);e.builtInEncoding=i;break;case"FontBBox":const s=this.readNumberArray();e.ascent=Math.max(s[3],s[1]);e.descent=Math.min(s[1],s[3]);e.ascentScaled=!0}}}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Pattern=void 0;t.getTilingPatternIR=function getTilingPatternIR(e,t,r){const n=t.getArray("Matrix"),i=a.Util.normalizeRect(t.getArray("BBox")),s=t.get("XStep"),o=t.get("YStep"),c=t.get("PaintType"),l=t.get("TilingType");if(i[2]-i[0]==0||i[3]-i[1]==0)throw new a.FormatError(`Invalid getTilingPatternIR /BBox array: [${i}].`);return["TilingPattern",r,e,n,i,s,o,c,l]};var a=r(2),n=r(135),i=r(142),s=r(134);const o=2,c=3,l=4,h=5,u=6,d=7;t.Pattern=class Pattern{constructor(){(0,a.unreachable)("Cannot initialize Pattern.")}static parseShading(e,t,r,i,f,g){const p=e instanceof n.BaseStream?e.dict:e,m=p.get("ShadingType");try{switch(m){case o:case c:return new RadialAxialShading(p,t,r,f,g);case l:case h:case u:case d:return new MeshShading(e,t,r,f,g);default:throw new a.FormatError("Unsupported ShadingType: "+m)}}catch(e){if(e instanceof s.MissingDataException)throw e;i.send("UnsupportedFeature",{featureId:a.UNSUPPORTED_FEATURES.shadingPattern});(0,a.warn)(e);return new DummyShading}}};class BaseShading{static get SMALL_NUMBER(){return(0,a.shadow)(this,"SMALL_NUMBER",1e-6)}constructor(){this.constructor===BaseShading&&(0,a.unreachable)("Cannot initialize BaseShading.")}getIR(){(0,a.unreachable)("Abstract method `getIR` called.")}}class RadialAxialShading extends BaseShading{constructor(e,t,r,n,s){super();this.coordsArr=e.getArray("Coords");this.shadingType=e.get("ShadingType");const o=i.ColorSpace.parse({cs:e.getRaw("CS")||e.getRaw("ColorSpace"),xref:t,resources:r,pdfFunctionFactory:n,localColorSpaceCache:s}),l=e.getArray("BBox");Array.isArray(l)&&4===l.length?this.bbox=a.Util.normalizeRect(l):this.bbox=null;let h=0,u=1;if(e.has("Domain")){const t=e.getArray("Domain");h=t[0];u=t[1]}let d=!1,f=!1;if(e.has("Extend")){const t=e.getArray("Extend");d=t[0];f=t[1]}if(!(this.shadingType!==c||d&&f)){const[e,t,r,n,i,s]=this.coordsArr,o=Math.hypot(e-n,t-i);r<=s+o&&s<=r+o&&(0,a.warn)("Unsupported radial gradient.")}this.extendStart=d;this.extendEnd=f;const g=e.getRaw("Function"),p=n.createFromArray(g),m=(u-h)/10,b=this.colorStops=[];if(h>=u||m<=0){(0,a.info)("Bad shading domain.");return}const y=new Float32Array(o.numComps),w=new Float32Array(1);let S;for(let e=0;e<=10;e++){w[0]=h+e*m;p(w,0,y,0);S=o.getRgb(y,0);const t=a.Util.makeHexColor(S[0],S[1],S[2]);b.push([e/10,t])}let x="transparent";if(e.has("Background")){S=o.getRgb(e.get("Background"),0);x=a.Util.makeHexColor(S[0],S[1],S[2])}if(!d){b.unshift([0,x]);b[1][0]+=BaseShading.SMALL_NUMBER}if(!f){b.at(-1)[0]-=BaseShading.SMALL_NUMBER;b.push([1,x])}this.colorStops=b}getIR(){const e=this.coordsArr,t=this.shadingType;let r,n,i,s,l;if(t===o){n=[e[0],e[1]];i=[e[2],e[3]];s=null;l=null;r="axial"}else if(t===c){n=[e[0],e[1]];i=[e[3],e[4]];s=e[2];l=e[5];r="radial"}else(0,a.unreachable)(`getPattern type unknown: ${t}`);return["RadialAxial",r,this.bbox,this.colorStops,n,i,s,l]}}class MeshStreamReader{constructor(e,t){this.stream=e;this.context=t;this.buffer=0;this.bufferLength=0;const r=t.numComps;this.tmpCompsBuf=new Float32Array(r);const a=t.colorSpace.numComps;this.tmpCsCompsBuf=t.colorFn?new Float32Array(a):this.tmpCompsBuf}get hasData(){if(this.stream.end)return this.stream.pos<this.stream.end;if(this.bufferLength>0)return!0;const e=this.stream.getByte();if(e<0)return!1;this.buffer=e;this.bufferLength=8;return!0}readBits(e){let t=this.buffer,r=this.bufferLength;if(32===e){if(0===r)return(this.stream.getByte()<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte())>>>0;t=t<<24|this.stream.getByte()<<16|this.stream.getByte()<<8|this.stream.getByte();const e=this.stream.getByte();this.buffer=e&(1<<r)-1;return(t<<8-r|(255&e)>>r)>>>0}if(8===e&&0===r)return this.stream.getByte();for(;r<e;){t=t<<8|this.stream.getByte();r+=8}r-=e;this.bufferLength=r;this.buffer=t&(1<<r)-1;return t>>r}align(){this.buffer=0;this.bufferLength=0}readFlag(){return this.readBits(this.context.bitsPerFlag)}readCoordinate(){const e=this.context.bitsPerCoordinate,t=this.readBits(e),r=this.readBits(e),a=this.context.decode,n=e<32?1/((1<<e)-1):2.3283064365386963e-10;return[t*n*(a[1]-a[0])+a[0],r*n*(a[3]-a[2])+a[2]]}readComponents(){const e=this.context.numComps,t=this.context.bitsPerComponent,r=t<32?1/((1<<t)-1):2.3283064365386963e-10,a=this.context.decode,n=this.tmpCompsBuf;for(let i=0,s=4;i<e;i++,s+=2){const e=this.readBits(t);n[i]=e*r*(a[s+1]-a[s])+a[s]}const i=this.tmpCsCompsBuf;this.context.colorFn&&this.context.colorFn(n,0,i,0);return this.context.colorSpace.getRgb(i,0)}}const f=function getBClosure(){const e=[];return function(t){e[t]||(e[t]=function buildB(e){const t=[];for(let r=0;r<=e;r++){const a=r/e,n=1-a;t.push(new Float32Array([n*n*n,3*a*n*n,3*a*a*n,a*a*a]))}return t}(t));return e[t]}}();class MeshShading extends BaseShading{static get MIN_SPLIT_PATCH_CHUNKS_AMOUNT(){return(0,a.shadow)(this,"MIN_SPLIT_PATCH_CHUNKS_AMOUNT",3)}static get MAX_SPLIT_PATCH_CHUNKS_AMOUNT(){return(0,a.shadow)(this,"MAX_SPLIT_PATCH_CHUNKS_AMOUNT",20)}static get TRIANGLE_DENSITY(){return(0,a.shadow)(this,"TRIANGLE_DENSITY",20)}constructor(e,t,r,s,o){super();if(!(e instanceof n.BaseStream))throw new a.FormatError("Mesh data is not a stream");const c=e.dict;this.shadingType=c.get("ShadingType");const f=c.getArray("BBox");Array.isArray(f)&&4===f.length?this.bbox=a.Util.normalizeRect(f):this.bbox=null;const g=i.ColorSpace.parse({cs:c.getRaw("CS")||c.getRaw("ColorSpace"),xref:t,resources:r,pdfFunctionFactory:s,localColorSpaceCache:o});this.background=c.has("Background")?g.getRgb(c.get("Background"),0):null;const p=c.getRaw("Function"),m=p?s.createFromArray(p):null;this.coords=[];this.colors=[];this.figures=[];const b={bitsPerCoordinate:c.get("BitsPerCoordinate"),bitsPerComponent:c.get("BitsPerComponent"),bitsPerFlag:c.get("BitsPerFlag"),decode:c.getArray("Decode"),colorFn:m,colorSpace:g,numComps:m?1:g.numComps},y=new MeshStreamReader(e,b);let w=!1;switch(this.shadingType){case l:this._decodeType4Shading(y);break;case h:const e=0|c.get("VerticesPerRow");if(e<2)throw new a.FormatError("Invalid VerticesPerRow");this._decodeType5Shading(y,e);break;case u:this._decodeType6Shading(y);w=!0;break;case d:this._decodeType7Shading(y);w=!0;break;default:(0,a.unreachable)("Unsupported mesh type.")}if(w){this._updateBounds();for(let e=0,t=this.figures.length;e<t;e++)this._buildFigureFromPatch(e)}this._updateBounds();this._packData()}_decodeType4Shading(e){const t=this.coords,r=this.colors,n=[],i=[];let s=0;for(;e.hasData;){const o=e.readFlag(),c=e.readCoordinate(),l=e.readComponents();if(0===s){if(!(0<=o&&o<=2))throw new a.FormatError("Unknown type4 flag");switch(o){case 0:s=3;break;case 1:i.push(i.at(-2),i.at(-1));s=1;break;case 2:i.push(i.at(-3),i.at(-1));s=1}n.push(o)}i.push(t.length);t.push(c);r.push(l);s--;e.align()}this.figures.push({type:"triangles",coords:new Int32Array(i),colors:new Int32Array(i)})}_decodeType5Shading(e,t){const r=this.coords,a=this.colors,n=[];for(;e.hasData;){const t=e.readCoordinate(),i=e.readComponents();n.push(r.length);r.push(t);a.push(i)}this.figures.push({type:"lattice",coords:new Int32Array(n),colors:new Int32Array(n),verticesPerRow:t})}_decodeType6Shading(e){const t=this.coords,r=this.colors,n=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new a.FormatError("Unknown type6 flag");const o=t.length;for(let r=0,a=0!==s?8:12;r<a;r++)t.push(e.readCoordinate());const c=r.length;for(let t=0,a=0!==s?2:4;t<a;t++)r.push(e.readComponents());let l,h,u,d;switch(s){case 0:n[12]=o+3;n[13]=o+4;n[14]=o+5;n[15]=o+6;n[8]=o+2;n[11]=o+7;n[4]=o+1;n[7]=o+8;n[0]=o;n[1]=o+11;n[2]=o+10;n[3]=o+9;i[2]=c+1;i[3]=c+2;i[0]=c;i[1]=c+3;break;case 1:l=n[12];h=n[13];u=n[14];d=n[15];n[12]=d;n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=u;n[11]=o+3;n[4]=h;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[2];h=i[3];i[2]=h;i[3]=c;i[0]=l;i[1]=c+1;break;case 2:l=n[15];h=n[11];n[12]=n[3];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[7];n[11]=o+3;n[4]=h;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[3];i[2]=i[1];i[3]=c;i[0]=l;i[1]=c+1;break;case 3:n[12]=n[0];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[1];n[11]=o+3;n[4]=n[2];n[7]=o+4;n[0]=n[3];n[1]=o+7;n[2]=o+6;n[3]=o+5;i[2]=i[0];i[3]=c;i[0]=i[1];i[1]=c+1}n[5]=t.length;t.push([(-4*t[n[0]][0]-t[n[15]][0]+6*(t[n[4]][0]+t[n[1]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[13]][0]+t[n[7]][0]))/9,(-4*t[n[0]][1]-t[n[15]][1]+6*(t[n[4]][1]+t[n[1]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[13]][1]+t[n[7]][1]))/9]);n[6]=t.length;t.push([(-4*t[n[3]][0]-t[n[12]][0]+6*(t[n[2]][0]+t[n[7]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[4]][0]+t[n[14]][0]))/9,(-4*t[n[3]][1]-t[n[12]][1]+6*(t[n[2]][1]+t[n[7]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[4]][1]+t[n[14]][1]))/9]);n[9]=t.length;t.push([(-4*t[n[12]][0]-t[n[3]][0]+6*(t[n[8]][0]+t[n[13]][0])-2*(t[n[0]][0]+t[n[15]][0])+3*(t[n[11]][0]+t[n[1]][0]))/9,(-4*t[n[12]][1]-t[n[3]][1]+6*(t[n[8]][1]+t[n[13]][1])-2*(t[n[0]][1]+t[n[15]][1])+3*(t[n[11]][1]+t[n[1]][1]))/9]);n[10]=t.length;t.push([(-4*t[n[15]][0]-t[n[0]][0]+6*(t[n[11]][0]+t[n[14]][0])-2*(t[n[12]][0]+t[n[3]][0])+3*(t[n[2]][0]+t[n[8]][0]))/9,(-4*t[n[15]][1]-t[n[0]][1]+6*(t[n[11]][1]+t[n[14]][1])-2*(t[n[12]][1]+t[n[3]][1])+3*(t[n[2]][1]+t[n[8]][1]))/9]);this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(i)})}}_decodeType7Shading(e){const t=this.coords,r=this.colors,n=new Int32Array(16),i=new Int32Array(4);for(;e.hasData;){const s=e.readFlag();if(!(0<=s&&s<=3))throw new a.FormatError("Unknown type7 flag");const o=t.length;for(let r=0,a=0!==s?12:16;r<a;r++)t.push(e.readCoordinate());const c=r.length;for(let t=0,a=0!==s?2:4;t<a;t++)r.push(e.readComponents());let l,h,u,d;switch(s){case 0:n[12]=o+3;n[13]=o+4;n[14]=o+5;n[15]=o+6;n[8]=o+2;n[9]=o+13;n[10]=o+14;n[11]=o+7;n[4]=o+1;n[5]=o+12;n[6]=o+15;n[7]=o+8;n[0]=o;n[1]=o+11;n[2]=o+10;n[3]=o+9;i[2]=c+1;i[3]=c+2;i[0]=c;i[1]=c+3;break;case 1:l=n[12];h=n[13];u=n[14];d=n[15];n[12]=d;n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=u;n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=h;n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[2];h=i[3];i[2]=h;i[3]=c;i[0]=l;i[1]=c+1;break;case 2:l=n[15];h=n[11];n[12]=n[3];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[7];n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=h;n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=l;n[1]=o+7;n[2]=o+6;n[3]=o+5;l=i[3];i[2]=i[1];i[3]=c;i[0]=l;i[1]=c+1;break;case 3:n[12]=n[0];n[13]=o+0;n[14]=o+1;n[15]=o+2;n[8]=n[1];n[9]=o+9;n[10]=o+10;n[11]=o+3;n[4]=n[2];n[5]=o+8;n[6]=o+11;n[7]=o+4;n[0]=n[3];n[1]=o+7;n[2]=o+6;n[3]=o+5;i[2]=i[0];i[3]=c;i[0]=i[1];i[1]=c+1}this.figures.push({type:"patch",coords:new Int32Array(n),colors:new Int32Array(i)})}}_buildFigureFromPatch(e){const t=this.figures[e];(0,a.assert)("patch"===t.type,"Unexpected patch mesh figure");const r=this.coords,n=this.colors,i=t.coords,s=t.colors,o=Math.min(r[i[0]][0],r[i[3]][0],r[i[12]][0],r[i[15]][0]),c=Math.min(r[i[0]][1],r[i[3]][1],r[i[12]][1],r[i[15]][1]),l=Math.max(r[i[0]][0],r[i[3]][0],r[i[12]][0],r[i[15]][0]),h=Math.max(r[i[0]][1],r[i[3]][1],r[i[12]][1],r[i[15]][1]);let u=Math.ceil((l-o)*MeshShading.TRIANGLE_DENSITY/(this.bounds[2]-this.bounds[0]));u=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,u));let d=Math.ceil((h-c)*MeshShading.TRIANGLE_DENSITY/(this.bounds[3]-this.bounds[1]));d=Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT,d));const g=u+1,p=new Int32Array((d+1)*g),m=new Int32Array((d+1)*g);let b=0;const y=new Uint8Array(3),w=new Uint8Array(3),S=n[s[0]],x=n[s[1]],k=n[s[2]],C=n[s[3]],v=f(d),O=f(u);for(let e=0;e<=d;e++){y[0]=(S[0]*(d-e)+k[0]*e)/d|0;y[1]=(S[1]*(d-e)+k[1]*e)/d|0;y[2]=(S[2]*(d-e)+k[2]*e)/d|0;w[0]=(x[0]*(d-e)+C[0]*e)/d|0;w[1]=(x[1]*(d-e)+C[1]*e)/d|0;w[2]=(x[2]*(d-e)+C[2]*e)/d|0;for(let t=0;t<=u;t++,b++){if(!(0!==e&&e!==d||0!==t&&t!==u))continue;let a=0,s=0,o=0;for(let n=0;n<=3;n++)for(let c=0;c<=3;c++,o++){const l=v[e][n]*O[t][c];a+=r[i[o]][0]*l;s+=r[i[o]][1]*l}p[b]=r.length;r.push([a,s]);m[b]=n.length;const c=new Uint8Array(3);c[0]=(y[0]*(u-t)+w[0]*t)/u|0;c[1]=(y[1]*(u-t)+w[1]*t)/u|0;c[2]=(y[2]*(u-t)+w[2]*t)/u|0;n.push(c)}}p[0]=i[0];m[0]=s[0];p[u]=i[3];m[u]=s[1];p[g*d]=i[12];m[g*d]=s[2];p[g*d+u]=i[15];m[g*d+u]=s[3];this.figures[e]={type:"lattice",coords:p,colors:m,verticesPerRow:g}}_updateBounds(){let e=this.coords[0][0],t=this.coords[0][1],r=e,a=t;for(let n=1,i=this.coords.length;n<i;n++){const i=this.coords[n][0],s=this.coords[n][1];e=e>i?i:e;t=t>s?s:t;r=r<i?i:r;a=a<s?s:a}this.bounds=[e,t,r,a]}_packData(){let e,t,r,a;const n=this.coords,i=new Float32Array(2*n.length);for(e=0,r=0,t=n.length;e<t;e++){const t=n[e];i[r++]=t[0];i[r++]=t[1]}this.coords=i;const s=this.colors,o=new Uint8Array(3*s.length);for(e=0,r=0,t=s.length;e<t;e++){const t=s[e];o[r++]=t[0];o[r++]=t[1];o[r++]=t[2]}this.colors=o;const c=this.figures;for(e=0,t=c.length;e<t;e++){const t=c[e],n=t.coords,i=t.colors;for(r=0,a=n.length;r<a;r++){n[r]*=2;i[r]*=3}}}getIR(){return["Mesh",this.shadingType,this.coords,this.colors,this.figures,this.bounds,this.bbox,this.background]}}class DummyShading extends BaseShading{getIR(){return["Dummy"]}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getXfaFontDict=function getXfaFontDict(e){const t=function getXfaFontWidths(e){const t=getXfaFontName(e);if(!t)return null;const{baseWidths:r,baseMapping:a,factors:n}=t;let i;i=n?r.map(((e,t)=>e*n[t])):r;let s,o=-2;const c=[];for(const[e,t]of a.map(((e,t)=>[e,t])).sort(((e,t)=>{let[r]=e,[a]=t;return r-a})))if(-1!==e)if(e===o+1){s.push(i[t]);o+=1}else{o=e;s=[i[t]];c.push(e,s)}return c}(e),r=new n.Dict(null);r.set("BaseFont",n.Name.get(e));r.set("Type",n.Name.get("Font"));r.set("Subtype",n.Name.get("CIDFontType2"));r.set("Encoding",n.Name.get("Identity-H"));r.set("CIDToGIDMap",n.Name.get("Identity"));r.set("W",t);r.set("FirstChar",t[0]);r.set("LastChar",t.at(-2)+t.at(-1).length-1);const a=new n.Dict(null);r.set("FontDescriptor",a);const i=new n.Dict(null);i.set("Ordering","Identity");i.set("Registry","Adobe");i.set("Supplement",0);r.set("CIDSystemInfo",i);return r};t.getXfaFontName=getXfaFontName;var a=r(180),n=r(133),i=r(181),s=r(182),o=r(183),c=r(184),l=r(134),h=r(166);const u=(0,l.getLookupTableFactory)((function(e){e["MyriadPro-Regular"]=e["PdfJS-Fallback-Regular"]={name:"LiberationSans-Regular",factors:o.MyriadProRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:o.MyriadProRegularMetrics};e["MyriadPro-Bold"]=e["PdfJS-Fallback-Bold"]={name:"LiberationSans-Bold",factors:o.MyriadProBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:o.MyriadProBoldMetrics};e["MyriadPro-It"]=e["MyriadPro-Italic"]=e["PdfJS-Fallback-Italic"]={name:"LiberationSans-Italic",factors:o.MyriadProItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:o.MyriadProItalicMetrics};e["MyriadPro-BoldIt"]=e["MyriadPro-BoldItalic"]=e["PdfJS-Fallback-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:o.MyriadProBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:o.MyriadProBoldItalicMetrics};e.ArialMT=e.Arial=e["Arial-Regular"]={name:"LiberationSans-Regular",baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping};e["Arial-BoldMT"]=e["Arial-Bold"]={name:"LiberationSans-Bold",baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping};e["Arial-ItalicMT"]=e["Arial-Italic"]={name:"LiberationSans-Italic",baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping};e["Arial-BoldItalicMT"]=e["Arial-BoldItalic"]={name:"LiberationSans-BoldItalic",baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping};e["Calibri-Regular"]={name:"LiberationSans-Regular",factors:a.CalibriRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:a.CalibriRegularMetrics};e["Calibri-Bold"]={name:"LiberationSans-Bold",factors:a.CalibriBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:a.CalibriBoldMetrics};e["Calibri-Italic"]={name:"LiberationSans-Italic",factors:a.CalibriItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:a.CalibriItalicMetrics};e["Calibri-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:a.CalibriBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:a.CalibriBoldItalicMetrics};e["Segoeui-Regular"]={name:"LiberationSans-Regular",factors:c.SegoeuiRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:c.SegoeuiRegularMetrics};e["Segoeui-Bold"]={name:"LiberationSans-Bold",factors:c.SegoeuiBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:c.SegoeuiBoldMetrics};e["Segoeui-Italic"]={name:"LiberationSans-Italic",factors:c.SegoeuiItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:c.SegoeuiItalicMetrics};e["Segoeui-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:c.SegoeuiBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:c.SegoeuiBoldItalicMetrics};e["Helvetica-Regular"]=e.Helvetica={name:"LiberationSans-Regular",factors:i.HelveticaRegularFactors,baseWidths:s.LiberationSansRegularWidths,baseMapping:s.LiberationSansRegularMapping,metrics:i.HelveticaRegularMetrics};e["Helvetica-Bold"]={name:"LiberationSans-Bold",factors:i.HelveticaBoldFactors,baseWidths:s.LiberationSansBoldWidths,baseMapping:s.LiberationSansBoldMapping,metrics:i.HelveticaBoldMetrics};e["Helvetica-Italic"]={name:"LiberationSans-Italic",factors:i.HelveticaItalicFactors,baseWidths:s.LiberationSansItalicWidths,baseMapping:s.LiberationSansItalicMapping,metrics:i.HelveticaItalicMetrics};e["Helvetica-BoldItalic"]={name:"LiberationSans-BoldItalic",factors:i.HelveticaBoldItalicFactors,baseWidths:s.LiberationSansBoldItalicWidths,baseMapping:s.LiberationSansBoldItalicMapping,metrics:i.HelveticaBoldItalicMetrics}}));function getXfaFontName(e){const t=(0,h.normalizeFontName)(e);return u()[t]}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.CalibriRegularMetrics=t.CalibriRegularFactors=t.CalibriItalicMetrics=t.CalibriItalicFactors=t.CalibriBoldMetrics=t.CalibriBoldItalicMetrics=t.CalibriBoldItalicFactors=t.CalibriBoldFactors=void 0;t.CalibriBoldFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.54657,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.73293,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.9121,.86943,.79795,.88198,.77958,.70864,.81055,.90399,.88653,.96017,.82577,.77892,.78257,.97507,1.54657,.97507,.85284,.89552,.90176,.88762,.8785,.75241,.8785,.90518,.95015,.77618,.8785,.88401,.91916,.86304,.88401,.91488,.8785,.8801,.8785,.8785,.91343,.7173,1.04106,.8785,.85075,.95794,.82616,.85162,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.12401,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.73293,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.9121,.86943,.86943,.86943,.86943,.86943,.85284,.87508,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.88762,.88762,.88762,.88762,.88762,.88762,.8715,.75241,.90518,.90518,.90518,.90518,.88401,.88401,.88401,.88401,.8785,.8785,.8801,.8801,.8801,.8801,.8801,.90747,.89049,.8785,.8785,.8785,.8785,.85162,.8785,.85162,.83908,.88762,.83908,.88762,.83908,.88762,.73293,.75241,.73293,.75241,.73293,.75241,.73293,.75241,.87289,.83016,.88506,.93125,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.73133,.90518,.81921,.77618,.81921,.77618,.81921,.77618,1,1,.87356,.8785,.91075,.89608,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76229,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.79468,.91926,.88175,.70823,.94903,.9121,.8785,1,1,.9121,.8785,.87802,.88656,.8785,.86943,.8801,.86943,.8801,.86943,.8801,.87402,.89291,.77958,.91343,1,1,.77958,.91343,.70864,.7173,.70864,.7173,.70864,.7173,.70864,.7173,1,1,.81055,.75841,.81055,1.06452,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.90399,.8785,.96017,.95794,.77892,.85162,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.88762,.77539,.8715,.87508,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70674,.98387,.94721,1.33431,1.45894,.95161,1.06303,.83908,.80352,.57184,.6965,.56289,.82001,.56029,.81235,1.02988,.83908,.7762,.68156,.80367,.73133,.78257,.87356,.86943,.95958,.75727,.89019,1.04924,.9121,.7648,.86943,.87356,.79795,.78275,.81055,.77892,.9762,.82577,.99819,.84896,.95958,.77892,.96108,1.01407,.89049,1.02988,.94211,.96108,.8936,.84021,.87842,.96399,.79109,.89049,1.00813,1.02988,.86077,.87445,.92099,.84723,.86513,.8801,.75638,.85714,.78216,.79586,.87965,.94211,.97747,.78287,.97926,.84971,1.02988,.94211,.8801,.94211,.84971,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90264,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.90518,1,1,1,1,1,1,1,1,1,1,1,1,.90548,1,1,1,1,1,1,.96017,.95794,.96017,.95794,.96017,.95794,.77892,.85162,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.92794,.87012,.87012,.87012,.89552,.89552,1.42259,.71143,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.93835,.83406,.91133,.84107,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90527,1.81055,.90527,1.81055,1.31006,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriBoldMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriBoldItalicFactors=[1.3877,1,1,1,.97801,.92482,.89552,.91133,.81988,.97566,.98152,.93548,.93548,1.2798,.85284,.92794,1,.96134,1.56239,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.82845,.82845,.85284,.85284,.85284,.75859,.92138,.83908,.7762,.71805,.87289,.73133,.7514,.81921,.87356,.95958,.59526,.75727,.69225,1.04924,.90872,.85938,.79795,.87068,.77958,.69766,.81055,.90399,.88653,.96068,.82577,.77892,.78257,.97507,1.529,.97507,.85284,.89552,.90176,.94908,.86411,.74012,.86411,.88323,.95015,.86411,.86331,.88401,.91916,.86304,.88401,.9039,.86331,.86331,.86411,.86411,.90464,.70852,1.04106,.86331,.84372,.95794,.82616,.84548,.79492,.88331,1.69808,.88331,.85284,.97801,.89552,.91133,.89552,.91133,1.7801,.89552,1.24487,1.13254,1.19129,.96839,.85284,.68787,.70645,.85592,.90747,1.01466,1.0088,.90323,1,1.07463,1,.91056,.75806,1.19118,.96839,.78864,.82845,.84133,.75859,.83908,.83908,.83908,.83908,.83908,.83908,.77539,.71805,.73133,.73133,.73133,.73133,.95958,.95958,.95958,.95958,.88506,.90872,.85938,.85938,.85938,.85938,.85938,.85284,.87068,.90399,.90399,.90399,.90399,.77892,.79795,.90807,.94908,.94908,.94908,.94908,.94908,.94908,.85887,.74012,.88323,.88323,.88323,.88323,.88401,.88401,.88401,.88401,.8785,.86331,.86331,.86331,.86331,.86331,.86331,.90747,.89049,.86331,.86331,.86331,.86331,.84548,.86411,.84548,.83908,.94908,.83908,.94908,.83908,.94908,.71805,.74012,.71805,.74012,.71805,.74012,.71805,.74012,.87289,.79538,.88506,.92726,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.73133,.88323,.81921,.86411,.81921,.86411,.81921,.86411,1,1,.87356,.86331,.91075,.8777,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.95958,.88401,.76467,.90167,.59526,.91916,1,1,.86304,.69225,.88401,1,1,.70424,.77312,.91926,.88175,.70823,.94903,.90872,.86331,1,1,.90872,.86331,.86906,.88116,.86331,.85938,.86331,.85938,.86331,.85938,.86331,.87402,.86549,.77958,.90464,1,1,.77958,.90464,.69766,.70852,.69766,.70852,.69766,.70852,.69766,.70852,1,1,.81055,.75841,.81055,1.06452,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.90399,.86331,.96068,.95794,.77892,.84548,.77892,.78257,.79492,.78257,.79492,.78257,.79492,.9297,.56892,.83908,.94908,.77539,.85887,.87068,.89049,1,1,.81055,1.04106,1.20528,1.20528,1,1.15543,.70088,.98387,.94721,1.33431,1.45894,.95161,1.48387,.83908,.80352,.57118,.6965,.56347,.79179,.55853,.80346,1.02988,.83908,.7762,.67174,.86036,.73133,.78257,.87356,.86441,.95958,.75727,.89019,1.04924,.90872,.74889,.85938,.87891,.79795,.7957,.81055,.77892,.97447,.82577,.97466,.87179,.95958,.77892,.94252,.95612,.8753,1.02988,.92733,.94252,.87411,.84021,.8728,.95612,.74081,.8753,1.02189,1.02988,.84814,.87445,.91822,.84723,.85668,.86331,.81344,.87581,.76422,.82046,.96057,.92733,.99375,.78022,.95452,.86015,1.02988,.92733,.86331,.92733,.86015,.73133,1,1,1,1,1,1,1,1,1,1,1,1,.90631,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.88323,1,1,1,1,1,1,1,1,1,1,1,1,.85174,1,1,1,1,1,1,.96068,.95794,.96068,.95794,.96068,.95794,.77892,.84548,1,1,.89552,.90527,1,.90363,.92794,.92794,.92794,.89807,.87012,.87012,.87012,.89552,.89552,1.42259,.71094,1.06152,1,1,1.03372,1.03372,.97171,1.4956,2.2807,.92972,.83406,.91133,.83326,.91133,1,1,1,.72021,1,1.23108,.83489,.88525,.88525,.81499,.90616,1.81055,.90527,1.81055,1.3107,1.53711,.94434,1.08696,1,.95018,.77192,.85284,.90747,1.17534,.69825,.9716,1.37077,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.08004,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,.90727,.90727,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriBoldItalicMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriItalicFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39543,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.72346,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89249,.84118,.77452,.85374,.75186,.67789,.79776,.88844,.85066,.94309,.77818,.7306,.76659,1.10369,1.38313,1.10369,1.06139,.89552,.8739,.9245,.9245,.83203,.9245,.85865,1.09842,.9245,.9245,1.03297,1.07692,.90918,1.03297,.94959,.9245,.92274,.9245,.9245,1.02933,.77832,1.20562,.9245,.8916,.98986,.86621,.89453,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.16359,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.72346,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89249,.84118,.84118,.84118,.84118,.84118,.85284,.84557,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.9245,.9245,.9245,.9245,.9245,.9245,.84843,.83203,.85865,.85865,.85865,.85865,.82601,.82601,.82601,.82601,.94469,.9245,.92274,.92274,.92274,.92274,.92274,.90747,.86651,.9245,.9245,.9245,.9245,.89453,.9245,.89453,.8675,.9245,.8675,.9245,.8675,.9245,.72346,.83203,.72346,.83203,.72346,.83203,.72346,.83203,.85193,.8875,.86477,.99034,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.73206,.85865,.81105,.9245,.81105,.9245,.81105,.9245,1,1,.86275,.9245,.90872,.93591,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77896,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.9375,.98156,.93407,.77261,1.11429,.89249,.9245,1,1,.89249,.9245,.92534,.86698,.9245,.84118,.92274,.84118,.92274,.84118,.92274,.8667,.86291,.75186,1.02933,1,1,.75186,1.02933,.67789,.77832,.67789,.77832,.67789,.77832,.67789,.77832,1,1,.79776,.97655,.79776,1.23023,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.88844,.9245,.94309,.98986,.7306,.89453,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.9245,.76318,.84843,.84557,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67009,.96334,.93695,1.35191,1.40909,.95161,1.48387,.8675,.90861,.6192,.7363,.64824,.82411,.56321,.85696,1.23516,.8675,.81552,.7286,.84134,.73206,.76659,.86275,.84369,.90685,.77892,.85871,1.02638,.89249,.75828,.84118,.85984,.77452,.76466,.79776,.7306,.90782,.77818,.903,.87291,.90685,.7306,.99058,1.03667,.94635,1.23516,.9849,.99058,.92393,.8916,.942,1.03667,.75026,.94635,1.0297,1.23516,.90918,.94048,.98217,.89746,.84153,.92274,.82507,.88832,.84438,.88178,1.03525,.9849,1.00225,.78086,.97248,.89404,1.23516,.9849,.92274,.9849,.89404,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.89693,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.85865,1,1,1,1,1,1,1,1,1,1,1,1,.90933,1,1,1,1,1,1,.94309,.98986,.94309,.98986,.94309,.98986,.7306,.89453,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.68994,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.97858,.82616,.91133,.83437,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90572,1.81055,.90749,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85284,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.CalibriItalicMetrics={lineHeight:1.2207,lineGap:.2207};t.CalibriRegularFactors=[1.3877,1,1,1,1.17223,1.1293,.89552,.91133,.80395,1.02269,1.15601,.91056,.91056,1.2798,.85284,.89807,1,.90861,1.39016,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.91133,.96309,.96309,.85284,.85284,.85284,.83319,.88071,.8675,.81552,.73834,.85193,.73206,.7522,.81105,.86275,.90685,.6377,.77892,.75593,1.02638,.89385,.85122,.77452,.86503,.75186,.68887,.79776,.88844,.85066,.94258,.77818,.7306,.76659,1.10369,1.39016,1.10369,1.06139,.89552,.8739,.86128,.94469,.8457,.94469,.89464,1.09842,.84636,.94469,1.03297,1.07692,.90918,1.03297,.95897,.94469,.9482,.94469,.94469,1.04692,.78223,1.20562,.94469,.90332,.98986,.86621,.90527,.79004,.94152,1.77256,.94152,.85284,.97801,.89552,.91133,.89552,.91133,1.91729,.89552,1.17889,1.13254,1.08707,.92098,.85284,.68787,.71353,.84737,.90747,1.0088,1.0044,.87683,1,1.09091,1,.92229,.739,1.15642,.92098,.76288,.80504,.80972,.75859,.8675,.8675,.8675,.8675,.8675,.8675,.76318,.73834,.73206,.73206,.73206,.73206,.90685,.90685,.90685,.90685,.86477,.89385,.85122,.85122,.85122,.85122,.85122,.85284,.85311,.88844,.88844,.88844,.88844,.7306,.77452,.86331,.86128,.86128,.86128,.86128,.86128,.86128,.8693,.8457,.89464,.89464,.89464,.89464,.82601,.82601,.82601,.82601,.94469,.94469,.9482,.9482,.9482,.9482,.9482,.90747,.86651,.94469,.94469,.94469,.94469,.90527,.94469,.90527,.8675,.86128,.8675,.86128,.8675,.86128,.73834,.8457,.73834,.8457,.73834,.8457,.73834,.8457,.85193,.92454,.86477,.9921,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.73206,.89464,.81105,.84636,.81105,.84636,.81105,.84636,1,1,.86275,.94469,.90872,.95786,.90685,.82601,.90685,.82601,.90685,.82601,.90685,1.03297,.90685,.82601,.77741,1.05611,.6377,1.07692,1,1,.90918,.75593,1.03297,1,1,.76032,.90452,.98156,1.11842,.77261,1.11429,.89385,.94469,1,1,.89385,.94469,.95877,.86901,.94469,.85122,.9482,.85122,.9482,.85122,.9482,.8667,.90016,.75186,1.04692,1,1,.75186,1.04692,.68887,.78223,.68887,.78223,.68887,.78223,.68887,.78223,1,1,.79776,.92188,.79776,1.23023,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.88844,.94469,.94258,.98986,.7306,.90527,.7306,.76659,.79004,.76659,.79004,.76659,.79004,1.09231,.54873,.8675,.86128,.76318,.8693,.85311,.86651,1,1,.79776,1.20562,1.18622,1.18622,1,1.1437,.67742,.96334,.93695,1.35191,1.40909,.95161,1.48387,.86686,.90861,.62267,.74359,.65649,.85498,.56963,.88254,1.23516,.8675,.81552,.75443,.84503,.73206,.76659,.86275,.85122,.90685,.77892,.85746,1.02638,.89385,.75657,.85122,.86275,.77452,.74171,.79776,.7306,.95165,.77818,.89772,.88831,.90685,.7306,.98142,1.02191,.96576,1.23516,.99018,.98142,.9236,.89258,.94035,1.02191,.78848,.96576,.9561,1.23516,.90918,.92578,.95424,.89746,.83969,.9482,.80113,.89442,.85208,.86155,.98022,.99018,1.00452,.81209,.99247,.89181,1.23516,.99018,.9482,.99018,.89181,.73206,1,1,1,1,1,1,1,1,1,1,1,1,.88844,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89464,1,1,1,1,1,1,1,1,1,1,1,1,.96766,1,1,1,1,1,1,.94258,.98986,.94258,.98986,.94258,.98986,.7306,.90527,1,1,.89552,.90527,1,.90186,1.12308,1.12308,1.12308,1.12308,1.2566,1.2566,1.2566,.89552,.89552,1.42259,.69043,1.03809,1,1,1.0176,1.0176,1.11523,1.4956,2.01462,.99331,.82616,.91133,.84286,.91133,1,1,1,.70508,1,1.23108,.79801,.84426,.84426,.774,.90527,1.81055,.90527,1.81055,1.28809,1.55469,.94434,1.07806,1,.97094,.7589,.85284,.90747,1.19658,.69825,.97622,1.33512,.90747,.90747,.85356,.90747,.90747,1.44947,.85284,.8941,.8941,.70572,.8,.70572,.70572,.70572,.70572,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.99862,.99862,1,1,1,1,1,1.0336,.91027,1,1,1,.99862,1,1,1,1,1,1,1,1,1,1,1,1,1.05859,1.05859,1,1,1,1.07185,.99413,.96334,1.08065,1,1,1,1,1,1,1,1,1,1,1];t.CalibriRegularMetrics={lineHeight:1.2207,lineGap:.2207}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HelveticaRegularMetrics=t.HelveticaRegularFactors=t.HelveticaItalicMetrics=t.HelveticaItalicFactors=t.HelveticaBoldMetrics=t.HelveticaBoldItalicMetrics=t.HelveticaBoldItalicFactors=t.HelveticaBoldFactors=void 0;t.HelveticaBoldFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.03374,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.00042,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.03828,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00034,.99977,1,.99997,1.00026,1.00078,1.00036,.99973,1.00013,1.0006,.99977,.99977,.99988,.85148,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,1.00069,1.00022,.99977,1.00001,.99984,1.00026,1.00001,1.00024,1.00001,.9999,1,1.0006,1.00001,1.00041,.99962,1.00026,1.0006,.99995,1.00041,.99942,.99973,.99927,1.00082,.99902,1.00026,1.00087,1.0006,1.00069,.99973,.99867,.99973,.9993,1.00026,1.00049,1.00056,1,.99988,.99935,.99995,.99954,1.00055,.99945,1.00032,1.0006,.99995,1.00026,.99995,1.00032,1.00001,1.00008,.99971,1.00019,.9994,1.00001,1.0006,1.00044,.99973,1.00023,1.00047,1,.99942,.99561,.99989,1.00035,.99977,1.00035,.99977,1.00019,.99944,1.00001,1.00021,.99926,1.00035,1.00035,.99942,1.00048,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.99989,1.00057,1.00001,.99936,1.00052,1.00012,.99996,1.00043,1,1.00035,.9994,.99976,1.00035,.99973,1.00052,1.00041,1.00119,1.00037,.99973,1.00002,.99986,1.00041,1.00041,.99902,.9996,1.00034,.99999,1.00026,.99999,1.00026,.99973,1.00052,.99973,1,.99973,1.00041,1.00075,.9994,1.0003,.99999,1,1.00041,.99955,1,.99915,.99973,.99973,1.00026,1.00119,.99955,.99973,1.0006,.99911,1.0006,1.00026,.99972,1.00026,.99902,1.00041,.99973,.99999,1,1,1.00038,1.0005,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,1.00047,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaBoldMetrics={lineHeight:1.2,lineGap:.2};t.HelveticaBoldItalicFactors=[.76116,1,1,1.0006,.99998,.99974,.99973,.99973,.99982,.99977,1.00087,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99998,1,1.00003,1.00003,1.00003,1.00026,.9999,.99977,.99977,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,.99973,.99977,1.00026,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,.99998,1.0006,.99998,1.00003,.99973,.99998,.99973,1.00026,.99973,1.00026,.99973,.99998,1.00026,1.00026,1.0006,1.0006,.99973,1.0006,.99982,1.00026,1.00026,1.00026,1.00026,.99959,.99973,.99998,1.00026,.99973,1.00022,.99973,.99973,1,.99959,1.00077,.99959,1.00003,.99998,.99973,.99973,.99973,.99973,1.00077,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.99973,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,.99977,.99977,.99977,.99977,.99977,.99977,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,.99973,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.00026,1.06409,1.00026,1.00026,1.00026,1.00026,1.00026,.99973,1.00026,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,1.0044,.99977,1.00026,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,.99977,1.00026,.99977,1.00026,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99971,.99973,.99973,1.0006,.99977,.99973,.99973,1.00026,1.0006,1.00026,1.0006,1.00026,1.01011,1.00026,.99999,1.00026,1.0006,.99977,1.00026,.99977,1.00026,.99977,1.00026,.9993,.9998,1.00026,1.00022,1.00026,1.00022,1.00026,1.00022,1.00026,1,1.00016,.99977,.99959,.99977,.99959,.99977,.99959,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00026,.99998,1.00026,.8121,1.00026,.99998,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,.99977,1.00026,1.00016,1.00022,1.00001,.99973,1.00001,1.00026,1,1.00026,1,1.00026,1,1.0006,.99973,.99977,.99973,1,.99982,1.00022,1.00026,1.00001,.99973,1.00026,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99977,1,1,1.00026,.99969,.99972,.99981,.9998,1.0006,.99977,.99977,1.00022,.91155,1.00001,1.00026,.99977,1.00022,1.0006,.99977,1.00001,.99999,.99977,.99966,1.00022,1.00032,1.00001,.99944,1.00026,1.00001,.99968,1.00001,1.00047,1,1.0006,1.00001,.99981,1.00101,1.00026,1.0006,.99948,.99981,1.00064,.99973,.99942,1.00101,1.00061,1.00026,1.00069,1.0006,1.00014,.99973,1.01322,.99973,1.00065,1.00026,1.00012,.99923,1,1.00064,1.00076,.99948,1.00055,1.00063,1.00007,.99943,1.0006,.99948,1.00026,.99948,.99943,1.00001,1.00001,1.00029,1.00038,1.00035,1.00001,1.0006,1.0006,.99973,.99978,1.00001,1.00057,.99989,.99967,.99964,.99967,.99977,.99999,.99977,1.00038,.99977,1.00001,.99973,1.00066,.99967,.99967,1.00041,.99998,.99999,.99977,1.00022,.99967,1.00001,.99977,1.00026,.99964,1.00031,1.00001,.99999,.99999,1,1.00023,1,1,.99999,1.00035,1.00001,.99999,.99973,.99977,.99999,1.00058,.99973,.99973,.99955,.9995,1.00026,1.00026,1.00032,.99989,1.00034,.99999,1.00026,1.00026,1.00026,.99973,.45998,.99973,1.00026,.99973,1.00001,.99999,.99982,.99994,.99996,1,1.00042,1.00044,1.00029,1.00023,.99973,.99973,1.00026,.99949,1.00002,.99973,1.0006,1.0006,1.0006,.99975,1.00026,1.00026,1.00032,.98685,.99973,1.00026,1,1,.99966,1.00044,1.00016,1.00022,1.00016,1.00022,1.00016,1.00022,1.00001,.99973,1,1,.99973,1,1,.99955,1.0006,1.0006,1.0006,1.0006,1,1,1,.99973,.99973,.99972,1,1,1.00106,.99999,.99998,.99998,.99999,.99998,1.66475,1,.99973,.99973,1,.99973,.99971,.99978,1,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00098,1,1,1,1.00049,1,1,.99972,1,1.20985,1.39713,1.00003,1.00031,1.00015,1,.99561,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.99972,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaBoldItalicMetrics={lineHeight:1.35,lineGap:.2};t.HelveticaItalicFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.0288,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,.99946,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.06311,.99973,1.00024,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,1.00041,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.89547,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,1.00001,1,1.00054,.99977,1.00084,1.00007,.99973,1.00013,.99924,1.00001,1.00001,.99945,.91221,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00001,.99999,.99977,.99933,1.00022,1.00054,1.00001,1.00065,1.00026,1.00001,1.0001,1.00001,1.00052,1,1.0006,1.00001,.99945,.99897,.99968,.99924,1.00036,.99945,.99949,1,1.0006,.99897,.99918,.99968,.99911,.99924,1,.99962,1.01487,1,1.0005,.99973,1.00012,1.00043,1,.99995,.99994,1.00036,.99947,1.00019,1.00063,1.00025,.99924,1.00036,.99973,1.00036,1.00025,1.00001,1.00001,1.00027,1.0001,1.00068,1.00001,1.0006,1.0006,1,1.00008,.99957,.99972,.9994,.99954,.99975,1.00051,1.00001,1.00019,1.00001,1.0001,.99986,1.00001,1.00001,1.00038,.99954,.99954,.9994,1.00066,.99999,.99977,1.00022,1.00054,1.00001,.99977,1.00026,.99975,1.0001,1.00001,.99993,.9995,.99955,1.00016,.99978,.99974,1.00019,1.00022,.99955,1.00053,.99973,1.00089,1.00005,.99967,1.00048,.99973,1.00002,1.00034,.99973,.99973,.99964,1.00006,1.00066,.99947,.99973,.98894,.99973,1,.44898,1,.99946,1,1.00039,1.00082,.99991,.99991,.99985,1.00022,1.00023,1.00061,1.00006,.99966,.99973,.99973,.99973,1.00019,1.0008,1,.99924,.99924,.99924,.99983,1.00044,.99973,.99964,.98332,1,.99973,1,1,.99962,.99895,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,1.00423,.99925,.99999,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1.00049,1,1.00245,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,1.00003,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,.99998,.99998,.99998,.99998,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaItalicMetrics={lineHeight:1.35,lineGap:.2};t.HelveticaRegularFactors=[.76116,1,1,1.0006,1.0006,1.00006,.99973,.99973,.99982,1.00001,1.00043,.99998,.99998,.99959,1.00003,1.0006,.99998,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.0006,1,1.00003,1.00003,1.00003,.99973,.99987,1.00001,1.00001,.99977,.99977,1.00001,1.00026,1.00022,.99977,1.0006,1,1.00001,.99973,.99999,.99977,1.00022,1.00001,1.00022,.99977,1.00001,1.00026,.99977,1.00001,1.00016,1.00001,1.00001,1.00026,1.0006,1.0006,1.0006,.99949,.99973,.99998,.99973,.99973,1,.99973,.99973,1.0006,.99973,.99973,.99924,.99924,1,.99924,.99999,.99973,.99973,.99973,.99973,.99998,1,1.0006,.99973,1,.99977,1,1,1,1.00005,1.0009,1.00005,1.00003,.99998,.99973,.99973,.99973,.99973,1.0009,.99973,.99998,1.00025,.99968,.99973,1.00003,1.00025,.60299,1.00024,1.06409,1,1,.99998,1,.9998,1.0006,.99998,1,.99936,.99973,1.00002,1.00002,1.00002,1.00026,1.00001,1.00001,1.00001,1.00001,1.00001,1.00001,1,.99977,1.00001,1.00001,1.00001,1.00001,1.0006,1.0006,1.0006,1.0006,.99977,.99977,1.00022,1.00022,1.00022,1.00022,1.00022,1.00003,1.00022,.99977,.99977,.99977,.99977,1.00001,1.00001,1.00026,.99973,.99973,.99973,.99973,.99973,.99973,.99982,1,.99973,.99973,.99973,.99973,1.0006,1.0006,1.0006,1.0006,.99973,.99973,.99973,.99973,.99973,.99973,.99973,1.06409,1.00026,.99973,.99973,.99973,.99973,1,.99973,1,1.00001,.99973,1.00001,.99973,1.00001,.99973,.99977,1,.99977,1,.99977,1,.99977,1,.99977,1.04596,.99977,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00001,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,.99977,.99973,.99977,.99973,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,1.0006,.99924,1.0006,1.0006,1.00019,1.00034,1,.99924,1.00001,1,1,.99973,.99924,.99973,.99924,.99973,1.02572,.99973,1.00005,.99973,.99924,.99977,.99973,.99977,.99973,.99977,.99973,.99999,.9998,.99973,1.00022,.99973,1.00022,.99973,1.00022,.99973,1,1.00016,.99977,.99998,.99977,.99998,.99977,.99998,1.00001,1,1.00001,1,1.00001,1,1.00001,1,1.00026,1.0006,1.00026,.84533,1.00026,1.0006,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,.99977,.99973,1.00016,.99977,1.00001,1,1.00001,1.00026,1,1.00026,1,1.00026,1,.99924,.99973,1.00001,.99973,1,.99982,1.00022,1.00026,1.00001,1,1.00026,1.0006,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99998,.99928,1,.99977,1.00013,1.00055,.99947,.99945,.99941,.99924,1.00001,1.00001,1.0004,.91621,1.00001,1.00026,.99977,1.00022,1.0006,1.00001,1.00005,.99999,.99977,1.00015,1.00022,.99977,1.00001,.99973,1.00026,1.00001,1.00019,1.00001,.99946,1,1.0006,1.00001,.99978,1.00045,.99973,.99924,1.00023,.99978,.99966,1,1.00065,1.00045,1.00019,.99973,.99973,.99924,1,1,.96499,1,1.00055,.99973,1.00008,1.00027,1,.9997,.99995,1.00023,.99933,1.00019,1.00015,1.00031,.99924,1.00023,.99973,1.00023,1.00031,1.00001,.99928,1.00029,1.00092,1.00035,1.00001,1.0006,1.0006,1,.99988,.99975,1,1.00082,.99561,.9996,1.00035,1.00001,.99962,1.00001,1.00092,.99964,1.00001,.99963,.99999,1.00035,1.00035,1.00082,.99962,.99999,.99977,1.00022,1.00035,1.00001,.99977,1.00026,.9996,.99967,1.00001,1.00034,1.00074,1.00054,1.00053,1.00063,.99971,.99962,1.00035,.99975,.99977,.99973,1.00043,.99953,1.0007,.99915,.99973,1.00008,.99892,1.00073,1.00073,1.00114,.99915,1.00073,.99955,.99973,1.00092,.99973,1,.99998,1,1.0003,1,1.00043,1.00001,.99969,1.0003,1,1.00035,1.00001,.9995,1,1.00092,.99973,.99973,.99973,1.0007,.9995,1,.99924,1.0006,.99924,.99972,1.00062,.99973,1.00114,1.00073,1,.99955,1,1,1.00047,.99968,1.00016,.99977,1.00016,.99977,1.00016,.99977,1.00001,1,1,1,.99973,1,1,.99955,.99924,.99924,.99924,.99924,.99998,.99998,.99998,.99973,.99973,.99972,1,1,1.00267,.99999,.99998,.99998,1,.99998,1.66475,1,.99973,.99973,1.00023,.99973,.99971,.99925,1.00023,1,.99991,.99984,1.00002,1.00002,1.00002,1.00002,1,1,1,1,1,1,1,.96329,1,1.20985,1.39713,1.00003,.8254,1.00015,1,1.00035,1.00027,1.00031,1.00031,.99915,1.00031,1.00031,.99999,1.00003,.99999,.99999,1.41144,1.6,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.41144,1.40579,1.40579,1.36625,.99999,1,.99861,.99861,1,1.00026,1.00026,1.00026,1.00026,.95317,.99999,.99999,.99999,.99999,1.40483,1,.99977,1.00054,1,1,.99953,.99962,1.00042,.9995,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.HelveticaRegularMetrics={lineHeight:1.2,lineGap:.2}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LiberationSansRegularWidths=t.LiberationSansRegularMapping=t.LiberationSansItalicWidths=t.LiberationSansItalicMapping=t.LiberationSansBoldWidths=t.LiberationSansBoldMapping=t.LiberationSansBoldItalicWidths=t.LiberationSansBoldItalicMapping=void 0;t.LiberationSansBoldWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,719,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,785,556,556,278,722,556,556,611,278,611,278,611,385,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,465,722,333,853,906,474,825,927,838,278,722,722,601,719,667,611,722,778,278,722,667,833,722,644,778,722,667,600,611,667,821,667,809,802,278,667,615,451,611,278,582,615,610,556,606,475,460,611,541,278,558,556,612,556,445,611,766,619,520,684,446,582,715,576,753,845,278,582,611,582,845,667,669,885,567,711,667,278,276,556,1094,1062,875,610,722,622,719,722,719,722,567,712,667,904,626,719,719,610,702,833,722,778,719,667,722,611,622,854,667,730,703,1005,1019,870,979,719,711,1031,719,556,618,615,417,635,556,709,497,615,615,500,635,740,604,611,604,611,556,490,556,875,556,615,581,833,844,729,854,615,552,854,583,556,556,611,417,552,556,278,281,278,969,906,611,500,615,556,604,778,611,487,447,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1094,556,885,489,1115,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];t.LiberationSansBoldMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansBoldItalicWidths=[365,0,333,278,333,474,556,556,889,722,238,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,333,333,584,584,584,611,975,722,722,722,722,667,611,778,722,278,556,722,611,833,722,778,667,778,722,667,611,722,667,944,667,667,611,333,278,333,584,556,333,556,611,556,611,556,333,611,611,278,278,556,278,889,611,611,611,611,389,556,333,611,556,778,556,556,500,389,280,389,584,333,556,556,556,556,280,556,333,737,370,556,584,737,552,400,549,333,333,333,576,556,278,333,333,365,556,834,834,834,611,722,722,722,722,722,722,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,556,556,556,556,556,278,278,278,278,611,611,611,611,611,611,611,549,611,611,611,611,611,556,611,556,722,556,722,556,722,556,722,556,722,556,722,556,722,556,722,740,722,611,667,556,667,556,667,556,667,556,667,556,778,611,778,611,778,611,778,611,722,611,722,611,278,278,278,278,278,278,278,278,278,278,782,556,556,278,722,556,556,611,278,611,278,611,396,611,479,611,278,722,611,722,611,722,611,708,723,611,778,611,778,611,778,611,1e3,944,722,389,722,389,722,389,667,556,667,556,667,556,667,556,611,333,611,479,611,333,722,611,722,611,722,611,722,611,722,611,722,611,944,778,667,556,667,611,500,611,500,611,500,278,556,722,556,1e3,889,778,611,667,556,611,333,333,333,333,333,333,333,333,333,333,333,333,722,333,854,906,473,844,930,847,278,722,722,610,671,667,611,722,778,278,722,667,833,722,657,778,718,667,590,611,667,822,667,829,781,278,667,620,479,611,278,591,620,621,556,610,479,492,611,558,278,566,556,603,556,450,611,712,605,532,664,409,591,704,578,773,834,278,591,611,591,834,667,667,886,614,719,667,278,278,556,1094,1042,854,622,719,677,719,722,708,722,614,722,667,927,643,719,719,615,687,833,722,778,719,667,722,611,677,781,667,729,708,979,989,854,1e3,708,719,1042,729,556,619,604,534,618,556,736,510,611,611,507,622,740,604,611,611,611,556,889,556,885,556,646,583,889,935,707,854,594,552,865,589,556,556,611,469,563,556,278,278,278,969,906,611,507,619,556,611,778,611,575,467,944,778,944,778,944,778,667,556,333,333,556,1e3,1e3,552,278,278,278,278,500,500,500,556,556,350,1e3,1e3,240,479,333,333,604,333,167,396,556,556,1104,556,885,516,1146,1e3,768,600,834,834,834,834,999,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,722,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,611,611,333,333,333,333,333,333,333,333,222,222,333,333,333,333,333,333,333,333];t.LiberationSansBoldItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansItalicWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,625,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,733,444,500,222,667,500,500,556,222,556,222,556,281,556,400,556,222,722,556,722,556,722,556,615,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,354,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,789,846,389,794,865,775,222,667,667,570,671,667,611,722,778,278,667,667,833,722,648,778,725,667,600,611,667,837,667,831,761,278,667,570,439,555,222,550,570,571,500,556,439,463,555,542,222,500,492,548,500,447,556,670,573,486,603,374,550,652,546,728,779,222,550,556,550,779,667,667,843,544,708,667,278,278,500,1066,982,844,589,715,639,724,667,651,667,544,704,667,917,614,715,715,589,686,833,722,778,725,667,722,611,639,795,667,727,673,920,923,805,886,651,694,1022,682,556,562,522,493,553,556,688,465,556,556,472,564,686,550,556,556,556,500,833,500,835,500,572,518,830,851,621,736,526,492,752,534,556,556,556,378,496,500,222,222,222,910,828,556,472,565,500,556,778,556,492,339,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1083,1e3,768,600,834,834,834,834,1e3,500,998,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,584,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];t.LiberationSansItalicMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1];t.LiberationSansRegularWidths=[365,0,333,278,278,355,556,556,889,667,191,333,333,389,584,278,333,278,278,556,556,556,556,556,556,556,556,556,556,278,278,584,584,584,556,1015,667,667,722,722,667,611,778,722,278,500,667,556,833,722,778,667,778,722,667,611,722,667,944,667,667,611,278,278,278,469,556,333,556,556,500,556,556,278,556,556,222,222,500,222,833,556,556,556,556,333,500,278,556,500,722,500,500,500,334,260,334,584,333,556,556,556,556,260,556,333,737,370,556,584,737,552,400,549,333,333,333,576,537,278,333,333,365,556,834,834,834,611,667,667,667,667,667,667,1e3,722,667,667,667,667,278,278,278,278,722,722,778,778,778,778,778,584,778,722,722,722,722,667,667,611,556,556,556,556,556,556,889,500,556,556,556,556,278,278,278,278,556,556,556,556,556,556,556,549,611,556,556,556,556,500,556,500,667,556,667,556,667,556,722,500,722,500,722,500,722,500,722,615,722,556,667,556,667,556,667,556,667,556,667,556,778,556,778,556,778,556,778,556,722,556,722,556,278,278,278,278,278,278,278,222,278,278,735,444,500,222,667,500,500,556,222,556,222,556,292,556,334,556,222,722,556,722,556,722,556,604,723,556,778,556,778,556,778,556,1e3,944,722,333,722,333,722,333,667,500,667,500,667,500,667,500,611,278,611,375,611,278,722,556,722,556,722,556,722,556,722,556,722,556,944,722,667,500,667,611,500,611,500,611,500,222,556,667,556,1e3,889,778,611,667,500,611,278,333,333,333,333,333,333,333,333,333,333,333,667,278,784,838,384,774,855,752,222,667,667,551,668,667,611,722,778,278,667,668,833,722,650,778,722,667,618,611,667,798,667,835,748,278,667,578,446,556,222,547,578,575,500,557,446,441,556,556,222,500,500,576,500,448,556,690,569,482,617,395,547,648,525,713,781,222,547,556,547,781,667,667,865,542,719,667,278,278,500,1057,1010,854,583,722,635,719,667,656,667,542,677,667,923,604,719,719,583,656,833,722,778,719,667,722,611,635,760,667,740,667,917,938,792,885,656,719,1010,722,556,573,531,365,583,556,669,458,559,559,438,583,688,552,556,542,556,500,458,500,823,500,573,521,802,823,625,719,521,510,750,542,556,556,556,365,510,500,222,278,222,906,812,556,438,559,500,552,778,556,489,411,944,722,944,722,944,722,667,500,333,333,556,1e3,1e3,552,222,222,222,222,333,333,333,556,556,350,1e3,1e3,188,354,333,333,500,333,167,365,556,556,1094,556,885,323,1073,1e3,768,600,834,834,834,834,1e3,500,1e3,500,1e3,500,500,494,612,823,713,584,549,713,979,719,274,549,549,583,549,549,604,584,604,604,708,625,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,708,729,604,604,354,354,1e3,990,990,990,990,494,604,604,604,604,354,1021,1052,917,750,750,531,656,594,510,500,750,750,500,500,333,333,333,333,333,333,333,333,222,222,294,294,324,324,316,328,398,285];t.LiberationSansRegularMapping=[-1,-1,-1,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,161,162,163,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,372,373,374,375,376,377,378,379,380,381,382,383,402,506,507,508,509,510,511,536,537,538,539,710,711,713,728,729,730,731,732,733,900,901,902,903,904,905,906,908,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1138,1139,1168,1169,7808,7809,7810,7811,7812,7813,7922,7923,8208,8209,8211,8212,8213,8215,8216,8217,8218,8219,8220,8221,8222,8224,8225,8226,8230,8240,8242,8243,8249,8250,8252,8254,8260,8319,8355,8356,8359,8364,8453,8467,8470,8482,8486,8494,8539,8540,8541,8542,8592,8593,8594,8595,8596,8597,8616,8706,8710,8719,8721,8722,8730,8734,8735,8745,8747,8776,8800,8801,8804,8805,8962,8976,8992,8993,9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9552,9553,9554,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,9600,9604,9608,9612,9616,9617,9618,9619,9632,9633,9642,9643,9644,9650,9658,9660,9668,9674,9675,9679,9688,9689,9702,9786,9787,9788,9792,9794,9824,9827,9829,9830,9834,9835,9836,61441,61442,61445,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MyriadProRegularMetrics=t.MyriadProRegularFactors=t.MyriadProItalicMetrics=t.MyriadProItalicFactors=t.MyriadProBoldMetrics=t.MyriadProBoldItalicMetrics=t.MyriadProBoldItalicFactors=t.MyriadProBoldFactors=void 0;t.MyriadProBoldFactors=[1.36898,1,1,.72706,.80479,.83734,.98894,.99793,.9897,.93884,.86209,.94292,.94292,1.16661,1.02058,.93582,.96694,.93582,1.19137,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.99793,.78076,.78076,1.02058,1.02058,1.02058,.72851,.78966,.90838,.83637,.82391,.96376,.80061,.86275,.8768,.95407,1.0258,.73901,.85022,.83655,1.0156,.95546,.92179,.87107,.92179,.82114,.8096,.89713,.94438,.95353,.94083,.91905,.90406,.9446,.94292,1.18777,.94292,1.02058,.89903,.90088,.94938,.97898,.81093,.97571,.94938,1.024,.9577,.95933,.98621,1.0474,.97455,.98981,.9672,.95933,.9446,.97898,.97407,.97646,.78036,1.10208,.95442,.95298,.97579,.9332,.94039,.938,.80687,1.01149,.80687,1.02058,.80479,.99793,.99793,.99793,.99793,1.01149,1.00872,.90088,.91882,1.0213,.8361,1.02058,.62295,.54324,.89022,1.08595,1,1,.90088,1,.97455,.93582,.90088,1,1.05686,.8361,.99642,.99642,.99642,.72851,.90838,.90838,.90838,.90838,.90838,.90838,.868,.82391,.80061,.80061,.80061,.80061,1.0258,1.0258,1.0258,1.0258,.97484,.95546,.92179,.92179,.92179,.92179,.92179,1.02058,.92179,.94438,.94438,.94438,.94438,.90406,.86958,.98225,.94938,.94938,.94938,.94938,.94938,.94938,.9031,.81093,.94938,.94938,.94938,.94938,.98621,.98621,.98621,.98621,.93969,.95933,.9446,.9446,.9446,.9446,.9446,1.08595,.9446,.95442,.95442,.95442,.95442,.94039,.97898,.94039,.90838,.94938,.90838,.94938,.90838,.94938,.82391,.81093,.82391,.81093,.82391,.81093,.82391,.81093,.96376,.84313,.97484,.97571,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.80061,.94938,.8768,.9577,.8768,.9577,.8768,.9577,1,1,.95407,.95933,.97069,.95933,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,1.0258,.98621,.887,1.01591,.73901,1.0474,1,1,.97455,.83655,.98981,1,1,.83655,.73977,.83655,.73903,.84638,1.033,.95546,.95933,1,1,.95546,.95933,.8271,.95417,.95933,.92179,.9446,.92179,.9446,.92179,.9446,.936,.91964,.82114,.97646,1,1,.82114,.97646,.8096,.78036,.8096,.78036,1,1,.8096,.78036,1,1,.89713,.77452,.89713,1.10208,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94438,.95442,.94083,.97579,.90406,.94039,.90406,.9446,.938,.9446,.938,.9446,.938,1,.99793,.90838,.94938,.868,.9031,.92179,.9446,1,1,.89713,1.10208,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90989,.9358,.91945,.83181,.75261,.87992,.82976,.96034,.83689,.97268,1.0078,.90838,.83637,.8019,.90157,.80061,.9446,.95407,.92436,1.0258,.85022,.97153,1.0156,.95546,.89192,.92179,.92361,.87107,.96318,.89713,.93704,.95638,.91905,.91709,.92796,1.0258,.93704,.94836,1.0373,.95933,1.0078,.95871,.94836,.96174,.92601,.9498,.98607,.95776,.95933,1.05453,1.0078,.98275,.9314,.95617,.91701,1.05993,.9446,.78367,.9553,1,.86832,1.0128,.95871,.99394,.87548,.96361,.86774,1.0078,.95871,.9446,.95871,.86774,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.94083,.97579,.94083,.97579,.94083,.97579,.90406,.94039,.96694,1,.89903,1,1,1,.93582,.93582,.93582,1,.908,.908,.918,.94219,.94219,.96544,1,1.285,1,1,.81079,.81079,1,1,.74854,1,1,1,1,.99793,1,1,1,.65,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.17173,1,.80535,.76169,1.02058,1.0732,1.05486,1,1,1.30692,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.16161,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProBoldMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProBoldItalicFactors=[1.36898,1,1,.66227,.80779,.81625,.97276,.97276,.97733,.92222,.83266,.94292,.94292,1.16148,1.02058,.93582,.96694,.93582,1.17337,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.97276,.78076,.78076,1.02058,1.02058,1.02058,.71541,.76813,.85576,.80591,.80729,.94299,.77512,.83655,.86523,.92222,.98621,.71743,.81698,.79726,.98558,.92222,.90637,.83809,.90637,.80729,.76463,.86275,.90699,.91605,.9154,.85308,.85458,.90531,.94292,1.21296,.94292,1.02058,.89903,1.18616,.99613,.91677,.78216,.91677,.90083,.98796,.9135,.92168,.95381,.98981,.95298,.95381,.93459,.92168,.91513,.92004,.91677,.95077,.748,1.04502,.91677,.92061,.94236,.89544,.89364,.9,.80687,.8578,.80687,1.02058,.80779,.97276,.97276,.97276,.97276,.8578,.99973,1.18616,.91339,1.08074,.82891,1.02058,.55509,.71526,.89022,1.08595,1,1,1.18616,1,.96736,.93582,1.18616,1,1.04864,.82711,.99043,.99043,.99043,.71541,.85576,.85576,.85576,.85576,.85576,.85576,.845,.80729,.77512,.77512,.77512,.77512,.98621,.98621,.98621,.98621,.95961,.92222,.90637,.90637,.90637,.90637,.90637,1.02058,.90251,.90699,.90699,.90699,.90699,.85458,.83659,.94951,.99613,.99613,.99613,.99613,.99613,.99613,.85811,.78216,.90083,.90083,.90083,.90083,.95381,.95381,.95381,.95381,.9135,.92168,.91513,.91513,.91513,.91513,.91513,1.08595,.91677,.91677,.91677,.91677,.91677,.89364,.92332,.89364,.85576,.99613,.85576,.99613,.85576,.99613,.80729,.78216,.80729,.78216,.80729,.78216,.80729,.78216,.94299,.76783,.95961,.91677,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.77512,.90083,.86523,.9135,.86523,.9135,.86523,.9135,1,1,.92222,.92168,.92222,.92168,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.98621,.95381,.86036,.97096,.71743,.98981,1,1,.95298,.79726,.95381,1,1,.79726,.6894,.79726,.74321,.81691,1.0006,.92222,.92168,1,1,.92222,.92168,.79464,.92098,.92168,.90637,.91513,.90637,.91513,.90637,.91513,.909,.87514,.80729,.95077,1,1,.80729,.95077,.76463,.748,.76463,.748,1,1,.76463,.748,1,1,.86275,.72651,.86275,1.04502,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.90699,.91677,.9154,.94236,.85458,.89364,.85458,.90531,.9,.90531,.9,.90531,.9,1,.97276,.85576,.99613,.845,.85811,.90251,.91677,1,1,.86275,1.04502,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.18616,1.00899,1.30628,.85576,.80178,.66862,.7927,.69323,.88127,.72459,.89711,.95381,.85576,.80591,.7805,.94729,.77512,.90531,.92222,.90637,.98621,.81698,.92655,.98558,.92222,.85359,.90637,.90976,.83809,.94523,.86275,.83509,.93157,.85308,.83392,.92346,.98621,.83509,.92886,.91324,.92168,.95381,.90646,.92886,.90557,.86847,.90276,.91324,.86842,.92168,.99531,.95381,.9224,.85408,.92699,.86847,1.0051,.91513,.80487,.93481,1,.88159,1.05214,.90646,.97355,.81539,.89398,.85923,.95381,.90646,.91513,.90646,.85923,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9154,.94236,.9154,.94236,.9154,.94236,.85458,.89364,.96694,1,.89903,1,1,1,.91782,.91782,.91782,1,.896,.896,.896,.9332,.9332,.95973,1,1.26,1,1,.80479,.80178,1,1,.85633,1,1,1,1,.97276,1,1,1,.698,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.14542,1,.79199,.78694,1.02058,1.03493,1.05486,1,1,1.23026,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.20006,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProBoldItalicMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProItalicFactors=[1.36898,1,1,.65507,.84943,.85639,.88465,.88465,.86936,.88307,.86948,.85283,.85283,1.06383,1.02058,.75945,.9219,.75945,1.17337,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.88465,.75945,.75945,1.02058,1.02058,1.02058,.69046,.70926,.85158,.77812,.76852,.89591,.70466,.76125,.80094,.86822,.83864,.728,.77212,.79475,.93637,.87514,.8588,.76013,.8588,.72421,.69866,.77598,.85991,.80811,.87832,.78112,.77512,.8562,1.0222,1.18417,1.0222,1.27014,.89903,1.15012,.93859,.94399,.846,.94399,.81453,1.0186,.94219,.96017,1.03075,1.02175,.912,1.03075,.96998,.96017,.93859,.94399,.94399,.95493,.746,1.12658,.94578,.91,.979,.882,.882,.83,.85034,.83537,.85034,1.02058,.70869,.88465,.88465,.88465,.88465,.83537,.90083,1.15012,.9161,.94565,.73541,1.02058,.53609,.69353,.79519,1.08595,1,1,1.15012,1,.91974,.75945,1.15012,1,.9446,.73361,.9005,.9005,.9005,.62864,.85158,.85158,.85158,.85158,.85158,.85158,.773,.76852,.70466,.70466,.70466,.70466,.83864,.83864,.83864,.83864,.90561,.87514,.8588,.8588,.8588,.8588,.8588,1.02058,.85751,.85991,.85991,.85991,.85991,.77512,.76013,.88075,.93859,.93859,.93859,.93859,.93859,.93859,.8075,.846,.81453,.81453,.81453,.81453,.82424,.82424,.82424,.82424,.9278,.96017,.93859,.93859,.93859,.93859,.93859,1.08595,.8562,.94578,.94578,.94578,.94578,.882,.94578,.882,.85158,.93859,.85158,.93859,.85158,.93859,.76852,.846,.76852,.846,.76852,.846,.76852,.846,.89591,.8544,.90561,.94399,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.70466,.81453,.80094,.94219,.80094,.94219,.80094,.94219,1,1,.86822,.96017,.86822,.96017,.83864,.82424,.83864,.82424,.83864,.82424,.83864,1.03075,.83864,.82424,.81402,1.02738,.728,1.02175,1,1,.912,.79475,1.03075,1,1,.79475,.83911,.79475,.66266,.80553,1.06676,.87514,.96017,1,1,.87514,.96017,.86865,.87396,.96017,.8588,.93859,.8588,.93859,.8588,.93859,.867,.84759,.72421,.95493,1,1,.72421,.95493,.69866,.746,.69866,.746,1,1,.69866,.746,1,1,.77598,.88417,.77598,1.12658,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.85991,.94578,.87832,.979,.77512,.882,.77512,.8562,.83,.8562,.83,.8562,.83,1,.88465,.85158,.93859,.773,.8075,.85751,.8562,1,1,.77598,1.12658,1.15012,1.15012,1.15012,1.15012,1.15012,1.15313,1.15012,1.15012,1.15012,1.08106,1.03901,.85158,.77025,.62264,.7646,.65351,.86026,.69461,.89947,1.03075,.85158,.77812,.76449,.88836,.70466,.8562,.86822,.8588,.83864,.77212,.85308,.93637,.87514,.82352,.8588,.85701,.76013,.89058,.77598,.8156,.82565,.78112,.77899,.89386,.83864,.8156,.9486,.92388,.96186,1.03075,.91123,.9486,.93298,.878,.93942,.92388,.84596,.96186,.95119,1.03075,.922,.88787,.95829,.88,.93559,.93859,.78815,.93758,1,.89217,1.03737,.91123,.93969,.77487,.85769,.86799,1.03075,.91123,.93859,.91123,.86799,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87832,.979,.87832,.979,.87832,.979,.77512,.882,.9219,1,.89903,1,1,1,.87321,.87321,.87321,1,1.027,1.027,1.027,.86847,.86847,.79121,1,1.124,1,1,.73572,.73572,1,1,.85034,1,1,1,1,.88465,1,1,1,.669,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.04828,1,.74948,.75187,1.02058,.98391,1.02119,1,1,1.06233,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05233,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProItalicMetrics={lineHeight:1.2,lineGap:.2};t.MyriadProRegularFactors=[1.36898,1,1,.76305,.82784,.94935,.89364,.92241,.89073,.90706,.98472,.85283,.85283,1.0664,1.02058,.74505,.9219,.74505,1.23456,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.92241,.74505,.74505,1.02058,1.02058,1.02058,.73002,.72601,.91755,.8126,.80314,.92222,.73764,.79726,.83051,.90284,.86023,.74,.8126,.84869,.96518,.91115,.8858,.79761,.8858,.74498,.73914,.81363,.89591,.83659,.89633,.85608,.8111,.90531,1.0222,1.22736,1.0222,1.27014,.89903,.90088,.86667,1.0231,.896,1.01411,.90083,1.05099,1.00512,.99793,1.05326,1.09377,.938,1.06226,1.00119,.99793,.98714,1.0231,1.01231,.98196,.792,1.19137,.99074,.962,1.01915,.926,.942,.856,.85034,.92006,.85034,1.02058,.69067,.92241,.92241,.92241,.92241,.92006,.9332,.90088,.91882,.93484,.75339,1.02058,.56866,.54324,.79519,1.08595,1,1,.90088,1,.95325,.74505,.90088,1,.97198,.75339,.91009,.91009,.91009,.66466,.91755,.91755,.91755,.91755,.91755,.91755,.788,.80314,.73764,.73764,.73764,.73764,.86023,.86023,.86023,.86023,.92915,.91115,.8858,.8858,.8858,.8858,.8858,1.02058,.8858,.89591,.89591,.89591,.89591,.8111,.79611,.89713,.86667,.86667,.86667,.86667,.86667,.86667,.86936,.896,.90083,.90083,.90083,.90083,.84224,.84224,.84224,.84224,.97276,.99793,.98714,.98714,.98714,.98714,.98714,1.08595,.89876,.99074,.99074,.99074,.99074,.942,1.0231,.942,.91755,.86667,.91755,.86667,.91755,.86667,.80314,.896,.80314,.896,.80314,.896,.80314,.896,.92222,.93372,.92915,1.01411,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.73764,.90083,.83051,1.00512,.83051,1.00512,.83051,1.00512,1,1,.90284,.99793,.90976,.99793,.86023,.84224,.86023,.84224,.86023,.84224,.86023,1.05326,.86023,.84224,.82873,1.07469,.74,1.09377,1,1,.938,.84869,1.06226,1,1,.84869,.83704,.84869,.81441,.85588,1.08927,.91115,.99793,1,1,.91115,.99793,.91887,.90991,.99793,.8858,.98714,.8858,.98714,.8858,.98714,.894,.91434,.74498,.98196,1,1,.74498,.98196,.73914,.792,.73914,.792,1,1,.73914,.792,1,1,.81363,.904,.81363,1.19137,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89591,.99074,.89633,1.01915,.8111,.942,.8111,.90531,.856,.90531,.856,.90531,.856,1,.92241,.91755,.86667,.788,.86936,.8858,.89876,1,1,.81363,1.19137,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90088,.90388,1.03901,.92138,.78105,.7154,.86169,.80513,.94007,.82528,.98612,1.06226,.91755,.8126,.81884,.92819,.73764,.90531,.90284,.8858,.86023,.8126,.91172,.96518,.91115,.83089,.8858,.87791,.79761,.89297,.81363,.88157,.89992,.85608,.81992,.94307,.86023,.88157,.95308,.98699,.99793,1.06226,.95817,.95308,.97358,.928,.98088,.98699,.92761,.99793,.96017,1.06226,.986,.944,.95978,.938,.96705,.98714,.80442,.98972,1,.89762,1.04552,.95817,.99007,.87064,.91879,.88888,1.06226,.95817,.98714,.95817,.88888,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.89633,1.01915,.89633,1.01915,.89633,1.01915,.8111,.942,.9219,1,.89903,1,1,1,.93173,.93173,.93173,1,1.06304,1.06304,1.06904,.89903,.89903,.80549,1,1.156,1,1,.76575,.76575,1,1,.72458,1,1,1,1,.92241,1,1,1,.619,1,1.36145,1,1,1,1,1,1,1,1,1,1,1,1.07257,1,.74705,.71119,1.02058,1.024,1.02119,1,1,1.1536,1.08595,1.08595,1,1.08595,1.08595,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.05638,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.MyriadProRegularMetrics={lineHeight:1.2,lineGap:.2}},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SegoeuiRegularMetrics=t.SegoeuiRegularFactors=t.SegoeuiItalicMetrics=t.SegoeuiItalicFactors=t.SegoeuiBoldMetrics=t.SegoeuiBoldItalicMetrics=t.SegoeuiBoldItalicFactors=t.SegoeuiBoldFactors=void 0;t.SegoeuiBoldFactors=[1.76738,1,1,.99297,.9824,1.04016,1.06497,1.03424,.97529,1.17647,1.23203,1.1085,1.1085,1.16939,1.2107,.9754,1.21408,.9754,1.59578,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,1.03424,.81378,.81378,1.2107,1.2107,1.2107,.71703,.97847,.97363,.88776,.8641,1.02096,.79795,.85132,.914,1.06085,1.1406,.8007,.89858,.83693,1.14889,1.09398,.97489,.92094,.97489,.90399,.84041,.95923,1.00135,1,1.06467,.98243,.90996,.99361,1.1085,1.56942,1.1085,1.2107,.74627,.94282,.96752,1.01519,.86304,1.01359,.97278,1.15103,1.01359,.98561,1.02285,1.02285,1.00527,1.02285,1.0302,.99041,1.0008,1.01519,1.01359,1.02258,.79104,1.16862,.99041,.97454,1.02511,.99298,.96752,.95801,.94856,1.16579,.94856,1.2107,.9824,1.03424,1.03424,1,1.03424,1.16579,.8727,1.3871,1.18622,1.10818,1.04478,1.2107,1.18622,.75155,.94994,1.28826,1.21408,1.21408,.91056,1,.91572,.9754,.64663,1.18328,1.24866,1.04478,1.14169,1.15749,1.17389,.71703,.97363,.97363,.97363,.97363,.97363,.97363,.93506,.8641,.79795,.79795,.79795,.79795,1.1406,1.1406,1.1406,1.1406,1.02096,1.09398,.97426,.97426,.97426,.97426,.97426,1.2107,.97489,1.00135,1.00135,1.00135,1.00135,.90996,.92094,1.02798,.96752,.96752,.96752,.96752,.96752,.96752,.93136,.86304,.97278,.97278,.97278,.97278,1.02285,1.02285,1.02285,1.02285,.97122,.99041,1,1,1,1,1,1.28826,1.0008,.99041,.99041,.99041,.99041,.96752,1.01519,.96752,.97363,.96752,.97363,.96752,.97363,.96752,.8641,.86304,.8641,.86304,.8641,.86304,.8641,.86304,1.02096,1.03057,1.02096,1.03517,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.79795,.97278,.914,1.01359,.914,1.01359,.914,1.01359,1,1,1.06085,.98561,1.06085,1.00879,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,1.1406,1.02285,.97138,1.08692,.8007,1.02285,1,1,1.00527,.83693,1.02285,1,1,.83693,.9455,.83693,.90418,.83693,1.13005,1.09398,.99041,1,1,1.09398,.99041,.96692,1.09251,.99041,.97489,1.0008,.97489,1.0008,.97489,1.0008,.93994,.97931,.90399,1.02258,1,1,.90399,1.02258,.84041,.79104,.84041,.79104,.84041,.79104,.84041,.79104,1,1,.95923,1.07034,.95923,1.16862,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.00135,.99041,1.06467,1.02511,.90996,.96752,.90996,.99361,.95801,.99361,.95801,.99361,.95801,1.07733,1.03424,.97363,.96752,.93506,.93136,.97489,1.0008,1,1,.95923,1.16862,1.15103,1.15103,1.01173,1.03959,.75953,.81378,.79912,1.15103,1.21994,.95161,.87815,1.01149,.81525,.7676,.98167,1.01134,1.02546,.84097,1.03089,1.18102,.97363,.88776,.85134,.97826,.79795,.99361,1.06085,.97489,1.1406,.89858,1.0388,1.14889,1.09398,.86039,.97489,1.0595,.92094,.94793,.95923,.90996,.99346,.98243,1.02112,.95493,1.1406,.90996,1.03574,1.02597,1.0008,1.18102,1.06628,1.03574,1.0192,1.01932,1.00886,.97531,1.0106,1.0008,1.13189,1.18102,1.02277,.98683,1.0016,.99561,1.07237,1.0008,.90434,.99921,.93803,.8965,1.23085,1.06628,1.04983,.96268,1.0499,.98439,1.18102,1.06628,1.0008,1.06628,.98439,.79795,1,1,1,1,1,1,1,1,1,1,1,1,1.09466,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.97278,1,1,1,1,1,1,1,1,1,1,1,1,1.02065,1,1,1,1,1,1,1.06467,1.02511,1.06467,1.02511,1.06467,1.02511,.90996,.96752,1,1.21408,.89903,1,1,.75155,1.04394,1.04394,1.04394,1.04394,.98633,.98633,.98633,.73047,.73047,1.20642,.91211,1.25635,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.12454,.93503,1.03424,1.19687,1.03424,1,1,1,.771,1,1,1.15749,1.15749,1.15749,1.10948,.86279,.94434,.86279,.94434,.86182,1,1,1.16897,1,.96085,.90137,1.2107,1.18416,1.13973,.69825,.9716,2.10339,1.29004,1.29004,1.21172,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18874,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.09193,1.09193,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiBoldMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiBoldItalicFactors=[1.76738,1,1,.98946,1.03959,1.04016,1.02809,1.036,.97639,1.10953,1.23203,1.11144,1.11144,1.16939,1.21237,.9754,1.21261,.9754,1.59754,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,1.036,.81378,.81378,1.21237,1.21237,1.21237,.73541,.97847,.97363,.89723,.87897,1.0426,.79429,.85292,.91149,1.05815,1.1406,.79631,.90128,.83853,1.04396,1.10615,.97552,.94436,.97552,.88641,.80527,.96083,1.00135,1,1.06777,.9817,.91142,.99361,1.11144,1.57293,1.11144,1.21237,.74627,1.31818,1.06585,.97042,.83055,.97042,.93503,1.1261,.97042,.97922,1.14236,.94552,1.01054,1.14236,1.02471,.97922,.94165,.97042,.97042,1.0276,.78929,1.1261,.97922,.95874,1.02197,.98507,.96752,.97168,.95107,1.16579,.95107,1.21237,1.03959,1.036,1.036,1,1.036,1.16579,.87357,1.31818,1.18754,1.26781,1.05356,1.21237,1.18622,.79487,.94994,1.29004,1.24047,1.24047,1.31818,1,.91484,.9754,1.31818,1.1349,1.24866,1.05356,1.13934,1.15574,1.17389,.73541,.97363,.97363,.97363,.97363,.97363,.97363,.94385,.87897,.79429,.79429,.79429,.79429,1.1406,1.1406,1.1406,1.1406,1.0426,1.10615,.97552,.97552,.97552,.97552,.97552,1.21237,.97552,1.00135,1.00135,1.00135,1.00135,.91142,.94436,.98721,1.06585,1.06585,1.06585,1.06585,1.06585,1.06585,.96705,.83055,.93503,.93503,.93503,.93503,1.14236,1.14236,1.14236,1.14236,.93125,.97922,.94165,.94165,.94165,.94165,.94165,1.29004,.94165,.97922,.97922,.97922,.97922,.96752,.97042,.96752,.97363,1.06585,.97363,1.06585,.97363,1.06585,.87897,.83055,.87897,.83055,.87897,.83055,.87897,.83055,1.0426,1.0033,1.0426,.97042,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.79429,.93503,.91149,.97042,.91149,.97042,.91149,.97042,1,1,1.05815,.97922,1.05815,.97922,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,1.1406,1.14236,.97441,1.04302,.79631,1.01582,1,1,1.01054,.83853,1.14236,1,1,.83853,1.09125,.83853,.90418,.83853,1.19508,1.10615,.97922,1,1,1.10615,.97922,1.01034,1.10466,.97922,.97552,.94165,.97552,.94165,.97552,.94165,.91602,.91981,.88641,1.0276,1,1,.88641,1.0276,.80527,.78929,.80527,.78929,.80527,.78929,.80527,.78929,1,1,.96083,1.05403,.95923,1.16862,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.00135,.97922,1.06777,1.02197,.91142,.96752,.91142,.99361,.97168,.99361,.97168,.99361,.97168,1.23199,1.036,.97363,1.06585,.94385,.96705,.97552,.94165,1,1,.96083,1.1261,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,1.31818,.95161,1.27126,1.00811,.83284,.77702,.99137,.95253,1.0347,.86142,1.07205,1.14236,.97363,.89723,.86869,1.09818,.79429,.99361,1.05815,.97552,1.1406,.90128,1.06662,1.04396,1.10615,.84918,.97552,1.04694,.94436,.98015,.96083,.91142,1.00356,.9817,1.01945,.98999,1.1406,.91142,1.04961,.9898,1.00639,1.14236,1.07514,1.04961,.99607,1.02897,1.008,.9898,.95134,1.00639,1.11121,1.14236,1.00518,.97981,1.02186,1,1.08578,.94165,.99314,.98387,.93028,.93377,1.35125,1.07514,1.10687,.93491,1.04232,1.00351,1.14236,1.07514,.94165,1.07514,1.00351,.79429,1,1,1,1,1,1,1,1,1,1,1,1,1.09097,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.93503,1,1,1,1,1,1,1,1,1,1,1,1,.96609,1,1,1,1,1,1,1.06777,1.02197,1.06777,1.02197,1.06777,1.02197,.91142,.96752,1,1.21261,.89903,1,1,.75155,1.04745,1.04745,1.04745,1.04394,.98633,.98633,.98633,.72959,.72959,1.20502,.91406,1.26514,1.222,1.02956,1.03372,1.03372,.96039,1.24633,1,1.09125,.93327,1.03336,1.16541,1.036,1,1,1,.771,1,1,1.15574,1.15574,1.15574,1.15574,.86364,.94434,.86279,.94434,.86224,1,1,1.16798,1,.96085,.90068,1.21237,1.18416,1.13904,.69825,.9716,2.10339,1.29004,1.29004,1.21339,1.29004,1.29004,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18775,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.13269,1.13269,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiBoldItalicMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiItalicFactors=[1.76738,1,1,.98946,1.14763,1.05365,1.06234,.96927,.92586,1.15373,1.18414,.91349,.91349,1.07403,1.17308,.78383,1.20088,.78383,1.42531,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78383,.78383,1.17308,1.17308,1.17308,.77349,.94565,.94729,.85944,.88506,.9858,.74817,.80016,.88449,.98039,.95782,.69238,.89898,.83231,.98183,1.03989,.96924,.86237,.96924,.80595,.74524,.86091,.95402,.94143,.98448,.8858,.83089,.93285,1.0949,1.39016,1.0949,1.45994,.74627,1.04839,.97454,.97454,.87207,.97454,.87533,1.06151,.97454,1.00176,1.16484,1.08132,.98047,1.16484,1.02989,1.01054,.96225,.97454,.97454,1.06598,.79004,1.16344,1.00351,.94629,.9973,.91016,.96777,.9043,.91082,.92481,.91082,1.17308,.95748,.96927,.96927,1,.96927,.92481,.80597,1.04839,1.23393,1.1781,.9245,1.17308,1.20808,.63218,.94261,1.24822,1.09971,1.09971,1.04839,1,.85273,.78032,1.04839,1.09971,1.22326,.9245,1.09836,1.13525,1.15222,.70424,.94729,.94729,.94729,.94729,.94729,.94729,.85498,.88506,.74817,.74817,.74817,.74817,.95782,.95782,.95782,.95782,.9858,1.03989,.96924,.96924,.96924,.96924,.96924,1.17308,.96924,.95402,.95402,.95402,.95402,.83089,.86237,.88409,.97454,.97454,.97454,.97454,.97454,.97454,.92916,.87207,.87533,.87533,.87533,.87533,.93146,.93146,.93146,.93146,.93854,1.01054,.96225,.96225,.96225,.96225,.96225,1.24822,.8761,1.00351,1.00351,1.00351,1.00351,.96777,.97454,.96777,.94729,.97454,.94729,.97454,.94729,.97454,.88506,.87207,.88506,.87207,.88506,.87207,.88506,.87207,.9858,.95391,.9858,.97454,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.74817,.87533,.88449,.97454,.88449,.97454,.88449,.97454,1,1,.98039,1.00176,.98039,1.00176,.95782,.93146,.95782,.93146,.95782,.93146,.95782,1.16484,.95782,.93146,.84421,1.12761,.69238,1.08132,1,1,.98047,.83231,1.16484,1,1,.84723,1.04861,.84723,.78755,.83231,1.23736,1.03989,1.01054,1,1,1.03989,1.01054,.9857,1.03849,1.01054,.96924,.96225,.96924,.96225,.96924,.96225,.92383,.90171,.80595,1.06598,1,1,.80595,1.06598,.74524,.79004,.74524,.79004,.74524,.79004,.74524,.79004,1,1,.86091,1.02759,.85771,1.16344,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.95402,1.00351,.98448,.9973,.83089,.96777,.83089,.93285,.9043,.93285,.9043,.93285,.9043,1.31868,.96927,.94729,.97454,.85498,.92916,.96924,.8761,1,1,.86091,1.16344,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,1.04839,.81965,.81965,.94729,.78032,.71022,.90883,.84171,.99877,.77596,1.05734,1.2,.94729,.85944,.82791,.9607,.74817,.93285,.98039,.96924,.95782,.89898,.98316,.98183,1.03989,.78614,.96924,.97642,.86237,.86075,.86091,.83089,.90082,.8858,.97296,1.01284,.95782,.83089,1.0976,1.04,1.03342,1.2,1.0675,1.0976,.98205,1.03809,1.05097,1.04,.95364,1.03342,1.05401,1.2,1.02148,1.0119,1.04724,1.0127,1.02732,.96225,.8965,.97783,.93574,.94818,1.30679,1.0675,1.11826,.99821,1.0557,1.0326,1.2,1.0675,.96225,1.0675,1.0326,.74817,1,1,1,1,1,1,1,1,1,1,1,1,1.03754,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.87533,1,1,1,1,1,1,1,1,1,1,1,1,.98705,1,1,1,1,1,1,.98448,.9973,.98448,.9973,.98448,.9973,.83089,.96777,1,1.20088,.89903,1,1,.75155,.94945,.94945,.94945,.94945,1.12317,1.12317,1.12317,.67603,.67603,1.15621,.73584,1.21191,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87709,.96927,1.01473,.96927,1,1,1,.77295,1,1,1.09836,1.09836,1.09836,1.01522,.86321,.94434,.8649,.94434,.86182,1,1,1.083,1,.91578,.86438,1.17308,1.18416,1.14589,.69825,.97622,1.96791,1.24822,1.24822,1.17308,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.17984,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10742,1.10742,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiItalicMetrics={lineHeight:1.33008,lineGap:0};t.SegoeuiRegularFactors=[1.76738,1,1,.98594,1.02285,1.10454,1.06234,.96927,.92037,1.19985,1.2046,.90616,.90616,1.07152,1.1714,.78032,1.20088,.78032,1.40246,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.96927,.78032,.78032,1.1714,1.1714,1.1714,.80597,.94084,.96706,.85944,.85734,.97093,.75842,.79936,.88198,.9831,.95782,.71387,.86969,.84636,1.07796,1.03584,.96924,.83968,.96924,.82826,.79649,.85771,.95132,.93119,.98965,.88433,.8287,.93365,1.08612,1.3638,1.08612,1.45786,.74627,.80499,.91484,1.05707,.92383,1.05882,.9403,1.12654,1.05882,1.01756,1.09011,1.09011,.99414,1.09011,1.034,1.01756,1.05356,1.05707,1.05882,1.04399,.84863,1.21968,1.01756,.95801,1.00068,.91797,.96777,.9043,.90351,.92105,.90351,1.1714,.85337,.96927,.96927,.99912,.96927,.92105,.80597,1.2434,1.20808,1.05937,.90957,1.1714,1.20808,.75155,.94261,1.24644,1.09971,1.09971,.84751,1,.85273,.78032,.61584,1.05425,1.17914,.90957,1.08665,1.11593,1.14169,.73381,.96706,.96706,.96706,.96706,.96706,.96706,.86035,.85734,.75842,.75842,.75842,.75842,.95782,.95782,.95782,.95782,.97093,1.03584,.96924,.96924,.96924,.96924,.96924,1.1714,.96924,.95132,.95132,.95132,.95132,.8287,.83968,.89049,.91484,.91484,.91484,.91484,.91484,.91484,.93575,.92383,.9403,.9403,.9403,.9403,.8717,.8717,.8717,.8717,1.00527,1.01756,1.05356,1.05356,1.05356,1.05356,1.05356,1.24644,.95923,1.01756,1.01756,1.01756,1.01756,.96777,1.05707,.96777,.96706,.91484,.96706,.91484,.96706,.91484,.85734,.92383,.85734,.92383,.85734,.92383,.85734,.92383,.97093,1.0969,.97093,1.05882,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.75842,.9403,.88198,1.05882,.88198,1.05882,.88198,1.05882,1,1,.9831,1.01756,.9831,1.01756,.95782,.8717,.95782,.8717,.95782,.8717,.95782,1.09011,.95782,.8717,.84784,1.11551,.71387,1.09011,1,1,.99414,.84636,1.09011,1,1,.84636,1.0536,.84636,.94298,.84636,1.23297,1.03584,1.01756,1,1,1.03584,1.01756,1.00323,1.03444,1.01756,.96924,1.05356,.96924,1.05356,.96924,1.05356,.93066,.98293,.82826,1.04399,1,1,.82826,1.04399,.79649,.84863,.79649,.84863,.79649,.84863,.79649,.84863,1,1,.85771,1.17318,.85771,1.21968,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.95132,1.01756,.98965,1.00068,.8287,.96777,.8287,.93365,.9043,.93365,.9043,.93365,.9043,1.08571,.96927,.96706,.91484,.86035,.93575,.96924,.95923,1,1,.85771,1.21968,1.11437,1.11437,.93109,.91202,.60411,.84164,.55572,1.01173,.97361,.81818,.81818,.96635,.78032,.72727,.92366,.98601,1.03405,.77968,1.09799,1.2,.96706,.85944,.85638,.96491,.75842,.93365,.9831,.96924,.95782,.86969,.94152,1.07796,1.03584,.78437,.96924,.98715,.83968,.83491,.85771,.8287,.94492,.88433,.9287,1.0098,.95782,.8287,1.0625,.98248,1.03424,1.2,1.01071,1.0625,.95246,1.03809,1.04912,.98248,1.00221,1.03424,1.05443,1.2,1.04785,.99609,1.00169,1.05176,.99346,1.05356,.9087,1.03004,.95542,.93117,1.23362,1.01071,1.07831,1.02512,1.05205,1.03502,1.2,1.01071,1.05356,1.01071,1.03502,.75842,1,1,1,1,1,1,1,1,1,1,1,1,1.03719,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,.9403,1,1,1,1,1,1,1,1,1,1,1,1,1.04021,1,1,1,1,1,1,.98965,1.00068,.98965,1.00068,.98965,1.00068,.8287,.96777,1,1.20088,.89903,1,1,.75155,1.03077,1.03077,1.03077,1.03077,1.13196,1.13196,1.13196,.67428,.67428,1.16039,.73291,1.20996,1.22135,1.06483,.94868,.94868,.95996,1.24633,1,1.07497,.87796,.96927,1.01518,.96927,1,1,1,.77295,1,1,1.10539,1.10539,1.11358,1.06967,.86279,.94434,.86279,.94434,.86182,1,1,1.083,1,.91578,.86507,1.1714,1.18416,1.14589,.69825,.97622,1.9697,1.24822,1.24822,1.17238,1.24822,1.24822,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.42603,1,.99862,.99862,1,.87025,.87025,.87025,.87025,1.18083,1.42603,1,1.42603,1.42603,.99862,1,1,1,1,1,1.2886,1.04315,1.15296,1.34163,1,1,1,1.10938,1.10938,1,1,1,1.05425,1.09971,1.09971,1.09971,1,1,1,1,1,1,1,1,1,1,1];t.SegoeuiRegularMetrics={lineHeight:1.33008,lineGap:0}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PostScriptEvaluator=t.PostScriptCompiler=t.PDFFunctionFactory=void 0;t.isPDFFunction=function isPDFFunction(e){let t;if("object"!=typeof e)return!1;if(e instanceof a.Dict)t=e;else{if(!(e instanceof s.BaseStream))return!1;t=e.dict}return t.has("FunctionType")};var a=r(133),n=r(2),i=r(186),s=r(135),o=r(187);t.PDFFunctionFactory=class PDFFunctionFactory{constructor(e){let{xref:t,isEvalSupported:r=!0}=e;this.xref=t;this.isEvalSupported=!1!==r}create(e){const t=this.getCached(e);if(t)return t;const r=PDFFunction.parse({xref:this.xref,isEvalSupported:this.isEvalSupported,fn:e instanceof a.Ref?this.xref.fetch(e):e});this._cache(e,r);return r}createFromArray(e){const t=this.getCached(e);if(t)return t;const r=PDFFunction.parseArray({xref:this.xref,isEvalSupported:this.isEvalSupported,fnObj:e instanceof a.Ref?this.xref.fetch(e):e});this._cache(e,r);return r}getCached(e){let t;e instanceof a.Ref?t=e:e instanceof a.Dict?t=e.objId:e instanceof s.BaseStream&&(t=e.dict&&e.dict.objId);if(t){const e=this._localFunctionCache.getByRef(t);if(e)return e}return null}_cache(e,t){if(!t)throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.');let r;e instanceof a.Ref?r=e:e instanceof a.Dict?r=e.objId:e instanceof s.BaseStream&&(r=e.dict&&e.dict.objId);r&&this._localFunctionCache.set(null,r,t)}get _localFunctionCache(){return(0,n.shadow)(this,"_localFunctionCache",new o.LocalFunctionCache)}};function toNumberArray(e){if(!Array.isArray(e))return null;const t=e.length;for(let r=0;r<t;r++)if("number"!=typeof e[r]){const r=new Array(t);for(let a=0;a<t;a++)r[a]=+e[a];return r}return e}class PDFFunction{static getSampleArray(e,t,r,a){let n,i,s=1;for(n=0,i=e.length;n<i;n++)s*=e[n];s*=t;const o=new Array(s);let c=0,l=0;const h=1/(2**r-1),u=a.getBytes((s*r+7)/8);let d=0;for(n=0;n<s;n++){for(;c<r;){l<<=8;l|=u[d++];c+=8}c-=r;o[n]=(l>>c)*h;l&=(1<<c)-1}return o}static parse(e){let{xref:t,isEvalSupported:r,fn:a}=e;const i=a.dict||a;switch(i.get("FunctionType")){case 0:return this.constructSampled({xref:t,isEvalSupported:r,fn:a,dict:i});case 1:break;case 2:return this.constructInterpolated({xref:t,isEvalSupported:r,dict:i});case 3:return this.constructStiched({xref:t,isEvalSupported:r,dict:i});case 4:return this.constructPostScript({xref:t,isEvalSupported:r,fn:a,dict:i})}throw new n.FormatError("Unknown type of function")}static parseArray(e){let{xref:t,isEvalSupported:r,fnObj:a}=e;if(!Array.isArray(a))return this.parse({xref:t,isEvalSupported:r,fn:a});const n=[];for(let e=0,i=a.length;e<i;e++)n.push(this.parse({xref:t,isEvalSupported:r,fn:t.fetchIfRef(a[e])}));return function(e,t,r,a){for(let i=0,s=n.length;i<s;i++)n[i](e,t,r,a+i)}}static constructSampled(e){let{xref:t,isEvalSupported:r,fn:a,dict:i}=e;function toMultiArray(e){const t=e.length,r=[];let a=0;for(let n=0;n<t;n+=2)r[a++]=[e[n],e[n+1]];return r}function interpolate(e,t,r,a,n){return a+(n-a)/(r-t)*(e-t)}let s=toNumberArray(i.getArray("Domain")),o=toNumberArray(i.getArray("Range"));if(!s||!o)throw new n.FormatError("No domain or range");const c=s.length/2,l=o.length/2;s=toMultiArray(s);o=toMultiArray(o);const h=toNumberArray(i.getArray("Size")),u=i.get("BitsPerSample"),d=i.get("Order")||1;1!==d&&(0,n.info)("No support for cubic spline interpolation: "+d);let f=toNumberArray(i.getArray("Encode"));if(f)f=toMultiArray(f);else{f=[];for(let e=0;e<c;++e)f.push([0,h[e]-1])}let g=toNumberArray(i.getArray("Decode"));g=g?toMultiArray(g):o;const p=this.getSampleArray(h,l,u,a);return function constructSampledFn(e,t,r,a){const n=1<<c,i=new Float64Array(n),u=new Uint32Array(n);let d,m;for(m=0;m<n;m++)i[m]=1;let b=l,y=1;for(d=0;d<c;++d){const r=s[d][0],a=s[d][1];let o=interpolate(Math.min(Math.max(e[t+d],r),a),r,a,f[d][0],f[d][1]);const c=h[d];o=Math.min(Math.max(o,0),c-1);const l=o<c-1?Math.floor(o):o-1,g=l+1-o,p=o-l,w=l*b,S=w+b;for(m=0;m<n;m++)if(m&y){i[m]*=p;u[m]+=S}else{i[m]*=g;u[m]+=w}b*=c;y<<=1}for(m=0;m<l;++m){let e=0;for(d=0;d<n;d++)e+=p[u[d]+m]*i[d];e=interpolate(e,0,1,g[m][0],g[m][1]);r[a+m]=Math.min(Math.max(e,o[m][0]),o[m][1])}}}static constructInterpolated(e){let{xref:t,isEvalSupported:r,dict:a}=e;const n=toNumberArray(a.getArray("C0"))||[0],i=toNumberArray(a.getArray("C1"))||[1],s=a.get("N"),o=[];for(let e=0,t=n.length;e<t;++e)o.push(i[e]-n[e]);const c=o.length;return function constructInterpolatedFn(e,t,r,a){const i=1===s?e[t]:e[t]**s;for(let e=0;e<c;++e)r[a+e]=n[e]+i*o[e]}}static constructStiched(e){let{xref:t,isEvalSupported:r,dict:a}=e;const i=toNumberArray(a.getArray("Domain"));if(!i)throw new n.FormatError("No domain");if(1!==i.length/2)throw new n.FormatError("Bad domain for stiched function");const s=a.get("Functions"),o=[];for(let e=0,a=s.length;e<a;++e)o.push(this.parse({xref:t,isEvalSupported:r,fn:t.fetchIfRef(s[e])}));const c=toNumberArray(a.getArray("Bounds")),l=toNumberArray(a.getArray("Encode")),h=new Float32Array(1);return function constructStichedFn(e,t,r,a){const n=function constructStichedFromIRClip(e,t,r){e>r?e=r:e<t&&(e=t);return e}(e[t],i[0],i[1]),s=c.length;let u;for(u=0;u<s&&!(n<c[u]);++u);let d=i[0];u>0&&(d=c[u-1]);let f=i[1];u<c.length&&(f=c[u]);const g=l[2*u],p=l[2*u+1];h[0]=d===f?g:g+(n-d)*(p-g)/(f-d);o[u](h,0,r,a)}}static constructPostScript(e){let{xref:t,isEvalSupported:r,fn:a,dict:s}=e;const o=toNumberArray(s.getArray("Domain")),c=toNumberArray(s.getArray("Range"));if(!o)throw new n.FormatError("No domain.");if(!c)throw new n.FormatError("No range.");const l=new i.PostScriptLexer(a),h=new i.PostScriptParser(l).parse();if(r&&n.FeatureTest.isEvalSupported){const e=(new PostScriptCompiler).compile(h,o,c);if(e)return new Function("src","srcOffset","dest","destOffset",e)}(0,n.info)("Unable to compile PS function");const u=c.length>>1,d=o.length>>1,f=new PostScriptEvaluator(h),g=Object.create(null);let p=8192;const m=new Float32Array(d);return function constructPostScriptFn(e,t,r,a){let n,i,s="";const o=m;for(n=0;n<d;n++){i=e[t+n];o[n]=i;s+=i+"_"}const l=g[s];if(void 0!==l){r.set(l,a);return}const h=new Float32Array(u),b=f.execute(o),y=b.length-u;for(n=0;n<u;n++){i=b[y+n];let e=c[2*n];if(i<e)i=e;else{e=c[2*n+1];i>e&&(i=e)}h[n]=i}if(p>0){p--;g[s]=h}r.set(h,a)}}}class PostScriptStack{static get MAX_STACK_SIZE(){return(0,n.shadow)(this,"MAX_STACK_SIZE",100)}constructor(e){this.stack=e?Array.from(e):[]}push(e){if(this.stack.length>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");this.stack.push(e)}pop(){if(this.stack.length<=0)throw new Error("PostScript function stack underflow.");return this.stack.pop()}copy(e){if(this.stack.length+e>=PostScriptStack.MAX_STACK_SIZE)throw new Error("PostScript function stack overflow.");const t=this.stack;for(let r=t.length-e,a=e-1;a>=0;a--,r++)t.push(t[r])}index(e){this.push(this.stack[this.stack.length-e-1])}roll(e,t){const r=this.stack,a=r.length-e,n=r.length-1,i=a+(t-Math.floor(t/e)*e);for(let e=a,t=n;e<t;e++,t--){const a=r[e];r[e]=r[t];r[t]=a}for(let e=a,t=i-1;e<t;e++,t--){const a=r[e];r[e]=r[t];r[t]=a}for(let e=i,t=n;e<t;e++,t--){const a=r[e];r[e]=r[t];r[t]=a}}}class PostScriptEvaluator{constructor(e){this.operators=e}execute(e){const t=new PostScriptStack(e);let r=0;const a=this.operators,i=a.length;let s,o,c;for(;r<i;){s=a[r++];if("number"!=typeof s)switch(s){case"jz":c=t.pop();o=t.pop();o||(r=c);break;case"j":o=t.pop();r=o;break;case"abs":o=t.pop();t.push(Math.abs(o));break;case"add":c=t.pop();o=t.pop();t.push(o+c);break;case"and":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o&&c):t.push(o&c);break;case"atan":o=t.pop();t.push(Math.atan(o));break;case"bitshift":c=t.pop();o=t.pop();o>0?t.push(o<<c):t.push(o>>c);break;case"ceiling":o=t.pop();t.push(Math.ceil(o));break;case"copy":o=t.pop();t.copy(o);break;case"cos":o=t.pop();t.push(Math.cos(o));break;case"cvi":o=0|t.pop();t.push(o);break;case"cvr":break;case"div":c=t.pop();o=t.pop();t.push(o/c);break;case"dup":t.copy(1);break;case"eq":c=t.pop();o=t.pop();t.push(o===c);break;case"exch":t.roll(2,1);break;case"exp":c=t.pop();o=t.pop();t.push(o**c);break;case"false":t.push(!1);break;case"floor":o=t.pop();t.push(Math.floor(o));break;case"ge":c=t.pop();o=t.pop();t.push(o>=c);break;case"gt":c=t.pop();o=t.pop();t.push(o>c);break;case"idiv":c=t.pop();o=t.pop();t.push(o/c|0);break;case"index":o=t.pop();t.index(o);break;case"le":c=t.pop();o=t.pop();t.push(o<=c);break;case"ln":o=t.pop();t.push(Math.log(o));break;case"log":o=t.pop();t.push(Math.log(o)/Math.LN10);break;case"lt":c=t.pop();o=t.pop();t.push(o<c);break;case"mod":c=t.pop();o=t.pop();t.push(o%c);break;case"mul":c=t.pop();o=t.pop();t.push(o*c);break;case"ne":c=t.pop();o=t.pop();t.push(o!==c);break;case"neg":o=t.pop();t.push(-o);break;case"not":o=t.pop();"boolean"==typeof o?t.push(!o):t.push(~o);break;case"or":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o||c):t.push(o|c);break;case"pop":t.pop();break;case"roll":c=t.pop();o=t.pop();t.roll(o,c);break;case"round":o=t.pop();t.push(Math.round(o));break;case"sin":o=t.pop();t.push(Math.sin(o));break;case"sqrt":o=t.pop();t.push(Math.sqrt(o));break;case"sub":c=t.pop();o=t.pop();t.push(o-c);break;case"true":t.push(!0);break;case"truncate":o=t.pop();o=o<0?Math.ceil(o):Math.floor(o);t.push(o);break;case"xor":c=t.pop();o=t.pop();"boolean"==typeof o&&"boolean"==typeof c?t.push(o!==c):t.push(o^c);break;default:throw new n.FormatError(`Unknown operator ${s}`)}else t.push(s)}return t.stack}}t.PostScriptEvaluator=PostScriptEvaluator;class AstNode{constructor(e){this.type=e}visit(e){(0,n.unreachable)("abstract method")}}class AstArgument extends AstNode{constructor(e,t,r){super("args");this.index=e;this.min=t;this.max=r}visit(e){e.visitArgument(this)}}class AstLiteral extends AstNode{constructor(e){super("literal");this.number=e;this.min=e;this.max=e}visit(e){e.visitLiteral(this)}}class AstBinaryOperation extends AstNode{constructor(e,t,r,a,n){super("binary");this.op=e;this.arg1=t;this.arg2=r;this.min=a;this.max=n}visit(e){e.visitBinaryOperation(this)}}class AstMin extends AstNode{constructor(e,t){super("max");this.arg=e;this.min=e.min;this.max=t}visit(e){e.visitMin(this)}}class AstVariable extends AstNode{constructor(e,t,r){super("var");this.index=e;this.min=t;this.max=r}visit(e){e.visitVariable(this)}}class AstVariableDefinition extends AstNode{constructor(e,t){super("definition");this.variable=e;this.arg=t}visit(e){e.visitVariableDefinition(this)}}class ExpressionBuilderVisitor{constructor(){this.parts=[]}visitArgument(e){this.parts.push("Math.max(",e.min,", Math.min(",e.max,", src[srcOffset + ",e.index,"]))")}visitVariable(e){this.parts.push("v",e.index)}visitLiteral(e){this.parts.push(e.number)}visitBinaryOperation(e){this.parts.push("(");e.arg1.visit(this);this.parts.push(" ",e.op," ");e.arg2.visit(this);this.parts.push(")")}visitVariableDefinition(e){this.parts.push("var ");e.variable.visit(this);this.parts.push(" = ");e.arg.visit(this);this.parts.push(";")}visitMin(e){this.parts.push("Math.min(");e.arg.visit(this);this.parts.push(", ",e.max,")")}toString(){return this.parts.join("")}}function buildAddOperation(e,t){return"literal"===t.type&&0===t.number?e:"literal"===e.type&&0===e.number?t:"literal"===t.type&&"literal"===e.type?new AstLiteral(e.number+t.number):new AstBinaryOperation("+",e,t,e.min+t.min,e.max+t.max)}function buildMulOperation(e,t){if("literal"===t.type){if(0===t.number)return new AstLiteral(0);if(1===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number*t.number)}if("literal"===e.type){if(0===e.number)return new AstLiteral(0);if(1===e.number)return t}const r=Math.min(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max),a=Math.max(e.min*t.min,e.min*t.max,e.max*t.min,e.max*t.max);return new AstBinaryOperation("*",e,t,r,a)}function buildSubOperation(e,t){if("literal"===t.type){if(0===t.number)return e;if("literal"===e.type)return new AstLiteral(e.number-t.number)}return"binary"===t.type&&"-"===t.op&&"literal"===e.type&&1===e.number&&"literal"===t.arg1.type&&1===t.arg1.number?t.arg2:new AstBinaryOperation("-",e,t,e.min-t.max,e.max-t.min)}function buildMinOperation(e,t){return e.min>=t?new AstLiteral(t):e.max<=t?e:new AstMin(e,t)}class PostScriptCompiler{compile(e,t,r){const a=[],n=[],i=t.length>>1,s=r.length>>1;let o,c,l,h,u,d,f,g,p=0;for(let e=0;e<i;e++)a.push(new AstArgument(e,t[2*e],t[2*e+1]));for(let t=0,r=e.length;t<r;t++){g=e[t];if("number"!=typeof g)switch(g){case"add":if(a.length<2)return null;h=a.pop();l=a.pop();a.push(buildAddOperation(l,h));break;case"cvr":if(a.length<1)return null;break;case"mul":if(a.length<2)return null;h=a.pop();l=a.pop();a.push(buildMulOperation(l,h));break;case"sub":if(a.length<2)return null;h=a.pop();l=a.pop();a.push(buildSubOperation(l,h));break;case"exch":if(a.length<2)return null;u=a.pop();d=a.pop();a.push(u,d);break;case"pop":if(a.length<1)return null;a.pop();break;case"index":if(a.length<1)return null;l=a.pop();if("literal"!==l.type)return null;o=l.number;if(o<0||!Number.isInteger(o)||a.length<o)return null;u=a[a.length-o-1];if("literal"===u.type||"var"===u.type){a.push(u);break}f=new AstVariable(p++,u.min,u.max);a[a.length-o-1]=f;a.push(f);n.push(new AstVariableDefinition(f,u));break;case"dup":if(a.length<1)return null;if("number"==typeof e[t+1]&&"gt"===e[t+2]&&e[t+3]===t+7&&"jz"===e[t+4]&&"pop"===e[t+5]&&e[t+6]===e[t+1]){l=a.pop();a.push(buildMinOperation(l,e[t+1]));t+=6;break}u=a.at(-1);if("literal"===u.type||"var"===u.type){a.push(u);break}f=new AstVariable(p++,u.min,u.max);a[a.length-1]=f;a.push(f);n.push(new AstVariableDefinition(f,u));break;case"roll":if(a.length<2)return null;h=a.pop();l=a.pop();if("literal"!==h.type||"literal"!==l.type)return null;c=h.number;o=l.number;if(o<=0||!Number.isInteger(o)||!Number.isInteger(c)||a.length<o)return null;c=(c%o+o)%o;if(0===c)break;a.push(...a.splice(a.length-o,o-c));break;default:return null}else a.push(new AstLiteral(g))}if(a.length!==s)return null;const m=[];for(const e of n){const t=new ExpressionBuilderVisitor;e.visit(t);m.push(t.toString())}for(let e=0,t=a.length;e<t;e++){const t=a[e],n=new ExpressionBuilderVisitor;t.visit(n);const i=r[2*e],s=r[2*e+1],o=[n.toString()];if(i>t.min){o.unshift("Math.max(",i,", ");o.push(")")}if(s<t.max){o.unshift("Math.min(",s,", ");o.push(")")}o.unshift("dest[destOffset + ",e,"] = ");o.push(";");m.push(o.join(""))}return m.join("\n")}}t.PostScriptCompiler=PostScriptCompiler},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PostScriptParser=t.PostScriptLexer=void 0;var a=r(2),n=r(133),i=r(134);t.PostScriptParser=class PostScriptParser{constructor(e){this.lexer=e;this.operators=[];this.token=null;this.prev=null}nextToken(){this.prev=this.token;this.token=this.lexer.getToken()}accept(e){if(this.token.type===e){this.nextToken();return!0}return!1}expect(e){if(this.accept(e))return!0;throw new a.FormatError(`Unexpected symbol: found ${this.token.type} expected ${e}.`)}parse(){this.nextToken();this.expect(s.LBRACE);this.parseBlock();this.expect(s.RBRACE);return this.operators}parseBlock(){for(;;)if(this.accept(s.NUMBER))this.operators.push(this.prev.value);else if(this.accept(s.OPERATOR))this.operators.push(this.prev.value);else{if(!this.accept(s.LBRACE))return;this.parseCondition()}}parseCondition(){const e=this.operators.length;this.operators.push(null,null);this.parseBlock();this.expect(s.RBRACE);if(this.accept(s.IF)){this.operators[e]=this.operators.length;this.operators[e+1]="jz"}else{if(!this.accept(s.LBRACE))throw new a.FormatError("PS Function: error parsing conditional.");{const t=this.operators.length;this.operators.push(null,null);const r=this.operators.length;this.parseBlock();this.expect(s.RBRACE);this.expect(s.IFELSE);this.operators[t]=this.operators.length;this.operators[t+1]="j";this.operators[e]=r;this.operators[e+1]="jz"}}}};const s={LBRACE:0,RBRACE:1,NUMBER:2,OPERATOR:3,IF:4,IFELSE:5};class PostScriptToken{static get opCache(){return(0,a.shadow)(this,"opCache",Object.create(null))}constructor(e,t){this.type=e;this.value=t}static getOperator(e){const t=PostScriptToken.opCache[e];return t||(PostScriptToken.opCache[e]=new PostScriptToken(s.OPERATOR,e))}static get LBRACE(){return(0,a.shadow)(this,"LBRACE",new PostScriptToken(s.LBRACE,"{"))}static get RBRACE(){return(0,a.shadow)(this,"RBRACE",new PostScriptToken(s.RBRACE,"}"))}static get IF(){return(0,a.shadow)(this,"IF",new PostScriptToken(s.IF,"IF"))}static get IFELSE(){return(0,a.shadow)(this,"IFELSE",new PostScriptToken(s.IFELSE,"IFELSE"))}}t.PostScriptLexer=class PostScriptLexer{constructor(e){this.stream=e;this.nextChar();this.strBuf=[]}nextChar(){return this.currentChar=this.stream.getByte()}getToken(){let e=!1,t=this.currentChar;for(;;){if(t<0)return n.EOF;if(e)10!==t&&13!==t||(e=!1);else if(37===t)e=!0;else if(!(0,i.isWhiteSpace)(t))break;t=this.nextChar()}switch(0|t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 43:case 45:case 46:return new PostScriptToken(s.NUMBER,this.getNumber());case 123:this.nextChar();return PostScriptToken.LBRACE;case 125:this.nextChar();return PostScriptToken.RBRACE}const r=this.strBuf;r.length=0;r[0]=String.fromCharCode(t);for(;(t=this.nextChar())>=0&&(t>=65&&t<=90||t>=97&&t<=122);)r.push(String.fromCharCode(t));const a=r.join("");switch(a.toLowerCase()){case"if":return PostScriptToken.IF;case"ifelse":return PostScriptToken.IFELSE;default:return PostScriptToken.getOperator(a)}}getNumber(){let e=this.currentChar;const t=this.strBuf;t.length=0;t[0]=String.fromCharCode(e);for(;(e=this.nextChar())>=0&&(e>=48&&e<=57||45===e||46===e);)t.push(String.fromCharCode(e));const r=parseFloat(t.join(""));if(isNaN(r))throw new a.FormatError(`Invalid floating point number: ${r}`);return r}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LocalTilingPatternCache=t.LocalImageCache=t.LocalGStateCache=t.LocalFunctionCache=t.LocalColorSpaceCache=t.GlobalImageCache=void 0;var a=r(2),n=r(133);class BaseLocalCache{constructor(e){this.constructor===BaseLocalCache&&(0,a.unreachable)("Cannot initialize BaseLocalCache.");this._onlyRefs=!0===(e&&e.onlyRefs);if(!this._onlyRefs){this._nameRefMap=new Map;this._imageMap=new Map}this._imageCache=new n.RefSetCache}getByName(e){this._onlyRefs&&(0,a.unreachable)("Should not call `getByName` method.");const t=this._nameRefMap.get(e);return t?this.getByRef(t):this._imageMap.get(e)||null}getByRef(e){return this._imageCache.get(e)||null}set(e,t,r){(0,a.unreachable)("Abstract method `set` called.")}}t.LocalImageCache=class LocalImageCache extends BaseLocalCache{set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if("string"!=typeof e)throw new Error('LocalImageCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,r)}else this._imageMap.has(e)||this._imageMap.set(e,r)}};t.LocalColorSpaceCache=class LocalColorSpaceCache extends BaseLocalCache{set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if("string"!=typeof e&&!t)throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');if(t){if(this._imageCache.has(t))return;null!==e&&this._nameRefMap.set(e,t);this._imageCache.put(t,r)}else this._imageMap.has(e)||this._imageMap.set(e,r)}};t.LocalFunctionCache=class LocalFunctionCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(){let e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0;if(!e)throw new Error('LocalFunctionCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,t)}};t.LocalGStateCache=class LocalGStateCache extends BaseLocalCache{set(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2?arguments[2]:void 0;if("string"!=typeof e)throw new Error('LocalGStateCache.set - expected "name" argument.');if(t){if(this._imageCache.has(t))return;this._nameRefMap.set(e,t);this._imageCache.put(t,r)}else this._imageMap.has(e)||this._imageMap.set(e,r)}};t.LocalTilingPatternCache=class LocalTilingPatternCache extends BaseLocalCache{constructor(e){super({onlyRefs:!0})}set(){let e=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0;if(!e)throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');this._imageCache.has(e)||this._imageCache.put(e,t)}};class GlobalImageCache{static get NUM_PAGES_THRESHOLD(){return(0,a.shadow)(this,"NUM_PAGES_THRESHOLD",2)}static get MIN_IMAGES_TO_CACHE(){return(0,a.shadow)(this,"MIN_IMAGES_TO_CACHE",10)}static get MAX_BYTE_SIZE(){return(0,a.shadow)(this,"MAX_BYTE_SIZE",4e7)}constructor(){this._refCache=new n.RefSetCache;this._imageCache=new n.RefSetCache}get _byteSize(){let e=0;for(const t of this._imageCache)e+=t.byteSize;return e}get _cacheLimitReached(){return!(this._imageCache.size<GlobalImageCache.MIN_IMAGES_TO_CACHE)&&!(this._byteSize<GlobalImageCache.MAX_BYTE_SIZE)}shouldCache(e,t){const r=this._refCache.get(e);return!((r?r.size+(r.has(t)?0:1):1)<GlobalImageCache.NUM_PAGES_THRESHOLD)&&!(!this._imageCache.has(e)&&this._cacheLimitReached)}addPageIndex(e,t){let r=this._refCache.get(e);if(!r){r=new Set;this._refCache.put(e,r)}r.add(t)}addByteSize(e,t){const r=this._imageCache.get(e);r&&(r.byteSize||(r.byteSize=t))}getData(e,t){const r=this._refCache.get(e);if(!r)return null;if(r.size<GlobalImageCache.NUM_PAGES_THRESHOLD)return null;const a=this._imageCache.get(e);if(!a)return null;r.add(t);return a}setData(e,t){if(!this._refCache.has(e))throw new Error('GlobalImageCache.setData - expected "addPageIndex" to have been called.');this._imageCache.has(e)||(this._cacheLimitReached?(0,a.warn)("GlobalImageCache.setData - cache limit reached."):this._imageCache.put(e,t))}clear(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]||this._refCache.clear();this._imageCache.clear()}}t.GlobalImageCache=GlobalImageCache},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.bidi=function bidi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=!0;const l=e.length;if(0===l||r)return createBidiText(e,c,r);s.length=l;o.length=l;let h,u,d=0;for(h=0;h<l;++h){s[h]=e.charAt(h);const t=e.charCodeAt(h);let r="L";if(t<=255)r=n[t];else if(1424<=t&&t<=1524)r="R";else if(1536<=t&&t<=1791){r=i[255&t];r||(0,a.warn)("Bidi: invalid Unicode character "+t.toString(16))}else 1792<=t&&t<=2220&&(r="AL");"R"!==r&&"AL"!==r&&"AN"!==r||d++;o[h]=r}if(0===d){c=!0;return createBidiText(e,c)}if(-1===t)if(d/l<.3&&l>4){c=!0;t=0}else{c=!1;t=1}const f=[];for(h=0;h<l;++h)f[h]=t;const g=isOdd(t)?"R":"L",p=g,m=p;let b,y=p;for(h=0;h<l;++h)"NSM"===o[h]?o[h]=y:y=o[h];y=p;for(h=0;h<l;++h){b=o[h];"EN"===b?o[h]="AL"===y?"AN":"EN":"R"!==b&&"L"!==b&&"AL"!==b||(y=b)}for(h=0;h<l;++h){b=o[h];"AL"===b&&(o[h]="R")}for(h=1;h<l-1;++h){"ES"===o[h]&&"EN"===o[h-1]&&"EN"===o[h+1]&&(o[h]="EN");"CS"!==o[h]||"EN"!==o[h-1]&&"AN"!==o[h-1]||o[h+1]!==o[h-1]||(o[h]=o[h-1])}for(h=0;h<l;++h)if("EN"===o[h]){for(let e=h-1;e>=0&&"ET"===o[e];--e)o[e]="EN";for(let e=h+1;e<l&&"ET"===o[e];++e)o[e]="EN"}for(h=0;h<l;++h){b=o[h];"WS"!==b&&"ES"!==b&&"ET"!==b&&"CS"!==b||(o[h]="ON")}y=p;for(h=0;h<l;++h){b=o[h];"EN"===b?o[h]="L"===y?"L":"EN":"R"!==b&&"L"!==b||(y=b)}for(h=0;h<l;++h)if("ON"===o[h]){const e=findUnequal(o,h+1,"ON");let t=p;h>0&&(t=o[h-1]);let r=m;e+1<l&&(r=o[e+1]);"L"!==t&&(t="R");"L"!==r&&(r="R");t===r&&setValues(o,h,e,t);h=e-1}for(h=0;h<l;++h)"ON"===o[h]&&(o[h]=g);for(h=0;h<l;++h){b=o[h];isEven(f[h])?"R"===b?f[h]+=1:"AN"!==b&&"EN"!==b||(f[h]+=2):"L"!==b&&"AN"!==b&&"EN"!==b||(f[h]+=1)}let w,S=-1,x=99;for(h=0,u=f.length;h<u;++h){w=f[h];S<w&&(S=w);x>w&&isOdd(w)&&(x=w)}for(w=S;w>=x;--w){let e=-1;for(h=0,u=f.length;h<u;++h)if(f[h]<w){if(e>=0){reverseValues(s,e,h);e=-1}}else e<0&&(e=h);e>=0&&reverseValues(s,e,f.length)}for(h=0,u=s.length;h<u;++h){const e=s[h];"<"!==e&&">"!==e||(s[h]="")}return createBidiText(s.join(""),c)};var a=r(2);const n=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","ON","ON","ET","ET","ET","ON","ON","ON","ON","ON","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","ON","ON","ON","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","ON","ET","ET","ET","ET","ON","ON","ON","ON","L","ON","ON","BN","ON","ON","ET","ET","EN","EN","ON","L","ON","ON","ON","EN","L","ON","ON","ON","ON","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","ON","L","L","L","L","L","L","L","L"],i=["AN","AN","AN","AN","AN","AN","ON","ON","AL","ET","ET","AL","CS","AL","ON","ON","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","ON","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","ON","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL"];function isOdd(e){return 0!=(1&e)}function isEven(e){return 0==(1&e)}function findUnequal(e,t,r){let a,n;for(a=t,n=e.length;a<n;++a)if(e[a]!==r)return a;return a}function setValues(e,t,r,a){for(let n=t;n<r;++n)e[n]=a}function reverseValues(e,t,r){for(let a=t,n=r-1;a<n;++a,--n){const t=e[a];e[a]=e[n];e[n]=t}}function createBidiText(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a="ltr";r?a="ttb":t||(a="rtl");return{str:e,dir:a}}const s=[],o=[]},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MurmurHash3_64=void 0;var a=r(2);const n=3285377520,i=4294901760,s=65535;t.MurmurHash3_64=class MurmurHash3_64{constructor(e){this.h1=e?4294967295&e:n;this.h2=e?4294967295&e:n}update(e){let t,r;if("string"==typeof e){t=new Uint8Array(2*e.length);r=0;for(let a=0,n=e.length;a<n;a++){const n=e.charCodeAt(a);if(n<=255)t[r++]=n;else{t[r++]=n>>>8;t[r++]=255&n}}}else{if(!(0,a.isArrayBuffer)(e))throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");t=e.slice();r=t.byteLength}const n=r>>2,o=r-4*n,c=new Uint32Array(t.buffer,0,n);let l=0,h=0,u=this.h1,d=this.h2;const f=3432918353,g=461845907,p=11601,m=13715;for(let e=0;e<n;e++)if(1&e){l=c[e];l=l*f&i|l*p&s;l=l<<15|l>>>17;l=l*g&i|l*m&s;u^=l;u=u<<13|u>>>19;u=5*u+3864292196}else{h=c[e];h=h*f&i|h*p&s;h=h<<15|h>>>17;h=h*g&i|h*m&s;d^=h;d=d<<13|d>>>19;d=5*d+3864292196}l=0;switch(o){case 3:l^=t[4*n+2]<<16;case 2:l^=t[4*n+1]<<8;case 1:l^=t[4*n];l=l*f&i|l*p&s;l=l<<15|l>>>17;l=l*g&i|l*m&s;1&n?u^=l:d^=l}this.h1=u;this.h2=d}hexdigest(){let e=this.h1,t=this.h2;e^=t>>>1;e=3981806797*e&i|36045*e&s;t=4283543511*t&i|(2950163797*(t<<16|e>>>16)&i)>>>16;e^=t>>>1;e=444984403*e&i|60499*e&s;t=3301882366*t&i|(3120437893*(t<<16|e>>>16)&i)>>>16;e^=t>>>1;const r=(e>>>0).toString(16),a=(t>>>0).toString(16);return r.padStart(8,"0")+a.padStart(8,"0")}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.OperatorList=void 0;var a=r(2);function addState(e,t,r,a,n){let i=e;for(let e=0,r=t.length-1;e<r;e++){const r=t[e];i=i[r]||(i[r]=[])}i[t.at(-1)]={checkFn:r,iterateFn:a,processFn:n}}const n=[];addState(n,[a.OPS.save,a.OPS.transform,a.OPS.paintInlineImageXObject,a.OPS.restore],null,(function iterateInlineImageGroup(e,t){const r=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return r[t]===a.OPS.save;case 1:return r[t]===a.OPS.transform;case 2:return r[t]===a.OPS.paintInlineImageXObject;case 3:return r[t]===a.OPS.restore}throw new Error(`iterateInlineImageGroup - invalid pos: ${n}`)}),(function foundInlineImageGroup(e,t){const r=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=i-1,l=Math.min(Math.floor((t-s)/4),200);if(l<10)return t-(t-s)%4;let h=0;const u=[];let d=0,f=1,g=1;for(let e=0;e<l;e++){const t=n[o+(e<<2)],r=n[c+(e<<2)][0];if(f+r.width>1e3){h=Math.max(h,f);g+=d+2;f=0;d=0}u.push({transform:t,x:f,y:g,w:r.width,h:r.height});f+=r.width+2;d=Math.max(d,r.height)}const p=Math.max(h,f)+1,m=g+d+1,b=new Uint8Array(p*m*4),y=p<<2;for(let e=0;e<l;e++){const t=n[c+(e<<2)][0].data,r=u[e].w<<2;let a=0,i=u[e].x+u[e].y*p<<2;b.set(t.subarray(0,r),i-y);for(let n=0,s=u[e].h;n<s;n++){b.set(t.subarray(a,a+r),i);a+=r;i+=y}b.set(t.subarray(a-r,a),i);for(;i>=0;){t[i-4]=t[i];t[i-3]=t[i+1];t[i-2]=t[i+2];t[i-1]=t[i+3];t[i+r]=t[i+r-4];t[i+r+1]=t[i+r-3];t[i+r+2]=t[i+r-2];t[i+r+3]=t[i+r-1];i-=y}}r.splice(s,4*l,a.OPS.paintInlineImageXObjectGroup);n.splice(s,4*l,[{width:p,height:m,kind:a.ImageKind.RGBA_32BPP,data:b},u]);return s+1}));addState(n,[a.OPS.save,a.OPS.transform,a.OPS.paintImageMaskXObject,a.OPS.restore],null,(function iterateImageMaskGroup(e,t){const r=e.fnArray,n=(t-(e.iCurr-3))%4;switch(n){case 0:return r[t]===a.OPS.save;case 1:return r[t]===a.OPS.transform;case 2:return r[t]===a.OPS.paintImageMaskXObject;case 3:return r[t]===a.OPS.restore}throw new Error(`iterateImageMaskGroup - invalid pos: ${n}`)}),(function foundImageMaskGroup(e,t){const r=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=i-1;let l=Math.floor((t-s)/4);if(l<10)return t-(t-s)%4;let h,u,d=!1;const f=n[c][0],g=n[o][0],p=n[o][1],m=n[o][2],b=n[o][3];if(p===m){d=!0;h=o+4;let e=c+4;for(let t=1;t<l;t++,h+=4,e+=4){u=n[h];if(n[e][0]!==f||u[0]!==g||u[1]!==p||u[2]!==m||u[3]!==b){t<10?d=!1:l=t;break}}}if(d){l=Math.min(l,1e3);const e=new Float32Array(2*l);h=o;for(let t=0;t<l;t++,h+=4){u=n[h];e[t<<1]=u[4];e[1+(t<<1)]=u[5]}r.splice(s,4*l,a.OPS.paintImageMaskXObjectRepeat);n.splice(s,4*l,[f,g,p,m,b,e])}else{l=Math.min(l,100);const e=[];for(let t=0;t<l;t++){u=n[o+(t<<2)];const r=n[c+(t<<2)][0];e.push({data:r.data,width:r.width,height:r.height,interpolate:r.interpolate,count:r.count,transform:u})}r.splice(s,4*l,a.OPS.paintImageMaskXObjectGroup);n.splice(s,4*l,[e])}return s+1}));addState(n,[a.OPS.save,a.OPS.transform,a.OPS.paintImageXObject,a.OPS.restore],(function(e){const t=e.argsArray,r=e.iCurr-2;return 0===t[r][1]&&0===t[r][2]}),(function iterateImageGroup(e,t){const r=e.fnArray,n=e.argsArray,i=(t-(e.iCurr-3))%4;switch(i){case 0:return r[t]===a.OPS.save;case 1:if(r[t]!==a.OPS.transform)return!1;const i=e.iCurr-2,s=n[i][0],o=n[i][3];return n[t][0]===s&&0===n[t][1]&&0===n[t][2]&&n[t][3]===o;case 2:if(r[t]!==a.OPS.paintImageXObject)return!1;const c=n[e.iCurr-1][0];return n[t][0]===c;case 3:return r[t]===a.OPS.restore}throw new Error(`iterateImageGroup - invalid pos: ${i}`)}),(function(e,t){const r=e.fnArray,n=e.argsArray,i=e.iCurr,s=i-3,o=i-2,c=n[i-1][0],l=n[o][0],h=n[o][3],u=Math.min(Math.floor((t-s)/4),1e3);if(u<3)return t-(t-s)%4;const d=new Float32Array(2*u);let f=o;for(let e=0;e<u;e++,f+=4){const t=n[f];d[e<<1]=t[4];d[1+(e<<1)]=t[5]}const g=[c,l,h,d];r.splice(s,4*u,a.OPS.paintImageXObjectRepeat);n.splice(s,4*u,g);return s+1}));addState(n,[a.OPS.beginText,a.OPS.setFont,a.OPS.setTextMatrix,a.OPS.showText,a.OPS.endText],null,(function iterateShowTextGroup(e,t){const r=e.fnArray,n=e.argsArray,i=(t-(e.iCurr-4))%5;switch(i){case 0:return r[t]===a.OPS.beginText;case 1:return r[t]===a.OPS.setFont;case 2:return r[t]===a.OPS.setTextMatrix;case 3:if(r[t]!==a.OPS.showText)return!1;const i=e.iCurr-3,s=n[i][0],o=n[i][1];return n[t][0]===s&&n[t][1]===o;case 4:return r[t]===a.OPS.endText}throw new Error(`iterateShowTextGroup - invalid pos: ${i}`)}),(function(e,t){const r=e.fnArray,a=e.argsArray,n=e.iCurr,i=n-4,s=n-3,o=n-2,c=n-1,l=n,h=a[s][0],u=a[s][1];let d=Math.min(Math.floor((t-i)/5),1e3);if(d<3)return t-(t-i)%5;let f=i;if(i>=4&&r[i-4]===r[s]&&r[i-3]===r[o]&&r[i-2]===r[c]&&r[i-1]===r[l]&&a[i-4][0]===h&&a[i-4][1]===u){d++;f-=5}let g=f+4;for(let e=1;e<d;e++){r.splice(g,3);a.splice(g,3);g+=2}return g+1}));class NullOptimizer{constructor(e){this.queue=e}_optimize(){}push(e,t){this.queue.fnArray.push(e);this.queue.argsArray.push(t);this._optimize()}flush(){}reset(){}}class QueueOptimizer extends NullOptimizer{constructor(e){super(e);this.state=null;this.context={iCurr:0,fnArray:e.fnArray,argsArray:e.argsArray};this.match=null;this.lastProcessed=0}_optimize(){const e=this.queue.fnArray;let t=this.lastProcessed,r=e.length,a=this.state,i=this.match;if(!a&&!i&&t+1===r&&!n[e[t]]){this.lastProcessed=r;return}const s=this.context;for(;t<r;){if(i){if((0,i.iterateFn)(s,t)){t++;continue}t=(0,i.processFn)(s,t+1);r=e.length;i=null;a=null;if(t>=r)break}a=(a||n)[e[t]];if(a&&!Array.isArray(a)){s.iCurr=t;t++;if(!a.checkFn||(0,a.checkFn)(s)){i=a;a=null}else a=null}else t++}this.state=a;this.match=i;this.lastProcessed=t}flush(){for(;this.match;){const e=this.queue.fnArray.length;this.lastProcessed=(0,this.match.processFn)(this.context,e);this.match=null;this.state=null;this._optimize()}}reset(){this.state=null;this.match=null;this.lastProcessed=0}}class OperatorList{static get CHUNK_SIZE(){return(0,a.shadow)(this,"CHUNK_SIZE",1e3)}static get CHUNK_SIZE_ABOUT(){return(0,a.shadow)(this,"CHUNK_SIZE_ABOUT",this.CHUNK_SIZE-5)}constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;this._streamSink=t;this.fnArray=[];this.argsArray=[];!t||e&a.RenderingIntentFlag.OPLIST?this.optimizer=new NullOptimizer(this):this.optimizer=new QueueOptimizer(this);this.dependencies=new Set;this._totalLength=0;this.weight=0;this._resolved=t?null:Promise.resolve()}get length(){return this.argsArray.length}get ready(){return this._resolved||this._streamSink.ready}get totalLength(){return this._totalLength+this.length}addOp(e,t){this.optimizer.push(e,t);this.weight++;this._streamSink&&(this.weight>=OperatorList.CHUNK_SIZE||this.weight>=OperatorList.CHUNK_SIZE_ABOUT&&(e===a.OPS.restore||e===a.OPS.endText))&&this.flush()}addImageOps(e,t,r){void 0!==r&&this.addOp(a.OPS.beginMarkedContentProps,["OC",r]);this.addOp(e,t);void 0!==r&&this.addOp(a.OPS.endMarkedContent,[])}addDependency(e){if(!this.dependencies.has(e)){this.dependencies.add(e);this.addOp(a.OPS.dependency,[e])}}addDependencies(e){for(const t of e)this.addDependency(t)}addOpList(e){if(e instanceof OperatorList){for(const t of e.dependencies)this.dependencies.add(t);for(let t=0,r=e.length;t<r;t++)this.addOp(e.fnArray[t],e.argsArray[t])}else(0,a.warn)('addOpList - ignoring invalid "opList" parameter.')}getIR(){return{fnArray:this.fnArray,argsArray:this.argsArray,length:this.length}}get _transfers(){const e=[],{fnArray:t,argsArray:r,length:n}=this;for(let i=0;i<n;i++)switch(t[i]){case a.OPS.paintInlineImageXObject:case a.OPS.paintInlineImageXObjectGroup:case a.OPS.paintImageMaskXObject:const t=r[i][0];!t.cached&&t.data&&t.data.buffer instanceof ArrayBuffer&&e.push(t.data.buffer)}return e}flush(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.optimizer.flush();const r=this.length;this._totalLength+=r;this._streamSink.enqueue({fnArray:this.fnArray,argsArray:this.argsArray,lastChunk:e,separateAnnots:t,length:r},1,this._transfers);this.dependencies.clear();this.fnArray.length=0;this.argsArray.length=0;this.weight=0;this.optimizer.reset()}}t.OperatorList=OperatorList},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFImage=void 0;var a=r(2),n=r(192),i=r(135),s=r(142),o=r(147),c=r(155),l=r(158),h=r(133);function decodeAndClamp(e,t,r,a){(e=t+e*r)<0?e=0:e>a&&(e=a);return e}function resizeImageMask(e,t,r,a,n,i){const s=n*i;let o;o=t<=8?new Uint8Array(s):t<=16?new Uint16Array(s):new Uint32Array(s);const c=r/n,l=a/i;let h,u,d,f,g=0;const p=new Uint16Array(n),m=r;for(h=0;h<n;h++)p[h]=Math.floor(h*c);for(h=0;h<i;h++){d=Math.floor(h*l)*m;for(u=0;u<n;u++){f=d+p[u];o[g++]=e[f]}}return o}class PDFImage{constructor(e){let{xref:t,res:r,image:n,isInline:o=!1,smask:c=null,mask:u=null,isMask:d=!1,pdfFunctionFactory:f,localColorSpaceCache:g}=e;this.image=n;const p=n.dict,m=p.get("F","Filter");let b;if(m instanceof h.Name)b=m.name;else if(Array.isArray(m)){const e=t.fetchIfRef(m[0]);e instanceof h.Name&&(b=e.name)}switch(b){case"JPXDecode":const e=new l.JpxImage;e.parseImageProperties(n.stream);n.stream.reset();n.width=e.width;n.height=e.height;n.bitsPerComponent=e.bitsPerComponent;n.numComps=e.componentsCount;break;case"JBIG2Decode":n.bitsPerComponent=1;n.numComps=1}let y=p.get("W","Width"),w=p.get("H","Height");if(Number.isInteger(n.width)&&n.width>0&&Number.isInteger(n.height)&&n.height>0&&(n.width!==y||n.height!==w)){(0,a.warn)("PDFImage - using the Width/Height of the image data, rather than the image dictionary.");y=n.width;w=n.height}if(y<1||w<1)throw new a.FormatError(`Invalid image width: ${y} or height: ${w}`);this.width=y;this.height=w;this.interpolate=p.get("I","Interpolate");this.imageMask=p.get("IM","ImageMask")||!1;this.matte=p.get("Matte")||!1;let S=n.bitsPerComponent;if(!S){S=p.get("BPC","BitsPerComponent");if(!S){if(!this.imageMask)throw new a.FormatError(`Bits per component missing in image: ${this.imageMask}`);S=1}}this.bpc=S;if(!this.imageMask){let e=p.getRaw("CS")||p.getRaw("ColorSpace");if(!e){(0,a.info)("JPX images (which do not require color spaces)");switch(n.numComps){case 1:e=h.Name.get("DeviceGray");break;case 3:e=h.Name.get("DeviceRGB");break;case 4:e=h.Name.get("DeviceCMYK");break;default:throw new Error(`JPX images with ${n.numComps} color components not supported.`)}}this.colorSpace=s.ColorSpace.parse({cs:e,xref:t,resources:o?r:null,pdfFunctionFactory:f,localColorSpaceCache:g});this.numComps=this.colorSpace.numComps}this.decode=p.getArray("D","Decode");this.needsDecode=!1;if(this.decode&&(this.colorSpace&&!this.colorSpace.isDefaultDecode(this.decode,S)||d&&!s.ColorSpace.isDefaultDecode(this.decode,1))){this.needsDecode=!0;const e=(1<<S)-1;this.decodeCoefficients=[];this.decodeAddends=[];const t=this.colorSpace&&"Indexed"===this.colorSpace.name;for(let r=0,a=0;r<this.decode.length;r+=2,++a){const n=this.decode[r],i=this.decode[r+1];this.decodeCoefficients[a]=t?(i-n)/e:i-n;this.decodeAddends[a]=t?n:e*n}}if(c)this.smask=new PDFImage({xref:t,res:r,image:c,isInline:o,pdfFunctionFactory:f,localColorSpaceCache:g});else if(u)if(u instanceof i.BaseStream){u.dict.get("IM","ImageMask")?this.mask=new PDFImage({xref:t,res:r,image:u,isInline:o,isMask:!0,pdfFunctionFactory:f,localColorSpaceCache:g}):(0,a.warn)("Ignoring /Mask in image without /ImageMask.")}else this.mask=u}static async buildImage(e){let{xref:t,res:r,image:n,isInline:s=!1,pdfFunctionFactory:o,localColorSpaceCache:c}=e;const l=n;let h=null,u=null;const d=n.dict.get("SMask"),f=n.dict.get("Mask");d?d instanceof i.BaseStream?h=d:(0,a.warn)("Unsupported /SMask format."):f&&(f instanceof i.BaseStream||Array.isArray(f)?u=f:(0,a.warn)("Unsupported /Mask format."));return new PDFImage({xref:t,res:r,image:l,isInline:s,smask:h,mask:u,pdfFunctionFactory:o,localColorSpaceCache:c})}static createRawMask(e){let{imgArray:t,width:r,height:a,imageIsFromDecodeStream:n,inverseDecode:i,interpolate:s}=e;const o=(r+7>>3)*a,c=t.byteLength;let l,h;if(!n||i&&!(o===c))if(i){l=new Uint8Array(o);l.set(t);l.fill(255,c)}else l=new Uint8Array(t);else l=t;if(i)for(h=0;h<c;h++)l[h]^=255;return{data:l,width:r,height:a,interpolate:s}}static createMask(e){let{imgArray:t,width:r,height:i,imageIsFromDecodeStream:s,inverseDecode:o,interpolate:c}=e;const l=1===r&&1===i&&o===(0===t.length||!!(128&t[0]));if(l)return{isSingleOpaquePixel:l};if(a.FeatureTest.isOffscreenCanvasSupported){const e=new OffscreenCanvas(r,i),a=e.getContext("2d"),s=a.createImageData(r,i);(0,n.applyMaskImageData)({src:t,dest:s.data,width:r,height:i,inverseDecode:o});a.putImageData(s,0,0);return{data:null,width:r,height:i,interpolate:c,bitmap:e.transferToImageBitmap()}}return this.createRawMask({imgArray:t,width:r,height:i,inverseDecode:o,imageIsFromDecodeStream:s,interpolate:c})}get drawWidth(){return Math.max(this.width,this.smask&&this.smask.width||0,this.mask&&this.mask.width||0)}get drawHeight(){return Math.max(this.height,this.smask&&this.smask.height||0,this.mask&&this.mask.height||0)}decodeBuffer(e){const t=this.bpc,r=this.numComps,a=this.decodeAddends,n=this.decodeCoefficients,i=(1<<t)-1;let s,o;if(1===t){for(s=0,o=e.length;s<o;s++)e[s]=+!e[s];return}let c=0;for(s=0,o=this.width*this.height;s<o;s++)for(let t=0;t<r;t++){e[c]=decodeAndClamp(e[c],a[t],n[t],i);c++}}getComponents(e){const t=this.bpc;if(8===t)return e;const r=this.width,a=this.height,n=this.numComps,i=r*a*n;let s,o=0;s=t<=8?new Uint8Array(i):t<=16?new Uint16Array(i):new Uint32Array(i);const c=r*n,l=(1<<t)-1;let h,u,d=0;if(1===t){let t,r,n;for(let i=0;i<a;i++){r=d+(-8&c);n=d+c;for(;d<r;){u=e[o++];s[d]=u>>7&1;s[d+1]=u>>6&1;s[d+2]=u>>5&1;s[d+3]=u>>4&1;s[d+4]=u>>3&1;s[d+5]=u>>2&1;s[d+6]=u>>1&1;s[d+7]=1&u;d+=8}if(d<n){u=e[o++];t=128;for(;d<n;){s[d++]=+!!(u&t);t>>=1}}}}else{let r=0;u=0;for(d=0,h=i;d<h;++d){if(d%c==0){u=0;r=0}for(;r<t;){u=u<<8|e[o++];r+=8}const a=r-t;let n=u>>a;n<0?n=0:n>l&&(n=l);s[d]=n;u&=(1<<a)-1;r=a}}return s}fillOpacity(e,t,r,n,i){const s=this.smask,o=this.mask;let c,l,h,u,d,f;if(s){l=s.width;h=s.height;c=new Uint8ClampedArray(l*h);s.fillGrayBuffer(c);l===t&&h===r||(c=resizeImageMask(c,s.bpc,l,h,t,r))}else if(o)if(o instanceof PDFImage){l=o.width;h=o.height;c=new Uint8ClampedArray(l*h);o.numComps=1;o.fillGrayBuffer(c);for(u=0,d=l*h;u<d;++u)c[u]=255-c[u];l===t&&h===r||(c=resizeImageMask(c,o.bpc,l,h,t,r))}else{if(!Array.isArray(o))throw new a.FormatError("Unknown mask format.");{c=new Uint8ClampedArray(t*r);const e=this.numComps;for(u=0,d=t*r;u<d;++u){let t=0;const r=u*e;for(f=0;f<e;++f){const e=i[r+f],a=2*f;if(e<o[a]||e>o[a+1]){t=255;break}}c[u]=t}}}if(c)for(u=0,f=3,d=t*n;u<d;++u,f+=4)e[f]=c[u];else for(u=0,f=3,d=t*n;u<d;++u,f+=4)e[f]=255}undoPreblend(e,t,r){const a=this.smask&&this.smask.matte;if(!a)return;const n=this.colorSpace.getRgb(a,0),i=n[0],s=n[1],o=n[2],c=t*r*4;for(let t=0;t<c;t+=4){const r=e[t+3];if(0===r){e[t]=255;e[t+1]=255;e[t+2]=255;continue}const a=255/r;e[t]=(e[t]-i)*a+i;e[t+1]=(e[t+1]-s)*a+s;e[t+2]=(e[t+2]-o)*a+o}}createImageData(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.drawWidth,r=this.drawHeight,n={width:t,height:r,interpolate:this.interpolate,kind:0,data:null},i=this.numComps,s=this.width,o=this.height,l=this.bpc,h=s*i*l+7>>3;if(!e){let e;"DeviceGray"===this.colorSpace.name&&1===l?e=a.ImageKind.GRAYSCALE_1BPP:"DeviceRGB"!==this.colorSpace.name||8!==l||this.needsDecode||(e=a.ImageKind.RGB_24BPP);if(e&&!this.smask&&!this.mask&&t===s&&r===o){n.kind=e;n.data=this.getImageBytes(o*h,{});if(this.needsDecode){(0,a.assert)(e===a.ImageKind.GRAYSCALE_1BPP,"PDFImage.createImageData: The image must be grayscale.");const t=n.data;for(let e=0,r=t.length;e<r;e++)t[e]^=255}return n}if(this.image instanceof c.JpegStream&&!this.smask&&!this.mask){let e=o*h;switch(this.colorSpace.name){case"DeviceGray":e*=3;case"DeviceRGB":case"DeviceCMYK":n.kind=a.ImageKind.RGB_24BPP;n.data=this.getImageBytes(e,{drawWidth:t,drawHeight:r,forceRGB:!0});return n}}}const u=this.getImageBytes(o*h,{internal:!0}),d=0|u.length/h*r/o,f=this.getComponents(u);let g,p;if(e||this.smask||this.mask){n.kind=a.ImageKind.RGBA_32BPP;n.data=new Uint8ClampedArray(t*r*4);g=1;p=!0;this.fillOpacity(n.data,t,r,d,f)}else{n.kind=a.ImageKind.RGB_24BPP;n.data=new Uint8ClampedArray(t*r*3);g=0;p=!1}this.needsDecode&&this.decodeBuffer(f);this.colorSpace.fillRgb(n.data,s,o,t,r,d,l,f,g);p&&this.undoPreblend(n.data,t,d);return n}fillGrayBuffer(e){const t=this.numComps;if(1!==t)throw new a.FormatError(`Reading gray scale from a color image: ${t}`);const r=this.width,n=this.height,i=this.bpc,s=r*t*i+7>>3,o=this.getImageBytes(n*s,{internal:!0}),c=this.getComponents(o);let l,h;if(1===i){h=r*n;if(this.needsDecode)for(l=0;l<h;++l)e[l]=c[l]-1&255;else for(l=0;l<h;++l)e[l]=255&-c[l];return}this.needsDecode&&this.decodeBuffer(c);h=r*n;const u=255/((1<<i)-1);for(l=0;l<h;++l)e[l]=u*c[l]}getImageBytes(e,t){let{drawWidth:r,drawHeight:n,forceRGB:i=!1,internal:s=!1}=t;this.image.reset();this.image.drawWidth=r||this.width;this.image.drawHeight=n||this.height;this.image.forceRGB=!!i;const c=this.image.getBytes(e);if(s||this.image instanceof o.DecodeStream)return c;(0,a.assert)(c instanceof Uint8Array,'PDFImage.getImageBytes: Unsupported "imageBytes" type.');return new Uint8Array(c)}}t.PDFImage=PDFImage},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.applyMaskImageData=function applyMaskImageData(e){let{src:t,srcPos:r=0,dest:n,destPos:i=0,width:s,height:o,inverseDecode:c=!1}=e;const l=a.FeatureTest.isLittleEndian?4278190080:255,[h,u]=c?[0,l]:[l,0],d=s>>3,f=7&s,g=t.length;n=new Uint32Array(n.buffer);for(let e=0;e<o;e++){for(const e=r+d;r<e;r++){const e=r<g?t[r]:255;n[i++]=128&e?u:h;n[i++]=64&e?u:h;n[i++]=32&e?u:h;n[i++]=16&e?u:h;n[i++]=8&e?u:h;n[i++]=4&e?u:h;n[i++]=2&e?u:h;n[i++]=1&e?u:h}if(0===f)continue;const e=r<g?t[r++]:255;for(let t=0;t<f;t++)n[i++]=e&1<<7-t?u:h}return{srcPos:r,destPos:i}};var a=r(2)},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.incrementalUpdate=function incrementalUpdate(e){let{originalData:t,xrefInfo:r,newRefs:o,xref:l=null,hasXfa:h=!1,xfaDatasetsRef:u=null,hasXfaDatasetsEntry:d=!1,acroFormRef:f=null,acroForm:g=null,xfaData:p=null}=e;h&&function updateXFA(e){let{xfaData:t,xfaDatasetsRef:r,hasXfaDatasetsEntry:n,acroFormRef:o,acroForm:c,newRefs:l,xref:h,xrefInfo:u}=e;if(null===h)return;if(!n){if(!o){(0,a.warn)("XFA - Cannot save it");return}const e=c.get("XFA"),t=e.slice();t.splice(2,0,"datasets");t.splice(3,0,r);c.set("XFA",t);const n=h.encrypt;let i=null;n&&(i=n.createCipherTransform(o.num,o.gen));const s=[`${o.num} ${o.gen} obj\n`];writeDict(c,s,i);s.push("\n");c.set("XFA",e);l.push({ref:o,data:s.join("")})}if(null===t){t=function writeXFADataForAcroform(e,t){const r=new s.SimpleXMLParser({hasAttributes:!0}).parseFromString(e);for(const{xfa:e}of t){if(!e)continue;const{path:t,value:n}=e;if(!t)continue;const o=r.documentElement.searchNode((0,i.parseXFAPath)(t),0);o?Array.isArray(n)?o.childNodes=n.map((e=>new s.SimpleDOMNode("value",e))):o.childNodes=[new s.SimpleDOMNode("#text",n)]:(0,a.warn)(`Node not found for path: ${t}`)}const n=[];r.documentElement.dump(n);return n.join("")}(h.fetchIfRef(r).getString(),l)}const d=h.encrypt;if(d){t=d.createCipherTransform(r.num,r.gen).encryptString(t)}const f=`${r.num} ${r.gen} obj\n<< /Type /EmbeddedFile /Length ${t.length}>>\nstream\n`+t+"\nendstream\nendobj\n";l.push({ref:r,data:f})}({xfaData:p,xfaDatasetsRef:u,hasXfaDatasetsEntry:d,acroFormRef:f,acroForm:g,newRefs:o,xref:l,xrefInfo:r});const m=new n.Dict(null),b=r.newRef;let y,w;const S=t.at(-1);if(10===S||13===S){y=[];w=t.length}else{y=["\n"];w=t.length+1}m.set("Size",b.num+1);m.set("Prev",r.startXRef);m.set("Type",n.Name.get("XRef"));null!==r.rootRef&&m.set("Root",r.rootRef);null!==r.infoRef&&m.set("Info",r.infoRef);null!==r.encryptRef&&m.set("Encrypt",r.encryptRef);o.push({ref:b,data:""});o=o.sort(((e,t)=>e.ref.num-t.ref.num));const x=[[0,1,65535]],k=[0,1];let C=0;for(const{ref:e,data:t}of o){C=Math.max(C,w);x.push([1,w,Math.min(e.gen,65535)]);w+=t.length;k.push(e.num,1);y.push(t)}m.set("Index",k);if(Array.isArray(r.fileIds)&&r.fileIds.length>0){const e=function computeMD5(e,t){const r=Math.floor(Date.now()/1e3),n=t.filename||"",i=[r.toString(),n,e.toString()];let s=i.reduce(((e,t)=>e+t.length),0);for(const e of Object.values(t.info)){i.push(e);s+=e.length}const o=new Uint8Array(s);let l=0;for(const e of i){writeString(e,l,o);l+=e.length}return(0,a.bytesToString)((0,c.calculateMD5)(o))}(w,r);m.set("ID",[r.fileIds[0],e])}const v=[1,Math.ceil(Math.log2(C)/8),2],O=(v[0]+v[1]+v[2])*x.length;m.set("W",v);m.set("Length",O);y.push(`${b.num} ${b.gen} obj\n`);writeDict(m,y,null);y.push(" stream\n");const T=y.reduce(((e,t)=>e+t.length),0),M=`\nendstream\nendobj\nstartxref\n${w}\n%%EOF\n`,E=new Uint8Array(t.length+T+O+M.length);E.set(t);let D=t.length;for(const e of y){writeString(e,D,E);D+=e.length}for(const[e,t,r]of x){D=writeInt(e,v[0],D,E);D=writeInt(t,v[1],D,E);D=writeInt(r,v[2],D,E)}writeString(M,D,E);return E};t.writeDict=writeDict;t.writeObject=function writeObject(e,t,r,a){r.push(`${e.num} ${e.gen} obj\n`);t instanceof n.Dict?writeDict(t,r,a):t instanceof o.BaseStream&&writeStream(t,r,a);r.push("\nendobj\n")};var a=r(2),n=r(133),i=r(134),s=r(194),o=r(135),c=r(195);function writeDict(e,t,r){t.push("<<");for(const a of e.getKeys()){t.push(` /${(0,i.escapePDFName)(a)} `);writeValue(e.getRaw(a),t,r)}t.push(">>")}function writeStream(e,t,r){writeDict(e.dict,t,r);t.push(" stream\n");let a=e.getString();null!==r&&(a=r.encryptString(a));t.push(a,"\nendstream\n")}function writeValue(e,t,r){if(e instanceof n.Name)t.push(`/${(0,i.escapePDFName)(e.name)}`);else if(e instanceof n.Ref)t.push(`${e.num} ${e.gen} R`);else if(Array.isArray(e))!function writeArray(e,t,r){t.push("[");let a=!0;for(const n of e){a?a=!1:t.push(" ");writeValue(n,t,r)}t.push("]")}(e,t,r);else if("string"==typeof e){null!==r&&(e=r.encryptString(e));t.push(`(${(0,a.escapeString)(e)})`)}else"number"==typeof e?t.push((0,i.numberToString)(e)):"boolean"==typeof e?t.push(e.toString()):e instanceof n.Dict?writeDict(e,t,r):e instanceof o.BaseStream?writeStream(e,t,r):null===e?t.push("null"):(0,a.warn)(`Unhandled value in writer: ${typeof e}, please file a bug.`)}function writeInt(e,t,r,a){for(let n=t+r-1;n>r-1;n--){a[n]=255&e;e>>=8}return r+t}function writeString(e,t,r){for(let a=0,n=e.length;a<n;a++)r[t+a]=255&e.charCodeAt(a)}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XMLParserErrorCode=t.XMLParserBase=t.SimpleXMLParser=t.SimpleDOMNode=void 0;var a=r(134);const n={NoError:0,EndOfDocument:-1,UnterminatedCdat:-2,UnterminatedXmlDeclaration:-3,UnterminatedDoctypeDeclaration:-4,UnterminatedComment:-5,MalformedElement:-6,OutOfMemory:-7,UnterminatedAttributeValue:-8,UnterminatedElement:-9,ElementNeverBegun:-10};t.XMLParserErrorCode=n;function isWhitespace(e,t){const r=e[t];return" "===r||"\n"===r||"\r"===r||"\t"===r}class XMLParserBase{_resolveEntities(e){return e.replace(/&([^;]+);/g,((e,t)=>{if("#x"===t.substring(0,2))return String.fromCodePoint(parseInt(t.substring(2),16));if("#"===t.substring(0,1))return String.fromCodePoint(parseInt(t.substring(1),10));switch(t){case"lt":return"<";case"gt":return">";case"amp":return"&";case"quot":return'"';case"apos":return"'"}return this.onResolveEntity(t)}))}_parseContent(e,t){const r=[];let a=t;function skipWs(){for(;a<e.length&&isWhitespace(e,a);)++a}for(;a<e.length&&!isWhitespace(e,a)&&">"!==e[a]&&"/"!==e[a];)++a;const n=e.substring(t,a);skipWs();for(;a<e.length&&">"!==e[a]&&"/"!==e[a]&&"?"!==e[a];){skipWs();let t="",n="";for(;a<e.length&&!isWhitespace(e,a)&&"="!==e[a];){t+=e[a];++a}skipWs();if("="!==e[a])return null;++a;skipWs();const i=e[a];if('"'!==i&&"'"!==i)return null;const s=e.indexOf(i,++a);if(s<0)return null;n=e.substring(a,s);r.push({name:t,value:this._resolveEntities(n)});a=s+1;skipWs()}return{name:n,attributes:r,parsed:a-t}}_parseProcessingInstruction(e,t){let r=t;for(;r<e.length&&!isWhitespace(e,r)&&">"!==e[r]&&"?"!==e[r]&&"/"!==e[r];)++r;const a=e.substring(t,r);!function skipWs(){for(;r<e.length&&isWhitespace(e,r);)++r}();const n=r;for(;r<e.length&&("?"!==e[r]||">"!==e[r+1]);)++r;return{name:a,value:e.substring(n,r),parsed:r-t}}parseXml(e){let t=0;for(;t<e.length;){let r=t;if("<"===e[t]){++r;let t;switch(e[r]){case"/":++r;t=e.indexOf(">",r);if(t<0){this.onError(n.UnterminatedElement);return}this.onEndElement(e.substring(r,t));r=t+1;break;case"?":++r;const a=this._parseProcessingInstruction(e,r);if("?>"!==e.substring(r+a.parsed,r+a.parsed+2)){this.onError(n.UnterminatedXmlDeclaration);return}this.onPi(a.name,a.value);r+=a.parsed+2;break;case"!":if("--"===e.substring(r+1,r+3)){t=e.indexOf("--\x3e",r+3);if(t<0){this.onError(n.UnterminatedComment);return}this.onComment(e.substring(r+3,t));r=t+3}else if("[CDATA["===e.substring(r+1,r+8)){t=e.indexOf("]]>",r+8);if(t<0){this.onError(n.UnterminatedCdat);return}this.onCdata(e.substring(r+8,t));r=t+3}else{if("DOCTYPE"!==e.substring(r+1,r+8)){this.onError(n.MalformedElement);return}{const a=e.indexOf("[",r+8);let i=!1;t=e.indexOf(">",r+8);if(t<0){this.onError(n.UnterminatedDoctypeDeclaration);return}if(a>0&&t>a){t=e.indexOf("]>",r+8);if(t<0){this.onError(n.UnterminatedDoctypeDeclaration);return}i=!0}const s=e.substring(r+8,t+(i?1:0));this.onDoctype(s);r=t+(i?2:1)}}break;default:const i=this._parseContent(e,r);if(null===i){this.onError(n.MalformedElement);return}let s=!1;if("/>"===e.substring(r+i.parsed,r+i.parsed+2))s=!0;else if(">"!==e.substring(r+i.parsed,r+i.parsed+1)){this.onError(n.UnterminatedElement);return}this.onBeginElement(i.name,i.attributes,s);r+=i.parsed+(s?2:1)}}else{for(;r<e.length&&"<"!==e[r];)r++;const a=e.substring(t,r);this.onText(this._resolveEntities(a))}t=r}}onResolveEntity(e){return`&${e};`}onPi(e,t){}onComment(e){}onCdata(e){}onDoctype(e){}onText(e){}onBeginElement(e,t,r){}onEndElement(e){}onError(e){}}t.XMLParserBase=XMLParserBase;class SimpleDOMNode{constructor(e,t){this.nodeName=e;this.nodeValue=t;Object.defineProperty(this,"parentNode",{value:null,writable:!0})}get firstChild(){return this.childNodes&&this.childNodes[0]}get nextSibling(){const e=this.parentNode.childNodes;if(!e)return;const t=e.indexOf(this);return-1!==t?e[t+1]:void 0}get textContent(){return this.childNodes?this.childNodes.map((function(e){return e.textContent})).join(""):this.nodeValue||""}get children(){return this.childNodes||[]}hasChildNodes(){return this.childNodes&&this.childNodes.length>0}searchNode(e,t){if(t>=e.length)return this;const r=e[t],a=[];let n=this;for(;;){if(r.name===n.nodeName){if(0!==r.pos){if(0===a.length)return null;{const[i]=a.pop();let s=0;for(const a of i.childNodes)if(r.name===a.nodeName){if(s===r.pos)return a.searchNode(e,t+1);s++}return n.searchNode(e,t+1)}}{const r=n.searchNode(e,t+1);if(null!==r)return r}}if(n.childNodes&&0!==n.childNodes.length){a.push([n,0]);n=n.childNodes[0]}else{if(0===a.length)return null;for(;0!==a.length;){const[e,t]=a.pop(),r=t+1;if(r<e.childNodes.length){a.push([e,r]);n=e.childNodes[r];break}}if(0===a.length)return null}}}dump(e){if("#text"!==this.nodeName){e.push(`<${this.nodeName}`);if(this.attributes)for(const t of this.attributes)e.push(` ${t.name}="${(0,a.encodeToXmlString)(t.value)}"`);if(this.hasChildNodes()){e.push(">");for(const t of this.childNodes)t.dump(e);e.push(`</${this.nodeName}>`)}else this.nodeValue?e.push(`>${(0,a.encodeToXmlString)(this.nodeValue)}</${this.nodeName}>`):e.push("/>")}else e.push((0,a.encodeToXmlString)(this.nodeValue))}}t.SimpleDOMNode=SimpleDOMNode;t.SimpleXMLParser=class SimpleXMLParser extends XMLParserBase{constructor(e){let{hasAttributes:t=!1,lowerCaseName:r=!1}=e;super();this._currentFragment=null;this._stack=null;this._errorCode=n.NoError;this._hasAttributes=t;this._lowerCaseName=r}parseFromString(e){this._currentFragment=[];this._stack=[];this._errorCode=n.NoError;this.parseXml(e);if(this._errorCode!==n.NoError)return;const[t]=this._currentFragment;return t?{documentElement:t}:void 0}onText(e){if(function isWhitespaceString(e){for(let t=0,r=e.length;t<r;t++)if(!isWhitespace(e,t))return!1;return!0}(e))return;const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onCdata(e){const t=new SimpleDOMNode("#text",e);this._currentFragment.push(t)}onBeginElement(e,t,r){this._lowerCaseName&&(e=e.toLowerCase());const a=new SimpleDOMNode(e);a.childNodes=[];this._hasAttributes&&(a.attributes=t);this._currentFragment.push(a);if(!r){this._stack.push(this._currentFragment);this._currentFragment=a.childNodes}}onEndElement(e){this._currentFragment=this._stack.pop()||[];const t=this._currentFragment.at(-1);if(!t)return null;for(let e=0,r=t.childNodes.length;e<r;e++)t.childNodes[e].parentNode=t;return t}onError(e){this._errorCode=e}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.calculateSHA256=t.calculateMD5=t.PDF20=t.PDF17=t.CipherTransformFactory=t.ARCFourCipher=t.AES256Cipher=t.AES128Cipher=void 0;t.calculateSHA384=calculateSHA384;t.calculateSHA512=void 0;var a=r(2),n=r(133),i=r(196);class ARCFourCipher{constructor(e){this.a=0;this.b=0;const t=new Uint8Array(256),r=e.length;for(let e=0;e<256;++e)t[e]=e;for(let a=0,n=0;a<256;++a){const i=t[a];n=n+i+e[a%r]&255;t[a]=t[n];t[n]=i}this.s=t}encryptBlock(e){let t=this.a,r=this.b;const a=this.s,n=e.length,i=new Uint8Array(n);for(let s=0;s<n;++s){t=t+1&255;const n=a[t];r=r+n&255;const o=a[r];a[t]=o;a[r]=n;i[s]=e[s]^a[n+o&255]}this.a=t;this.b=r;return i}decryptBlock(e){return this.encryptBlock(e)}encrypt(e){return this.encryptBlock(e)}}t.ARCFourCipher=ARCFourCipher;const s=function calculateMD5Closure(){const e=new Uint8Array([7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21]),t=new Int32Array([-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551]);return function hash(r,a,n){let i=1732584193,s=-271733879,o=-1732584194,c=271733878;const l=n+72&-64,h=new Uint8Array(l);let u,d;for(u=0;u<n;++u)h[u]=r[a++];h[u++]=128;const f=l-8;for(;u<f;)h[u++]=0;h[u++]=n<<3&255;h[u++]=n>>5&255;h[u++]=n>>13&255;h[u++]=n>>21&255;h[u++]=n>>>29&255;h[u++]=0;h[u++]=0;h[u++]=0;const g=new Int32Array(16);for(u=0;u<l;){for(d=0;d<16;++d,u+=4)g[d]=h[u]|h[u+1]<<8|h[u+2]<<16|h[u+3]<<24;let r,a,n=i,l=s,f=o,p=c;for(d=0;d<64;++d){if(d<16){r=l&f|~l&p;a=d}else if(d<32){r=p&l|~p&f;a=5*d+1&15}else if(d<48){r=l^f^p;a=3*d+5&15}else{r=f^(l|~p);a=7*d&15}const i=p,s=n+r+t[d]+g[a]|0,o=e[d];p=f;f=l;l=l+(s<<o|s>>>32-o)|0;n=i}i=i+n|0;s=s+l|0;o=o+f|0;c=c+p|0}return new Uint8Array([255&i,i>>8&255,i>>16&255,i>>>24&255,255&s,s>>8&255,s>>16&255,s>>>24&255,255&o,o>>8&255,o>>16&255,o>>>24&255,255&c,c>>8&255,c>>16&255,c>>>24&255])}}();t.calculateMD5=s;class Word64{constructor(e,t){this.high=0|e;this.low=0|t}and(e){this.high&=e.high;this.low&=e.low}xor(e){this.high^=e.high;this.low^=e.low}or(e){this.high|=e.high;this.low|=e.low}shiftRight(e){if(e>=32){this.low=this.high>>>e-32|0;this.high=0}else{this.low=this.low>>>e|this.high<<32-e;this.high=this.high>>>e|0}}shiftLeft(e){if(e>=32){this.high=this.low<<e-32;this.low=0}else{this.high=this.high<<e|this.low>>>32-e;this.low<<=e}}rotateRight(e){let t,r;if(32&e){r=this.low;t=this.high}else{t=this.low;r=this.high}e&=31;this.low=t>>>e|r<<32-e;this.high=r>>>e|t<<32-e}not(){this.high=~this.high;this.low=~this.low}add(e){const t=(this.low>>>0)+(e.low>>>0);let r=(this.high>>>0)+(e.high>>>0);t>4294967295&&(r+=1);this.low=0|t;this.high=0|r}copyTo(e,t){e[t]=this.high>>>24&255;e[t+1]=this.high>>16&255;e[t+2]=this.high>>8&255;e[t+3]=255&this.high;e[t+4]=this.low>>>24&255;e[t+5]=this.low>>16&255;e[t+6]=this.low>>8&255;e[t+7]=255&this.low}assign(e){this.high=e.high;this.low=e.low}}const o=function calculateSHA256Closure(){function rotr(e,t){return e>>>t|e<<32-t}function ch(e,t,r){return e&t^~e&r}function maj(e,t,r){return e&t^e&r^t&r}function sigma(e){return rotr(e,2)^rotr(e,13)^rotr(e,22)}function sigmaPrime(e){return rotr(e,6)^rotr(e,11)^rotr(e,25)}function littleSigma(e){return rotr(e,7)^rotr(e,18)^e>>>3}const e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];return function hash(t,r,a){let n=1779033703,i=3144134277,s=1013904242,o=2773480762,c=1359893119,l=2600822924,h=528734635,u=1541459225;const d=64*Math.ceil((a+9)/64),f=new Uint8Array(d);let g,p;for(g=0;g<a;++g)f[g]=t[r++];f[g++]=128;const m=d-8;for(;g<m;)f[g++]=0;f[g++]=0;f[g++]=0;f[g++]=0;f[g++]=a>>>29&255;f[g++]=a>>21&255;f[g++]=a>>13&255;f[g++]=a>>5&255;f[g++]=a<<3&255;const b=new Uint32Array(64);for(g=0;g<d;){for(p=0;p<16;++p){b[p]=f[g]<<24|f[g+1]<<16|f[g+2]<<8|f[g+3];g+=4}for(p=16;p<64;++p)b[p]=(rotr(y=b[p-2],17)^rotr(y,19)^y>>>10)+b[p-7]+littleSigma(b[p-15])+b[p-16]|0;let t,r,a=n,d=i,m=s,w=o,S=c,x=l,k=h,C=u;for(p=0;p<64;++p){t=C+sigmaPrime(S)+ch(S,x,k)+e[p]+b[p];r=sigma(a)+maj(a,d,m);C=k;k=x;x=S;S=w+t|0;w=m;m=d;d=a;a=t+r|0}n=n+a|0;i=i+d|0;s=s+m|0;o=o+w|0;c=c+S|0;l=l+x|0;h=h+k|0;u=u+C|0}var y;return new Uint8Array([n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,o>>24&255,o>>16&255,o>>8&255,255&o,c>>24&255,c>>16&255,c>>8&255,255&c,l>>24&255,l>>16&255,l>>8&255,255&l,h>>24&255,h>>16&255,h>>8&255,255&h,u>>24&255,u>>16&255,u>>8&255,255&u])}}();t.calculateSHA256=o;const c=function calculateSHA512Closure(){function ch(e,t,r,a,n){e.assign(t);e.and(r);n.assign(t);n.not();n.and(a);e.xor(n)}function maj(e,t,r,a,n){e.assign(t);e.and(r);n.assign(t);n.and(a);e.xor(n);n.assign(r);n.and(a);e.xor(n)}function sigma(e,t,r){e.assign(t);e.rotateRight(28);r.assign(t);r.rotateRight(34);e.xor(r);r.assign(t);r.rotateRight(39);e.xor(r)}function sigmaPrime(e,t,r){e.assign(t);e.rotateRight(14);r.assign(t);r.rotateRight(18);e.xor(r);r.assign(t);r.rotateRight(41);e.xor(r)}function littleSigma(e,t,r){e.assign(t);e.rotateRight(1);r.assign(t);r.rotateRight(8);e.xor(r);r.assign(t);r.shiftRight(7);e.xor(r)}function littleSigmaPrime(e,t,r){e.assign(t);e.rotateRight(19);r.assign(t);r.rotateRight(61);e.xor(r);r.assign(t);r.shiftRight(6);e.xor(r)}const e=[new Word64(1116352408,3609767458),new Word64(1899447441,602891725),new Word64(3049323471,3964484399),new Word64(3921009573,2173295548),new Word64(961987163,4081628472),new Word64(1508970993,3053834265),new Word64(2453635748,2937671579),new Word64(2870763221,3664609560),new Word64(3624381080,2734883394),new Word64(310598401,1164996542),new Word64(607225278,1323610764),new Word64(1426881987,3590304994),new Word64(1925078388,4068182383),new Word64(2162078206,991336113),new Word64(2614888103,633803317),new Word64(3248222580,3479774868),new Word64(3835390401,2666613458),new Word64(4022224774,944711139),new Word64(264347078,2341262773),new Word64(604807628,2007800933),new Word64(770255983,1495990901),new Word64(1249150122,1856431235),new Word64(1555081692,3175218132),new Word64(1996064986,2198950837),new Word64(2554220882,3999719339),new Word64(2821834349,766784016),new Word64(2952996808,2566594879),new Word64(3210313671,3203337956),new Word64(3336571891,1034457026),new Word64(3584528711,2466948901),new Word64(113926993,3758326383),new Word64(338241895,168717936),new Word64(666307205,1188179964),new Word64(773529912,1546045734),new Word64(1294757372,1522805485),new Word64(1396182291,2643833823),new Word64(1695183700,2343527390),new Word64(1986661051,1014477480),new Word64(2177026350,1206759142),new Word64(2456956037,344077627),new Word64(2730485921,1290863460),new Word64(2820302411,3158454273),new Word64(3259730800,3505952657),new Word64(3345764771,106217008),new Word64(3516065817,3606008344),new Word64(3600352804,1432725776),new Word64(4094571909,1467031594),new Word64(275423344,851169720),new Word64(430227734,3100823752),new Word64(506948616,1363258195),new Word64(659060556,3750685593),new Word64(883997877,3785050280),new Word64(958139571,3318307427),new Word64(1322822218,3812723403),new Word64(1537002063,2003034995),new Word64(1747873779,3602036899),new Word64(1955562222,1575990012),new Word64(2024104815,1125592928),new Word64(2227730452,2716904306),new Word64(2361852424,442776044),new Word64(2428436474,593698344),new Word64(2756734187,3733110249),new Word64(3204031479,2999351573),new Word64(3329325298,3815920427),new Word64(3391569614,3928383900),new Word64(3515267271,566280711),new Word64(3940187606,3454069534),new Word64(4118630271,4000239992),new Word64(116418474,1914138554),new Word64(174292421,2731055270),new Word64(289380356,3203993006),new Word64(460393269,320620315),new Word64(685471733,587496836),new Word64(852142971,1086792851),new Word64(1017036298,365543100),new Word64(1126000580,2618297676),new Word64(1288033470,3409855158),new Word64(1501505948,4234509866),new Word64(1607167915,987167468),new Word64(1816402316,1246189591)];return function hash(t,r,a){let n,i,s,o,c,l,h,u,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(d){n=new Word64(3418070365,3238371032);i=new Word64(1654270250,914150663);s=new Word64(2438529370,812702999);o=new Word64(355462360,4144912697);c=new Word64(1731405415,4290775857);l=new Word64(2394180231,1750603025);h=new Word64(3675008525,1694076839);u=new Word64(1203062813,3204075428)}else{n=new Word64(1779033703,4089235720);i=new Word64(3144134277,2227873595);s=new Word64(1013904242,4271175723);o=new Word64(2773480762,1595750129);c=new Word64(1359893119,2917565137);l=new Word64(2600822924,725511199);h=new Word64(528734635,4215389547);u=new Word64(1541459225,327033209)}const f=128*Math.ceil((a+17)/128),g=new Uint8Array(f);let p,m;for(p=0;p<a;++p)g[p]=t[r++];g[p++]=128;const b=f-16;for(;p<b;)g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=0;g[p++]=a>>>29&255;g[p++]=a>>21&255;g[p++]=a>>13&255;g[p++]=a>>5&255;g[p++]=a<<3&255;const y=new Array(80);for(p=0;p<80;p++)y[p]=new Word64(0,0);let w=new Word64(0,0),S=new Word64(0,0),x=new Word64(0,0),k=new Word64(0,0),C=new Word64(0,0),v=new Word64(0,0),O=new Word64(0,0),T=new Word64(0,0);const M=new Word64(0,0),E=new Word64(0,0),D=new Word64(0,0),N=new Word64(0,0);let R,L;for(p=0;p<f;){for(m=0;m<16;++m){y[m].high=g[p]<<24|g[p+1]<<16|g[p+2]<<8|g[p+3];y[m].low=g[p+4]<<24|g[p+5]<<16|g[p+6]<<8|g[p+7];p+=8}for(m=16;m<80;++m){R=y[m];littleSigmaPrime(R,y[m-2],N);R.add(y[m-7]);littleSigma(D,y[m-15],N);R.add(D);R.add(y[m-16])}w.assign(n);S.assign(i);x.assign(s);k.assign(o);C.assign(c);v.assign(l);O.assign(h);T.assign(u);for(m=0;m<80;++m){M.assign(T);sigmaPrime(D,C,N);M.add(D);ch(D,C,v,O,N);M.add(D);M.add(e[m]);M.add(y[m]);sigma(E,w,N);maj(D,w,S,x,N);E.add(D);R=T;T=O;O=v;v=C;k.add(M);C=k;k=x;x=S;S=w;R.assign(M);R.add(E);w=R}n.add(w);i.add(S);s.add(x);o.add(k);c.add(C);l.add(v);h.add(O);u.add(T)}if(d){L=new Uint8Array(48);n.copyTo(L,0);i.copyTo(L,8);s.copyTo(L,16);o.copyTo(L,24);c.copyTo(L,32);l.copyTo(L,40)}else{L=new Uint8Array(64);n.copyTo(L,0);i.copyTo(L,8);s.copyTo(L,16);o.copyTo(L,24);c.copyTo(L,32);l.copyTo(L,40);h.copyTo(L,48);u.copyTo(L,56)}return L}}();t.calculateSHA512=c;function calculateSHA384(e,t,r){return c(e,t,r,!0)}class NullCipher{decryptBlock(e){return e}encrypt(e){return e}}class AESBaseCipher{constructor(){this.constructor===AESBaseCipher&&(0,a.unreachable)("Cannot initialize AESBaseCipher.");this._s=new Uint8Array([99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22]);this._inv_s=new Uint8Array([82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125]);this._mix=new Uint32Array([0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795]);this._mixCol=new Uint8Array(256);for(let e=0;e<256;e++)this._mixCol[e]=e<128?e<<1:e<<1^27;this.buffer=new Uint8Array(16);this.bufferPosition=0}_expandKey(e){(0,a.unreachable)("Cannot call `_expandKey` on the base class")}_decrypt(e,t){let r,a,n;const i=new Uint8Array(16);i.set(e);for(let e=0,r=this._keySize;e<16;++e,++r)i[e]^=t[r];for(let e=this._cyclesOfRepetition-1;e>=1;--e){r=i[13];i[13]=i[9];i[9]=i[5];i[5]=i[1];i[1]=r;r=i[14];a=i[10];i[14]=i[6];i[10]=i[2];i[6]=r;i[2]=a;r=i[15];a=i[11];n=i[7];i[15]=i[3];i[11]=r;i[7]=a;i[3]=n;for(let e=0;e<16;++e)i[e]=this._inv_s[i[e]];for(let r=0,a=16*e;r<16;++r,++a)i[r]^=t[a];for(let e=0;e<16;e+=4){const t=this._mix[i[e]],a=this._mix[i[e+1]],n=this._mix[i[e+2]],s=this._mix[i[e+3]];r=t^a>>>8^a<<24^n>>>16^n<<16^s>>>24^s<<8;i[e]=r>>>24&255;i[e+1]=r>>16&255;i[e+2]=r>>8&255;i[e+3]=255&r}}r=i[13];i[13]=i[9];i[9]=i[5];i[5]=i[1];i[1]=r;r=i[14];a=i[10];i[14]=i[6];i[10]=i[2];i[6]=r;i[2]=a;r=i[15];a=i[11];n=i[7];i[15]=i[3];i[11]=r;i[7]=a;i[3]=n;for(let e=0;e<16;++e){i[e]=this._inv_s[i[e]];i[e]^=t[e]}return i}_encrypt(e,t){const r=this._s;let a,n,i;const s=new Uint8Array(16);s.set(e);for(let e=0;e<16;++e)s[e]^=t[e];for(let e=1;e<this._cyclesOfRepetition;e++){for(let e=0;e<16;++e)s[e]=r[s[e]];i=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=i;i=s[2];n=s[6];s[2]=s[10];s[6]=s[14];s[10]=i;s[14]=n;i=s[3];n=s[7];a=s[11];s[3]=s[15];s[7]=i;s[11]=n;s[15]=a;for(let e=0;e<16;e+=4){const t=s[e+0],r=s[e+1],n=s[e+2],i=s[e+3];a=t^r^n^i;s[e+0]^=a^this._mixCol[t^r];s[e+1]^=a^this._mixCol[r^n];s[e+2]^=a^this._mixCol[n^i];s[e+3]^=a^this._mixCol[i^t]}for(let r=0,a=16*e;r<16;++r,++a)s[r]^=t[a]}for(let e=0;e<16;++e)s[e]=r[s[e]];i=s[1];s[1]=s[5];s[5]=s[9];s[9]=s[13];s[13]=i;i=s[2];n=s[6];s[2]=s[10];s[6]=s[14];s[10]=i;s[14]=n;i=s[3];n=s[7];a=s[11];s[3]=s[15];s[7]=i;s[11]=n;s[15]=a;for(let e=0,r=this._keySize;e<16;++e,++r)s[e]^=t[r];return s}_decryptBlock2(e,t){const r=e.length;let a=this.buffer,n=this.bufferPosition;const i=[];let s=this.iv;for(let t=0;t<r;++t){a[n]=e[t];++n;if(n<16)continue;const r=this._decrypt(a,this._key);for(let e=0;e<16;++e)r[e]^=s[e];s=a;i.push(r);a=new Uint8Array(16);n=0}this.buffer=a;this.bufferLength=n;this.iv=s;if(0===i.length)return new Uint8Array(0);let o=16*i.length;if(t){const e=i.at(-1);let t=e[15];if(t<=16){for(let r=15,a=16-t;r>=a;--r)if(e[r]!==t){t=0;break}o-=t;i[i.length-1]=e.subarray(0,16-t)}}const c=new Uint8Array(o);for(let e=0,t=0,r=i.length;e<r;++e,t+=16)c.set(i[e],t);return c}decryptBlock(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const a=e.length,n=this.buffer;let i=this.bufferPosition;if(r)this.iv=r;else{for(let t=0;i<16&&t<a;++t,++i)n[i]=e[t];if(i<16){this.bufferLength=i;return new Uint8Array(0)}this.iv=n;e=e.subarray(16)}this.buffer=new Uint8Array(16);this.bufferLength=0;this.decryptBlock=this._decryptBlock2;return this.decryptBlock(e,t)}encrypt(e,t){const r=e.length;let a=this.buffer,n=this.bufferPosition;const i=[];t||(t=new Uint8Array(16));for(let s=0;s<r;++s){a[n]=e[s];++n;if(n<16)continue;for(let e=0;e<16;++e)a[e]^=t[e];const r=this._encrypt(a,this._key);t=r;i.push(r);a=new Uint8Array(16);n=0}this.buffer=a;this.bufferLength=n;this.iv=t;if(0===i.length)return new Uint8Array(0);const s=16*i.length,o=new Uint8Array(s);for(let e=0,t=0,r=i.length;e<r;++e,t+=16)o.set(i[e],t);return o}}class AES128Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=10;this._keySize=160;this._rcon=new Uint8Array([141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141,1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145,57,114,228,211,189,97,194,159,37,74,148,51,102,204,131,29,58,116,232,203,141]);this._key=this._expandKey(e)}_expandKey(e){const t=this._s,r=this._rcon,a=new Uint8Array(176);a.set(e);for(let e=16,n=1;e<176;++n){let i=a[e-3],s=a[e-2],o=a[e-1],c=a[e-4];i=t[i];s=t[s];o=t[o];c=t[c];i^=r[n];for(let t=0;t<4;++t){a[e]=i^=a[e-16];e++;a[e]=s^=a[e-16];e++;a[e]=o^=a[e-16];e++;a[e]=c^=a[e-16];e++}}return a}}t.AES128Cipher=AES128Cipher;class AES256Cipher extends AESBaseCipher{constructor(e){super();this._cyclesOfRepetition=14;this._keySize=224;this._key=this._expandKey(e)}_expandKey(e){const t=this._s,r=new Uint8Array(240);r.set(e);let a,n,i,s,o=1;for(let e=32,c=1;e<240;++c){if(e%32==16){a=t[a];n=t[n];i=t[i];s=t[s]}else if(e%32==0){a=r[e-3];n=r[e-2];i=r[e-1];s=r[e-4];a=t[a];n=t[n];i=t[i];s=t[s];a^=o;(o<<=1)>=256&&(o=255&(27^o))}for(let t=0;t<4;++t){r[e]=a^=r[e-32];e++;r[e]=n^=r[e-32];e++;r[e]=i^=r[e-32];e++;r[e]=s^=r[e-32];e++}}return r}}t.AES256Cipher=AES256Cipher;class PDF17{checkOwnerPassword(e,t,r,n){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(r,e.length+t.length);const s=o(i,0,i.length);return(0,a.isArrayEqual)(s,n)}checkUserPassword(e,t,r){const n=new Uint8Array(e.length+8);n.set(e,0);n.set(t,e.length);const i=o(n,0,n.length);return(0,a.isArrayEqual)(i,r)}getOwnerKey(e,t,r,a){const n=new Uint8Array(e.length+56);n.set(e,0);n.set(t,e.length);n.set(r,e.length+t.length);const i=o(n,0,n.length);return new AES256Cipher(i).decryptBlock(a,!1,new Uint8Array(16))}getUserKey(e,t,r){const a=new Uint8Array(e.length+8);a.set(e,0);a.set(t,e.length);const n=o(a,0,a.length);return new AES256Cipher(n).decryptBlock(r,!1,new Uint8Array(16))}}t.PDF17=PDF17;const l=function PDF20Closure(){function calculatePDF20Hash(e,t,r){let a=o(t,0,t.length).subarray(0,32),n=[0],i=0;for(;i<64||n.at(-1)>i-32;){const t=e.length+a.length+r.length,s=new Uint8Array(t);let l=0;s.set(e,l);l+=e.length;s.set(a,l);l+=a.length;s.set(r,l);const h=new Uint8Array(64*t);for(let e=0,r=0;e<64;e++,r+=t)h.set(s,r);n=new AES128Cipher(a.subarray(0,16)).encrypt(h,a.subarray(16,32));let u=0;for(let e=0;e<16;e++){u*=1;u%=3;u+=(n[e]>>>0)%3;u%=3}0===u?a=o(n,0,n.length):1===u?a=calculateSHA384(n,0,n.length):2===u&&(a=c(n,0,n.length));i++}return a.subarray(0,32)}return class PDF20{hash(e,t,r){return calculatePDF20Hash(e,t,r)}checkOwnerPassword(e,t,r,n){const i=new Uint8Array(e.length+56);i.set(e,0);i.set(t,e.length);i.set(r,e.length+t.length);const s=calculatePDF20Hash(e,i,r);return(0,a.isArrayEqual)(s,n)}checkUserPassword(e,t,r){const n=new Uint8Array(e.length+8);n.set(e,0);n.set(t,e.length);const i=calculatePDF20Hash(e,n,[]);return(0,a.isArrayEqual)(i,r)}getOwnerKey(e,t,r,a){const n=new Uint8Array(e.length+56);n.set(e,0);n.set(t,e.length);n.set(r,e.length+t.length);const i=calculatePDF20Hash(e,n,r);return new AES256Cipher(i).decryptBlock(a,!1,new Uint8Array(16))}getUserKey(e,t,r){const a=new Uint8Array(e.length+8);a.set(e,0);a.set(t,e.length);const n=calculatePDF20Hash(e,a,[]);return new AES256Cipher(n).decryptBlock(r,!1,new Uint8Array(16))}}}();t.PDF20=l;class CipherTransform{constructor(e,t){this.StringCipherConstructor=e;this.StreamCipherConstructor=t}createStream(e,t){const r=new this.StreamCipherConstructor;return new i.DecryptStream(e,t,(function cipherTransformDecryptStream(e,t){return r.decryptBlock(e,t)}))}decryptString(e){const t=new this.StringCipherConstructor;let r=(0,a.stringToBytes)(e);r=t.decryptBlock(r,!0);return(0,a.bytesToString)(r)}encryptString(e){const t=new this.StringCipherConstructor;if(t instanceof AESBaseCipher){const r=16-e.length%16;e+=String.fromCharCode(r).repeat(r);const n=new Uint8Array(16);if("undefined"!=typeof crypto)crypto.getRandomValues(n);else for(let e=0;e<16;e++)n[e]=Math.floor(256*Math.random());let i=(0,a.stringToBytes)(e);i=t.encrypt(i,n);const s=new Uint8Array(16+i.length);s.set(n);s.set(i,16);return(0,a.bytesToString)(s)}let r=(0,a.stringToBytes)(e);r=t.encrypt(r);return(0,a.bytesToString)(r)}}const h=function CipherTransformFactoryClosure(){const e=new Uint8Array([40,191,78,94,78,117,138,65,100,0,78,86,255,250,1,8,46,46,0,182,208,104,62,128,47,12,169,254,100,83,105,122]);function prepareKeyData(t,r,a,n,i,o,c,l){const h=40+a.length+t.length,u=new Uint8Array(h);let d,f,g=0;if(r){f=Math.min(32,r.length);for(;g<f;++g)u[g]=r[g]}d=0;for(;g<32;)u[g++]=e[d++];for(d=0,f=a.length;d<f;++d)u[g++]=a[d];u[g++]=255&i;u[g++]=i>>8&255;u[g++]=i>>16&255;u[g++]=i>>>24&255;for(d=0,f=t.length;d<f;++d)u[g++]=t[d];if(o>=4&&!l){u[g++]=255;u[g++]=255;u[g++]=255;u[g++]=255}let p=s(u,0,g);const m=c>>3;if(o>=3)for(d=0;d<50;++d)p=s(p,0,m);const b=p.subarray(0,m);let y,w;if(o>=3){for(g=0;g<32;++g)u[g]=e[g];for(d=0,f=t.length;d<f;++d)u[g++]=t[d];y=new ARCFourCipher(b);w=y.encryptBlock(s(u,0,g));f=b.length;const r=new Uint8Array(f);for(d=1;d<=19;++d){for(let e=0;e<f;++e)r[e]=b[e]^d;y=new ARCFourCipher(r);w=y.encryptBlock(w)}for(d=0,f=w.length;d<f;++d)if(n[d]!==w[d])return null}else{y=new ARCFourCipher(b);w=y.encryptBlock(e);for(d=0,f=w.length;d<f;++d)if(n[d]!==w[d])return null}return b}const t=n.Name.get("Identity");function buildObjectKey(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const n=new Uint8Array(r.length+9),i=r.length;let o;for(o=0;o<i;++o)n[o]=r[o];n[o++]=255&e;n[o++]=e>>8&255;n[o++]=e>>16&255;n[o++]=255&t;n[o++]=t>>8&255;if(a){n[o++]=115;n[o++]=65;n[o++]=108;n[o++]=84}const c=s(n,0,o);return c.subarray(0,Math.min(r.length+5,16))}function buildCipherConstructor(e,t,r,i,s){if(!(t instanceof n.Name))throw new a.FormatError("Invalid crypt filter name.");const o=e.get(t.name);let c;null!=o&&(c=o.get("CFM"));if(!c||"None"===c.name)return function cipherTransformFactoryBuildCipherConstructorNone(){return new NullCipher};if("V2"===c.name)return function cipherTransformFactoryBuildCipherConstructorV2(){return new ARCFourCipher(buildObjectKey(r,i,s,!1))};if("AESV2"===c.name)return function cipherTransformFactoryBuildCipherConstructorAESV2(){return new AES128Cipher(buildObjectKey(r,i,s,!0))};if("AESV3"===c.name)return function cipherTransformFactoryBuildCipherConstructorAESV3(){return new AES256Cipher(s)};throw new a.FormatError("Unknown crypto method")}return class CipherTransformFactory{constructor(r,i,o){const c=r.get("Filter");if(!(0,n.isName)(c,"Standard"))throw new a.FormatError("unknown encryption method");this.filterName=c.name;this.dict=r;const h=r.get("V");if(!Number.isInteger(h)||1!==h&&2!==h&&4!==h&&5!==h)throw new a.FormatError("unsupported encryption algorithm");this.algorithm=h;let u=r.get("Length");if(!u)if(h<=3)u=40;else{const e=r.get("CF"),t=r.get("StmF");if(e instanceof n.Dict&&t instanceof n.Name){e.suppressEncryption=!0;const r=e.get(t.name);u=r&&r.get("Length")||128;u<40&&(u<<=3)}}if(!Number.isInteger(u)||u<40||u%8!=0)throw new a.FormatError("invalid key length");const d=(0,a.stringToBytes)(r.get("O")).subarray(0,32),f=(0,a.stringToBytes)(r.get("U")).subarray(0,32),g=r.get("P"),p=r.get("R"),m=(4===h||5===h)&&!1!==r.get("EncryptMetadata");this.encryptMetadata=m;const b=(0,a.stringToBytes)(i);let y,w;if(o){if(6===p)try{o=(0,a.utf8StringToString)(o)}catch(e){(0,a.warn)("CipherTransformFactory: Unable to convert UTF8 encoded password.")}y=(0,a.stringToBytes)(o)}if(5!==h)w=prepareKeyData(b,y,d,f,g,p,u,m);else{const e=(0,a.stringToBytes)(r.get("O")).subarray(32,40),t=(0,a.stringToBytes)(r.get("O")).subarray(40,48),n=(0,a.stringToBytes)(r.get("U")).subarray(0,48),i=(0,a.stringToBytes)(r.get("U")).subarray(32,40),s=(0,a.stringToBytes)(r.get("U")).subarray(40,48),o=(0,a.stringToBytes)(r.get("OE")),c=(0,a.stringToBytes)(r.get("UE"));(0,a.stringToBytes)(r.get("Perms"));w=function createEncryptionKey20(e,t,r,a,n,i,s,o,c,h,u,d){if(t){const e=Math.min(127,t.length);t=t.subarray(0,e)}else t=[];let f;f=6===e?new l:new PDF17;return f.checkUserPassword(t,o,s)?f.getUserKey(t,c,u):t.length&&f.checkOwnerPassword(t,a,i,r)?f.getOwnerKey(t,n,i,h):null}(p,y,d,e,t,n,f,i,s,o,c)}if(!w&&!o)throw new a.PasswordException("No password given",a.PasswordResponses.NEED_PASSWORD);if(!w&&o){const t=function decodeUserPassword(t,r,a,n){const i=new Uint8Array(32);let o=0;const c=Math.min(32,t.length);for(;o<c;++o)i[o]=t[o];let l=0;for(;o<32;)i[o++]=e[l++];let h=s(i,0,o);const u=n>>3;if(a>=3)for(l=0;l<50;++l)h=s(h,0,h.length);let d,f;if(a>=3){f=r;const e=new Uint8Array(u);for(l=19;l>=0;l--){for(let t=0;t<u;++t)e[t]=h[t]^l;d=new ARCFourCipher(e);f=d.encryptBlock(f)}}else{d=new ARCFourCipher(h.subarray(0,u));f=d.encryptBlock(r)}return f}(y,d,p,u);w=prepareKeyData(b,t,d,f,g,p,u,m)}if(!w)throw new a.PasswordException("Incorrect Password",a.PasswordResponses.INCORRECT_PASSWORD);this.encryptionKey=w;if(h>=4){const e=r.get("CF");e instanceof n.Dict&&(e.suppressEncryption=!0);this.cf=e;this.stmf=r.get("StmF")||t;this.strf=r.get("StrF")||t;this.eff=r.get("EFF")||this.stmf}}createCipherTransform(e,t){if(4===this.algorithm||5===this.algorithm)return new CipherTransform(buildCipherConstructor(this.cf,this.strf,e,t,this.encryptionKey),buildCipherConstructor(this.cf,this.stmf,e,t,this.encryptionKey));const r=buildObjectKey(e,t,this.encryptionKey,!1),a=function buildCipherCipherConstructor(){return new ARCFourCipher(r)};return new CipherTransform(a,a)}}}();t.CipherTransformFactory=h},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DecryptStream=void 0;var a=r(147);class DecryptStream extends a.DecodeStream{constructor(e,t,r){super(t);this.str=e;this.dict=e.dict;this.decrypt=r;this.nextChunk=null;this.initialized=!1}readBlock(){let e;if(this.initialized)e=this.nextChunk;else{e=this.str.getBytes(512);this.initialized=!0}if(!e||0===e.length){this.eof=!0;return}this.nextChunk=this.str.getBytes(512);const t=this.nextChunk&&this.nextChunk.length>0;e=(0,this.decrypt)(e,!t);let r=this.bufferLength;const a=e.length,n=this.ensureBuffer(r+a);for(let t=0;t<a;t++)n[r++]=e[t];this.bufferLength=r}}t.DecryptStream=DecryptStream},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Catalog=void 0;var a=r(134),n=r(2),i=r(133),s=r(198),o=r(135),c=r(199),l=r(142),h=r(200),u=r(187),d=r(201),f=r(202);function fetchDestination(e){e instanceof i.Dict&&(e=e.get("D"));return Array.isArray(e)?e:null}class Catalog{constructor(e,t){this.pdfManager=e;this.xref=t;this._catDict=t.getCatalogObj();if(!(this._catDict instanceof i.Dict))throw new n.FormatError("Catalog object is not a dictionary.");this.toplevelPagesDict;this._actualNumPages=null;this.fontCache=new i.RefSetCache;this.builtInCMapCache=new Map;this.standardFontDataCache=new Map;this.globalImageCache=new u.GlobalImageCache;this.pageKidsCountCache=new i.RefSetCache;this.pageIndexCache=new i.RefSetCache;this.nonBlendModesSet=new i.RefSet}get version(){const e=this._catDict.get("Version");return(0,n.shadow)(this,"version",e instanceof i.Name?e.name:null)}get lang(){const e=this._catDict.get("Lang");return(0,n.shadow)(this,"lang","string"==typeof e?(0,n.stringToPDFString)(e):null)}get needsRendering(){const e=this._catDict.get("NeedsRendering");return(0,n.shadow)(this,"needsRendering","boolean"==typeof e&&e)}get collection(){let e=null;try{const t=this._catDict.get("Collection");t instanceof i.Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.info)("Cannot fetch Collection entry; assuming no collection is present.")}return(0,n.shadow)(this,"collection",e)}get acroForm(){let e=null;try{const t=this._catDict.get("AcroForm");t instanceof i.Dict&&t.size>0&&(e=t)}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.info)("Cannot fetch AcroForm entry; assuming no forms are present.")}return(0,n.shadow)(this,"acroForm",e)}get acroFormRef(){const e=this._catDict.getRaw("AcroForm");return(0,n.shadow)(this,"acroFormRef",e instanceof i.Ref?e:null)}get metadata(){const e=this._catDict.getRaw("Metadata");if(!(e instanceof i.Ref))return(0,n.shadow)(this,"metadata",null);let t=null;try{const r=!(this.xref.encrypt&&this.xref.encrypt.encryptMetadata),a=this.xref.fetch(e,r);if(a instanceof o.BaseStream&&a.dict instanceof i.Dict){const e=a.dict.get("Type"),r=a.dict.get("Subtype");if((0,i.isName)(e,"Metadata")&&(0,i.isName)(r,"XML")){const e=(0,n.stringToUTF8String)(a.getString());e&&(t=new d.MetadataParser(e).serializable)}}}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.info)(`Skipping invalid Metadata: "${e}".`)}return(0,n.shadow)(this,"metadata",t)}get markInfo(){let e=null;try{e=this._readMarkInfo()}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.warn)("Unable to read mark info.")}return(0,n.shadow)(this,"markInfo",e)}_readMarkInfo(){const e=this._catDict.get("MarkInfo");if(!(e instanceof i.Dict))return null;const t={Marked:!1,UserProperties:!1,Suspects:!1};for(const r in t){const a=e.get(r);"boolean"==typeof a&&(t[r]=a)}return t}get structTreeRoot(){let e=null;try{e=this._readStructTreeRoot()}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.warn)("Unable read to structTreeRoot info.")}return(0,n.shadow)(this,"structTreeRoot",e)}_readStructTreeRoot(){const e=this._catDict.get("StructTreeRoot");if(!(e instanceof i.Dict))return null;const t=new f.StructTreeRoot(e);t.init();return t}get toplevelPagesDict(){const e=this._catDict.get("Pages");if(!(e instanceof i.Dict))throw new n.FormatError("Invalid top-level pages dictionary.");return(0,n.shadow)(this,"toplevelPagesDict",e)}get documentOutline(){let e=null;try{e=this._readDocumentOutline()}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.warn)("Unable to read document outline.")}return(0,n.shadow)(this,"documentOutline",e)}_readDocumentOutline(){let e=this._catDict.get("Outlines");if(!(e instanceof i.Dict))return null;e=e.getRaw("First");if(!(e instanceof i.Ref))return null;const t={items:[]},r=[{obj:e,parent:t}],a=new i.RefSet;a.put(e);const s=this.xref,o=new Uint8ClampedArray(3);for(;r.length>0;){const t=r.shift(),c=s.fetchIfRef(t.obj);if(null===c)continue;if(!c.has("Title"))throw new n.FormatError("Invalid outline item encountered.");const h={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:c,resultObj:h,docBaseUrl:this.pdfManager.docBaseUrl});const u=c.get("Title"),d=c.get("F")||0,f=c.getArray("C"),g=c.get("Count");let p=o;!Array.isArray(f)||3!==f.length||0===f[0]&&0===f[1]&&0===f[2]||(p=l.ColorSpace.singletons.rgb.getRgb(f,0));const m={action:h.action,dest:h.dest,url:h.url,unsafeUrl:h.unsafeUrl,newWindow:h.newWindow,setOCGState:h.setOCGState,title:(0,n.stringToPDFString)(u),color:p,count:Number.isInteger(g)?g:void 0,bold:!!(2&d),italic:!!(1&d),items:[]};t.parent.items.push(m);e=c.getRaw("First");if(e instanceof i.Ref&&!a.has(e)){r.push({obj:e,parent:m});a.put(e)}e=c.getRaw("Next");if(e instanceof i.Ref&&!a.has(e)){r.push({obj:e,parent:t.parent});a.put(e)}}return t.items.length>0?t.items:null}get permissions(){let e=null;try{e=this._readPermissions()}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.warn)("Unable to read permissions.")}return(0,n.shadow)(this,"permissions",e)}_readPermissions(){const e=this.xref.trailer.get("Encrypt");if(!(e instanceof i.Dict))return null;let t=e.get("P");if("number"!=typeof t)return null;t+=2**32;const r=[];for(const e in n.PermissionFlag){const a=n.PermissionFlag[e];t&a&&r.push(a)}return r}get optionalContentConfig(){let e=null;try{const t=this._catDict.get("OCProperties");if(!t)return(0,n.shadow)(this,"optionalContentConfig",null);const r=t.get("D");if(!r)return(0,n.shadow)(this,"optionalContentConfig",null);const a=t.get("OCGs");if(!Array.isArray(a))return(0,n.shadow)(this,"optionalContentConfig",null);const s=[],o=[];for(const e of a){if(!(e instanceof i.Ref))continue;o.push(e);const t=this.xref.fetchIfRef(e);s.push({id:e.toString(),name:"string"==typeof t.get("Name")?(0,n.stringToPDFString)(t.get("Name")):null,intent:"string"==typeof t.get("Intent")?(0,n.stringToPDFString)(t.get("Intent")):null})}e=this._readOptionalContentConfig(r,o);e.groups=s}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.warn)(`Unable to read optional content config: ${e}`)}return(0,n.shadow)(this,"optionalContentConfig",e)}_readOptionalContentConfig(e,t){function parseOnOff(e){const r=[];if(Array.isArray(e))for(const a of e)a instanceof i.Ref&&t.includes(a)&&r.push(a.toString());return r}function parseOrder(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!Array.isArray(e))return null;const n=[];for(const s of e){if(s instanceof i.Ref&&t.includes(s)){a.put(s);n.push(s.toString());continue}const e=parseNestedOrder(s,r);e&&n.push(e)}if(r>0)return n;const s=[];for(const e of t)a.has(e)||s.push(e.toString());s.length&&n.push({name:null,order:s});return n}function parseNestedOrder(e,t){if(++t>s){(0,n.warn)("parseNestedOrder - reached MAX_NESTED_LEVELS.");return null}const a=r.fetchIfRef(e);if(!Array.isArray(a))return null;const i=r.fetchIfRef(a[0]);if("string"!=typeof i)return null;const o=parseOrder(a.slice(1),t);return o&&o.length?{name:(0,n.stringToPDFString)(i),order:o}:null}const r=this.xref,a=new i.RefSet,s=10;return{name:"string"==typeof e.get("Name")?(0,n.stringToPDFString)(e.get("Name")):null,creator:"string"==typeof e.get("Creator")?(0,n.stringToPDFString)(e.get("Creator")):null,baseState:e.get("BaseState")instanceof i.Name?e.get("BaseState").name:null,on:parseOnOff(e.get("ON")),off:parseOnOff(e.get("OFF")),order:parseOrder(e.get("Order")),groups:null}}setActualNumPages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._actualNumPages=e}get hasActualNumPages(){return null!==this._actualNumPages}get _pagesCount(){const e=this.toplevelPagesDict.get("Count");if(!Number.isInteger(e))throw new n.FormatError("Page count in top-level pages dictionary is not an integer.");return(0,n.shadow)(this,"_pagesCount",e)}get numPages(){return this.hasActualNumPages?this._actualNumPages:this._pagesCount}get destinations(){const e=this._readDests(),t=Object.create(null);if(e instanceof s.NameTree)for(const[r,a]of e.getAll()){const e=fetchDestination(a);e&&(t[(0,n.stringToPDFString)(r)]=e)}else e instanceof i.Dict&&e.forEach((function(e,r){const a=fetchDestination(r);a&&(t[e]=a)}));return(0,n.shadow)(this,"destinations",t)}getDestination(e){const t=this._readDests();if(t instanceof s.NameTree){const r=fetchDestination(t.get(e));if(r)return r;const a=this.destinations[e];if(a){(0,n.warn)(`Found "${e}" at an incorrect position in the NameTree.`);return a}}else if(t instanceof i.Dict){const r=fetchDestination(t.get(e));if(r)return r}return null}_readDests(){const e=this._catDict.get("Names");return e&&e.has("Dests")?new s.NameTree(e.getRaw("Dests"),this.xref):this._catDict.has("Dests")?this._catDict.get("Dests"):void 0}get pageLabels(){let e=null;try{e=this._readPageLabels()}catch(e){if(e instanceof a.MissingDataException)throw e;(0,n.warn)("Unable to read page labels.")}return(0,n.shadow)(this,"pageLabels",e)}_readPageLabels(){const e=this._catDict.getRaw("PageLabels");if(!e)return null;const t=new Array(this.numPages);let r=null,o="";const c=new s.NumberTree(e,this.xref).getAll();let l="",h=1;for(let e=0,s=this.numPages;e<s;e++){const s=c.get(e);if(void 0!==s){if(!(s instanceof i.Dict))throw new n.FormatError("PageLabel is not a dictionary.");if(s.has("Type")&&!(0,i.isName)(s.get("Type"),"PageLabel"))throw new n.FormatError("Invalid type in PageLabel dictionary.");if(s.has("S")){const e=s.get("S");if(!(e instanceof i.Name))throw new n.FormatError("Invalid style in PageLabel dictionary.");r=e.name}else r=null;if(s.has("P")){const e=s.get("P");if("string"!=typeof e)throw new n.FormatError("Invalid prefix in PageLabel dictionary.");o=(0,n.stringToPDFString)(e)}else o="";if(s.has("St")){const e=s.get("St");if(!(Number.isInteger(e)&&e>=1))throw new n.FormatError("Invalid start in PageLabel dictionary.");h=e}else h=1}switch(r){case"D":l=h;break;case"R":case"r":l=(0,a.toRomanNumerals)(h,"r"===r);break;case"A":case"a":const e=26,t=65,i=97,s="a"===r?i:t,o=h-1;l=String.fromCharCode(s+o%e).repeat(Math.floor(o/e)+1);break;default:if(r)throw new n.FormatError(`Invalid style "${r}" in PageLabel dictionary.`);l=""}t[e]=o+l;h++}return t}get pageLayout(){const e=this._catDict.get("PageLayout");let t="";if(e instanceof i.Name)switch(e.name){case"SinglePage":case"OneColumn":case"TwoColumnLeft":case"TwoColumnRight":case"TwoPageLeft":case"TwoPageRight":t=e.name}return(0,n.shadow)(this,"pageLayout",t)}get pageMode(){const e=this._catDict.get("PageMode");let t="UseNone";if(e instanceof i.Name)switch(e.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"FullScreen":case"UseOC":case"UseAttachments":t=e.name}return(0,n.shadow)(this,"pageMode",t)}get viewerPreferences(){const e=this._catDict.get("ViewerPreferences");if(!(e instanceof i.Dict))return(0,n.shadow)(this,"viewerPreferences",null);let t=null;for(const r of e.getKeys()){const a=e.get(r);let s;switch(r){case"HideToolbar":case"HideMenubar":case"HideWindowUI":case"FitWindow":case"CenterWindow":case"DisplayDocTitle":case"PickTrayByPDFSize":"boolean"==typeof a&&(s=a);break;case"NonFullScreenPageMode":if(a instanceof i.Name)switch(a.name){case"UseNone":case"UseOutlines":case"UseThumbs":case"UseOC":s=a.name;break;default:s="UseNone"}break;case"Direction":if(a instanceof i.Name)switch(a.name){case"L2R":case"R2L":s=a.name;break;default:s="L2R"}break;case"ViewArea":case"ViewClip":case"PrintArea":case"PrintClip":if(a instanceof i.Name)switch(a.name){case"MediaBox":case"CropBox":case"BleedBox":case"TrimBox":case"ArtBox":s=a.name;break;default:s="CropBox"}break;case"PrintScaling":if(a instanceof i.Name)switch(a.name){case"None":case"AppDefault":s=a.name;break;default:s="AppDefault"}break;case"Duplex":if(a instanceof i.Name)switch(a.name){case"Simplex":case"DuplexFlipShortEdge":case"DuplexFlipLongEdge":s=a.name;break;default:s="None"}break;case"PrintPageRange":if(Array.isArray(a)&&a.length%2==0){a.every(((e,t,r)=>Number.isInteger(e)&&e>0&&(0===t||e>=r[t-1])&&e<=this.numPages))&&(s=a)}break;case"NumCopies":Number.isInteger(a)&&a>0&&(s=a);break;default:(0,n.warn)(`Ignoring non-standard key in ViewerPreferences: ${r}.`);continue}if(void 0!==s){t||(t=Object.create(null));t[r]=s}else(0,n.warn)(`Bad value, for key "${r}", in ViewerPreferences: ${a}.`)}return(0,n.shadow)(this,"viewerPreferences",t)}get openAction(){const e=this._catDict.get("OpenAction"),t=Object.create(null);if(e instanceof i.Dict){const r=new i.Dict(this.xref);r.set("A",e);const a={url:null,dest:null,action:null};Catalog.parseDestDictionary({destDict:r,resultObj:a});Array.isArray(a.dest)?t.dest=a.dest:a.action&&(t.action=a.action)}else Array.isArray(e)&&(t.dest=e);return(0,n.shadow)(this,"openAction",(0,n.objectSize)(t)>0?t:null)}get attachments(){const e=this._catDict.get("Names");let t=null;if(e instanceof i.Dict&&e.has("EmbeddedFiles")){const r=new s.NameTree(e.getRaw("EmbeddedFiles"),this.xref);for(const[e,a]of r.getAll()){const r=new h.FileSpec(a,this.xref);t||(t=Object.create(null));t[(0,n.stringToPDFString)(e)]=r.serializable}}return(0,n.shadow)(this,"attachments",t)}get xfaImages(){const e=this._catDict.get("Names");let t=null;if(e instanceof i.Dict&&e.has("XFAImages")){const r=new s.NameTree(e.getRaw("XFAImages"),this.xref);for(const[e,a]of r.getAll()){t||(t=new i.Dict(this.xref));t.set((0,n.stringToPDFString)(e),a)}}return(0,n.shadow)(this,"xfaImages",t)}_collectJavaScript(){const e=this._catDict.get("Names");let t=null;function appendIfJavaScriptDict(e,r){if(!(r instanceof i.Dict))return;if(!(0,i.isName)(r.get("S"),"JavaScript"))return;let a=r.get("JS");if(a instanceof o.BaseStream)a=a.getString();else if("string"!=typeof a)return;null===t&&(t=new Map);a=(0,n.stringToPDFString)(a).replace(/\u0000/g,"");t.set(e,a)}if(e instanceof i.Dict&&e.has("JavaScript")){const t=new s.NameTree(e.getRaw("JavaScript"),this.xref);for(const[e,r]of t.getAll())appendIfJavaScriptDict((0,n.stringToPDFString)(e),r)}const r=this._catDict.get("OpenAction");r&&appendIfJavaScriptDict("OpenAction",r);return t}get javaScript(){const e=this._collectJavaScript();return(0,n.shadow)(this,"javaScript",e?[...e.values()]:null)}get jsActions(){const e=this._collectJavaScript();let t=(0,a.collectActions)(this.xref,this._catDict,n.DocumentActionEventType);if(e){t||(t=Object.create(null));for(const[r,a]of e)r in t?t[r].push(a):t[r]=[a]}return(0,n.shadow)(this,"jsActions",t)}async fontFallback(e,t){const r=await Promise.all(this.fontCache);for(const a of r)if(a.loadedName===e){a.fallback(t);return}}async cleanup(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(0,c.clearGlobalCaches)();this.globalImageCache.clear(e);this.pageKidsCountCache.clear();this.pageIndexCache.clear();this.nonBlendModesSet.clear();const t=await Promise.all(this.fontCache);for(const{dict:e}of t)delete e.cacheKey;this.fontCache.clear();this.builtInCMapCache.clear();this.standardFontDataCache.clear()}async getPageDict(e){const t=[this.toplevelPagesDict],r=new i.RefSet,a=this._catDict.getRaw("Pages");a instanceof i.Ref&&r.put(a);const s=this.xref,o=this.pageKidsCountCache,c=this.pageIndexCache;let l=0;for(;t.length;){const a=t.pop();if(a instanceof i.Ref){const h=o.get(a);if(h>=0&&l+h<=e){l+=h;continue}if(r.has(a))throw new n.FormatError("Pages tree contains circular reference.");r.put(a);const u=await s.fetchAsync(a);if(u instanceof i.Dict){let t=u.getRaw("Type");t instanceof i.Ref&&(t=await s.fetchAsync(t));if((0,i.isName)(t,"Page")||!u.has("Kids")){o.has(a)||o.put(a,1);c.has(a)||c.put(a,l);if(l===e)return[u,a];l++;continue}}t.push(u);continue}if(!(a instanceof i.Dict))throw new n.FormatError("Page dictionary kid reference points to wrong type of object.");const{objId:h}=a;let u=a.getRaw("Count");u instanceof i.Ref&&(u=await s.fetchAsync(u));if(Number.isInteger(u)&&u>=0){h&&!o.has(h)&&o.put(h,u);if(l+u<=e){l+=u;continue}}let d=a.getRaw("Kids");d instanceof i.Ref&&(d=await s.fetchAsync(d));if(!Array.isArray(d)){let t=a.getRaw("Type");t instanceof i.Ref&&(t=await s.fetchAsync(t));if((0,i.isName)(t,"Page")||!a.has("Kids")){if(l===e)return[a,null];l++;continue}throw new n.FormatError("Page dictionary kids object is not an array.")}for(let e=d.length-1;e>=0;e--)t.push(d[e])}throw new Error(`Page index ${e} not found.`)}async getAllPageDicts(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=[{currentNode:this.toplevelPagesDict,posInKids:0}],r=new i.RefSet,s=this._catDict.getRaw("Pages");s instanceof i.Ref&&r.put(s);const o=new Map,c=this.xref,l=this.pageIndexCache;let h=0;function addPageDict(e,t){t&&!l.has(t)&&l.put(t,h);o.set(h++,[e,t])}function addPageError(t){if(t instanceof a.XRefEntryException&&!e)throw t;o.set(h++,[t,null])}for(;t.length>0;){const e=t.at(-1),{currentNode:a,posInKids:s}=e;let o=a.getRaw("Kids");if(o instanceof i.Ref)try{o=await c.fetchAsync(o)}catch(e){addPageError(e);break}if(!Array.isArray(o)){addPageError(new n.FormatError("Page dictionary kids object is not an array."));break}if(s>=o.length){t.pop();continue}const l=o[s];let h;if(l instanceof i.Ref){if(r.has(l)){addPageError(new n.FormatError("Pages tree contains circular reference."));break}r.put(l);try{h=await c.fetchAsync(l)}catch(e){addPageError(e);break}}else h=l;if(!(h instanceof i.Dict)){addPageError(new n.FormatError("Page dictionary kid reference points to wrong type of object."));break}let u=h.getRaw("Type");if(u instanceof i.Ref)try{u=await c.fetchAsync(u)}catch(e){addPageError(e);break}(0,i.isName)(u,"Page")||!h.has("Kids")?addPageDict(h,l instanceof i.Ref?l:null):t.push({currentNode:h,posInKids:0});e.posInKids++}return o}getPageIndex(e){const t=this.pageIndexCache.get(e);if(void 0!==t)return Promise.resolve(t);const r=this.xref;let a=0;const next=t=>function pagesBeforeRef(t){let a,s=0;return r.fetchAsync(t).then((function(r){if((0,i.isRefsEqual)(t,e)&&!(0,i.isDict)(r,"Page")&&!(r instanceof i.Dict&&!r.has("Type")&&r.has("Contents")))throw new n.FormatError("The reference does not point to a /Page dictionary.");if(!r)return null;if(!(r instanceof i.Dict))throw new n.FormatError("Node must be a dictionary.");a=r.getRaw("Parent");return r.getAsync("Parent")})).then((function(e){if(!e)return null;if(!(e instanceof i.Dict))throw new n.FormatError("Parent must be a dictionary.");return e.getAsync("Kids")})).then((function(e){if(!e)return null;const o=[];let c=!1;for(let a=0,l=e.length;a<l;a++){const l=e[a];if(!(l instanceof i.Ref))throw new n.FormatError("Kid must be a reference.");if((0,i.isRefsEqual)(l,t)){c=!0;break}o.push(r.fetchAsync(l).then((function(e){if(!(e instanceof i.Dict))throw new n.FormatError("Kid node must be a dictionary.");e.has("Count")?s+=e.get("Count"):s++})))}if(!c)throw new n.FormatError("Kid reference not found in parent's kids.");return Promise.all(o).then((function(){return[s,a]}))}))}(t).then((t=>{if(!t){this.pageIndexCache.put(e,a);return a}const[r,n]=t;a+=r;return next(n)}));return next(e)}get baseUrl(){const e=this._catDict.get("URI");if(e instanceof i.Dict){const t=e.get("Base");if("string"==typeof t){const e=(0,n.createValidAbsoluteUrl)(t,null,{tryConvertEncoding:!0});if(e)return(0,n.shadow)(this,"baseUrl",e.href)}}return(0,n.shadow)(this,"baseUrl",null)}static parseDestDictionary(e){const t=e.destDict;if(!(t instanceof i.Dict)){(0,n.warn)("parseDestDictionary: `destDict` must be a dictionary.");return}const r=e.resultObj;if("object"!=typeof r){(0,n.warn)("parseDestDictionary: `resultObj` must be an object.");return}const s=e.docBaseUrl||null;let c,l,h=t.get("A");if(!(h instanceof i.Dict))if(t.has("Dest"))h=t.get("Dest");else{h=t.get("AA");h instanceof i.Dict&&(h.has("D")?h=h.get("D"):h.has("U")&&(h=h.get("U")))}if(h instanceof i.Dict){const e=h.get("S");if(!(e instanceof i.Name)){(0,n.warn)("parseDestDictionary: Invalid type in Action dictionary.");return}const t=e.name;switch(t){case"ResetForm":const e=h.get("Flags"),s=0==(1&("number"==typeof e?e:0)),u=[],d=[];for(const e of h.get("Fields")||[])e instanceof i.Ref?d.push(e.toString()):"string"==typeof e&&u.push((0,n.stringToPDFString)(e));r.resetForm={fields:u,refs:d,include:s};break;case"URI":c=h.get("URI");c instanceof i.Name&&(c="/"+c.name);break;case"GoTo":l=h.get("D");break;case"Launch":case"GoToR":const f=h.get("F");f instanceof i.Dict?c=f.get("F")||null:"string"==typeof f&&(c=f);let g=h.get("D");if(g){g instanceof i.Name&&(g=g.name);if("string"==typeof c){const e=c.split("#")[0];"string"==typeof g?c=e+"#"+g:Array.isArray(g)&&(c=e+"#"+JSON.stringify(g))}}const p=h.get("NewWindow");"boolean"==typeof p&&(r.newWindow=p);break;case"Named":const m=h.get("N");m instanceof i.Name&&(r.action=m.name);break;case"SetOCGState":const b=h.get("State"),y=h.get("PreserveRB");if(!Array.isArray(b)||0===b.length)break;const w=[];for(const e of b)if(e instanceof i.Name)switch(e.name){case"ON":case"OFF":case"Toggle":w.push(e.name)}else e instanceof i.Ref&&w.push(e.toString());if(w.length!==b.length)break;r.setOCGState={state:w,preserveRB:"boolean"!=typeof y||y};break;case"JavaScript":const S=h.get("JS");let x;S instanceof o.BaseStream?x=S.getString():"string"==typeof S&&(x=S);const k=x&&(0,a.recoverJsURL)((0,n.stringToPDFString)(x));if(k){c=k.url;r.newWindow=k.newWindow;break}default:if("JavaScript"===t||"SubmitForm"===t)break;(0,n.warn)(`parseDestDictionary - unsupported action: "${t}".`)}}else t.has("Dest")&&(l=t.get("Dest"));if("string"==typeof c){const e=(0,n.createValidAbsoluteUrl)(c,s,{addDefaultProtocol:!0,tryConvertEncoding:!0});e&&(r.url=e.href);r.unsafeUrl=c}if(l){l instanceof i.Name&&(l=l.name);"string"==typeof l?r.dest=(0,n.stringToPDFString)(l):Array.isArray(l)&&(r.dest=l)}}}t.Catalog=Catalog},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NumberTree=t.NameTree=void 0;var a=r(133),n=r(2);class NameOrNumberTree{constructor(e,t,r){this.constructor===NameOrNumberTree&&(0,n.unreachable)("Cannot initialize NameOrNumberTree.");this.root=e;this.xref=t;this._type=r}getAll(){const e=new Map;if(!this.root)return e;const t=this.xref,r=new a.RefSet;r.put(this.root);const i=[this.root];for(;i.length>0;){const s=t.fetchIfRef(i.shift());if(!(s instanceof a.Dict))continue;if(s.has("Kids")){const e=s.get("Kids");if(!Array.isArray(e))continue;for(const t of e){if(r.has(t))throw new n.FormatError(`Duplicate entry in "${this._type}" tree.`);i.push(t);r.put(t)}continue}const o=s.get(this._type);if(Array.isArray(o))for(let r=0,a=o.length;r<a;r+=2)e.set(t.fetchIfRef(o[r]),t.fetchIfRef(o[r+1]))}return e}get(e){if(!this.root)return null;const t=this.xref;let r=t.fetchIfRef(this.root),a=0;for(;r.has("Kids");){if(++a>10){(0,n.warn)(`Search depth limit reached for "${this._type}" tree.`);return null}const i=r.get("Kids");if(!Array.isArray(i))return null;let s=0,o=i.length-1;for(;s<=o;){const a=s+o>>1,n=t.fetchIfRef(i[a]),c=n.get("Limits");if(e<t.fetchIfRef(c[0]))o=a-1;else{if(!(e>t.fetchIfRef(c[1]))){r=n;break}s=a+1}}if(s>o)return null}const i=r.get(this._type);if(Array.isArray(i)){let r=0,a=i.length-2;for(;r<=a;){const n=r+a>>1,s=n+(1&n),o=t.fetchIfRef(i[s]);if(e<o)a=s-2;else{if(!(e>o))return t.fetchIfRef(i[s+1]);r=s+2}}}return null}}t.NameTree=class NameTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Names")}};t.NumberTree=class NumberTree extends NameOrNumberTree{constructor(e,t){super(e,t,"Nums")}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.clearGlobalCaches=function clearGlobalCaches(){(0,a.clearPrimitiveCaches)();(0,n.clearUnicodeCaches)()};var a=r(133),n=r(168)},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FileSpec=void 0;var a=r(2),n=r(135),i=r(133);function pickPlatformItem(e){return e.has("UF")?e.get("UF"):e.has("F")?e.get("F"):e.has("Unix")?e.get("Unix"):e.has("Mac")?e.get("Mac"):e.has("DOS")?e.get("DOS"):null}t.FileSpec=class FileSpec{constructor(e,t){if(e instanceof i.Dict){this.xref=t;this.root=e;e.has("FS")&&(this.fs=e.get("FS"));this.description=e.has("Desc")?(0,a.stringToPDFString)(e.get("Desc")):"";e.has("RF")&&(0,a.warn)("Related file specifications are not supported");this.contentAvailable=!0;if(!e.has("EF")){this.contentAvailable=!1;(0,a.warn)("Non-embedded file specifications are not supported")}}}get filename(){if(!this._filename&&this.root){const e=pickPlatformItem(this.root)||"unnamed";this._filename=(0,a.stringToPDFString)(e).replace(/\\\\/g,"\\").replace(/\\\//g,"/").replace(/\\/g,"/")}return this._filename}get content(){if(!this.contentAvailable)return null;!this.contentRef&&this.root&&(this.contentRef=pickPlatformItem(this.root.get("EF")));let e=null;if(this.contentRef){const t=this.xref.fetchIfRef(this.contentRef);t instanceof n.BaseStream?e=t.getBytes():(0,a.warn)("Embedded file specification points to non-existing/invalid content")}else(0,a.warn)("Embedded file specification does not have a content");return e}get serializable(){return{filename:this.filename,content:this.content}}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MetadataParser=void 0;var a=r(194);t.MetadataParser=class MetadataParser{constructor(e){e=this._repair(e);const t=new a.SimpleXMLParser({lowerCaseName:!0}).parseFromString(e);this._metadataMap=new Map;this._data=e;t&&this._parse(t)}_repair(e){return e.replace(/^[^<]+/,"").replace(/>\\376\\377([^<]+)/g,(function(e,t){const r=t.replace(/\\([0-3])([0-7])([0-7])/g,(function(e,t,r,a){return String.fromCharCode(64*t+8*r+1*a)})).replace(/&(amp|apos|gt|lt|quot);/g,(function(e,t){switch(t){case"amp":return"&";case"apos":return"'";case"gt":return">";case"lt":return"<";case"quot":return'"'}throw new Error(`_repair: ${t} isn't defined.`)})),a=[];for(let e=0,t=r.length;e<t;e+=2){const t=256*r.charCodeAt(e)+r.charCodeAt(e+1);t>=32&&t<127&&60!==t&&62!==t&&38!==t?a.push(String.fromCharCode(t)):a.push("&#x"+(65536+t).toString(16).substring(1)+";")}return">"+a.join("")}))}_getSequence(e){const t=e.nodeName;return"rdf:bag"!==t&&"rdf:seq"!==t&&"rdf:alt"!==t?null:e.childNodes.filter((e=>"rdf:li"===e.nodeName))}_parseArray(e){if(!e.hasChildNodes())return;const[t]=e.childNodes,r=this._getSequence(t)||[];this._metadataMap.set(e.nodeName,r.map((e=>e.textContent.trim())))}_parse(e){let t=e.documentElement;if("rdf:rdf"!==t.nodeName){t=t.firstChild;for(;t&&"rdf:rdf"!==t.nodeName;)t=t.nextSibling}if(t&&"rdf:rdf"===t.nodeName&&t.hasChildNodes())for(const e of t.childNodes)if("rdf:description"===e.nodeName)for(const t of e.childNodes){const e=t.nodeName;switch(e){case"#text":continue;case"dc:creator":case"dc:subject":this._parseArray(t);continue}this._metadataMap.set(e,t.textContent.trim())}}get serializable(){return{parsedData:this._metadataMap,rawData:this._data}}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StructTreeRoot=t.StructTreePage=void 0;var a=r(133),n=r(2),i=r(198);const s="PAGE_CONTENT",o="STREAM_CONTENT",c="OBJECT",l="ELEMENT";t.StructTreeRoot=class StructTreeRoot{constructor(e){this.dict=e;this.roleMap=new Map}init(){this.readRoleMap()}readRoleMap(){const e=this.dict.get("RoleMap");e instanceof a.Dict&&e.forEach(((e,t)=>{t instanceof a.Name&&this.roleMap.set(e,t.name)}))}};class StructElementNode{constructor(e,t){this.tree=e;this.dict=t;this.kids=[];this.parseKids()}get role(){const e=this.dict.get("S"),t=e instanceof a.Name?e.name:"",{root:r}=this.tree;return r.roleMap.has(t)?r.roleMap.get(t):t}parseKids(){let e=null;const t=this.dict.getRaw("Pg");t instanceof a.Ref&&(e=t.toString());const r=this.dict.get("K");if(Array.isArray(r))for(const t of r){const r=this.parseKid(e,t);r&&this.kids.push(r)}else{const t=this.parseKid(e,r);t&&this.kids.push(t)}}parseKid(e,t){if(Number.isInteger(t))return this.tree.pageDict.objId!==e?null:new StructElement({type:s,mcid:t,pageObjId:e});let r=null;t instanceof a.Ref?r=this.dict.xref.fetch(t):t instanceof a.Dict&&(r=t);if(!r)return null;const n=r.getRaw("Pg");n instanceof a.Ref&&(e=n.toString());const i=r.get("Type")instanceof a.Name?r.get("Type").name:null;return"MCR"===i?this.tree.pageDict.objId!==e?null:new StructElement({type:o,refObjId:r.getRaw("Stm")instanceof a.Ref?r.getRaw("Stm").toString():null,pageObjId:e,mcid:r.get("MCID")}):"OBJR"===i?this.tree.pageDict.objId!==e?null:new StructElement({type:c,refObjId:r.getRaw("Obj")instanceof a.Ref?r.getRaw("Obj").toString():null,pageObjId:e}):new StructElement({type:l,dict:r})}}class StructElement{constructor(e){let{type:t,dict:r=null,mcid:a=null,pageObjId:n=null,refObjId:i=null}=e;this.type=t;this.dict=r;this.mcid=a;this.pageObjId=n;this.refObjId=i;this.parentNode=null}}t.StructTreePage=class StructTreePage{constructor(e,t){this.root=e;this.rootDict=e?e.dict:null;this.pageDict=t;this.nodes=[]}parse(){if(!this.root||!this.rootDict)return;const e=this.rootDict.get("ParentTree");if(!e)return;const t=this.pageDict.get("StructParents");if(!Number.isInteger(t))return;const r=new i.NumberTree(e,this.rootDict.xref).get(t);if(!Array.isArray(r))return;const n=new Map;for(const e of r)e instanceof a.Ref&&this.addNode(this.rootDict.xref.fetch(e),n)}addNode(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r>40){(0,n.warn)("StructTree MAX_DEPTH reached.");return null}if(t.has(e))return t.get(e);const i=new StructElementNode(this,e);t.set(e,i);const s=e.get("P");if(!s||(0,a.isName)(s.get("Type"),"StructTreeRoot")){this.addTopLevelNode(e,i)||t.delete(e);return i}const o=this.addNode(s,t,r+1);if(!o)return i;let c=!1;for(const t of o.kids)if(t.type===l&&t.dict===e){t.parentNode=i;c=!0}c||t.delete(e);return i}addTopLevelNode(e,t){const r=this.rootDict.get("K");if(!r)return!1;if(r instanceof a.Dict){if(r.objId!==e.objId)return!1;this.nodes[0]=t;return!0}if(!Array.isArray(r))return!0;let n=!1;for(let a=0;a<r.length;a++){const i=r[a];if(i&&i.toString()===e.objId){this.nodes[a]=t;n=!0}}return n}get serializable(){function nodeToSerializable(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r>40){(0,n.warn)("StructTree too deep to be fully serialized.");return}const a=Object.create(null);a.role=e.role;a.children=[];t.children.push(a);const i=e.dict.get("Alt");"string"==typeof i&&(a.alt=(0,n.stringToPDFString)(i));const h=e.dict.get("Lang");"string"==typeof h&&(a.lang=(0,n.stringToPDFString)(h));for(const t of e.kids){const e=t.type===l?t.parentNode:null;e?nodeToSerializable(e,a,r+1):t.type===s||t.type===o?a.children.push({type:"content",id:`page${t.pageObjId}_mcid${t.mcid}`}):t.type===c&&a.children.push({type:"object",id:t.refObjId})}}const e=Object.create(null);e.children=[];e.role="Root";for(const t of this.nodes)t&&nodeToSerializable(t,e);return e}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ObjectLoader=void 0;var a=r(133),n=r(135),i=r(134),s=r(2);function addChildren(e,t){if(e instanceof a.Dict)e=e.getRawValues();else if(e instanceof n.BaseStream)e=e.dict.getRawValues();else if(!Array.isArray(e))return;for(const i of e)((r=i)instanceof a.Ref||r instanceof a.Dict||r instanceof n.BaseStream||Array.isArray(r))&&t.push(i);var r}t.ObjectLoader=class ObjectLoader{constructor(e,t,r){this.dict=e;this.keys=t;this.xref=r;this.refSet=null}async load(){if(this.xref.stream.isDataLoaded)return;const{keys:e,dict:t}=this;this.refSet=new a.RefSet;const r=[];for(let a=0,n=e.length;a<n;a++){const n=t.getRaw(e[a]);void 0!==n&&r.push(n)}return this._walk(r)}async _walk(e){const t=[],r=[];for(;e.length;){let o=e.pop();if(o instanceof a.Ref){if(this.refSet.has(o))continue;try{this.refSet.put(o);o=this.xref.fetch(o)}catch(e){if(!(e instanceof i.MissingDataException)){(0,s.warn)(`ObjectLoader._walk - requesting all data: "${e}".`);this.refSet=null;const{manager:t}=this.xref.stream;return t.requestAllChunks()}t.push(o);r.push({begin:e.begin,end:e.end})}}if(o instanceof n.BaseStream){const e=o.getBaseStreams();if(e){let a=!1;for(const t of e)if(!t.isDataLoaded){a=!0;r.push({begin:t.start,end:t.end})}a&&t.push(o)}}addChildren(o,e)}if(r.length){await this.xref.stream.manager.requestRanges(r);for(const e of t)e instanceof a.Ref&&this.refSet.remove(e);return this._walk(t)}this.refSet=null}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XFAFactory=void 0;var a=r(205),n=r(209),i=r(215),s=r(213),o=r(206),c=r(2),l=r(216),h=r(226);class XFAFactory{constructor(e){try{this.root=(new l.XFAParser).parse(XFAFactory._createDocument(e));const t=new n.Binder(this.root);this.form=t.bind();this.dataHandler=new i.DataHandler(this.root,t.getData());this.form[a.$globalData].template=this.form}catch(e){(0,c.warn)(`XFA - an error occurred during parsing and binding: ${e}`)}}isValid(){return this.root&&this.form}_createPagesHelper(){const e=this.form[a.$toPages]();return new Promise(((t,r)=>{const nextIteration=()=>{try{const r=e.next();r.done?t(r.value):setTimeout(nextIteration,0)}catch(e){r(e)}};setTimeout(nextIteration,0)}))}async _createPages(){try{this.pages=await this._createPagesHelper();this.dims=this.pages.children.map((e=>{const{width:t,height:r}=e.attributes.style;return[0,0,parseInt(t),parseInt(r)]}))}catch(e){(0,c.warn)(`XFA - an error occurred during layout: ${e}`)}}getBoundingBox(e){return this.dims[e]}async getNumPages(){this.pages||await this._createPages();return this.dims.length}setImages(e){this.form[a.$globalData].images=e}setFonts(e){this.form[a.$globalData].fontFinder=new s.FontFinder(e);const t=[];for(let e of this.form[a.$globalData].usedTypefaces){e=(0,o.stripQuotes)(e);this.form[a.$globalData].fontFinder.find(e)||t.push(e)}return t.length>0?t:null}appendFonts(e,t){this.form[a.$globalData].fontFinder.add(e,t)}async getPages(){this.pages||await this._createPages();const e=this.pages;this.pages=null;return e}serializeData(e){return this.dataHandler.serialize(e)}static _createDocument(e){return e["/xdp:xdp"]?Object.values(e).join(""):e["xdp:xdp"]}static getRichTextAsHtml(e){if(!e||"string"!=typeof e)return null;try{let t=new l.XFAParser(h.XhtmlNamespace,!0).parse(e);if(!["body","xhtml"].includes(t[a.$nodeName])){const e=h.XhtmlNamespace.body({});e[a.$appendChild](t);t=e}const r=t[a.$toHTML]();if(!r.success)return null;const{html:n}=r,{attributes:i}=n;if(i){i.class&&(i.class=i.class.filter((e=>!e.startsWith("xfa"))));i.dir="auto"}return{html:n,str:t[a.$text]()}}catch(e){(0,c.warn)(`XFA - an error occurred during parsing of rich text: ${e}`)}return null}}t.XFAFactory=XFAFactory},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XmlObject=t.XFAObjectArray=t.XFAObject=t.XFAAttribute=t.StringObject=t.OptionObject=t.Option10=t.Option01=t.IntegerObject=t.ContentObject=t.$uid=t.$toStyle=t.$toString=t.$toPages=t.$toHTML=t.$text=t.$tabIndex=t.$setValue=t.$setSetAttributes=t.$setId=t.$searchNode=t.$root=t.$resolvePrototypes=t.$removeChild=t.$pushPara=t.$pushGlyphs=t.$popPara=t.$onText=t.$onChildCheck=t.$onChild=t.$nsAttributes=t.$nodeName=t.$namespaceId=t.$isUsable=t.$isTransparent=t.$isThereMoreWidth=t.$isSplittable=t.$isNsAgnostic=t.$isDescendent=t.$isDataValue=t.$isCDATAXml=t.$isBindable=t.$insertAt=t.$indexOf=t.$ids=t.$hasSettableValue=t.$globalData=t.$getTemplateRoot=t.$getSubformParent=t.$getRealChildrenByNameIt=t.$getParent=t.$getNextPage=t.$getExtra=t.$getDataValue=t.$getContainedChildren=t.$getChildrenByNameIt=t.$getChildrenByName=t.$getChildrenByClass=t.$getChildren=t.$getAvailableSpace=t.$getAttributes=t.$getAttributeIt=t.$flushHTML=t.$finalize=t.$extra=t.$dump=t.$data=t.$content=t.$consumed=t.$clone=t.$cleanup=t.$cleanPage=t.$clean=t.$childrenToHTML=t.$appendChild=t.$addHTML=t.$acceptWhitespace=void 0;var a=r(206),n=r(2),i=r(134),s=r(207),o=r(208);const c=Symbol();t.$acceptWhitespace=c;const l=Symbol();t.$addHTML=l;const h=Symbol();t.$appendChild=h;const u=Symbol();t.$childrenToHTML=u;const d=Symbol();t.$clean=d;const f=Symbol();t.$cleanPage=f;const g=Symbol();t.$cleanup=g;const p=Symbol();t.$clone=p;const m=Symbol();t.$consumed=m;const b=Symbol("content");t.$content=b;const y=Symbol("data");t.$data=y;const w=Symbol();t.$dump=w;const S=Symbol("extra");t.$extra=S;const x=Symbol();t.$finalize=x;const k=Symbol();t.$flushHTML=k;const C=Symbol();t.$getAttributeIt=C;const v=Symbol();t.$getAttributes=v;const O=Symbol();t.$getAvailableSpace=O;const T=Symbol();t.$getChildrenByClass=T;const M=Symbol();t.$getChildrenByName=M;const E=Symbol();t.$getChildrenByNameIt=E;const D=Symbol();t.$getDataValue=D;const N=Symbol();t.$getExtra=N;const R=Symbol();t.$getRealChildrenByNameIt=R;const L=Symbol();t.$getChildren=L;const j=Symbol();t.$getContainedChildren=j;const $=Symbol();t.$getNextPage=$;const _=Symbol();t.$getSubformParent=_;const U=Symbol();t.$getParent=U;const X=Symbol();t.$getTemplateRoot=X;const H=Symbol();t.$globalData=H;const q=Symbol();t.$hasSettableValue=q;const z=Symbol();t.$ids=z;const W=Symbol();t.$indexOf=W;const G=Symbol();t.$insertAt=G;const V=Symbol();t.$isCDATAXml=V;const K=Symbol();t.$isBindable=K;const Y=Symbol();t.$isDataValue=Y;const J=Symbol();t.$isDescendent=J;const Z=Symbol();t.$isNsAgnostic=Z;const Q=Symbol();t.$isSplittable=Q;const ee=Symbol();t.$isThereMoreWidth=ee;const te=Symbol();t.$isTransparent=te;const re=Symbol();t.$isUsable=re;const ae=Symbol(),ne=Symbol("namespaceId");t.$namespaceId=ne;const ie=Symbol("nodeName");t.$nodeName=ie;const se=Symbol();t.$nsAttributes=se;const oe=Symbol();t.$onChild=oe;const ce=Symbol();t.$onChildCheck=ce;const le=Symbol();t.$onText=le;const he=Symbol();t.$pushGlyphs=he;const ue=Symbol();t.$popPara=ue;const de=Symbol();t.$pushPara=de;const fe=Symbol();t.$removeChild=fe;const ge=Symbol("root");t.$root=ge;const pe=Symbol();t.$resolvePrototypes=pe;const me=Symbol();t.$searchNode=me;const be=Symbol();t.$setId=be;const ye=Symbol();t.$setSetAttributes=ye;const we=Symbol();t.$setValue=we;const Se=Symbol();t.$tabIndex=Se;const xe=Symbol();t.$text=xe;const Ae=Symbol();t.$toPages=Ae;const ke=Symbol();t.$toHTML=ke;const Ce=Symbol();t.$toString=Ce;const ve=Symbol();t.$toStyle=ve;const Fe=Symbol("uid");t.$uid=Fe;const Oe=Symbol(),Te=Symbol(),Ie=Symbol(),Pe=Symbol("_children"),Me=Symbol(),Ee=Symbol(),De=Symbol(),Ne=Symbol(),Be=Symbol(),Re=Symbol(),Le=Symbol(),je=Symbol(),$e=Symbol(),_e=Symbol("parent"),Ue=Symbol(),Xe=Symbol(),He=Symbol();let qe=0;const ze=s.NamespaceIds.datasets.id;class XFAObject{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this[ne]=e;this[ie]=t;this[Le]=r;this[_e]=null;this[Pe]=[];this[Fe]=`${t}${qe++}`;this[H]=null}[oe](e){if(!this[Le]||!this[ce](e))return!1;const t=e[ie],r=this[t];if(!(r instanceof XFAObjectArray)){null!==r&&this[fe](r);this[t]=e;this[h](e);return!0}if(r.push(e)){this[h](e);return!0}let a="";this.id?a=` (id: ${this.id})`:this.name&&(a=` (name: ${this.name} ${this.h.value})`);(0,n.warn)(`XFA - node "${this[ie]}"${a} has already enough "${t}"!`);return!1}[ce](e){return this.hasOwnProperty(e[ie])&&e[ne]===this[ne]}[Z](){return!1}[c](){return!1}[V](){return!1}[K](){return!1}[ue](){this.para&&this[X]()[S].paraStack.pop()}[de](){this[X]()[S].paraStack.push(this.para)}[be](e){this.id&&this[ne]===s.NamespaceIds.template.id&&e.set(this.id,this)}[X](){return this[H].template}[Q](){return!1}[ee](){return!1}[h](e){e[_e]=this;this[Pe].push(e);!e[H]&&this[H]&&(e[H]=this[H])}[fe](e){const t=this[Pe].indexOf(e);this[Pe].splice(t,1)}[q](){return this.hasOwnProperty("value")}[we](e){}[le](e){}[x](){}[d](e){delete this[Le];if(this[g]){e.clean(this[g]);delete this[g]}}[W](e){return this[Pe].indexOf(e)}[G](e,t){t[_e]=this;this[Pe].splice(e,0,t);!t[H]&&this[H]&&(t[H]=this[H])}[te](){return!this.name}[ae](){return""}[xe](){return 0===this[Pe].length?this[b]:this[Pe].map((e=>e[xe]())).join("")}get[Ie](){const e=Object.getPrototypeOf(this);if(!e._attributes){const t=e._attributes=new Set;for(const e of Object.getOwnPropertyNames(this)){if(null===this[e]||this[e]instanceof XFAObject||this[e]instanceof XFAObjectArray)break;t.add(e)}}return(0,n.shadow)(this,Ie,e._attributes)}[J](e){let t=this;for(;t;){if(t===e)return!0;t=t[U]()}return!1}[U](){return this[_e]}[_](){return this[U]()}[L](){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?this[e]:this[Pe]}[w](){const e=Object.create(null);this[b]&&(e.$content=this[b]);for(const t of Object.getOwnPropertyNames(this)){const r=this[t];null!==r&&(r instanceof XFAObject?e[t]=r[w]():r instanceof XFAObjectArray?r.isEmpty()||(e[t]=r.dump()):e[t]=r)}return e}[ve](){return null}[ke](){return a.HTMLResult.EMPTY}*[j](){for(const e of this[L]())yield e}*[Ne](e,t){for(const r of this[j]())if(!e||t===e.has(r[ie])){const e=this[O](),t=r[ke](e);t.success||(this[S].failingNode=r);yield t}}[k](){return null}[l](e,t){this[S].children.push(e)}[O](){}[u](e){let{filter:t=null,include:r=!0}=e;if(this[S].generator){const e=this[O](),t=this[S].failingNode[ke](e);if(!t.success)return t;t.html&&this[l](t.html,t.bbox);delete this[S].failingNode}else this[S].generator=this[Ne](t,r);for(;;){const e=this[S].generator.next();if(e.done)break;const t=e.value;if(!t.success)return t;t.html&&this[l](t.html,t.bbox)}this[S].generator=null;return a.HTMLResult.EMPTY}[ye](e){this[Xe]=new Set(Object.keys(e))}[Re](e){const t=this[Ie],r=this[Xe];return[...e].filter((e=>t.has(e)&&!r.has(e)))}[pe](e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;for(const r of this[Pe])r[Ue](e,t)}[Ue](e,t){const r=this[Be](e,t);r?this[Oe](r,e,t):this[pe](e,t)}[Be](e,t){const{use:r,usehref:a}=this;if(!r&&!a)return null;let i=null,s=null,c=null,l=r;if(a){l=a;a.startsWith("#som(")&&a.endsWith(")")?s=a.slice("#som(".length,a.length-1):a.startsWith(".#som(")&&a.endsWith(")")?s=a.slice(".#som(".length,a.length-1):a.startsWith("#")?c=a.slice(1):a.startsWith(".#")&&(c=a.slice(2))}else r.startsWith("#")?c=r.slice(1):s=r;this.use=this.usehref="";if(c)i=e.get(c);else{i=(0,o.searchNode)(e.get(ge),this,s,!0,!1);i&&(i=i[0])}if(!i){(0,n.warn)(`XFA - Invalid prototype reference: ${l}.`);return null}if(i[ie]!==this[ie]){(0,n.warn)(`XFA - Incompatible prototype: ${i[ie]} !== ${this[ie]}.`);return null}if(t.has(i)){(0,n.warn)("XFA - Cycle detected in prototypes use.");return null}t.add(i);const h=i[Be](e,t);h&&i[Oe](h,e,t);i[pe](e,t);t.delete(i);return i}[Oe](e,t,r){if(r.has(e)){(0,n.warn)("XFA - Cycle detected in prototypes use.");return}!this[b]&&e[b]&&(this[b]=e[b]);new Set(r).add(e);for(const t of this[Re](e[Xe])){this[t]=e[t];this[Xe]&&this[Xe].add(t)}for(const a of Object.getOwnPropertyNames(this)){if(this[Ie].has(a))continue;const n=this[a],i=e[a];if(n instanceof XFAObjectArray){for(const e of n[Pe])e[Ue](t,r);for(let a=n[Pe].length,s=i[Pe].length;a<s;a++){const i=e[Pe][a][p]();if(!n.push(i))break;i[_e]=this;this[Pe].push(i);i[Ue](t,r)}}else if(null===n){if(null!==i){const e=i[p]();e[_e]=this;this[a]=e;this[Pe].push(e);e[Ue](t,r)}}else{n[pe](t,r);i&&n[Oe](i,t,r)}}}static[Me](e){return Array.isArray(e)?e.map((e=>XFAObject[Me](e))):"object"==typeof e&&null!==e?Object.assign({},e):e}[p](){const e=Object.create(Object.getPrototypeOf(this));for(const t of Object.getOwnPropertySymbols(this))try{e[t]=this[t]}catch(r){(0,n.shadow)(e,t,this[t])}e[Fe]=`${e[ie]}${qe++}`;e[Pe]=[];for(const t of Object.getOwnPropertyNames(this)){if(this[Ie].has(t)){e[t]=XFAObject[Me](this[t]);continue}const r=this[t];e[t]=r instanceof XFAObjectArray?new XFAObjectArray(r[je]):null}for(const t of this[Pe]){const r=t[ie],a=t[p]();e[Pe].push(a);a[_e]=e;null===e[r]?e[r]=a:e[r][Pe].push(a)}return e}[L](){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?this[Pe].filter((t=>t[ie]===e)):this[Pe]}[T](e){return this[e]}[M](e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return Array.from(this[E](e,t,r))}*[E](e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("parent"!==e){for(const r of this[Pe]){r[ie]===e&&(yield r);r.name===e&&(yield r);(t||r[te]())&&(yield*r[E](e,t,!1))}r&&this[Ie].has(e)&&(yield new XFAAttribute(this,e,this[e]))}else yield this[_e]}}t.XFAObject=XFAObject;class XFAObjectArray{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1/0;this[je]=e;this[Pe]=[]}push(e){if(this[Pe].length<=this[je]){this[Pe].push(e);return!0}(0,n.warn)(`XFA - node "${e[ie]}" accepts no more than ${this[je]} children`);return!1}isEmpty(){return 0===this[Pe].length}dump(){return 1===this[Pe].length?this[Pe][0][w]():this[Pe].map((e=>e[w]()))}[p](){const e=new XFAObjectArray(this[je]);e[Pe]=this[Pe].map((e=>e[p]()));return e}get children(){return this[Pe]}clear(){this[Pe].length=0}}t.XFAObjectArray=XFAObjectArray;class XFAAttribute{constructor(e,t,r){this[_e]=e;this[ie]=t;this[b]=r;this[m]=!1;this[Fe]="attribute"+qe++}[U](){return this[_e]}[Y](){return!0}[D](){return this[b].trim()}[we](e){e=e.value||"";this[b]=e.toString()}[xe](){return this[b]}[J](e){return this[_e]===e||this[_e][J](e)}}t.XFAAttribute=XFAAttribute;class XmlObject extends XFAObject{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};super(e,t);this[b]="";this[Ee]=null;if("#text"!==t){const e=new Map;this[Te]=e;for(const[t,a]of Object.entries(r))e.set(t,new XFAAttribute(this,t,a));if(r.hasOwnProperty(se)){const e=r[se].xfa.dataNode;void 0!==e&&("dataGroup"===e?this[Ee]=!1:"dataValue"===e&&(this[Ee]=!0))}}this[m]=!1}[Ce](e){const t=this[ie];if("#text"===t){e.push((0,i.encodeToXmlString)(this[b]));return}const r=(0,n.utf8StringToString)(t),a=this[ne]===ze?"xfa:":"";e.push(`<${a}${r}`);for(const[t,r]of this[Te].entries()){const a=(0,n.utf8StringToString)(t);e.push(` ${a}="${(0,i.encodeToXmlString)(r[b])}"`)}null!==this[Ee]&&(this[Ee]?e.push(' xfa:dataNode="dataValue"'):e.push(' xfa:dataNode="dataGroup"'));if(this[b]||0!==this[Pe].length){e.push(">");if(this[b])"string"==typeof this[b]?e.push((0,i.encodeToXmlString)(this[b])):this[b][Ce](e);else for(const t of this[Pe])t[Ce](e);e.push(`</${a}${r}>`)}else e.push("/>")}[oe](e){if(this[b]){const e=new XmlObject(this[ne],"#text");this[h](e);e[b]=this[b];this[b]=""}this[h](e);return!0}[le](e){this[b]+=e}[x](){if(this[b]&&this[Pe].length>0){const e=new XmlObject(this[ne],"#text");this[h](e);e[b]=this[b];delete this[b]}}[ke](){return"#text"===this[ie]?a.HTMLResult.success({name:"#text",value:this[b]}):a.HTMLResult.EMPTY}[L](){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e?this[Pe].filter((t=>t[ie]===e)):this[Pe]}[v](){return this[Te]}[T](e){const t=this[Te].get(e);return void 0!==t?t:this[L](e)}*[E](e,t){const r=this[Te].get(e);r&&(yield r);for(const r of this[Pe]){r[ie]===e&&(yield r);t&&(yield*r[E](e,t))}}*[C](e,t){const r=this[Te].get(e);!r||t&&r[m]||(yield r);for(const r of this[Pe])yield*r[C](e,t)}*[R](e,t,r){for(const a of this[Pe]){a[ie]!==e||r&&a[m]||(yield a);t&&(yield*a[R](e,t,r))}}[Y](){return null===this[Ee]?0===this[Pe].length||this[Pe][0][ne]===s.NamespaceIds.xhtml.id:this[Ee]}[D](){return null===this[Ee]?0===this[Pe].length?this[b].trim():this[Pe][0][ne]===s.NamespaceIds.xhtml.id?this[Pe][0][xe]().trim():null:this[b].trim()}[we](e){e=e.value||"";this[b]=e.toString()}[w](){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=Object.create(null);e&&(t.$ns=this[ne]);this[b]&&(t.$content=this[b]);t.$name=this[ie];t.children=[];for(const r of this[Pe])t.children.push(r[w](e));t.attributes=Object.create(null);for(const[e,r]of this[Te])t.attributes[e]=r[b];return t}}t.XmlObject=XmlObject;class ContentObject extends XFAObject{constructor(e,t){super(e,t);this[b]=""}[le](e){this[b]+=e}[x](){}}t.ContentObject=ContentObject;t.OptionObject=class OptionObject extends ContentObject{constructor(e,t,r){super(e,t);this[$e]=r}[x](){this[b]=(0,a.getKeyword)({data:this[b],defaultValue:this[$e][0],validate:e=>this[$e].includes(e)})}[d](e){super[d](e);delete this[$e]}};t.StringObject=class StringObject extends ContentObject{[x](){this[b]=this[b].trim()}};class IntegerObject extends ContentObject{constructor(e,t,r,a){super(e,t);this[De]=r;this[He]=a}[x](){this[b]=(0,a.getInteger)({data:this[b],defaultValue:this[De],validate:this[He]})}[d](e){super[d](e);delete this[De];delete this[He]}}t.IntegerObject=IntegerObject;t.Option01=class Option01 extends IntegerObject{constructor(e,t){super(e,t,0,(e=>1===e))}};t.Option10=class Option10 extends IntegerObject{constructor(e,t){super(e,t,1,(e=>0===e))}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.HTMLResult=void 0;t.getBBox=function getBBox(e){const t=-1;if(!e)return{x:t,y:t,width:t,height:t};const r=e.trim().split(/\s*,\s*/).map((e=>getMeasurement(e,"-1")));if(r.length<4||r[2]<0||r[3]<0)return{x:t,y:t,width:t,height:t};const[a,n,i,s]=r;return{x:a,y:n,width:i,height:s}};t.getColor=function getColor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],[r,a,n]=t;if(!e)return{r:r,g:a,b:n};const i=e.trim().split(/\s*,\s*/).map((e=>Math.min(Math.max(0,parseInt(e.trim(),10)),255))).map((e=>isNaN(e)?0:e));if(i.length<3)return{r:r,g:a,b:n};[r,a,n]=i;return{r:r,g:a,b:n}};t.getFloat=function getFloat(e){let{data:t,defaultValue:r,validate:a}=e;if(!t)return r;t=t.trim();const n=parseFloat(t);if(!isNaN(n)&&a(n))return n;return r};t.getInteger=function getInteger(e){let{data:t,defaultValue:r,validate:a}=e;if(!t)return r;t=t.trim();const n=parseInt(t,10);if(!isNaN(n)&&a(n))return n;return r};t.getKeyword=getKeyword;t.getMeasurement=getMeasurement;t.getRatio=function getRatio(e){if(!e)return{num:1,den:1};const t=e.trim().split(/\s*:\s*/).map((e=>parseFloat(e))).filter((e=>!isNaN(e)));1===t.length&&t.push(1);if(0===t.length)return{num:1,den:1};const[r,a]=t;return{num:r,den:a}};t.getRelevant=function getRelevant(e){if(!e)return[];return e.trim().split(/\s+/).map((e=>({excluded:"-"===e[0],viewname:e.substring(1)})))};t.getStringOption=function getStringOption(e,t){return getKeyword({data:e,defaultValue:t[0],validate:e=>t.includes(e)})};t.stripQuotes=function stripQuotes(e){if(e.startsWith("'")||e.startsWith('"'))return e.slice(1,e.length-1);return e};var a=r(2);const n={pt:e=>e,cm:e=>e/2.54*72,mm:e=>e/25.4*72,in:e=>72*e,px:e=>e},i=/([+-]?\d+\.?\d*)(.*)/;function getKeyword(e){let{data:t,defaultValue:r,validate:a}=e;if(!t)return r;t=t.trim();return a(t)?t:r}function getMeasurement(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";t=t||"0";if(!e)return getMeasurement(t);const r=e.trim().match(i);if(!r)return getMeasurement(t);const[,a,s]=r,o=parseFloat(a);if(isNaN(o))return getMeasurement(t);if(0===o)return 0;const c=n[s];return c?c(o):o}class HTMLResult{static get FAILURE(){return(0,a.shadow)(this,"FAILURE",new HTMLResult(!1,null,null,null))}static get EMPTY(){return(0,a.shadow)(this,"EMPTY",new HTMLResult(!0,null,null,null))}constructor(e,t,r,a){this.success=e;this.html=t;this.bbox=r;this.breakNode=a}isBreak(){return!!this.breakNode}static breakNode(e){return new HTMLResult(!1,null,null,e)}static success(e){return new HTMLResult(!0,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,null)}}t.HTMLResult=HTMLResult},(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NamespaceIds=t.$buildXFAObject=void 0;const r=Symbol();t.$buildXFAObject=r;t.NamespaceIds={config:{id:0,check:e=>e.startsWith("http://www.xfa.org/schema/xci/")},connectionSet:{id:1,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-connection-set/")},datasets:{id:2,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-data/")},form:{id:3,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-form/")},localeSet:{id:4,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-locale-set/")},pdf:{id:5,check:e=>"http://ns.adobe.com/xdp/pdf/"===e},signature:{id:6,check:e=>"http://www.w3.org/2000/09/xmldsig#"===e},sourceSet:{id:7,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-source-set/")},stylesheet:{id:8,check:e=>"http://www.w3.org/1999/XSL/Transform"===e},template:{id:9,check:e=>e.startsWith("http://www.xfa.org/schema/xfa-template/")},xdc:{id:10,check:e=>e.startsWith("http://www.xfa.org/schema/xdc/")},xdp:{id:11,check:e=>"http://ns.adobe.com/xdp/"===e},xfdf:{id:12,check:e=>"http://ns.adobe.com/xfdf/"===e},xhtml:{id:13,check:e=>"http://www.w3.org/1999/xhtml"===e},xmpmeta:{id:14,check:e=>"http://ns.adobe.com/xmpmeta/"===e}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.createDataNode=function createDataNode(e,t,r){const n=parseExpression(r);if(!n)return null;if(n.some((e=>e.operator===l)))return null;const s=f.get(n[0].name);let o=0;if(s){e=s(e,t);o=1}else e=t||e;for(let t=n.length;o<t;o++){const{name:t,operator:r,index:s}=n[o];if(!isFinite(s)){n[o].index=0;return createNodes(e,n.slice(o))}let u;switch(r){case c:u=e[a.$getChildrenByName](t,!1);break;case l:u=e[a.$getChildrenByName](t,!0);break;case h:u=e[a.$getChildrenByClass](t);u=u instanceof a.XFAObjectArray?u.children:[u]}if(0===u.length)return createNodes(e,n.slice(o));if(!(s<u.length)){n[o].index=s-u.length;return createNodes(e,n.slice(o))}{const t=u[s];if(!(t instanceof a.XFAObject)){(0,i.warn)("XFA - Cannot create a node.");return null}e=t}}return null};t.searchNode=function searchNode(e,t,r){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];const s=parseExpression(r,n);if(!s)return null;const o=f.get(s[0].name);let u,d=0;if(o){u=!0;e=[o(e,t)];d=1}else{u=null===t;e=[t||e]}for(let r=s.length;d<r;d++){const{name:r,cacheName:n,operator:o,index:f}=s[d],p=[];for(const t of e){if(!(t instanceof a.XFAObject))continue;let e,s;if(i){s=g.get(t);if(!s){s=new Map;g.set(t,s)}e=s.get(n)}if(!e){switch(o){case c:e=t[a.$getChildrenByName](r,!1);break;case l:e=t[a.$getChildrenByName](r,!0);break;case h:e=t[a.$getChildrenByClass](r);e=e instanceof a.XFAObjectArray?e.children:[e]}i&&s.set(n,e)}e.length>0&&p.push(e)}if(0!==p.length||u||0!==d)e=isFinite(f)?p.filter((e=>f<e.length)).map((e=>e[f])):p.flat();else{const r=t[a.$getParent]();if(!(t=r))return null;d=-1;e=[t]}}if(0===e.length)return null;return e};var a=r(205),n=r(207),i=r(2);const s=/^[^.[]+/,o=/^[^\]]+/,c=0,l=1,h=2,u=3,d=4,f=new Map([["$data",(e,t)=>e.datasets?e.datasets.data:e],["$record",(e,t)=>(e.datasets?e.datasets.data:e)[a.$getChildren]()[0]],["$template",(e,t)=>e.template],["$connectionSet",(e,t)=>e.connectionSet],["$form",(e,t)=>e.form],["$layout",(e,t)=>e.layout],["$host",(e,t)=>e.host],["$dataWindow",(e,t)=>e.dataWindow],["$event",(e,t)=>e.event],["!",(e,t)=>e.datasets],["$xfa",(e,t)=>e],["xfa",(e,t)=>e],["$",(e,t)=>t]]),g=new WeakMap,p=n.NamespaceIds.datasets.id;function parseIndex(e){return"*"===(e=e.trim())?1/0:parseInt(e,10)||0}function parseExpression(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=e.match(s);if(!a)return null;let[n]=a;const f=[{name:n,cacheName:"."+n,index:0,js:null,formCalc:null,operator:c}];let g=n.length;for(;g<e.length;){const p=g;if("["===e.charAt(g++)){a=e.slice(g).match(o);if(!a){(0,i.warn)("XFA - Invalid index in SOM expression");return null}f.at(-1).index=parseIndex(a[0]);g+=a[0].length+1;continue}let m;switch(e.charAt(g)){case".":if(!t)return null;g++;m=l;break;case"#":g++;m=h;break;case"[":if(r){(0,i.warn)("XFA - SOM expression contains a FormCalc subexpression which is not supported for now.");return null}m=u;break;case"(":if(r){(0,i.warn)("XFA - SOM expression contains a JavaScript subexpression which is not supported for now.");return null}m=d;break;default:m=c}a=e.slice(g).match(s);if(!a)break;[n]=a;g+=n.length;f.push({name:n,cacheName:e.slice(p,g),operator:m,index:0,js:null,formCalc:null})}return f}function createNodes(e,t){let r=null;for(const{name:n,index:i}of t){for(let t=0,s=isFinite(i)?i:0;t<=s;t++){const t=e[a.$namespaceId]===p?-1:e[a.$namespaceId];r=new a.XmlObject(t,n);e[a.$appendChild](r)}e=r}return r}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Binder=void 0;var a=r(205),n=r(210),i=r(208),s=r(207),o=r(2);const c=s.NamespaceIds.datasets.id;function createText(e){const t=new n.Text({});t[a.$content]=e;return t}t.Binder=class Binder{constructor(e){this.root=e;this.datasets=e.datasets;e.datasets&&e.datasets.data?this.data=e.datasets.data:this.data=new a.XmlObject(s.NamespaceIds.datasets.id,"data");this.emptyMerge=0===this.data[a.$getChildren]().length;this.root.form=this.form=e.template[a.$clone]()}_isConsumeData(){return!this.emptyMerge&&this._mergeMode}_isMatchTemplate(){return!this._isConsumeData()}bind(){this._bindElement(this.form,this.data);return this.form}getData(){return this.data}_bindValue(e,t,r){e[a.$data]=t;if(e[a.$hasSettableValue]())if(t[a.$isDataValue]()){const r=t[a.$getDataValue]();e[a.$setValue](createText(r))}else if(e instanceof n.Field&&e.ui&&e.ui.choiceList&&"multiSelect"===e.ui.choiceList.open){const r=t[a.$getChildren]().map((e=>e[a.$content].trim())).join("\n");e[a.$setValue](createText(r))}else this._isConsumeData()&&(0,o.warn)("XFA - Nodes haven't the same type.");else!t[a.$isDataValue]()||this._isMatchTemplate()?this._bindElement(e,t):(0,o.warn)("XFA - Nodes haven't the same type.")}_findDataByNameToConsume(e,t,r,n){if(!e)return null;let i,o;for(let n=0;n<3;n++){i=r[a.$getRealChildrenByNameIt](e,!1,!0);for(;;){o=i.next().value;if(!o)break;if(t===o[a.$isDataValue]())return o}if(r[a.$namespaceId]===s.NamespaceIds.datasets.id&&"data"===r[a.$nodeName])break;r=r[a.$getParent]()}if(!n)return null;i=this.data[a.$getRealChildrenByNameIt](e,!0,!1);o=i.next().value;if(o)return o;i=this.data[a.$getAttributeIt](e,!0);o=i.next().value;return o&&o[a.$isDataValue]()?o:null}_setProperties(e,t){if(e.hasOwnProperty("setProperty"))for(const{ref:r,target:s,connection:c}of e.setProperty.children){if(c)continue;if(!r)continue;const l=(0,i.searchNode)(this.root,t,r,!1,!1);if(!l){(0,o.warn)(`XFA - Invalid reference: ${r}.`);continue}const[h]=l;if(!h[a.$isDescendent](this.data)){(0,o.warn)("XFA - Invalid node: must be a data node.");continue}const u=(0,i.searchNode)(this.root,e,s,!1,!1);if(!u){(0,o.warn)(`XFA - Invalid target: ${s}.`);continue}const[d]=u;if(!d[a.$isDescendent](e)){(0,o.warn)("XFA - Invalid target: must be a property or subproperty.");continue}const f=d[a.$getParent]();if(d instanceof n.SetProperty||f instanceof n.SetProperty){(0,o.warn)("XFA - Invalid target: cannot be a setProperty or one of its properties.");continue}if(d instanceof n.BindItems||f instanceof n.BindItems){(0,o.warn)("XFA - Invalid target: cannot be a bindItems or one of its properties.");continue}const g=h[a.$text](),p=d[a.$nodeName];if(d instanceof a.XFAAttribute){const e=Object.create(null);e[p]=g;const t=Reflect.construct(Object.getPrototypeOf(f).constructor,[e]);f[p]=t[p]}else if(d.hasOwnProperty(a.$content)){d[a.$data]=h;d[a.$content]=g;d[a.$finalize]()}else(0,o.warn)("XFA - Invalid node to use in setProperty")}}_bindItems(e,t){if(!e.hasOwnProperty("items")||!e.hasOwnProperty("bindItems")||e.bindItems.isEmpty())return;for(const t of e.items.children)e[a.$removeChild](t);e.items.clear();const r=new n.Items({}),s=new n.Items({});e[a.$appendChild](r);e.items.push(r);e[a.$appendChild](s);e.items.push(s);for(const{ref:n,labelRef:c,valueRef:l,connection:h}of e.bindItems.children){if(h)continue;if(!n)continue;const e=(0,i.searchNode)(this.root,t,n,!1,!1);if(e)for(const t of e){if(!t[a.$isDescendent](this.datasets)){(0,o.warn)(`XFA - Invalid ref (${n}): must be a datasets child.`);continue}const e=(0,i.searchNode)(this.root,t,c,!0,!1);if(!e){(0,o.warn)(`XFA - Invalid label: ${c}.`);continue}const[h]=e;if(!h[a.$isDescendent](this.datasets)){(0,o.warn)("XFA - Invalid label: must be a datasets child.");continue}const u=(0,i.searchNode)(this.root,t,l,!0,!1);if(!u){(0,o.warn)(`XFA - Invalid value: ${l}.`);continue}const[d]=u;if(!d[a.$isDescendent](this.datasets)){(0,o.warn)("XFA - Invalid value: must be a datasets child.");continue}const f=createText(h[a.$text]()),g=createText(d[a.$text]());r[a.$appendChild](f);r.text.push(f);s[a.$appendChild](g);s.text.push(g)}else(0,o.warn)(`XFA - Invalid reference: ${n}.`)}}_bindOccurrences(e,t,r){let n;if(t.length>1){n=e[a.$clone]();n[a.$removeChild](n.occur);n.occur=null}this._bindValue(e,t[0],r);this._setProperties(e,t[0]);this._bindItems(e,t[0]);if(1===t.length)return;const i=e[a.$getParent](),s=e[a.$nodeName],o=i[a.$indexOf](e);for(let e=1,c=t.length;e<c;e++){const c=t[e],l=n[a.$clone]();i[s].push(l);i[a.$insertAt](o+e,l);this._bindValue(l,c,r);this._setProperties(l,c);this._bindItems(l,c)}}_createOccurrences(e){if(!this.emptyMerge)return;const{occur:t}=e;if(!t||t.initial<=1)return;const r=e[a.$getParent](),n=e[a.$nodeName];if(!(r[n]instanceof a.XFAObjectArray))return;let i;i=e.name?r[n].children.filter((t=>t.name===e.name)).length:r[n].children.length;const s=r[a.$indexOf](e)+1,o=t.initial-i;if(o){const t=e[a.$clone]();t[a.$removeChild](t.occur);t.occur=null;r[n].push(t);r[a.$insertAt](s,t);for(let e=1;e<o;e++){const i=t[a.$clone]();r[n].push(i);r[a.$insertAt](s+e,i)}}}_getOccurInfo(e){const{name:t,occur:r}=e;if(!r||!t)return[1,1];const a=-1===r.max?1/0:r.max;return[r.min,a]}_setAndBind(e,t){this._setProperties(e,t);this._bindItems(e,t);this._bindElement(e,t)}_bindElement(e,t){const r=[];this._createOccurrences(e);for(const n of e[a.$getChildren]()){if(n[a.$data])continue;if(void 0===this._mergeMode&&"subform"===n[a.$nodeName]){this._mergeMode="consumeData"===n.mergeMode;const e=t[a.$getChildren]();if(e.length>0)this._bindOccurrences(n,[e[0]],null);else if(this.emptyMerge){const e=t[a.$namespaceId]===c?-1:t[a.$namespaceId],r=n[a.$data]=new a.XmlObject(e,n.name||"root");t[a.$appendChild](r);this._bindElement(n,r)}continue}if(!n[a.$isBindable]())continue;let e=!1,s=null,l=null,h=null;if(n.bind){switch(n.bind.match){case"none":this._setAndBind(n,t);continue;case"global":e=!0;break;case"dataRef":if(!n.bind.ref){(0,o.warn)(`XFA - ref is empty in node ${n[a.$nodeName]}.`);this._setAndBind(n,t);continue}l=n.bind.ref}n.bind.picture&&(s=n.bind.picture[a.$content])}const[u,d]=this._getOccurInfo(n);if(l){h=(0,i.searchNode)(this.root,t,l,!0,!1);if(null===h){h=(0,i.createDataNode)(this.data,t,l);if(!h)continue;this._isConsumeData()&&(h[a.$consumed]=!0);this._setAndBind(n,h);continue}this._isConsumeData()&&(h=h.filter((e=>!e[a.$consumed])));h.length>d?h=h.slice(0,d):0===h.length&&(h=null);h&&this._isConsumeData()&&h.forEach((e=>{e[a.$consumed]=!0}))}else{if(!n.name){this._setAndBind(n,t);continue}if(this._isConsumeData()){const r=[];for(;r.length<d;){const i=this._findDataByNameToConsume(n.name,n[a.$hasSettableValue](),t,e);if(!i)break;i[a.$consumed]=!0;r.push(i)}h=r.length>0?r:null}else{h=t[a.$getRealChildrenByNameIt](n.name,!1,this.emptyMerge).next().value;if(!h){if(0===u){r.push(n);continue}const e=t[a.$namespaceId]===c?-1:t[a.$namespaceId];h=n[a.$data]=new a.XmlObject(e,n.name);this.emptyMerge&&(h[a.$consumed]=!0);t[a.$appendChild](h);this._setAndBind(n,h);continue}this.emptyMerge&&(h[a.$consumed]=!0);h=[h]}}h?this._bindOccurrences(n,h,s):u>0?this._setAndBind(n,t):r.push(n)}r.forEach((e=>e[a.$getParent]()[a.$removeChild](e)))}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Value=t.Text=t.TemplateNamespace=t.Template=t.SetProperty=t.Items=t.Field=t.BindItems=void 0;var a=r(205),n=r(207),i=r(211),s=r(212),o=r(206),c=r(2),l=r(213),h=r(134),u=r(208);const d=n.NamespaceIds.template.id,f="http://www.w3.org/2000/svg",g=/^H(\d+)$/,p=new Set(["image/gif","image/jpeg","image/jpg","image/pjpeg","image/png","image/apng","image/x-png","image/bmp","image/x-ms-bmp","image/tiff","image/tif","application/octet-stream"]),m=[[[66,77],"image/bmp"],[[255,216,255],"image/jpeg"],[[73,73,42,0],"image/tiff"],[[77,77,0,42],"image/tiff"],[[71,73,70,56,57,97],"image/gif"],[[137,80,78,71,13,10,26,10],"image/png"]];function getBorderDims(e){if(!e||!e.border)return{w:0,h:0};const t=e.border[a.$getExtra]();return t?{w:t.widths[0]+t.widths[2]+t.insets[0]+t.insets[2],h:t.widths[1]+t.widths[3]+t.insets[1]+t.insets[3]}:{w:0,h:0}}function hasMargin(e){return e.margin&&(e.margin.topInset||e.margin.rightInset||e.margin.bottomInset||e.margin.leftInset)}function _setValue(e,t){if(!e.value){const t=new Value({});e[a.$appendChild](t);e.value=t}e.value[a.$setValue](t)}function*getContainedChildren(e){for(const t of e[a.$getChildren]())t instanceof SubformSet?yield*t[a.$getContainedChildren]():yield t}function isRequired(e){return e.validate&&"error"===e.validate.nullTest}function setTabIndex(e){for(;e;){if(!e.traversal){e[a.$tabIndex]=e[a.$getParent]()[a.$tabIndex];return}if(e[a.$tabIndex])return;let t=null;for(const r of e.traversal[a.$getChildren]())if("next"===r.operation){t=r;break}if(!t||!t.ref){e[a.$tabIndex]=e[a.$getParent]()[a.$tabIndex];return}const r=e[a.$getTemplateRoot]();e[a.$tabIndex]=++r[a.$tabIndex];const n=r[a.$searchNode](t.ref,e);if(!n)return;e=n[0]}}function applyAssist(e,t){const r=e.assist;if(r){const e=r[a.$toHTML]();e&&(t.title=e);const n=r.role.match(g);if(n){const e="heading",r=n[1];t.role=e;t["aria-level"]=r}}if("table"===e.layout)t.role="table";else if("row"===e.layout)t.role="row";else{const r=e[a.$getParent]();"row"===r.layout&&(r.assist&&"TH"===r.assist.role?t.role="columnheader":t.role="cell")}}function ariaLabel(e){if(!e.assist)return null;const t=e.assist;return t.speak&&""!==t.speak[a.$content]?t.speak[a.$content]:t.toolTip?t.toolTip[a.$content]:null}function valueToHtml(e){return o.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:Object.create(null)},children:[{name:"span",attributes:{style:Object.create(null)},value:e}]})}function setFirstUnsplittable(e){const t=e[a.$getTemplateRoot]();if(null===t[a.$extra].firstUnsplittable){t[a.$extra].firstUnsplittable=e;t[a.$extra].noLayoutFailure=!0}}function unsetFirstUnsplittable(e){const t=e[a.$getTemplateRoot]();t[a.$extra].firstUnsplittable===e&&(t[a.$extra].noLayoutFailure=!1)}function handleBreak(e){if(e[a.$extra])return!1;e[a.$extra]=Object.create(null);if("auto"===e.targetType)return!1;const t=e[a.$getTemplateRoot]();let r=null;if(e.target){r=t[a.$searchNode](e.target,e[a.$getParent]());if(!r)return!1;r=r[0]}const{currentPageArea:n,currentContentArea:i}=t[a.$extra];if("pageArea"===e.targetType){r instanceof PageArea||(r=null);if(e.startNew){e[a.$extra].target=r||n;return!0}if(r&&r!==n){e[a.$extra].target=r;return!0}return!1}r instanceof ContentArea||(r=null);const s=r&&r[a.$getParent]();let o,c=s;if(e.startNew)if(r){const e=s.contentArea.children,t=e.indexOf(i),a=e.indexOf(r);-1!==t&&t<a&&(c=null);o=a-1}else o=n.contentArea.children.indexOf(i);else{if(!r||r===i)return!1;o=s.contentArea.children.indexOf(r)-1;c=s===n?null:s}e[a.$extra].target=c;e[a.$extra].index=o;return!0}function handleOverflow(e,t,r){const n=e[a.$getTemplateRoot](),i=n[a.$extra].noLayoutFailure,s=t[a.$getSubformParent];t[a.$getSubformParent]=()=>e;n[a.$extra].noLayoutFailure=!0;const o=t[a.$toHTML](r);e[a.$addHTML](o.html,o.bbox);n[a.$extra].noLayoutFailure=i;t[a.$getSubformParent]=s}class AppearanceFilter extends a.StringObject{constructor(e){super(d,"appearanceFilter");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Arc extends a.XFAObject{constructor(e){super(d,"arc",!0);this.circular=(0,o.getInteger)({data:e.circular,defaultValue:0,validate:e=>1===e});this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.startAngle=(0,o.getFloat)({data:e.startAngle,defaultValue:0,validate:e=>!0});this.sweepAngle=(0,o.getFloat)({data:e.sweepAngle,defaultValue:360,validate:e=>!0});this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null;this.fill=null}[a.$toHTML](){const e=this.edge||new Edge({}),t=e[a.$toStyle](),r=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(r,this.fill[a.$toStyle]()):r.fill="transparent";r.strokeWidth=(0,s.measureToString)("visible"===e.presence?e.thickness:0);r.stroke=t.color;let n;const i={xmlns:f,style:{width:"100%",height:"100%",overflow:"visible"}};if(360===this.sweepAngle)n={name:"ellipse",attributes:{xmlns:f,cx:"50%",cy:"50%",rx:"50%",ry:"50%",style:r}};else{const e=this.startAngle*Math.PI/180,t=this.sweepAngle*Math.PI/180,a=this.sweepAngle>180?1:0,[s,o,c,l]=[50*(1+Math.cos(e)),50*(1-Math.sin(e)),50*(1+Math.cos(e+t)),50*(1-Math.sin(e+t))];n={name:"path",attributes:{xmlns:f,d:`M ${s} ${o} A 50 50 0 ${a} 0 ${c} ${l}`,vectorEffect:"non-scaling-stroke",style:r}};Object.assign(i,{viewBox:"0 0 100 100",preserveAspectRatio:"none"})}const c={name:"svg",children:[n],attributes:i};if(hasMargin(this[a.$getParent]()[a.$getParent]()))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[c]});c.attributes.style.position="absolute";return o.HTMLResult.success(c)}}class Area extends a.XFAObject{constructor(e){super(d,"area",!0);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.id=e.id||"";this.name=e.name||"";this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.desc=null;this.extras=null;this.area=new a.XFAObjectArray;this.draw=new a.XFAObjectArray;this.exObject=new a.XFAObjectArray;this.exclGroup=new a.XFAObjectArray;this.field=new a.XFAObjectArray;this.subform=new a.XFAObjectArray;this.subformSet=new a.XFAObjectArray}*[a.$getContainedChildren](){yield*getContainedChildren(this)}[a.$isTransparent](){return!0}[a.$isBindable](){return!0}[a.$addHTML](e,t){const[r,n,i,s]=t;this[a.$extra].width=Math.max(this[a.$extra].width,r+i);this[a.$extra].height=Math.max(this[a.$extra].height,n+s);this[a.$extra].children.push(e)}[a.$getAvailableSpace](){return this[a.$extra].availableSpace}[a.$toHTML](e){const t=(0,s.toStyle)(this,"position"),r={style:t,id:this[a.$uid],class:["xfaArea"]};(0,s.isPrintOnly)(this)&&r.class.push("xfaPrintOnly");this.name&&(r.xfaName=this.name);const n=[];this[a.$extra]={children:n,width:0,height:0,availableSpace:e};const i=this[a.$childrenToHTML]({filter:new Set(["area","draw","field","exclGroup","subform","subformSet"]),include:!0});if(!i.success){if(i.isBreak())return i;delete this[a.$extra];return o.HTMLResult.FAILURE}t.width=(0,s.measureToString)(this[a.$extra].width);t.height=(0,s.measureToString)(this[a.$extra].height);const c={name:"div",attributes:r,children:n},l=[this.x,this.y,this[a.$extra].width,this[a.$extra].height];delete this[a.$extra];return o.HTMLResult.success(c,l)}}class Assist extends a.XFAObject{constructor(e){super(d,"assist",!0);this.id=e.id||"";this.role=e.role||"";this.use=e.use||"";this.usehref=e.usehref||"";this.speak=null;this.toolTip=null}[a.$toHTML](){return this.toolTip&&this.toolTip[a.$content]?this.toolTip[a.$content]:null}}class Barcode extends a.XFAObject{constructor(e){super(d,"barcode",!0);this.charEncoding=(0,o.getKeyword)({data:e.charEncoding?e.charEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)});this.checksum=(0,o.getStringOption)(e.checksum,["none","1mod10","1mod10_1mod11","2mod10","auto"]);this.dataColumnCount=(0,o.getInteger)({data:e.dataColumnCount,defaultValue:-1,validate:e=>e>=0});this.dataLength=(0,o.getInteger)({data:e.dataLength,defaultValue:-1,validate:e=>e>=0});this.dataPrep=(0,o.getStringOption)(e.dataPrep,["none","flateCompress"]);this.dataRowCount=(0,o.getInteger)({data:e.dataRowCount,defaultValue:-1,validate:e=>e>=0});this.endChar=e.endChar||"";this.errorCorrectionLevel=(0,o.getInteger)({data:e.errorCorrectionLevel,defaultValue:-1,validate:e=>e>=0&&e<=8});this.id=e.id||"";this.moduleHeight=(0,o.getMeasurement)(e.moduleHeight,"5mm");this.moduleWidth=(0,o.getMeasurement)(e.moduleWidth,"0.25mm");this.printCheckDigit=(0,o.getInteger)({data:e.printCheckDigit,defaultValue:0,validate:e=>1===e});this.rowColumnRatio=(0,o.getRatio)(e.rowColumnRatio);this.startChar=e.startChar||"";this.textLocation=(0,o.getStringOption)(e.textLocation,["below","above","aboveEmbedded","belowEmbedded","none"]);this.truncate=(0,o.getInteger)({data:e.truncate,defaultValue:0,validate:e=>1===e});this.type=(0,o.getStringOption)(e.type?e.type.toLowerCase():"",["aztec","codabar","code2of5industrial","code2of5interleaved","code2of5matrix","code2of5standard","code3of9","code3of9extended","code11","code49","code93","code128","code128a","code128b","code128c","code128sscc","datamatrix","ean8","ean8add2","ean8add5","ean13","ean13add2","ean13add5","ean13pwcd","fim","logmars","maxicode","msi","pdf417","pdf417macro","plessey","postauscust2","postauscust3","postausreplypaid","postausstandard","postukrm4scc","postusdpbc","postusimb","postusstandard","postus5zip","qrcode","rfid","rss14","rss14expanded","rss14limited","rss14stacked","rss14stackedomni","rss14truncated","telepen","ucc128","ucc128random","ucc128sscc","upca","upcaadd2","upcaadd5","upcapwcd","upce","upceadd2","upceadd5","upcean2","upcean5","upsmaxicode"]);this.upsMode=(0,o.getStringOption)(e.upsMode,["usCarrier","internationalCarrier","secureSymbol","standardSymbol"]);this.use=e.use||"";this.usehref=e.usehref||"";this.wideNarrowRatio=(0,o.getRatio)(e.wideNarrowRatio);this.encrypt=null;this.extras=null}}class Bind extends a.XFAObject{constructor(e){super(d,"bind",!0);this.match=(0,o.getStringOption)(e.match,["once","dataRef","global","none"]);this.ref=e.ref||"";this.picture=null}}class BindItems extends a.XFAObject{constructor(e){super(d,"bindItems");this.connection=e.connection||"";this.labelRef=e.labelRef||"";this.ref=e.ref||"";this.valueRef=e.valueRef||""}}t.BindItems=BindItems;class Bookend extends a.XFAObject{constructor(e){super(d,"bookend");this.id=e.id||"";this.leader=e.leader||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}}class BooleanElement extends a.Option01{constructor(e){super(d,"boolean");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$toHTML](e){return valueToHtml(1===this[a.$content]?"1":"0")}}class Border extends a.XFAObject{constructor(e){super(d,"border",!0);this.break=(0,o.getStringOption)(e.break,["close","open"]);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new a.XFAObjectArray(4);this.edge=new a.XFAObjectArray(4);this.extras=null;this.fill=null;this.margin=null}[a.$getExtra](){if(!this[a.$extra]){const e=this.edge.children.slice();if(e.length<4){const t=e.at(-1)||new Edge({});for(let r=e.length;r<4;r++)e.push(t)}const t=e.map((e=>e.thickness)),r=[0,0,0,0];if(this.margin){r[0]=this.margin.topInset;r[1]=this.margin.rightInset;r[2]=this.margin.bottomInset;r[3]=this.margin.leftInset}this[a.$extra]={widths:t,insets:r,edges:e}}return this[a.$extra]}[a.$toStyle](){const{edges:e}=this[a.$getExtra](),t=e.map((e=>{const t=e[a.$toStyle]();t.color=t.color||"#000000";return t})),r=Object.create(null);this.margin&&Object.assign(r,this.margin[a.$toStyle]());this.fill&&"visible"===this.fill.presence&&Object.assign(r,this.fill[a.$toStyle]());if(this.corner.children.some((e=>0!==e.radius))){const e=this.corner.children.map((e=>e[a.$toStyle]()));if(2===e.length||3===e.length){const t=e.at(-1);for(let r=e.length;r<4;r++)e.push(t)}r.borderRadius=e.map((e=>e.radius)).join(" ")}switch(this.presence){case"invisible":case"hidden":r.borderStyle="";break;case"inactive":r.borderStyle="none";break;default:r.borderStyle=t.map((e=>e.style)).join(" ")}r.borderWidth=t.map((e=>e.width)).join(" ");r.borderColor=t.map((e=>e.color)).join(" ");return r}}class Break extends a.XFAObject{constructor(e){super(d,"break",!0);this.after=(0,o.getStringOption)(e.after,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.afterTarget=e.afterTarget||"";this.before=(0,o.getStringOption)(e.before,["auto","contentArea","pageArea","pageEven","pageOdd"]);this.beforeTarget=e.beforeTarget||"";this.bookendLeader=e.bookendLeader||"";this.bookendTrailer=e.bookendTrailer||"";this.id=e.id||"";this.overflowLeader=e.overflowLeader||"";this.overflowTarget=e.overflowTarget||"";this.overflowTrailer=e.overflowTrailer||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class BreakAfter extends a.XFAObject{constructor(e){super(d,"breakAfter",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=(0,o.getStringOption)(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}}class BreakBefore extends a.XFAObject{constructor(e){super(d,"breakBefore",!0);this.id=e.id||"";this.leader=e.leader||"";this.startNew=(0,o.getInteger)({data:e.startNew,defaultValue:0,validate:e=>1===e});this.target=e.target||"";this.targetType=(0,o.getStringOption)(e.targetType,["auto","contentArea","pageArea"]);this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||"";this.script=null}[a.$toHTML](e){this[a.$extra]={};return o.HTMLResult.FAILURE}}class Button extends a.XFAObject{constructor(e){super(d,"button",!0);this.highlight=(0,o.getStringOption)(e.highlight,["inverted","none","outline","push"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[a.$toHTML](e){const t=this[a.$getParent]()[a.$getParent](),r={name:"button",attributes:{id:this[a.$uid],class:["xfaButton"],style:{}},children:[]};for(const e of t.event.children){if("click"!==e.activity||!e.script)continue;const t=(0,h.recoverJsURL)(e.script[a.$content]);if(!t)continue;const n=(0,s.fixURL)(t.url);n&&r.children.push({name:"a",attributes:{id:"link"+this[a.$uid],href:n,newWindow:t.newWindow,class:["xfaLink"],style:{}},children:[]})}return o.HTMLResult.success(r)}}class Calculate extends a.XFAObject{constructor(e){super(d,"calculate",!0);this.id=e.id||"";this.override=(0,o.getStringOption)(e.override,["disabled","error","ignore","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.script=null}}class Caption extends a.XFAObject{constructor(e){super(d,"caption",!0);this.id=e.id||"";this.placement=(0,o.getStringOption)(e.placement,["left","bottom","inline","right","top"]);this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.reserve=Math.ceil((0,o.getMeasurement)(e.reserve));this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.font=null;this.margin=null;this.para=null;this.value=null}[a.$setValue](e){_setValue(this,e)}[a.$getExtra](e){if(!this[a.$extra]){let{width:t,height:r}=e;switch(this.placement){case"left":case"right":case"inline":t=this.reserve<=0?t:this.reserve;break;case"top":case"bottom":r=this.reserve<=0?r:this.reserve}this[a.$extra]=(0,s.layoutNode)(this,{width:t,height:r})}return this[a.$extra]}[a.$toHTML](e){if(!this.value)return o.HTMLResult.EMPTY;this[a.$pushPara]();const t=this.value[a.$toHTML](e).html;if(!t){this[a.$popPara]();return o.HTMLResult.EMPTY}const r=this.reserve;if(this.reserve<=0){const{w:t,h:r}=this[a.$getExtra](e);switch(this.placement){case"left":case"right":case"inline":this.reserve=t;break;case"top":case"bottom":this.reserve=r}}const n=[];"string"==typeof t?n.push({name:"#text",value:t}):n.push(t);const i=(0,s.toStyle)(this,"font","margin","visibility");switch(this.placement){case"left":case"right":this.reserve>0&&(i.width=(0,s.measureToString)(this.reserve));break;case"top":case"bottom":this.reserve>0&&(i.height=(0,s.measureToString)(this.reserve))}(0,s.setPara)(this,null,t);this[a.$popPara]();this.reserve=r;return o.HTMLResult.success({name:"div",attributes:{style:i,class:["xfaCaption"]},children:n})}}class Certificate extends a.StringObject{constructor(e){super(d,"certificate");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Certificates extends a.XFAObject{constructor(e){super(d,"certificates",!0);this.credentialServerPolicy=(0,o.getStringOption)(e.credentialServerPolicy,["optional","required"]);this.id=e.id||"";this.url=e.url||"";this.urlPolicy=e.urlPolicy||"";this.use=e.use||"";this.usehref=e.usehref||"";this.encryption=null;this.issuers=null;this.keyUsage=null;this.oids=null;this.signing=null;this.subjectDNs=null}}class CheckButton extends a.XFAObject{constructor(e){super(d,"checkButton",!0);this.id=e.id||"";this.mark=(0,o.getStringOption)(e.mark,["default","check","circle","cross","diamond","square","star"]);this.shape=(0,o.getStringOption)(e.shape,["square","round"]);this.size=(0,o.getMeasurement)(e.size,"10pt");this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[a.$toHTML](e){const t=(0,s.toStyle)("margin"),r=(0,s.measureToString)(this.size);t.width=t.height=r;let n,i,c;const l=this[a.$getParent]()[a.$getParent](),h=l.items.children.length&&l.items.children[0][a.$toHTML]().html||[],u={on:(void 0!==h[0]?h[0]:"on").toString(),off:(void 0!==h[1]?h[1]:"off").toString()},d=(l.value&&l.value[a.$text]()||"off")===u.on||void 0,f=l[a.$getSubformParent](),g=l[a.$uid];let p;if(f instanceof ExclGroup){c=f[a.$uid];n="radio";i="xfaRadio";p=f[a.$data]&&f[a.$data][a.$uid]||f[a.$uid]}else{n="checkbox";i="xfaCheckbox";p=l[a.$data]&&l[a.$data][a.$uid]||l[a.$uid]}const m={name:"input",attributes:{class:[i],style:t,fieldId:g,dataId:p,type:n,checked:d,xfaOn:u.on,xfaOff:u.off,"aria-label":ariaLabel(l),"aria-required":!1}};c&&(m.attributes.name=c);if(isRequired(l)){m.attributes["aria-required"]=!0;m.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[m]})}}class ChoiceList extends a.XFAObject{constructor(e){super(d,"choiceList",!0);this.commitOn=(0,o.getStringOption)(e.commitOn,["select","exit"]);this.id=e.id||"";this.open=(0,o.getStringOption)(e.open,["userControl","always","multiSelect","onEntry"]);this.textEntry=(0,o.getInteger)({data:e.textEntry,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[a.$toHTML](e){const t=(0,s.toStyle)(this,"border","margin"),r=this[a.$getParent]()[a.$getParent](),n={fontSize:`calc(${r.font&&r.font.size||10}px * var(--scale-factor))`},i=[];if(r.items.children.length>0){const e=r.items;let t=0,s=0;if(2===e.children.length){t=e.children[0].save;s=1-t}const o=e.children[t][a.$toHTML]().html,c=e.children[s][a.$toHTML]().html;let l=!1;const h=r.value&&r.value[a.$text]()||"";for(let e=0,t=o.length;e<t;e++){const t={name:"option",attributes:{value:c[e]||o[e],style:n},value:o[e]};c[e]===h&&(t.attributes.selected=l=!0);i.push(t)}l||i.splice(0,0,{name:"option",attributes:{hidden:!0,selected:!0},value:" "})}const c={class:["xfaSelect"],fieldId:r[a.$uid],dataId:r[a.$data]&&r[a.$data][a.$uid]||r[a.$uid],style:t,"aria-label":ariaLabel(r),"aria-required":!1};if(isRequired(r)){c["aria-required"]=!0;c.required=!0}"multiSelect"===this.open&&(c.multiple=!0);return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[{name:"select",children:i,attributes:c}]})}}class Color extends a.XFAObject{constructor(e){super(d,"color",!0);this.cSpace=(0,o.getStringOption)(e.cSpace,["SRGB"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.value=e.value?(0,o.getColor)(e.value):"";this.extras=null}[a.$hasSettableValue](){return!1}[a.$toStyle](){return this.value?c.Util.makeHexColor(this.value.r,this.value.g,this.value.b):null}}class Comb extends a.XFAObject{constructor(e){super(d,"comb");this.id=e.id||"";this.numberOfCells=(0,o.getInteger)({data:e.numberOfCells,defaultValue:0,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||""}}class Connect extends a.XFAObject{constructor(e){super(d,"connect",!0);this.connection=e.connection||"";this.id=e.id||"";this.ref=e.ref||"";this.usage=(0,o.getStringOption)(e.usage,["exportAndImport","exportOnly","importOnly"]);this.use=e.use||"";this.usehref=e.usehref||"";this.picture=null}}class ContentArea extends a.XFAObject{constructor(e){super(d,"contentArea",!0);this.h=(0,o.getMeasurement)(e.h);this.id=e.id||"";this.name=e.name||"";this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=(0,o.getMeasurement)(e.w);this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.desc=null;this.extras=null}[a.$toHTML](e){const t={left:(0,s.measureToString)(this.x),top:(0,s.measureToString)(this.y),width:(0,s.measureToString)(this.w),height:(0,s.measureToString)(this.h)},r=["xfaContentarea"];(0,s.isPrintOnly)(this)&&r.push("xfaPrintOnly");return o.HTMLResult.success({name:"div",children:[],attributes:{style:t,class:r,id:this[a.$uid]}})}}class Corner extends a.XFAObject{constructor(e){super(d,"corner",!0);this.id=e.id||"";this.inverted=(0,o.getInteger)({data:e.inverted,defaultValue:0,validate:e=>1===e});this.join=(0,o.getStringOption)(e.join,["square","round"]);this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.radius=(0,o.getMeasurement)(e.radius);this.stroke=(0,o.getStringOption)(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=(0,o.getMeasurement)(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[a.$toStyle](){const e=(0,s.toStyle)(this,"visibility");e.radius=(0,s.measureToString)("square"===this.join?0:this.radius);return e}}class DateElement extends a.ContentObject{constructor(e){super(d,"date");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){const e=this[a.$content].trim();this[a.$content]=e?new Date(e):null}[a.$toHTML](e){return valueToHtml(this[a.$content]?this[a.$content].toString():"")}}class DateTime extends a.ContentObject{constructor(e){super(d,"dateTime");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){const e=this[a.$content].trim();this[a.$content]=e?new Date(e):null}[a.$toHTML](e){return valueToHtml(this[a.$content]?this[a.$content].toString():"")}}class DateTimeEdit extends a.XFAObject{constructor(e){super(d,"dateTimeEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.picker=(0,o.getStringOption)(e.picker,["host","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[a.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin"),r=this[a.$getParent]()[a.$getParent](),n={name:"input",attributes:{type:"text",fieldId:r[a.$uid],dataId:r[a.$data]&&r[a.$data][a.$uid]||r[a.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(r),"aria-required":!1}};if(isRequired(r)){n.attributes["aria-required"]=!0;n.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Decimal extends a.ContentObject{constructor(e){super(d,"decimal");this.fracDigits=(0,o.getInteger)({data:e.fracDigits,defaultValue:2,validate:e=>!0});this.id=e.id||"";this.leadDigits=(0,o.getInteger)({data:e.leadDigits,defaultValue:-1,validate:e=>!0});this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){const e=parseFloat(this[a.$content].trim());this[a.$content]=isNaN(e)?null:e}[a.$toHTML](e){return valueToHtml(null!==this[a.$content]?this[a.$content].toString():"")}}class DefaultUi extends a.XFAObject{constructor(e){super(d,"defaultUi",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class Desc extends a.XFAObject{constructor(e){super(d,"desc",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new a.XFAObjectArray;this.date=new a.XFAObjectArray;this.dateTime=new a.XFAObjectArray;this.decimal=new a.XFAObjectArray;this.exData=new a.XFAObjectArray;this.float=new a.XFAObjectArray;this.image=new a.XFAObjectArray;this.integer=new a.XFAObjectArray;this.text=new a.XFAObjectArray;this.time=new a.XFAObjectArray}}class DigestMethod extends a.OptionObject{constructor(e){super(d,"digestMethod",["","SHA1","SHA256","SHA512","RIPEMD160"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class DigestMethods extends a.XFAObject{constructor(e){super(d,"digestMethods",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.digestMethod=new a.XFAObjectArray}}class Draw extends a.XFAObject{constructor(e){super(d,"draw",!0);this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.rotate=(0,o.getInteger)({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.border=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.value=null;this.setProperty=new a.XFAObjectArray}[a.$setValue](e){_setValue(this,e)}[a.$toHTML](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);this[a.$pushPara]();const t=this.w,r=this.h,{w:n,h:c,isBroken:l}=(0,s.layoutNode)(this,e);if(n&&""===this.w){if(l&&this[a.$getSubformParent]()[a.$isThereMoreWidth]()){this[a.$popPara]();return o.HTMLResult.FAILURE}this.w=n}c&&""===this.h&&(this.h=c);setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e)){this.w=t;this.h=r;this[a.$popPara]();return o.HTMLResult.FAILURE}unsetFirstUnsplittable(this);const h=(0,s.toStyle)(this,"font","hAlign","dimensions","position","presence","rotate","anchorType","border","margin");(0,s.setMinMaxDimensions)(this,h);if(h.margin){h.padding=h.margin;delete h.margin}const u=["xfaDraw"];this.font&&u.push("xfaFont");(0,s.isPrintOnly)(this)&&u.push("xfaPrintOnly");const d={style:h,id:this[a.$uid],class:u};this.name&&(d.xfaName=this.name);const f={name:"div",attributes:d,children:[]};applyAssist(this,d);const g=(0,s.computeBbox)(this,f,e),p=this.value?this.value[a.$toHTML](e).html:null;if(null===p){this.w=t;this.h=r;this[a.$popPara]();return o.HTMLResult.success((0,s.createWrapper)(this,f),g)}f.children.push(p);(0,s.setPara)(this,h,p);this.w=t;this.h=r;this[a.$popPara]();return o.HTMLResult.success((0,s.createWrapper)(this,f),g)}}class Edge extends a.XFAObject{constructor(e){super(d,"edge",!0);this.cap=(0,o.getStringOption)(e.cap,["square","butt","round"]);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.stroke=(0,o.getStringOption)(e.stroke,["solid","dashDot","dashDotDot","dashed","dotted","embossed","etched","lowered","raised"]);this.thickness=(0,o.getMeasurement)(e.thickness,"0.5pt");this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[a.$toStyle](){const e=(0,s.toStyle)(this,"visibility");Object.assign(e,{linecap:this.cap,width:(0,s.measureToString)(this.thickness),color:this.color?this.color[a.$toStyle]():"#000000",style:""});if("visible"!==this.presence)e.style="none";else switch(this.stroke){case"solid":e.style="solid";break;case"dashDot":case"dashDotDot":case"dashed":e.style="dashed";break;case"dotted":e.style="dotted";break;case"embossed":e.style="ridge";break;case"etched":e.style="groove";break;case"lowered":e.style="inset";break;case"raised":e.style="outset"}return e}}class Encoding extends a.OptionObject{constructor(e){super(d,"encoding",["adbe.x509.rsa_sha1","adbe.pkcs7.detached","adbe.pkcs7.sha1"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Encodings extends a.XFAObject{constructor(e){super(d,"encodings",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encoding=new a.XFAObjectArray}}class Encrypt extends a.XFAObject{constructor(e){super(d,"encrypt",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=null}}class EncryptData extends a.XFAObject{constructor(e){super(d,"encryptData",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["encrypt","decrypt"]);this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Encryption extends a.XFAObject{constructor(e){super(d,"encryption",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new a.XFAObjectArray}}class EncryptionMethod extends a.OptionObject{constructor(e){super(d,"encryptionMethod",["","AES256-CBC","TRIPLEDES-CBC","AES128-CBC","AES192-CBC"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EncryptionMethods extends a.XFAObject{constructor(e){super(d,"encryptionMethods",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.encryptionMethod=new a.XFAObjectArray}}class Event extends a.XFAObject{constructor(e){super(d,"event",!0);this.activity=(0,o.getStringOption)(e.activity,["click","change","docClose","docReady","enter","exit","full","indexChange","initialize","mouseDown","mouseEnter","mouseExit","mouseUp","postExecute","postOpen","postPrint","postSave","postSign","postSubmit","preExecute","preOpen","prePrint","preSave","preSign","preSubmit","ready","validationState"]);this.id=e.id||"";this.listen=(0,o.getStringOption)(e.listen,["refOnly","refAndDescendents"]);this.name=e.name||"";this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.encryptData=null;this.execute=null;this.script=null;this.signData=null;this.submit=null}}class ExData extends a.ContentObject{constructor(e){super(d,"exData");this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.maxLength=(0,o.getInteger)({data:e.maxLength,defaultValue:-1,validate:e=>e>=-1});this.name=e.name||"";this.rid=e.rid||"";this.transferEncoding=(0,o.getStringOption)(e.transferEncoding,["none","base64","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[a.$isCDATAXml](){return"text/html"===this.contentType}[a.$onChild](e){if("text/html"===this.contentType&&e[a.$namespaceId]===n.NamespaceIds.xhtml.id){this[a.$content]=e;return!0}if("text/xml"===this.contentType){this[a.$content]=e;return!0}return!1}[a.$toHTML](e){return"text/html"===this.contentType&&this[a.$content]?this[a.$content][a.$toHTML](e):o.HTMLResult.EMPTY}}class ExObject extends a.XFAObject{constructor(e){super(d,"exObject",!0);this.archive=e.archive||"";this.classId=e.classId||"";this.codeBase=e.codeBase||"";this.codeType=e.codeType||"";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.boolean=new a.XFAObjectArray;this.date=new a.XFAObjectArray;this.dateTime=new a.XFAObjectArray;this.decimal=new a.XFAObjectArray;this.exData=new a.XFAObjectArray;this.exObject=new a.XFAObjectArray;this.float=new a.XFAObjectArray;this.image=new a.XFAObjectArray;this.integer=new a.XFAObjectArray;this.text=new a.XFAObjectArray;this.time=new a.XFAObjectArray}}class ExclGroup extends a.XFAObject{constructor(e){super(d,"exclGroup",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=(0,o.getStringOption)(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.margin=null;this.para=null;this.traversal=null;this.validate=null;this.connect=new a.XFAObjectArray;this.event=new a.XFAObjectArray;this.field=new a.XFAObjectArray;this.setProperty=new a.XFAObjectArray}[a.$isBindable](){return!0}[a.$hasSettableValue](){return!0}[a.$setValue](e){for(const t of this.field.children){if(!t.value){const e=new Value({});t[a.$appendChild](e);t.value=e}t.value[a.$setValue](e)}}[a.$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[a.$extra].attempt&&this[a.$extra].numberInLine>0||this[a.$getParent]()[a.$isThereMoreWidth]()}[a.$isSplittable](){const e=this[a.$getSubformParent]();if(!e[a.$isSplittable]())return!1;if(void 0!==this[a.$extra]._isSplittable)return this[a.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[a.$extra]._isSplittable=!1;return!1}if(e.layout&&e.layout.endsWith("-tb")&&0!==e[a.$extra].numberInLine)return!1;this[a.$extra]._isSplittable=!0;return!0}[a.$flushHTML](){return(0,i.flushHTML)(this)}[a.$addHTML](e,t){(0,i.addHTML)(this,e,t)}[a.$getAvailableSpace](){return(0,i.getAvailableSpace)(this)}[a.$toHTML](e){setTabIndex(this);if("hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);const t=[],r={id:this[a.$uid],class:[]};(0,s.setAccess)(this,r.class);this[a.$extra]||(this[a.$extra]=Object.create(null));Object.assign(this[a.$extra],{children:t,attributes:r,attempt:0,line:null,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[a.$isSplittable]();n||setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e))return o.HTMLResult.FAILURE;const c=new Set(["field"]);if(this.layout.includes("row")){const e=this[a.$getSubformParent]().columnWidths;if(Array.isArray(e)&&e.length>0){this[a.$extra].columnWidths=e;this[a.$extra].currentColumn=0}}const l=(0,s.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),h=["xfaExclgroup"],u=(0,s.layoutClass)(this);u&&h.push(u);(0,s.isPrintOnly)(this)&&h.push("xfaPrintOnly");r.style=l;r.class=h;this.name&&(r.xfaName=this.name);this[a.$pushPara]();const d="lr-tb"===this.layout||"rl-tb"===this.layout,f=d?2:1;for(;this[a.$extra].attempt<f;this[a.$extra].attempt++){d&&1===this[a.$extra].attempt&&(this[a.$extra].numberInLine=0);const e=this[a.$childrenToHTML]({filter:c,include:!0});if(e.success)break;if(e.isBreak()){this[a.$popPara]();return e}if(d&&0===this[a.$extra].attempt&&0===this[a.$extra].numberInLine&&!this[a.$getTemplateRoot]()[a.$extra].noLayoutFailure){this[a.$extra].attempt=f;break}}this[a.$popPara]();n||unsetFirstUnsplittable(this);if(this[a.$extra].attempt===f){n||delete this[a.$extra];return o.HTMLResult.FAILURE}let g=0,p=0;if(this.margin){g=this.margin.leftInset+this.margin.rightInset;p=this.margin.topInset+this.margin.bottomInset}const m=Math.max(this[a.$extra].width+g,this.w||0),b=Math.max(this[a.$extra].height+p,this.h||0),y=[this.x,this.y,m,b];""===this.w&&(l.width=(0,s.measureToString)(m));""===this.h&&(l.height=(0,s.measureToString)(b));const w={name:"div",attributes:r,children:t};applyAssist(this,r);delete this[a.$extra];return o.HTMLResult.success((0,s.createWrapper)(this,w),y)}}class Execute extends a.XFAObject{constructor(e){super(d,"execute");this.connection=e.connection||"";this.executeType=(0,o.getStringOption)(e.executeType,["import","remerge"]);this.id=e.id||"";this.runAt=(0,o.getStringOption)(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Extras extends a.XFAObject{constructor(e){super(d,"extras",!0);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new a.XFAObjectArray;this.date=new a.XFAObjectArray;this.dateTime=new a.XFAObjectArray;this.decimal=new a.XFAObjectArray;this.exData=new a.XFAObjectArray;this.extras=new a.XFAObjectArray;this.float=new a.XFAObjectArray;this.image=new a.XFAObjectArray;this.integer=new a.XFAObjectArray;this.text=new a.XFAObjectArray;this.time=new a.XFAObjectArray}}class Field extends a.XFAObject{constructor(e){super(d,"field",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.accessKey=e.accessKey||"";this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.rotate=(0,o.getInteger)({data:e.rotate,defaultValue:0,validate:e=>e%90==0});this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.border=null;this.calculate=null;this.caption=null;this.desc=null;this.extras=null;this.font=null;this.format=null;this.items=new a.XFAObjectArray(2);this.keep=null;this.margin=null;this.para=null;this.traversal=null;this.ui=null;this.validate=null;this.value=null;this.bindItems=new a.XFAObjectArray;this.connect=new a.XFAObjectArray;this.event=new a.XFAObjectArray;this.setProperty=new a.XFAObjectArray}[a.$isBindable](){return!0}[a.$setValue](e){_setValue(this,e)}[a.$toHTML](e){setTabIndex(this);if(!this.ui){this.ui=new Ui({});this.ui[a.$globalData]=this[a.$globalData];this[a.$appendChild](this.ui);let e;switch(this.items.children.length){case 0:e=new TextEdit({});this.ui.textEdit=e;break;case 1:e=new CheckButton({});this.ui.checkButton=e;break;case 2:e=new ChoiceList({});this.ui.choiceList=e}this.ui[a.$appendChild](e)}if(!this.ui||"hidden"===this.presence||"inactive"===this.presence||0===this.h||0===this.w)return o.HTMLResult.EMPTY;this.caption&&delete this.caption[a.$extra];this[a.$pushPara]();const t=this.caption?this.caption[a.$toHTML](e).html:null,r=this.w,n=this.h;let c=0,h=0;if(this.margin){c=this.margin.leftInset+this.margin.rightInset;h=this.margin.topInset+this.margin.bottomInset}let u=null;if(""===this.w||""===this.h){let t=null,r=null,n=0,i=0;if(this.ui.checkButton)n=i=this.ui.checkButton.size;else{const{w:t,h:r}=(0,s.layoutNode)(this,e);if(null!==t){n=t;i=r}else i=(0,l.getMetrics)(this.font,!0).lineNoGap}u=getBorderDims(this.ui[a.$getExtra]());n+=u.w;i+=u.h;if(this.caption){const{w:s,h:c,isBroken:l}=this.caption[a.$getExtra](e);if(l&&this[a.$getSubformParent]()[a.$isThereMoreWidth]()){this[a.$popPara]();return o.HTMLResult.FAILURE}t=s;r=c;switch(this.caption.placement){case"left":case"right":case"inline":t+=n;break;case"top":case"bottom":r+=i}}else{t=n;r=i}if(t&&""===this.w){t+=c;this.w=Math.min(this.maxW<=0?1/0:this.maxW,this.minW+1<t?t:this.minW)}if(r&&""===this.h){r+=h;this.h=Math.min(this.maxH<=0?1/0:this.maxH,this.minH+1<r?r:this.minH)}}this[a.$popPara]();(0,s.fixDimensions)(this);setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e)){this.w=r;this.h=n;this[a.$popPara]();return o.HTMLResult.FAILURE}unsetFirstUnsplittable(this);const d=(0,s.toStyle)(this,"font","dimensions","position","rotate","anchorType","presence","margin","hAlign");(0,s.setMinMaxDimensions)(this,d);const f=["xfaField"];this.font&&f.push("xfaFont");(0,s.isPrintOnly)(this)&&f.push("xfaPrintOnly");const g={style:d,id:this[a.$uid],class:f};if(d.margin){d.padding=d.margin;delete d.margin}(0,s.setAccess)(this,f);this.name&&(g.xfaName=this.name);const p=[],m={name:"div",attributes:g,children:p};applyAssist(this,g);const b=this.border?this.border[a.$toStyle]():null,y=(0,s.computeBbox)(this,m,e),w=this.ui[a.$toHTML]().html;if(!w){Object.assign(d,b);return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}this[a.$tabIndex]&&(w.children&&w.children[0]?w.children[0].attributes.tabindex=this[a.$tabIndex]:w.attributes.tabindex=this[a.$tabIndex]);w.attributes.style||(w.attributes.style=Object.create(null));let S=null;if(this.ui.button){1===w.children.length&&([S]=w.children.splice(0,1));Object.assign(w.attributes.style,b)}else Object.assign(d,b);p.push(w);if(this.value)if(this.ui.imageEdit)w.children.push(this.value[a.$toHTML]().html);else if(!this.ui.button){let e="";if(this.value.exData)e=this.value.exData[a.$text]();else if(this.value.text)e=this.value.text[a.$getExtra]();else{const t=this.value[a.$toHTML]().html;null!==t&&(e=t.children[0].value)}this.ui.textEdit&&this.value.text&&this.value.text.maxChars&&(w.children[0].attributes.maxLength=this.value.text.maxChars);if(e){if(this.ui.numericEdit){e=parseFloat(e);e=isNaN(e)?"":e.toString()}"textarea"===w.children[0].name?w.children[0].attributes.textContent=e:w.children[0].attributes.value=e}}if(!this.ui.imageEdit&&w.children&&w.children[0]&&this.h){u=u||getBorderDims(this.ui[a.$getExtra]());let t=0;if(this.caption&&["top","bottom"].includes(this.caption.placement)){t=this.caption.reserve;t<=0&&(t=this.caption[a.$getExtra](e).h);const r=this.h-t-h-u.h;w.children[0].attributes.style.height=(0,s.measureToString)(r)}else w.children[0].attributes.style.height="100%"}S&&w.children.push(S);if(!t){w.attributes.class&&w.attributes.class.push("xfaLeft");this.w=r;this.h=n;return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}if(this.ui.button){d.padding&&delete d.padding;"div"===t.name&&(t.name="span");w.children.push(t);return o.HTMLResult.success(m,y)}this.ui.checkButton&&(t.attributes.class[0]="xfaCaptionForCheckButton");w.attributes.class||(w.attributes.class=[]);w.children.splice(0,0,t);switch(this.caption.placement){case"left":case"inline":w.attributes.class.push("xfaLeft");break;case"right":w.attributes.class.push("xfaRight");break;case"top":w.attributes.class.push("xfaTop");break;case"bottom":w.attributes.class.push("xfaBottom")}this.w=r;this.h=n;return o.HTMLResult.success((0,s.createWrapper)(this,m),y)}}t.Field=Field;class Fill extends a.XFAObject{constructor(e){super(d,"fill",!0);this.id=e.id||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null;this.linear=null;this.pattern=null;this.radial=null;this.solid=null;this.stipple=null}[a.$toStyle](){const e=this[a.$getParent](),t=e[a.$getParent]()[a.$getParent](),r=Object.create(null);let n="color",i=n;if(e instanceof Border){n="background-color";i="background";t instanceof Ui&&(r.backgroundColor="white")}if(e instanceof Rectangle||e instanceof Arc){n=i="fill";r.fill="white"}for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"color"===e)continue;const t=this[e];if(!(t instanceof a.XFAObject))continue;const s=t[a.$toStyle](this.color);s&&(r[s.startsWith("#")?n:i]=s);return r}if(this.color&&this.color.value){const e=this.color[a.$toStyle]();r[e.startsWith("#")?n:i]=e}return r}}class Filter extends a.XFAObject{constructor(e){super(d,"filter",!0);this.addRevocationInfo=(0,o.getStringOption)(e.addRevocationInfo,["","required","optional","none"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.version=(0,o.getInteger)({data:this.version,defaultValue:5,validate:e=>e>=1&&e<=5});this.appearanceFilter=null;this.certificates=null;this.digestMethods=null;this.encodings=null;this.encryptionMethods=null;this.handler=null;this.lockDocument=null;this.mdp=null;this.reasons=null;this.timeStamp=null}}class Float extends a.ContentObject{constructor(e){super(d,"float");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){const e=parseFloat(this[a.$content].trim());this[a.$content]=isNaN(e)?null:e}[a.$toHTML](e){return valueToHtml(null!==this[a.$content]?this[a.$content].toString():"")}}class Font extends a.XFAObject{constructor(e){super(d,"font",!0);this.baselineShift=(0,o.getMeasurement)(e.baselineShift);this.fontHorizontalScale=(0,o.getFloat)({data:e.fontHorizontalScale,defaultValue:100,validate:e=>e>=0});this.fontVerticalScale=(0,o.getFloat)({data:e.fontVerticalScale,defaultValue:100,validate:e=>e>=0});this.id=e.id||"";this.kerningMode=(0,o.getStringOption)(e.kerningMode,["none","pair"]);this.letterSpacing=(0,o.getMeasurement)(e.letterSpacing,"0");this.lineThrough=(0,o.getInteger)({data:e.lineThrough,defaultValue:0,validate:e=>1===e||2===e});this.lineThroughPeriod=(0,o.getStringOption)(e.lineThroughPeriod,["all","word"]);this.overline=(0,o.getInteger)({data:e.overline,defaultValue:0,validate:e=>1===e||2===e});this.overlinePeriod=(0,o.getStringOption)(e.overlinePeriod,["all","word"]);this.posture=(0,o.getStringOption)(e.posture,["normal","italic"]);this.size=(0,o.getMeasurement)(e.size,"10pt");this.typeface=e.typeface||"Courier";this.underline=(0,o.getInteger)({data:e.underline,defaultValue:0,validate:e=>1===e||2===e});this.underlinePeriod=(0,o.getStringOption)(e.underlinePeriod,["all","word"]);this.use=e.use||"";this.usehref=e.usehref||"";this.weight=(0,o.getStringOption)(e.weight,["normal","bold"]);this.extras=null;this.fill=null}[a.$clean](e){super[a.$clean](e);this[a.$globalData].usedTypefaces.add(this.typeface)}[a.$toStyle](){const e=(0,s.toStyle)(this,"fill"),t=e.color;if(t)if("#000000"===t)delete e.color;else if(!t.startsWith("#")){e.background=t;e.backgroundClip="text";e.color="transparent"}this.baselineShift&&(e.verticalAlign=(0,s.measureToString)(this.baselineShift));e.fontKerning="none"===this.kerningMode?"none":"normal";e.letterSpacing=(0,s.measureToString)(this.letterSpacing);if(0!==this.lineThrough){e.textDecoration="line-through";2===this.lineThrough&&(e.textDecorationStyle="double")}if(0!==this.overline){e.textDecoration="overline";2===this.overline&&(e.textDecorationStyle="double")}e.fontStyle=this.posture;e.fontSize=(0,s.measureToString)(.99*this.size);(0,s.setFontFamily)(this,this,this[a.$globalData].fontFinder,e);if(0!==this.underline){e.textDecoration="underline";2===this.underline&&(e.textDecorationStyle="double")}e.fontWeight=this.weight;return e}}class Format extends a.XFAObject{constructor(e){super(d,"format",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null}}class Handler extends a.StringObject{constructor(e){super(d,"handler");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Hyphenation extends a.XFAObject{constructor(e){super(d,"hyphenation");this.excludeAllCaps=(0,o.getInteger)({data:e.excludeAllCaps,defaultValue:0,validate:e=>1===e});this.excludeInitialCap=(0,o.getInteger)({data:e.excludeInitialCap,defaultValue:0,validate:e=>1===e});this.hyphenate=(0,o.getInteger)({data:e.hyphenate,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.pushCharacterCount=(0,o.getInteger)({data:e.pushCharacterCount,defaultValue:3,validate:e=>e>=0});this.remainCharacterCount=(0,o.getInteger)({data:e.remainCharacterCount,defaultValue:3,validate:e=>e>=0});this.use=e.use||"";this.usehref=e.usehref||"";this.wordCharacterCount=(0,o.getInteger)({data:e.wordCharacterCount,defaultValue:7,validate:e=>e>=0})}}class Image extends a.StringObject{constructor(e){super(d,"image");this.aspect=(0,o.getStringOption)(e.aspect,["fit","actual","height","none","width"]);this.contentType=e.contentType||"";this.href=e.href||"";this.id=e.id||"";this.name=e.name||"";this.transferEncoding=(0,o.getStringOption)(e.transferEncoding,["base64","none","package"]);this.use=e.use||"";this.usehref=e.usehref||""}[a.$toHTML](){if(this.contentType&&!p.has(this.contentType.toLowerCase()))return o.HTMLResult.EMPTY;let e=this[a.$globalData].images&&this[a.$globalData].images.get(this.href);if(!e&&(this.href||!this[a.$content]))return o.HTMLResult.EMPTY;e||"base64"!==this.transferEncoding||(e=(0,c.stringToBytes)(atob(this[a.$content])));if(!e)return o.HTMLResult.EMPTY;if(!this.contentType){for(const[t,r]of m)if(e.length>t.length&&t.every(((t,r)=>t===e[r]))){this.contentType=r;break}if(!this.contentType)return o.HTMLResult.EMPTY}const t=new Blob([e],{type:this.contentType});let r;switch(this.aspect){case"fit":case"actual":break;case"height":r={height:"100%",objectFit:"fill"};break;case"none":r={width:"100%",height:"100%",objectFit:"fill"};break;case"width":r={width:"100%",objectFit:"fill"}}const n=this[a.$getParent]();return o.HTMLResult.success({name:"img",attributes:{class:["xfaImage"],style:r,src:URL.createObjectURL(t),alt:n?ariaLabel(n[a.$getParent]()):null}})}}class ImageEdit extends a.XFAObject{constructor(e){super(d,"imageEdit",!0);this.data=(0,o.getStringOption)(e.data,["link","embed"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}[a.$toHTML](e){return"embed"===this.data?o.HTMLResult.success({name:"div",children:[],attributes:{}}):o.HTMLResult.EMPTY}}class Integer extends a.ContentObject{constructor(e){super(d,"integer");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){const e=parseInt(this[a.$content].trim(),10);this[a.$content]=isNaN(e)?null:e}[a.$toHTML](e){return valueToHtml(null!==this[a.$content]?this[a.$content].toString():"")}}class Issuers extends a.XFAObject{constructor(e){super(d,"issuers",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new a.XFAObjectArray}}class Items extends a.XFAObject{constructor(e){super(d,"items",!0);this.id=e.id||"";this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.ref=e.ref||"";this.save=(0,o.getInteger)({data:e.save,defaultValue:0,validate:e=>1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new a.XFAObjectArray;this.date=new a.XFAObjectArray;this.dateTime=new a.XFAObjectArray;this.decimal=new a.XFAObjectArray;this.exData=new a.XFAObjectArray;this.float=new a.XFAObjectArray;this.image=new a.XFAObjectArray;this.integer=new a.XFAObjectArray;this.text=new a.XFAObjectArray;this.time=new a.XFAObjectArray}[a.$toHTML](){const e=[];for(const t of this[a.$getChildren]())e.push(t[a.$text]());return o.HTMLResult.success(e)}}t.Items=Items;class Keep extends a.XFAObject{constructor(e){super(d,"keep",!0);this.id=e.id||"";const t=["none","contentArea","pageArea"];this.intact=(0,o.getStringOption)(e.intact,t);this.next=(0,o.getStringOption)(e.next,t);this.previous=(0,o.getStringOption)(e.previous,t);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}}class KeyUsage extends a.XFAObject{constructor(e){super(d,"keyUsage");const t=["","yes","no"];this.crlSign=(0,o.getStringOption)(e.crlSign,t);this.dataEncipherment=(0,o.getStringOption)(e.dataEncipherment,t);this.decipherOnly=(0,o.getStringOption)(e.decipherOnly,t);this.digitalSignature=(0,o.getStringOption)(e.digitalSignature,t);this.encipherOnly=(0,o.getStringOption)(e.encipherOnly,t);this.id=e.id||"";this.keyAgreement=(0,o.getStringOption)(e.keyAgreement,t);this.keyCertSign=(0,o.getStringOption)(e.keyCertSign,t);this.keyEncipherment=(0,o.getStringOption)(e.keyEncipherment,t);this.nonRepudiation=(0,o.getStringOption)(e.nonRepudiation,t);this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Line extends a.XFAObject{constructor(e){super(d,"line",!0);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.slope=(0,o.getStringOption)(e.slope,["\\","/"]);this.use=e.use||"";this.usehref=e.usehref||"";this.edge=null}[a.$toHTML](){const e=this[a.$getParent]()[a.$getParent](),t=this.edge||new Edge({}),r=t[a.$toStyle](),n=Object.create(null),i="visible"===t.presence?t.thickness:0;n.strokeWidth=(0,s.measureToString)(i);n.stroke=r.color;let c,l,h,u,d="100%",g="100%";if(e.w<=i){[c,l,h,u]=["50%",0,"50%","100%"];d=n.strokeWidth}else if(e.h<=i){[c,l,h,u]=[0,"50%","100%","50%"];g=n.strokeWidth}else"\\"===this.slope?[c,l,h,u]=[0,0,"100%","100%"]:[c,l,h,u]=[0,"100%","100%",0];const p={name:"svg",children:[{name:"line",attributes:{xmlns:f,x1:c,y1:l,x2:h,y2:u,style:n}}],attributes:{xmlns:f,width:d,height:g,style:{overflow:"visible"}}};if(hasMargin(e))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[p]});p.attributes.style.position="absolute";return o.HTMLResult.success(p)}}class Linear extends a.XFAObject{constructor(e){super(d,"linear",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["toRight","toBottom","toLeft","toTop"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[a.$toStyle](e){e=e?e[a.$toStyle]():"#FFFFFF";return`linear-gradient(${this.type.replace(/([RBLT])/," $1").toLowerCase()}, ${e}, ${this.color?this.color[a.$toStyle]():"#000000"})`}}class LockDocument extends a.ContentObject{constructor(e){super(d,"lockDocument");this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){this[a.$content]=(0,o.getStringOption)(this[a.$content],["auto","0","1"])}}class Manifest extends a.XFAObject{constructor(e){super(d,"manifest",!0);this.action=(0,o.getStringOption)(e.action,["include","all","exclude"]);this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.ref=new a.XFAObjectArray}}class Margin extends a.XFAObject{constructor(e){super(d,"margin",!0);this.bottomInset=(0,o.getMeasurement)(e.bottomInset,"0");this.id=e.id||"";this.leftInset=(0,o.getMeasurement)(e.leftInset,"0");this.rightInset=(0,o.getMeasurement)(e.rightInset,"0");this.topInset=(0,o.getMeasurement)(e.topInset,"0");this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[a.$toStyle](){return{margin:(0,s.measureToString)(this.topInset)+" "+(0,s.measureToString)(this.rightInset)+" "+(0,s.measureToString)(this.bottomInset)+" "+(0,s.measureToString)(this.leftInset)}}}class Mdp extends a.XFAObject{constructor(e){super(d,"mdp");this.id=e.id||"";this.permissions=(0,o.getInteger)({data:e.permissions,defaultValue:2,validate:e=>1===e||3===e});this.signatureType=(0,o.getStringOption)(e.signatureType,["filler","author"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Medium extends a.XFAObject{constructor(e){super(d,"medium");this.id=e.id||"";this.imagingBBox=(0,o.getBBox)(e.imagingBBox);this.long=(0,o.getMeasurement)(e.long);this.orientation=(0,o.getStringOption)(e.orientation,["portrait","landscape"]);this.short=(0,o.getMeasurement)(e.short);this.stock=e.stock||"";this.trayIn=(0,o.getStringOption)(e.trayIn,["auto","delegate","pageFront"]);this.trayOut=(0,o.getStringOption)(e.trayOut,["auto","delegate"]);this.use=e.use||"";this.usehref=e.usehref||""}}class Message extends a.XFAObject{constructor(e){super(d,"message",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.text=new a.XFAObjectArray}}class NumericEdit extends a.XFAObject{constructor(e){super(d,"numericEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.comb=null;this.extras=null;this.margin=null}[a.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin"),r=this[a.$getParent]()[a.$getParent](),n={name:"input",attributes:{type:"text",fieldId:r[a.$uid],dataId:r[a.$data]&&r[a.$data][a.$uid]||r[a.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(r),"aria-required":!1}};if(isRequired(r)){n.attributes["aria-required"]=!0;n.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[n]})}}class Occur extends a.XFAObject{constructor(e){super(d,"occur",!0);this.id=e.id||"";this.initial=""!==e.initial?(0,o.getInteger)({data:e.initial,defaultValue:"",validate:e=>!0}):"";this.max=""!==e.max?(0,o.getInteger)({data:e.max,defaultValue:1,validate:e=>!0}):"";this.min=""!==e.min?(0,o.getInteger)({data:e.min,defaultValue:1,validate:e=>!0}):"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[a.$clean](){const e=this[a.$getParent](),t=this.min;""===this.min&&(this.min=e instanceof PageArea||e instanceof PageSet?0:1);""===this.max&&(this.max=""===t?e instanceof PageArea||e instanceof PageSet?-1:1:this.min);-1!==this.max&&this.max<this.min&&(this.max=this.min);""===this.initial&&(this.initial=e instanceof Template?1:this.min)}}class Oid extends a.StringObject{constructor(e){super(d,"oid");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Oids extends a.XFAObject{constructor(e){super(d,"oids",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.oid=new a.XFAObjectArray}}class Overflow extends a.XFAObject{constructor(e){super(d,"overflow");this.id=e.id||"";this.leader=e.leader||"";this.target=e.target||"";this.trailer=e.trailer||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$getExtra](){if(!this[a.$extra]){const e=this[a.$getParent](),t=this[a.$getTemplateRoot](),r=t[a.$searchNode](this.target,e),n=t[a.$searchNode](this.leader,e),i=t[a.$searchNode](this.trailer,e);this[a.$extra]={target:r&&r[0]||null,leader:n&&n[0]||null,trailer:i&&i[0]||null,addLeader:!1,addTrailer:!1}}return this[a.$extra]}}class PageArea extends a.XFAObject{constructor(e){super(d,"pageArea",!0);this.blankOrNotBlank=(0,o.getStringOption)(e.blankOrNotBlank,["any","blank","notBlank"]);this.id=e.id||"";this.initialNumber=(0,o.getInteger)({data:e.initialNumber,defaultValue:1,validate:e=>!0});this.name=e.name||"";this.numbered=(0,o.getInteger)({data:e.numbered,defaultValue:1,validate:e=>!0});this.oddOrEven=(0,o.getStringOption)(e.oddOrEven,["any","even","odd"]);this.pagePosition=(0,o.getStringOption)(e.pagePosition,["any","first","last","only","rest"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.desc=null;this.extras=null;this.medium=null;this.occur=null;this.area=new a.XFAObjectArray;this.contentArea=new a.XFAObjectArray;this.draw=new a.XFAObjectArray;this.exclGroup=new a.XFAObjectArray;this.field=new a.XFAObjectArray;this.subform=new a.XFAObjectArray}[a.$isUsable](){if(!this[a.$extra]){this[a.$extra]={numberOfUse:0};return!0}return!this.occur||-1===this.occur.max||this[a.$extra].numberOfUse<this.occur.max}[a.$cleanPage](){delete this[a.$extra]}[a.$getNextPage](){this[a.$extra]||(this[a.$extra]={numberOfUse:0});const e=this[a.$getParent]();if("orderedOccurrence"===e.relation&&this[a.$isUsable]()){this[a.$extra].numberOfUse+=1;return this}return e[a.$getNextPage]()}[a.$getAvailableSpace](){return this[a.$extra].space||{width:0,height:0}}[a.$toHTML](){this[a.$extra]||(this[a.$extra]={numberOfUse:1});const e=[];this[a.$extra].children=e;const t=Object.create(null);if(this.medium&&this.medium.short&&this.medium.long){t.width=(0,s.measureToString)(this.medium.short);t.height=(0,s.measureToString)(this.medium.long);this[a.$extra].space={width:this.medium.short,height:this.medium.long};if("landscape"===this.medium.orientation){const e=t.width;t.width=t.height;t.height=e;this[a.$extra].space={width:this.medium.long,height:this.medium.short}}}else(0,c.warn)("XFA - No medium specified in pageArea: please file a bug.");this[a.$childrenToHTML]({filter:new Set(["area","draw","field","subform"]),include:!0});this[a.$childrenToHTML]({filter:new Set(["contentArea"]),include:!0});return o.HTMLResult.success({name:"div",children:e,attributes:{class:["xfaPage"],id:this[a.$uid],style:t,xfaName:this.name}})}}class PageSet extends a.XFAObject{constructor(e){super(d,"pageSet",!0);this.duplexImposition=(0,o.getStringOption)(e.duplexImposition,["longEdge","shortEdge"]);this.id=e.id||"";this.name=e.name||"";this.relation=(0,o.getStringOption)(e.relation,["orderedOccurrence","duplexPaginated","simplexPaginated"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.occur=null;this.pageArea=new a.XFAObjectArray;this.pageSet=new a.XFAObjectArray}[a.$cleanPage](){for(const e of this.pageArea.children)e[a.$cleanPage]();for(const e of this.pageSet.children)e[a.$cleanPage]()}[a.$isUsable](){return!this.occur||-1===this.occur.max||this[a.$extra].numberOfUse<this.occur.max}[a.$getNextPage](){this[a.$extra]||(this[a.$extra]={numberOfUse:1,pageIndex:-1,pageSetIndex:-1});if("orderedOccurrence"===this.relation){if(this[a.$extra].pageIndex+1<this.pageArea.children.length){this[a.$extra].pageIndex+=1;return this.pageArea.children[this[a.$extra].pageIndex][a.$getNextPage]()}if(this[a.$extra].pageSetIndex+1<this.pageSet.children.length){this[a.$extra].pageSetIndex+=1;return this.pageSet.children[this[a.$extra].pageSetIndex][a.$getNextPage]()}if(this[a.$isUsable]()){this[a.$extra].numberOfUse+=1;this[a.$extra].pageIndex=-1;this[a.$extra].pageSetIndex=-1;return this[a.$getNextPage]()}const e=this[a.$getParent]();if(e instanceof PageSet)return e[a.$getNextPage]();this[a.$cleanPage]();return this[a.$getNextPage]()}const e=this[a.$getTemplateRoot]()[a.$extra].pageNumber,t=e%2==0?"even":"odd",r=0===e?"first":"rest";let n=this.pageArea.children.find((e=>e.oddOrEven===t&&e.pagePosition===r));if(n)return n;n=this.pageArea.children.find((e=>"any"===e.oddOrEven&&e.pagePosition===r));if(n)return n;n=this.pageArea.children.find((e=>"any"===e.oddOrEven&&"any"===e.pagePosition));return n||this.pageArea.children[0]}}class Para extends a.XFAObject{constructor(e){super(d,"para",!0);this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.lineHeight=e.lineHeight?(0,o.getMeasurement)(e.lineHeight,"0pt"):"";this.marginLeft=e.marginLeft?(0,o.getMeasurement)(e.marginLeft,"0pt"):"";this.marginRight=e.marginRight?(0,o.getMeasurement)(e.marginRight,"0pt"):"";this.orphans=(0,o.getInteger)({data:e.orphans,defaultValue:0,validate:e=>e>=0});this.preserve=e.preserve||"";this.radixOffset=e.radixOffset?(0,o.getMeasurement)(e.radixOffset,"0pt"):"";this.spaceAbove=e.spaceAbove?(0,o.getMeasurement)(e.spaceAbove,"0pt"):"";this.spaceBelow=e.spaceBelow?(0,o.getMeasurement)(e.spaceBelow,"0pt"):"";this.tabDefault=e.tabDefault?(0,o.getMeasurement)(this.tabDefault):"";this.tabStops=(e.tabStops||"").trim().split(/\s+/).map(((e,t)=>t%2==1?(0,o.getMeasurement)(e):e));this.textIndent=e.textIndent?(0,o.getMeasurement)(e.textIndent,"0pt"):"";this.use=e.use||"";this.usehref=e.usehref||"";this.vAlign=(0,o.getStringOption)(e.vAlign,["top","bottom","middle"]);this.widows=(0,o.getInteger)({data:e.widows,defaultValue:0,validate:e=>e>=0});this.hyphenation=null}[a.$toStyle](){const e=(0,s.toStyle)(this,"hAlign");""!==this.marginLeft&&(e.paddingLeft=(0,s.measureToString)(this.marginLeft));""!==this.marginRight&&(e.paddingight=(0,s.measureToString)(this.marginRight));""!==this.spaceAbove&&(e.paddingTop=(0,s.measureToString)(this.spaceAbove));""!==this.spaceBelow&&(e.paddingBottom=(0,s.measureToString)(this.spaceBelow));if(""!==this.textIndent){e.textIndent=(0,s.measureToString)(this.textIndent);(0,s.fixTextIndent)(e)}this.lineHeight>0&&(e.lineHeight=(0,s.measureToString)(this.lineHeight));""!==this.tabDefault&&(e.tabSize=(0,s.measureToString)(this.tabDefault));this.tabStops.length;this.hyphenatation&&Object.assign(e,this.hyphenatation[a.$toStyle]());return e}}class PasswordEdit extends a.XFAObject{constructor(e){super(d,"passwordEdit",!0);this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.passwordChar=e.passwordChar||"*";this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.margin=null}}class Pattern extends a.XFAObject{constructor(e){super(d,"pattern",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["crossHatch","crossDiagonal","diagonalLeft","diagonalRight","horizontal","vertical"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[a.$toStyle](e){e=e?e[a.$toStyle]():"#FFFFFF";const t=this.color?this.color[a.$toStyle]():"#000000",r="repeating-linear-gradient",n=`${e},${e} 5px,${t} 5px,${t} 10px`;switch(this.type){case"crossHatch":return`${r}(to top,${n}) ${r}(to right,${n})`;case"crossDiagonal":return`${r}(45deg,${n}) ${r}(-45deg,${n})`;case"diagonalLeft":return`${r}(45deg,${n})`;case"diagonalRight":return`${r}(-45deg,${n})`;case"horizontal":return`${r}(to top,${n})`;case"vertical":return`${r}(to right,${n})`}return""}}class Picture extends a.StringObject{constructor(e){super(d,"picture");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Proto extends a.XFAObject{constructor(e){super(d,"proto",!0);this.appearanceFilter=new a.XFAObjectArray;this.arc=new a.XFAObjectArray;this.area=new a.XFAObjectArray;this.assist=new a.XFAObjectArray;this.barcode=new a.XFAObjectArray;this.bindItems=new a.XFAObjectArray;this.bookend=new a.XFAObjectArray;this.boolean=new a.XFAObjectArray;this.border=new a.XFAObjectArray;this.break=new a.XFAObjectArray;this.breakAfter=new a.XFAObjectArray;this.breakBefore=new a.XFAObjectArray;this.button=new a.XFAObjectArray;this.calculate=new a.XFAObjectArray;this.caption=new a.XFAObjectArray;this.certificate=new a.XFAObjectArray;this.certificates=new a.XFAObjectArray;this.checkButton=new a.XFAObjectArray;this.choiceList=new a.XFAObjectArray;this.color=new a.XFAObjectArray;this.comb=new a.XFAObjectArray;this.connect=new a.XFAObjectArray;this.contentArea=new a.XFAObjectArray;this.corner=new a.XFAObjectArray;this.date=new a.XFAObjectArray;this.dateTime=new a.XFAObjectArray;this.dateTimeEdit=new a.XFAObjectArray;this.decimal=new a.XFAObjectArray;this.defaultUi=new a.XFAObjectArray;this.desc=new a.XFAObjectArray;this.digestMethod=new a.XFAObjectArray;this.digestMethods=new a.XFAObjectArray;this.draw=new a.XFAObjectArray;this.edge=new a.XFAObjectArray;this.encoding=new a.XFAObjectArray;this.encodings=new a.XFAObjectArray;this.encrypt=new a.XFAObjectArray;this.encryptData=new a.XFAObjectArray;this.encryption=new a.XFAObjectArray;this.encryptionMethod=new a.XFAObjectArray;this.encryptionMethods=new a.XFAObjectArray;this.event=new a.XFAObjectArray;this.exData=new a.XFAObjectArray;this.exObject=new a.XFAObjectArray;this.exclGroup=new a.XFAObjectArray;this.execute=new a.XFAObjectArray;this.extras=new a.XFAObjectArray;this.field=new a.XFAObjectArray;this.fill=new a.XFAObjectArray;this.filter=new a.XFAObjectArray;this.float=new a.XFAObjectArray;this.font=new a.XFAObjectArray;this.format=new a.XFAObjectArray;this.handler=new a.XFAObjectArray;this.hyphenation=new a.XFAObjectArray;this.image=new a.XFAObjectArray;this.imageEdit=new a.XFAObjectArray;this.integer=new a.XFAObjectArray;this.issuers=new a.XFAObjectArray;this.items=new a.XFAObjectArray;this.keep=new a.XFAObjectArray;this.keyUsage=new a.XFAObjectArray;this.line=new a.XFAObjectArray;this.linear=new a.XFAObjectArray;this.lockDocument=new a.XFAObjectArray;this.manifest=new a.XFAObjectArray;this.margin=new a.XFAObjectArray;this.mdp=new a.XFAObjectArray;this.medium=new a.XFAObjectArray;this.message=new a.XFAObjectArray;this.numericEdit=new a.XFAObjectArray;this.occur=new a.XFAObjectArray;this.oid=new a.XFAObjectArray;this.oids=new a.XFAObjectArray;this.overflow=new a.XFAObjectArray;this.pageArea=new a.XFAObjectArray;this.pageSet=new a.XFAObjectArray;this.para=new a.XFAObjectArray;this.passwordEdit=new a.XFAObjectArray;this.pattern=new a.XFAObjectArray;this.picture=new a.XFAObjectArray;this.radial=new a.XFAObjectArray;this.reason=new a.XFAObjectArray;this.reasons=new a.XFAObjectArray;this.rectangle=new a.XFAObjectArray;this.ref=new a.XFAObjectArray;this.script=new a.XFAObjectArray;this.setProperty=new a.XFAObjectArray;this.signData=new a.XFAObjectArray;this.signature=new a.XFAObjectArray;this.signing=new a.XFAObjectArray;this.solid=new a.XFAObjectArray;this.speak=new a.XFAObjectArray;this.stipple=new a.XFAObjectArray;this.subform=new a.XFAObjectArray;this.subformSet=new a.XFAObjectArray;this.subjectDN=new a.XFAObjectArray;this.subjectDNs=new a.XFAObjectArray;this.submit=new a.XFAObjectArray;this.text=new a.XFAObjectArray;this.textEdit=new a.XFAObjectArray;this.time=new a.XFAObjectArray;this.timeStamp=new a.XFAObjectArray;this.toolTip=new a.XFAObjectArray;this.traversal=new a.XFAObjectArray;this.traverse=new a.XFAObjectArray;this.ui=new a.XFAObjectArray;this.validate=new a.XFAObjectArray;this.value=new a.XFAObjectArray;this.variables=new a.XFAObjectArray}}class Radial extends a.XFAObject{constructor(e){super(d,"radial",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["toEdge","toCenter"]);this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[a.$toStyle](e){e=e?e[a.$toStyle]():"#FFFFFF";const t=this.color?this.color[a.$toStyle]():"#000000";return`radial-gradient(circle at center, ${"toEdge"===this.type?`${e},${t}`:`${t},${e}`})`}}class Reason extends a.StringObject{constructor(e){super(d,"reason");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Reasons extends a.XFAObject{constructor(e){super(d,"reasons",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.reason=new a.XFAObjectArray}}class Rectangle extends a.XFAObject{constructor(e){super(d,"rectangle",!0);this.hand=(0,o.getStringOption)(e.hand,["even","left","right"]);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.corner=new a.XFAObjectArray(4);this.edge=new a.XFAObjectArray(4);this.fill=null}[a.$toHTML](){const e=this.edge.children.length?this.edge.children[0]:new Edge({}),t=e[a.$toStyle](),r=Object.create(null);this.fill&&"visible"===this.fill.presence?Object.assign(r,this.fill[a.$toStyle]()):r.fill="transparent";r.strokeWidth=(0,s.measureToString)("visible"===e.presence?e.thickness:0);r.stroke=t.color;const n=(this.corner.children.length?this.corner.children[0]:new Corner({}))[a.$toStyle](),i={name:"svg",children:[{name:"rect",attributes:{xmlns:f,width:"100%",height:"100%",x:0,y:0,rx:n.radius,ry:n.radius,style:r}}],attributes:{xmlns:f,style:{overflow:"visible"},width:"100%",height:"100%"}};if(hasMargin(this[a.$getParent]()[a.$getParent]()))return o.HTMLResult.success({name:"div",attributes:{style:{display:"inline",width:"100%",height:"100%"}},children:[i]});i.attributes.style.position="absolute";return o.HTMLResult.success(i)}}class RefElement extends a.StringObject{constructor(e){super(d,"ref");this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Script extends a.StringObject{constructor(e){super(d,"script");this.binding=e.binding||"";this.contentType=e.contentType||"";this.id=e.id||"";this.name=e.name||"";this.runAt=(0,o.getStringOption)(e.runAt,["client","both","server"]);this.use=e.use||"";this.usehref=e.usehref||""}}class SetProperty extends a.XFAObject{constructor(e){super(d,"setProperty");this.connection=e.connection||"";this.ref=e.ref||"";this.target=e.target||""}}t.SetProperty=SetProperty;class SignData extends a.XFAObject{constructor(e){super(d,"signData",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["sign","clear","verify"]);this.ref=e.ref||"";this.target=e.target||"";this.use=e.use||"";this.usehref=e.usehref||"";this.filter=null;this.manifest=null}}class Signature extends a.XFAObject{constructor(e){super(d,"signature",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["PDF1.3","PDF1.6"]);this.use=e.use||"";this.usehref=e.usehref||"";this.border=null;this.extras=null;this.filter=null;this.manifest=null;this.margin=null}}class Signing extends a.XFAObject{constructor(e){super(d,"signing",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.certificate=new a.XFAObjectArray}}class Solid extends a.XFAObject{constructor(e){super(d,"solid",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null}[a.$toStyle](e){return e?e[a.$toStyle]():"#FFFFFF"}}class Speak extends a.StringObject{constructor(e){super(d,"speak");this.disable=(0,o.getInteger)({data:e.disable,defaultValue:0,validate:e=>1===e});this.id=e.id||"";this.priority=(0,o.getStringOption)(e.priority,["custom","caption","name","toolTip"]);this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Stipple extends a.XFAObject{constructor(e){super(d,"stipple",!0);this.id=e.id||"";this.rate=(0,o.getInteger)({data:e.rate,defaultValue:50,validate:e=>e>=0&&e<=100});this.use=e.use||"";this.usehref=e.usehref||"";this.color=null;this.extras=null}[a.$toStyle](e){const t=this.rate/100;return c.Util.makeHexColor(Math.round(e.value.r*(1-t)+this.value.r*t),Math.round(e.value.g*(1-t)+this.value.g*t),Math.round(e.value.b*(1-t)+this.value.b*t))}}class Subform extends a.XFAObject{constructor(e){super(d,"subform",!0);this.access=(0,o.getStringOption)(e.access,["open","nonInteractive","protected","readOnly"]);this.allowMacro=(0,o.getInteger)({data:e.allowMacro,defaultValue:0,validate:e=>1===e});this.anchorType=(0,o.getStringOption)(e.anchorType,["topLeft","bottomCenter","bottomLeft","bottomRight","middleCenter","middleLeft","middleRight","topCenter","topRight"]);this.colSpan=(0,o.getInteger)({data:e.colSpan,defaultValue:1,validate:e=>e>=1||-1===e});this.columnWidths=(e.columnWidths||"").trim().split(/\s+/).map((e=>"-1"===e?-1:(0,o.getMeasurement)(e)));this.h=e.h?(0,o.getMeasurement)(e.h):"";this.hAlign=(0,o.getStringOption)(e.hAlign,["left","center","justify","justifyAll","radix","right"]);this.id=e.id||"";this.layout=(0,o.getStringOption)(e.layout,["position","lr-tb","rl-row","rl-tb","row","table","tb"]);this.locale=e.locale||"";this.maxH=(0,o.getMeasurement)(e.maxH,"0pt");this.maxW=(0,o.getMeasurement)(e.maxW,"0pt");this.mergeMode=(0,o.getStringOption)(e.mergeMode,["consumeData","matchTemplate"]);this.minH=(0,o.getMeasurement)(e.minH,"0pt");this.minW=(0,o.getMeasurement)(e.minW,"0pt");this.name=e.name||"";this.presence=(0,o.getStringOption)(e.presence,["visible","hidden","inactive","invisible"]);this.relevant=(0,o.getRelevant)(e.relevant);this.restoreState=(0,o.getStringOption)(e.restoreState,["manual","auto"]);this.scope=(0,o.getStringOption)(e.scope,["name","none"]);this.use=e.use||"";this.usehref=e.usehref||"";this.w=e.w?(0,o.getMeasurement)(e.w):"";this.x=(0,o.getMeasurement)(e.x,"0pt");this.y=(0,o.getMeasurement)(e.y,"0pt");this.assist=null;this.bind=null;this.bookend=null;this.border=null;this.break=null;this.calculate=null;this.desc=null;this.extras=null;this.keep=null;this.margin=null;this.occur=null;this.overflow=null;this.pageSet=null;this.para=null;this.traversal=null;this.validate=null;this.variables=null;this.area=new a.XFAObjectArray;this.breakAfter=new a.XFAObjectArray;this.breakBefore=new a.XFAObjectArray;this.connect=new a.XFAObjectArray;this.draw=new a.XFAObjectArray;this.event=new a.XFAObjectArray;this.exObject=new a.XFAObjectArray;this.exclGroup=new a.XFAObjectArray;this.field=new a.XFAObjectArray;this.proto=new a.XFAObjectArray;this.setProperty=new a.XFAObjectArray;this.subform=new a.XFAObjectArray;this.subformSet=new a.XFAObjectArray}[a.$getSubformParent](){const e=this[a.$getParent]();return e instanceof SubformSet?e[a.$getSubformParent]():e}[a.$isBindable](){return!0}[a.$isThereMoreWidth](){return this.layout.endsWith("-tb")&&0===this[a.$extra].attempt&&this[a.$extra].numberInLine>0||this[a.$getParent]()[a.$isThereMoreWidth]()}*[a.$getContainedChildren](){yield*getContainedChildren(this)}[a.$flushHTML](){return(0,i.flushHTML)(this)}[a.$addHTML](e,t){(0,i.addHTML)(this,e,t)}[a.$getAvailableSpace](){return(0,i.getAvailableSpace)(this)}[a.$isSplittable](){const e=this[a.$getSubformParent]();if(!e[a.$isSplittable]())return!1;if(void 0!==this[a.$extra]._isSplittable)return this[a.$extra]._isSplittable;if("position"===this.layout||this.layout.includes("row")){this[a.$extra]._isSplittable=!1;return!1}if(this.keep&&"none"!==this.keep.intact){this[a.$extra]._isSplittable=!1;return!1}if(e.layout&&e.layout.endsWith("-tb")&&0!==e[a.$extra].numberInLine)return!1;this[a.$extra]._isSplittable=!0;return!0}[a.$toHTML](e){setTabIndex(this);if(this.break){if("auto"!==this.break.after||""!==this.break.afterTarget){const e=new BreakAfter({targetType:this.break.after,target:this.break.afterTarget,startNew:this.break.startNew.toString()});e[a.$globalData]=this[a.$globalData];this[a.$appendChild](e);this.breakAfter.push(e)}if("auto"!==this.break.before||""!==this.break.beforeTarget){const e=new BreakBefore({targetType:this.break.before,target:this.break.beforeTarget,startNew:this.break.startNew.toString()});e[a.$globalData]=this[a.$globalData];this[a.$appendChild](e);this.breakBefore.push(e)}if(""!==this.break.overflowTarget){const e=new Overflow({target:this.break.overflowTarget,leader:this.break.overflowLeader,trailer:this.break.overflowTrailer});e[a.$globalData]=this[a.$globalData];this[a.$appendChild](e);this.overflow.push(e)}this[a.$removeChild](this.break);this.break=null}if("hidden"===this.presence||"inactive"===this.presence)return o.HTMLResult.EMPTY;(this.breakBefore.children.length>1||this.breakAfter.children.length>1)&&(0,c.warn)("XFA - Several breakBefore or breakAfter in subforms: please file a bug.");if(this.breakBefore.children.length>=1){const e=this.breakBefore.children[0];if(handleBreak(e))return o.HTMLResult.breakNode(e)}if(this[a.$extra]&&this[a.$extra].afterBreakAfter)return o.HTMLResult.EMPTY;(0,s.fixDimensions)(this);const t=[],r={id:this[a.$uid],class:[]};(0,s.setAccess)(this,r.class);this[a.$extra]||(this[a.$extra]=Object.create(null));Object.assign(this[a.$extra],{children:t,line:null,attributes:r,attempt:0,numberInLine:0,availableSpace:{width:Math.min(this.w||1/0,e.width),height:Math.min(this.h||1/0,e.height)},width:0,height:0,prevHeight:0,currentWidth:0});const n=this[a.$getTemplateRoot](),l=n[a.$extra].noLayoutFailure,h=this[a.$isSplittable]();h||setFirstUnsplittable(this);if(!(0,i.checkDimensions)(this,e))return o.HTMLResult.FAILURE;const u=new Set(["area","draw","exclGroup","field","subform","subformSet"]);if(this.layout.includes("row")){const e=this[a.$getSubformParent]().columnWidths;if(Array.isArray(e)&&e.length>0){this[a.$extra].columnWidths=e;this[a.$extra].currentColumn=0}}const d=(0,s.toStyle)(this,"anchorType","dimensions","position","presence","border","margin","hAlign"),f=["xfaSubform"],g=(0,s.layoutClass)(this);g&&f.push(g);r.style=d;r.class=f;this.name&&(r.xfaName=this.name);if(this.overflow){const t=this.overflow[a.$getExtra]();if(t.addLeader){t.addLeader=!1;handleOverflow(this,t.leader,e)}}this[a.$pushPara]();const p="lr-tb"===this.layout||"rl-tb"===this.layout,m=p?2:1;for(;this[a.$extra].attempt<m;this[a.$extra].attempt++){p&&1===this[a.$extra].attempt&&(this[a.$extra].numberInLine=0);const e=this[a.$childrenToHTML]({filter:u,include:!0});if(e.success)break;if(e.isBreak()){this[a.$popPara]();return e}if(p&&0===this[a.$extra].attempt&&0===this[a.$extra].numberInLine&&!n[a.$extra].noLayoutFailure){this[a.$extra].attempt=m;break}}this[a.$popPara]();h||unsetFirstUnsplittable(this);n[a.$extra].noLayoutFailure=l;if(this[a.$extra].attempt===m){this.overflow&&(this[a.$getTemplateRoot]()[a.$extra].overflowNode=this.overflow);h||delete this[a.$extra];return o.HTMLResult.FAILURE}if(this.overflow){const t=this.overflow[a.$getExtra]();if(t.addTrailer){t.addTrailer=!1;handleOverflow(this,t.trailer,e)}}let b=0,y=0;if(this.margin){b=this.margin.leftInset+this.margin.rightInset;y=this.margin.topInset+this.margin.bottomInset}const w=Math.max(this[a.$extra].width+b,this.w||0),S=Math.max(this[a.$extra].height+y,this.h||0),x=[this.x,this.y,w,S];""===this.w&&(d.width=(0,s.measureToString)(w));""===this.h&&(d.height=(0,s.measureToString)(S));if(("0px"===d.width||"0px"===d.height)&&0===t.length)return o.HTMLResult.EMPTY;const k={name:"div",attributes:r,children:t};applyAssist(this,r);const C=o.HTMLResult.success((0,s.createWrapper)(this,k),x);if(this.breakAfter.children.length>=1){const e=this.breakAfter.children[0];if(handleBreak(e)){this[a.$extra].afterBreakAfter=C;return o.HTMLResult.breakNode(e)}}delete this[a.$extra];return C}}class SubformSet extends a.XFAObject{constructor(e){super(d,"subformSet",!0);this.id=e.id||"";this.name=e.name||"";this.relation=(0,o.getStringOption)(e.relation,["ordered","choice","unordered"]);this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.bookend=null;this.break=null;this.desc=null;this.extras=null;this.occur=null;this.overflow=null;this.breakAfter=new a.XFAObjectArray;this.breakBefore=new a.XFAObjectArray;this.subform=new a.XFAObjectArray;this.subformSet=new a.XFAObjectArray}*[a.$getContainedChildren](){yield*getContainedChildren(this)}[a.$getSubformParent](){let e=this[a.$getParent]();for(;!(e instanceof Subform);)e=e[a.$getParent]();return e}[a.$isBindable](){return!0}}class SubjectDN extends a.ContentObject{constructor(e){super(d,"subjectDN");this.delimiter=e.delimiter||",";this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){this[a.$content]=new Map(this[a.$content].split(this.delimiter).map((e=>{(e=e.split("=",2))[0]=e[0].trim();return e})))}}class SubjectDNs extends a.XFAObject{constructor(e){super(d,"subjectDNs",!0);this.id=e.id||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||"";this.subjectDN=new a.XFAObjectArray}}class Submit extends a.XFAObject{constructor(e){super(d,"submit",!0);this.embedPDF=(0,o.getInteger)({data:e.embedPDF,defaultValue:0,validate:e=>1===e});this.format=(0,o.getStringOption)(e.format,["xdp","formdata","pdf","urlencoded","xfd","xml"]);this.id=e.id||"";this.target=e.target||"";this.textEncoding=(0,o.getKeyword)({data:e.textEncoding?e.textEncoding.toLowerCase():"",defaultValue:"",validate:e=>["utf-8","big-five","fontspecific","gbk","gb-18030","gb-2312","ksc-5601","none","shift-jis","ucs-2","utf-16"].includes(e)||e.match(/iso-8859-\d{2}/)});this.use=e.use||"";this.usehref=e.usehref||"";this.xdpContent=e.xdpContent||"";this.encrypt=null;this.encryptData=new a.XFAObjectArray;this.signData=new a.XFAObjectArray}}class Template extends a.XFAObject{constructor(e){super(d,"template",!0);this.baseProfile=(0,o.getStringOption)(e.baseProfile,["full","interactiveForms"]);this.extras=null;this.subform=new a.XFAObjectArray}[a.$finalize](){0===this.subform.children.length&&(0,c.warn)("XFA - No subforms in template node.");this.subform.children.length>=2&&(0,c.warn)("XFA - Several subforms in template node: please file a bug.");this[a.$tabIndex]=5e3}[a.$isSplittable](){return!0}[a.$searchNode](e,t){return e.startsWith("#")?[this[a.$ids].get(e.slice(1))]:(0,u.searchNode)(this,t,e,!0,!0)}*[a.$toPages](){if(!this.subform.children.length)return o.HTMLResult.success({name:"div",children:[]});this[a.$extra]={overflowNode:null,firstUnsplittable:null,currentContentArea:null,currentPageArea:null,noLayoutFailure:!1,pageNumber:1,pagePosition:"first",oddOrEven:"odd",blankOrNotBlank:"nonBlank",paraStack:[]};const e=this.subform.children[0];e.pageSet[a.$cleanPage]();const t=e.pageSet.pageArea.children,r={name:"div",children:[]};let n=null,i=null,s=null;if(e.breakBefore.children.length>=1){i=e.breakBefore.children[0];s=i.target}else if(e.subform.children.length>=1&&e.subform.children[0].breakBefore.children.length>=1){i=e.subform.children[0].breakBefore.children[0];s=i.target}else if(e.break&&e.break.beforeTarget){i=e.break;s=i.beforeTarget}else if(e.subform.children.length>=1&&e.subform.children[0].break&&e.subform.children[0].break.beforeTarget){i=e.subform.children[0].break;s=i.beforeTarget}if(i){const e=this[a.$searchNode](s,i[a.$getParent]());if(e instanceof PageArea){n=e;i[a.$extra]={}}}n||(n=t[0]);n[a.$extra]={numberOfUse:1};const l=n[a.$getParent]();l[a.$extra]={numberOfUse:1,pageIndex:l.pageArea.children.indexOf(n),pageSetIndex:0};let h,u=null,d=null,f=!0,g=0,p=0;for(;;){if(f)g=0;else{r.children.pop();if(3==++g){(0,c.warn)("XFA - Something goes wrong: please file a bug.");return r}}h=null;this[a.$extra].currentPageArea=n;const t=n[a.$toHTML]().html;r.children.push(t);if(u){this[a.$extra].noLayoutFailure=!0;t.children.push(u[a.$toHTML](n[a.$extra].space).html);u=null}if(d){this[a.$extra].noLayoutFailure=!0;t.children.push(d[a.$toHTML](n[a.$extra].space).html);d=null}const i=n.contentArea.children,s=t.children.filter((e=>e.attributes.class.includes("xfaContentarea")));f=!1;this[a.$extra].firstUnsplittable=null;this[a.$extra].noLayoutFailure=!1;const flush=t=>{const r=e[a.$flushHTML]();if(r){f=f||r.children&&0!==r.children.length;s[t].children.push(r)}};for(let t=p,n=i.length;t<n;t++){const n=this[a.$extra].currentContentArea=i[t],o={width:n.w,height:n.h};p=0;if(u){s[t].children.push(u[a.$toHTML](o).html);u=null}if(d){s[t].children.push(d[a.$toHTML](o).html);d=null}const c=e[a.$toHTML](o);if(c.success){if(c.html){f=f||c.html.children&&0!==c.html.children.length;s[t].children.push(c.html)}else!f&&r.children.length>1&&r.children.pop();return r}if(c.isBreak()){const e=c.breakNode;flush(t);if("auto"===e.targetType)continue;if(e.leader){u=this[a.$searchNode](e.leader,e[a.$getParent]());u=u?u[0]:null}if(e.trailer){d=this[a.$searchNode](e.trailer,e[a.$getParent]());d=d?d[0]:null}if("pageArea"===e.targetType){h=e[a.$extra].target;t=1/0}else if(e[a.$extra].target){h=e[a.$extra].target;p=e[a.$extra].index+1;t=1/0}else t=e[a.$extra].index}else if(this[a.$extra].overflowNode){const e=this[a.$extra].overflowNode;this[a.$extra].overflowNode=null;const r=e[a.$getExtra](),n=r.target;r.addLeader=null!==r.leader;r.addTrailer=null!==r.trailer;flush(t);const s=t;t=1/0;if(n instanceof PageArea)h=n;else if(n instanceof ContentArea){const e=i.indexOf(n);if(-1!==e)e>s?t=e-1:p=e;else{h=n[a.$getParent]();p=h.contentArea.children.indexOf(n)}}}else flush(t)}this[a.$extra].pageNumber+=1;h&&(h[a.$isUsable]()?h[a.$extra].numberOfUse+=1:h=null);n=h||n[a.$getNextPage]();yield null}}}t.Template=Template;class Text extends a.ContentObject{constructor(e){super(d,"text");this.id=e.id||"";this.maxChars=(0,o.getInteger)({data:e.maxChars,defaultValue:0,validate:e=>e>=0});this.name=e.name||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$acceptWhitespace](){return!0}[a.$onChild](e){if(e[a.$namespaceId]===n.NamespaceIds.xhtml.id){this[a.$content]=e;return!0}(0,c.warn)(`XFA - Invalid content in Text: ${e[a.$nodeName]}.`);return!1}[a.$onText](e){this[a.$content]instanceof a.XFAObject||super[a.$onText](e)}[a.$finalize](){"string"==typeof this[a.$content]&&(this[a.$content]=this[a.$content].replace(/\r\n/g,"\n"))}[a.$getExtra](){return"string"==typeof this[a.$content]?this[a.$content].split(/[\u2029\u2028\n]/).reduce(((e,t)=>{t&&e.push(t);return e}),[]).join("\n"):this[a.$content][a.$text]()}[a.$toHTML](e){if("string"==typeof this[a.$content]){const e=valueToHtml(this[a.$content]).html;if(this[a.$content].includes("\u2029")){e.name="div";e.children=[];this[a.$content].split("\u2029").map((e=>e.split(/[\u2028\n]/).reduce(((e,t)=>{e.push({name:"span",value:t},{name:"br"});return e}),[]))).forEach((t=>{e.children.push({name:"p",children:t})}))}else if(/[\u2028\n]/.test(this[a.$content])){e.name="div";e.children=[];this[a.$content].split(/[\u2028\n]/).forEach((t=>{e.children.push({name:"span",value:t},{name:"br"})}))}return o.HTMLResult.success(e)}return this[a.$content][a.$toHTML](e)}}t.Text=Text;class TextEdit extends a.XFAObject{constructor(e){super(d,"textEdit",!0);this.allowRichText=(0,o.getInteger)({data:e.allowRichText,defaultValue:0,validate:e=>1===e});this.hScrollPolicy=(0,o.getStringOption)(e.hScrollPolicy,["auto","off","on"]);this.id=e.id||"";this.multiLine=(0,o.getInteger)({data:e.multiLine,defaultValue:"",validate:e=>0===e||1===e});this.use=e.use||"";this.usehref=e.usehref||"";this.vScrollPolicy=(0,o.getStringOption)(e.vScrollPolicy,["auto","off","on"]);this.border=null;this.comb=null;this.extras=null;this.margin=null}[a.$toHTML](e){const t=(0,s.toStyle)(this,"border","font","margin");let r;const n=this[a.$getParent]()[a.$getParent]();""===this.multiLine&&(this.multiLine=n instanceof Draw?1:0);r=1===this.multiLine?{name:"textarea",attributes:{dataId:n[a.$data]&&n[a.$data][a.$uid]||n[a.$uid],fieldId:n[a.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}}:{name:"input",attributes:{type:"text",dataId:n[a.$data]&&n[a.$data][a.$uid]||n[a.$uid],fieldId:n[a.$uid],class:["xfaTextfield"],style:t,"aria-label":ariaLabel(n),"aria-required":!1}};if(isRequired(n)){r.attributes["aria-required"]=!0;r.attributes.required=!0}return o.HTMLResult.success({name:"label",attributes:{class:["xfaLabel"]},children:[r]})}}class Time extends a.StringObject{constructor(e){super(d,"time");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}[a.$finalize](){const e=this[a.$content].trim();this[a.$content]=e?new Date(e):null}[a.$toHTML](e){return valueToHtml(this[a.$content]?this[a.$content].toString():"")}}class TimeStamp extends a.XFAObject{constructor(e){super(d,"timeStamp");this.id=e.id||"";this.server=e.server||"";this.type=(0,o.getStringOption)(e.type,["optional","required"]);this.use=e.use||"";this.usehref=e.usehref||""}}class ToolTip extends a.StringObject{constructor(e){super(d,"toolTip");this.id=e.id||"";this.rid=e.rid||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Traversal extends a.XFAObject{constructor(e){super(d,"traversal",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.traverse=new a.XFAObjectArray}}class Traverse extends a.XFAObject{constructor(e){super(d,"traverse",!0);this.id=e.id||"";this.operation=(0,o.getStringOption)(e.operation,["next","back","down","first","left","right","up"]);this.ref=e.ref||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.script=null}get name(){return this.operation}[a.$isTransparent](){return!1}}class Ui extends a.XFAObject{constructor(e){super(d,"ui",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.picture=null;this.barcode=null;this.button=null;this.checkButton=null;this.choiceList=null;this.dateTimeEdit=null;this.defaultUi=null;this.imageEdit=null;this.numericEdit=null;this.passwordEdit=null;this.signature=null;this.textEdit=null}[a.$getExtra](){if(void 0===this[a.$extra]){for(const e of Object.getOwnPropertyNames(this)){if("extras"===e||"picture"===e)continue;const t=this[e];if(t instanceof a.XFAObject){this[a.$extra]=t;return t}}this[a.$extra]=null}return this[a.$extra]}[a.$toHTML](e){const t=this[a.$getExtra]();return t?t[a.$toHTML](e):o.HTMLResult.EMPTY}}class Validate extends a.XFAObject{constructor(e){super(d,"validate",!0);this.formatTest=(0,o.getStringOption)(e.formatTest,["warning","disabled","error"]);this.id=e.id||"";this.nullTest=(0,o.getStringOption)(e.nullTest,["disabled","error","warning"]);this.scriptTest=(0,o.getStringOption)(e.scriptTest,["error","disabled","warning"]);this.use=e.use||"";this.usehref=e.usehref||"";this.extras=null;this.message=null;this.picture=null;this.script=null}}class Value extends a.XFAObject{constructor(e){super(d,"value",!0);this.id=e.id||"";this.override=(0,o.getInteger)({data:e.override,defaultValue:0,validate:e=>1===e});this.relevant=(0,o.getRelevant)(e.relevant);this.use=e.use||"";this.usehref=e.usehref||"";this.arc=null;this.boolean=null;this.date=null;this.dateTime=null;this.decimal=null;this.exData=null;this.float=null;this.image=null;this.integer=null;this.line=null;this.rectangle=null;this.text=null;this.time=null}[a.$setValue](e){const t=this[a.$getParent]();if(t instanceof Field&&t.ui&&t.ui.imageEdit){if(!this.image){this.image=new Image({});this[a.$appendChild](this.image)}this.image[a.$content]=e[a.$content];return}const r=e[a.$nodeName];if(null===this[r]){for(const e of Object.getOwnPropertyNames(this)){const t=this[e];if(t instanceof a.XFAObject){this[e]=null;this[a.$removeChild](t)}}this[e[a.$nodeName]]=e;this[a.$appendChild](e)}else this[r][a.$content]=e[a.$content]}[a.$text](){if(this.exData)return"string"==typeof this.exData[a.$content]?this.exData[a.$content].trim():this.exData[a.$content][a.$text]().trim();for(const e of Object.getOwnPropertyNames(this)){if("image"===e)continue;const t=this[e];if(t instanceof a.XFAObject)return(t[a.$content]||"").toString().trim()}return null}[a.$toHTML](e){for(const t of Object.getOwnPropertyNames(this)){const r=this[t];if(r instanceof a.XFAObject)return r[a.$toHTML](e)}return o.HTMLResult.EMPTY}}t.Value=Value;class Variables extends a.XFAObject{constructor(e){super(d,"variables",!0);this.id=e.id||"";this.use=e.use||"";this.usehref=e.usehref||"";this.boolean=new a.XFAObjectArray;this.date=new a.XFAObjectArray;this.dateTime=new a.XFAObjectArray;this.decimal=new a.XFAObjectArray;this.exData=new a.XFAObjectArray;this.float=new a.XFAObjectArray;this.image=new a.XFAObjectArray;this.integer=new a.XFAObjectArray;this.manifest=new a.XFAObjectArray;this.script=new a.XFAObjectArray;this.text=new a.XFAObjectArray;this.time=new a.XFAObjectArray}[a.$isTransparent](){return!0}}class TemplateNamespace{static[n.$buildXFAObject](e,t){if(TemplateNamespace.hasOwnProperty(e)){const r=TemplateNamespace[e](t);r[a.$setSetAttributes](t);return r}}static appearanceFilter(e){return new AppearanceFilter(e)}static arc(e){return new Arc(e)}static area(e){return new Area(e)}static assist(e){return new Assist(e)}static barcode(e){return new Barcode(e)}static bind(e){return new Bind(e)}static bindItems(e){return new BindItems(e)}static bookend(e){return new Bookend(e)}static boolean(e){return new BooleanElement(e)}static border(e){return new Border(e)}static break(e){return new Break(e)}static breakAfter(e){return new BreakAfter(e)}static breakBefore(e){return new BreakBefore(e)}static button(e){return new Button(e)}static calculate(e){return new Calculate(e)}static caption(e){return new Caption(e)}static certificate(e){return new Certificate(e)}static certificates(e){return new Certificates(e)}static checkButton(e){return new CheckButton(e)}static choiceList(e){return new ChoiceList(e)}static color(e){return new Color(e)}static comb(e){return new Comb(e)}static connect(e){return new Connect(e)}static contentArea(e){return new ContentArea(e)}static corner(e){return new Corner(e)}static date(e){return new DateElement(e)}static dateTime(e){return new DateTime(e)}static dateTimeEdit(e){return new DateTimeEdit(e)}static decimal(e){return new Decimal(e)}static defaultUi(e){return new DefaultUi(e)}static desc(e){return new Desc(e)}static digestMethod(e){return new DigestMethod(e)}static digestMethods(e){return new DigestMethods(e)}static draw(e){return new Draw(e)}static edge(e){return new Edge(e)}static encoding(e){return new Encoding(e)}static encodings(e){return new Encodings(e)}static encrypt(e){return new Encrypt(e)}static encryptData(e){return new EncryptData(e)}static encryption(e){return new Encryption(e)}static encryptionMethod(e){return new EncryptionMethod(e)}static encryptionMethods(e){return new EncryptionMethods(e)}static event(e){return new Event(e)}static exData(e){return new ExData(e)}static exObject(e){return new ExObject(e)}static exclGroup(e){return new ExclGroup(e)}static execute(e){return new Execute(e)}static extras(e){return new Extras(e)}static field(e){return new Field(e)}static fill(e){return new Fill(e)}static filter(e){return new Filter(e)}static float(e){return new Float(e)}static font(e){return new Font(e)}static format(e){return new Format(e)}static handler(e){return new Handler(e)}static hyphenation(e){return new Hyphenation(e)}static image(e){return new Image(e)}static imageEdit(e){return new ImageEdit(e)}static integer(e){return new Integer(e)}static issuers(e){return new Issuers(e)}static items(e){return new Items(e)}static keep(e){return new Keep(e)}static keyUsage(e){return new KeyUsage(e)}static line(e){return new Line(e)}static linear(e){return new Linear(e)}static lockDocument(e){return new LockDocument(e)}static manifest(e){return new Manifest(e)}static margin(e){return new Margin(e)}static mdp(e){return new Mdp(e)}static medium(e){return new Medium(e)}static message(e){return new Message(e)}static numericEdit(e){return new NumericEdit(e)}static occur(e){return new Occur(e)}static oid(e){return new Oid(e)}static oids(e){return new Oids(e)}static overflow(e){return new Overflow(e)}static pageArea(e){return new PageArea(e)}static pageSet(e){return new PageSet(e)}static para(e){return new Para(e)}static passwordEdit(e){return new PasswordEdit(e)}static pattern(e){return new Pattern(e)}static picture(e){return new Picture(e)}static proto(e){return new Proto(e)}static radial(e){return new Radial(e)}static reason(e){return new Reason(e)}static reasons(e){return new Reasons(e)}static rectangle(e){return new Rectangle(e)}static ref(e){return new RefElement(e)}static script(e){return new Script(e)}static setProperty(e){return new SetProperty(e)}static signData(e){return new SignData(e)}static signature(e){return new Signature(e)}static signing(e){return new Signing(e)}static solid(e){return new Solid(e)}static speak(e){return new Speak(e)}static stipple(e){return new Stipple(e)}static subform(e){return new Subform(e)}static subformSet(e){return new SubformSet(e)}static subjectDN(e){return new SubjectDN(e)}static subjectDNs(e){return new SubjectDNs(e)}static submit(e){return new Submit(e)}static template(e){return new Template(e)}static text(e){return new Text(e)}static textEdit(e){return new TextEdit(e)}static time(e){return new Time(e)}static timeStamp(e){return new TimeStamp(e)}static toolTip(e){return new ToolTip(e)}static traversal(e){return new Traversal(e)}static traverse(e){return new Traverse(e)}static ui(e){return new Ui(e)}static validate(e){return new Validate(e)}static value(e){return new Value(e)}static variables(e){return new Variables(e)}}t.TemplateNamespace=TemplateNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.addHTML=function addHTML(e,t,r){const i=e[a.$extra],s=i.availableSpace,[o,c,l,h]=r;switch(e.layout){case"position":i.width=Math.max(i.width,o+l);i.height=Math.max(i.height,c+h);i.children.push(t);break;case"lr-tb":case"rl-tb":if(!i.line||1===i.attempt){i.line=createLine(e,[]);i.children.push(i.line);i.numberInLine=0}i.numberInLine+=1;i.line.children.push(t);if(0===i.attempt){i.currentWidth+=l;i.height=Math.max(i.height,i.prevHeight+h)}else{i.currentWidth=l;i.prevHeight=i.height;i.height+=h;i.attempt=0}i.width=Math.max(i.width,i.currentWidth);break;case"rl-row":case"row":{i.children.push(t);i.width+=l;i.height=Math.max(i.height,h);const e=(0,n.measureToString)(i.height);for(const t of i.children)t.attributes.style.height=e;break}case"table":case"tb":i.width=Math.min(s.width,Math.max(i.width,l));i.height+=h;i.children.push(t)}};t.checkDimensions=function checkDimensions(e,t){if(null===e[a.$getTemplateRoot]()[a.$extra].firstUnsplittable)return!0;if(0===e.w||0===e.h)return!0;const r=e[a.$getSubformParent](),n=r[a.$extra]&&r[a.$extra].attempt||0,[,i,s,o]=function getTransformedBBox(e){let t,r,a=""===e.w?NaN:e.w,n=""===e.h?NaN:e.h,[i,s]=[0,0];switch(e.anchorType||""){case"bottomCenter":[i,s]=[a/2,n];break;case"bottomLeft":[i,s]=[0,n];break;case"bottomRight":[i,s]=[a,n];break;case"middleCenter":[i,s]=[a/2,n/2];break;case"middleLeft":[i,s]=[0,n/2];break;case"middleRight":[i,s]=[a,n/2];break;case"topCenter":[i,s]=[a/2,0];break;case"topRight":[i,s]=[a,0]}switch(e.rotate||0){case 0:[t,r]=[-i,-s];break;case 90:[t,r]=[-s,i];[a,n]=[n,-a];break;case 180:[t,r]=[i,s];[a,n]=[-a,-n];break;case 270:[t,r]=[s,-i];[a,n]=[-n,a]}return[e.x+t+Math.min(0,a),e.y+r+Math.min(0,n),Math.abs(a),Math.abs(n)]}(e);switch(r.layout){case"lr-tb":case"rl-tb":return 0===n?e[a.$getTemplateRoot]()[a.$extra].noLayoutFailure?""!==e.w?Math.round(s-t.width)<=2:t.width>2:!(""!==e.h&&Math.round(o-t.height)>2)&&(""!==e.w?Math.round(s-t.width)<=2||0===r[a.$extra].numberInLine&&t.height>2:t.width>2):!!e[a.$getTemplateRoot]()[a.$extra].noLayoutFailure||!(""!==e.h&&Math.round(o-t.height)>2)&&((""===e.w||Math.round(s-t.width)<=2||!r[a.$isThereMoreWidth]())&&t.height>2);case"table":case"tb":return!!e[a.$getTemplateRoot]()[a.$extra].noLayoutFailure||(""===e.h||e[a.$isSplittable]()?(""===e.w||Math.round(s-t.width)<=2||!r[a.$isThereMoreWidth]())&&t.height>2:Math.round(o-t.height)<=2);case"position":if(e[a.$getTemplateRoot]()[a.$extra].noLayoutFailure)return!0;if(""===e.h||Math.round(o+i-t.height)<=2)return!0;const c=e[a.$getTemplateRoot]()[a.$extra].currentContentArea;return o+i>c.h;case"rl-row":case"row":return!!e[a.$getTemplateRoot]()[a.$extra].noLayoutFailure||(""===e.h||Math.round(o-t.height)<=2);default:return!0}};t.flushHTML=function flushHTML(e){if(!e[a.$extra])return null;const t={name:"div",attributes:e[a.$extra].attributes,children:e[a.$extra].children};if(e[a.$extra].failingNode){const r=e[a.$extra].failingNode[a.$flushHTML]();r&&(e.layout.endsWith("-tb")?t.children.push(createLine(e,[r])):t.children.push(r))}if(0===t.children.length)return null;return t};t.getAvailableSpace=function getAvailableSpace(e){const t=e[a.$extra].availableSpace,r=e.margin?e.margin.topInset+e.margin.bottomInset:0,n=e.margin?e.margin.leftInset+e.margin.rightInset:0;switch(e.layout){case"lr-tb":case"rl-tb":return 0===e[a.$extra].attempt?{width:t.width-n-e[a.$extra].currentWidth,height:t.height-r-e[a.$extra].prevHeight}:{width:t.width-n,height:t.height-r-e[a.$extra].height};case"rl-row":case"row":return{width:e[a.$extra].columnWidths.slice(e[a.$extra].currentColumn).reduce(((e,t)=>e+t)),height:t.height-n};case"table":case"tb":return{width:t.width-n,height:t.height-r-e[a.$extra].height};default:return t}};var a=r(205),n=r(212);function createLine(e,t){return{name:"div",attributes:{class:["lr-tb"===e.layout?"xfaLr":"xfaRl"]},children:t}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.computeBbox=function computeBbox(e,t,r){let n;if(""!==e.w&&""!==e.h)n=[e.x,e.y,e.w,e.h];else{if(!r)return null;let i=e.w;if(""===i){if(0===e.maxW){const t=e[a.$getSubformParent]();i="position"===t.layout&&""!==t.w?0:e.minW}else i=Math.min(e.maxW,r.width);t.attributes.style.width=measureToString(i)}let s=e.h;if(""===s){if(0===e.maxH){const t=e[a.$getSubformParent]();s="position"===t.layout&&""!==t.h?0:e.minH}else s=Math.min(e.maxH,r.height);t.attributes.style.height=measureToString(s)}n=[e.x,e.y,i,s]}return n};t.createWrapper=function createWrapper(e,t){const{attributes:r}=t,{style:n}=r,i={name:"div",attributes:{class:["xfaWrapper"],style:Object.create(null)},children:[]};r.class.push("xfaWrapped");if(e.border){const{widths:r,insets:s}=e.border[a.$extra];let o,c,l=s[0],h=s[3];const u=s[0]+s[2],d=s[1]+s[3];switch(e.border.hand){case"even":l-=r[0]/2;h-=r[3]/2;o=`calc(100% + ${(r[1]+r[3])/2-d}px)`;c=`calc(100% + ${(r[0]+r[2])/2-u}px)`;break;case"left":l-=r[0];h-=r[3];o=`calc(100% + ${r[1]+r[3]-d}px)`;c=`calc(100% + ${r[0]+r[2]-u}px)`;break;case"right":o=d?`calc(100% - ${d}px)`:"100%";c=u?`calc(100% - ${u}px)`:"100%"}const f=["xfaBorder"];isPrintOnly(e.border)&&f.push("xfaPrintOnly");const g={name:"div",attributes:{class:f,style:{top:`${l}px`,left:`${h}px`,width:o,height:c}},children:[]};for(const e of["border","borderWidth","borderColor","borderRadius","borderStyle"])if(void 0!==n[e]){g.attributes.style[e]=n[e];delete n[e]}i.children.push(g,t)}else i.children.push(t);for(const e of["background","backgroundClip","top","left","width","height","minWidth","minHeight","maxWidth","maxHeight","transform","transformOrigin","visibility"])if(void 0!==n[e]){i.attributes.style[e]=n[e];delete n[e]}"absolute"===n.position?i.attributes.style.position="absolute":i.attributes.style.position="relative";delete n.position;if(n.alignSelf){i.attributes.style.alignSelf=n.alignSelf;delete n.alignSelf}return i};t.fixDimensions=function fixDimensions(e){const t=e[a.$getSubformParent]();if(t.layout&&t.layout.includes("row")){const r=t[a.$extra],n=e.colSpan;let i;i=-1===n?r.columnWidths.slice(r.currentColumn).reduce(((e,t)=>e+t),0):r.columnWidths.slice(r.currentColumn,r.currentColumn+n).reduce(((e,t)=>e+t),0);isNaN(i)||(e.w=i)}t.layout&&"position"!==t.layout&&(e.x=e.y=0);"table"===e.layout&&""===e.w&&Array.isArray(e.columnWidths)&&(e.w=e.columnWidths.reduce(((e,t)=>e+t),0))};t.fixTextIndent=function fixTextIndent(e){const t=(0,i.getMeasurement)(e.textIndent,"0px");if(t>=0)return;const r="padding"+("left"==("right"===e.textAlign?"right":"left")?"Left":"Right"),a=(0,i.getMeasurement)(e[r],"0px");e[r]=a-t+"px"};t.fixURL=function fixURL(e){const t=(0,n.createValidAbsoluteUrl)(e,null,{addDefaultProtocol:!0,tryConvertEncoding:!0});return t?t.href:null};t.isPrintOnly=isPrintOnly;t.layoutClass=function layoutClass(e){switch(e.layout){case"position":default:return"xfaPosition";case"lr-tb":return"xfaLrTb";case"rl-row":return"xfaRlRow";case"rl-tb":return"xfaRlTb";case"row":return"xfaRow";case"table":return"xfaTable";case"tb":return"xfaTb"}};t.layoutNode=function layoutNode(e,t){let r=null,n=null,i=!1;if((!e.w||!e.h)&&e.value){let s=0,o=0;if(e.margin){s=e.margin.leftInset+e.margin.rightInset;o=e.margin.topInset+e.margin.bottomInset}let c=null,l=null;if(e.para){l=Object.create(null);c=""===e.para.lineHeight?null:e.para.lineHeight;l.top=""===e.para.spaceAbove?0:e.para.spaceAbove;l.bottom=""===e.para.spaceBelow?0:e.para.spaceBelow;l.left=""===e.para.marginLeft?0:e.para.marginLeft;l.right=""===e.para.marginRight?0:e.para.marginRight}let h=e.font;if(!h){const t=e[a.$getTemplateRoot]();let r=e[a.$getParent]();for(;r&&r!==t;){if(r.font){h=r.font;break}r=r[a.$getParent]()}}const u=(e.w||t.width)-s,d=e[a.$globalData].fontFinder;if(e.value.exData&&e.value.exData[a.$content]&&"text/html"===e.value.exData.contentType){const t=layoutText(e.value.exData[a.$content],h,l,c,d,u);n=t.width;r=t.height;i=t.isBroken}else{const t=e.value[a.$text]();if(t){const e=layoutText(t,h,l,c,d,u);n=e.width;r=e.height;i=e.isBroken}}null===n||e.w||(n+=s);null===r||e.h||(r+=o)}return{w:n,h:r,isBroken:i}};t.measureToString=measureToString;t.setAccess=function setAccess(e,t){switch(e.access){case"nonInteractive":t.push("xfaNonInteractive");break;case"readOnly":t.push("xfaReadOnly");break;case"protected":t.push("xfaDisabled")}};t.setFontFamily=function setFontFamily(e,t,r,a){if(!r){delete a.fontFamily;return}const n=(0,i.stripQuotes)(e.typeface);a.fontFamily=`"${n}"`;const o=r.find(n);if(o){const{fontFamily:r}=o.regular.cssFontInfo;r!==n&&(a.fontFamily=`"${r}"`);const i=getCurrentPara(t);if(i&&""!==i.lineHeight)return;if(a.lineHeight)return;const c=(0,s.selectFont)(e,o);c&&(a.lineHeight=Math.max(1.2,c.lineHeight))}};t.setMinMaxDimensions=function setMinMaxDimensions(e,t){if("position"===e[a.$getSubformParent]().layout){e.minW>0&&(t.minWidth=measureToString(e.minW));e.maxW>0&&(t.maxWidth=measureToString(e.maxW));e.minH>0&&(t.minHeight=measureToString(e.minH));e.maxH>0&&(t.maxHeight=measureToString(e.maxH))}};t.setPara=function setPara(e,t,r){if(r.attributes.class&&r.attributes.class.includes("xfaRich")){if(t){""===e.h&&(t.height="auto");""===e.w&&(t.width="auto")}const n=getCurrentPara(e);if(n){const e=r.attributes.style;e.display="flex";e.flexDirection="column";switch(n.vAlign){case"top":e.justifyContent="start";break;case"bottom":e.justifyContent="end";break;case"middle":e.justifyContent="center"}const t=n[a.$toStyle]();for(const[r,a]of Object.entries(t))r in e||(e[r]=a)}}};t.toStyle=function toStyle(e){const t=Object.create(null);for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];for(const r of i){const i=e[r];if(null!==i)if(c.hasOwnProperty(r))c[r](e,t);else if(i instanceof a.XFAObject){const e=i[a.$toStyle]();e?Object.assign(t,e):(0,n.warn)(`(DEBUG) - XFA - style for ${r} not implemented yet`)}}return t};var a=r(205),n=r(2),i=r(206),s=r(213),o=r(214);function measureToString(e){return"string"==typeof e?"0px":Number.isInteger(e)?`${e}px`:`${e.toFixed(2)}px`}const c={anchorType(e,t){const r=e[a.$getSubformParent]();if(r&&(!r.layout||"position"===r.layout)){"transform"in t||(t.transform="");switch(e.anchorType){case"bottomCenter":t.transform+="translate(-50%, -100%)";break;case"bottomLeft":t.transform+="translate(0,-100%)";break;case"bottomRight":t.transform+="translate(-100%,-100%)";break;case"middleCenter":t.transform+="translate(-50%,-50%)";break;case"middleLeft":t.transform+="translate(0,-50%)";break;case"middleRight":t.transform+="translate(-100%,-50%)";break;case"topCenter":t.transform+="translate(-50%,0)";break;case"topRight":t.transform+="translate(-100%,0)"}}},dimensions(e,t){const r=e[a.$getSubformParent]();let n=e.w;const i=e.h;if(r.layout&&r.layout.includes("row")){const t=r[a.$extra],i=e.colSpan;let s;if(-1===i){s=t.columnWidths.slice(t.currentColumn).reduce(((e,t)=>e+t),0);t.currentColumn=0}else{s=t.columnWidths.slice(t.currentColumn,t.currentColumn+i).reduce(((e,t)=>e+t),0);t.currentColumn=(t.currentColumn+e.colSpan)%t.columnWidths.length}isNaN(s)||(n=e.w=s)}t.width=""!==n?measureToString(n):"auto";t.height=""!==i?measureToString(i):"auto"},position(e,t){const r=e[a.$getSubformParent]();if(!r||!r.layout||"position"===r.layout){t.position="absolute";t.left=measureToString(e.x);t.top=measureToString(e.y)}},rotate(e,t){if(e.rotate){"transform"in t||(t.transform="");t.transform+=`rotate(-${e.rotate}deg)`;t.transformOrigin="top left"}},presence(e,t){switch(e.presence){case"invisible":t.visibility="hidden";break;case"hidden":case"inactive":t.display="none"}},hAlign(e,t){if("para"===e[a.$nodeName])switch(e.hAlign){case"justifyAll":t.textAlign="justify-all";break;case"radix":t.textAlign="left";break;default:t.textAlign=e.hAlign}else switch(e.hAlign){case"left":t.alignSelf="start";break;case"center":t.alignSelf="center";break;case"right":t.alignSelf="end"}},margin(e,t){e.margin&&(t.margin=e.margin[a.$toStyle]().margin)}};function layoutText(e,t,r,n,i,s){const c=new o.TextMeasure(t,r,n,i);"string"==typeof e?c.addString(e):e[a.$pushGlyphs](c);return c.compute(s)}function isPrintOnly(e){return e.relevant.length>0&&!e.relevant[0].excluded&&"print"===e.relevant[0].viewname}function getCurrentPara(e){const t=e[a.$getTemplateRoot]()[a.$extra].paraStack;return t.length?t.at(-1):null}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.FontFinder=void 0;t.getMetrics=function getMetrics(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=null;if(e){const t=(0,n.stripQuotes)(e.typeface),i=e[a.$globalData].fontFinder.find(t);r=selectFont(e,i)}if(!r)return{lineHeight:12,lineGap:2,lineNoGap:10};const i=e.size||10,s=r.lineHeight?Math.max(t?0:1.2,r.lineHeight):1.2,o=void 0===r.lineGap?.2:r.lineGap;return{lineHeight:s*i,lineGap:o*i,lineNoGap:Math.max(1,s-o)*i}};t.selectFont=selectFont;var a=r(205),n=r(206),i=r(2);t.FontFinder=class FontFinder{constructor(e){this.fonts=new Map;this.cache=new Map;this.warned=new Set;this.defaultFont=null;this.add(e)}add(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;for(const t of e)this.addPdfFont(t);for(const e of this.fonts.values())e.regular||(e.regular=e.italic||e.bold||e.bolditalic);if(!t||0===t.size)return;const r=this.fonts.get("PdfJS-Fallback-PdfJS-XFA");for(const e of t)this.fonts.set(e,r)}addPdfFont(e){const t=e.cssFontInfo,r=t.fontFamily;let a=this.fonts.get(r);if(!a){a=Object.create(null);this.fonts.set(r,a);this.defaultFont||(this.defaultFont=a)}let n="";const i=parseFloat(t.fontWeight);0!==parseFloat(t.italicAngle)?n=i>=700?"bolditalic":"italic":i>=700&&(n="bold");if(!n){(e.name.includes("Bold")||e.psName&&e.psName.includes("Bold"))&&(n="bold");(e.name.includes("Italic")||e.name.endsWith("It")||e.psName&&(e.psName.includes("Italic")||e.psName.endsWith("It")))&&(n+="italic")}n||(n="regular");a[n]=e}getDefault(){return this.defaultFont}find(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.fonts.get(e)||this.cache.get(e);if(r)return r;const a=/,|-|_| |bolditalic|bold|italic|regular|it/gi;let n=e.replace(a,"");r=this.fonts.get(n);if(r){this.cache.set(e,r);return r}n=n.toLowerCase();const s=[];for(const[e,t]of this.fonts.entries())e.replace(a,"").toLowerCase().startsWith(n)&&s.push(t);if(0===s.length)for(const[,e]of this.fonts.entries())e.regular.name&&e.regular.name.replace(a,"").toLowerCase().startsWith(n)&&s.push(e);if(0===s.length){n=n.replace(/psmt|mt/gi,"");for(const[e,t]of this.fonts.entries())e.replace(a,"").toLowerCase().startsWith(n)&&s.push(t)}if(0===s.length)for(const e of this.fonts.values())e.regular.name&&e.regular.name.replace(a,"").toLowerCase().startsWith(n)&&s.push(e);if(s.length>=1){1!==s.length&&t&&(0,i.warn)(`XFA - Too many choices to guess the correct font: ${e}`);this.cache.set(e,s[0]);return s[0]}if(t&&!this.warned.has(e)){this.warned.add(e);(0,i.warn)(`XFA - Cannot find the font: ${e}`)}return null}};function selectFont(e,t){return"italic"===e.posture?"bold"===e.weight?t.bolditalic:t.italic:"bold"===e.weight?t.bold:t.regular}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TextMeasure=void 0;var a=r(213);class FontInfo{constructor(e,t,r,n){this.lineHeight=r;this.paraMargin=t||{top:0,bottom:0,left:0,right:0};if(!e){[this.pdfFont,this.xfaFont]=this.defaultFont(n);return}this.xfaFont={typeface:e.typeface,posture:e.posture,weight:e.weight,size:e.size,letterSpacing:e.letterSpacing};const i=n.find(e.typeface);if(i){this.pdfFont=(0,a.selectFont)(e,i);this.pdfFont||([this.pdfFont,this.xfaFont]=this.defaultFont(n))}else[this.pdfFont,this.xfaFont]=this.defaultFont(n)}defaultFont(e){const t=e.find("Helvetica",!1)||e.find("Myriad Pro",!1)||e.find("Arial",!1)||e.getDefault();if(t&&t.regular){const e=t.regular;return[e,{typeface:e.cssFontInfo.fontFamily,posture:"normal",weight:"normal",size:10,letterSpacing:0}]}return[null,{typeface:"Courier",posture:"normal",weight:"normal",size:10,letterSpacing:0}]}}class FontSelector{constructor(e,t,r,a){this.fontFinder=a;this.stack=[new FontInfo(e,t,r,a)]}pushData(e,t,r){const a=this.stack.at(-1);for(const t of["typeface","posture","weight","size","letterSpacing"])e[t]||(e[t]=a.xfaFont[t]);for(const e of["top","bottom","left","right"])isNaN(t[e])&&(t[e]=a.paraMargin[e]);const n=new FontInfo(e,t,r||a.lineHeight,this.fontFinder);n.pdfFont||(n.pdfFont=a.pdfFont);this.stack.push(n)}popFont(){this.stack.pop()}topFont(){return this.stack.at(-1)}}t.TextMeasure=class TextMeasure{constructor(e,t,r,a){this.glyphs=[];this.fontSelector=new FontSelector(e,t,r,a);this.extraHeight=0}pushData(e,t,r){this.fontSelector.pushData(e,t,r)}popFont(e){return this.fontSelector.popFont()}addPara(){const e=this.fontSelector.topFont();this.extraHeight+=e.paraMargin.top+e.paraMargin.bottom}addString(e){if(!e)return;const t=this.fontSelector.topFont(),r=t.xfaFont.size;if(t.pdfFont){const a=t.xfaFont.letterSpacing,n=t.pdfFont,i=n.lineHeight||1.2,s=t.lineHeight||Math.max(1.2,i)*r,o=i-(void 0===n.lineGap?.2:n.lineGap),c=Math.max(1,o)*r,l=r/1e3,h=n.defaultWidth||n.charsToGlyphs(" ")[0].width;for(const t of e.split(/[\u2029\n]/)){const e=n.encodeString(t).join(""),r=n.charsToGlyphs(e);for(const e of r){const t=e.width||h;this.glyphs.push([t*l+a,s,c,e.unicode,!1])}this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}else{for(const t of e.split(/[\u2029\n]/)){for(const e of t.split(""))this.glyphs.push([r,1.2*r,r,e,!1]);this.glyphs.push([0,0,0,"\n",!0])}this.glyphs.pop()}}compute(e){let t=-1,r=0,a=0,n=0,i=0,s=0,o=!1,c=!0;for(let l=0,h=this.glyphs.length;l<h;l++){const[h,u,d,f,g]=this.glyphs[l],p=" "===f,m=c?d:u;if(g){a=Math.max(a,i);i=0;n+=s;s=m;t=-1;r=0;c=!1}else if(p)if(i+h>e){a=Math.max(a,i);i=0;n+=s;s=m;t=-1;r=0;o=!0;c=!1}else{s=Math.max(m,s);r=i;i+=h;t=l}else if(i+h>e){n+=s;s=m;if(-1!==t){l=t;a=Math.max(a,r);i=0;t=-1;r=0}else{a=Math.max(a,i);i=h}o=!0;c=!1}else{i+=h;s=Math.max(m,s)}}a=Math.max(a,i);n+=s+this.extraHeight;return{width:1.02*a,height:n,isBroken:o}}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DataHandler=void 0;var a=r(205);t.DataHandler=class DataHandler{constructor(e,t){this.data=t;this.dataset=e.datasets||null}serialize(e){const t=[[-1,this.data[a.$getChildren]()]];for(;t.length>0;){const r=t.at(-1),[n,i]=r;if(n+1===i.length){t.pop();continue}const s=i[++r[0]],o=e.get(s[a.$uid]);if(o)s[a.$setValue](o);else{const t=s[a.$getAttributes]();for(const r of t.values()){const t=e.get(r[a.$uid]);if(t){r[a.$setValue](t);break}}}const c=s[a.$getChildren]();c.length>0&&t.push([-1,c])}const r=['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];if(this.dataset)for(const e of this.dataset[a.$getChildren]())"data"!==e[a.$nodeName]&&e[a.$toString](r);this.data[a.$toString](r);r.push("</xfa:datasets>");return r.join("")}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XFAParser=void 0;var a=r(205),n=r(194),i=r(217),s=r(2);class XFAParser extends n.XMLParserBase{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super();this._builder=new i.Builder(e);this._stack=[];this._globalData={usedTypefaces:new Set};this._ids=new Map;this._current=this._builder.buildRoot(this._ids);this._errorCode=n.XMLParserErrorCode.NoError;this._whiteRegex=/^\s+$/;this._nbsps=/\xa0+/g;this._richText=t}parse(e){this.parseXml(e);if(this._errorCode===n.XMLParserErrorCode.NoError){this._current[a.$finalize]();return this._current.element}}onText(e){e=e.replace(this._nbsps,(e=>e.slice(1)+" "));this._richText||this._current[a.$acceptWhitespace]()?this._current[a.$onText](e,this._richText):this._whiteRegex.test(e)||this._current[a.$onText](e.trim())}onCdata(e){this._current[a.$onText](e)}_mkAttributes(e,t){let r=null,n=null;const i=Object.create({});for(const{name:o,value:c}of e)if("xmlns"===o)r?(0,s.warn)(`XFA - multiple namespace definition in <${t}>`):r=c;else if(o.startsWith("xmlns:")){const e=o.substring("xmlns:".length);n||(n=[]);n.push({prefix:e,value:c})}else{const e=o.indexOf(":");if(-1===e)i[o]=c;else{let t=i[a.$nsAttributes];t||(t=i[a.$nsAttributes]=Object.create(null));const[r,n]=[o.slice(0,e),o.slice(e+1)];let s=t[r];s||(s=t[r]=Object.create(null));s[n]=c}}return[r,n,i]}_getNameAndPrefix(e,t){const r=e.indexOf(":");return-1===r?[e,null]:[e.substring(r+1),t?"":e.substring(0,r)]}onBeginElement(e,t,r){const[n,i,s]=this._mkAttributes(t,e),[o,c]=this._getNameAndPrefix(e,this._builder.isNsAgnostic()),l=this._builder.build({nsPrefix:c,name:o,attributes:s,namespace:n,prefixes:i});l[a.$globalData]=this._globalData;if(r){l[a.$finalize]();this._current[a.$onChild](l)&&l[a.$setId](this._ids);l[a.$clean](this._builder)}else{this._stack.push(this._current);this._current=l}}onEndElement(e){const t=this._current;if(t[a.$isCDATAXml]()&&"string"==typeof t[a.$content]){const e=new XFAParser;e._globalData=this._globalData;const r=e.parse(t[a.$content]);t[a.$content]=null;t[a.$onChild](r)}t[a.$finalize]();this._current=this._stack.pop();this._current[a.$onChild](t)&&t[a.$setId](this._ids);t[a.$clean](this._builder)}onError(e){this._errorCode=e}}t.XFAParser=XFAParser},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Builder=void 0;var a=r(207),n=r(205),i=r(218),s=r(210),o=r(227),c=r(2);class Root extends n.XFAObject{constructor(e){super(-1,"root",Object.create(null));this.element=null;this[n.$ids]=e}[n.$onChild](e){this.element=e;return!0}[n.$finalize](){super[n.$finalize]();if(this.element.template instanceof s.Template){this[n.$ids].set(n.$root,this.element);this.element.template[n.$resolvePrototypes](this[n.$ids]);this.element.template[n.$ids]=this[n.$ids]}}}class Empty extends n.XFAObject{constructor(){super(-1,"",Object.create(null))}[n.$onChild](e){return!1}}t.Builder=class Builder{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._namespaceStack=[];this._nsAgnosticLevel=0;this._namespacePrefixes=new Map;this._namespaces=new Map;this._nextNsId=Math.max(...Object.values(a.NamespaceIds).map((e=>{let{id:t}=e;return t})));this._currentNamespace=e||new o.UnknownNamespace(++this._nextNsId)}buildRoot(e){return new Root(e)}build(e){let{nsPrefix:t,name:r,attributes:s,namespace:o,prefixes:c}=e;const l=null!==o;if(l){this._namespaceStack.push(this._currentNamespace);this._currentNamespace=this._searchNamespace(o)}c&&this._addNamespacePrefix(c);if(s.hasOwnProperty(n.$nsAttributes)){const e=i.NamespaceSetUp.datasets,t=s[n.$nsAttributes];let r=null;for(const[a,n]of Object.entries(t)){if(this._getNamespaceToUse(a)===e){r={xfa:n};break}}r?s[n.$nsAttributes]=r:delete s[n.$nsAttributes]}const h=this._getNamespaceToUse(t),u=h&&h[a.$buildXFAObject](r,s)||new Empty;u[n.$isNsAgnostic]()&&this._nsAgnosticLevel++;(l||c||u[n.$isNsAgnostic]())&&(u[n.$cleanup]={hasNamespace:l,prefixes:c,nsAgnostic:u[n.$isNsAgnostic]()});return u}isNsAgnostic(){return this._nsAgnosticLevel>0}_searchNamespace(e){let t=this._namespaces.get(e);if(t)return t;for(const[r,{check:n}]of Object.entries(a.NamespaceIds))if(n(e)){t=i.NamespaceSetUp[r];if(t){this._namespaces.set(e,t);return t}break}t=new o.UnknownNamespace(++this._nextNsId);this._namespaces.set(e,t);return t}_addNamespacePrefix(e){for(const{prefix:t,value:r}of e){const e=this._searchNamespace(r);let a=this._namespacePrefixes.get(t);if(!a){a=[];this._namespacePrefixes.set(t,a)}a.push(e)}}_getNamespaceToUse(e){if(!e)return this._currentNamespace;const t=this._namespacePrefixes.get(e);if(t&&t.length>0)return t.at(-1);(0,c.warn)(`Unknown namespace prefix: ${e}.`);return null}clean(e){const{hasNamespace:t,prefixes:r,nsAgnostic:a}=e;t&&(this._currentNamespace=this._namespaceStack.pop());r&&r.forEach((e=>{let{prefix:t}=e;this._namespacePrefixes.get(t).pop()}));a&&this._nsAgnosticLevel--}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.NamespaceSetUp=void 0;var a=r(219),n=r(220),i=r(221),s=r(222),o=r(223),c=r(224),l=r(210),h=r(225),u=r(226);const d={config:a.ConfigNamespace,connection:n.ConnectionSetNamespace,datasets:i.DatasetsNamespace,localeSet:s.LocaleSetNamespace,signature:o.SignatureNamespace,stylesheet:c.StylesheetNamespace,template:l.TemplateNamespace,xdp:h.XdpNamespace,xhtml:u.XhtmlNamespace};t.NamespaceSetUp=d},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ConfigNamespace=void 0;var a=r(207),n=r(205),i=r(206),s=r(2);const o=a.NamespaceIds.config.id;class Acrobat extends n.XFAObject{constructor(e){super(o,"acrobat",!0);this.acrobat7=null;this.autoSave=null;this.common=null;this.validate=null;this.validateApprovalSignatures=null;this.submitUrl=new n.XFAObjectArray}}class Acrobat7 extends n.XFAObject{constructor(e){super(o,"acrobat7",!0);this.dynamicRender=null}}class ADBE_JSConsole extends n.OptionObject{constructor(e){super(o,"ADBE_JSConsole",["delegate","Enable","Disable"])}}class ADBE_JSDebugger extends n.OptionObject{constructor(e){super(o,"ADBE_JSDebugger",["delegate","Enable","Disable"])}}class AddSilentPrint extends n.Option01{constructor(e){super(o,"addSilentPrint")}}class AddViewerPreferences extends n.Option01{constructor(e){super(o,"addViewerPreferences")}}class AdjustData extends n.Option10{constructor(e){super(o,"adjustData")}}class AdobeExtensionLevel extends n.IntegerObject{constructor(e){super(o,"adobeExtensionLevel",0,(e=>e>=1&&e<=8))}}class Agent extends n.XFAObject{constructor(e){super(o,"agent",!0);this.name=e.name?e.name.trim():"";this.common=new n.XFAObjectArray}}class AlwaysEmbed extends n.ContentObject{constructor(e){super(o,"alwaysEmbed")}}class Amd extends n.StringObject{constructor(e){super(o,"amd")}}class Area extends n.XFAObject{constructor(e){super(o,"area");this.level=(0,i.getInteger)({data:e.level,defaultValue:0,validate:e=>e>=1&&e<=3});this.name=(0,i.getStringOption)(e.name,["","barcode","coreinit","deviceDriver","font","general","layout","merge","script","signature","sourceSet","templateCache"])}}class Attributes extends n.OptionObject{constructor(e){super(o,"attributes",["preserve","delegate","ignore"])}}class AutoSave extends n.OptionObject{constructor(e){super(o,"autoSave",["disabled","enabled"])}}class Base extends n.StringObject{constructor(e){super(o,"base")}}class BatchOutput extends n.XFAObject{constructor(e){super(o,"batchOutput");this.format=(0,i.getStringOption)(e.format,["none","concat","zip","zipCompress"])}}class BehaviorOverride extends n.ContentObject{constructor(e){super(o,"behaviorOverride")}[n.$finalize](){this[n.$content]=new Map(this[n.$content].trim().split(/\s+/).filter((e=>e.includes(":"))).map((e=>e.split(":",2))))}}class Cache extends n.XFAObject{constructor(e){super(o,"cache",!0);this.templateCache=null}}class Change extends n.Option01{constructor(e){super(o,"change")}}class Common extends n.XFAObject{constructor(e){super(o,"common",!0);this.data=null;this.locale=null;this.localeSet=null;this.messaging=null;this.suppressBanner=null;this.template=null;this.validationMessaging=null;this.versionControl=null;this.log=new n.XFAObjectArray}}class Compress extends n.XFAObject{constructor(e){super(o,"compress");this.scope=(0,i.getStringOption)(e.scope,["imageOnly","document"])}}class CompressLogicalStructure extends n.Option01{constructor(e){super(o,"compressLogicalStructure")}}class CompressObjectStream extends n.Option10{constructor(e){super(o,"compressObjectStream")}}class Compression extends n.XFAObject{constructor(e){super(o,"compression",!0);this.compressLogicalStructure=null;this.compressObjectStream=null;this.level=null;this.type=null}}class Config extends n.XFAObject{constructor(e){super(o,"config",!0);this.acrobat=null;this.present=null;this.trace=null;this.agent=new n.XFAObjectArray}}class Conformance extends n.OptionObject{constructor(e){super(o,"conformance",["A","B"])}}class ContentCopy extends n.Option01{constructor(e){super(o,"contentCopy")}}class Copies extends n.IntegerObject{constructor(e){super(o,"copies",1,(e=>e>=1))}}class Creator extends n.StringObject{constructor(e){super(o,"creator")}}class CurrentPage extends n.IntegerObject{constructor(e){super(o,"currentPage",0,(e=>e>=0))}}class Data extends n.XFAObject{constructor(e){super(o,"data",!0);this.adjustData=null;this.attributes=null;this.incrementalLoad=null;this.outputXSL=null;this.range=null;this.record=null;this.startNode=null;this.uri=null;this.window=null;this.xsl=null;this.excludeNS=new n.XFAObjectArray;this.transform=new n.XFAObjectArray}}class Debug extends n.XFAObject{constructor(e){super(o,"debug",!0);this.uri=null}}class DefaultTypeface extends n.ContentObject{constructor(e){super(o,"defaultTypeface");this.writingScript=(0,i.getStringOption)(e.writingScript,["*","Arabic","Cyrillic","EastEuropeanRoman","Greek","Hebrew","Japanese","Korean","Roman","SimplifiedChinese","Thai","TraditionalChinese","Vietnamese"])}}class Destination extends n.OptionObject{constructor(e){super(o,"destination",["pdf","pcl","ps","webClient","zpl"])}}class DocumentAssembly extends n.Option01{constructor(e){super(o,"documentAssembly")}}class Driver extends n.XFAObject{constructor(e){super(o,"driver",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class DuplexOption extends n.OptionObject{constructor(e){super(o,"duplexOption",["simplex","duplexFlipLongEdge","duplexFlipShortEdge"])}}class DynamicRender extends n.OptionObject{constructor(e){super(o,"dynamicRender",["forbidden","required"])}}class Embed extends n.Option01{constructor(e){super(o,"embed")}}class Encrypt extends n.Option01{constructor(e){super(o,"encrypt")}}class Encryption extends n.XFAObject{constructor(e){super(o,"encryption",!0);this.encrypt=null;this.encryptionLevel=null;this.permissions=null}}class EncryptionLevel extends n.OptionObject{constructor(e){super(o,"encryptionLevel",["40bit","128bit"])}}class Enforce extends n.StringObject{constructor(e){super(o,"enforce")}}class Equate extends n.XFAObject{constructor(e){super(o,"equate");this.force=(0,i.getInteger)({data:e.force,defaultValue:1,validate:e=>0===e});this.from=e.from||"";this.to=e.to||""}}class EquateRange extends n.XFAObject{constructor(e){super(o,"equateRange");this.from=e.from||"";this.to=e.to||"";this._unicodeRange=e.unicodeRange||""}get unicodeRange(){const e=[],t=/U\+([0-9a-fA-F]+)/,r=this._unicodeRange;for(let a of r.split(",").map((e=>e.trim())).filter((e=>!!e))){a=a.split("-",2).map((e=>{const r=e.match(t);return r?parseInt(r[1],16):0}));1===a.length&&a.push(a[0]);e.push(a)}return(0,s.shadow)(this,"unicodeRange",e)}}class Exclude extends n.ContentObject{constructor(e){super(o,"exclude")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>e&&["calculate","close","enter","exit","initialize","ready","validate"].includes(e)))}}class ExcludeNS extends n.StringObject{constructor(e){super(o,"excludeNS")}}class FlipLabel extends n.OptionObject{constructor(e){super(o,"flipLabel",["usePrinterSetting","on","off"])}}class FontInfo extends n.XFAObject{constructor(e){super(o,"fontInfo",!0);this.embed=null;this.map=null;this.subsetBelow=null;this.alwaysEmbed=new n.XFAObjectArray;this.defaultTypeface=new n.XFAObjectArray;this.neverEmbed=new n.XFAObjectArray}}class FormFieldFilling extends n.Option01{constructor(e){super(o,"formFieldFilling")}}class GroupParent extends n.StringObject{constructor(e){super(o,"groupParent")}}class IfEmpty extends n.OptionObject{constructor(e){super(o,"ifEmpty",["dataValue","dataGroup","ignore","remove"])}}class IncludeXDPContent extends n.StringObject{constructor(e){super(o,"includeXDPContent")}}class IncrementalLoad extends n.OptionObject{constructor(e){super(o,"incrementalLoad",["none","forwardOnly"])}}class IncrementalMerge extends n.Option01{constructor(e){super(o,"incrementalMerge")}}class Interactive extends n.Option01{constructor(e){super(o,"interactive")}}class Jog extends n.OptionObject{constructor(e){super(o,"jog",["usePrinterSetting","none","pageSet"])}}class LabelPrinter extends n.XFAObject{constructor(e){super(o,"labelPrinter",!0);this.name=(0,i.getStringOption)(e.name,["zpl","dpl","ipl","tcpl"]);this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class Layout extends n.OptionObject{constructor(e){super(o,"layout",["paginate","panel"])}}class Level extends n.IntegerObject{constructor(e){super(o,"level",0,(e=>e>0))}}class Linearized extends n.Option01{constructor(e){super(o,"linearized")}}class Locale extends n.StringObject{constructor(e){super(o,"locale")}}class LocaleSet extends n.StringObject{constructor(e){super(o,"localeSet")}}class Log extends n.XFAObject{constructor(e){super(o,"log",!0);this.mode=null;this.threshold=null;this.to=null;this.uri=null}}class MapElement extends n.XFAObject{constructor(e){super(o,"map",!0);this.equate=new n.XFAObjectArray;this.equateRange=new n.XFAObjectArray}}class MediumInfo extends n.XFAObject{constructor(e){super(o,"mediumInfo",!0);this.map=null}}class Message extends n.XFAObject{constructor(e){super(o,"message",!0);this.msgId=null;this.severity=null}}class Messaging extends n.XFAObject{constructor(e){super(o,"messaging",!0);this.message=new n.XFAObjectArray}}class Mode extends n.OptionObject{constructor(e){super(o,"mode",["append","overwrite"])}}class ModifyAnnots extends n.Option01{constructor(e){super(o,"modifyAnnots")}}class MsgId extends n.IntegerObject{constructor(e){super(o,"msgId",1,(e=>e>=1))}}class NameAttr extends n.StringObject{constructor(e){super(o,"nameAttr")}}class NeverEmbed extends n.ContentObject{constructor(e){super(o,"neverEmbed")}}class NumberOfCopies extends n.IntegerObject{constructor(e){super(o,"numberOfCopies",null,(e=>e>=2&&e<=5))}}class OpenAction extends n.XFAObject{constructor(e){super(o,"openAction",!0);this.destination=null}}class Output extends n.XFAObject{constructor(e){super(o,"output",!0);this.to=null;this.type=null;this.uri=null}}class OutputBin extends n.StringObject{constructor(e){super(o,"outputBin")}}class OutputXSL extends n.XFAObject{constructor(e){super(o,"outputXSL",!0);this.uri=null}}class Overprint extends n.OptionObject{constructor(e){super(o,"overprint",["none","both","draw","field"])}}class Packets extends n.StringObject{constructor(e){super(o,"packets")}[n.$finalize](){"*"!==this[n.$content]&&(this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>["config","datasets","template","xfdf","xslt"].includes(e))))}}class PageOffset extends n.XFAObject{constructor(e){super(o,"pageOffset");this.x=(0,i.getInteger)({data:e.x,defaultValue:"useXDCSetting",validate:e=>!0});this.y=(0,i.getInteger)({data:e.y,defaultValue:"useXDCSetting",validate:e=>!0})}}class PageRange extends n.StringObject{constructor(e){super(o,"pageRange")}[n.$finalize](){const e=this[n.$content].trim().split(/\s+/).map((e=>parseInt(e,10))),t=[];for(let r=0,a=e.length;r<a;r+=2)t.push(e.slice(r,r+2));this[n.$content]=t}}class Pagination extends n.OptionObject{constructor(e){super(o,"pagination",["simplex","duplexShortEdge","duplexLongEdge"])}}class PaginationOverride extends n.OptionObject{constructor(e){super(o,"paginationOverride",["none","forceDuplex","forceDuplexLongEdge","forceDuplexShortEdge","forceSimplex"])}}class Part extends n.IntegerObject{constructor(e){super(o,"part",1,(e=>!1))}}class Pcl extends n.XFAObject{constructor(e){super(o,"pcl",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.pageOffset=null;this.staple=null;this.xdc=null}}class Pdf extends n.XFAObject{constructor(e){super(o,"pdf",!0);this.name=e.name||"";this.adobeExtensionLevel=null;this.batchOutput=null;this.compression=null;this.creator=null;this.encryption=null;this.fontInfo=null;this.interactive=null;this.linearized=null;this.openAction=null;this.pdfa=null;this.producer=null;this.renderPolicy=null;this.scriptModel=null;this.silentPrint=null;this.submitFormat=null;this.tagged=null;this.version=null;this.viewerPreferences=null;this.xdc=null}}class Pdfa extends n.XFAObject{constructor(e){super(o,"pdfa",!0);this.amd=null;this.conformance=null;this.includeXDPContent=null;this.part=null}}class Permissions extends n.XFAObject{constructor(e){super(o,"permissions",!0);this.accessibleContent=null;this.change=null;this.contentCopy=null;this.documentAssembly=null;this.formFieldFilling=null;this.modifyAnnots=null;this.plaintextMetadata=null;this.print=null;this.printHighQuality=null}}class PickTrayByPDFSize extends n.Option01{constructor(e){super(o,"pickTrayByPDFSize")}}class Picture extends n.StringObject{constructor(e){super(o,"picture")}}class PlaintextMetadata extends n.Option01{constructor(e){super(o,"plaintextMetadata")}}class Presence extends n.OptionObject{constructor(e){super(o,"presence",["preserve","dissolve","dissolveStructure","ignore","remove"])}}class Present extends n.XFAObject{constructor(e){super(o,"present",!0);this.behaviorOverride=null;this.cache=null;this.common=null;this.copies=null;this.destination=null;this.incrementalMerge=null;this.layout=null;this.output=null;this.overprint=null;this.pagination=null;this.paginationOverride=null;this.script=null;this.validate=null;this.xdp=null;this.driver=new n.XFAObjectArray;this.labelPrinter=new n.XFAObjectArray;this.pcl=new n.XFAObjectArray;this.pdf=new n.XFAObjectArray;this.ps=new n.XFAObjectArray;this.submitUrl=new n.XFAObjectArray;this.webClient=new n.XFAObjectArray;this.zpl=new n.XFAObjectArray}}class Print extends n.Option01{constructor(e){super(o,"print")}}class PrintHighQuality extends n.Option01{constructor(e){super(o,"printHighQuality")}}class PrintScaling extends n.OptionObject{constructor(e){super(o,"printScaling",["appdefault","noScaling"])}}class PrinterName extends n.StringObject{constructor(e){super(o,"printerName")}}class Producer extends n.StringObject{constructor(e){super(o,"producer")}}class Ps extends n.XFAObject{constructor(e){super(o,"ps",!0);this.name=e.name||"";this.batchOutput=null;this.fontInfo=null;this.jog=null;this.mediumInfo=null;this.outputBin=null;this.staple=null;this.xdc=null}}class Range extends n.ContentObject{constructor(e){super(o,"range")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s*,\s*/,2).map((e=>e.split("-").map((e=>parseInt(e.trim(),10))))).filter((e=>e.every((e=>!isNaN(e))))).map((e=>{1===e.length&&e.push(e[0]);return e}))}}class Record extends n.ContentObject{constructor(e){super(o,"record")}[n.$finalize](){this[n.$content]=this[n.$content].trim();const e=parseInt(this[n.$content],10);!isNaN(e)&&e>=0&&(this[n.$content]=e)}}class Relevant extends n.ContentObject{constructor(e){super(o,"relevant")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/)}}class Rename extends n.ContentObject{constructor(e){super(o,"rename")}[n.$finalize](){this[n.$content]=this[n.$content].trim();(this[n.$content].toLowerCase().startsWith("xml")||new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*","u").test(this[n.$content]))&&(0,s.warn)("XFA - Rename: invalid XFA name")}}class RenderPolicy extends n.OptionObject{constructor(e){super(o,"renderPolicy",["server","client"])}}class RunScripts extends n.OptionObject{constructor(e){super(o,"runScripts",["both","client","none","server"])}}class Script extends n.XFAObject{constructor(e){super(o,"script",!0);this.currentPage=null;this.exclude=null;this.runScripts=null}}class ScriptModel extends n.OptionObject{constructor(e){super(o,"scriptModel",["XFA","none"])}}class Severity extends n.OptionObject{constructor(e){super(o,"severity",["ignore","error","information","trace","warning"])}}class SilentPrint extends n.XFAObject{constructor(e){super(o,"silentPrint",!0);this.addSilentPrint=null;this.printerName=null}}class Staple extends n.XFAObject{constructor(e){super(o,"staple");this.mode=(0,i.getStringOption)(e.mode,["usePrinterSetting","on","off"])}}class StartNode extends n.StringObject{constructor(e){super(o,"startNode")}}class StartPage extends n.IntegerObject{constructor(e){super(o,"startPage",0,(e=>!0))}}class SubmitFormat extends n.OptionObject{constructor(e){super(o,"submitFormat",["html","delegate","fdf","xml","pdf"])}}class SubmitUrl extends n.StringObject{constructor(e){super(o,"submitUrl")}}class SubsetBelow extends n.IntegerObject{constructor(e){super(o,"subsetBelow",100,(e=>e>=0&&e<=100))}}class SuppressBanner extends n.Option01{constructor(e){super(o,"suppressBanner")}}class Tagged extends n.Option01{constructor(e){super(o,"tagged")}}class Template extends n.XFAObject{constructor(e){super(o,"template",!0);this.base=null;this.relevant=null;this.startPage=null;this.uri=null;this.xsl=null}}class Threshold extends n.OptionObject{constructor(e){super(o,"threshold",["trace","error","information","warning"])}}class To extends n.OptionObject{constructor(e){super(o,"to",["null","memory","stderr","stdout","system","uri"])}}class TemplateCache extends n.XFAObject{constructor(e){super(o,"templateCache");this.maxEntries=(0,i.getInteger)({data:e.maxEntries,defaultValue:5,validate:e=>e>=0})}}class Trace extends n.XFAObject{constructor(e){super(o,"trace",!0);this.area=new n.XFAObjectArray}}class Transform extends n.XFAObject{constructor(e){super(o,"transform",!0);this.groupParent=null;this.ifEmpty=null;this.nameAttr=null;this.picture=null;this.presence=null;this.rename=null;this.whitespace=null}}class Type extends n.OptionObject{constructor(e){super(o,"type",["none","ascii85","asciiHex","ccittfax","flate","lzw","runLength","native","xdp","mergedXDP"])}}class Uri extends n.StringObject{constructor(e){super(o,"uri")}}class Validate extends n.OptionObject{constructor(e){super(o,"validate",["preSubmit","prePrint","preExecute","preSave"])}}class ValidateApprovalSignatures extends n.ContentObject{constructor(e){super(o,"validateApprovalSignatures")}[n.$finalize](){this[n.$content]=this[n.$content].trim().split(/\s+/).filter((e=>["docReady","postSign"].includes(e)))}}class ValidationMessaging extends n.OptionObject{constructor(e){super(o,"validationMessaging",["allMessagesIndividually","allMessagesTogether","firstMessageOnly","noMessages"])}}class Version extends n.OptionObject{constructor(e){super(o,"version",["1.7","1.6","1.5","1.4","1.3","1.2"])}}class VersionControl extends n.XFAObject{constructor(e){super(o,"VersionControl");this.outputBelow=(0,i.getStringOption)(e.outputBelow,["warn","error","update"]);this.sourceAbove=(0,i.getStringOption)(e.sourceAbove,["warn","error"]);this.sourceBelow=(0,i.getStringOption)(e.sourceBelow,["update","maintain"])}}class ViewerPreferences extends n.XFAObject{constructor(e){super(o,"viewerPreferences",!0);this.ADBE_JSConsole=null;this.ADBE_JSDebugger=null;this.addViewerPreferences=null;this.duplexOption=null;this.enforce=null;this.numberOfCopies=null;this.pageRange=null;this.pickTrayByPDFSize=null;this.printScaling=null}}class WebClient extends n.XFAObject{constructor(e){super(o,"webClient",!0);this.name=e.name?e.name.trim():"";this.fontInfo=null;this.xdc=null}}class Whitespace extends n.OptionObject{constructor(e){super(o,"whitespace",["preserve","ltrim","normalize","rtrim","trim"])}}class Window extends n.ContentObject{constructor(e){super(o,"window")}[n.$finalize](){const e=this[n.$content].trim().split(/\s*,\s*/,2).map((e=>parseInt(e,10)));if(e.some((e=>isNaN(e))))this[n.$content]=[0,0];else{1===e.length&&e.push(e[0]);this[n.$content]=e}}}class Xdc extends n.XFAObject{constructor(e){super(o,"xdc",!0);this.uri=new n.XFAObjectArray;this.xsl=new n.XFAObjectArray}}class Xdp extends n.XFAObject{constructor(e){super(o,"xdp",!0);this.packets=null}}class Xsl extends n.XFAObject{constructor(e){super(o,"xsl",!0);this.debug=null;this.uri=null}}class Zpl extends n.XFAObject{constructor(e){super(o,"zpl",!0);this.name=e.name?e.name.trim():"";this.batchOutput=null;this.flipLabel=null;this.fontInfo=null;this.xdc=null}}class ConfigNamespace{static[a.$buildXFAObject](e,t){if(ConfigNamespace.hasOwnProperty(e))return ConfigNamespace[e](t)}static acrobat(e){return new Acrobat(e)}static acrobat7(e){return new Acrobat7(e)}static ADBE_JSConsole(e){return new ADBE_JSConsole(e)}static ADBE_JSDebugger(e){return new ADBE_JSDebugger(e)}static addSilentPrint(e){return new AddSilentPrint(e)}static addViewerPreferences(e){return new AddViewerPreferences(e)}static adjustData(e){return new AdjustData(e)}static adobeExtensionLevel(e){return new AdobeExtensionLevel(e)}static agent(e){return new Agent(e)}static alwaysEmbed(e){return new AlwaysEmbed(e)}static amd(e){return new Amd(e)}static area(e){return new Area(e)}static attributes(e){return new Attributes(e)}static autoSave(e){return new AutoSave(e)}static base(e){return new Base(e)}static batchOutput(e){return new BatchOutput(e)}static behaviorOverride(e){return new BehaviorOverride(e)}static cache(e){return new Cache(e)}static change(e){return new Change(e)}static common(e){return new Common(e)}static compress(e){return new Compress(e)}static compressLogicalStructure(e){return new CompressLogicalStructure(e)}static compressObjectStream(e){return new CompressObjectStream(e)}static compression(e){return new Compression(e)}static config(e){return new Config(e)}static conformance(e){return new Conformance(e)}static contentCopy(e){return new ContentCopy(e)}static copies(e){return new Copies(e)}static creator(e){return new Creator(e)}static currentPage(e){return new CurrentPage(e)}static data(e){return new Data(e)}static debug(e){return new Debug(e)}static defaultTypeface(e){return new DefaultTypeface(e)}static destination(e){return new Destination(e)}static documentAssembly(e){return new DocumentAssembly(e)}static driver(e){return new Driver(e)}static duplexOption(e){return new DuplexOption(e)}static dynamicRender(e){return new DynamicRender(e)}static embed(e){return new Embed(e)}static encrypt(e){return new Encrypt(e)}static encryption(e){return new Encryption(e)}static encryptionLevel(e){return new EncryptionLevel(e)}static enforce(e){return new Enforce(e)}static equate(e){return new Equate(e)}static equateRange(e){return new EquateRange(e)}static exclude(e){return new Exclude(e)}static excludeNS(e){return new ExcludeNS(e)}static flipLabel(e){return new FlipLabel(e)}static fontInfo(e){return new FontInfo(e)}static formFieldFilling(e){return new FormFieldFilling(e)}static groupParent(e){return new GroupParent(e)}static ifEmpty(e){return new IfEmpty(e)}static includeXDPContent(e){return new IncludeXDPContent(e)}static incrementalLoad(e){return new IncrementalLoad(e)}static incrementalMerge(e){return new IncrementalMerge(e)}static interactive(e){return new Interactive(e)}static jog(e){return new Jog(e)}static labelPrinter(e){return new LabelPrinter(e)}static layout(e){return new Layout(e)}static level(e){return new Level(e)}static linearized(e){return new Linearized(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static log(e){return new Log(e)}static map(e){return new MapElement(e)}static mediumInfo(e){return new MediumInfo(e)}static message(e){return new Message(e)}static messaging(e){return new Messaging(e)}static mode(e){return new Mode(e)}static modifyAnnots(e){return new ModifyAnnots(e)}static msgId(e){return new MsgId(e)}static nameAttr(e){return new NameAttr(e)}static neverEmbed(e){return new NeverEmbed(e)}static numberOfCopies(e){return new NumberOfCopies(e)}static openAction(e){return new OpenAction(e)}static output(e){return new Output(e)}static outputBin(e){return new OutputBin(e)}static outputXSL(e){return new OutputXSL(e)}static overprint(e){return new Overprint(e)}static packets(e){return new Packets(e)}static pageOffset(e){return new PageOffset(e)}static pageRange(e){return new PageRange(e)}static pagination(e){return new Pagination(e)}static paginationOverride(e){return new PaginationOverride(e)}static part(e){return new Part(e)}static pcl(e){return new Pcl(e)}static pdf(e){return new Pdf(e)}static pdfa(e){return new Pdfa(e)}static permissions(e){return new Permissions(e)}static pickTrayByPDFSize(e){return new PickTrayByPDFSize(e)}static picture(e){return new Picture(e)}static plaintextMetadata(e){return new PlaintextMetadata(e)}static presence(e){return new Presence(e)}static present(e){return new Present(e)}static print(e){return new Print(e)}static printHighQuality(e){return new PrintHighQuality(e)}static printScaling(e){return new PrintScaling(e)}static printerName(e){return new PrinterName(e)}static producer(e){return new Producer(e)}static ps(e){return new Ps(e)}static range(e){return new Range(e)}static record(e){return new Record(e)}static relevant(e){return new Relevant(e)}static rename(e){return new Rename(e)}static renderPolicy(e){return new RenderPolicy(e)}static runScripts(e){return new RunScripts(e)}static script(e){return new Script(e)}static scriptModel(e){return new ScriptModel(e)}static severity(e){return new Severity(e)}static silentPrint(e){return new SilentPrint(e)}static staple(e){return new Staple(e)}static startNode(e){return new StartNode(e)}static startPage(e){return new StartPage(e)}static submitFormat(e){return new SubmitFormat(e)}static submitUrl(e){return new SubmitUrl(e)}static subsetBelow(e){return new SubsetBelow(e)}static suppressBanner(e){return new SuppressBanner(e)}static tagged(e){return new Tagged(e)}static template(e){return new Template(e)}static templateCache(e){return new TemplateCache(e)}static threshold(e){return new Threshold(e)}static to(e){return new To(e)}static trace(e){return new Trace(e)}static transform(e){return new Transform(e)}static type(e){return new Type(e)}static uri(e){return new Uri(e)}static validate(e){return new Validate(e)}static validateApprovalSignatures(e){return new ValidateApprovalSignatures(e)}static validationMessaging(e){return new ValidationMessaging(e)}static version(e){return new Version(e)}static versionControl(e){return new VersionControl(e)}static viewerPreferences(e){return new ViewerPreferences(e)}static webClient(e){return new WebClient(e)}static whitespace(e){return new Whitespace(e)}static window(e){return new Window(e)}static xdc(e){return new Xdc(e)}static xdp(e){return new Xdp(e)}static xsl(e){return new Xsl(e)}static zpl(e){return new Zpl(e)}}t.ConfigNamespace=ConfigNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.ConnectionSetNamespace=void 0;var a=r(207),n=r(205);const i=a.NamespaceIds.connectionSet.id;class ConnectionSet extends n.XFAObject{constructor(e){super(i,"connectionSet",!0);this.wsdlConnection=new n.XFAObjectArray;this.xmlConnection=new n.XFAObjectArray;this.xsdConnection=new n.XFAObjectArray}}class EffectiveInputPolicy extends n.XFAObject{constructor(e){super(i,"effectiveInputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class EffectiveOutputPolicy extends n.XFAObject{constructor(e){super(i,"effectiveOutputPolicy");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Operation extends n.StringObject{constructor(e){super(i,"operation");this.id=e.id||"";this.input=e.input||"";this.name=e.name||"";this.output=e.output||"";this.use=e.use||"";this.usehref=e.usehref||""}}class RootElement extends n.StringObject{constructor(e){super(i,"rootElement");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAction extends n.StringObject{constructor(e){super(i,"soapAction");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class SoapAddress extends n.StringObject{constructor(e){super(i,"soapAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class Uri extends n.StringObject{constructor(e){super(i,"uri");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlAddress extends n.StringObject{constructor(e){super(i,"wsdlAddress");this.id=e.id||"";this.name=e.name||"";this.use=e.use||"";this.usehref=e.usehref||""}}class WsdlConnection extends n.XFAObject{constructor(e){super(i,"wsdlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.effectiveInputPolicy=null;this.effectiveOutputPolicy=null;this.operation=null;this.soapAction=null;this.soapAddress=null;this.wsdlAddress=null}}class XmlConnection extends n.XFAObject{constructor(e){super(i,"xmlConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.uri=null}}class XsdConnection extends n.XFAObject{constructor(e){super(i,"xsdConnection",!0);this.dataDescription=e.dataDescription||"";this.name=e.name||"";this.rootElement=null;this.uri=null}}class ConnectionSetNamespace{static[a.$buildXFAObject](e,t){if(ConnectionSetNamespace.hasOwnProperty(e))return ConnectionSetNamespace[e](t)}static connectionSet(e){return new ConnectionSet(e)}static effectiveInputPolicy(e){return new EffectiveInputPolicy(e)}static effectiveOutputPolicy(e){return new EffectiveOutputPolicy(e)}static operation(e){return new Operation(e)}static rootElement(e){return new RootElement(e)}static soapAction(e){return new SoapAction(e)}static soapAddress(e){return new SoapAddress(e)}static uri(e){return new Uri(e)}static wsdlAddress(e){return new WsdlAddress(e)}static wsdlConnection(e){return new WsdlConnection(e)}static xmlConnection(e){return new XmlConnection(e)}static xsdConnection(e){return new XsdConnection(e)}}t.ConnectionSetNamespace=ConnectionSetNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DatasetsNamespace=void 0;var a=r(205),n=r(207);const i=n.NamespaceIds.datasets.id;class Data extends a.XmlObject{constructor(e){super(i,"data",e)}[a.$isNsAgnostic](){return!0}}class Datasets extends a.XFAObject{constructor(e){super(i,"datasets",!0);this.data=null;this.Signature=null}[a.$onChild](e){const t=e[a.$nodeName];("data"===t&&e[a.$namespaceId]===i||"Signature"===t&&e[a.$namespaceId]===n.NamespaceIds.signature.id)&&(this[t]=e);this[a.$appendChild](e)}}class DatasetsNamespace{static[n.$buildXFAObject](e,t){if(DatasetsNamespace.hasOwnProperty(e))return DatasetsNamespace[e](t)}static datasets(e){return new Datasets(e)}static data(e){return new Data(e)}}t.DatasetsNamespace=DatasetsNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LocaleSetNamespace=void 0;var a=r(207),n=r(205),i=r(206);const s=a.NamespaceIds.localeSet.id;class CalendarSymbols extends n.XFAObject{constructor(e){super(s,"calendarSymbols",!0);this.name="gregorian";this.dayNames=new n.XFAObjectArray(2);this.eraNames=null;this.meridiemNames=null;this.monthNames=new n.XFAObjectArray(2)}}class CurrencySymbol extends n.StringObject{constructor(e){super(s,"currencySymbol");this.name=(0,i.getStringOption)(e.name,["symbol","isoname","decimal"])}}class CurrencySymbols extends n.XFAObject{constructor(e){super(s,"currencySymbols",!0);this.currencySymbol=new n.XFAObjectArray(3)}}class DatePattern extends n.StringObject{constructor(e){super(s,"datePattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class DatePatterns extends n.XFAObject{constructor(e){super(s,"datePatterns",!0);this.datePattern=new n.XFAObjectArray(4)}}class DateTimeSymbols extends n.ContentObject{constructor(e){super(s,"dateTimeSymbols")}}class Day extends n.StringObject{constructor(e){super(s,"day")}}class DayNames extends n.XFAObject{constructor(e){super(s,"dayNames",!0);this.abbr=(0,i.getInteger)({data:e.abbr,defaultValue:0,validate:e=>1===e});this.day=new n.XFAObjectArray(7)}}class Era extends n.StringObject{constructor(e){super(s,"era")}}class EraNames extends n.XFAObject{constructor(e){super(s,"eraNames",!0);this.era=new n.XFAObjectArray(2)}}class Locale extends n.XFAObject{constructor(e){super(s,"locale",!0);this.desc=e.desc||"";this.name="isoname";this.calendarSymbols=null;this.currencySymbols=null;this.datePatterns=null;this.dateTimeSymbols=null;this.numberPatterns=null;this.numberSymbols=null;this.timePatterns=null;this.typeFaces=null}}class LocaleSet extends n.XFAObject{constructor(e){super(s,"localeSet",!0);this.locale=new n.XFAObjectArray}}class Meridiem extends n.StringObject{constructor(e){super(s,"meridiem")}}class MeridiemNames extends n.XFAObject{constructor(e){super(s,"meridiemNames",!0);this.meridiem=new n.XFAObjectArray(2)}}class Month extends n.StringObject{constructor(e){super(s,"month")}}class MonthNames extends n.XFAObject{constructor(e){super(s,"monthNames",!0);this.abbr=(0,i.getInteger)({data:e.abbr,defaultValue:0,validate:e=>1===e});this.month=new n.XFAObjectArray(12)}}class NumberPattern extends n.StringObject{constructor(e){super(s,"numberPattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class NumberPatterns extends n.XFAObject{constructor(e){super(s,"numberPatterns",!0);this.numberPattern=new n.XFAObjectArray(4)}}class NumberSymbol extends n.StringObject{constructor(e){super(s,"numberSymbol");this.name=(0,i.getStringOption)(e.name,["decimal","grouping","percent","minus","zero"])}}class NumberSymbols extends n.XFAObject{constructor(e){super(s,"numberSymbols",!0);this.numberSymbol=new n.XFAObjectArray(5)}}class TimePattern extends n.StringObject{constructor(e){super(s,"timePattern");this.name=(0,i.getStringOption)(e.name,["full","long","med","short"])}}class TimePatterns extends n.XFAObject{constructor(e){super(s,"timePatterns",!0);this.timePattern=new n.XFAObjectArray(4)}}class TypeFace extends n.XFAObject{constructor(e){super(s,"typeFace",!0);this.name=""|e.name}}class TypeFaces extends n.XFAObject{constructor(e){super(s,"typeFaces",!0);this.typeFace=new n.XFAObjectArray}}class LocaleSetNamespace{static[a.$buildXFAObject](e,t){if(LocaleSetNamespace.hasOwnProperty(e))return LocaleSetNamespace[e](t)}static calendarSymbols(e){return new CalendarSymbols(e)}static currencySymbol(e){return new CurrencySymbol(e)}static currencySymbols(e){return new CurrencySymbols(e)}static datePattern(e){return new DatePattern(e)}static datePatterns(e){return new DatePatterns(e)}static dateTimeSymbols(e){return new DateTimeSymbols(e)}static day(e){return new Day(e)}static dayNames(e){return new DayNames(e)}static era(e){return new Era(e)}static eraNames(e){return new EraNames(e)}static locale(e){return new Locale(e)}static localeSet(e){return new LocaleSet(e)}static meridiem(e){return new Meridiem(e)}static meridiemNames(e){return new MeridiemNames(e)}static month(e){return new Month(e)}static monthNames(e){return new MonthNames(e)}static numberPattern(e){return new NumberPattern(e)}static numberPatterns(e){return new NumberPatterns(e)}static numberSymbol(e){return new NumberSymbol(e)}static numberSymbols(e){return new NumberSymbols(e)}static timePattern(e){return new TimePattern(e)}static timePatterns(e){return new TimePatterns(e)}static typeFace(e){return new TypeFace(e)}static typeFaces(e){return new TypeFaces(e)}}t.LocaleSetNamespace=LocaleSetNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SignatureNamespace=void 0;var a=r(207),n=r(205);const i=a.NamespaceIds.signature.id;class Signature extends n.XFAObject{constructor(e){super(i,"signature",!0)}}class SignatureNamespace{static[a.$buildXFAObject](e,t){if(SignatureNamespace.hasOwnProperty(e))return SignatureNamespace[e](t)}static signature(e){return new Signature(e)}}t.SignatureNamespace=SignatureNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.StylesheetNamespace=void 0;var a=r(207),n=r(205);const i=a.NamespaceIds.stylesheet.id;class Stylesheet extends n.XFAObject{constructor(e){super(i,"stylesheet",!0)}}class StylesheetNamespace{static[a.$buildXFAObject](e,t){if(StylesheetNamespace.hasOwnProperty(e))return StylesheetNamespace[e](t)}static stylesheet(e){return new Stylesheet(e)}}t.StylesheetNamespace=StylesheetNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XdpNamespace=void 0;var a=r(207),n=r(205);const i=a.NamespaceIds.xdp.id;class Xdp extends n.XFAObject{constructor(e){super(i,"xdp",!0);this.uuid=e.uuid||"";this.timeStamp=e.timeStamp||"";this.config=null;this.connectionSet=null;this.datasets=null;this.localeSet=null;this.stylesheet=new n.XFAObjectArray;this.template=null}[n.$onChildCheck](e){const t=a.NamespaceIds[e[n.$nodeName]];return t&&e[n.$namespaceId]===t.id}}class XdpNamespace{static[a.$buildXFAObject](e,t){if(XdpNamespace.hasOwnProperty(e))return XdpNamespace[e](t)}static xdp(e){return new Xdp(e)}}t.XdpNamespace=XdpNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XhtmlNamespace=void 0;var a=r(205),n=r(207),i=r(212),s=r(206);const o=n.NamespaceIds.xhtml.id,c=Symbol(),l=new Set(["color","font","font-family","font-size","font-stretch","font-style","font-weight","margin","margin-bottom","margin-left","margin-right","margin-top","letter-spacing","line-height","orphans","page-break-after","page-break-before","page-break-inside","tab-interval","tab-stop","text-align","text-decoration","text-indent","vertical-align","widows","kerning-mode","xfa-font-horizontal-scale","xfa-font-vertical-scale","xfa-spacerun","xfa-tab-stops"]),h=new Map([["page-break-after","breakAfter"],["page-break-before","breakBefore"],["page-break-inside","breakInside"],["kerning-mode",e=>"none"===e?"none":"normal"],["xfa-font-horizontal-scale",e=>`scaleX(${Math.max(0,Math.min(parseInt(e)/100)).toFixed(2)})`],["xfa-font-vertical-scale",e=>`scaleY(${Math.max(0,Math.min(parseInt(e)/100)).toFixed(2)})`],["xfa-spacerun",""],["xfa-tab-stops",""],["font-size",(e,t)=>{e=t.fontSize=(0,s.getMeasurement)(e);return(0,i.measureToString)(.99*e)}],["letter-spacing",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["line-height",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-bottom",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-left",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-right",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["margin-top",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["text-indent",e=>(0,i.measureToString)((0,s.getMeasurement)(e))],["font-family",e=>e],["vertical-align",e=>(0,i.measureToString)((0,s.getMeasurement)(e))]]),u=/\s+/g,d=/[\r\n]+/g,f=/\r\n?/g;function mapStyle(e,t,r){const n=Object.create(null);if(!e)return n;const o=Object.create(null);for(const[t,r]of e.split(";").map((e=>e.split(":",2)))){const e=h.get(t);if(""===e)continue;let a=r;e&&(a="string"==typeof e?e:e(r,o));t.endsWith("scale")?n.transform?n.transform=`${n[t]} ${a}`:n.transform=a:n[t.replaceAll(/-([a-zA-Z])/g,((e,t)=>t.toUpperCase()))]=a}n.fontFamily&&(0,i.setFontFamily)({typeface:n.fontFamily,weight:n.fontWeight||"normal",posture:n.fontStyle||"normal",size:o.fontSize||0},t,t[a.$globalData].fontFinder,n);if(r&&n.verticalAlign&&"0px"!==n.verticalAlign&&n.fontSize){const e=.583,t=.333,r=(0,s.getMeasurement)(n.fontSize);n.fontSize=(0,i.measureToString)(r*e);n.verticalAlign=(0,i.measureToString)(Math.sign((0,s.getMeasurement)(n.verticalAlign))*r*t)}r&&n.fontSize&&(n.fontSize=`calc(${n.fontSize} * var(--scale-factor))`);(0,i.fixTextIndent)(n);return n}const g=new Set(["body","html"]);class XhtmlObject extends a.XmlObject{constructor(e,t){super(o,t);this[c]=!1;this.style=e.style||""}[a.$clean](e){super[a.$clean](e);this.style=function checkStyle(e){return e.style?e.style.trim().split(/\s*;\s*/).filter((e=>!!e)).map((e=>e.split(/\s*:\s*/,2))).filter((t=>{let[r,n]=t;"font-family"===r&&e[a.$globalData].usedTypefaces.add(n);return l.has(r)})).map((e=>e.join(":"))).join(";"):""}(this)}[a.$acceptWhitespace](){return!g.has(this[a.$nodeName])}[a.$onText](e){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])this[c]=!0;else{e=e.replace(d,"");this.style.includes("xfa-spacerun:yes")||(e=e.replace(u," "))}e&&(this[a.$content]+=e)}[a.$pushGlyphs](e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=Object.create(null),n={top:NaN,bottom:NaN,left:NaN,right:NaN};let i=null;for(const[e,t]of this.style.split(";").map((e=>e.split(":",2))))switch(e){case"font-family":r.typeface=(0,s.stripQuotes)(t);break;case"font-size":r.size=(0,s.getMeasurement)(t);break;case"font-weight":r.weight=t;break;case"font-style":r.posture=t;break;case"letter-spacing":r.letterSpacing=(0,s.getMeasurement)(t);break;case"margin":const e=t.split(/ \t/).map((e=>(0,s.getMeasurement)(e)));switch(e.length){case 1:n.top=n.bottom=n.left=n.right=e[0];break;case 2:n.top=n.bottom=e[0];n.left=n.right=e[1];break;case 3:n.top=e[0];n.bottom=e[2];n.left=n.right=e[1];break;case 4:n.top=e[0];n.left=e[1];n.bottom=e[2];n.right=e[3]}break;case"margin-top":n.top=(0,s.getMeasurement)(t);break;case"margin-bottom":n.bottom=(0,s.getMeasurement)(t);break;case"margin-left":n.left=(0,s.getMeasurement)(t);break;case"margin-right":n.right=(0,s.getMeasurement)(t);break;case"line-height":i=(0,s.getMeasurement)(t)}e.pushData(r,n,i);if(this[a.$content])e.addString(this[a.$content]);else for(const t of this[a.$getChildren]())"#text"!==t[a.$nodeName]?t[a.$pushGlyphs](e):e.addString(t[a.$content]);t&&e.popFont()}[a.$toHTML](e){const t=[];this[a.$extra]={children:t};this[a.$childrenToHTML]({});if(0===t.length&&!this[a.$content])return s.HTMLResult.EMPTY;let r;r=this[c]?this[a.$content]?this[a.$content].replace(f,"\n"):void 0:this[a.$content]||void 0;return s.HTMLResult.success({name:this[a.$nodeName],attributes:{href:this.href,style:mapStyle(this.style,this,this[c])},children:t,value:r})}}class A extends XhtmlObject{constructor(e){super(e,"a");this.href=(0,i.fixURL)(e.href)||""}}class B extends XhtmlObject{constructor(e){super(e,"b")}[a.$pushGlyphs](e){e.pushFont({weight:"bold"});super[a.$pushGlyphs](e);e.popFont()}}class Body extends XhtmlObject{constructor(e){super(e,"body")}[a.$toHTML](e){const t=super[a.$toHTML](e),{html:r}=t;if(!r)return s.HTMLResult.EMPTY;r.name="div";r.attributes.class=["xfaRich"];return t}}class Br extends XhtmlObject{constructor(e){super(e,"br")}[a.$text](){return"\n"}[a.$pushGlyphs](e){e.addString("\n")}[a.$toHTML](e){return s.HTMLResult.success({name:"br"})}}class Html extends XhtmlObject{constructor(e){super(e,"html")}[a.$toHTML](e){const t=[];this[a.$extra]={children:t};this[a.$childrenToHTML]({});if(0===t.length)return s.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[a.$content]||""});if(1===t.length){const e=t[0];if(e.attributes&&e.attributes.class.includes("xfaRich"))return s.HTMLResult.success(e)}return s.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:t})}}class I extends XhtmlObject{constructor(e){super(e,"i")}[a.$pushGlyphs](e){e.pushFont({posture:"italic"});super[a.$pushGlyphs](e);e.popFont()}}class Li extends XhtmlObject{constructor(e){super(e,"li")}}class Ol extends XhtmlObject{constructor(e){super(e,"ol")}}class P extends XhtmlObject{constructor(e){super(e,"p")}[a.$pushGlyphs](e){super[a.$pushGlyphs](e,!1);e.addString("\n");e.addPara();e.popFont()}[a.$text](){return this[a.$getParent]()[a.$getChildren]().at(-1)===this?super[a.$text]():super[a.$text]()+"\n"}}class Span extends XhtmlObject{constructor(e){super(e,"span")}}class Sub extends XhtmlObject{constructor(e){super(e,"sub")}}class Sup extends XhtmlObject{constructor(e){super(e,"sup")}}class Ul extends XhtmlObject{constructor(e){super(e,"ul")}}class XhtmlNamespace{static[n.$buildXFAObject](e,t){if(XhtmlNamespace.hasOwnProperty(e))return XhtmlNamespace[e](t)}static a(e){return new A(e)}static b(e){return new B(e)}static body(e){return new Body(e)}static br(e){return new Br(e)}static html(e){return new Html(e)}static i(e){return new I(e)}static li(e){return new Li(e)}static ol(e){return new Ol(e)}static p(e){return new P(e)}static span(e){return new Span(e)}static sub(e){return new Sub(e)}static sup(e){return new Sup(e)}static ul(e){return new Ul(e)}}t.XhtmlNamespace=XhtmlNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.UnknownNamespace=void 0;var a=r(207),n=r(205);class UnknownNamespace{constructor(e){this.namespaceId=e}[a.$buildXFAObject](e,t){return new n.XmlObject(this.namespaceId,e,t)}}t.UnknownNamespace=UnknownNamespace},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.DatasetReader=void 0;var a=r(2),n=r(134),i=r(194);function decodeString(e){try{return(0,a.stringToUTF8String)(e)}catch(t){(0,a.warn)(`UTF-8 decoding failed: "${t}".`);return e}}class DatasetXMLParser extends i.SimpleXMLParser{constructor(e){super(e);this.node=null}onEndElement(e){const t=super.onEndElement(e);if(t&&"xfa:datasets"===e){this.node=t;throw new Error("Aborting DatasetXMLParser.")}}}t.DatasetReader=class DatasetReader{constructor(e){if(e.datasets)this.node=new i.SimpleXMLParser({hasAttributes:!0}).parseFromString(e.datasets).documentElement;else{const t=new DatasetXMLParser({hasAttributes:!0});try{t.parseFromString(e["xdp:xdp"])}catch(e){}this.node=t.node}}getValue(e){if(!this.node||!e)return"";const t=this.node.searchNode((0,n.parseXFAPath)(e),0);if(!t)return"";const r=t.firstChild;return r&&"value"===r.nodeName?t.children.map((e=>decodeString(e.textContent))):decodeString(t.textContent)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.XRef=void 0;var a=r(2),n=r(133),i=r(134),s=r(145),o=r(135),c=r(195);t.XRef=class XRef{constructor(e,t){this.stream=e;this.pdfManager=t;this.entries=[];this.xrefstms=Object.create(null);this._cacheMap=new Map;this._pendingRefs=new n.RefSet;this.stats=new i.DocStats(t.msgHandler);this._newRefNum=null}getNewRef(){null===this._newRefNum&&(this._newRefNum=this.entries.length||1);return n.Ref.get(this._newRefNum++,0)}resetNewRef(){this._newRefNum=null}setStartXRef(e){this.startXRefQueue=[e]}parse(){let e,t,r,s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(s){(0,a.warn)("Indexing all PDF objects");e=this.indexObjects()}else e=this.readXRef();e.assignXref(this);this.trailer=e;try{t=e.get("Encrypt")}catch(e){if(e instanceof i.MissingDataException)throw e;(0,a.warn)(`XRef.parse - Invalid "Encrypt" reference: "${e}".`)}if(t instanceof n.Dict){const r=e.get("ID"),a=r&&r.length?r[0]:"";t.suppressEncryption=!0;this.encrypt=new c.CipherTransformFactory(t,a,this.pdfManager.password)}try{r=e.get("Root")}catch(e){if(e instanceof i.MissingDataException)throw e;(0,a.warn)(`XRef.parse - Invalid "Root" reference: "${e}".`)}if(r instanceof n.Dict)try{if(r.get("Pages")instanceof n.Dict){this.root=r;return}}catch(e){if(e instanceof i.MissingDataException)throw e;(0,a.warn)(`XRef.parse - Invalid "Pages" reference: "${e}".`)}if(!s)throw new i.XRefParseException;throw new a.InvalidPDFException("Invalid Root reference.")}processXRefTable(e){"tableState"in this||(this.tableState={entryNum:0,streamPos:e.lexer.stream.pos,parserBuf1:e.buf1,parserBuf2:e.buf2});const t=this.readXRefTable(e);if(!(0,n.isCmd)(t,"trailer"))throw new a.FormatError("Invalid XRef table: could not find trailer dictionary");let r=e.getObj();r instanceof n.Dict||!r.dict||(r=r.dict);if(!(r instanceof n.Dict))throw new a.FormatError("Invalid XRef table: could not parse trailer dictionary");delete this.tableState;return r}readXRefTable(e){const t=e.lexer.stream,r=this.tableState;t.pos=r.streamPos;e.buf1=r.parserBuf1;e.buf2=r.parserBuf2;let i;for(;;){if(!("firstEntryNum"in r)||!("entryCount"in r)){if((0,n.isCmd)(i=e.getObj(),"trailer"))break;r.firstEntryNum=i;r.entryCount=e.getObj()}let s=r.firstEntryNum;const o=r.entryCount;if(!Number.isInteger(s)||!Number.isInteger(o))throw new a.FormatError("Invalid XRef table: wrong types in subsection header");for(let i=r.entryNum;i<o;i++){r.streamPos=t.pos;r.entryNum=i;r.parserBuf1=e.buf1;r.parserBuf2=e.buf2;const c={};c.offset=e.getObj();c.gen=e.getObj();const l=e.getObj();if(l instanceof n.Cmd)switch(l.cmd){case"f":c.free=!0;break;case"n":c.uncompressed=!0}if(!Number.isInteger(c.offset)||!Number.isInteger(c.gen)||!c.free&&!c.uncompressed)throw new a.FormatError(`Invalid entry in XRef subsection: ${s}, ${o}`);0===i&&c.free&&1===s&&(s=0);this.entries[i+s]||(this.entries[i+s]=c)}r.entryNum=0;r.streamPos=t.pos;r.parserBuf1=e.buf1;r.parserBuf2=e.buf2;delete r.firstEntryNum;delete r.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new a.FormatError("Invalid XRef table: unexpected first object");return i}processXRefStream(e){if(!("streamState"in this)){const t=e.dict,r=t.get("W");let a=t.get("Index");a||(a=[0,t.get("Size")]);this.streamState={entryRanges:a,byteWidths:r,entryNum:0,streamPos:e.pos}}this.readXRefStream(e);delete this.streamState;return e.dict}readXRefStream(e){const t=this.streamState;e.pos=t.streamPos;const[r,n,i]=t.byteWidths,s=t.entryRanges;for(;s.length>0;){const[o,c]=s;if(!Number.isInteger(o)||!Number.isInteger(c))throw new a.FormatError(`Invalid XRef range fields: ${o}, ${c}`);if(!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i))throw new a.FormatError(`Invalid XRef entry fields length: ${o}, ${c}`);for(let s=t.entryNum;s<c;++s){t.entryNum=s;t.streamPos=e.pos;let c=0,l=0,h=0;for(let t=0;t<r;++t){const t=e.getByte();if(-1===t)throw new a.FormatError("Invalid XRef byteWidths 'type'.");c=c<<8|t}0===r&&(c=1);for(let t=0;t<n;++t){const t=e.getByte();if(-1===t)throw new a.FormatError("Invalid XRef byteWidths 'offset'.");l=l<<8|t}for(let t=0;t<i;++t){const t=e.getByte();if(-1===t)throw new a.FormatError("Invalid XRef byteWidths 'generation'.");h=h<<8|t}const u={};u.offset=l;u.gen=h;switch(c){case 0:u.free=!0;break;case 1:u.uncompressed=!0;break;case 2:break;default:throw new a.FormatError(`Invalid XRef entry type: ${c}`)}this.entries[o+s]||(this.entries[o+s]=u)}t.entryNum=0;t.streamPos=e.pos;s.splice(0,2)}}indexObjects(){function readToken(e,t){let r="",a=e[t];for(;10!==a&&13!==a&&60!==a&&!(++t>=e.length);){r+=String.fromCharCode(a);a=e[t]}return r}function skipUntil(e,t,r){const a=r.length,n=e.length;let i=0;for(;t<n;){let n=0;for(;n<a&&e[t+n]===r[n];)++n;if(n>=a)break;t++;i++}return i}const e=/^(\d+)\s+(\d+)\s+obj\b/,t=/\bendobj[\b\s]$/,r=/\s+(\d+\s+\d+\s+obj[\b\s<])$/,o=new Uint8Array([116,114,97,105,108,101,114]),c=new Uint8Array([115,116,97,114,116,120,114,101,102]),l=new Uint8Array([111,98,106]),h=new Uint8Array([47,88,82,101,102]);this.entries.length=0;this._cacheMap.clear();const u=this.stream;u.pos=0;const d=u.getBytes(),f=d.length;let g=u.start;const p=[],m=[];for(;g<f;){let n=d[g];if(9===n||10===n||13===n||32===n){++g;continue}if(37===n){do{++g;if(g>=f)break;n=d[g]}while(10!==n&&13!==n);continue}const b=readToken(d,g);let y;if(b.startsWith("xref")&&(4===b.length||/\s/.test(b[4]))){g+=skipUntil(d,g,o);p.push(g);g+=skipUntil(d,g,c)}else if(y=e.exec(b)){const e=0|y[1],n=0|y[2];let o,c=g+b.length,f=!1;if(this.entries[e]){if(this.entries[e].gen===n)try{new s.Parser({lexer:new s.Lexer(u.makeSubStream(c))}).getObj();f=!0}catch(e){e instanceof i.ParserEOFException?(0,a.warn)(`indexObjects -- checking object (${b}): "${e}".`):f=!0}}else f=!0;f&&(this.entries[e]={offset:g-u.start,gen:n,uncompressed:!0});for(;c<d.length;){const e=c+skipUntil(d,c,l)+4;o=e-g;const n=Math.max(e-25,c),i=(0,a.bytesToString)(d.subarray(n,e));if(t.test(i))break;{const e=r.exec(i);if(e&&e[1]){(0,a.warn)('indexObjects: Found new "obj" inside of another "obj", caused by missing "endobj" -- trying to recover.');o-=e[1].length;break}}c=e}const p=d.subarray(g,g+o),w=skipUntil(p,0,h);if(w<o&&p[w+5]<64){m.push(g-u.start);this.xrefstms[g-u.start]=1}g+=o}else if(b.startsWith("trailer")&&(7===b.length||/\s/.test(b[7]))){p.push(g);g+=skipUntil(d,g,c)}else g+=b.length+1}for(let e=0,t=m.length;e<t;++e){this.startXRefQueue.push(m[e]);this.readXRef(!0)}let b;for(let e=0,t=p.length;e<t;++e){u.pos=p[e];const t=new s.Parser({lexer:new s.Lexer(u),xref:this,allowStreams:!0,recoveryMode:!0}),r=t.getObj();if(!(0,n.isCmd)(r,"trailer"))continue;const a=t.getObj();if(a instanceof n.Dict){try{const e=a.get("Root");if(!(e instanceof n.Dict))continue;const t=e.get("Pages");if(!(t instanceof n.Dict))continue;const r=t.get("Count");if(!Number.isInteger(r))continue}catch(e){continue}if(a.has("ID"))return a;b=a}}if(b)return b;if(this.topDict)return this.topDict;throw new a.InvalidPDFException("Invalid PDF structure.")}readXRef(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=this.stream,r=new Set;try{for(;this.startXRefQueue.length;){const e=this.startXRefQueue[0];if(r.has(e)){(0,a.warn)("readXRef - skipping XRef table since it was already parsed.");this.startXRefQueue.shift();continue}r.add(e);t.pos=e+t.start;const i=new s.Parser({lexer:new s.Lexer(t),xref:this,allowStreams:!0});let c,l=i.getObj();if((0,n.isCmd)(l,"xref")){c=this.processXRefTable(i);this.topDict||(this.topDict=c);l=c.get("XRefStm");if(Number.isInteger(l)){const e=l;if(!(e in this.xrefstms)){this.xrefstms[e]=1;this.startXRefQueue.push(e)}}}else{if(!Number.isInteger(l))throw new a.FormatError("Invalid XRef stream header");if(!(Number.isInteger(i.getObj())&&(0,n.isCmd)(i.getObj(),"obj")&&(l=i.getObj())instanceof o.BaseStream))throw new a.FormatError("Invalid XRef stream");c=this.processXRefStream(l);this.topDict||(this.topDict=c);if(!c)throw new a.FormatError("Failed to read XRef stream")}l=c.get("Prev");Number.isInteger(l)?this.startXRefQueue.push(l):l instanceof n.Ref&&this.startXRefQueue.push(l.num);this.startXRefQueue.shift()}return this.topDict}catch(e){if(e instanceof i.MissingDataException)throw e;(0,a.info)("(while reading XRef): "+e);this.startXRefQueue.shift()}if(!e)throw new i.XRefParseException}getEntry(e){const t=this.entries[e];return t&&!t.free&&t.offset?t:null}fetchIfRef(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e instanceof n.Ref?this.fetch(e,t):e}fetch(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(e instanceof n.Ref))throw new Error("ref object is not a reference");const r=e.num,i=this._cacheMap.get(r);if(void 0!==i){i instanceof n.Dict&&!i.objId&&(i.objId=e.toString());return i}let s=this.getEntry(r);if(null===s){this._cacheMap.set(r,s);return s}if(this._pendingRefs.has(e)){this._pendingRefs.remove(e);(0,a.warn)(`Ignoring circular reference: ${e}.`);return n.CIRCULAR_REF}this._pendingRefs.put(e);try{s=s.uncompressed?this.fetchUncompressed(e,s,t):this.fetchCompressed(e,s,t);this._pendingRefs.remove(e)}catch(t){this._pendingRefs.remove(e);throw t}s instanceof n.Dict?s.objId=e.toString():s instanceof o.BaseStream&&(s.dict.objId=e.toString());return s}fetchUncompressed(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const a=e.gen;let c=e.num;if(t.gen!==a)throw new i.XRefEntryException(`Inconsistent generation in XRef: ${e}`);const l=this.stream.makeSubStream(t.offset+this.stream.start),h=new s.Parser({lexer:new s.Lexer(l),xref:this,allowStreams:!0}),u=h.getObj(),d=h.getObj(),f=h.getObj();if(u!==c||d!==a||!(f instanceof n.Cmd))throw new i.XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`);if("obj"!==f.cmd){if(f.cmd.startsWith("obj")){c=parseInt(f.cmd.substring(3),10);if(!Number.isNaN(c))return c}throw new i.XRefEntryException(`Bad (uncompressed) XRef entry: ${e}`)}(t=this.encrypt&&!r?h.getObj(this.encrypt.createCipherTransform(c,a)):h.getObj())instanceof o.BaseStream||this._cacheMap.set(c,t);return t}fetchCompressed(e,t){const r=t.offset,c=this.fetch(n.Ref.get(r,0));if(!(c instanceof o.BaseStream))throw new a.FormatError("bad ObjStm stream");const l=c.dict.get("First"),h=c.dict.get("N");if(!Number.isInteger(l)||!Number.isInteger(h))throw new a.FormatError("invalid first and n parameters for ObjStm stream");let u=new s.Parser({lexer:new s.Lexer(c),xref:this,allowStreams:!0});const d=new Array(h),f=new Array(h);for(let e=0;e<h;++e){const t=u.getObj();if(!Number.isInteger(t))throw new a.FormatError(`invalid object number in the ObjStm stream: ${t}`);const r=u.getObj();if(!Number.isInteger(r))throw new a.FormatError(`invalid object offset in the ObjStm stream: ${r}`);d[e]=t;f[e]=r}const g=(c.start||0)+l,p=new Array(h);for(let e=0;e<h;++e){const t=e<h-1?f[e+1]-f[e]:void 0;if(t<0)throw new a.FormatError("Invalid offset in the ObjStm stream.");u=new s.Parser({lexer:new s.Lexer(c.makeSubStream(g+f[e],t,c.dict)),xref:this,allowStreams:!0});const n=u.getObj();p[e]=n;if(n instanceof o.BaseStream)continue;const i=d[e],l=this.entries[i];l&&l.offset===r&&l.gen===e&&this._cacheMap.set(i,n)}if(void 0===(t=p[t.gen]))throw new i.XRefEntryException(`Bad (compressed) XRef entry: ${e}`);return t}async fetchIfRefAsync(e,t){return e instanceof n.Ref?this.fetchAsync(e,t):e}async fetchAsync(e,t){try{return this.fetch(e,t)}catch(r){if(!(r instanceof i.MissingDataException))throw r;await this.pdfManager.requestRange(r.begin,r.end);return this.fetchAsync(e,t)}}getCatalogObj(){return this.root}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MessageHandler=void 0;var a=r(2);const n=1,i=2,s=1,o=2,c=3,l=4,h=5,u=6,d=7,f=8;function wrapReason(e){e instanceof Error||"object"==typeof e&&null!==e||(0,a.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');switch(e.name){case"AbortException":return new a.AbortException(e.message);case"MissingPDFException":return new a.MissingPDFException(e.message);case"PasswordException":return new a.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new a.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new a.UnknownErrorException(e.message,e.details);default:return new a.UnknownErrorException(e.message,e.toString())}}t.MessageHandler=class MessageHandler{constructor(e,t,r){this.sourceName=e;this.targetName=t;this.comObj=r;this.callbackId=1;this.streamId=1;this.streamSinks=Object.create(null);this.streamControllers=Object.create(null);this.callbackCapabilities=Object.create(null);this.actionHandler=Object.create(null);this._onComObjOnMessage=e=>{const t=e.data;if(t.targetName!==this.sourceName)return;if(t.stream){this._processStreamMessage(t);return}if(t.callback){const e=t.callbackId,r=this.callbackCapabilities[e];if(!r)throw new Error(`Cannot resolve callback ${e}`);delete this.callbackCapabilities[e];if(t.callback===n)r.resolve(t.data);else{if(t.callback!==i)throw new Error("Unexpected callback case");r.reject(wrapReason(t.reason))}return}const a=this.actionHandler[t.action];if(!a)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const e=this.sourceName,s=t.sourceName;new Promise((function(e){e(a(t.data))})).then((function(a){r.postMessage({sourceName:e,targetName:s,callback:n,callbackId:t.callbackId,data:a})}),(function(a){r.postMessage({sourceName:e,targetName:s,callback:i,callbackId:t.callbackId,reason:wrapReason(a)})}))}else t.streamId?this._createStreamSink(t):a(t.data)};r.addEventListener("message",this._onComObjOnMessage)}on(e,t){const r=this.actionHandler;if(r[e])throw new Error(`There is already an actionName called "${e}"`);r[e]=t}send(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)}sendWithPromise(e,t,r){const n=this.callbackId++,i=(0,a.createPromiseCapability)();this.callbackCapabilities[n]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:n,data:t},r)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,r,n){const i=this.streamId++,o=this.sourceName,c=this.targetName,l=this.comObj;return new ReadableStream({start:r=>{const s=(0,a.createPromiseCapability)();this.streamControllers[i]={controller:r,startCall:s,pullCall:null,cancelCall:null,isClosed:!1};l.postMessage({sourceName:o,targetName:c,action:e,streamId:i,data:t,desiredSize:r.desiredSize},n);return s.promise},pull:e=>{const t=(0,a.createPromiseCapability)();this.streamControllers[i].pullCall=t;l.postMessage({sourceName:o,targetName:c,stream:u,streamId:i,desiredSize:e.desiredSize});return t.promise},cancel:e=>{(0,a.assert)(e instanceof Error,"cancel must have a valid reason");const t=(0,a.createPromiseCapability)();this.streamControllers[i].cancelCall=t;this.streamControllers[i].isClosed=!0;l.postMessage({sourceName:o,targetName:c,stream:s,streamId:i,reason:wrapReason(e)});return t.promise}},r)}_createStreamSink(e){const t=e.streamId,r=this.sourceName,n=e.sourceName,i=this.comObj,s=this,o=this.actionHandler[e.action],u={enqueue(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2?arguments[2]:void 0;if(this.isCancelled)return;const c=this.desiredSize;this.desiredSize-=s;if(c>0&&this.desiredSize<=0){this.sinkCapability=(0,a.createPromiseCapability)();this.ready=this.sinkCapability.promise}i.postMessage({sourceName:r,targetName:n,stream:l,streamId:t,chunk:e},o)},close(){if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:r,targetName:n,stream:c,streamId:t});delete s.streamSinks[t]}},error(e){(0,a.assert)(e instanceof Error,"error must have a valid reason");if(!this.isCancelled){this.isCancelled=!0;i.postMessage({sourceName:r,targetName:n,stream:h,streamId:t,reason:wrapReason(e)})}},sinkCapability:(0,a.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};u.sinkCapability.resolve();u.ready=u.sinkCapability.promise;this.streamSinks[t]=u;new Promise((function(t){t(o(e.data,u))})).then((function(){i.postMessage({sourceName:r,targetName:n,stream:f,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:n,stream:f,streamId:t,reason:wrapReason(e)})}))}_processStreamMessage(e){const t=e.streamId,r=this.sourceName,n=e.sourceName,i=this.comObj,g=this.streamControllers[t],p=this.streamSinks[t];switch(e.stream){case f:e.success?g.startCall.resolve():g.startCall.reject(wrapReason(e.reason));break;case d:e.success?g.pullCall.resolve():g.pullCall.reject(wrapReason(e.reason));break;case u:if(!p){i.postMessage({sourceName:r,targetName:n,stream:d,streamId:t,success:!0});break}p.desiredSize<=0&&e.desiredSize>0&&p.sinkCapability.resolve();p.desiredSize=e.desiredSize;new Promise((function(e){e(p.onPull&&p.onPull())})).then((function(){i.postMessage({sourceName:r,targetName:n,stream:d,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:n,stream:d,streamId:t,reason:wrapReason(e)})}));break;case l:(0,a.assert)(g,"enqueue should have stream controller");if(g.isClosed)break;g.controller.enqueue(e.chunk);break;case c:(0,a.assert)(g,"close should have stream controller");if(g.isClosed)break;g.isClosed=!0;g.controller.close();this._deleteStreamController(g,t);break;case h:(0,a.assert)(g,"error should have stream controller");g.controller.error(wrapReason(e.reason));this._deleteStreamController(g,t);break;case o:e.success?g.cancelCall.resolve():g.cancelCall.reject(wrapReason(e.reason));this._deleteStreamController(g,t);break;case s:if(!p)break;new Promise((function(t){t(p.onCancel&&p.onCancel(wrapReason(e.reason)))})).then((function(){i.postMessage({sourceName:r,targetName:n,stream:o,streamId:t,success:!0})}),(function(e){i.postMessage({sourceName:r,targetName:n,stream:o,streamId:t,reason:wrapReason(e)})}));p.sinkCapability.reject(wrapReason(e.reason));p.isCancelled=!0;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController(e,t){await Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise]);delete this.streamControllers[t]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}},(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.PDFWorkerStream=void 0;var a=r(2);t.PDFWorkerStream=class PDFWorkerStream{constructor(e){this._msgHandler=e;this._contentLength=null;this._fullRequestReader=null;this._rangeRequestReaders=[]}getFullReader(){(0,a.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once.");this._fullRequestReader=new PDFWorkerStreamReader(this._msgHandler);return this._fullRequestReader}getRangeReader(e,t){const r=new PDFWorkerStreamRangeReader(e,t,this._msgHandler);this._rangeRequestReaders.push(r);return r}cancelAllRequests(e){this._fullRequestReader&&this._fullRequestReader.cancel(e);for(const t of this._rangeRequestReaders.slice(0))t.cancel(e)}};class PDFWorkerStreamReader{constructor(e){this._msgHandler=e;this.onProgress=null;this._contentLength=null;this._isRangeSupported=!1;this._isStreamingSupported=!1;const t=this._msgHandler.sendWithStream("GetReader");this._reader=t.getReader();this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then((e=>{this._isStreamingSupported=e.isStreamingSupported;this._isRangeSupported=e.isRangeSupported;this._contentLength=e.contentLength}))}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}class PDFWorkerStreamRangeReader{constructor(e,t,r){this._msgHandler=r;this.onProgress=null;const a=this._msgHandler.sendWithStream("GetRangeReader",{begin:e,end:t});this._reader=a.getReader()}get isStreamingSupported(){return!1}async read(){const{value:e,done:t}=await this._reader.read();return t?{value:void 0,done:!0}:{value:e.buffer,done:!1}}cancel(e){this._reader.cancel(e)}}}],t={};function __w_pdfjs_require__(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};e[r](n,n.exports,__w_pdfjs_require__);return n.exports}__w_pdfjs_require__.d=(e,t)=>{for(var r in t)__w_pdfjs_require__.o(t,r)&&!__w_pdfjs_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})};__w_pdfjs_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);__w_pdfjs_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";var e=r;Object.defineProperty(e,"__esModule",{value:!0});Object.defineProperty(e,"WorkerMessageHandler",{enumerable:!0,get:function(){return t.WorkerMessageHandler}});var t=__w_pdfjs_require__(1)})();return r})()));\ No newline at end of file