@verdocs/web-sdk 1.4.0 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Auth-adc80bd4.js +68 -0
- package/dist/cjs/{Token-b86e5335.js → Token-1ec62bd3.js} +2 -135
- package/dist/{verdocs-web-sdk/buffer-es6-5cef4368.js → cjs/buffer-es6-bc8199b1.js} +47 -14
- package/dist/cjs/index-589f3be8.js +1356 -0
- package/dist/cjs/loader.cjs.js +3 -19
- package/dist/cjs/{index-9c6e5f50.js → popper-71bf3058.js} +0 -186
- package/dist/cjs/verdocs-auth.cjs.entry.js +7 -199
- package/dist/cjs/verdocs-button_2.cjs.entry.js +105 -0
- package/dist/cjs/{verdocs-view.cjs.entry.js → verdocs-dropdown_12.cjs.entry.js} +3313 -50
- package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-kba-dialog.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-loader.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-organization-card.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +228 -0
- package/dist/cjs/verdocs-search-tabs.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +3 -1511
- package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +4 -90
- package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-toggle.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-upload-dialog.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-web-sdk.cjs.js +5 -117
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/controls/verdocs-button/verdocs-button.css +1 -1
- package/dist/collection/components/dialogs/verdocs-kba-dialog/verdocs-kba-dialog.css +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.css +2 -2
- package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.css +4 -4
- package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.css +2 -2
- package/dist/collection/components/elements/verdocs-field-attachment/verdocs-field-attachment.css +2 -4
- package/dist/collection/components/elements/verdocs-field-checkbox-group/verdocs-field-checkbox.css +1 -3
- package/dist/collection/components/elements/verdocs-field-date/verdocs-field-date.css +1 -3
- package/dist/collection/components/elements/verdocs-field-dropdown/verdocs-field-dropdown.css +1 -3
- package/dist/collection/components/elements/verdocs-field-initial/verdocs-field-initial.css +1 -3
- package/dist/collection/components/elements/verdocs-field-payment/verdocs-field-payment.css +1 -3
- package/dist/collection/components/elements/verdocs-field-radio-button-group/verdocs-field-radio-button.css +1 -3
- package/dist/collection/components/elements/verdocs-field-signature/verdocs-field-signature.css +1 -3
- package/dist/collection/components/elements/verdocs-field-textarea/verdocs-field-textarea.css +1 -3
- package/dist/collection/components/elements/verdocs-field-textbox/verdocs-field-textbox.css +1 -3
- package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.css +1 -3
- package/dist/collection/components/elements/verdocs-search-activity/verdocs-search-activity.css +1 -3
- package/dist/collection/components/elements/verdocs-search-box/verdocs-search-box.css +1 -3
- package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.css +1 -0
- package/dist/components/Auth.js +0 -93
- package/dist/components/Token.js +1 -134
- package/dist/components/buffer-es6.js +39 -14
- package/dist/components/index.js +0 -4
- package/dist/components/{index3.js → popper.js} +0 -186
- package/dist/components/verdocs-auth.js +2 -193
- package/dist/components/verdocs-button2.js +2 -2
- package/dist/components/verdocs-dropdown2.js +2 -2
- package/dist/components/verdocs-field-attachment2.js +2 -2
- package/dist/components/verdocs-field-checkbox2.js +2 -2
- package/dist/components/verdocs-field-date2.js +2 -214
- package/dist/components/verdocs-field-dropdown2.js +2 -2
- package/dist/components/verdocs-field-initial2.js +2 -2
- package/dist/components/verdocs-field-payment2.js +2 -2
- package/dist/components/verdocs-field-radio-button2.js +2 -2
- package/dist/components/verdocs-field-signature2.js +2 -2
- package/dist/components/verdocs-field-textarea2.js +2 -2
- package/dist/components/verdocs-field-textbox2.js +2 -2
- package/dist/components/verdocs-initial-dialog2.js +1 -1
- package/dist/components/verdocs-kba-dialog.js +2 -2
- package/dist/components/verdocs-loader2.js +1 -1
- package/dist/components/verdocs-ok-dialog2.js +2 -2
- package/dist/components/verdocs-organization-card.js +1 -1
- package/dist/components/verdocs-quick-functions.js +2 -2
- package/dist/components/verdocs-search-activity2.js +16 -104
- package/dist/components/verdocs-search-box2.js +2 -2
- package/dist/components/verdocs-search-tabs.js +2 -2
- package/dist/components/verdocs-search.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1508
- package/dist/components/verdocs-signature-dialog2.js +2 -2
- package/dist/components/verdocs-status-indicator.js +3 -88
- package/dist/components/verdocs-template-card.js +1 -1
- package/dist/components/verdocs-template-tags.js +1 -1
- package/dist/components/verdocs-text-input2.js +1 -1
- package/dist/components/verdocs-toggle.js +1 -1
- package/dist/components/verdocs-upload-dialog2.js +2 -2
- package/dist/components/verdocs-view2.js +6 -33
- package/dist/docs.json +2 -2
- package/dist/esm/Auth-ff6040be.js +64 -0
- package/dist/{verdocs-web-sdk/Token-29eea56d.js → esm/Token-a587e3ad.js} +1 -134
- package/dist/{cjs/buffer-es6-b2c1c885.js → esm/buffer-es6-136673c8.js} +38 -15
- package/dist/esm/index-859bc689.js +1327 -0
- package/dist/esm/loader.js +3 -19
- package/dist/esm/{index-432c65a6.js → popper-93ecb064.js} +0 -186
- package/dist/esm/verdocs-auth.entry.js +4 -196
- package/dist/esm/verdocs-button_2.entry.js +100 -0
- package/dist/esm/{verdocs-view.entry.js → verdocs-dropdown_12.entry.js} +3286 -34
- package/dist/esm/verdocs-initial-dialog.entry.js +1 -1
- package/dist/esm/verdocs-kba-dialog.entry.js +2 -2
- package/dist/esm/verdocs-loader.entry.js +1 -1
- package/dist/esm/verdocs-ok-dialog.entry.js +2 -2
- package/dist/esm/verdocs-organization-card.entry.js +1 -1
- package/dist/esm/verdocs-quick-functions.entry.js +2 -2
- package/dist/esm/verdocs-search-activity_2.entry.js +223 -0
- package/dist/esm/verdocs-search-tabs.entry.js +2 -2
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +3 -1511
- package/dist/esm/verdocs-signature-dialog.entry.js +2 -2
- package/dist/esm/verdocs-status-indicator.entry.js +3 -89
- package/dist/esm/verdocs-template-card.entry.js +1 -1
- package/dist/esm/verdocs-template-tags.entry.js +1 -1
- package/dist/esm/verdocs-toggle.entry.js +1 -1
- package/dist/esm/verdocs-upload-dialog.entry.js +2 -2
- package/dist/esm/verdocs-web-sdk.js +5 -117
- package/dist/esm-es5/Auth-ff6040be.js +1 -0
- package/dist/esm-es5/Token-a587e3ad.js +1 -0
- package/dist/esm-es5/buffer-es6-136673c8.js +7 -0
- package/dist/esm-es5/index-859bc689.js +2 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/popper-93ecb064.js +1 -0
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-button_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-dropdown_12.entry.js +23 -0
- package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-kba-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-loader.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-organization-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -11
- package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
- package/dist/esm-es5/verdocs-toggle.entry.js +1 -1
- package/dist/esm-es5/verdocs-upload-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/verdocs-web-sdk/index.esm.js +0 -1
- package/dist/verdocs-web-sdk/p-0353c423.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-11bc03a5.js +1 -0
- package/dist/verdocs-web-sdk/p-144e0842.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-15b7ed4d.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-1f55d8ac.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-2bc58746.js +2 -0
- package/dist/verdocs-web-sdk/p-34bb9854.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3d1eb63d.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-3f437456.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-432c3151.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-466cf9bf.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-4c66f794.js +1 -0
- package/dist/verdocs-web-sdk/{index.system.js → p-50ea2036.system.js} +0 -0
- package/dist/verdocs-web-sdk/p-5dfd73f9.system.js +7 -0
- package/dist/verdocs-web-sdk/p-6348272c.js +1 -0
- package/dist/verdocs-web-sdk/p-6393b2b4.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-66b19637.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6802ef91.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6ac9e6f8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6d65d54e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6fa6fb3c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-829b235c.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8795dbe8.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -0
- package/dist/verdocs-web-sdk/p-8c6db319.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8c6e29a5.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-92632d8e.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-96c0bf40.system.js +1 -0
- package/dist/verdocs-web-sdk/p-98d72550.system.entry.js +23 -0
- package/dist/verdocs-web-sdk/p-9b34c794.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-9fbb3fc2.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a1fcf0c4.entry.js +23 -0
- package/dist/verdocs-web-sdk/p-b1cd24f7.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-bf2620cb.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c2f97ef9.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-caed7818.system.js +2 -0
- package/dist/verdocs-web-sdk/p-cc127684.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-cd6d1fe5.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-d6206c17.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-da667373.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e2e643c5.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-e3659c64.system.js +1 -0
- package/dist/verdocs-web-sdk/p-e609b2ee.system.js +1 -0
- package/dist/verdocs-web-sdk/p-e719f9ca.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ed5baeb4.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ef932a87.js +1 -0
- package/dist/verdocs-web-sdk/p-f0d0f959.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f7e26fbd.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f814d5cc.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f9d431ef.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.css +1 -57
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -129
- package/dist/verdocs-web-sdk/verdocs-web-sdk.js +2 -1
- package/package.json +4 -4
- package/dist/cjs/Auth-0146ddd8.js +0 -161
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-e9231523.js +0 -6
- package/dist/cjs/dom-7fb93981.js +0 -75
- package/dist/cjs/index-a24f3b6a.js +0 -3096
- package/dist/cjs/index-b5a86b04.js +0 -4
- package/dist/cjs/index-c4be37e1.js +0 -54
- package/dist/cjs/shadow-css-abc19485.js +0 -389
- package/dist/cjs/verdocs-button.cjs.entry.js +0 -49
- package/dist/cjs/verdocs-dropdown.cjs.entry.js +0 -80
- package/dist/cjs/verdocs-field-attachment.cjs.entry.js +0 -59
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +0 -39
- package/dist/cjs/verdocs-field-date.cjs.entry.js +0 -2968
- package/dist/cjs/verdocs-field-dropdown.cjs.entry.js +0 -59
- package/dist/cjs/verdocs-field-initial.cjs.entry.js +0 -52
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +0 -86
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +0 -48
- package/dist/cjs/verdocs-field-signature.cjs.entry.js +0 -52
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +0 -63
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +0 -63
- package/dist/cjs/verdocs-search-activity.cjs.entry.js +0 -263
- package/dist/cjs/verdocs-search-box.cjs.entry.js +0 -60
- package/dist/cjs/verdocs-text-input.cjs.entry.js +0 -62
- package/dist/components/index2.js +0 -1
- package/dist/components/index4.js +0 -47
- package/dist/custom-elements.json +0 -830
- package/dist/esm/Auth-4b21fced.js +0 -157
- package/dist/esm/Token-29eea56d.js +0 -2458
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/buffer-es6-5cef4368.js +0 -1985
- package/dist/esm/css-shim-60f618b9.js +0 -4
- package/dist/esm/dom-4eeb3fee.js +0 -73
- package/dist/esm/index-97ec070b.js +0 -47
- package/dist/esm/index-ddbd60b5.js +0 -3059
- package/dist/esm/index-ef172650.js +0 -1
- package/dist/esm/shadow-css-02866686.js +0 -387
- package/dist/esm/verdocs-button.entry.js +0 -45
- package/dist/esm/verdocs-dropdown.entry.js +0 -76
- package/dist/esm/verdocs-field-attachment.entry.js +0 -55
- package/dist/esm/verdocs-field-checkbox.entry.js +0 -35
- package/dist/esm/verdocs-field-date.entry.js +0 -2964
- package/dist/esm/verdocs-field-dropdown.entry.js +0 -55
- package/dist/esm/verdocs-field-initial.entry.js +0 -48
- package/dist/esm/verdocs-field-payment.entry.js +0 -82
- package/dist/esm/verdocs-field-radio-button.entry.js +0 -44
- package/dist/esm/verdocs-field-signature.entry.js +0 -48
- package/dist/esm/verdocs-field-textarea.entry.js +0 -59
- package/dist/esm/verdocs-field-textbox.entry.js +0 -59
- package/dist/esm/verdocs-search-activity.entry.js +0 -259
- package/dist/esm/verdocs-search-box.entry.js +0 -56
- package/dist/esm/verdocs-text-input.entry.js +0 -58
- package/dist/esm-es5/Auth-4b21fced.js +0 -1
- package/dist/esm-es5/Token-29eea56d.js +0 -1
- package/dist/esm-es5/app-globals-0f993ce5.js +0 -1
- package/dist/esm-es5/buffer-es6-5cef4368.js +0 -7
- package/dist/esm-es5/css-shim-60f618b9.js +0 -1
- package/dist/esm-es5/dom-4eeb3fee.js +0 -21
- package/dist/esm-es5/index-432c65a6.js +0 -1
- package/dist/esm-es5/index-97ec070b.js +0 -1
- package/dist/esm-es5/index-ddbd60b5.js +0 -2
- package/dist/esm-es5/index-ef172650.js +0 -1
- package/dist/esm-es5/shadow-css-02866686.js +0 -12
- package/dist/esm-es5/verdocs-button.entry.js +0 -1
- package/dist/esm-es5/verdocs-dropdown.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-attachment.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +0 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +0 -1
- package/dist/esm-es5/verdocs-search-activity.entry.js +0 -1
- package/dist/esm-es5/verdocs-search-box.entry.js +0 -1
- package/dist/esm-es5/verdocs-text-input.entry.js +0 -1
- package/dist/esm-es5/verdocs-view.entry.js +0 -23
- package/dist/verdocs-web-sdk/Auth-4b21fced.js +0 -157
- package/dist/verdocs-web-sdk/Auth-82e38539.system.js +0 -1
- package/dist/verdocs-web-sdk/Token-c1cf309e.system.js +0 -1
- package/dist/verdocs-web-sdk/app-globals-0f993ce5.js +0 -3
- package/dist/verdocs-web-sdk/app-globals-497eb362.system.js +0 -1
- package/dist/verdocs-web-sdk/buffer-es6-aa11181b.system.js +0 -7
- package/dist/verdocs-web-sdk/css-shim-60f618b9.js +0 -4
- package/dist/verdocs-web-sdk/css-shim-e41ceccc.system.js +0 -1
- package/dist/verdocs-web-sdk/dom-4eeb3fee.js +0 -73
- package/dist/verdocs-web-sdk/dom-89b5deb7.system.js +0 -21
- package/dist/verdocs-web-sdk/index-027b383e.system.js +0 -1
- package/dist/verdocs-web-sdk/index-06e036a1.system.js +0 -1
- package/dist/verdocs-web-sdk/index-432c65a6.js +0 -1974
- package/dist/verdocs-web-sdk/index-5d49316f.system.js +0 -1
- package/dist/verdocs-web-sdk/index-6465280a.system.js +0 -2
- package/dist/verdocs-web-sdk/index-97ec070b.js +0 -47
- package/dist/verdocs-web-sdk/index-ddbd60b5.js +0 -3059
- package/dist/verdocs-web-sdk/index-ef172650.js +0 -1
- package/dist/verdocs-web-sdk/shadow-css-02866686.js +0 -387
- package/dist/verdocs-web-sdk/shadow-css-6207e159.system.js +0 -13
- package/dist/verdocs-web-sdk/verdocs-auth.entry.js +0 -302
- package/dist/verdocs-web-sdk/verdocs-auth.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-button.entry.js +0 -45
- package/dist/verdocs-web-sdk/verdocs-button.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-dropdown.entry.js +0 -76
- package/dist/verdocs-web-sdk/verdocs-dropdown.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-attachment.entry.js +0 -55
- package/dist/verdocs-web-sdk/verdocs-field-attachment.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-checkbox.entry.js +0 -35
- package/dist/verdocs-web-sdk/verdocs-field-checkbox.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-date.entry.js +0 -2964
- package/dist/verdocs-web-sdk/verdocs-field-date.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-dropdown.entry.js +0 -55
- package/dist/verdocs-web-sdk/verdocs-field-dropdown.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-initial.entry.js +0 -48
- package/dist/verdocs-web-sdk/verdocs-field-initial.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-payment.entry.js +0 -82
- package/dist/verdocs-web-sdk/verdocs-field-payment.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-radio-button.entry.js +0 -44
- package/dist/verdocs-web-sdk/verdocs-field-radio-button.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-signature.entry.js +0 -48
- package/dist/verdocs-web-sdk/verdocs-field-signature.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-textarea.entry.js +0 -59
- package/dist/verdocs-web-sdk/verdocs-field-textarea.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-field-textbox.entry.js +0 -59
- package/dist/verdocs-web-sdk/verdocs-field-textbox.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-initial-dialog.entry.js +0 -239
- package/dist/verdocs-web-sdk/verdocs-initial-dialog.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-kba-dialog.entry.js +0 -77
- package/dist/verdocs-web-sdk/verdocs-kba-dialog.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-loader.entry.js +0 -15
- package/dist/verdocs-web-sdk/verdocs-loader.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-ok-dialog.entry.js +0 -44
- package/dist/verdocs-web-sdk/verdocs-ok-dialog.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-organization-card.entry.js +0 -18
- package/dist/verdocs-web-sdk/verdocs-organization-card.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-quick-functions.entry.js +0 -27
- package/dist/verdocs-web-sdk/verdocs-quick-functions.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-search-activity.entry.js +0 -259
- package/dist/verdocs-web-sdk/verdocs-search-activity.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-search-box.entry.js +0 -56
- package/dist/verdocs-web-sdk/verdocs-search-box.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-search-tabs.entry.js +0 -16
- package/dist/verdocs-web-sdk/verdocs-search-tabs.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-search.entry.js +0 -15
- package/dist/verdocs-web-sdk/verdocs-search.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-sign.entry.js +0 -1995
- package/dist/verdocs-web-sdk/verdocs-sign.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-signature-dialog.entry.js +0 -235
- package/dist/verdocs-web-sdk/verdocs-signature-dialog.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-status-indicator.entry.js +0 -7611
- package/dist/verdocs-web-sdk/verdocs-status-indicator.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-template-card.entry.js +0 -34
- package/dist/verdocs-web-sdk/verdocs-template-card.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-template-tags.entry.js +0 -16
- package/dist/verdocs-web-sdk/verdocs-template-tags.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-text-input.entry.js +0 -58
- package/dist/verdocs-web-sdk/verdocs-text-input.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-toggle.entry.js +0 -32
- package/dist/verdocs-web-sdk/verdocs-toggle.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-upload-dialog.entry.js +0 -119
- package/dist/verdocs-web-sdk/verdocs-upload-dialog.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/verdocs-view.entry.js +0 -16118
- package/dist/verdocs-web-sdk/verdocs-view.system.entry.js +0 -23
- package/dist/verdocs-web-sdk/verdocs-web-sdk.system.js +0 -1
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]};return e(t,r)};return function(t,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n["throw"](e))}catch(e){i(e)}}function l(e){e.done?r(e.value):a(e.value).then(o,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:r.label++;return{value:o[1],done:false};case 5:r.label++;a=o[1];o=[0];continue;case 7:o=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){r.label=o[1];break}if(o[0]===6&&r.label<i[1]){r.label=i[1];i=o;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(o);break}if(i[2])r.ops.pop();r.trys.pop();continue}o=t.call(e,r)}catch(e){o=[6,e];a=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};var __classPrivateFieldGet=this&&this.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var __classPrivateFieldSet=this&&this.__classPrivateFieldSet||function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r};var __asyncValues=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(t){r[t]=e[t]&&function(r){return new Promise((function(n,i){r=e[t](r),a(n,i,r.done,r.value)}))}}function a(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return e.concat(i||Array.prototype.slice.call(t))};System.register(["./index-6465280a.system.js","./index-027b383e.system.js","./buffer-es6-aa11181b.system.js"],(function(exports){"use strict";var registerInstance,createEvent,h,getElement,getAugmentedNamespace,createCommonjsModule,commonjsGlobal,process_1,commonjsRequire,getDefaultExportFromCjs,Buffer;return{setters:[function(e){registerInstance=e.r;createEvent=e.e;h=e.h;getElement=e.g},function(e){getAugmentedNamespace=e.g;createCommonjsModule=e.c;commonjsGlobal=e.a;process_1=e.p;commonjsRequire=e.b;getDefaultExportFromCjs=e.d},function(e){Buffer=e.B}],execute:function(){var _nodeResolve_empty={};var _nodeResolve_empty$1=Object.freeze({__proto__:null,default:_nodeResolve_empty});var require$$5=getAugmentedNamespace(_nodeResolve_empty$1);var pdf=createCommonjsModule((function(module,exports){
|
|
2
|
-
/**
|
|
3
|
-
* @licstart The following is the entire license notice for the
|
|
4
|
-
* Javascript code in this page
|
|
5
|
-
*
|
|
6
|
-
* Copyright 2021 Mozilla Foundation
|
|
7
|
-
*
|
|
8
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License.
|
|
10
|
-
* You may obtain a copy of the License at
|
|
11
|
-
*
|
|
12
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
-
*
|
|
14
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
-
* See the License for the specific language governing permissions and
|
|
18
|
-
* limitations under the License.
|
|
19
|
-
*
|
|
20
|
-
* @licend The above is the entire license notice for the
|
|
21
|
-
* Javascript code in this page
|
|
22
|
-
*/
|
|
23
|
-
(function e(t,r){if("object"==="object"&&"object"==="object")module.exports=r();else if(typeof undefined==="function"&&undefined.amd)undefined("pdfjs-dist/build/pdf",[],r);else if("object"==="object")exports["pdfjs-dist/build/pdf"]=r();else t["pdfjs-dist/build/pdf"]=t.pdfjsLib=r()})(commonjsGlobal,(function(){return function(){"use strict";var __webpack_modules__=[,function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.StatTimer=t.RenderingCancelledException=t.PixelsPerInch=t.PageViewport=t.PDFDateString=t.LinkTarget=t.DOMStandardFontDataFactory=t.DOMSVGFactory=t.DOMCanvasFactory=t.DOMCMapReaderFactory=void 0;t.addLinkAttributes=g;t.deprecated=C;t.getFilenameFromUrl=y;t.getPdfFilenameFromUrl=b;t.getXfaPageViewport=k;t.isDataScheme=m;t.isPdfFile=_;t.isValidFetchUrl=S;t.loadScript=x;var n=r(2);var a=r(5);var i="noopener noreferrer nofollow";var o="http://www.w3.org/2000/svg";var s={CSS:96,PDF:72,get PDF_TO_CSS_UNITS(){return(0,n.shadow)(this,"PDF_TO_CSS_UNITS",this.CSS/this.PDF)}};t.PixelsPerInch=s;var l=function(e){__extends(t,e);function t(t){var r=t===void 0?{}:t,n=r.ownerDocument,a=n===void 0?globalThis.document:n;var i=e.call(this)||this;i._document=a;return i}t.prototype._createCanvas=function(e,t){var r=this._document.createElement("canvas");r.width=e;r.height=t;return r};return t}(a.BaseCanvasFactory);t.DOMCanvasFactory=l;function u(e,t){if(t===void 0){t=false}return __awaiter(this,void 0,void 0,(function(){var r,a,i,o;return __generator(this,(function(s){switch(s.label){case 0:if(!S(e,document.baseURI))return[3,6];return[4,fetch(e)];case 1:r=s.sent();if(!r.ok){throw new Error(r.statusText)}if(!t)return[3,3];i=Uint8Array.bind;return[4,r.arrayBuffer()];case 2:a=new(i.apply(Uint8Array,[void 0,s.sent()]));return[3,5];case 3:o=(0,n.stringToBytes);return[4,r.text()];case 4:a=o.apply(void 0,[s.sent()]);s.label=5;case 5:return[2,a];case 6:return[2,new Promise((function(r,a){var i=new XMLHttpRequest;i.open("GET",e,true);if(t){i.responseType="arraybuffer"}i.onreadystatechange=function(){if(i.readyState!==XMLHttpRequest.DONE){return}if(i.status===200||i.status===0){var e=void 0;if(t&&i.response){e=new Uint8Array(i.response)}else if(!t&&i.responseText){e=(0,n.stringToBytes)(i.responseText)}if(e){r(e);return}}a(new Error(i.statusText))};i.send(null)}))]}}))}))}var c=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._fetchData=function(e,t){return u(e,this.isCompressed).then((function(e){return{cMapData:e,compressionType:t}}))};return t}(a.BaseCMapReaderFactory);t.DOMCMapReaderFactory=c;var d=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._fetchData=function(e){return u(e,true)};return t}(a.BaseStandardFontDataFactory);t.DOMStandardFontDataFactory=d;var h=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._createSVG=function(e){return document.createElementNS(o,e)};return t}(a.BaseSVGFactory);t.DOMSVGFactory=h;var f=function(){function e(e){var t=e.viewBox,r=e.scale,n=e.rotation,a=e.offsetX,i=a===void 0?0:a,o=e.offsetY,s=o===void 0?0:o,l=e.dontFlip,u=l===void 0?false:l;this.viewBox=t;this.scale=r;this.rotation=n;this.offsetX=i;this.offsetY=s;var c=(t[2]+t[0])/2;var d=(t[3]+t[1])/2;var h,f,p,v;n%=360;if(n<0){n+=360}switch(n){case 180:h=-1;f=0;p=0;v=1;break;case 90:h=0;f=1;p=1;v=0;break;case 270:h=0;f=-1;p=-1;v=0;break;case 0:h=1;f=0;p=0;v=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}if(u){p=-p;v=-v}var g,m;var _,y;if(h===0){g=Math.abs(d-t[1])*r+i;m=Math.abs(c-t[0])*r+s;_=Math.abs(t[3]-t[1])*r;y=Math.abs(t[2]-t[0])*r}else{g=Math.abs(c-t[0])*r+i;m=Math.abs(d-t[1])*r+s;_=Math.abs(t[2]-t[0])*r;y=Math.abs(t[3]-t[1])*r}this.transform=[h*r,f*r,p*r,v*r,g-h*r*c-p*r*d,m-f*r*c-v*r*d];this.width=_;this.height=y}e.prototype.clone=function(t){var r=t===void 0?{}:t,n=r.scale,a=n===void 0?this.scale:n,i=r.rotation,o=i===void 0?this.rotation:i,s=r.offsetX,l=s===void 0?this.offsetX:s,u=r.offsetY,c=u===void 0?this.offsetY:u,d=r.dontFlip,h=d===void 0?false:d;return new e({viewBox:this.viewBox.slice(),scale:a,rotation:o,offsetX:l,offsetY:c,dontFlip:h})};e.prototype.convertToViewportPoint=function(e,t){return n.Util.applyTransform([e,t],this.transform)};e.prototype.convertToViewportRectangle=function(e){var t=n.Util.applyTransform([e[0],e[1]],this.transform);var r=n.Util.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],r[0],r[1]]};e.prototype.convertToPdfPoint=function(e,t){return n.Util.applyInverseTransform([e,t],this.transform)};return e}();t.PageViewport=f;var p=function(e){__extends(t,e);function t(t,r){var n=e.call(this,t,"RenderingCancelledException")||this;n.type=r;return n}return t}(n.BaseException);t.RenderingCancelledException=p;var v={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4};t.LinkTarget=v;function g(e,t){var r=t===void 0?{}:t,a=r.url,o=r.target,s=r.rel,l=r.enabled,u=l===void 0?true:l;(0,n.assert)(a&&typeof a==="string",'addLinkAttributes: A valid "url" parameter must provided.');var c=(0,n.removeNullCharacters)(a);if(u){e.href=e.title=c}else{e.href="";e.title="Disabled: ".concat(c);e.onclick=function(){return false}}var d="";switch(o){case v.NONE:break;case v.SELF:d="_self";break;case v.BLANK:d="_blank";break;case v.PARENT:d="_parent";break;case v.TOP:d="_top";break}e.target=d;e.rel=typeof s==="string"?s:i}function m(e){var t=e.length;var r=0;while(r<t&&e[r].trim()===""){r++}return e.substring(r,r+5).toLowerCase()==="data:"}function _(e){return typeof e==="string"&&/\.pdf$/i.test(e)}function y(e){var t=e.indexOf("#");var r=e.indexOf("?");var n=Math.min(t>0?t:e.length,r>0?r:e.length);return e.substring(e.lastIndexOf("/",n)+1,n)}function b(e,t){if(t===void 0){t="document.pdf"}if(typeof e!=="string"){return t}if(m(e)){(0,n.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.');return t}var r=/^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;var a=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i;var i=r.exec(e);var o=a.exec(i[1])||a.exec(i[2])||a.exec(i[3]);if(o){o=o[0];if(o.includes("%")){try{o=a.exec(decodeURIComponent(o))[0]}catch(e){}}}return o||t}var A=function(){function e(){this.started=Object.create(null);this.times=[]}e.prototype.time=function(e){if(e in this.started){(0,n.warn)("Timer is already running for ".concat(e))}this.started[e]=Date.now()};e.prototype.timeEnd=function(e){if(!(e in this.started)){(0,n.warn)("Timer has not been started for ".concat(e))}this.times.push({name:e,start:this.started[e],end:Date.now()});delete this.started[e]};e.prototype.toString=function(){var e=[];var t=0;for(var r=0,n=this.times;r<n.length;r++){var a=n[r];var i=a.name;if(i.length>t){t=i.length}}for(var o=0,s=this.times;o<s.length;o++){var a=s[o];var l=a.end-a.start;e.push("".concat(a.name.padEnd(t)," ").concat(l,"ms\n"))}return e.join("")};return e}();t.StatTimer=A;function S(e,t){try{var r=(t?new URL(e,t):new URL(e)).protocol;return r==="http:"||r==="https:"}catch(e){return false}}function x(e,t){if(t===void 0){t=false}return new Promise((function(r,n){var a=document.createElement("script");a.src=e;a.onload=function(e){if(t){a.remove()}r(e)};a.onerror=function(){n(new Error("Cannot load script at: ".concat(a.src)))};(document.head||document.documentElement).appendChild(a)}))}function C(e){console.log("Deprecated API usage: "+e)}var P;var w=function(){function e(){}e.toDateObject=function(e){if(!e||!(0,n.isString)(e)){return null}if(!P){P=new RegExp("^D:"+"(\\d{4})"+"(\\d{2})?"+"(\\d{2})?"+"(\\d{2})?"+"(\\d{2})?"+"(\\d{2})?"+"([Z|+|-])?"+"(\\d{2})?"+"'?"+"(\\d{2})?"+"'?")}var t=P.exec(e);if(!t){return null}var r=parseInt(t[1],10);var a=parseInt(t[2],10);a=a>=1&&a<=12?a-1:0;var i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;var o=parseInt(t[4],10);o=o>=0&&o<=23?o:0;var s=parseInt(t[5],10);s=s>=0&&s<=59?s:0;var l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;var u=t[7]||"Z";var c=parseInt(t[8],10);c=c>=0&&c<=23?c:0;var d=parseInt(t[9],10)||0;d=d>=0&&d<=59?d:0;if(u==="-"){o+=c;s+=d}else if(u==="+"){o-=c;s-=d}return new Date(Date.UTC(r,a,i,o,s,l))};return e}();t.PDFDateString=w;function k(e,t){var r=t.scale,n=r===void 0?1:r,a=t.rotation,i=a===void 0?0:a;var o=e.attributes.style,s=o.width,l=o.height;var u=[0,0,parseInt(s),parseInt(l)];return new f({viewBox:u,scale:n,rotation:i})}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});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.IsLittleEndianCached=t.IsEvalSupportedCached=t.InvalidPDFException=t.ImageKind=t.IDENTITY_MATRIX=t.FormatError=t.FontType=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.AnnotationBorderStyleType=t.AnnotationActionEventType=t.AbortException=void 0;t.arrayByteLength=$;t.arraysToBytes=Z;t.assert=D;t.bytesToString=J;t.createObjectURL=xe;t.createPromiseCapability=Se;t.createValidAbsoluteUrl=N;t.escapeString=de;t.getModificationDate=Ae;t.getVerbosityLevel=F;t.info=E;t.isArrayBuffer=ye;t.isArrayEqual=be;t.isAscii=he;t.isBool=ge;t.isNum=me;t.isSameOrigin=L;t.isString=_e;t.objectFromMap=re;t.objectSize=te;t.removeNullCharacters=K;t.setVerbosityLevel=R;t.shadow=j;t.string32=ee;t.stringToBytes=Q;t.stringToPDFString=ce;t.stringToUTF16BEString=fe;t.stringToUTF8String=pe;t.unreachable=M;t.utf8StringToString=ve;t.warn=O;r(3);var n=[1,0,0,1,0,0];t.IDENTITY_MATRIX=n;var a=[.001,0,0,.001,0,0];t.FONT_IDENTITY_MATRIX=a;var i={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};t.RenderingIntentFlag=i;var o={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};t.AnnotationMode=o;var s={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.PermissionFlag=s;var l={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.TextRenderingMode=l;var u={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};t.ImageKind=u;var c={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.AnnotationType=c;var d={MARKED:"Marked",REVIEW:"Review"};t.AnnotationStateModelType=d;var h={MARKED:"Marked",UNMARKED:"Unmarked"};t.AnnotationMarkedState=h;var f={ACCEPTED:"Accepted",REJECTED:"Rejected",CANCELLED:"Cancelled",COMPLETED:"Completed",NONE:"None"};t.AnnotationReviewState=f;var p={GROUP:"Group",REPLY:"R"};t.AnnotationReplyType=p;var v={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};t.AnnotationFlag=v;var g={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.AnnotationFieldFlag=g;var m={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};t.AnnotationBorderStyleType=m;var _={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.AnnotationActionEventType=_;var y={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};t.DocumentActionEventType=y;var b={O:"PageOpen",C:"PageClose"};t.PageActionEventType=b;var A={UNKNOWN:"UNKNOWN",FLATE:"FLATE",LZW:"LZW",DCT:"DCT",JPX:"JPX",JBIG:"JBIG",A85:"A85",AHX:"AHX",CCF:"CCF",RLX:"RLX"};t.StreamType=A;var S={UNKNOWN:"UNKNOWN",TYPE1:"TYPE1",TYPE1STANDARD:"TYPE1STANDARD",TYPE1C:"TYPE1C",CIDFONTTYPE0:"CIDFONTTYPE0",CIDFONTTYPE0C:"CIDFONTTYPE0C",TRUETYPE:"TRUETYPE",CIDFONTTYPE2:"CIDFONTTYPE2",TYPE3:"TYPE3",OPENTYPE:"OPENTYPE",TYPE0:"TYPE0",MMTYPE1:"MMTYPE1"};t.FontType=S;var x={ERRORS:0,WARNINGS:1,INFOS:5};t.VerbosityLevel=x;var C={NONE:0,BINARY:1,STREAM:2};t.CMapCompressionType=C;var P={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.OPS=P;var w={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.UNSUPPORTED_FEATURES=w;var k={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};t.PasswordResponses=k;var T=x.WARNINGS;function R(e){if(Number.isInteger(e)){T=e}}function F(){return T}function E(e){if(T>=x.INFOS){console.log("Info: ".concat(e))}}function O(e){if(T>=x.WARNINGS){console.log("Warning: ".concat(e))}}function M(e){throw new Error(e)}function D(e,t){if(!e){M(t)}}function L(e,t){var r;try{r=new URL(e);if(!r.origin||r.origin==="null"){return false}}catch(e){return false}var n=new URL(t,r);return r.origin===n.origin}function I(e){if(!e){return false}switch(e.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return true;default:return false}}function N(e,t,r){if(t===void 0){t=null}if(r===void 0){r=null}if(!e){return null}try{if(r&&typeof e==="string"){if(r.addDefaultProtocol&&e.startsWith("www.")){var n=e.match(/\./g);if(n&&n.length>=2){e="http://".concat(e)}}if(r.tryConvertEncoding){try{e=pe(e)}catch(e){}}}var a=t?new URL(e,t):new URL(e);if(I(a)){return a}}catch(e){}return null}function j(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:false});return r}var U=function e(){function t(e,r){if(this.constructor===t){M("Cannot initialize BaseException.")}this.message=e;this.name=r}t.prototype=new Error;t.constructor=t;return t}();t.BaseException=U;var W=function(e){__extends(t,e);function t(t,r){var n=e.call(this,t,"PasswordException")||this;n.code=r;return n}return t}(U);t.PasswordException=W;var B=function(e){__extends(t,e);function t(t,r){var n=e.call(this,t,"UnknownErrorException")||this;n.details=r;return n}return t}(U);t.UnknownErrorException=B;var q=function(e){__extends(t,e);function t(t){return e.call(this,t,"InvalidPDFException")||this}return t}(U);t.InvalidPDFException=q;var G=function(e){__extends(t,e);function t(t){return e.call(this,t,"MissingPDFException")||this}return t}(U);t.MissingPDFException=G;var V=function(e){__extends(t,e);function t(t,r){var n=e.call(this,t,"UnexpectedResponseException")||this;n.status=r;return n}return t}(U);t.UnexpectedResponseException=V;var H=function(e){__extends(t,e);function t(t){return e.call(this,t,"FormatError")||this}return t}(U);t.FormatError=H;var z=function(e){__extends(t,e);function t(t){return e.call(this,t,"AbortException")||this}return t}(U);t.AbortException=z;var X=/\x00+/g;var Y=/[\x01-\x1F]/g;function K(e,t){if(t===void 0){t=false}if(typeof e!=="string"){O("The argument for removeNullCharacters must be a string.");return e}if(t){e=e.replace(Y," ")}return e.replace(X,"")}function J(e){D(e!==null&&typeof e==="object"&&e.length!==undefined,"Invalid argument for bytesToString");var t=e.length;var r=8192;if(t<r){return String.fromCharCode.apply(null,e)}var n=[];for(var a=0;a<t;a+=r){var i=Math.min(a+r,t);var o=e.subarray(a,i);n.push(String.fromCharCode.apply(null,o))}return n.join("")}function Q(e){D(typeof e==="string","Invalid argument for stringToBytes");var t=e.length;var r=new Uint8Array(t);for(var n=0;n<t;++n){r[n]=e.charCodeAt(n)&255}return r}function $(e){if(e.length!==undefined){return e.length}D(e.byteLength!==undefined,"arrayByteLength - invalid argument.");return e.byteLength}function Z(e){var t=e.length;if(t===1&&e[0]instanceof Uint8Array){return e[0]}var r=0;for(var n=0;n<t;n++){r+=$(e[n])}var a=0;var i=new Uint8Array(r);for(var n=0;n<t;n++){var o=e[n];if(!(o instanceof Uint8Array)){if(typeof o==="string"){o=Q(o)}else{o=new Uint8Array(o)}}var s=o.byteLength;i.set(o,a);a+=s}return i}function ee(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function te(e){return Object.keys(e).length}function re(e){var t=Object.create(null);for(var r=0,n=e;r<n.length;r++){var a=n[r],i=a[0],o=a[1];t[i]=o}return t}function ne(){var e=new Uint8Array(4);e[0]=1;var t=new Uint32Array(e.buffer,0,1);return t[0]===1}var ae={get value(){return j(this,"value",ne())}};t.IsLittleEndianCached=ae;function ie(){try{new Function("");return true}catch(e){return false}}var oe={get value(){return j(this,"value",ie())}};t.IsEvalSupportedCached=oe;var se=__spreadArray([],Array(256).keys(),true).map((function(e){return e.toString(16).padStart(2,"0")}));var le=function(){function e(){}e.makeHexColor=function(e,t,r){return"#".concat(se[e]).concat(se[t]).concat(se[r])};e.transform=function(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]]};e.applyTransform=function(e,t){var r=e[0]*t[0]+e[1]*t[2]+t[4];var n=e[0]*t[1]+e[1]*t[3]+t[5];return[r,n]};e.applyInverseTransform=function(e,t){var r=t[0]*t[3]-t[1]*t[2];var n=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/r;var a=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/r;return[n,a]};e.getAxialAlignedBoundingBox=function(t,r){var n=e.applyTransform(t,r);var a=e.applyTransform(t.slice(2,4),r);var i=e.applyTransform([t[0],t[3]],r);var o=e.applyTransform([t[2],t[1]],r);return[Math.min(n[0],a[0],i[0],o[0]),Math.min(n[1],a[1],i[1],o[1]),Math.max(n[0],a[0],i[0],o[0]),Math.max(n[1],a[1],i[1],o[1])]};e.inverseTransform=function(e){var 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]};e.apply3dTransform=function(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]]};e.singularValueDecompose2dScale=function(e){var t=[e[0],e[2],e[1],e[3]];var r=e[0]*t[0]+e[1]*t[2];var n=e[0]*t[1]+e[1]*t[3];var a=e[2]*t[0]+e[3]*t[2];var i=e[2]*t[1]+e[3]*t[3];var o=(r+i)/2;var s=Math.sqrt(Math.pow(r+i,2)-4*(r*i-a*n))/2;var l=o+s||1;var u=o-s||1;return[Math.sqrt(l),Math.sqrt(u)]};e.normalizeRect=function(e){var 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};e.intersect=function(t,r){function n(e,t){return e-t}var a=[t[0],t[2],r[0],r[2]].sort(n);var i=[t[1],t[3],r[1],r[3]].sort(n);var o=[];t=e.normalizeRect(t);r=e.normalizeRect(r);if(a[0]===t[0]&&a[1]===r[0]||a[0]===r[0]&&a[1]===t[0]){o[0]=a[1];o[2]=a[2]}else{return null}if(i[0]===t[1]&&i[1]===r[1]||i[0]===r[1]&&i[1]===t[1]){o[1]=i[1];o[3]=i[2]}else{return null}return o};e.bezierBoundingBox=function(e,t,r,n,a,i,o,s){var l=[],u=[[],[]];var c,d,h,f,p,v,g,m;for(var _=0;_<2;++_){if(_===0){d=6*e-12*r+6*a;c=-3*e+9*r-9*a+3*o;h=3*r-3*e}else{d=6*t-12*n+6*i;c=-3*t+9*n-9*i+3*s;h=3*n-3*t}if(Math.abs(c)<1e-12){if(Math.abs(d)<1e-12){continue}f=-h/d;if(0<f&&f<1){l.push(f)}continue}g=d*d-4*h*c;m=Math.sqrt(g);if(g<0){continue}p=(-d+m)/(2*c);if(0<p&&p<1){l.push(p)}v=(-d-m)/(2*c);if(0<v&&v<1){l.push(v)}}var y=l.length,b;var A=y;while(y--){f=l[y];b=1-f;u[0][y]=b*b*b*e+3*b*b*f*r+3*b*f*f*a+f*f*f*o;u[1][y]=b*b*b*t+3*b*b*f*n+3*b*f*f*i+f*f*f*s}u[0][A]=e;u[1][A]=t;u[0][A+1]=o;u[1][A+1]=s;u[0].length=u[1].length=A+2;return[Math.min.apply(Math,u[0]),Math.min.apply(Math,u[1]),Math.max.apply(Math,u[0]),Math.max.apply(Math,u[1])]};return e}();t.Util=le;var ue=[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 ce(e){var t=e.length,r=[];if(e[0]==="þ"&&e[1]==="ÿ"){for(var n=2;n<t;n+=2){r.push(String.fromCharCode(e.charCodeAt(n)<<8|e.charCodeAt(n+1)))}}else if(e[0]==="ÿ"&&e[1]==="þ"){for(var n=2;n<t;n+=2){r.push(String.fromCharCode(e.charCodeAt(n+1)<<8|e.charCodeAt(n)))}}else{for(var n=0;n<t;++n){var a=ue[e.charCodeAt(n)];r.push(a?String.fromCharCode(a):e.charAt(n))}}return r.join("")}function de(e){return e.replace(/([()\\\n\r])/g,(function(e){if(e==="\n"){return"\\n"}else if(e==="\r"){return"\\r"}return"\\".concat(e)}))}function he(e){return/^[\x00-\x7F]*$/.test(e)}function fe(e){var t=["þÿ"];for(var r=0,n=e.length;r<n;r++){var a=e.charCodeAt(r);t.push(String.fromCharCode(a>>8&255),String.fromCharCode(a&255))}return t.join("")}function pe(e){return decodeURIComponent(escape(e))}function ve(e){return unescape(encodeURIComponent(e))}function ge(e){return typeof e==="boolean"}function me(e){return typeof e==="number"}function _e(e){return typeof e==="string"}function ye(e){return typeof e==="object"&&e!==null&&e.byteLength!==undefined}function be(e,t){if(e.length!==t.length){return false}for(var r=0,n=e.length;r<n;r++){if(e[r]!==t[r]){return false}}return true}function Ae(e){if(e===void 0){e=new Date}var 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("")}function Se(){var e=Object.create(null);var t=false;Object.defineProperty(e,"settled",{get:function(){return t}});e.promise=new Promise((function(r,n){e.resolve=function(e){t=true;r(e)};e.reject=function(e){t=true;n(e)}}));return e}function xe(e,t,r){if(t===void 0){t=""}if(r===void 0){r=false}if(URL.createObjectURL&&typeof Blob!=="undefined"&&!r){return URL.createObjectURL(new Blob([e],{type:t}))}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var a="data:".concat(t,";base64,");for(var i=0,o=e.length;i<o;i+=3){var s=e[i]&255;var l=e[i+1]&255;var u=e[i+2]&255;var c=s>>2,d=(s&3)<<4|l>>4;var h=i+1<o?(l&15)<<2|u>>6:64;var f=i+2<o?u&63:64;a+=n[c]+n[d]+n[h]+n[f]}return a}},function(e,t,r){var n=r(4)},function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.isNodeJS=void 0;var r=typeof process_1==="object"&&process_1+""==="[object process]"&&!process_1.versions.nw&&!(process_1.versions.electron&&process_1.type&&process_1.type!=="browser");t.isNodeJS=r},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.BaseStandardFontDataFactory=t.BaseSVGFactory=t.BaseCanvasFactory=t.BaseCMapReaderFactory=void 0;var n=r(2);var a=function(){function e(){if(this.constructor===e){(0,n.unreachable)("Cannot initialize BaseCanvasFactory.")}}e.prototype.create=function(e,t){if(e<=0||t<=0){throw new Error("Invalid canvas size")}var r=this._createCanvas(e,t);return{canvas:r,context:r.getContext("2d")}};e.prototype.reset=function(e,t,r){if(!e.canvas){throw new Error("Canvas is not specified")}if(t<=0||r<=0){throw new Error("Invalid canvas size")}e.canvas.width=t;e.canvas.height=r};e.prototype.destroy=function(e){if(!e.canvas){throw new Error("Canvas is not specified")}e.canvas.width=0;e.canvas.height=0;e.canvas=null;e.context=null};e.prototype._createCanvas=function(e,t){(0,n.unreachable)("Abstract method `_createCanvas` called.")};return e}();t.BaseCanvasFactory=a;var i=function(){function e(t){var r=t.baseUrl,a=r===void 0?null:r,i=t.isCompressed,o=i===void 0?false:i;if(this.constructor===e){(0,n.unreachable)("Cannot initialize BaseCMapReaderFactory.")}this.baseUrl=a;this.isCompressed=o}e.prototype.fetch=function(e){var t=e.name;return __awaiter(this,void 0,void 0,(function(){var e,r;var a=this;return __generator(this,(function(i){if(!this.baseUrl){throw new Error('The CMap "baseUrl" parameter must be specified, ensure that '+'the "cMapUrl" and "cMapPacked" API parameters are provided.')}if(!t){throw new Error("CMap name must be specified.")}e=this.baseUrl+t+(this.isCompressed?".bcmap":"");r=this.isCompressed?n.CMapCompressionType.BINARY:n.CMapCompressionType.NONE;return[2,this._fetchData(e,r).catch((function(t){throw new Error("Unable to load ".concat(a.isCompressed?"binary ":"","CMap at: ").concat(e))}))]}))}))};e.prototype._fetchData=function(e,t){(0,n.unreachable)("Abstract method `_fetchData` called.")};return e}();t.BaseCMapReaderFactory=i;var o=function(){function e(t){var r=t.baseUrl,a=r===void 0?null:r;if(this.constructor===e){(0,n.unreachable)("Cannot initialize BaseStandardFontDataFactory.")}this.baseUrl=a}e.prototype.fetch=function(e){var t=e.filename;return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){if(!this.baseUrl){throw new Error('The standard font "baseUrl" parameter must be specified, ensure that '+'the "standardFontDataUrl" API parameter is provided.')}if(!t){throw new Error("Font filename must be specified.")}e="".concat(this.baseUrl).concat(t);return[2,this._fetchData(e).catch((function(t){throw new Error("Unable to load font data at: ".concat(e))}))]}))}))};e.prototype._fetchData=function(e){(0,n.unreachable)("Abstract method `_fetchData` called.")};return e}();t.BaseStandardFontDataFactory=o;var s=function(){function e(){if(this.constructor===e){(0,n.unreachable)("Cannot initialize BaseSVGFactory.")}}e.prototype.create=function(e,t){if(e<=0||t<=0){throw new Error("Invalid SVG dimensions")}var r=this._createSVG("svg:svg");r.setAttribute("version","1.1");r.setAttribute("width","".concat(e,"px"));r.setAttribute("height","".concat(t,"px"));r.setAttribute("preserveAspectRatio","none");r.setAttribute("viewBox","0 0 ".concat(e," ").concat(t));return r};e.prototype.createElement=function(e){if(typeof e!=="string"){throw new Error("Invalid SVG element type")}return this._createSVG(e)};e.prototype._createSVG=function(e){(0,n.unreachable)("Abstract method `_createSVG` called.")};return e}();t.BaseSVGFactory=s},function(__unused_webpack_module,exports,__w_pdfjs_require__){var _a;var _WorkerTransport_docStats,_WorkerTransport_pageCache,_WorkerTransport_pagePromises,_WorkerTransport_metadataPromise;Object.defineProperty(exports,"__esModule",{value:true});exports.build=exports.RenderTask=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__(2);var _display_utils=__w_pdfjs_require__(1);var _font_loader=__w_pdfjs_require__(7);var _node_utils=__w_pdfjs_require__(8);var _annotation_storage=__w_pdfjs_require__(9);var _canvas=__w_pdfjs_require__(10);var _worker_options=__w_pdfjs_require__(12);var _is_node=__w_pdfjs_require__(4);var _message_handler=__w_pdfjs_require__(13);var _metadata=__w_pdfjs_require__(14);var _optional_content_config=__w_pdfjs_require__(15);var _transport_stream=__w_pdfjs_require__(16);var _xfa_text=__w_pdfjs_require__(17);var DEFAULT_RANGE_CHUNK_SIZE=65536;var RENDERING_CANCELLED_TIMEOUT=100;var 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;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;var createPDFNetworkStream;function setPDFNetworkStreamFactory(e){createPDFNetworkStream=e}function getDocument(e){var t=new PDFDocumentLoadingTask;var r;if(typeof e==="string"||e instanceof URL){r={url:e}}else if((0,_util.isArrayBuffer)(e)){r={data:e}}else if(e instanceof PDFDataRangeTransport){r={range:e}}else{if(typeof e!=="object"){throw new Error("Invalid parameter in getDocument, "+"need either string, URL, Uint8Array, or parameter object.")}if(!e.url&&!e.data&&!e.range){throw new Error("Invalid parameter object: need either .data, .range or .url")}r=e}var n=Object.create(null);var a=null,i=null;for(var o in r){var s=r[o];switch(o){case"url":if(typeof window!=="undefined"){try{n[o]=new URL(s,window.location).href;continue}catch(e){(0,_util.warn)('Cannot create valid URL: "'.concat(e,'".'))}}else if(typeof s==="string"||s instanceof URL){n[o]=s.toString();continue}throw new Error("Invalid PDF url data: "+"either string or URL-object is expected in the url property.");case"range":a=s;continue;case"worker":i=s;continue;case"data":if(_is_node.isNodeJS&&typeof Buffer!=="undefined"&&s instanceof Buffer){n[o]=new Uint8Array(s)}else if(s instanceof Uint8Array){break}else if(typeof s==="string"){n[o]=(0,_util.stringToBytes)(s)}else if(typeof s==="object"&&s!==null&&!isNaN(s.length)){n[o]=new Uint8Array(s)}else if((0,_util.isArrayBuffer)(s)){n[o]=new Uint8Array(s)}else{throw new Error("Invalid PDF binary data: either typed array, "+"string, or array-like object is expected in the data property.")}continue}n[o]=s}n.rangeChunkSize=n.rangeChunkSize||DEFAULT_RANGE_CHUNK_SIZE;n.CMapReaderFactory=n.CMapReaderFactory||DefaultCMapReaderFactory;n.StandardFontDataFactory=n.StandardFontDataFactory||DefaultStandardFontDataFactory;n.ignoreErrors=n.stopAtErrors!==true;n.fontExtraProperties=n.fontExtraProperties===true;n.pdfBug=n.pdfBug===true;n.enableXfa=n.enableXfa===true;if(typeof n.docBaseUrl!=="string"||(0,_display_utils.isDataScheme)(n.docBaseUrl)){n.docBaseUrl=null}if(!Number.isInteger(n.maxImageSize)){n.maxImageSize=-1}if(typeof n.useWorkerFetch!=="boolean"){n.useWorkerFetch=n.CMapReaderFactory===_display_utils.DOMCMapReaderFactory&&n.StandardFontDataFactory===_display_utils.DOMStandardFontDataFactory}if(typeof n.isEvalSupported!=="boolean"){n.isEvalSupported=true}if(typeof n.disableFontFace!=="boolean"){n.disableFontFace=_is_node.isNodeJS}if(typeof n.useSystemFonts!=="boolean"){n.useSystemFonts=!_is_node.isNodeJS&&!n.disableFontFace}if(typeof n.ownerDocument==="undefined"){n.ownerDocument=globalThis.document}if(typeof n.disableRange!=="boolean"){n.disableRange=false}if(typeof n.disableStream!=="boolean"){n.disableStream=false}if(typeof n.disableAutoFetch!=="boolean"){n.disableAutoFetch=false}(0,_util.setVerbosityLevel)(n.verbosity);if(!i){var l={verbosity:n.verbosity,port:_worker_options.GlobalWorkerOptions.workerPort};i=l.port?PDFWorker.fromPort(l):new PDFWorker(l);t._worker=i}var u=t.docId;i.promise.then((function(){if(t.destroyed){throw new Error("Loading aborted")}var e=_fetchDocument(i,n,a,u);var r=new Promise((function(e){var t;if(a){t=new _transport_stream.PDFDataTransportStream({length:n.length,initialData:n.initialData,progressiveDone:n.progressiveDone,contentDispositionFilename:n.contentDispositionFilename,disableRange:n.disableRange,disableStream:n.disableStream},a)}else if(!n.data){t=createPDFNetworkStream({url:n.url,length:n.length,httpHeaders:n.httpHeaders,withCredentials:n.withCredentials,rangeChunkSize:n.rangeChunkSize,disableRange:n.disableRange,disableStream:n.disableStream})}e(t)}));return Promise.all([e,r]).then((function(e){var r=e[0],a=e[1];if(t.destroyed){throw new Error("Loading aborted")}var o=new _message_handler.MessageHandler(u,r,i.port);var s=new WorkerTransport(o,t,a,n);t._transport=s;o.send("Ready",null)}))})).catch(t._capability.reject);return t}function _fetchDocument(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var a;return __generator(this,(function(i){switch(i.label){case 0:if(e.destroyed){throw new Error("Worker was destroyed")}if(r){t.length=r.length;t.initialData=r.initialData;t.progressiveDone=r.progressiveDone;t.contentDispositionFilename=r.contentDispositionFilename}return[4,e.messageHandler.sendWithPromise("GetDocRequest",{docId:n,apiVersion:"2.12.313",source:{data:t.data,url:t.url,password:t.password,disableAutoFetch:t.disableAutoFetch,rangeChunkSize:t.rangeChunkSize,length:t.length},maxImageSize:t.maxImageSize,disableFontFace:t.disableFontFace,docBaseUrl:t.docBaseUrl,ignoreErrors:t.ignoreErrors,isEvalSupported:t.isEvalSupported,fontExtraProperties:t.fontExtraProperties,enableXfa:t.enableXfa,useSystemFonts:t.useSystemFonts,cMapUrl:t.useWorkerFetch?t.cMapUrl:null,standardFontDataUrl:t.useWorkerFetch?t.standardFontDataUrl:null})];case 1:a=i.sent();if(e.destroyed){throw new Error("Worker was destroyed")}return[2,a]}}))}))}var PDFDocumentLoadingTask=function(){function e(){this._capability=(0,_util.createPromiseCapability)();this._transport=null;this._worker=null;this.docId="d".concat(e.idCounters.doc++);this.destroyed=false;this.onPassword=null;this.onProgress=null;this.onUnsupportedFeature=null}Object.defineProperty(e,"idCounters",{get:function(){return(0,_util.shadow)(this,"idCounters",{doc:0})},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"promise",{get:function(){return this._capability.promise},enumerable:false,configurable:true});e.prototype.destroy=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.destroyed=true;return[4,(e=this._transport)===null||e===void 0?void 0:e.destroy()];case 1:t.sent();this._transport=null;if(this._worker){this._worker.destroy();this._worker=null}return[2]}}))}))};return e}();exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;var PDFDataRangeTransport=function(){function e(e,t,r,n){if(r===void 0){r=false}if(n===void 0){n=null}this.length=e;this.initialData=t;this.progressiveDone=r;this.contentDispositionFilename=n;this._rangeListeners=[];this._progressListeners=[];this._progressiveReadListeners=[];this._progressiveDoneListeners=[];this._readyCapability=(0,_util.createPromiseCapability)()}e.prototype.addRangeListener=function(e){this._rangeListeners.push(e)};e.prototype.addProgressListener=function(e){this._progressListeners.push(e)};e.prototype.addProgressiveReadListener=function(e){this._progressiveReadListeners.push(e)};e.prototype.addProgressiveDoneListener=function(e){this._progressiveDoneListeners.push(e)};e.prototype.onDataRange=function(e,t){for(var r=0,n=this._rangeListeners;r<n.length;r++){var a=n[r];a(e,t)}};e.prototype.onDataProgress=function(e,t){var r=this;this._readyCapability.promise.then((function(){for(var n=0,a=r._progressListeners;n<a.length;n++){var i=a[n];i(e,t)}}))};e.prototype.onDataProgressiveRead=function(e){var t=this;this._readyCapability.promise.then((function(){for(var r=0,n=t._progressiveReadListeners;r<n.length;r++){var a=n[r];a(e)}}))};e.prototype.onDataProgressiveDone=function(){var e=this;this._readyCapability.promise.then((function(){for(var t=0,r=e._progressiveDoneListeners;t<r.length;t++){var n=r[t];n()}}))};e.prototype.transportReady=function(){this._readyCapability.resolve()};e.prototype.requestDataRange=function(e,t){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")};e.prototype.abort=function(){};return e}();exports.PDFDataRangeTransport=PDFDataRangeTransport;var PDFDocumentProxy=function(){function e(e,t){var r=this;this._pdfInfo=e;this._transport=t;Object.defineProperty(this,"fingerprint",{get:function(){(0,_display_utils.deprecated)("`PDFDocumentProxy.fingerprint`, "+"please use `PDFDocumentProxy.fingerprints` instead.");return this.fingerprints[0]}});Object.defineProperty(this,"getStats",{value:function(){return __awaiter(r,void 0,void 0,(function(){return __generator(this,(function(e){(0,_display_utils.deprecated)("`PDFDocumentProxy.getStats`, "+"please use the `PDFDocumentProxy.stats`-getter instead.");return[2,this.stats||{streamTypes:{},fontTypes:{}}]}))}))}})}Object.defineProperty(e.prototype,"annotationStorage",{get:function(){return this._transport.annotationStorage},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"numPages",{get:function(){return this._pdfInfo.numPages},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"fingerprints",{get:function(){return this._pdfInfo.fingerprints},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"stats",{get:function(){return this._transport.stats},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isPureXfa",{get:function(){return!!this._transport._htmlForXfa},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"allXfaHtml",{get:function(){return this._transport._htmlForXfa},enumerable:false,configurable:true});e.prototype.getPage=function(e){return this._transport.getPage(e)};e.prototype.getPageIndex=function(e){return this._transport.getPageIndex(e)};e.prototype.getDestinations=function(){return this._transport.getDestinations()};e.prototype.getDestination=function(e){return this._transport.getDestination(e)};e.prototype.getPageLabels=function(){return this._transport.getPageLabels()};e.prototype.getPageLayout=function(){return this._transport.getPageLayout()};e.prototype.getPageMode=function(){return this._transport.getPageMode()};e.prototype.getViewerPreferences=function(){return this._transport.getViewerPreferences()};e.prototype.getOpenAction=function(){return this._transport.getOpenAction()};e.prototype.getAttachments=function(){return this._transport.getAttachments()};e.prototype.getJavaScript=function(){return this._transport.getJavaScript()};e.prototype.getJSActions=function(){return this._transport.getDocJSActions()};e.prototype.getOutline=function(){return this._transport.getOutline()};e.prototype.getOptionalContentConfig=function(){return this._transport.getOptionalContentConfig()};e.prototype.getPermissions=function(){return this._transport.getPermissions()};e.prototype.getMetadata=function(){return this._transport.getMetadata()};e.prototype.getMarkInfo=function(){return this._transport.getMarkInfo()};e.prototype.getData=function(){return this._transport.getData()};e.prototype.getDownloadInfo=function(){return this._transport.downloadInfoCapability.promise};e.prototype.cleanup=function(e){if(e===void 0){e=false}return this._transport.startCleanup(e||this.isPureXfa)};e.prototype.destroy=function(){return this.loadingTask.destroy()};Object.defineProperty(e.prototype,"loadingParams",{get:function(){return this._transport.loadingParams},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"loadingTask",{get:function(){return this._transport.loadingTask},enumerable:false,configurable:true});e.prototype.saveDocument=function(){if(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()};e.prototype.getFieldObjects=function(){return this._transport.getFieldObjects()};e.prototype.hasJSActions=function(){return this._transport.hasJSActions()};e.prototype.getCalculationOrderIds=function(){return this._transport.getCalculationOrderIds()};return e}();exports.PDFDocumentProxy=PDFDocumentProxy;var PDFPageProxy=function(){function e(e,t,r,n,a){if(a===void 0){a=false}this._pageIndex=e;this._pageInfo=t;this._ownerDocument=n;this._transport=r;this._stats=a?new _display_utils.StatTimer:null;this._pdfBug=a;this.commonObjs=r.commonObjs;this.objs=new PDFObjects;this.cleanupAfterRender=false;this.pendingCleanup=false;this._intentStates=new Map;this._annotationPromises=new Map;this.destroyed=false}Object.defineProperty(e.prototype,"pageNumber",{get:function(){return this._pageIndex+1},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"rotate",{get:function(){return this._pageInfo.rotate},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"ref",{get:function(){return this._pageInfo.ref},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"userUnit",{get:function(){return this._pageInfo.userUnit},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"view",{get:function(){return this._pageInfo.view},enumerable:false,configurable:true});e.prototype.getViewport=function(e){var t=e===void 0?{}:e,r=t.scale,n=t.rotation,a=n===void 0?this.rotate:n,i=t.offsetX,o=i===void 0?0:i,s=t.offsetY,l=s===void 0?0:s,u=t.dontFlip,c=u===void 0?false:u;return new _display_utils.PageViewport({viewBox:this.view,scale:r,rotation:a,offsetX:o,offsetY:l,dontFlip:c})};e.prototype.getAnnotations=function(e){var t=e===void 0?{}:e,r=t.intent,n=r===void 0?"display":r;var a=this._transport.getRenderingIntent(n);var i=this._annotationPromises.get(a.cacheKey);if(!i){i=this._transport.getAnnotations(this._pageIndex,a.renderingIntent);this._annotationPromises.set(a.cacheKey,i);i=i.then((function(e){var t=function(e){if(e.titleObj!==undefined){Object.defineProperty(e,"title",{get:function(){(0,_display_utils.deprecated)("`title`-property on annotation, please use `titleObj` instead.");return e.titleObj.str}})}if(e.contentsObj!==undefined){Object.defineProperty(e,"contents",{get:function(){(0,_display_utils.deprecated)("`contents`-property on annotation, please use `contentsObj` instead.");return e.contentsObj.str}})}};for(var r=0,n=e;r<n.length;r++){var a=n[r];t(a)}return e}))}return i};e.prototype.getJSActions=function(){return this._jsActionsPromise||(this._jsActionsPromise=this._transport.getPageJSActions(this._pageIndex))};e.prototype.getXfa=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,((e=this._transport._htmlForXfa)===null||e===void 0?void 0:e.children[this._pageIndex])||null]}))}))};e.prototype.render=function(e){var t=this;var r,n;var a=e.canvasContext,i=e.viewport,o=e.intent,s=o===void 0?"display":o,l=e.annotationMode,u=l===void 0?_util.AnnotationMode.ENABLE:l,c=e.transform,d=c===void 0?null:c,h=e.imageLayer,f=h===void 0?null:h,p=e.canvasFactory,v=p===void 0?null:p,g=e.background,m=g===void 0?null:g,_=e.optionalContentConfigPromise,y=_===void 0?null:_,b=e.annotationCanvasMap,A=b===void 0?null:b;if(((r=arguments[0])===null||r===void 0?void 0:r.renderInteractiveForms)!==undefined){(0,_display_utils.deprecated)("render no longer accepts the `renderInteractiveForms`-option, "+"please use the `annotationMode`-option instead.");if(arguments[0].renderInteractiveForms===true&&u===_util.AnnotationMode.ENABLE){u=_util.AnnotationMode.ENABLE_FORMS}}if(((n=arguments[0])===null||n===void 0?void 0:n.includeAnnotationStorage)!==undefined){(0,_display_utils.deprecated)("render no longer accepts the `includeAnnotationStorage`-option, "+"please use the `annotationMode`-option instead.");if(arguments[0].includeAnnotationStorage===true&&u===_util.AnnotationMode.ENABLE){u=_util.AnnotationMode.ENABLE_STORAGE}}if(this._stats){this._stats.time("Overall")}var S=this._transport.getRenderingIntent(s,u);this.pendingCleanup=false;if(!y){y=this._transport.getOptionalContentConfig()}var x=this._intentStates.get(S.cacheKey);if(!x){x=Object.create(null);this._intentStates.set(S.cacheKey,x)}if(x.streamReaderCancelTimeout){clearTimeout(x.streamReaderCancelTimeout);x.streamReaderCancelTimeout=null}var C=v||new DefaultCanvasFactory({ownerDocument:this._ownerDocument});var P=!!(S.renderingIntent&_util.RenderingIntentFlag.PRINT);if(!x.displayReadyCapability){x.displayReadyCapability=(0,_util.createPromiseCapability)();x.operatorList={fnArray:[],argsArray:[],lastChunk:false};if(this._stats){this._stats.time("Page Request")}this._pumpOperatorList(S)}var w=function(e){x.renderTasks.delete(k);if(t.cleanupAfterRender||P){t.pendingCleanup=true}t._tryCleanup();if(e){k.capability.reject(e);t._abortOperatorList({intentState:x,reason:e instanceof Error?e:new Error(e)})}else{k.capability.resolve()}if(t._stats){t._stats.timeEnd("Rendering");t._stats.timeEnd("Overall")}};var k=new InternalRenderTask({callback:w,params:{canvasContext:a,viewport:i,transform:d,imageLayer:f,background:m},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:A,operatorList:x.operatorList,pageIndex:this._pageIndex,canvasFactory:C,useRequestAnimationFrame:!P,pdfBug:this._pdfBug});(x.renderTasks||(x.renderTasks=new Set)).add(k);var T=k.task;Promise.all([x.displayReadyCapability.promise,y]).then((function(e){var r=e[0],n=e[1];if(t.pendingCleanup){w();return}if(t._stats){t._stats.time("Rendering")}k.initializeGraphics({transparency:r,optionalContentConfig:n});k.operatorListChanged()})).catch(w);return T};e.prototype.getOperatorList=function(e){var t=e===void 0?{}:e,r=t.intent,n=r===void 0?"display":r,a=t.annotationMode,i=a===void 0?_util.AnnotationMode.ENABLE:a;function o(){if(l.operatorList.lastChunk){l.opListReadCapability.resolve(l.operatorList);l.renderTasks.delete(u)}}var s=this._transport.getRenderingIntent(n,i,true);var l=this._intentStates.get(s.cacheKey);if(!l){l=Object.create(null);this._intentStates.set(s.cacheKey,l)}var u;if(!l.opListReadCapability){u=Object.create(null);u.operatorListChanged=o;l.opListReadCapability=(0,_util.createPromiseCapability)();(l.renderTasks||(l.renderTasks=new Set)).add(u);l.operatorList={fnArray:[],argsArray:[],lastChunk:false};if(this._stats){this._stats.time("Page Request")}this._pumpOperatorList(s)}return l.opListReadCapability.promise};e.prototype.streamTextContent=function(e){var t=e===void 0?{}:e,r=t.normalizeWhitespace,n=r===void 0?false:r,a=t.disableCombineTextItems,i=a===void 0?false:a,o=t.includeMarkedContent,s=o===void 0?false:o;var l=100;return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,normalizeWhitespace:n===true,combineTextItems:i!==true,includeMarkedContent:s===true},{highWaterMark:l,size:function(e){return e.items.length}})};e.prototype.getTextContent=function(e){if(e===void 0){e={}}if(this._transport._htmlForXfa){return this.getXfa().then((function(e){return _xfa_text.XfaText.textContent(e)}))}var t=this.streamTextContent(e);return new Promise((function(e,r){function n(){a.read().then((function(t){var r;var a=t.value,o=t.done;if(o){e(i);return}Object.assign(i.styles,a.styles);(r=i.items).push.apply(r,a.items);n()}),r)}var a=t.getReader();var i={items:[],styles:Object.create(null)};n()}))};e.prototype.getStructTree=function(){return this._structTreePromise||(this._structTreePromise=this._transport.getStructTree(this._pageIndex))};e.prototype._destroy=function(){this.destroyed=true;var e=[];for(var t=0,r=this._intentStates.values();t<r.length;t++){var n=r[t];this._abortOperatorList({intentState:n,reason:new Error("Page was destroyed."),force:true});if(n.opListReadCapability){continue}for(var a=0,i=n.renderTasks;a<i.length;a++){var o=i[a];e.push(o.completed);o.cancel()}}this.objs.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;this.pendingCleanup=false;return Promise.all(e)};e.prototype.cleanup=function(e){if(e===void 0){e=false}this.pendingCleanup=true;return this._tryCleanup(e)};e.prototype._tryCleanup=function(e){if(e===void 0){e=false}if(!this.pendingCleanup){return false}for(var t=0,r=this._intentStates.values();t<r.length;t++){var n=r[t],a=n.renderTasks,i=n.operatorList;if(a.size>0||!i.lastChunk){return false}}this._intentStates.clear();this.objs.clear();this._annotationPromises.clear();this._jsActionsPromise=null;this._structTreePromise=null;if(e&&this._stats){this._stats=new _display_utils.StatTimer}this.pendingCleanup=false;return true};e.prototype._startRenderPage=function(e,t){var r=this._intentStates.get(t);if(!r){return}if(this._stats){this._stats.timeEnd("Page Request")}if(r.displayReadyCapability){r.displayReadyCapability.resolve(e)}};e.prototype._renderPageChunk=function(e,t){for(var r=0,n=e.length;r<n;r++){t.operatorList.fnArray.push(e.fnArray[r]);t.operatorList.argsArray.push(e.argsArray[r])}t.operatorList.lastChunk=e.lastChunk;for(var a=0,i=t.renderTasks;a<i.length;a++){var o=i[a];o.operatorListChanged()}if(e.lastChunk){this._tryCleanup()}};e.prototype._pumpOperatorList=function(e){var t=this;var r=e.renderingIntent,n=e.cacheKey;var a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:r,cacheKey:n,annotationStorage:r&_util.RenderingIntentFlag.ANNOTATIONS_STORAGE?this._transport.annotationStorage.serializable:null});var i=a.getReader();var o=this._intentStates.get(n);o.streamReader=i;var s=function(){i.read().then((function(e){var r=e.value,n=e.done;if(n){o.streamReader=null;return}if(t._transport.destroyed){return}t._renderPageChunk(r,o);s()}),(function(e){o.streamReader=null;if(t._transport.destroyed){return}if(o.operatorList){o.operatorList.lastChunk=true;for(var r=0,n=o.renderTasks;r<n.length;r++){var a=n[r];a.operatorListChanged()}t._tryCleanup()}if(o.displayReadyCapability){o.displayReadyCapability.reject(e)}else if(o.opListReadCapability){o.opListReadCapability.reject(e)}else{throw e}}))};s()};e.prototype._abortOperatorList=function(e){var t=this;var r=e.intentState,n=e.reason,a=e.force,i=a===void 0?false:a;if(!r.streamReader){return}if(!i){if(r.renderTasks.size>0){return}if(n instanceof _display_utils.RenderingCancelledException){r.streamReaderCancelTimeout=setTimeout((function(){t._abortOperatorList({intentState:r,reason:n,force:true});r.streamReaderCancelTimeout=null}),RENDERING_CANCELLED_TIMEOUT);return}}r.streamReader.cancel(new _util.AbortException(n.message)).catch((function(){}));r.streamReader=null;if(this._transport.destroyed){return}for(var o=0,s=this._intentStates;o<s.length;o++){var l=s[o],u=l[0],c=l[1];if(c===r){this._intentStates.delete(u);break}}this.cleanup()};Object.defineProperty(e.prototype,"stats",{get:function(){return this._stats},enumerable:false,configurable:true});return e}();exports.PDFPageProxy=PDFPageProxy;var LoopbackPort=function(){function e(){this._listeners=[];this._deferred=Promise.resolve()}e.prototype.postMessage=function(e,t){var r=this;function n(e){if(globalThis.structuredClone){return globalThis.structuredClone(e,t)}function r(e){var a;if(typeof e==="function"||typeof e==="symbol"||e instanceof URL){throw new Error("LoopbackPort.postMessage - cannot clone: ".concat(e===null||e===void 0?void 0:e.toString()))}if(typeof e!=="object"||e===null){return e}if(n.has(e)){return n.get(e)}var i,o;if((i=e.buffer)&&(0,_util.isArrayBuffer)(i)){if(t===null||t===void 0?void 0:t.includes(i)){o=new e.constructor(i,e.byteOffset,e.byteLength)}else{o=new e.constructor(e)}n.set(e,o);return o}if(e instanceof Map){o=new Map;n.set(e,o);for(var s=0,l=e;s<l.length;s++){var u=l[s],c=u[0],d=u[1];o.set(c,r(d))}return o}if(e instanceof Set){o=new Set;n.set(e,o);for(var h=0,f=e;h<f.length;h++){var d=f[h];o.add(r(d))}return o}o=Array.isArray(e)?[]:Object.create(null);n.set(e,o);for(var p in e){var v=void 0,g=e;while(!(v=Object.getOwnPropertyDescriptor(g,p))){g=Object.getPrototypeOf(g)}if(typeof v.value==="undefined"){continue}if(typeof v.value==="function"&&!((a=e.hasOwnProperty)===null||a===void 0?void 0:a.call(e,p))){continue}o[p]=r(v.value)}return o}var n=new WeakMap;return r(e)}var a={data:n(e)};this._deferred.then((function(){for(var e=0,t=r._listeners;e<t.length;e++){var n=t[e];n.call(r,a)}}))};e.prototype.addEventListener=function(e,t){this._listeners.push(t)};e.prototype.removeEventListener=function(e,t){var r=this._listeners.indexOf(t);this._listeners.splice(r,1)};e.prototype.terminate=function(){this._listeners.length=0};return e}();exports.LoopbackPort=LoopbackPort;var PDFWorkerUtil={isWorkerDisabled:false,fallbackWorkerSrc:null,fakeWorkerId:0};{if(_is_node.isNodeJS&&typeof commonjsRequire==="function"){PDFWorkerUtil.isWorkerDisabled=true;PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js"}else if(typeof document==="object"){var pdfjsFilePath=(_a=document===null||document===void 0?void 0:document.currentScript)===null||_a===void 0?void 0:_a.src;if(pdfjsFilePath){PDFWorkerUtil.fallbackWorkerSrc=pdfjsFilePath.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2")}}PDFWorkerUtil.createCDNWrapper=function(e){var t='importScripts("'.concat(e,'");');return URL.createObjectURL(new Blob([t]))}}var PDFWorker=function(){function PDFWorker(e){var t=e===void 0?{}:e,r=t.name,n=r===void 0?null:r,a=t.port,i=a===void 0?null:a,o=t.verbosity,s=o===void 0?(0,_util.getVerbosityLevel)():o;if(i&&PDFWorker._workerPorts.has(i)){throw new Error("Cannot use more than one PDFWorker per port.")}this.name=n;this.destroyed=false;this.verbosity=s;this._readyCapability=(0,_util.createPromiseCapability)();this._port=null;this._webWorker=null;this._messageHandler=null;if(i){PDFWorker._workerPorts.set(i,this);this._initializeFromPort(i);return}this._initialize()}Object.defineProperty(PDFWorker,"_workerPorts",{get:function(){return(0,_util.shadow)(this,"_workerPorts",new WeakMap)},enumerable:false,configurable:true});Object.defineProperty(PDFWorker.prototype,"promise",{get:function(){return this._readyCapability.promise},enumerable:false,configurable:true});Object.defineProperty(PDFWorker.prototype,"port",{get:function(){return this._port},enumerable:false,configurable:true});Object.defineProperty(PDFWorker.prototype,"messageHandler",{get:function(){return this._messageHandler},enumerable:false,configurable:true});PDFWorker.prototype._initializeFromPort=function(e){this._port=e;this._messageHandler=new _message_handler.MessageHandler("main","worker",e);this._messageHandler.on("ready",(function(){}));this._readyCapability.resolve()};PDFWorker.prototype._initialize=function(){var e=this;if(typeof Worker!=="undefined"&&!PDFWorkerUtil.isWorkerDisabled&&!PDFWorker._mainThreadWorkerMessageHandler){var t=PDFWorker.workerSrc;try{if(!(0,_util.isSameOrigin)(window.location.href,t)){t=PDFWorkerUtil.createCDNWrapper(new URL(t,window.location).href)}var r=new Worker(t);var n=new _message_handler.MessageHandler("main","worker",r);var a=function(){r.removeEventListener("error",i);n.destroy();r.terminate();if(e.destroyed){e._readyCapability.reject(new Error("Worker was destroyed"))}else{e._setupFakeWorker()}};var i=function(){if(!e._webWorker){a()}};r.addEventListener("error",i);n.on("test",(function(t){r.removeEventListener("error",i);if(e.destroyed){a();return}if(t){e._messageHandler=n;e._port=r;e._webWorker=r;e._readyCapability.resolve();n.send("configure",{verbosity:e.verbosity})}else{e._setupFakeWorker();n.destroy();r.terminate()}}));n.on("ready",(function(t){r.removeEventListener("error",i);if(e.destroyed){a();return}try{o()}catch(t){e._setupFakeWorker()}}));var o=function(){var e=new Uint8Array([255]);try{n.send("test",e,[e.buffer])}catch(t){(0,_util.warn)("Cannot use postMessage transfers.");e[0]=0;n.send("test",e)}};o();return}catch(e){(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()};PDFWorker.prototype._setupFakeWorker=function(){var e=this;if(!PDFWorkerUtil.isWorkerDisabled){(0,_util.warn)("Setting up fake worker.");PDFWorkerUtil.isWorkerDisabled=true}PDFWorker._setupFakeWorkerGlobal.then((function(t){if(e.destroyed){e._readyCapability.reject(new Error("Worker was destroyed"));return}var r=new LoopbackPort;e._port=r;var n="fake".concat(PDFWorkerUtil.fakeWorkerId++);var a=new _message_handler.MessageHandler(n+"_worker",n,r);t.setup(a,r);var i=new _message_handler.MessageHandler(n,n+"_worker",r);e._messageHandler=i;e._readyCapability.resolve();i.send("configure",{verbosity:e.verbosity})})).catch((function(t){e._readyCapability.reject(new Error('Setting up fake worker failed: "'.concat(t.message,'".')))}))};PDFWorker.prototype.destroy=function(){this.destroyed=true;if(this._webWorker){this._webWorker.terminate();this._webWorker=null}PDFWorker._workerPorts.delete(this._port);this._port=null;if(this._messageHandler){this._messageHandler.destroy();this._messageHandler=null}};PDFWorker.fromPort=function(e){if(!(e===null||e===void 0?void 0:e.port)){throw new Error("PDFWorker.fromPort - invalid method signature.")}if(this._workerPorts.has(e.port)){return this._workerPorts.get(e.port)}return new PDFWorker(e)};Object.defineProperty(PDFWorker,"workerSrc",{get:function(){if(_worker_options.GlobalWorkerOptions.workerSrc){return _worker_options.GlobalWorkerOptions.workerSrc}if(PDFWorkerUtil.fallbackWorkerSrc!==null){if(!_is_node.isNodeJS){(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.')}return PDFWorkerUtil.fallbackWorkerSrc}throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')},enumerable:false,configurable:true});Object.defineProperty(PDFWorker,"_mainThreadWorkerMessageHandler",{get:function(){var e;try{return((e=globalThis.pdfjsWorker)===null||e===void 0?void 0:e.WorkerMessageHandler)||null}catch(e){return null}},enumerable:false,configurable:true});Object.defineProperty(PDFWorker,"_setupFakeWorkerGlobal",{get:function(){var _this=this;var loader=function(){return __awaiter(_this,void 0,void 0,(function(){var mainWorkerMessageHandler,worker;return __generator(this,(function(_a){switch(_a.label){case 0:mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler){return[2,mainWorkerMessageHandler]}if(_is_node.isNodeJS&&typeof commonjsRequire==="function"){worker=eval("require")(this.workerSrc);return[2,worker.WorkerMessageHandler]}return[4,(0,_display_utils.loadScript)(this.workerSrc)];case 1:_a.sent();return[2,window.pdfjsWorker.WorkerMessageHandler]}}))}))};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())},enumerable:false,configurable:true});return PDFWorker}();exports.PDFWorker=PDFWorker;{PDFWorker.getWorkerSrc=function(){(0,_display_utils.deprecated)("`PDFWorker.getWorkerSrc()`, please use `PDFWorker.workerSrc` instead.");return this.workerSrc}}var WorkerTransport=function(){function e(e,t,r,n){_WorkerTransport_docStats.set(this,null);_WorkerTransport_pageCache.set(this,new Map);_WorkerTransport_pagePromises.set(this,new Map);_WorkerTransport_metadataPromise.set(this,null);this.messageHandler=e;this.loadingTask=t;this.commonObjs=new PDFObjects;this.fontLoader=new _font_loader.FontLoader({docId:t.docId,onUnsupportedFeature:this._onUnsupportedFeature.bind(this),ownerDocument:n.ownerDocument,styleElement:n.styleElement});this._params=n;if(!n.useWorkerFetch){this.CMapReaderFactory=new n.CMapReaderFactory({baseUrl:n.cMapUrl,isCompressed:n.cMapPacked});this.StandardFontDataFactory=new n.StandardFontDataFactory({baseUrl:n.standardFontDataUrl})}this.destroyed=false;this.destroyCapability=null;this._passwordCapability=null;this._networkStream=r;this._fullReader=null;this._lastProgress=null;this.downloadInfoCapability=(0,_util.createPromiseCapability)();this.setupMessageHandler()}Object.defineProperty(e.prototype,"annotationStorage",{get:function(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"stats",{get:function(){return __classPrivateFieldGet(this,_WorkerTransport_docStats,"f")},enumerable:false,configurable:true});e.prototype.getRenderingIntent=function(e,t,r){if(t===void 0){t=_util.AnnotationMode.ENABLE}if(r===void 0){r=false}var n=_util.RenderingIntentFlag.DISPLAY;var a="";switch(e){case"any":n=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":n=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)("getRenderingIntent - invalid intent: ".concat(e))}switch(t){case _util.AnnotationMode.DISABLE:n+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:n+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:n+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE;a=this.annotationStorage.lastModified;break;default:(0,_util.warn)("getRenderingIntent - invalid annotationMode: ".concat(t))}if(r){n+=_util.RenderingIntentFlag.OPLIST}return{renderingIntent:n,cacheKey:"".concat(n,"_").concat(a)}};e.prototype.destroy=function(){var e=this;if(this.destroyCapability){return this.destroyCapability.promise}this.destroyed=true;this.destroyCapability=(0,_util.createPromiseCapability)();if(this._passwordCapability){this._passwordCapability.reject(new Error("Worker was destroyed during onPassword callback"))}var t=[];for(var r=0,n=__classPrivateFieldGet(this,_WorkerTransport_pageCache,"f").values();r<n.length;r++){var a=n[r];t.push(a._destroy())}__classPrivateFieldGet(this,_WorkerTransport_pageCache,"f").clear();__classPrivateFieldGet(this,_WorkerTransport_pagePromises,"f").clear();if(this.hasOwnProperty("annotationStorage")){this.annotationStorage.resetModified()}var i=this.messageHandler.sendWithPromise("Terminate",null);t.push(i);Promise.all(t).then((function(){e.commonObjs.clear();e.fontLoader.clear();__classPrivateFieldSet(e,_WorkerTransport_metadataPromise,null,"f");e._getFieldObjectsPromise=null;e._hasJSActionsPromise=null;if(e._networkStream){e._networkStream.cancelAllRequests(new _util.AbortException("Worker was terminated."))}if(e.messageHandler){e.messageHandler.destroy();e.messageHandler=null}e.destroyCapability.resolve()}),this.destroyCapability.reject);return this.destroyCapability.promise};e.prototype.setupMessageHandler=function(){var e=this;var t=this,r=t.messageHandler,n=t.loadingTask;r.on("GetReader",(function(t,r){(0,_util.assert)(e._networkStream,"GetReader - no `IPDFStream` instance available.");e._fullReader=e._networkStream.getFullReader();e._fullReader.onProgress=function(t){e._lastProgress={loaded:t.loaded,total:t.total}};r.onPull=function(){e._fullReader.read().then((function(e){var t=e.value,n=e.done;if(n){r.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(t),"GetReader - expected an ArrayBuffer.");r.enqueue(new Uint8Array(t),1,[t])})).catch((function(e){r.error(e)}))};r.onCancel=function(t){e._fullReader.cancel(t);r.ready.catch((function(t){if(e.destroyed){return}throw t}))}}));r.on("ReaderHeadersReady",(function(t){var r=(0,_util.createPromiseCapability)();var a=e._fullReader;a.headersReady.then((function(){var t;if(!a.isStreamingSupported||!a.isRangeSupported){if(e._lastProgress){(t=n.onProgress)===null||t===void 0?void 0:t.call(n,e._lastProgress)}a.onProgress=function(e){var t;(t=n.onProgress)===null||t===void 0?void 0:t.call(n,{loaded:e.loaded,total:e.total})}}r.resolve({isStreamingSupported:a.isStreamingSupported,isRangeSupported:a.isRangeSupported,contentLength:a.contentLength})}),r.reject);return r.promise}));r.on("GetRangeReader",(function(t,r){(0,_util.assert)(e._networkStream,"GetRangeReader - no `IPDFStream` instance available.");var n=e._networkStream.getRangeReader(t.begin,t.end);if(!n){r.close();return}r.onPull=function(){n.read().then((function(e){var t=e.value,n=e.done;if(n){r.close();return}(0,_util.assert)((0,_util.isArrayBuffer)(t),"GetRangeReader - expected an ArrayBuffer.");r.enqueue(new Uint8Array(t),1,[t])})).catch((function(e){r.error(e)}))};r.onCancel=function(t){n.cancel(t);r.ready.catch((function(t){if(e.destroyed){return}throw t}))}}));r.on("GetDoc",(function(t){var r=t.pdfInfo;e._numPages=r.numPages;e._htmlForXfa=r.htmlForXfa;delete r.htmlForXfa;n._capability.resolve(new PDFDocumentProxy(r,e))}));r.on("DocException",(function(e){var t;switch(e.name){case"PasswordException":t=new _util.PasswordException(e.message,e.code);break;case"InvalidPDFException":t=new _util.InvalidPDFException(e.message);break;case"MissingPDFException":t=new _util.MissingPDFException(e.message);break;case"UnexpectedResponseException":t=new _util.UnexpectedResponseException(e.message,e.status);break;case"UnknownErrorException":t=new _util.UnknownErrorException(e.message,e.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}n._capability.reject(t)}));r.on("PasswordRequest",(function(t){e._passwordCapability=(0,_util.createPromiseCapability)();if(n.onPassword){var r=function(t){e._passwordCapability.resolve({password:t})};try{n.onPassword(r,t.code)}catch(t){e._passwordCapability.reject(t)}}else{e._passwordCapability.reject(new _util.PasswordException(t.message,t.code))}return e._passwordCapability.promise}));r.on("DataLoaded",(function(t){var r;(r=n.onProgress)===null||r===void 0?void 0:r.call(n,{loaded:t.length,total:t.length});e.downloadInfoCapability.resolve(t)}));r.on("StartRenderPage",(function(t){if(e.destroyed){return}var r=__classPrivateFieldGet(e,_WorkerTransport_pageCache,"f").get(t.pageIndex);r._startRenderPage(t.transparency,t.cacheKey)}));r.on("commonobj",(function(t){var n;var a=t[0],i=t[1],o=t[2];if(e.destroyed){return}if(e.commonObjs.has(a)){return}switch(i){case"Font":var s=e._params;if("error"in o){var l=o.error;(0,_util.warn)("Error during font loading: ".concat(l));e.commonObjs.resolve(a,l);break}var u=null;if(s.pdfBug&&((n=globalThis.FontInspector)===null||n===void 0?void 0:n.enabled)){u={registerFont:function(e,t){globalThis.FontInspector.fontAdded(e,t)}}}var c=new _font_loader.FontFaceObject(o,{isEvalSupported:s.isEvalSupported,disableFontFace:s.disableFontFace,ignoreErrors:s.ignoreErrors,onUnsupportedFeature:e._onUnsupportedFeature.bind(e),fontRegistry:u});e.fontLoader.bind(c).catch((function(e){return r.sendWithPromise("FontFallback",{id:a})})).finally((function(){if(!s.fontExtraProperties&&c.data){c.data=null}e.commonObjs.resolve(a,c)}));break;case"FontPath":case"Image":e.commonObjs.resolve(a,o);break;default:throw new Error("Got unknown common object type ".concat(i))}}));r.on("obj",(function(t){var r;var n=t[0],a=t[1],i=t[2],o=t[3];if(e.destroyed){return}var s=__classPrivateFieldGet(e,_WorkerTransport_pageCache,"f").get(a);if(s.objs.has(n)){return}switch(i){case"Image":s.objs.resolve(n,o);var l=8e6;if(((r=o===null||o===void 0?void 0:o.data)===null||r===void 0?void 0:r.length)>l){s.cleanupAfterRender=true}break;case"Pattern":s.objs.resolve(n,o);break;default:throw new Error("Got unknown object type ".concat(i))}}));r.on("DocProgress",(function(t){var r;if(e.destroyed){return}(r=n.onProgress)===null||r===void 0?void 0:r.call(n,{loaded:t.loaded,total:t.total})}));r.on("DocStats",(function(t){if(e.destroyed){return}__classPrivateFieldSet(e,_WorkerTransport_docStats,Object.freeze({streamTypes:Object.freeze(t.streamTypes),fontTypes:Object.freeze(t.fontTypes)}),"f")}));r.on("UnsupportedFeature",this._onUnsupportedFeature.bind(this));r.on("FetchBuiltInCMap",(function(t){if(e.destroyed){return Promise.reject(new Error("Worker was destroyed."))}if(!e.CMapReaderFactory){return Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))}return e.CMapReaderFactory.fetch(t)}));r.on("FetchStandardFontData",(function(t){if(e.destroyed){return Promise.reject(new Error("Worker was destroyed."))}if(!e.StandardFontDataFactory){return Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."))}return e.StandardFontDataFactory.fetch(t)}))};e.prototype._onUnsupportedFeature=function(e){var t,r;var n=e.featureId;if(this.destroyed){return}(r=(t=this.loadingTask).onUnsupportedFeature)===null||r===void 0?void 0:r.call(t,n)};e.prototype.getData=function(){return this.messageHandler.sendWithPromise("GetData",null)};e.prototype.getPage=function(e){var t=this;if(!Number.isInteger(e)||e<=0||e>this._numPages){return Promise.reject(new Error("Invalid page request"))}var r=e-1,n=__classPrivateFieldGet(this,_WorkerTransport_pagePromises,"f").get(r);if(n){return n}var a=this.messageHandler.sendWithPromise("GetPage",{pageIndex:r}).then((function(e){if(t.destroyed){throw new Error("Transport destroyed")}var n=new PDFPageProxy(r,e,t,t._params.ownerDocument,t._params.pdfBug);__classPrivateFieldGet(t,_WorkerTransport_pageCache,"f").set(r,n);return n}));__classPrivateFieldGet(this,_WorkerTransport_pagePromises,"f").set(r,a);return a};e.prototype.getPageIndex=function(e){return this.messageHandler.sendWithPromise("GetPageIndex",{ref:e})};e.prototype.getAnnotations=function(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})};e.prototype.saveDocument=function(){var e=this;var t,r;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:this.annotationStorage.serializable,filename:(r=(t=this._fullReader)===null||t===void 0?void 0:t.filename)!==null&&r!==void 0?r:null}).finally((function(){e.annotationStorage.resetModified()}))};e.prototype.getFieldObjects=function(){return this._getFieldObjectsPromise||(this._getFieldObjectsPromise=this.messageHandler.sendWithPromise("GetFieldObjects",null))};e.prototype.hasJSActions=function(){return this._hasJSActionsPromise||(this._hasJSActionsPromise=this.messageHandler.sendWithPromise("HasJSActions",null))};e.prototype.getCalculationOrderIds=function(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)};e.prototype.getDestinations=function(){return this.messageHandler.sendWithPromise("GetDestinations",null)};e.prototype.getDestination=function(e){if(typeof e!=="string"){return Promise.reject(new Error("Invalid destination request."))}return this.messageHandler.sendWithPromise("GetDestination",{id:e})};e.prototype.getPageLabels=function(){return this.messageHandler.sendWithPromise("GetPageLabels",null)};e.prototype.getPageLayout=function(){return this.messageHandler.sendWithPromise("GetPageLayout",null)};e.prototype.getPageMode=function(){return this.messageHandler.sendWithPromise("GetPageMode",null)};e.prototype.getViewerPreferences=function(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)};e.prototype.getOpenAction=function(){return this.messageHandler.sendWithPromise("GetOpenAction",null)};e.prototype.getAttachments=function(){return this.messageHandler.sendWithPromise("GetAttachments",null)};e.prototype.getJavaScript=function(){return this.messageHandler.sendWithPromise("GetJavaScript",null)};e.prototype.getDocJSActions=function(){return this.messageHandler.sendWithPromise("GetDocJSActions",null)};e.prototype.getPageJSActions=function(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})};e.prototype.getStructTree=function(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})};e.prototype.getOutline=function(){return this.messageHandler.sendWithPromise("GetOutline",null)};e.prototype.getOptionalContentConfig=function(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then((function(e){return new _optional_content_config.OptionalContentConfig(e)}))};e.prototype.getPermissions=function(){return this.messageHandler.sendWithPromise("GetPermissions",null)};e.prototype.getMetadata=function(){var e=this;return __classPrivateFieldSet(this,_WorkerTransport_metadataPromise,__classPrivateFieldGet(this,_WorkerTransport_metadataPromise,"f")||this.messageHandler.sendWithPromise("GetMetadata",null).then((function(t){var r,n,a,i;return{info:t[0],metadata:t[1]?new _metadata.Metadata(t[1]):null,contentDispositionFilename:(n=(r=e._fullReader)===null||r===void 0?void 0:r.filename)!==null&&n!==void 0?n:null,contentLength:(i=(a=e._fullReader)===null||a===void 0?void 0:a.contentLength)!==null&&i!==void 0?i:null}})),"f")};e.prototype.getMarkInfo=function(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)};e.prototype.startCleanup=function(e){if(e===void 0){e=false}return __awaiter(this,void 0,void 0,(function(){var t,r,n,a;return __generator(this,(function(i){switch(i.label){case 0:return[4,this.messageHandler.sendWithPromise("Cleanup",null)];case 1:i.sent();if(this.destroyed){return[2]}for(t=0,r=__classPrivateFieldGet(this,_WorkerTransport_pageCache,"f").values();t<r.length;t++){n=r[t];a=n.cleanup();if(!a){throw new Error("startCleanup: Page ".concat(n.pageNumber," is currently rendering."))}}this.commonObjs.clear();if(!e){this.fontLoader.clear()}__classPrivateFieldSet(this,_WorkerTransport_metadataPromise,null,"f");this._getFieldObjectsPromise=null;this._hasJSActionsPromise=null;return[2]}}))}))};Object.defineProperty(e.prototype,"loadingParams",{get:function(){var e=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:e.disableAutoFetch,enableXfa:e.enableXfa})},enumerable:false,configurable:true});return e}();_WorkerTransport_docStats=new WeakMap,_WorkerTransport_pageCache=new WeakMap,_WorkerTransport_pagePromises=new WeakMap,_WorkerTransport_metadataPromise=new WeakMap;var PDFObjects=function(){function e(){this._objs=Object.create(null)}e.prototype._ensureObj=function(e){if(this._objs[e]){return this._objs[e]}return this._objs[e]={capability:(0,_util.createPromiseCapability)(),data:null,resolved:false}};e.prototype.get=function(e,t){if(t===void 0){t=null}if(t){this._ensureObj(e).capability.promise.then(t);return null}var r=this._objs[e];if(!r||!r.resolved){throw new Error("Requesting object that isn't resolved yet ".concat(e,"."))}return r.data};e.prototype.has=function(e){var t=this._objs[e];return(t===null||t===void 0?void 0:t.resolved)||false};e.prototype.resolve=function(e,t){var r=this._ensureObj(e);r.resolved=true;r.data=t;r.capability.resolve(t)};e.prototype.clear=function(){this._objs=Object.create(null)};return e}();var RenderTask=function(){function e(e){this._internalRenderTask=e;this.onContinue=null}Object.defineProperty(e.prototype,"promise",{get:function(){return this._internalRenderTask.capability.promise},enumerable:false,configurable:true});e.prototype.cancel=function(){this._internalRenderTask.cancel()};return e}();exports.RenderTask=RenderTask;var InternalRenderTask=function(){function e(e){var t=e.callback,r=e.params,n=e.objs,a=e.commonObjs,i=e.annotationCanvasMap,o=e.operatorList,s=e.pageIndex,l=e.canvasFactory,u=e.useRequestAnimationFrame,c=u===void 0?false:u,d=e.pdfBug,h=d===void 0?false:d;this.callback=t;this.params=r;this.objs=n;this.commonObjs=a;this.annotationCanvasMap=i;this.operatorListIdx=null;this.operatorList=o;this._pageIndex=s;this.canvasFactory=l;this._pdfBug=h;this.running=false;this.graphicsReadyCallback=null;this.graphicsReady=false;this._useRequestAnimationFrame=c===true&&typeof window!=="undefined";this.cancelled=false;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=r.canvasContext.canvas}Object.defineProperty(e,"canvasInUse",{get:function(){return(0,_util.shadow)(this,"canvasInUse",new WeakSet)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"completed",{get:function(){return this.capability.promise.catch((function(){}))},enumerable:false,configurable:true});e.prototype.initializeGraphics=function(t){var r;var n=t.transparency,a=n===void 0?false:n,i=t.optionalContentConfig;if(this.cancelled){return}if(this._canvas){if(e.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.")}e.canvasInUse.add(this._canvas)}if(this._pdfBug&&((r=globalThis.StepperManager)===null||r===void 0?void 0:r.enabled)){this.stepper=globalThis.StepperManager.create(this._pageIndex);this.stepper.init(this.operatorList);this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint()}var o=this.params,s=o.canvasContext,l=o.viewport,u=o.transform,c=o.imageLayer,d=o.background;this.gfx=new _canvas.CanvasGraphics(s,this.commonObjs,this.objs,this.canvasFactory,c,i,this.annotationCanvasMap);this.gfx.beginDrawing({transform:u,viewport:l,transparency:a,background:d});this.operatorListIdx=0;this.graphicsReady=true;if(this.graphicsReadyCallback){this.graphicsReadyCallback()}};e.prototype.cancel=function(t){if(t===void 0){t=null}this.running=false;this.cancelled=true;if(this.gfx){this.gfx.endDrawing()}if(this._canvas){e.canvasInUse.delete(this._canvas)}this.callback(t||new _display_utils.RenderingCancelledException("Rendering cancelled, page ".concat(this._pageIndex+1),"canvas"))};e.prototype.operatorListChanged=function(){if(!this.graphicsReady){if(!this.graphicsReadyCallback){this.graphicsReadyCallback=this._continueBound}return}if(this.stepper){this.stepper.updateOperatorList(this.operatorList)}if(this.running){return}this._continue()};e.prototype._continue=function(){this.running=true;if(this.cancelled){return}if(this.task.onContinue){this.task.onContinue(this._scheduleNextBound)}else{this._scheduleNext()}};e.prototype._scheduleNext=function(){var e=this;if(this._useRequestAnimationFrame){window.requestAnimationFrame((function(){e._nextBound().catch(e._cancelBound)}))}else{Promise.resolve().then(this._nextBound).catch(this._cancelBound)}};e.prototype._next=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.cancelled){return[2]}this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper);if(this.operatorListIdx===this.operatorList.argsArray.length){this.running=false;if(this.operatorList.lastChunk){this.gfx.endDrawing();if(this._canvas){e.canvasInUse.delete(this._canvas)}this.callback()}}return[2]}))}))};return e}();var version="2.12.313";exports.version=version;var build="a2ae56f39";exports.build=build},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.FontLoader=t.FontFaceObject=void 0;var n=r(2);var a=function(){function e(t){var r=t.docId,a=t.onUnsupportedFeature,i=t.ownerDocument,o=i===void 0?globalThis.document:i,s=t.styleElement,l=s===void 0?null:s;if(this.constructor===e){(0,n.unreachable)("Cannot initialize BaseFontLoader.")}this.docId=r;this._onUnsupportedFeature=a;this._document=o;this.nativeFontFaces=[];this.styleElement=null}e.prototype.addNativeFontFace=function(e){this.nativeFontFaces.push(e);this._document.fonts.add(e)};e.prototype.insertRule=function(e){var t=this.styleElement;if(!t){t=this.styleElement=this._document.createElement("style");t.id="PDFJS_FONT_STYLE_TAG_".concat(this.docId);this._document.documentElement.getElementsByTagName("head")[0].appendChild(t)}var r=t.sheet;r.insertRule(e,r.cssRules.length)};e.prototype.clear=function(){for(var e=0,t=this.nativeFontFaces;e<t.length;e++){var r=t[e];this._document.fonts.delete(r)}this.nativeFontFaces.length=0;if(this.styleElement){this.styleElement.remove();this.styleElement=null}};e.prototype.bind=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,a;var i=this;return __generator(this,(function(o){switch(o.label){case 0:if(e.attached||e.missingFile){return[2]}e.attached=true;if(!this.isFontLoadingAPISupported)return[3,5];t=e.createNativeFontFace();if(!t)return[3,4];this.addNativeFontFace(t);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,t.loaded];case 2:o.sent();return[3,4];case 3:r=o.sent();this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontLoadNative});(0,n.warn)("Failed to load font '".concat(t.family,"': '").concat(r,"'."));e.disableFontFace=true;throw r;case 4:return[2];case 5:a=e.createFontFaceRule();if(!a)return[3,7];this.insertRule(a);if(this.isSyncFontLoadingSupported){return[2]}return[4,new Promise((function(t){var r=i._queueLoadingCallback(t);i._prepareFontLoadEvent([a],[e],r)}))];case 6:o.sent();o.label=7;case 7:return[2]}}))}))};e.prototype._queueLoadingCallback=function(e){(0,n.unreachable)("Abstract method `_queueLoadingCallback`.")};Object.defineProperty(e.prototype,"isFontLoadingAPISupported",{get:function(){var e;var t=!!((e=this._document)===null||e===void 0?void 0:e.fonts);return(0,n.shadow)(this,"isFontLoadingAPISupported",t)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSyncFontLoadingSupported",{get:function(){(0,n.unreachable)("Abstract method `isSyncFontLoadingSupported`.")},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"_loadTestFont",{get:function(){(0,n.unreachable)("Abstract method `_loadTestFont`.")},enumerable:false,configurable:true});e.prototype._prepareFontLoadEvent=function(e,t,r){(0,n.unreachable)("Abstract method `_prepareFontLoadEvent`.")};return e}();var i;t.FontLoader=i;{t.FontLoader=i=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;r.loadingContext={requests:[],nextRequestId:0};r.loadTestFontId=0;return r}Object.defineProperty(t.prototype,"isSyncFontLoadingSupported",{get:function(){var e=false;if(typeof navigator==="undefined"){e=true}else{var t=/Mozilla\/5.0.*?rv:(\d+).*? Gecko/.exec(navigator.userAgent);if((t===null||t===void 0?void 0:t[1])>=14){e=true}}return(0,n.shadow)(this,"isSyncFontLoadingSupported",e)},enumerable:false,configurable:true});t.prototype._queueLoadingCallback=function(e){function t(){(0,n.assert)(!a.done,"completeRequest() cannot be called twice.");a.done=true;while(r.requests.length>0&&r.requests[0].done){var e=r.requests.shift();setTimeout(e.callback,0)}}var r=this.loadingContext;var a={id:"pdfjs-font-loading-".concat(r.nextRequestId++),done:false,complete:t,callback:e};r.requests.push(a);return a};Object.defineProperty(t.prototype,"_loadTestFont",{get:function(){var e=function(){return atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA"+"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA"+"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA"+"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1"+"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD"+"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM"+"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D"+"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA"+"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA"+"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB"+"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY"+"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA"+"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"+"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA"+"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC"+"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3"+"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj"+"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==")};return(0,n.shadow)(this,"_loadTestFont",e())},enumerable:false,configurable:true});t.prototype._prepareFontLoadEvent=function(e,t,r){function a(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function i(e,t,r,n){var a=e.substring(0,t);var i=e.substring(t+r);return a+n+i}var o,s;var l=this._document.createElement("canvas");l.width=1;l.height=1;var u=l.getContext("2d");var c=0;function d(e,t){c++;if(c>30){(0,n.warn)("Load test font never loaded.");t();return}u.font="30px "+e;u.fillText(".",0,20);var r=u.getImageData(0,0,1,1);if(r.data[3]>0){t();return}setTimeout(d.bind(null,e,t))}var h="lt".concat(Date.now()).concat(this.loadTestFontId++);var f=this._loadTestFont;var p=976;f=i(f,p,h.length,h);var v=16;var g=1482184792;var m=a(f,v);for(o=0,s=h.length-3;o<s;o+=4){m=m-g+a(h,o)|0}if(o<h.length){m=m-g+a(h+"XXX",o)|0}f=i(f,v,4,(0,n.string32)(m));var _="url(data:font/opentype;base64,".concat(btoa(f),");");var y='@font-face {font-family:"'.concat(h,'";src:').concat(_,"}");this.insertRule(y);var b=[];for(var A=0,S=t;A<S.length;A++){var x=S[A];b.push(x.loadedName)}b.push(h);var C=this._document.createElement("div");C.style.visibility="hidden";C.style.width=C.style.height="10px";C.style.position="absolute";C.style.top=C.style.left="0px";for(var P=0,w=b;P<w.length;P++){var k=w[P];var T=this._document.createElement("span");T.textContent="Hi";T.style.fontFamily=k;C.appendChild(T)}this._document.body.appendChild(C);d(h,(function(){C.remove();r.complete()}))};return t}(a)}var o=function(){function e(e,t){var r=t.isEvalSupported,n=r===void 0?true:r,a=t.disableFontFace,i=a===void 0?false:a,o=t.ignoreErrors,s=o===void 0?false:o,l=t.onUnsupportedFeature,u=t.fontRegistry,c=u===void 0?null:u;this.compiledGlyphs=Object.create(null);for(var d in e){this[d]=e[d]}this.isEvalSupported=n!==false;this.disableFontFace=i===true;this.ignoreErrors=s===true;this._onUnsupportedFeature=l;this.fontRegistry=c}e.prototype.createNativeFontFace=function(){if(!this.data||this.disableFontFace){return null}var e;if(!this.cssFontInfo){e=new FontFace(this.loadedName,this.data,{})}else{var t={weight:this.cssFontInfo.fontWeight};if(this.cssFontInfo.italicAngle){t.style="oblique ".concat(this.cssFontInfo.italicAngle,"deg")}e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}if(this.fontRegistry){this.fontRegistry.registerFont(this)}return e};e.prototype.createFontFaceRule=function(){if(!this.data||this.disableFontFace){return null}var e=(0,n.bytesToString)(this.data);var t="url(data:".concat(this.mimetype,";base64,").concat(btoa(e),");");var r;if(!this.cssFontInfo){r='@font-face {font-family:"'.concat(this.loadedName,'";src:').concat(t,"}")}else{var a="font-weight: ".concat(this.cssFontInfo.fontWeight,";");if(this.cssFontInfo.italicAngle){a+="font-style: oblique ".concat(this.cssFontInfo.italicAngle,"deg;")}r='@font-face {font-family:"'.concat(this.cssFontInfo.fontFamily,'";').concat(a,"src:").concat(t,"}")}if(this.fontRegistry){this.fontRegistry.registerFont(this,t)}return r};e.prototype.getPathGenerator=function(e,t){if(this.compiledGlyphs[t]!==undefined){return this.compiledGlyphs[t]}var r;try{r=e.get(this.loadedName+"_path_"+t)}catch(e){if(!this.ignoreErrors){throw e}this._onUnsupportedFeature({featureId:n.UNSUPPORTED_FEATURES.errorFontGetPath});(0,n.warn)('getPathGenerator - ignoring character: "'.concat(e,'".'));return this.compiledGlyphs[t]=function(e,t){}}if(this.isEvalSupported&&n.IsEvalSupportedCached.value){var a=[];for(var i=0,o=r;i<o.length;i++){var s=o[i];var l=s.args!==undefined?s.args.join(","):"";a.push("c.",s.cmd,"(",l,");\n")}return this.compiledGlyphs[t]=new Function("c","size",a.join(""))}return this.compiledGlyphs[t]=function(e,t){for(var n=0,a=r;n<a.length;n++){var i=a[n];if(i.cmd==="scale"){i.args=[t,-t]}e[i.cmd].apply(e,i.args)}}};return e}();t.FontFaceObject=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.NodeStandardFontDataFactory=t.NodeCanvasFactory=t.NodeCMapReaderFactory=void 0;var n=r(5);var a=r(4);var i=r(2);var o=function(){function e(){(0,i.unreachable)("Not implemented: NodeCanvasFactory")}return e}();t.NodeCanvasFactory=o;var s=function(){function e(){(0,i.unreachable)("Not implemented: NodeCMapReaderFactory")}return e}();t.NodeCMapReaderFactory=s;var l=function(){function e(){(0,i.unreachable)("Not implemented: NodeStandardFontDataFactory")}return e}();t.NodeStandardFontDataFactory=l;if(a.isNodeJS){var u=function(e){return new Promise((function(t,r){var n=require$$5;n.readFile(e,(function(e,n){if(e||!n){r(new Error(e));return}t(new Uint8Array(n))}))}))};t.NodeCanvasFactory=o=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._createCanvas=function(e,t){var r=require$$5;return r.createCanvas(e,t)};return t}(n.BaseCanvasFactory);t.NodeCMapReaderFactory=s=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._fetchData=function(e,t){return u(e).then((function(e){return{cMapData:e,compressionType:t}}))};return t}(n.BaseCMapReaderFactory);t.NodeStandardFontDataFactory=l=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype._fetchData=function(e){return u(e)};return t}(n.BaseStandardFontDataFactory)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.AnnotationStorage=void 0;var n=r(2);var a=function(){function e(){this._storage=new Map;this._timeStamp=Date.now();this._modified=false;this.onSetModified=null;this.onResetModified=null}e.prototype.getValue=function(e,t){var r=this._storage.get(e);if(r===undefined){return t}return Object.assign(t,r)};e.prototype.setValue=function(e,t){var r=this._storage.get(e);var n=false;if(r!==undefined){for(var a=0,i=Object.entries(t);a<i.length;a++){var o=i[a],s=o[0],l=o[1];if(r[s]!==l){n=true;r[s]=l}}}else{n=true;this._storage.set(e,t)}if(n){this._timeStamp=Date.now();this._setModified()}};e.prototype.getAll=function(){return this._storage.size>0?(0,n.objectFromMap)(this._storage):null};Object.defineProperty(e.prototype,"size",{get:function(){return this._storage.size},enumerable:false,configurable:true});e.prototype._setModified=function(){if(!this._modified){this._modified=true;if(typeof this.onSetModified==="function"){this.onSetModified()}}};e.prototype.resetModified=function(){if(this._modified){this._modified=false;if(typeof this.onResetModified==="function"){this.onResetModified()}}};Object.defineProperty(e.prototype,"serializable",{get:function(){return this._storage.size>0?this._storage:null},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"lastModified",{get:function(){return this._timeStamp.toString()},enumerable:false,configurable:true});return e}();t.AnnotationStorage=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.CanvasGraphics=void 0;var n=r(2);var a=r(11);var i=r(1);var o=16;var s=100;var l=4096;var u=15;var c=10;var d=true;var h=1e3;var f=16;var p=1.000001;function v(e,t){if(e._removeMirroring){throw new Error("Context is already forwarding operations.")}e.__originalSave=e.save;e.__originalRestore=e.restore;e.__originalRotate=e.rotate;e.__originalScale=e.scale;e.__originalTranslate=e.translate;e.__originalTransform=e.transform;e.__originalSetTransform=e.setTransform;e.__originalResetTransform=e.resetTransform;e.__originalClip=e.clip;e.__originalMoveTo=e.moveTo;e.__originalLineTo=e.lineTo;e.__originalBezierCurveTo=e.bezierCurveTo;e.__originalRect=e.rect;e.__originalClosePath=e.closePath;e.__originalBeginPath=e.beginPath;e._removeMirroring=function(){e.save=e.__originalSave;e.restore=e.__originalRestore;e.rotate=e.__originalRotate;e.scale=e.__originalScale;e.translate=e.__originalTranslate;e.transform=e.__originalTransform;e.setTransform=e.__originalSetTransform;e.resetTransform=e.__originalResetTransform;e.clip=e.__originalClip;e.moveTo=e.__originalMoveTo;e.lineTo=e.__originalLineTo;e.bezierCurveTo=e.__originalBezierCurveTo;e.rect=e.__originalRect;e.closePath=e.__originalClosePath;e.beginPath=e.__originalBeginPath;delete e._removeMirroring};e.save=function e(){t.save();this.__originalSave()};e.restore=function e(){t.restore();this.__originalRestore()};e.translate=function e(r,n){t.translate(r,n);this.__originalTranslate(r,n)};e.scale=function e(r,n){t.scale(r,n);this.__originalScale(r,n)};e.transform=function e(r,n,a,i,o,s){t.transform(r,n,a,i,o,s);this.__originalTransform(r,n,a,i,o,s)};e.setTransform=function e(r,n,a,i,o,s){t.setTransform(r,n,a,i,o,s);this.__originalSetTransform(r,n,a,i,o,s)};e.resetTransform=function e(){t.resetTransform();this.__originalResetTransform()};e.rotate=function e(r){t.rotate(r);this.__originalRotate(r)};e.clip=function e(r){t.clip(r);this.__originalClip(r)};e.moveTo=function(e,r){t.moveTo(e,r);this.__originalMoveTo(e,r)};e.lineTo=function(e,r){t.lineTo(e,r);this.__originalLineTo(e,r)};e.bezierCurveTo=function(e,r,n,a,i,o){t.bezierCurveTo(e,r,n,a,i,o);this.__originalBezierCurveTo(e,r,n,a,i,o)};e.rect=function(e,r,n,a){t.rect(e,r,n,a);this.__originalRect(e,r,n,a)};e.closePath=function(){t.closePath();this.__originalClosePath()};e.beginPath=function(){t.beginPath();this.__originalBeginPath()}}function g(e){if(e.mozCurrentTransform){return}e._originalSave=e.save;e._originalRestore=e.restore;e._originalRotate=e.rotate;e._originalScale=e.scale;e._originalTranslate=e.translate;e._originalTransform=e.transform;e._originalSetTransform=e.setTransform;e._originalResetTransform=e.resetTransform;e._transformMatrix=e._transformMatrix||[1,0,0,1,0,0];e._transformStack=[];try{var t=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"lineWidth");e._setLineWidth=t.set;e._getLineWidth=t.get;Object.defineProperty(e,"lineWidth",{set:function e(t){this._setLineWidth(t*p)},get:function e(){return this._getLineWidth()}})}catch(e){}Object.defineProperty(e,"mozCurrentTransform",{get:function e(){return this._transformMatrix}});Object.defineProperty(e,"mozCurrentTransformInverse",{get:function e(){var t=this._transformMatrix,r=t[0],n=t[1],a=t[2],i=t[3],o=t[4],s=t[5];var l=r*i-n*a;var u=n*a-r*i;return[i/l,n/u,a/u,r/l,(i*o-a*s)/u,(n*o-r*s)/l]}});e.save=function e(){var t=this._transformMatrix;this._transformStack.push(t);this._transformMatrix=t.slice(0,6);this._originalSave()};e.restore=function e(){var t=this._transformStack.pop();if(t){this._transformMatrix=t;this._originalRestore()}};e.translate=function e(t,r){var n=this._transformMatrix;n[4]=n[0]*t+n[2]*r+n[4];n[5]=n[1]*t+n[3]*r+n[5];this._originalTranslate(t,r)};e.scale=function e(t,r){var n=this._transformMatrix;n[0]*=t;n[1]*=t;n[2]*=r;n[3]*=r;this._originalScale(t,r)};e.transform=function t(r,n,a,i,o,s){var l=this._transformMatrix;this._transformMatrix=[l[0]*r+l[2]*n,l[1]*r+l[3]*n,l[0]*a+l[2]*i,l[1]*a+l[3]*i,l[0]*o+l[2]*s+l[4],l[1]*o+l[3]*s+l[5]];e._originalTransform(r,n,a,i,o,s)};e.setTransform=function t(r,n,a,i,o,s){this._transformMatrix=[r,n,a,i,o,s];e._originalSetTransform(r,n,a,i,o,s)};e.resetTransform=function t(){this._transformMatrix=[1,0,0,1,0,0];e._originalResetTransform()};e.rotate=function e(t){var r=Math.cos(t);var n=Math.sin(t);var a=this._transformMatrix;this._transformMatrix=[a[0]*r+a[2]*n,a[1]*r+a[3]*n,a[0]*-n+a[2]*r,a[1]*-n+a[3]*r,a[4],a[5]];this._originalRotate(t)}}var m=function(){function e(e){this.canvasFactory=e;this.cache=Object.create(null)}e.prototype.getCanvas=function(e,t,r,n){var a;if(this.cache[e]!==undefined){a=this.cache[e];this.canvasFactory.reset(a,t,r);a.context.setTransform(1,0,0,1,0,0)}else{a=this.canvasFactory.create(t,r);this.cache[e]=a}if(n){g(a.context)}return a};e.prototype.clear=function(){for(var e in this.cache){var t=this.cache[e];this.canvasFactory.destroy(t);delete this.cache[e]}};return e}();function _(e){var t=1e3;var r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]);var n=e.width,a=e.height,i=n+1;var o,s,l,u;var c=new Uint8Array(i*(a+1));var d=n+7&~7,h=e.data;var f=new Uint8Array(d*a);var p=0;for(o=0,s=h.length;o<s;o++){var v=h[o];var g=128;while(g>0){f[p++]=v&g?0:255;g>>=1}}var m=0;p=0;if(f[p]!==0){c[0]=1;++m}for(l=1;l<n;l++){if(f[p]!==f[p+1]){c[l]=f[p]?2:1;++m}p++}if(f[p]!==0){c[l]=2;++m}for(o=1;o<a;o++){p=o*d;u=o*i;if(f[p-d]!==f[p]){c[u]=f[p]?1:8;++m}var _=(f[p]?4:0)+(f[p-d]?8:0);for(l=1;l<n;l++){_=(_>>2)+(f[p+1]?4:0)+(f[p-d+1]?8:0);if(r[_]){c[u+l]=r[_];++m}p++}if(f[p-d]!==f[p]){c[u+l]=f[p]?2:4;++m}if(m>t){return null}}p=d*(a-1);u=o*i;if(f[p]!==0){c[u]=8;++m}for(l=1;l<n;l++){if(f[p]!==f[p+1]){c[u+l]=f[p]?4:8;++m}p++}if(f[p]!==0){c[u+l]=4;++m}if(m>t){return null}var y=new Int32Array([0,i,-1,0,-i,0,0,0,1]);var b=[];for(o=0;m&&o<=a;o++){var A=o*i;var S=A+n;while(A<S&&!c[A]){A++}if(A===S){continue}var x=[A%i,o];var C=A;var P=c[A];do{var w=y[P];do{A+=w}while(!c[A]);var k=c[A];if(k!==5&&k!==10){P=k;c[A]=0}else{P=k&51*P>>4;c[A]&=P>>2|P<<2}x.push(A%i,A/i|0);if(!c[A]){--m}}while(C!==A);b.push(x);--o}var T=function(e){e.save();e.scale(1/n,-1/a);e.translate(0,-a);e.beginPath();for(var t=0,r=b.length;t<r;t++){var i=b[t];e.moveTo(i[0],i[1]);for(var o=2,s=i.length;o<s;o+=2){e.lineTo(i[o],i[o+1])}}e.fill();e.beginPath();e.restore()};return T}var y=function(){function e(e,t){this.alphaIsShape=false;this.fontSize=0;this.fontSizeScale=1;this.textMatrix=n.IDENTITY_MATRIX;this.textMatrixScale=1;this.fontMatrix=n.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=n.TextRenderingMode.FILL;this.textRise=0;this.fillColor="#000000";this.strokeColor="#000000";this.patternFill=false;this.fillAlpha=1;this.strokeAlpha=1;this.lineWidth=1;this.activeSMask=null;this.transferMaps=null;this.startNewPathAndClipBox([0,0,e,t])}e.prototype.clone=function(){var e=Object.create(this);e.clipBox=this.clipBox.slice();return e};e.prototype.setCurrentPoint=function(e,t){this.x=e;this.y=t};e.prototype.updatePathMinMax=function(e,t,r){var a;a=n.Util.applyTransform([t,r],e),t=a[0],r=a[1];this.minX=Math.min(this.minX,t);this.minY=Math.min(this.minY,r);this.maxX=Math.max(this.maxX,t);this.maxY=Math.max(this.maxY,r)};e.prototype.updateCurvePathMinMax=function(e,t,r,a,i,o,s,l,u){var c=n.Util.bezierBoundingBox(t,r,a,i,o,s,l,u);this.updatePathMinMax(e,c[0],c[1]);this.updatePathMinMax(e,c[2],c[3])};e.prototype.getPathBoundingBox=function(e,t){if(e===void 0){e=a.PathType.FILL}if(t===void 0){t=null}var r=[this.minX,this.minY,this.maxX,this.maxY];if(e===a.PathType.STROKE){if(!t){(0,n.unreachable)("Stroke bounding box must include transform.")}var i=n.Util.singularValueDecompose2dScale(t);var o=i[0]*this.lineWidth/2;var s=i[1]*this.lineWidth/2;r[0]-=o;r[1]-=s;r[2]+=o;r[3]+=s}return r};e.prototype.updateClipFromPath=function(){var e=n.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])};e.prototype.startNewPathAndClipBox=function(e){this.clipBox=e;this.minX=Infinity;this.minY=Infinity;this.maxX=0;this.maxY=0};e.prototype.getClippedPathBoundingBox=function(e,t){if(e===void 0){e=a.PathType.FILL}if(t===void 0){t=null}return n.Util.intersect(this.clipBox,this.getPathBoundingBox(e,t))};return e}();function b(e,t,r){var a;if(r===void 0){r=null}if(typeof ImageData!=="undefined"&&t instanceof ImageData){e.putImageData(t,0,0);return}var i=t.height,o=t.width;var s=i%f;var l=(i-s)/f;var u=s===0?l:l+1;var c=e.createImageData(o,f);var d=0,h;var p=t.data;var v=c.data;var g,m,_,y;var b,A,S,x;if(r){switch(r.length){case 1:b=r[0];A=r[0];S=r[0];x=r[0];break;case 4:b=r[0];A=r[1];S=r[2];x=r[3];break}}if(t.kind===n.ImageKind.GRAYSCALE_1BPP){var C=p.byteLength;var P=new Uint32Array(v.buffer,0,v.byteLength>>2);var w=P.length;var k=o+7>>3;var T=4294967295;var R=n.IsLittleEndianCached.value?4278190080:255;if(x){if(x[0]===255&&x[255]===0){a=[R,T],T=a[0],R=a[1]}}for(g=0;g<u;g++){_=g<l?f:s;h=0;for(m=0;m<_;m++){var F=C-d;var E=0;var O=F>k?o:F*8-7;var M=O&~7;var D=0;var L=0;for(;E<M;E+=8){L=p[d++];P[h++]=L&128?T:R;P[h++]=L&64?T:R;P[h++]=L&32?T:R;P[h++]=L&16?T:R;P[h++]=L&8?T:R;P[h++]=L&4?T:R;P[h++]=L&2?T:R;P[h++]=L&1?T:R}for(;E<O;E++){if(D===0){L=p[d++];D=128}P[h++]=L&D?T:R;D>>=1}}while(h<w){P[h++]=0}e.putImageData(c,0,g*f)}}else if(t.kind===n.ImageKind.RGBA_32BPP){var I=!!(b||A||S);m=0;y=o*f*4;for(g=0;g<l;g++){v.set(p.subarray(d,d+y));d+=y;if(I){for(var E=0;E<y;E+=4){if(b){v[E+0]=b[v[E+0]]}if(A){v[E+1]=A[v[E+1]]}if(S){v[E+2]=S[v[E+2]]}}}e.putImageData(c,0,m);m+=f}if(g<u){y=o*s*4;v.set(p.subarray(d,d+y));if(I){for(var E=0;E<y;E+=4){if(b){v[E+0]=b[v[E+0]]}if(A){v[E+1]=A[v[E+1]]}if(S){v[E+2]=S[v[E+2]]}}}e.putImageData(c,0,m)}}else if(t.kind===n.ImageKind.RGB_24BPP){var I=!!(b||A||S);_=f;y=o*_;for(g=0;g<u;g++){if(g>=l){_=s;y=o*_}h=0;for(m=y;m--;){v[h++]=p[d++];v[h++]=p[d++];v[h++]=p[d++];v[h++]=255}if(I){for(var E=0;E<h;E+=4){if(b){v[E+0]=b[v[E+0]]}if(A){v[E+1]=A[v[E+1]]}if(S){v[E+2]=S[v[E+2]]}}}e.putImageData(c,0,g*f)}}else{throw new Error("bad image kind: ".concat(t.kind))}}function A(e,t){var r=t.height,n=t.width;var a=r%f;var i=(r-a)/f;var o=a===0?i:i+1;var s=e.createImageData(n,f);var l=0;var u=t.data;var c=s.data;for(var d=0;d<o;d++){var h=d<i?f:a;var p=3;for(var v=0;v<h;v++){var g=void 0,m=0;for(var _=0;_<n;_++){if(!m){g=u[l++];m=128}c[p]=g&m?0:255;p+=4;m>>=1}}e.putImageData(s,0,d*f)}}function S(e,t){var r=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font"];for(var n=0,a=r.length;n<a;n++){var i=r[n];if(e[i]!==undefined){t[i]=e[i]}}if(e.setLineDash!==undefined){t.setLineDash(e.getLineDash());t.lineDashOffset=e.lineDashOffset}}function x(e){e.strokeStyle="#000000";e.fillStyle="#000000";e.fillRule="nonzero";e.globalAlpha=1;e.lineWidth=1;e.lineCap="butt";e.lineJoin="miter";e.miterLimit=10;e.globalCompositeOperation="source-over";e.font="10px sans-serif";if(e.setLineDash!==undefined){e.setLineDash([]);e.lineDashOffset=0}}function C(e,t,r,n){var a=e.length;for(var i=3;i<a;i+=4){var o=e[i];if(o===0){e[i-3]=t;e[i-2]=r;e[i-1]=n}else if(o<255){var s=255-o;e[i-3]=e[i-3]*o+t*s>>8;e[i-2]=e[i-2]*o+r*s>>8;e[i-1]=e[i-1]*o+n*s>>8}}}function P(e,t,r){var n=e.length;var a=1/255;for(var i=3;i<n;i+=4){var o=r?r[e[i]]:e[i];t[i]=t[i]*o*a|0}}function w(e,t,r){var n=e.length;for(var a=3;a<n;a+=4){var i=e[a-3]*77+e[a-2]*152+e[a-1]*28;t[a]=r?t[a]*r[i>>8]>>8:t[a]*i>>16}}function k(e,t,r,n,a,i,o,s,l,u,c){var d=!!i;var h=d?i[0]:0;var f=d?i[1]:0;var p=d?i[2]:0;var v;if(a==="Luminosity"){v=w}else{v=P}var g=1048576;var m=Math.min(n,Math.ceil(g/r));for(var _=0;_<n;_+=m){var y=Math.min(m,n-_);var b=e.getImageData(s-u,_+(l-c),r,y);var A=t.getImageData(s,_+l,r,y);if(d){C(b.data,h,f,p)}v(b.data,A.data,o);t.putImageData(A,s,_+l)}}function T(e,t,r,n){var a=n[0];var i=n[1];var o=n[2]-a;var s=n[3]-i;if(o===0||s===0){return}k(t.context,r,o,s,t.subtype,t.backdrop,t.transferMap,a,i,t.offsetX,t.offsetY);e.save();e.globalAlpha=1;e.globalCompositeOperation="source-over";e.setTransform(1,0,0,1,0,0);e.drawImage(r.canvas,0,0);e.restore()}function R(e,t){var r=n.Util.singularValueDecompose2dScale(e);r[0]=Math.fround(r[0]);r[1]=Math.fround(r[1]);var a=Math.fround((globalThis.devicePixelRatio||1)*i.PixelsPerInch.PDF_TO_CSS_UNITS);if(t!==undefined){return t}else if(r[0]<=a||r[1]<=a){return true}return false}var F=["butt","round","square"];var E=["miter","round","bevel"];var O={};var M={};var D=function(){function e(e,t,r,n,a,i,o){this.ctx=e;this.current=new y(this.ctx.canvas.width,this.ctx.canvas.height);this.stateStack=[];this.pendingClip=null;this.pendingEOFill=false;this.res=null;this.xobjs=null;this.commonObjs=t;this.objs=r;this.canvasFactory=n;this.imageLayer=a;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=true;this.markedContentStack=[];this.optionalContentConfig=i;this.cachedCanvases=new m(this.canvasFactory);this.cachedPatterns=new Map;this.annotationCanvasMap=o;this.viewportScale=1;this.outputScaleX=1;this.outputScaleY=1;if(e){g(e)}this._cachedGetSinglePixelWidth=null}e.prototype.beginDrawing=function(e){var t=e.transform,r=e.viewport,n=e.transparency,a=n===void 0?false:n,i=e.background,o=i===void 0?null:i;var s=this.ctx.canvas.width;var l=this.ctx.canvas.height;this.ctx.save();this.ctx.fillStyle=o||"rgb(255, 255, 255)";this.ctx.fillRect(0,0,s,l);this.ctx.restore();if(a){var u=this.cachedCanvases.getCanvas("transparent",s,l,true);this.compositeCtx=this.ctx;this.transparentCanvas=u.canvas;this.ctx=u.context;this.ctx.save();this.ctx.transform.apply(this.ctx,this.compositeCtx.mozCurrentTransform)}this.ctx.save();x(this.ctx);if(t){this.ctx.transform.apply(this.ctx,t);this.outputScaleX=t[0];this.outputScaleY=t[0]}this.ctx.transform.apply(this.ctx,r.transform);this.viewportScale=r.scale;this.baseTransform=this.ctx.mozCurrentTransform.slice();this._combinedScaleFactor=Math.hypot(this.baseTransform[0],this.baseTransform[2]);if(this.imageLayer){this.imageLayer.beginLayout()}};e.prototype.executeOperatorList=function(e,t,r,a){var i=e.argsArray;var o=e.fnArray;var s=t||0;var l=i.length;if(l===s){return s}var d=l-s>c&&typeof r==="function";var h=d?Date.now()+u:0;var f=0;var p=this.commonObjs;var v=this.objs;var g;while(true){if(a!==undefined&&s===a.nextBreakPoint){a.breakIt(s,r);return s}g=o[s];if(g!==n.OPS.dependency){this[g].apply(this,i[s])}else{for(var m=0,_=i[s];m<_.length;m++){var y=_[m];var b=y.startsWith("g_")?p:v;if(!b.has(y)){b.get(y,r);return s}}}s++;if(s===l){return s}if(d&&++f>c){if(Date.now()>h){r();return s}f=0}}};e.prototype.endDrawing=function(){while(this.stateStack.length||this.current.activeSMask!==null){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();if(this.imageLayer){this.imageLayer.endLayout()}};e.prototype._scaleImage=function(e,t){var r=e.width;var n=e.height;var a=Math.max(Math.hypot(t[0],t[1]),1);var i=Math.max(Math.hypot(t[2],t[3]),1);var o=r,s=n;var l="prescale1";var u,c;while(a>2&&o>1||i>2&&s>1){var d=o,h=s;if(a>2&&o>1){d=Math.ceil(o/2);a/=o/d}if(i>2&&s>1){h=Math.ceil(s/2);i/=s/h}u=this.cachedCanvases.getCanvas(l,d,h);c=u.context;c.clearRect(0,0,d,h);c.drawImage(e,0,0,o,s,0,0,d,h);e=u.canvas;o=d;s=h;l=l==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:o,paintHeight:s}};e.prototype._createMaskCanvas=function(e){var t=this.ctx;var r=e.width,i=e.height;var o=this.current.fillColor;var s=this.current.patternFill;var l=this.cachedCanvases.getCanvas("maskCanvas",r,i);var u=l.context;A(u,e);var c=t.mozCurrentTransform;var d=n.Util.transform(c,[1/r,0,0,-1/i,0,0]);d=n.Util.transform(d,[1,0,0,1,0,-i]);var h=n.Util.applyTransform([0,0],d);var f=n.Util.applyTransform([r,i],d);var p=n.Util.normalizeRect([h[0],h[1],f[0],f[1]]);var v=Math.ceil(p[2]-p[0]);var g=Math.ceil(p[3]-p[1]);var m=this.cachedCanvases.getCanvas("fillCanvas",v,g,true);var _=m.context;var y=Math.min(h[0],f[0]);var b=Math.min(h[1],f[1]);_.translate(-y,-b);_.transform.apply(_,d);var S=this._scaleImage(l.canvas,_.mozCurrentTransformInverse);_.imageSmoothingEnabled=R(_.mozCurrentTransform,e.interpolate);_.drawImage(S.img,0,0,S.img.width,S.img.height,0,0,r,i);_.globalCompositeOperation="source-in";var x=n.Util.transform(_.mozCurrentTransformInverse,[1,0,0,1,-y,-b]);_.fillStyle=s?o.getPattern(t,this,x,a.PathType.FILL):o;_.fillRect(0,0,r,i);return{canvas:m.canvas,offsetX:Math.round(y),offsetY:Math.round(b)}};e.prototype.setLineWidth=function(e){this.current.lineWidth=e;this.ctx.lineWidth=e};e.prototype.setLineCap=function(e){this.ctx.lineCap=F[e]};e.prototype.setLineJoin=function(e){this.ctx.lineJoin=E[e]};e.prototype.setMiterLimit=function(e){this.ctx.miterLimit=e};e.prototype.setDash=function(e,t){var r=this.ctx;if(r.setLineDash!==undefined){r.setLineDash(e);r.lineDashOffset=t}};e.prototype.setRenderingIntent=function(e){};e.prototype.setFlatness=function(e){};e.prototype.setGState=function(e){for(var t=0,r=e.length;t<r;t++){var n=e[t];var a=n[0];var i=n[1];switch(a){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[0],i[1]);break;case"CA":this.current.strokeAlpha=n[1];break;case"ca":this.current.fillAlpha=n[1];this.ctx.globalAlpha=n[1];break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null;this.tempSMask=null;this.checkSMaskState();break;case"TR":this.current.transferMaps=i}}};e.prototype.checkSMaskState=function(){var e=!!this.suspendedCtx;if(this.current.activeSMask&&!e){this.beginSMaskMode()}else if(!this.current.activeSMask&&e){this.endSMaskMode()}};e.prototype.beginSMaskMode=function(){if(this.suspendedCtx){throw new Error("beginSMaskMode called while already in smask mode")}var e=this.ctx.canvas.width;var t=this.ctx.canvas.height;var r="smaskGroupAt"+this.groupLevel;var n=this.cachedCanvases.getCanvas(r,e,t,true);this.suspendedCtx=this.ctx;this.ctx=n.context;var a=this.ctx;a.setTransform.apply(a,this.suspendedCtx.mozCurrentTransform);S(this.suspendedCtx,a);v(a,this.suspendedCtx);this.setGState([["BM","source-over"],["ca",1],["CA",1]])};e.prototype.endSMaskMode=function(){if(!this.suspendedCtx){throw new Error("endSMaskMode called while not in smask mode")}this.ctx._removeMirroring();S(this.ctx,this.suspendedCtx);this.ctx=this.suspendedCtx;this.current.activeSMask=null;this.suspendedCtx=null};e.prototype.compose=function(e){if(!this.current.activeSMask){return}if(!e){e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height]}else{e[0]=Math.floor(e[0]);e[1]=Math.floor(e[1]);e[2]=Math.ceil(e[2]);e[3]=Math.ceil(e[3])}var t=this.current.activeSMask;var r=this.suspendedCtx;T(r,t,this.ctx,e);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()};e.prototype.save=function(){this.ctx.save();var e=this.current;this.stateStack.push(e);this.current=e.clone()};e.prototype.restore=function(){if(this.stateStack.length===0&&this.current.activeSMask){this.endSMaskMode()}if(this.stateStack.length!==0){this.current=this.stateStack.pop();this.ctx.restore();this.checkSMaskState();this.pendingClip=null;this._cachedGetSinglePixelWidth=null}};e.prototype.transform=function(e,t,r,n,a,i){this.ctx.transform(e,t,r,n,a,i);this._cachedGetSinglePixelWidth=null};e.prototype.constructPath=function(e,t){var r=this.ctx;var a=this.current;var i=a.x,o=a.y;var s,l;for(var u=0,c=0,d=e.length;u<d;u++){switch(e[u]|0){case n.OPS.rectangle:i=t[c++];o=t[c++];var h=t[c++];var f=t[c++];var p=i+h;var v=o+f;r.moveTo(i,o);if(h===0||f===0){r.lineTo(p,v)}else{r.lineTo(p,o);r.lineTo(p,v);r.lineTo(i,v)}a.updatePathMinMax(r.mozCurrentTransform,i,o);a.updatePathMinMax(r.mozCurrentTransform,p,v);r.closePath();break;case n.OPS.moveTo:i=t[c++];o=t[c++];r.moveTo(i,o);a.updatePathMinMax(r.mozCurrentTransform,i,o);break;case n.OPS.lineTo:i=t[c++];o=t[c++];r.lineTo(i,o);a.updatePathMinMax(r.mozCurrentTransform,i,o);break;case n.OPS.curveTo:s=i;l=o;i=t[c+4];o=t[c+5];r.bezierCurveTo(t[c],t[c+1],t[c+2],t[c+3],i,o);a.updateCurvePathMinMax(r.mozCurrentTransform,s,l,t[c],t[c+1],t[c+2],t[c+3],i,o);c+=6;break;case n.OPS.curveTo2:s=i;l=o;r.bezierCurveTo(i,o,t[c],t[c+1],t[c+2],t[c+3]);a.updateCurvePathMinMax(r.mozCurrentTransform,s,l,i,o,t[c],t[c+1],t[c+2],t[c+3]);i=t[c+2];o=t[c+3];c+=4;break;case n.OPS.curveTo3:s=i;l=o;i=t[c+2];o=t[c+3];r.bezierCurveTo(t[c],t[c+1],i,o,i,o);a.updateCurvePathMinMax(r.mozCurrentTransform,s,l,t[c],t[c+1],i,o,i,o);c+=4;break;case n.OPS.closePath:r.closePath();break}}a.setCurrentPoint(i,o)};e.prototype.closePath=function(){this.ctx.closePath()};e.prototype.stroke=function(e){e=typeof e!=="undefined"?e:true;var t=this.ctx;var r=this.current.strokeColor;t.globalAlpha=this.current.strokeAlpha;if(this.contentVisible){if(typeof r==="object"&&(r===null||r===void 0?void 0:r.getPattern)){var n=this.getSinglePixelWidth();t.save();t.strokeStyle=r.getPattern(t,this,t.mozCurrentTransformInverse,a.PathType.STROKE);t.lineWidth=Math.max(n,this.current.lineWidth);t.stroke();t.restore()}else{var n=this.getSinglePixelWidth();if(n<0&&-n>=this.current.lineWidth){t.save();t.resetTransform();t.lineWidth=Math.round(this._combinedScaleFactor);t.stroke();t.restore()}else{t.lineWidth=Math.max(n,this.current.lineWidth);t.stroke()}}}if(e){this.consumePath(this.current.getClippedPathBoundingBox())}t.globalAlpha=this.current.fillAlpha};e.prototype.closeStroke=function(){this.closePath();this.stroke()};e.prototype.fill=function(e){e=typeof e!=="undefined"?e:true;var t=this.ctx;var r=this.current.fillColor;var n=this.current.patternFill;var i=false;if(n){t.save();t.fillStyle=r.getPattern(t,this,t.mozCurrentTransformInverse,a.PathType.FILL);i=true}var o=this.current.getClippedPathBoundingBox();if(this.contentVisible&&o!==null){if(this.pendingEOFill){t.fill("evenodd");this.pendingEOFill=false}else{t.fill()}}if(i){t.restore()}if(e){this.consumePath(o)}};e.prototype.eoFill=function(){this.pendingEOFill=true;this.fill()};e.prototype.fillStroke=function(){this.fill(false);this.stroke(false);this.consumePath()};e.prototype.eoFillStroke=function(){this.pendingEOFill=true;this.fillStroke()};e.prototype.closeFillStroke=function(){this.closePath();this.fillStroke()};e.prototype.closeEOFillStroke=function(){this.pendingEOFill=true;this.closePath();this.fillStroke()};e.prototype.endPath=function(){this.consumePath()};e.prototype.clip=function(){this.pendingClip=O};e.prototype.eoClip=function(){this.pendingClip=M};e.prototype.beginText=function(){this.current.textMatrix=n.IDENTITY_MATRIX;this.current.textMatrixScale=1;this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0};e.prototype.endText=function(){var e=this.pendingTextPaths;var t=this.ctx;if(e===undefined){t.beginPath();return}t.save();t.beginPath();for(var r=0;r<e.length;r++){var n=e[r];t.setTransform.apply(t,n.transform);t.translate(n.x,n.y);n.addToPath(t,n.fontSize)}t.restore();t.clip();t.beginPath();delete this.pendingTextPaths};e.prototype.setCharSpacing=function(e){this.current.charSpacing=e};e.prototype.setWordSpacing=function(e){this.current.wordSpacing=e};e.prototype.setHScale=function(e){this.current.textHScale=e/100};e.prototype.setLeading=function(e){this.current.leading=-e};e.prototype.setFont=function(e,t){var r=this.commonObjs.get(e);var a=this.current;if(!r){throw new Error("Can't find font for ".concat(e))}a.fontMatrix=r.fontMatrix||n.FONT_IDENTITY_MATRIX;if(a.fontMatrix[0]===0||a.fontMatrix[3]===0){(0,n.warn)("Invalid font matrix for font "+e)}if(t<0){t=-t;a.fontDirection=-1}else{a.fontDirection=1}this.current.font=r;this.current.fontSize=t;if(r.isType3Font){return}var i=r.loadedName||"sans-serif";var l="normal";if(r.black){l="900"}else if(r.bold){l="bold"}var u=r.italic?"italic":"normal";var c='"'.concat(i,'", ').concat(r.fallbackName);var d=t;if(t<o){d=o}else if(t>s){d=s}this.current.fontSizeScale=t/d;this.ctx.font="".concat(u," ").concat(l," ").concat(d,"px ").concat(c)};e.prototype.setTextRenderingMode=function(e){this.current.textRenderingMode=e};e.prototype.setTextRise=function(e){this.current.textRise=e};e.prototype.moveText=function(e,t){this.current.x=this.current.lineX+=e;this.current.y=this.current.lineY+=t};e.prototype.setLeadingMoveText=function(e,t){this.setLeading(-t);this.moveText(e,t)};e.prototype.setTextMatrix=function(e,t,r,n,a,i){this.current.textMatrix=[e,t,r,n,a,i];this.current.textMatrixScale=Math.hypot(e,t);this.current.x=this.current.lineX=0;this.current.y=this.current.lineY=0};e.prototype.nextLine=function(){this.moveText(0,this.current.leading)};e.prototype.paintChar=function(e,t,r,a,i){var o=this.ctx;var s=this.current;var l=s.font;var u=s.textRenderingMode;var c=s.fontSize/s.fontSizeScale;var d=u&n.TextRenderingMode.FILL_STROKE_MASK;var h=!!(u&n.TextRenderingMode.ADD_TO_PATH_FLAG);var f=s.patternFill&&!l.missingFile;var p;if(l.disableFontFace||h||f){p=l.getPathGenerator(this.commonObjs,e)}if(l.disableFontFace||f){o.save();o.translate(t,r);o.beginPath();p(o,c);if(a){o.setTransform.apply(o,a)}if(d===n.TextRenderingMode.FILL||d===n.TextRenderingMode.FILL_STROKE){o.fill()}if(d===n.TextRenderingMode.STROKE||d===n.TextRenderingMode.FILL_STROKE){if(i){o.resetTransform();o.lineWidth=Math.round(this._combinedScaleFactor)}o.stroke()}o.restore()}else{if(d===n.TextRenderingMode.FILL||d===n.TextRenderingMode.FILL_STROKE){o.fillText(e,t,r)}if(d===n.TextRenderingMode.STROKE||d===n.TextRenderingMode.FILL_STROKE){if(i){o.save();o.moveTo(t,r);o.resetTransform();o.lineWidth=Math.round(this._combinedScaleFactor);o.strokeText(e,0,0);o.restore()}else{o.strokeText(e,t,r)}}}if(h){var v=this.pendingTextPaths||(this.pendingTextPaths=[]);v.push({transform:o.mozCurrentTransform,x:t,y:r,fontSize:c,addToPath:p})}};Object.defineProperty(e.prototype,"isFontSubpixelAAEnabled",{get:function(){var e=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10).context;e.scale(1.5,1);e.fillText("I",0,10);var t=e.getImageData(0,0,10,10).data;var r=false;for(var a=3;a<t.length;a+=4){if(t[a]>0&&t[a]<255){r=true;break}}return(0,n.shadow)(this,"isFontSubpixelAAEnabled",r)},enumerable:false,configurable:true});e.prototype.showText=function(e){var t=this.current;var r=t.font;if(r.isType3Font){return this.showType3Text(e)}var i=t.fontSize;if(i===0){return undefined}var o=this.ctx;var s=t.fontSizeScale;var l=t.charSpacing;var u=t.wordSpacing;var c=t.fontDirection;var d=t.textHScale*c;var h=e.length;var f=r.vertical;var p=f?1:-1;var v=r.defaultVMetrics;var g=i*t.fontMatrix[0];var m=t.textRenderingMode===n.TextRenderingMode.FILL&&!r.disableFontFace&&!t.patternFill;o.save();o.transform.apply(o,t.textMatrix);o.translate(t.x,t.y+t.textRise);if(c>0){o.scale(d,-1)}else{o.scale(d,1)}var _;if(t.patternFill){o.save();var y=t.fillColor.getPattern(o,this,o.mozCurrentTransformInverse,a.PathType.FILL);_=o.mozCurrentTransform;o.restore();o.fillStyle=y}var b=t.lineWidth;var A=false;var S=t.textMatrixScale;if(S===0||b===0){var x=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(x===n.TextRenderingMode.STROKE||x===n.TextRenderingMode.FILL_STROKE){this._cachedGetSinglePixelWidth=null;b=this.getSinglePixelWidth();A=b<0}}else{b/=S}if(s!==1){o.scale(s,s);b/=s}o.lineWidth=b;var C=0,P;for(P=0;P<h;++P){var w=e[P];if((0,n.isNum)(w)){C+=p*w*i/1e3;continue}var k=false;var T=(w.isSpace?u:0)+l;var R=w.fontChar;var F=w.accent;var E=void 0,O=void 0;var M=w.width;if(f){var D=w.vmetric||v;var L=-(w.vmetric?D[1]:M*.5)*g;var I=D[2]*g;M=D?-D[0]:M;E=L/s;O=(C+I)/s}else{E=C/s;O=0}if(r.remeasure&&M>0){var N=o.measureText(R).width*1e3/i*s;if(M<N&&this.isFontSubpixelAAEnabled){var j=M/N;k=true;o.save();o.scale(j,1);E/=j}else if(M!==N){E+=(M-N)/2e3*i/s}}if(this.contentVisible&&(w.isInFont||r.missingFile)){if(m&&!F){o.fillText(R,E,O)}else{this.paintChar(R,E,O,_,A);if(F){var U=E+i*F.offset.x/s;var W=O-i*F.offset.y/s;this.paintChar(F.fontChar,U,W,_,A)}}}var B=void 0;if(f){B=M*g-T*c}else{B=M*g+T*c}C+=B;if(k){o.restore()}}if(f){t.y-=C}else{t.x+=C*d}o.restore();this.compose();return undefined};e.prototype.showType3Text=function(e){var t=this.ctx;var r=this.current;var a=r.font;var i=r.fontSize;var o=r.fontDirection;var s=a.vertical?1:-1;var l=r.charSpacing;var u=r.wordSpacing;var c=r.textHScale*o;var d=r.fontMatrix||n.FONT_IDENTITY_MATRIX;var h=e.length;var f=r.textRenderingMode===n.TextRenderingMode.INVISIBLE;var p,v,g,m;if(f||i===0){return}this._cachedGetSinglePixelWidth=null;t.save();t.transform.apply(t,r.textMatrix);t.translate(r.x,r.y);t.scale(c,o);for(p=0;p<h;++p){v=e[p];if((0,n.isNum)(v)){m=s*v*i/1e3;this.ctx.translate(m,0);r.x+=m*c;continue}var _=(v.isSpace?u:0)+l;var y=a.charProcOperatorList[v.operatorListId];if(!y){(0,n.warn)('Type3 character "'.concat(v.operatorListId,'" is not available.'));continue}if(this.contentVisible){this.processingType3=v;this.save();t.scale(i,i);t.transform.apply(t,d);this.executeOperatorList(y);this.restore()}var b=n.Util.applyTransform([v.width,0],d);g=b[0]*i+_;t.translate(g,0);r.x+=g*c}t.restore();this.processingType3=null};e.prototype.setCharWidth=function(e,t){};e.prototype.setCharWidthAndBounds=function(e,t,r,n,a,i){this.ctx.rect(r,n,a-r,i-n);this.clip();this.endPath()};e.prototype.getColorN_Pattern=function(t){var r=this;var n;if(t[0]==="TilingPattern"){var i=t[1];var o=this.baseTransform||this.ctx.mozCurrentTransform.slice();var s={createCanvasGraphics:function(t){return new e(t,r.commonObjs,r.objs,r.canvasFactory)}};n=new a.TilingPattern(t,i,this.ctx,s,o)}else{n=this._getPattern(t[1],t[2])}return n};e.prototype.setStrokeColorN=function(){this.current.strokeColor=this.getColorN_Pattern(arguments)};e.prototype.setFillColorN=function(){this.current.fillColor=this.getColorN_Pattern(arguments);this.current.patternFill=true};e.prototype.setStrokeRGBColor=function(e,t,r){var a=n.Util.makeHexColor(e,t,r);this.ctx.strokeStyle=a;this.current.strokeColor=a};e.prototype.setFillRGBColor=function(e,t,r){var a=n.Util.makeHexColor(e,t,r);this.ctx.fillStyle=a;this.current.fillColor=a;this.current.patternFill=false};e.prototype._getPattern=function(e,t){if(t===void 0){t=null}var r;if(this.cachedPatterns.has(e)){r=this.cachedPatterns.get(e)}else{r=(0,a.getShadingPattern)(this.objs.get(e));this.cachedPatterns.set(e,r)}if(t){r.matrix=t}return r};e.prototype.shadingFill=function(e){if(!this.contentVisible){return}var t=this.ctx;this.save();var r=this._getPattern(e);t.fillStyle=r.getPattern(t,this,t.mozCurrentTransformInverse,a.PathType.SHADING);var i=t.mozCurrentTransformInverse;if(i){var o=t.canvas;var s=o.width;var l=o.height;var u=n.Util.applyTransform([0,0],i);var c=n.Util.applyTransform([0,l],i);var d=n.Util.applyTransform([s,0],i);var h=n.Util.applyTransform([s,l],i);var f=Math.min(u[0],c[0],d[0],h[0]);var p=Math.min(u[1],c[1],d[1],h[1]);var v=Math.max(u[0],c[0],d[0],h[0]);var g=Math.max(u[1],c[1],d[1],h[1]);this.ctx.fillRect(f,p,v-f,g-p)}else{this.ctx.fillRect(-1e10,-1e10,2e10,2e10)}this.compose(this.current.getClippedPathBoundingBox());this.restore()};e.prototype.beginInlineImage=function(){(0,n.unreachable)("Should not call beginInlineImage")};e.prototype.beginImageData=function(){(0,n.unreachable)("Should not call beginImageData")};e.prototype.paintFormXObjectBegin=function(e,t){if(!this.contentVisible){return}this.save();this.baseTransformStack.push(this.baseTransform);if(Array.isArray(e)&&e.length===6){this.transform.apply(this,e)}this.baseTransform=this.ctx.mozCurrentTransform;if(t){var r=t[2]-t[0];var n=t[3]-t[1];this.ctx.rect(t[0],t[1],r,n);this.current.updatePathMinMax(this.ctx.mozCurrentTransform,t[0],t[1]);this.current.updatePathMinMax(this.ctx.mozCurrentTransform,t[2],t[3]);this.clip();this.endPath()}};e.prototype.paintFormXObjectEnd=function(){if(!this.contentVisible){return}this.restore();this.baseTransform=this.baseTransformStack.pop()};e.prototype.beginGroup=function(e){if(!this.contentVisible){return}this.save();var t=this.suspendedCtx;if(this.current.activeSMask){this.suspendedCtx=null;this.current.activeSMask=null}var r=this.ctx;if(!e.isolated){(0,n.info)("TODO: Support non-isolated groups.")}if(e.knockout){(0,n.warn)("Knockout groups not supported.")}var a=r.mozCurrentTransform;if(e.matrix){r.transform.apply(r,e.matrix)}if(!e.bbox){throw new Error("Bounding box is required.")}var i=n.Util.getAxialAlignedBoundingBox(e.bbox,r.mozCurrentTransform);var o=[0,0,r.canvas.width,r.canvas.height];i=n.Util.intersect(i,o)||[0,0,0,0];var s=Math.floor(i[0]);var u=Math.floor(i[1]);var c=Math.max(Math.ceil(i[2])-s,1);var d=Math.max(Math.ceil(i[3])-u,1);var h=1,f=1;if(c>l){h=c/l;c=l}if(d>l){f=d/l;d=l}this.current.startNewPathAndClipBox([0,0,c,d]);var p="groupAt"+this.groupLevel;if(e.smask){p+="_smask_"+this.smaskCounter++%2}var v=this.cachedCanvases.getCanvas(p,c,d,true);var g=v.context;g.scale(1/h,1/f);g.translate(-s,-u);g.transform.apply(g,a);if(e.smask){this.smaskStack.push({canvas:v.canvas,context:g,offsetX:s,offsetY:u,scaleX:h,scaleY:f,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null})}else{r.setTransform(1,0,0,1,0,0);r.translate(s,u);r.scale(h,f);r.save()}S(r,g);this.ctx=g;this.setGState([["BM","source-over"],["ca",1],["CA",1]]);this.groupStack.push({ctx:r,suspendedCtx:t});this.groupLevel++};e.prototype.endGroup=function(e){if(!this.contentVisible){return}this.groupLevel--;var t=this.ctx;var r=this.groupStack.pop(),a=r.ctx,i=r.suspendedCtx;this.ctx=a;this.ctx.imageSmoothingEnabled=false;if(i){this.suspendedCtx=i}if(e.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 s=n.Util.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],o);this.ctx.drawImage(t.canvas,0,0);this.ctx.restore();this.compose(s)}};e.prototype.beginAnnotations=function(){this.save();if(this.baseTransform){this.ctx.setTransform.apply(this.ctx,this.baseTransform)}};e.prototype.endAnnotations=function(){this.restore()};e.prototype.beginAnnotation=function(e,t,r,a,i){this.save();if(Array.isArray(t)&&t.length===4){var o=t[2]-t[0];var s=t[3]-t[1];if(i&&this.annotationCanvasMap){r=r.slice();r[4]-=t[0];r[5]-=t[1];t=t.slice();t[0]=t[1]=0;t[2]=o;t[3]=s;var l=n.Util.singularValueDecompose2dScale(this.ctx.mozCurrentTransform),u=l[0],c=l[1];var d=this.viewportScale;var h=Math.ceil(o*this.outputScaleX*d);var f=Math.ceil(s*this.outputScaleY*d);this.annotationCanvas=this.canvasFactory.create(h,f);var p=this.annotationCanvas,v=p.canvas,m=p.context;v.style.width="calc(".concat(o,"px * var(--viewport-scale-factor))");v.style.height="calc(".concat(s,"px * var(--viewport-scale-factor))");this.annotationCanvasMap.set(e,v);this.annotationCanvas.savedCtx=this.ctx;this.ctx=m;this.ctx.setTransform(u,0,0,-c,0,s*c);g(this.ctx);x(this.ctx)}else{x(this.ctx);this.ctx.rect(t[0],t[1],o,s);this.clip();this.endPath()}}this.current=new y(this.ctx.canvas.width,this.ctx.canvas.height);this.transform.apply(this,r);this.transform.apply(this,a)};e.prototype.endAnnotation=function(){if(this.annotationCanvas){this.ctx=this.annotationCanvas.savedCtx;delete this.annotationCanvas.savedCtx;delete this.annotationCanvas}this.restore()};e.prototype.paintImageMaskXObject=function(e){if(!this.contentVisible){return}var t=this.ctx;var r=e.width,n=e.height;var a=this.processingType3;if(d&&a&&a.compiled===undefined){if(r<=h&&n<=h){a.compiled=_({data:e.data,width:r,height:n})}else{a.compiled=null}}if(a===null||a===void 0?void 0:a.compiled){a.compiled(t);return}var i=this._createMaskCanvas(e);var o=i.canvas;t.save();t.setTransform(1,0,0,1,0,0);t.drawImage(o,i.offsetX,i.offsetY);t.restore();this.compose()};e.prototype.paintImageMaskXObjectRepeat=function(e,t,r,a,i,o){if(r===void 0){r=0}if(a===void 0){a=0}if(!this.contentVisible){return}var s=this.ctx;s.save();var l=s.mozCurrentTransform;s.transform(t,r,a,i,0,0);var u=this._createMaskCanvas(e);s.setTransform(1,0,0,1,0,0);for(var c=0,d=o.length;c<d;c+=2){var h=n.Util.transform(l,[t,r,a,i,o[c],o[c+1]]);var f=n.Util.applyTransform([0,0],h),p=f[0],v=f[1];s.drawImage(u.canvas,p,v)}s.restore();this.compose()};e.prototype.paintImageMaskXObjectGroup=function(e){if(!this.contentVisible){return}var t=this.ctx;var r=this.current.fillColor;var n=this.current.patternFill;for(var i=0,o=e.length;i<o;i++){var s=e[i];var l=s.width,u=s.height;var c=this.cachedCanvases.getCanvas("maskCanvas",l,u);var d=c.context;d.save();A(d,s);d.globalCompositeOperation="source-in";d.fillStyle=n?r.getPattern(d,this,t.mozCurrentTransformInverse,a.PathType.FILL):r;d.fillRect(0,0,l,u);d.restore();t.save();t.transform.apply(t,s.transform);t.scale(1,-1);t.drawImage(c.canvas,0,0,l,u,0,-1,1,1);t.restore()}this.compose()};e.prototype.paintImageXObject=function(e){if(!this.contentVisible){return}var t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);if(!t){(0,n.warn)("Dependent image isn't ready yet");return}this.paintInlineImageXObject(t)};e.prototype.paintImageXObjectRepeat=function(e,t,r,a){if(!this.contentVisible){return}var i=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);if(!i){(0,n.warn)("Dependent image isn't ready yet");return}var o=i.width;var s=i.height;var l=[];for(var u=0,c=a.length;u<c;u+=2){l.push({transform:[t,0,0,r,a[u],a[u+1]],x:0,y:0,w:o,h:s})}this.paintInlineImageXObjectGroup(i,l)};e.prototype.paintInlineImageXObject=function(e){if(!this.contentVisible){return}var t=e.width;var r=e.height;var n=this.ctx;this.save();n.scale(1/t,-1/r);var a;if(typeof HTMLElement==="function"&&e instanceof HTMLElement||!e.data){a=e}else{var i=this.cachedCanvases.getCanvas("inlineImage",t,r);var o=i.context;b(o,e,this.current.transferMaps);a=i.canvas}var s=this._scaleImage(a,n.mozCurrentTransformInverse);n.imageSmoothingEnabled=R(n.mozCurrentTransform,e.interpolate);n.drawImage(s.img,0,0,s.paintWidth,s.paintHeight,0,-r,t,r);if(this.imageLayer){var l=this.getCanvasPosition(0,-r);this.imageLayer.appendImage({imgData:e,left:l[0],top:l[1],width:t/n.mozCurrentTransformInverse[0],height:r/n.mozCurrentTransformInverse[3]})}this.compose();this.restore()};e.prototype.paintInlineImageXObjectGroup=function(e,t){if(!this.contentVisible){return}var r=this.ctx;var n=e.width;var a=e.height;var i=this.cachedCanvases.getCanvas("inlineImage",n,a);var o=i.context;b(o,e,this.current.transferMaps);for(var s=0,l=t.length;s<l;s++){var u=t[s];r.save();r.transform.apply(r,u.transform);r.scale(1,-1);r.drawImage(i.canvas,u.x,u.y,u.w,u.h,0,-1,1,1);if(this.imageLayer){var c=this.getCanvasPosition(u.x,u.y);this.imageLayer.appendImage({imgData:e,left:c[0],top:c[1],width:n,height:a})}r.restore()}this.compose()};e.prototype.paintSolidColorImageMask=function(){if(!this.contentVisible){return}this.ctx.fillRect(0,0,1,1);this.compose()};e.prototype.markPoint=function(e){};e.prototype.markPointProps=function(e,t){};e.prototype.beginMarkedContent=function(e){this.markedContentStack.push({visible:true})};e.prototype.beginMarkedContentProps=function(e,t){if(e==="OC"){this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(t)})}else{this.markedContentStack.push({visible:true})}this.contentVisible=this.isContentVisible()};e.prototype.endMarkedContent=function(){this.markedContentStack.pop();this.contentVisible=this.isContentVisible()};e.prototype.beginCompat=function(){};e.prototype.endCompat=function(){};e.prototype.consumePath=function(e){if(this.pendingClip){this.current.updateClipFromPath()}if(!this.pendingClip){this.compose(e)}var t=this.ctx;if(this.pendingClip){if(this.pendingClip===M){t.clip("evenodd")}else{t.clip()}this.pendingClip=null}this.current.startNewPathAndClipBox(this.current.clipBox);t.beginPath()};e.prototype.getSinglePixelWidth=function(){if(this._cachedGetSinglePixelWidth===null){var e=this.ctx.mozCurrentTransform;var t=Math.abs(e[0]*e[3]-e[2]*e[1]);var r=Math.pow(e[0],2)+Math.pow(e[2],2);var n=Math.pow(e[1],2)+Math.pow(e[3],2);var a=Math.sqrt(Math.max(r,n))/t;if(r!==n&&this._combinedScaleFactor*a>1){this._cachedGetSinglePixelWidth=-(this._combinedScaleFactor*a)}else if(t>Number.EPSILON){this._cachedGetSinglePixelWidth=a}else{this._cachedGetSinglePixelWidth=1}}return this._cachedGetSinglePixelWidth};e.prototype.getCanvasPosition=function(e,t){var r=this.ctx.mozCurrentTransform;return[r[0]*e+r[2]*t+r[4],r[1]*e+r[3]*t+r[5]]};e.prototype.isContentVisible=function(){for(var e=this.markedContentStack.length-1;e>=0;e--){if(!this.markedContentStack[e].visible){return false}}return true};return e}();t.CanvasGraphics=D;for(var L in n.OPS){if(D.prototype[L]!==undefined){D.prototype[n.OPS[L]]=D.prototype[L]}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.TilingPattern=t.PathType=void 0;t.getShadingPattern=h;var n=r(2);var a={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};t.PathType=a;function i(e,t){if(!t||typeof Path2D==="undefined"){return}var r=t[2]-t[0];var n=t[3]-t[1];var a=new Path2D;a.rect(t[0],t[1],r,n);e.clip(a)}var o=function(){function e(){if(this.constructor===e){(0,n.unreachable)("Cannot initialize BaseShadingPattern.")}}e.prototype.getPattern=function(){(0,n.unreachable)("Abstract method `getPattern` called.")};return e}();var s=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;r._type=t[1];r._bbox=t[2];r._colorStops=t[3];r._p0=t[4];r._p1=t[5];r._r0=t[6];r._r1=t[7];r.matrix=null;return r}t.prototype._createGradient=function(e){var t;if(this._type==="axial"){t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1])}else if(this._type==="radial"){t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1)}for(var r=0,n=this._colorStops;r<n.length;r++){var a=n[r];t.addColorStop(a[0],a[1])}return t};t.prototype.getPattern=function(e,t,r,o){var s;if(o===a.STROKE||o===a.FILL){var l=t.current.getClippedPathBoundingBox(o,e.mozCurrentTransform)||[0,0,0,0];var u=Math.ceil(l[2]-l[0])||1;var c=Math.ceil(l[3]-l[1])||1;var d=t.cachedCanvases.getCanvas("pattern",u,c,true);var 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(-l[0],-l[1]);r=n.Util.transform(r,[1,0,0,1,l[0],l[1]]);h.transform.apply(h,t.baseTransform);if(this.matrix){h.transform.apply(h,this.matrix)}i(h,this._bbox);h.fillStyle=this._createGradient(h);h.fill();s=e.createPattern(d.canvas,"no-repeat");var f=new DOMMatrix(r);try{s.setTransform(f)}catch(e){(0,n.warn)('RadialAxialShadingPattern.getPattern: "'.concat(e===null||e===void 0?void 0:e.message,'".'))}}else{i(e,this._bbox);s=this._createGradient(e)}return s};return t}(o);function l(e,t,r,n,a,i,o,s){var l=t.coords,u=t.colors;var c=e.data,d=e.width*4;var h;if(l[r+1]>l[n+1]){h=r;r=n;n=h;h=i;i=o;o=h}if(l[n+1]>l[a+1]){h=n;n=a;a=h;h=o;o=s;s=h}if(l[r+1]>l[n+1]){h=r;r=n;n=h;h=i;i=o;o=h}var f=(l[r]+t.offsetX)*t.scaleX;var p=(l[r+1]+t.offsetY)*t.scaleY;var v=(l[n]+t.offsetX)*t.scaleX;var g=(l[n+1]+t.offsetY)*t.scaleY;var m=(l[a]+t.offsetX)*t.scaleX;var _=(l[a+1]+t.offsetY)*t.scaleY;if(p>=_){return}var y=u[i],b=u[i+1],A=u[i+2];var S=u[o],x=u[o+1],C=u[o+2];var P=u[s],w=u[s+1],k=u[s+2];var T=Math.round(p),R=Math.round(_);var F,E,O,M;var D,L,I,N;for(var j=T;j<=R;j++){if(j<g){var U=void 0;if(j<p){U=0}else{U=(p-j)/(p-g)}F=f-(f-v)*U;E=y-(y-S)*U;O=b-(b-x)*U;M=A-(A-C)*U}else{var W=void 0;if(j>_){W=1}else if(g===_){W=0}else{W=(g-j)/(g-_)}F=v-(v-m)*W;E=S-(S-P)*W;O=x-(x-w)*W;M=C-(C-k)*W}var B=void 0;if(j<p){B=0}else if(j>_){B=1}else{B=(p-j)/(p-_)}D=f-(f-m)*B;L=y-(y-P)*B;I=b-(b-w)*B;N=A-(A-k)*B;var q=Math.round(Math.min(F,D));var G=Math.round(Math.max(F,D));var V=d*j+q*4;for(var H=q;H<=G;H++){B=(F-H)/(F-D);if(B<0){B=0}else if(B>1){B=1}c[V++]=E-(E-L)*B|0;c[V++]=O-(O-I)*B|0;c[V++]=M-(M-N)*B|0;c[V++]=255}}}function u(e,t,r){var n=t.coords;var a=t.colors;var i,o;switch(t.type){case"lattice":var s=t.verticesPerRow;var u=Math.floor(n.length/s)-1;var c=s-1;for(i=0;i<u;i++){var d=i*s;for(var h=0;h<c;h++,d++){l(e,r,n[d],n[d+1],n[d+s],a[d],a[d+1],a[d+s]);l(e,r,n[d+s+1],n[d+1],n[d+s],a[d+s+1],a[d+1],a[d+s])}}break;case"triangles":for(i=0,o=n.length;i<o;i+=3){l(e,r,n[i],n[i+1],n[i+2],a[i],a[i+1],a[i+2])}break;default:throw new Error("illegal figure")}}var c=function(e){__extends(t,e);function t(t){var r=e.call(this)||this;r._coords=t[2];r._colors=t[3];r._figures=t[4];r._bounds=t[5];r._bbox=t[7];r._background=t[8];r.matrix=null;return r}t.prototype._createMeshCanvas=function(e,t,r){var n=1.1;var a=3e3;var i=2;var o=Math.floor(this._bounds[0]);var s=Math.floor(this._bounds[1]);var l=Math.ceil(this._bounds[2])-o;var c=Math.ceil(this._bounds[3])-s;var d=Math.min(Math.ceil(Math.abs(l*e[0]*n)),a);var h=Math.min(Math.ceil(Math.abs(c*e[1]*n)),a);var f=l/d;var p=c/h;var v={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-s,scaleX:1/f,scaleY:1/p};var g=d+i*2;var m=h+i*2;var _=r.getCanvas("mesh",g,m,false);var y=_.context;var b=y.createImageData(d,h);if(t){var A=b.data;for(var S=0,x=A.length;S<x;S+=4){A[S]=t[0];A[S+1]=t[1];A[S+2]=t[2];A[S+3]=255}}for(var C=0,P=this._figures;C<P.length;C++){var w=P[C];u(b,w,v)}y.putImageData(b,i,i);var k=_.canvas;return{canvas:k,offsetX:o-i*f,offsetY:s-i*p,scaleX:f,scaleY:p}};t.prototype.getPattern=function(e,t,r,o){i(e,this._bbox);var s;if(o===a.SHADING){s=n.Util.singularValueDecompose2dScale(e.mozCurrentTransform)}else{s=n.Util.singularValueDecompose2dScale(t.baseTransform);if(this.matrix){var l=n.Util.singularValueDecompose2dScale(this.matrix);s=[s[0]*l[0],s[1]*l[1]]}}var u=this._createMeshCanvas(s,o===a.SHADING?null:this._background,t.cachedCanvases);if(o!==a.SHADING){e.setTransform.apply(e,t.baseTransform);if(this.matrix){e.transform.apply(e,this.matrix)}}e.translate(u.offsetX,u.offsetY);e.scale(u.scaleX,u.scaleY);return e.createPattern(u.canvas,"no-repeat")};return t}(o);var d=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.getPattern=function(){return"hotpink"};return t}(o);function h(e){switch(e[0]){case"RadialAxial":return new s(e);case"Mesh":return new c(e);case"Dummy":return new d}throw new Error("Unknown IR type: ".concat(e[0]))}var f={COLORED:1,UNCOLORED:2};var p=function(){function e(e,t,r,n,a){this.operatorList=e[2];this.matrix=e[3]||[1,0,0,1,0,0];this.bbox=e[4];this.xstep=e[5];this.ystep=e[6];this.paintType=e[7];this.tilingType=e[8];this.color=t;this.ctx=r;this.canvasGraphicsFactory=n;this.baseTransform=a}Object.defineProperty(e,"MAX_PATTERN_SIZE",{get:function(){return(0,n.shadow)(this,"MAX_PATTERN_SIZE",3e3)},enumerable:false,configurable:true});e.prototype.createPatternCanvas=function(e){var t=this.operatorList;var r=this.bbox;var a=this.xstep;var i=this.ystep;var o=this.paintType;var s=this.tilingType;var l=this.color;var u=this.canvasGraphicsFactory;(0,n.info)("TilingType: "+s);var c=r[0],d=r[1],h=r[2],f=r[3];var p=n.Util.singularValueDecompose2dScale(this.matrix);var v=n.Util.singularValueDecompose2dScale(this.baseTransform);var g=[p[0]*v[0],p[1]*v[1]];var m=this.getSizeAndScale(a,this.ctx.canvas.width,g[0]);var _=this.getSizeAndScale(i,this.ctx.canvas.height,g[1]);var y=e.cachedCanvases.getCanvas("pattern",m.size,_.size,true);var b=y.context;var A=u.createCanvasGraphics(b);A.groupLevel=e.groupLevel;this.setFillAndStrokeStyleToContext(A,o,l);var S=c;var x=d;var C=h;var P=f;if(c<0){S=0;C+=Math.abs(c)}if(d<0){x=0;P+=Math.abs(d)}b.translate(-(m.scale*S),-(_.scale*x));A.transform(m.scale,0,0,_.scale,0,0);this.clipBbox(A,S,x,C,P);A.baseTransform=A.ctx.mozCurrentTransform.slice();A.executeOperatorList(t);A.endDrawing();return{canvas:y.canvas,scaleX:m.scale,scaleY:_.scale,offsetX:S,offsetY:x}};e.prototype.getSizeAndScale=function(t,r,n){t=Math.abs(t);var a=Math.max(e.MAX_PATTERN_SIZE,r);var i=Math.ceil(t*n);if(i>=a){i=a}else{n=i/t}return{scale:n,size:i}};e.prototype.clipBbox=function(e,t,r,n,a){var i=n-t;var o=a-r;e.ctx.rect(t,r,i,o);e.clip();e.endPath()};e.prototype.setFillAndStrokeStyleToContext=function(e,t,r){var a=e.ctx,i=e.current;switch(t){case f.COLORED:var o=this.ctx;a.fillStyle=o.fillStyle;a.strokeStyle=o.strokeStyle;i.fillColor=o.fillStyle;i.strokeColor=o.strokeStyle;break;case f.UNCOLORED:var s=n.Util.makeHexColor(r[0],r[1],r[2]);a.fillStyle=s;a.strokeStyle=s;i.fillColor=s;i.strokeColor=s;break;default:throw new n.FormatError("Unsupported paint type: ".concat(t))}};e.prototype.getPattern=function(e,t,r,i){var o=r;if(i!==a.SHADING){o=n.Util.transform(o,t.baseTransform);if(this.matrix){o=n.Util.transform(o,this.matrix)}}var s=this.createPatternCanvas(t);var l=new DOMMatrix(o);l=l.translate(s.offsetX,s.offsetY);l=l.scale(1/s.scaleX,1/s.scaleY);var u=e.createPattern(s.canvas,"repeat");try{u.setTransform(l)}catch(e){(0,n.warn)('TilingPattern.getPattern: "'.concat(e===null||e===void 0?void 0:e.message,'".'))}return u};return e}();t.TilingPattern=p},function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.GlobalWorkerOptions=void 0;var r=Object.create(null);t.GlobalWorkerOptions=r;r.workerPort=r.workerPort===undefined?null:r.workerPort;r.workerSrc=r.workerSrc===undefined?"":r.workerSrc},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.MessageHandler=void 0;var n=r(2);var a={UNKNOWN:0,DATA:1,ERROR:2};var i={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function o(e){if(!(e instanceof Error||typeof e==="object"&&e!==null)){(0,n.warn)('wrapReason: Expected "reason" to be a (possibly cloned) Error.');return e}switch(e.name){case"AbortException":return new n.AbortException(e.message);case"MissingPDFException":return new n.MissingPDFException(e.message);case"PasswordException":return new n.PasswordException(e.message,e.code);case"UnexpectedResponseException":return new n.UnexpectedResponseException(e.message,e.status);case"UnknownErrorException":return new n.UnknownErrorException(e.message,e.details);default:return new n.UnknownErrorException(e.message,e.toString())}}var s=function(){function e(e,t,r){var n=this;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=function(e){var t=e.data;if(t.targetName!==n.sourceName){return}if(t.stream){n._processStreamMessage(t);return}if(t.callback){var i=t.callbackId;var s=n.callbackCapabilities[i];if(!s){throw new Error("Cannot resolve callback ".concat(i))}delete n.callbackCapabilities[i];if(t.callback===a.DATA){s.resolve(t.data)}else if(t.callback===a.ERROR){s.reject(o(t.reason))}else{throw new Error("Unexpected callback case")}return}var l=n.actionHandler[t.action];if(!l){throw new Error("Unknown action from worker: ".concat(t.action))}if(t.callbackId){var u=n.sourceName;var c=t.sourceName;new Promise((function(e){e(l(t.data))})).then((function(e){r.postMessage({sourceName:u,targetName:c,callback:a.DATA,callbackId:t.callbackId,data:e})}),(function(e){r.postMessage({sourceName:u,targetName:c,callback:a.ERROR,callbackId:t.callbackId,reason:o(e)})}));return}if(t.streamId){n._createStreamSink(t);return}l(t.data)};r.addEventListener("message",this._onComObjOnMessage)}e.prototype.on=function(e,t){var r=this.actionHandler;if(r[e]){throw new Error('There is already an actionName called "'.concat(e,'"'))}r[e]=t};e.prototype.send=function(e,t,r){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},r)};e.prototype.sendWithPromise=function(e,t,r){var a=this.callbackId++;var i=(0,n.createPromiseCapability)();this.callbackCapabilities[a]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:a,data:t},r)}catch(e){i.reject(e)}return i.promise};e.prototype.sendWithStream=function(e,t,r,a){var s=this;var l=this.streamId++,u=this.sourceName,c=this.targetName,d=this.comObj;return new ReadableStream({start:function(r){var i=(0,n.createPromiseCapability)();s.streamControllers[l]={controller:r,startCall:i,pullCall:null,cancelCall:null,isClosed:false};d.postMessage({sourceName:u,targetName:c,action:e,streamId:l,data:t,desiredSize:r.desiredSize},a);return i.promise},pull:function(e){var t=(0,n.createPromiseCapability)();s.streamControllers[l].pullCall=t;d.postMessage({sourceName:u,targetName:c,stream:i.PULL,streamId:l,desiredSize:e.desiredSize});return t.promise},cancel:function(e){(0,n.assert)(e instanceof Error,"cancel must have a valid reason");var t=(0,n.createPromiseCapability)();s.streamControllers[l].cancelCall=t;s.streamControllers[l].isClosed=true;d.postMessage({sourceName:u,targetName:c,stream:i.CANCEL,streamId:l,reason:o(e)});return t.promise}},r)};e.prototype._createStreamSink=function(e){var t=e.streamId,r=this.sourceName,a=e.sourceName,s=this.comObj;var l=this,u=this.actionHandler[e.action];var c={enqueue:function(e,o,l){if(o===void 0){o=1}if(this.isCancelled){return}var u=this.desiredSize;this.desiredSize-=o;if(u>0&&this.desiredSize<=0){this.sinkCapability=(0,n.createPromiseCapability)();this.ready=this.sinkCapability.promise}s.postMessage({sourceName:r,targetName:a,stream:i.ENQUEUE,streamId:t,chunk:e},l)},close:function(){if(this.isCancelled){return}this.isCancelled=true;s.postMessage({sourceName:r,targetName:a,stream:i.CLOSE,streamId:t});delete l.streamSinks[t]},error:function(e){(0,n.assert)(e instanceof Error,"error must have a valid reason");if(this.isCancelled){return}this.isCancelled=true;s.postMessage({sourceName:r,targetName:a,stream:i.ERROR,streamId:t,reason:o(e)})},sinkCapability:(0,n.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:false,desiredSize:e.desiredSize,ready:null};c.sinkCapability.resolve();c.ready=c.sinkCapability.promise;this.streamSinks[t]=c;new Promise((function(t){t(u(e.data,c))})).then((function(){s.postMessage({sourceName:r,targetName:a,stream:i.START_COMPLETE,streamId:t,success:true})}),(function(e){s.postMessage({sourceName:r,targetName:a,stream:i.START_COMPLETE,streamId:t,reason:o(e)})}))};e.prototype._processStreamMessage=function(e){var t=e.streamId,r=this.sourceName,a=e.sourceName,s=this.comObj;var l=this.streamControllers[t],u=this.streamSinks[t];switch(e.stream){case i.START_COMPLETE:if(e.success){l.startCall.resolve()}else{l.startCall.reject(o(e.reason))}break;case i.PULL_COMPLETE:if(e.success){l.pullCall.resolve()}else{l.pullCall.reject(o(e.reason))}break;case i.PULL:if(!u){s.postMessage({sourceName:r,targetName:a,stream:i.PULL_COMPLETE,streamId:t,success:true});break}if(u.desiredSize<=0&&e.desiredSize>0){u.sinkCapability.resolve()}u.desiredSize=e.desiredSize;new Promise((function(e){e(u.onPull&&u.onPull())})).then((function(){s.postMessage({sourceName:r,targetName:a,stream:i.PULL_COMPLETE,streamId:t,success:true})}),(function(e){s.postMessage({sourceName:r,targetName:a,stream:i.PULL_COMPLETE,streamId:t,reason:o(e)})}));break;case i.ENQUEUE:(0,n.assert)(l,"enqueue should have stream controller");if(l.isClosed){break}l.controller.enqueue(e.chunk);break;case i.CLOSE:(0,n.assert)(l,"close should have stream controller");if(l.isClosed){break}l.isClosed=true;l.controller.close();this._deleteStreamController(l,t);break;case i.ERROR:(0,n.assert)(l,"error should have stream controller");l.controller.error(o(e.reason));this._deleteStreamController(l,t);break;case i.CANCEL_COMPLETE:if(e.success){l.cancelCall.resolve()}else{l.cancelCall.reject(o(e.reason))}this._deleteStreamController(l,t);break;case i.CANCEL:if(!u){break}new Promise((function(t){t(u.onCancel&&u.onCancel(o(e.reason)))})).then((function(){s.postMessage({sourceName:r,targetName:a,stream:i.CANCEL_COMPLETE,streamId:t,success:true})}),(function(e){s.postMessage({sourceName:r,targetName:a,stream:i.CANCEL_COMPLETE,streamId:t,reason:o(e)})}));u.sinkCapability.reject(o(e.reason));u.isCancelled=true;delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}};e.prototype._deleteStreamController=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,Promise.allSettled([e.startCall&&e.startCall.promise,e.pullCall&&e.pullCall.promise,e.cancelCall&&e.cancelCall.promise])];case 1:r.sent();delete this.streamControllers[t];return[2]}}))}))};e.prototype.destroy=function(){this.comObj.removeEventListener("message",this._onComObjOnMessage)};return e}();t.MessageHandler=s},function(e,t,r){var n,a;Object.defineProperty(t,"__esModule",{value:true});t.Metadata=void 0;var i=r(2);var o=function(){function e(e){var t=e.parsedData,r=e.rawData;n.set(this,void 0);a.set(this,void 0);__classPrivateFieldSet(this,n,t,"f");__classPrivateFieldSet(this,a,r,"f")}e.prototype.getRaw=function(){return __classPrivateFieldGet(this,a,"f")};e.prototype.get=function(e){var t;return(t=__classPrivateFieldGet(this,n,"f").get(e))!==null&&t!==void 0?t:null};e.prototype.getAll=function(){return(0,i.objectFromMap)(__classPrivateFieldGet(this,n,"f"))};e.prototype.has=function(e){return __classPrivateFieldGet(this,n,"f").has(e)};return e}();n=new WeakMap,a=new WeakMap;t.Metadata=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.OptionalContentConfig=void 0;var n=r(2);var a=function(){function e(e,t){this.visible=true;this.name=e;this.intent=t}return e}();var i=function(){function e(e){this.name=null;this.creator=null;this._order=null;this._groups=new Map;if(e===null){return}this.name=e.name;this.creator=e.creator;this._order=e.order;for(var t=0,r=e.groups;t<r.length;t++){var n=r[t];this._groups.set(n.id,new a(n.name,n.intent))}if(e.baseState==="OFF"){for(var i=0,o=this._groups;i<o.length;i++){var n=o[i];n.visible=false}}for(var s=0,l=e.on;s<l.length;s++){var u=l[s];this._groups.get(u).visible=true}for(var c=0,d=e.off;c<d.length;c++){var h=d[c];this._groups.get(h).visible=false}}e.prototype._evaluateVisibilityExpression=function(e){var t=e.length;if(t<2){return true}var r=e[0];for(var a=1;a<t;a++){var i=e[a];var o=void 0;if(Array.isArray(i)){o=this._evaluateVisibilityExpression(i)}else if(this._groups.has(i)){o=this._groups.get(i).visible}else{(0,n.warn)("Optional content group not found: ".concat(i));return true}switch(r){case"And":if(!o){return false}break;case"Or":if(o){return true}break;case"Not":return!o;default:return true}}return r==="And"};e.prototype.isVisible=function(e){if(this._groups.size===0){return true}if(!e){(0,n.warn)("Optional content group not defined.");return true}if(e.type==="OCG"){if(!this._groups.has(e.id)){(0,n.warn)("Optional content group not found: ".concat(e.id));return true}return this._groups.get(e.id).visible}else if(e.type==="OCMD"){if(e.expression){return this._evaluateVisibilityExpression(e.expression)}if(!e.policy||e.policy==="AnyOn"){for(var t=0,r=e.ids;t<r.length;t++){var a=r[t];if(!this._groups.has(a)){(0,n.warn)("Optional content group not found: ".concat(a));return true}if(this._groups.get(a).visible){return true}}return false}else if(e.policy==="AllOn"){for(var i=0,o=e.ids;i<o.length;i++){var a=o[i];if(!this._groups.has(a)){(0,n.warn)("Optional content group not found: ".concat(a));return true}if(!this._groups.get(a).visible){return false}}return true}else if(e.policy==="AnyOff"){for(var s=0,l=e.ids;s<l.length;s++){var a=l[s];if(!this._groups.has(a)){(0,n.warn)("Optional content group not found: ".concat(a));return true}if(!this._groups.get(a).visible){return true}}return false}else if(e.policy==="AllOff"){for(var u=0,c=e.ids;u<c.length;u++){var a=c[u];if(!this._groups.has(a)){(0,n.warn)("Optional content group not found: ".concat(a));return true}if(this._groups.get(a).visible){return false}}return true}(0,n.warn)("Unknown optional content policy ".concat(e.policy,"."));return true}(0,n.warn)("Unknown group type ".concat(e.type,"."));return true};e.prototype.setVisibility=function(e,t){if(t===void 0){t=true}if(!this._groups.has(e)){(0,n.warn)("Optional content group not found: ".concat(e));return}this._groups.get(e).visible=!!t};e.prototype.getOrder=function(){if(!this._groups.size){return null}if(this._order){return this._order.slice()}return Array.from(this._groups.keys())};e.prototype.getGroups=function(){return this._groups.size>0?(0,n.objectFromMap)(this._groups):null};e.prototype.getGroup=function(e){return this._groups.get(e)||null};return e}();t.OptionalContentConfig=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.PDFDataTransportStream=void 0;var n=r(2);var a=r(1);var i=function(){function e(e,t){var r=this;(0,n.assert)(t,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');this._queuedChunks=[];this._progressiveDone=e.progressiveDone||false;this._contentDispositionFilename=e.contentDispositionFilename||null;var a=e.initialData;if((a===null||a===void 0?void 0:a.length)>0){var i=new Uint8Array(a).buffer;this._queuedChunks.push(i)}this._pdfDataRangeTransport=t;this._isStreamingSupported=!e.disableStream;this._isRangeSupported=!e.disableRange;this._contentLength=e.length;this._fullRequestReader=null;this._rangeReaders=[];this._pdfDataRangeTransport.addRangeListener((function(e,t){r._onReceiveData({begin:e,chunk:t})}));this._pdfDataRangeTransport.addProgressListener((function(e,t){r._onProgress({loaded:e,total:t})}));this._pdfDataRangeTransport.addProgressiveReadListener((function(e){r._onReceiveData({chunk:e})}));this._pdfDataRangeTransport.addProgressiveDoneListener((function(){r._onProgressiveDone()}));this._pdfDataRangeTransport.transportReady()}e.prototype._onReceiveData=function(e){var t=new Uint8Array(e.chunk).buffer;if(e.begin===undefined){if(this._fullRequestReader){this._fullRequestReader._enqueue(t)}else{this._queuedChunks.push(t)}}else{var r=this._rangeReaders.some((function(r){if(r._begin!==e.begin){return false}r._enqueue(t);return true}));(0,n.assert)(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}};Object.defineProperty(e.prototype,"_progressiveDataLength",{get:function(){var e,t;return(t=(e=this._fullRequestReader)===null||e===void 0?void 0:e._loaded)!==null&&t!==void 0?t:0},enumerable:false,configurable:true});e.prototype._onProgress=function(e){if(e.total===undefined){var t=this._rangeReaders[0];if(t===null||t===void 0?void 0:t.onProgress){t.onProgress({loaded:e.loaded})}}else{var r=this._fullRequestReader;if(r===null||r===void 0?void 0:r.onProgress){r.onProgress({loaded:e.loaded,total:e.total})}}};e.prototype._onProgressiveDone=function(){if(this._fullRequestReader){this._fullRequestReader.progressiveDone()}this._progressiveDone=true};e.prototype._removeRangeReader=function(e){var t=this._rangeReaders.indexOf(e);if(t>=0){this._rangeReaders.splice(t,1)}};e.prototype.getFullReader=function(){(0,n.assert)(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");var e=this._queuedChunks;this._queuedChunks=null;return new o(this,e,this._progressiveDone,this._contentDispositionFilename)};e.prototype.getRangeReader=function(e,t){if(t<=this._progressiveDataLength){return null}var r=new s(this,e,t);this._pdfDataRangeTransport.requestDataRange(e,t);this._rangeReaders.push(r);return r};e.prototype.cancelAllRequests=function(e){if(this._fullRequestReader){this._fullRequestReader.cancel(e)}for(var t=0,r=this._rangeReaders.slice(0);t<r.length;t++){var n=r[t];n.cancel(e)}this._pdfDataRangeTransport.abort()};return e}();t.PDFDataTransportStream=i;var o=function(){function e(e,t,r,n){if(r===void 0){r=false}if(n===void 0){n=null}this._stream=e;this._done=r||false;this._filename=(0,a.isPdfFile)(n)?n:null;this._queuedChunks=t||[];this._loaded=0;for(var i=0,o=this._queuedChunks;i<o.length;i++){var s=o[i];this._loaded+=s.byteLength}this._requests=[];this._headersReady=Promise.resolve();e._fullRequestReader=this;this.onProgress=null}e.prototype._enqueue=function(e){if(this._done){return}if(this._requests.length>0){var t=this._requests.shift();t.resolve({value:e,done:false})}else{this._queuedChunks.push(e)}this._loaded+=e.byteLength};Object.defineProperty(e.prototype,"headersReady",{get:function(){return this._headersReady},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"filename",{get:function(){return this._filename},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRangeSupported",{get:function(){return this._stream._isRangeSupported},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return this._stream._isStreamingSupported},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLength",{get:function(){return this._stream._contentLength},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){if(this._queuedChunks.length>0){e=this._queuedChunks.shift();return[2,{value:e,done:false}]}if(this._done){return[2,{value:undefined,done:true}]}t=(0,n.createPromiseCapability)();this._requests.push(t);return[2,t.promise]}))}))};e.prototype.cancel=function(e){this._done=true;for(var t=0,r=this._requests;t<r.length;t++){var n=r[t];n.resolve({value:undefined,done:true})}this._requests.length=0};e.prototype.progressiveDone=function(){if(this._done){return}this._done=true};return e}();var s=function(){function e(e,t,r){this._stream=e;this._begin=t;this._end=r;this._queuedChunk=null;this._requests=[];this._done=false;this.onProgress=null}e.prototype._enqueue=function(e){if(this._done){return}if(this._requests.length===0){this._queuedChunk=e}else{var t=this._requests.shift();t.resolve({value:e,done:false});for(var r=0,n=this._requests;r<n.length;r++){var a=n[r];a.resolve({value:undefined,done:true})}this._requests.length=0}this._done=true;this._stream._removeRangeReader(this)};Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return false},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){if(this._queuedChunk){e=this._queuedChunk;this._queuedChunk=null;return[2,{value:e,done:false}]}if(this._done){return[2,{value:undefined,done:true}]}t=(0,n.createPromiseCapability)();this._requests.push(t);return[2,t.promise]}))}))};e.prototype.cancel=function(e){this._done=true;for(var t=0,r=this._requests;t<r.length;t++){var n=r[t];n.resolve({value:undefined,done:true})}this._requests.length=0;this._stream._removeRangeReader(this)};return e}()},function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.XfaText=void 0;var r=function(){function e(){}e.textContent=function(t){var r=[];var n={items:r,styles:Object.create(null)};function a(t){var n;if(!t){return}var i=null;var o=t.name;if(o==="#text"){i=t.value}else if(!e.shouldBuildText(o)){return}else if((n=t===null||t===void 0?void 0:t.attributes)===null||n===void 0?void 0:n.textContent){i=t.attributes.textContent}else if(t.value){i=t.value}if(i!==null){r.push({str:i})}if(!t.children){return}for(var s=0,l=t.children;s<l.length;s++){var u=l[s];a(u)}}a(t);return n};e.shouldBuildText=function(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")};return e}();t.XfaText=r},function(e,t,r){var n,a;Object.defineProperty(t,"__esModule",{value:true});t.AnnotationLayer=void 0;var i=r(2);var o=r(1);var s=r(9);var l=r(19);var u=r(20);var c=1e3;var d=new WeakSet;var h=function(){function e(){}e.create=function(e){var t=e.data.annotationType;switch(t){case i.AnnotationType.LINK:return new p(e);case i.AnnotationType.TEXT:return new v(e);case i.AnnotationType.WIDGET:var r=e.data.fieldType;switch(r){case"Tx":return new m(e);case"Btn":if(e.data.radioButton){return new y(e)}else if(e.data.checkBox){return new _(e)}return new b(e);case"Ch":return new A(e)}return new g(e);case i.AnnotationType.POPUP:return new S(e);case i.AnnotationType.FREETEXT:return new C(e);case i.AnnotationType.LINE:return new P(e);case i.AnnotationType.SQUARE:return new w(e);case i.AnnotationType.CIRCLE:return new k(e);case i.AnnotationType.POLYLINE:return new T(e);case i.AnnotationType.CARET:return new F(e);case i.AnnotationType.INK:return new E(e);case i.AnnotationType.POLYGON:return new R(e);case i.AnnotationType.HIGHLIGHT:return new O(e);case i.AnnotationType.UNDERLINE:return new M(e);case i.AnnotationType.SQUIGGLY:return new D(e);case i.AnnotationType.STRIKEOUT:return new L(e);case i.AnnotationType.STAMP:return new I(e);case i.AnnotationType.FILEATTACHMENT:return new N(e);default:return new f(e)}};return e}();var f=function(){function e(e,t){var r=t===void 0?{}:t,n=r.isRenderable,a=n===void 0?false:n,i=r.ignoreBorder,o=i===void 0?false:i,s=r.createQuadrilaterals,l=s===void 0?false:s;this.isRenderable=a;this.data=e.data;this.layer=e.layer;this.page=e.page;this.viewport=e.viewport;this.linkService=e.linkService;this.downloadManager=e.downloadManager;this.imageResourcesPath=e.imageResourcesPath;this.renderForms=e.renderForms;this.svgFactory=e.svgFactory;this.annotationStorage=e.annotationStorage;this.enableScripting=e.enableScripting;this.hasJSActions=e.hasJSActions;this._fieldObjects=e.fieldObjects;this._mouseState=e.mouseState;if(a){this.container=this._createContainer(o)}if(l){this.quadrilaterals=this._createQuadrilaterals(o)}}e.prototype._createContainer=function(e){if(e===void 0){e=false}var t=this.data,r=this.page,n=this.viewport;var a=document.createElement("section");var o=t.rect[2]-t.rect[0];var s=t.rect[3]-t.rect[1];a.setAttribute("data-annotation-id",t.id);var l=i.Util.normalizeRect([t.rect[0],r.view[3]-t.rect[1]+r.view[1],t.rect[2],r.view[3]-t.rect[3]+r.view[1]]);if(t.hasOwnCanvas){var u=n.transform.slice();var c=i.Util.singularValueDecompose2dScale(u),d=c[0],h=c[1];o=Math.ceil(o*d);s=Math.ceil(s*h);l[0]*=d;l[1]*=h;for(var f=0;f<4;f++){u[f]=Math.sign(u[f])}a.style.transform="matrix(".concat(u.join(","),")")}else{a.style.transform="matrix(".concat(n.transform.join(","),")")}a.style.transformOrigin="".concat(-l[0],"px ").concat(-l[1],"px");if(!e&&t.borderStyle.width>0){a.style.borderWidth="".concat(t.borderStyle.width,"px");if(t.borderStyle.style!==i.AnnotationBorderStyleType.UNDERLINE){o-=2*t.borderStyle.width;s-=2*t.borderStyle.width}var p=t.borderStyle.horizontalCornerRadius;var v=t.borderStyle.verticalCornerRadius;if(p>0||v>0){var g="".concat(p,"px / ").concat(v,"px");a.style.borderRadius=g}switch(t.borderStyle.style){case i.AnnotationBorderStyleType.SOLID:a.style.borderStyle="solid";break;case i.AnnotationBorderStyleType.DASHED:a.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:a.style.borderBottomStyle="solid";break;default:break}var m=t.borderColor||t.color||null;if(m){a.style.borderColor=i.Util.makeHexColor(t.color[0]|0,t.color[1]|0,t.color[2]|0)}else{a.style.borderWidth=0}}a.style.left="".concat(l[0],"px");a.style.top="".concat(l[1],"px");if(t.hasOwnCanvas){a.style.width=a.style.height="auto"}else{a.style.width="".concat(o,"px");a.style.height="".concat(s,"px")}return a};e.prototype._createQuadrilaterals=function(e){if(e===void 0){e=false}if(!this.data.quadPoints){return null}var t=[];var r=this.data.rect;for(var n=0,a=this.data.quadPoints;n<a.length;n++){var i=a[n];this.data.rect=[i[2].x,i[2].y,i[1].x,i[1].y];t.push(this._createContainer(e))}this.data.rect=r;return t};e.prototype._createPopup=function(e,t){var r=this.container;if(this.quadrilaterals){e=e||this.quadrilaterals;r=this.quadrilaterals[0]}if(!e){e=document.createElement("div");e.style.height=r.style.height;e.style.width=r.style.width;r.appendChild(e)}var n=new x({container:r,trigger:e,color:t.color,titleObj:t.titleObj,modificationDate:t.modificationDate,contentsObj:t.contentsObj,richText:t.richText,hideWrapper:true});var a=n.render();a.style.left=r.style.width;r.appendChild(a)};e.prototype._renderQuadrilaterals=function(e){for(var t=0,r=this.quadrilaterals;t<r.length;t++){var n=r[t];n.className=e}return this.quadrilaterals};e.prototype.render=function(){(0,i.unreachable)("Abstract method `AnnotationElement.render` called")};e.prototype._getElementsByName=function(e,t){if(t===void 0){t=null}var r=[];if(this._fieldObjects){var n=this._fieldObjects[e];if(n){for(var a=0,o=n;a<o.length;a++){var s=o[a],l=s.page,u=s.id,c=s.exportValues;if(l===-1){continue}if(u===t){continue}var h=typeof c==="string"?c:null;var f=document.getElementById(u);if(f&&!d.has(f)){(0,i.warn)("_getElementsByName - element not allowed: ".concat(u));continue}r.push({id:u,exportValue:h,domElement:f})}}return r}for(var p=0,v=document.getElementsByName(e);p<v.length;p++){var f=v[p];var u=f.id,h=f.exportValue;if(u===t){continue}if(!d.has(f)){continue}r.push({id:u,exportValue:h,domElement:f})}return r};Object.defineProperty(e,"platform",{get:function(){var e=typeof navigator!=="undefined"?navigator.platform:"";return(0,i.shadow)(this,"platform",{isWin:e.includes("Win"),isMac:e.includes("Mac")})},enumerable:false,configurable:true});return e}();var p=function(e){__extends(t,e);function t(t,r){if(r===void 0){r=null}var n=this;var a=!!(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"]));n=e.call(this,t,{isRenderable:a,ignoreBorder:!!(r===null||r===void 0?void 0:r.ignoreBorder),createQuadrilaterals:true})||this;return n}t.prototype.render=function(){var e;var t=this,r=t.data,n=t.linkService;var a=document.createElement("a");if(r.url){if(!n.addLinkAttributes){(0,i.warn)("LinkAnnotationElement.render - missing `addLinkAttributes`-method on the `linkService`-instance.")}(e=n.addLinkAttributes)===null||e===void 0?void 0:e.call(n,a,r.url,r.newWindow)}else if(r.action){this._bindNamedAction(a,r.action)}else if(r.dest){this._bindLink(a,r.dest)}else{var o=false;if(r.actions&&(r.actions.Action||r.actions["Mouse Up"]||r.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions){o=true;this._bindJSAction(a,r)}if(r.resetForm){this._bindResetFormAction(a,r.resetForm)}else if(!o){this._bindLink(a,"")}}if(this.quadrilaterals){return this._renderQuadrilaterals("linkAnnotation").map((function(e,t){var r=t===0?a:a.cloneNode();e.appendChild(r);return e}))}this.container.className="linkAnnotation";this.container.appendChild(a);return this.container};t.prototype._bindLink=function(e,t){var r=this;e.href=this.linkService.getDestinationHash(t);e.onclick=function(){if(t){r.linkService.goToDestination(t)}return false};if(t||t===""){e.className="internalLink"}};t.prototype._bindNamedAction=function(e,t){var r=this;e.href=this.linkService.getAnchorUrl("");e.onclick=function(){r.linkService.executeNamedAction(t);return false};e.className="internalLink"};t.prototype._bindJSAction=function(e,t){var r=this;e.href=this.linkService.getAnchorUrl("");var n=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);var a=function(a){var i=n.get(a);if(!i){return"continue"}e[i]=function(){var e;(e=r.linkService.eventBus)===null||e===void 0?void 0:e.dispatch("dispatcheventinsandbox",{source:r,detail:{id:t.id,name:a}});return false}};for(var i=0,o=Object.keys(t.actions);i<o.length;i++){var s=o[i];a(s)}if(!e.onclick){e.onclick=function(){return false}}e.className="internalLink"};t.prototype._bindResetFormAction=function(e,t){var r=this;var n=e.onclick;if(!n){e.href=this.linkService.getAnchorUrl("")}e.className="internalLink";if(!this._fieldObjects){(0,i.warn)('_bindResetFormAction - "resetForm" action not supported, '+"ensure that the `fieldObjects` parameter is provided.");if(!n){e.onclick=function(){return false}}return}e.onclick=function(){var e;if(n){n()}var a=t.fields,i=t.refs,o=t.include;var s=[];if(a.length!==0||i.length!==0){var l=new Set(i);for(var u=0,c=a;u<c.length;u++){var h=c[u];var f=r._fieldObjects[h]||[];for(var p=0,v=f;p<v.length;p++){var g=v[p].id;l.add(g)}}for(var m=0,_=Object.values(r._fieldObjects);m<_.length;m++){var f=_[m];for(var y=0,b=f;y<b.length;y++){var A=b[y];if(l.has(A.id)===o){s.push(A)}}}}else{for(var S=0,x=Object.values(r._fieldObjects);S<x.length;S++){var f=x[S];s.push.apply(s,f)}}var C=r.annotationStorage;var P=[];for(var w=0,k=s;w<k.length;w++){var A=k[w];var g=A.id;P.push(g);switch(A.type){case"text":{var T=A.defaultValue||"";C.setValue(g,{value:T,valueAsString:T});break}case"checkbox":case"radiobutton":{var T=A.defaultValue===A.exportValues;C.setValue(g,{value:T});break}case"combobox":case"listbox":{var T=A.defaultValue||"";C.setValue(g,{value:T});break}default:continue}var R=document.getElementById(g);if(!R||!d.has(R)){continue}R.dispatchEvent(new Event("resetform"))}if(r.enableScripting){(e=r.linkService.eventBus)===null||e===void 0?void 0:e.dispatch("dispatcheventinsandbox",{source:r,detail:{id:"app",ids:P,name:"ResetForm"}})}return false}};return t}(f);var v=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o})||this;return i}t.prototype.render=function(){this.container.className="textAnnotation";var e=document.createElement("img");e.style.height=this.container.style.height;e.style.width=this.container.style.width;e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg";e.alt="[{{type}} Annotation]";e.dataset.l10nId="text_annotation_type";e.dataset.l10nArgs=JSON.stringify({type:this.data.name});if(!this.data.hasPopup){this._createPopup(e,this.data)}this.container.appendChild(e);return this.container};return t}(f);var g=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.prototype.render=function(){if(this.data.alternativeText){this.container.title=this.data.alternativeText}return this.container};t.prototype._getKeyModifier=function(e){var t=f.platform,r=t.isWin,n=t.isMac;return r&&e.ctrlKey||n&&e.metaKey};t.prototype._setEventListener=function(e,t,r,n){var a=this;if(t.includes("mouse")){e.addEventListener(t,(function(e){var t;(t=a.linkService.eventBus)===null||t===void 0?void 0:t.dispatch("dispatcheventinsandbox",{source:a,detail:{id:a.data.id,name:r,value:n(e),shift:e.shiftKey,modifier:a._getKeyModifier(e)}})}))}else{e.addEventListener(t,(function(e){var t;(t=a.linkService.eventBus)===null||t===void 0?void 0:t.dispatch("dispatcheventinsandbox",{source:a,detail:{id:a.data.id,name:r,value:e.target.checked}})}))}};t.prototype._setEventListeners=function(e,t,r){var n;for(var a=0,i=t;a<i.length;a++){var o=i[a],s=o[0],l=o[1];if(l==="Action"||((n=this.data.actions)===null||n===void 0?void 0:n[l])){this._setEventListener(e,s,l,r)}}};t.prototype._setBackgroundColor=function(e){var t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":i.Util.makeHexColor(t[0],t[1],t[2])};t.prototype._dispatchEventFromSandbox=function(e,t){var r=this;var n=function(e,t,r){var n=r.detail[e];r.target.style[t]=l.ColorConverters["".concat(n[0],"_HTML")](n.slice(1))};var a={display:function(e){var t=e.detail.display%2===1;e.target.style.visibility=t?"hidden":"visible";r.annotationStorage.setValue(r.data.id,{hidden:t,print:e.detail.display===0||e.detail.display===3})},print:function(e){r.annotationStorage.setValue(r.data.id,{print:e.detail.print})},hidden:function(e){e.target.style.visibility=e.detail.hidden?"hidden":"visible";r.annotationStorage.setValue(r.data.id,{hidden:e.detail.hidden})},focus:function(e){setTimeout((function(){return e.target.focus({preventScroll:false})}),0)},userName:function(e){e.target.title=e.detail.userName},readonly:function(e){if(e.detail.readonly){e.target.setAttribute("readonly","")}else{e.target.removeAttribute("readonly")}},required:function(e){if(e.detail.required){e.target.setAttribute("required","")}else{e.target.removeAttribute("required")}},bgColor:function(e){n("bgColor","backgroundColor",e)},fillColor:function(e){n("fillColor","backgroundColor",e)},fgColor:function(e){n("fgColor","color",e)},textColor:function(e){n("textColor","color",e)},borderColor:function(e){n("borderColor","borderColor",e)},strokeColor:function(e){n("strokeColor","borderColor",e)}};for(var i=0,o=Object.keys(t.detail);i<o.length;i++){var s=o[i];var u=e[s]||a[s];if(u){u(t)}}};return t}(f);var m=function(e){__extends(t,e);function t(t){var r=this;var n=t.renderForms||!t.data.hasAppearance&&!!t.data.fieldValue;r=e.call(this,t,{isRenderable:n})||this;return r}t.prototype.setPropertyOnSiblings=function(e,t,r,n){var a;var i=this.annotationStorage;for(var o=0,s=this._getElementsByName(e.name,e.id);o<s.length;o++){var l=s[o];if(l.domElement){l.domElement[t]=r}i.setValue(l.id,(a={},a[n]=r,a))}};t.prototype.render=function(){var e=this;var t;var r=this.annotationStorage;var n=this.data.id;this.container.className="textWidgetAnnotation";var a=null;if(this.renderForms){var i=r.getValue(n,{value:this.data.fieldValue,valueAsString:this.data.fieldValue});var o=i.valueAsString||i.value||"";var s={userValue:null,formattedValue:null,beforeInputSelectionRange:null,beforeInputValue:null};if(this.data.multiLine){a=document.createElement("textarea");a.textContent=o}else{a=document.createElement("input");a.type="text";a.setAttribute("value",o)}d.add(a);a.disabled=this.data.readOnly;a.name=this.data.fieldName;a.tabIndex=c;s.userValue=o;a.setAttribute("id",n);a.addEventListener("input",(function(t){r.setValue(n,{value:t.target.value});e.setPropertyOnSiblings(a,"value",t.target.value,"value")}));a.addEventListener("resetform",(function(t){var r=e.data.defaultFieldValue||"";a.value=s.userValue=r;delete s.formattedValue}));var l=function(e){if(s.formattedValue){e.target.value=s.formattedValue}e.target.scrollLeft=0;s.beforeInputSelectionRange=null};if(this.enableScripting&&this.hasJSActions){a.addEventListener("focus",(function(e){if(s.userValue){e.target.value=s.userValue}}));a.addEventListener("updatefromsandbox",(function(t){var a={value:function(e){s.userValue=e.detail.value||"";r.setValue(n,{value:s.userValue.toString()});if(!s.formattedValue){e.target.value=s.userValue}},valueAsString:function(e){s.formattedValue=e.detail.valueAsString||"";if(e.target!==document.activeElement){e.target.value=s.formattedValue}r.setValue(n,{formattedValue:s.formattedValue})},selRange:function(e){var t=e.detail.selRange,r=t[0],n=t[1];if(r>=0&&n<e.target.value.length){e.target.setSelectionRange(r,n)}}};e._dispatchEventFromSandbox(a,t)}));a.addEventListener("keydown",(function(t){var r;s.beforeInputValue=t.target.value;var a=-1;if(t.key==="Escape"){a=0}else if(t.key==="Enter"){a=2}else if(t.key==="Tab"){a=3}if(a===-1){return}s.userValue=t.target.value;(r=e.linkService.eventBus)===null||r===void 0?void 0:r.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:t.target.value,willCommit:true,commitKey:a,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}));var u=l;l=null;a.addEventListener("blur",(function(t){var r;if(e._mouseState.isDown){s.userValue=t.target.value;(r=e.linkService.eventBus)===null||r===void 0?void 0:r.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:t.target.value,willCommit:true,commitKey:1,selStart:t.target.selectionStart,selEnd:t.target.selectionEnd}})}u(t)}));a.addEventListener("mousedown",(function(e){s.beforeInputValue=e.target.value;s.beforeInputSelectionRange=null}));a.addEventListener("keyup",(function(e){if(e.target.selectionStart===e.target.selectionEnd){s.beforeInputSelectionRange=null}}));a.addEventListener("select",(function(e){s.beforeInputSelectionRange=[e.target.selectionStart,e.target.selectionEnd]}));if((t=this.data.actions)===null||t===void 0?void 0:t.Keystroke){a.addEventListener("input",(function(t){var r;var a;var i=-1;var o=-1;if(s.beforeInputSelectionRange){r=s.beforeInputSelectionRange,i=r[0],o=r[1]}(a=e.linkService.eventBus)===null||a===void 0?void 0:a.dispatch("dispatcheventinsandbox",{source:e,detail:{id:n,name:"Keystroke",value:s.beforeInputValue,change:t.data,willCommit:false,selStart:i,selEnd:o}})}))}this._setEventListeners(a,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(e){return e.target.value}))}if(l){a.addEventListener("blur",l)}if(this.data.maxLen!==null){a.maxLength=this.data.maxLen}if(this.data.comb){var h=this.data.rect[2]-this.data.rect[0];var f=h/this.data.maxLen;a.classList.add("comb");a.style.letterSpacing="calc(".concat(f,"px - 1ch)")}}else{a=document.createElement("div");a.textContent=this.data.fieldValue;a.style.verticalAlign="middle";a.style.display="table-cell"}this._setTextStyle(a);this._setBackgroundColor(a);this.container.appendChild(a);return this.container};t.prototype._setTextStyle=function(e){var t=["left","center","right"];var r=this.data.defaultAppearanceData,n=r.fontSize,a=r.fontColor;var o=e.style;if(n){o.fontSize="".concat(n,"px")}o.color=i.Util.makeHexColor(a[0],a[1],a[2]);if(this.data.textAlignment!==null){o.textAlign=t[this.data.textAlignment]}};return t}(g);var _=function(e){__extends(t,e);function t(t){return e.call(this,t,{isRenderable:t.renderForms})||this}t.prototype.render=function(){var e=this;var t=this.annotationStorage;var r=this.data;var n=r.id;var a=t.getValue(n,{value:r.exportValue===r.fieldValue}).value;if(typeof a==="string"){a=a!=="Off";t.setValue(n,{value:a})}this.container.className="buttonWidgetAnnotation checkBox";var i=document.createElement("input");d.add(i);i.disabled=r.readOnly;i.type="checkbox";i.name=r.fieldName;if(a){i.setAttribute("checked",true)}i.setAttribute("id",n);i.setAttribute("exportValue",r.exportValue);i.tabIndex=c;i.addEventListener("change",(function(a){var i=a.target,o=i.name,s=i.checked;for(var l=0,u=e._getElementsByName(o,n);l<u.length;l++){var c=u[l];var d=s&&c.exportValue===r.exportValue;if(c.domElement){c.domElement.checked=d}t.setValue(c.id,{value:d})}t.setValue(n,{value:s})}));i.addEventListener("resetform",(function(e){var t=r.defaultFieldValue||"Off";e.target.checked=t===r.exportValue}));if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(function(r){var a={value:function(e){e.target.checked=e.detail.value!=="Off";t.setValue(n,{value:e.target.checked})}};e._dispatchEventFromSandbox(a,r)}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(e){return e.target.checked}))}this._setBackgroundColor(i);this.container.appendChild(i);return this.container};return t}(g);var y=function(e){__extends(t,e);function t(t){return e.call(this,t,{isRenderable:t.renderForms})||this}t.prototype.render=function(){var e=this;this.container.className="buttonWidgetAnnotation radioButton";var t=this.annotationStorage;var r=this.data;var n=r.id;var a=t.getValue(n,{value:r.fieldValue===r.buttonValue}).value;if(typeof a==="string"){a=a!==r.buttonValue;t.setValue(n,{value:a})}var i=document.createElement("input");d.add(i);i.disabled=r.readOnly;i.type="radio";i.name=r.fieldName;if(a){i.setAttribute("checked",true)}i.setAttribute("id",n);i.tabIndex=c;i.addEventListener("change",(function(r){var a=r.target,i=a.name,o=a.checked;for(var s=0,l=e._getElementsByName(i,n);s<l.length;s++){var u=l[s];t.setValue(u.id,{value:false})}t.setValue(n,{value:o})}));i.addEventListener("resetform",(function(e){var t=r.defaultFieldValue;e.target.checked=t!==null&&t!==undefined&&t===r.buttonValue}));if(this.enableScripting&&this.hasJSActions){var o=r.buttonValue;i.addEventListener("updatefromsandbox",(function(r){var a={value:function(r){var a=o===r.detail.value;for(var i=0,s=e._getElementsByName(r.target.name);i<s.length;i++){var l=s[i];var u=a&&l.id===n;if(l.domElement){l.domElement.checked=u}t.setValue(l.id,{value:u})}}};e._dispatchEventFromSandbox(a,r)}));this._setEventListeners(i,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],(function(e){return e.target.checked}))}this._setBackgroundColor(i);this.container.appendChild(i);return this.container};return t}(g);var b=function(e){__extends(t,e);function t(t){return e.call(this,t,{ignoreBorder:t.data.hasAppearance})||this}t.prototype.render=function(){var t=e.prototype.render.call(this);t.className="buttonWidgetAnnotation pushButton";if(this.data.alternativeText){t.title=this.data.alternativeText}return t};return t}(p);var A=function(e){__extends(t,e);function t(t){return e.call(this,t,{isRenderable:t.renderForms})||this}t.prototype.render=function(){var e=this;this.container.className="choiceWidgetAnnotation";var t=this.annotationStorage;var r=this.data.id;t.getValue(r,{value:this.data.fieldValue.length>0?this.data.fieldValue[0]:undefined});var n=this.data.defaultAppearanceData.fontSize;if(!n){n=9}var a="calc(".concat(n,"px * var(--zoom-factor))");var i=document.createElement("select");d.add(i);i.disabled=this.data.readOnly;i.name=this.data.fieldName;i.setAttribute("id",r);i.tabIndex=c;i.style.fontSize="".concat(n,"px");if(!this.data.combo){i.size=this.data.options.length;if(this.data.multiSelect){i.multiple=true}}i.addEventListener("resetform",(function(t){var r=e.data.defaultFieldValue;for(var n=0,a=i.options;n<a.length;n++){var o=a[n];o.selected=o.value===r}}));for(var o=0,s=this.data.options;o<s.length;o++){var l=s[o];var u=document.createElement("option");u.textContent=l.displayValue;u.value=l.exportValue;if(this.data.combo){u.style.fontSize=a}if(this.data.fieldValue.includes(l.exportValue)){u.setAttribute("selected",true)}i.appendChild(u)}var h=function(e,t){var r=t?"value":"textContent";var n=e.target.options;if(!e.target.multiple){return n.selectedIndex===-1?null:n[n.selectedIndex][r]}return Array.prototype.filter.call(n,(function(e){return e.selected})).map((function(e){return e[r]}))};var f=function(e){var t=e.target.options;return Array.prototype.map.call(t,(function(e){return{displayValue:e.textContent,exportValue:e.value}}))};if(this.enableScripting&&this.hasJSActions){i.addEventListener("updatefromsandbox",(function(n){var a={value:function(e){var n=e.detail.value;var a=new Set(Array.isArray(n)?n:[n]);for(var o=0,s=i.options;o<s.length;o++){var l=s[o];l.selected=a.has(l.value)}t.setValue(r,{value:h(e,true)})},multipleSelection:function(e){i.multiple=true},remove:function(e){var n=i.options;var a=e.detail.remove;n[a].selected=false;i.remove(a);if(n.length>0){var o=Array.prototype.findIndex.call(n,(function(e){return e.selected}));if(o===-1){n[0].selected=true}}t.setValue(r,{value:h(e,true),items:f(e)})},clear:function(e){while(i.length!==0){i.remove(0)}t.setValue(r,{value:null,items:[]})},insert:function(e){var n=e.detail.insert,a=n.index,o=n.displayValue,s=n.exportValue;var l=document.createElement("option");l.textContent=o;l.value=s;i.insertBefore(l,i.children[a]);t.setValue(r,{value:h(e,true),items:f(e)})},items:function(e){var n=e.detail.items;while(i.length!==0){i.remove(0)}for(var a=0,o=n;a<o.length;a++){var s=o[a];var l=s.displayValue,u=s.exportValue;var c=document.createElement("option");c.textContent=l;c.value=u;i.appendChild(c)}if(i.options.length>0){i.options[0].selected=true}t.setValue(r,{value:h(e,true),items:f(e)})},indices:function(e){var n=new Set(e.detail.indices);for(var a=0,i=e.target.options;a<i.length;a++){var o=i[a];o.selected=n.has(o.index)}t.setValue(r,{value:h(e,true)})},editable:function(e){e.target.disabled=!e.detail.editable}};e._dispatchEventFromSandbox(a,n)}));i.addEventListener("input",(function(n){var a;var i=h(n,true);var o=h(n,false);t.setValue(r,{value:i});(a=e.linkService.eventBus)===null||a===void 0?void 0:a.dispatch("dispatcheventinsandbox",{source:e,detail:{id:r,name:"Keystroke",value:o,changeEx:i,willCommit:true,commitKey:1,keyDown:false}})}));this._setEventListeners(i,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"]],(function(e){return e.target.checked}))}else{i.addEventListener("input",(function(e){t.setValue(r,{value:h(e)})}))}this._setBackgroundColor(i);this.container.appendChild(i);return this.container};return t}(g);var S=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o})||this;return i}t.prototype.render=function(){var e=["Line","Square","Circle","PolyLine","Polygon","Ink"];this.container.className="popupAnnotation";if(e.includes(this.data.parentType)){return this.container}var t='[data-annotation-id="'.concat(this.data.parentId,'"]');var r=this.layer.querySelectorAll(t);if(r.length===0){return this.container}var n=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});var a=this.page;var o=i.Util.normalizeRect([this.data.parentRect[0],a.view[3]-this.data.parentRect[1]+a.view[1],this.data.parentRect[2],a.view[3]-this.data.parentRect[3]+a.view[1]]);var s=o[0]+this.data.parentRect[2]-this.data.parentRect[0];var l=o[1];this.container.style.transformOrigin="".concat(-s,"px ").concat(-l,"px");this.container.style.left="".concat(s,"px");this.container.style.top="".concat(l,"px");this.container.appendChild(n.render());return this.container};return t}(f);var x=function(){function e(e){this.container=e.container;this.trigger=e.trigger;this.color=e.color;this.titleObj=e.titleObj;this.modificationDate=e.modificationDate;this.contentsObj=e.contentsObj;this.richText=e.richText;this.hideWrapper=e.hideWrapper||false;this.pinned=false}e.prototype.render=function(){var e,t;var r=.7;var n=document.createElement("div");n.className="popupWrapper";this.hideElement=this.hideWrapper?n:this.container;this.hideElement.hidden=true;var a=document.createElement("div");a.className="popup";var s=this.color;if(s){var l=r*(255-s[0])+s[0];var c=r*(255-s[1])+s[1];var d=r*(255-s[2])+s[2];a.style.backgroundColor=i.Util.makeHexColor(l|0,c|0,d|0)}var h=document.createElement("h1");h.dir=this.titleObj.dir;h.textContent=this.titleObj.str;a.appendChild(h);var f=o.PDFDateString.toDateObject(this.modificationDate);if(f){var p=document.createElement("span");p.className="popupDate";p.textContent="{{date}}, {{time}}";p.dataset.l10nId="annotation_date_string";p.dataset.l10nArgs=JSON.stringify({date:f.toLocaleDateString(),time:f.toLocaleTimeString()});a.appendChild(p)}if(((e=this.richText)===null||e===void 0?void 0:e.str)&&(!((t=this.contentsObj)===null||t===void 0?void 0:t.str)||this.contentsObj.str===this.richText.str)){u.XfaLayer.render({xfaHtml:this.richText.html,intent:"richText",div:a});a.lastChild.className="richText popupContent"}else{var v=this._formatContents(this.contentsObj);a.appendChild(v)}if(!Array.isArray(this.trigger)){this.trigger=[this.trigger]}for(var g=0,m=this.trigger;g<m.length;g++){var _=m[g];_.addEventListener("click",this._toggle.bind(this));_.addEventListener("mouseover",this._show.bind(this,false));_.addEventListener("mouseout",this._hide.bind(this,false))}a.addEventListener("click",this._hide.bind(this,true));n.appendChild(a);return n};e.prototype._formatContents=function(e){var t=e.str,r=e.dir;var n=document.createElement("p");n.className="popupContent";n.dir=r;var a=t.split(/(?:\r\n?|\n)/);for(var i=0,o=a.length;i<o;++i){var s=a[i];n.appendChild(document.createTextNode(s));if(i<o-1){n.appendChild(document.createElement("br"))}}return n};e.prototype._toggle=function(){if(this.pinned){this._hide(true)}else{this._show(true)}};e.prototype._show=function(e){if(e===void 0){e=false}if(e){this.pinned=true}if(this.hideElement.hidden){this.hideElement.hidden=false;this.container.style.zIndex+=1}};e.prototype._hide=function(e){if(e===void 0){e=true}if(e){this.pinned=false}if(!this.hideElement.hidden&&!this.pinned){this.hideElement.hidden=true;this.container.style.zIndex-=1}};return e}();var C=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;return i}t.prototype.render=function(){this.container.className="freeTextAnnotation";if(!this.data.hasPopup){this._createPopup(null,this.data)}return this.container};return t}(f);var P=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;return i}t.prototype.render=function(){this.container.className="lineAnnotation";var e=this.data;var t=e.rect[2]-e.rect[0];var r=e.rect[3]-e.rect[1];var n=this.svgFactory.create(t,r);var a=this.svgFactory.createElement("svg:line");a.setAttribute("x1",e.rect[2]-e.lineCoordinates[0]);a.setAttribute("y1",e.rect[3]-e.lineCoordinates[1]);a.setAttribute("x2",e.rect[2]-e.lineCoordinates[2]);a.setAttribute("y2",e.rect[3]-e.lineCoordinates[3]);a.setAttribute("stroke-width",e.borderStyle.width||1);a.setAttribute("stroke","transparent");a.setAttribute("fill","transparent");n.appendChild(a);this.container.append(n);this._createPopup(a,e);return this.container};return t}(f);var w=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;return i}t.prototype.render=function(){this.container.className="squareAnnotation";var e=this.data;var t=e.rect[2]-e.rect[0];var r=e.rect[3]-e.rect[1];var n=this.svgFactory.create(t,r);var a=e.borderStyle.width;var i=this.svgFactory.createElement("svg:rect");i.setAttribute("x",a/2);i.setAttribute("y",a/2);i.setAttribute("width",t-a);i.setAttribute("height",r-a);i.setAttribute("stroke-width",a||1);i.setAttribute("stroke","transparent");i.setAttribute("fill","transparent");n.appendChild(i);this.container.append(n);this._createPopup(i,e);return this.container};return t}(f);var k=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;return i}t.prototype.render=function(){this.container.className="circleAnnotation";var e=this.data;var t=e.rect[2]-e.rect[0];var r=e.rect[3]-e.rect[1];var n=this.svgFactory.create(t,r);var a=e.borderStyle.width;var i=this.svgFactory.createElement("svg:ellipse");i.setAttribute("cx",t/2);i.setAttribute("cy",r/2);i.setAttribute("rx",t/2-a/2);i.setAttribute("ry",r/2-a/2);i.setAttribute("stroke-width",a||1);i.setAttribute("stroke","transparent");i.setAttribute("fill","transparent");n.appendChild(i);this.container.append(n);this._createPopup(i,e);return this.container};return t}(f);var T=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;i.containerClassName="polylineAnnotation";i.svgElementName="svg:polyline";return i}t.prototype.render=function(){this.container.className=this.containerClassName;var e=this.data;var t=e.rect[2]-e.rect[0];var r=e.rect[3]-e.rect[1];var n=this.svgFactory.create(t,r);var a=[];for(var i=0,o=e.vertices;i<o.length;i++){var s=o[i];var l=s.x-e.rect[0];var u=e.rect[3]-s.y;a.push(l+","+u)}a=a.join(" ");var c=this.svgFactory.createElement(this.svgElementName);c.setAttribute("points",a);c.setAttribute("stroke-width",e.borderStyle.width||1);c.setAttribute("stroke","transparent");c.setAttribute("fill","transparent");n.appendChild(c);this.container.append(n);this._createPopup(c,e);return this.container};return t}(f);var R=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;r.containerClassName="polygonAnnotation";r.svgElementName="svg:polygon";return r}return t}(T);var F=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;return i}t.prototype.render=function(){this.container.className="caretAnnotation";if(!this.data.hasPopup){this._createPopup(null,this.data)}return this.container};return t}(f);var E=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;i.containerClassName="inkAnnotation";i.svgElementName="svg:polyline";return i}t.prototype.render=function(){this.container.className=this.containerClassName;var e=this.data;var t=e.rect[2]-e.rect[0];var r=e.rect[3]-e.rect[1];var n=this.svgFactory.create(t,r);for(var a=0,i=e.inkLists;a<i.length;a++){var o=i[a];var s=[];for(var l=0,u=o;l<u.length;l++){var c=u[l];var d=c.x-e.rect[0];var h=e.rect[3]-c.y;s.push("".concat(d,",").concat(h))}s=s.join(" ");var f=this.svgFactory.createElement(this.svgElementName);f.setAttribute("points",s);f.setAttribute("stroke-width",e.borderStyle.width||1);f.setAttribute("stroke","transparent");f.setAttribute("fill","transparent");this._createPopup(f,e);n.appendChild(f)}this.container.append(n);return this.container};return t}(f);var O=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true,createQuadrilaterals:true})||this;return i}t.prototype.render=function(){if(!this.data.hasPopup){this._createPopup(null,this.data)}if(this.quadrilaterals){return this._renderQuadrilaterals("highlightAnnotation")}this.container.className="highlightAnnotation";return this.container};return t}(f);var M=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true,createQuadrilaterals:true})||this;return i}t.prototype.render=function(){if(!this.data.hasPopup){this._createPopup(null,this.data)}if(this.quadrilaterals){return this._renderQuadrilaterals("underlineAnnotation")}this.container.className="underlineAnnotation";return this.container};return t}(f);var D=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true,createQuadrilaterals:true})||this;return i}t.prototype.render=function(){if(!this.data.hasPopup){this._createPopup(null,this.data)}if(this.quadrilaterals){return this._renderQuadrilaterals("squigglyAnnotation")}this.container.className="squigglyAnnotation";return this.container};return t}(f);var L=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true,createQuadrilaterals:true})||this;return i}t.prototype.render=function(){if(!this.data.hasPopup){this._createPopup(null,this.data)}if(this.quadrilaterals){return this._renderQuadrilaterals("strikeoutAnnotation")}this.container.className="strikeoutAnnotation";return this.container};return t}(f);var I=function(e){__extends(t,e);function t(t){var r,n,a;var i=this;var o=!!(t.data.hasPopup||((r=t.data.titleObj)===null||r===void 0?void 0:r.str)||((n=t.data.contentsObj)===null||n===void 0?void 0:n.str)||((a=t.data.richText)===null||a===void 0?void 0:a.str));i=e.call(this,t,{isRenderable:o,ignoreBorder:true})||this;return i}t.prototype.render=function(){this.container.className="stampAnnotation";if(!this.data.hasPopup){this._createPopup(null,this.data)}return this.container};return t}(f);var N=function(e){__extends(t,e);function t(t){var r;var n=e.call(this,t,{isRenderable:true})||this;var a=n.data.file,s=a.filename,l=a.content;n.filename=(0,o.getFilenameFromUrl)(s);n.content=l;(r=n.linkService.eventBus)===null||r===void 0?void 0:r.dispatch("fileattachmentannotation",{source:n,id:(0,i.stringToPDFString)(s),filename:s,content:l});return n}t.prototype.render=function(){var e,t;this.container.className="fileAttachmentAnnotation";var r=document.createElement("div");r.style.height=this.container.style.height;r.style.width=this.container.style.width;r.addEventListener("dblclick",this._download.bind(this));if(!this.data.hasPopup&&(((e=this.data.titleObj)===null||e===void 0?void 0:e.str)||((t=this.data.contentsObj)===null||t===void 0?void 0:t.str)||this.data.richText)){this._createPopup(r,this.data)}this.container.appendChild(r);return this.container};t.prototype._download=function(){var e;(e=this.downloadManager)===null||e===void 0?void 0:e.openOrDownloadData(this.container,this.content,this.filename)};return t}(f);var j=function(){function e(){}e.render=function(e){var t=[],r=[];for(var l=0,u=e.annotations;l<u.length;l++){var c=u[l];if(!c){continue}if(c.annotationType===i.AnnotationType.POPUP){r.push(c);continue}t.push(c)}if(r.length){t.push.apply(t,r)}var d=e.div;for(var f=0,p=t;f<p.length;f++){var c=p[f];var v=h.create({data:c,layer:d,page:e.page,viewport:e.viewport,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==false,svgFactory:new o.DOMSVGFactory,annotationStorage:e.annotationStorage||new s.AnnotationStorage,enableScripting:e.enableScripting,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,mouseState:e.mouseState||{isDown:false}});if(v.isRenderable){var g=v.render();if(c.hidden){g.style.visibility="hidden"}if(Array.isArray(g)){for(var m=0,_=g;m<_.length;m++){var y=_[m];d.appendChild(y)}}else{if(v instanceof S){d.prepend(g)}else{d.appendChild(g)}}}}__classPrivateFieldGet(this,n,"m",a).call(this,d,e.annotationCanvasMap)};e.update=function(e){var t=e.page,r=e.viewport,o=e.annotations,s=e.annotationCanvasMap,l=e.div;var u=r.transform;var c="matrix(".concat(u.join(","),")");var d,h;for(var f=0,p=o;f<p.length;f++){var v=p[f];var g=l.querySelectorAll('[data-annotation-id="'.concat(v.id,'"]'));if(g){for(var m=0,_=g;m<_.length;m++){var y=_[m];if(v.hasOwnCanvas){var b=i.Util.normalizeRect([v.rect[0],t.view[3]-v.rect[1]+t.view[1],v.rect[2],t.view[3]-v.rect[3]+t.view[1]]);if(!h){d=Math.abs(u[0]||u[1]);var A=u.slice();for(var S=0;S<4;S++){A[S]=Math.sign(A[S])}h="matrix(".concat(A.join(","),")")}var x=b[0]*d;var C=b[1]*d;y.style.left="".concat(x,"px");y.style.top="".concat(C,"px");y.style.transformOrigin="".concat(-x,"px ").concat(-C,"px");y.style.transform=h}else{y.style.transform=c}}}}__classPrivateFieldGet(this,n,"m",a).call(this,l,s);l.hidden=false};return e}();n=j,a=function e(t,r){if(!r){return}for(var n=0,a=r;n<a.length;n++){var i=a[n],o=i[0],s=i[1];var l=t.querySelector('[data-annotation-id="'.concat(o,'"]'));if(!l){continue}var u=l.firstChild;if(u.nodeName==="CANVAS"){l.replaceChild(s,u)}else{l.insertBefore(s,u)}}r.clear()};t.AnnotationLayer=j},function(e,t){Object.defineProperty(t,"__esModule",{value:true});t.ColorConverters=void 0;function r(e){return Math.floor(Math.max(0,Math.min(1,e))*255).toString(16).padStart(2,"0")}var n=function(){function e(){}e.CMYK_G=function(e){var t=e[0],r=e[1],n=e[2],a=e[3];return["G",1-Math.min(1,.3*t+.59*n+.11*r+a)]};e.G_CMYK=function(e){var t=e[0];return["CMYK",0,0,0,1-t]};e.G_RGB=function(e){var t=e[0];return["RGB",t,t,t]};e.G_HTML=function(e){var t=e[0];var n=r(t);return"#".concat(n).concat(n).concat(n)};e.RGB_G=function(e){var t=e[0],r=e[1],n=e[2];return["G",.3*t+.59*r+.11*n]};e.RGB_HTML=function(e){var t=e[0],n=e[1],a=e[2];var i=r(t);var o=r(n);var s=r(a);return"#".concat(i).concat(o).concat(s)};e.T_HTML=function(){return"#00000000"};e.CMYK_RGB=function(e){var t=e[0],r=e[1],n=e[2],a=e[3];return["RGB",1-Math.min(1,t+a),1-Math.min(1,n+a),1-Math.min(1,r+a)]};e.CMYK_HTML=function(e){return this.RGB_HTML(this.CMYK_RGB(e))};e.RGB_CMYK=function(e){var t=e[0],r=e[1],n=e[2];var a=1-t;var i=1-r;var o=1-n;var s=Math.min(a,i,o);return["CMYK",a,i,o,s]};return e}();t.ColorConverters=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.XfaLayer=void 0;var n=r(2);var a=r(17);var i=function(){function e(){}e.setupStorage=function(e,t,r,n,a){var i=n.getValue(t,{value:null});switch(r.name){case"textarea":if(i.value!==null){e.textContent=i.value}if(a==="print"){break}e.addEventListener("input",(function(e){n.setValue(t,{value:e.target.value})}));break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(i.value===r.attributes.xfaOn){e.setAttribute("checked",true)}else if(i.value===r.attributes.xfaOff){e.removeAttribute("checked")}if(a==="print"){break}e.addEventListener("change",(function(e){n.setValue(t,{value:e.target.checked?e.target.getAttribute("xfaOn"):e.target.getAttribute("xfaOff")})}))}else{if(i.value!==null){e.setAttribute("value",i.value)}if(a==="print"){break}e.addEventListener("input",(function(e){n.setValue(t,{value:e.target.value})}))}break;case"select":if(i.value!==null){for(var o=0,s=r.children;o<s.length;o++){var l=s[o];if(l.attributes.value===i.value){l.attributes.selected=true}}}e.addEventListener("input",(function(e){var r=e.target.options;var a=r.selectedIndex===-1?"":r[r.selectedIndex].value;n.setValue(t,{value:a})}));break}};e.setAttributes=function(e){var t;var r=e.html,a=e.element,i=e.storage,o=i===void 0?null:i,s=e.intent,l=e.linkService;var u=a.attributes;var c=r instanceof HTMLAnchorElement;if(u.type==="radio"){u.name="".concat(u.name,"-").concat(s)}for(var d=0,h=Object.entries(u);d<h.length;d++){var f=h[d],p=f[0],v=f[1];if(v===null||v===undefined||p==="dataId"){continue}if(p!=="style"){if(p==="textContent"){r.textContent=v}else if(p==="class"){if(v.length){r.setAttribute(p,v.join(" "))}}else{if(c&&(p==="href"||p==="newWindow")){continue}r.setAttribute(p,v)}}else{Object.assign(r.style,v)}}if(c){if(!l.addLinkAttributes){(0,n.warn)("XfaLayer.setAttribute - missing `addLinkAttributes`-method on the `linkService`-instance.")}(t=l.addLinkAttributes)===null||t===void 0?void 0:t.call(l,r,u.href,u.newWindow)}if(o&&u.dataId){this.setupStorage(r,u.dataId,a,o)}};e.render=function(e){var t;var r=e.annotationStorage;var n=e.linkService;var i=e.xfaHtml;var o=e.intent||"display";var s=document.createElement(i.name);if(i.attributes){this.setAttributes({html:s,element:i,intent:o,linkService:n})}var l=[[i,-1,s]];var u=e.div;u.appendChild(s);if(e.viewport){var c="matrix(".concat(e.viewport.transform.join(","),")");u.style.transform=c}if(o!=="richText"){u.setAttribute("class","xfaLayer xfaFont")}var d=[];while(l.length>0){var h=l[l.length-1],f=h[0],p=h[1],v=h[2];if(p+1===f.children.length){l.pop();continue}var g=f.children[++l[l.length-1][1]];if(g===null){continue}var m=g.name;if(m==="#text"){var _=document.createTextNode(g.value);d.push(_);v.appendChild(_);continue}var y=void 0;if((t=g===null||g===void 0?void 0:g.attributes)===null||t===void 0?void 0:t.xmlns){y=document.createElementNS(g.attributes.xmlns,m)}else{y=document.createElement(m)}v.appendChild(y);if(g.attributes){this.setAttributes({html:y,element:g,storage:r,intent:o,linkService:n})}if(g.children&&g.children.length>0){l.push([g,-1,y])}else if(g.value){var _=document.createTextNode(g.value);if(a.XfaText.shouldBuildText(m)){d.push(_)}y.appendChild(_)}}for(var b=0,A=u.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea");b<A.length;b++){var S=A[b];S.setAttribute("readOnly",true)}return{textDivs:d}};e.update=function(e){var t="matrix(".concat(e.viewport.transform.join(","),")");e.div.style.transform=t;e.div.hidden=false};return e}();t.XfaLayer=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.renderTextLayer=m;var n=r(2);var a=1e5;var i=30;var o=.8;var s=new Map;var l=/^\s+$/g;function u(e,t){var r=s.get(e);if(r){return r}t.save();t.font="".concat(i,"px ").concat(e);var n=t.measureText("");var a=n.fontBoundingBoxAscent;var l=Math.abs(n.fontBoundingBoxDescent);if(a){t.restore();var u=a/(a+l);s.set(e,u);return u}t.strokeStyle="red";t.clearRect(0,0,i,i);t.strokeText("g",0,0);var c=t.getImageData(0,0,i,i).data;l=0;for(var d=c.length-1-3;d>=0;d-=4){if(c[d]>0){l=Math.ceil(d/4/i);break}}t.clearRect(0,0,i,i);t.strokeText("A",0,i);c=t.getImageData(0,0,i,i).data;a=0;for(var d=0,h=c.length;d<h;d+=4){if(c[d]>0){a=i-Math.floor(d/4/i);break}}t.restore();if(a){var u=a/(a+l);s.set(e,u);return u}s.set(e,o);return o}function c(e,t,r,a){var i=document.createElement("span");var o=e._enhanceTextSelection?{angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL,originalTransform:null,paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0,scale:1}:{angle:0,canvasWidth:0,hasText:t.str!=="",hasEOL:t.hasEOL};e._textDivs.push(i);var s=n.Util.transform(e._viewport.transform,t.transform);var c=Math.atan2(s[1],s[0]);var d=r[t.fontName];if(d.vertical){c+=Math.PI/2}var h=Math.hypot(s[2],s[3]);var f=h*u(d.fontFamily,a);var p,v;if(c===0){p=s[4];v=s[5]-f}else{p=s[4]+f*Math.sin(c);v=s[5]-f*Math.cos(c)}i.style.left="".concat(p,"px");i.style.top="".concat(v,"px");i.style.fontSize="".concat(h,"px");i.style.fontFamily=d.fontFamily;i.setAttribute("role","presentation");i.textContent=t.str;i.dir=t.dir;if(e._fontInspectorEnabled){i.dataset.fontName=t.fontName}if(c!==0){o.angle=c*(180/Math.PI)}var g=false;if(t.str.length>1||e._enhanceTextSelection&&l.test(t.str)){g=true}else if(t.str!==" "&&t.transform[0]!==t.transform[3]){var m=Math.abs(t.transform[0]),_=Math.abs(t.transform[3]);if(m!==_&&Math.max(m,_)/Math.min(m,_)>1.5){g=true}}if(g){if(d.vertical){o.canvasWidth=t.height*e._viewport.scale}else{o.canvasWidth=t.width*e._viewport.scale}}e._textDivProperties.set(i,o);if(e._textContentStream){e._layoutText(i)}if(e._enhanceTextSelection&&o.hasText){var y=1,b=0;if(c!==0){y=Math.cos(c);b=Math.sin(c)}var A=(d.vertical?t.height:t.width)*e._viewport.scale;var S=h;var x=void 0,C=void 0;if(c!==0){x=[y,b,-b,y,p,v];C=n.Util.getAxialAlignedBoundingBox([0,0,A,S],x)}else{C=[p,v,p+A,v+S]}e._bounds.push({left:C[0],top:C[1],right:C[2],bottom:C[3],div:i,size:[A,S],m:x})}}function d(e){if(e._canceled){return}var t=e._textDivs;var r=e._capability;var n=t.length;if(n>a){e._renderingDone=true;r.resolve();return}if(!e._textContentStream){for(var i=0;i<n;i++){e._layoutText(t[i])}}e._renderingDone=true;r.resolve()}function h(e,t,r){var n=0;for(var a=0;a<r;a++){var i=e[t++];if(i>0){n=n?Math.min(i,n):i}}return n}function f(e){var t=e._bounds;var r=e._viewport;var a=p(r.width,r.height,t);for(var i=0;i<a.length;i++){var o=t[i].div;var s=e._textDivProperties.get(o);if(s.angle===0){s.paddingLeft=t[i].left-a[i].left;s.paddingTop=t[i].top-a[i].top;s.paddingRight=a[i].right-t[i].right;s.paddingBottom=a[i].bottom-t[i].bottom;e._textDivProperties.set(o,s);continue}var l=a[i],u=t[i];var c=u.m,d=c[0],f=c[1];var v=[[0,0],[0,u.size[1]],[u.size[0],0],u.size];var g=new Float64Array(64);for(var m=0,_=v.length;m<_;m++){var y=n.Util.applyTransform(v[m],c);g[m+0]=d&&(l.left-y[0])/d;g[m+4]=f&&(l.top-y[1])/f;g[m+8]=d&&(l.right-y[0])/d;g[m+12]=f&&(l.bottom-y[1])/f;g[m+16]=f&&(l.left-y[0])/-f;g[m+20]=d&&(l.top-y[1])/d;g[m+24]=f&&(l.right-y[0])/-f;g[m+28]=d&&(l.bottom-y[1])/d;g[m+32]=d&&(l.left-y[0])/-d;g[m+36]=f&&(l.top-y[1])/-f;g[m+40]=d&&(l.right-y[0])/-d;g[m+44]=f&&(l.bottom-y[1])/-f;g[m+48]=f&&(l.left-y[0])/f;g[m+52]=d&&(l.top-y[1])/-d;g[m+56]=f&&(l.right-y[0])/f;g[m+60]=d&&(l.bottom-y[1])/-d}var b=1+Math.min(Math.abs(d),Math.abs(f));s.paddingLeft=h(g,32,16)/b;s.paddingTop=h(g,48,16)/b;s.paddingRight=h(g,0,16)/b;s.paddingBottom=h(g,16,16)/b;e._textDivProperties.set(o,s)}}function p(e,t,r){var n=r.map((function(e,t){return{x1:e.left,y1:e.top,x2:e.right,y2:e.bottom,index:t,x1New:undefined,x2New:undefined}}));v(e,n);var a=new Array(r.length);for(var i=0,o=n;i<o.length;i++){var s=o[i];var l=s.index;a[l]={left:s.x1New,top:0,right:s.x2New,bottom:0}}r.map((function(t,r){var i=a[r],o=n[r];o.x1=t.top;o.y1=e-i.right;o.x2=t.bottom;o.y2=e-i.left;o.index=r;o.x1New=undefined;o.x2New=undefined}));v(t,n);for(var u=0,c=n;u<c.length;u++){var s=c[u];var l=s.index;a[l].top=s.x1New;a[l].bottom=s.x2New}return a}function v(e,t){t.sort((function(e,t){return e.x1-t.x1||e.index-t.index}));var r={x1:-Infinity,y1:-Infinity,x2:0,y2:Infinity,index:-1,x1New:0,x2New:0};var n=[{start:-Infinity,end:Infinity,boundary:r}];for(var a=0,i=t;a<i.length;a++){var o=i[a];var s=0;while(s<n.length&&n[s].end<=o.y1){s++}var l=n.length-1;while(l>=0&&n[l].start>=o.y2){l--}var u=void 0,c=void 0;var d=void 0,h=void 0,f=-Infinity;for(d=s;d<=l;d++){u=n[d];c=u.boundary;var p=void 0;if(c.x2>o.x1){p=c.index>o.index?c.x1New:o.x1}else if(c.x2New===undefined){p=(c.x2+o.x1)/2}else{p=c.x2New}if(p>f){f=p}}o.x1New=f;for(d=s;d<=l;d++){u=n[d];c=u.boundary;if(c.x2New===undefined){if(c.x2>o.x1){if(c.index>o.index){c.x2New=c.x2}}else{c.x2New=f}}else if(c.x2New>f){c.x2New=Math.max(f,c.x2)}}var v=[];var g=null;for(d=s;d<=l;d++){u=n[d];c=u.boundary;var m=c.x2>o.x2?c:o;if(g===m){v[v.length-1].end=u.end}else{v.push({start:u.start,end:u.end,boundary:m});g=m}}if(n[s].start<o.y1){v[0].start=o.y1;v.unshift({start:n[s].start,end:o.y1,boundary:n[s].boundary})}if(o.y2<n[l].end){v[v.length-1].end=o.y2;v.push({start:o.y2,end:n[l].end,boundary:n[l].boundary})}for(d=s;d<=l;d++){u=n[d];c=u.boundary;if(c.x2New!==undefined){continue}var _=false;for(h=s-1;!_&&h>=0&&n[h].start>=c.y1;h--){_=n[h].boundary===c}for(h=l+1;!_&&h<n.length&&n[h].end<=c.y2;h++){_=n[h].boundary===c}for(h=0;!_&&h<v.length;h++){_=v[h].boundary===c}if(!_){c.x2New=f}}Array.prototype.splice.apply(n,[s,l-s+1].concat(v))}for(var y=0,b=n;y<b.length;y++){var u=b[y];var c=u.boundary;if(c.x2New===undefined){c.x2New=Math.max(e,c.x2)}}}var g=function(){function e(e){var t=this;var r=e.textContent,a=e.textContentStream,i=e.container,o=e.viewport,s=e.textDivs,l=e.textContentItemsStr,u=e.enhanceTextSelection;var c;this._textContent=r;this._textContentStream=a;this._container=i;this._document=i.ownerDocument;this._viewport=o;this._textDivs=s||[];this._textContentItemsStr=l||[];this._enhanceTextSelection=!!u;this._fontInspectorEnabled=!!((c=globalThis.FontInspector)===null||c===void 0?void 0:c.enabled);this._reader=null;this._layoutTextLastFontSize=null;this._layoutTextLastFontFamily=null;this._layoutTextCtx=null;this._textDivProperties=new WeakMap;this._renderingDone=false;this._canceled=false;this._capability=(0,n.createPromiseCapability)();this._renderTimer=null;this._bounds=[];this._capability.promise.finally((function(){if(!t._enhanceTextSelection){t._textDivProperties=null}if(t._layoutTextCtx){t._layoutTextCtx.canvas.width=0;t._layoutTextCtx.canvas.height=0;t._layoutTextCtx=null}})).catch((function(){}))}Object.defineProperty(e.prototype,"promise",{get:function(){return this._capability.promise},enumerable:false,configurable:true});e.prototype.cancel=function(){this._canceled=true;if(this._reader){this._reader.cancel(new n.AbortException("TextLayer task cancelled.")).catch((function(){}));this._reader=null}if(this._renderTimer!==null){clearTimeout(this._renderTimer);this._renderTimer=null}this._capability.reject(new Error("TextLayer task cancelled."))};e.prototype._processItems=function(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r].str===undefined){if(e[r].type==="beginMarkedContentProps"||e[r].type==="beginMarkedContent"){var a=this._container;this._container=document.createElement("span");this._container.classList.add("markedContent");if(e[r].id!==null){this._container.setAttribute("id","".concat(e[r].id))}a.appendChild(this._container)}else if(e[r].type==="endMarkedContent"){this._container=this._container.parentNode}continue}this._textContentItemsStr.push(e[r].str);c(this,e[r],t,this._layoutTextCtx)}};e.prototype._layoutText=function(e){var t=this._textDivProperties.get(e);var r="";if(t.canvasWidth!==0&&t.hasText){var n=e.style,a=n.fontSize,i=n.fontFamily;if(a!==this._layoutTextLastFontSize||i!==this._layoutTextLastFontFamily){this._layoutTextCtx.font="".concat(a," ").concat(i);this._layoutTextLastFontSize=a;this._layoutTextLastFontFamily=i}var o=this._layoutTextCtx.measureText(e.textContent).width;if(o>0){var s=t.canvasWidth/o;if(this._enhanceTextSelection){t.scale=s}r="scaleX(".concat(s,")")}}if(t.angle!==0){r="rotate(".concat(t.angle,"deg) ").concat(r)}if(r.length>0){if(this._enhanceTextSelection){t.originalTransform=r}e.style.transform=r}if(t.hasText){this._container.appendChild(e)}if(t.hasEOL){var l=document.createElement("br");l.setAttribute("role","presentation");this._container.appendChild(l)}};e.prototype._render=function(e){var t=this;if(e===void 0){e=0}var r=(0,n.createPromiseCapability)();var a=Object.create(null);var o=this._document.createElement("canvas");o.height=o.width=i;o.mozOpaque=true;this._layoutTextCtx=o.getContext("2d",{alpha:false});if(this._textContent){var s=this._textContent.items;var l=this._textContent.styles;this._processItems(s,l);r.resolve()}else if(this._textContentStream){var u=function(){t._reader.read().then((function(e){var n=e.value,i=e.done;if(i){r.resolve();return}Object.assign(a,n.styles);t._processItems(n.items,a);u()}),r.reject)};this._reader=this._textContentStream.getReader();u()}else{throw new Error('Neither "textContent" nor "textContentStream" parameters specified.')}r.promise.then((function(){a=null;if(!e){d(t)}else{t._renderTimer=setTimeout((function(){d(t);t._renderTimer=null}),e)}}),this._capability.reject)};e.prototype.expandTextDivs=function(e){if(e===void 0){e=false}if(!this._enhanceTextSelection||!this._renderingDone){return}if(this._bounds!==null){f(this);this._bounds=null}var t=[],r=[];for(var n=0,a=this._textDivs.length;n<a;n++){var i=this._textDivs[n];var o=this._textDivProperties.get(i);if(!o.hasText){continue}if(e){t.length=0;r.length=0;if(o.originalTransform){t.push(o.originalTransform)}if(o.paddingTop>0){r.push("".concat(o.paddingTop,"px"));t.push("translateY(".concat(-o.paddingTop,"px)"))}else{r.push(0)}if(o.paddingRight>0){r.push("".concat(o.paddingRight/o.scale,"px"))}else{r.push(0)}if(o.paddingBottom>0){r.push("".concat(o.paddingBottom,"px"))}else{r.push(0)}if(o.paddingLeft>0){r.push("".concat(o.paddingLeft/o.scale,"px"));t.push("translateX(".concat(-o.paddingLeft/o.scale,"px)"))}else{r.push(0)}i.style.padding=r.join(" ");if(t.length){i.style.transform=t.join(" ")}}else{i.style.padding=null;i.style.transform=o.originalTransform}}};return e}();function m(e){var t=new g({textContent:e.textContent,textContentStream:e.textContentStream,container:e.container,viewport:e.viewport,textDivs:e.textDivs,textContentItemsStr:e.textContentItemsStr,enhanceTextSelection:e.enhanceTextSelection});t._render(e.timeout);return t}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.SVGGraphics=void 0;var n=r(2);var a=r(1);var i=r(4);var o=function(){function e(){(0,n.unreachable)("Not implemented: SVGGraphics")}return e}();t.SVGGraphics=o;{var s={fontStyle:"normal",fontWeight:"normal",fillColor:"#000000"};var l="http://www.w3.org/XML/1998/namespace";var u="http://www.w3.org/1999/xlink";var c=["butt","round","square"];var d=["miter","round","bevel"];var h=function(){var e=new Uint8Array([137,80,78,71,13,10,26,10]);var t=12;var r=new Int32Array(256);for(var a=0;a<256;a++){var o=a;for(var s=0;s<8;s++){if(o&1){o=3988292384^o>>1&2147483647}else{o=o>>1&2147483647}}r[a]=o}function l(e,t,n){var a=-1;for(var i=t;i<n;i++){var o=(a^e[i])&255;var s=r[o];a=a>>>8^s}return a^-1}function u(e,t,r,n){var a=n;var i=t.length;r[a]=i>>24&255;r[a+1]=i>>16&255;r[a+2]=i>>8&255;r[a+3]=i&255;a+=4;r[a]=e.charCodeAt(0)&255;r[a+1]=e.charCodeAt(1)&255;r[a+2]=e.charCodeAt(2)&255;r[a+3]=e.charCodeAt(3)&255;a+=4;r.set(t,a);a+=t.length;var o=l(r,n+4,a);r[a]=o>>24&255;r[a+1]=o>>16&255;r[a+2]=o>>8&255;r[a+3]=o&255}function c(e,t,r){var n=1;var a=0;for(var i=t;i<r;++i){n=(n+(e[i]&255))%65521;a=(a+n)%65521}return a<<16|n}function d(e){if(!i.isNodeJS){return h(e)}try{var t=void 0;if(parseInt(process_1.versions.node)>=8){t=e}else{t=Buffer.from(e)}var r=require$$5.deflateSync(t,{level:9});return r instanceof Uint8Array?r:new Uint8Array(r)}catch(e){(0,n.warn)("Not compressing PNG because zlib.deflateSync is unavailable: "+e)}return h(e)}function h(e){var t=e.length;var r=65535;var n=Math.ceil(t/r);var a=new Uint8Array(2+t+n*5+4);var i=0;a[i++]=120;a[i++]=156;var o=0;while(t>r){a[i++]=0;a[i++]=255;a[i++]=255;a[i++]=0;a[i++]=0;a.set(e.subarray(o,o+r),i);i+=r;o+=r;t-=r}a[i++]=1;a[i++]=t&255;a[i++]=t>>8&255;a[i++]=~t&65535&255;a[i++]=(~t&65535)>>8&255;a.set(e.subarray(o),i);i+=e.length-o;var s=c(e,0,e.length);a[i++]=s>>24&255;a[i++]=s>>16&255;a[i++]=s>>8&255;a[i++]=s&255;return a}function f(r,a,i,o){var s=r.width;var l=r.height;var c,h,f;var p=r.data;switch(a){case n.ImageKind.GRAYSCALE_1BPP:h=0;c=1;f=s+7>>3;break;case n.ImageKind.RGB_24BPP:h=2;c=8;f=s*3;break;case n.ImageKind.RGBA_32BPP:h=6;c=8;f=s*4;break;default:throw new Error("invalid format")}var v=new Uint8Array((1+f)*l);var g=0,m=0;for(var _=0;_<l;++_){v[g++]=0;v.set(p.subarray(m,m+f),g);m+=f;g+=f}if(a===n.ImageKind.GRAYSCALE_1BPP&&o){g=0;for(var _=0;_<l;_++){g++;for(var y=0;y<f;y++){v[g++]^=255}}}var b=new Uint8Array([s>>24&255,s>>16&255,s>>8&255,s&255,l>>24&255,l>>16&255,l>>8&255,l&255,c,h,0,0,0]);var A=d(v);var S=e.length+t*3+b.length+A.length;var x=new Uint8Array(S);var C=0;x.set(e,C);C+=e.length;u("IHDR",b,x,C);C+=t+b.length;u("IDATA",A,x,C);C+=t+A.length;u("IEND",new Uint8Array(0),x,C);return(0,n.createObjectURL)(x,"image/png",i)}return function e(t,r,a){var i=t.kind===undefined?n.ImageKind.GRAYSCALE_1BPP:t.kind;return f(t,i,r,a)}}();var f=function(){function e(){this.fontSizeScale=1;this.fontWeight=s.fontWeight;this.fontSize=0;this.textMatrix=n.IDENTITY_MATRIX;this.fontMatrix=n.FONT_IDENTITY_MATRIX;this.leading=0;this.textRenderingMode=n.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=s.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=""}e.prototype.clone=function(){return Object.create(this)};e.prototype.setCurrentPoint=function(e,t){this.x=e;this.y=t};return e}();function p(e){var t=[];var r=[];for(var n=0,a=e;n<a.length;n++){var i=a[n];if(i.fn==="save"){t.push({fnId:92,fn:"group",items:[]});r.push(t);t=t[t.length-1].items;continue}if(i.fn==="restore"){t=r.pop()}else{t.push(i)}}return t}function v(e){if(Number.isInteger(e)){return e.toString()}var t=e.toFixed(10);var r=t.length-1;if(t[r]!=="0"){return t}do{r--}while(t[r]==="0");return t.substring(0,t[r]==="."?r:r+1)}function g(e){if(e[4]===0&&e[5]===0){if(e[1]===0&&e[2]===0){if(e[0]===1&&e[3]===1){return""}return"scale(".concat(v(e[0])," ").concat(v(e[3]),")")}if(e[0]===e[3]&&e[1]===-e[2]){var t=Math.acos(e[0])*180/Math.PI;return"rotate(".concat(v(t),")")}}else{if(e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1){return"translate(".concat(v(e[4])," ").concat(v(e[5]),")")}}return"matrix(".concat(v(e[0])," ").concat(v(e[1])," ").concat(v(e[2])," ").concat(v(e[3])," ").concat(v(e[4])," ")+"".concat(v(e[5]),")")}var m=0;var _=0;var y=0;t.SVGGraphics=o=function(){function e(e,t,r){if(r===void 0){r=false}this.svgFactory=new a.DOMSVGFactory;this.current=new f;this.transformMatrix=n.IDENTITY_MATRIX;this.transformStack=[];this.extraStack=[];this.commonObjs=e;this.objs=t;this.pendingClip=null;this.pendingEOFill=false;this.embedFonts=false;this.embeddedFonts=Object.create(null);this.cssStyle=null;this.forceDataSchema=!!r;this._operatorIdMapping=[];for(var i in n.OPS){this._operatorIdMapping[n.OPS[i]]=i}}e.prototype.save=function(){this.transformStack.push(this.transformMatrix);var e=this.current;this.extraStack.push(e);this.current=e.clone()};e.prototype.restore=function(){this.transformMatrix=this.transformStack.pop();this.current=this.extraStack.pop();this.pendingClip=null;this.tgrp=null};e.prototype.group=function(e){this.save();this.executeOpTree(e);this.restore()};e.prototype.loadDependencies=function(e){var t=e.fnArray;var r=e.argsArray;for(var a=0,i=t.length;a<i;a++){if(t[a]!==n.OPS.dependency){continue}var o=function(e){var t=e.startsWith("g_")?s.commonObjs:s.objs;var r=new Promise((function(r){t.get(e,r)}));s.current.dependencies.push(r)};var s=this;for(var l=0,u=r[a];l<u.length;l++){var c=u[l];o(c)}}return Promise.all(this.current.dependencies)};e.prototype.transform=function(e,t,r,a,i,o){var s=[e,t,r,a,i,o];this.transformMatrix=n.Util.transform(this.transformMatrix,s);this.tgrp=null};e.prototype.getSVG=function(e,t){var r=this;this.viewport=t;var a=this._initialize(t);return this.loadDependencies(e).then((function(){r.transformMatrix=n.IDENTITY_MATRIX;r.executeOpTree(r.convertOpList(e));return a}))};e.prototype.convertOpList=function(e){var t=this._operatorIdMapping;var r=e.argsArray;var n=e.fnArray;var a=[];for(var i=0,o=n.length;i<o;i++){var s=n[i];a.push({fnId:s,fn:t[s],args:r[i]})}return p(a)};e.prototype.executeOpTree=function(e){for(var t=0,r=e;t<r.length;t++){var a=r[t];var i=a.fn;var o=a.fnId;var s=a.args;switch(o|0){case n.OPS.beginText:this.beginText();break;case n.OPS.dependency:break;case n.OPS.setLeading:this.setLeading(s);break;case n.OPS.setLeadingMoveText:this.setLeadingMoveText(s[0],s[1]);break;case n.OPS.setFont:this.setFont(s);break;case n.OPS.showText:this.showText(s[0]);break;case n.OPS.showSpacedText:this.showText(s[0]);break;case n.OPS.endText:this.endText();break;case n.OPS.moveText:this.moveText(s[0],s[1]);break;case n.OPS.setCharSpacing:this.setCharSpacing(s[0]);break;case n.OPS.setWordSpacing:this.setWordSpacing(s[0]);break;case n.OPS.setHScale:this.setHScale(s[0]);break;case n.OPS.setTextMatrix:this.setTextMatrix(s[0],s[1],s[2],s[3],s[4],s[5]);break;case n.OPS.setTextRise:this.setTextRise(s[0]);break;case n.OPS.setTextRenderingMode:this.setTextRenderingMode(s[0]);break;case n.OPS.setLineWidth:this.setLineWidth(s[0]);break;case n.OPS.setLineJoin:this.setLineJoin(s[0]);break;case n.OPS.setLineCap:this.setLineCap(s[0]);break;case n.OPS.setMiterLimit:this.setMiterLimit(s[0]);break;case n.OPS.setFillRGBColor:this.setFillRGBColor(s[0],s[1],s[2]);break;case n.OPS.setStrokeRGBColor:this.setStrokeRGBColor(s[0],s[1],s[2]);break;case n.OPS.setStrokeColorN:this.setStrokeColorN(s);break;case n.OPS.setFillColorN:this.setFillColorN(s);break;case n.OPS.shadingFill:this.shadingFill(s[0]);break;case n.OPS.setDash:this.setDash(s[0],s[1]);break;case n.OPS.setRenderingIntent:this.setRenderingIntent(s[0]);break;case n.OPS.setFlatness:this.setFlatness(s[0]);break;case n.OPS.setGState:this.setGState(s[0]);break;case n.OPS.fill:this.fill();break;case n.OPS.eoFill:this.eoFill();break;case n.OPS.stroke:this.stroke();break;case n.OPS.fillStroke:this.fillStroke();break;case n.OPS.eoFillStroke:this.eoFillStroke();break;case n.OPS.clip:this.clip("nonzero");break;case n.OPS.eoClip:this.clip("evenodd");break;case n.OPS.paintSolidColorImageMask:this.paintSolidColorImageMask();break;case n.OPS.paintImageXObject:this.paintImageXObject(s[0]);break;case n.OPS.paintInlineImageXObject:this.paintInlineImageXObject(s[0]);break;case n.OPS.paintImageMaskXObject:this.paintImageMaskXObject(s[0]);break;case n.OPS.paintFormXObjectBegin:this.paintFormXObjectBegin(s[0],s[1]);break;case n.OPS.paintFormXObjectEnd:this.paintFormXObjectEnd();break;case n.OPS.closePath:this.closePath();break;case n.OPS.closeStroke:this.closeStroke();break;case n.OPS.closeFillStroke:this.closeFillStroke();break;case n.OPS.closeEOFillStroke:this.closeEOFillStroke();break;case n.OPS.nextLine:this.nextLine();break;case n.OPS.transform:this.transform(s[0],s[1],s[2],s[3],s[4],s[5]);break;case n.OPS.constructPath:this.constructPath(s[0],s[1]);break;case n.OPS.endPath:this.endPath();break;case 92:this.group(a.items);break;default:(0,n.warn)("Unimplemented operator ".concat(i));break}}};e.prototype.setWordSpacing=function(e){this.current.wordSpacing=e};e.prototype.setCharSpacing=function(e){this.current.charSpacing=e};e.prototype.nextLine=function(){this.moveText(0,this.current.leading)};e.prototype.setTextMatrix=function(e,t,r,n,a,i){var o=this.current;o.textMatrix=o.lineMatrix=[e,t,r,n,a,i];o.textMatrixScale=Math.hypot(e,t);o.x=o.lineX=0;o.y=o.lineY=0;o.xcoords=[];o.ycoords=[];o.tspan=this.svgFactory.createElement("svg:tspan");o.tspan.setAttributeNS(null,"font-family",o.fontFamily);o.tspan.setAttributeNS(null,"font-size","".concat(v(o.fontSize),"px"));o.tspan.setAttributeNS(null,"y",v(-o.y));o.txtElement=this.svgFactory.createElement("svg:text");o.txtElement.appendChild(o.tspan)};e.prototype.beginText=function(){var e=this.current;e.x=e.lineX=0;e.y=e.lineY=0;e.textMatrix=n.IDENTITY_MATRIX;e.lineMatrix=n.IDENTITY_MATRIX;e.textMatrixScale=1;e.tspan=this.svgFactory.createElement("svg:tspan");e.txtElement=this.svgFactory.createElement("svg:text");e.txtgrp=this.svgFactory.createElement("svg:g");e.xcoords=[];e.ycoords=[]};e.prototype.moveText=function(e,t){var r=this.current;r.x=r.lineX+=e;r.y=r.lineY+=t;r.xcoords=[];r.ycoords=[];r.tspan=this.svgFactory.createElement("svg:tspan");r.tspan.setAttributeNS(null,"font-family",r.fontFamily);r.tspan.setAttributeNS(null,"font-size","".concat(v(r.fontSize),"px"));r.tspan.setAttributeNS(null,"y",v(-r.y))};e.prototype.showText=function(e){var t=this.current;var r=t.font;var a=t.fontSize;if(a===0){return}var i=t.fontSizeScale;var o=t.charSpacing;var u=t.wordSpacing;var c=t.fontDirection;var d=t.textHScale*c;var h=r.vertical;var f=h?1:-1;var p=r.defaultVMetrics;var m=a*t.fontMatrix[0];var _=0;for(var y=0,b=e;y<b.length;y++){var A=b[y];if(A===null){_+=c*u;continue}else if((0,n.isNum)(A)){_+=f*A*a/1e3;continue}var S=(A.isSpace?u:0)+o;var x=A.fontChar;var C=void 0,P=void 0;var w=A.width;if(h){var k=void 0;var T=A.vmetric||p;k=A.vmetric?T[1]:w*.5;k=-k*m;var R=T[2]*m;w=T?-T[0]:w;C=k/i;P=(_+R)/i}else{C=_/i;P=0}if(A.isInFont||r.missingFile){t.xcoords.push(t.x+C);if(h){t.ycoords.push(-t.y+P)}t.tspan.textContent+=x}else{}var F=void 0;if(h){F=w*m-S*c}else{F=w*m+S*c}_+=F}t.tspan.setAttributeNS(null,"x",t.xcoords.map(v).join(" "));if(h){t.tspan.setAttributeNS(null,"y",t.ycoords.map(v).join(" "))}else{t.tspan.setAttributeNS(null,"y",v(-t.y))}if(h){t.y-=_}else{t.x+=_*d}t.tspan.setAttributeNS(null,"font-family",t.fontFamily);t.tspan.setAttributeNS(null,"font-size","".concat(v(t.fontSize),"px"));if(t.fontStyle!==s.fontStyle){t.tspan.setAttributeNS(null,"font-style",t.fontStyle)}if(t.fontWeight!==s.fontWeight){t.tspan.setAttributeNS(null,"font-weight",t.fontWeight)}var E=t.textRenderingMode&n.TextRenderingMode.FILL_STROKE_MASK;if(E===n.TextRenderingMode.FILL||E===n.TextRenderingMode.FILL_STROKE){if(t.fillColor!==s.fillColor){t.tspan.setAttributeNS(null,"fill",t.fillColor)}if(t.fillAlpha<1){t.tspan.setAttributeNS(null,"fill-opacity",t.fillAlpha)}}else if(t.textRenderingMode===n.TextRenderingMode.ADD_TO_PATH){t.tspan.setAttributeNS(null,"fill","transparent")}else{t.tspan.setAttributeNS(null,"fill","none")}if(E===n.TextRenderingMode.STROKE||E===n.TextRenderingMode.FILL_STROKE){var O=1/(t.textMatrixScale||1);this._setStrokeAttributes(t.tspan,O)}var M=t.textMatrix;if(t.textRise!==0){M=M.slice();M[5]+=t.textRise}t.txtElement.setAttributeNS(null,"transform","".concat(g(M)," scale(").concat(v(d),", -1)"));t.txtElement.setAttributeNS(l,"xml:space","preserve");t.txtElement.appendChild(t.tspan);t.txtgrp.appendChild(t.txtElement);this._ensureTransformGroup().appendChild(t.txtElement)};e.prototype.setLeadingMoveText=function(e,t){this.setLeading(-t);this.moveText(e,t)};e.prototype.addFontStyle=function(e){if(!e.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 t=(0,n.createObjectURL)(e.data,e.mimetype,this.forceDataSchema);this.cssStyle.textContent+='@font-face { font-family: "'.concat(e.loadedName,'";')+" src: url(".concat(t,"); }\n")};e.prototype.setFont=function(e){var t=this.current;var r=this.commonObjs.get(e[0]);var a=e[1];t.font=r;if(this.embedFonts&&!r.missingFile&&!this.embeddedFonts[r.loadedName]){this.addFontStyle(r);this.embeddedFonts[r.loadedName]=r}t.fontMatrix=r.fontMatrix||n.FONT_IDENTITY_MATRIX;var i="normal";if(r.black){i="900"}else if(r.bold){i="bold"}var o=r.italic?"italic":"normal";if(a<0){a=-a;t.fontDirection=-1}else{t.fontDirection=1}t.fontSize=a;t.fontFamily=r.loadedName;t.fontWeight=i;t.fontStyle=o;t.tspan=this.svgFactory.createElement("svg:tspan");t.tspan.setAttributeNS(null,"y",v(-t.y));t.xcoords=[];t.ycoords=[]};e.prototype.endText=function(){var e;var t=this.current;if(t.textRenderingMode&n.TextRenderingMode.ADD_TO_PATH_FLAG&&((e=t.txtElement)===null||e===void 0?void 0:e.hasChildNodes())){t.element=t.txtElement;this.clip("nonzero");this.endPath()}};e.prototype.setLineWidth=function(e){if(e>0){this.current.lineWidth=e}};e.prototype.setLineCap=function(e){this.current.lineCap=c[e]};e.prototype.setLineJoin=function(e){this.current.lineJoin=d[e]};e.prototype.setMiterLimit=function(e){this.current.miterLimit=e};e.prototype.setStrokeAlpha=function(e){this.current.strokeAlpha=e};e.prototype.setStrokeRGBColor=function(e,t,r){this.current.strokeColor=n.Util.makeHexColor(e,t,r)};e.prototype.setFillAlpha=function(e){this.current.fillAlpha=e};e.prototype.setFillRGBColor=function(e,t,r){this.current.fillColor=n.Util.makeHexColor(e,t,r);this.current.tspan=this.svgFactory.createElement("svg:tspan");this.current.xcoords=[];this.current.ycoords=[]};e.prototype.setStrokeColorN=function(e){this.current.strokeColor=this._makeColorN_Pattern(e)};e.prototype.setFillColorN=function(e){this.current.fillColor=this._makeColorN_Pattern(e)};e.prototype.shadingFill=function(e){var t=this.viewport.width;var r=this.viewport.height;var a=n.Util.inverseTransform(this.transformMatrix);var i=n.Util.applyTransform([0,0],a);var o=n.Util.applyTransform([0,r],a);var s=n.Util.applyTransform([t,0],a);var l=n.Util.applyTransform([t,r],a);var u=Math.min(i[0],o[0],s[0],l[0]);var c=Math.min(i[1],o[1],s[1],l[1]);var d=Math.max(i[0],o[0],s[0],l[0]);var h=Math.max(i[1],o[1],s[1],l[1]);var f=this.svgFactory.createElement("svg:rect");f.setAttributeNS(null,"x",u);f.setAttributeNS(null,"y",c);f.setAttributeNS(null,"width",d-u);f.setAttributeNS(null,"height",h-c);f.setAttributeNS(null,"fill",this._makeShadingPattern(e));if(this.current.fillAlpha<1){f.setAttributeNS(null,"fill-opacity",this.current.fillAlpha)}this._ensureTransformGroup().appendChild(f)};e.prototype._makeColorN_Pattern=function(e){if(e[0]==="TilingPattern"){return this._makeTilingPattern(e)}return this._makeShadingPattern(e)};e.prototype._makeTilingPattern=function(e){var t;var r=e[1];var a=e[2];var i=e[3]||n.IDENTITY_MATRIX;var o=e[4],s=o[0],l=o[1],u=o[2],c=o[3];var d=e[5];var h=e[6];var f=e[7];var p="shading".concat(y++);var v=n.Util.normalizeRect(__spreadArray(__spreadArray([],n.Util.applyTransform([s,l],i),true),n.Util.applyTransform([u,c],i),true)),g=v[0],m=v[1],_=v[2],b=v[3];var A=n.Util.singularValueDecompose2dScale(i),S=A[0],x=A[1];var C=d*S;var P=h*x;var w=this.svgFactory.createElement("svg:pattern");w.setAttributeNS(null,"id",p);w.setAttributeNS(null,"patternUnits","userSpaceOnUse");w.setAttributeNS(null,"width",C);w.setAttributeNS(null,"height",P);w.setAttributeNS(null,"x","".concat(g));w.setAttributeNS(null,"y","".concat(m));var k=this.svg;var T=this.transformMatrix;var R=this.current.fillColor;var F=this.current.strokeColor;var E=this.svgFactory.create(_-g,b-m);this.svg=E;this.transformMatrix=i;if(f===2){var O=(t=n.Util).makeHexColor.apply(t,r);this.current.fillColor=O;this.current.strokeColor=O}this.executeOpTree(this.convertOpList(a));this.svg=k;this.transformMatrix=T;this.current.fillColor=R;this.current.strokeColor=F;w.appendChild(E.childNodes[0]);this.defs.appendChild(w);return"url(#".concat(p,")")};e.prototype._makeShadingPattern=function(e){if(typeof e==="string"){e=this.objs.get(e)}switch(e[0]){case"RadialAxial":var t="shading".concat(y++);var r=e[3];var a=void 0;switch(e[1]){case"axial":var i=e[4];var o=e[5];a=this.svgFactory.createElement("svg:linearGradient");a.setAttributeNS(null,"id",t);a.setAttributeNS(null,"gradientUnits","userSpaceOnUse");a.setAttributeNS(null,"x1",i[0]);a.setAttributeNS(null,"y1",i[1]);a.setAttributeNS(null,"x2",o[0]);a.setAttributeNS(null,"y2",o[1]);break;case"radial":var s=e[4];var l=e[5];var u=e[6];var c=e[7];a=this.svgFactory.createElement("svg:radialGradient");a.setAttributeNS(null,"id",t);a.setAttributeNS(null,"gradientUnits","userSpaceOnUse");a.setAttributeNS(null,"cx",l[0]);a.setAttributeNS(null,"cy",l[1]);a.setAttributeNS(null,"r",c);a.setAttributeNS(null,"fx",s[0]);a.setAttributeNS(null,"fy",s[1]);a.setAttributeNS(null,"fr",u);break;default:throw new Error("Unknown RadialAxial type: ".concat(e[1]))}for(var d=0,h=r;d<h.length;d++){var f=h[d];var p=this.svgFactory.createElement("svg:stop");p.setAttributeNS(null,"offset",f[0]);p.setAttributeNS(null,"stop-color",f[1]);a.appendChild(p)}this.defs.appendChild(a);return"url(#".concat(t,")");case"Mesh":(0,n.warn)("Unimplemented pattern Mesh");return null;case"Dummy":return"hotpink";default:throw new Error("Unknown IR type: ".concat(e[0]))}};e.prototype.setDash=function(e,t){this.current.dashArray=e;this.current.dashPhase=t};e.prototype.constructPath=function(e,t){var r=this.current;var a=r.x,i=r.y;var o=[];var s=0;for(var l=0,u=e;l<u.length;l++){var c=u[l];switch(c|0){case n.OPS.rectangle:a=t[s++];i=t[s++];var d=t[s++];var h=t[s++];var f=a+d;var p=i+h;o.push("M",v(a),v(i),"L",v(f),v(i),"L",v(f),v(p),"L",v(a),v(p),"Z");break;case n.OPS.moveTo:a=t[s++];i=t[s++];o.push("M",v(a),v(i));break;case n.OPS.lineTo:a=t[s++];i=t[s++];o.push("L",v(a),v(i));break;case n.OPS.curveTo:a=t[s+4];i=t[s+5];o.push("C",v(t[s]),v(t[s+1]),v(t[s+2]),v(t[s+3]),v(a),v(i));s+=6;break;case n.OPS.curveTo2:o.push("C",v(a),v(i),v(t[s]),v(t[s+1]),v(t[s+2]),v(t[s+3]));a=t[s+2];i=t[s+3];s+=4;break;case n.OPS.curveTo3:a=t[s+2];i=t[s+3];o.push("C",v(t[s]),v(t[s+1]),v(a),v(i),v(a),v(i));s+=4;break;case n.OPS.closePath:o.push("Z");break}}o=o.join(" ");if(r.path&&e.length>0&&e[0]!==n.OPS.rectangle&&e[0]!==n.OPS.moveTo){o=r.path.getAttributeNS(null,"d")+o}else{r.path=this.svgFactory.createElement("svg:path");this._ensureTransformGroup().appendChild(r.path)}r.path.setAttributeNS(null,"d",o);r.path.setAttributeNS(null,"fill","none");r.element=r.path;r.setCurrentPoint(a,i)};e.prototype.endPath=function(){var e=this.current;e.path=null;if(!this.pendingClip){return}if(!e.element){this.pendingClip=null;return}var t="clippath".concat(m++);var r=this.svgFactory.createElement("svg:clipPath");r.setAttributeNS(null,"id",t);r.setAttributeNS(null,"transform",g(this.transformMatrix));var n=e.element.cloneNode(true);if(this.pendingClip==="evenodd"){n.setAttributeNS(null,"clip-rule","evenodd")}else{n.setAttributeNS(null,"clip-rule","nonzero")}this.pendingClip=null;r.appendChild(n);this.defs.appendChild(r);if(e.activeClipUrl){e.clipGroup=null;for(var a=0,i=this.extraStack;a<i.length;a++){var o=i[a];o.clipGroup=null}r.setAttributeNS(null,"clip-path",e.activeClipUrl)}e.activeClipUrl="url(#".concat(t,")");this.tgrp=null};e.prototype.clip=function(e){this.pendingClip=e};e.prototype.closePath=function(){var e=this.current;if(e.path){var t="".concat(e.path.getAttributeNS(null,"d"),"Z");e.path.setAttributeNS(null,"d",t)}};e.prototype.setLeading=function(e){this.current.leading=-e};e.prototype.setTextRise=function(e){this.current.textRise=e};e.prototype.setTextRenderingMode=function(e){this.current.textRenderingMode=e};e.prototype.setHScale=function(e){this.current.textHScale=e/100};e.prototype.setRenderingIntent=function(e){};e.prototype.setFlatness=function(e){};e.prototype.setGState=function(e){for(var t=0,r=e;t<r.length;t++){var a=r[t],i=a[0],o=a[1];switch(i){case"LW":this.setLineWidth(o);break;case"LC":this.setLineCap(o);break;case"LJ":this.setLineJoin(o);break;case"ML":this.setMiterLimit(o);break;case"D":this.setDash(o[0],o[1]);break;case"RI":this.setRenderingIntent(o);break;case"FL":this.setFlatness(o);break;case"Font":this.setFont(o);break;case"CA":this.setStrokeAlpha(o);break;case"ca":this.setFillAlpha(o);break;default:(0,n.warn)("Unimplemented graphic state operator ".concat(i));break}}};e.prototype.fill=function(){var e=this.current;if(e.element){e.element.setAttributeNS(null,"fill",e.fillColor);e.element.setAttributeNS(null,"fill-opacity",e.fillAlpha);this.endPath()}};e.prototype.stroke=function(){var e=this.current;if(e.element){this._setStrokeAttributes(e.element);e.element.setAttributeNS(null,"fill","none");this.endPath()}};e.prototype._setStrokeAttributes=function(e,t){if(t===void 0){t=1}var r=this.current;var n=r.dashArray;if(t!==1&&n.length>0){n=n.map((function(e){return t*e}))}e.setAttributeNS(null,"stroke",r.strokeColor);e.setAttributeNS(null,"stroke-opacity",r.strokeAlpha);e.setAttributeNS(null,"stroke-miterlimit",v(r.miterLimit));e.setAttributeNS(null,"stroke-linecap",r.lineCap);e.setAttributeNS(null,"stroke-linejoin",r.lineJoin);e.setAttributeNS(null,"stroke-width",v(t*r.lineWidth)+"px");e.setAttributeNS(null,"stroke-dasharray",n.map(v).join(" "));e.setAttributeNS(null,"stroke-dashoffset",v(t*r.dashPhase)+"px")};e.prototype.eoFill=function(){if(this.current.element){this.current.element.setAttributeNS(null,"fill-rule","evenodd")}this.fill()};e.prototype.fillStroke=function(){this.stroke();this.fill()};e.prototype.eoFillStroke=function(){if(this.current.element){this.current.element.setAttributeNS(null,"fill-rule","evenodd")}this.fillStroke()};e.prototype.closeStroke=function(){this.closePath();this.stroke()};e.prototype.closeFillStroke=function(){this.closePath();this.fillStroke()};e.prototype.closeEOFillStroke=function(){this.closePath();this.eoFillStroke()};e.prototype.paintSolidColorImageMask=function(){var e=this.svgFactory.createElement("svg:rect");e.setAttributeNS(null,"x","0");e.setAttributeNS(null,"y","0");e.setAttributeNS(null,"width","1px");e.setAttributeNS(null,"height","1px");e.setAttributeNS(null,"fill",this.current.fillColor);this._ensureTransformGroup().appendChild(e)};e.prototype.paintImageXObject=function(e){var t=e.startsWith("g_")?this.commonObjs.get(e):this.objs.get(e);if(!t){(0,n.warn)("Dependent image with object ID ".concat(e," is not ready yet"));return}this.paintInlineImageXObject(t)};e.prototype.paintInlineImageXObject=function(e,t){var r=e.width;var n=e.height;var a=h(e,this.forceDataSchema,!!t);var i=this.svgFactory.createElement("svg:rect");i.setAttributeNS(null,"x","0");i.setAttributeNS(null,"y","0");i.setAttributeNS(null,"width",v(r));i.setAttributeNS(null,"height",v(n));this.current.element=i;this.clip("nonzero");var o=this.svgFactory.createElement("svg:image");o.setAttributeNS(u,"xlink:href",a);o.setAttributeNS(null,"x","0");o.setAttributeNS(null,"y",v(-n));o.setAttributeNS(null,"width",v(r)+"px");o.setAttributeNS(null,"height",v(n)+"px");o.setAttributeNS(null,"transform","scale(".concat(v(1/r)," ").concat(v(-1/n),")"));if(t){t.appendChild(o)}else{this._ensureTransformGroup().appendChild(o)}};e.prototype.paintImageMaskXObject=function(e){var t=this.current;var r=e.width;var n=e.height;var a=t.fillColor;t.maskId="mask".concat(_++);var i=this.svgFactory.createElement("svg:mask");i.setAttributeNS(null,"id",t.maskId);var o=this.svgFactory.createElement("svg:rect");o.setAttributeNS(null,"x","0");o.setAttributeNS(null,"y","0");o.setAttributeNS(null,"width",v(r));o.setAttributeNS(null,"height",v(n));o.setAttributeNS(null,"fill",a);o.setAttributeNS(null,"mask","url(#".concat(t.maskId,")"));this.defs.appendChild(i);this._ensureTransformGroup().appendChild(o);this.paintInlineImageXObject(e,i)};e.prototype.paintFormXObjectBegin=function(e,t){if(Array.isArray(e)&&e.length===6){this.transform(e[0],e[1],e[2],e[3],e[4],e[5])}if(t){var r=t[2]-t[0];var n=t[3]-t[1];var a=this.svgFactory.createElement("svg:rect");a.setAttributeNS(null,"x",t[0]);a.setAttributeNS(null,"y",t[1]);a.setAttributeNS(null,"width",v(r));a.setAttributeNS(null,"height",v(n));this.current.element=a;this.clip("nonzero");this.endPath()}};e.prototype.paintFormXObjectEnd=function(){};e.prototype._initialize=function(e){var t=this.svgFactory.create(e.width,e.height);var r=this.svgFactory.createElement("svg:defs");t.appendChild(r);this.defs=r;var n=this.svgFactory.createElement("svg:g");n.setAttributeNS(null,"transform",g(e.transform));t.appendChild(n);this.svg=n;return t};e.prototype._ensureClipGroup=function(){if(!this.current.clipGroup){var e=this.svgFactory.createElement("svg:g");e.setAttributeNS(null,"clip-path",this.current.activeClipUrl);this.svg.appendChild(e);this.current.clipGroup=e}return this.current.clipGroup};e.prototype._ensureTransformGroup=function(){if(!this.tgrp){this.tgrp=this.svgFactory.createElement("svg:g");this.tgrp.setAttributeNS(null,"transform",g(this.transformMatrix));if(this.current.activeClipUrl){this._ensureClipGroup().appendChild(this.tgrp)}else{this.svg.appendChild(this.tgrp)}}return this.tgrp};return e}()}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.PDFNodeStream=void 0;var n=r(2);var a=r(24);var i=require$$5;var o=require$$5;var s=require$$5;var l=require$$5;var u=/^file:\/\/\/[a-zA-Z]:\//;function c(e){var t=l.parse(e);if(t.protocol==="file:"||t.host){return t}if(/^[a-z]:[/\\]/i.test(e)){return l.parse("file:///".concat(e))}if(!t.host){t.protocol="file:"}return t}var d=function(){function e(e){this.source=e;this.url=c(e.url);this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:";this.isFsUrl=this.url.protocol==="file:";this.httpHeaders=this.isHttp&&e.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}Object.defineProperty(e.prototype,"_progressiveDataLength",{get:function(){var e,t;return(t=(e=this._fullRequestReader)===null||e===void 0?void 0:e._loaded)!==null&&t!==void 0?t:0},enumerable:false,configurable:true});e.prototype.getFullReader=function(){(0,n.assert)(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once.");this._fullRequestReader=this.isFsUrl?new m(this):new v(this);return this._fullRequestReader};e.prototype.getRangeReader=function(e,t){if(t<=this._progressiveDataLength){return null}var r=this.isFsUrl?new _(this,e,t):new g(this,e,t);this._rangeRequestReaders.push(r);return r};e.prototype.cancelAllRequests=function(e){if(this._fullRequestReader){this._fullRequestReader.cancel(e)}for(var t=0,r=this._rangeRequestReaders.slice(0);t<r.length;t++){var n=r[t];n.cancel(e)}};return e}();t.PDFNodeStream=d;var h=function(){function e(e){this._url=e.url;this._done=false;this._storedError=null;this.onProgress=null;var t=e.source;this._contentLength=t.length;this._loaded=0;this._filename=null;this._disableRange=t.disableRange||false;this._rangeChunkSize=t.rangeChunkSize;if(!this._rangeChunkSize&&!this._disableRange){this._disableRange=true}this._isStreamingSupported=!t.disableStream;this._isRangeSupported=!t.disableRange;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();this._headersCapability=(0,n.createPromiseCapability)()}Object.defineProperty(e.prototype,"headersReady",{get:function(){return this._headersCapability.promise},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"filename",{get:function(){return this._filename},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLength",{get:function(){return this._contentLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRangeSupported",{get:function(){return this._isRangeSupported},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return this._isStreamingSupported},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this._readCapability.promise];case 1:r.sent();if(this._done){return[2,{value:undefined,done:true}]}if(this._storedError){throw this._storedError}e=this._readableStream.read();if(e===null){this._readCapability=(0,n.createPromiseCapability)();return[2,this.read()]}this._loaded+=e.length;if(this.onProgress){this.onProgress({loaded:this._loaded,total:this._contentLength})}t=new Uint8Array(e).buffer;return[2,{value:t,done:false}]}}))}))};e.prototype.cancel=function(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)};e.prototype._error=function(e){this._storedError=e;this._readCapability.resolve()};e.prototype._setReadableStream=function(e){var t=this;this._readableStream=e;e.on("readable",(function(){t._readCapability.resolve()}));e.on("end",(function(){e.destroy();t._done=true;t._readCapability.resolve()}));e.on("error",(function(e){t._error(e)}));if(!this._isStreamingSupported&&this._isRangeSupported){this._error(new n.AbortException("streaming is disabled"))}if(this._storedError){this._readableStream.destroy(this._storedError)}};return e}();var f=function(){function e(e){this._url=e.url;this._done=false;this._storedError=null;this.onProgress=null;this._loaded=0;this._readableStream=null;this._readCapability=(0,n.createPromiseCapability)();var t=e.source;this._isStreamingSupported=!t.disableStream}Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return this._isStreamingSupported},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this._readCapability.promise];case 1:r.sent();if(this._done){return[2,{value:undefined,done:true}]}if(this._storedError){throw this._storedError}e=this._readableStream.read();if(e===null){this._readCapability=(0,n.createPromiseCapability)();return[2,this.read()]}this._loaded+=e.length;if(this.onProgress){this.onProgress({loaded:this._loaded})}t=new Uint8Array(e).buffer;return[2,{value:t,done:false}]}}))}))};e.prototype.cancel=function(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)};e.prototype._error=function(e){this._storedError=e;this._readCapability.resolve()};e.prototype._setReadableStream=function(e){var t=this;this._readableStream=e;e.on("readable",(function(){t._readCapability.resolve()}));e.on("end",(function(){e.destroy();t._done=true;t._readCapability.resolve()}));e.on("error",(function(e){t._error(e)}));if(this._storedError){this._readableStream.destroy(this._storedError)}};return e}();function p(e,t){return{protocol:e.protocol,auth:e.auth,host:e.hostname,port:e.port,path:e.path,method:"GET",headers:t}}var v=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;var i=function(e){if(e.statusCode===404){var i=new n.MissingPDFException('Missing PDF "'.concat(r._url,'".'));r._storedError=i;r._headersCapability.reject(i);return}r._headersCapability.resolve();r._setReadableStream(e);var o=function(e){return r._readableStream.headers[e.toLowerCase()]};var s=(0,a.validateRangeRequestCapabilities)({getResponseHeader:o,isHttp:t.isHttp,rangeChunkSize:r._rangeChunkSize,disableRange:r._disableRange}),l=s.allowRangeRequests,u=s.suggestedLength;r._isRangeSupported=l;r._contentLength=u||r._contentLength;r._filename=(0,a.extractFilenameFromHeader)(o)};r._request=null;if(r._url.protocol==="http:"){r._request=o.request(p(r._url,t.httpHeaders),i)}else{r._request=s.request(p(r._url,t.httpHeaders),i)}r._request.on("error",(function(e){r._storedError=e;r._headersCapability.reject(e)}));r._request.end();return r}return t}(h);var g=function(e){__extends(t,e);function t(t,r,a){var i=e.call(this,t)||this;i._httpHeaders={};for(var l in t.httpHeaders){var u=t.httpHeaders[l];if(typeof u==="undefined"){continue}i._httpHeaders[l]=u}i._httpHeaders.Range="bytes=".concat(r,"-").concat(a-1);var c=function(e){if(e.statusCode===404){var t=new n.MissingPDFException('Missing PDF "'.concat(i._url,'".'));i._storedError=t;return}i._setReadableStream(e)};i._request=null;if(i._url.protocol==="http:"){i._request=o.request(p(i._url,i._httpHeaders),c)}else{i._request=s.request(p(i._url,i._httpHeaders),c)}i._request.on("error",(function(e){i._storedError=e}));i._request.end();return i}return t}(f);var m=function(e){__extends(t,e);function t(t){var r=e.call(this,t)||this;var a=decodeURIComponent(r._url.path);if(u.test(r._url.href)){a=a.replace(/^\//,"")}i.lstat(a,(function(e,t){if(e){if(e.code==="ENOENT"){e=new n.MissingPDFException('Missing PDF "'.concat(a,'".'))}r._storedError=e;r._headersCapability.reject(e);return}r._contentLength=t.size;r._setReadableStream(i.createReadStream(a));r._headersCapability.resolve()}));return r}return t}(h);var _=function(e){__extends(t,e);function t(t,r,n){var a=e.call(this,t)||this;var o=decodeURIComponent(a._url.path);if(u.test(a._url.href)){o=o.replace(/^\//,"")}a._setReadableStream(i.createReadStream(o,{start:r,end:n-1}));return a}return t}(f)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.createResponseStatusError=l;t.extractFilenameFromHeader=s;t.validateRangeRequestCapabilities=o;t.validateResponseStatus=u;var n=r(2);var a=r(25);var i=r(1);function o(e){var t=e.getResponseHeader,r=e.isHttp,a=e.rangeChunkSize,i=e.disableRange;(0,n.assert)(a>0,"Range chunk size must be larger than zero");var o={allowRangeRequests:false,suggestedLength:undefined};var s=parseInt(t("Content-Length"),10);if(!Number.isInteger(s)){return o}o.suggestedLength=s;if(s<=2*a){return o}if(i||!r){return o}if(t("Accept-Ranges")!=="bytes"){return o}var l=t("Content-Encoding")||"identity";if(l!=="identity"){return o}o.allowRangeRequests=true;return o}function s(e){var t=e("Content-Disposition");if(t){var r=(0,a.getFilenameFromContentDispositionHeader)(t);if(r.includes("%")){try{r=decodeURIComponent(r)}catch(e){}}if((0,i.isPdfFile)(r)){return r}}return null}function l(e,t){if(e===404||e===0&&t.startsWith("file:")){return new n.MissingPDFException('Missing PDF "'+t+'".')}return new n.UnexpectedResponseException("Unexpected server response (".concat(e,') while retrieving PDF "').concat(t,'".'),e)}function u(e){return e===200||e===206}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.getFilenameFromContentDispositionHeader=a;var n=r(2);function a(e){var t=true;var r=i("filename\\*","i").exec(e);if(r){r=r[1];var a=u(r);a=unescape(a);a=c(a);a=d(a);return s(a)}r=l(e);if(r){var a=d(r);return s(a)}r=i("filename","i").exec(e);if(r){r=r[1];var a=u(r);a=d(a);return s(a)}function i(e,t){return new RegExp("(?:^|;)\\s*"+e+"\\s*=\\s*"+"("+'[^";\\s][^;\\s]*'+"|"+'"(?:[^"\\\\]|\\\\"?)+"?'+")",t)}function o(e,r){if(e){if(!/^[\x00-\xFF]+$/.test(r)){return r}try{var a=new TextDecoder(e,{fatal:true});var i=(0,n.stringToBytes)(r);r=a.decode(i);t=false}catch(n){if(/^utf-?8$/i.test(e)){try{r=decodeURIComponent(escape(r));t=false}catch(e){}}}}return r}function s(e){if(t&&/[\x80-\xff]/.test(e)){e=o("utf-8",e);if(t){e=o("iso-8859-1",e)}}return e}function l(e){var t=[];var r;var n=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");while((r=n.exec(e))!==null){var a=r[1],o=r[2],s=r[3];a=parseInt(a,10);if(a in t){if(a===0){break}continue}t[a]=[o,s]}var l=[];for(var a=0;a<t.length;++a){if(!(a in t)){break}var d=t[a],o=d[0],s=d[1];s=u(s);if(o){s=unescape(s);if(a===0){s=c(s)}}l.push(s)}return l.join("")}function u(e){if(e.startsWith('"')){var t=e.slice(1).split('\\"');for(var r=0;r<t.length;++r){var n=t[r].indexOf('"');if(n!==-1){t[r]=t[r].slice(0,n);t.length=r+1}t[r]=t[r].replace(/\\(.)/g,"$1")}e=t.join('"')}return e}function c(e){var t=e.indexOf("'");if(t===-1){return e}var r=e.slice(0,t);var n=e.slice(t+1);var a=n.replace(/^[^']*'/,"");return o(r,a)}function d(e){if(!e.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(e)){return e}return e.replace(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,(function(e,t,r,n){if(r==="q"||r==="Q"){n=n.replace(/_/g," ");n=n.replace(/=([0-9a-fA-F]{2})/g,(function(e,t){return String.fromCharCode(parseInt(t,16))}));return o(t,n)}try{n=atob(n)}catch(e){}return o(t,n)}))}return""}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.PDFNetworkStream=void 0;var n=r(2);var a=r(24);var i=200;var o=206;function s(e){var t=e.response;if(typeof t!=="string"){return t}var r=(0,n.stringToBytes)(t);return r.buffer}var l=function(){function e(e,t){if(t===void 0){t={}}this.url=e;this.isHttp=/^https?:/i.test(e);this.httpHeaders=this.isHttp&&t.httpHeaders||Object.create(null);this.withCredentials=t.withCredentials||false;this.getXhr=t.getXhr||function e(){return new XMLHttpRequest};this.currXhrId=0;this.pendingRequests=Object.create(null)}e.prototype.requestRange=function(e,t,r){var n={begin:e,end:t};for(var a in r){n[a]=r[a]}return this.request(n)};e.prototype.requestFull=function(e){return this.request(e)};e.prototype.request=function(e){var t=this.getXhr();var r=this.currXhrId++;var n=this.pendingRequests[r]={xhr:t};t.open("GET",this.url);t.withCredentials=this.withCredentials;for(var a in this.httpHeaders){var s=this.httpHeaders[a];if(typeof s==="undefined"){continue}t.setRequestHeader(a,s)}if(this.isHttp&&"begin"in e&&"end"in e){t.setRequestHeader("Range","bytes=".concat(e.begin,"-").concat(e.end-1));n.expectedStatus=o}else{n.expectedStatus=i}t.responseType="arraybuffer";if(e.onError){t.onerror=function(r){e.onError(t.status)}}t.onreadystatechange=this.onStateChange.bind(this,r);t.onprogress=this.onProgress.bind(this,r);n.onHeadersReceived=e.onHeadersReceived;n.onDone=e.onDone;n.onError=e.onError;n.onProgress=e.onProgress;t.send(null);return r};e.prototype.onProgress=function(e,t){var r;var n=this.pendingRequests[e];if(!n){return}(r=n.onProgress)===null||r===void 0?void 0:r.call(n,t)};e.prototype.onStateChange=function(e,t){var r,n,a;var l=this.pendingRequests[e];if(!l){return}var u=l.xhr;if(u.readyState>=2&&l.onHeadersReceived){l.onHeadersReceived();delete l.onHeadersReceived}if(u.readyState!==4){return}if(!(e in this.pendingRequests)){return}delete this.pendingRequests[e];if(u.status===0&&this.isHttp){(r=l.onError)===null||r===void 0?void 0:r.call(l,u.status);return}var c=u.status||i;var d=c===i&&l.expectedStatus===o;if(!d&&c!==l.expectedStatus){(n=l.onError)===null||n===void 0?void 0:n.call(l,u.status);return}var h=s(u);if(c===o){var f=u.getResponseHeader("Content-Range");var p=/bytes (\d+)-(\d+)\/(\d+)/.exec(f);l.onDone({begin:parseInt(p[1],10),chunk:h})}else if(h){l.onDone({begin:0,chunk:h})}else{(a=l.onError)===null||a===void 0?void 0:a.call(l,u.status)}};e.prototype.getRequestXhr=function(e){return this.pendingRequests[e].xhr};e.prototype.isPendingRequest=function(e){return e in this.pendingRequests};e.prototype.abortRequest=function(e){var t=this.pendingRequests[e].xhr;delete this.pendingRequests[e];t.abort()};return e}();var u=function(){function e(e){this._source=e;this._manager=new l(e.url,{httpHeaders:e.httpHeaders,withCredentials:e.withCredentials});this._rangeChunkSize=e.rangeChunkSize;this._fullRequestReader=null;this._rangeRequestReaders=[]}e.prototype._onRangeRequestReaderClosed=function(e){var t=this._rangeRequestReaders.indexOf(e);if(t>=0){this._rangeRequestReaders.splice(t,1)}};e.prototype.getFullReader=function(){(0,n.assert)(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once.");this._fullRequestReader=new c(this._manager,this._source);return this._fullRequestReader};e.prototype.getRangeReader=function(e,t){var r=new d(this._manager,e,t);r.onClosed=this._onRangeRequestReaderClosed.bind(this);this._rangeRequestReaders.push(r);return r};e.prototype.cancelAllRequests=function(e){var t;(t=this._fullRequestReader)===null||t===void 0?void 0:t.cancel(e);for(var r=0,n=this._rangeRequestReaders.slice(0);r<n.length;r++){var a=n[r];a.cancel(e)}};return e}();t.PDFNetworkStream=u;var c=function(){function e(e,t){this._manager=e;var r={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url;this._fullRequestId=e.requestFull(r);this._headersReceivedCapability=(0,n.createPromiseCapability)();this._disableRange=t.disableRange||false;this._contentLength=t.length;this._rangeChunkSize=t.rangeChunkSize;if(!this._rangeChunkSize&&!this._disableRange){this._disableRange=true}this._isStreamingSupported=false;this._isRangeSupported=false;this._cachedChunks=[];this._requests=[];this._done=false;this._storedError=undefined;this._filename=null;this.onProgress=null}e.prototype._onHeadersReceived=function(){var e=this._fullRequestId;var t=this._manager.getRequestXhr(e);var r=function(e){return t.getResponseHeader(e)};var n=(0,a.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange}),i=n.allowRangeRequests,o=n.suggestedLength;if(i){this._isRangeSupported=true}this._contentLength=o||this._contentLength;this._filename=(0,a.extractFilenameFromHeader)(r);if(this._isRangeSupported){this._manager.abortRequest(e)}this._headersReceivedCapability.resolve()};e.prototype._onDone=function(e){if(e){if(this._requests.length>0){var t=this._requests.shift();t.resolve({value:e.chunk,done:false})}else{this._cachedChunks.push(e.chunk)}}this._done=true;if(this._cachedChunks.length>0){return}for(var r=0,n=this._requests;r<n.length;r++){var t=n[r];t.resolve({value:undefined,done:true})}this._requests.length=0};e.prototype._onError=function(e){this._storedError=(0,a.createResponseStatusError)(e,this._url);this._headersReceivedCapability.reject(this._storedError);for(var t=0,r=this._requests;t<r.length;t++){var n=r[t];n.reject(this._storedError)}this._requests.length=0;this._cachedChunks.length=0};e.prototype._onProgress=function(e){var t;(t=this.onProgress)===null||t===void 0?void 0:t.call(this,{loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})};Object.defineProperty(e.prototype,"filename",{get:function(){return this._filename},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRangeSupported",{get:function(){return this._isRangeSupported},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return this._isStreamingSupported},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLength",{get:function(){return this._contentLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"headersReady",{get:function(){return this._headersReceivedCapability.promise},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){if(this._storedError){throw this._storedError}if(this._cachedChunks.length>0){e=this._cachedChunks.shift();return[2,{value:e,done:false}]}if(this._done){return[2,{value:undefined,done:true}]}t=(0,n.createPromiseCapability)();this._requests.push(t);return[2,t.promise]}))}))};e.prototype.cancel=function(e){this._done=true;this._headersReceivedCapability.reject(e);for(var t=0,r=this._requests;t<r.length;t++){var n=r[t];n.resolve({value:undefined,done:true})}this._requests.length=0;if(this._manager.isPendingRequest(this._fullRequestId)){this._manager.abortRequest(this._fullRequestId)}this._fullRequestReader=null};return e}();var d=function(){function e(e,t,r){this._manager=e;var n={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url;this._requestId=e.requestRange(t,r,n);this._requests=[];this._queuedChunk=null;this._done=false;this._storedError=undefined;this.onProgress=null;this.onClosed=null}e.prototype._close=function(){var e;(e=this.onClosed)===null||e===void 0?void 0:e.call(this,this)};e.prototype._onDone=function(e){var t=e.chunk;if(this._requests.length>0){var r=this._requests.shift();r.resolve({value:t,done:false})}else{this._queuedChunk=t}this._done=true;for(var n=0,a=this._requests;n<a.length;n++){var r=a[n];r.resolve({value:undefined,done:true})}this._requests.length=0;this._close()};e.prototype._onError=function(e){this._storedError=(0,a.createResponseStatusError)(e,this._url);for(var t=0,r=this._requests;t<r.length;t++){var n=r[t];n.reject(this._storedError)}this._requests.length=0;this._queuedChunk=null};e.prototype._onProgress=function(e){var t;if(!this.isStreamingSupported){(t=this.onProgress)===null||t===void 0?void 0:t.call(this,{loaded:e.loaded})}};Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return false},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){if(this._storedError){throw this._storedError}if(this._queuedChunk!==null){e=this._queuedChunk;this._queuedChunk=null;return[2,{value:e,done:false}]}if(this._done){return[2,{value:undefined,done:true}]}t=(0,n.createPromiseCapability)();this._requests.push(t);return[2,t.promise]}))}))};e.prototype.cancel=function(e){this._done=true;for(var t=0,r=this._requests;t<r.length;t++){var n=r[t];n.resolve({value:undefined,done:true})}this._requests.length=0;if(this._manager.isPendingRequest(this._requestId)){this._manager.abortRequest(this._requestId)}this._close()};return e}()},function(e,t,r){Object.defineProperty(t,"__esModule",{value:true});t.PDFFetchStream=void 0;var n=r(2);var a=r(24);function i(e,t,r){return{method:"GET",headers:e,signal:r===null||r===void 0?void 0:r.signal,mode:"cors",credentials:t?"include":"same-origin",redirect:"follow"}}function o(e){var t=new Headers;for(var r in e){var n=e[r];if(typeof n==="undefined"){continue}t.append(r,n)}return t}var s=function(){function e(e){this.source=e;this.isHttp=/^https?:/i.test(e.url);this.httpHeaders=this.isHttp&&e.httpHeaders||{};this._fullRequestReader=null;this._rangeRequestReaders=[]}Object.defineProperty(e.prototype,"_progressiveDataLength",{get:function(){var e,t;return(t=(e=this._fullRequestReader)===null||e===void 0?void 0:e._loaded)!==null&&t!==void 0?t:0},enumerable:false,configurable:true});e.prototype.getFullReader=function(){(0,n.assert)(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once.");this._fullRequestReader=new l(this);return this._fullRequestReader};e.prototype.getRangeReader=function(e,t){if(t<=this._progressiveDataLength){return null}var r=new u(this,e,t);this._rangeRequestReaders.push(r);return r};e.prototype.cancelAllRequests=function(e){if(this._fullRequestReader){this._fullRequestReader.cancel(e)}for(var t=0,r=this._rangeRequestReaders.slice(0);t<r.length;t++){var n=r[t];n.cancel(e)}};return e}();t.PDFFetchStream=s;var l=function(){function e(e){var t=this;this._stream=e;this._reader=null;this._loaded=0;this._filename=null;var r=e.source;this._withCredentials=r.withCredentials||false;this._contentLength=r.length;this._headersCapability=(0,n.createPromiseCapability)();this._disableRange=r.disableRange||false;this._rangeChunkSize=r.rangeChunkSize;if(!this._rangeChunkSize&&!this._disableRange){this._disableRange=true}if(typeof AbortController!=="undefined"){this._abortController=new AbortController}this._isStreamingSupported=!r.disableStream;this._isRangeSupported=!r.disableRange;this._headers=o(this._stream.httpHeaders);var s=r.url;fetch(s,i(this._headers,this._withCredentials,this._abortController)).then((function(e){if(!(0,a.validateResponseStatus)(e.status)){throw(0,a.createResponseStatusError)(e.status,s)}t._reader=e.body.getReader();t._headersCapability.resolve();var r=function(t){return e.headers.get(t)};var i=(0,a.validateRangeRequestCapabilities)({getResponseHeader:r,isHttp:t._stream.isHttp,rangeChunkSize:t._rangeChunkSize,disableRange:t._disableRange}),o=i.allowRangeRequests,l=i.suggestedLength;t._isRangeSupported=o;t._contentLength=l||t._contentLength;t._filename=(0,a.extractFilenameFromHeader)(r);if(!t._isStreamingSupported&&t._isRangeSupported){t.cancel(new n.AbortException("Streaming is disabled."))}})).catch(this._headersCapability.reject);this.onProgress=null}Object.defineProperty(e.prototype,"headersReady",{get:function(){return this._headersCapability.promise},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"filename",{get:function(){return this._filename},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contentLength",{get:function(){return this._contentLength},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRangeSupported",{get:function(){return this._isRangeSupported},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return this._isStreamingSupported},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(a){switch(a.label){case 0:return[4,this._headersCapability.promise];case 1:a.sent();return[4,this._reader.read()];case 2:e=a.sent(),t=e.value,r=e.done;if(r){return[2,{value:t,done:r}]}this._loaded+=t.byteLength;if(this.onProgress){this.onProgress({loaded:this._loaded,total:this._contentLength})}n=new Uint8Array(t).buffer;return[2,{value:n,done:false}]}}))}))};e.prototype.cancel=function(e){if(this._reader){this._reader.cancel(e)}if(this._abortController){this._abortController.abort()}};return e}();var u=function(){function e(e,t,r){var s=this;this._stream=e;this._reader=null;this._loaded=0;var l=e.source;this._withCredentials=l.withCredentials||false;this._readCapability=(0,n.createPromiseCapability)();this._isStreamingSupported=!l.disableStream;if(typeof AbortController!=="undefined"){this._abortController=new AbortController}this._headers=o(this._stream.httpHeaders);this._headers.append("Range","bytes=".concat(t,"-").concat(r-1));var u=l.url;fetch(u,i(this._headers,this._withCredentials,this._abortController)).then((function(e){if(!(0,a.validateResponseStatus)(e.status)){throw(0,a.createResponseStatusError)(e.status,u)}s._readCapability.resolve();s._reader=e.body.getReader()})).catch(this._readCapability.reject);this.onProgress=null}Object.defineProperty(e.prototype,"isStreamingSupported",{get:function(){return this._isStreamingSupported},enumerable:false,configurable:true});e.prototype.read=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(a){switch(a.label){case 0:return[4,this._readCapability.promise];case 1:a.sent();return[4,this._reader.read()];case 2:e=a.sent(),t=e.value,r=e.done;if(r){return[2,{value:t,done:r}]}this._loaded+=t.byteLength;if(this.onProgress){this.onProgress({loaded:this._loaded})}n=new Uint8Array(t).buffer;return[2,{value:n,done:false}]}}))}))};e.prototype.cancel=function(e){if(this._reader){this._reader.cancel(e)}if(this._abortController){this._abortController.abort()}};return e}()}];var __webpack_module_cache__={};function __w_pdfjs_require__(e){var t=__webpack_module_cache__[e];if(t!==undefined){return t.exports}var r=__webpack_module_cache__[e]={exports:{}};__webpack_modules__[e](r,r.exports,__w_pdfjs_require__);return r.exports}var __webpack_exports__={};(function(){var e=__webpack_exports__;Object.defineProperty(e,"__esModule",{value:true});Object.defineProperty(e,"AnnotationLayer",{enumerable:true,get:function(){return a.AnnotationLayer}});Object.defineProperty(e,"AnnotationMode",{enumerable:true,get:function(){return r.AnnotationMode}});Object.defineProperty(e,"CMapCompressionType",{enumerable:true,get:function(){return r.CMapCompressionType}});Object.defineProperty(e,"GlobalWorkerOptions",{enumerable:true,get:function(){return i.GlobalWorkerOptions}});Object.defineProperty(e,"InvalidPDFException",{enumerable:true,get:function(){return r.InvalidPDFException}});Object.defineProperty(e,"LinkTarget",{enumerable:true,get:function(){return t.LinkTarget}});Object.defineProperty(e,"LoopbackPort",{enumerable:true,get:function(){return n.LoopbackPort}});Object.defineProperty(e,"MissingPDFException",{enumerable:true,get:function(){return r.MissingPDFException}});Object.defineProperty(e,"OPS",{enumerable:true,get:function(){return r.OPS}});Object.defineProperty(e,"PDFDataRangeTransport",{enumerable:true,get:function(){return n.PDFDataRangeTransport}});Object.defineProperty(e,"PDFDateString",{enumerable:true,get:function(){return t.PDFDateString}});Object.defineProperty(e,"PDFWorker",{enumerable:true,get:function(){return n.PDFWorker}});Object.defineProperty(e,"PasswordResponses",{enumerable:true,get:function(){return r.PasswordResponses}});Object.defineProperty(e,"PermissionFlag",{enumerable:true,get:function(){return r.PermissionFlag}});Object.defineProperty(e,"PixelsPerInch",{enumerable:true,get:function(){return t.PixelsPerInch}});Object.defineProperty(e,"RenderingCancelledException",{enumerable:true,get:function(){return t.RenderingCancelledException}});Object.defineProperty(e,"SVGGraphics",{enumerable:true,get:function(){return l.SVGGraphics}});Object.defineProperty(e,"UNSUPPORTED_FEATURES",{enumerable:true,get:function(){return r.UNSUPPORTED_FEATURES}});Object.defineProperty(e,"UnexpectedResponseException",{enumerable:true,get:function(){return r.UnexpectedResponseException}});Object.defineProperty(e,"Util",{enumerable:true,get:function(){return r.Util}});Object.defineProperty(e,"VerbosityLevel",{enumerable:true,get:function(){return r.VerbosityLevel}});Object.defineProperty(e,"XfaLayer",{enumerable:true,get:function(){return u.XfaLayer}});Object.defineProperty(e,"addLinkAttributes",{enumerable:true,get:function(){return t.addLinkAttributes}});Object.defineProperty(e,"build",{enumerable:true,get:function(){return n.build}});Object.defineProperty(e,"createObjectURL",{enumerable:true,get:function(){return r.createObjectURL}});Object.defineProperty(e,"createPromiseCapability",{enumerable:true,get:function(){return r.createPromiseCapability}});Object.defineProperty(e,"createValidAbsoluteUrl",{enumerable:true,get:function(){return r.createValidAbsoluteUrl}});Object.defineProperty(e,"getDocument",{enumerable:true,get:function(){return n.getDocument}});Object.defineProperty(e,"getFilenameFromUrl",{enumerable:true,get:function(){return t.getFilenameFromUrl}});Object.defineProperty(e,"getPdfFilenameFromUrl",{enumerable:true,get:function(){return t.getPdfFilenameFromUrl}});Object.defineProperty(e,"getXfaPageViewport",{enumerable:true,get:function(){return t.getXfaPageViewport}});Object.defineProperty(e,"isPdfFile",{enumerable:true,get:function(){return t.isPdfFile}});Object.defineProperty(e,"loadScript",{enumerable:true,get:function(){return t.loadScript}});Object.defineProperty(e,"removeNullCharacters",{enumerable:true,get:function(){return r.removeNullCharacters}});Object.defineProperty(e,"renderTextLayer",{enumerable:true,get:function(){return s.renderTextLayer}});Object.defineProperty(e,"shadow",{enumerable:true,get:function(){return r.shadow}});Object.defineProperty(e,"version",{enumerable:true,get:function(){return n.version}});var t=__w_pdfjs_require__(1);var r=__w_pdfjs_require__(2);var n=__w_pdfjs_require__(6);var a=__w_pdfjs_require__(18);var i=__w_pdfjs_require__(12);var o=__w_pdfjs_require__(4);var s=__w_pdfjs_require__(21);var l=__w_pdfjs_require__(22);var u=__w_pdfjs_require__(20);var c="2.12.313";var d="a2ae56f39";{if(o.isNodeJS){var h=__w_pdfjs_require__(23).PDFNodeStream;(0,n.setPDFNetworkStreamFactory)((function(e){return new h(e)}))}else{var f=__w_pdfjs_require__(26).PDFNetworkStream;var p=__w_pdfjs_require__(27).PDFFetchStream;(0,n.setPDFNetworkStreamFactory)((function(e){if((0,t.isValidFetchUrl)(e.url)){return new p(e)}return new f(e)}))}}})();return __webpack_exports__}()}))}));var pdf$1=getDefaultExportFromCjs(pdf);function format(e,t,r){return(e||"")+(t?" ".concat(t):"")+(r?" ".concat(r):"")}var integerSequence=function(e,t){return Array(t).fill(1).map((function(t,r){return r+e}))};var verdocsViewCss='verdocs-view{font-family:"Barlow", sans-serif;display:-ms-flexbox;display:flex;background:#ccc;min-height:600px;position:relative;padding:0 0 20px 0;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-view button.test{color:#fff;cursor:pointer;padding:5px 10px;border-radius:4px;background:#5a5767;border:1px solid #ccc}verdocs-view .load-progress{position:absolute;top:0;left:0;right:0;height:6px;z-index:2000;background:#000}verdocs-view .load-progress .bar{height:6px;background:#50be80}#verdocs-pdf-viewer-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}#verdocs-pdf-viewer-container canvas{background:white;max-width:100%;margin:15px 0 0 0}';var CANVAS_MARGIN=15;var PDF_WORKER_URL="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(pdf.version,"/pdf.worker.min.js");var CMAPS_URL="https://unpkg.com/pdfjs-dist@".concat(pdf.version,"/cmaps/");console.log("[VIEW] Loading PDF-JS",{PDF_WORKER_URL:PDF_WORKER_URL,CMAPS_URL:CMAPS_URL});pdf$1.GlobalWorkerOptions.workerSrc=PDF_WORKER_URL;var VerdocsView=exports("verdocs_view",function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered",7);this.pageLoaded=createEvent(this,"pageLoaded",7);this.pageChange=createEvent(this,"pageChange",7);this.pageInit=createEvent(this,"pageInit",7);this.scaleChange=createEvent(this,"scaleChange",7);this.documentRendered=createEvent(this,"documentRendered",7);this.numPages=1;this.fingerprint=null;this.rotation=0;this.token=null;this.loadProgress=0;this.pagesRendered=[]}e.prototype.doSrc=function(e,t){if(e===t){return}this.loadAndRender(e)};e.prototype.isRotated=function(e){return e!==0&&e%180!==0};e.prototype.renderPages=function(){var e,t;return __awaiter(this,void 0,void 0,(function(){var r,n,a,i,o,s,l,u,c,d,h,f,p,v,g,m,_,y,b,A,S,x,C,P;return __generator(this,(function(w){switch(w.label){case 0:r=integerSequence(1,this.numPages);w.label=1;case 1:w.trys.push([1,8,9,14]);n=__asyncValues(r);w.label=2;case 2:return[4,n.next()];case 3:if(!(a=w.sent(),!a.done))return[3,7];i=a.value;o=i-1;console.log("[VIEW] Rendering page",i);return[4,this.pdfDocument.getPage(i)];case 4:s=w.sent();l=s.view,u=l[0],c=l[1],d=l[2],h=l[3];f=s.rotate;p=s.getViewport({scale:1/.75});v=document.createElement("canvas");g=v.getContext("2d");v.height=p.height;v.width=p.width;return[4,s.render({canvasContext:g,viewport:p})];case 5:w.sent();this.pdfContainer.appendChild(v);m=v.width;_=v.height;y=d-u;b=h-c;this.pagesRendered.sort((function(e,t){return e.pageNumber-t.pageNumber}));A=this.pagesRendered.filter((function(e){return e.pageNumber<i})).pop();S=((A===null||A===void 0?void 0:A.canvasBottom)||0)+CANVAS_MARGIN;x={pageNumber:i,width:m,height:_,originalWidth:this.isRotated(f)?b:y,originalHeight:this.isRotated(f)?y:b,xRatio:m/y,yRatio:_/b,canvasTop:S,canvasLeft:CANVAS_MARGIN,canvasRight:CANVAS_MARGIN+m,canvasBottom:S+_};if(this.pagesRendered[o]){this.pagesRendered[o]=x}else{this.pagesRendered.push(x)}C={pages:this.pagesRendered,numPages:this.numPages,numRendered:this.pagesRendered.length,canvasContainer:this.pdfContainer};this.pageRendered.emit(C);if(i>=this.numPages){console.log("[VIEW] Done rendering");this.pagesRendered.sort((function(e,t){return e.pageNumber-t.pageNumber}));this.documentRendered.emit(C)}w.label=6;case 6:return[3,2];case 7:return[3,14];case 8:P=w.sent();e={error:P};return[3,14];case 9:w.trys.push([9,,12,13]);if(!(a&&!a.done&&(t=n.return)))return[3,11];return[4,t.call(n)];case 10:w.sent();w.label=11;case 11:return[3,13];case 12:if(e)throw e.error;return[7];case 13:return[7];case 14:return[2]}}))}))};e.prototype.componentDidLoad=function(){this.pdfContainer=document.getElementById("verdocs-pdf-viewer-container");if(this.source){this.loadAndRender(this.source)}};e.prototype.onProgress=function(e){this.loadProgress=Math.floor(100*e.loaded/e.total)};e.prototype.loadAndRender=function(e){var t=this;console.log("[VIEW] Loading",e);var r=this.token?{Authorization:"Bearer ".concat(this.token)}:{};var n={url:e,withCredentials:true,cMapUrl:CMAPS_URL,cMapPacked:true,verbosity:pdf.VerbosityLevel.WARNINGS,httpHeaders:r};var a=pdf$1.getDocument(n,null,null,this.onProgress);a.onProgress=this.onProgress;a.promise.then((function(e){t.loadProgress=100;t.numPages=e.numPages;t.fingerprint=e.fingerprints[0];console.log('[VIEW] Got PDF document fingerprint "'.concat(t.fingerprint,", ").concat(t.numPages," pages"),e);t.pdfDocument=e;t.renderPages().catch((function(e){return console.log("Rendering error",e)}))}))};e.prototype.render=function(){return h("div",{class:"container"},this.loadProgress<100?h("verdocs-loader",null):h("div",{style:{display:"none"}}),h("div",{id:"verdocs-pdf-viewer-container"}))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{source:["doSrc"]}},enumerable:false,configurable:true});return e}());VerdocsView.style=verdocsViewCss}}}));
|